summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2018-02-15 14:18:00 +0100
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2018-02-15 14:00:37 +0000
commit66a2147d838e293f4a5db7711c8eba4e6faaaf0f (patch)
tree61ad99912355f5b6cc603d9b1dfadd77b950ce98
parentda51f56cc21233c2d30f0fe0d171727c3102b2e0 (diff)
BASELINE: Update Chromium to 65.0.3325.75
Change-Id: I5485bc5c111539356276457516584fa5737f07d8 Reviewed-by: Peter Varga <pvarga@inf.u-szeged.hu>
-rw-r--r--chromium/DEPS28
-rw-r--r--chromium/base/i18n/icu_util.cc6
-rw-r--r--chromium/base/memory/shared_memory.h2
-rw-r--r--chromium/base/memory/shared_memory_android.cc27
-rw-r--r--chromium/base/memory/shared_memory_handle.h20
-rw-r--r--chromium/base/memory/shared_memory_handle_android.cc52
-rw-r--r--chromium/base/memory/shared_memory_posix.cc20
-rw-r--r--chromium/base/memory/shared_memory_unittest.cc114
-rw-r--r--chromium/base/metrics/field_trial.cc21
-rw-r--r--chromium/base/metrics/field_trial.h1
-rw-r--r--chromium/base/metrics/field_trial_unittest.cc25
-rw-r--r--chromium/base/test/BUILD.gn2
-rw-r--r--chromium/build/config/android/internal_rules.gni4
-rw-r--r--chromium/build/util/LASTCHANGE2
-rw-r--r--chromium/cc/scheduler/scheduler_state_machine.h2
-rw-r--r--chromium/cc/scheduler/scheduler_state_machine_unittest.cc1
-rw-r--r--chromium/cc/scheduler/scheduler_unittest.cc16
-rw-r--r--chromium/cc/trees/layer_tree_host_impl.cc9
-rw-r--r--chromium/cc/trees/layer_tree_host_impl.h2
-rw-r--r--chromium/cc/trees/layer_tree_host_unittest.cc38
-rw-r--r--chromium/chrome/VERSION2
-rw-r--r--chromium/chrome/app/resources/chromium_strings_ar.xtb2
-rw-r--r--chromium/chrome/app/resources/chromium_strings_bg.xtb1
-rw-r--r--chromium/chrome/app/resources/chromium_strings_bn.xtb1
-rw-r--r--chromium/chrome/app/resources/chromium_strings_ca.xtb1
-rw-r--r--chromium/chrome/app/resources/chromium_strings_cs.xtb1
-rw-r--r--chromium/chrome/app/resources/chromium_strings_da.xtb1
-rw-r--r--chromium/chrome/app/resources/chromium_strings_el.xtb1
-rw-r--r--chromium/chrome/app/resources/chromium_strings_es-419.xtb1
-rw-r--r--chromium/chrome/app/resources/chromium_strings_et.xtb1
-rw-r--r--chromium/chrome/app/resources/chromium_strings_fil.xtb1
-rw-r--r--chromium/chrome/app/resources/chromium_strings_gu.xtb1
-rw-r--r--chromium/chrome/app/resources/chromium_strings_hi.xtb2
-rw-r--r--chromium/chrome/app/resources/chromium_strings_hu.xtb1
-rw-r--r--chromium/chrome/app/resources/chromium_strings_iw.xtb1
-rw-r--r--chromium/chrome/app/resources/chromium_strings_kn.xtb1
-rw-r--r--chromium/chrome/app/resources/chromium_strings_ko.xtb1
-rw-r--r--chromium/chrome/app/resources/chromium_strings_lt.xtb1
-rw-r--r--chromium/chrome/app/resources/chromium_strings_lv.xtb1
-rw-r--r--chromium/chrome/app/resources/chromium_strings_ml.xtb1
-rw-r--r--chromium/chrome/app/resources/chromium_strings_mr.xtb1
-rw-r--r--chromium/chrome/app/resources/chromium_strings_nl.xtb1
-rw-r--r--chromium/chrome/app/resources/chromium_strings_no.xtb2
-rw-r--r--chromium/chrome/app/resources/chromium_strings_ro.xtb1
-rw-r--r--chromium/chrome/app/resources/chromium_strings_ru.xtb1
-rw-r--r--chromium/chrome/app/resources/chromium_strings_sl.xtb1
-rw-r--r--chromium/chrome/app/resources/chromium_strings_sr.xtb1
-rw-r--r--chromium/chrome/app/resources/chromium_strings_sv.xtb1
-rw-r--r--chromium/chrome/app/resources/chromium_strings_te.xtb1
-rw-r--r--chromium/chrome/app/resources/chromium_strings_th.xtb1
-rw-r--r--chromium/chrome/app/resources/chromium_strings_tr.xtb1
-rw-r--r--chromium/chrome/app/resources/chromium_strings_vi.xtb2
-rw-r--r--chromium/chrome/app/resources/chromium_strings_zh-TW.xtb1
-rw-r--r--chromium/chrome/app/resources/generated_resources_de.xtb2
-rw-r--r--chromium/chrome/app/resources/generated_resources_es-419.xtb2
-rw-r--r--chromium/chrome/app/resources/generated_resources_fr.xtb2
-rw-r--r--chromium/chrome/app/resources/generated_resources_id.xtb2
-rw-r--r--chromium/chrome/app/resources/generated_resources_mr.xtb14
-rw-r--r--chromium/chrome/app/resources/generated_resources_no.xtb47
-rw-r--r--chromium/chrome/app/resources/generated_resources_pl.xtb2
-rw-r--r--chromium/chrome/app/resources/generated_resources_pt-BR.xtb2
-rw-r--r--chromium/chrome/app/resources/generated_resources_sw.xtb2
-rw-r--r--chromium/chrome/app/resources/generated_resources_zh-TW.xtb12
-rw-r--r--chromium/chrome/app/resources/google_chrome_strings_ar.xtb2
-rw-r--r--chromium/chrome/app/resources/google_chrome_strings_bg.xtb1
-rw-r--r--chromium/chrome/app/resources/google_chrome_strings_bn.xtb1
-rw-r--r--chromium/chrome/app/resources/google_chrome_strings_ca.xtb1
-rw-r--r--chromium/chrome/app/resources/google_chrome_strings_cs.xtb1
-rw-r--r--chromium/chrome/app/resources/google_chrome_strings_da.xtb1
-rw-r--r--chromium/chrome/app/resources/google_chrome_strings_de.xtb6
-rw-r--r--chromium/chrome/app/resources/google_chrome_strings_el.xtb1
-rw-r--r--chromium/chrome/app/resources/google_chrome_strings_es-419.xtb1
-rw-r--r--chromium/chrome/app/resources/google_chrome_strings_et.xtb1
-rw-r--r--chromium/chrome/app/resources/google_chrome_strings_fil.xtb1
-rw-r--r--chromium/chrome/app/resources/google_chrome_strings_gu.xtb1
-rw-r--r--chromium/chrome/app/resources/google_chrome_strings_hi.xtb2
-rw-r--r--chromium/chrome/app/resources/google_chrome_strings_hu.xtb1
-rw-r--r--chromium/chrome/app/resources/google_chrome_strings_iw.xtb1
-rw-r--r--chromium/chrome/app/resources/google_chrome_strings_kn.xtb1
-rw-r--r--chromium/chrome/app/resources/google_chrome_strings_ko.xtb1
-rw-r--r--chromium/chrome/app/resources/google_chrome_strings_lt.xtb1
-rw-r--r--chromium/chrome/app/resources/google_chrome_strings_lv.xtb1
-rw-r--r--chromium/chrome/app/resources/google_chrome_strings_ml.xtb1
-rw-r--r--chromium/chrome/app/resources/google_chrome_strings_mr.xtb1
-rw-r--r--chromium/chrome/app/resources/google_chrome_strings_nl.xtb1
-rw-r--r--chromium/chrome/app/resources/google_chrome_strings_no.xtb2
-rw-r--r--chromium/chrome/app/resources/google_chrome_strings_ro.xtb1
-rw-r--r--chromium/chrome/app/resources/google_chrome_strings_ru.xtb1
-rw-r--r--chromium/chrome/app/resources/google_chrome_strings_sl.xtb1
-rw-r--r--chromium/chrome/app/resources/google_chrome_strings_sr.xtb1
-rw-r--r--chromium/chrome/app/resources/google_chrome_strings_sv.xtb1
-rw-r--r--chromium/chrome/app/resources/google_chrome_strings_te.xtb1
-rw-r--r--chromium/chrome/app/resources/google_chrome_strings_th.xtb1
-rw-r--r--chromium/chrome/app/resources/google_chrome_strings_tr.xtb1
-rw-r--r--chromium/chrome/app/resources/google_chrome_strings_vi.xtb2
-rw-r--r--chromium/chrome/app/resources/google_chrome_strings_zh-TW.xtb1
-rw-r--r--chromium/chrome/browser/BUILD.gn7
-rw-r--r--chromium/chrome/browser/browser_resources.grd30
-rw-r--r--chromium/chrome/browser/extensions/BUILD.gn2
-rw-r--r--chromium/chrome/browser/extensions/api/preference/preference_apitest.cc50
-rw-r--r--chromium/chrome/browser/extensions/api/preference/preference_helpers.cc30
-rw-r--r--chromium/chrome/browser/resources/chromeos/bluetooth_pairing_dialog/BUILD.gn12
-rw-r--r--chromium/chrome/browser/resources/chromeos/bluetooth_pairing_dialog/compiled_resources2.gyp19
-rw-r--r--chromium/chrome/browser/resources/chromeos/compiled_resources2.gyp43
-rw-r--r--chromium/chrome/browser/resources/chromeos/internet_config_dialog/BUILD.gn12
-rw-r--r--chromium/chrome/browser/resources/chromeos/internet_config_dialog/compiled_resources2.gyp22
-rw-r--r--chromium/chrome/browser/resources/chromeos/internet_detail_dialog/BUILD.gn12
-rw-r--r--chromium/chrome/browser/resources/chromeos/internet_detail_dialog/compiled_resources2.gyp20
-rw-r--r--chromium/chrome/browser/resources/chromeos/zip_archiver/manifest.json3
-rw-r--r--chromium/chrome/browser/resources/feedback/js/feedback.js3
-rw-r--r--chromium/chrome/browser/resources/print_preview/data/destination_match.js9
-rw-r--r--chromium/chrome/browser/resources/print_preview/data/destination_store.js22
-rw-r--r--chromium/chrome/browser/resources/settings/about_page/about_page.js2
-rw-r--r--chromium/chrome/browser/resources/settings/android_apps_page/android_apps_subpage.js24
-rw-r--r--chromium/chrome/browser/resources/settings/bluetooth_page/bluetooth_page.html6
-rw-r--r--chromium/chrome/browser/resources/settings/bluetooth_page/bluetooth_page.js34
-rw-r--r--chromium/chrome/browser/resources/settings/bluetooth_page/bluetooth_subpage.html2
-rw-r--r--chromium/chrome/browser/resources/settings/bluetooth_page/bluetooth_subpage.js14
-rw-r--r--chromium/chrome/browser/resources/settings/controls/settings_dropdown_menu.html5
-rw-r--r--chromium/chrome/browser/resources/settings/date_time_page/date_time_page.html3
-rw-r--r--chromium/chrome/browser/resources/settings/date_time_page/timezone_selector.html5
-rw-r--r--chromium/chrome/browser/resources/settings/date_time_page/timezone_subpage.html7
-rw-r--r--chromium/chrome/browser/resources/settings/icons.html6
-rw-r--r--chromium/chrome/browser/resources/settings/internet_page/network_proxy_section.js10
-rw-r--r--chromium/chrome/browser/resources/settings/lifetime_browser_proxy.js2
-rw-r--r--chromium/chrome/browser/resources/settings/reset_page/compiled_resources2.gyp8
-rw-r--r--chromium/chrome/browser/resources/settings/reset_page/powerwash_dialog.js5
-rw-r--r--chromium/chrome/browser/resources/settings/settings_menu/settings_menu.html2
-rw-r--r--chromium/chrome/browser/ui/webui/chromeos/bluetooth_pairing_dialog.cc8
-rw-r--r--chromium/chrome/browser/ui/webui/chromeos/internet_config_dialog.cc6
-rw-r--r--chromium/chrome/browser/ui/webui/chromeos/internet_detail_dialog.cc7
-rw-r--r--chromium/chrome/browser/ui/webui/chromeos/login/encryption_migration_screen_handler.cc4
-rw-r--r--chromium/chrome/browser/ui/webui/chromeos/network_element_localized_strings_provider.cc2
-rw-r--r--chromium/chrome/browser/ui/webui/settings/browser_lifetime_handler.cc6
-rw-r--r--chromium/chrome/browser/ui/webui/settings/md_settings_localized_strings_provider.cc5
-rw-r--r--chromium/chrome/common/custom_handlers/OWNERS1
-rw-r--r--chromium/chrome/common/custom_handlers/protocol_handler.cc88
-rw-r--r--chromium/chrome/common/custom_handlers/protocol_handler.h73
-rw-r--r--chromium/chrome/common/extensions/api/accessibility_private.json58
-rw-r--r--chromium/chrome/common/features.gni5
-rw-r--r--chromium/chrome/common/url_constants.cc5
-rw-r--r--chromium/chrome/common/url_constants.h5
-rw-r--r--chromium/chrome/renderer/resources/extensions/media_router_bindings.js36
-rw-r--r--chromium/components/arc/video_accelerator/gpu_arc_video_decode_accelerator.cc2
-rw-r--r--chromium/components/autofill/content/renderer/page_passwords_analyser.cc3
-rw-r--r--chromium/components/data_use_measurement/core/data_use_ascriber.h1
-rw-r--r--chromium/components/exo/client_controlled_shell_surface.cc20
-rw-r--r--chromium/components/exo/client_controlled_shell_surface.h2
-rw-r--r--chromium/components/exo/client_controlled_shell_surface_unittest.cc47
-rw-r--r--chromium/components/exo/pointer.cc18
-rw-r--r--chromium/components/exo/shell_surface.cc7
-rw-r--r--chromium/components/exo/shell_surface.h3
-rw-r--r--chromium/components/exo/shell_surface_base.cc13
-rw-r--r--chromium/components/exo/shell_surface_base.h5
-rw-r--r--chromium/components/exo/sub_surface.cc4
-rw-r--r--chromium/components/exo/sub_surface.h2
-rw-r--r--chromium/components/exo/surface.cc9
-rw-r--r--chromium/components/exo/surface.h4
-rw-r--r--chromium/components/exo/surface_delegate.h6
-rw-r--r--chromium/components/exo/surface_tree_host.cc6
-rw-r--r--chromium/components/exo/surface_tree_host.h6
-rw-r--r--chromium/components/exo/wayland/server.cc4
-rw-r--r--chromium/components/ntp_snippets/remote/remote_suggestions_fetcher_impl.cc16
-rw-r--r--chromium/components/ntp_snippets/remote/remote_suggestions_fetcher_impl.h9
-rw-r--r--chromium/components/ntp_snippets/remote/remote_suggestions_fetcher_impl_unittest.cc36
-rw-r--r--chromium/components/password_manager/core/browser/password_syncable_service.cc406
-rw-r--r--chromium/components/password_manager/core/browser/password_syncable_service.h29
-rw-r--r--chromium/components/password_manager/core/browser/password_syncable_service_unittest.cc567
-rw-r--r--chromium/components/safe_browsing/proto/csd.proto15
-rw-r--r--chromium/components/strings/components_strings_mr.xtb2
-rw-r--r--chromium/components/strings/components_strings_no.xtb2
-rw-r--r--chromium/components/viz/service/display/gl_renderer.cc4
-rw-r--r--chromium/content/app/strings/translations/content_strings_mr.xtb4
-rw-r--r--chromium/content/app/strings/translations/content_strings_no.xtb3
-rw-r--r--chromium/content/browser/accessibility/fullscreen_browsertest.cc34
-rw-r--r--chromium/content/browser/blob_storage/blob_dispatcher_host.cc23
-rw-r--r--chromium/content/browser/blob_storage/blob_storage_browsertest.cc64
-rw-r--r--chromium/content/browser/browser_side_navigation_browsertest.cc49
-rw-r--r--chromium/content/browser/device_sensors/device_sensor_browsertest.cc21
-rw-r--r--chromium/content/browser/frame_host/cross_process_frame_connector.cc60
-rw-r--r--chromium/content/browser/frame_host/cross_process_frame_connector.h17
-rw-r--r--chromium/content/browser/frame_host/navigation_request.cc11
-rw-r--r--chromium/content/browser/frame_host/navigation_request.h5
-rw-r--r--chromium/content/browser/frame_host/render_frame_host_impl.cc50
-rw-r--r--chromium/content/browser/frame_host/render_frame_host_manager.cc16
-rw-r--r--chromium/content/browser/frame_host/render_widget_host_view_guest.cc5
-rw-r--r--chromium/content/browser/generic_sensor_browsertest.cc20
-rw-r--r--chromium/content/browser/isolated_origin_browsertest.cc71
-rw-r--r--chromium/content/browser/loader/cross_site_document_blocking_browsertest.cc319
-rw-r--r--chromium/content/browser/loader/cross_site_document_resource_handler.cc35
-rw-r--r--chromium/content/browser/loader/cross_site_document_resource_handler.h15
-rw-r--r--chromium/content/browser/loader/navigation_url_loader_network_service.cc20
-rw-r--r--chromium/content/browser/renderer_host/dwrite_font_proxy_message_filter_win.cc6
-rw-r--r--chromium/content/browser/renderer_host/frame_connector_delegate.cc63
-rw-r--r--chromium/content/browser/renderer_host/frame_connector_delegate.h46
-rw-r--r--chromium/content/browser/renderer_host/render_process_host_impl.cc7
-rw-r--r--chromium/content/browser/renderer_host/render_widget_host_view_child_frame.cc20
-rw-r--r--chromium/content/browser/renderer_host/render_widget_host_view_child_frame_unittest.cc52
-rw-r--r--chromium/content/browser/service_worker/embedded_worker_test_helper.cc1
-rw-r--r--chromium/content/browser/service_worker/service_worker_handle.cc1
-rw-r--r--chromium/content/browser/service_worker/service_worker_provider_host.cc21
-rw-r--r--chromium/content/browser/service_worker/service_worker_provider_host.h2
-rw-r--r--chromium/content/browser/site_per_process_browsertest.cc316
-rw-r--r--chromium/content/browser/top_document_isolation_browsertest.cc14
-rw-r--r--chromium/content/common/frame.mojom7
-rw-r--r--chromium/content/common/frame_messages.h5
-rw-r--r--chromium/content/common/renderer.mojom5
-rw-r--r--chromium/content/public/common/content_features.cc2
-rw-r--r--chromium/content/renderer/device_sensors/fake_sensor_and_provider.cc19
-rw-r--r--chromium/content/renderer/device_sensors/fake_sensor_and_provider.h1
-rw-r--r--chromium/content/renderer/loader/site_isolation_stats_gatherer_browsertest.cc4
-rw-r--r--chromium/content/renderer/media_capture_from_element/canvas_capture_handler.cc1
-rw-r--r--chromium/content/renderer/pepper/video_decoder_shim.cc104
-rw-r--r--chromium/content/renderer/render_frame_impl.cc9
-rw-r--r--chromium/content/renderer/render_frame_proxy.cc37
-rw-r--r--chromium/content/renderer/render_frame_proxy.h14
-rw-r--r--chromium/content/renderer/render_thread_impl.cc4
-rw-r--r--chromium/content/renderer/render_thread_impl.h1
-rw-r--r--chromium/content/renderer/render_view_browsertest.cc49
-rw-r--r--chromium/content/renderer/render_view_impl.cc6
-rw-r--r--chromium/content/renderer/render_widget.cc42
-rw-r--r--chromium/content/renderer/render_widget.h9
-rw-r--r--chromium/content/renderer/service_worker/controller_service_worker_connector.cc3
-rw-r--r--chromium/content/renderer/service_worker/service_worker_provider_context.cc10
-rw-r--r--chromium/content/renderer/service_worker/service_worker_provider_context.h7
-rw-r--r--chromium/device/vr/orientation/orientation_device_unittest.cc13
-rw-r--r--chromium/extensions/browser/api/feedback_private/feedback_private_api_chromeos_unittest.cc1
-rw-r--r--chromium/extensions/browser/api/feedback_private/log_source_access_manager.cc16
-rw-r--r--chromium/extensions/browser/api/feedback_private/log_source_access_manager.h3
-rw-r--r--chromium/extensions/browser/api/media_perception_private/conversion_utils.cc141
-rw-r--r--chromium/extensions/browser/api/media_perception_private/conversion_utils_unittest.cc86
-rw-r--r--chromium/extensions/browser/extension_function_histogram_value.h1
-rw-r--r--chromium/extensions/browser/user_script_loader.cc6
-rw-r--r--chromium/extensions/common/api/bluetooth_private.idl3
-rw-r--r--chromium/extensions/common/api/media_perception_private.idl94
-rw-r--r--chromium/gpu/config/gpu_lists_version.h2
-rw-r--r--chromium/ios/chrome/browser/ntp_snippets/BUILD.gn1
-rw-r--r--chromium/ios/chrome/browser/ui/fullscreen/BUILD.gn17
-rw-r--r--chromium/ios/chrome/browser/ui/fullscreen/test/BUILD.gn2
-rw-r--r--chromium/ipc/ipc_message_utils.cc20
-rw-r--r--chromium/media/audio/mac/audio_low_latency_input_mac.cc423
-rw-r--r--chromium/media/audio/mac/audio_low_latency_input_mac.h49
-rw-r--r--chromium/media/audio/win/audio_low_latency_output_win.cc29
-rw-r--r--chromium/media/audio/win/core_audio_util_win.cc25
-rw-r--r--chromium/media/capture/video/chromeos/local_gpu_memory_buffer_manager.cc9
-rw-r--r--chromium/media/capture/video/chromeos/mock_gpu_memory_buffer_manager.cc4
-rw-r--r--chromium/media/capture/video/chromeos/stream_buffer_manager_unittest.cc4
-rw-r--r--chromium/media/gpu/v4l2/generic_v4l2_device.cc2
-rw-r--r--chromium/media/gpu/vaapi/vaapi_video_decode_accelerator.cc22
-rw-r--r--chromium/mojo/edk/embedder/platform_shared_buffer.cc28
-rw-r--r--chromium/mojo/edk/embedder/platform_shared_buffer.h6
-rw-r--r--chromium/mojo/edk/system/shared_buffer_dispatcher.cc2
-rw-r--r--chromium/mojo/edk/system/shared_buffer_dispatcher_unittest.cc7
-rw-r--r--chromium/net/http/http_auth_handler_ntlm_portable.cc2
-rw-r--r--chromium/net/http/http_cache_transaction.cc14
-rw-r--r--chromium/net/http/http_cache_unittest.cc30
-rw-r--r--chromium/net/http/http_network_transaction_unittest.cc104
-rw-r--r--chromium/net/nqe/network_qualities_prefs_manager.cc14
-rw-r--r--chromium/net/nqe/network_qualities_prefs_manager_unittest.cc9
-rw-r--r--chromium/net/nqe/network_quality_estimator_params.cc19
-rw-r--r--chromium/net/nqe/network_quality_estimator_params.h4
-rw-r--r--chromium/net/nqe/network_quality_estimator_params_unittest.cc55
-rw-r--r--chromium/net/ntlm/ntlm_test_data.h44
-rw-r--r--chromium/services/device/generic_sensor/platform_sensor_and_provider_unittest.cc9
-rw-r--r--chromium/skia/ext/skia_commit_hash.h2
-rw-r--r--chromium/skia/public/interfaces/bitmap_skbitmap_struct_traits.cc4
-rw-r--r--chromium/testing/variations/fieldtrial_testing_config.json21
-rw-r--r--chromium/third_party/WebKit/Source/bindings/modules/v8/wasm/WasmResponseExtensions.cpp12
-rw-r--r--chromium/third_party/WebKit/Source/core/animation/EffectModel.cpp17
-rw-r--r--chromium/third_party/WebKit/Source/core/animation/EffectModel.h5
-rw-r--r--chromium/third_party/WebKit/Source/core/animation/ElementAnimation.cpp8
-rw-r--r--chromium/third_party/WebKit/Source/core/animation/KeyframeEffect.cpp9
-rw-r--r--chromium/third_party/WebKit/Source/core/animation/KeyframeEffectReadOnly.cpp9
-rw-r--r--chromium/third_party/WebKit/Source/core/dom/Document.cpp7
-rw-r--r--chromium/third_party/WebKit/Source/core/events/BUILD.gn2
-rw-r--r--chromium/third_party/WebKit/Source/core/events/CurrentInputEvent.cpp11
-rw-r--r--chromium/third_party/WebKit/Source/core/events/CurrentInputEvent.h29
-rw-r--r--chromium/third_party/WebKit/Source/core/events/MouseEvent.cpp27
-rw-r--r--chromium/third_party/WebKit/Source/core/exported/LocalFrameClientImpl.cpp3
-rw-r--r--chromium/third_party/WebKit/Source/core/exported/WebDevToolsAgentImpl.cpp24
-rw-r--r--chromium/third_party/WebKit/Source/core/exported/WebFrame.cpp1
-rw-r--r--chromium/third_party/WebKit/Source/core/exported/WebViewImpl.cpp16
-rw-r--r--chromium/third_party/WebKit/Source/core/exported/WebViewImpl.h5
-rw-r--r--chromium/third_party/WebKit/Source/core/frame/LocalFrame.h7
-rw-r--r--chromium/third_party/WebKit/Source/core/frame/LocalFrameView.cpp6
-rw-r--r--chromium/third_party/WebKit/Source/core/frame/RemoteFrameClient.h7
-rw-r--r--chromium/third_party/WebKit/Source/core/frame/RemoteFrameClientImpl.cpp6
-rw-r--r--chromium/third_party/WebKit/Source/core/frame/RemoteFrameClientImpl.h3
-rw-r--r--chromium/third_party/WebKit/Source/core/frame/RemoteFrameView.cpp10
-rw-r--r--chromium/third_party/WebKit/Source/core/frame/UseCounter.cpp2
-rw-r--r--chromium/third_party/WebKit/Source/core/frame/WebFrameWidgetBase.cpp8
-rw-r--r--chromium/third_party/WebKit/Source/core/frame/WebFrameWidgetImpl.cpp8
-rw-r--r--chromium/third_party/WebKit/Source/core/frame/WebFrameWidgetImpl.h4
-rw-r--r--chromium/third_party/WebKit/Source/core/frame/WebLocalFrameImpl.cpp1
-rw-r--r--chromium/third_party/WebKit/Source/core/fullscreen/Fullscreen.cpp6
-rw-r--r--chromium/third_party/WebKit/Source/core/html/HTMLViewSourceDocument.cpp3
-rw-r--r--chromium/third_party/WebKit/Source/core/html/canvas/HTMLCanvasElement.cpp26
-rw-r--r--chromium/third_party/WebKit/Source/core/html/canvas/HTMLCanvasElement.h5
-rw-r--r--chromium/third_party/WebKit/Source/core/html/forms/ExternalPopupMenu.cpp3
-rw-r--r--chromium/third_party/WebKit/Source/core/layout/LayoutBlock.cpp6
-rw-r--r--chromium/third_party/WebKit/Source/core/layout/LayoutBlock.h1
-rw-r--r--chromium/third_party/WebKit/Source/core/layout/LayoutFlexibleBox.cpp25
-rw-r--r--chromium/third_party/WebKit/Source/core/layout/LayoutGrid.cpp6
-rw-r--r--chromium/third_party/WebKit/Source/core/layout/LayoutTable.cpp2
-rw-r--r--chromium/third_party/WebKit/Source/core/layout/LayoutTableTest.cpp24
-rw-r--r--chromium/third_party/WebKit/Source/core/layout/ScrollAnchor.cpp4
-rw-r--r--chromium/third_party/WebKit/Source/core/layout/ScrollAnchorTest.cpp28
-rw-r--r--chromium/third_party/WebKit/Source/core/loader/EmptyClients.h3
-rw-r--r--chromium/third_party/WebKit/Source/core/loader/InteractiveDetector.cpp29
-rw-r--r--chromium/third_party/WebKit/Source/core/loader/InteractiveDetector.h6
-rw-r--r--chromium/third_party/WebKit/Source/core/loader/InteractiveDetectorTest.cpp29
-rw-r--r--chromium/third_party/WebKit/Source/core/loader/modulescript/DocumentModuleScriptFetcher.cpp3
-rw-r--r--chromium/third_party/WebKit/Source/core/loader/resource/ImageResource.cpp7
-rw-r--r--chromium/third_party/WebKit/Source/core/loader/resource/ScriptResource.cpp12
-rw-r--r--chromium/third_party/WebKit/Source/core/loader/resource/ScriptResource.h2
-rw-r--r--chromium/third_party/WebKit/Source/core/page/CreateWindow.cpp5
-rw-r--r--chromium/third_party/WebKit/Source/core/page/scrolling/ScrollingCoordinator.cpp17
-rw-r--r--chromium/third_party/WebKit/Source/core/paint/InlineTextBoxPainter.cpp16
-rw-r--r--chromium/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp3
-rw-r--r--chromium/third_party/WebKit/Source/core/paint/PaintTiming.cpp2
-rw-r--r--chromium/third_party/WebKit/Source/core/paint/compositing/CompositedLayerMapping.cpp9
-rw-r--r--chromium/third_party/WebKit/Source/core/paint/compositing/CompositedLayerMappingTest.cpp43
-rw-r--r--chromium/third_party/WebKit/Source/core/script/ClassicPendingScript.cpp6
-rw-r--r--chromium/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.idl10
-rw-r--r--chromium/third_party/WebKit/Source/devtools/front_end/network/RequestPreviewView.js18
-rw-r--r--chromium/third_party/WebKit/Source/devtools/front_end/network/ResourceWebSocketFrameView.js6
-rw-r--r--chromium/third_party/WebKit/Source/devtools/front_end/resources/ServiceWorkersView.js2
-rw-r--r--chromium/third_party/WebKit/Source/devtools/front_end/source_frame/JSONView.js15
-rw-r--r--chromium/third_party/WebKit/Source/devtools/front_end/source_frame/PreviewFactory.js7
-rw-r--r--chromium/third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp4
-rw-r--r--chromium/third_party/WebKit/Source/modules/accessibility/AXTableCell.cpp8
-rw-r--r--chromium/third_party/WebKit/Source/modules/canvas/canvas2d/CanvasRenderingContext2DTest.cpp2
-rw-r--r--chromium/third_party/WebKit/Source/platform/DEPS1
-rw-r--r--chromium/third_party/WebKit/Source/platform/exported/WebClipboardImpl.cpp11
-rw-r--r--chromium/third_party/WebKit/Source/platform/fonts/shaping/ShapeResultBloberizer.cpp1
-rw-r--r--chromium/third_party/WebKit/Source/platform/graphics/CanvasResource.cpp10
-rw-r--r--chromium/third_party/WebKit/Source/platform/graphics/CanvasResourceProvider.cpp21
-rw-r--r--chromium/third_party/WebKit/Source/platform/graphics/CanvasResourceTest.cpp14
-rw-r--r--chromium/third_party/WebKit/Source/platform/graphics/Image.cpp3
-rw-r--r--chromium/third_party/WebKit/Source/platform/image-decoders/png/PNGImageReader.cpp3
-rw-r--r--chromium/third_party/WebKit/Source/platform/image-decoders/png/PNGImageReader.h2
-rw-r--r--chromium/third_party/WebKit/Source/platform/loader/fetch/Resource.cpp11
-rw-r--r--chromium/third_party/WebKit/Source/platform/loader/fetch/Resource.h2
-rw-r--r--chromium/third_party/WebKit/Source/platform/runtime_enabled_features.json513
-rw-r--r--chromium/third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl.cc17
-rw-r--r--chromium/third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl.h3
-rw-r--r--chromium/third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl_unittest.cc66
-rw-r--r--chromium/third_party/WebKit/Source/platform/text/Character.cpp4
-rw-r--r--chromium/third_party/WebKit/Source/platform/wtf/text/CharacterNames.h4
-rw-r--r--chromium/third_party/WebKit/public/platform/scheduler/renderer/renderer_scheduler.h5
-rw-r--r--chromium/third_party/WebKit/public/web/WebRemoteFrameClient.h3
-rw-r--r--chromium/third_party/WebKit/public/web/devtools_agent.mojom6
-rw-r--r--chromium/third_party/catapult/tracing/trace_viewer.gypi1
-rw-r--r--chromium/third_party/libpng/BUILD.gn2
-rw-r--r--chromium/third_party/libxml/README.chromium2
-rw-r--r--chromium/third_party/libxml/chromium/chromium-issue-628581.patch8
-rwxr-xr-xchromium/third_party/libxml/linux/xml2-config6
-rw-r--r--chromium/third_party/libxml/src/HTMLparser.c2
-rw-r--r--chromium/third_party/libxml/src/configure.ac4
-rw-r--r--chromium/third_party/libxml/src/libxml2.spec2
-rw-r--r--chromium/third_party/libxml/src/parser.c17
-rw-r--r--chromium/third_party/libxml/src/parserInternals.c2
-rw-r--r--chromium/third_party/libxml/src/win32/Makefile.msvc16
-rw-r--r--chromium/third_party/libxml/src/win32/configure.js12
-rw-r--r--chromium/third_party/libxml/src/win32/libxml2.rc36
-rw-r--r--chromium/third_party/libxml/src/xmlIO.c4
-rw-r--r--chromium/third_party/pdfium/core/fxcodec/jbig2/JBig2_HuffmanTable.cpp7
-rw-r--r--chromium/third_party/skia/gm/bitmapcopy.cpp29
-rw-r--r--chromium/third_party/skia/include/core/SkImageInfo.h64
-rw-r--r--chromium/third_party/skia/src/codec/SkWebpCodec.cpp3
-rw-r--r--chromium/third_party/skia/src/core/SkImageInfo.cpp71
-rw-r--r--chromium/third_party/skia/src/core/SkPaint.cpp10
-rw-r--r--chromium/third_party/skia/src/core/SkScan_AntiPath.cpp7
-rw-r--r--chromium/third_party/skia/src/gpu/SkGr.cpp6
-rw-r--r--chromium/third_party/skia/src/gpu/gl/GrGLCaps.cpp6
-rw-r--r--chromium/third_party/skia/src/gpu/vk/GrVkCaps.cpp6
-rw-r--r--chromium/third_party/skia/src/image/SkImage_Lazy.cpp3
-rw-r--r--chromium/third_party/skia/tools/debugger/SkObjectParser.cpp23
-rw-r--r--chromium/third_party/wayland-protocols/LICENSE33
-rw-r--r--chromium/third_party/wayland-protocols/OWNERS2
-rw-r--r--chromium/third_party/wayland-protocols/README.chromium66
-rw-r--r--chromium/third_party/wayland-protocols/include/protocol/alpha-compositing-unstable-v1-client-protocol.h308
-rw-r--r--chromium/third_party/wayland-protocols/include/protocol/alpha-compositing-unstable-v1-server-protocol.h253
-rw-r--r--chromium/third_party/wayland-protocols/include/protocol/gaming-input-unstable-v1-client-protocol.h332
-rw-r--r--chromium/third_party/wayland-protocols/include/protocol/gaming-input-unstable-v1-server-protocol.h266
-rw-r--r--chromium/third_party/wayland-protocols/include/protocol/gaming-input-unstable-v2-client-protocol.h422
-rw-r--r--chromium/third_party/wayland-protocols/include/protocol/gaming-input-unstable-v2-server-protocol.h316
-rw-r--r--chromium/third_party/wayland-protocols/include/protocol/keyboard-configuration-unstable-v1-client-protocol.h260
-rw-r--r--chromium/third_party/wayland-protocols/include/protocol/keyboard-configuration-unstable-v1-server-protocol.h198
-rw-r--r--chromium/third_party/wayland-protocols/include/protocol/keyboard-extension-unstable-v1-client-protocol.h236
-rw-r--r--chromium/third_party/wayland-protocols/include/protocol/keyboard-extension-unstable-v1-server-protocol.h188
-rw-r--r--chromium/third_party/wayland-protocols/include/protocol/linux-dmabuf-unstable-v1-client-protocol.h652
-rw-r--r--chromium/third_party/wayland-protocols/include/protocol/linux-dmabuf-unstable-v1-server-protocol.h563
-rw-r--r--chromium/third_party/wayland-protocols/include/protocol/pointer-gestures-unstable-v1-client-protocol.h300
-rw-r--r--chromium/third_party/wayland-protocols/include/protocol/pointer-gestures-unstable-v1-server-protocol.h179
-rw-r--r--chromium/third_party/wayland-protocols/include/protocol/presentation-time-client-protocol.h497
-rw-r--r--chromium/third_party/wayland-protocols/include/protocol/presentation-time-server-protocol.h349
-rw-r--r--chromium/third_party/wayland-protocols/include/protocol/remote-shell-unstable-v1-client-protocol.h1543
-rw-r--r--chromium/third_party/wayland-protocols/include/protocol/remote-shell-unstable-v1-server-protocol.h1251
-rw-r--r--chromium/third_party/wayland-protocols/include/protocol/secure-output-unstable-v1-client-protocol.h272
-rw-r--r--chromium/third_party/wayland-protocols/include/protocol/secure-output-unstable-v1-server-protocol.h219
-rw-r--r--chromium/third_party/wayland-protocols/include/protocol/stylus-tools-unstable-v1-client-protocol.h258
-rw-r--r--chromium/third_party/wayland-protocols/include/protocol/stylus-tools-unstable-v1-server-protocol.h205
-rw-r--r--chromium/third_party/wayland-protocols/include/protocol/stylus-unstable-v2-client-protocol.h316
-rw-r--r--chromium/third_party/wayland-protocols/include/protocol/stylus-unstable-v2-server-protocol.h251
-rw-r--r--chromium/third_party/wayland-protocols/include/protocol/viewporter-client-protocol.h408
-rw-r--r--chromium/third_party/wayland-protocols/include/protocol/viewporter-server-protocol.h361
-rw-r--r--chromium/third_party/wayland-protocols/include/protocol/vsync-feedback-unstable-v1-client-protocol.h257
-rw-r--r--chromium/third_party/wayland-protocols/include/protocol/vsync-feedback-unstable-v1-server-protocol.h179
-rw-r--r--chromium/third_party/wayland-protocols/include/protocol/xdg-shell-unstable-v5-client-protocol.h1110
-rw-r--r--chromium/third_party/wayland-protocols/include/protocol/xdg-shell-unstable-v5-server-protocol.h903
-rw-r--r--chromium/third_party/wayland-protocols/include/protocol/xdg-shell-unstable-v6-client-protocol.h1750
-rw-r--r--chromium/third_party/wayland-protocols/include/protocol/xdg-shell-unstable-v6-server-protocol.h1441
-rw-r--r--chromium/third_party/wayland-protocols/protocol/alpha-compositing-protocol.c61
-rw-r--r--chromium/third_party/wayland-protocols/protocol/gaming-input-protocol-v1.c68
-rw-r--r--chromium/third_party/wayland-protocols/protocol/gaming-input-protocol-v2.c85
-rw-r--r--chromium/third_party/wayland-protocols/protocol/keyboard-configuration-protocol.c62
-rw-r--r--chromium/third_party/wayland-protocols/protocol/keyboard-extension-protocol.c60
-rw-r--r--chromium/third_party/wayland-protocols/protocol/linux-dmabuf-protocol.c82
-rw-r--r--chromium/third_party/wayland-protocols/protocol/pointer-gestures-v1-protocol.c74
-rw-r--r--chromium/third_party/wayland-protocols/protocol/presentation-time-protocol.c73
-rw-r--r--chromium/third_party/wayland-protocols/protocol/remote-shell-protocol.c139
-rw-r--r--chromium/third_party/wayland-protocols/protocol/secure-output-protocol.c59
-rw-r--r--chromium/third_party/wayland-protocols/protocol/stylus-protocol-v2.c67
-rw-r--r--chromium/third_party/wayland-protocols/protocol/stylus-tools-protocol.c59
-rw-r--r--chromium/third_party/wayland-protocols/protocol/viewporter-protocol.c64
-rw-r--r--chromium/third_party/wayland-protocols/protocol/vsync-feedback-protocol.c66
-rw-r--r--chromium/third_party/wayland-protocols/protocol/xdg-shell-v5-protocol.c125
-rw-r--r--chromium/third_party/wayland-protocols/protocol/xdg-shell-v6-protocol.c162
-rw-r--r--chromium/third_party/wayland-protocols/src/COPYING33
-rw-r--r--chromium/third_party/wayland-protocols/src/Makefile.am39
-rw-r--r--chromium/third_party/wayland-protocols/src/README141
-rwxr-xr-xchromium/third_party/wayland-protocols/src/autogen.sh9
-rw-r--r--chromium/third_party/wayland-protocols/src/configure.ac45
-rw-r--r--chromium/third_party/wayland-protocols/src/m4/compat.m412
-rw-r--r--chromium/third_party/wayland-protocols/src/stable/presentation-time/README5
-rw-r--r--chromium/third_party/wayland-protocols/src/stable/presentation-time/presentation-time.xml266
-rw-r--r--chromium/third_party/wayland-protocols/src/stable/viewporter/README7
-rw-r--r--chromium/third_party/wayland-protocols/src/stable/viewporter/viewporter.xml186
-rw-r--r--chromium/third_party/wayland-protocols/src/unstable/fullscreen-shell/README4
-rw-r--r--chromium/third_party/wayland-protocols/src/unstable/fullscreen-shell/fullscreen-shell-unstable-v1.xml220
-rw-r--r--chromium/third_party/wayland-protocols/src/unstable/idle-inhibit/README4
-rw-r--r--chromium/third_party/wayland-protocols/src/unstable/idle-inhibit/idle-inhibit-unstable-v1.xml83
-rw-r--r--chromium/third_party/wayland-protocols/src/unstable/input-method/README4
-rw-r--r--chromium/third_party/wayland-protocols/src/unstable/input-method/input-method-unstable-v1.xml305
-rw-r--r--chromium/third_party/wayland-protocols/src/unstable/linux-dmabuf/README5
-rw-r--r--chromium/third_party/wayland-protocols/src/unstable/linux-dmabuf/linux-dmabuf-unstable-v1.xml348
-rw-r--r--chromium/third_party/wayland-protocols/src/unstable/pointer-constraints/README4
-rw-r--r--chromium/third_party/wayland-protocols/src/unstable/pointer-constraints/pointer-constraints-unstable-v1.xml339
-rw-r--r--chromium/third_party/wayland-protocols/src/unstable/pointer-gestures/README4
-rw-r--r--chromium/third_party/wayland-protocols/src/unstable/pointer-gestures/pointer-gestures-unstable-v1.xml177
-rw-r--r--chromium/third_party/wayland-protocols/src/unstable/relative-pointer/README4
-rw-r--r--chromium/third_party/wayland-protocols/src/unstable/relative-pointer/relative-pointer-unstable-v1.xml136
-rw-r--r--chromium/third_party/wayland-protocols/src/unstable/tablet/README4
-rw-r--r--chromium/third_party/wayland-protocols/src/unstable/tablet/tablet-unstable-v1.xml640
-rw-r--r--chromium/third_party/wayland-protocols/src/unstable/tablet/tablet-unstable-v2.xml1178
-rw-r--r--chromium/third_party/wayland-protocols/src/unstable/text-input/README4
-rw-r--r--chromium/third_party/wayland-protocols/src/unstable/text-input/text-input-unstable-v1.xml385
-rw-r--r--chromium/third_party/wayland-protocols/src/unstable/xdg-foreign/README4
-rw-r--r--chromium/third_party/wayland-protocols/src/unstable/xdg-foreign/xdg-foreign-unstable-v1.xml182
-rw-r--r--chromium/third_party/wayland-protocols/src/unstable/xdg-shell/README4
-rw-r--r--chromium/third_party/wayland-protocols/src/unstable/xdg-shell/xdg-shell-unstable-v5.xml623
-rw-r--r--chromium/third_party/wayland-protocols/src/unstable/xdg-shell/xdg-shell-unstable-v6.xml1044
-rw-r--r--chromium/third_party/wayland-protocols/src/wayland-protocols-uninstalled.pc.in5
-rw-r--r--chromium/third_party/wayland-protocols/src/wayland-protocols.pc.in7
-rw-r--r--chromium/third_party/wayland-protocols/unstable/alpha-compositing/README4
-rw-r--r--chromium/third_party/wayland-protocols/unstable/alpha-compositing/alpha-compositing-unstable-v1.xml130
-rw-r--r--chromium/third_party/wayland-protocols/unstable/gaming-input/README4
-rw-r--r--chromium/third_party/wayland-protocols/unstable/gaming-input/gaming-input-unstable-v1.xml127
-rw-r--r--chromium/third_party/wayland-protocols/unstable/gaming-input/gaming-input-unstable-v2.xml152
-rw-r--r--chromium/third_party/wayland-protocols/unstable/keyboard/README4
-rw-r--r--chromium/third_party/wayland-protocols/unstable/keyboard/keyboard-configuration-unstable-v1.xml87
-rw-r--r--chromium/third_party/wayland-protocols/unstable/keyboard/keyboard-extension-unstable-v1.xml82
-rw-r--r--chromium/third_party/wayland-protocols/unstable/remote-shell/README4
-rw-r--r--chromium/third_party/wayland-protocols/unstable/remote-shell/remote-shell-unstable-v1.xml776
-rw-r--r--chromium/third_party/wayland-protocols/unstable/secure-output/README4
-rw-r--r--chromium/third_party/wayland-protocols/unstable/secure-output/secure-output-unstable-v1.xml118
-rw-r--r--chromium/third_party/wayland-protocols/unstable/stylus-tools/README4
-rw-r--r--chromium/third_party/wayland-protocols/unstable/stylus-tools/stylus-tools-unstable-v1.xml105
-rw-r--r--chromium/third_party/wayland-protocols/unstable/stylus/README4
-rw-r--r--chromium/third_party/wayland-protocols/unstable/stylus/stylus-unstable-v2.xml116
-rw-r--r--chromium/third_party/wayland-protocols/unstable/vsync-feedback/README4
-rw-r--r--chromium/third_party/wayland-protocols/unstable/vsync-feedback/vsync-feedback-unstable-v1.xml99
-rw-r--r--chromium/third_party/wayland/LICENSE25
-rw-r--r--chromium/third_party/wayland/OWNERS2
-rw-r--r--chromium/third_party/wayland/README.chromium22
-rw-r--r--chromium/third_party/wayland/include/config.h81
-rw-r--r--chromium/third_party/wayland/include/protocol/wayland-client-protocol-core.h5587
-rw-r--r--chromium/third_party/wayland/include/protocol/wayland-client-protocol.h5587
-rw-r--r--chromium/third_party/wayland/include/protocol/wayland-server-protocol-core.h4335
-rw-r--r--chromium/third_party/wayland/include/protocol/wayland-server-protocol.h4335
-rw-r--r--chromium/third_party/wayland/include/src/wayland-version.h34
-rw-r--r--chromium/third_party/wayland/protocol/wayland-protocol.c507
-rw-r--r--chromium/third_party/wds/DEPS3
-rw-r--r--chromium/third_party/wds/LICENSE503
-rw-r--r--chromium/third_party/wds/OWNERS2
-rw-r--r--chromium/third_party/wds/README.chromium21
-rw-r--r--chromium/third_party/wds/gen/errorscanner.cpp2298
-rw-r--r--chromium/third_party/wds/gen/errorscanner.h376
-rw-r--r--chromium/third_party/wds/gen/headerscanner.cpp3023
-rw-r--r--chromium/third_party/wds/gen/headerscanner.h381
-rw-r--r--chromium/third_party/wds/gen/messagescanner.cpp3725
-rw-r--r--chromium/third_party/wds/gen/messagescanner.h384
-rw-r--r--chromium/third_party/wds/gen/parser.cpp3651
-rw-r--r--chromium/third_party/wds/gen/parser.h261
-rw-r--r--chromium/third_party/wds/src/CMakeLists.txt23
-rw-r--r--chromium/third_party/wds/src/COPYING503
-rw-r--r--chromium/third_party/wds/src/README.md91
-rw-r--r--chromium/third_party/wds/src/TODO22
-rw-r--r--chromium/third_party/wds/src/data/CMakeLists.txt3
-rw-r--r--chromium/third_party/wds/src/data/wds.pc.in10
-rw-r--r--chromium/third_party/wds/src/datadumps/gstreamer-pipelines.txt22
-rw-r--r--chromium/third_party/wds/src/datadumps/information-elements.pcapngbin0 -> 799804 bytes
-rw-r--r--chromium/third_party/wds/src/datadumps/rtsp-capture-win8.txt229
-rw-r--r--chromium/third_party/wds/src/desktop_source/CMakeLists.txt23
-rw-r--r--chromium/third_party/wds/src/desktop_source/desktop_media_manager.cpp130
-rw-r--r--chromium/third_party/wds/src/desktop_source/desktop_media_manager.h57
-rw-r--r--chromium/third_party/wds/src/desktop_source/main.cpp132
-rw-r--r--chromium/third_party/wds/src/desktop_source/mirac_broker_source.cpp56
-rw-r--r--chromium/third_party/wds/src/desktop_source/mirac_broker_source.h51
-rw-r--r--chromium/third_party/wds/src/desktop_source/source-app.cpp111
-rw-r--r--chromium/third_party/wds/src/desktop_source/source-app.h55
-rw-r--r--chromium/third_party/wds/src/libwds/CMakeLists.txt27
-rw-r--r--chromium/third_party/wds/src/libwds/common/CMakeLists.txt8
-rw-r--r--chromium/third_party/wds/src/libwds/common/logging.cpp64
-rw-r--r--chromium/third_party/wds/src/libwds/common/message_handler.cpp340
-rw-r--r--chromium/third_party/wds/src/libwds/common/message_handler.h249
-rw-r--r--chromium/third_party/wds/src/libwds/common/rtsp_input_handler.cpp89
-rw-r--r--chromium/third_party/wds/src/libwds/common/rtsp_input_handler.h56
-rw-r--r--chromium/third_party/wds/src/libwds/common/video_format.cpp245
-rw-r--r--chromium/third_party/wds/src/libwds/public/audio_codec.h73
-rw-r--r--chromium/third_party/wds/src/libwds/public/connector_type.h36
-rw-r--r--chromium/third_party/wds/src/libwds/public/logging.h99
-rw-r--r--chromium/third_party/wds/src/libwds/public/media_manager.h258
-rw-r--r--chromium/third_party/wds/src/libwds/public/peer.h175
-rw-r--r--chromium/third_party/wds/src/libwds/public/sink.h49
-rw-r--r--chromium/third_party/wds/src/libwds/public/source.h50
-rw-r--r--chromium/third_party/wds/src/libwds/public/video_format.h218
-rw-r--r--chromium/third_party/wds/src/libwds/public/wds_export.h32
-rw-r--r--chromium/third_party/wds/src/libwds/rtsp/CMakeLists.txt41
-rw-r--r--chromium/third_party/wds/src/libwds/rtsp/audiocodecs.cpp79
-rw-r--r--chromium/third_party/wds/src/libwds/rtsp/audiocodecs.h50
-rw-r--r--chromium/third_party/wds/src/libwds/rtsp/avformatchangetiming.cpp52
-rw-r--r--chromium/third_party/wds/src/libwds/rtsp/avformatchangetiming.h49
-rw-r--r--chromium/third_party/wds/src/libwds/rtsp/clientrtpports.cpp52
-rw-r--r--chromium/third_party/wds/src/libwds/rtsp/clientrtpports.h48
-rw-r--r--chromium/third_party/wds/src/libwds/rtsp/connectortype.cpp64
-rw-r--r--chromium/third_party/wds/src/libwds/rtsp/connectortype.h48
-rw-r--r--chromium/third_party/wds/src/libwds/rtsp/constants.h122
-rw-r--r--chromium/third_party/wds/src/libwds/rtsp/contentprotection.cpp67
-rw-r--r--chromium/third_party/wds/src/libwds/rtsp/contentprotection.h55
-rw-r--r--chromium/third_party/wds/src/libwds/rtsp/coupledsink.cpp67
-rw-r--r--chromium/third_party/wds/src/libwds/rtsp/coupledsink.h49
-rw-r--r--chromium/third_party/wds/src/libwds/rtsp/displayedid.cpp60
-rw-r--r--chromium/third_party/wds/src/libwds/rtsp/displayedid.h49
-rw-r--r--chromium/third_party/wds/src/libwds/rtsp/driver.cpp102
-rw-r--r--chromium/third_party/wds/src/libwds/rtsp/driver.h48
-rw-r--r--chromium/third_party/wds/src/libwds/rtsp/errorlexer.l155
-rw-r--r--chromium/third_party/wds/src/libwds/rtsp/formats3d.cpp110
-rw-r--r--chromium/third_party/wds/src/libwds/rtsp/formats3d.h90
-rw-r--r--chromium/third_party/wds/src/libwds/rtsp/genericproperty.cpp51
-rw-r--r--chromium/third_party/wds/src/libwds/rtsp/genericproperty.h52
-rw-r--r--chromium/third_party/wds/src/libwds/rtsp/getparameter.cpp43
-rw-r--r--chromium/third_party/wds/src/libwds/rtsp/getparameter.h41
-rw-r--r--chromium/third_party/wds/src/libwds/rtsp/header.cpp177
-rw-r--r--chromium/third_party/wds/src/libwds/rtsp/header.h89
-rw-r--r--chromium/third_party/wds/src/libwds/rtsp/headerlexer.l239
-rw-r--r--chromium/third_party/wds/src/libwds/rtsp/i2c.cpp41
-rw-r--r--chromium/third_party/wds/src/libwds/rtsp/i2c.h47
-rw-r--r--chromium/third_party/wds/src/libwds/rtsp/idrrequest.cpp39
-rw-r--r--chromium/third_party/wds/src/libwds/rtsp/idrrequest.h42
-rw-r--r--chromium/third_party/wds/src/libwds/rtsp/macros.h57
-rw-r--r--chromium/third_party/wds/src/libwds/rtsp/message.cpp78
-rw-r--r--chromium/third_party/wds/src/libwds/rtsp/message.h115
-rw-r--r--chromium/third_party/wds/src/libwds/rtsp/messagelexer.l299
-rw-r--r--chromium/third_party/wds/src/libwds/rtsp/messages_rules.txt286
-rw-r--r--chromium/third_party/wds/src/libwds/rtsp/options.cpp43
-rw-r--r--chromium/third_party/wds/src/libwds/rtsp/options.h41
-rw-r--r--chromium/third_party/wds/src/libwds/rtsp/parser.ypp1164
-rw-r--r--chromium/third_party/wds/src/libwds/rtsp/pause.cpp43
-rw-r--r--chromium/third_party/wds/src/libwds/rtsp/pause.h41
-rw-r--r--chromium/third_party/wds/src/libwds/rtsp/payload.cpp136
-rw-r--r--chromium/third_party/wds/src/libwds/rtsp/payload.h143
-rw-r--r--chromium/third_party/wds/src/libwds/rtsp/play.cpp40
-rw-r--r--chromium/third_party/wds/src/libwds/rtsp/play.h40
-rw-r--r--chromium/third_party/wds/src/libwds/rtsp/preferreddisplaymode.cpp88
-rw-r--r--chromium/third_party/wds/src/libwds/rtsp/preferreddisplaymode.h78
-rw-r--r--chromium/third_party/wds/src/libwds/rtsp/presentationurl.cpp49
-rw-r--r--chromium/third_party/wds/src/libwds/rtsp/presentationurl.h49
-rw-r--r--chromium/third_party/wds/src/libwds/rtsp/property.cpp102
-rw-r--r--chromium/third_party/wds/src/libwds/rtsp/property.h58
-rw-r--r--chromium/third_party/wds/src/libwds/rtsp/propertyerrors.cpp69
-rw-r--r--chromium/third_party/wds/src/libwds/rtsp/propertyerrors.h54
-rw-r--r--chromium/third_party/wds/src/libwds/rtsp/reply.cpp49
-rw-r--r--chromium/third_party/wds/src/libwds/rtsp/reply.h48
-rw-r--r--chromium/third_party/wds/src/libwds/rtsp/route.cpp48
-rw-r--r--chromium/third_party/wds/src/libwds/rtsp/route.h52
-rw-r--r--chromium/third_party/wds/src/libwds/rtsp/setparameter.cpp41
-rw-r--r--chromium/third_party/wds/src/libwds/rtsp/setparameter.h40
-rw-r--r--chromium/third_party/wds/src/libwds/rtsp/setup.cpp43
-rw-r--r--chromium/third_party/wds/src/libwds/rtsp/setup.h41
-rw-r--r--chromium/third_party/wds/src/libwds/rtsp/standby.cpp39
-rw-r--r--chromium/third_party/wds/src/libwds/rtsp/standby.h41
-rw-r--r--chromium/third_party/wds/src/libwds/rtsp/standbyresumecapability.cpp47
-rw-r--r--chromium/third_party/wds/src/libwds/rtsp/standbyresumecapability.h42
-rw-r--r--chromium/third_party/wds/src/libwds/rtsp/teardown.cpp43
-rw-r--r--chromium/third_party/wds/src/libwds/rtsp/teardown.h41
-rw-r--r--chromium/third_party/wds/src/libwds/rtsp/transportheader.cpp97
-rw-r--r--chromium/third_party/wds/src/libwds/rtsp/transportheader.h60
-rw-r--r--chromium/third_party/wds/src/libwds/rtsp/triggermethod.cpp49
-rw-r--r--chromium/third_party/wds/src/libwds/rtsp/triggermethod.h54
-rw-r--r--chromium/third_party/wds/src/libwds/rtsp/uibccapability.cpp164
-rw-r--r--chromium/third_party/wds/src/libwds/rtsp/uibccapability.h84
-rw-r--r--chromium/third_party/wds/src/libwds/rtsp/uibcsetting.cpp50
-rw-r--r--chromium/third_party/wds/src/libwds/rtsp/uibcsetting.h45
-rw-r--r--chromium/third_party/wds/src/libwds/rtsp/videoformats.cpp301
-rw-r--r--chromium/third_party/wds/src/libwds/rtsp/videoformats.h95
-rw-r--r--chromium/third_party/wds/src/libwds/sink/CMakeLists.txt10
-rw-r--r--chromium/third_party/wds/src/libwds/sink/cap_negotiation_state.cpp206
-rw-r--r--chromium/third_party/wds/src/libwds/sink/cap_negotiation_state.h52
-rw-r--r--chromium/third_party/wds/src/libwds/sink/init_state.cpp95
-rw-r--r--chromium/third_party/wds/src/libwds/sink/init_state.h43
-rw-r--r--chromium/third_party/wds/src/libwds/sink/session_state.cpp114
-rw-r--r--chromium/third_party/wds/src/libwds/sink/session_state.h62
-rw-r--r--chromium/third_party/wds/src/libwds/sink/sink.cpp219
-rw-r--r--chromium/third_party/wds/src/libwds/sink/streaming_state.cpp230
-rw-r--r--chromium/third_party/wds/src/libwds/sink/streaming_state.h45
-rw-r--r--chromium/third_party/wds/src/libwds/source/CMakeLists.txt9
-rw-r--r--chromium/third_party/wds/src/libwds/source/cap_negotiation_state.cpp179
-rw-r--r--chromium/third_party/wds/src/libwds/source/cap_negotiation_state.h41
-rw-r--r--chromium/third_party/wds/src/libwds/source/init_state.cpp83
-rw-r--r--chromium/third_party/wds/src/libwds/source/init_state.h41
-rw-r--r--chromium/third_party/wds/src/libwds/source/session_state.cpp125
-rw-r--r--chromium/third_party/wds/src/libwds/source/session_state.h59
-rw-r--r--chromium/third_party/wds/src/libwds/source/source.cpp261
-rw-r--r--chromium/third_party/wds/src/libwds/source/streaming_state.cpp107
-rw-r--r--chromium/third_party/wds/src/libwds/source/streaming_state.h41
-rw-r--r--chromium/third_party/wds/src/mirac_network/CMakeLists.txt26
-rw-r--r--chromium/third_party/wds/src/mirac_network/gst-test.cpp121
-rw-r--r--chromium/third_party/wds/src/mirac_network/mirac-broker.cpp287
-rw-r--r--chromium/third_party/wds/src/mirac_network/mirac-broker.hpp100
-rw-r--r--chromium/third_party/wds/src/mirac_network/mirac-exception.hpp76
-rw-r--r--chromium/third_party/wds/src/mirac_network/mirac-glib-logging.cpp64
-rw-r--r--chromium/third_party/wds/src/mirac_network/mirac-glib-logging.hpp31
-rw-r--r--chromium/third_party/wds/src/mirac_network/mirac-gst-bus-handler.cpp62
-rw-r--r--chromium/third_party/wds/src/mirac_network/mirac-gst-bus-handler.hpp30
-rw-r--r--chromium/third_party/wds/src/mirac_network/mirac-gst-sink.cpp120
-rw-r--r--chromium/third_party/wds/src/mirac_network/mirac-gst-sink.hpp47
-rw-r--r--chromium/third_party/wds/src/mirac_network/mirac-gst-test-source.cpp105
-rw-r--r--chromium/third_party/wds/src/mirac_network/mirac-gst-test-source.hpp48
-rw-r--r--chromium/third_party/wds/src/mirac_network/mirac-network.cpp322
-rw-r--r--chromium/third_party/wds/src/mirac_network/mirac-network.hpp81
-rw-r--r--chromium/third_party/wds/src/mirac_network/network-test.cpp179
-rw-r--r--chromium/third_party/wds/src/p2p/CMakeLists.txt20
-rw-r--r--chromium/third_party/wds/src/p2p/connman-client.cpp380
-rw-r--r--chromium/third_party/wds/src/p2p/connman-client.h88
-rw-r--r--chromium/third_party/wds/src/p2p/connman-peer.cpp257
-rw-r--r--chromium/third_party/wds/src/p2p/connman-peer.h81
-rw-r--r--chromium/third_party/wds/src/p2p/information-element.cpp171
-rw-r--r--chromium/third_party/wds/src/p2p/information-element.h166
-rw-r--r--chromium/third_party/wds/src/p2p/main.cpp62
-rw-r--r--chromium/third_party/wds/src/p2p/test-ie.cpp67
-rw-r--r--chromium/third_party/wds/src/rtsp-message-exchanges.txt148
-rw-r--r--chromium/third_party/wds/src/sink/CMakeLists.txt22
-rw-r--r--chromium/third_party/wds/src/sink/gst_sink_media_manager.cpp94
-rw-r--r--chromium/third_party/wds/src/sink/gst_sink_media_manager.h56
-rw-r--r--chromium/third_party/wds/src/sink/main.cpp132
-rw-r--r--chromium/third_party/wds/src/sink/sink-app.cpp90
-rw-r--r--chromium/third_party/wds/src/sink/sink-app.h51
-rw-r--r--chromium/third_party/wds/src/sink/sink.cpp68
-rw-r--r--chromium/third_party/wds/src/sink/sink.h54
-rw-r--r--chromium/third_party/webrtc/api/peerconnectioninterface.h8
-rw-r--r--chromium/third_party/webrtc/audio/audio_send_stream.cc20
-rw-r--r--chromium/third_party/webrtc/audio/audio_send_stream.h6
-rw-r--r--chromium/third_party/webrtc/audio/audio_send_stream_unittest.cc51
-rw-r--r--chromium/third_party/webrtc/call/call.cc4
-rw-r--r--chromium/third_party/webrtc/common_video/h264/sps_parser.cc7
-rw-r--r--chromium/third_party/webrtc/common_video/h264/sps_parser_unittest.cc2
-rw-r--r--chromium/third_party/webrtc/modules/audio_processing/BUILD.gn1
-rw-r--r--chromium/third_party/webrtc/modules/audio_processing/aec3/aec_state.cc7
-rw-r--r--chromium/third_party/webrtc/modules/audio_processing/aec3/block_processor.cc45
-rw-r--r--chromium/third_party/webrtc/modules/audio_processing/aec3/block_processor_unittest.cc3
-rw-r--r--chromium/third_party/webrtc/modules/audio_processing/aec3/delay_estimate.h29
-rw-r--r--chromium/third_party/webrtc/modules/audio_processing/aec3/echo_path_delay_estimator.cc23
-rw-r--r--chromium/third_party/webrtc/modules/audio_processing/aec3/echo_path_delay_estimator.h3
-rw-r--r--chromium/third_party/webrtc/modules/audio_processing/aec3/echo_path_delay_estimator_unittest.cc47
-rw-r--r--chromium/third_party/webrtc/modules/audio_processing/aec3/main_filter_update_gain_unittest.cc3
-rw-r--r--chromium/third_party/webrtc/modules/audio_processing/aec3/matched_filter.cc31
-rw-r--r--chromium/third_party/webrtc/modules/audio_processing/aec3/matched_filter_lag_aggregator.cc8
-rw-r--r--chromium/third_party/webrtc/modules/audio_processing/aec3/matched_filter_lag_aggregator.h4
-rw-r--r--chromium/third_party/webrtc/modules/audio_processing/aec3/matched_filter_lag_aggregator_unittest.cc38
-rw-r--r--chromium/third_party/webrtc/modules/audio_processing/aec3/mock/mock_render_delay_buffer.h2
-rw-r--r--chromium/third_party/webrtc/modules/audio_processing/aec3/mock/mock_render_delay_controller.h5
-rw-r--r--chromium/third_party/webrtc/modules/audio_processing/aec3/render_delay_buffer.cc14
-rw-r--r--chromium/third_party/webrtc/modules/audio_processing/aec3/render_delay_buffer.h2
-rw-r--r--chromium/third_party/webrtc/modules/audio_processing/aec3/render_delay_controller.cc76
-rw-r--r--chromium/third_party/webrtc/modules/audio_processing/aec3/render_delay_controller.h6
-rw-r--r--chromium/third_party/webrtc/modules/audio_processing/aec3/render_delay_controller_unittest.cc20
-rw-r--r--chromium/third_party/webrtc/modules/audio_processing/aec3/residual_echo_estimator.cc8
-rw-r--r--chromium/third_party/webrtc/modules/audio_processing/include/audio_processing.h20
-rw-r--r--chromium/third_party/webrtc/modules/video_coding/codecs/vp8/screenshare_layers.cc22
-rw-r--r--chromium/third_party/webrtc/modules/video_coding/codecs/vp8/screenshare_layers_unittest.cc2
-rw-r--r--chromium/third_party/webrtc/pc/peerconnection.h2
-rw-r--r--chromium/third_party/webrtc/pc/rtcstatscollector.cc45
-rw-r--r--chromium/third_party/webrtc/pc/rtcstatscollector_unittest.cc17
-rw-r--r--chromium/tools/metrics/histograms/enums.xml26
-rw-r--r--chromium/tools/metrics/histograms/histograms.xml80
-rw-r--r--chromium/ui/arc/notification/arc_notification_surface_impl.cc8
-rw-r--r--chromium/ui/base/ui_features.gni5
-rw-r--r--chromium/ui/display/manager/display_manager.cc13
-rw-r--r--chromium/ui/gfx/native_pixmap_handle.cc7
-rw-r--r--chromium/ui/gfx/native_pixmap_handle.h10
-rw-r--r--chromium/ui/gl/gl_image_native_pixmap.cc3
-rw-r--r--chromium/ui/ozone/platform/drm/gpu/drm_device.cc4
-rw-r--r--chromium/ui/ozone/platform/drm/gpu/drm_device.h4
-rw-r--r--chromium/ui/ozone/platform/drm/gpu/gbm_buffer.cc37
-rw-r--r--chromium/ui/ozone/platform/drm/gpu/gbm_buffer.h5
-rw-r--r--chromium/ui/resources/BUILD.gn2
-rw-r--r--chromium/ui/webui/resources/cr_components/chromeos/network/network_config.html3
-rw-r--r--chromium/ui/webui/resources/cr_components/chromeos/network/network_config.js15
-rw-r--r--chromium/ui/webui/resources/cr_components/chromeos/network/network_ip_config.js7
-rw-r--r--chromium/ui/webui/resources/cr_components/chromeos/network/network_nameservers.js15
-rw-r--r--chromium/ui/webui/resources/cr_components/chromeos/network/network_siminfo.html16
-rw-r--r--chromium/ui/webui/resources/cr_components/chromeos/network/network_siminfo.js29
-rw-r--r--chromium/ui/webui/resources/cr_components/cr_components_resources.grdp5
-rwxr-xr-xchromium/v8/gypfiles/gyp_v815
-rw-r--r--chromium/v8/include/v8-version.h2
-rw-r--r--chromium/v8/src/api.cc6
-rw-r--r--chromium/v8/src/compiler/simplified-lowering.cc16
-rw-r--r--chromium/v8/src/compiler/x64/instruction-selector-x64.cc6
-rw-r--r--chromium/v8/src/frames.cc9
-rw-r--r--chromium/v8/src/frames.h1
-rw-r--r--chromium/v8/src/globals.h271
-rw-r--r--chromium/v8/src/handles.cc2
-rw-r--r--chromium/v8/src/heap/heap.cc3
-rw-r--r--chromium/v8/src/heap/spaces.cc2
-rw-r--r--chromium/v8/src/icu_util.cc4
-rw-r--r--chromium/v8/src/objects.cc27
-rw-r--r--chromium/v8/src/objects.h2
-rw-r--r--chromium/v8/src/objects/map-inl.h53
-rw-r--r--chromium/v8/src/parsing/parser-base.h30
-rw-r--r--chromium/v8/src/profiler/heap-snapshot-generator.cc2
-rw-r--r--chromium/v8/src/profiler/sampling-heap-profiler.cc23
-rw-r--r--chromium/v8/src/wasm/wasm-serialization.cc1
-rw-r--r--chromium/v8/src/x64/macro-assembler-x64.cc14
745 files changed, 82335 insertions, 3048 deletions
diff --git a/chromium/DEPS b/chromium/DEPS
index 8b4685ff7cd..36012f92844 100644
--- a/chromium/DEPS
+++ b/chromium/DEPS
@@ -14,7 +14,7 @@ vars = {
'buildtools_revision':
'437a616be5b2056336ed3ca5c33c41f7788ede09',
'catapult_revision':
- 'b4706e73204bf551ca2f85fce8cbe23ef7d0df31',
+ '12ffa89339910751ca0516770d7b8877f4dd25a3',
'checkout_configuration':
'default',
'checkout_instrumented_libraries':
@@ -234,7 +234,7 @@ deps = {
'src/third_party/breakpad/breakpad':
(Var("chromium_git")) + '/breakpad/breakpad.git@4a02ec03038d9d6f870f42d5070591512f488db0',
'src/third_party/catapult':
- (Var("chromium_git")) + '/catapult.git@b4706e73204bf551ca2f85fce8cbe23ef7d0df31',
+ (Var("chromium_git")) + '/catapult.git@12ffa89339910751ca0516770d7b8877f4dd25a3',
'src/third_party/ced/src':
(Var("chromium_git")) + '/external/github.com/google/compact_enc_det.git@94c367a1fe3a13207f4b22604fcfd1d9f9ddf6d9',
'src/third_party/chromite': {
@@ -473,8 +473,10 @@ deps = {
(Var("chromium_git")) + '/external/github.com/cisco/openh264@2e96d62426547ac4fb5cbcd122e5f6eb68d66ee6',
'src/third_party/openmax_dl':
(Var("webrtc_git")) + '/deps/third_party/openmax.git@b611996df3b8f6b151339d22c12c21f167009cb6',
- 'src/third_party/pdfium':
- (Var("pdfium_git")) + '/pdfium.git@27d718ebb2989631d6b4d3425e1fceb4b3bc795b',
+ 'src/third_party/pdfium': {
+ 'url':
+ '{pdfium_git}/pdfium.git@ad3e2461b811a70c433e9f62c75f8ddb1d1253ab'
+ },
'src/third_party/pefile': {
'condition':
'checkout_win',
@@ -517,8 +519,10 @@ deps = {
(Var("chromium_git")) + '/external/github.com/googlei18n/sfntly.git@2439bd08ff93d4dce761dd6b825917938bd35a4f',
'src/third_party/shaderc/src':
(Var("chromium_git")) + '/external/github.com/google/shaderc.git@cd8793c34907073025af2622c28bcee64e9879a4',
- 'src/third_party/skia':
- (Var("skia_git")) + '/skia.git@8cf17a8c72b19444d51d3d064c69fcc9faaba1c9',
+ 'src/third_party/skia': {
+ 'url':
+ '{skia_git}/skia.git@567bd716a9ae4051c8629cc4e8c047be69e84cd6'
+ },
'src/third_party/smhasher/src':
(Var("chromium_git")) + '/external/smhasher.git@e87738e57558e0ec472b2fc3a643b838e5b6e88f',
'src/third_party/snappy/src':
@@ -557,8 +561,10 @@ deps = {
(Var("chromium_git")) + '/external/selenium/py.git@5fd78261a75fe08d27ca4835fb6c5ce4b42275bd',
'src/third_party/webgl/src':
(Var("chromium_git")) + '/external/khronosgroup/webgl.git@d458ada06171a85af00367251a4ed55db7fe2018',
- 'src/third_party/webrtc':
- (Var("webrtc_git")) + '/src.git@7ee493622bb721cc14bf45edf22a69118402f971',
+ 'src/third_party/webrtc': {
+ 'url':
+ '{webrtc_git}/src.git@1512bd5f912c37ac88a07fb27dbc42190a4cce58'
+ },
'src/third_party/xdg-utils': {
'condition':
'checkout_linux',
@@ -573,8 +579,10 @@ deps = {
(Var("chromium_git")) + '/chromium/deps/acid3.git@6be0a66a1ebd7ebc5abc1b2f405a945f6d871521',
'src/tools/swarming_client':
(Var("chromium_git")) + '/infra/luci/client-py.git@88229872dd17e71658fe96763feaa77915d8cbd6',
- 'src/v8':
- (Var("chromium_git")) + '/v8/v8.git@83d148d1ee4144a96cc50a8781e4879de16be099'
+ 'src/v8': {
+ 'url':
+ '{chromium_git}/v8/v8.git@9239b67b799f23961552d5f7538d001063f335c2'
+ }
}
gclient_gn_args = [
diff --git a/chromium/base/i18n/icu_util.cc b/chromium/base/i18n/icu_util.cc
index 4a1327bf156..6caf730306a 100644
--- a/chromium/base/i18n/icu_util.cc
+++ b/chromium/base/i18n/icu_util.cc
@@ -202,6 +202,8 @@ bool InitializeICUWithFileDescriptorInternal(
icu::UnicodeString(FALSE, timezone_id.data(), timezone_id.length())));
}
#endif
+ // Never try to load ICU data from files.
+ udata_setFileAccess(UDATA_ONLY_PACKAGES, &err);
return err == U_ZERO_ERROR;
}
#endif // ICU_UTIL_DATA_IMPL == ICU_UTIL_DATA_FILE
@@ -243,6 +245,8 @@ bool InitializeICUFromRawMemory(const uint8_t* raw_memory) {
UErrorCode err = U_ZERO_ERROR;
udata_setCommonData(const_cast<uint8_t*>(raw_memory), &err);
+ // Never try to load ICU data from files.
+ udata_setFileAccess(UDATA_ONLY_PACKAGES, &err);
return err == U_ZERO_ERROR;
#else
return true;
@@ -279,6 +283,8 @@ bool InitializeICU() {
UErrorCode err = U_ZERO_ERROR;
udata_setCommonData(reinterpret_cast<void*>(addr), &err);
+ // Never try to load ICU data from files.
+ udata_setFileAccess(UDATA_ONLY_PACKAGES, &err);
result = (err == U_ZERO_ERROR);
#elif (ICU_UTIL_DATA_IMPL == ICU_UTIL_DATA_STATIC)
// The ICU data is statically linked.
diff --git a/chromium/base/memory/shared_memory.h b/chromium/base/memory/shared_memory.h
index 9a4159855b6..2ab7870f4f0 100644
--- a/chromium/base/memory/shared_memory.h
+++ b/chromium/base/memory/shared_memory.h
@@ -226,7 +226,7 @@ class BASE_EXPORT SharedMemory {
// before being mapped.
bool external_section_ = false;
string16 name_;
-#else
+#elif !defined(OS_ANDROID) && !defined(OS_FUCHSIA)
// If valid, points to the same memory region as shm_, but with readonly
// permissions.
SharedMemoryHandle readonly_shm_;
diff --git a/chromium/base/memory/shared_memory_android.cc b/chromium/base/memory/shared_memory_android.cc
index c426ac3bcce..c126767c6b3 100644
--- a/chromium/base/memory/shared_memory_android.cc
+++ b/chromium/base/memory/shared_memory_android.cc
@@ -33,21 +33,13 @@ bool SharedMemory::Create(const SharedMemoryCreateOptions& options) {
return false;
}
- int err = ashmem_set_prot_region(shm_.GetHandle(),
- PROT_READ | PROT_WRITE | PROT_EXEC);
+ int flags = PROT_READ | PROT_WRITE | (options.executable ? PROT_EXEC : 0);
+ int err = ashmem_set_prot_region(shm_.GetHandle(), flags);
if (err < 0) {
DLOG(ERROR) << "Error " << err << " when setting protection of ashmem";
return false;
}
- // Android doesn't appear to have a way to drop write access on an ashmem
- // segment for a single descriptor. http://crbug.com/320865
- readonly_shm_ = shm_.Duplicate();
- if (!readonly_shm_.IsValid()) {
- DPLOG(ERROR) << "dup() failed";
- return false;
- }
-
requested_size_ = options.size;
return true;
@@ -65,4 +57,19 @@ bool SharedMemory::Open(const std::string& name, bool read_only) {
return false;
}
+void SharedMemory::Close() {
+ if (shm_.IsValid()) {
+ shm_.Close();
+ shm_ = SharedMemoryHandle();
+ }
+}
+
+SharedMemoryHandle SharedMemory::GetReadOnlyHandle() const {
+ // There are no read-only Ashmem descriptors on Android.
+ // Instead, the protection mask is a property of the region itself.
+ SharedMemoryHandle handle = shm_.Duplicate();
+ handle.SetReadOnly();
+ return handle;
+}
+
} // namespace base
diff --git a/chromium/base/memory/shared_memory_handle.h b/chromium/base/memory/shared_memory_handle.h
index 22b9737b4b9..e8b1a797c9c 100644
--- a/chromium/base/memory/shared_memory_handle.h
+++ b/chromium/base/memory/shared_memory_handle.h
@@ -174,6 +174,21 @@ class BASE_EXPORT SharedMemoryHandle {
size_t size,
const base::UnguessableToken& guid);
AHardwareBuffer* GetMemoryObject() const;
+
+ // Marks the current file descriptor as read-only, for the purpose of
+ // mapping. This is independent of the region's read-only status.
+ void SetReadOnly() { read_only_ = true; }
+
+ // Returns true iff the descriptor is to be used for read-only
+ // mappings.
+ bool IsReadOnly() const { return read_only_; }
+
+ // Returns true iff the corresponding region is read-only.
+ bool IsRegionReadOnly() const;
+
+ // Try to set the region read-only. This will fail any future attempt
+ // at read-write mapping.
+ bool SetRegionReadOnly() const;
#endif
#if defined(OS_POSIX) && !defined(OS_FUCHSIA)
@@ -199,6 +214,8 @@ class BASE_EXPORT SharedMemoryHandle {
private:
#if defined(OS_MACOSX) && !defined(OS_IOS)
friend class SharedMemory;
+ friend bool CheckReadOnlySharedMemoryHandleForTesting(
+ SharedMemoryHandle handle);
Type type_ = MACH;
@@ -218,6 +235,8 @@ class BASE_EXPORT SharedMemoryHandle {
};
};
#elif defined(OS_ANDROID)
+ friend class SharedMemory;
+
// Each instance of a SharedMemoryHandle is either INVALID, or backed by an
// ashmem fd, or backed by an AHardwareBuffer. |type_| determines the backing
// member.
@@ -225,6 +244,7 @@ class BASE_EXPORT SharedMemoryHandle {
FileDescriptor file_descriptor_;
AHardwareBuffer* memory_object_ = nullptr;
bool ownership_passes_to_ipc_ = false;
+ bool read_only_ = false;
#elif defined(OS_FUCHSIA)
zx_handle_t handle_ = ZX_HANDLE_INVALID;
bool ownership_passes_to_ipc_ = false;
diff --git a/chromium/base/memory/shared_memory_handle_android.cc b/chromium/base/memory/shared_memory_handle_android.cc
index 69d32032c6d..2704213fc0b 100644
--- a/chromium/base/memory/shared_memory_handle_android.cc
+++ b/chromium/base/memory/shared_memory_handle_android.cc
@@ -4,6 +4,7 @@
#include "base/memory/shared_memory_handle.h"
+#include <sys/mman.h>
#include <unistd.h>
#include "base/android/android_hardware_buffer_compat.h"
@@ -11,9 +12,19 @@
#include "base/posix/eintr_wrapper.h"
#include "base/posix/unix_domain_socket.h"
#include "base/unguessable_token.h"
+#include "third_party/ashmem/ashmem.h"
namespace base {
+static int GetAshmemRegionProtectionMask(int fd) {
+ int prot = ashmem_get_prot_region(fd);
+ if (prot < 0) {
+ DPLOG(ERROR) << "ashmem_get_prot_region";
+ return -1;
+ }
+ return prot;
+}
+
SharedMemoryHandle::SharedMemoryHandle() {}
SharedMemoryHandle::SharedMemoryHandle(
@@ -154,11 +165,15 @@ SharedMemoryHandle SharedMemoryHandle::Duplicate() const {
return SharedMemoryHandle();
case Type::ASHMEM: {
DCHECK(IsValid());
+ SharedMemoryHandle result;
int duped_handle = HANDLE_EINTR(dup(file_descriptor_.fd));
- if (duped_handle < 0)
- return SharedMemoryHandle();
- return SharedMemoryHandle(FileDescriptor(duped_handle, true), GetSize(),
- GetGUID());
+ if (duped_handle >= 0) {
+ result = SharedMemoryHandle(FileDescriptor(duped_handle, true),
+ GetSize(), GetGUID());
+ if (IsReadOnly())
+ result.SetReadOnly();
+ }
+ return result;
}
case Type::ANDROID_HARDWARE_BUFFER:
DCHECK(IsValid());
@@ -195,4 +210,33 @@ bool SharedMemoryHandle::OwnershipPassesToIPC() const {
}
}
+bool SharedMemoryHandle::IsRegionReadOnly() const {
+ if (type_ != Type::ASHMEM)
+ return false;
+
+ int prot = GetAshmemRegionProtectionMask(file_descriptor_.fd);
+ return (prot >= 0 && (prot & PROT_WRITE) == 0);
+}
+
+bool SharedMemoryHandle::SetRegionReadOnly() const {
+ DCHECK_EQ(type_, Type::ASHMEM);
+ int fd = file_descriptor_.fd;
+ int prot = GetAshmemRegionProtectionMask(fd);
+ if (prot < 0)
+ return false;
+
+ if ((prot & PROT_WRITE) == 0) {
+ // Region is already read-only.
+ return true;
+ }
+
+ prot &= ~PROT_WRITE;
+ int ret = ashmem_set_prot_region(fd, prot);
+ if (ret != 0) {
+ DPLOG(ERROR) << "ashmem_set_prot_region";
+ return false;
+ }
+ return true;
+}
+
} // namespace base
diff --git a/chromium/base/memory/shared_memory_posix.cc b/chromium/base/memory/shared_memory_posix.cc
index f0e4f95b84f..f9d71f4739c 100644
--- a/chromium/base/memory/shared_memory_posix.cc
+++ b/chromium/base/memory/shared_memory_posix.cc
@@ -281,6 +281,22 @@ bool SharedMemory::MapAt(off_t offset, size_t bytes) {
return false;
bytes = ashmem_bytes;
}
+
+ // Sanity check. This shall catch invalid uses of the SharedMemory APIs
+ // but will not protect against direct mmap() attempts.
+ if (shm_.IsReadOnly()) {
+ // Use a DCHECK() to call writable mappings with read-only descriptors
+ // in debug builds immediately. Return an error for release builds
+ // or during unit-testing (assuming a ScopedLogAssertHandler was installed).
+ DCHECK(read_only_)
+ << "Trying to map a region writable with a read-only descriptor.";
+ if (!read_only_) {
+ return false;
+ }
+ if (!shm_.SetRegionReadOnly()) { // Ensure the region is read-only.
+ return false;
+ }
+ }
#endif
memory_ = mmap(nullptr, bytes, PROT_READ | (read_only_ ? 0 : PROT_WRITE),
@@ -326,6 +342,7 @@ SharedMemoryHandle SharedMemory::TakeHandle() {
return handle_copy;
}
+#if !defined(OS_ANDROID)
void SharedMemory::Close() {
if (shm_.IsValid()) {
shm_.Close();
@@ -337,7 +354,6 @@ void SharedMemory::Close() {
}
}
-#if !defined(OS_ANDROID)
// For the given shmem named |mem_name|, return a filename to mmap()
// (and possibly create). Modifies |filename|. Return false on
// error, or true of we are happy.
@@ -361,11 +377,11 @@ bool SharedMemory::FilePathForMemoryName(const std::string& mem_name,
*path = temp_dir.AppendASCII(name_base + mem_name);
return true;
}
-#endif // !defined(OS_ANDROID)
SharedMemoryHandle SharedMemory::GetReadOnlyHandle() const {
CHECK(readonly_shm_.IsValid());
return readonly_shm_.Duplicate();
}
+#endif // !defined(OS_ANDROID)
} // namespace base
diff --git a/chromium/base/memory/shared_memory_unittest.cc b/chromium/base/memory/shared_memory_unittest.cc
index d3c31dbd569..b8f197807df 100644
--- a/chromium/base/memory/shared_memory_unittest.cc
+++ b/chromium/base/memory/shared_memory_unittest.cc
@@ -11,12 +11,15 @@
#include "base/atomicops.h"
#include "base/base_switches.h"
+#include "base/bind.h"
#include "base/command_line.h"
+#include "base/logging.h"
#include "base/macros.h"
#include "base/memory/shared_memory_handle.h"
#include "base/process/kill.h"
#include "base/rand_util.h"
#include "base/strings/string_number_conversions.h"
+#include "base/strings/string_piece.h"
#include "base/strings/string_util.h"
#include "base/sys_info.h"
#include "base/test/multiprocess_test.h"
@@ -382,6 +385,11 @@ TEST_P(SharedMemoryTest, GetReadOnlyHandle) {
contents.size()));
EXPECT_TRUE(readonly_shmem.Unmap());
+#if defined(OS_ANDROID)
+ // On Android, mapping a region through a read-only descriptor makes the
+ // region read-only. Any writable mapping attempt should fail.
+ ASSERT_FALSE(writable_shmem.Map(contents.size()));
+#else
// Make sure the writable instance is still writable.
ASSERT_TRUE(writable_shmem.Map(contents.size()));
StringPiece new_contents = "Goodbye";
@@ -389,6 +397,7 @@ TEST_P(SharedMemoryTest, GetReadOnlyHandle) {
EXPECT_EQ(new_contents,
StringPiece(static_cast<const char*>(writable_shmem.memory()),
new_contents.size()));
+#endif
// We'd like to check that if we send the read-only segment to another
// process, then that other process can't reopen it read/write. (Since that
@@ -594,6 +603,29 @@ TEST_P(SharedMemoryTest, AnonymousExecutable) {
}
#endif // !defined(OS_IOS)
+#if defined(OS_ANDROID)
+// This test is restricted to Android since there is no way on other platforms
+// to guarantee that a region can never be mapped with PROT_EXEC. E.g. on
+// Linux, anonymous shared regions come from /dev/shm which can be mounted
+// without 'noexec'. In this case, anything can perform an mprotect() to
+// change the protection mask of a given page.
+TEST(SharedMemoryTest, AnonymousIsNotExecutableByDefault) {
+ const uint32_t kTestSize = 1 << 16;
+
+ SharedMemory shared_memory;
+ SharedMemoryCreateOptions options;
+ options.size = kTestSize;
+
+ EXPECT_TRUE(shared_memory.Create(options));
+ EXPECT_TRUE(shared_memory.Map(shared_memory.requested_size()));
+
+ errno = 0;
+ EXPECT_EQ(-1, mprotect(shared_memory.memory(), shared_memory.requested_size(),
+ PROT_READ | PROT_EXEC));
+ EXPECT_EQ(EACCES, errno);
+}
+#endif // OS_ANDROID
+
// Android supports a different permission model than POSIX for its "ashmem"
// shared memory implementation. So the tests about file permissions are not
// included on Android. Fuchsia does not use a file-backed shared memory
@@ -844,4 +876,86 @@ INSTANTIATE_TEST_CASE_P(SkipDevShm,
::testing::Values(Mode::DisableDevShm));
#endif // defined(OS_LINUX) && !defined(OS_CHROMEOS)
+#if defined(OS_ANDROID)
+TEST(SharedMemoryTest, ReadOnlyRegions) {
+ const uint32_t kDataSize = 1024;
+ SharedMemory memory;
+ SharedMemoryCreateOptions options;
+ options.size = kDataSize;
+ EXPECT_TRUE(memory.Create(options));
+
+ EXPECT_FALSE(memory.handle().IsRegionReadOnly());
+
+ // Check that it is possible to map the region directly from the fd.
+ int region_fd = memory.handle().GetHandle();
+ EXPECT_GE(region_fd, 0);
+ void* address = mmap(nullptr, kDataSize, PROT_READ | PROT_WRITE, MAP_SHARED,
+ region_fd, 0);
+ bool success = address && address != MAP_FAILED;
+ ASSERT_TRUE(address);
+ ASSERT_NE(address, MAP_FAILED);
+ if (success) {
+ EXPECT_EQ(0, munmap(address, kDataSize));
+ }
+
+ ASSERT_TRUE(memory.handle().SetRegionReadOnly());
+ EXPECT_TRUE(memory.handle().IsRegionReadOnly());
+
+ // Check that it is no longer possible to map the region read/write.
+ errno = 0;
+ address = mmap(nullptr, kDataSize, PROT_READ | PROT_WRITE, MAP_SHARED,
+ region_fd, 0);
+ success = address && address != MAP_FAILED;
+ ASSERT_FALSE(success);
+ ASSERT_EQ(EPERM, errno);
+ if (success) {
+ EXPECT_EQ(0, munmap(address, kDataSize));
+ }
+}
+
+TEST(SharedMemoryTest, ReadOnlyDescriptors) {
+ const uint32_t kDataSize = 1024;
+ SharedMemory memory;
+ SharedMemoryCreateOptions options;
+ options.size = kDataSize;
+ EXPECT_TRUE(memory.Create(options));
+
+ EXPECT_FALSE(memory.handle().IsRegionReadOnly());
+
+ // Getting a read-only descriptor should not make the region read-only itself.
+ SharedMemoryHandle ro_handle = memory.GetReadOnlyHandle();
+ EXPECT_FALSE(memory.handle().IsRegionReadOnly());
+
+ // Mapping a writable region from a read-only descriptor should not
+ // be possible, it will DCHECK() in debug builds (see test below),
+ // while returning false on release ones.
+ {
+ bool dcheck_fired = false;
+ logging::ScopedLogAssertHandler log_assert(
+ base::BindRepeating([](bool* flag, const char*, int, base::StringPiece,
+ base::StringPiece) { *flag = true; },
+ base::Unretained(&dcheck_fired)));
+
+ SharedMemory rw_region(ro_handle.Duplicate(), /* read_only */ false);
+ EXPECT_FALSE(rw_region.Map(kDataSize));
+ EXPECT_EQ(DCHECK_IS_ON() ? true : false, dcheck_fired);
+ }
+
+ // Nor shall it turn the region read-only itself.
+ EXPECT_FALSE(ro_handle.IsRegionReadOnly());
+
+ // Mapping a read-only region from a read-only descriptor should work.
+ SharedMemory ro_region(ro_handle.Duplicate(), /* read_only */ true);
+ EXPECT_TRUE(ro_region.Map(kDataSize));
+
+ // And it should turn the region read-only too.
+ EXPECT_TRUE(ro_handle.IsRegionReadOnly());
+ EXPECT_TRUE(memory.handle().IsRegionReadOnly());
+ EXPECT_FALSE(memory.Map(kDataSize));
+
+ ro_handle.Close();
+}
+
+#endif // OS_ANDROID
+
} // namespace base
diff --git a/chromium/base/metrics/field_trial.cc b/chromium/base/metrics/field_trial.cc
index 7f7b372da00..0214f5a876c 100644
--- a/chromium/base/metrics/field_trial.cc
+++ b/chromium/base/metrics/field_trial.cc
@@ -229,7 +229,20 @@ bool DeserializeGUIDFromStringPieces(base::StringPiece first,
*guid = base::UnguessableToken::Deserialize(high, low);
return true;
}
-#endif
+
+// Extract a read-only SharedMemoryHandle from an existing |shared_memory|
+// handle. Note that on Android, this also makes the whole region read-only.
+SharedMemoryHandle GetSharedMemoryReadOnlyHandle(SharedMemory* shared_memory) {
+ SharedMemoryHandle result = shared_memory->GetReadOnlyHandle();
+#if defined(OS_ANDROID)
+ // On Android, turn the region read-only. This prevents any future
+ // writable mapping attempts, but the original one in |shm| survives
+ // and is still usable in the current process.
+ result.SetRegionReadOnly();
+#endif // OS_ANDROID
+ return result;
+}
+#endif // !OS_NACL
} // namespace
@@ -1306,10 +1319,8 @@ void FieldTrialList::InstantiateFieldTrialAllocatorIfNeeded() {
global_->field_trial_allocator_.get());
#if !defined(OS_NACL)
- // Set |readonly_allocator_handle_| so we can pass it to be inherited and
- // via the command line.
- global_->readonly_allocator_handle_ =
- global_->field_trial_allocator_->shared_memory()->GetReadOnlyHandle();
+ global_->readonly_allocator_handle_ = GetSharedMemoryReadOnlyHandle(
+ global_->field_trial_allocator_->shared_memory());
#endif
}
diff --git a/chromium/base/metrics/field_trial.h b/chromium/base/metrics/field_trial.h
index f794803f315..c58666ce255 100644
--- a/chromium/base/metrics/field_trial.h
+++ b/chromium/base/metrics/field_trial.h
@@ -650,6 +650,7 @@ class BASE_EXPORT FieldTrialList {
FRIEND_TEST_ALL_PREFIXES(FieldTrialListTest, ClearParamsFromSharedMemory);
FRIEND_TEST_ALL_PREFIXES(FieldTrialListTest,
SerializeSharedMemoryHandleMetadata);
+ FRIEND_TEST_ALL_PREFIXES(FieldTrialListTest, CheckReadOnlySharedMemoryHandle);
// Serialization is used to pass information about the handle to child
// processes. It passes a reference to the relevant OS resource, and it passes
diff --git a/chromium/base/metrics/field_trial_unittest.cc b/chromium/base/metrics/field_trial_unittest.cc
index 56f727840d2..406f5616664 100644
--- a/chromium/base/metrics/field_trial_unittest.cc
+++ b/chromium/base/metrics/field_trial_unittest.cc
@@ -20,6 +20,8 @@
#include "base/test/gtest_util.h"
#include "base/test/mock_entropy_provider.h"
#include "base/test/scoped_feature_list.h"
+#include "base/test/test_shared_memory_util.h"
+#include "build/build_config.h"
#include "testing/gtest/include/gtest/gtest.h"
namespace base {
@@ -75,7 +77,7 @@ class TestFieldTrialObserver : public FieldTrialList::Observer {
} // namespace
-class FieldTrialTest : public testing::Test {
+class FieldTrialTest : public ::testing::Test {
public:
FieldTrialTest() : trial_list_(nullptr) {}
@@ -1383,4 +1385,25 @@ TEST(FieldTrialListTest, SerializeSharedMemoryHandleMetadata) {
}
#endif // !defined(OS_NACL)
+// Verify that the field trial shared memory handle is really read-only, and
+// does not allow writable mappings. Test disabled on NaCl, Windows and Fuchsia
+// which don't support/implement GetFieldTrialHandle(). For Fuchsia, see
+// crbug.com/752368
+#if !defined(OS_NACL) && !defined(OS_WIN) && !defined(OS_FUCHSIA)
+TEST(FieldTrialListTest, CheckReadOnlySharedMemoryHandle) {
+ FieldTrialList field_trial_list(nullptr);
+ FieldTrialList::CreateFieldTrial("Trial1", "Group1");
+
+ test::ScopedFeatureList scoped_feature_list;
+ scoped_feature_list.Init();
+
+ FieldTrialList::InstantiateFieldTrialAllocatorIfNeeded();
+
+ SharedMemoryHandle handle = FieldTrialList::GetFieldTrialHandle();
+ ASSERT_TRUE(handle.IsValid());
+
+ ASSERT_TRUE(CheckReadOnlySharedMemoryHandleForTesting(handle));
+}
+#endif // !OS_NACL && !OS_WIN && !OS_FUCHSIA
+
} // namespace base
diff --git a/chromium/base/test/BUILD.gn b/chromium/base/test/BUILD.gn
index e260022971a..e6e7752aa8b 100644
--- a/chromium/base/test/BUILD.gn
+++ b/chromium/base/test/BUILD.gn
@@ -117,6 +117,8 @@ static_library("test_support") {
"test_pending_task.h",
"test_reg_util_win.cc",
"test_reg_util_win.h",
+ "test_shared_memory_util.cc",
+ "test_shared_memory_util.h",
"test_shortcut_win.cc",
"test_shortcut_win.h",
"test_simple_task_runner.cc",
diff --git a/chromium/build/config/android/internal_rules.gni b/chromium/build/config/android/internal_rules.gni
index 6278645c5db..bcf42f48f70 100644
--- a/chromium/build/config/android/internal_rules.gni
+++ b/chromium/build/config/android/internal_rules.gni
@@ -1437,7 +1437,7 @@ if (enable_java_templates) {
])
script = "//build/android/gyp/process_resources.py"
- depfile = "$target_gen_dir/$target_name.d"
+ depfile = "$target_gen_dir/${invoker.target_name}_1.d"
outputs = []
_all_resource_dirs = []
sources = []
@@ -1658,7 +1658,7 @@ if (enable_java_templates) {
if (defined(_packaged_resources_path) && _post_process) {
action(target_name) {
- depfile = "${target_gen_dir}/${target_name}.d"
+ depfile = "${target_gen_dir}/${invoker.target_name}_2.d"
script = invoker.post_process_script
args = [
"--depfile",
diff --git a/chromium/build/util/LASTCHANGE b/chromium/build/util/LASTCHANGE
index fab4362c3d9..48795aa613c 100644
--- a/chromium/build/util/LASTCHANGE
+++ b/chromium/build/util/LASTCHANGE
@@ -1 +1 @@
-LASTCHANGE=31566ac6591be7f470f68e5aefda035c36058ddc-
+LASTCHANGE=a0bb379a4de011b41ea07da28716e685a1cf4579-
diff --git a/chromium/cc/scheduler/scheduler_state_machine.h b/chromium/cc/scheduler/scheduler_state_machine.h
index a408e304b26..3c763683945 100644
--- a/chromium/cc/scheduler/scheduler_state_machine.h
+++ b/chromium/cc/scheduler/scheduler_state_machine.h
@@ -402,7 +402,7 @@ class CC_EXPORT SchedulerStateMachine {
bool did_submit_in_last_frame_ = false;
bool needs_impl_side_invalidation_ = false;
bool next_invalidation_needs_first_draw_on_activation_ = false;
- bool should_defer_invalidation_for_fast_main_frame_ = false;
+ bool should_defer_invalidation_for_fast_main_frame_ = true;
// Set to true if the main thread fails to respond with a commit or abort the
// main frame before the draw deadline on the previous impl frame.
diff --git a/chromium/cc/scheduler/scheduler_state_machine_unittest.cc b/chromium/cc/scheduler/scheduler_state_machine_unittest.cc
index 8c4064cef7e..aee47f6fdda 100644
--- a/chromium/cc/scheduler/scheduler_state_machine_unittest.cc
+++ b/chromium/cc/scheduler/scheduler_state_machine_unittest.cc
@@ -2359,6 +2359,7 @@ TEST(SchedulerStateMachineTest, ImplSideInvalidationWhenPendingTreeExists) {
// Since there is no main frame request, this should perform impl-side
// invalidations.
+ state.set_should_defer_invalidation_for_fast_main_frame(false);
state.IssueNextBeginImplFrame();
EXPECT_ACTION_UPDATE_STATE(
SchedulerStateMachine::Action::PERFORM_IMPL_SIDE_INVALIDATION);
diff --git a/chromium/cc/scheduler/scheduler_unittest.cc b/chromium/cc/scheduler/scheduler_unittest.cc
index e58941d2d29..04ec8ea1bee 100644
--- a/chromium/cc/scheduler/scheduler_unittest.cc
+++ b/chromium/cc/scheduler/scheduler_unittest.cc
@@ -3918,5 +3918,21 @@ TEST_F(SchedulerTest,
EXPECT_ACTIONS("WillBeginImplFrame");
}
+TEST_F(SchedulerTest, SynchronousCompositorImplSideInvalidation) {
+ // Synchronous compositor doesn't have a deadline and our heuristics can't
+ // work. We should never be prioritizing impl-side invalidations over main
+ // frames.
+ scheduler_settings_.using_synchronous_renderer_compositor = true;
+ SetUpScheduler(EXTERNAL_BFS);
+
+ fake_compositor_timing_history_->SetAllEstimatesTo(kSlowDuration);
+ scheduler_->SetNeedsBeginMainFrame();
+ const bool needs_first_draw_on_activation = true;
+ scheduler_->SetNeedsImplSideInvalidation(needs_first_draw_on_activation);
+ client_->Reset();
+ EXPECT_SCOPED(AdvanceFrame());
+ EXPECT_ACTIONS("WillBeginImplFrame", "ScheduledActionSendBeginMainFrame");
+}
+
} // namespace
} // namespace cc
diff --git a/chromium/cc/trees/layer_tree_host_impl.cc b/chromium/cc/trees/layer_tree_host_impl.cc
index 5482b96da89..06d59301904 100644
--- a/chromium/cc/trees/layer_tree_host_impl.cc
+++ b/chromium/cc/trees/layer_tree_host_impl.cc
@@ -862,10 +862,16 @@ bool LayerTreeHostImpl::HasDamage(bool handle_visibility_changed) const {
bool must_always_swap =
layer_tree_frame_sink_->capabilities().must_always_swap;
+ // If we have a new LocalSurfaceId, we must always submit a CompositorFrame
+ // because the parent is blocking on us.
+ bool local_surface_id_changed =
+ settings_.enable_surface_synchronization &&
+ (last_draw_local_surface_id_ != active_tree->local_surface_id());
+
return !root_surface_has_contributing_layers ||
!root_surface_has_no_visible_damage ||
active_tree_->property_trees()->effect_tree.HasCopyRequests() ||
- must_always_swap || hud_wants_to_draw_;
+ must_always_swap || hud_wants_to_draw_ || local_surface_id_changed;
}
DrawResult LayerTreeHostImpl::CalculateRenderPasses(FrameData* frame) {
@@ -1929,6 +1935,7 @@ bool LayerTreeHostImpl::DrawLayers(FrameData* frame) {
active_tree()->local_surface_id().is_valid()) {
layer_tree_frame_sink_->SetLocalSurfaceId(
active_tree()->local_surface_id());
+ last_draw_local_surface_id_ = active_tree()->local_surface_id();
}
if (const char* client_name = GetClientNameForMetrics()) {
size_t total_quad_count = 0;
diff --git a/chromium/cc/trees/layer_tree_host_impl.h b/chromium/cc/trees/layer_tree_host_impl.h
index abae9212c9b..41d6de7f90e 100644
--- a/chromium/cc/trees/layer_tree_host_impl.h
+++ b/chromium/cc/trees/layer_tree_host_impl.h
@@ -975,6 +975,8 @@ class CC_EXPORT LayerTreeHostImpl
// to zero when no more presentation tokens are in flight.
uint32_t last_presentation_token_ = 0u;
+ viz::LocalSurfaceId last_draw_local_surface_id_;
+
DISALLOW_COPY_AND_ASSIGN(LayerTreeHostImpl);
};
diff --git a/chromium/cc/trees/layer_tree_host_unittest.cc b/chromium/cc/trees/layer_tree_host_unittest.cc
index 94e20f1d7bd..3e733b65d02 100644
--- a/chromium/cc/trees/layer_tree_host_unittest.cc
+++ b/chromium/cc/trees/layer_tree_host_unittest.cc
@@ -8515,5 +8515,43 @@ class DontUpdateLayersWithEmptyBounds : public LayerTreeTest {
SINGLE_AND_MULTI_THREAD_TEST_F(DontUpdateLayersWithEmptyBounds);
+// Verifies that if we have a new LocalSurfaceId we submit a CompositorFrame
+// even if there is no damage.
+class LayerTreeHostTestNewLocalSurfaceIdForcesDraw : public LayerTreeHostTest {
+ public:
+ LayerTreeHostTestNewLocalSurfaceIdForcesDraw() {}
+
+ void InitializeSettings(LayerTreeSettings* settings) override {
+ settings->enable_surface_synchronization = true;
+ }
+
+ void BeginTest() override {
+ layer_tree_host()->SetViewportSize(gfx::Size(10, 10));
+ layer_tree_host()->root_layer()->SetBounds(gfx::Size(10, 10));
+ local_surface_id_ = allocator_.GenerateId();
+ PostSetLocalSurfaceIdToMainThread(local_surface_id_);
+ }
+
+ void DidReceiveCompositorFrameAck() override {
+ switch (layer_tree_host()->SourceFrameNumber()) {
+ case 1:
+ local_surface_id_ = allocator_.GenerateId();
+ PostSetLocalSurfaceIdToMainThread(local_surface_id_);
+ break;
+ case 2:
+ EndTest();
+ break;
+ default:
+ NOTREACHED();
+ }
+ }
+
+ void AfterTest() override {}
+ viz::LocalSurfaceId local_surface_id_;
+ viz::ParentLocalSurfaceIdAllocator allocator_;
+};
+
+SINGLE_AND_MULTI_THREAD_TEST_F(LayerTreeHostTestNewLocalSurfaceIdForcesDraw);
+
} // namespace
} // namespace cc
diff --git a/chromium/chrome/VERSION b/chromium/chrome/VERSION
index e55b4c510c0..8355e122f99 100644
--- a/chromium/chrome/VERSION
+++ b/chromium/chrome/VERSION
@@ -1,4 +1,4 @@
MAJOR=65
MINOR=0
BUILD=3325
-PATCH=40
+PATCH=75
diff --git a/chromium/chrome/app/resources/chromium_strings_ar.xtb b/chromium/chrome/app/resources/chromium_strings_ar.xtb
index d95f7f05b31..dce5ff4915f 100644
--- a/chromium/chrome/app/resources/chromium_strings_ar.xtb
+++ b/chromium/chrome/app/resources/chromium_strings_ar.xtb
@@ -153,7 +153,7 @@
<translation id="6334986366598267305">â€Ø§Ù„آن أصبح استخدام Chromium مع حسابك ÙÙŠ Google ÙˆÙÙŠ أجهزة الكمبيوتر المشتركة أكثر سهولة.</translation>
<translation id="6373523479360886564">â€Ù‡Ù„ تريد Ùعلًا إزالة ChromiumØŸ</translation>
<translation id="6394232988457703198">â€ÙŠØ¬Ø¨ إعادة تشغيل Chromium الآن.</translation>
-<translation id="6400072781405947421">â€Ù‚د لا يعمل Chromium بشكل٠صحيح لأنه أصبح غير معتمد على نظام التشغيل Mac OS X 10.9.</translation>
+<translation id="6400072781405947421">â€Ù‚د لا يعمل Chromium بشكل٠صحيح لأنه لم يعÙد متاحًا على نظام التشغيل Mac OS X 10.9.</translation>
<translation id="6403826409255603130">†إن Chromium هو متصÙØ­ ويب يشغّل صÙحات الويب والتطبيقات بسرعة مذهلة. إنه سريع وثابت وسهل الاستخدام. يمكنك تصÙØ­ الويب بشكل أكثر أمانًا من خلال ميزات الحماية من البرامج الضارة والتصيّد الاحتيالي المدمجة ÙÙŠ Chromium.</translation>
<translation id="6475912303565314141">â€ÙƒÙ…ا أنها تتحكم ÙÙŠ الصÙحة التي تظهر عند تشغيل Chromium.</translation>
<translation id="6485906693002546646">â€Ø£Ù†Øª تستخدم <ph name="PROFILE_EMAIL" /> لمزامنة عناصرك ÙÙŠ Chromium. لتحديث تÙضيل المزامنة أو استخدام Chromium بدون حساب GoogleØŒ ÙŠÙرجى الانتقال إلى <ph name="SETTINGS_LINK" />.</translation>
diff --git a/chromium/chrome/app/resources/chromium_strings_bg.xtb b/chromium/chrome/app/resources/chromium_strings_bg.xtb
index 755a31ba8bd..9ca4afc114f 100644
--- a/chromium/chrome/app/resources/chromium_strings_bg.xtb
+++ b/chromium/chrome/app/resources/chromium_strings_bg.xtb
@@ -151,6 +151,7 @@
<translation id="6334986366598267305">Вече е по-леÑно да използвате Chromium Ñ Ð¿Ñ€Ð¾Ñ„Ð¸Ð»Ð° Ñи в Google и на Ñподелени компютри.</translation>
<translation id="6373523479360886564">ÐаиÑтина ли иÑкате да деинÑталирате Chromium?</translation>
<translation id="6394232988457703198">ТрÑбва да реÑтартирате Chromium Ñега.</translation>
+<translation id="6400072781405947421">Chromium може да не функционира правилно, защото вече не Ñе поддържа под Mac OS X 10.9.</translation>
<translation id="6403826409255603130">Chromium е уеб браузър, който зарежда уеб Ñтраници и изпълнÑва Ð¿Ñ€Ð¸Ð»Ð¾Ð¶ÐµÐ½Ð¸Ñ ÑÑŠÑ Ñветкавична ÑкороÑÑ‚. Той е бърз, Ñтабилен и леÑен за употреба. Сърфирайте в мрежата по-безопаÑно Ñ Ð²Ð³Ñ€Ð°Ð´ÐµÐ½Ð°Ñ‚Ð° защита на Chromium Ñрещу злонамерен Ñофтуер и фишинг.</translation>
<translation id="6475912303565314141">То Ñъщо контролира ÐºÐ¾Ñ Ñтраница Ñе показва при Ñтартиране на Chromium.</translation>
<translation id="6485906693002546646">Използвате <ph name="PROFILE_EMAIL" /> за Ñинхронизиране на нещата Ñи в Chromium. За да актуализирате Ñъответното предпочитание или да ползвате браузъра без профил в Google, поÑетете <ph name="SETTINGS_LINK" />.</translation>
diff --git a/chromium/chrome/app/resources/chromium_strings_bn.xtb b/chromium/chrome/app/resources/chromium_strings_bn.xtb
index 2f26612a12b..9e0573fa6a1 100644
--- a/chromium/chrome/app/resources/chromium_strings_bn.xtb
+++ b/chromium/chrome/app/resources/chromium_strings_bn.xtb
@@ -153,6 +153,7 @@
<translation id="6334986366598267305">à¦à¦–ন আপনার Google অà§à¦¯à¦¾à¦•à¦¾à¦‰à¦¨à§à¦Ÿ ও শেয়ার করা কমà§à¦ªà¦¿à¦‰à¦Ÿà¦¾à¦°à¦—à§à¦²à¦¿à¦¤à§‡ Chromium বà§à¦¯à¦¬à¦¹à¦¾à¦° করা আরও সহজ৷</translation>
<translation id="6373523479360886564">আপনি কি Chromium আনইনসà§à¦Ÿà¦² করার বà§à¦¯à¦¾à¦ªà¦¾à¦°à§‡ নিশà§à¦šà¦¿à¦¤?</translation>
<translation id="6394232988457703198">আপনার à¦à¦–নই Chromium আবার চালৠকরা উচিত হবে।</translation>
+<translation id="6400072781405947421">Chromium সঠিকভাবে কাজ নাও করতে পারে কারণ à¦à¦Ÿà¦¿ à¦à¦–ন আর Mac OS X 10.9 ঠসমরà§à¦¥à¦¿à¦¤ নয়।</translation>
<translation id="6403826409255603130">Chromium হল à¦à¦•à¦Ÿà¦¿ ওয়েব বà§à¦°à¦¾à¦‰à¦œà¦¾à¦° যা ওয়েব পৃষà§à¦ à¦¾à¦° গতি à¦à¦¬à¦‚ অà§à¦¯à¦¾à¦ªà§à¦²à¦¿à¦•à§‡à¦¶à¦¨à¦—à§à¦²à¦¿à¦•à§‡ আলোকের গতিতে সঞà§à¦šà¦¾à¦²à¦¿à¦¤ করে৷ à¦à¦Ÿà¦¾ দà§à¦°à§à¦¤, সà§à¦¥à¦¿à¦¤à¦¿à¦¶à§€à¦², à¦à¦¬à¦‚ সহজে বà§à¦¯à¦¬à¦¹à¦¾à¦°à§‡à¦° যোগà§à¦¯à§· Chromium নিরà§à¦®à¦¿à¦¤ মà§à¦¯à¦¾à¦²à¦“য়ার à¦à¦¬à¦‚ ফিশিং সà§à¦°à¦•à§à¦·à¦¾à¦° সাহাযà§à¦¯à§‡ আরও সà§à¦°à¦•à§à¦·à¦¿à¦¤ ভাবে ওয়েব বà§à¦°à¦¾à¦‰à¦œ করà§à¦¨à§·</translation>
<translation id="6475912303565314141">আপনি Chromium শà§à¦°à§ করলে কোন পৃষà§à¦ à¦¾à¦Ÿà¦¿ দেখানো হবে তাও à¦à¦Ÿà¦¿ নিয়নà§à¦¤à§à¦°à¦£ করে।</translation>
<translation id="6485906693002546646">আপনার Chromium জিনিসপতà§à¦° সমনà§à¦¬à§Ÿ করার জনà§à¦¯ আপনি <ph name="PROFILE_EMAIL" /> বà§à¦¯à¦¬à¦¹à¦¾à¦° করছেন৷ আপনার সিঙà§à¦• পছনà§à¦¦à¦—à§à¦²à¦¿ আপডেট করতে বা Google অà§à¦¯à¦¾à¦•à¦¾à¦‰à¦¨à§à¦Ÿ ছাড়া Chromium বà§à¦¯à¦¬à¦¹à¦¾à¦° করতে <ph name="SETTINGS_LINK" /> ঠযান৷</translation>
diff --git a/chromium/chrome/app/resources/chromium_strings_ca.xtb b/chromium/chrome/app/resources/chromium_strings_ca.xtb
index 7928c910eb1..d0bc06d7614 100644
--- a/chromium/chrome/app/resources/chromium_strings_ca.xtb
+++ b/chromium/chrome/app/resources/chromium_strings_ca.xtb
@@ -153,6 +153,7 @@
<translation id="6334986366598267305">Ara resulta més fàcil utilitzar Chromium amb el vostre compte de Google i en ordinadors compartits.</translation>
<translation id="6373523479360886564">Confirmeu que voleu desinstal·lar Chromium?</translation>
<translation id="6394232988457703198">Reinicieu Chromium ara</translation>
+<translation id="6400072781405947421">Pot ser que Chromium no funcioni correctament perquè ja no és compatible amb Mac OS X 10.9.</translation>
<translation id="6403826409255603130">Chromium és un navegador web que executa les pàgines web i les aplicacions a gran velocitat. És ràpid, estable i fàcil d'utilitzar. Navegueu per Internet amb més seguretat amb protecció inserida a Chromium contra el programari maliciós i contra la pesca (suplantació d'identitat).</translation>
<translation id="6475912303565314141">També controla la pàgina que es mostra quan inicieu Chromium.</translation>
<translation id="6485906693002546646">Utilitzeu <ph name="PROFILE_EMAIL" /> per sincronitzar el contingut de Chromium. Per modificar la preferència de sincronització o per utilitzar Chromium sense cap compte de Google, dirigiu-vos a <ph name="SETTINGS_LINK" />.</translation>
diff --git a/chromium/chrome/app/resources/chromium_strings_cs.xtb b/chromium/chrome/app/resources/chromium_strings_cs.xtb
index 345472a1fa7..0eaa73183c1 100644
--- a/chromium/chrome/app/resources/chromium_strings_cs.xtb
+++ b/chromium/chrome/app/resources/chromium_strings_cs.xtb
@@ -155,6 +155,7 @@ Některé funkce možná nebudou k dispozici a změny nastavení se neuloží.</
<translation id="6334986366598267305">Používání prohlížeÄe Chromium se spravovaným úÄtem Google a sdílenými poÄítaÄi je nyní snazší.</translation>
<translation id="6373523479360886564">Jste si jisti, že chcete Chromium odinstalovat?</translation>
<translation id="6394232988457703198">Nyní byste Chromium měli restartovat.</translation>
+<translation id="6400072781405947421">ProhlížeÄ Chromium nemusí fungovat správnÄ›, protože v systémech Mac OS X 10.9 již není podporován.</translation>
<translation id="6403826409255603130">Chromium je webový prohlížeÄ, který spouÅ¡tí webové stránky a aplikace rychlostí blesku. Je rychlý a snadno se používá. Prohlížejte web bezpeÄnÄ›ji díky ochranÄ› proti malwaru a phishingu integrované v prohlížeÄi Chromium.</translation>
<translation id="6475912303565314141">Také řídí, která stránka se zobrazí pÅ™i spuÅ¡tÄ›ní prohlížeÄe Chromium.</translation>
<translation id="6485906693002546646">Synchronizujete obsah a nastavení prohlížeÄe Chromium s úÄtem <ph name="PROFILE_EMAIL" />. Chcete-li možnosti synchronizace upravit nebo Chromium používat bez úÄtu Google, navÅ¡tivte <ph name="SETTINGS_LINK" />.</translation>
diff --git a/chromium/chrome/app/resources/chromium_strings_da.xtb b/chromium/chrome/app/resources/chromium_strings_da.xtb
index 99280f62442..91dca21e1d0 100644
--- a/chromium/chrome/app/resources/chromium_strings_da.xtb
+++ b/chromium/chrome/app/resources/chromium_strings_da.xtb
@@ -153,6 +153,7 @@
<translation id="6334986366598267305">Det er nu blevet nemmere at bruge Chromium med din Google-konto og på delte computere.</translation>
<translation id="6373523479360886564">Er du sikker på, at du vil afinstallere Chromium?</translation>
<translation id="6394232988457703198">Du bør genstarte Chromium nu.</translation>
+<translation id="6400072781405947421">Chromium fungerer muligvis ikke korrekt, da det ikke længere understøttes af Mac OS X 10.9.</translation>
<translation id="6403826409255603130">Chromium er en webbrowser, der kører websider og applikationer med lynets hast. Den er hurtig, stabil og brugervenlig. Beskyttelse mod malware og phishing er indbygget i Chromium, så du kan søge mere sikkert på internettet.</translation>
<translation id="6475912303565314141">Den styrer også, hvilken side der vises, når du åbner Chromium.</translation>
<translation id="6485906693002546646">Du bruger <ph name="PROFILE_EMAIL" /> til at synkronisere dine Chromium-ting med. Gå til <ph name="SETTINGS_LINK" />, hvis du vil opdatere dine synkroniseringspræference eller bruge Chromium uden en Google-konto.</translation>
diff --git a/chromium/chrome/app/resources/chromium_strings_el.xtb b/chromium/chrome/app/resources/chromium_strings_el.xtb
index 9036ea92de0..638c8d0d74d 100644
--- a/chromium/chrome/app/resources/chromium_strings_el.xtb
+++ b/chromium/chrome/app/resources/chromium_strings_el.xtb
@@ -153,6 +153,7 @@
<translation id="6334986366598267305">ΤώÏα μποÏείτε να χÏησιμοποιείτε πιο εÏκολα το Chromium με το ΛογαÏιασμό σας Google και σε κοινόχÏηστους υπολογιστές.</translation>
<translation id="6373523479360886564">Είστε βέβαιοι ότι θέλετε να καταÏγήσετε την εγκατάσταση του Chromium;</translation>
<translation id="6394232988457703198">ΤώÏα θα Ï€Ïέπει να επανεκκινήσετε το Chromium.</translation>
+<translation id="6400072781405947421">Το Chromium μποÏεί να μην λειτουÏγεί σωστά επειδή δεν υποστηÏίζεται πλέον στο Mac OS X 10.9.</translation>
<translation id="6403826409255603130">Το Chromium είναι ένα Ï€ÏόγÏαμμα πεÏιήγησης Î¹ÏƒÏ„Î¿Ï Ï€Î¿Ï… εκτελεί εφαÏμογές και ιστοσελίδες με απίστευτη ταχÏτητα. Είναι γÏήγοÏο, σταθεÏÏŒ και εÏχÏηστο. ΠεÏιηγηθείτε στον ιστό με μεγαλÏτεÏη ασφάλεια με την ενσωματωμένη Ï€Ïοστασία από κακόβουλα Ï€ÏογÏάμματα και ηλεκτÏονικό "ψάÏεμα" (phishing).</translation>
<translation id="6475912303565314141">Επίσης, ελέγχει τη σελίδα που εμφανίζεται κατά την εκκίνηση του Chromium.</translation>
<translation id="6485906693002546646">ΧÏησιμοποιείτε το Ï€Ïοφίλ <ph name="PROFILE_EMAIL" /> για το συγχÏονισμό του πεÏιεχομένου σας στο Chromium. Για να ενημεÏώσετε τις Ï€Ïοτιμήσεις συγχÏÎ¿Î½Î¹ÏƒÎ¼Î¿Ï Î® για να χÏησιμοποιήστε το Chromium χωÏίς ΛογαÏιασμό Google, μεταβείτε στην πεÏιοχή <ph name="SETTINGS_LINK" />.</translation>
diff --git a/chromium/chrome/app/resources/chromium_strings_es-419.xtb b/chromium/chrome/app/resources/chromium_strings_es-419.xtb
index e5574671d4c..6fcbc303941 100644
--- a/chromium/chrome/app/resources/chromium_strings_es-419.xtb
+++ b/chromium/chrome/app/resources/chromium_strings_es-419.xtb
@@ -151,6 +151,7 @@
<translation id="6334986366598267305">Ahora es más sencillo utilizar Chromium con la cuenta de Google y en computadoras compartidas.</translation>
<translation id="6373523479360886564">¿Estás seguro de que deseas desinstalar Chromium?</translation>
<translation id="6394232988457703198">Debes reiniciar Chromium ahora.</translation>
+<translation id="6400072781405947421">Es posible que Chromium no funcione correctamente porque ya no es compatible con Mac OS X 10.9.</translation>
<translation id="6403826409255603130">Chromium es un navegador web que ejecuta páginas web y aplicaciones con la velocidad de la luz. Es rápido, estable y fácil de usar. Navega por la Web con seguridad y protección integrada contra software mailicioso y suplantación de identidad.</translation>
<translation id="6475912303565314141">También controla qué página se muestra al iniciar Chromium.</translation>
<translation id="6485906693002546646">Estás utilizando <ph name="PROFILE_EMAIL" /> para sincronizar los datos de Chromium. Si quieres actualizar las preferencias de sincronización o utilizar Chromium sin una cuenta de Google, accede a <ph name="SETTINGS_LINK" />.</translation>
diff --git a/chromium/chrome/app/resources/chromium_strings_et.xtb b/chromium/chrome/app/resources/chromium_strings_et.xtb
index 56355fc58ba..ceb2b461591 100644
--- a/chromium/chrome/app/resources/chromium_strings_et.xtb
+++ b/chromium/chrome/app/resources/chromium_strings_et.xtb
@@ -153,6 +153,7 @@
<translation id="6334986366598267305">Nüüd on Chromiumi lihtsam kasutada Google'i kontoga ja jagatud arvutistes.</translation>
<translation id="6373523479360886564">Kas soovite kindlasti Chromiumi desinstallida?</translation>
<translation id="6394232988457703198">Soovitame Chromiumi kohe taaskäivitada.</translation>
+<translation id="6400072781405947421">Chromium ei pruugi õigesti töötada, kuna seda ei toetata enam operatsioonisüsteemis Mac OS X 10.9.</translation>
<translation id="6403826409255603130">Chromium on veebibrauser, mis avab veebilehti ja rakendusi välgukiirusel. See on kiire, stabiilne ja hõlpsasti kasutatav. Sirvige veebi turvalisemalt tänu Chromiumi sisseehitatud pahavara- ja andmepüügikaitsele.</translation>
<translation id="6475912303565314141">Lisaks juhib see seda, mis leht kuvatakse Chromiumi käivitamisel.</translation>
<translation id="6485906693002546646">Kasutate Chromiumi kraami sünkroonimiseks kontot <ph name="PROFILE_EMAIL" />. Sünkroonimiseelistuste värskendamiseks või Chromiumi kasutamiseks ilma Google'i kontota avage <ph name="SETTINGS_LINK" />.</translation>
diff --git a/chromium/chrome/app/resources/chromium_strings_fil.xtb b/chromium/chrome/app/resources/chromium_strings_fil.xtb
index 8b17bade107..bcacef969b6 100644
--- a/chromium/chrome/app/resources/chromium_strings_fil.xtb
+++ b/chromium/chrome/app/resources/chromium_strings_fil.xtb
@@ -155,6 +155,7 @@ Maaaring hindi available ang ilang tampok at hindi mase-save ang mga pagbabago s
<translation id="6334986366598267305">Ngayon, mas madali nang gamitin ang Chromium sa iyong Google Account at sa mga nakabahaging computer.</translation>
<translation id="6373523479360886564">Sigurado ka bang nais mong i-uninstall ang Chromium?</translation>
<translation id="6394232988457703198">Dapat mo nang i-restart ngayon ang Chromium.</translation>
+<translation id="6400072781405947421">Maaaring hindi gumana nang maayos ang Chromium dahil hindi na ito sinusuportahan sa Mac OS X 10.9.</translation>
<translation id="6403826409255603130">Ang Chromium ay isang web browser na nagpapatakbo ng mga webpage at application sa bilis ng kidlat. Ito ay mabilis, maaasahan, at madaling gamitin. Mas maingat na mag-browse sa web gamit ang proteksyon ng Chromium laban sa malware at phishing.</translation>
<translation id="6475912303565314141">Kinokontrol din nito kung anong pahina ang ipinapakita kapag sinimulan mo ang Chromium.</translation>
<translation id="6485906693002546646">Ginagamit mo ang <ph name="PROFILE_EMAIL" /> upang i-sync ang iyong bagay sa Chromium. Upang ma-update ang iyong kagustuhan sa pag-sync o upang magamit ang Chromium nang walang Google account, bisitahin ang <ph name="SETTINGS_LINK" />.</translation>
diff --git a/chromium/chrome/app/resources/chromium_strings_gu.xtb b/chromium/chrome/app/resources/chromium_strings_gu.xtb
index d491bfabf40..08f2562185e 100644
--- a/chromium/chrome/app/resources/chromium_strings_gu.xtb
+++ b/chromium/chrome/app/resources/chromium_strings_gu.xtb
@@ -155,6 +155,7 @@
<translation id="6334986366598267305">હવે તમારા Google àªàª•àª¾àª‰àª¨à«àªŸ સાથે અને શેર કરેલ કમà«àªªà«àª¯à«àªŸàª°à«àª¸ પર Chromium નો ઉપયોગ કરવો વધૠસરળ છે.</translation>
<translation id="6373523479360886564">શà«àª‚ તમે ખરેખર તમે Chromium ને અનઇનà«àª¸à«àªŸà«‹àª² કરવા માંગો છો?</translation>
<translation id="6394232988457703198">તમારે હવે Chromium ને પà«àª¨àªƒàªªà«àª°àª¾àª°àª‚ભ કરવà«àª‚ જોઈàª.</translation>
+<translation id="6400072781405947421">Chromium યોગà«àª¯ રીતે કારà«àª¯ ન કરે તેવà«àª‚ બની શકે કારણ કે તે હવેથી Mac OS X 10.9 પર સમરà«àª¥àª¿àª¤ નથી.</translation>
<translation id="6403826409255603130">Chromium ઠàªàª• àªàªµà«àª‚ વેબ બà«àª°àª¾àª‰àªàª° છે જે પà«àª°àª•àª¾àª¶àª¨à«€ ગતિઠવેબપૃષà«àª à«‹ અને àªàªªà«àª²àª¿àª•à«‡àª¶àª‚સને ચલાવે છે. તે àªàª¡àªªà«€, સà«àª¥àª¿àª° અને ઉપયોગમાં સરળ છે. Google Chromium માં નિરà«àª®àª¿àª¤ મૉલવેર અને ફિશીંગ સà«àª°àª•à«àª·àª¾ સાથે વેબને વધૠસà«àª°àª•à«àª·àª¿àª¤ રૂપે બà«àª°àª¾àª‰àª કરો.</translation>
<translation id="6475912303565314141">જà«àª¯àª¾àª°à«‡ તમે Chromium શરૂ કરો તà«àª¯àª¾àª°à«‡ કયà«àª‚ પૃષà«àª  બતાવવામાં આવે તે તેનà«àª‚ પણ નિયંતà«àª°àª£ કરે છે.</translation>
<translation id="6485906693002546646">તમે તમારી Chromium સામગà«àª°à«€àª¨à«àª‚ સમનà«àªµàª¯àª¨ કરવા માટે <ph name="PROFILE_EMAIL" /> નો ઉપયોગ કરી રહà«àª¯àª¾àª‚ છો. તમારી સમનà«àªµàª¯àª¨ પસંદગીને અપડેટ કરવા માટે અથવા Chromium ને Google àªàª•àª¾àª‰àª¨à«àªŸ વગર ઉપયોગ કરવા માટે, <ph name="SETTINGS_LINK" /> ની મà«àª²àª¾àª•àª¾àª¤ લો.</translation>
diff --git a/chromium/chrome/app/resources/chromium_strings_hi.xtb b/chromium/chrome/app/resources/chromium_strings_hi.xtb
index e62a9f3d860..1d57da20657 100644
--- a/chromium/chrome/app/resources/chromium_strings_hi.xtb
+++ b/chromium/chrome/app/resources/chromium_strings_hi.xtb
@@ -153,7 +153,7 @@
<translation id="6334986366598267305">अब अपने Google खाते के साथ और साà¤à¤¾ किठगठकंपà¥à¤¯à¥‚टर पर कà¥à¤°à¥‹à¤®à¤¿à¤¯à¤® का उपयोग करना आसान हो गया है.</translation>
<translation id="6373523479360886564">कà¥à¤¯à¤¾ आप वाकई कà¥à¤°à¥‹à¤®à¤¿à¤¯à¤® को अनइंसà¥à¤Ÿà¤¾à¤² करना चाहते हैं?</translation>
<translation id="6394232988457703198">आपको कà¥à¤°à¥‹à¤®à¤¿à¤¯à¤® को अभी पà¥à¤¨: पà¥à¤°à¤¾à¤°à¤‚भ करना चाहिà¤.</translation>
-<translation id="6400072781405947421">हो सकता है कि कà¥à¤°à¥‹à¤®à¤¿à¤¯à¤® ठीक से काम ना करे कà¥à¤¯à¥‹à¤‚कि अब वह Mac OS X 10.9 पर समरà¥à¤¥à¤¿à¤¤ नहीं है.</translation>
+<translation id="6400072781405947421">हो सकता है कि कà¥à¤°à¥‹à¤®à¤¿à¤¯à¤® ठीक से काम ना करे कà¥à¤¯à¥‹à¤‚कि अब Mac OS X 10.9 पर इसकी सà¥à¤µà¤¿à¤§à¤¾ नहीं है.</translation>
<translation id="6403826409255603130">कà¥à¤°à¥‹à¤®à¤¿à¤¯à¤® वेब बà¥à¤°à¤¾à¤‰à¤œà¤¼à¤° है जो बहà¥à¤¤ तेज़ी से वेबपेज और à¤à¤ªà¥â€à¤²à¤¿à¤•à¥‡à¤¶à¤¨ चलाता है. यह तेज़, सà¥â€à¤¥à¤¿à¤°, और उपयोग में आसान है. कà¥à¤°à¥‹à¤®à¤¿à¤¯à¤® में अंतरà¥à¤¨à¤¿à¤¹à¤¿à¤¤ मैलवेयर और फ़ीशिंग सà¥à¤°à¤•à¥à¤·à¤¾ के साथ अधिक आसानी से वेब बà¥à¤°à¤¾à¤‰à¤œà¤¼ करें.</translation>
<translation id="6475912303565314141">इससे यह भी नियंतà¥à¤°à¤¿à¤¤ होता है कि जब आप कà¥à¤°à¥‹à¤®à¤¿à¤¯à¤® पà¥à¤°à¤¾à¤°à¤‚भ करते हैं तब कौन सा पृषà¥â€à¤  दिखाया जाà¤.</translation>
<translation id="6485906693002546646">आप अपनी कà¥à¤°à¥‹à¤®à¤¿à¤¯à¤® सामगà¥à¤°à¥€ को समनà¥à¤µà¤¯à¤¿à¤¤ करने के लिठ<ph name="PROFILE_EMAIL" /> का उपयोग कर रहे हैं. अपनी समनà¥à¤µà¤¯à¤¨ पà¥à¤°à¤¾à¤¥à¤®à¤¿à¤•à¤¤à¤¾ को अपडेट करने या Google खाते के बिना कà¥à¤°à¥‹à¤®à¤¿à¤¯à¤® का उपयोग करने के लिà¤, <ph name="SETTINGS_LINK" /> पर जाà¤à¤‚.</translation>
diff --git a/chromium/chrome/app/resources/chromium_strings_hu.xtb b/chromium/chrome/app/resources/chromium_strings_hu.xtb
index 8c320a5a17f..a357af0801b 100644
--- a/chromium/chrome/app/resources/chromium_strings_hu.xtb
+++ b/chromium/chrome/app/resources/chromium_strings_hu.xtb
@@ -153,6 +153,7 @@
<translation id="6334986366598267305">Google-fiókjával most még egyszerűbben használhatja a Chromiumot közösen használt számítógépeken.</translation>
<translation id="6373523479360886564">Biztos, hogy el szeretné távolítani a Chromiumot?</translation>
<translation id="6394232988457703198">Indítsa újra a Chromiumot most.</translation>
+<translation id="6400072781405947421">Előfordulhat, hogy a Chromium nem működik majd megfelelően, mert a továbbiakban nem támogatja a Mac OS X 10.9 rendszert.</translation>
<translation id="6403826409255603130">A Chromium olyan böngésző, amely villámgyorsan futtatja a weboldalakat és az alkalmazásokat. Gyors, stabil és könnyen használható. A beépített, adathalászat és kártékony programok elleni védelemmel biztonságosabban böngészhet az interneten.</translation>
<translation id="6475912303565314141">Továbbá azt is szabályozza, hogy melyik oldal jelenik meg a Chromium indításakor.</translation>
<translation id="6485906693002546646">Chromiumos dolgainak szinkronizálásához a(z) <ph name="PROFILE_EMAIL" /> fiókot használja. Szinkronizálási beállításainak frissítéséhez, illetve a Chromium Google-fiók nélküli használatához keresse fel a <ph name="SETTINGS_LINK" /> linket.</translation>
diff --git a/chromium/chrome/app/resources/chromium_strings_iw.xtb b/chromium/chrome/app/resources/chromium_strings_iw.xtb
index cf0c484e1f0..0d8a851af89 100644
--- a/chromium/chrome/app/resources/chromium_strings_iw.xtb
+++ b/chromium/chrome/app/resources/chromium_strings_iw.xtb
@@ -151,6 +151,7 @@
<translation id="6334986366598267305">â€×§×œ יותר כעת להשתמש ב-Chromium ב×מצעות חשבון Google שלך ×•×‘×ž×—×©×‘×™× ×ž×©×•×ª×¤×™×.</translation>
<translation id="6373523479360886564">â€×”×× ×תה בטוח שברצונך להסיר ×ת התקנת Chromium?</translation>
<translation id="6394232988457703198">â€×¢×œ×™×š ל×תחל ×ת Chromium עכשיו.</translation>
+<translation id="6400072781405947421">â€×™×™×ª×›×Ÿ ש-Chromium ×œ× ×™×¤×¢×œ כר×וי ×›×™ ×”×•× ×›×‘×¨ ×œ× × ×ª×ž×š בגירסה 10.9 של Mac OS X.</translation>
<translation id="6403826409255603130">â€Chromium ×”×•× ×“×¤×“×¤×Ÿ ×ינטרנט המפעיל דפי ×ינטרנט ו×פליקציות במהירות הבזק. זהו דפדפן מהיר, יציב וקל לשימוש. תוכל לגלוש ב×ינטרנט בצורה מ×ובטחת יותר הודות להגנה מפני תוכנות זדוניות ודיוג המובנית ב-Chromium.</translation>
<translation id="6475912303565314141">â€×”גדרה זו ×’× ×§×•×‘×¢×ª ××™×–×” דף מוצג כש×תה מפעיל ×ת Chromium.</translation>
<translation id="6485906693002546646">â€×תה משתמש ב-<ph name="PROFILE_EMAIL" /> כדי לסנכרן ×ת ×”×¤×¨×™×˜×™× ×©×œ×š ב-Chromium. עבור ×ל '<ph name="SETTINGS_LINK" />' כדי לעדכן ×ת העדפות הסנכרון ×ו להשתמש ב-Chromium ×œ×œ× ×—×©×‘×•×Ÿ Google.</translation>
diff --git a/chromium/chrome/app/resources/chromium_strings_kn.xtb b/chromium/chrome/app/resources/chromium_strings_kn.xtb
index e366c02196a..b183247d104 100644
--- a/chromium/chrome/app/resources/chromium_strings_kn.xtb
+++ b/chromium/chrome/app/resources/chromium_strings_kn.xtb
@@ -151,6 +151,7 @@
<translation id="6334986366598267305">ನಿಮà³à²® Google ಖಾತೆಯ ಮೂಲಕ ಮತà³à²¤à³ ಹಂಚಿದ ಕಂಪà³à²¯à³‚ಟರà³â€Œà²—ಳಲà³à²²à²¿ Chromium ಬಳಕೆಯೠಇದೀಗ ತà³à²‚ಬಾ ಸà³à²²à²­à²µà²¾à²—ಿದೆ.</translation>
<translation id="6373523479360886564">Chromium ಅಸà³à²¥à²¾à²ªà²¿à²¸à²²à³ ನೀವೠಖಚಿತವಾಗಿ ಬಯಸà³à²µà²¿à²°à²¾?</translation>
<translation id="6394232988457703198">ಇದೀಗ ನೀವೠChromium ಅನà³à²¨à³ ಮರà³à²ªà³à²°à²¾à²°à²‚ಭಿಸಬೇಕà³.</translation>
+<translation id="6400072781405947421">Mac OS X 10.9 ನಲà³à²²à²¿ Chromium ಇನà³à²¨à³ ಮà³à²‚ದೆ ಬೆಂಬಲಿಸದೇ ಇರà³à²µà³à²¦à²°à²¿à²‚ದ ಅದೠಸರಿಯಾಗಿ ಕಾರà³à²¯à²¨à²¿à²°à³à²µà²¹à²¿à²¸à²¦à³‡ ಇರಬಹà³à²¦à³.</translation>
<translation id="6403826409255603130">Chromium ಒಂದೠವೆಬೠಬà³à²°à³Œà²¸à²°à³ ಆಗಿದà³à²¦à³ ವೆಬà³â€Œà²ªà³à²Ÿà²—ಳನà³à²¨à³ ಮತà³à²¤à³ ಅಪà³à²²à²¿à²•à³‡à²¶à²¨à³â€Œà²—ಳನà³à²¨à³ ವೇಗದೊಂದಿಗೆ ಕಾರà³à²¯à²¨à²¿à²°à³à²µà²¹à²¿à²¸à³à²¤à³à²¤à²¦à³†. ಇದೠವೇಗವಾದ, ಸà³à²¥à²¿à²°à²µà²¾à²¦, ಮತà³à²¤à³ ಬಳಸಲೠಸà³à²²à²­à²µà²¾à²—ಿದೆ. ಮಾಲà³â€Œà²µà³‡à²°à³â€Œà²¨à³Šà²‚ದಿಗೆ ಹೆಚà³à²šà³ ಸà³à²°à²•à³à²·à²¿à²¤à²µà²¾à²—ಿ ಹಾಗೂ Chromium ನಲà³à²²à²¿ ವಿನà³à²¯à²¾à²¸à²—ೊಳಿಸಲಾದ ಫಿಶಿಂಗೠಸà³à²°à²•à³à²·à³†à²¯à³Šà²‚ದಿಗೆ ವೆಬೠಅನà³à²¨à³ ಬà³à²°à³Œà²¸à³ ಮಾಡಿ.</translation>
<translation id="6475912303565314141">ನೀವೠChromium ಪà³à²°à²¾à²°à²‚ಭಿಸಿದಾಗ ತೋರಿಸಬೇಕಾದ ಪà³à²Ÿà²µà²¨à³à²¨à³ ಕೂಡಾ ಇದೠನಿಯಂತà³à²°à²¿à²¸à³à²¤à³à²¤à²¦à³†.</translation>
<translation id="6485906693002546646">ನಿಮà³à²® Chromium ವಿಷಯವನà³à²¨à³ ಸಿಂಕೠಮಾಡಲೠನೀವೠ<ph name="PROFILE_EMAIL" /> ಅನà³à²¨à³ ಬಳಸà³à²¤à³à²¤à²¿à²°à³à²µà²¿à²°à²¿. Google ಖಾತೆ ಇಲà³à²²à²¦à³† ನಿಮà³à²® ಸಿಂಕೠಪà³à²°à²¾à²¶à²¸à³à²¤à³à²¯à²—ಳನà³à²¨à³ ನವೀಕರಿಸಲೠಅಥವಾ Chromium ಬಳಸಲà³, <ph name="SETTINGS_LINK" /> ಭೇಟಿ ನೀಡಿ.</translation>
diff --git a/chromium/chrome/app/resources/chromium_strings_ko.xtb b/chromium/chrome/app/resources/chromium_strings_ko.xtb
index 4e84f4bb11a..54e8005a414 100644
--- a/chromium/chrome/app/resources/chromium_strings_ko.xtb
+++ b/chromium/chrome/app/resources/chromium_strings_ko.xtb
@@ -155,6 +155,7 @@
<translation id="6334986366598267305">ì´ì œ Google 계정으로 공유 컴퓨터ì—ì„œ Chromiumì„ ì†ì‰½ê²Œ 사용할 수 있습니다.</translation>
<translation id="6373523479360886564">Chromiumì„ ì œê±°í•˜ì‹œê² ìŠµë‹ˆê¹Œ?</translation>
<translation id="6394232988457703198">지금 Chromiumì„ ë‹¤ì‹œ 시작해야 합니다.</translation>
+<translation id="6400072781405947421">Mac OS X 10.9ì—ì„œ ë” ì´ìƒ Chromiumì„ ì§€ì›í•˜ì§€ 않으므로 Chromiumì´ ì˜¬ë°”ë¥´ê²Œ ìž‘ë™í•˜ì§€ ì•Šì„ ìˆ˜ 있습니다.</translation>
<translation id="6403826409255603130">Chromiumì€ ë¹ ë¥¸ ì†ë„ë¡œ 웹페ì´ì§€ì™€ 애플리케ì´ì…˜ì„ 실행하는 웹 브ë¼ìš°ì €ìž…니다. 빠르고 안정ì ì´ë©° ì‚¬ìš©í•˜ê¸°ì— íŽ¸ë¦¬í•©ë‹ˆë‹¤. Chromiumì— ë‚´ìž¥ëœ ë©€ì›¨ì–´ ë° ì•…ì„± 코드 방지 ê¸°ëŠ¥ì„ ì‚¬ìš©í•˜ì—¬ ë”ìš± 안전하게 ì›¹ì„ ê²€ìƒ‰í•˜ì„¸ìš”.</translation>
<translation id="6475912303565314141">ë˜í•œ Chromiumì„ ì‹œìž‘í•  ë•Œ 표시ë˜ëŠ” 페ì´ì§€ë¥¼ 설정합니다.</translation>
<translation id="6485906693002546646">Chromium 콘í…츠를 ë™ê¸°í™”하기 위해 <ph name="PROFILE_EMAIL" />ì„(를) 사용 중입니다. ë™ê¸°í™” í™˜ê²½ì„¤ì •ì„ ì—…ë°ì´íŠ¸í•˜ê±°ë‚˜ Google 계정 ì—†ì´ Chromiumì„ ì‚¬ìš©í•˜ë ¤ë©´ <ph name="SETTINGS_LINK" />(으)ë¡œ ì´ë™í•˜ì„¸ìš”.</translation>
diff --git a/chromium/chrome/app/resources/chromium_strings_lt.xtb b/chromium/chrome/app/resources/chromium_strings_lt.xtb
index f9dcc0577e0..6e1aff55d11 100644
--- a/chromium/chrome/app/resources/chromium_strings_lt.xtb
+++ b/chromium/chrome/app/resources/chromium_strings_lt.xtb
@@ -155,6 +155,7 @@ Kai kurios funkcijos gali būti nepasiekiamos ir nuostatų pakeitimai nebus išs
<translation id="6334986366598267305">Dabar galite lengviau naudoti „Chromium“ naudodami „Google“ paskyrą ir bendrinamus kompiuterius.</translation>
<translation id="6373523479360886564">Ar tikrai norite pašalinti „Chromium"?</translation>
<translation id="6394232988457703198">Turėtumėte dabar iš naujo paleisti „Chromium“.</translation>
+<translation id="6400072781405947421">„Chromium“ gali tinkamai neveikti, nes ji nebepalaikoma naudojant 10.9 versijos „Mac OS X“.</translation>
<translation id="6403826409255603130">„Chromium“ – tai žiniatinklio narÅ¡yklÄ—, kuriÄ… naudojant akimirksniu paleidžiami tinklalapiai ir programos. Ji greita, stabili ir lengvai naudojama. Saugiau narÅ¡ykite žiniatinklį naudodami į „Chromium“ integruotÄ… apsaugÄ… nuo kenkÄ—jiÅ¡kų programų ir sukÄiavimo.</translation>
<translation id="6475912303565314141">Ji taip pat kontroliuoja, koks puslapis rodomas, kai paleidžiate „Chromium“.</translation>
<translation id="6485906693002546646">Sinchronizuoti „Chromium“ duomenims naudojate <ph name="PROFILE_EMAIL" />. Jei norite atnaujinti sinchronizavimo nuostatą arba naudoti „Chromium“ be „Google“ paskyros, apsilankykite <ph name="SETTINGS_LINK" /> skiltyje.</translation>
diff --git a/chromium/chrome/app/resources/chromium_strings_lv.xtb b/chromium/chrome/app/resources/chromium_strings_lv.xtb
index 7d29514beeb..8983040de86 100644
--- a/chromium/chrome/app/resources/chromium_strings_lv.xtb
+++ b/chromium/chrome/app/resources/chromium_strings_lv.xtb
@@ -153,6 +153,7 @@
<translation id="6334986366598267305">Tagad pÄrlÅ«kÄ Chromium ir vieglÄk izmantot Google kontu, kÄ arÄ« ir atvieglota lietoÅ¡ana datoros, ko izmanto vairÄkas personas.</translation>
<translation id="6373523479360886564">Vai tieÅ¡Äm vÄ“laties atinstalÄ“t pÄrlÅ«ku Chromium?</translation>
<translation id="6394232988457703198">Restartējiet Chromium tūlīt.</translation>
+<translation id="6400072781405947421">IespÄ“jams, Chromium nedarbosies pareizi, jo tas vairs netiek atbalstÄ«ts operÄ“tÄjsistÄ“mÄ Mac OS X 10.9.</translation>
<translation id="6403826409255603130">Chromium ir tÄ«mekļa pÄrlÅ«ks, kas darbina tÄ«mekļa lapas un lietojumprogrammas zibenÄ«gÄ ÄtrumÄ. Tas ir Ätrs, stabils un Ä“rti lietojams. PÄrlÅ«kojiet tÄ«mekli vÄ“l droÅ¡Äk ar aizsardzÄ«bu pret ļaunprÄtÄ«gu programmatÅ«ru un pikÅ¡Ä·erÄ“Å¡anu, kas iebÅ«vÄ“ta pÄrlÅ«kÄ Chromium.</translation>
<translation id="6475912303565314141">Tas nosaka arÄ« to, kÄda lapa tiks rÄdÄ«ta, kad atvÄ“rsiet pÄrlÅ«ku Chromium.</translation>
<translation id="6485906693002546646">Chromium satura sinhronizÄ“Å¡anai jÅ«s izmantojat kontu <ph name="PROFILE_EMAIL" />. Lai atjauninÄtu savas sinhronizÄcijas preferences vai izmantotu Chromium bez Google konta, dodieties uz: <ph name="SETTINGS_LINK" />.</translation>
diff --git a/chromium/chrome/app/resources/chromium_strings_ml.xtb b/chromium/chrome/app/resources/chromium_strings_ml.xtb
index 3945687f5f2..49828d1ac98 100644
--- a/chromium/chrome/app/resources/chromium_strings_ml.xtb
+++ b/chromium/chrome/app/resources/chromium_strings_ml.xtb
@@ -155,6 +155,7 @@
<translation id="6334986366598267305">ഇപàµà´ªàµ‹àµ¾ നിങàµà´™à´³àµà´Ÿàµ† Google à´…à´•àµà´•àµ—à´£àµà´Ÿàµ ഉപയോഗിചàµà´šàµ, പങàµà´•à´¿à´Ÿàµà´Ÿ à´•à´®àµà´ªàµà´¯àµ‚à´Ÿàµà´Ÿà´±àµà´•à´³à´¿àµ½ Chromium ഉപയോഗികàµà´•à´¾àµ» à´Žà´³àµà´ªàµà´ªà´®à´¾à´£àµ.</translation>
<translation id="6373523479360886564">Chromium അൺഇൻസàµà´±àµà´±à´¾à´³àµà´šàµ†à´¯àµà´¯à´¾àµ» നിങàµà´™àµ¾ താൽപàµà´ªà´°àµà´¯à´ªàµà´ªàµ†à´Ÿàµà´¨àµà´¨àµà´µàµ†à´¨àµà´¨àµ തീർചàµà´šà´¯à´¾à´£àµ‹?</translation>
<translation id="6394232988457703198">നിങàµà´™àµ¾ ഇപàµà´ªàµ‹àµ¾ Chromium à´ªàµà´¨à´ƒà´°à´¾à´°à´‚à´­à´¿à´•àµà´•à´£à´‚.</translation>
+<translation id="6400072781405947421">Chromium ഇനി Mac OS X 10.9.-നെ പിനàµà´¤àµà´£à´¯àµâ€Œà´•àµà´•à´¾à´¤àµà´¤à´¤à´¿à´¨à´¾àµ½ ഇതൠശരിയായി à´ªàµà´°à´µàµ¼à´¤àµà´¤à´¿à´•àµà´•à´¾à´¨à´¿à´Ÿà´¯à´¿à´²àµà´².</translation>
<translation id="6403826409255603130">മിനàµà´¨àµ½ വേഗതàµà´¤à´¿àµ½ വെബàµâ€Œà´ªàµ‡à´œàµà´•à´³àµà´‚ à´…à´ªàµà´²à´¿à´•àµà´•àµ‡à´·à´¨àµà´•à´³àµà´‚ à´ªàµà´°à´µàµ¼à´¤àµà´¤à´¿à´ªàµà´ªà´¿à´•àµà´•àµà´¨àµà´¨ ഒരൠവെബൠബàµà´°àµ—സറാണൠChromium. ഇതൠവേഗതയàµà´³àµà´³à´¤àµà´‚ à´¸àµà´¥à´¿à´°à´¤à´¯à´¾àµ¼à´¨àµà´¨à´¤àµà´‚ ഉപയോഗികàµà´•à´¾àµ» à´Žà´³àµà´ªàµà´ªà´®àµà´³àµà´³à´¤àµà´®à´¾à´£àµ. Chromium-ൽ à´…à´¨àµà´¤àµ¼à´¨à´¿àµ¼à´®àµà´®à´¿à´¤à´®à´¾à´¯ à´•àµà´·àµà´¦àµà´°à´µàµ†à´¯àµ¼, ഫിഷിംഗൠഎനàµà´¨à´¿à´µà´¯àµâ€Œà´•àµà´•àµ†à´¤à´¿à´°à´¾à´¯àµà´³àµà´³ പരിരകàµà´·à´¯àµ‹à´ŸàµŠà´ªàµà´ªà´‚ കൂടàµà´¤àµ½ à´¸àµà´°à´•àµà´·à´¿à´¤à´®à´¾à´¯à´¿ വെബൠബàµà´°àµ—à´¸àµà´šàµ†à´¯àµà´¯àµà´•.</translation>
<translation id="6475912303565314141">നിങàµà´™àµ¾ Chromium ആരംഭികàµà´•àµà´®àµà´ªàµ‹àµ¾ ദൃശàµà´¯à´®à´¾à´•àµà´¨àµà´¨ പേജàµà´‚ അതൠനിയനàµà´¤àµà´°à´¿à´¯àµà´•àµà´•àµà´‚.</translation>
<translation id="6485906693002546646">Chromium ഫയൽ സമനàµà´µà´¯à´¿à´ªàµà´ªà´¿à´•àµà´•à´¾àµ» നിങàµà´™àµ¾ <ph name="PROFILE_EMAIL" /> ഉപയോഗികàµà´•àµà´¨àµà´¨àµ. നിങàµà´™à´³àµà´Ÿàµ† സമനàµà´µà´¯ à´®àµàµ»à´—ണനകൾ à´…à´ªàµâ€Œà´¡àµ‡à´±àµà´±àµà´šàµ†à´¯àµà´¯à´¾à´¨àµ‹ ഒരൠGoogle à´…à´•àµà´•àµ—à´£àµà´Ÿàµ ഇലàµà´²à´¾à´¤àµ† Chromium ഉപയോഗികàµà´•à´¾à´¨àµ‹, <ph name="SETTINGS_LINK" /> സനàµà´¦àµ¼à´¶à´¿à´•àµà´•àµà´•.</translation>
diff --git a/chromium/chrome/app/resources/chromium_strings_mr.xtb b/chromium/chrome/app/resources/chromium_strings_mr.xtb
index b6b921a6ee4..9b14af05103 100644
--- a/chromium/chrome/app/resources/chromium_strings_mr.xtb
+++ b/chromium/chrome/app/resources/chromium_strings_mr.xtb
@@ -154,6 +154,7 @@
<translation id="6334986366598267305">आता आपलà¥à¤¯à¤¾ Google खातà¥à¤¯à¤¾à¤µà¤° आणि सामायिक केलेलà¥à¤¯à¤¾ संगणकांवर Chromium वापरणे अधिक सà¥à¤²à¤­ आहे.</translation>
<translation id="6373523479360886564">आपलà¥â€à¤¯à¤¾à¤²à¤¾ खातà¥à¤°à¥€ आहे की आपण Chromium विसà¥â€à¤¥à¤¾à¤ªà¤¿à¤¤ करू इचà¥â€à¤›à¤¿à¤¤à¤¾?</translation>
<translation id="6394232988457703198">आपण आता Chromium रीसà¥à¤Ÿà¤¾à¤°à¥à¤Ÿ करावे.</translation>
+<translation id="6400072781405947421">Mac OS X 10.9 वर Chromium ला सपोरà¥à¤Ÿ नसलà¥à¤¯à¤¾à¤®à¥à¤³à¥‡ ते कदाचित नीट चालणार नाही.</translation>
<translation id="6403826409255603130">Chromium हे à¤à¤• वेबबà¥à¤°à¤¾à¤‰à¤à¤° असून ते वेबपृषà¥à¤ à¥‡ आणि अॅपà¥à¤²à¤¿à¤•à¥‡à¤¶à¤¨ अतिशय वेगात चालवते. हे वापरणà¥à¤¯à¤¾à¤¸ जलद, सà¥à¤¥à¤¿à¤° आणि सोपे आहे. Chromium मधà¥à¤¯à¥‡ तयार करणà¥à¤¯à¤¾à¤¸à¤¾à¤ à¥€ मालवेयर आणि फिशिंग संरकà¥à¤·à¤£à¤¾à¤¸à¤¹ वेब अधिक सà¥à¤°à¤•à¥à¤·à¤¿à¤¤à¤ªà¤£à¥‡ बà¥à¤°à¤¾à¤‰à¤ करा.</translation>
<translation id="6475912303565314141">आपण Chromium पà¥à¤°à¤¾à¤°à¤‚भ करता तेवà¥à¤¹à¤¾ कोणते पृषà¥à¤  दरà¥à¤¶à¤µà¤¿à¤²à¥‡ जाते हे देखील हे नियंतà¥à¤°à¤¿à¤¤ करते.</translation>
<translation id="6485906693002546646">आपण आपली Chromium सामगà¥à¤°à¥€ संकालित करणà¥à¤¯à¤¾à¤¸à¤¾à¤ à¥€ <ph name="PROFILE_EMAIL" /> वापरत आहात. आपले संकालन पà¥à¤°à¤¾à¤§à¤¾à¤¨à¥à¤¯ अपडेट करणà¥à¤¯à¤¾à¤¸à¤¾à¤ à¥€ किंवा Google खाते न सोडता Chromium वापरणà¥à¤¯à¤¾à¤¸à¤¾à¤ à¥€, <ph name="SETTINGS_LINK" /> ला भेट दà¥à¤¯à¤¾.</translation>
diff --git a/chromium/chrome/app/resources/chromium_strings_nl.xtb b/chromium/chrome/app/resources/chromium_strings_nl.xtb
index 4ad3871574a..57719f07ce4 100644
--- a/chromium/chrome/app/resources/chromium_strings_nl.xtb
+++ b/chromium/chrome/app/resources/chromium_strings_nl.xtb
@@ -155,6 +155,7 @@ Sommige functies zijn wellicht niet beschikbaar en wijzigingen in voorkeuren wor
<translation id="6334986366598267305">Het is nu gemakkelijker om Chromium met je Google-account en op gedeelde computers te gebruiken.</translation>
<translation id="6373523479360886564">Weet je zeker dat je Chromium wilt verwijderen?</translation>
<translation id="6394232988457703198">Je moet Chromium nu opnieuw starten.</translation>
+<translation id="6400072781405947421">Chromium werkt wellicht niet naar behoren omdat dit niet meer op Mac OS X 10.9 wordt ondersteund.</translation>
<translation id="6403826409255603130">Chromium is een webbrowser die webpagina's en applicaties bliksemsnel uitvoert. Chromium is snel, stabiel en eenvoudig in gebruik. Surf veiliger op internet met de in Chromium ingebouwde beveiliging tegen malware en phishing.</translation>
<translation id="6475912303565314141">Hiermee wordt ook gecontroleerd welke pagina wordt weergegeven wanneer je Chromium start.</translation>
<translation id="6485906693002546646">Je gebruikt <ph name="PROFILE_EMAIL" /> om je Chromium-bestanden te synchroniseren. Als je je synchronisatievoorkeur wilt bijwerken of Chromium zonder een Google-account wilt gebruiken, ga je naar '<ph name="SETTINGS_LINK" />'.</translation>
diff --git a/chromium/chrome/app/resources/chromium_strings_no.xtb b/chromium/chrome/app/resources/chromium_strings_no.xtb
index 9ec0203687a..bd6b57ef171 100644
--- a/chromium/chrome/app/resources/chromium_strings_no.xtb
+++ b/chromium/chrome/app/resources/chromium_strings_no.xtb
@@ -153,6 +153,7 @@
<translation id="6334986366598267305">Nå er det enklere å bruke Chromium med Google-kontoen din og på datamaskiner du deler med andre.</translation>
<translation id="6373523479360886564">Er du sikker på at du vil avinstallere Chromium?</translation>
<translation id="6394232988457703198">Du bør starte Chromium på nytt nå.</translation>
+<translation id="6400072781405947421">Chromium fungerer kanskje ikke riktig fordi den ikke lenger støttes på Mac OS X 10.9.</translation>
<translation id="6403826409255603130">Chromium er en nettleser som kjører nettsider og programmer i lynets hastighet. Den er rask, stabil og enkel å bruke. Surf på nettet på en tryggere måte med Chromium, som har innebygd beskyttelse mot skadelig programvare og nettfisking.</translation>
<translation id="6475912303565314141">Den styrer også hvilken side som vises når du starter Chromium.</translation>
<translation id="6485906693002546646">Du bruker <ph name="PROFILE_EMAIL" /> for synkronisering av Chromium-tingene dine. For å oppdatere alternativene for synkronisering eller bruke Chromium uten Google-konto, kan du gå til <ph name="SETTINGS_LINK" />.</translation>
@@ -168,6 +169,7 @@ Det er mulig at enkelte funksjoner ikke er tilgjengelige. Angi en annen profilka
<translation id="6734291798041940871">Chromium er allerede installert for alle brukerne på datamaskinen din.</translation>
<translation id="6810143991807788455">Bidra til å gjøre Chromium bedre ved å rapportere inn de gjeldende innstillingene</translation>
<translation id="6857782730669500492">Chromium – <ph name="PAGE_TITLE" /></translation>
+<translation id="6863361426438995919">Google Pay (kopiert til Chromium)</translation>
<translation id="6893813176749746474">Chromium har blitt oppdatert, men du har ikke brukt den på minst 30 dager.</translation>
<translation id="6944967875980567883">Moduler lastet inn i Chromium</translation>
<translation id="6964305034639999644">Ã…pne linken i et inko&amp;gnitovindu i Chromium</translation>
diff --git a/chromium/chrome/app/resources/chromium_strings_ro.xtb b/chromium/chrome/app/resources/chromium_strings_ro.xtb
index 3d648a6ab29..09128592baa 100644
--- a/chromium/chrome/app/resources/chromium_strings_ro.xtb
+++ b/chromium/chrome/app/resources/chromium_strings_ro.xtb
@@ -153,6 +153,7 @@
<translation id="6334986366598267305">Acum este mai ușor să folosiți Chromium cu Contul Google și pe computerele utilizate în comun.</translation>
<translation id="6373523479360886564">Sigur doriți să dezinstalați Chromium?</translation>
<translation id="6394232988457703198">Îți recomandăm să repornești Chromium acum.</translation>
+<translation id="6400072781405947421">Este posibil ca Chromium să nu funcționeze corespunzător, deoarece nu mai este acceptat pe Mac OS X 10.9.</translation>
<translation id="6403826409255603130">Chromium este un browser web care rulează pagini web și aplicații cu viteza fulgerului. Este rapid, stabil și ușor de utilizat. Navigați pe web în condiții de mai multă siguranță, beneficiind de o protecție sporită, încorporată în Chromium, împotriva programelor malware și a tentativelor de phishing.</translation>
<translation id="6475912303565314141">Stabilește și ce pagină se afișează când porniți Chromium.</translation>
<translation id="6485906693002546646">În prezent, folosiți <ph name="PROFILE_EMAIL" /> pentru a sincroniza datele Chromium. Pentru a actualiza preferințele de sincronizare sau pentru a folosi Chromium fără un Cont Google, accesați <ph name="SETTINGS_LINK" />.</translation>
diff --git a/chromium/chrome/app/resources/chromium_strings_ru.xtb b/chromium/chrome/app/resources/chromium_strings_ru.xtb
index 7be19d77bac..cea0cd74d23 100644
--- a/chromium/chrome/app/resources/chromium_strings_ru.xtb
+++ b/chromium/chrome/app/resources/chromium_strings_ru.xtb
@@ -151,6 +151,7 @@
<translation id="6334986366598267305">Теперь Ñ Chromium ещё удобнее работать в аккаунте Google, в том чиÑле на общих компьютерах.</translation>
<translation id="6373523479360886564">Ð’Ñ‹ дейÑтвительно хотите удалить Chromium?</translation>
<translation id="6394232988457703198">ПерезапуÑтите Chromium</translation>
+<translation id="6400072781405947421">Ð’ работе Chromium могут возникать Ñбои, так как браузер больше не поддерживает Mac OS X 10.9.</translation>
<translation id="6403826409255603130">Chromium – браузер, который открывает веб-Ñтраницы и Ð¿Ñ€Ð¸Ð»Ð¾Ð¶ÐµÐ½Ð¸Ñ Ð·Ð° Ñекунды. Он быÑÑ‚Ñ€, Ñтабилен в работе и проÑÑ‚ в иÑпользовании. Ð’ÑÑ‚Ñ€Ð¾ÐµÐ½Ð½Ð°Ñ Ð² Chromium защита от мошенничеÑтва и вредоноÑного ПО обеÑпечивает макÑимально безопаÑную работу в Интернете.</translation>
<translation id="6475912303565314141">Кроме того, раÑширение изменило Ñтартовую Ñтраницу Chromium.</translation>
<translation id="6485906693002546646">Ð”Ð»Ñ Ñинхронизации данных Chromium иÑпользуетÑÑ Ð°ÐºÐºÐ°ÑƒÐ½Ñ‚ <ph name="PROFILE_EMAIL" />. Изменить параметры Ñинхронизации или отключить аккаунт можно в <ph name="SETTINGS_LINK" />.</translation>
diff --git a/chromium/chrome/app/resources/chromium_strings_sl.xtb b/chromium/chrome/app/resources/chromium_strings_sl.xtb
index 4984c0f25e9..965aebc8536 100644
--- a/chromium/chrome/app/resources/chromium_strings_sl.xtb
+++ b/chromium/chrome/app/resources/chromium_strings_sl.xtb
@@ -156,6 +156,7 @@ Te storitve lahko po želji onemogoÄite. <ph name="BEGIN_LINK" />VeÄ o tem<ph
<translation id="6334986366598267305">Zdaj je Chromium lažje uporabljati z Google RaÄunom in v raÄunalnikih, ki so v skupni rabi.</translation>
<translation id="6373523479360886564">Ali ste prepriÄani, da želite odstraniti Chromiuma?</translation>
<translation id="6394232988457703198">Chromium zdaj znova zaženite.</translation>
+<translation id="6400072781405947421">Chromium morda ne bo deloval pravilno, ker ni veÄ podprt v razliÄici sistema Mac OS X 10.9.</translation>
<translation id="6403826409255603130">Chromium je spletni brskalnik, ki bliskovito odpira spletne strani in izvaja aplikacije. Je hiter, stabilen in preprost za uporabo. Z vgrajeno zaÅ¡Äito pred zlonamerno programsko opremo in lažnim predstavljanjem je brskanje po spletu varno.</translation>
<translation id="6475912303565314141">DoloÄa tudi, katera stran je prikazana, ko zaženete Chromium.</translation>
<translation id="6485906693002546646">Za sinhronizacijo stvari v Chromiumu uporabljate <ph name="PROFILE_EMAIL" />. ÄŒe želite posodobiti nastavitve sinhroniziranja ali uporabljati Chromium brez Google RaÄuna, odprite <ph name="SETTINGS_LINK" />.</translation>
diff --git a/chromium/chrome/app/resources/chromium_strings_sr.xtb b/chromium/chrome/app/resources/chromium_strings_sr.xtb
index fed44d342e4..d792c0bbc55 100644
--- a/chromium/chrome/app/resources/chromium_strings_sr.xtb
+++ b/chromium/chrome/app/resources/chromium_strings_sr.xtb
@@ -155,6 +155,7 @@
<translation id="6334986366598267305">Сада можете лакше да кориÑтите Chromium Ñа Google налогом и на дељеним рачунарима.</translation>
<translation id="6373523479360886564">ЈеÑте ли Ñигурни да желите да деинÑталирате Chromium?</translation>
<translation id="6394232988457703198">Сада треба поново да покренете Chromium.</translation>
+<translation id="6400072781405947421">Chromium можда неће иÑправно функциониÑати зато што више није подржан на ÑиÑтему Mac OS X 10.9.</translation>
<translation id="6403826409255603130">Chromium је веб прегледач који покреће веб-Ñтранице и апликације муњевитом брзином. Брз је, Ñтабилан и једноÑтаван за коришћење. Прегледајте Веб безбедније Ñа заштитом од малвера и „пецања“ која је уграђена у Chromium.</translation>
<translation id="6475912303565314141">Контролише и Ñтраницу која Ñе приказује када покренете Chromium.</translation>
<translation id="6485906693002546646">КориÑтите <ph name="PROFILE_EMAIL" /> за Ñинхронизацију Chromium Ñадржаја. Да биÑте ажурирали подешавање Ñинхронизације или кориÑтили Chromium без Google налога, поÑетите <ph name="SETTINGS_LINK" />.</translation>
diff --git a/chromium/chrome/app/resources/chromium_strings_sv.xtb b/chromium/chrome/app/resources/chromium_strings_sv.xtb
index 047f9e1008a..aab48b6d9bf 100644
--- a/chromium/chrome/app/resources/chromium_strings_sv.xtb
+++ b/chromium/chrome/app/resources/chromium_strings_sv.xtb
@@ -155,6 +155,7 @@ Vissa funktioner kanske inte är tillgängliga och ändringar i inställningarna
<translation id="6334986366598267305">Nu är det enklare att använda Chromium med ditt Google-konto och på delade datorer.</translation>
<translation id="6373523479360886564">Vill du avinstallera Chromium?</translation>
<translation id="6394232988457703198">Starta om Chromium nu.</translation>
+<translation id="6400072781405947421">Chromium kanske inte fungerar ordentligt eftersom den inte längre stöds på Mac OS X 10.9.</translation>
<translation id="6403826409255603130">Chromium är en webbläsare som kör webbsidor och appar blixtsnabbt. Den är snabb, stabil och lätt att använda. Surfa säkrare med Chromiums skydd mot skadliga program och lösenordsfiske.</translation>
<translation id="6475912303565314141">Det styr också vilken sida som visas när du startar Chromium.</translation>
<translation id="6485906693002546646">Du synkroniserar dina grejer i Chromium med <ph name="PROFILE_EMAIL" />. Om du vill ändra synkroniseringsinställningen eller använda Chromium utan ett Google-konto besöker du <ph name="SETTINGS_LINK" />.</translation>
diff --git a/chromium/chrome/app/resources/chromium_strings_te.xtb b/chromium/chrome/app/resources/chromium_strings_te.xtb
index 3d39664f330..fd7ee55b77c 100644
--- a/chromium/chrome/app/resources/chromium_strings_te.xtb
+++ b/chromium/chrome/app/resources/chromium_strings_te.xtb
@@ -151,6 +151,7 @@
<translation id="6334986366598267305">ఇపà±à°ªà±à°¡à± మీ Google ఖాతాతో మరియౠభాగసà±à°µà°¾à°®à±à°¯ à°•à°‚à°ªà±à°¯à±‚à°Ÿà°°à±â€Œà°²à±à°²à±‹ Chromiumని à°¸à±à°²à°­à°‚à°—à°¾ ఉపయోగించవచà±à°šà±.</translation>
<translation id="6373523479360886564">మీరౠChromiumని à°…à°¨à±à°‡à°¨à±â€Œà°¸à±à°Ÿà°¾à°²à± చేయాలనà±à°•à±à°‚à°Ÿà±à°¨à±à°¨à°¾à°°à°¾?</translation>
<translation id="6394232988457703198">మీరౠఇపà±à°ªà±à°¡à±‡ Chromiumని à°ªà±à°¨à°ƒà°ªà±à°°à°¾à°°à°‚భించాలి.</translation>
+<translation id="6400072781405947421">Chromiumà°•à°¿ ఇపà±à°ªà±à°¡à± Mac OS X 10.9లో మదà±à°¦à°¤à± లేనందà±à°¨ ఇది సరిగà±à°—à°¾ పని చేయకపోవచà±à°šà±.</translation>
<translation id="6403826409255603130">Chromium అనేది మెరà±à°ªà± వేగంతో వెబà±â€Œà°ªà±‡à°œà±€à°²à°¨à± మరియౠఅనà±à°µà°°à±à°¤à°¨à°¾à°²à°¨à± అమలౠచేసే వెబౠబà±à°°à±Œà°œà°°à±. ఇది వేగవంతమైనది, à°¸à±à°¥à°¿à°°à°®à±ˆà°¨à°¦à°¿ మరియౠఉపయోగించడానికి à°¸à±à°²à°­à°®à±ˆà°¨à°¦à°¿. Chromiumలో రూపొందించిన మాలà±à°µà±‡à°°à± మరియౠఫిషింగౠరకà±à°·à°£à°¤à±‹ మరింత à°¸à±à°°à°•à±à°·à°¿à°¤à°‚à°—à°¾ వెబà±â€Œà°²à±‹ à°¬à±à°°à±Œà°œà± చేయండి.</translation>
<translation id="6475912303565314141">ఇది మీరౠChromiumని à°ªà±à°°à°¾à°°à°‚భించేటపà±à°ªà±à°¡à± చూపబడే పేజీని కూడా నియంతà±à°°à°¿à°¸à±à°¤à±à°‚ది.</translation>
<translation id="6485906693002546646">మీరౠమీ Chromium అంశాలనౠసమకాలీకరించడానికి <ph name="PROFILE_EMAIL" />ని ఉపయోగిసà±à°¤à±à°¨à±à°¨à°¾à°°à±. మీ సమకాలీకరణ à°ªà±à°°à°¾à°§à°¾à°¨à±à°¯à°¤à°¨à± నవీకరించడానికి లేదా Google ఖాతా లేకà±à°‚à°¡à°¾ Chromiumని ఉపయోగించడానికి, <ph name="SETTINGS_LINK" />నౠసందరà±à°¶à°¿à°‚à°šà°‚à°¡à°¿.</translation>
diff --git a/chromium/chrome/app/resources/chromium_strings_th.xtb b/chromium/chrome/app/resources/chromium_strings_th.xtb
index 87ccc4cbdfd..405575c4a9f 100644
--- a/chromium/chrome/app/resources/chromium_strings_th.xtb
+++ b/chromium/chrome/app/resources/chromium_strings_th.xtb
@@ -153,6 +153,7 @@
<translation id="6334986366598267305">ตอนนี้à¸à¸²à¸£à¹ƒà¸Šà¹‰ Chromium à¸à¸±à¸šà¸šà¸±à¸à¸Šà¸µ Google ของคุณà¹à¸¥à¸°à¸šà¸™à¸„อมพิวเตอร์ที่ใช้ร่วมà¸à¸±à¸™à¸—ำได้ง่ายà¸à¸§à¹ˆà¸²à¹€à¸”ิม</translation>
<translation id="6373523479360886564">คุณà¹à¸™à¹ˆà¹ƒà¸ˆà¸«à¸£à¸·à¸­à¹„ม่ว่าต้องà¸à¸²à¸£à¸–อนà¸à¸²à¸£à¸•à¸´à¸”ตั้ง Chromium</translation>
<translation id="6394232988457703198">คุณควรรีสตาร์ท Chromium เลย</translation>
+<translation id="6400072781405947421">Chromium อาจทำงานไม่ถูà¸à¸•à¹‰à¸­à¸‡à¹€à¸™à¸·à¹ˆà¸­à¸‡à¸ˆà¸²à¸à¹„ม่รองรับ Mac OS X 10.9 à¹à¸¥à¹‰à¸§</translation>
<translation id="6403826409255603130">Chromium เป็นเว็บเบราว์เซอร์ที่เรียà¸à¹ƒà¸Šà¹‰à¸«à¸™à¹‰à¸²à¹€à¸§à¹‡à¸šà¹à¸¥à¸°à¹à¸­à¸›à¸žà¸¥à¸´à¹€à¸„ชันด้วยความเร็วสูง มีความรวดเร็ว เสถียร à¹à¸¥à¸°à¸‡à¹ˆà¸²à¸¢à¹ƒà¸™à¸à¸²à¸£à¹ƒà¸Šà¹‰à¸‡à¸²à¸™ เรียà¸à¸”ูเว็บได้อย่างปลอดภัยมาà¸à¸‚ึ้นด้วยà¸à¸²à¸£à¸›à¹‰à¸­à¸‡à¸à¸±à¸™à¸¡à¸±à¸¥à¹à¸§à¸£à¹Œà¹à¸¥à¸°à¸Ÿà¸´à¸Šà¸Šà¸´à¸‡à¸—ี่สร้างอยู่ภายใน Chromium</translation>
<translation id="6475912303565314141">อีà¸à¸—ั้งยังควบคุมหน้าที่จะà¹à¸ªà¸”งเมื่อคุณเปิด Chromium ด้วย</translation>
<translation id="6485906693002546646">คุณà¸à¸³à¸¥à¸±à¸‡à¹ƒà¸Šà¹‰ <ph name="PROFILE_EMAIL" /> ในà¸à¸²à¸£à¸‹à¸´à¸‡à¸„์ข้อมูลใน Chromium หาà¸à¸•à¹‰à¸­à¸‡à¸à¸²à¸£à¸­à¸±à¸›à¹€à¸”ตค่าà¸à¸³à¸«à¸™à¸”à¸à¸²à¸£à¸‹à¸´à¸‡à¸„์หรือใช้ Chromium โดยไม่มีบัà¸à¸Šà¸µ Google โปรดไปที่ <ph name="SETTINGS_LINK" /></translation>
diff --git a/chromium/chrome/app/resources/chromium_strings_tr.xtb b/chromium/chrome/app/resources/chromium_strings_tr.xtb
index f39030cb3a8..fddad4516b9 100644
--- a/chromium/chrome/app/resources/chromium_strings_tr.xtb
+++ b/chromium/chrome/app/resources/chromium_strings_tr.xtb
@@ -151,6 +151,7 @@
<translation id="6334986366598267305">Chromium'u Google Hesabınızla ve paylaşılan bilgisayarlarda kullanmak artık daha kolay.</translation>
<translation id="6373523479360886564">Chromium'u kaldırmak istediğinizden emin misiniz?</translation>
<translation id="6394232988457703198">Chromium'u şimdi yeniden başlatmalısınız.</translation>
+<translation id="6400072781405947421">Chromium artık Mac OS X 10.9'da desteklenmediği için doğru şekilde çalışmayabilir.</translation>
<translation id="6403826409255603130">Chromium, Web sayfalarını ve uygulamaları yıldırım hızıyla çalıştıran bir Web tarayıcısıdır. Hızlı ve kararlı çalışır, kolay kullanılır. Chromium'da dahili olarak bulunan zararlı yazılım ve kimlik avı koruması sayesinde Web'de daha güvenli gezinin.</translation>
<translation id="6475912303565314141">Ayrıca, Chromium'u başlattığınızda gösterilecek sayfayı da denetler.</translation>
<translation id="6485906693002546646">Chromium öğelerinizi senkronize etmek için <ph name="PROFILE_EMAIL" /> adresini kullanıyorsunuz. Senkronizasyon tercihinizi güncellemek veya Chromium'u bir Google Hesabı olmadan kullanmak için şurayı ziyaret edin: <ph name="SETTINGS_LINK" /></translation>
diff --git a/chromium/chrome/app/resources/chromium_strings_vi.xtb b/chromium/chrome/app/resources/chromium_strings_vi.xtb
index cbf4b8e7806..e0f1a7e9462 100644
--- a/chromium/chrome/app/resources/chromium_strings_vi.xtb
+++ b/chromium/chrome/app/resources/chromium_strings_vi.xtb
@@ -153,7 +153,7 @@
<translation id="6334986366598267305">GiỠđây, việc sử dụng Chromium bằng tài khoản Google của bạn và trên máy tính dùng chung trở nên dễ dàng hơn.</translation>
<translation id="6373523479360886564">Bạn có chắc chắn muốn gỡ cài đặt Chromium không?</translation>
<translation id="6394232988457703198">Bạn phải khởi Ä‘á»™ng lại Chromium ngay bây giá».</translation>
-<translation id="6400072781405947421">Chromium có thể không hoạt động chính xác do không được hỗ trợ trên Mac OS X 10.9.</translation>
+<translation id="6400072781405947421">Chromium có thể không hoạt động chính xác do không còn được hỗ trợ trên Mac OS X 10.9.</translation>
<translation id="6403826409255603130">Chromium là trình duyệt web chạy các trang web và ứng dụng vá»›i tốc Ä‘á»™ cá»±c nhanh. Äây là má»™t trình duyệt web nhanh, ổn định và dá»… sá»­ dụng. Duyệt web trở nên an toàn hÆ¡n vá»›i tính năng bảo vệ chống lại phần má»m Ä‘á»™c hại và lừa đảo được tích hợp sẵn vào Chromium.</translation>
<translation id="6475912303565314141">Tiện ích này cÅ©ng Ä‘iá»u khiển trang nào được hiển thị khi bạn khởi Ä‘á»™ng Chromium.</translation>
<translation id="6485906693002546646">Bạn Ä‘ang sá»­ dụng <ph name="PROFILE_EMAIL" /> để đồng bá»™ hóa ná»™i dung Chromium của mình. Äể cập nhật tùy chá»n đồng bá»™ hóa hoặc sá»­ dụng Chromium mà không cần tài khoản Google, hãy truy cập <ph name="SETTINGS_LINK" />.</translation>
diff --git a/chromium/chrome/app/resources/chromium_strings_zh-TW.xtb b/chromium/chrome/app/resources/chromium_strings_zh-TW.xtb
index 89a77356e7f..9d75737c645 100644
--- a/chromium/chrome/app/resources/chromium_strings_zh-TW.xtb
+++ b/chromium/chrome/app/resources/chromium_strings_zh-TW.xtb
@@ -153,6 +153,7 @@
<translation id="6334986366598267305">無論是登入 Google 帳戶使用 Chromium,還是以 Google 帳戶使用共用電腦,ç¾åœ¨éƒ½è®Šå¾—更容易了。</translation>
<translation id="6373523479360886564">你確定è¦è§£é™¤å®‰è£ Chromium 嗎?</translation>
<translation id="6394232988457703198">建議您立å³é‡æ–°å•Ÿå‹• Chromium。</translation>
+<translation id="6400072781405947421">Chromium å·²ä¸å†æ”¯æ´ Mac OS X 10.9,因此部分功能å¯èƒ½ç„¡æ³•æ­£å¸¸é‹ä½œã€‚</translation>
<translation id="6403826409255603130">Chromium 網路ç€è¦½å™¨é–‹å•Ÿç¶²é å’ŒåŸ·è¡Œæ‡‰ç”¨ç¨‹å¼çš„速度å分迅速。除了迅速ã€ç©©å®šä¸”易於使用之外,Chromium 的內建惡æ„軟體與網路釣魚防護功能,å¯è®“你安心悠éŠç¶²è·¯ã€‚</translation>
<translation id="6475912303565314141">這個擴充功能也會控管你啟動 Chromium 時所顯示的網é ã€‚</translation>
<translation id="6485906693002546646">你正使用 <ph name="PROFILE_EMAIL" /> 帳戶åŒæ­¥è™•ç†ä½ çš„ Chromium 資料。如è¦æ›´æ–°ä½ çš„å好設定,或是在未登入 Google 帳戶的情æ³ä¸‹ä½¿ç”¨ Chromium,請å‰å¾€ [<ph name="SETTINGS_LINK" />]。</translation>
diff --git a/chromium/chrome/app/resources/generated_resources_de.xtb b/chromium/chrome/app/resources/generated_resources_de.xtb
index f4a88b27427..6d2552ae02e 100644
--- a/chromium/chrome/app/resources/generated_resources_de.xtb
+++ b/chromium/chrome/app/resources/generated_resources_de.xtb
@@ -4213,7 +4213,7 @@ Möchten Sie <ph name="CONTROL_PANEL_APPLET_NAME" /> starten?</translation>
<translation id="7576032389798113292">6 x 4</translation>
<translation id="7576690715254076113">Zuordnen</translation>
<translation id="7579149537961810247">Websites stummschalten</translation>
-<translation id="7580671184200851182">Dieselben Audioinhalte über alle Boxen wiedergeben (Mono-Audio)</translation>
+<translation id="7580671184200851182">Dieselben Audioinhalte über alle Lautsprecher wiedergeben (Mono-Audio)</translation>
<translation id="7581462281756524039">Ein Bereinigungstool</translation>
<translation id="7582582252461552277">Dieses Netzwerk bevorzugen</translation>
<translation id="7586498138629385861">Chrome wird weiter ausgeführt, solange die Chrome-Apps geöffnet sind.</translation>
diff --git a/chromium/chrome/app/resources/generated_resources_es-419.xtb b/chromium/chrome/app/resources/generated_resources_es-419.xtb
index 9679e277d3b..9c9db9035a0 100644
--- a/chromium/chrome/app/resources/generated_resources_es-419.xtb
+++ b/chromium/chrome/app/resources/generated_resources_es-419.xtb
@@ -52,7 +52,7 @@
<ph name="EXTENSION_NAME" /></translation>
<translation id="1071917609930274619">Cifrado de datos</translation>
-<translation id="1074944608454986967">Para leer el contenido en voz alta, mantén presionado el botón de búsqueda y, luego, haz clic o arrastra el cursor para seleccionar contenido. O bien, destaca una parte y presiona Búsqueda + S.</translation>
+<translation id="1074944608454986967">Para leer el contenido en voz alta, mantén presionado el botón de búsqueda y, luego, haz clic en el contenido o arrastra el cursor para seleccionarlo. O bien, destaca una parte y presiona Búsqueda + S.</translation>
<translation id="1076698951459398590">Habilitar tema</translation>
<translation id="1076818208934827215">Microsoft Internet Explorer</translation>
<translation id="1077946062898560804">Configurar actualizaciones automáticas para todos los usuarios</translation>
diff --git a/chromium/chrome/app/resources/generated_resources_fr.xtb b/chromium/chrome/app/resources/generated_resources_fr.xtb
index be8080d51bd..7d5a16af0c0 100644
--- a/chromium/chrome/app/resources/generated_resources_fr.xtb
+++ b/chromium/chrome/app/resources/generated_resources_fr.xtb
@@ -3185,7 +3185,7 @@ Assurez-vous de ne pas dévoiler d'informations sensibles.</translation>
<translation id="5921745308587794300">Faire pivoter la fenêtre</translation>
<translation id="5924047253200400718">Obtenir de l'aide<ph name="SCANNING_STATUS" /></translation>
<translation id="5925147183566400388">Pointeur de la déclaration CPS (Certification Practice Statement)</translation>
-<translation id="592880897588170157">Télécharger des fichiers PDF au lieu de les ouvrir automatiquement dans Chrome</translation>
+<translation id="592880897588170157">Télécharger les fichiers PDF au lieu de les ouvrir automatiquement dans Chrome</translation>
<translation id="5931146425219109062">Accéder à toutes vos données sur les sites Web que vous consultez et les modifier</translation>
<translation id="5932881020239635062">Série</translation>
<translation id="5933376509899483611">Fuseau horaire</translation>
diff --git a/chromium/chrome/app/resources/generated_resources_id.xtb b/chromium/chrome/app/resources/generated_resources_id.xtb
index 38c6a626c5a..48c7f079326 100644
--- a/chromium/chrome/app/resources/generated_resources_id.xtb
+++ b/chromium/chrome/app/resources/generated_resources_id.xtb
@@ -672,7 +672,7 @@
<translation id="2034346955588403444">Tambahkan jaringan Wi-Fi lainnya</translation>
<translation id="203574396658008164">Aktifkan pencatat dari layar kunci</translation>
<translation id="2039623879703305659">Jari bergerak terlalu cepat</translation>
-<translation id="2040460856718599782">Ups! Terjadi masalah saat mencoba mengautentikasi Anda. Periksa lagi kredensial masuk Anda dan coba lagi.</translation>
+<translation id="2040460856718599782">Ups! Terjadi masalah saat mencoba mengautentikasi Anda. Periksa lagi kredensial login Anda dan coba lagi.</translation>
<translation id="2043818754674261542">Jauhkan ponsel untuk membuka kunci <ph name="DEVICE_TYPE" /> ini</translation>
<translation id="204497730941176055">Microsoft Certificate Template Name</translation>
<translation id="2045969484888636535">Lanjutkan pencekalan cookie</translation>
diff --git a/chromium/chrome/app/resources/generated_resources_mr.xtb b/chromium/chrome/app/resources/generated_resources_mr.xtb
index 16b41b2aa4e..07b592396ec 100644
--- a/chromium/chrome/app/resources/generated_resources_mr.xtb
+++ b/chromium/chrome/app/resources/generated_resources_mr.xtb
@@ -295,7 +295,7 @@
<translation id="1432581352905426595">शोध इंजिन वà¥à¤¯à¤µà¤¸à¥à¤¥à¤¾à¤ªà¤¿à¤¤ करा</translation>
<translation id="1433811987160647649">पà¥à¤°à¤µà¥‡à¤¶ करणà¥à¤¯à¤¾à¤ªà¥‚रà¥à¤µà¥€ विचारा</translation>
<translation id="1434696352799406980">हे आपले पà¥à¤°à¤¾à¤°à¤‚भ पृषà¥à¤ , नवीन टॅब पृषà¥à¤ , शोध इंजिन आणि पिन केलेले टॅब रीसेट करेल. हे सरà¥à¤µ विसà¥à¤¤à¤¾à¤° अकà¥à¤·à¤® करेल आणि कà¥à¤•à¥€à¤œ सारखा तातà¥à¤ªà¥à¤°à¤¤à¤¾ डेटा साफ करेल. आपले बà¥à¤•à¤®à¤¾à¤°à¥à¤•, इतिहास आणि सेवà¥à¤¹ केलेले पासवरà¥à¤¡ साफ केले जाणार नाहीत.</translation>
-<translation id="1434886155212424586">मà¥à¤–à¥à¤¯à¤ªà¥ƒà¤·à¥à¤  हे नवीन टॅब पृषà¥à¤  आहे</translation>
+<translation id="1434886155212424586">होमपेज हे नवीन टॅब पृषà¥à¤  आहे</translation>
<translation id="1436784010935106834">काढली</translation>
<translation id="1438632560381091872">टॅब सशबà¥à¤¦ करा</translation>
<translation id="1442392616396121389">मारà¥à¤— उपसरà¥à¤—</translation>
@@ -1793,7 +1793,7 @@
<translation id="3693415264595406141">पासवरà¥à¤¡:</translation>
<translation id="3694027410380121301">मागील टॅब निवडा</translation>
<translation id="3697100740575341996">आपलà¥à¤¯à¤¾ IT पà¥à¤°à¤¶à¤¾à¤¸à¤•à¤¾à¤¨à¥‡ आपलà¥à¤¯à¤¾ डिवà¥à¤¹à¤¾à¤‡à¤¸à¤¸à¤¾à¤ à¥€ Chrome Goodies अकà¥à¤·à¤® केलà¥à¤¯à¤¾ आहेत. <ph name="MORE_INFO_LINK" /></translation>
-<translation id="3699624789011381381">ईमेल पतà¥à¤¤à¤¾</translation>
+<translation id="3699624789011381381">ईमेल अॅडà¥à¤°à¥‡à¤¸</translation>
<translation id="3702500414347826004"><ph name="URL" /> समाविषà¥â€à¤Ÿ करणà¥â€à¤¯à¤¾à¤¸à¤¾à¤ à¥€ आपली पà¥à¤°à¤¾à¤°à¤‚भ पृषà¥â€à¤ à¥‡ बदलली.</translation>
<translation id="370415077757856453">JavaScript बà¥à¤²à¥‰à¤• केले</translation>
<translation id="3704331259350077894">ऑपरेशनची समापà¥à¤¤à¥€</translation>
@@ -2915,7 +2915,7 @@
<translation id="5517535964909391608">असà¥à¤°à¤•à¥à¤·à¤¿à¤¤ आशय बà¥à¤²à¥‰à¤• केला</translation>
<translation id="5518219166343146486">साइटला कà¥à¤²à¤¿à¤ªà¤¬à¥‹à¤°à¥à¤¡à¤µà¤° कॉपी केलेला मजकूर आणि इमेज पाहायचà¥à¤¯à¤¾ असतील, तेवà¥à¤¹à¤¾ विचारा</translation>
<translation id="5518584115117143805">ईमेल कूटबदà¥à¤§à¥€à¤•à¤°à¤£ पà¥à¤°à¤®à¤¾à¤£à¤ªà¤¤à¥à¤°</translation>
-<translation id="5521078259930077036">आपण अपेकà¥à¤·à¤¾ करत होता हे तेच मà¥à¤–à¥à¤¯à¤ªà¥ƒà¤·à¥à¤  आहे?</translation>
+<translation id="5521078259930077036">आपण अपेकà¥à¤·à¤¾ करत होता हे तेच होमपेज आहे?</translation>
<translation id="5521348028713515143">डेसà¥à¤•à¤Ÿà¥‰à¤ª शॉरà¥à¤Ÿà¤•à¤Ÿ जोडा</translation>
<translation id="5522156646677899028">या विसà¥â€à¤¤à¤¾à¤°à¤¾à¤®à¤§à¥â€à¤¯à¥‡ à¤à¤• गंभीर सà¥à¤°à¤•à¥à¤·à¤¾ भेदà¥à¤¯à¤¤à¤¾ आहे.</translation>
<translation id="5524517123096967210">फाइल वाचली जाऊ शकली नाही.</translation>
@@ -3923,7 +3923,7 @@
<translation id="7108338896283013870">लपवा</translation>
<translation id="7108668606237948702">पà¥à¤°à¤µà¤¿à¤·à¥â€à¤Ÿ करा</translation>
<translation id="7112978678959880812">परà¥à¤¸à¤¨à¤²à¤¾à¤‡à¤ करणे चालू आहे. तà¥à¤®à¥à¤¹à¥€ हे myaccount.google.com वर बदलू शकता.</translation>
-<translation id="7113502843173351041">आपला ईमेल पतà¥à¤¤à¤¾ माहिती करून घà¥à¤¯à¤¾</translation>
+<translation id="7113502843173351041">आपला ईमेल अॅडà¥à¤°à¥‡à¤¸ माहिती करून घà¥à¤¯à¤¾</translation>
<translation id="7114054701490058191">पासवरà¥à¤¡ जà¥à¤³à¤¤ नाहीत</translation>
<translation id="7117228822971127758">कृपया नंतर पà¥à¤¨à¥à¤¹à¤¾ पà¥à¤°à¤¯à¤¤à¥à¤¨ करा</translation>
<translation id="7117247127439884114">पà¥à¤¨à¥à¤¹à¤¾ साइन इन करा...</translation>
@@ -3983,7 +3983,7 @@
<translation id="7221155467930685510">$1 GB</translation>
<translation id="7221855153210829124">सूचना दरà¥à¤¶à¤µà¤¾</translation>
<translation id="7221869452894271364">हे पृषà¥à¤  रीलोड करा</translation>
-<translation id="7222232353993864120">ईमेल पतà¥à¤¤à¤¾</translation>
+<translation id="7222232353993864120">ईमेल अॅडà¥à¤°à¥‡à¤¸</translation>
<translation id="7222373446505536781">F11</translation>
<translation id="722363467515709460">सà¥à¤•à¥à¤°à¥€à¤¨ भिंग सकà¥à¤·à¤® करा</translation>
<translation id="7223775956298141902">अरेरे.. आपलà¥à¤¯à¤¾à¤•à¤¡à¥‡ कोणतेही विसà¥à¤¤à¤¾à¤° नाहीत :-(</translation>
@@ -4078,7 +4078,7 @@
<translation id="7384292194278095697">हे डिवà¥à¤¹à¤¾à¤‡à¤¸ यापà¥à¤¢à¥‡ समरà¥à¤¥à¤¿à¤¤ असणार नाही</translation>
<translation id="7385854874724088939">पà¥à¤°à¤¿à¤‚ट करणà¥à¤¯à¤¾à¤šà¤¾ पà¥à¤°à¤¯à¤¤à¥à¤¨ करताना काहीतरी चूक à¤à¤¾à¤²à¥€. कृपया आपला पà¥à¤°à¤¿à¤‚टर तपासा आणि पà¥à¤¨à¥à¤¹à¤¾ पà¥à¤°à¤¯à¤¤à¥à¤¨ करा.</translation>
<translation id="7386824183915085801">वर समाविषà¥à¤Ÿ करणà¥à¤¯à¤¾à¤¸à¤¾à¤ à¥€ आपण निवडता तà¥â€à¤¯à¤¾ कोणतà¥à¤¯à¤¾à¤¹à¥€ माहिती वà¥à¤¯à¤¤à¤¿à¤°à¤¿à¤•à¥à¤¤ आपले
- Chrome आणि ऑपरेटिंग पà¥à¤°à¤£à¤¾à¤²à¥€ आवृतà¥à¤¤à¥€ सबमिट केली जाईल. आपण आपला ईमेल पतà¥à¤¤à¤¾
+ Chrome आणि ऑपरेटिंग पà¥à¤°à¤£à¤¾à¤²à¥€ आवृतà¥à¤¤à¥€ सबमिट केली जाईल. आपण आपला ईमेल अॅडà¥à¤°à¥‡à¤¸
समाविषà¥à¤Ÿ केलà¥à¤¯à¤¾à¤¸, Google आपलà¥à¤¯à¤¾à¤¶à¥€ अभिपà¥à¤°à¤¾à¤¯ अहवाला संबंधी संपरà¥à¤• साधू शकते. हा अभिपà¥à¤°à¤¾à¤¯
समसà¥à¤¯à¤¾à¤‚चे निदान करणà¥à¤¯à¤¾à¤¸à¤¾à¤ à¥€ आणि Chrome सà¥à¤§à¤¾à¤°à¤£à¥à¤¯à¤¾à¤¤ मदतीसाठी वापरला जातो. आपण
सà¥à¤¸à¥à¤ªà¤·à¥à¤Ÿà¤ªà¤£à¥‡ किंवा योगायोगाने सबमिट करता ती कोणतीही वैयकà¥à¤¤à¤¿à¤• माहिती,
@@ -4514,7 +4514,7 @@
<translation id="8053390638574070785">हे पृषà¥à¤  रीलोड करा</translation>
<translation id="8054029954190364711">फिंगरपà¥à¤°à¤¿à¤‚ट अनलॉक वैशिषà¥â€à¤Ÿà¥à¤¯</translation>
<translation id="8054517699425078995">या पà¥à¤°à¤•à¤¾à¤°à¤šà¥€ फाईल आपलà¥â€à¤¯à¤¾ डिवà¥â€à¤¹à¤¾à¤‡à¤¸à¤²à¤¾ हानी पोहचवू शकते. आपण <ph name="FILE_NAME" /> तरीही ठेवू इचà¥â€à¤›à¤¿à¤¤à¤¾?</translation>
-<translation id="8054563304616131773">कृपया à¤à¤• वैध ईमेल पतà¥à¤¤à¤¾ à¤à¤‚टर करा</translation>
+<translation id="8054563304616131773">कृपया à¤à¤• वैध ईमेल अॅडà¥à¤°à¥‡à¤¸ à¤à¤‚टर करा</translation>
<translation id="8054921503121346576">USB कीबोरà¥à¤¡ कनेकà¥à¤Ÿ à¤à¤¾à¤²à¤¾</translation>
<translation id="8058655154417507695">कालबाहà¥à¤¯ होणà¥à¤¯à¤¾à¤šà¥‡ वरà¥à¤·</translation>
<translation id="8059178146866384858">"$1" नावाची फाइल आधीच असà¥à¤¤à¤¿à¤¤à¥à¤µà¤¾à¤¤ आहे. कृपया भिनà¥à¤¨ नाव निवडा.</translation>
diff --git a/chromium/chrome/app/resources/generated_resources_no.xtb b/chromium/chrome/app/resources/generated_resources_no.xtb
index 5f08f4e7e24..7431d341c4b 100644
--- a/chromium/chrome/app/resources/generated_resources_no.xtb
+++ b/chromium/chrome/app/resources/generated_resources_no.xtb
@@ -5,6 +5,7 @@
<translation id="1003088604756913841">Ã…pne linken i et nytt <ph name="APP" />-vindu</translation>
<translation id="1005274289863221750">bruke mikrofonen din og kameraet ditt</translation>
<translation id="1007408791287232274">Kunne ikke laste inn enhetene.</translation>
+<translation id="1008186147501209563">Eksportér bokmerker</translation>
<translation id="1010833424573920260">{NUM_PAGES,plural, =1{Siden svarer ikke}other{Sidene svarer ikke}}</translation>
<translation id="1012794136286421601">Dokumenter-, Regneark-, Presentasjoner- og Tegninger-filene dine synkroniseres. Åpne Google Disk-appen for å få tilgang til dem med eller uten nett.</translation>
<translation id="1013707859758800957">Et programtillegg uten prosessisolering fikk tillatelse til å kjøre på denne siden.</translation>
@@ -51,6 +52,7 @@
<ph name="EXTENSION_NAME" /></translation>
<translation id="1071917609930274619">Datachiffrering</translation>
+<translation id="1074944608454986967">For å få innholdet lest opp, trykk og hold på Søk, og klikk eller dra for å velge innholdet. Eller fremhev et område og bruk Søk + S.</translation>
<translation id="1076698951459398590">Slå på temaet</translation>
<translation id="1076818208934827215">Microsoft Internet Explorer</translation>
<translation id="1077946062898560804">Velg automatiske oppdateringer for alle brukere</translation>
@@ -144,6 +146,7 @@
<translation id="1205489148908752564">Se gjennom og endre listen over godkjente brukere</translation>
<translation id="1206407435587370571">Utforsk Chromebooken din</translation>
<translation id="1209796539517632982">Automatiske navnetjenere</translation>
+<translation id="1210982357925844241">Se og administrer lagrede passord på <ph name="SAVED_PASSWORDS_LINK" /></translation>
<translation id="1211364473545090084">Med et inkognitovindu kan du bruke nettet uten at nettlesingsloggen lagres</translation>
<translation id="1213037489357051291"><ph name="NUM_FINGERPRINTS" /> fingeravtrykk er registrert</translation>
<translation id="1215411991991485844">Nytt bakgrunnsprogram er lagt til</translation>
@@ -231,6 +234,7 @@
<translation id="1347975661240122359">Oppdateringen starter når batteriet når <ph name="BATTERY_LEVEL" /> %.</translation>
<translation id="1351692861129622852">Importerer <ph name="FILE_COUNT" /> filer ...</translation>
<translation id="1353686479385938207"><ph name="PROVIDER_NAME" />: <ph name="NETWORK_NAME" /></translation>
+<translation id="1353980523955420967">Finner ikke PPD. Sjekk at Chromebooken din er på nettet, og prøv på nytt.</translation>
<translation id="1355466263109342573"><ph name="PLUGIN_NAME" /> er blokkert</translation>
<translation id="1357589289913453911">Utvidelses-ID</translation>
<translation id="1358735829858566124">Filen eller katalogen ikke er brukbar.</translation>
@@ -277,6 +281,7 @@
<translation id="1410616244180625362">Fortsett å tillate <ph name="HOST" /> å bruke kameraet ditt</translation>
<translation id="1411668397053040814">Installer eller oppdater Daydream-tastaturet for å bruke Chrome i VR</translation>
<translation id="1414648216875402825">Du er i ferd med å oppdatere en ustabil versjon av <ph name="PRODUCT_NAME" />, som inneholder funksjoner som er under utvikling. Kræsjing og uventede feil kan oppstå. Fortsett med forsiktighet.</translation>
+<translation id="1415708812149920388">Lesetilgang til utklippstavlen er avvist</translation>
<translation id="1415990189994829608"><ph name="EXTENSION_NAME" /> (utvidelses-ID «<ph name="EXTENSION_ID" />») tillates ikke i denne typen økt.</translation>
<translation id="1416836038590872660">EAP-MD5</translation>
<translation id="1420684932347524586">Beklager. Forsøket på å opprette tilfeldig RSA-privatnøkkel mislyktes.</translation>
@@ -310,6 +315,7 @@
<translation id="1465827627707997754">Pizzastykke</translation>
<translation id="1467432559032391204">Venstre</translation>
<translation id="1467999917853307373"><ph name="URL" /> ønsker å lagre data på enheten din permanent.</translation>
+<translation id="1468571364034902819">Du kan ikke bruke denne profilen</translation>
<translation id="1470719357688513792">Nye innstillinger for informasjonskapsler trer i kraft etter siden er lastet inn på nytt.</translation>
<translation id="1470811252759861213">For å få utvidelsene dine på alle datamaskinene du bruker, <ph name="SIGN_IN_LINK" />.</translation>
<translation id="1474339897586437869">«<ph name="FILENAME" />» ble ikke lastet opp. Det er ikke nok ledig plass på Google Disk.</translation>
@@ -458,6 +464,7 @@
<translation id="1673103856845176271">Filen kunne ikke åpnes av sikkerhetsårsaker.</translation>
<translation id="167832068858235403">redusert lydstyrke</translation>
<translation id="1679068421605151609">Utviklerverktøy</translation>
+<translation id="16815041330799488">Ikke la nettsteder se tekst og bilder som er kopiert til utklippstavlen</translation>
<translation id="1682548588986054654">Nytt inkognitovindu</translation>
<translation id="1688935057616748272">Skriv inn en bokstav</translation>
<translation id="168991973552362966">Legg til en skriver i nærheten</translation>
@@ -690,6 +697,7 @@
<translation id="2085470240340828803">Det finnes allerede en fil med navnet «<ph name="FILENAME" />». Hva ønsker du å gjøre?</translation>
<translation id="2087822576218954668">Skriv ut: <ph name="PRINT_NAME" /></translation>
<translation id="2089566709556890888">Surf trygt med Google Chrome</translation>
+<translation id="2089795179672254991">Spør når et nettsted ber om å se tekst og bilder som er kopiert til utklippstavlen (anbefalt)</translation>
<translation id="2090165459409185032">For å gjenopprette kontoinformasjonen din, gå til: google.com/accounts/recovery</translation>
<translation id="2090876986345970080">Systemets sikkerhetsinnstillinger</translation>
<translation id="2091887806945687916">Lyd</translation>
@@ -809,6 +817,7 @@
<translation id="2255317897038918278">Microsoft tidsangivelse</translation>
<translation id="225614027745146050">Velkommen</translation>
<translation id="225692081236532131">Aktiveringsstatus</translation>
+<translation id="2261323523305321874">Administratoren din har gjort en endring for hele systemet som deaktiverer enkelte gamle profiler.</translation>
<translation id="2262477216570151239">Forsinkelse før gjentakelse</translation>
<translation id="2263189956353037928">Logg av og på</translation>
<translation id="2263497240924215535">(deaktivert)</translation>
@@ -991,6 +1000,7 @@ Jeg tror ikke det er nødvendig å blokkere dette nettstedet.</translation>
<translation id="2562743677925229011">Ikke logget på <ph name="SHORT_PRODUCT_NAME" /></translation>
<translation id="2563856802393254086">Gratulerer! <ph name="NAME" />-datatjenesten din er aktivert og klar til bruk.</translation>
<translation id="2566124945717127842">Kjør Powerwash for å tilbakestille <ph name="IDS_SHORT_PRODUCT_NAME" />-enheten så den blir som ny.</translation>
+<translation id="2567257616420533738">Passordet er lagret. Se og administrer lagrede passord på <ph name="SAVED_PASSWORDS_LINK" /></translation>
<translation id="2568774940984945469">Beholder for inforad</translation>
<translation id="2570000010887652771">Lagrede data.</translation>
<translation id="257088987046510401">Temaer</translation>
@@ -1011,6 +1021,7 @@ Jeg tror ikke det er nødvendig å blokkere dette nettstedet.</translation>
<translation id="2582253231918033891"><ph name="PRODUCT_NAME" /> – <ph name="PRODUCT_VERSION" /> (plattform <ph name="PLATFORM_VERSION" />) – <ph name="DEVICE_SERIAL_NUMBER" /></translation>
<translation id="2585300050980572691">Standardinnstillinger for søk</translation>
<translation id="2586657967955657006">Utklippstavle</translation>
+<translation id="2586672484245266891">Skriv inn en kortere nettadresse</translation>
<translation id="2587922270115112871">Når du oppretter en administrert bruker, oppretter du ikke en Google-konto, og vedkommendes innstillinger og data blir ikke kopiert til andre enheter med Chrome-synkronisering. En administrert bruker er bare tilgjengelig på denne enheten.</translation>
<translation id="258932246702879617">Velg <ph name="BEGIN_BOLD" />Fest til oppgavelinjen<ph name="END_BOLD" /></translation>
<translation id="259421303766146093">Tilbakestill forstørrelsen</translation>
@@ -1061,6 +1072,7 @@ Jeg tror ikke det er nødvendig å blokkere dette nettstedet.</translation>
<translation id="265390580714150011">Feltverdi</translation>
<translation id="2655386581175833247">Brukersertifikat:</translation>
<translation id="2660779039299703961">Aktivitet</translation>
+<translation id="266079277508604648">Kan ikke koble til skriveren. Kontrollér at skriveren er slått på og koblet til Chromebooken din via Wi-Fi eller USB.</translation>
<translation id="2661146741306740526">16 x 9</translation>
<translation id="2662876636500006917">Chrome Nettmarked</translation>
<translation id="2663302507110284145">Språk</translation>
@@ -1083,6 +1095,7 @@ Jeg tror ikke det er nødvendig å blokkere dette nettstedet.</translation>
<translation id="2680208403056680091">Internett-tilkoblingen din kontrolleres</translation>
<translation id="268053382412112343">Lo&amp;gg</translation>
<translation id="2683638487103917598">Mappen er sortert</translation>
+<translation id="2684004000387153598">For å fortsette, klikk på OK. Klikk deretter på Legg til person for å opprette en ny profil for e-postadressen din.</translation>
<translation id="2686759344028411998">Finner ingen innlastede moduler.</translation>
<translation id="2688196195245426394">Feil under registreringen av enheten hos tjeneren: <ph name="CLIENT_ERROR" />.</translation>
<translation id="2690024944919328218">Vis alternativer for språk</translation>
@@ -1147,6 +1160,7 @@ Jeg tror ikke det er nødvendig å blokkere dette nettstedet.</translation>
<translation id="2773802008104670137">Denne filtypen kan skade datamaskinen din.</translation>
<translation id="2775104091073479743">Endre fingeravtrykk</translation>
<translation id="2776441542064982094">Det ser ut til at det ikke er noen enheter som kan registreres på nettverket. Hvis enheten din er slått på og koblet til Internett, kan du prøve å registrere den ved å følge instruksjonene i instruksjonshåndboken.</translation>
+<translation id="2781692009645368755">Google Pay</translation>
<translation id="2783298271312924866">Lastet ned</translation>
<translation id="2783661497142353826">Administrer kiosk-apper</translation>
<translation id="2784407158394623927">Aktiverer mobildatatjenesten</translation>
@@ -1210,6 +1224,7 @@ Jeg tror ikke det er nødvendig å blokkere dette nettstedet.</translation>
<translation id="2849936225196189499">Kritisk</translation>
<translation id="2850124913210091882">Sikkerhetskopiér</translation>
<translation id="2850541429955027218">Legg til temaet</translation>
+<translation id="2853121255651601031">Passordet er lagret</translation>
<translation id="2853916256216444076">$1-video</translation>
<translation id="2857608528410806398">Teksten i varselet for hurtigopplåsing-funksjonen skal være her. Teksten i varselet for hurtigopplåsing-funksjonen skal være her. Teksten i varselet for hurtigopplåsing-funksjonen skal være her. Teksten i varselet for hurtigopplåsing-funksjonen skal være her. Teksten i varselet for hurtigopplåsing-funksjonen skal være her.</translation>
<translation id="2860150991415616761">svært lang (4 s)</translation>
@@ -1252,6 +1267,7 @@ Jeg tror ikke det er nødvendig å blokkere dette nettstedet.</translation>
<translation id="2908162660801918428">Legg til mediegalleri etter katalog</translation>
<translation id="2908789530129661844">Zoom skjermen ut</translation>
<translation id="2910318910161511225">Koble til et nettverk og prøv igjen</translation>
+<translation id="2911898792135283060">Generer passord</translation>
<translation id="2912905526406334195"><ph name="HOST" /> ønsker å bruke mikrofonen din.</translation>
<translation id="2913331724188855103">Tillat at nettsteder lagrer og leser data i informasjonskapsler (anbefales).</translation>
<translation id="2916073183900451334">Trykk på Tab på en nettside for å utheve linker og skjemafelter</translation>
@@ -1443,6 +1459,7 @@ Du finner mer informasjon i <ph name="BEGIN_LINK" />brukerstøtten<ph name="END_
<translation id="3202173864863109533">Lyden er slått av for denne fanen.</translation>
<translation id="3206175707080061730">En fil med navnet $1 finnes allerede. Vil du erstatte den?</translation>
<translation id="3208703785962634733">Ikke bekreftet</translation>
+<translation id="3213187967168344806">Kan ikke legge til skriver. Start datamaskinen på nytt, og prøv igjen.</translation>
<translation id="321799795901478485">Zip Archiver</translation>
<translation id="3220586366024592812">Programstopp for kontaktprosessen for <ph name="CLOUD_PRINT_NAME" />. Vil du starte på nytt?</translation>
<translation id="3221634914176615296">Utforsk innholdet på enheten via Filer-appen.</translation>
@@ -1476,6 +1493,7 @@ Du finner mer informasjon i <ph name="BEGIN_LINK" />brukerstøtten<ph name="END_
<translation id="3268451620468152448">Ã…pne faner</translation>
<translation id="3269069891205016797">Informasjonen din fjernes fra enheten når du logger av.</translation>
<translation id="3269093882174072735">Last inn bildet</translation>
+<translation id="3269889795238950578">Denne siden kan se tekst og bilder som er kopiert til utklippstavlen.</translation>
<translation id="326999365752735949">Nedlastingsproblemer</translation>
<translation id="3270965368676314374">lese, endre og slette bilder, musikk og andre medier fra datamaskinen din</translation>
<translation id="327147043223061465">Se alle informasjonskapsler og nettstedsdata</translation>
@@ -1607,10 +1625,12 @@ Du finner mer informasjon i <ph name="BEGIN_LINK" />brukerstøtten<ph name="END_
<translation id="3450157232394774192">Utnyttelsesgrad for hviletilstand</translation>
<translation id="3453612417627951340">Trenger autorisasjon</translation>
<translation id="3454157711543303649">Aktiveringen er fullført</translation>
+<translation id="3454224730401036106">Tilkoblingen din er byttet til et sikrere nettverk</translation>
<translation id="345693547134384690">Ã…pne b&amp;ilde i ny fane</translation>
<translation id="3459509316159669723">Utskrift</translation>
<translation id="3459697287128633276">For å få tilgang til Google Play Butikken med kontoen din, bekreft hvem du er, hos identitetsleverandøren din.</translation>
<translation id="3459774175445953971">Sist endret:</translation>
+<translation id="3461266716147554923"><ph name="URL" /> ber om å se tekst og bilder som er kopiert til utklippstavlen</translation>
<translation id="3462413494201477527">Vil du avbryte kontokonfigurasjonen?</translation>
<translation id="346431825526753">Dette er en konto for barn, som administreres av <ph name="CUSTODIAN_EMAIL" />.</translation>
<translation id="3465566417615315331">Klikk på bildet ditt</translation>
@@ -1623,6 +1643,7 @@ Du finner mer informasjon i <ph name="BEGIN_LINK" />brukerstøtten<ph name="END_
<translation id="3470502288861289375">Kopierer ...</translation>
<translation id="3473479545200714844">Skjermforstørrer</translation>
<translation id="3475447146579922140">Google-regneark</translation>
+<translation id="3475538074809281797">{LINE_COUNT,plural, =1{&lt;1 linje vises ikke&gt;}other{&lt;$1 linjer vises ikke&gt;}}</translation>
<translation id="3475843873335999118">Fingeravtrykket ditt ble fortsatt ikke gjenkjent. Skriv inn passordet ditt.</translation>
<translation id="347670947055184738">Beklager. Systemet kunne ikke hente reglene for enheten din.</translation>
<translation id="347785443197175480">Fortsett å gi <ph name="HOST" /> tillatelse til å bruke kameraet og mikrofonen</translation>
@@ -1655,6 +1676,7 @@ Du finner mer informasjon i <ph name="BEGIN_LINK" />brukerstøtten<ph name="END_
<translation id="3511528412952710609">Kort</translation>
<translation id="3512410469020716447">{NUM_DOWNLOAD,plural, =1{Avbryt nedlastingen}other{Avbryt nedlastingene}}</translation>
<translation id="3514373592552233661">Foretrukne nettverk prioriteres fremfor andre kjente nettverk hvis mer enn ett nettverk er tilgjengelig</translation>
+<translation id="3520212870468945358"><ph name="URL" /> ber om å se serienummeret for sikkerhetsnøkkelen din</translation>
<translation id="3523642406908660543">Spør når et nettsted ønsker å bruke et programtillegg for å få tilgang til datamaskinen (anbefales)</translation>
<translation id="3525897975040424366">Installer i hyllen</translation>
<translation id="3527085408025491307">Mappe</translation>
@@ -1876,6 +1898,7 @@ Du finner mer informasjon i <ph name="BEGIN_LINK" />brukerstøtten<ph name="END_
<translation id="3838486795898716504">Mer av <ph name="PAGE_TITLE" /></translation>
<translation id="3838543471119263078">Informasjonskapsler og andre nettsteds- og programtilleggsdata</translation>
<translation id="383891835335927981">Det er ikke zoomet inn eller ut på noen nettsteder</translation>
+<translation id="3839516600093027468">Blokkér alltid <ph name="HOST" /> fra å se utklippstavlen</translation>
<translation id="3840053866656739575">Mistet tilkoblingen til Chromeboxen din. Gå nærmere eller sjekk enheten din mens vi prøver å koble til på nytt.</translation>
<translation id="3842132283799370683">Kunne ikke legge til maskinen på domenet. Dette kan være på grunn av problemer med organisasjonsenheten.</translation>
<translation id="3842552989725514455">Med seriffer</translation>
@@ -1944,6 +1967,7 @@ Du finner mer informasjon i <ph name="BEGIN_LINK" />brukerstøtten<ph name="END_
<translation id="3949790930165450333"><ph name="DEVICE_NAME" /> (<ph name="DEVICE_ID" />)</translation>
<translation id="394984172568887996">Importert fra Internet Explorer</translation>
<translation id="3950820424414687140">Logg på</translation>
+<translation id="3950870029767307261">Denne siden er blokkert fra å se tekst og bilder som er kopiert til utklippstavlen</translation>
<translation id="3954354850384043518">Pågår</translation>
<translation id="3955193568934677022">Gi nettsteder tillatelse til å spille av beskyttet innhold (anbefales)</translation>
<translation id="3956702100721821638">Kunne ikke nå Google Play</translation>
@@ -1976,6 +2000,7 @@ Du finner mer informasjon i <ph name="BEGIN_LINK" />brukerstøtten<ph name="END_
<translation id="39964277676607559">Kan ikke laste inn JavaScript <ph name="RELATIVE_PATH" /> for innholdsskript.</translation>
<translation id="4002066346123236978">Tittel</translation>
<translation id="40027638859996362">Ordforflytning</translation>
+<translation id="4005817994523282006">Metode for registrering av tidssone</translation>
<translation id="4008291085758151621">Nettstedsinformasjon er ikke tilgjengelig i VR</translation>
<translation id="4010917659463429001">For å få bokmerker på mobilenheten din, <ph name="GET_IOS_APP_LINK" />.</translation>
<translation id="4014432863917027322">Vil du reparere «<ph name="EXTENSION_NAME" />»?</translation>
@@ -1992,6 +2017,7 @@ Du finner mer informasjon i <ph name="BEGIN_LINK" />brukerstøtten<ph name="END_
<translation id="4037084878352560732">Hest</translation>
<translation id="4037889604535939429">Endre person</translation>
<translation id="4042264909745389898">Vilkår for Google Chrome OS</translation>
+<translation id="4042863763121826131">{NUM_PAGES,plural, =1{Lukk siden}other{Lukk sidene}}</translation>
<translation id="4044612648082411741">Angi sertifikatpassordet ditt</translation>
<translation id="404493185430269859">Standard søkemotor</translation>
<translation id="4047112090469382184">Derfor er dette sikkert</translation>
@@ -2135,6 +2161,7 @@ Du finner mer informasjon i <ph name="BEGIN_LINK" />brukerstøtten<ph name="END_
<translation id="430303754419731728">Du har en ny OS-oppdatering. Logg på for å komme i gang.</translation>
<translation id="4305227814872083840">lang (2 s)</translation>
<translation id="4309420042698375243"><ph name="NUM_KILOBYTES" /> kB (<ph name="NUM_KILOBYTES_LIVE" /> kB ubrukt)</translation>
+<translation id="4310139701823742692">Filen har feil format. Sjekk PPD-filen og prøv på nytt.</translation>
<translation id="431076611119798497">&amp;Detaljer</translation>
<translation id="4312866146174492540">Blokkér (standard)</translation>
<translation id="4316850752623536204">Utviklernettsted</translation>
@@ -2184,6 +2211,7 @@ Du finner mer informasjon i <ph name="BEGIN_LINK" />brukerstøtten<ph name="END_
<translation id="4408599188496843485">H&amp;jelp</translation>
<translation id="4409697491990005945">Marger</translation>
<translation id="4411578466613447185">Kodesignatar</translation>
+<translation id="4412698727486357573">Brukerstøtte</translation>
<translation id="4414232939543644979">Nytt &amp;inkognitovindu</translation>
<translation id="4415748029120993980">SECG elliptisk kurve secp384r1 (også kjent som NIST P-384)</translation>
<translation id="4419409365248380979">Tillat alltid at <ph name="HOST" /> angir informasjonskapsler</translation>
@@ -2239,6 +2267,7 @@ Du finner mer informasjon i <ph name="BEGIN_LINK" />brukerstøtten<ph name="END_
<translation id="4520385623207007473">Informasjonskapsler i bruk</translation>
<translation id="452039078290142656">ukjente enheter fra <ph name="VENDOR_NAME" /></translation>
<translation id="4522570452068850558">Detaljer</translation>
+<translation id="4522600456902129422">Fortsett å gi dette nettstedet tillatelse til å se utklippstavlen</translation>
<translation id="4530494379350999373">Opprinnelse</translation>
<translation id="4532499992208253975">em-innlasting</translation>
<translation id="4533985347672295764">CPU-tid</translation>
@@ -2255,6 +2284,7 @@ Du finner mer informasjon i <ph name="BEGIN_LINK" />brukerstøtten<ph name="END_
<translation id="4545759655004063573">Manglende tillatelser gjør lagring umulig her. Lagre på et annet sted.</translation>
<translation id="4546308221697447294">Surf raskt med Google Chrome</translation>
<translation id="4547659257713117923">Ingen faner fra andre enheter</translation>
+<translation id="4547672827276975204">Angi automatisk</translation>
<translation id="4547992677060857254">Mappen du valgte inneholder sensitive filer. Er du sikker på at du vil gi «$ 1» permanent skrivetilgang til denne mappen?</translation>
<translation id="4552031286893852992">Chrome har blokkert annonser på dette nettstedet fordi det ofte viser forstyrrende annonser.</translation>
<translation id="4552089082226364758">Flash</translation>
@@ -2426,6 +2456,7 @@ Du finner mer informasjon i <ph name="BEGIN_LINK" />brukerstøtten<ph name="END_
<translation id="4837926214103741331">Du er ikke autorisert til å bruke denne enheten. Ta kontakt med eieren av enheten for å få tillatelse til å logge på.</translation>
<translation id="4837952862063191349">For å låse opp og gjenopprette lokale data må du oppgi det gamle <ph name="DEVICE_TYPE" />-passordet ditt.</translation>
<translation id="4838355575774807786">En feil oppsto da Chrome fjernet skadelig programvare.</translation>
+<translation id="4838836835474292213">Lesetilgang til utklippstavlen er tillatt</translation>
<translation id="4839303808932127586">La&amp;gre video som</translation>
<translation id="4839847978919684242"><ph name="SELCTED_FILES_COUNT" /> elementer valgt</translation>
<translation id="4840150926623932060">{NUM_DOWNLOAD,plural, =1{1 til}other{# til}}</translation>
@@ -2526,6 +2557,7 @@ Du finner mer informasjon i <ph name="BEGIN_LINK" />brukerstøtten<ph name="END_
<translation id="4970738541803285369">Installer på skrivebordet</translation>
<translation id="4971412780836297815">Åpne når ferdig</translation>
<translation id="4972129977812092092">Endre skriveren</translation>
+<translation id="497287958838527945">Kredittkort og adresser ved bruk av Google Pay.</translation>
<translation id="4973307593867026061">Legg til skrivere</translation>
<translation id="4973523518332075481">Bruk et navn på <ph name="MAX_LENGTH" /> eller færre tegn</translation>
<translation id="497421865427891073">GÃ¥ til neste</translation>
@@ -2878,6 +2910,7 @@ Du finner mer informasjon i <ph name="BEGIN_LINK" />brukerstøtten<ph name="END_
<translation id="5516183516694518900">Logg på Chrome med Google-kontoen din for å hente bokmerkene, loggen, passordene og andre innstillinger på alle enhetene dine.</translation>
<translation id="551752069230578406">Legger til skriveren i kontoen din – dette kan ta en liten stund …</translation>
<translation id="5517535964909391608">Usikkert innhold er blokkert</translation>
+<translation id="5518219166343146486">Spør når et nettsted ber om å se tekst og bilder som er kopiert til utklippstavlen</translation>
<translation id="5518584115117143805">Sertifikat for kryptering av e-post</translation>
<translation id="5521078259930077036">Er dette startsiden du forventet?</translation>
<translation id="5521348028713515143">Legg til skrivebordsnarvei</translation>
@@ -3085,6 +3118,7 @@ Du finner mer informasjon i <ph name="BEGIN_LINK" />brukerstøtten<ph name="END_
<translation id="5843250171025351504">Enheten din overholder ikke lenger minimum klientversjon som er angitt av administratoren din. Oppdater for å logge på.</translation>
<translation id="5846929185714966548">Fane 4</translation>
<translation id="5848924408752252705">Trykk for å gå tilbake.</translation>
+<translation id="5849212445710944278">Allerede lagt til</translation>
<translation id="5849570051105887917">Kode for leverandøren for hjemmeenheten</translation>
<translation id="5849869942539715694">Pakk utvidelse</translation>
<translation id="5850516540536751549">Denne filtypen støttes ikke. Gå til <ph name="BEGIN_LINK" />Chrome Nettmarked<ph name="END_LINK" /> for å finne en app som kan åpne denne filtypen.
@@ -3253,9 +3287,11 @@ Du finner mer informasjon i <ph name="BEGIN_LINK" />brukerstøtten<ph name="END_
<translation id="6107012941649240045">Utstedt til</translation>
<translation id="6112952769866305444">Endre personen <ph name="PROFILE_NAME" /> (<ph name="USERNAME" />)</translation>
<translation id="6115424132962100663">Trykk på |<ph name="SHORTCUT" />| for å gå tilbake</translation>
+<translation id="6116338172782435947">Se tekst og bilder som er kopiert til utklippstavlen</translation>
<translation id="6116921718742659598">Endre språk- og inndatainnstillinger</translation>
<translation id="6120205520491252677">Fest denne siden til startsiden</translation>
<translation id="6122081475643980456">Internett-tilkoblingen din kontrolleres</translation>
+<translation id="6122095009389448667">Fortsett å blokkere dette nettstedet fra å se utklippstavlen</translation>
<translation id="6122875415561139701">Skriveoperasjonen er ikke tillatt på: «<ph name="DEVICE_NAME" />».</translation>
<translation id="6124650939968185064">Disse utvidelsene er avhengige av denne utvidelsen:</translation>
<translation id="6125479973208104919">Du må dessverre legge til kontoen din på denne <ph name="DEVICE_TYPE" />-enheten på nytt.</translation>
@@ -3346,6 +3382,7 @@ Du finner mer informasjon i <ph name="BEGIN_LINK" />brukerstøtten<ph name="END_
<translation id="6263284346895336537">Ikke kritisk</translation>
<translation id="6263541650532042179">tilbakestill synkronisering</translation>
<translation id="6264365405983206840">Velg &amp;alle</translation>
+<translation id="6265930187414222160">Ferdig! Skadelig programvare er fjernet.</translation>
<translation id="6267166720438879315">Velg sertifikat for å autentisere deg selv til <ph name="HOST_NAME" /></translation>
<translation id="6268252012308737255">Ã…pne med <ph name="APP" /></translation>
<translation id="6268747994388690914">Importér bokmerker fra HTML-fil</translation>
@@ -3647,6 +3684,7 @@ Du finner mer informasjon i <ph name="BEGIN_LINK" />brukerstøtten<ph name="END_
<translation id="6736045498964449756">Beklager. Passordene samsvarer ikke!</translation>
<translation id="6736243959894955139">Adresse</translation>
<translation id="6736329909263487977"><ph name="ISSUED_BY" /> [<ph name="ISSUED_TO" />]</translation>
+<translation id="673970589316422346">Selv om du ikke har tilgang til den gamle profilen din lenger, kan du fjerne den.</translation>
<translation id="6739923123728562974">Vis skrivebordssnarvei</translation>
<translation id="6740234557573873150"><ph name="FILE_NAME" /> er satt på pause</translation>
<translation id="6742339027238151589">Tilgjengelig for skript</translation>
@@ -3663,6 +3701,7 @@ Du finner mer informasjon i <ph name="BEGIN_LINK" />brukerstøtten<ph name="END_
<translation id="6757101664402245801">Nettadressen er kopiert</translation>
<translation id="6758056191028427665">Gi oss tilbakemelding.</translation>
<translation id="6759193508432371551">Tilbakestilling til fabrikkstandard</translation>
+<translation id="6765234885931342179">Se serienummeret til sikkerhetsnøkkelen din</translation>
<translation id="6766101255664245434">Ta et nytt bilde eller velg et eksisterende bilde eller ikon.
<ph name="LINE_BREAK" />
Dette bildet vises på låse- og påloggingsskjermen på Chromebooken.</translation>
@@ -3753,6 +3792,7 @@ Du finner mer informasjon i <ph name="BEGIN_LINK" />brukerstøtten<ph name="END_
<translation id="691024665142758461">Last ned flere filer.</translation>
<translation id="6911324888870229398">Nettverkstilkoblingen gikk tapt. Kontrollér tilkoblingen din, eller prøv et annet Wi-Fi-nettverk.</translation>
<translation id="6911734910326569517">Minnebruk</translation>
+<translation id="6914783257214138813">Passordene dine blir synlige for alle som kan se den eksporterte filen.</translation>
<translation id="6915804003454593391">Bruker:</translation>
<translation id="6916590542764765824">Administrer utvidelser</translation>
<translation id="6920989436227028121">Ã…pne som vanlig fane</translation>
@@ -3871,6 +3911,7 @@ Du finner mer informasjon i <ph name="BEGIN_LINK" />brukerstøtten<ph name="END_
<translation id="7093866338626856921">Utveksle data med enhetene <ph name="HOSTNAMES" /></translation>
<translation id="7096108453481049031">Den administrerte brukeren kunne ikke importeres. Kontrollér nettverkstilkoblingen din, og prøv igjen senere.</translation>
<translation id="7098447629416471489">Andre lagrede søkemotorer vises her</translation>
+<translation id="7099337801055912064">Kan ikke laste inn stor PPD. Maksimal størrelse er 250 kB.</translation>
<translation id="7100897339030255923"><ph name="COUNT" /> elementer er valgt</translation>
<translation id="7102687220333134671">Automatiske oppdateringer er slått på</translation>
<translation id="7106346894903675391">Kjøp mer lagringsplass</translation>
@@ -3929,6 +3970,7 @@ Du finner mer informasjon i <ph name="BEGIN_LINK" />brukerstøtten<ph name="END_
<translation id="7201118060536064622">«<ph name="DELETED_ITEM_NAME" />» er slettet</translation>
<translation id="7205869271332034173">SSID:</translation>
<translation id="7206693748120342859">Laster ned <ph name="PLUGIN_NAME" /> …</translation>
+<translation id="720715819012336933">{NUM_PAGES,plural, =1{Lukk siden}other{Lukk sidene}}</translation>
<translation id="721331389620694978">Enkelte innstillinger som muligens gjenspeiler nettleservaner, blir ikke fjernet.</translation>
<translation id="7216409898977639127">Mobiloperatør</translation>
<translation id="7216595297012131718">Bestill språk basert på innstillingene dine</translation>
@@ -4037,6 +4079,7 @@ Du finner mer informasjon i <ph name="BEGIN_LINK" />brukerstøtten<ph name="END_
<translation id="7392118418926456391">Virusskanningen mislyktes</translation>
<translation id="7392915005464253525">Gj&amp;enåpne det lukkede vinduet</translation>
<translation id="7396845648024431313"><ph name="APP_NAME" /> starter ved systemoppstart, og fortsetter å kjøre i bakgrunnen selv når du har lukket alle andre vinduer for <ph name="PRODUCT_NAME" />.</translation>
+<translation id="7398254312354928459">Byttet nettverkstilkobling</translation>
<translation id="7400418766976504921">Nettadresse</translation>
<translation id="740083207982962331">Vent mens Chromeboxen din starter på nytt …</translation>
<translation id="7400839060291901923">Konfigurerer tilkoblingen på <ph name="PHONE_NAME" />-enheten din</translation>
@@ -4173,6 +4216,7 @@ Du finner mer informasjon i <ph name="BEGIN_LINK" />brukerstøtten<ph name="END_
<translation id="7607274158153386860">Be om nettsted for nettbrett</translation>
<translation id="7611008212562900400">Søk på enheten, i apper, på nettet osv.</translation>
<translation id="7615910377284548269">Administrer blokkering av programtillegg uten prosessisolering</translation>
+<translation id="7616214729753637086">Registrerer enheten …</translation>
<translation id="7617366389578322136">Kobler til «<ph name="DEVICE_NAME" />»</translation>
<translation id="761779991806306006">Ingen passord er lagret.</translation>
<translation id="7622114377921274169">Lader.</translation>
@@ -4201,6 +4245,7 @@ Du finner mer informasjon i <ph name="BEGIN_LINK" />brukerstøtten<ph name="END_
<translation id="7664620655576155379">Ustøttet Bluetooth-enhet: <ph name="DEVICE_NAME" />.</translation>
<translation id="7665369617277396874">Legg til konto</translation>
<translation id="7671130400130574146">Bruk systemets tittellinje og kantlinjer</translation>
+<translation id="7683373461016844951">For å fortsette, klikk på OK. Klikk deretter på Legg til person for å opprette en ny profil for <ph name="DOMAIN" />-e-postadressen din.</translation>
<translation id="7684212569183643648">Installert av administratoren din</translation>
<translation id="7684559058815332124">Besøk Captive Portal-påloggingssiden</translation>
<translation id="7685049629764448582">JavaScript-minne</translation>
@@ -4420,6 +4465,7 @@ Oppbevar nøkkelfilen på et trygt sted. Du får bruk for den når du skal oppre
<translation id="8000066093800657092">Ingen nettverk</translation>
<translation id="8001504501378762252">Et nettsted kan ha stjålet passordet ditt</translation>
<translation id="8004582292198964060">Nettleser</translation>
+<translation id="8005600846065423578">Tillat alltid at <ph name="HOST" /> ser utklippstavlen</translation>
<translation id="8008356846765065031">Internett er frakoblet. Sjekk Internett-forbindelsen din .</translation>
<translation id="8008765610824028412">Kunne ikke laste inn <ph name="PLUGIN_NAME" />.</translation>
<translation id="8008818777654712271">Send automatisk noe systeminformasjon og sideinnhold til Google for å bidra til å oppdage farlige apper og nettsteder.</translation>
@@ -4747,6 +4793,7 @@ Oppbevar nøkkelfilen på et trygt sted. Du får bruk for den når du skal oppre
<translation id="8569764466147087991">Velg en fil du vil åpne</translation>
<translation id="8571213806525832805">Siste 4 uker</translation>
<translation id="8574990355410201600">Tillat alltid lyd på <ph name="HOST" /></translation>
+<translation id="8578639784464423491">Kan ikke overstige 99 bokstaver</translation>
<translation id="8579285237314169903">Synkroniserer <ph name="NUMBER_OF_FILES" /> elementer …</translation>
<translation id="857943718398505171">Tillatt (anbefales)</translation>
<translation id="8581809080475256101">Trykk for å gå fremover, eller trykk på kontekstmenyen for å se loggen</translation>
diff --git a/chromium/chrome/app/resources/generated_resources_pl.xtb b/chromium/chrome/app/resources/generated_resources_pl.xtb
index 6dd6cc0cd2d..0de3ab1cb5b 100644
--- a/chromium/chrome/app/resources/generated_resources_pl.xtb
+++ b/chromium/chrome/app/resources/generated_resources_pl.xtb
@@ -1221,7 +1221,7 @@ Ta strona nie powinna być zablokowana.</translation>
<translation id="2843806747483486897">Zmień ustawienie domyślne...</translation>
<translation id="2844111009524261443">Uruchamiaj po kliknięciu</translation>
<translation id="2845382757467349449">Zawsze pokazuj pasek zakładek</translation>
-<translation id="2847759467426165163">Prześlij do</translation>
+<translation id="2847759467426165163">Przesyłaj na</translation>
<translation id="284805635805850872">Usunąć szkodliwe oprogramowanie?</translation>
<translation id="2849362176025371110">Automatycznie wysyłaj do Google dane diagnostyczne i informacje dotyczące użytkowania. Tę opcję możesz zmienić w dowolnym momencie w <ph name="BEGIN_LINK1" />ustawieniach<ph name="END_LINK1" /> urządzenia. <ph name="BEGIN_LINK2" />Więcej informacji<ph name="END_LINK2" /></translation>
<translation id="284970761985428403"><ph name="ASCII_NAME" /> (<ph name="UNICODE_NAME" />)</translation>
diff --git a/chromium/chrome/app/resources/generated_resources_pt-BR.xtb b/chromium/chrome/app/resources/generated_resources_pt-BR.xtb
index f09a14684c2..d46fa1de2a9 100644
--- a/chromium/chrome/app/resources/generated_resources_pt-BR.xtb
+++ b/chromium/chrome/app/resources/generated_resources_pt-BR.xtb
@@ -4245,7 +4245,7 @@ permanentemente excluídos assim que esse usuário for removido. Os websites vis
<translation id="7628127343934101653">Abrir arquivos em PDF no aplicativo visualizador de PDF padrão.</translation>
<translation id="7629827748548208700">Guia: <ph name="TAB_NAME" /></translation>
<translation id="7631887513477658702">&amp;Sempre abrir arquivos deste tipo</translation>
-<translation id="7632948528260659758">Os seguintes apps de quiosque tiveram falha na atualização:</translation>
+<translation id="7632948528260659758">Os seguintes aplicativos de quiosque tiveram falha na atualização:</translation>
<translation id="7639178625568735185">Entendi.</translation>
<translation id="763959977925219242">Pop-ups bloqueados</translation>
<translation id="764017888128728"><ph name="PASSWORD_MANAGER_BRAND" /> conecta você automaticamente a sites qualificados com as senhas que você salvou.</translation>
diff --git a/chromium/chrome/app/resources/generated_resources_sw.xtb b/chromium/chrome/app/resources/generated_resources_sw.xtb
index 19bb98d0dad..f9ac01f583a 100644
--- a/chromium/chrome/app/resources/generated_resources_sw.xtb
+++ b/chromium/chrome/app/resources/generated_resources_sw.xtb
@@ -2063,7 +2063,7 @@ Ungependa kuanza <ph name="CONTROL_PANEL_APPLET_NAME" />?</translation>
<translation id="4109135793348361820">Hamisha dirisha hadi kwa <ph name="USER_NAME" /> (<ph name="USER_EMAIL" />)</translation>
<translation id="4110559665646603267">kabati ya Kulenga</translation>
<translation id="4114360727879906392">Dirisha la awali</translation>
-<translation id="4115002065223188701">Mtandao upo mbali ya ufikiaji</translation>
+<translation id="4115002065223188701">Uko mbali na mtandao huu</translation>
<translation id="4115080753528843955">Baadhi ya huduma za maudhui hutumia vitambulisho vya kipekee kwa madhumuni ya kuidhinisha ufikiaji wa maudhui yaliyolindwa</translation>
<translation id="411666854932687641">Kumbukukumbu Binafsi</translation>
<translation id="4120817667028078560">Kijia ni kirefu mno</translation>
diff --git a/chromium/chrome/app/resources/generated_resources_zh-TW.xtb b/chromium/chrome/app/resources/generated_resources_zh-TW.xtb
index 01b687e6e97..306f2cc2cc1 100644
--- a/chromium/chrome/app/resources/generated_resources_zh-TW.xtb
+++ b/chromium/chrome/app/resources/generated_resources_zh-TW.xtb
@@ -315,7 +315,7 @@
<translation id="1465827627707997754">披薩切片</translation>
<translation id="1467432559032391204">å‘å·¦</translation>
<translation id="1467999917853307373"><ph name="URL" /> è¦æ±‚在你的è£ç½®ä¸Šæ°¸ä¹…儲存資料。</translation>
-<translation id="1468571364034902819">無法使用這個個人資料</translation>
+<translation id="1468571364034902819">無法使用這個設定檔</translation>
<translation id="1470719357688513792">æ–°çš„ Cookie 設定會在é‡æ–°è¼‰å…¥ç¶²é å¾Œç”Ÿæ•ˆã€‚</translation>
<translation id="1470811252759861213">如è¦åœ¨æ‰€æœ‰é›»è…¦ä¸Šä½¿ç”¨æ‚¨çš„擴充功能,請<ph name="SIGN_IN_LINK" />。</translation>
<translation id="1474339897586437869">您的 Google 雲端硬碟的å¯ç”¨ç©ºé–“ä¸è¶³ï¼Œå› æ­¤ç„¡æ³•ä¸Šå‚³ã€Œ<ph name="FILENAME" />ã€ã€‚</translation>
@@ -820,7 +820,7 @@
<translation id="2255317897038918278">Microsoft 時間戳記</translation>
<translation id="225614027745146050">歡迎使用</translation>
<translation id="225692081236532131">啟用狀態</translation>
-<translation id="2261323523305321874">管ç†å“¡æ‰€åšçš„系統全域變更åœç”¨äº†éƒ¨åˆ†èˆŠçš„個人資料。</translation>
+<translation id="2261323523305321874">你的管ç†å“¡è®Šæ›´äº†ç³»çµ±è¨­å®šï¼Œéƒ¨åˆ†èˆŠçš„設定檔因此é­åˆ°åœç”¨ã€‚</translation>
<translation id="2262477216570151239">é‡è¤‡å‰å»¶é²æ™‚é–“</translation>
<translation id="2263189956353037928">登出å†é‡æ–°ç™»å…¥</translation>
<translation id="2263497240924215535">(å·²åœç”¨)</translation>
@@ -1099,7 +1099,7 @@
<translation id="2680208403056680091">你的網際網路連線目å‰å—到控制</translation>
<translation id="268053382412112343">記錄(&amp;S)</translation>
<translation id="2683638487103917598">資料夾已排åº</translation>
-<translation id="2684004000387153598">如è¦ç¹¼çºŒæ“作,請ä¾åºé»žé¸ [確定] å’Œ [新增使用者],為你的電å­éƒµä»¶åœ°å€å»ºç«‹æ–°çš„個人資料。</translation>
+<translation id="2684004000387153598">如è¦ç¹¼çºŒæ“作,請ä¾åºé»žé¸ [確定] å’Œ [新增使用者],為你的電å­éƒµä»¶åœ°å€å»ºç«‹æ–°çš„設定檔。</translation>
<translation id="2686759344028411998">未åµæ¸¬åˆ°ä»»ä½•å·²è¼‰å…¥çš„模組。</translation>
<translation id="2688196195245426394">å‘伺æœå™¨è¨»å†Šè£ç½®æ™‚發生錯誤:<ph name="CLIENT_ERROR" />。</translation>
<translation id="2690024944919328218">顯示語言é¸é …</translation>
@@ -1630,7 +1630,7 @@
<translation id="3450157232394774192">閒置狀態å ç”¨çŽ‡</translation>
<translation id="3453612417627951340">需è¦æŽˆæ¬Š</translation>
<translation id="3454157711543303649">啟用完æˆ</translation>
-<translation id="3454224730401036106">已改為連線至更安全的網路</translation>
+<translation id="3454224730401036106">已切æ›è‡³æ›´å®‰å…¨çš„網路連線</translation>
<translation id="345693547134384690">在新分é ä¸­é–‹å•Ÿåœ–片(&amp;I)</translation>
<translation id="3459509316159669723">列å°</translation>
<translation id="3459697287128633276">如è¦ä½¿ç”¨ä½ çš„å¸³æˆ¶å­˜å– Google Play 商店,請é€éŽè­˜åˆ¥è³‡è¨Šæ供者進行驗證。</translation>
@@ -3690,7 +3690,7 @@
<translation id="6736045498964449756">糟糕,密碼ä¸ç¬¦ï¼</translation>
<translation id="6736243959894955139">ä½å€</translation>
<translation id="6736329909263487977"><ph name="ISSUED_BY" /> [<ph name="ISSUED_TO" />]</translation>
-<translation id="673970589316422346">雖然你無法å†å­˜å–舊的個人資料,但å¯å°‡å…¶ç§»é™¤ã€‚</translation>
+<translation id="673970589316422346">雖然你無法å†ä½¿ç”¨èˆŠçš„設定檔,但å¯å°‡å…¶ç§»é™¤ã€‚</translation>
<translation id="6739923123728562974">顯示桌é¢æ·å¾‘</translation>
<translation id="6740234557573873150">已暫åœä¸‹è¼‰ <ph name="FILE_NAME" /></translation>
<translation id="6742339027238151589">å¯é€éŽæŒ‡ä»¤ç¢¼å­˜å–</translation>
@@ -4256,7 +4256,7 @@
<translation id="7664620655576155379">ä¸æ”¯æ´çš„è—牙è£ç½®ï¼šã€Œ<ph name="DEVICE_NAME" />ã€ã€‚</translation>
<translation id="7665369617277396874">新增帳戶</translation>
<translation id="7671130400130574146">使用系統標題列åŠé‚Šç•Œ</translation>
-<translation id="7683373461016844951">如è¦ç¹¼çºŒæ“作,請ä¾åºé»žé¸ [確定] å’Œ [新增使用者],為你的 <ph name="DOMAIN" /> é›»å­éƒµä»¶åœ°å€å»ºç«‹æ–°çš„個人資料。</translation>
+<translation id="7683373461016844951">如è¦ç¹¼çºŒæ“作,請ä¾åºé»žé¸ [確定] å’Œ [新增使用者],為你的 <ph name="DOMAIN" /> é›»å­éƒµä»¶åœ°å€å»ºç«‹æ–°çš„設定檔。</translation>
<translation id="7684212569183643648">由您的管ç†å“¡å®‰è£</translation>
<translation id="7684559058815332124">造訪監控å¼å…¥å£ç¶²ç«™ç™»å…¥é é¢</translation>
<translation id="7685049629764448582">JavaScript 記憶體使用é‡</translation>
diff --git a/chromium/chrome/app/resources/google_chrome_strings_ar.xtb b/chromium/chrome/app/resources/google_chrome_strings_ar.xtb
index 7a2e30647b3..dfc2cf8de5b 100644
--- a/chromium/chrome/app/resources/google_chrome_strings_ar.xtb
+++ b/chromium/chrome/app/resources/google_chrome_strings_ar.xtb
@@ -218,7 +218,7 @@
<translation id="7494905215383356681">â€ØªØ±Ø§Ø®ÙŠØµ Ù…Ùتوحة المصدر لـ Chrome</translation>
<translation id="7535429826459677826">â€Ø¥ØµØ¯Ø§Ø± مطوري البرامج من Google Chrome</translation>
<translation id="7552219221109926349">â€Ø¹Ø±Ø¶ نظام تشغيل Chrome بهذه اللغة</translation>
-<translation id="7589360514048265910">â€Ù„Ù† يتلقى هذا الكمبيوتر تحديثات Google Chrome بعد الآن لأن نظام التشغيل Mac OS X 10.9 أصبح غير معتمد.</translation>
+<translation id="7589360514048265910">â€Ù„Ù† يتلقى هذا الكمبيوتر تحديثات Google Chrome بعد الآن لأن نظام التشغيل Mac OS X 10.9 لم يعÙد متاحًا.</translation>
<translation id="7592736734348559088">â€ØªØ¹Ø°Ø± على Google Chrome مزامنة البيانات نظرًا لأن تÙاصيل تسجيل الدخول إلى حسابك قديمة.</translation>
<translation id="7626032353295482388">â€Ù…رحبًا بك ÙÙŠ Chromeâ€</translation>
<translation id="7747138024166251722">تعذر على أداة المثبّÙت إنشاء دليل مؤقت. ÙŠÙرجى التحقق من وجود مساحة خالية على القرص وتوÙر الإذن اللازم لتثبيت البرنامج.</translation>
diff --git a/chromium/chrome/app/resources/google_chrome_strings_bg.xtb b/chromium/chrome/app/resources/google_chrome_strings_bg.xtb
index 7ea236fef3f..18ecc33c69a 100644
--- a/chromium/chrome/app/resources/google_chrome_strings_bg.xtb
+++ b/chromium/chrome/app/resources/google_chrome_strings_bg.xtb
@@ -216,6 +216,7 @@
<translation id="7494905215383356681">Лицензи за отворен код за Chrome</translation>
<translation id="7535429826459677826">Google Chrome Dev</translation>
<translation id="7552219221109926349">Показване на Chrome OS на този език</translation>
+<translation id="7589360514048265910">Занапред този компютър нÑма да получава актуализации на Google Chrome, защото Mac OS X 10.9 вече не Ñе поддържа.</translation>
<translation id="7592736734348559088">Google Chrome не можа да Ñинхронизира данните ви, защото потребителÑкото име и паролата за вход в профила ви не Ñа актуални.</translation>
<translation id="7626032353295482388">Добре дошли в Chrome</translation>
<translation id="7747138024166251722">ИнÑталационната програма не можа да Ñъздаде временна директориÑ. МолÑ, проверете дали има Ñвободно диÑково проÑтранÑтво и разрешение за инÑталиране на Ñофтуер.</translation>
diff --git a/chromium/chrome/app/resources/google_chrome_strings_bn.xtb b/chromium/chrome/app/resources/google_chrome_strings_bn.xtb
index 5099efe7c8c..9d54587108c 100644
--- a/chromium/chrome/app/resources/google_chrome_strings_bn.xtb
+++ b/chromium/chrome/app/resources/google_chrome_strings_bn.xtb
@@ -218,6 +218,7 @@
<translation id="7494905215383356681">Chrome মà§à¦•à§à¦¤ উৎসের লাইসেনà§à¦¸à¦—à§à¦²à¦¿</translation>
<translation id="7535429826459677826">Google Chrome ডেভেলপার</translation>
<translation id="7552219221109926349">à¦à¦‡ ভাষায় Chrome OS পà§à¦°à¦¦à¦°à§à¦¶à¦¨ করà§à¦¨</translation>
+<translation id="7589360514048265910">à¦à¦‡ কমà§à¦ªà¦¿à¦‰à¦Ÿà¦¾à¦°à¦Ÿà¦¿ আর Google Chrome à¦à¦° আপডেট গà§à¦°à¦¹à¦£ করবে না কারণ à¦à¦‡ Mac OS X 10.9 আর সমরà§à¦¥à¦¿à¦¤ নয়৷</translation>
<translation id="7592736734348559088">Google Chrome আপনার অà§à¦¯à¦¾à¦•à¦¾à¦‰à¦¨à§à¦Ÿ পà§à¦°à¦¬à§‡à¦¶ করà§à¦¨ বিশদটি তারিখ সীমার বাইরে হওয়ার কারণে সিঙà§à¦• করতে পারেনি৷</translation>
<translation id="7626032353295482388">Chrome ঠসà§à¦¬à¦¾à¦—তম</translation>
<translation id="7747138024166251722">ইনসà§à¦Ÿà¦²à¦¾à¦°à¦Ÿà¦¿ অসà§à¦¥à¦¾à§Ÿà§€ ডাইরেকà§à¦Ÿà¦°à¦¿ তৈরি করতে পারে নি৷ দয়া করে মà§à¦•à§à¦¤ ডিসà§à¦• সà§à¦¥à¦¾à¦¨ à¦à¦¬à¦‚ সফà§à¦Ÿà¦“য়à§à¦¯à¦¾à¦°à¦Ÿà¦¿ ইনসà§à¦Ÿà¦² করার অনà§à¦®à¦¤à¦¿ যাচাই করে নিন৷</translation>
diff --git a/chromium/chrome/app/resources/google_chrome_strings_ca.xtb b/chromium/chrome/app/resources/google_chrome_strings_ca.xtb
index 3edbe4219ce..5fd1704a77d 100644
--- a/chromium/chrome/app/resources/google_chrome_strings_ca.xtb
+++ b/chromium/chrome/app/resources/google_chrome_strings_ca.xtb
@@ -214,6 +214,7 @@ Per obtenir més instruccions, consulteu el correu electrònic a <ph name="ACCOU
<translation id="7494905215383356681">Llicències de programari lliure de Chrome</translation>
<translation id="7535429826459677826">Google Chrome Dev</translation>
<translation id="7552219221109926349">Mostra Chrome OS en aquest idioma</translation>
+<translation id="7589360514048265910">Aquest ordinador ja no rebrà més actualitzacions de Google Chrome perquè Mac OS X 10.9 ja no és compatible.</translation>
<translation id="7592736734348559088">Google Chrome no ha pogut sincronitzar les dades perquè els detalls d'inici de sessió del compte no estan actualitzats.</translation>
<translation id="7626032353295482388">Us donem la benvinguda a Chrome</translation>
<translation id="7747138024166251722">L'instal·lador no ha pogut crear un directori temporal. Comprova que hi ha espai lliure al disc i que tens permís per instal·lar el programari.</translation>
diff --git a/chromium/chrome/app/resources/google_chrome_strings_cs.xtb b/chromium/chrome/app/resources/google_chrome_strings_cs.xtb
index c63cc971a11..071729073b2 100644
--- a/chromium/chrome/app/resources/google_chrome_strings_cs.xtb
+++ b/chromium/chrome/app/resources/google_chrome_strings_cs.xtb
@@ -222,6 +222,7 @@ Aplikace Google Chrome nemůže vaše nastavení obnovit.</translation>
<translation id="7494905215383356681">Chrome – licence open source</translation>
<translation id="7535429826459677826">Google Chrome Dev</translation>
<translation id="7552219221109926349">Zobrazit Chrome OS v tomto jazyce</translation>
+<translation id="7589360514048265910">Tento poÄítaÄ již nebude dostávat aktualizace Google Chrome, protože systém Mac OS X 10.9 již není podporován.</translation>
<translation id="7592736734348559088">Google Chrome vaše data nemohl synchronizovat, protože vaše přihlašovací údaje nejsou aktuální.</translation>
<translation id="7626032353295482388">Vítá vás Chrome</translation>
<translation id="7747138024166251722">InstalaÄní soubor nemohl vytvoÅ™it doÄasný adresář. Zkontrolujte prosím volné místo na disku a povolení instalovat software.</translation>
diff --git a/chromium/chrome/app/resources/google_chrome_strings_da.xtb b/chromium/chrome/app/resources/google_chrome_strings_da.xtb
index 86a7b76b882..e4a47e44aa1 100644
--- a/chromium/chrome/app/resources/google_chrome_strings_da.xtb
+++ b/chromium/chrome/app/resources/google_chrome_strings_da.xtb
@@ -214,6 +214,7 @@ Gå til din e-mail på <ph name="ACCOUNT_EMAIL" /> for at få yderligere vejledn
<translation id="7494905215383356681">Chrome open source-licenser</translation>
<translation id="7535429826459677826">Udviklerversionen af Chrome</translation>
<translation id="7552219221109926349">Vis Chrome OS på dette sprog</translation>
+<translation id="7589360514048265910">Denne computer vil ikke længere modtage Google Chrome-opdateringer, da Mac OS X 10.9 ikke længere understøttes.</translation>
<translation id="7592736734348559088">Google Chrome kunne ikke synkronisere dine data, fordi loginoplysningerne til din konto er forældede.</translation>
<translation id="7626032353295482388">Velkommen til Chrome</translation>
<translation id="7747138024166251722">Installationsprogrammet kunne ikke oprette en midlertidig mappe. Tjek, om der er tilstrækkelig diskplads, og om der er tilladelse til at installere software.</translation>
diff --git a/chromium/chrome/app/resources/google_chrome_strings_de.xtb b/chromium/chrome/app/resources/google_chrome_strings_de.xtb
index f74f7187370..9348281649f 100644
--- a/chromium/chrome/app/resources/google_chrome_strings_de.xtb
+++ b/chromium/chrome/app/resources/google_chrome_strings_de.xtb
@@ -90,7 +90,7 @@ Weitere Informationen wurden per E-Mail an <ph name="ACCOUNT_EMAIL" /> gesendet.
<translation id="3360895254066713204">Chrome Helper</translation>
<translation id="3395323229510056640">Hilfe für Chrome OS aufrufen</translation>
<translation id="3396977131400919238">Während der Installation ist ein Fehler im Betriebssystem aufgetreten. Laden Sie Google Chrome erneut herunter.</translation>
-<translation id="3398288718845740432">Im Chrome-Menü ausblenden</translation>
+<translation id="3398288718845740432">Ins Chrome-Menü verschieben</translation>
<translation id="3451115285585441894">Wird zu Chrome hinzugefügt...</translation>
<translation id="345171907106878721">Mich zu Chrome hinzufügen</translation>
<translation id="3479552764303398839">Jetzt nicht</translation>
@@ -124,7 +124,7 @@ Weitere Informationen wurden per E-Mail an <ph name="ACCOUNT_EMAIL" /> gesendet.
<translation id="4561051373932531560">In Google Chrome können Sie auf eine Telefonnummer im Web klicken und diese mit Skype anrufen.</translation>
<translation id="4567424176335768812">Sie sind als <ph name="USER_EMAIL_ADDRESS" /> angemeldet. Auf allen Geräten, auf denen Sie angemeldet sind, sind nun Ihre Lesezeichen, Ihr Verlauf und andere Einstellungen verfügbar.</translation>
<translation id="4600710005438004015">Chrome konnte nicht auf die neueste Version aktualisiert werden. In Ihrer Version fehlen daher einige neue Funktionen und Sicherheitspatches.</translation>
-<translation id="4631713731678262610">Im Chrome-Menü ausblenden</translation>
+<translation id="4631713731678262610">Ins Chrome-Menü verschieben</translation>
<translation id="4633000520311261472">Um Chrome sicherer zu machen, haben wir einige Erweiterungen deaktiviert, die nicht im <ph name="IDS_EXTENSION_WEB_STORE_TITLE" /> aufgeführt sind und möglicherweise ohne Ihr Wissen hinzugefügt wurden.</translation>
<translation id="4664415150087723341">Soeben wurde ein spezielles Sicherheitsupdate für Google Chrome installiert. Führen Sie einen Neustart durch, damit es wirksam wird. Ihre Tabs werden automatisch wiederhergestellt.</translation>
<translation id="4700157086864140907">Google Chrome bietet eine intelligentere Rechtschreibprüfung, indem der Browser das, was Sie eingeben, an die Google-Server sendet. So steht Ihnen dieselbe Technologie zur Rechtschreibprüfung zur Verfügung, die bei der Google-Suche zum Einsatz kommt.</translation>
@@ -214,7 +214,7 @@ Weitere Informationen wurden per E-Mail an <ph name="ACCOUNT_EMAIL" /> gesendet.
<translation id="7494905215383356681">Open Source-Lizenzen für Chrome</translation>
<translation id="7535429826459677826">Google Chrome Dev</translation>
<translation id="7552219221109926349">Chrome OS in dieser Sprache anzeigen</translation>
-<translation id="7589360514048265910">Für diesen Computer werden keine weiteren Google Chrome-Updates mehr bereitgestellt, da Mac OS X 10.9 nicht mehr unterstützt wird.</translation>
+<translation id="7589360514048265910">Für diesen Computer wird es keine weiteren Google Chrome-Updates mehr geben, da Mac OS X 10.9 nicht mehr unterstützt wird.</translation>
<translation id="7592736734348559088">Google Chrome konnte Ihre Daten nicht synchronisieren, da die Anmeldedaten Ihres Kontos nicht mehr aktuell sind.</translation>
<translation id="7626032353295482388">Willkommen bei Chrome</translation>
<translation id="7747138024166251722">Das Installationsprogramm konnte kein temporäres Verzeichnis erstellen. Überprüfen Sie, ob freier Speicherplatz und die Rechte zum Installieren von Software vorhanden sind.</translation>
diff --git a/chromium/chrome/app/resources/google_chrome_strings_el.xtb b/chromium/chrome/app/resources/google_chrome_strings_el.xtb
index 0425511ee6e..964109a1ddc 100644
--- a/chromium/chrome/app/resources/google_chrome_strings_el.xtb
+++ b/chromium/chrome/app/resources/google_chrome_strings_el.xtb
@@ -218,6 +218,7 @@
<translation id="7494905215383356681">Άδειες Î»Î¿Î³Î¹ÏƒÎ¼Î¹ÎºÎ¿Ï Î±Î½Î¿Î¹ÎºÏ„Î¿Ï ÎºÏŽÎ´Î¹ÎºÎ± του Chrome</translation>
<translation id="7535429826459677826">Google Chrome Dev</translation>
<translation id="7552219221109926349">Îα εμφανίζεται το Chrome OS σε αυτήν τη γλώσσα</translation>
+<translation id="7589360514048265910">Αυτός ο υπολογιστής δεν θα λαμβάνει πλέον ενημεÏώσεις του Google Chrome επειδή το Mac OS X 10.9 δεν υποστηÏίζεται πλέον.</translation>
<translation id="7592736734348559088">Το Google Chrome δεν κατάφεÏε να συγχÏονίσει τα δεδομένα σας επειδή τα στοιχεία σÏνδεσης στο λογαÏιασμό σας δεν έχουν ενημεÏωθεί.</translation>
<translation id="7626032353295482388">Καλώς ήÏθατε στο Chrome</translation>
<translation id="7747138024166251722">Δεν ήταν δυνατή η δημιουÏγία ενός Ï€ÏοσωÏÎ¹Î½Î¿Ï ÎºÎ±Ï„Î±Î»ÏŒÎ³Î¿Ï… από το Ï€ÏόγÏαμμα εγκατάστασης. Ελέγξτε τον κενό χώÏο του δίσκου και το δικαίωμα εγκατάστασης του λογισμικοÏ.</translation>
diff --git a/chromium/chrome/app/resources/google_chrome_strings_es-419.xtb b/chromium/chrome/app/resources/google_chrome_strings_es-419.xtb
index d65fce750d2..6c0d9301ee1 100644
--- a/chromium/chrome/app/resources/google_chrome_strings_es-419.xtb
+++ b/chromium/chrome/app/resources/google_chrome_strings_es-419.xtb
@@ -214,6 +214,7 @@ Para obtener más instrucciones, revisa tu correo electrónico en <ph name="ACCO
<translation id="7494905215383356681">Licencias de código abierto de Chrome</translation>
<translation id="7535429826459677826">Google Chrome Dev</translation>
<translation id="7552219221109926349">Mostrar el SO Chrome en este idioma</translation>
+<translation id="7589360514048265910">Esta computadora no recibirá más actualizaciones de Google Chrome porque Mac OS X 10.9 ya no es compatible.</translation>
<translation id="7592736734348559088">Google Chrome no pudo sincronizar los datos porque los datos de acceso de la cuenta están obsoletos.</translation>
<translation id="7626032353295482388">Te damos la bienvenida a Chrome</translation>
<translation id="7747138024166251722">El instalador no pudo crear un directorio temporal. Verifique si hay espacio disponible en el disco y cuenta con permiso para instalar software.</translation>
diff --git a/chromium/chrome/app/resources/google_chrome_strings_et.xtb b/chromium/chrome/app/resources/google_chrome_strings_et.xtb
index 88d84773ad5..71b9d313e5e 100644
--- a/chromium/chrome/app/resources/google_chrome_strings_et.xtb
+++ b/chromium/chrome/app/resources/google_chrome_strings_et.xtb
@@ -218,6 +218,7 @@ Mõned funktsioonid ei pruugi saadaval olla. Määrake muu profiilikataloog või
<translation id="7494905215383356681">Chrome'i avatud lähtekoodi litsentsid</translation>
<translation id="7535429826459677826">Google Chrome Dev</translation>
<translation id="7552219221109926349">Kuva Chrome OS selles keeles</translation>
+<translation id="7589360514048265910">See arvuti ei saa enam Google Chrome'i värskendusi, kuna operatsioonisüsteemi Mac OS X 10.9 enam ei toetata.</translation>
<translation id="7592736734348559088">Google Chrome ei saanud andmeid sünkroonida, sest teie konto sisselogimisandmed on aegunud.</translation>
<translation id="7626032353295482388">Tere tulemast Chrome'i</translation>
<translation id="7747138024166251722">Installija ei suutnud luua ajutist kataloogi. Palun kontrollige vaba kettaruumi ja tarkvara installimise loa olemasolu.</translation>
diff --git a/chromium/chrome/app/resources/google_chrome_strings_fil.xtb b/chromium/chrome/app/resources/google_chrome_strings_fil.xtb
index eaf45bf533a..59c1ee9a6f1 100644
--- a/chromium/chrome/app/resources/google_chrome_strings_fil.xtb
+++ b/chromium/chrome/app/resources/google_chrome_strings_fil.xtb
@@ -222,6 +222,7 @@ Hindi magawang bawiin ng Google Chrome ang iyong mga setting.</translation>
<translation id="7494905215383356681">Mga lisensya ng open source ng Chrome</translation>
<translation id="7535429826459677826">Google Chrome Dev</translation>
<translation id="7552219221109926349">Ipakita ang Chrome OS sa wikang ito</translation>
+<translation id="7589360514048265910">Hindi na makakatanggap ng mga update sa Google Chrome ang computer na ito dahil hindi na sinusuportahan ang Mac OS X 10.9.</translation>
<translation id="7592736734348559088">Hindi mai-sync ng Google Chrome ang iyong data dahil hindi napapanahon ang mga detalye sa pag-sign in ng iyong account.</translation>
<translation id="7626032353295482388">Maligayang pagdating sa Chrome</translation>
<translation id="7747138024166251722">Hindi makalikha ng pansamantalang direktoryo ang installer. Paki-suri para sa puwang sa disk na walang laman at pahintulot upang i-install ang software.</translation>
diff --git a/chromium/chrome/app/resources/google_chrome_strings_gu.xtb b/chromium/chrome/app/resources/google_chrome_strings_gu.xtb
index df5a2bacc35..862c4a08332 100644
--- a/chromium/chrome/app/resources/google_chrome_strings_gu.xtb
+++ b/chromium/chrome/app/resources/google_chrome_strings_gu.xtb
@@ -222,6 +222,7 @@ Google Chrome તમારી સેટિંગà«àª¸àª¨à«‡ પà«àª¨àªƒàªªà«à
<translation id="7494905215383356681">Chrome ખà«àª²à«àª²àª¾ સà«àª¤à«àª°à«‹àª¤ લાઇસેંસેસ</translation>
<translation id="7535429826459677826">Google Chrome Dev</translation>
<translation id="7552219221109926349">આ ભાષામાં Chrome OS પà«àª°àª¦àª°à«àª¶àª¿àª¤ કરો</translation>
+<translation id="7589360514048265910">આ કમà«àªªà«àª¯à«àªŸàª° હવેથી Google Chrome અપડેટ મેળવી શકશે નહીં કારણ કે હવેથી Mac OS X 10.9 સમરà«àª¥àª¿àª¤ નથી.</translation>
<translation id="7592736734348559088">સાઇન ઇન વિગતો જૂની હોવાને કારણે Google Chrome તમારા ડેટાને સમનà«àªµàª¯àª¿àª¤ કરી શકà«àª¯à«àª‚ નથી.</translation>
<translation id="7626032353295482388">Chrome પર આપનà«àª‚ સà«àªµàª¾àª—ત છે</translation>
<translation id="7747138024166251722">ઇનà«àª¸à«àªŸà«‹àª²àª° અસà«àª¥àª¾àª¯à«€ ડાયરેકà«àªŸàª°à«€ બનાવી શકà«àª¯à«àª‚ નથી. કૃપા કરીને ખાલી ડિસà«àª• સà«àªªà«‡àª¸ માટે અને સૉફà«àªŸàªµà«‡àª° ઇનà«àª¸à«àªŸà«‹àª² કરવાની પરવાનગી માટે તપાસો.</translation>
diff --git a/chromium/chrome/app/resources/google_chrome_strings_hi.xtb b/chromium/chrome/app/resources/google_chrome_strings_hi.xtb
index 3128f0b509f..9a41159760f 100644
--- a/chromium/chrome/app/resources/google_chrome_strings_hi.xtb
+++ b/chromium/chrome/app/resources/google_chrome_strings_hi.xtb
@@ -216,7 +216,7 @@
<translation id="7494905215383356681">Chrome ओपन सोरà¥à¤¸ लाइसेंस</translation>
<translation id="7535429826459677826">Google Chrome डेवलपर</translation>
<translation id="7552219221109926349">Chrome OS इस भाषा में दिखाà¤à¤‚</translation>
-<translation id="7589360514048265910">इस कंपà¥à¤¯à¥‚टर पर अब Google Chrome के अपडेट नहीं मिलेंगे कà¥à¤¯à¥‹à¤‚कि अब Mac OS X 10.9 समरà¥à¤¥à¤¿à¤¤ नहीं है.</translation>
+<translation id="7589360514048265910">इस कंपà¥à¤¯à¥‚टर पर अब Google Chrome के अपडेट नहीं मिलेंगे कà¥à¤¯à¥‹à¤‚कि अब इस पर Mac OS X 10.9 की सà¥à¤µà¤¿à¤§à¤¾ नहीं है.</translation>
<translation id="7592736734348559088">Google Chrome आपका डेटा समनà¥â€à¤µà¤¯à¤¿à¤¤ नहीं कर सका कà¥â€à¤¯à¥‹à¤‚कि आपके खाते के पà¥à¤°à¤µà¥‡à¤¶ विवरण पà¥à¤°à¤¾à¤¨à¥‡ हैं.</translation>
<translation id="7626032353295482388">Chrome में आपका सà¥à¤µà¤¾à¤—त है</translation>
<translation id="7747138024166251722">इंसà¥à¤Ÿà¥‰à¤²à¤° असà¥à¤¥à¤¾à¤¯à¥€ निरà¥à¤¦à¥‡à¤¶à¤¿à¤•à¤¾ नहीं बना सकता. कृपया डिसà¥à¤• में खाली जगह और सॉफ़à¥à¤Ÿà¤µà¥‡à¤¯à¤° को इंसà¥â€à¤Ÿà¥‰à¤² करने की अनà¥à¤®à¤¤à¤¿ की जाà¤à¤š करें.</translation>
diff --git a/chromium/chrome/app/resources/google_chrome_strings_hu.xtb b/chromium/chrome/app/resources/google_chrome_strings_hu.xtb
index 86d5268ed38..a63c3410d8e 100644
--- a/chromium/chrome/app/resources/google_chrome_strings_hu.xtb
+++ b/chromium/chrome/app/resources/google_chrome_strings_hu.xtb
@@ -214,6 +214,7 @@ További utasításokat a(z) <ph name="ACCOUNT_EMAIL" /> címére küldött e-ma
<translation id="7494905215383356681">Chrome nyílt forráskódú licencek</translation>
<translation id="7535429826459677826">Google Chrome Dev</translation>
<translation id="7552219221109926349">A Chrome OS megjelenítése ezen a nyelven</translation>
+<translation id="7589360514048265910">Mivel a jelenlegi Mac OS X 10.9 rendszer támogatása megszűnik, ez a számítógép a továbbiakban nem kap Google Chrome-frissítéseket.</translation>
<translation id="7592736734348559088">A Google Chrome nem tudta szinkronizálni az adatokat, mert a fiók bejelentkezési adatai elavultak.</translation>
<translation id="7626032353295482388">A Chrome üdvözli Önt!</translation>
<translation id="7747138024166251722">A telepítőnek nem sikerült létrehoznia az ideiglenes könyvtárat. Kérjük ellenőrizze, hogy van-e elegendő hely a lemezen, és rendelkezik-e engedéllyel a szoftvertelepítésre.</translation>
diff --git a/chromium/chrome/app/resources/google_chrome_strings_iw.xtb b/chromium/chrome/app/resources/google_chrome_strings_iw.xtb
index 00161452dcb..536f15bb4db 100644
--- a/chromium/chrome/app/resources/google_chrome_strings_iw.xtb
+++ b/chromium/chrome/app/resources/google_chrome_strings_iw.xtb
@@ -214,6 +214,7 @@
<translation id="7494905215383356681">â€×¨×™×©×™×•× ×•×ª קוד פתוח של Chrome</translation>
<translation id="7535429826459677826">â€×’רסת הפיתוח של Google Chrome</translation>
<translation id="7552219221109926349">â€×”צג ×ת מערכת ההפעלה של Chrome בשפה זו</translation>
+<translation id="7589360514048265910">â€×”מחשב ×”×–×” יפסיק לקבל ×¢×“×›×•× ×™× ×©×œ Google Chrome ×›×™ כבר ×ין תמיכה בגירסה 10.9 של Mac OS X.</translation>
<translation id="7592736734348559088">â€Google Chrome ×œ× ×”×¦×œ×™×— לסנכרן ×ת ×”× ×ª×•× ×™× ×©×œ×š מפני שפרטי הכניסה של חשבונך ××™× × ×ž×¢×•×“×›× ×™×.</translation>
<translation id="7626032353295482388">â€×‘×¨×•×›×™× ×”×‘××™× ×œ-Chrome</translation>
<translation id="7747138024166251722">המתקין ×œ× ×”×¦×œ×™×— ליצור ספריה זמנית. בדוק ×ת ×”×ž×§×•× ×”×¤× ×•×™ בדיסק ו×ת ×”×ישור להתקנת תוכנה.</translation>
diff --git a/chromium/chrome/app/resources/google_chrome_strings_kn.xtb b/chromium/chrome/app/resources/google_chrome_strings_kn.xtb
index edf5670252e..121acbf555a 100644
--- a/chromium/chrome/app/resources/google_chrome_strings_kn.xtb
+++ b/chromium/chrome/app/resources/google_chrome_strings_kn.xtb
@@ -216,6 +216,7 @@
<translation id="7494905215383356681">Chrome ಮà³à²•à³à²¤ ಮೂಲ ಪರವಾನಗಿಗಳà³</translation>
<translation id="7535429826459677826">Google Chrome Dev</translation>
<translation id="7552219221109926349">Chrome OS ಈ ಭಾಷೆಯಲà³à²²à²¿ ಪà³à²°à²¦à²°à³à²¶à²¿à²¸à²¿</translation>
+<translation id="7589360514048265910">ಈ ಕಂಪà³à²¯à³‚ಟರà³â€Œ ಇನà³à²¨à³ ಮà³à²‚ದೆ Google Chrome ಅಪà³â€Œà²¡à³‡à²Ÿà³â€Œà²—ಳನà³à²¨à³ ಸà³à²µà³€à²•à²°à²¿à²¸à³à²µà³à²¦à²¿à²²à³à²². à²à²•à³†à²‚ದರೆ ಅದರ Mac OS X 10.9 ಇನà³à²¨à³ ಮà³à²‚ದೆ ಬೆಂಬಲಿಸà³à²µà³à²¦à²¿à²²à³à²².</translation>
<translation id="7592736734348559088">ನಿಮà³à²® ಖಾತೆಯ ಸೈನೠಇನೠವಿವರಗಳೠತೀರಾ ಹಳತಾಗಿರà³à²µ ಕಾರಣ ನಿಮà³à²® ಡೇಟಾವನà³à²¨à³ ಸಿಂಕೠಮಾಡಲೠGoogle Chrome ಗೆ ಸಾಧà³à²¯à²µà²¾à²—ಲಿಲà³à²².</translation>
<translation id="7626032353295482388">Chrome ಗೆ ಸà³à²µà²¾à²—ತ</translation>
<translation id="7747138024166251722">ಸà³à²¥à²¾à²ªà²•à²•à³à²•à³† ತಾತà³à²•à²¾à²²à²¿à²• ಡೈರೆಕà³à²Ÿà²°à²¿à²¯à²¨à³à²¨à³ ರಚಿಸಲಾಗಲಿಲà³à²². ಸಾಫà³à²Ÿà³à²µà³‡à²°à³ ಸà³à²¥à²¾à²ªà²¨à³† ಮಾಡಲೠಮà³à²•à³à²¤ ಡಿಸà³à²•à³ ಜಾಗ ಮತà³à²¤à³ ಅನà³à²®à²¤à²¿à²—ಾಗಿ ದಯವಿಟà³à²Ÿà³ ಪರಿಶೀಲಿಸಿ.</translation>
diff --git a/chromium/chrome/app/resources/google_chrome_strings_ko.xtb b/chromium/chrome/app/resources/google_chrome_strings_ko.xtb
index 0ed0860655d..2a37d1b6d8e 100644
--- a/chromium/chrome/app/resources/google_chrome_strings_ko.xtb
+++ b/chromium/chrome/app/resources/google_chrome_strings_ko.xtb
@@ -222,6 +222,7 @@ Chromeì—ì„œ ì„¤ì •ì„ ë³µêµ¬í•  수 없습니다.</translation>
<translation id="7494905215383356681">Chrome 오픈소스 ë¼ì´ì„ ìŠ¤</translation>
<translation id="7535429826459677826">Chrome 개발ìž</translation>
<translation id="7552219221109926349">ì´ ì–¸ì–´ë¡œ Chrome OS 표시</translation>
+<translation id="7589360514048265910">Mac OS X 10.9ê°€ ë” ì´ìƒ 지ì›ë˜ì§€ 않으므로 ì´ ì»´í“¨í„°ì—ì„œ Chrome ì—…ë°ì´íŠ¸ë¥¼ ë°›ì„ ìˆ˜ 없게 ë©ë‹ˆë‹¤.</translation>
<translation id="7592736734348559088">ê³„ì •ì˜ ë¡œê·¸ì¸ ì„¸ë¶€ì •ë³´ê°€ 오래ë˜ì–´ Chromeì—ì„œ ë°ì´í„°ë¥¼ ë™ê¸°í™”하지 못했습니다.</translation>
<translation id="7626032353295482388">Chromeì— ì˜¤ì‹  ê²ƒì„ í™˜ì˜í•©ë‹ˆë‹¤.</translation>
<translation id="7747138024166251722">설치 í”„ë¡œê·¸ëž¨ì´ ìž„ì‹œ 디렉토리를 만들지 못했습니다. ë””ìŠ¤í¬ ê³µê°„ ë° ì„¤ì¹˜ ê¶Œí•œì„ í™•ì¸í•´ 보세요.</translation>
diff --git a/chromium/chrome/app/resources/google_chrome_strings_lt.xtb b/chromium/chrome/app/resources/google_chrome_strings_lt.xtb
index 197302d11f5..f471df95d7f 100644
--- a/chromium/chrome/app/resources/google_chrome_strings_lt.xtb
+++ b/chromium/chrome/app/resources/google_chrome_strings_lt.xtb
@@ -223,6 +223,7 @@ Kai kurios funkcijos gali būti nepasiekiamos. Nurodykite kitą profilio katalog
<translation id="7494905215383356681">„Chrome“ atvirojo šaltinio licencijos</translation>
<translation id="7535429826459677826">Google Chrome Dev</translation>
<translation id="7552219221109926349">Pateikti „Chrome“ OS šia kalba</translation>
+<translation id="7589360514048265910">Šiame kompiuteryje nebebus gaunami „Google Chrome“ naujiniai, nes 10.9 versijos „Mac OS X“ nebepalaikoma.</translation>
<translation id="7592736734348559088">„Google Chrome“ negali sinchronizuoti duomenų, nes paskyros išsami prisijungimo informacija yra pasenusi.</translation>
<translation id="7626032353295482388">Sveiki, tai „Chrome“</translation>
<translation id="7747138024166251722">Diegimo programai nepavyko sukurti laikino katalogo. Patikrinkite, ar yra laisvos vietos diske ir, ar leidžiama įdiegti programinę įrangą.</translation>
diff --git a/chromium/chrome/app/resources/google_chrome_strings_lv.xtb b/chromium/chrome/app/resources/google_chrome_strings_lv.xtb
index facf4a8046e..810772b641b 100644
--- a/chromium/chrome/app/resources/google_chrome_strings_lv.xtb
+++ b/chromium/chrome/app/resources/google_chrome_strings_lv.xtb
@@ -218,6 +218,7 @@ Dažas funkcijas var nebÅ«t pieejamas. NorÄdiet citu profila direktoriju vai li
<translation id="7494905215383356681">Chrome atklÄtÄ pirmkoda licences</translation>
<translation id="7535429826459677826">Google Chrome Dev</translation>
<translation id="7552219221109926349">RÄdÄ«t Chrome OS Å¡ajÄ valodÄ</translation>
+<translation id="7589360514048265910">Å ajÄ datorÄ vairs netiks saņemti Google Chrome atjauninÄjumi, jo operÄ“tÄjsistÄ“ma Mac OS X 10.9 vairs netiek atbalstÄ«ta.</translation>
<translation id="7592736734348559088">Google Chrome nevarÄ“ja sinhronizÄ“t jÅ«su datus, jo jÅ«su konta pierakstÄ«Å¡anÄs informÄcija ir novecojusi.</translation>
<translation id="7626032353295482388">Laipni lÅ«dzam pÄrlÅ«kÄ Chrome</translation>
<translation id="7747138024166251722">InstalÄ“tÄjam neizdevÄs izveidot pagaidu katalogu. LÅ«dzu, pÄrbaudiet, vai diskÄ pietiek vietas un vai ir atļauja instalÄ“t programmatÅ«ru.</translation>
diff --git a/chromium/chrome/app/resources/google_chrome_strings_ml.xtb b/chromium/chrome/app/resources/google_chrome_strings_ml.xtb
index 17702a1e7e3..3a5396ccf9b 100644
--- a/chromium/chrome/app/resources/google_chrome_strings_ml.xtb
+++ b/chromium/chrome/app/resources/google_chrome_strings_ml.xtb
@@ -222,6 +222,7 @@
<translation id="7494905215383356681">Chrome à´“à´ªàµà´ªàµº സോഴàµâ€Œà´¸àµ ലൈസൻസàµà´•àµ¾</translation>
<translation id="7535429826459677826">Google Chrome Dev</translation>
<translation id="7552219221109926349">à´ˆ ഭാഷയിലàµâ€â€Œ Chrome OS à´ªàµà´°à´¦à´°àµâ€â€Œà´¶à´¿à´ªàµà´ªà´¿à´•àµà´•àµà´•</translation>
+<translation id="7589360514048265910">Mac OS X 10.9 ഇനി പിനàµà´¤àµà´£à´¯àµâ€Œà´•àµà´•à´¾à´¤àµà´¤à´¤à´¿à´¨à´¾àµ½ à´ˆ à´•à´®àµà´ªàµà´¯àµ‚à´Ÿàµà´Ÿà´±à´¿à´¨àµ ഇനി Google Chrome à´…à´ªàµâ€Œà´¡àµ‡à´±àµà´±àµà´•àµ¾ à´¸àµà´µàµ€à´•à´°à´¿à´•àµà´•à´¾à´¨à´¾à´µà´¿à´²àµà´².</translation>
<translation id="7592736734348559088">നിങàµà´™à´³àµà´Ÿàµ† à´…à´•àµà´•àµ—à´£àµà´Ÿà´¿à´¨àµà´±àµ† സൈൻ ഇൻ വിശദാംശങàµà´™àµ¾ കാലഹരണപàµà´ªàµ†à´Ÿàµà´Ÿà´¤à´¿à´¨à´¾àµ½ Google Chrome-നൠനിങàµà´™à´³àµà´Ÿàµ† ഡാറàµà´± സമനàµà´µà´¯à´¿à´ªàµà´ªà´¿à´•àµà´•à´¾à´¨à´¾à´¯à´¿à´²àµà´².</translation>
<translation id="7626032353295482388">Chrome-ലേകàµà´•àµ à´¸àµà´µà´¾à´—തം</translation>
<translation id="7747138024166251722">ഇനàµâ€à´¸àµà´±àµà´±à´¾à´³à´±à´¿à´¨àµ ഒരൠതാലàµâ€à´•àµà´•à´¾à´²à´¿à´• ഡയറകàµâ€Œà´Ÿà´±à´¿ സൃഷàµâ€Œà´Ÿà´¿à´•àµà´•à´¾à´¨àµâ€ à´•à´´à´¿à´žàµà´žà´¿à´²àµà´². സോഫàµà´±àµà´±àµâ€Œà´µàµ†à´¯à´°àµâ€ ഇനàµâ€à´¸àµà´±àµà´±à´¾à´³àµâ€ ചെയàµà´¯àµà´¨àµà´¨à´¤à´¿à´¨à´¾à´¯à´¿ à´¸àµà´µà´¤à´¨àµà´¤àµà´°à´®à´¾à´¯ à´¡à´¿à´¸àµà´•àµ à´¸àµà´¥à´²à´µàµà´‚ à´…à´¨àµà´®à´¤à´¿à´¯àµà´‚ പരിശോധികàµà´•àµà´•.</translation>
diff --git a/chromium/chrome/app/resources/google_chrome_strings_mr.xtb b/chromium/chrome/app/resources/google_chrome_strings_mr.xtb
index 27d512ad36b..2a7f8c6f2de 100644
--- a/chromium/chrome/app/resources/google_chrome_strings_mr.xtb
+++ b/chromium/chrome/app/resources/google_chrome_strings_mr.xtb
@@ -219,6 +219,7 @@ Google Chrome आपली सेटिंगà¥à¤œ पà¥à¤°à¥à¤¨à¤ªà¥à¤°à¤¾à
<translation id="7494905215383356681">Chrome खà¥à¤²à¤¾ सà¥à¤¤à¥à¤°à¥‹à¤¤ परवाने</translation>
<translation id="7535429826459677826">Google Chrome विकासक</translation>
<translation id="7552219221109926349">Chrome OS या भाषेत पà¥à¤°à¤¦à¤°à¥à¤¶à¤¿â€à¤¤ करा</translation>
+<translation id="7589360514048265910">यापà¥à¤¢à¥‡ Mac OS X 10.9 ला सपोरà¥à¤Ÿ नसलà¥à¤¯à¤¾à¤®à¥à¤³à¥‡, या कॉंपà¥à¤¯à¥à¤Ÿà¤°à¤²à¤¾ इथून पà¥à¤¢à¥‡ Google Chrome चे अपडेट मिळणार नाहीत.</translation>
<translation id="7592736734348559088">आपले खाते साइन इन तपशील कालबाहà¥à¤¯ à¤à¤¾à¤²à¥à¤¯à¤¾à¤®à¥à¤³à¥‡ Google Chrome आपला डेटा संकालित करू शकले नाही.</translation>
<translation id="7626032353295482388">Chrome मधà¥à¤¯à¥‡ सà¥à¤µà¤¾à¤—त आहे</translation>
<translation id="7747138024166251722">इनà¥à¤¸à¥à¤Ÿà¥‰à¤²à¤° तातà¥à¤ªà¥à¤°à¤¤à¥€ निरà¥à¤¦à¥‡à¤¶à¤¿à¤•à¤¾ तयार करू शकत नाही. कृपया सॉफà¥à¤Ÿà¤µà¥‡à¤…र सà¥à¤¥à¤¾à¤ªà¤¨ करणà¥à¤¯à¤¾à¤¸à¤¾à¤ à¥€ रिकà¥à¤¤ डिसà¥à¤• सà¥à¤¥à¤¾à¤¨ आणि परवानगी करिता पहा.</translation>
diff --git a/chromium/chrome/app/resources/google_chrome_strings_nl.xtb b/chromium/chrome/app/resources/google_chrome_strings_nl.xtb
index 49125c9c537..4031930c262 100644
--- a/chromium/chrome/app/resources/google_chrome_strings_nl.xtb
+++ b/chromium/chrome/app/resources/google_chrome_strings_nl.xtb
@@ -220,6 +220,7 @@ Sommige functies zijn wellicht niet beschikbaar. Geef een andere profieldirector
<translation id="7494905215383356681">Open-sourcelicenties van Chrome</translation>
<translation id="7535429826459677826">Google Chrome Dev</translation>
<translation id="7552219221109926349">Chrome OS weergeven in deze taal</translation>
+<translation id="7589360514048265910">Deze computer ontvangt geen Google Chrome-updates meer omdat Mac OS X 10.9 niet meer wordt ondersteund.</translation>
<translation id="7592736734348559088">Google Chrome kan je gegevens niet synchroniseren omdat de inloggegevens voor je account zijn verouderd.</translation>
<translation id="7626032353295482388">Welkom bij Chrome</translation>
<translation id="7747138024166251722">Het installatieprogramma kan geen tijdelijke directory maken. Controleer of je nog schijfruimte hebt en of je toestemming hebt om software te installeren.</translation>
diff --git a/chromium/chrome/app/resources/google_chrome_strings_no.xtb b/chromium/chrome/app/resources/google_chrome_strings_no.xtb
index 4baae72b772..a798ed6a584 100644
--- a/chromium/chrome/app/resources/google_chrome_strings_no.xtb
+++ b/chromium/chrome/app/resources/google_chrome_strings_no.xtb
@@ -58,6 +58,7 @@ Hvis du logger deg på allikevel, blir Chrome-informasjon som bokmerker, loggen
<translation id="2429317896000329049">Google Chrome kunne ikke synkronisere dataene dine fordi synkronisering ikke er tilgjengelig for domenet ditt.</translation>
<translation id="2446511512801740068">Chrome er utdatert fordi den ikke har vært startet på nytt på en stund. En oppdatering er tilgjengelig og tas i bruk når du starter Chrome på nytt.</translation>
<translation id="2485422356828889247">Avinstaller</translation>
+<translation id="2534507159460261402">Google Pay (kopiert til Chrome)</translation>
<translation id="2580411288591421699">Google Chrome-versjonen du prøver å installere, kjører allerede. Lukk Google Chrome og forsøk å installere på nytt.</translation>
<translation id="2586406160782125153">Dette sletter nettlesingsdataene dine fra denne enheten. For å hente dataene igjen senere må du logge på Chrome som <ph name="USER_EMAIL" />.</translation>
<translation id="2588322182880276190">Chrome-logo</translation>
@@ -213,6 +214,7 @@ Vi har sendt deg (<ph name="ACCOUNT_EMAIL" />) en e-post med nærmere instruksjo
<translation id="7494905215383356681">Ã…pen kildekode-lisenser for Chrome</translation>
<translation id="7535429826459677826">Google Chrome Dev</translation>
<translation id="7552219221109926349">Vis Chrome OS på dette språket</translation>
+<translation id="7589360514048265910">Denne datamaskinen kommer ikke til å motta oppdateringer av Google Chrome lenger fordi Mac OS X 10.9 ikke støttes lenger.</translation>
<translation id="7592736734348559088">Google Chrome kunne ikke synkronisere dataene dine. Dette skyldes at påloggingsopplysningene for kontoen din er foreldede.</translation>
<translation id="7626032353295482388">Velkommen til Chrome</translation>
<translation id="7747138024166251722">Installasjonsprogrammet kunne ikke opprette en midlertidig katalog. Kontroller at du har nok ledig diskplass og tillatelse til å installere programvare.</translation>
diff --git a/chromium/chrome/app/resources/google_chrome_strings_ro.xtb b/chromium/chrome/app/resources/google_chrome_strings_ro.xtb
index 1e3578fb13c..e191492db94 100644
--- a/chromium/chrome/app/resources/google_chrome_strings_ro.xtb
+++ b/chromium/chrome/app/resources/google_chrome_strings_ro.xtb
@@ -214,6 +214,7 @@ Verifică e-mailul la <ph name="ACCOUNT_EMAIL" /> pentru instrucțiuni supliment
<translation id="7494905215383356681">Licențe open source pentru Chrome</translation>
<translation id="7535429826459677826">Google Chrome Dev</translation>
<translation id="7552219221109926349">Afișează sistemul de operare Chrome în această limbă</translation>
+<translation id="7589360514048265910">Acest computer nu va mai primi actualizări pentru Google Chrome, deoarece Mac OS X 10.9 nu mai este acceptat.</translation>
<translation id="7592736734348559088">Google Chrome nu a putut sincroniza datele, deoarece detaliile de conectare pentru contul dvs. nu sunt actualizate.</translation>
<translation id="7626032353295482388">Bun venit la Chrome</translation>
<translation id="7747138024166251722">Programul de instalare nu a putut crea un director temporar. Verifică dacă există suficient spațiu liber și dacă ai drepturile necesare pentru a instala software-ul.</translation>
diff --git a/chromium/chrome/app/resources/google_chrome_strings_ru.xtb b/chromium/chrome/app/resources/google_chrome_strings_ru.xtb
index 67cb9ab7629..01b768563f8 100644
--- a/chromium/chrome/app/resources/google_chrome_strings_ru.xtb
+++ b/chromium/chrome/app/resources/google_chrome_strings_ru.xtb
@@ -214,6 +214,7 @@
<translation id="7494905215383356681">Лицензии Chrome на ПО Ñ Ð¾Ñ‚ÐºÑ€Ñ‹Ñ‚Ñ‹Ð¼ иÑходным кодом</translation>
<translation id="7535429826459677826">Google Chrome Ð´Ð»Ñ Ñ€Ð°Ð·Ñ€Ð°Ð±Ð¾Ñ‚Ñ‡Ð¸ÐºÐ¾Ð²</translation>
<translation id="7552219221109926349">Отображать Chrome OS на Ñтом Ñзыке</translation>
+<translation id="7589360514048265910">Google Chrome больше не будет обновлÑÑ‚ÑŒÑÑ Ð½Ð° Ñтом компьютере, так как поддержка Mac OS X 10.9 прекращена.</translation>
<translation id="7592736734348559088">Google Chrome не удалоÑÑŒ Ñинхронизировать данные, поÑкольку ваши учетные данные уÑтарели.</translation>
<translation id="7626032353295482388">Добро пожаловать в Chrome!</translation>
<translation id="7747138024166251722">Программе уÑтановки не удалоÑÑŒ Ñоздать временный каталог. Возможно, у Ð²Ð°Ñ Ð½ÐµÑ‚ прав на уÑтановку приложений или недоÑтаточно меÑта на диÑке.</translation>
diff --git a/chromium/chrome/app/resources/google_chrome_strings_sl.xtb b/chromium/chrome/app/resources/google_chrome_strings_sl.xtb
index 67c47560d77..c813e91e4c6 100644
--- a/chromium/chrome/app/resources/google_chrome_strings_sl.xtb
+++ b/chromium/chrome/app/resources/google_chrome_strings_sl.xtb
@@ -222,6 +222,7 @@ Google Chrome ne more obnoviti vaših nastavitev.</translation>
<translation id="7494905215383356681">Odprtokodne licence za Chrome</translation>
<translation id="7535429826459677826">Google Chrome Dev</translation>
<translation id="7552219221109926349">Prikaži OS Chrome v tem jeziku</translation>
+<translation id="7589360514048265910">Ta raÄunalnik ne bo veÄ prejemal posodobitev za Google Chrome, ker sistem Mac OS X 10.9 ni veÄ podprt.</translation>
<translation id="7592736734348559088">Google Chrome ni mogel sinhronizirati podatkov, ker so podatki za prijavo v raÄun zastareli.</translation>
<translation id="7626032353295482388">Dobrodošli v brskalniku Chrome</translation>
<translation id="7747138024166251722">Namestitvenemu programu ni uspelo ustvariti zaÄasnega imenika. Preverite, ali je na disku dovolj prostora in ali imate dovoljenje za namestitev programske opreme.</translation>
diff --git a/chromium/chrome/app/resources/google_chrome_strings_sr.xtb b/chromium/chrome/app/resources/google_chrome_strings_sr.xtb
index a5450286fa2..31b8aa1be54 100644
--- a/chromium/chrome/app/resources/google_chrome_strings_sr.xtb
+++ b/chromium/chrome/app/resources/google_chrome_strings_sr.xtb
@@ -222,6 +222,7 @@ Google Chrome не може да врати подешавања.</translation>
<translation id="7494905215383356681">Лиценце отвореног кода за Chrome</translation>
<translation id="7535429826459677826">ПрограмерÑка верзија Google Chrome-а</translation>
<translation id="7552219221109926349">Приказуј Chrome ОС на овом језику</translation>
+<translation id="7589360514048265910">Овај рачунар више неће добијати ажурирања за Google Chrome зато што Mac OS X 10.9 више није подржан.</translation>
<translation id="7592736734348559088">Google Chrome не може да Ñинхронизује податке зато што Ñу подаци за пријављивање на налог заÑтарели.</translation>
<translation id="7626032353295482388">Добро дошли у Chrome</translation>
<translation id="7747138024166251722">Програм за инÑталацију није могао да направи привремени директоријум. Проверите да ли имате Ñлободног проÑтора на диÑку, као и дозволу да инÑталирате Ñофтвер.</translation>
diff --git a/chromium/chrome/app/resources/google_chrome_strings_sv.xtb b/chromium/chrome/app/resources/google_chrome_strings_sv.xtb
index 231f38e3164..11d3ec3c162 100644
--- a/chromium/chrome/app/resources/google_chrome_strings_sv.xtb
+++ b/chromium/chrome/app/resources/google_chrome_strings_sv.xtb
@@ -222,6 +222,7 @@ Google Chrome kan inte återställa dina inställningar.</translation>
<translation id="7494905215383356681">Licenser för öppen källkod för Chrome</translation>
<translation id="7535429826459677826">Google Chrome Dev</translation>
<translation id="7552219221109926349">Visa Chrome OS på det här språket.</translation>
+<translation id="7589360514048265910">Den här datorn får inte längre uppdateringar för Google Chrome eftersom Mac OS X 10.9 inte längre stöds.</translation>
<translation id="7592736734348559088">Google Chrome kunde inte synkronisera data eftersom inloggningsuppgifterna för kontot är inaktuella.</translation>
<translation id="7626032353295482388">Välkommen till Chrome</translation>
<translation id="7747138024166251722">Det gick inte att skapa en tillfällig katalog för installationsfilen. Kontrollera diskutrymmet och att du har behörighet att installera program.</translation>
diff --git a/chromium/chrome/app/resources/google_chrome_strings_te.xtb b/chromium/chrome/app/resources/google_chrome_strings_te.xtb
index f95a1bf9d14..a855e25e94e 100644
--- a/chromium/chrome/app/resources/google_chrome_strings_te.xtb
+++ b/chromium/chrome/app/resources/google_chrome_strings_te.xtb
@@ -214,6 +214,7 @@
<translation id="7494905215383356681">Chrome ఓపెనౠసోరà±à°¸à± లైసెనà±à°¸à±â€Œà°²à±</translation>
<translation id="7535429826459677826">Google Chrome డెవలపరà±</translation>
<translation id="7552219221109926349">Chrome OSనౠఈ భాషలో à°ªà±à°°à°¦à°°à±à°¶à°¿à°‚à°šà±</translation>
+<translation id="7589360514048265910">Mac OS X 10.9కౠమదà±à°¦à°¤à± లేనందà±à°¨ à°ˆ à°•à°‚à°ªà±à°¯à±‚టరౠఇకపై Google Chrome à°…à°ªà±â€Œà°¡à±‡à°Ÿà±â€Œà°²à°¨à± à°¸à±à°µà±€à°•à°°à°¿à°‚à°šà°¦à±.</translation>
<translation id="7592736734348559088">మీ ఖాతా సైనà±-ఇనౠవివరాల à°—à°¡à±à°µà± à°®à±à°—ిసినందà±à°¨ Google Chrome మీ డేటానౠసమకాలీకరించలేకపోయింది.</translation>
<translation id="7626032353295482388">Chromeà°•à± à°¸à±à°µà°¾à°—తం</translation>
<translation id="7747138024166251722">ఇనà±â€Œà°¸à±à°Ÿà°¾à°²à°°à± à°’à°• తాతà±à°•à°¾à°²à°¿à°• డైరకà±à°Ÿà°°à±€à°¨à°¿ సృషà±à°Ÿà°¿à°‚చలేకపోయింది. సాఫà±à°Ÿà±â€Œà°µà±‡à°°à±â€Œà°¨à± ఇనà±â€Œà°¸à±à°Ÿà°¾à°²à± చేయడానికి దయచేసి ఖాళీ à°¡à°¿à°¸à±à°•à± à°¸à±à°¥à°²à°‚, à°…à°¨à±à°®à°¤à°¿à°¨à°¿ తనిఖీ చెయà±à°¯à°‚à°¡à°¿.</translation>
diff --git a/chromium/chrome/app/resources/google_chrome_strings_th.xtb b/chromium/chrome/app/resources/google_chrome_strings_th.xtb
index 7c1b0f5907e..29a0b94afdb 100644
--- a/chromium/chrome/app/resources/google_chrome_strings_th.xtb
+++ b/chromium/chrome/app/resources/google_chrome_strings_th.xtb
@@ -215,6 +215,7 @@
<translation id="7494905215383356681">ใบอนุà¸à¸²à¸•à¹‚อเพนซอร์สของ Chrome</translation>
<translation id="7535429826459677826">Google Chrome Dev</translation>
<translation id="7552219221109926349">à¹à¸ªà¸”ง Chrome OS ในภาษานี้</translation>
+<translation id="7589360514048265910">คอมพิวเตอร์เครื่องนี้จะไม่ได้รับà¸à¸²à¸£à¸­à¸±à¸›à¹€à¸”ตจาภGoogle Chrome อีภเนื่องจาà¸à¸£à¸°à¸šà¸šà¹„ม่รองรับ Mac OS X 10.9 à¹à¸¥à¹‰à¸§</translation>
<translation id="7592736734348559088">Google Chrome ไม่สามารถซิงค์ข้อมูลของคุณเนื่องจาà¸à¸£à¸²à¸¢à¸¥à¸°à¹€à¸­à¸µà¸¢à¸”à¸à¸²à¸£à¸¥à¸‡à¸Šà¸·à¹ˆà¸­à¹€à¸‚้าใช้บัà¸à¸Šà¸µà¸‚องคุณล้าสมัย</translation>
<translation id="7626032353295482388">ยินดีต้อนรับสู่ Chrome</translation>
<translation id="7747138024166251722">โปรà¹à¸à¸£à¸¡à¸•à¸´à¸”ตั้งสร้างไดเรà¸à¸—อรีชั่วคราวไม่ได้ โปรดตรวจสอบพื้นที่ดิสà¸à¹Œà¸§à¹ˆà¸²à¸‡à¹à¸¥à¸°à¸à¸²à¸£à¸­à¸™à¸¸à¸à¸²à¸•à¹ƒà¸«à¹‰à¸•à¸´à¸”ตั้งซอฟต์à¹à¸§à¸£à¹Œ</translation>
diff --git a/chromium/chrome/app/resources/google_chrome_strings_tr.xtb b/chromium/chrome/app/resources/google_chrome_strings_tr.xtb
index bace0d90343..fa1470b6d57 100644
--- a/chromium/chrome/app/resources/google_chrome_strings_tr.xtb
+++ b/chromium/chrome/app/resources/google_chrome_strings_tr.xtb
@@ -217,6 +217,7 @@ Bazı özellikler kullanılamayabilir. Lütfen farklı bir profil dizini belirti
<translation id="7494905215383356681">Chrome açık kaynak lisansları</translation>
<translation id="7535429826459677826">Google Chrome Dev</translation>
<translation id="7552219221109926349">Chrome OS'yi bu dilde görüntüle</translation>
+<translation id="7589360514048265910">Mac OS X 10.9 artık desteklenmediğinden, bu bilgisayar artık Google Chrome güncellemelerini almayacak.</translation>
<translation id="7592736734348559088">Hesap oturum açma ayrıntılarınız güncel olmadığından Google Chrome, verilerinizi senkronize edemedi.</translation>
<translation id="7626032353295482388">Chrome'a HoÅŸ Geldiniz</translation>
<translation id="7747138024166251722">Yükleyici geçici bir dizin oluşturamadı. Lütfen, kullanılabilir disk alanını ve yazılım yükleme iznini kontrol edin.</translation>
diff --git a/chromium/chrome/app/resources/google_chrome_strings_vi.xtb b/chromium/chrome/app/resources/google_chrome_strings_vi.xtb
index 3652831d7a7..c1f33df2b71 100644
--- a/chromium/chrome/app/resources/google_chrome_strings_vi.xtb
+++ b/chromium/chrome/app/resources/google_chrome_strings_vi.xtb
@@ -219,7 +219,7 @@ Một số tính năng có thể không khả dụng. Vui lòng chỉ định th
<translation id="7494905215383356681">Giấy phép nguồn mở Chrome</translation>
<translation id="7535429826459677826">Google Chrome Dev</translation>
<translation id="7552219221109926349">Hiển thị Chrome OS bằng ngôn ngữ này</translation>
-<translation id="7589360514048265910">Máy tính này sẽ không còn nhận được bản cập nhật của Google Chrome do hệ thống Mac OS X 10.9 không được hỗ trợ nữa.</translation>
+<translation id="7589360514048265910">Máy tính này sẽ không còn nhận được bản cập nhật của Google Chrome do hệ Ä‘iá»u hành Mac OS X 10.9 không được há»— trợ nữa.</translation>
<translation id="7592736734348559088">Google Chrome không thể đồng bộ hóa dữ liệu của bạn vì chi tiết đăng nhập tài khoản của bạn đã cũ.</translation>
<translation id="7626032353295482388">Chào mừng bạn đến với Chrome</translation>
<translation id="7747138024166251722">Trình cài đặt không thể tạo thÆ° mục tạm thá»i. Vui lòng kiểm tra dung lượng ổ Ä‘Ä©a còn trống và quyá»n cài đặt phần má»m.</translation>
diff --git a/chromium/chrome/app/resources/google_chrome_strings_zh-TW.xtb b/chromium/chrome/app/resources/google_chrome_strings_zh-TW.xtb
index df449831efb..ff90d86412f 100644
--- a/chromium/chrome/app/resources/google_chrome_strings_zh-TW.xtb
+++ b/chromium/chrome/app/resources/google_chrome_strings_zh-TW.xtb
@@ -216,6 +216,7 @@ Google Chrome 無法復原你的設定。</translation>
<translation id="7494905215383356681">Chrome 開放原始碼授權</translation>
<translation id="7535429826459677826">Google Chrome 開發人員版</translation>
<translation id="7552219221109926349">å°‡ Chrome 作業系統的介é¢æ–‡å­—設為這種語言</translation>
+<translation id="7589360514048265910">我們已ä¸æ”¯æ´ Mac OS X 10.9,因此這部電腦ä¸æœƒå†æ”¶åˆ° Google Chrome 更新。</translation>
<translation id="7592736734348559088">你的帳戶登入詳細資料尚未更新,因此 Google Chrome 無法åŒæ­¥è™•ç†ä½ çš„資料。</translation>
<translation id="7626032353295482388">歡迎使用 Chrome</translation>
<translation id="7747138024166251722">安è£ç¨‹å¼ç„¡æ³•å»ºç«‹æš«æ™‚目錄,請檢查å¯ç”¨ç£ç¢Ÿç©ºé–“與權é™ï¼Œä»¥é †åˆ©å®‰è£è»Ÿé«”。</translation>
diff --git a/chromium/chrome/browser/BUILD.gn b/chromium/chrome/browser/BUILD.gn
index 472d5ea3468..c61e8b60b4c 100644
--- a/chromium/chrome/browser/BUILD.gn
+++ b/chromium/chrome/browser/BUILD.gn
@@ -4521,6 +4521,13 @@ grit("resources") {
"//chrome/browser/resources/md_downloads:build",
"//chrome/browser/resources/md_history:build",
]
+ if (is_chromeos) {
+ deps += [
+ "//chrome/browser/resources/chromeos/bluetooth_pairing_dialog:build",
+ "//chrome/browser/resources/chromeos/internet_config_dialog:build",
+ "//chrome/browser/resources/chromeos/internet_detail_dialog:build",
+ ]
+ }
}
if (safe_browsing_mode > 0) {
diff --git a/chromium/chrome/browser/browser_resources.grd b/chromium/chrome/browser/browser_resources.grd
index 6297d9c291b..c25812b62a3 100644
--- a/chromium/chrome/browser/browser_resources.grd
+++ b/chromium/chrome/browser/browser_resources.grd
@@ -447,8 +447,16 @@
<include name="IDR_CRYPTOTOKEN_MANIFEST" file="resources\cryptotoken\manifest.json" type="BINDATA" />
<include name="IDR_GAIA_AUTH_MANIFEST" file="resources\gaia_auth\manifest.json" type="BINDATA" />
<if expr="chromeos">
- <include name="IDR_BLUETOOTH_PAIRING_DIALOG_HTML" file="resources\chromeos\bluetooth_pairing_dialog.html" flattenhtml="true" allowexternalscript="true" type="chrome_html" />
- <include name="IDR_BLUETOOTH_PAIRING_DIALOG_JS" file="resources\chromeos\bluetooth_pairing_dialog.js" type="chrome_html" />
+ <if expr="optimize_webui">
+ <then>
+ <include name="IDR_BLUETOOTH_PAIRING_DIALOG_VULCANIZED_HTML" file="${root_gen_dir}\chrome\browser\resources\chromeos\bluetooth_pairing_dialog\vulcanized.html" use_base_dir="false" flattenhtml="true" allowexternalscript="true" type="BINDATA" compress="gzip" />
+ <include name="IDR_BLUETOOTH_PAIRING_DIALOG_CRISPER_JS" file="${root_gen_dir}\chrome\browser\resources\chromeos\bluetooth_pairing_dialog\crisper.js" use_base_dir="false" flattenhtml="true" type="BINDATA" compress="gzip" />
+ </then>
+ <else>
+ <include name="IDR_BLUETOOTH_PAIRING_DIALOG_HTML" file="resources\chromeos\bluetooth_pairing_dialog\bluetooth_pairing_dialog.html" flattenhtml="true" allowexternalscript="true" type="chrome_html" />
+ <include name="IDR_BLUETOOTH_PAIRING_DIALOG_JS" file="resources\chromeos\bluetooth_pairing_dialog\bluetooth_pairing_dialog.js" type="chrome_html" />
+ </else>
+ </if>
<include name="IDR_CROSH_BUILTIN_MANIFEST" file="resources\chromeos\crosh_builtin\manifest.json" type="BINDATA" />
<include name="IDR_CRYPTOHOME_HTML" file="resources\chromeos\cryptohome.html" flattenhtml="true" type="BINDATA" />
<include name="IDR_CRYPTOHOME_JS" file="resources\chromeos\cryptohome.js" type="BINDATA" />
@@ -468,10 +476,20 @@
<include name="IDR_ECHO_MANIFEST" file="resources\chromeos\echo\manifest.json" type="BINDATA" />
<include name="IDR_MERGE_SESSION_LOAD_HTML" file="resources\chromeos\merge_session_load.html" flattenhtml="true" type="BINDATA" />
<include name="IDR_OS_CREDITS_HTML" file="resources\chromeos\about_os_credits.html" flattenhtml="true" type="BINDATA" />
- <include name="IDR_INTERNET_CONFIG_DIALOG_HTML" file="resources\chromeos\internet_config_dialog.html" flattenhtml="true" allowexternalscript="true" type="chrome_html" />
- <include name="IDR_INTERNET_CONFIG_DIALOG_JS" file="resources\chromeos\internet_config_dialog.js" type="chrome_html" />
- <include name="IDR_INTERNET_DETAIL_DIALOG_HTML" file="resources\chromeos\internet_detail_dialog.html" flattenhtml="true" allowexternalscript="true" type="chrome_html" />
- <include name="IDR_INTERNET_DETAIL_DIALOG_JS" file="resources\chromeos\internet_detail_dialog.js" type="chrome_html" />
+ <if expr="optimize_webui">
+ <then>
+ <include name="IDR_INTERNET_CONFIG_DIALOG_VULCANIZED_HTML" file="${root_gen_dir}\chrome\browser\resources\chromeos\internet_config_dialog\vulcanized.html" use_base_dir="false" flattenhtml="true" allowexternalscript="true" type="BINDATA" compress="gzip" />
+ <include name="IDR_INTERNET_CONFIG_DIALOG_CRISPER_JS" file="${root_gen_dir}\chrome\browser\resources\chromeos\internet_config_dialog\crisper.js" use_base_dir="false" flattenhtml="true" type="BINDATA" compress="gzip" />
+ <include name="IDR_INTERNET_DETAIL_DIALOG_VULCANIZED_HTML" file="${root_gen_dir}\chrome\browser\resources\chromeos\internet_detail_dialog\vulcanized.html" use_base_dir="false" flattenhtml="true" allowexternalscript="true" type="BINDATA" compress="gzip" />
+ <include name="IDR_INTERNET_DETAIL_DIALOG_CRISPER_JS" file="${root_gen_dir}\chrome\browser\resources\chromeos\internet_detail_dialog\crisper.js" use_base_dir="false" flattenhtml="true" type="BINDATA" compress="gzip" />
+ </then>
+ <else>
+ <include name="IDR_INTERNET_CONFIG_DIALOG_HTML" file="resources\chromeos\internet_config_dialog\internet_config_dialog.html" flattenhtml="true" allowexternalscript="true" type="chrome_html" />
+ <include name="IDR_INTERNET_CONFIG_DIALOG_JS" file="resources\chromeos\internet_config_dialog\internet_config_dialog.js" type="chrome_html" />
+ <include name="IDR_INTERNET_DETAIL_DIALOG_HTML" file="resources\chromeos\internet_detail_dialog\internet_detail_dialog.html" flattenhtml="true" allowexternalscript="true" type="chrome_html" />
+ <include name="IDR_INTERNET_DETAIL_DIALOG_JS" file="resources\chromeos\internet_detail_dialog\internet_detail_dialog.js" type="chrome_html" />
+ </else>
+ </if>
<include name="IDR_CERT_MANAGER_DIALOG_HTML" file="resources\chromeos\certificate_manager_dialog.html" flattenhtml="true" type="BINDATA" />
<include name="IDR_SLOW_HTML" file="resources\chromeos\slow.html" flattenhtml="true" type="BINDATA" />
<include name="IDR_SLOW_JS" file="resources\chromeos\slow.js" type="BINDATA" />
diff --git a/chromium/chrome/browser/extensions/BUILD.gn b/chromium/chrome/browser/extensions/BUILD.gn
index a4e21df711c..6e19b623bae 100644
--- a/chromium/chrome/browser/extensions/BUILD.gn
+++ b/chromium/chrome/browser/extensions/BUILD.gn
@@ -854,6 +854,8 @@ static_library("extensions") {
"//components/proxy_config",
"//components/rappor",
"//components/resources",
+ "//components/safe_browsing:csd_proto",
+ "//components/safe_browsing:features",
"//components/safe_browsing/common:safe_browsing_prefs",
"//components/safe_browsing/db:database_manager",
"//components/search_engines",
diff --git a/chromium/chrome/browser/extensions/api/preference/preference_apitest.cc b/chromium/chrome/browser/extensions/api/preference/preference_apitest.cc
index 96ea43851f3..51d8980a312 100644
--- a/chromium/chrome/browser/extensions/api/preference/preference_apitest.cc
+++ b/chromium/chrome/browser/extensions/api/preference/preference_apitest.cc
@@ -343,7 +343,55 @@ IN_PROC_BROWSER_TEST_F(ExtensionPreferenceApiTest, OnChangeSplit) {
listener_incognito10.Reply("ok");
EXPECT_TRUE(catcher.GetNextResult()) << catcher.message();
- EXPECT_TRUE(catcher_incognito.GetNextResult()) << catcher.message();
+ EXPECT_TRUE(catcher_incognito.GetNextResult()) << catcher_incognito.message();
+}
+
+IN_PROC_BROWSER_TEST_F(ExtensionPreferenceApiTest,
+ OnChangeSplitWithNoOTRProfile) {
+ PrefService* prefs = profile_->GetPrefs();
+ prefs->SetBoolean(prefs::kBlockThirdPartyCookies, true);
+
+ extensions::ResultCatcher catcher;
+ ExtensionTestMessageListener loaded_incognito_test_listener(
+ "incognito loaded", false);
+
+ ExtensionTestMessageListener change_pref_listener("change pref value", false);
+
+ ASSERT_TRUE(
+ LoadExtensionIncognito(test_data_dir_.AppendASCII("preference")
+ .AppendASCII("onchange_split_regular_only")));
+
+ ASSERT_TRUE(change_pref_listener.WaitUntilSatisfied());
+ prefs->SetBoolean(prefs::kBlockThirdPartyCookies, false);
+
+ EXPECT_TRUE(catcher.GetNextResult()) << catcher.message();
+ EXPECT_FALSE(loaded_incognito_test_listener.was_satisfied());
+ EXPECT_FALSE(profile_->HasOffTheRecordProfile());
+}
+
+IN_PROC_BROWSER_TEST_F(ExtensionPreferenceApiTest,
+ OnChangeSplitWithoutIncognitoAccess) {
+ PrefService* prefs = profile_->GetPrefs();
+ prefs->SetBoolean(prefs::kBlockThirdPartyCookies, true);
+
+ // Open an incognito window.
+ OpenURLOffTheRecord(profile_, GURL("chrome://newtab/"));
+ EXPECT_TRUE(profile_->HasOffTheRecordProfile());
+
+ extensions::ResultCatcher catcher;
+ ExtensionTestMessageListener loaded_incognito_test_listener(
+ "incognito loaded", false);
+
+ ExtensionTestMessageListener change_pref_listener("change pref value", false);
+
+ ASSERT_TRUE(LoadExtension(test_data_dir_.AppendASCII("preference")
+ .AppendASCII("onchange_split_regular_only")));
+
+ ASSERT_TRUE(change_pref_listener.WaitUntilSatisfied());
+ prefs->SetBoolean(prefs::kBlockThirdPartyCookies, false);
+
+ EXPECT_TRUE(catcher.GetNextResult()) << catcher.message();
+ EXPECT_FALSE(loaded_incognito_test_listener.was_satisfied());
}
IN_PROC_BROWSER_TEST_F(ExtensionPreferenceApiTest, DataReductionProxy) {
diff --git a/chromium/chrome/browser/extensions/api/preference/preference_helpers.cc b/chromium/chrome/browser/extensions/api/preference/preference_helpers.cc
index 3414501b336..1be40a499cc 100644
--- a/chromium/chrome/browser/extensions/api/preference/preference_helpers.cc
+++ b/chromium/chrome/browser/extensions/api/preference/preference_helpers.cc
@@ -99,8 +99,7 @@ void DispatchEventToExtensions(Profile* profile,
// TODO(bauerb): Only iterate over registered event listeners.
if (router->ExtensionHasEventListener(extension->id(), event_name) &&
extension->permissions_data()->HasAPIPermission(permission) &&
- (!incognito || IncognitoInfo::IsSplitMode(extension.get()) ||
- util::CanCrossIncognito(extension.get(), profile))) {
+ (!incognito || util::IsIncognitoEnabled(extension->id(), profile))) {
// Inject level of control key-value.
base::DictionaryValue* dict;
bool rv = args->GetDictionary(0, &dict);
@@ -112,17 +111,28 @@ void DispatchEventToExtensions(Profile* profile,
// If the extension is in incognito split mode,
// a) incognito pref changes are visible only to the incognito tabs
// b) regular pref changes are visible only to the incognito tabs if the
- // incognito pref has not alredy been set
+ // incognito pref has not already been set
Profile* restrict_to_profile = nullptr;
- bool from_incognito = false;
if (IncognitoInfo::IsSplitMode(extension.get())) {
- if (incognito && util::IsIncognitoEnabled(extension->id(), profile)) {
+ if (incognito) { // Handle case a).
+ // If off the record profile does not exist, there should be no
+ // extensions running in incognito at this time, and consequentially
+ // no need to dispatch an event restricted to an incognito extension.
+ // Furthermore, avoid calling GetOffTheRecordProfile() in this case -
+ // this method creates off the record profile if one does not exist.
+ // Unnecessarily creating off the record profile is undesirable, and
+ // can lead to a crash if incognito is disallowed for the current
+ // profile (see https://crbug.com/796814).
+ if (!profile->HasOffTheRecordProfile())
+ continue;
restrict_to_profile = profile->GetOffTheRecordProfile();
- } else if (!incognito &&
- PreferenceAPI::Get(profile)->DoesExtensionControlPref(
- extension->id(), browser_pref, &from_incognito) &&
- from_incognito) {
- restrict_to_profile = profile;
+ } else { // Handle case b).
+ bool controlled_from_incognito = false;
+ bool controlled_by_extension =
+ PreferenceAPI::Get(profile)->DoesExtensionControlPref(
+ extension->id(), browser_pref, &controlled_from_incognito);
+ if (controlled_by_extension && controlled_from_incognito)
+ restrict_to_profile = profile;
}
}
diff --git a/chromium/chrome/browser/resources/chromeos/bluetooth_pairing_dialog/BUILD.gn b/chromium/chrome/browser/resources/chromeos/bluetooth_pairing_dialog/BUILD.gn
new file mode 100644
index 00000000000..15d7eeb92a3
--- /dev/null
+++ b/chromium/chrome/browser/resources/chromeos/bluetooth_pairing_dialog/BUILD.gn
@@ -0,0 +1,12 @@
+import("../../optimize_webui.gni")
+
+optimize_webui("build") {
+ host = "bluetooth_pairing_dialog"
+ html_in_files = [ "bluetooth_pairing_dialog.html" ]
+ html_out_files = [ "vulcanized.html" ]
+
+ input = rebase_path(".", root_build_dir)
+ js_out_files = [ "crisper.js" ]
+
+ deps = []
+}
diff --git a/chromium/chrome/browser/resources/chromeos/bluetooth_pairing_dialog/compiled_resources2.gyp b/chromium/chrome/browser/resources/chromeos/bluetooth_pairing_dialog/compiled_resources2.gyp
new file mode 100644
index 00000000000..8abdc2c0cb7
--- /dev/null
+++ b/chromium/chrome/browser/resources/chromeos/bluetooth_pairing_dialog/compiled_resources2.gyp
@@ -0,0 +1,19 @@
+# Copyright 2018 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+{
+ 'targets': [
+ {
+ 'target_name': 'bluetooth_pairing_dialog',
+ 'dependencies': [
+ '<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:cr',
+ '<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:i18n_behavior',
+ '<(EXTERNS_GYP):bluetooth',
+ '<(EXTERNS_GYP):bluetooth_private',
+ '<(INTERFACES_GYP):bluetooth_interface',
+ '<(INTERFACES_GYP):bluetooth_private_interface',
+ ],
+ 'includes': ['../../../../../third_party/closure_compiler/compile_js2.gypi'],
+ },
+ ],
+}
diff --git a/chromium/chrome/browser/resources/chromeos/compiled_resources2.gyp b/chromium/chrome/browser/resources/chromeos/compiled_resources2.gyp
index 2aff6fece17..38d2711fbdc 100644
--- a/chromium/chrome/browser/resources/chromeos/compiled_resources2.gyp
+++ b/chromium/chrome/browser/resources/chromeos/compiled_resources2.gyp
@@ -4,44 +4,13 @@
{
'targets': [
{
- 'target_name': 'bluetooth_pairing_dialog',
+ 'target_name': 'chromeos_resources',
+ 'type': 'none',
'dependencies': [
- '<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:cr',
- '<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:i18n_behavior',
- '<(EXTERNS_GYP):bluetooth',
- '<(EXTERNS_GYP):bluetooth_private',
- '<(INTERFACES_GYP):bluetooth_interface',
- '<(INTERFACES_GYP):bluetooth_private_interface',
+ 'bluetooth_pairing_dialog/compiled_resources2.gyp:*',
+ 'internet_config_dialog/compiled_resources2.gyp:*',
+ 'internet_detail_dialog/compiled_resources2.gyp:*',
],
- 'includes': ['../../../../third_party/closure_compiler/compile_js2.gypi'],
},
- {
- 'target_name': 'internet_config_dialog',
- 'dependencies': [
- '<(DEPTH)/ui/webui/resources/cr_components/chromeos/network/compiled_resources2.gyp:network_config',
- '<(DEPTH)/ui/webui/resources/cr_elements/chromeos/network/compiled_resources2.gyp:cr_onc_types',
- '<(DEPTH)/ui/webui/resources/cr_elements/cr_dialog/compiled_resources2.gyp:cr_dialog',
- '<(DEPTH)/ui/webui/resources/cr_elements/policy/compiled_resources2.gyp:cr_policy_network_behavior',
- '<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:assert',
- '<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:i18n_behavior',
- '<(EXTERNS_GYP):chrome_send',
- '<(EXTERNS_GYP):networking_private',
- '<(INTERFACES_GYP):networking_private_interface',
- ],
- 'includes': ['../../../../third_party/closure_compiler/compile_js2.gypi'],
- },
- {
- 'target_name': 'internet_detail_dialog',
- 'dependencies': [
- '<(DEPTH)/ui/webui/resources/cr_elements/chromeos/network/compiled_resources2.gyp:cr_onc_types',
- '<(DEPTH)/ui/webui/resources/cr_elements/policy/compiled_resources2.gyp:cr_policy_network_behavior',
- '<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:assert',
- '<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:i18n_behavior',
- '<(EXTERNS_GYP):chrome_send',
- '<(EXTERNS_GYP):networking_private',
- '<(INTERFACES_GYP):networking_private_interface',
- ],
- 'includes': ['../../../../third_party/closure_compiler/compile_js2.gypi'],
- },
- ],
+ ]
}
diff --git a/chromium/chrome/browser/resources/chromeos/internet_config_dialog/BUILD.gn b/chromium/chrome/browser/resources/chromeos/internet_config_dialog/BUILD.gn
new file mode 100644
index 00000000000..b6041a5b6ea
--- /dev/null
+++ b/chromium/chrome/browser/resources/chromeos/internet_config_dialog/BUILD.gn
@@ -0,0 +1,12 @@
+import("../../optimize_webui.gni")
+
+optimize_webui("build") {
+ host = "internet_config_dialog"
+ html_in_files = [ "internet_config_dialog.html" ]
+ html_out_files = [ "vulcanized.html" ]
+
+ input = rebase_path(".", root_build_dir)
+ js_out_files = [ "crisper.js" ]
+
+ deps = []
+}
diff --git a/chromium/chrome/browser/resources/chromeos/internet_config_dialog/compiled_resources2.gyp b/chromium/chrome/browser/resources/chromeos/internet_config_dialog/compiled_resources2.gyp
new file mode 100644
index 00000000000..a75a8e4f46a
--- /dev/null
+++ b/chromium/chrome/browser/resources/chromeos/internet_config_dialog/compiled_resources2.gyp
@@ -0,0 +1,22 @@
+# Copyright 2018 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+{
+ 'targets': [
+ {
+ 'target_name': 'internet_config_dialog',
+ 'dependencies': [
+ '<(DEPTH)/ui/webui/resources/cr_components/chromeos/network/compiled_resources2.gyp:network_config',
+ '<(DEPTH)/ui/webui/resources/cr_elements/chromeos/network/compiled_resources2.gyp:cr_onc_types',
+ '<(DEPTH)/ui/webui/resources/cr_elements/cr_dialog/compiled_resources2.gyp:cr_dialog',
+ '<(DEPTH)/ui/webui/resources/cr_elements/policy/compiled_resources2.gyp:cr_policy_network_behavior',
+ '<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:assert',
+ '<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:i18n_behavior',
+ '<(EXTERNS_GYP):chrome_send',
+ '<(EXTERNS_GYP):networking_private',
+ '<(INTERFACES_GYP):networking_private_interface',
+ ],
+ 'includes': ['../../../../../third_party/closure_compiler/compile_js2.gypi'],
+ },
+ ],
+}
diff --git a/chromium/chrome/browser/resources/chromeos/internet_detail_dialog/BUILD.gn b/chromium/chrome/browser/resources/chromeos/internet_detail_dialog/BUILD.gn
new file mode 100644
index 00000000000..a97168ca4a3
--- /dev/null
+++ b/chromium/chrome/browser/resources/chromeos/internet_detail_dialog/BUILD.gn
@@ -0,0 +1,12 @@
+import("../../optimize_webui.gni")
+
+optimize_webui("build") {
+ host = "internet_detail_dialog"
+ html_in_files = [ "internet_detail_dialog.html" ]
+ html_out_files = [ "vulcanized.html" ]
+
+ input = rebase_path(".", root_build_dir)
+ js_out_files = [ "crisper.js" ]
+
+ deps = []
+}
diff --git a/chromium/chrome/browser/resources/chromeos/internet_detail_dialog/compiled_resources2.gyp b/chromium/chrome/browser/resources/chromeos/internet_detail_dialog/compiled_resources2.gyp
new file mode 100644
index 00000000000..8d58322672d
--- /dev/null
+++ b/chromium/chrome/browser/resources/chromeos/internet_detail_dialog/compiled_resources2.gyp
@@ -0,0 +1,20 @@
+# Copyright 2018 The Chromium Authors. All rights reserved.
+# Use of this source code is governed by a BSD-style license that can be
+# found in the LICENSE file.
+{
+ 'targets': [
+ {
+ 'target_name': 'internet_detail_dialog',
+ 'dependencies': [
+ '<(DEPTH)/ui/webui/resources/cr_elements/chromeos/network/compiled_resources2.gyp:cr_onc_types',
+ '<(DEPTH)/ui/webui/resources/cr_elements/policy/compiled_resources2.gyp:cr_policy_network_behavior',
+ '<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:assert',
+ '<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:i18n_behavior',
+ '<(EXTERNS_GYP):chrome_send',
+ '<(EXTERNS_GYP):networking_private',
+ '<(INTERFACES_GYP):networking_private_interface',
+ ],
+ 'includes': ['../../../../../third_party/closure_compiler/compile_js2.gypi'],
+ },
+ ],
+}
diff --git a/chromium/chrome/browser/resources/chromeos/zip_archiver/manifest.json b/chromium/chrome/browser/resources/chromeos/zip_archiver/manifest.json
index 456a43640de..3478c1cc9d3 100644
--- a/chromium/chrome/browser/resources/chromeos/zip_archiver/manifest.json
+++ b/chromium/chrome/browser/resources/chromeos/zip_archiver/manifest.json
@@ -22,8 +22,7 @@
"directory"
]
},
- "notifications",
- "storage"
+ "notifications"
],
"file_system_provider_capabilities": {
"multipleMounts": true,
diff --git a/chromium/chrome/browser/resources/feedback/js/feedback.js b/chromium/chrome/browser/resources/feedback/js/feedback.js
index a4a37683e34..909a5e50a68 100644
--- a/chromium/chrome/browser/resources/feedback/js/feedback.js
+++ b/chromium/chrome/browser/resources/feedback/js/feedback.js
@@ -321,7 +321,8 @@ function initialize() {
}
$('description-text').textContent = feedbackInfo.description;
- $('description-text').placeholder = feedbackInfo.descriptionPlaceholder;
+ if (feedbackInfo.descriptionPlaceholder)
+ $('description-text').placeholder = feedbackInfo.descriptionPlaceholder;
if (feedbackInfo.pageUrl)
$('page-url-text').value = feedbackInfo.pageUrl;
diff --git a/chromium/chrome/browser/resources/print_preview/data/destination_match.js b/chromium/chrome/browser/resources/print_preview/data/destination_match.js
index 260a6411f31..84cb9c014cb 100644
--- a/chromium/chrome/browser/resources/print_preview/data/destination_match.js
+++ b/chromium/chrome/browser/resources/print_preview/data/destination_match.js
@@ -106,11 +106,12 @@ cr.define('print_preview', function() {
}
/**
- * @return {?print_preview.PrinterType} The printer type of this
- * destination match. Will return null for Cloud destinations.
+ * @return {!Set<?print_preview.PrinterType>} The printer types that
+ * correspond to this destination match. A null element in the set
+ * indicates the match may represent a Cloud destination.
*/
- getType() {
- return originToType(this.origins_[0]);
+ getTypes() {
+ return new Set(this.origins_.map(origin => originToType(origin)));
}
}
diff --git a/chromium/chrome/browser/resources/print_preview/data/destination_store.js b/chromium/chrome/browser/resources/print_preview/data/destination_store.js
index 975c6874f12..6bb76292b0b 100644
--- a/chromium/chrome/browser/resources/print_preview/data/destination_store.js
+++ b/chromium/chrome/browser/resources/print_preview/data/destination_store.js
@@ -530,16 +530,18 @@ cr.define('print_preview', function() {
*/
fetchMatchingDestination_(destinationMatch) {
this.autoSelectMatchingDestination_ = destinationMatch;
- const type = destinationMatch.getType();
- if (type != null) { // Local, Privet, or Extension.
- this.startLoadDestinations(type);
- } else if (
- destinationMatch.matchOrigin(
- print_preview.DestinationOrigin.COOKIES) ||
- destinationMatch.matchOrigin(
- print_preview.DestinationOrigin.DEVICE)) {
- this.startLoadCloudDestinations();
- }
+ const types = destinationMatch.getTypes();
+ types.forEach(type => {
+ if (type != null) { // Local, extension, or privet printer
+ this.startLoadDestinations(type);
+ } else if (
+ destinationMatch.matchOrigin(
+ print_preview.DestinationOrigin.COOKIES) ||
+ destinationMatch.matchOrigin(
+ print_preview.DestinationOrigin.DEVICE)) {
+ this.startLoadCloudDestinations();
+ }
+ });
}
/**
diff --git a/chromium/chrome/browser/resources/settings/about_page/about_page.js b/chromium/chrome/browser/resources/settings/about_page/about_page.js
index ac46a5686a9..beecac15534 100644
--- a/chromium/chrome/browser/resources/settings/about_page/about_page.js
+++ b/chromium/chrome/browser/resources/settings/about_page/about_page.js
@@ -417,7 +417,7 @@ Polymer({
/** @private */
onRelaunchAndPowerwashTap_: function() {
- this.lifetimeBrowserProxy_.factoryReset();
+ this.lifetimeBrowserProxy_.factoryReset(false);
},
/**
diff --git a/chromium/chrome/browser/resources/settings/android_apps_page/android_apps_subpage.js b/chromium/chrome/browser/resources/settings/android_apps_page/android_apps_subpage.js
index e165f6992a4..c8baa19e856 100644
--- a/chromium/chrome/browser/resources/settings/android_apps_page/android_apps_subpage.js
+++ b/chromium/chrome/browser/resources/settings/android_apps_page/android_apps_subpage.js
@@ -19,7 +19,13 @@ Polymer({
/** @private {!AndroidAppsInfo|undefined} */
androidAppsInfo: {
type: Object,
- observer: 'onAndroidAppsInfoUpdate_',
+ },
+
+ /** @private */
+ playStoreEnabled_: {
+ type: Boolean,
+ computed: 'computePlayStoreEnabled_(androidAppsInfo)',
+ observer: 'onPlayStoreEnabledChanged_'
},
/** @private */
@@ -41,11 +47,9 @@ Polymer({
this.browserProxy_ = settings.AndroidAppsBrowserProxyImpl.getInstance();
},
- /**
- * @private
- */
- onAndroidAppsInfoUpdate_: function() {
- if (!this.androidAppsInfo.playStoreEnabled &&
+ /** @private */
+ onPlayStoreEnabledChanged_: function(enabled) {
+ if (!enabled &&
settings.getCurrentRoute() == settings.routes.ANDROID_APPS_DETAILS) {
settings.navigateToPreviousRoute();
}
@@ -55,6 +59,14 @@ Polymer({
* @return {boolean}
* @private
*/
+ computePlayStoreEnabled_: function() {
+ return this.androidAppsInfo.playStoreEnabled;
+ },
+
+ /**
+ * @return {boolean}
+ * @private
+ */
allowRemove_: function() {
return this.prefs.arc.enabled.enforcement !=
chrome.settingsPrivate.Enforcement.ENFORCED;
diff --git a/chromium/chrome/browser/resources/settings/bluetooth_page/bluetooth_page.html b/chromium/chrome/browser/resources/settings/bluetooth_page/bluetooth_page.html
index bcb20f6001c..fb27688ce72 100644
--- a/chromium/chrome/browser/resources/settings/bluetooth_page/bluetooth_page.html
+++ b/chromium/chrome/browser/resources/settings/bluetooth_page/bluetooth_page.html
@@ -44,7 +44,9 @@
<div class="separator"></div>
<paper-toggle-button id="enableBluetooth"
checked="{{bluetoothToggleState_}}"
- disabled$="[[bluetoothToggleDisabled_]]" on-tap="stopTap_"
+ disabled$=
+ "[[!isToggleEnabled_(adapterState_, stateChangeInProgress_)]]"
+ on-tap="stopTap_"
aria-label="$i18n{bluetoothToggleA11yLabel}">
</paper-toggle-button>
</div>
@@ -56,7 +58,7 @@
<settings-bluetooth-subpage
adapter-state="[[adapterState_]]"
bluetooth-toggle-state="{{bluetoothToggleState_}}"
- bluetooth-toggle-disabled="[[bluetoothToggleDisabled_]]"
+ state-change-in-progress="[[stateChangeInProgress_]]"
bluetooth="[[bluetooth]]"
bluetooth-private="[[bluetoothPrivate]]">
</settings-bluetooth-subpage>
diff --git a/chromium/chrome/browser/resources/settings/bluetooth_page/bluetooth_page.js b/chromium/chrome/browser/resources/settings/bluetooth_page/bluetooth_page.js
index 674bf08c65f..73b88de9676 100644
--- a/chromium/chrome/browser/resources/settings/bluetooth_page/bluetooth_page.js
+++ b/chromium/chrome/browser/resources/settings/bluetooth_page/bluetooth_page.js
@@ -46,15 +46,14 @@ Polymer({
},
/**
- * Set to true before the adapter state is received, when the adapter is
- * unavailable, and while an adapter state change is requested. This
- * prevents user changes while a change is in progress or when the adapter
- * is not available.
+ * Set to true while an adapter state change is requested and the callback
+ * hasn't fired yet. One of the factor that determines whether to disable
+ * the toggle button.
* @private
*/
- bluetoothToggleDisabled_: {
+ stateChangeInProgress_: {
type: Boolean,
- value: true,
+ value: false,
},
/**
@@ -160,19 +159,28 @@ Polymer({
},
/**
+ * @return {boolean}
+ * @private
+ */
+ isToggleEnabled_: function() {
+ return this.adapterState_ !== undefined && this.adapterState_.available &&
+ !this.stateChangeInProgress_;
+ },
+
+ /**
* Process bluetooth.onAdapterStateChanged events.
* @param {!chrome.bluetooth.AdapterState} state
* @private
*/
onBluetoothAdapterStateChanged_: function(state) {
this.adapterState_ = state;
- this.bluetoothToggleState_ = state.powered;
- this.bluetoothToggleDisabled_ = !state.available;
+ if (this.isToggleEnabled_())
+ this.bluetoothToggleState_ = state.powered;
},
/** @private */
onTap_: function() {
- if (this.adapterState_.available === false)
+ if (!this.isToggleEnabled_())
return;
if (!this.bluetoothToggleState_)
this.bluetoothToggleState_ = true;
@@ -199,13 +207,17 @@ Polymer({
/** @private */
bluetoothToggleStateChanged_: function() {
- if (!this.adapterState_ || this.bluetoothToggleDisabled_ ||
+ if (!this.adapterState_ || !this.isToggleEnabled_() ||
this.bluetoothToggleState_ == this.adapterState_.powered) {
return;
}
- this.bluetoothToggleDisabled_ = true;
+ this.stateChangeInProgress_ = true;
this.bluetoothPrivate.setAdapterState(
{powered: this.bluetoothToggleState_}, () => {
+ // Restore the in-progress mark when the callback is called regardless
+ // of error or success.
+ this.stateChangeInProgress_ = false;
+
const error = chrome.runtime.lastError;
if (error && error != 'Error setting adapter properties: powered') {
console.error('Error enabling bluetooth: ' + error.message);
diff --git a/chromium/chrome/browser/resources/settings/bluetooth_page/bluetooth_subpage.html b/chromium/chrome/browser/resources/settings/bluetooth_page/bluetooth_subpage.html
index 4174281cd80..6ca9d1b16fa 100644
--- a/chromium/chrome/browser/resources/settings/bluetooth_page/bluetooth_subpage.html
+++ b/chromium/chrome/browser/resources/settings/bluetooth_page/bluetooth_subpage.html
@@ -46,7 +46,7 @@
</div>
<paper-toggle-button id="enableBluetooth"
checked="{{bluetoothToggleState}}"
- disabled$="[[bluetoothToggleDisabled]]"
+ disabled$="[[!isToggleEnabled_(adapterState, stateChangeInProgress)]]"
aria-label="$i18n{bluetoothToggleA11yLabel}"
on-tap="stopTap_">
</paper-toggle-button>
diff --git a/chromium/chrome/browser/resources/settings/bluetooth_page/bluetooth_subpage.js b/chromium/chrome/browser/resources/settings/bluetooth_page/bluetooth_subpage.js
index 48376567145..d8d0ef34916 100644
--- a/chromium/chrome/browser/resources/settings/bluetooth_page/bluetooth_subpage.js
+++ b/chromium/chrome/browser/resources/settings/bluetooth_page/bluetooth_subpage.js
@@ -31,7 +31,7 @@ Polymer({
},
/** Reflects the bluetooth-page property. */
- bluetoothToggleDisabled: Boolean,
+ stateChangeInProgress: Boolean,
/**
* The bluetooth adapter state, cached by bluetooth-page.
@@ -379,7 +379,8 @@ Polymer({
* @private
*/
onEnableTap_: function(event) {
- this.bluetoothToggleState = !this.bluetoothToggleState;
+ if (this.isToggleEnabled_())
+ this.bluetoothToggleState = !this.bluetoothToggleState;
event.stopPropagation();
},
@@ -395,6 +396,15 @@ Polymer({
},
/**
+ * @return {boolean}
+ * @private
+ */
+ isToggleEnabled_: function() {
+ return this.adapterState !== undefined && this.adapterState.available &&
+ !this.stateChangeInProgress;
+ },
+
+ /**
* @param {boolean} bluetoothToggleState
* @param {!Array<!chrome.bluetooth.Device>} deviceList
* @return {boolean}
diff --git a/chromium/chrome/browser/resources/settings/controls/settings_dropdown_menu.html b/chromium/chrome/browser/resources/settings/controls/settings_dropdown_menu.html
index a675aa6f86f..4fbf5d6ac5b 100644
--- a/chromium/chrome/browser/resources/settings/controls/settings_dropdown_menu.html
+++ b/chromium/chrome/browser/resources/settings/controls/settings_dropdown_menu.html
@@ -16,8 +16,13 @@
display: inline-flex;
}
+ /* When settings-dropdown-menu is start-aligned, we probably want policy
+ * indicator to be be displayed after the dropdown.
+ * Setting --settings-dropdown-menu-policy-order to 1 will do the job.
+ */
cr-policy-pref-indicator {
margin: 0 var(--settings-controlled-by-spacing);
+ order: var(--settings-dropdown-menu-policy-order, 0);
}
/* Hide "Custom" value when unselectable. */
diff --git a/chromium/chrome/browser/resources/settings/date_time_page/date_time_page.html b/chromium/chrome/browser/resources/settings/date_time_page/date_time_page.html
index becd135bec1..c064fabcbef 100644
--- a/chromium/chrome/browser/resources/settings/date_time_page/date_time_page.html
+++ b/chromium/chrome/browser/resources/settings/date_time_page/date_time_page.html
@@ -88,7 +88,8 @@
<template is="dom-if" route-path="/dateTime/timeZone">
<settings-subpage data-route="DATETIME_TIMEZONE_SUBPAGE"
associated-control="[[$$('#timeZoneSettingsTrigger')]]"
- page-title="$i18n{timeZoneSubpageTitle}">
+ page-title="$i18n{timeZoneSubpageTitle}"
+ learn-more-url="$i18n{timeZoneSettingsLearnMoreURL}">
<timezone-subpage id="timezoneSubpage" prefs="{{prefs}}"
active-time-zone-display-name="{{activeTimeZoneDisplayName}}">
</timezone-subpage>
diff --git a/chromium/chrome/browser/resources/settings/date_time_page/timezone_selector.html b/chromium/chrome/browser/resources/settings/date_time_page/timezone_selector.html
index e2c5bd33190..dd6c68405b9 100644
--- a/chromium/chrome/browser/resources/settings/date_time_page/timezone_selector.html
+++ b/chromium/chrome/browser/resources/settings/date_time_page/timezone_selector.html
@@ -13,6 +13,11 @@
settings-dropdown-menu {
--md-select-width: 400px;
}
+ /* When per_user_timezone_enabled is true, dropdowns are start-aligned. */
+ #userTimeZoneSelector,
+ #systemTimezoneSelector {
+ --settings-dropdown-menu-policy-order: 1;
+ }
</style>
<template is="dom-if" restamp
if="[[!prefs.cros.flags.per_user_timezone_enabled.value]]">
diff --git a/chromium/chrome/browser/resources/settings/date_time_page/timezone_subpage.html b/chromium/chrome/browser/resources/settings/date_time_page/timezone_subpage.html
index 6d27dfb503e..e2953defea0 100644
--- a/chromium/chrome/browser/resources/settings/date_time_page/timezone_subpage.html
+++ b/chromium/chrome/browser/resources/settings/date_time_page/timezone_subpage.html
@@ -16,6 +16,11 @@
}
settings-dropdown-menu {
--md-select-width: 400px;
+ --settings-dropdown-menu-policy-order: 1;
+ }
+ #timeZoneResolveMethodDropdown,
+ #timezoneSelector {
+ -webkit-padding-start: 28px;
}
</style>
<div class="settings-box block first">
@@ -42,7 +47,7 @@
label="$i18n{setTimeZoneAutomaticallyOff}"
no-extension-indicator>
</controlled-radio-button>
- <timezone-selector prefs="{{prefs}}"
+ <timezone-selector id="timezoneSelector" prefs="{{prefs}}"
active-time-zone-display-name="{{activeTimeZoneDisplayName}}">
</timezone-selector>
</settings-radio-group>
diff --git a/chromium/chrome/browser/resources/settings/icons.html b/chromium/chrome/browser/resources/settings/icons.html
index 432ad8ed51e..5c035d852d8 100644
--- a/chromium/chrome/browser/resources/settings/icons.html
+++ b/chromium/chrome/browser/resources/settings/icons.html
@@ -29,6 +29,11 @@ List icons here rather than importing large sets of (e.g. Polymer) icons.
<path fill="none" d="M1 1h22v22H1z"></path>
</g>
+ <!-- Icons from https://icons.googleplex.com. -->
+<if expr="chromeos">
+ <g id="play-prism"><path fill="#5A5A5A" d="M20.18 10.88l-3.06-1.74L14.26 12l2.86 2.86 3.06-1.74c.55-.31.82-.71.82-1.12 0-.41-.27-.81-.82-1.12zM4.71 2.45l8.42 8.42 2.55-2.55-10.7-6.06c-.07-.04-.14-.07-.21-.1-.17-.07-.3.05-.15.21.03.02.06.05.09.08zm0 19.1l-.08.08c-.15.15-.02.28.15.21.07-.03.14-.06.21-.1l10.69-6.06-2.55-2.55s-7.2 7.21-8.42 8.42zM12 12L3.38 3.38c-.19-.19-.38-.07-.38.19v16.86c0 .26.19.38.38.19L12 12z"></path></g>
+</if>
+
<!--
These icons are copied from Polymer's iron-icons and kept in sorted order.
See http://goo.gl/Y1OdAq for instructions on adding additional icons.
@@ -37,7 +42,6 @@ List icons here rather than importing large sets of (e.g. Polymer) icons.
<g id="access-time"><path d="M11.99 2C6.47 2 2 6.48 2 12s4.47 10 9.99 10C17.52 22 22 17.52 22 12S17.52 2 11.99 2zM12 20c-4.42 0-8-3.58-8-8s3.58-8 8-8 8 3.58 8 8-3.58 8-8 8zm.5-13H11v6l5.25 3.15.75-1.23-4.5-2.67z"></path></g>
</if>
<g id="accessibility"><path d="M12 2c1.1 0 2 .9 2 2s-.9 2-2 2-2-.9-2-2 .9-2 2-2zm9 7h-6v13h-2v-6h-2v6H9V9H3V7h18v2z"></path></g>
- <g id="android"><path d="M6 18c0 .55.45 1 1 1h1v3.5c0 .83.67 1.5 1.5 1.5s1.5-.67 1.5-1.5V19h2v3.5c0 .83.67 1.5 1.5 1.5s1.5-.67 1.5-1.5V19h1c.55 0 1-.45 1-1V8H6v10zM3.5 8C2.67 8 2 8.67 2 9.5v7c0 .83.67 1.5 1.5 1.5S5 17.33 5 16.5v-7C5 8.67 4.33 8 3.5 8zm17 0c-.83 0-1.5.67-1.5 1.5v7c0 .83.67 1.5 1.5 1.5s1.5-.67 1.5-1.5v-7c0-.83-.67-1.5-1.5-1.5zm-4.97-5.84l1.3-1.3c.2-.2.2-.51 0-.71-.2-.2-.51-.2-.71 0l-1.48 1.48C13.85 1.23 12.95 1 12 1c-.96 0-1.86.23-2.66.63L7.85.15c-.2-.2-.51-.2-.71 0-.2.2-.2.51 0 .71l1.31 1.31C6.97 3.26 6 5.01 6 7h12c0-1.99-.97-3.75-2.47-4.84zM10 5H9V4h1v1zm5 0h-1V4h1v1z"></path></g>
<g id="apps"><path d="M4 8h4V4H4v4zm6 12h4v-4h-4v4zm-6 0h4v-4H4v4zm0-6h4v-4H4v4zm6 0h4v-4h-4v4zm6-10v4h4V4h-4zm-6 4h4V4h-4v4zm6 6h4v-4h-4v4zm0 6h4v-4h-4v4z"></path></g>
<g id="arrow-back"><path d="M20 11H7.83l5.59-5.59L12 4l-8 8 8 8 1.41-1.41L7.83 13H20v-2z"></path></g>
<g id="assignment"><path d="M19 3h-4.18C14.4 1.84 13.3 1 12 1c-1.3 0-2.4.84-2.82 2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-7 0c.55 0 1 .45 1 1s-.45 1-1 1-1-.45-1-1 .45-1 1-1zm2 14H7v-2h7v2zm3-4H7v-2h10v2zm0-4H7V7h10v2z"></path></g>
diff --git a/chromium/chrome/browser/resources/settings/internet_page/network_proxy_section.js b/chromium/chrome/browser/resources/settings/internet_page/network_proxy_section.js
index be5d5f21fdf..1d974dec521 100644
--- a/chromium/chrome/browser/resources/settings/internet_page/network_proxy_section.js
+++ b/chromium/chrome/browser/resources/settings/internet_page/network_proxy_section.js
@@ -104,13 +104,9 @@ Polymer({
shouldShowAllowShared_: function(property) {
if (!this.isShared_())
return false;
- if (this.isNetworkPolicyControlled(property)) {
- // Shared networks may respect the 'use_shared_proxies' pref unless
- // the proxy is configured by a user policy.
- // See ProxyConfigServiceImpl::IgnoreProxy().
- if (typeof property.UserEditable != 'undefined')
- return property.UserEditable;
- }
+ // We currently do not accurately determine the source if the policy
+ // controlling the proxy setting, so always show the 'allow shared'
+ // toggle for shared networks. http://crbug.com/662529.
return true;
},
diff --git a/chromium/chrome/browser/resources/settings/lifetime_browser_proxy.js b/chromium/chrome/browser/resources/settings/lifetime_browser_proxy.js
index 19bc02a2d69..396539708ff 100644
--- a/chromium/chrome/browser/resources/settings/lifetime_browser_proxy.js
+++ b/chromium/chrome/browser/resources/settings/lifetime_browser_proxy.js
@@ -19,7 +19,7 @@ cr.define('settings', function() {
* Triggers a factory reset. The parameter indicates whether to install a
* TPM firmware update (if available) after the reset.
*
- * @param {boolean=} requestTpmFirmwareUpdate
+ * @param {boolean} requestTpmFirmwareUpdate
*/
factoryReset(requestTpmFirmwareUpdate) {}
// </if>
diff --git a/chromium/chrome/browser/resources/settings/reset_page/compiled_resources2.gyp b/chromium/chrome/browser/resources/settings/reset_page/compiled_resources2.gyp
index 39f600e4c60..831d1e4c2f3 100644
--- a/chromium/chrome/browser/resources/settings/reset_page/compiled_resources2.gyp
+++ b/chromium/chrome/browser/resources/settings/reset_page/compiled_resources2.gyp
@@ -4,6 +4,14 @@
{
'targets': [
{
+ 'target_name': 'powerwash_dialog',
+ 'dependencies': [
+ '../compiled_resources2.gyp:lifetime_browser_proxy',
+ 'reset_browser_proxy',
+ ],
+ 'includes': ['../../../../../third_party/closure_compiler/compile_js2.gypi'],
+ },
+ {
'target_name': 'reset_page',
'dependencies': [
'../compiled_resources2.gyp:route',
diff --git a/chromium/chrome/browser/resources/settings/reset_page/powerwash_dialog.js b/chromium/chrome/browser/resources/settings/reset_page/powerwash_dialog.js
index 2ff5c06ee71..37786342ef1 100644
--- a/chromium/chrome/browser/resources/settings/reset_page/powerwash_dialog.js
+++ b/chromium/chrome/browser/resources/settings/reset_page/powerwash_dialog.js
@@ -12,7 +12,10 @@ Polymer({
properties: {
/** @public */
- requestTpmFirmwareUpdate: Boolean,
+ requestTpmFirmwareUpdate: {
+ type: Boolean,
+ value: false,
+ }
},
/** @override */
diff --git a/chromium/chrome/browser/resources/settings/settings_menu/settings_menu.html b/chromium/chrome/browser/resources/settings/settings_menu/settings_menu.html
index ffe06b5ee5a..56bc54956d0 100644
--- a/chromium/chrome/browser/resources/settings/settings_menu/settings_menu.html
+++ b/chromium/chrome/browser/resources/settings/settings_menu/settings_menu.html
@@ -113,7 +113,7 @@
</a>
<if expr="chromeos">
<a href="/androidApps" hidden="[[!showAndroidApps]]">
- <iron-icon icon="settings:android"></iron-icon>
+ <iron-icon icon="settings:play-prism"></iron-icon>
$i18n{androidAppsPageTitle}
</a>
</if>
diff --git a/chromium/chrome/browser/ui/webui/chromeos/bluetooth_pairing_dialog.cc b/chromium/chrome/browser/ui/webui/chromeos/bluetooth_pairing_dialog.cc
index 4fd2ef91461..495bd41c242 100644
--- a/chromium/chrome/browser/ui/webui/chromeos/bluetooth_pairing_dialog.cc
+++ b/chromium/chrome/browser/ui/webui/chromeos/bluetooth_pairing_dialog.cc
@@ -84,10 +84,16 @@ BluetoothPairingDialogUI::BluetoothPairingDialogUI(content::WebUI* web_ui)
AddBluetoothStrings(source);
source->AddLocalizedString("title", IDS_SETTINGS_BLUETOOTH_PAIR_DEVICE_TITLE);
source->SetJsonPath("strings.js");
+#if BUILDFLAG(OPTIMIZE_WEBUI)
+ source->UseGzip();
+ source->SetDefaultResource(IDR_BLUETOOTH_PAIRING_DIALOG_VULCANIZED_HTML);
+ source->AddResourcePath("crisper.js",
+ IDR_BLUETOOTH_PAIRING_DIALOG_CRISPER_JS);
+#else
source->SetDefaultResource(IDR_BLUETOOTH_PAIRING_DIALOG_HTML);
source->AddResourcePath("bluetooth_pairing_dialog.js",
IDR_BLUETOOTH_PAIRING_DIALOG_JS);
-
+#endif
content::WebUIDataSource::Add(Profile::FromWebUI(web_ui), source);
}
diff --git a/chromium/chrome/browser/ui/webui/chromeos/internet_config_dialog.cc b/chromium/chrome/browser/ui/webui/chromeos/internet_config_dialog.cc
index 2f559bede90..0591f3b24f6 100644
--- a/chromium/chrome/browser/ui/webui/chromeos/internet_config_dialog.cc
+++ b/chromium/chrome/browser/ui/webui/chromeos/internet_config_dialog.cc
@@ -113,9 +113,15 @@ InternetConfigDialogUI::InternetConfigDialogUI(content::WebUI* web_ui)
AddInternetStrings(source);
source->AddLocalizedString("title", IDS_SETTINGS_INTERNET_CONFIG);
source->SetJsonPath("strings.js");
+#if BUILDFLAG(OPTIMIZE_WEBUI)
+ source->UseGzip();
+ source->SetDefaultResource(IDR_INTERNET_CONFIG_DIALOG_VULCANIZED_HTML);
+ source->AddResourcePath("crisper.js", IDR_INTERNET_CONFIG_DIALOG_CRISPER_JS);
+#else
source->SetDefaultResource(IDR_INTERNET_CONFIG_DIALOG_HTML);
source->AddResourcePath("internet_config_dialog.js",
IDR_INTERNET_CONFIG_DIALOG_JS);
+#endif
content::WebUIDataSource::Add(Profile::FromWebUI(web_ui), source);
}
diff --git a/chromium/chrome/browser/ui/webui/chromeos/internet_detail_dialog.cc b/chromium/chrome/browser/ui/webui/chromeos/internet_detail_dialog.cc
index 327acb5a363..3f191280d06 100644
--- a/chromium/chrome/browser/ui/webui/chromeos/internet_detail_dialog.cc
+++ b/chromium/chrome/browser/ui/webui/chromeos/internet_detail_dialog.cc
@@ -113,10 +113,15 @@ InternetDetailDialogUI::InternetDetailDialogUI(content::WebUI* web_ui)
AddInternetStrings(source);
source->AddLocalizedString("title", IDS_SETTINGS_INTERNET_DETAIL);
source->SetJsonPath("strings.js");
+#if BUILDFLAG(OPTIMIZE_WEBUI)
+ source->UseGzip();
+ source->SetDefaultResource(IDR_INTERNET_DETAIL_DIALOG_VULCANIZED_HTML);
+ source->AddResourcePath("crisper.js", IDR_INTERNET_DETAIL_DIALOG_CRISPER_JS);
+#else
source->SetDefaultResource(IDR_INTERNET_DETAIL_DIALOG_HTML);
source->AddResourcePath("internet_detail_dialog.js",
IDR_INTERNET_DETAIL_DIALOG_JS);
-
+#endif
content::WebUIDataSource::Add(Profile::FromWebUI(web_ui), source);
}
diff --git a/chromium/chrome/browser/ui/webui/chromeos/login/encryption_migration_screen_handler.cc b/chromium/chrome/browser/ui/webui/chromeos/login/encryption_migration_screen_handler.cc
index 55c82d30e19..07a8fc05c1f 100644
--- a/chromium/chrome/browser/ui/webui/chromeos/login/encryption_migration_screen_handler.cc
+++ b/chromium/chrome/browser/ui/webui/chromeos/login/encryption_migration_screen_handler.cc
@@ -573,8 +573,8 @@ void EncryptionMigrationScreenHandler::StartMigration() {
auth_request = CreateAuthorizationRequest();
}
DBusThreadManager::Get()->GetCryptohomeClient()->MountEx(
- cryptohome::Identification(user_context_.GetAccountId()),
- cryptohome::AuthorizationRequest(), mount,
+ cryptohome::Identification(user_context_.GetAccountId()), auth_request,
+ mount,
base::BindOnce(&EncryptionMigrationScreenHandler::OnMountExistingVault,
weak_ptr_factory_.GetWeakPtr()));
}
diff --git a/chromium/chrome/browser/ui/webui/chromeos/network_element_localized_strings_provider.cc b/chromium/chrome/browser/ui/webui/chromeos/network_element_localized_strings_provider.cc
index 6ea6ba96951..3bca92cad9a 100644
--- a/chromium/chrome/browser/ui/webui/chromeos/network_element_localized_strings_provider.cc
+++ b/chromium/chrome/browser/ui/webui/chromeos/network_element_localized_strings_provider.cc
@@ -170,6 +170,8 @@ void AddDetailsLocalizedStrings(content::WebUIDataSource* html_source) {
int id;
} localized_strings[] = {
{"loading", IDS_SETTINGS_LOADING},
+ {"hidePassword", IDS_SETTINGS_PASSWORD_HIDE},
+ {"showPassword", IDS_SETTINGS_PASSWORD_SHOW},
{"networkProxy", IDS_SETTINGS_INTERNET_NETWORK_PROXY_PROXY},
{"networkProxyAddException",
IDS_SETTINGS_INTERNET_NETWORK_PROXY_ADD_EXCEPTION},
diff --git a/chromium/chrome/browser/ui/webui/settings/browser_lifetime_handler.cc b/chromium/chrome/browser/ui/webui/settings/browser_lifetime_handler.cc
index 3c264c536a0..d8fce5d42bb 100644
--- a/chromium/chrome/browser/ui/webui/settings/browser_lifetime_handler.cc
+++ b/chromium/chrome/browser/ui/webui/settings/browser_lifetime_handler.cc
@@ -59,8 +59,10 @@ void BrowserLifetimeHandler::HandleSignOutAndRestart(
void BrowserLifetimeHandler::HandleFactoryReset(
const base::ListValue* args) {
- bool tpm_firmware_update_requested;
- args->GetBoolean(0, &tpm_firmware_update_requested);
+ const base::Value::ListStorage& args_list = args->GetList();
+ CHECK_EQ(1U, args_list.size());
+ bool tpm_firmware_update_requested = args_list[0].GetBool();
+
if (tpm_firmware_update_requested) {
chromeos::tpm_firmware_update::ShouldOfferUpdateViaPowerwash(
base::BindOnce([](bool offer_update) {
diff --git a/chromium/chrome/browser/ui/webui/settings/md_settings_localized_strings_provider.cc b/chromium/chrome/browser/ui/webui/settings/md_settings_localized_strings_provider.cc
index 61f926ee926..7d992e1fae3 100644
--- a/chromium/chrome/browser/ui/webui/settings/md_settings_localized_strings_provider.cc
+++ b/chromium/chrome/browser/ui/webui/settings/md_settings_localized_strings_provider.cc
@@ -961,6 +961,11 @@ void AddDateTimeStrings(content::WebUIDataSource* html_source) {
};
AddLocalizedStringsBulk(html_source, localized_strings,
arraysize(localized_strings));
+ html_source->AddString(
+ "timeZoneSettingsLearnMoreURL",
+ base::ASCIIToUTF16(base::StringPrintf(
+ chrome::kTimeZoneSettingsLearnMoreURL,
+ g_browser_process->GetApplicationLocale().c_str())));
}
void AddEasyUnlockStrings(content::WebUIDataSource* html_source) {
diff --git a/chromium/chrome/common/custom_handlers/OWNERS b/chromium/chrome/common/custom_handlers/OWNERS
new file mode 100644
index 00000000000..a6ac2a66c92
--- /dev/null
+++ b/chromium/chrome/common/custom_handlers/OWNERS
@@ -0,0 +1 @@
+file://chrome/browser/custom_handlers/OWNERS
diff --git a/chromium/chrome/common/custom_handlers/protocol_handler.cc b/chromium/chrome/common/custom_handlers/protocol_handler.cc
new file mode 100644
index 00000000000..32aa1998c36
--- /dev/null
+++ b/chromium/chrome/common/custom_handlers/protocol_handler.cc
@@ -0,0 +1,88 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "chrome/common/custom_handlers/protocol_handler.h"
+
+#include "base/memory/ptr_util.h"
+#include "base/strings/string_util.h"
+#include "base/strings/utf_string_conversions.h"
+#include "net/base/escape.h"
+
+
+ProtocolHandler::ProtocolHandler(const std::string& protocol,
+ const GURL& url)
+ : protocol_(protocol),
+ url_(url) {
+}
+
+ProtocolHandler ProtocolHandler::CreateProtocolHandler(
+ const std::string& protocol,
+ const GURL& url) {
+ std::string lower_protocol = base::ToLowerASCII(protocol);
+ return ProtocolHandler(lower_protocol, url);
+}
+
+ProtocolHandler::ProtocolHandler() {
+}
+
+bool ProtocolHandler::IsValidDict(const base::DictionaryValue* value) {
+ // Note that "title" parameter is ignored.
+ return value->HasKey("protocol") && value->HasKey("url");
+}
+
+bool ProtocolHandler::IsSameOrigin(
+ const ProtocolHandler& handler) const {
+ return handler.url().GetOrigin() == url_.GetOrigin();
+}
+
+const ProtocolHandler& ProtocolHandler::EmptyProtocolHandler() {
+ static const ProtocolHandler* const kEmpty = new ProtocolHandler();
+ return *kEmpty;
+}
+
+ProtocolHandler ProtocolHandler::CreateProtocolHandler(
+ const base::DictionaryValue* value) {
+ if (!IsValidDict(value)) {
+ return EmptyProtocolHandler();
+ }
+ std::string protocol, url;
+ value->GetString("protocol", &protocol);
+ value->GetString("url", &url);
+ return ProtocolHandler::CreateProtocolHandler(protocol, GURL(url));
+}
+
+GURL ProtocolHandler::TranslateUrl(const GURL& url) const {
+ std::string translatedUrlSpec(url_.spec());
+ base::ReplaceFirstSubstringAfterOffset(
+ &translatedUrlSpec, 0, "%s",
+ net::EscapeQueryParamValue(url.spec(), true));
+ return GURL(translatedUrlSpec);
+}
+
+std::unique_ptr<base::DictionaryValue> ProtocolHandler::Encode() const {
+ auto d = base::MakeUnique<base::DictionaryValue>();
+ d->SetString("protocol", protocol_);
+ d->SetString("url", url_.spec());
+ return d;
+}
+
+#if !defined(NDEBUG)
+std::string ProtocolHandler::ToString() const {
+ return "{ protocol=" + protocol_ +
+ ", url=" + url_.spec() +
+ " }";
+}
+#endif
+
+bool ProtocolHandler::operator==(const ProtocolHandler& other) const {
+ return protocol_ == other.protocol_ && url_ == other.url_;
+}
+
+bool ProtocolHandler::IsEquivalent(const ProtocolHandler& other) const {
+ return protocol_ == other.protocol_ && url_ == other.url_;
+}
+
+bool ProtocolHandler::operator<(const ProtocolHandler& other) const {
+ return url_ < other.url_;
+}
diff --git a/chromium/chrome/common/custom_handlers/protocol_handler.h b/chromium/chrome/common/custom_handlers/protocol_handler.h
new file mode 100644
index 00000000000..69c195c7c56
--- /dev/null
+++ b/chromium/chrome/common/custom_handlers/protocol_handler.h
@@ -0,0 +1,73 @@
+// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_COMMON_CUSTOM_HANDLERS_PROTOCOL_HANDLER_H_
+#define CHROME_COMMON_CUSTOM_HANDLERS_PROTOCOL_HANDLER_H_
+
+#include <memory>
+#include <string>
+
+#include "base/values.h"
+#include "url/gurl.h"
+
+// A single tuple of (protocol, url) that indicates how URLs of the
+// given protocol should be rewritten to be handled.
+
+class ProtocolHandler {
+ public:
+ static ProtocolHandler CreateProtocolHandler(const std::string& protocol,
+ const GURL& url);
+
+ // Creates a ProtocolHandler with fields from the dictionary. Returns an
+ // empty ProtocolHandler if the input is invalid.
+ static ProtocolHandler CreateProtocolHandler(
+ const base::DictionaryValue* value);
+
+ // Returns true if the dictionary value has all the necessary fields to
+ // define a ProtocolHandler.
+ static bool IsValidDict(const base::DictionaryValue* value);
+
+ // Returns true if this handler's url has the same origin as the given one.
+ bool IsSameOrigin(const ProtocolHandler& handler) const;
+
+ // Canonical empty ProtocolHandler.
+ static const ProtocolHandler& EmptyProtocolHandler();
+
+ // Interpolates the given URL into the URL template of this handler.
+ GURL TranslateUrl(const GURL& url) const;
+
+ // Returns true if the handlers are considered equivalent when determining
+ // if both handlers can be registered, or if a handler has previously been
+ // ignored.
+ bool IsEquivalent(const ProtocolHandler& other) const;
+
+ // Encodes this protocol handler as a DictionaryValue.
+ std::unique_ptr<base::DictionaryValue> Encode() const;
+
+ const std::string& protocol() const { return protocol_; }
+ const GURL& url() const { return url_;}
+
+ bool IsEmpty() const {
+ return protocol_.empty();
+ }
+
+#if !defined(NDEBUG)
+ // Returns a string representation suitable for use in debugging.
+ std::string ToString() const;
+#endif
+
+
+ bool operator==(const ProtocolHandler& other) const;
+ bool operator<(const ProtocolHandler& other) const;
+
+ private:
+ ProtocolHandler(const std::string& protocol,
+ const GURL& url);
+ ProtocolHandler();
+
+ std::string protocol_;
+ GURL url_;
+};
+
+#endif // CHROME_COMMON_CUSTOM_HANDLERS_PROTOCOL_HANDLER_H_
diff --git a/chromium/chrome/common/extensions/api/accessibility_private.json b/chromium/chrome/common/extensions/api/accessibility_private.json
index e73a88b6de2..34f0bc5bd81 100644
--- a/chromium/chrome/common/extensions/api/accessibility_private.json
+++ b/chromium/chrome/common/extensions/api/accessibility_private.json
@@ -37,6 +37,51 @@
"type": "string",
"enum": [ "click", "swipeLeft1", "swipeUp1", "swipeRight1", "swipeDown1", "swipeLeft2", "swipeUp2", "swipeRight2", "swipeDown2", "swipeLeft3", "swipeUp3", "swipeRight3", "swipeDown3", "swipeLeft4", "swipeUp4", "swipeRight4", "swipeDown4" ],
"description": "Accessibility gestures fired by the touch exploration controller."
+ },
+ {
+ "id": "SyntheticKeyboardEventType",
+ "type": "string",
+ "description": "The event to send",
+ "enum": ["keyup", "keydown"]
+ },
+ {
+ "id": "SyntheticKeyboardModifiers",
+ "type": "object",
+ "properties": {
+ "ctrl": {
+ "type": "boolean",
+ "description": "Control modifier.",
+ "optional": true
+ },
+ "alt": {
+ "type": "boolean",
+ "description": "alt modifier.",
+ "optional": true
+ },
+ "search": {
+ "type": "boolean",
+ "description": "search modifier.",
+ "optional": true
+ },
+ "shift": {
+ "type": "boolean",
+ "description": "shift modifier.",
+ "optional": true
+ }
+ }
+ },
+ {
+ "id": "SyntheticKeyboardEvent",
+ "type": "object",
+ "properties": {
+ "type": {"$ref": "SyntheticKeyboardEventType"},
+ "keyCode": {"type": "integer", "description": "Virtual key code, which is independent of the keyboard layout or modifier state."},
+ "modifiers": {
+ "$ref": "SyntheticKeyboardModifiers",
+ "optional": true,
+ "description": "Contains all active modifiers."
+ }
+ }
}
],
"functions": [
@@ -149,6 +194,19 @@
}
],
"platforms": ["chromeos"]
+ },
+ {
+ "name": "sendSyntheticKeyEvent",
+ "type": "function",
+ "description": "Sends a fabricated key event.",
+ "parameters": [
+ {
+ "name": "keyEvent",
+ "$ref": "SyntheticKeyboardEvent",
+ "description": "The event to send."
+ }
+ ],
+ "platforms": ["chromeos"]
}
],
"events": [
diff --git a/chromium/chrome/common/features.gni b/chromium/chrome/common/features.gni
index 1332126e4eb..d1e4c295995 100644
--- a/chromium/chrome/common/features.gni
+++ b/chromium/chrome/common/features.gni
@@ -60,10 +60,7 @@ declare_args() {
# Indicates if the build is using PGO.
pgo_build = chrome_pgo_phase > 0
- # Optimize parts of Chrome's UI written with web technologies (HTML/CSS/JS)
- # for runtime performance purposes. This does more work at compile time for
- # speed benefits at runtime (so we skip in debug builds).
- optimize_webui = !is_debug
+ # optimize_webui was moved to ui/base/ui_features.gni
# Enable donwloadable language PAK files to reduce the size of the main
# Chrome APK. TODO(digit): Restrict this to official builds.
diff --git a/chromium/chrome/common/url_constants.cc b/chromium/chrome/common/url_constants.cc
index 26aa58a5d7e..9b52b843125 100644
--- a/chromium/chrome/common/url_constants.cc
+++ b/chromium/chrome/common/url_constants.cc
@@ -332,4 +332,9 @@ const char kGoogleNameserversLearnMoreURL[] =
"https://developers.google.com/speed/public-dns";
#endif
+#if defined(OS_CHROMEOS)
+const char kTimeZoneSettingsLearnMoreURL[] =
+ "https://support.google.com/chromebook/answer/177871?hl=%s";
+#endif
+
} // namespace chrome
diff --git a/chromium/chrome/common/url_constants.h b/chromium/chrome/common/url_constants.h
index fd7330eed38..71f9dc89ae2 100644
--- a/chromium/chrome/common/url_constants.h
+++ b/chromium/chrome/common/url_constants.h
@@ -295,6 +295,11 @@ extern const char kEolNotificationURL[];
extern const char kGoogleNameserversLearnMoreURL[];
#endif
+#if defined(OS_CHROMEOS)
+// The URL for the "Learn more" page for the time zone settings page.
+extern const char kTimeZoneSettingsLearnMoreURL[];
+#endif
+
} // namespace chrome
#endif // CHROME_COMMON_URL_CONSTANTS_H_
diff --git a/chromium/chrome/renderer/resources/extensions/media_router_bindings.js b/chromium/chrome/renderer/resources/extensions/media_router_bindings.js
index 6d5f113eb9d..1d49718966a 100644
--- a/chromium/chrome/renderer/resources/extensions/media_router_bindings.js
+++ b/chromium/chrome/renderer/resources/extensions/media_router_bindings.js
@@ -618,6 +618,34 @@ function presentationConnectionCloseReasonToMojo_(reason) {
}
/**
+ * Converts string to Mojo origin.
+ * @param {string|!url.mojom.Origin} origin
+ * @return {!url.mojom.Origin}
+ */
+function stringToMojoOrigin_(origin) {
+ if (origin instanceof url.mojom.Origin) {
+ return origin;
+ }
+ var originUrl = new URL(origin);
+ var mojoOrigin = {};
+ mojoOrigin.scheme = originUrl.protocol.replace(':', '');
+ mojoOrigin.host = originUrl.hostname;
+ var port = originUrl.port ? Number.parseInt(originUrl.port) : 0;
+ switch (mojoOrigin.scheme) {
+ case 'http':
+ mojoOrigin.port = port || 80;
+ break;
+ case 'https':
+ mojoOrigin.port = port || 443;
+ break;
+ default:
+ throw new Error('Scheme must be http or https');
+ }
+ mojoOrigin.suborigin = '';
+ return new url.mojom.Origin(mojoOrigin);
+}
+
+/**
* Parses the given route request Error object and converts it to the
* corresponding result code.
* @param {!Error} error
@@ -782,12 +810,16 @@ MediaRouter.prototype.getKeepAlive = function() {
* updated.
* @param {!string} sourceUrn
* @param {!Array<!MediaSink>} sinks
- * @param {!Array<!url.mojom.Origin>} origins
+ * @param {!Array<string|!url.mojom.Origin>} origins
*/
MediaRouter.prototype.onSinksReceived = function(sourceUrn, sinks, origins) {
+ // |origins| is a string array if the Media Router component extension version
+ // is 59 or older. Without the stringToMojoOrigin_() conversion, clients using
+ // those extension versions would see a crash shown in
+ // https://crbug.com/787427.
this.service_.onSinksReceived(
mediaRouter.mojom.MediaRouteProvider.Id.EXTENSION, sourceUrn,
- sinks.map(sinkToMojo_), origins);
+ sinks.map(sinkToMojo_), origins.map(stringToMojoOrigin_));
};
/**
diff --git a/chromium/components/arc/video_accelerator/gpu_arc_video_decode_accelerator.cc b/chromium/components/arc/video_accelerator/gpu_arc_video_decode_accelerator.cc
index 4347194e254..3319035130c 100644
--- a/chromium/components/arc/video_accelerator/gpu_arc_video_decode_accelerator.cc
+++ b/chromium/components/arc/video_accelerator/gpu_arc_video_decode_accelerator.cc
@@ -610,7 +610,7 @@ void GpuArcVideoDecodeAccelerator::ImportBufferForPicture(
base::FileDescriptor(handle_fd.release(), true));
for (const auto& plane : planes) {
gmb_handle.native_pixmap_handle.planes.emplace_back(plane.stride,
- plane.offset, 0, 0);
+ plane.offset, 0);
}
}
diff --git a/chromium/components/autofill/content/renderer/page_passwords_analyser.cc b/chromium/components/autofill/content/renderer/page_passwords_analyser.cc
index 141d40e521c..f45a6caa4ad 100644
--- a/chromium/components/autofill/content/renderer/page_passwords_analyser.cc
+++ b/chromium/components/autofill/content/renderer/page_passwords_analyser.cc
@@ -371,8 +371,9 @@ void AnalyseForm(const FormInputCollection& form_input_collection,
} else {
// By default (if the other heuristics fail), the first text field
// preceding a password field will be considered the username field.
- for (username_field_guess = password_inputs[0] - 1;;
+ for (username_field_guess = explicit_password_inputs[0] - 1;;
--username_field_guess) {
+ DCHECK(username_field_guess < signature.size());
if (signature[username_field_guess] == kTextFieldSignature)
break;
}
diff --git a/chromium/components/data_use_measurement/core/data_use_ascriber.h b/chromium/components/data_use_measurement/core/data_use_ascriber.h
index 9d903aea015..5ead8d7d0f8 100644
--- a/chromium/components/data_use_measurement/core/data_use_ascriber.h
+++ b/chromium/components/data_use_measurement/core/data_use_ascriber.h
@@ -102,6 +102,7 @@ class DataUseAscriber {
}
// Methods called by DataUseNetworkDelegate to propagate data use information:
+ // OnBeforeUrlRequest may be called twice. e.g., in case of redirects.
virtual void OnBeforeUrlRequest(net::URLRequest* request);
virtual void OnNetworkBytesSent(net::URLRequest* request, int64_t bytes_sent);
virtual void OnNetworkBytesReceived(net::URLRequest* request,
diff --git a/chromium/components/exo/client_controlled_shell_surface.cc b/chromium/components/exo/client_controlled_shell_surface.cc
index 348a3168631..7139392ef6e 100644
--- a/chromium/components/exo/client_controlled_shell_surface.cc
+++ b/chromium/components/exo/client_controlled_shell_surface.cc
@@ -474,14 +474,15 @@ void ClientControlledShellSurface::OnSurfaceCommit() {
orientation_compositor_lock_.reset();
}
-bool ClientControlledShellSurface::IsTouchEnabled(Surface* surface) const {
- // The target for input events is selected by recursively hit-testing surfaces
- // in the surface tree. During client-driven dragging/resizing, capture is set
- // on the root surface. When capture is reset to a different target, mouse
- // events are redirected from the old to the new target, but touch/gesture
- // events are cancelled. To avoid prematurely ending the drag/resize, ensure
- // that the target and capture windows are the same by disabling touch input
- // for all but the root surface.
+bool ClientControlledShellSurface::IsInputEnabled(Surface* surface) const {
+ // Client-driven dragging/resizing relies on implicit grab, which ensures that
+ // mouse/touch events are delivered to the focused surface until release, even
+ // if they fall outside surface bounds. However, if the client destroys the
+ // surface with implicit grab, the drag/resize is prematurely ended. Prevent
+ // this by delivering all input events to the root surface, which shares the
+ // lifetime of the shell surface.
+ // TODO(domlaskowski): Remove once the client is provided with an API to hook
+ // into server-driven dragging/resizing.
return surface == root_surface();
}
@@ -670,8 +671,9 @@ void ClientControlledShellSurface::InitializeWindowState(
// Allow the client to request bounds that do not fill the entire work area
// when maximized, or the entire display when fullscreen.
window_state->set_allow_set_bounds_direct(true);
- widget_->set_movement_disabled(true);
window_state->set_ignore_keyboard_bounds_change(true);
+ if (container_ == ash::kShellWindowId_SystemModalContainer)
+ DisableMovement();
}
float ClientControlledShellSurface::GetScale() const {
diff --git a/chromium/components/exo/client_controlled_shell_surface.h b/chromium/components/exo/client_controlled_shell_surface.h
index 7c9349db058..3fda1e29f85 100644
--- a/chromium/components/exo/client_controlled_shell_surface.h
+++ b/chromium/components/exo/client_controlled_shell_surface.h
@@ -150,7 +150,7 @@ class ClientControlledShellSurface
// Overridden from SurfaceDelegate:
void OnSurfaceCommit() override;
- bool IsTouchEnabled(Surface* surface) const override;
+ bool IsInputEnabled(Surface* surface) const override;
// Overridden from views::WidgetDelegate:
bool CanMaximize() const override;
diff --git a/chromium/components/exo/client_controlled_shell_surface_unittest.cc b/chromium/components/exo/client_controlled_shell_surface_unittest.cc
index 78da5c0e8af..68ff31e7c4b 100644
--- a/chromium/components/exo/client_controlled_shell_surface_unittest.cc
+++ b/chromium/components/exo/client_controlled_shell_surface_unittest.cc
@@ -754,4 +754,51 @@ TEST_F(ClientControlledShellSurfaceTest, MouseAndTouchTarget) {
targeter->FindTargetForEvent(root, &no_touch))));
}
+// The shell surface in SystemModal container should be unresizable.
+TEST_F(ClientControlledShellSurfaceTest,
+ ShellSurfaceInSystemModalIsUnresizable) {
+ gfx::Size buffer_size(256, 256);
+ std::unique_ptr<Buffer> buffer(
+ new Buffer(exo_test_helper()->CreateGpuMemoryBuffer(buffer_size)));
+ std::unique_ptr<Surface> surface(new Surface);
+ auto shell_surface =
+ exo_test_helper()->CreateClientControlledShellSurface(surface.get(),
+ /*is_modal=*/true);
+ surface->Attach(buffer.get());
+ surface->Commit();
+
+ EXPECT_FALSE(shell_surface->GetWidget()->widget_delegate()->CanResize());
+}
+
+// The shell surface in SystemModal container should not become target
+// at the edge.
+TEST_F(ClientControlledShellSurfaceTest, ShellSurfaceInSystemModalHitTest) {
+ std::unique_ptr<Surface> surface(new Surface);
+ auto shell_surface =
+ exo_test_helper()->CreateClientControlledShellSurface(surface.get(),
+ /*is_modal=*/true);
+ shell_surface->set_client_controlled_move_resize(false);
+
+ display::Display display = display::Screen::GetScreen()->GetPrimaryDisplay();
+
+ gfx::Size desktop_size(640, 480);
+ std::unique_ptr<Buffer> desktop_buffer(
+ new Buffer(exo_test_helper()->CreateGpuMemoryBuffer(desktop_size)));
+ surface->Attach(desktop_buffer.get());
+ surface->SetInputRegion(gfx::Rect(0, 0, 0, 0));
+ shell_surface->SetGeometry(display.bounds());
+ surface->Commit();
+
+ EXPECT_FALSE(shell_surface->GetWidget()->widget_delegate()->CanResize());
+ aura::Window* window = shell_surface->GetWidget()->GetNativeWindow();
+ aura::Window* root = window->GetRootWindow();
+
+ ui::MouseEvent event(ui::ET_MOUSE_MOVED, gfx::Point(100, 0),
+ gfx::Point(100, 0), ui::EventTimeForNow(), 0, 0);
+ aura::WindowTargeter targeter;
+ aura::Window* found =
+ static_cast<aura::Window*>(targeter.FindTargetForEvent(root, &event));
+ EXPECT_FALSE(window->Contains(found));
+}
+
} // namespace exo
diff --git a/chromium/components/exo/pointer.cc b/chromium/components/exo/pointer.cc
index 5d278bbe7b9..62ccbe27047 100644
--- a/chromium/components/exo/pointer.cc
+++ b/chromium/components/exo/pointer.cc
@@ -23,6 +23,7 @@
#include "ui/events/event.h"
#include "ui/gfx/geometry/vector2d_conversions.h"
#include "ui/gfx/transform_util.h"
+#include "ui/views/widget/widget.h"
#if defined(USE_OZONE)
#include "ui/ozone/public/cursor_factory_ozone.h"
@@ -478,7 +479,22 @@ void Pointer::UpdateCursor() {
#endif
}
- cursor_client->SetCursor(cursor_);
+ // If there is a focused surface, update its widget as the views framework
+ // expect that Widget knows the current cursor. Otherwise update the
+ // cursor directly on CursorClient.
+ if (focus_surface_) {
+ aura::Window* window = focus_surface_->window();
+ do {
+ views::Widget* widget = views::Widget::GetWidgetForNativeView(window);
+ if (widget) {
+ widget->SetCursor(cursor_);
+ return;
+ }
+ window = window->parent();
+ } while (window);
+ } else {
+ cursor_client->SetCursor(cursor_);
+ }
}
} // namespace exo
diff --git a/chromium/components/exo/shell_surface.cc b/chromium/components/exo/shell_surface.cc
index 1bcfad83e97..b14d7aafd1f 100644
--- a/chromium/components/exo/shell_surface.cc
+++ b/chromium/components/exo/shell_surface.cc
@@ -140,13 +140,6 @@ void ShellSurface::SetFullscreen(bool fullscreen) {
widget_->SetFullscreen(fullscreen);
}
-void ShellSurface::DisableMovement() {
- movement_disabled_ = true;
-
- if (widget_)
- widget_->set_movement_disabled(true);
-}
-
void ShellSurface::Resize(int component) {
TRACE_EVENT1("exo", "ShellSurface::Resize", "component", component);
diff --git a/chromium/components/exo/shell_surface.h b/chromium/components/exo/shell_surface.h
index 589e27bf2f1..10e753899f0 100644
--- a/chromium/components/exo/shell_surface.h
+++ b/chromium/components/exo/shell_surface.h
@@ -43,9 +43,6 @@ class ShellSurface : public ShellSurfaceBase,
// Set fullscreen state for shell surface.
void SetFullscreen(bool fullscreen);
- // Prevents shell surface from being moved.
- void DisableMovement();
-
// Start an interactive resize of surface. |component| is one of the windows
// HT constants (see ui/base/hit_test.h) and describes in what direction the
// surface should be resized.
diff --git a/chromium/components/exo/shell_surface_base.cc b/chromium/components/exo/shell_surface_base.cc
index 3a189d58e7c..7023369b1d4 100644
--- a/chromium/components/exo/shell_surface_base.cc
+++ b/chromium/components/exo/shell_surface_base.cc
@@ -210,8 +210,10 @@ class CustomWindowTargeter : public aura::WindowTargeter {
return false;
int component = widget_->non_client_view()->NonClientHitTest(local_point);
- if (component != HTNOWHERE && component != HTCLIENT)
+ if (component != HTNOWHERE && component != HTCLIENT &&
+ component != HTBORDER) {
return true;
+ }
aura::Window::ConvertPointToTarget(window, surface->window(), &local_point);
return surface->HitTest(local_point);
@@ -567,6 +569,13 @@ void ShellSurfaceBase::SetCanMinimize(bool can_minimize) {
can_minimize_ = can_minimize;
}
+void ShellSurfaceBase::DisableMovement() {
+ movement_disabled_ = true;
+
+ if (widget_)
+ widget_->set_movement_disabled(true);
+}
+
// static
void ShellSurfaceBase::SetMainSurface(aura::Window* window, Surface* surface) {
window->SetProperty(kMainSurfaceKey, surface);
@@ -675,7 +684,7 @@ void ShellSurfaceBase::OnSurfaceCommit() {
widget_->OnSizeConstraintsChanged();
}
-bool ShellSurfaceBase::IsTouchEnabled(Surface*) const {
+bool ShellSurfaceBase::IsInputEnabled(Surface*) const {
return true;
}
diff --git a/chromium/components/exo/shell_surface_base.h b/chromium/components/exo/shell_surface_base.h
index 58d91216f18..defeb662aba 100644
--- a/chromium/components/exo/shell_surface_base.h
+++ b/chromium/components/exo/shell_surface_base.h
@@ -146,6 +146,9 @@ class ShellSurfaceBase : public SurfaceTreeHost,
void SetCanMinimize(bool can_minimize);
+ // Prevents shell surface from being moved.
+ void DisableMovement();
+
// Sets the main surface for the window.
static void SetMainSurface(aura::Window* window, Surface* surface);
@@ -158,7 +161,7 @@ class ShellSurfaceBase : public SurfaceTreeHost,
// Overridden from SurfaceDelegate:
void OnSurfaceCommit() override;
- bool IsTouchEnabled(Surface* surface) const override;
+ bool IsInputEnabled(Surface* surface) const override;
void OnSetFrame(SurfaceFrameType type) override;
void OnSetFrameColors(SkColor active_color, SkColor inactive_color) override;
void OnSetParent(Surface* parent, const gfx::Point& position) override;
diff --git a/chromium/components/exo/sub_surface.cc b/chromium/components/exo/sub_surface.cc
index 871899143c9..27592e55850 100644
--- a/chromium/components/exo/sub_surface.cc
+++ b/chromium/components/exo/sub_surface.cc
@@ -109,8 +109,8 @@ bool SubSurface::IsSurfaceSynchronized() const {
return parent_ && parent_->IsSynchronized();
}
-bool SubSurface::IsTouchEnabled(Surface* surface) const {
- return !parent_ || parent_->IsTouchEnabled(surface);
+bool SubSurface::IsInputEnabled(Surface* surface) const {
+ return !parent_ || parent_->IsInputEnabled(surface);
}
////////////////////////////////////////////////////////////////////////////////
diff --git a/chromium/components/exo/sub_surface.h b/chromium/components/exo/sub_surface.h
index e0a11185c20..acd775eac0e 100644
--- a/chromium/components/exo/sub_surface.h
+++ b/chromium/components/exo/sub_surface.h
@@ -51,7 +51,7 @@ class SubSurface : public SurfaceDelegate, public SurfaceObserver {
// Overridden from SurfaceDelegate:
void OnSurfaceCommit() override;
bool IsSurfaceSynchronized() const override;
- bool IsTouchEnabled(Surface* surface) const override;
+ bool IsInputEnabled(Surface* surface) const override;
void OnSetFrame(SurfaceFrameType type) override {}
void OnSetFrameColors(SkColor active_color, SkColor inactive_color) override {
}
diff --git a/chromium/components/exo/surface.cc b/chromium/components/exo/surface.cc
index 6b9d48ab3f4..be321c416bf 100644
--- a/chromium/components/exo/surface.cc
+++ b/chromium/components/exo/surface.cc
@@ -163,10 +163,7 @@ class CustomWindowTargeter : public aura::WindowTargeter {
bool EventLocationInsideBounds(aura::Window* window,
const ui::LocatedEvent& event) const override {
Surface* surface = Surface::AsSurface(window);
- if (!surface)
- return false;
-
- if (event.IsTouchEvent() && !surface->IsTouchEnabled(surface))
+ if (!surface || !surface->IsInputEnabled(surface))
return false;
gfx::Point local_point = event.location();
@@ -629,8 +626,8 @@ bool Surface::IsSynchronized() const {
return delegate_ && delegate_->IsSurfaceSynchronized();
}
-bool Surface::IsTouchEnabled(Surface* surface) const {
- return !delegate_ || delegate_->IsTouchEnabled(surface);
+bool Surface::IsInputEnabled(Surface* surface) const {
+ return !delegate_ || delegate_->IsInputEnabled(surface);
}
bool Surface::HasHitTestRegion() const {
diff --git a/chromium/components/exo/surface.h b/chromium/components/exo/surface.h
index 888a518a9b9..efac96f8a68 100644
--- a/chromium/components/exo/surface.h
+++ b/chromium/components/exo/surface.h
@@ -181,8 +181,8 @@ class Surface final : public ui::PropertyHandler {
// Returns true if surface is in synchronized mode.
bool IsSynchronized() const;
- // Returns true if surface should receive touch events.
- bool IsTouchEnabled(Surface* surface) const;
+ // Returns true if surface should receive input events.
+ bool IsInputEnabled(Surface* surface) const;
// Returns false if the hit test region is empty.
bool HasHitTestRegion() const;
diff --git a/chromium/components/exo/surface_delegate.h b/chromium/components/exo/surface_delegate.h
index a1895815d07..4b5ed492e2f 100644
--- a/chromium/components/exo/surface_delegate.h
+++ b/chromium/components/exo/surface_delegate.h
@@ -24,10 +24,8 @@ class SurfaceDelegate {
// double-buffered state should be synchronized with parent surface.
virtual bool IsSurfaceSynchronized() const = 0;
- // Returns true if surface should receive touch events.
- // TODO(domlaskowski): Remove once client-driven dragging/resizing is removed
- // in crbug.com/795119.
- virtual bool IsTouchEnabled(Surface* surface) const = 0;
+ // Returns true if surface should receive input events.
+ virtual bool IsInputEnabled(Surface* surface) const = 0;
// Called when surface was requested to use a specific frame type.
virtual void OnSetFrame(SurfaceFrameType type) = 0;
diff --git a/chromium/components/exo/surface_tree_host.cc b/chromium/components/exo/surface_tree_host.cc
index 23b8131f6fa..f796cf48285 100644
--- a/chromium/components/exo/surface_tree_host.cc
+++ b/chromium/components/exo/surface_tree_host.cc
@@ -152,10 +152,6 @@ void SurfaceTreeHost::GetHitTestMask(gfx::Path* mask) const {
root_surface_->GetHitTestMask(mask);
}
-gfx::NativeCursor SurfaceTreeHost::GetCursor(const gfx::Point& point) const {
- return root_surface_ ? root_surface_->GetCursor() : ui::CursorType::kNull;
-}
-
void SurfaceTreeHost::DidReceiveCompositorFrameAck() {
active_frame_callbacks_.splice(active_frame_callbacks_.end(),
frame_callbacks_);
@@ -217,7 +213,7 @@ bool SurfaceTreeHost::IsSurfaceSynchronized() const {
return false;
}
-bool SurfaceTreeHost::IsTouchEnabled(Surface*) const {
+bool SurfaceTreeHost::IsInputEnabled(Surface*) const {
return true;
}
diff --git a/chromium/components/exo/surface_tree_host.h b/chromium/components/exo/surface_tree_host.h
index 0cfff8f0dd5..51c0dad364c 100644
--- a/chromium/components/exo/surface_tree_host.h
+++ b/chromium/components/exo/surface_tree_host.h
@@ -49,10 +49,6 @@ class SurfaceTreeHost : public SurfaceDelegate,
// surface tree.
void GetHitTestMask(gfx::Path* mask) const;
- // Returns the cursor for the given position. If no cursor provider is
- // registered then CursorType::kNull is returned.
- gfx::NativeCursor GetCursor(const gfx::Point& point) const;
-
// Call this to indicate that the previous CompositorFrame is processed and
// the surface is being scheduled for a draw.
void DidReceiveCompositorFrameAck();
@@ -90,7 +86,7 @@ class SurfaceTreeHost : public SurfaceDelegate,
// Overridden from SurfaceDelegate:
void OnSurfaceCommit() override;
bool IsSurfaceSynchronized() const override;
- bool IsTouchEnabled(Surface* surface) const override;
+ bool IsInputEnabled(Surface* surface) const override;
void OnSetFrame(SurfaceFrameType type) override {}
void OnSetFrameColors(SkColor active_color, SkColor inactive_color) override {
}
diff --git a/chromium/components/exo/wayland/server.cc b/chromium/components/exo/wayland/server.cc
index c60295e8c97..d9feec46565 100644
--- a/chromium/components/exo/wayland/server.cc
+++ b/chromium/components/exo/wayland/server.cc
@@ -745,7 +745,7 @@ void linux_buffer_params_create(wl_client* client,
for (uint32_t i = 0; i < num_planes; ++i) {
auto plane_it = linux_buffer_params->planes.find(i);
LinuxBufferParams::Plane& plane = plane_it->second;
- planes.emplace_back(plane.stride, plane.offset, 0, 0);
+ planes.emplace_back(plane.stride, plane.offset, 0);
fds.push_back(std::move(plane.fd));
}
@@ -804,7 +804,7 @@ void linux_buffer_params_create_immed(wl_client* client,
for (uint32_t i = 0; i < num_planes; ++i) {
auto plane_it = linux_buffer_params->planes.find(i);
LinuxBufferParams::Plane& plane = plane_it->second;
- planes.emplace_back(plane.stride, plane.offset, 0, 0);
+ planes.emplace_back(plane.stride, plane.offset, 0);
fds.push_back(std::move(plane.fd));
}
diff --git a/chromium/components/ntp_snippets/remote/remote_suggestions_fetcher_impl.cc b/chromium/components/ntp_snippets/remote/remote_suggestions_fetcher_impl.cc
index d33d3f03224..1150c058052 100644
--- a/chromium/components/ntp_snippets/remote/remote_suggestions_fetcher_impl.cc
+++ b/chromium/components/ntp_snippets/remote/remote_suggestions_fetcher_impl.cc
@@ -15,9 +15,9 @@
#include "components/ntp_snippets/category.h"
#include "components/ntp_snippets/ntp_snippets_constants.h"
#include "components/ntp_snippets/user_classifier.h"
+#include "components/signin/core/browser/signin_manager_base.h"
#include "net/url_request/url_fetcher.h"
#include "net/url_request/url_request_status.h"
-#include "services/identity/public/cpp/identity_manager.h"
#include "services/identity/public/cpp/primary_account_access_token_fetcher.h"
using language::UrlLanguageHistogram;
@@ -124,7 +124,8 @@ void FilterCategories(FetchedCategoriesVector* categories,
} // namespace
RemoteSuggestionsFetcherImpl::RemoteSuggestionsFetcherImpl(
- identity::IdentityManager* identity_manager,
+ SigninManagerBase* signin_manager,
+ OAuth2TokenService* token_service,
scoped_refptr<URLRequestContextGetter> url_request_context_getter,
PrefService* pref_service,
UrlLanguageHistogram* language_histogram,
@@ -132,7 +133,8 @@ RemoteSuggestionsFetcherImpl::RemoteSuggestionsFetcherImpl(
const GURL& api_endpoint,
const std::string& api_key,
const UserClassifier* user_classifier)
- : identity_manager_(identity_manager),
+ : signin_manager_(signin_manager),
+ token_service_(token_service),
url_request_context_getter_(std::move(url_request_context_getter)),
language_histogram_(language_histogram),
parse_json_callback_(parse_json_callback),
@@ -177,7 +179,7 @@ void RemoteSuggestionsFetcherImpl::FetchSnippets(
.SetUrlRequestContextGetter(url_request_context_getter_)
.SetUserClassifier(*user_classifier_);
- if (identity_manager_->HasPrimaryAccount()) {
+ if (signin_manager_->IsAuthenticated()) {
// Signed-in: get OAuth token --> fetch suggestions.
pending_requests_.emplace(std::move(builder), std::move(callback));
StartTokenRequest();
@@ -209,7 +211,7 @@ void RemoteSuggestionsFetcherImpl::FetchSnippetsAuthenticated(
const std::string& oauth_access_token) {
// TODO(jkrcal, treib): Add unit-tests for authenticated fetches.
builder.SetUrl(fetch_url_)
- .SetAuthentication(identity_manager_->GetPrimaryAccountInfo().account_id,
+ .SetAuthentication(signin_manager_->GetAuthenticatedAccountId(),
base::StringPrintf(kAuthorizationRequestHeaderFormat,
oauth_access_token.c_str()));
StartRequest(std::move(builder), std::move(callback));
@@ -232,8 +234,8 @@ void RemoteSuggestionsFetcherImpl::StartTokenRequest() {
}
OAuth2TokenService::ScopeSet scopes{kContentSuggestionsApiScope};
- token_fetcher_ = identity_manager_->CreateAccessTokenFetcherForPrimaryAccount(
- "ntp_snippets", scopes,
+ token_fetcher_ = std::make_unique<identity::PrimaryAccountAccessTokenFetcher>(
+ "ntp_snippets", signin_manager_, token_service_, scopes,
base::BindOnce(&RemoteSuggestionsFetcherImpl::AccessTokenFetchFinished,
base::Unretained(this)),
identity::PrimaryAccountAccessTokenFetcher::Mode::kWaitUntilAvailable);
diff --git a/chromium/components/ntp_snippets/remote/remote_suggestions_fetcher_impl.h b/chromium/components/ntp_snippets/remote/remote_suggestions_fetcher_impl.h
index f5a33841bb3..0d95ca461e0 100644
--- a/chromium/components/ntp_snippets/remote/remote_suggestions_fetcher_impl.h
+++ b/chromium/components/ntp_snippets/remote/remote_suggestions_fetcher_impl.h
@@ -20,14 +20,15 @@
#include "components/ntp_snippets/remote/request_params.h"
#include "net/url_request/url_request_context_getter.h"
+class OAuth2TokenService;
class PrefService;
+class SigninManagerBase;
namespace base {
class Value;
} // namespace base
namespace identity {
-class IdentityManager;
class PrimaryAccountAccessTokenFetcher;
}
@@ -42,7 +43,8 @@ class UserClassifier;
class RemoteSuggestionsFetcherImpl : public RemoteSuggestionsFetcher {
public:
RemoteSuggestionsFetcherImpl(
- identity::IdentityManager* identity_manager,
+ SigninManagerBase* signin_manager,
+ OAuth2TokenService* token_service,
scoped_refptr<net::URLRequestContextGetter> url_request_context_getter,
PrefService* pref_service,
language::UrlLanguageHistogram* language_histogram,
@@ -88,7 +90,8 @@ class RemoteSuggestionsFetcherImpl : public RemoteSuggestionsFetcher {
const std::string& error_details);
// Authentication for signed-in users.
- identity::IdentityManager* identity_manager_;
+ SigninManagerBase* signin_manager_;
+ OAuth2TokenService* token_service_;
std::unique_ptr<identity::PrimaryAccountAccessTokenFetcher> token_fetcher_;
diff --git a/chromium/components/ntp_snippets/remote/remote_suggestions_fetcher_impl_unittest.cc b/chromium/components/ntp_snippets/remote/remote_suggestions_fetcher_impl_unittest.cc
index 3df8a732140..67d205ba0a5 100644
--- a/chromium/components/ntp_snippets/remote/remote_suggestions_fetcher_impl_unittest.cc
+++ b/chromium/components/ntp_snippets/remote/remote_suggestions_fetcher_impl_unittest.cc
@@ -10,7 +10,6 @@
#include "base/containers/circular_deque.h"
#include "base/json/json_reader.h"
-#include "base/message_loop/message_loop.h"
#include "base/optional.h"
#include "base/test/histogram_tester.h"
#include "base/test/test_mock_time_task_runner.h"
@@ -35,7 +34,6 @@
#include "net/traffic_annotation/network_traffic_annotation_test_helper.h"
#include "net/url_request/test_url_fetcher_factory.h"
#include "net/url_request/url_request_test_util.h"
-#include "services/identity/public/cpp/identity_manager.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -61,7 +59,7 @@ const char kTestChromeContentSuggestionsSignedOutUrl[] =
const char kTestChromeContentSuggestionsSignedInUrl[] =
"https://chromecontentsuggestions-pa.googleapis.com/v1/suggestions/fetch";
-const char kTestAccount[] = "foo@bar.com";
+const char kTestEmail[] = "foo@bar.com";
// Artificial time delay for JSON parsing.
const int64_t kTestJsonParsingLatencyMs = 20;
@@ -293,25 +291,18 @@ class RemoteSuggestionsFetcherImplTestBase
scoped_refptr<net::TestURLRequestContextGetter> request_context_getter =
new net::TestURLRequestContextGetter(mock_task_runner_.get());
- if (fake_token_service_) {
+ if (fake_token_service_)
fake_token_service_->RemoveDiagnosticsObserver(this);
- identity_manager_.reset();
- }
-
fake_token_service_ = std::make_unique<FakeProfileOAuth2TokenService>(
std::make_unique<FakeOAuth2TokenServiceDelegate>(
request_context_getter.get()));
fake_token_service_->AddDiagnosticsObserver(this);
- // TODO(blundell): Convert this test to use IdentityTestEnvironment once
- // that infrastructure lands in the codebase.
- identity_manager_ = std::make_unique<identity::IdentityManager>(
- utils_.fake_signin_manager(), fake_token_service_.get());
-
fetcher_ = std::make_unique<RemoteSuggestionsFetcherImpl>(
- identity_manager_.get(), std::move(request_context_getter),
- utils_.pref_service(), nullptr, base::BindRepeating(&ParseJsonDelayed),
+ utils_.fake_signin_manager(), fake_token_service_.get(),
+ std::move(request_context_getter), utils_.pref_service(), nullptr,
+ base::BindRepeating(&ParseJsonDelayed),
GetFetchEndpoint(version_info::Channel::STABLE), api_key,
user_classifier_.get());
@@ -320,24 +311,26 @@ class RemoteSuggestionsFetcherImplTestBase
}
void SignIn() {
- identity_manager_->SetPrimaryAccountSynchronouslyForTests(kTestAccount,
- kTestAccount, "");
+#if defined(OS_CHROMEOS)
+ utils_.fake_signin_manager()->SignIn(kTestEmail);
+#else
+ utils_.fake_signin_manager()->SignIn(kTestEmail, "user", "password");
+#endif
}
void IssueRefreshToken() {
- fake_token_service_->GetDelegate()->UpdateCredentials(kTestAccount,
- "token");
+ fake_token_service_->GetDelegate()->UpdateCredentials(kTestEmail, "token");
}
void IssueOAuth2Token() {
- fake_token_service_->IssueAllTokensForAccount(kTestAccount, "access_token",
+ fake_token_service_->IssueAllTokensForAccount(kTestEmail, "access_token",
base::Time::Max());
}
void CancelOAuth2TokenRequests() {
fake_token_service_->IssueErrorForAllPendingRequestsForAccount(
- kTestAccount, GoogleServiceAuthError(
- GoogleServiceAuthError::State::REQUEST_CANCELED));
+ kTestEmail, GoogleServiceAuthError(
+ GoogleServiceAuthError::State::REQUEST_CANCELED));
}
RemoteSuggestionsFetcher::SnippetsAvailableCallback
@@ -415,7 +408,6 @@ class RemoteSuggestionsFetcherImplTestBase
// Initialized lazily in SetFakeResponse().
std::unique_ptr<net::FakeURLFetcherFactory> fake_url_fetcher_factory_;
std::unique_ptr<FakeProfileOAuth2TokenService> fake_token_service_;
- std::unique_ptr<identity::IdentityManager> identity_manager_;
std::unique_ptr<RemoteSuggestionsFetcherImpl> fetcher_;
std::unique_ptr<UserClassifier> user_classifier_;
MockSnippetsAvailableCallback mock_callback_;
diff --git a/chromium/components/password_manager/core/browser/password_syncable_service.cc b/chromium/components/password_manager/core/browser/password_syncable_service.cc
index 4653ac0cf8b..4f959a6ba44 100644
--- a/chromium/components/password_manager/core/browser/password_syncable_service.cc
+++ b/chromium/components/password_manager/core/browser/password_syncable_service.cc
@@ -12,12 +12,8 @@
#include "base/auto_reset.h"
#include "base/location.h"
#include "base/metrics/histogram_macros.h"
-#include "base/optional.h"
-#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
-#include "base/time/default_clock.h"
#include "components/autofill/core/common/password_form.h"
-#include "components/password_manager/core/browser/android_affiliation/affiliation_utils.h"
#include "components/password_manager/core/browser/password_manager_metrics_util.h"
#include "components/password_manager/core/browser/password_store_sync.h"
#include "components/sync/model/sync_error_factory.h"
@@ -40,12 +36,20 @@ std::string MakePasswordSyncTag(const autofill::PasswordForm& password);
namespace {
// Returns true iff |password_specifics| and |password_specifics| are equal
-// in the fields which don't comprise the sync tag.
-bool AreLocalAndSyncPasswordsNonSyncTagEqual(
+// memberwise.
+bool AreLocalAndSyncPasswordsEqual(
const sync_pb::PasswordSpecificsData& password_specifics,
const autofill::PasswordForm& password_form) {
return (password_form.scheme == password_specifics.scheme() &&
+ password_form.signon_realm == password_specifics.signon_realm() &&
+ password_form.origin.spec() == password_specifics.origin() &&
password_form.action.spec() == password_specifics.action() &&
+ base::UTF16ToUTF8(password_form.username_element) ==
+ password_specifics.username_element() &&
+ base::UTF16ToUTF8(password_form.password_element) ==
+ password_specifics.password_element() &&
+ base::UTF16ToUTF8(password_form.username_value) ==
+ password_specifics.username_value() &&
base::UTF16ToUTF8(password_form.password_value) ==
password_specifics.password_value() &&
password_form.preferred == password_specifics.preferred() &&
@@ -62,38 +66,6 @@ bool AreLocalAndSyncPasswordsNonSyncTagEqual(
.Serialize() == password_form.federation_origin.Serialize());
}
-// Returns true iff |password_specifics| and |password_specifics| are equal
-// memberwise.
-bool AreLocalAndSyncPasswordsEqual(
- const sync_pb::PasswordSpecificsData& password_specifics,
- const autofill::PasswordForm& password_form) {
- return (password_form.signon_realm == password_specifics.signon_realm() &&
- password_form.origin.spec() == password_specifics.origin() &&
- base::UTF16ToUTF8(password_form.username_element) ==
- password_specifics.username_element() &&
- base::UTF16ToUTF8(password_form.password_element) ==
- password_specifics.password_element() &&
- base::UTF16ToUTF8(password_form.username_value) ==
- password_specifics.username_value() &&
- AreLocalAndSyncPasswordsNonSyncTagEqual(password_specifics,
- password_form));
-}
-
-// Compares the fields which are not part of the sync tag.
-bool AreNonSyncTagFieldsEqual(const sync_pb::PasswordSpecificsData& left,
- const sync_pb::PasswordSpecificsData& right) {
- return (left.scheme() == right.scheme() && left.action() == right.action() &&
- left.password_value() == right.password_value() &&
- left.preferred() == right.preferred() &&
- left.date_created() == right.date_created() &&
- left.blacklisted() == right.blacklisted() &&
- left.type() == right.type() &&
- left.times_used() == right.times_used() &&
- left.display_name() == right.display_name() &&
- left.avatar_url() == right.avatar_url() &&
- left.federation_url() == right.federation_url());
-}
-
syncer::SyncChange::SyncChangeType GetSyncChangeType(
PasswordStoreChange::Type type) {
switch (type) {
@@ -119,190 +91,6 @@ void AppendPasswordFromSpecifics(
entries->back()->date_synced = sync_time;
}
-// Android autofill saves credential in a different format without trailing '/'.
-std::string GetIncorrectAndroidSignonRealm(std::string android_autofill_realm) {
- if (base::EndsWith(android_autofill_realm, "/", base::CompareCase::SENSITIVE))
- android_autofill_realm.erase(android_autofill_realm.size() - 1);
- return android_autofill_realm;
-}
-
-// The correct Android signon_realm should have a trailing '/'.
-std::string GetCorrectAndroidSignonRealm(std::string android_realm) {
- if (!base::EndsWith(android_realm, "/", base::CompareCase::SENSITIVE))
- android_realm += '/';
- return android_realm;
-}
-
-// Android autofill saves credentials in a different format without trailing
-// '/'. Return a sync tag for the style used by Android Autofill in GMS Core
-// v12.
-std::string AndroidAutofillSyncTag(
- const sync_pb::PasswordSpecificsData& password) {
- // realm has the same value as the origin.
- std::string origin = GetIncorrectAndroidSignonRealm(password.origin());
- std::string signon_realm =
- GetIncorrectAndroidSignonRealm(password.signon_realm());
- return (net::EscapePath(origin) + "|" +
- net::EscapePath(password.username_element()) + "|" +
- net::EscapePath(password.username_value()) + "|" +
- net::EscapePath(password.password_element()) + "|" +
- net::EscapePath(signon_realm));
-}
-
-// Return a sync tag for the correct format used by Android.
-std::string AndroidCorrectSyncTag(
- const sync_pb::PasswordSpecificsData& password) {
- // realm has the same value as the origin.
- std::string origin = GetCorrectAndroidSignonRealm(password.origin());
- std::string signon_realm =
- GetCorrectAndroidSignonRealm(password.signon_realm());
- return (net::EscapePath(origin) + "|" +
- net::EscapePath(password.username_element()) + "|" +
- net::EscapePath(password.username_value()) + "|" +
- net::EscapePath(password.password_element()) + "|" +
- net::EscapePath(signon_realm));
-}
-
-void PasswordSpecificsFromPassword(
- const autofill::PasswordForm& password_form,
- sync_pb::PasswordSpecificsData* password_specifics) {
-#define CopyField(field) password_specifics->set_##field(password_form.field)
-#define CopyStringField(field) \
- password_specifics->set_##field(base::UTF16ToUTF8(password_form.field))
- CopyField(scheme);
- CopyField(signon_realm);
- password_specifics->set_origin(password_form.origin.spec());
- password_specifics->set_action(password_form.action.spec());
- CopyStringField(username_element);
- CopyStringField(password_element);
- CopyStringField(username_value);
- CopyStringField(password_value);
- CopyField(preferred);
- password_specifics->set_date_created(
- password_form.date_created.ToInternalValue());
- password_specifics->set_blacklisted(password_form.blacklisted_by_user);
- CopyField(type);
- CopyField(times_used);
- CopyStringField(display_name);
- password_specifics->set_avatar_url(password_form.icon_url.spec());
- password_specifics->set_federation_url(
- password_form.federation_origin.unique()
- ? std::string()
- : password_form.federation_origin.Serialize());
-#undef CopyStringField
-#undef CopyField
-}
-
-struct AndroidMergeResult {
- // New value for Android entry in the correct format.
- base::Optional<syncer::SyncData> new_android_correct;
- // New value for Android autofill entry.
- base::Optional<syncer::SyncData> new_android_incorrect;
- // New value for local entry in the correct format.
- base::Optional<autofill::PasswordForm> new_local_correct;
- // New value for local entry in the Android autofill format.
- base::Optional<autofill::PasswordForm> new_local_incorrect;
-};
-
-// Perform deduplication of Android credentials saved in the wrong format. As
-// the result all the four entries should be created and have the same value.
-AndroidMergeResult Perform4WayMergeAndroidCredentials(
- const sync_pb::PasswordSpecificsData* correct_android,
- const sync_pb::PasswordSpecificsData* incorrect_android,
- const autofill::PasswordForm* correct_local,
- const autofill::PasswordForm* incorrect_local) {
- AndroidMergeResult result;
-
- base::Optional<sync_pb::PasswordSpecificsData> local_correct_ps;
- if (correct_local) {
- local_correct_ps = sync_pb::PasswordSpecificsData();
- PasswordSpecificsFromPassword(*correct_local, &local_correct_ps.value());
- }
-
- base::Optional<sync_pb::PasswordSpecificsData> local_incorrect_ps;
- if (incorrect_local) {
- local_incorrect_ps = sync_pb::PasswordSpecificsData();
- PasswordSpecificsFromPassword(*incorrect_local,
- &local_incorrect_ps.value());
- }
-
- const sync_pb::PasswordSpecificsData* all_data[4] = {
- correct_android, incorrect_android,
- local_correct_ps ? &local_correct_ps.value() : nullptr,
- local_incorrect_ps ? &local_incorrect_ps.value() : nullptr};
-
- // |newest_data| will point to the newest entry out of all 4.
- const sync_pb::PasswordSpecificsData* newest_data = nullptr;
- for (int i = 0; i < 4; ++i) {
- if (newest_data && all_data[i]) {
- if (all_data[i]->date_created() > newest_data->date_created())
- newest_data = all_data[i];
- } else if (all_data[i]) {
- newest_data = all_data[i];
- }
- }
- DCHECK(newest_data);
-
- const std::string correct_tag = AndroidCorrectSyncTag(*newest_data);
- const std::string incorrect_tag = AndroidAutofillSyncTag(*newest_data);
- const std::string correct_signon_realm =
- GetCorrectAndroidSignonRealm(newest_data->signon_realm());
- const std::string incorrect_signon_realm =
- GetIncorrectAndroidSignonRealm(newest_data->signon_realm());
- const std::string correct_origin =
- GetCorrectAndroidSignonRealm(newest_data->origin());
- const std::string incorrect_origin =
- GetIncorrectAndroidSignonRealm(newest_data->origin());
- DCHECK_EQ(GURL(incorrect_origin).spec(), incorrect_origin);
-
- // Set the correct Sync entry if needed.
- if (newest_data != correct_android &&
- (!correct_android ||
- !AreNonSyncTagFieldsEqual(*correct_android, *newest_data))) {
- sync_pb::EntitySpecifics password_data;
- sync_pb::PasswordSpecificsData* password_specifics =
- password_data.mutable_password()->mutable_client_only_encrypted_data();
- *password_specifics = *newest_data;
- password_specifics->set_origin(correct_origin);
- password_specifics->set_signon_realm(correct_signon_realm);
- result.new_android_correct = syncer::SyncData::CreateLocalData(
- correct_tag, correct_tag, password_data);
- }
-
- // Set the Andoroid Autofill Sync entry if needed.
- if (newest_data != incorrect_android &&
- (!incorrect_android ||
- !AreNonSyncTagFieldsEqual(*incorrect_android, *newest_data))) {
- sync_pb::EntitySpecifics password_data;
- sync_pb::PasswordSpecificsData* password_specifics =
- password_data.mutable_password()->mutable_client_only_encrypted_data();
- *password_specifics = *newest_data;
- password_specifics->set_origin(incorrect_origin);
- password_specifics->set_signon_realm(incorrect_signon_realm);
- result.new_android_incorrect = syncer::SyncData::CreateLocalData(
- incorrect_tag, incorrect_tag, password_data);
- }
-
- // Set the correct local entry if needed.
- if (!local_correct_ps ||
- (newest_data != &local_correct_ps.value() &&
- !AreNonSyncTagFieldsEqual(local_correct_ps.value(), *newest_data))) {
- result.new_local_correct = PasswordFromSpecifics(*newest_data);
- result.new_local_correct.value().origin = GURL(correct_origin);
- result.new_local_correct.value().signon_realm = correct_signon_realm;
- }
-
- // Set the incorrect local entry if needed.
- if (!local_incorrect_ps ||
- (newest_data != &local_incorrect_ps.value() &&
- !AreNonSyncTagFieldsEqual(local_incorrect_ps.value(), *newest_data))) {
- result.new_local_incorrect = PasswordFromSpecifics(*newest_data);
- result.new_local_incorrect.value().origin = GURL(incorrect_origin);
- result.new_local_incorrect.value().signon_realm = incorrect_signon_realm;
- }
- return result;
-}
-
} // namespace
struct PasswordSyncableService::SyncEntries {
@@ -336,9 +124,8 @@ struct PasswordSyncableService::SyncEntries {
PasswordSyncableService::PasswordSyncableService(
PasswordStoreSync* password_store)
- : password_store_(password_store),
- clock_(new base::DefaultClock),
- is_processing_sync_changes_(false) {}
+ : password_store_(password_store), is_processing_sync_changes_(false) {
+}
PasswordSyncableService::~PasswordSyncableService() = default;
@@ -374,12 +161,17 @@ syncer::SyncMergeResult PasswordSyncableService::MergeDataAndStartSyncing(
}
merge_result.set_num_items_before_association(new_local_entries.size());
- // Changes from Sync to be applied locally.
SyncEntries sync_entries;
// Changes from password db that need to be propagated to sync.
syncer::SyncChangeList updated_db_entries;
- MergeSyncDataWithLocalData(initial_sync_data, &new_local_entries,
- &sync_entries, &updated_db_entries);
+ for (syncer::SyncDataList::const_iterator sync_iter =
+ initial_sync_data.begin();
+ sync_iter != initial_sync_data.end(); ++sync_iter) {
+ CreateOrUpdateEntry(*sync_iter,
+ &new_local_entries,
+ &sync_entries,
+ &updated_db_entries);
+ }
for (PasswordEntryMap::iterator it = new_local_entries.begin();
it != new_local_entries.end(); ++it) {
@@ -443,7 +235,7 @@ syncer::SyncError PasswordSyncableService::ProcessSyncChanges(
DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
base::AutoReset<bool> processing_changes(&is_processing_sync_changes_, true);
SyncEntries sync_entries;
- base::Time time_now = clock_->Now();
+ base::Time time_now = base::Time::Now();
for (syncer::SyncChangeList::const_iterator it = change_list.begin();
it != change_list.end(); ++it) {
@@ -456,13 +248,6 @@ syncer::SyncError PasswordSyncableService::ProcessSyncChanges(
}
AppendPasswordFromSpecifics(
specifics.password().client_only_encrypted_data(), time_now, entries);
- if (IsValidAndroidFacetURI(entries->back()->signon_realm)) {
- // Fix the Android Autofill credentials if needed.
- entries->back()->signon_realm =
- GetCorrectAndroidSignonRealm(entries->back()->signon_realm);
- entries->back()->origin =
- GURL(GetCorrectAndroidSignonRealm(entries->back()->origin.spec()));
- }
}
WriteToPasswordStore(sync_entries);
@@ -553,132 +338,21 @@ void PasswordSyncableService::WriteToPasswordStore(const SyncEntries& entries) {
password_store_->NotifyLoginsChanged(changes);
}
-void PasswordSyncableService::MergeSyncDataWithLocalData(
- const syncer::SyncDataList& sync_data,
- PasswordEntryMap* unmatched_data_from_password_db,
- SyncEntries* sync_entries,
- syncer::SyncChangeList* updated_db_entries) {
- std::map<std::string, const sync_pb::PasswordSpecificsData*> sync_data_map;
- for (const auto& data : sync_data) {
- const sync_pb::EntitySpecifics& specifics = data.GetSpecifics();
- const sync_pb::PasswordSpecificsData* password_specifics =
- &specifics.password().client_only_encrypted_data();
- sync_data_map[MakePasswordSyncTag(*password_specifics)] =
- password_specifics;
- }
- DCHECK_EQ(sync_data_map.size(), sync_data.size());
-
- for (auto it = sync_data_map.begin(); it != sync_data_map.end();) {
- if (IsValidAndroidFacetURI(it->second->signon_realm())) {
- // Perform deduplication of Android credentials saved in the wrong format.
- // For each incorrect entry, a duplicate of it is created in the correct
- // format, so Chrome can make use of it. The incorrect sync entries are
- // not deleted for now.
- std::string incorrect_tag = AndroidAutofillSyncTag(*it->second);
- std::string correct_tag = AndroidCorrectSyncTag(*it->second);
- auto it_sync_incorrect = sync_data_map.find(incorrect_tag);
- auto it_sync_correct = sync_data_map.find(correct_tag);
- auto it_local_data_correct =
- unmatched_data_from_password_db->find(correct_tag);
- auto it_local_data_incorrect =
- unmatched_data_from_password_db->find(incorrect_tag);
- if ((it != it_sync_incorrect && it != it_sync_correct) ||
- (it_sync_incorrect == sync_data_map.end() &&
- it_local_data_incorrect == unmatched_data_from_password_db->end())) {
- // The current credential is in an unexpected format or incorrect
- // credential don't exist. Just do what Sync would normally do.
- CreateOrUpdateEntry(*it->second, unmatched_data_from_password_db,
- sync_entries, updated_db_entries);
- ++it;
- } else {
- AndroidMergeResult result = Perform4WayMergeAndroidCredentials(
- it_sync_correct == sync_data_map.end() ? nullptr
- : it_sync_correct->second,
- it_sync_incorrect == sync_data_map.end()
- ? nullptr
- : it_sync_incorrect->second,
- it_local_data_correct == unmatched_data_from_password_db->end()
- ? nullptr
- : it_local_data_correct->second,
- it_local_data_incorrect == unmatched_data_from_password_db->end()
- ? nullptr
- : it_local_data_incorrect->second);
- // Add or update the correct local entry.
- if (result.new_local_correct) {
- auto* local_changes = sync_entries->EntriesForChangeType(
- it_local_data_correct == unmatched_data_from_password_db->end()
- ? syncer::SyncChange::ACTION_ADD
- : syncer::SyncChange::ACTION_UPDATE);
- local_changes->push_back(std::make_unique<autofill::PasswordForm>(
- result.new_local_correct.value()));
- local_changes->back()->date_synced = clock_->Now();
- }
- // Add or update the incorrect local entry.
- if (result.new_local_incorrect) {
- auto* local_changes = sync_entries->EntriesForChangeType(
- it_local_data_incorrect == unmatched_data_from_password_db->end()
- ? syncer::SyncChange::ACTION_ADD
- : syncer::SyncChange::ACTION_UPDATE);
- local_changes->push_back(std::make_unique<autofill::PasswordForm>(
- result.new_local_incorrect.value()));
- local_changes->back()->date_synced = clock_->Now();
- }
- if (it_local_data_correct != unmatched_data_from_password_db->end())
- unmatched_data_from_password_db->erase(it_local_data_correct);
- if (it_local_data_incorrect != unmatched_data_from_password_db->end())
- unmatched_data_from_password_db->erase(it_local_data_incorrect);
- // Add or update the correct sync entry.
- if (result.new_android_correct) {
- updated_db_entries->push_back(
- syncer::SyncChange(FROM_HERE,
- it_sync_correct == sync_data_map.end()
- ? syncer::SyncChange::ACTION_ADD
- : syncer::SyncChange::ACTION_UPDATE,
- result.new_android_correct.value()));
- }
- // Add or update the Android Autofill sync entry.
- if (result.new_android_incorrect) {
- updated_db_entries->push_back(
- syncer::SyncChange(FROM_HERE,
- it_sync_incorrect == sync_data_map.end()
- ? syncer::SyncChange::ACTION_ADD
- : syncer::SyncChange::ACTION_UPDATE,
- result.new_android_incorrect.value()));
- }
- bool increment = true;
- for (auto sync_data_it : {it_sync_incorrect, it_sync_correct}) {
- if (sync_data_it != sync_data_map.end()) {
- if (sync_data_it == it) {
- it = sync_data_map.erase(it);
- increment = false;
- } else {
- sync_data_map.erase(sync_data_it);
- }
- }
- }
- if (increment)
- ++it;
- }
- } else {
- // Not Android.
- CreateOrUpdateEntry(*it->second, unmatched_data_from_password_db,
- sync_entries, updated_db_entries);
- ++it;
- }
- }
-}
-
+// static
void PasswordSyncableService::CreateOrUpdateEntry(
- const sync_pb::PasswordSpecificsData& password_specifics,
+ const syncer::SyncData& data,
PasswordEntryMap* unmatched_data_from_password_db,
SyncEntries* sync_entries,
syncer::SyncChangeList* updated_db_entries) {
+ const sync_pb::EntitySpecifics& specifics = data.GetSpecifics();
+ const sync_pb::PasswordSpecificsData& password_specifics(
+ specifics.password().client_only_encrypted_data());
std::string tag = MakePasswordSyncTag(password_specifics);
// Check whether the data from sync is already in the password store.
PasswordEntryMap::iterator existing_local_entry_iter =
unmatched_data_from_password_db->find(tag);
- base::Time time_now = clock_->Now();
+ base::Time time_now = base::Time::Now();
if (existing_local_entry_iter == unmatched_data_from_password_db->end()) {
// The sync data is not in the password store, so we need to create it in
// the password store. Add the entry to the new_entries list.
@@ -726,7 +400,31 @@ syncer::SyncData SyncDataFromPassword(
sync_pb::EntitySpecifics password_data;
sync_pb::PasswordSpecificsData* password_specifics =
password_data.mutable_password()->mutable_client_only_encrypted_data();
- PasswordSpecificsFromPassword(password_form, password_specifics);
+#define CopyField(field) password_specifics->set_##field(password_form.field)
+#define CopyStringField(field) \
+ password_specifics->set_##field(base::UTF16ToUTF8(password_form.field))
+ CopyField(scheme);
+ CopyField(signon_realm);
+ password_specifics->set_origin(password_form.origin.spec());
+ password_specifics->set_action(password_form.action.spec());
+ CopyStringField(username_element);
+ CopyStringField(password_element);
+ CopyStringField(username_value);
+ CopyStringField(password_value);
+ CopyField(preferred);
+ password_specifics->set_date_created(
+ password_form.date_created.ToInternalValue());
+ password_specifics->set_blacklisted(password_form.blacklisted_by_user);
+ CopyField(type);
+ CopyField(times_used);
+ CopyStringField(display_name);
+ password_specifics->set_avatar_url(password_form.icon_url.spec());
+ password_specifics->set_federation_url(
+ password_form.federation_origin.unique()
+ ? std::string()
+ : password_form.federation_origin.Serialize());
+#undef CopyStringField
+#undef CopyField
std::string tag = MakePasswordSyncTag(*password_specifics);
return syncer::SyncData::CreateLocalData(tag, tag, password_data);
diff --git a/chromium/components/password_manager/core/browser/password_syncable_service.h b/chromium/components/password_manager/core/browser/password_syncable_service.h
index e2fd572c4fb..d86daac1974 100644
--- a/chromium/components/password_manager/core/browser/password_syncable_service.h
+++ b/chromium/components/password_manager/core/browser/password_syncable_service.h
@@ -11,7 +11,6 @@
#include "base/macros.h"
#include "base/sequence_checker.h"
-#include "base/time/clock.h"
#include "components/password_manager/core/browser/password_store_change.h"
#include "components/sync/model/sync_change.h"
#include "components/sync/model/sync_data.h"
@@ -61,12 +60,6 @@ class PasswordSyncableService : public syncer::SyncableService {
void InjectStartSyncFlare(
const syncer::SyncableService::StartSyncFlare& flare);
-#if defined(UNIT_TEST)
- void set_clock(std::unique_ptr<base::Clock> clock) {
- clock_ = std::move(clock);
- }
-#endif
-
private:
// Map from password sync tag to password form.
typedef std::map<std::string, autofill::PasswordForm*> PasswordEntryMap;
@@ -87,23 +80,14 @@ class PasswordSyncableService : public syncer::SyncableService {
// Uses the |PasswordStore| APIs to change entries.
void WriteToPasswordStore(const SyncEntries& entries);
- // Goes through |sync_data| and for each entry merges the data with
- // |unmatched_data_from_password_db|. The result of merge is recorded in
- // |sync_entries| or |updated_db_entries|. Successfully merged elements are
- // removed from |unmatched_data_from_password_db|.
- void MergeSyncDataWithLocalData(
- const syncer::SyncDataList& sync_data,
- PasswordEntryMap* unmatched_data_from_password_db,
- SyncEntries* sync_entries,
- syncer::SyncChangeList* updated_db_entries);
-
// Examines |data|, an entry in sync db, and updates |sync_entries| or
// |updated_db_entries| accordingly. An element is removed from
// |unmatched_data_from_password_db| if its tag is identical to |data|'s.
- void CreateOrUpdateEntry(const sync_pb::PasswordSpecificsData& data,
- PasswordEntryMap* unmatched_data_from_password_db,
- SyncEntries* sync_entries,
- syncer::SyncChangeList* updated_db_entries);
+ static void CreateOrUpdateEntry(
+ const syncer::SyncData& data,
+ PasswordEntryMap* unmatched_data_from_password_db,
+ SyncEntries* sync_entries,
+ syncer::SyncChangeList* updated_db_entries);
// Calls |operation| for each element in |entries| and appends the changes to
// |all_changes|.
@@ -125,9 +109,6 @@ class PasswordSyncableService : public syncer::SyncableService {
// A signal activated by this class to start sync as soon as possible.
syncer::SyncableService::StartSyncFlare flare_;
- // Clock for date_synced updates.
- std::unique_ptr<base::Clock> clock_;
-
// True if processing sync changes is in progress.
bool is_processing_sync_changes_;
diff --git a/chromium/components/password_manager/core/browser/password_syncable_service_unittest.cc b/chromium/components/password_manager/core/browser/password_syncable_service_unittest.cc
index 9f1975d0895..39c4499a730 100644
--- a/chromium/components/password_manager/core/browser/password_syncable_service_unittest.cc
+++ b/chromium/components/password_manager/core/browser/password_syncable_service_unittest.cc
@@ -15,9 +15,7 @@
#include "base/memory/ref_counted.h"
#include "base/strings/utf_string_conversions.h"
#include "base/test/scoped_task_environment.h"
-#include "base/test/simple_test_clock.h"
#include "components/password_manager/core/browser/mock_password_store.h"
-#include "components/password_manager/core/browser/password_manager_test_utils.h"
#include "components/sync/model/sync_change_processor.h"
#include "components/sync/model/sync_error.h"
#include "components/sync/model/sync_error_factory_mock.h"
@@ -54,8 +52,6 @@ namespace {
// PasswordForm values for tests.
constexpr autofill::PasswordForm::Type kArbitraryType =
autofill::PasswordForm::TYPE_GENERATED;
-constexpr char kAndroidAutofillRealm[] = "android://hash@com.magisto";
-constexpr char kAndroidCorrectRealm[] = "android://hash@com.magisto/";
constexpr char kIconUrl[] = "https://fb.com/Icon";
constexpr char kDisplayName[] = "Agent Smith";
constexpr char kFederationUrl[] = "https://fb.com/";
@@ -73,8 +69,8 @@ const sync_pb::PasswordSpecificsData& GetPasswordSpecifics(
return sync_data.GetSpecifics().password().client_only_encrypted_data();
}
-MATCHER_P(HasDateSynced, time, "") {
- return arg.date_synced == time;
+MATCHER(HasDateSynced, "") {
+ return !arg.date_synced.is_null() && !arg.date_synced.is_max();
}
MATCHER_P(PasswordIs, form, "") {
@@ -127,14 +123,6 @@ ACTION_P(AppendForm, form) {
return true;
}
-// The argument is std::vector<autofill::PasswordForm*>*. The caller is
-// responsible for the lifetime of all the password forms.
-ACTION_P(AppendForms, forms) {
- for (const autofill::PasswordForm& form : forms)
- arg0->push_back(std::make_unique<autofill::PasswordForm>(form));
- return true;
-}
-
// Creates a sync data consisting of password specifics. The sign on realm is
// set to |signon_realm|.
SyncData CreateSyncData(const std::string& signon_realm) {
@@ -185,14 +173,12 @@ class PasswordSyncableServiceWrapper {
password_store_->Init(syncer::SyncableService::StartSyncFlare(), nullptr);
service_.reset(
new PasswordSyncableService(password_store_->GetSyncInterface()));
- auto clock = std::make_unique<base::SimpleTestClock>();
- clock->SetNow(time());
- service_->set_clock(std::move(clock));
- ON_CALL(*password_store_, AddLoginImpl(HasDateSynced(time())))
+
+ ON_CALL(*password_store_, AddLoginImpl(HasDateSynced()))
.WillByDefault(Return(PasswordStoreChangeList()));
ON_CALL(*password_store_, RemoveLoginImpl(_))
.WillByDefault(Return(PasswordStoreChangeList()));
- ON_CALL(*password_store_, UpdateLoginImpl(HasDateSynced(time())))
+ ON_CALL(*password_store_, UpdateLoginImpl(HasDateSynced()))
.WillByDefault(Return(PasswordStoreChangeList()));
EXPECT_CALL(*password_store(), NotifyLoginsChanged(_)).Times(AnyNumber());
}
@@ -203,8 +189,6 @@ class PasswordSyncableServiceWrapper {
PasswordSyncableService* service() { return service_.get(); }
- static base::Time time() { return base::Time::FromInternalValue(100000); }
-
// Returnes the scoped_ptr to |service_| thus NULLing out it.
std::unique_ptr<syncer::SyncChangeProcessor> ReleaseSyncableService() {
return std::move(service_);
@@ -233,6 +217,7 @@ class PasswordSyncableServiceTest : public testing::Test {
std::unique_ptr<MockSyncChangeProcessor> processor_;
private:
+ // Used by the password store.
base::test::ScopedTaskEnvironment scoped_task_environment_;
PasswordSyncableServiceWrapper wrapper_;
};
@@ -677,546 +662,6 @@ TEST_F(PasswordSyncableServiceTest, SerializeNonEmptyPasswordForm) {
EXPECT_EQ("https://google.com", specifics.federation_url());
}
-// Tests for Android Autofill credentials. Those are saved in the wrong format
-// without trailing '/'. Nevertheless, password store should always contain the
-// correct values.
-class PasswordSyncableServiceAndroidAutofillTest : public testing::Test {
- public:
- PasswordSyncableServiceAndroidAutofillTest() = default;
-
- static PasswordFormData android_incorrect(double creation_time) {
- PasswordFormData data = {autofill::PasswordForm::SCHEME_HTML,
- kAndroidAutofillRealm,
- kAndroidAutofillRealm,
- "",
- L"",
- L"",
- L"",
- L"username_value_1",
- L"11111",
- true,
- creation_time};
- return data;
- }
-
- static PasswordFormData android_correct(double creation_time) {
- PasswordFormData data = {autofill::PasswordForm::SCHEME_HTML,
- kAndroidCorrectRealm,
- kAndroidCorrectRealm,
- "",
- L"",
- L"",
- L"",
- L"username_value_1",
- L"22222",
- true,
- creation_time};
- return data;
- }
-
- static PasswordFormData android_incorrect2(double creation_time) {
- PasswordFormData data = {autofill::PasswordForm::SCHEME_HTML,
- kAndroidAutofillRealm,
- kAndroidAutofillRealm,
- "",
- L"",
- L"",
- L"",
- L"username_value_1",
- L"33333",
- false,
- creation_time};
- return data;
- }
-
- static PasswordFormData android_correct2(double creation_time) {
- PasswordFormData data = {autofill::PasswordForm::SCHEME_HTML,
- kAndroidCorrectRealm,
- kAndroidCorrectRealm,
- "",
- L"",
- L"",
- L"",
- L"username_value_1",
- L"444444",
- false,
- creation_time};
- return data;
- }
-
- static autofill::PasswordForm FormWithCorrectTag(PasswordFormData data) {
- autofill::PasswordForm form = *FillPasswordFormWithData(data);
- form.signon_realm = kAndroidCorrectRealm;
- form.origin = GURL(kAndroidCorrectRealm);
- form.date_synced = PasswordSyncableServiceWrapper::time();
- return form;
- }
-
- static autofill::PasswordForm FormWithAndroidAutofillTag(
- PasswordFormData data) {
- autofill::PasswordForm form = *FillPasswordFormWithData(data);
- form.signon_realm = kAndroidAutofillRealm;
- form.origin = GURL(kAndroidAutofillRealm);
- form.date_synced = PasswordSyncableServiceWrapper::time();
- return form;
- }
-
- // Transforms |val| into |count| numbers from 1 to |count| inclusive.
- static std::vector<unsigned> ExtractTimestamps(unsigned val, unsigned count) {
- std::vector<unsigned> result;
- for (unsigned i = 0; i < count; ++i) {
- result.push_back(val % count + 1);
- val /= count;
- }
- return result;
- }
-
- static testing::Message FormDataMessage(const std::string& prefix,
- const PasswordFormData* data) {
- testing::Message message;
- message << prefix;
- if (data)
- message << *FillPasswordFormWithData(*data);
- else
- message << "NULL";
- return message;
- }
-
- protected:
- base::test::ScopedTaskEnvironment scoped_task_environment_;
-};
-
-TEST_F(PasswordSyncableServiceAndroidAutofillTest, FourWayMerge) {
- for (unsigned val = 0; val < 4 * 4 * 4 * 4; ++val) {
- // Generate 4 creation timestamps for all the entries.
- std::vector<unsigned> dates = ExtractTimestamps(val, 4);
- ASSERT_EQ(4u, dates.size());
- const unsigned latest = *std::max_element(dates.begin(), dates.end());
- // Sync correct, Sync Android autofill, local correct, local incorrect.
- const PasswordFormData data[4] = {
- android_correct(dates[0]), android_incorrect(dates[1]),
- android_correct2(dates[2]), android_incorrect2(dates[3])};
- const PasswordFormData* latest_data =
- std::find_if(data, data + 4, [latest](const PasswordFormData& data) {
- return data.creation_time == latest;
- });
- ASSERT_TRUE(latest_data);
- std::vector<autofill::PasswordForm> expected_sync_updates;
- if (latest_data != &data[0])
- expected_sync_updates.push_back(FormWithCorrectTag(*latest_data));
- if (latest_data != &data[1])
- expected_sync_updates.push_back(FormWithAndroidAutofillTag(*latest_data));
- autofill::PasswordForm local_correct = *FillPasswordFormWithData(data[2]);
- autofill::PasswordForm local_incorrect = *FillPasswordFormWithData(data[3]);
- syncer::SyncData sync_correct =
- SyncDataFromPassword(*FillPasswordFormWithData(data[0]));
- syncer::SyncData sync_incorrect =
- SyncDataFromPassword(*FillPasswordFormWithData(data[1]));
-
- SCOPED_TRACE(*FillPasswordFormWithData(data[0]));
- SCOPED_TRACE(*FillPasswordFormWithData(data[1]));
- SCOPED_TRACE(*FillPasswordFormWithData(data[2]));
- SCOPED_TRACE(*FillPasswordFormWithData(data[3]));
-
- for (bool correct_sync_first : {true, false}) {
- auto wrapper = std::make_unique<PasswordSyncableServiceWrapper>();
- auto processor =
- std::make_unique<testing::StrictMock<MockSyncChangeProcessor>>();
-
- std::vector<autofill::PasswordForm> stored_forms = {local_correct,
- local_incorrect};
- EXPECT_CALL(*wrapper->password_store(), FillAutofillableLogins(_))
- .WillOnce(AppendForms(stored_forms));
- EXPECT_CALL(*wrapper->password_store(), FillBlacklistLogins(_))
- .WillOnce(Return(true));
- if (latest_data != &data[2]) {
- EXPECT_CALL(*wrapper->password_store(),
- UpdateLoginImpl(FormWithCorrectTag(*latest_data)));
- }
- if (latest_data != &data[3]) {
- EXPECT_CALL(*wrapper->password_store(),
- UpdateLoginImpl(FormWithAndroidAutofillTag(*latest_data)));
- }
-
- if (expected_sync_updates.size() == 1) {
- EXPECT_CALL(*processor,
- ProcessSyncChanges(_, ElementsAre(SyncChangeIs(
- SyncChange::ACTION_UPDATE,
- expected_sync_updates[0]))));
- } else {
- EXPECT_CALL(
- *processor,
- ProcessSyncChanges(_, UnorderedElementsAre(
- SyncChangeIs(SyncChange::ACTION_UPDATE,
- expected_sync_updates[0]),
- SyncChangeIs(SyncChange::ACTION_UPDATE,
- expected_sync_updates[1]))));
- }
-
- SyncDataList sync_list = {sync_correct, sync_incorrect};
- if (!correct_sync_first)
- std::swap(sync_list[0], sync_list[1]);
- wrapper->service()->MergeDataAndStartSyncing(
- syncer::PASSWORDS, sync_list, std::move(processor),
- std::unique_ptr<syncer::SyncErrorFactory>());
- wrapper.reset();
- // Wait til PasswordStore is destroy end therefore all the expectations on
- // it are checked.
- scoped_task_environment_.RunUntilIdle();
- }
- }
-}
-
-TEST_F(PasswordSyncableServiceAndroidAutofillTest, ThreeWayMerge) {
- for (int j = 0; j < 4; ++j) {
- // Whether the entry exists: Sync correct, Sync Android autofill,
- // local correct, local incorrect.
- bool entry_present[4] = {true, true, true, true};
- entry_present[j] = false;
- for (unsigned val = 0; val < 3 * 3 * 3; ++val) {
- // Generate 3 creation timestamps for all the entries.
- std::vector<unsigned> dates = ExtractTimestamps(val, 3);
- ASSERT_EQ(3u, dates.size());
- const unsigned latest = *std::max_element(dates.begin(), dates.end());
-
- // Sync correct, Sync Android autofill, local correct, local incorrect.
- std::vector<std::unique_ptr<PasswordFormData>> data;
- int date_index = 0;
- data.push_back(entry_present[0]
- ? std::make_unique<PasswordFormData>(
- android_correct(dates[date_index++]))
- : nullptr);
- data.push_back(entry_present[1]
- ? std::make_unique<PasswordFormData>(
- android_incorrect(dates[date_index++]))
- : nullptr);
- data.push_back(entry_present[2]
- ? std::make_unique<PasswordFormData>(
- android_correct2(dates[date_index++]))
- : nullptr);
- data.push_back(entry_present[3]
- ? std::make_unique<PasswordFormData>(
- android_incorrect2(dates[date_index++]))
- : nullptr);
-
- SCOPED_TRACE(val);
- SCOPED_TRACE(j);
- SCOPED_TRACE(FormDataMessage("data[0]=", data[0].get()));
- SCOPED_TRACE(FormDataMessage("data[1]=", data[1].get()));
- SCOPED_TRACE(FormDataMessage("data[2]=", data[2].get()));
- SCOPED_TRACE(FormDataMessage("data[3]=", data[3].get()));
-
- const PasswordFormData* latest_data =
- std::find_if(data.begin(), data.end(),
- [latest](const std::unique_ptr<PasswordFormData>& data) {
- return data && data->creation_time == latest;
- })
- ->get();
- ASSERT_TRUE(latest_data);
- std::vector<std::pair<SyncChange::SyncChangeType, autofill::PasswordForm>>
- expected_sync_updates;
- for (int i = 0; i < 2; ++i) {
- if (latest_data != data[i].get()) {
- expected_sync_updates.push_back(std::make_pair(
- data[i] ? SyncChange::ACTION_UPDATE : SyncChange::ACTION_ADD,
- i == 0 ? FormWithCorrectTag(*latest_data)
- : FormWithAndroidAutofillTag(*latest_data)));
- }
- }
-
- std::vector<autofill::PasswordForm> stored_forms;
- for (int i = 2; i < 4; ++i) {
- if (data[i])
- stored_forms.push_back(*FillPasswordFormWithData(*data[i]));
- }
-
- SyncDataList sync_list;
- for (int i = 0; i < 2; ++i) {
- if (data[i]) {
- sync_list.push_back(
- SyncDataFromPassword(*FillPasswordFormWithData(*data[i])));
- }
- }
-
- for (bool swap_sync_list : {false, true}) {
- auto wrapper = std::make_unique<PasswordSyncableServiceWrapper>();
- auto processor =
- std::make_unique<testing::StrictMock<MockSyncChangeProcessor>>();
-
- EXPECT_CALL(*wrapper->password_store(), FillAutofillableLogins(_))
- .WillOnce(AppendForms(stored_forms));
- EXPECT_CALL(*wrapper->password_store(), FillBlacklistLogins(_))
- .WillOnce(Return(true));
- for (int i = 2; i < 4; ++i) {
- if (latest_data != data[i].get()) {
- autofill::PasswordForm latest_form =
- i == 2 ? FormWithCorrectTag(*latest_data)
- : FormWithAndroidAutofillTag(*latest_data);
- if (data[i]) {
- EXPECT_CALL(*wrapper->password_store(),
- UpdateLoginImpl(latest_form));
- } else {
- EXPECT_CALL(*wrapper->password_store(),
- AddLoginImpl(latest_form));
- }
- }
- }
-
- if (expected_sync_updates.size() == 0) {
- EXPECT_CALL(*processor, ProcessSyncChanges(_, IsEmpty()));
- } else if (expected_sync_updates.size() == 1) {
- EXPECT_CALL(
- *processor,
- ProcessSyncChanges(_, ElementsAre(SyncChangeIs(
- expected_sync_updates[0].first,
- expected_sync_updates[0].second))));
- } else if (expected_sync_updates.size() == 2) {
- EXPECT_CALL(
- *processor,
- ProcessSyncChanges(
- _, UnorderedElementsAre(
- SyncChangeIs(expected_sync_updates[0].first,
- expected_sync_updates[0].second),
- SyncChangeIs(expected_sync_updates[1].first,
- expected_sync_updates[1].second))));
- }
-
- if (swap_sync_list && sync_list.size() == 2)
- std::swap(sync_list[0], sync_list[1]);
- wrapper->service()->MergeDataAndStartSyncing(
- syncer::PASSWORDS, sync_list, std::move(processor),
- std::unique_ptr<syncer::SyncErrorFactory>());
- wrapper.reset();
- // Wait til PasswordStore is destroy end therefore all the expectations
- // on it are checked.
- scoped_task_environment_.RunUntilIdle();
- }
- }
- }
-}
-
-TEST_F(PasswordSyncableServiceAndroidAutofillTest, TwoWayServerAndLocalMerge) {
- for (unsigned i = 0; i < 2 * 2; ++i) {
- // Generate 4 different combinations for local/server entries.
- std::vector<unsigned> combination = ExtractTimestamps(i, 2);
- ASSERT_EQ(2u, combination.size());
- const bool sync_data_correct = !!combination[0];
- const bool local_data_correct = !!combination[1];
-
- for (unsigned val = 0; val < 2 * 2; ++val) {
- std::vector<unsigned> dates = ExtractTimestamps(val, 2);
- ASSERT_EQ(2u, dates.size());
-
- const PasswordFormData sync_data = sync_data_correct
- ? android_correct(dates[0])
- : android_incorrect(dates[0]);
- const PasswordFormData local_data = local_data_correct
- ? android_correct2(dates[1])
- : android_incorrect2(dates[1]);
-
- const PasswordFormData* latest_data =
- dates[1] > dates[0] ? &local_data : &sync_data;
-
- auto wrapper = std::make_unique<PasswordSyncableServiceWrapper>();
- auto processor =
- std::make_unique<testing::StrictMock<MockSyncChangeProcessor>>();
-
- EXPECT_CALL(*wrapper->password_store(), FillAutofillableLogins(_))
- .WillOnce(AppendForm(*FillPasswordFormWithData(local_data)));
- EXPECT_CALL(*wrapper->password_store(), FillBlacklistLogins(_))
- .WillOnce(Return(true));
- if (!local_data_correct || latest_data == &sync_data) {
- if (local_data_correct) {
- EXPECT_CALL(*wrapper->password_store(),
- UpdateLoginImpl(FormWithCorrectTag(*latest_data)));
- } else {
- EXPECT_CALL(*wrapper->password_store(),
- AddLoginImpl(FormWithCorrectTag(*latest_data)));
- }
- }
- if (!local_data_correct && latest_data == &sync_data) {
- EXPECT_CALL(*wrapper->password_store(),
- UpdateLoginImpl(FormWithAndroidAutofillTag(*latest_data)));
- } else if (local_data_correct && !sync_data_correct) {
- EXPECT_CALL(*wrapper->password_store(),
- AddLoginImpl(FormWithAndroidAutofillTag(*latest_data)));
- }
-
- std::vector<std::pair<SyncChange::SyncChangeType, autofill::PasswordForm>>
- expected_sync_updates;
- // Deal with the correct sync entry and incorrect one.
- if (sync_data_correct) {
- if (latest_data != &sync_data) {
- expected_sync_updates.push_back(std::make_pair(
- SyncChange::ACTION_UPDATE, FormWithCorrectTag(*latest_data)));
- }
- if (!local_data_correct) {
- expected_sync_updates.push_back(
- std::make_pair(SyncChange::ACTION_ADD,
- FormWithAndroidAutofillTag(*latest_data)));
- }
- } else {
- expected_sync_updates.push_back(std::make_pair(
- SyncChange::ACTION_ADD, FormWithCorrectTag(*latest_data)));
- if (latest_data != &sync_data) {
- expected_sync_updates.push_back(
- std::make_pair(SyncChange::ACTION_UPDATE,
- FormWithAndroidAutofillTag(*latest_data)));
- }
- }
-
- // Set expectation on |processor|.
- if (expected_sync_updates.size() == 0) {
- EXPECT_CALL(*processor, ProcessSyncChanges(_, IsEmpty()));
- } else if (expected_sync_updates.size() == 1) {
- EXPECT_CALL(
- *processor,
- ProcessSyncChanges(
- _, ElementsAre(SyncChangeIs(expected_sync_updates[0].first,
- expected_sync_updates[0].second))));
- } else if (expected_sync_updates.size() == 2) {
- EXPECT_CALL(*processor,
- ProcessSyncChanges(
- _, UnorderedElementsAre(
- SyncChangeIs(expected_sync_updates[0].first,
- expected_sync_updates[0].second),
- SyncChangeIs(expected_sync_updates[1].first,
- expected_sync_updates[1].second))));
- }
-
- SyncDataList sync_list = {
- SyncDataFromPassword(*FillPasswordFormWithData(sync_data))};
- wrapper->service()->MergeDataAndStartSyncing(
- syncer::PASSWORDS, sync_list, std::move(processor),
- std::unique_ptr<syncer::SyncErrorFactory>());
- wrapper.reset();
- // Wait til PasswordStore is destroy end therefore all the expectations on
- // it are checked.
- scoped_task_environment_.RunUntilIdle();
- }
- }
-}
-
-TEST_F(PasswordSyncableServiceAndroidAutofillTest, OneEntryOnly) {
- for (int i = 0; i < 3; ++i) {
- // The case when only local incorrect entry exists is excluded. It's very
- // exotic because a local incorrect entry can come only from the server.
- // In such a case a copy will be uploaded to the server and next
- // MergeDataAndStartSyncing will do a proper migration.
- SCOPED_TRACE(i);
- // Whether the entry exists: Sync correct, Sync Android autofill,
- // local correct, local incorrect.
- const bool entry_is_correct = i == 0 || i == 2;
- const bool entry_is_local = i >= 2;
- PasswordFormData data =
- entry_is_correct ? android_correct(100) : android_incorrect(100);
-
- auto wrapper = std::make_unique<PasswordSyncableServiceWrapper>();
- auto processor =
- std::make_unique<testing::StrictMock<MockSyncChangeProcessor>>();
-
- if (entry_is_local) {
- EXPECT_CALL(*wrapper->password_store(), FillAutofillableLogins(_))
- .WillOnce(AppendForm(*FillPasswordFormWithData(data)));
- } else {
- EXPECT_CALL(*wrapper->password_store(), FillAutofillableLogins(_))
- .WillOnce(Return(true));
- }
- EXPECT_CALL(*wrapper->password_store(), FillBlacklistLogins(_))
- .WillOnce(Return(true));
- if (!entry_is_local && !entry_is_correct) {
- EXPECT_CALL(*wrapper->password_store(),
- AddLoginImpl(FormWithAndroidAutofillTag(data)));
- }
- if (!entry_is_local) {
- EXPECT_CALL(*wrapper->password_store(),
- AddLoginImpl(FormWithCorrectTag(data)));
- }
-
- if (entry_is_correct && !entry_is_local) {
- EXPECT_CALL(*processor, ProcessSyncChanges(_, IsEmpty()));
- } else {
- EXPECT_CALL(*processor,
- ProcessSyncChanges(
- _, ElementsAre(SyncChangeIs(SyncChange::ACTION_ADD,
- FormWithCorrectTag(data)))));
- }
-
- SyncDataList sync_list;
- if (!entry_is_local) {
- sync_list.push_back(
- SyncDataFromPassword(*FillPasswordFormWithData(data)));
- }
- wrapper->service()->MergeDataAndStartSyncing(
- syncer::PASSWORDS, sync_list, std::move(processor),
- std::unique_ptr<syncer::SyncErrorFactory>());
- wrapper.reset();
- // Wait til PasswordStore is destroy end therefore all the expectations on
- // it are checked.
- scoped_task_environment_.RunUntilIdle();
- }
-}
-
-TEST_F(PasswordSyncableServiceAndroidAutofillTest, FourEqualEntries) {
- // Sync correct, Sync Android autofill, local correct, local incorrect with
- // the same content. Nothing should happen.
- const PasswordFormData data = android_correct(100);
- autofill::PasswordForm local_correct = FormWithCorrectTag(data);
- autofill::PasswordForm local_incorrect = FormWithAndroidAutofillTag(data);
- syncer::SyncData sync_correct = SyncDataFromPassword(local_correct);
- syncer::SyncData sync_incorrect = SyncDataFromPassword(local_incorrect);
-
- for (bool correct_sync_first : {true, false}) {
- auto wrapper = std::make_unique<PasswordSyncableServiceWrapper>();
- auto processor =
- std::make_unique<testing::StrictMock<MockSyncChangeProcessor>>();
-
- std::vector<autofill::PasswordForm> stored_forms = {local_correct,
- local_incorrect};
- EXPECT_CALL(*wrapper->password_store(), FillAutofillableLogins(_))
- .WillOnce(AppendForms(stored_forms));
- EXPECT_CALL(*wrapper->password_store(), FillBlacklistLogins(_))
- .WillOnce(Return(true));
- EXPECT_CALL(*processor, ProcessSyncChanges(_, IsEmpty()));
-
- SyncDataList sync_list = {sync_correct, sync_incorrect};
- if (!correct_sync_first)
- std::swap(sync_list[0], sync_list[1]);
- wrapper->service()->MergeDataAndStartSyncing(
- syncer::PASSWORDS, sync_list, std::move(processor),
- std::unique_ptr<syncer::SyncErrorFactory>());
- wrapper.reset();
- // Wait til PasswordStore is destroy end therefore all the expectations on
- // it are checked.
- scoped_task_environment_.RunUntilIdle();
- }
-}
-
-TEST_F(PasswordSyncableServiceAndroidAutofillTest, AndroidCorrectEqualEntries) {
- // Sync correct, local correct with the same content. Nothing should happen.
- const PasswordFormData data = android_correct(100);
- autofill::PasswordForm local_correct = FormWithCorrectTag(data);
- syncer::SyncData sync_correct = SyncDataFromPassword(local_correct);
-
- auto wrapper = std::make_unique<PasswordSyncableServiceWrapper>();
- auto processor =
- std::make_unique<testing::StrictMock<MockSyncChangeProcessor>>();
-
- EXPECT_CALL(*wrapper->password_store(), FillAutofillableLogins(_))
- .WillOnce(AppendForm(local_correct));
- EXPECT_CALL(*wrapper->password_store(), FillBlacklistLogins(_))
- .WillOnce(Return(true));
- EXPECT_CALL(*processor, ProcessSyncChanges(_, IsEmpty()));
-
- wrapper->service()->MergeDataAndStartSyncing(
- syncer::PASSWORDS, {sync_correct}, std::move(processor),
- std::unique_ptr<syncer::SyncErrorFactory>());
- wrapper.reset();
- // Wait til PasswordStore is destroy end therefore all the expectations on
- // it are checked.
- scoped_task_environment_.RunUntilIdle();
-}
-
} // namespace
} // namespace password_manager
diff --git a/chromium/components/safe_browsing/proto/csd.proto b/chromium/components/safe_browsing/proto/csd.proto
index 842637175ae..f84453864fa 100644
--- a/chromium/components/safe_browsing/proto/csd.proto
+++ b/chromium/components/safe_browsing/proto/csd.proto
@@ -1146,3 +1146,18 @@ message NotificationImageReportRequest {
// (even if the image URL is cross-origin). Otherwise a website could mislead
// Safe Browsing into associating phishing image bitmaps with safe image URLs.
}
+
+// Protobuf for Chrome extension webstore install request.
+message ExtensionWebStoreInstallRequest {
+ // If we can find the complete referrer chain, this field will contain URL
+ // transitions from landing referrer to event in reverse chronological
+ // order, i.e. event url comes first in this list, and landing referrer
+ // comes last.
+ // For Safe Browsing Extended Reporting or Scout users, if the referrer
+ // chain is empty or partially missing, we will add/append recent navigation
+ // events to this list. The type of these entries will be RECENT_NAVIGATION.
+ repeated ReferrerChainEntry referrer_chain = 1;
+
+ // Options and metadata about the above referrer chain.
+ optional ReferrerChainOptions referrer_chain_options = 2;
+}
diff --git a/chromium/components/strings/components_strings_mr.xtb b/chromium/components/strings/components_strings_mr.xtb
index 7d8cef25840..67145b8dfcd 100644
--- a/chromium/components/strings/components_strings_mr.xtb
+++ b/chromium/components/strings/components_strings_mr.xtb
@@ -647,7 +647,7 @@
<translation id="5719499550583120431">पà¥à¤°à¥€à¤ªà¥‡à¤¡ कारà¥à¤¡à¥‡ सà¥à¤µà¥€à¤•à¤¾à¤°à¤²à¥€ जातात.</translation>
<translation id="5720705177508910913">वरà¥à¤¤à¤®à¤¾à¤¨ वापरकरà¥à¤¤à¤¾</translation>
<translation id="5732392974455271431">आपले पालक तà¥à¤®à¤šà¥à¤¯à¤¾à¤¸à¤¾à¤ à¥€ ती अनावरोधित करू शकतात</translation>
-<translation id="5763042198335101085">वैध ईमेल पतà¥à¤¤à¤¾ à¤à¤‚टर करा</translation>
+<translation id="5763042198335101085">वैध ईमेल अॅडà¥à¤°à¥‡à¤¸ à¤à¤‚टर करा</translation>
<translation id="5765072501007116331">वितरण पदà¥à¤§à¤¤à¥€ आणि आवशà¥à¤¯à¤•à¤¤à¤¾ पाहणà¥à¤¯à¤¾à¤¸à¤¾à¤ à¥€, à¤à¤• पतà¥à¤¤à¤¾ निवडा</translation>
<translation id="5770114862687765385">फाइल करपà¥à¤Ÿ आहे असे दिसते. सेशन रीसेट करणà¥à¤¯à¤¾à¤¸à¤¾à¤ à¥€ 'रीसेट करा' बटणावर कà¥à¤²à¤¿à¤• करा.</translation>
<translation id="5778550464785688721">MIDI डिवà¥à¤¹à¤¾à¤‡à¤¸à¥‡à¤¸ पूरà¥à¤£ नियंतà¥à¤°à¤£</translation>
diff --git a/chromium/components/strings/components_strings_no.xtb b/chromium/components/strings/components_strings_no.xtb
index 3e8755086b2..df9d93ba04b 100644
--- a/chromium/components/strings/components_strings_no.xtb
+++ b/chromium/components/strings/components_strings_no.xtb
@@ -259,6 +259,7 @@
<translation id="2835170189407361413">Slett skjemaet</translation>
<translation id="2851634818064021665">Du trenger tillatelse for å besøke dette nettstedet</translation>
<translation id="2856444702002559011">Det kan hende at angripere prøver å stjele informasjonen din fra <ph name="BEGIN_BOLD" /><ph name="SITE" /><ph name="END_BOLD" /> (for eksempel passord, meldinger og kredittkortinformasjon). <ph name="BEGIN_LEARN_MORE_LINK" />Finn ut mer<ph name="END_LEARN_MORE_LINK" /></translation>
+<translation id="2881276955470682203">Vil du lagre kortet?</translation>
<translation id="2909946352844186028">En nettverksendring ble oppdaget.</translation>
<translation id="2916038427272391327">Lukk andre programmer</translation>
<translation id="2922350208395188000">Tjenerens sertifikat kan ikke kontrolleres.</translation>
@@ -1073,4 +1074,5 @@
&lt;li&gt;Prøv å avinstallere eller slå av «<ph name="SOFTWARE_NAME" />»&lt;/li&gt;
&lt;li&gt;Prøv å koble til et annet nettverk&lt;/li&gt;
&lt;/ul&gt;</translation>
+<translation id="997986563973421916">Fra Google Pay</translation>
</translationbundle> \ No newline at end of file
diff --git a/chromium/components/viz/service/display/gl_renderer.cc b/chromium/components/viz/service/display/gl_renderer.cc
index 66a93a56b75..345f72d6684 100644
--- a/chromium/components/viz/service/display/gl_renderer.cc
+++ b/chromium/components/viz/service/display/gl_renderer.cc
@@ -2128,7 +2128,7 @@ void GLRenderer::DrawContentQuadNoAA(const ContentDrawQuadBase* quad,
// clamping to tex_coord_rect in all cases would cause these border
// texels to not be sampled. Therefore, only clamp texture coordinates
// for external edge bottom/right tiles that don't have content all
- // the way to the edge.
+ // the way to the edge and are using bilinear filtering.
gfx::Size texture_size = quad->texture_size;
bool fills_right_edge =
quad->shared_quad_state->quad_layer_rect.right() != quad->rect.right() ||
@@ -2137,7 +2137,7 @@ void GLRenderer::DrawContentQuadNoAA(const ContentDrawQuadBase* quad,
quad->rect.bottom() ||
texture_size.height() == tex_coord_rect.bottom();
bool has_tex_clamp_rect =
- (!fills_right_edge || !fills_bottom_edge) && !quad->nearest_neighbor;
+ filter == GL_LINEAR && (!fills_right_edge || !fills_bottom_edge);
gfx::SizeF tex_clamp_size(texture_size);
// Clamp from the original tex coord rect, instead of the one that has
// been adjusted by the visible rect.
diff --git a/chromium/content/app/strings/translations/content_strings_mr.xtb b/chromium/content/app/strings/translations/content_strings_mr.xtb
index f10edbd26fa..44b3db8d98c 100644
--- a/chromium/content/app/strings/translations/content_strings_mr.xtb
+++ b/chromium/content/app/strings/translations/content_strings_mr.xtb
@@ -5,7 +5,7 @@
<translation id="1020833440720551630">ऑडिओ टà¥à¤°à¥…क निःशबà¥à¤¦ करा</translation>
<translation id="10623998915015855">टॉगल बटण</translation>
<translation id="1088086359088493902">सेकंद</translation>
-<translation id="1171774979989969504">कृपया à¤à¤• ईमेल पतà¥à¤¤à¤¾ à¤à¤‚टर करा.</translation>
+<translation id="1171774979989969504">कृपया à¤à¤• ईमेल अॅडà¥à¤°à¥‡à¤¸ à¤à¤‚टर करा.</translation>
<translation id="1178581264944972037">विराम दà¥à¤¯à¤¾</translation>
<translation id="1188858454923323853">पूरक</translation>
<translation id="1206619573307042055">marquee</translation>
@@ -16,7 +16,7 @@
<translation id="1589122976691792535">पà¥à¤°à¤¦à¥‡à¤¶</translation>
<translation id="1591562245178063882">या महिनà¥à¤¯à¤¾à¤¤</translation>
<translation id="1637811476055996098">फायली निवडा</translation>
-<translation id="1729654308190250600">कृपया à¤à¤• रिकà¥à¤¤-नसलेला ईमेल पतà¥à¤¤à¤¾ à¤à¤‚टर करा.</translation>
+<translation id="1729654308190250600">कृपया à¤à¤• रिकà¥à¤¤-नसलेला ईमेल अॅडà¥à¤°à¥‡à¤¸ à¤à¤‚टर करा.</translation>
<translation id="1758486001363313524">अनà¥à¤¯...</translation>
<translation id="1806710327868736751">सूचना_संवाद</translation>
<translation id="1821985195704844674">टà¥à¤°à¥€ गà¥à¤°à¥€à¤¡</translation>
diff --git a/chromium/content/app/strings/translations/content_strings_no.xtb b/chromium/content/app/strings/translations/content_strings_no.xtb
index 8358c295e1b..00be9d82627 100644
--- a/chromium/content/app/strings/translations/content_strings_no.xtb
+++ b/chromium/content/app/strings/translations/content_strings_no.xtb
@@ -25,6 +25,7 @@
<translation id="1921819250265091946">dd</translation>
<translation id="1930711995431081526">status</translation>
<translation id="1938124657309484470">Verdien må være <ph name="MAXIMUM_DATE_OR_TIME" /> eller før.</translation>
+<translation id="1993104285338243655">Byttet til speiling</translation>
<translation id="2060505056492490888">«<ph name="DOT" />» er brukt på feil sted i «<ph name="INVALIDDOMAIN" />».</translation>
<translation id="2148716181193084225">I dag</translation>
<translation id="2226276347425096477">Forkort denne teksten til <ph name="MAX_CHARACTERS" /> tegn eller færre (for øyeblikket bruker du <ph name="CURRENT_LENGTH" /> tegn).</translation>
@@ -128,6 +129,7 @@
<translation id="6643016212128521049">Tøm</translation>
<translation id="668171684555832681">Annen</translation>
<translation id="6692633176391053278">stepper</translation>
+<translation id="6709570249143506788">DÃ¥rlig avspillingskvalitet</translation>
<translation id="6755330956360078551">verktøytips</translation>
<translation id="6790428901817661496">Spill av</translation>
<translation id="6820355525329141109">Kunne ikke laste inn programtillegget.</translation>
@@ -176,6 +178,7 @@
<translation id="8785498733064193001">start avspillingen</translation>
<translation id="8845239796550121995">Caster til TV-en nå</translation>
<translation id="8851136666856101339">main</translation>
+<translation id="8875657656876809964">Feil ved videoavspilling</translation>
<translation id="8901569739625249689"><ph name="QUANTITY" /> kB</translation>
<translation id="8987927404178983737">MÃ¥ned</translation>
<translation id="901493112792887934">gjeldende tid i sekunder</translation>
diff --git a/chromium/content/browser/accessibility/fullscreen_browsertest.cc b/chromium/content/browser/accessibility/fullscreen_browsertest.cc
index a93f137234f..482fb96fefe 100644
--- a/chromium/content/browser/accessibility/fullscreen_browsertest.cc
+++ b/chromium/content/browser/accessibility/fullscreen_browsertest.cc
@@ -105,4 +105,38 @@ IN_PROC_BROWSER_TEST_F(AccessibilityFullscreenBrowserTest,
EXPECT_EQ(1, CountLinks(manager->GetRoot()));
}
+IN_PROC_BROWSER_TEST_F(AccessibilityFullscreenBrowserTest, InsideIFrame) {
+ ASSERT_TRUE(embedded_test_server()->Start());
+
+ FakeFullscreenDelegate delegate;
+ shell()->web_contents()->SetDelegate(&delegate);
+
+ AccessibilityNotificationWaiter waiter(
+ shell()->web_contents(), ui::kAXModeComplete, ui::AX_EVENT_LOAD_COMPLETE);
+ GURL url(
+ embedded_test_server()->GetURL("/accessibility/fullscreen/iframe.html"));
+ NavigateToURL(shell(), url);
+ waiter.WaitForNotification();
+
+ WebContentsImpl* web_contents =
+ static_cast<WebContentsImpl*>(shell()->web_contents());
+ BrowserAccessibilityManager* manager =
+ web_contents->GetRootBrowserAccessibilityManager();
+
+ // Initially there's just one link, in the top frame.
+ EXPECT_EQ(1, CountLinks(manager->GetRoot()));
+
+ // Enter fullscreen by finding the button and performing the default action,
+ // which is to click it.
+ BrowserAccessibility* button = FindButton(manager->GetRoot());
+ ASSERT_NE(nullptr, button);
+ manager->DoDefaultAction(*button);
+
+ // After entering fullscreen, the page will add an iframe with a link inside
+ // in the inert part of the page, then exit fullscreen and change the button
+ // text to "Done". Then the link inside the iframe should also be exposed.
+ WaitForAccessibilityTreeToContainNodeWithName(web_contents, "Done");
+ EXPECT_EQ(2, CountLinks(manager->GetRoot()));
+}
+
} // namespace content
diff --git a/chromium/content/browser/blob_storage/blob_dispatcher_host.cc b/chromium/content/browser/blob_storage/blob_dispatcher_host.cc
index 94c53be5caa..31e36c9f600 100644
--- a/chromium/content/browser/blob_storage/blob_dispatcher_host.cc
+++ b/chromium/content/browser/blob_storage/blob_dispatcher_host.cc
@@ -89,6 +89,25 @@ void BlobDispatcherHost::OnRegisterPublicBlobURL(const GURL& public_url,
public_blob_urls_.insert(public_url);
}
+namespace {
+
+void RevokePublicBlobURLHelperIO(
+ scoped_refptr<ChromeBlobStorageContext> context,
+ const GURL& public_url) {
+ context->context()->RevokePublicBlobURL(public_url);
+}
+
+void RevokePublicBlobURLHelperUI(
+ scoped_refptr<ChromeBlobStorageContext> context,
+ const GURL& public_url) {
+ DCHECK_CURRENTLY_ON(BrowserThread::UI);
+ BrowserThread::PostTask(BrowserThread::IO, FROM_HERE,
+ base::BindOnce(&RevokePublicBlobURLHelperIO,
+ std::move(context), public_url));
+}
+
+} // namespace
+
void BlobDispatcherHost::OnRevokePublicBlobURL(const GURL& public_url) {
DCHECK_CURRENTLY_ON(BrowserThread::IO);
if (!public_url.is_valid()) {
@@ -103,8 +122,10 @@ void BlobDispatcherHost::OnRevokePublicBlobURL(const GURL& public_url) {
BDH_TRACING_ENUM_LAST);
return;
}
- context()->RevokePublicBlobURL(public_url);
public_blob_urls_.erase(public_url);
+ BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
+ base::BindOnce(&RevokePublicBlobURLHelperUI,
+ blob_storage_context_, public_url));
}
storage::BlobStorageContext* BlobDispatcherHost::context() {
diff --git a/chromium/content/browser/blob_storage/blob_storage_browsertest.cc b/chromium/content/browser/blob_storage/blob_storage_browsertest.cc
index 7bb729493e7..98d6c74f122 100644
--- a/chromium/content/browser/blob_storage/blob_storage_browsertest.cc
+++ b/chromium/content/browser/blob_storage/blob_storage_browsertest.cc
@@ -3,13 +3,12 @@
// found in the LICENSE file.
#include "base/run_loop.h"
-#include "base/test/scoped_feature_list.h"
+#include "base/test/bind_test_util.h"
#include "base/threading/sequenced_worker_pool.h"
#include "content/browser/blob_storage/chrome_blob_storage_context.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/web_contents.h"
-#include "content/public/common/content_features.h"
#include "content/public/test/browser_test_utils.h"
#include "content/public/test/content_browser_test.h"
#include "content/public/test/content_browser_test_utils.h"
@@ -28,6 +27,7 @@ const size_t kTestBlobStorageMaxBlobMemorySize = 200;
const uint64_t kTestBlobStorageMaxDiskSpace = 3000;
const uint64_t kTestBlobStorageMinFileSizeBytes = 20;
const uint64_t kTestBlobStorageMaxFileSizeBytes = 50;
+
} // namespace
// This browser test is aimed towards exercising the blob storage transportation
@@ -44,17 +44,26 @@ class BlobStorageBrowserTest : public ContentBrowserTest {
limits_.max_file_size = kTestBlobStorageMaxFileSizeBytes;
}
- void SetBlobLimits() {
- GetMemoryController()->set_limits_for_testing(limits_);
+ scoped_refptr<ChromeBlobStorageContext> GetBlobContext() {
+ return ChromeBlobStorageContext::GetFor(
+ shell()->web_contents()->GetBrowserContext());
+ }
+
+ void SetBlobLimitsOnIO(scoped_refptr<ChromeBlobStorageContext> context,
+ const storage::BlobStorageLimits& limits) {
+ DCHECK_CURRENTLY_ON(BrowserThread::IO);
+ CHECK(context);
+ CHECK(context->context());
+ context->context()->mutable_memory_controller()->set_limits_for_testing(
+ limits);
}
- storage::BlobMemoryController* GetMemoryController() {
- content::ChromeBlobStorageContext* blob_context =
- ChromeBlobStorageContext::GetFor(
- shell()->web_contents()->GetBrowserContext());
- if (!blob_context->context())
- return nullptr;
- return blob_context->context()->mutable_memory_controller();
+ void SetBlobLimits() {
+ BrowserThread::PostTask(
+ BrowserThread::IO, FROM_HERE,
+ base::BindOnce(&BlobStorageBrowserTest::SetBlobLimitsOnIO,
+ base::Unretained(this), GetBlobContext(),
+ base::ConstRef(limits_)));
}
void SimpleTest(const GURL& test_url, bool incognito = false) {
@@ -87,17 +96,28 @@ class BlobStorageBrowserTest : public ContentBrowserTest {
IN_PROC_BROWSER_TEST_F(BlobStorageBrowserTest, BlobCombinations) {
SetBlobLimits();
SimpleTest(GetTestUrl("blob_storage", "blob_creation_and_slicing.html"));
- storage::BlobMemoryController* memory_controller = GetMemoryController();
- ASSERT_TRUE(memory_controller);
- // Our exact usages depend on IPC message ordering & garbage collection.
- // Since this is basically random, we just check bounds.
- EXPECT_LT(0u, memory_controller->memory_usage());
- EXPECT_LT(0ul, memory_controller->disk_usage());
- EXPECT_GT(memory_controller->disk_usage(),
- static_cast<uint64_t>(memory_controller->memory_usage()));
- EXPECT_GT(limits_.max_blob_in_memory_space,
- memory_controller->memory_usage());
- EXPECT_GT(limits_.effective_max_disk_space, memory_controller->disk_usage());
+
+ auto blob_context = GetBlobContext();
+ base::RunLoop loop;
+ BrowserThread::PostTask(
+ BrowserThread::IO, FROM_HERE, base::BindLambdaForTesting([&]() {
+ const storage::BlobMemoryController& memory_controller =
+ blob_context->context()->memory_controller();
+ // Our exact usages depend on IPC message ordering & garbage collection.
+ // Since this is basically random, we just check bounds.
+ EXPECT_LT(0u, memory_controller.memory_usage());
+ EXPECT_LT(0ul, memory_controller.disk_usage());
+ EXPECT_GT(memory_controller.disk_usage(),
+ static_cast<uint64_t>(memory_controller.memory_usage()));
+ EXPECT_GT(limits_.max_blob_in_memory_space,
+ memory_controller.memory_usage());
+ EXPECT_GT(limits_.effective_max_disk_space,
+ memory_controller.disk_usage());
+
+ loop.Quit();
+ }));
+ loop.Run();
+
shell()->Close();
// Make sure we run all file / io tasks.
diff --git a/chromium/content/browser/browser_side_navigation_browsertest.cc b/chromium/content/browser/browser_side_navigation_browsertest.cc
index 8dc7b809fcb..f92e852215a 100644
--- a/chromium/content/browser/browser_side_navigation_browsertest.cc
+++ b/chromium/content/browser/browser_side_navigation_browsertest.cc
@@ -799,4 +799,53 @@ IN_PROC_BROWSER_TEST_F(BrowserSideNavigationBrowserTest,
EXPECT_EQ("#foo", reference_fragment);
}
+// Regression test for https://crbug.com/796561.
+// 1) Start on a document with history.length == 1.
+// 2) Create an iframe and call history.pushState at the same time.
+// 3) history.back() must work.
+IN_PROC_BROWSER_TEST_F(BrowserSideNavigationBrowserTest,
+ IframeAndPushStateSimultaneously) {
+ GURL main_url = embedded_test_server()->GetURL("/simple_page.html");
+ GURL iframe_url = embedded_test_server()->GetURL("/hello.html");
+
+ // 1) Start on a new document such that history.length == 1.
+ {
+ EXPECT_TRUE(NavigateToURL(shell(), main_url));
+
+ int history_length;
+ EXPECT_TRUE(ExecuteScriptAndExtractInt(
+ shell(), "window.domAutomationController.send(history.length)",
+ &history_length));
+ EXPECT_EQ(1, history_length);
+ }
+
+ // 2) Create an iframe and call history.pushState at the same time.
+ {
+ TestNavigationManager iframe_navigation(shell()->web_contents(),
+ iframe_url);
+ ExecuteScriptAsync(shell(),
+ "let iframe = document.createElement('iframe');"
+ "iframe.src = '/hello.html';"
+ "document.body.appendChild(iframe);");
+ EXPECT_TRUE(iframe_navigation.WaitForRequestStart());
+
+ // The iframe navigation is paused. In the meantime, a pushState navigation
+ // begins and ends.
+ TestNavigationManager push_state_navigation(shell()->web_contents(),
+ main_url);
+ ExecuteScriptAsync(shell(), "window.history.pushState({}, null);");
+ push_state_navigation.WaitForNavigationFinished();
+
+ // The iframe navigation is resumed.
+ iframe_navigation.WaitForNavigationFinished();
+ }
+
+ // 3) history.back() must work.
+ {
+ TestNavigationObserver navigation_observer(shell()->web_contents());
+ EXPECT_TRUE(ExecuteScript(shell()->web_contents(), "history.back();"));
+ navigation_observer.Wait();
+ }
+}
+
} // namespace content
diff --git a/chromium/content/browser/device_sensors/device_sensor_browsertest.cc b/chromium/content/browser/device_sensors/device_sensor_browsertest.cc
index bb4b9cc1d4c..9e1a2bc0504 100644
--- a/chromium/content/browser/device_sensors/device_sensor_browsertest.cc
+++ b/chromium/content/browser/device_sensors/device_sensor_browsertest.cc
@@ -48,6 +48,15 @@ class FakeSensor : public device::mojom::Sensor {
shared_buffer_handle_ = mojo::SharedBufferHandle::Create(
sizeof(device::SensorReadingSharedBuffer) *
static_cast<uint64_t>(device::mojom::SensorType::LAST));
+
+ if (!shared_buffer_handle_.is_valid())
+ return;
+
+ // Create read/write mapping now, to ensure it is kept writable
+ // after the region is sealed read-only on Android.
+ shared_buffer_mapping_ = shared_buffer_handle_->MapAtOffset(
+ device::mojom::SensorInitParams::kReadBufferSizeForTests,
+ GetBufferOffset());
}
~FakeSensor() override = default;
@@ -104,16 +113,13 @@ class FakeSensor : public device::mojom::Sensor {
void set_reading(device::SensorReading reading) { reading_ = reading; }
void SensorReadingChanged() {
- if (!shared_buffer_handle_.is_valid())
+ if (!shared_buffer_mapping_.get())
return;
- mojo::ScopedSharedBufferMapping shared_buffer =
- shared_buffer_handle_->MapAtOffset(
- device::mojom::SensorInitParams::kReadBufferSizeForTests,
- GetBufferOffset());
-
device::SensorReadingSharedBuffer* buffer =
- static_cast<device::SensorReadingSharedBuffer*>(shared_buffer.get());
+ static_cast<device::SensorReadingSharedBuffer*>(
+ shared_buffer_mapping_.get());
+
auto& seqlock = buffer->seqlock.value();
seqlock.WriteBegin();
buffer->reading = reading_;
@@ -127,6 +133,7 @@ class FakeSensor : public device::mojom::Sensor {
device::mojom::SensorType sensor_type_;
bool reading_notification_enabled_ = true;
mojo::ScopedSharedBufferHandle shared_buffer_handle_;
+ mojo::ScopedSharedBufferMapping shared_buffer_mapping_;
device::mojom::SensorClientPtr client_;
device::SensorReading reading_;
diff --git a/chromium/content/browser/frame_host/cross_process_frame_connector.cc b/chromium/content/browser/frame_host/cross_process_frame_connector.cc
index 26e705e7dc9..ecd9dd9e3d3 100644
--- a/chromium/content/browser/frame_host/cross_process_frame_connector.cc
+++ b/chromium/content/browser/frame_host/cross_process_frame_connector.cc
@@ -8,7 +8,6 @@
#include "components/viz/service/frame_sinks/frame_sink_manager_impl.h"
#include "components/viz/service/surfaces/surface.h"
#include "components/viz/service/surfaces/surface_hittest.h"
-#include "content/browser/bad_message.h"
#include "content/browser/compositor/surface_utils.h"
#include "content/browser/frame_host/frame_tree.h"
#include "content/browser/frame_host/frame_tree_node.h"
@@ -34,7 +33,6 @@ CrossProcessFrameConnector::CrossProcessFrameConnector(
RenderFrameProxyHost* frame_proxy_in_parent_renderer)
: FrameConnectorDelegate(IsUseZoomForDSFEnabled()),
frame_proxy_in_parent_renderer_(frame_proxy_in_parent_renderer),
- view_(nullptr),
is_scroll_bubbling_(false) {}
CrossProcessFrameConnector::~CrossProcessFrameConnector() {
@@ -85,7 +83,7 @@ void CrossProcessFrameConnector::SetView(RenderWidgetHostViewChildFrame* view) {
view_->SetFrameConnectorDelegate(nullptr);
}
- ResetFrameRect();
+ ResetScreenSpaceRect();
view_ = view;
// Attach ourselves to the new view and size it appropriately. Also update
@@ -213,7 +211,8 @@ void CrossProcessFrameConnector::BubbleScrollEvent(
auto* event_router =
parent_view->GetRenderWidgetHostImpl()->delegate()->GetInputEventRouter();
- gfx::Vector2d offset_from_parent = frame_rect_in_dip_.OffsetFromOrigin();
+ gfx::Vector2d offset_from_parent =
+ screen_space_rect_in_dip_.OffsetFromOrigin();
blink::WebGestureEvent resent_gesture_event(event);
// TODO(kenrb, wjmaclean): Do we need to account for transforms here?
// See https://crbug.com/626020.
@@ -271,13 +270,14 @@ void CrossProcessFrameConnector::UnlockMouse() {
}
void CrossProcessFrameConnector::OnUpdateResizeParams(
- const gfx::Rect& frame_rect,
+ const gfx::Rect& screen_space_rect,
+ const gfx::Size& local_frame_size,
const ScreenInfo& screen_info,
uint64_t sequence_number,
const viz::SurfaceId& surface_id) {
- // If the |frame_rect| or |screen_info| of the frame has changed, then the
- // viz::LocalSurfaceId must also change.
- if ((last_received_frame_rect_.size() != frame_rect.size() ||
+ // If the |screen_space_rect| or |screen_info| of the frame has changed, then
+ // the viz::LocalSurfaceId must also change.
+ if ((last_received_local_frame_size_ != local_frame_size ||
screen_info_ != screen_info) &&
local_surface_id_ == surface_id.local_surface_id()) {
bad_message::ReceivedBadMessage(
@@ -286,26 +286,9 @@ void CrossProcessFrameConnector::OnUpdateResizeParams(
return;
}
- screen_info_ = screen_info;
- last_received_frame_rect_ = frame_rect;
- local_surface_id_ = surface_id.local_surface_id();
- SetRect(frame_rect);
-
- if (!view_)
- return;
-#if defined(USE_AURA)
- view_->SetFrameSinkId(surface_id.frame_sink_id());
-#endif // defined(USE_AURA)
-
- RenderWidgetHostImpl* render_widget_host = view_->GetRenderWidgetHostImpl();
- DCHECK(render_widget_host);
-
- if (render_widget_host->auto_resize_enabled()) {
- render_widget_host->DidAllocateLocalSurfaceIdForAutoResize(sequence_number);
- return;
- }
-
- render_widget_host->WasResized();
+ last_received_local_frame_size_ = local_frame_size;
+ UpdateResizeParams(screen_space_rect, local_frame_size, screen_info,
+ sequence_number, surface_id);
}
void CrossProcessFrameConnector::OnUpdateViewportIntersection(
@@ -426,21 +409,21 @@ void CrossProcessFrameConnector::SetVisibilityForChildViews(
->SetVisibilityForChildViews(visible);
}
-void CrossProcessFrameConnector::SetRect(
- const gfx::Rect& frame_rect_in_pixels) {
- gfx::Rect old_rect = frame_rect_in_pixels_;
- FrameConnectorDelegate::SetRect(frame_rect_in_pixels);
+void CrossProcessFrameConnector::SetScreenSpaceRect(
+ const gfx::Rect& screen_space_rect) {
+ gfx::Rect old_rect = screen_space_rect;
+ FrameConnectorDelegate::SetScreenSpaceRect(screen_space_rect);
if (view_) {
- view_->SetBounds(frame_rect_in_dip_);
+ view_->SetBounds(screen_space_rect_in_dip_);
// Other local root frames nested underneath this one implicitly have their
// view rects changed when their ancestor is repositioned, and therefore
// need to have their screen rects updated.
FrameTreeNode* proxy_node =
frame_proxy_in_parent_renderer_->frame_tree_node();
- if (old_rect.x() != frame_rect_in_pixels_.x() ||
- old_rect.y() != frame_rect_in_pixels_.y()) {
+ if (old_rect.x() != screen_space_rect_in_pixels_.x() ||
+ old_rect.y() != screen_space_rect_in_pixels_.y()) {
for (FrameTreeNode* node :
proxy_node->frame_tree()->SubtreeNodes(proxy_node)) {
if (node != proxy_node && node->current_frame_host()->is_local_root())
@@ -450,10 +433,11 @@ void CrossProcessFrameConnector::SetRect(
}
}
-void CrossProcessFrameConnector::ResetFrameRect() {
+void CrossProcessFrameConnector::ResetScreenSpaceRect() {
local_surface_id_ = viz::LocalSurfaceId();
- frame_rect_in_pixels_ = gfx::Rect();
- frame_rect_in_dip_ = gfx::Rect();
+ screen_space_rect_in_pixels_ = gfx::Rect();
+ screen_space_rect_in_dip_ = gfx::Rect();
+ last_received_local_frame_size_ = gfx::Size();
}
void CrossProcessFrameConnector::OnUpdateRenderThrottlingStatus(
diff --git a/chromium/content/browser/frame_host/cross_process_frame_connector.h b/chromium/content/browser/frame_host/cross_process_frame_connector.h
index 9add9fc2534..8d66e17ad09 100644
--- a/chromium/content/browser/frame_host/cross_process_frame_connector.h
+++ b/chromium/content/browser/frame_host/cross_process_frame_connector.h
@@ -113,7 +113,7 @@ class CONTENT_EXPORT CrossProcessFrameConnector
// is |view_|.
void SetVisibilityForChildViews(bool visible) const override;
- void SetRect(const gfx::Rect& frame_rect_in_pixels) override;
+ void SetScreenSpaceRect(const gfx::Rect& screen_space_rect) override;
// Exposed for tests.
RenderWidgetHostViewBase* GetRootRenderWidgetHostViewForTesting() {
@@ -125,10 +125,11 @@ class CONTENT_EXPORT CrossProcessFrameConnector
// Resets the rect and the viz::LocalSurfaceId of the connector to ensure the
// unguessable surface ID is not reused after a cross-process navigation.
- void ResetFrameRect();
+ void ResetScreenSpaceRect();
// Handlers for messages received from the parent frame.
- void OnUpdateResizeParams(const gfx::Rect& frame_rect,
+ void OnUpdateResizeParams(const gfx::Rect& screen_space_rect,
+ const gfx::Size& local_frame_size,
const ScreenInfo& screen_info,
uint64_t sequence_number,
const viz::SurfaceId& surface_id);
@@ -145,9 +146,6 @@ class CONTENT_EXPORT CrossProcessFrameConnector
// renderer process.
RenderFrameProxyHost* frame_proxy_in_parent_renderer_;
- // The RenderWidgetHostView for the frame. Initially NULL.
- RenderWidgetHostViewChildFrame* view_;
-
bool is_inert_ = false;
bool is_throttled_ = false;
@@ -159,9 +157,10 @@ class CONTENT_EXPORT CrossProcessFrameConnector
bool is_scroll_bubbling_;
- // The last frame rect received from the parent renderer.
- // |last_received_frame_rect_| may be in DIP if use zoom for DSF is off.
- gfx::Rect last_received_frame_rect_;
+ // The last pre-transform frame size received from the parent renderer.
+ // |last_received_local_frame_size_| may be in DIP if use zoom for DSF is
+ // off.
+ gfx::Size last_received_local_frame_size_;
DISALLOW_COPY_AND_ASSIGN(CrossProcessFrameConnector);
};
diff --git a/chromium/content/browser/frame_host/navigation_request.cc b/chromium/content/browser/frame_host/navigation_request.cc
index ac20cab5b8a..b4b0e46f49a 100644
--- a/chromium/content/browser/frame_host/navigation_request.cc
+++ b/chromium/content/browser/frame_host/navigation_request.cc
@@ -1240,6 +1240,7 @@ void NavigationRequest::OnWillProcessResponseChecksComplete(
void NavigationRequest::CommitErrorPage(
RenderFrameHostImpl* render_frame_host,
const base::Optional<std::string>& error_page_content) {
+ UpdateRequestNavigationParamsHistory();
TransferNavigationHandleOwnership(render_frame_host);
render_frame_host->navigation_handle()->ReadyToCommitNavigation(
render_frame_host);
@@ -1249,6 +1250,7 @@ void NavigationRequest::CommitErrorPage(
}
void NavigationRequest::CommitNavigation() {
+ UpdateRequestNavigationParamsHistory();
DCHECK(response_ || !IsURLHandledByNetworkStack(common_params_.url) ||
navigation_handle_->IsSameDocument());
DCHECK(!common_params_.url.SchemeIs(url::kJavaScriptScheme));
@@ -1399,4 +1401,13 @@ NavigationRequest::CheckLegacyProtocolInSubresource() const {
return LegacyProtocolInSubresourceCheckResult::BLOCK_REQUEST;
}
+void NavigationRequest::UpdateRequestNavigationParamsHistory() {
+ NavigationController* navigation_controller =
+ frame_tree_node_->navigator()->GetController();
+ request_params_.current_history_list_offset =
+ navigation_controller->GetCurrentEntryIndex();
+ request_params_.current_history_list_length =
+ navigation_controller->GetEntryCount();
+}
+
} // namespace content
diff --git a/chromium/content/browser/frame_host/navigation_request.h b/chromium/content/browser/frame_host/navigation_request.h
index f0a832bf5e7..8f96c2472d8 100644
--- a/chromium/content/browser/frame_host/navigation_request.h
+++ b/chromium/content/browser/frame_host/navigation_request.h
@@ -299,6 +299,11 @@ class CONTENT_EXPORT NavigationRequest : public NavigationURLLoaderDelegate {
LegacyProtocolInSubresourceCheckResult CheckLegacyProtocolInSubresource()
const;
+ // Called before a commit. Updates the history index and length held in
+ // RequestNavigationParams. This is used to update this shared state with the
+ // renderer process.
+ void UpdateRequestNavigationParamsHistory();
+
FrameTreeNode* frame_tree_node_;
// Initialized on creation of the NavigationRequest. Sent to the renderer when
diff --git a/chromium/content/browser/frame_host/render_frame_host_impl.cc b/chromium/content/browser/frame_host/render_frame_host_impl.cc
index fc3412cb268..1879ab63097 100644
--- a/chromium/content/browser/frame_host/render_frame_host_impl.cc
+++ b/chromium/content/browser/frame_host/render_frame_host_impl.cc
@@ -575,6 +575,18 @@ RenderFrameHostImpl::RenderFrameHostImpl(SiteInstance* site_instance,
ax_tree_id_ = ui::AXTreeIDRegistry::GetInstance()->GetOrCreateAXTreeID(
GetProcess()->GetID(), routing_id_);
+
+ // Content-Security-Policy: The CSP source 'self' is usually the origin of the
+ // current document, set by SetLastCommittedOrigin(). However, before a new
+ // frame commits its first navigation, 'self' should correspond to the origin
+ // of the parent (in case of a new iframe) or the opener (in case of a new
+ // window). This is necessary to correctly enforce CSP during the initial
+ // navigation.
+ FrameTreeNode* frame_owner = frame_tree_node_->parent()
+ ? frame_tree_node_->parent()
+ : frame_tree_node_->opener();
+ if (frame_owner)
+ CSPContext::SetSelf(frame_owner->current_origin());
}
RenderFrameHostImpl::~RenderFrameHostImpl() {
@@ -777,11 +789,17 @@ void RenderFrameHostImpl::ExecuteJavaScriptInIsolatedWorld(
}
void RenderFrameHostImpl::CopyImageAt(int x, int y) {
- Send(new FrameMsg_CopyImageAt(routing_id_, x, y));
+ gfx::PointF point_in_view =
+ GetView()->TransformRootPointToViewCoordSpace(gfx::PointF(x, y));
+ Send(new FrameMsg_CopyImageAt(routing_id_, point_in_view.x(),
+ point_in_view.y()));
}
void RenderFrameHostImpl::SaveImageAt(int x, int y) {
- Send(new FrameMsg_SaveImageAt(routing_id_, x, y));
+ gfx::PointF point_in_view =
+ GetView()->TransformRootPointToViewCoordSpace(gfx::PointF(x, y));
+ Send(new FrameMsg_SaveImageAt(routing_id_, point_in_view.x(),
+ point_in_view.y()));
}
RenderViewHost* RenderFrameHostImpl::GetRenderViewHost() {
@@ -1559,6 +1577,14 @@ void RenderFrameHostImpl::DidCommitProvisionalLoad(
OnBeforeUnloadACK(true, approx_renderer_start_time, base::TimeTicks::Now());
}
+ // If we're waiting for an unload ack from this renderer and we receive a
+ // Navigate message, then the renderer was navigating before it received the
+ // unload request. It will either respond to the unload request soon or our
+ // timer will expire. Either way, we should ignore this message, because we
+ // have already committed to closing this renderer.
+ if (IsWaitingForUnloadACK())
+ return;
+
// Retroactive sanity check:
// - If this is the first real load committing in this frame, then by this
// time the RenderFrameHost's InterfaceProvider implementation should have
@@ -1605,14 +1631,6 @@ void RenderFrameHostImpl::DidCommitProvisionalLoad(
// therefore the global object is not replaced.
}
- // If we're waiting for an unload ack from this renderer and we receive a
- // Navigate message, then the renderer was navigating before it received the
- // unload request. It will either respond to the unload request soon or our
- // timer will expire. Either way, we should ignore this message, because we
- // have already committed to closing this renderer.
- if (IsWaitingForUnloadACK())
- return;
-
if (validated_params->report_type ==
FrameMsg_UILoadMetricsReportType::REPORT_LINK) {
UMA_HISTOGRAM_CUSTOM_TIMES(
@@ -3506,7 +3524,6 @@ void RenderFrameHostImpl::CommitNavigation(
FrameMsg_Navigate_Type::IsSameDocument(common_params.navigation_type);
base::Optional<URLLoaderFactoryBundle> subresource_loader_factories;
- mojom::ControllerServiceWorkerInfoPtr controller_service_worker_info;
if (base::FeatureList::IsEnabled(features::kNetworkService) &&
(!is_same_document || is_first_navigation)) {
subresource_loader_factories.emplace();
@@ -3593,12 +3610,13 @@ void RenderFrameHostImpl::CommitNavigation(
subresource_loader_factories->RegisterFactory(factory.first,
std::move(factory_proxy));
}
+ }
- // Pass the controller service worker info if we have one.
- if (subresource_loader_params) {
- controller_service_worker_info =
- std::move(subresource_loader_params->controller_service_worker_info);
- }
+ // Pass the controller service worker info if we have one.
+ mojom::ControllerServiceWorkerInfoPtr controller_service_worker_info;
+ if (subresource_loader_params) {
+ controller_service_worker_info =
+ std::move(subresource_loader_params->controller_service_worker_info);
}
// It is imperative that cross-document navigations always provide a set of
diff --git a/chromium/content/browser/frame_host/render_frame_host_manager.cc b/chromium/content/browser/frame_host/render_frame_host_manager.cc
index 3263eb9e324..3866f423e1b 100644
--- a/chromium/content/browser/frame_host/render_frame_host_manager.cc
+++ b/chromium/content/browser/frame_host/render_frame_host_manager.cc
@@ -1316,6 +1316,8 @@ RenderFrameHostManager::DetermineSiteInstanceForURL(
// isn't a strict invariant but rather a heuristic to avoid unnecessary
// OOPIFs; see https://crbug.com/711006. Note that this shouldn't apply to
// TopDocumentIsolation, so do this after TDI checks above.
+ //
+ // TODO(alexmos): Remove this check after fixing https://crbug.com/787576.
if (!frame_tree_node_->IsMainFrame()) {
RenderFrameHostImpl* parent =
frame_tree_node_->parent()->current_frame_host();
@@ -1382,6 +1384,20 @@ bool RenderFrameHostManager::IsRendererTransferNeededForNavigation(
return true;
}
+ // If the destination URL is not same-site with current RenderFrameHost and
+ // doesn't require a dedicated process (see above), but it is same-site with
+ // the opener RenderFrameHost, attempt a transfer so that the destination URL
+ // can go back to the opener SiteInstance. This avoids breaking scripting in
+ // some cases when only a subset of sites is isolated
+ // (https://crbug.com/807184).
+ //
+ // TODO(alexmos): This is a temporary workaround and should be removed after
+ // fixing https://crbug.com/787576.
+ FrameTreeNode* opener = frame_tree_node_->opener();
+ if (opener && IsCurrentlySameSite(opener->current_frame_host(), dest_url) &&
+ opener->current_frame_host()->GetSiteInstance() != rfh->GetSiteInstance())
+ return true;
+
return false;
}
diff --git a/chromium/content/browser/frame_host/render_widget_host_view_guest.cc b/chromium/content/browser/frame_host/render_widget_host_view_guest.cc
index bbfde2e4da2..9c03e285ca6 100644
--- a/chromium/content/browser/frame_host/render_widget_host_view_guest.cc
+++ b/chromium/content/browser/frame_host/render_widget_host_view_guest.cc
@@ -367,8 +367,9 @@ RenderWidgetHostViewGuest::GetTouchSelectionControllerClientManager() {
void RenderWidgetHostViewGuest::SetTooltipText(
const base::string16& tooltip_text) {
- if (guest_)
- guest_->SetTooltipText(tooltip_text);
+ RenderWidgetHostViewBase* root_view = GetRootView(this);
+ if (root_view)
+ root_view->SetTooltipText(tooltip_text);
}
void RenderWidgetHostViewGuest::SendSurfaceInfoToEmbedderImpl(
diff --git a/chromium/content/browser/generic_sensor_browsertest.cc b/chromium/content/browser/generic_sensor_browsertest.cc
index 06a08be5bca..b7f06a4d2f9 100644
--- a/chromium/content/browser/generic_sensor_browsertest.cc
+++ b/chromium/content/browser/generic_sensor_browsertest.cc
@@ -43,6 +43,15 @@ class FakeAmbientLightSensor : public device::mojom::Sensor {
shared_buffer_handle_ = mojo::SharedBufferHandle::Create(
sizeof(device::SensorReadingSharedBuffer) *
static_cast<uint64_t>(device::mojom::SensorType::LAST));
+
+ if (!shared_buffer_handle_.is_valid())
+ return;
+
+ // Create read/write mapping now, to ensure it is kept writable
+ // after the region is sealed read-only on Android.
+ shared_buffer_mapping_ = shared_buffer_handle_->MapAtOffset(
+ device::mojom::SensorInitParams::kReadBufferSizeForTests,
+ GetBufferOffset());
}
~FakeAmbientLightSensor() override = default;
@@ -98,21 +107,17 @@ class FakeAmbientLightSensor : public device::mojom::Sensor {
}
void SensorReadingChanged() {
- if (!shared_buffer_handle_.is_valid())
+ if (!shared_buffer_mapping_.get())
return;
- mojo::ScopedSharedBufferMapping shared_buffer =
- shared_buffer_handle_->MapAtOffset(
- device::mojom::SensorInitParams::kReadBufferSizeForTests,
- GetBufferOffset());
-
device::SensorReading reading;
reading.als.timestamp =
(base::TimeTicks::Now() - base::TimeTicks()).InSecondsF();
reading.als.value = 50;
device::SensorReadingSharedBuffer* buffer =
- static_cast<device::SensorReadingSharedBuffer*>(shared_buffer.get());
+ static_cast<device::SensorReadingSharedBuffer*>(
+ shared_buffer_mapping_.get());
auto& seqlock = buffer->seqlock.value();
seqlock.WriteBegin();
buffer->reading = reading;
@@ -124,6 +129,7 @@ class FakeAmbientLightSensor : public device::mojom::Sensor {
private:
mojo::ScopedSharedBufferHandle shared_buffer_handle_;
+ mojo::ScopedSharedBufferMapping shared_buffer_mapping_;
device::mojom::SensorClientPtr client_;
DISALLOW_COPY_AND_ASSIGN(FakeAmbientLightSensor);
diff --git a/chromium/content/browser/isolated_origin_browsertest.cc b/chromium/content/browser/isolated_origin_browsertest.cc
index 89fc7f4bffc..547bb6eb1cf 100644
--- a/chromium/content/browser/isolated_origin_browsertest.cc
+++ b/chromium/content/browser/isolated_origin_browsertest.cc
@@ -421,6 +421,77 @@ IN_PROC_BROWSER_TEST_F(IsolatedOriginTest,
EXPECT_EQ(bar_url2.spec(), popup_location);
}
+// Check that when a non-isolated-origin page opens a popup, navigates it
+// to an isolated origin, and then the popup navigates to a third non-isolated
+// origin and finally back to its opener's origin, the popup and the opener
+// iframe end up in the same process and can script each other:
+//
+// foo.com
+// |
+// window.open()
+// |
+// V
+// about:blank -> isolated.foo.com -> bar.com -> foo.com
+//
+// This is a variant of PopupNavigatesToIsolatedOriginAndBack where the popup
+// navigates to a third site before coming back to the opener's site. See
+// https://crbug.com/807184.
+IN_PROC_BROWSER_TEST_F(IsolatedOriginTest,
+ PopupNavigatesToIsolatedOriginThenToAnotherSiteAndBack) {
+ // Start on www.foo.com.
+ GURL foo_url(embedded_test_server()->GetURL("www.foo.com", "/title1.html"));
+ EXPECT_TRUE(NavigateToURL(shell(), foo_url));
+ FrameTreeNode* root = web_contents()->GetFrameTree()->root();
+
+ // Open a blank popup.
+ ShellAddedObserver new_shell_observer;
+ EXPECT_TRUE(ExecuteScript(root, "window.w = window.open();"));
+ Shell* new_shell = new_shell_observer.GetShell();
+
+ // Have the opener navigate the popup to an isolated origin.
+ GURL isolated_url(
+ embedded_test_server()->GetURL("isolated.foo.com", "/title1.html"));
+ {
+ TestNavigationManager manager(new_shell->web_contents(), isolated_url);
+ EXPECT_TRUE(ExecuteScript(
+ root, "window.w.location.href = '" + isolated_url.spec() + "';"));
+ manager.WaitForNavigationFinished();
+ }
+
+ // Simulate the isolated origin in the popup navigating to bar.com.
+ GURL bar_url(embedded_test_server()->GetURL("bar.com", "/title2.html"));
+ {
+ TestNavigationManager manager(new_shell->web_contents(), bar_url);
+ EXPECT_TRUE(
+ ExecuteScript(new_shell, "location.href = '" + bar_url.spec() + "';"));
+ manager.WaitForNavigationFinished();
+ }
+
+ // At this point, the popup and the opener should still be in separate
+ // SiteInstances.
+ EXPECT_NE(new_shell->web_contents()->GetMainFrame()->GetSiteInstance(),
+ root->current_frame_host()->GetSiteInstance());
+
+ // Simulate the isolated origin in the popup navigating to www.foo.com.
+ {
+ TestNavigationManager manager(new_shell->web_contents(), foo_url);
+ EXPECT_TRUE(
+ ExecuteScript(new_shell, "location.href = '" + foo_url.spec() + "';"));
+ manager.WaitForNavigationFinished();
+ }
+
+ // The popup should now be in the same SiteInstance as its same-site opener.
+ EXPECT_EQ(new_shell->web_contents()->GetMainFrame()->GetSiteInstance(),
+ root->current_frame_host()->GetSiteInstance());
+
+ // Check that the popup can script the opener.
+ std::string opener_location;
+ EXPECT_TRUE(ExecuteScriptAndExtractString(
+ new_shell, "domAutomationController.send(window.opener.location.href);",
+ &opener_location));
+ EXPECT_EQ(foo_url.spec(), opener_location);
+}
+
// Check that with an ABA hierarchy, where B is an isolated origin, the root
// and grandchild frames end up in the same process and can script each other.
// See https://crbug.com/796912.
diff --git a/chromium/content/browser/loader/cross_site_document_blocking_browsertest.cc b/chromium/content/browser/loader/cross_site_document_blocking_browsertest.cc
index 503ca5348d0..5e2364ec618 100644
--- a/chromium/content/browser/loader/cross_site_document_blocking_browsertest.cc
+++ b/chromium/content/browser/loader/cross_site_document_blocking_browsertest.cc
@@ -9,6 +9,7 @@
#include "base/strings/stringprintf.h"
#include "base/test/histogram_tester.h"
#include "base/test/scoped_feature_list.h"
+#include "content/public/browser/web_contents.h"
#include "content/public/common/content_features.h"
#include "content/public/common/content_switches.h"
#include "content/public/common/resource_type.h"
@@ -22,6 +23,65 @@
namespace content {
+namespace {
+
+// Ensure the correct histograms are incremented for blocking events.
+// Assumes the resource type is XHR.
+void InspectHistograms(const base::HistogramTester& histograms,
+ bool should_be_blocked,
+ bool should_be_sniffed,
+ const std::string& resource_name,
+ ResourceType resource_type) {
+ std::string bucket;
+ if (base::MatchPattern(resource_name, "*.html")) {
+ bucket = "HTML";
+ } else if (base::MatchPattern(resource_name, "*.xml")) {
+ bucket = "XML";
+ } else if (base::MatchPattern(resource_name, "*.json")) {
+ bucket = "JSON";
+ } else if (base::MatchPattern(resource_name, "*.txt")) {
+ bucket = "Plain";
+ } else {
+ bucket = "Others";
+ }
+
+ // Determine the appropriate histograms, including a start and end action
+ // (which are verified in unit tests), a read size if it was sniffed, and
+ // additional blocked metrics if it was blocked.
+ base::HistogramTester::CountsMap expected_counts;
+ std::string base = "SiteIsolation.XSD.Browser";
+ expected_counts[base + ".Action"] = 2;
+ if ((base::MatchPattern(resource_name, "*prefixed*") || bucket == "Others") &&
+ should_be_blocked) {
+ expected_counts[base + ".BlockedForParserBreaker"] = 1;
+ }
+ if (should_be_sniffed)
+ expected_counts[base + ".BytesReadForSniffing"] = 1;
+ if (should_be_blocked) {
+ expected_counts[base + ".Blocked"] = 1;
+ expected_counts[base + ".Blocked." + bucket] = 1;
+ }
+
+ // Make sure that the expected metrics, and only those metrics, were
+ // incremented.
+ EXPECT_THAT(histograms.GetTotalCountsForPrefix("SiteIsolation.XSD.Browser"),
+ testing::ContainerEq(expected_counts))
+ << "For resource_name=" << resource_name
+ << ", should_be_blocked=" << should_be_blocked;
+
+ // Determine if the bucket for the resource type (XHR) was incremented.
+ if (should_be_blocked) {
+ EXPECT_THAT(histograms.GetAllSamples(base + ".Blocked"),
+ testing::ElementsAre(base::Bucket(resource_type, 1)))
+ << "The wrong Blocked bucket was incremented.";
+ EXPECT_THAT(histograms.GetAllSamples(base + ".Blocked." + bucket),
+ testing::ElementsAre(base::Bucket(resource_type, 1)))
+ << "The wrong Blocked bucket was incremented.";
+ }
+}
+
+} // namespace
+
// These tests verify that the browser process blocks cross-site HTML, XML,
// JSON, and some plain text responses when they are not otherwise permitted
// (e.g., by CORS). This ensures that such responses never end up in the
@@ -70,62 +130,6 @@ class CrossSiteDocumentBlockingBaseTest : public ContentBrowserTest {
embedded_test_server()->StartAcceptingConnections();
}
- // Ensure the correct histograms are incremented for blocking events.
- // Assumes the resource type is XHR.
- void InspectHistograms(const base::HistogramTester& histograms,
- bool should_be_blocked,
- bool should_be_sniffed,
- const std::string& resource_name,
- ResourceType resource_type) {
- std::string bucket;
- if (base::MatchPattern(resource_name, "*.html")) {
- bucket = "HTML";
- } else if (base::MatchPattern(resource_name, "*.xml")) {
- bucket = "XML";
- } else if (base::MatchPattern(resource_name, "*.json")) {
- bucket = "JSON";
- } else if (base::MatchPattern(resource_name, "*.txt")) {
- bucket = "Plain";
- } else {
- bucket = "Others";
- }
-
- // Determine the appropriate histograms, including a start and end action
- // (which are verified in unit tests), a read size if it was sniffed, and
- // additional blocked metrics if it was blocked.
- base::HistogramTester::CountsMap expected_counts;
- std::string base = "SiteIsolation.XSD.Browser";
- expected_counts[base + ".Action"] = 2;
- if ((base::MatchPattern(resource_name, "*prefixed*") ||
- bucket == "Others") &&
- should_be_blocked) {
- expected_counts[base + ".BlockedForParserBreaker"] = 1;
- }
- if (should_be_sniffed)
- expected_counts[base + ".BytesReadForSniffing"] = 1;
- if (should_be_blocked) {
- expected_counts[base + ".Blocked"] = 1;
- expected_counts[base + ".Blocked." + bucket] = 1;
- }
-
- // Make sure that the expected metrics, and only those metrics, were
- // incremented.
- EXPECT_THAT(histograms.GetTotalCountsForPrefix("SiteIsolation.XSD.Browser"),
- testing::ContainerEq(expected_counts))
- << "For resource_name=" << resource_name
- << ", should_be_blocked=" << should_be_blocked;
-
- // Determine if the bucket for the resource type (XHR) was incremented.
- if (should_be_blocked) {
- EXPECT_THAT(histograms.GetAllSamples(base + ".Blocked"),
- testing::ElementsAre(base::Bucket(resource_type, 1)))
- << "The wrong Blocked bucket was incremented.";
- EXPECT_THAT(histograms.GetAllSamples(base + ".Blocked." + bucket),
- testing::ElementsAre(base::Bucket(resource_type, 1)))
- << "The wrong Blocked bucket was incremented.";
- }
- }
-
private:
DISALLOW_COPY_AND_ASSIGN(CrossSiteDocumentBlockingBaseTest);
};
@@ -153,7 +157,7 @@ IN_PROC_BROWSER_TEST_F(CrossSiteDocumentBlockingTest, BlockDocuments) {
// possible since we run the browser without the same origin policy, allowing
// it to see the response body if it makes it to the renderer (even if the
// renderer would normally block access to it).
- GURL foo_url("http://foo.com/cross_site_document_request.html");
+ GURL foo_url("http://foo.com/cross_site_document_blocking/request.html");
EXPECT_TRUE(NavigateToURL(shell(), foo_url));
// The following are files under content/test/data/site_isolation. All
@@ -257,7 +261,7 @@ IN_PROC_BROWSER_TEST_F(CrossSiteDocumentBlockingTest, BlockDocuments) {
// be a problem for script files mislabeled as HTML/XML/JSON/text (i.e., the
// reason for sniffing), since script tags won't send Range headers.
IN_PROC_BROWSER_TEST_F(CrossSiteDocumentBlockingTest, RangeRequest) {
- GURL foo_url("http://foo.com/cross_site_document_request.html");
+ GURL foo_url("http://foo.com/cross_site_document_blocking/request.html");
EXPECT_TRUE(NavigateToURL(shell(), foo_url));
{
@@ -309,14 +313,203 @@ IN_PROC_BROWSER_TEST_F(CrossSiteDocumentBlockingTest, BlockForVariousTargets) {
// TODO(nick): Split up these cases, and add positive assertions here about
// what actually happens in these various resource-block cases.
- GURL foo("http://foo.com/cross_site_document_request_target.html");
+ GURL foo("http://foo.com/cross_site_document_blocking/request_target.html");
EXPECT_TRUE(NavigateToURL(shell(), foo));
- WaitForLoadStop(shell()->web_contents());
// TODO(creis): Wait for all the subresources to load and ensure renderer
// process is still alive.
}
+// This test class sets up a service worker that can be used to try to respond
+// to same-origin requests with cross-origin responses.
+class CrossSiteDocumentBlockingServiceWorkerTest : public ContentBrowserTest {
+ public:
+ CrossSiteDocumentBlockingServiceWorkerTest()
+ : service_worker_https_server_(net::EmbeddedTestServer::TYPE_HTTPS),
+ cross_origin_https_server_(net::EmbeddedTestServer::TYPE_HTTPS) {}
+ ~CrossSiteDocumentBlockingServiceWorkerTest() override {}
+
+ void SetUpCommandLine(base::CommandLine* command_line) override {
+ IsolateAllSitesForTesting(command_line);
+
+ // To test that the renderer process does not receive blocked documents, we
+ // disable the same origin policy to let it see cross-origin fetches if they
+ // are received.
+ command_line->AppendSwitch(switches::kDisableWebSecurity);
+
+ ContentBrowserTest::SetUpCommandLine(command_line);
+ }
+
+ void SetUpOnMainThread() override {
+ SetupCrossSiteRedirector(embedded_test_server());
+
+ service_worker_https_server_.ServeFilesFromSourceDirectory(
+ "content/test/data");
+ ASSERT_TRUE(service_worker_https_server_.Start());
+
+ cross_origin_https_server_.ServeFilesFromSourceDirectory(
+ "content/test/data");
+ cross_origin_https_server_.SetSSLConfig(
+ net::EmbeddedTestServer::CERT_COMMON_NAME_IS_DOMAIN);
+ ASSERT_TRUE(cross_origin_https_server_.Start());
+
+ // Sanity check of test setup - the 2 https servers should be cross-site
+ // (the second server should have a different hostname because of the call
+ // to SetSSLConfig with CERT_COMMON_NAME_IS_DOMAIN argument).
+ ASSERT_FALSE(SiteInstance::IsSameWebSite(
+ shell()->web_contents()->GetBrowserContext(),
+ GetURLOnServiceWorkerServer("/"), GetURLOnCrossOriginServer("/")));
+ }
+
+ GURL GetURLOnServiceWorkerServer(const std::string& path) {
+ return service_worker_https_server_.GetURL(path);
+ }
+
+ GURL GetURLOnCrossOriginServer(const std::string& path) {
+ return cross_origin_https_server_.GetURL(path);
+ }
+
+ void StopCrossOriginServer() {
+ EXPECT_TRUE(cross_origin_https_server_.ShutdownAndWaitUntilComplete());
+ }
+
+ void SetUpServiceWorker() {
+ GURL url = GetURLOnServiceWorkerServer(
+ "/cross_site_document_blocking/request.html");
+ ASSERT_TRUE(NavigateToURL(shell(), url));
+
+ bool is_script_done;
+ std::string script = R"(
+ navigator.serviceWorker
+ .register('/cross_site_document_blocking/service_worker.js')
+ .then(registration => navigator.serviceWorker.ready)
+ .then(function(r) { domAutomationController.send(true); })
+ .catch(function(e) {
+ console.log('error: ' + e);
+ domAutomationController.send(false);
+ }); )";
+ ASSERT_TRUE(ExecuteScriptAndExtractBool(shell(), script, &is_script_done));
+ ASSERT_TRUE(is_script_done);
+ }
+
+ private:
+ // The test requires 2 https servers, because:
+ // 1. Service workers are only supported on secure origins.
+ // 2. One of tests requires fetching cross-origin resources from the
+ // original page and/or service worker - the target of the fetch needs to
+ // be a https server to avoid hitting the mixed content error.
+ net::EmbeddedTestServer service_worker_https_server_;
+ net::EmbeddedTestServer cross_origin_https_server_;
+
+ DISALLOW_COPY_AND_ASSIGN(CrossSiteDocumentBlockingServiceWorkerTest);
+};
+
+// Issue a cross-origin request that will be handled entirely within a service
+// worker (without reaching the network - the cross-origin response will be
+// "faked" within the same-origin service worker, because the service worker
+// used by the test recognizes the "data_from_service_worker" suffix in the
+// URL). This testcase is designed to hit the case in
+// CrossSiteDocumentResourceHandler::ShouldBlockBasedOnHeaders where
+// |response_type_via_service_worker| is equal to |kDefault|. See also
+// https://crbug.com/803672.
+//
+// TODO(lukasza): https://crbug.com/715640: This test might become invalid
+// after servicification of service workers.
+IN_PROC_BROWSER_TEST_F(CrossSiteDocumentBlockingServiceWorkerTest, NoNetwork) {
+ SetUpServiceWorker();
+
+ base::HistogramTester histograms;
+ std::string response;
+ std::string script = R"(
+ // Any cross-origin URL ending with .../data_from_service_worker can be
+ // used here - it will be intercepted by the service worker and will never
+ // go to the network.
+ fetch('https://bar.com/data_from_service_worker')
+ .then(response => response.text())
+ .then(responseText => {
+ domAutomationController.send(responseText);
+ })
+ .catch(error => {
+ var errorMessage = 'error: ' + error;
+ console.log(errorMessage);
+ domAutomationController.send(errorMessage);
+ }); )";
+ EXPECT_TRUE(ExecuteScriptAndExtractString(shell(), script, &response));
+
+ // Verify that XSDB didn't block the response (since it was "faked" within the
+ // service worker and didn't cross any security boundaries).
+ EXPECT_EQ("Response created by service worker", response);
+ InspectHistograms(histograms, false /* should_be_blocked */,
+ false /* should_be_sniffed */, "blah.html",
+ RESOURCE_TYPE_XHR);
+}
+
+IN_PROC_BROWSER_TEST_F(CrossSiteDocumentBlockingServiceWorkerTest,
+ NetworkAndOpaqueResponse) {
+ SetUpServiceWorker();
+
+ // Build a script for XHR-ing a cross-origin, nosniff HTML document.
+ GURL cross_origin_url =
+ GetURLOnCrossOriginServer("/site_isolation/nosniff.html");
+ const char* script_template = R"(
+ fetch('%s', { mode: 'no-cors' })
+ .then(response => response.text())
+ .then(responseText => {
+ domAutomationController.send(responseText);
+ })
+ .catch(error => {
+ var errorMessage = 'error: ' + error;
+ domAutomationController.send(errorMessage);
+ }); )";
+ std::string script =
+ base::StringPrintf(script_template, cross_origin_url.spec().c_str());
+
+ {
+ // The first time the request reaches the service worker, it will be
+ // forwarded to the network, but a response will be intercepted by the
+ // service worker and replaced with a new, artificial error.
+ base::HistogramTester histograms;
+ std::string response;
+ EXPECT_TRUE(ExecuteScriptAndExtractString(shell(), script, &response));
+
+ // Verify that XSDB blocked the response from the network (from
+ // |cross_origin_https_server_|) to the service worker.
+ InspectHistograms(histograms, true /* should_be_blocked */,
+ false /* should_be_sniffed */, "nosniff.html",
+ RESOURCE_TYPE_XHR);
+
+ // Verify that the service worker replied with an expected error.
+ // Replying with an error means that XSDB is only active once (for the
+ // initial, real network request) and therefore the test doesn't get
+ // confused (second successful response would have added noise to the
+ // histograms captured by the test).
+ EXPECT_EQ("error: TypeError: Failed to fetch", response);
+ }
+
+ // TODO(lukasza): https://crbug.com/715640: The remainder of this test might
+ // become invalid after servicification of service workers.
+ {
+ // Stop the server, to make sure the response below comes back from the
+ // service worker (and not from the network).
+ StopCrossOriginServer();
+
+ // The second time the request reaches the service worker, it will return
+ // the previously cached response from the network. This should hit the
+ // case in CrossSiteDocumentResourceHandler::ShouldBlockBasedOnHeaders where
+ // |response_type_via_service_worker| is equal to |kOpaque|.
+ base::HistogramTester histograms;
+ std::string response;
+ EXPECT_TRUE(ExecuteScriptAndExtractString(shell(), script, &response));
+
+ // Verify that XSDB blocked the cached/opaque service worker response from
+ // reaching a cross-origin page.
+ EXPECT_EQ("", response);
+ InspectHistograms(histograms, true /* should_be_blocked */,
+ false /* should_be_sniffed */, "nosniff.html",
+ RESOURCE_TYPE_XHR);
+ }
+}
+
class CrossSiteDocumentBlockingKillSwitchTest
: public CrossSiteDocumentBlockingTest {
public:
@@ -338,7 +531,7 @@ class CrossSiteDocumentBlockingKillSwitchTest
IN_PROC_BROWSER_TEST_F(CrossSiteDocumentBlockingKillSwitchTest,
NoBlockingWithKillSwitch) {
// Load a page that issues illegal cross-site document requests to bar.com.
- GURL foo_url("http://foo.com/cross_site_document_request.html");
+ GURL foo_url("http://foo.com/cross_site_document_blocking/request.html");
EXPECT_TRUE(NavigateToURL(shell(), foo_url));
bool was_blocked;
@@ -355,7 +548,7 @@ IN_PROC_BROWSER_TEST_F(CrossSiteDocumentBlockingBaseTest,
return;
// Load a page that issues illegal cross-site document requests to bar.com.
- GURL foo_url("http://foo.com/cross_site_document_request.html");
+ GURL foo_url("http://foo.com/cross_site_document_blocking/request.html");
EXPECT_TRUE(NavigateToURL(shell(), foo_url));
bool was_blocked;
@@ -388,7 +581,7 @@ IN_PROC_BROWSER_TEST_F(CrossSiteDocumentBlockingIsolatedOriginTest,
// Load a page that issues illegal cross-site document requests to the
// isolated origin.
- GURL foo_url("http://foo.com/cross_site_document_request.html");
+ GURL foo_url("http://foo.com/cross_site_document_blocking/request.html");
EXPECT_TRUE(NavigateToURL(shell(), foo_url));
bool was_blocked;
diff --git a/chromium/content/browser/loader/cross_site_document_resource_handler.cc b/chromium/content/browser/loader/cross_site_document_resource_handler.cc
index 2a5f9772006..dd93cd37488 100644
--- a/chromium/content/browser/loader/cross_site_document_resource_handler.cc
+++ b/chromium/content/browser/loader/cross_site_document_resource_handler.cc
@@ -478,11 +478,15 @@ void CrossSiteDocumentResourceHandler::OnResponseCompleted(
next_handler_->OnResponseCompleted(net::URLRequestStatus(),
std::move(controller));
} else {
- LogCrossSiteDocumentAction(
- needs_sniffing_
- ? CrossSiteDocumentResourceHandler::Action::kAllowedAfterSniffing
- : CrossSiteDocumentResourceHandler::Action::
- kAllowedWithoutSniffing);
+ // Only report XSDB status for successful (i.e. non-aborted,
+ // non-errored-out) requests.
+ if (status.is_success()) {
+ LogCrossSiteDocumentAction(
+ needs_sniffing_
+ ? CrossSiteDocumentResourceHandler::Action::kAllowedAfterSniffing
+ : CrossSiteDocumentResourceHandler::Action::
+ kAllowedWithoutSniffing);
+ }
next_handler_->OnResponseCompleted(status, std::move(controller));
}
@@ -563,6 +567,27 @@ bool CrossSiteDocumentResourceHandler::ShouldBlockBasedOnHeaders(
return false;
}
+ // Requests from foo.example.com will consult foo.example.com's service worker
+ // first (if one has been registered). The service worker can handle requests
+ // initiated by foo.example.com even if they are cross-origin (e.g. requests
+ // for bar.example.com). This is okay and should not be blocked by XSDB,
+ // unless the initiator opted out of CORS / opted into receiving an opaque
+ // response. See also https://crbug.com/803672.
+ if (response->head.was_fetched_via_service_worker) {
+ switch (response->head.response_type_via_service_worker) {
+ case network::mojom::FetchResponseType::kBasic:
+ case network::mojom::FetchResponseType::kCORS:
+ case network::mojom::FetchResponseType::kDefault:
+ case network::mojom::FetchResponseType::kError:
+ // Non-opaque responses shouldn't be blocked.
+ return false;
+ case network::mojom::FetchResponseType::kOpaque:
+ case network::mojom::FetchResponseType::kOpaqueRedirect:
+ // Opaque responses are eligible for blocking. Continue on...
+ break;
+ }
+ }
+
// Don't block plugin requests with universal access (e.g., Flash). Such
// requests are made without CORS, and thus dont have an Origin request
// header. Other plugin requests (e.g., NaCl) are made using CORS and have an
diff --git a/chromium/content/browser/loader/cross_site_document_resource_handler.h b/chromium/content/browser/loader/cross_site_document_resource_handler.h
index c582fa055cb..8b4eea23eb4 100644
--- a/chromium/content/browser/loader/cross_site_document_resource_handler.h
+++ b/chromium/content/browser/loader/cross_site_document_resource_handler.h
@@ -43,23 +43,24 @@ namespace content {
class CONTENT_EXPORT CrossSiteDocumentResourceHandler
: public LayeredResourceHandler {
public:
- // This enum backs a histogram. Update enums.xml if you make any updates, and
- // put new entries before |kCount|.
+ // This enum backs a histogram, so do not change the order of entries or
+ // remove entries. Put new entries before |kCount| and update enums.xml (see
+ // the SiteIsolationResponseAction enum).
enum class Action {
// Logged at OnResponseStarted.
- kResponseStarted,
+ kResponseStarted = 0,
// Logged when a response is blocked without requiring sniffing.
- kBlockedWithoutSniffing,
+ kBlockedWithoutSniffing = 1,
// Logged when a response is blocked as a result of sniffing the content.
- kBlockedAfterSniffing,
+ kBlockedAfterSniffing = 2,
// Logged when a response is allowed without requiring sniffing.
- kAllowedWithoutSniffing,
+ kAllowedWithoutSniffing = 3,
// Logged when a response is allowed as a result of sniffing the content.
- kAllowedAfterSniffing,
+ kAllowedAfterSniffing = 4,
kCount
};
diff --git a/chromium/content/browser/loader/navigation_url_loader_network_service.cc b/chromium/content/browser/loader/navigation_url_loader_network_service.cc
index d9297fa8365..f222194d970 100644
--- a/chromium/content/browser/loader/navigation_url_loader_network_service.cc
+++ b/chromium/content/browser/loader/navigation_url_loader_network_service.cc
@@ -574,6 +574,26 @@ class NavigationURLLoaderNetworkService::URLLoaderRequestController
if (navigation_data)
cloned_navigation_data = navigation_data->Clone();
}
+
+ // This is similar to what is done in
+ // ServiceWorkerControlleeHandler::MaybeCreateSubresourceLoaderParams().
+ // It takes the matching ControllerServiceWorkerInfo (if any) associated
+ // with the request. It will be sent to the renderer process and used to
+ // intercept requests.
+ // TODO(arthursonzogni): This is needed only for the non-S13nServiceWorker
+ // case. The S13nServiceWorker case is still not supported without the
+ // NetworkService. This block needs to be updated once support for it will
+ // be added.
+ ServiceWorkerProviderHost* sw_provider_host =
+ ServiceWorkerRequestHandler::GetProviderHost(url_request);
+ if (sw_provider_host && sw_provider_host->controller()) {
+ subresource_loader_params_ = SubresourceLoaderParams();
+ subresource_loader_params_->controller_service_worker_info =
+ mojom::ControllerServiceWorkerInfo::New();
+ subresource_loader_params_->controller_service_worker_info
+ ->object_info = sw_provider_host->GetOrCreateServiceWorkerHandle(
+ sw_provider_host->controller());
+ }
}
// Make a copy of the ResourceResponse before it is passed to another
diff --git a/chromium/content/browser/renderer_host/dwrite_font_proxy_message_filter_win.cc b/chromium/content/browser/renderer_host/dwrite_font_proxy_message_filter_win.cc
index d1b125cc1fa..5fb0c0179d5 100644
--- a/chromium/content/browser/renderer_host/dwrite_font_proxy_message_filter_win.cc
+++ b/chromium/content/browser/renderer_host/dwrite_font_proxy_message_filter_win.cc
@@ -200,7 +200,6 @@ void DWriteFontProxyImpl::FindFamily(const base::string16& family_name,
FindFamilyCallback callback) {
InitializeDirectWrite();
TRACE_EVENT0("dwrite", "FontProxyHost::OnFindFamily");
- DCHECK(collection_);
UINT32 family_index = UINT32_MAX;
if (collection_) {
BOOL exists = FALSE;
@@ -218,8 +217,7 @@ void DWriteFontProxyImpl::FindFamily(const base::string16& family_name,
void DWriteFontProxyImpl::GetFamilyCount(GetFamilyCountCallback callback) {
InitializeDirectWrite();
TRACE_EVENT0("dwrite", "FontProxyHost::OnGetFamilyCount");
- DCHECK(collection_);
- std::move(callback).Run(collection_->GetFontFamilyCount());
+ std::move(callback).Run(collection_ ? collection_->GetFontFamilyCount() : 0);
}
void DWriteFontProxyImpl::GetFamilyNames(UINT32 family_index,
@@ -228,7 +226,6 @@ void DWriteFontProxyImpl::GetFamilyNames(UINT32 family_index,
TRACE_EVENT0("dwrite", "FontProxyHost::OnGetFamilyNames");
callback = mojo::WrapCallbackWithDefaultInvokeIfNotRun(
std::move(callback), std::vector<mojom::DWriteStringPairPtr>());
- DCHECK(collection_);
if (!collection_)
return;
@@ -291,7 +288,6 @@ void DWriteFontProxyImpl::GetFontFiles(uint32_t family_index,
callback = mojo::WrapCallbackWithDefaultInvokeIfNotRun(
std::move(callback), std::vector<base::FilePath>(),
std::vector<base::File>());
- DCHECK(collection_);
if (!collection_)
return;
diff --git a/chromium/content/browser/renderer_host/frame_connector_delegate.cc b/chromium/content/browser/renderer_host/frame_connector_delegate.cc
index 1db1b20c2a3..323423bfb35 100644
--- a/chromium/content/browser/renderer_host/frame_connector_delegate.cc
+++ b/chromium/content/browser/renderer_host/frame_connector_delegate.cc
@@ -4,10 +4,16 @@
#include "content/browser/renderer_host/frame_connector_delegate.h"
+#include "content/browser/renderer_host/render_widget_host_impl.h"
+#include "content/browser/renderer_host/render_widget_host_view_child_frame.h"
#include "content/common/content_switches_internal.h"
namespace content {
+void FrameConnectorDelegate::SetView(RenderWidgetHostViewChildFrame* view) {
+ view_ = view;
+}
+
RenderWidgetHostViewBase*
FrameConnectorDelegate::GetParentRenderWidgetHostView() {
return nullptr;
@@ -18,6 +24,35 @@ FrameConnectorDelegate::GetRootRenderWidgetHostView() {
return nullptr;
}
+void FrameConnectorDelegate::UpdateResizeParams(
+ const gfx::Rect& screen_space_rect,
+ const gfx::Size& local_frame_size,
+ const ScreenInfo& screen_info,
+ uint64_t sequence_number,
+ const viz::SurfaceId& surface_id) {
+ screen_info_ = screen_info;
+ local_surface_id_ = surface_id.local_surface_id();
+
+ SetScreenSpaceRect(screen_space_rect);
+ SetLocalFrameSize(local_frame_size);
+
+ if (!view_)
+ return;
+#if defined(USE_AURA)
+ view_->SetFrameSinkId(surface_id.frame_sink_id());
+#endif // defined(USE_AURA)
+
+ RenderWidgetHostImpl* render_widget_host = view_->GetRenderWidgetHostImpl();
+ DCHECK(render_widget_host);
+
+ if (render_widget_host->auto_resize_enabled()) {
+ render_widget_host->DidAllocateLocalSurfaceIdForAutoResize(sequence_number);
+ return;
+ }
+
+ render_widget_host->WasResized();
+}
+
gfx::PointF FrameConnectorDelegate::TransformPointToRootCoordSpace(
const gfx::PointF& point,
const viz::SurfaceId& surface_id) {
@@ -64,15 +99,29 @@ bool FrameConnectorDelegate::IsSubtreeThrottled() const {
return false;
}
-void FrameConnectorDelegate::SetRect(const gfx::Rect& frame_rect) {
+void FrameConnectorDelegate::SetLocalFrameSize(
+ const gfx::Size& local_frame_size) {
+ if (use_zoom_for_device_scale_factor_) {
+ local_frame_size_in_pixels_ = local_frame_size;
+ local_frame_size_in_dip_ = gfx::ScaleToCeiledSize(
+ local_frame_size, 1.f / screen_info_.device_scale_factor);
+ } else {
+ local_frame_size_in_dip_ = local_frame_size;
+ local_frame_size_in_pixels_ = gfx::ScaleToCeiledSize(
+ local_frame_size, screen_info_.device_scale_factor);
+ }
+}
+
+void FrameConnectorDelegate::SetScreenSpaceRect(
+ const gfx::Rect& screen_space_rect) {
if (use_zoom_for_device_scale_factor_) {
- frame_rect_in_pixels_ = frame_rect;
- frame_rect_in_dip_ = gfx::ScaleToEnclosingRect(
- frame_rect, 1.f / screen_info_.device_scale_factor);
+ screen_space_rect_in_pixels_ = screen_space_rect;
+ screen_space_rect_in_dip_ = gfx::ScaleToEnclosingRect(
+ screen_space_rect, 1.f / screen_info_.device_scale_factor);
} else {
- frame_rect_in_dip_ = frame_rect;
- frame_rect_in_pixels_ =
- gfx::ScaleToEnclosingRect(frame_rect, screen_info_.device_scale_factor);
+ screen_space_rect_in_dip_ = screen_space_rect;
+ screen_space_rect_in_pixels_ = gfx::ScaleToEnclosingRect(
+ screen_space_rect, screen_info_.device_scale_factor);
}
}
diff --git a/chromium/content/browser/renderer_host/frame_connector_delegate.h b/chromium/content/browser/renderer_host/frame_connector_delegate.h
index 03562e8f0d4..34d4dcb6090 100644
--- a/chromium/content/browser/renderer_host/frame_connector_delegate.h
+++ b/chromium/content/browser/renderer_host/frame_connector_delegate.h
@@ -50,7 +50,7 @@ class WebCursor;
// into, and whether the view currently has keyboard focus.
class CONTENT_EXPORT FrameConnectorDelegate {
public:
- virtual void SetView(RenderWidgetHostViewChildFrame* view) {}
+ virtual void SetView(RenderWidgetHostViewChildFrame* view);
// Returns the parent RenderWidgetHostView or nullptr if it doesn't have one.
virtual RenderWidgetHostViewBase* GetParentRenderWidgetHostView();
@@ -67,13 +67,35 @@ class CONTENT_EXPORT FrameConnectorDelegate {
virtual void SetChildFrameSurface(const viz::SurfaceInfo& surface_info,
const viz::SurfaceSequence& sequence) {}
+ // Sends new resize parameters to the sub-frame's renderer.
+ void UpdateResizeParams(const gfx::Rect& screen_space_rect,
+ const gfx::Size& local_frame_size,
+ const ScreenInfo& screen_info,
+ uint64_t sequence_number,
+ const viz::SurfaceId& surface_id);
+
+ // Return the size of the CompositorFrame to use in the child renderer.
+ const gfx::Size& local_frame_size_in_pixels() {
+ return local_frame_size_in_pixels_;
+ }
+
+ // Return the size of the CompositorFrame to use in the child renderer in DIP.
+ // This is used to set the layout size of the child renderer.
+ const gfx::Size& local_frame_size_in_dip() {
+ return local_frame_size_in_dip_;
+ }
+
// Return the rect in DIP that the RenderWidgetHostViewChildFrame's content
// will render into.
- const gfx::Rect& frame_rect_in_dip() { return frame_rect_in_dip_; }
+ const gfx::Rect& screen_space_rect_in_dip() {
+ return screen_space_rect_in_dip_;
+ }
// Return the rect in pixels that the RenderWidgetHostViewChildFrame's content
// will render into.
- const gfx::Rect& frame_rect_in_pixels() { return frame_rect_in_pixels_; }
+ const gfx::Rect& screen_space_rect_in_pixels() {
+ return screen_space_rect_in_pixels_;
+ }
// Request that the platform change the mouse cursor when the mouse is
// positioned over this view's content.
@@ -172,9 +194,14 @@ class CONTENT_EXPORT FrameConnectorDelegate {
// nested child RWHVCFs inside it.
virtual void SetVisibilityForChildViews(bool visible) const {}
- // Called to resize the child renderer. |frame_rect| is in pixels if
+ // Called to resize the child renderer's CompositorFrame.
+ // |local_frame_size| is in pixels if zoom-for-dsf is enabled, and in DIP
+ // if not.
+ virtual void SetLocalFrameSize(const gfx::Size& local_frame_size);
+
+ // Called to resize the child renderer. |screen_space_rect| is in pixels if
// zoom-for-dsf is enabled, and in DIP if not.
- virtual void SetRect(const gfx::Rect& frame_rect);
+ virtual void SetScreenSpaceRect(const gfx::Rect& screen_space_rect);
#if defined(USE_AURA)
// Embeds a WindowTreeClient in the parent. This results in the parent
@@ -193,13 +220,18 @@ class CONTENT_EXPORT FrameConnectorDelegate {
virtual ~FrameConnectorDelegate() {}
+ // The RenderWidgetHostView for the frame. Initially NULL.
+ RenderWidgetHostViewChildFrame* view_ = nullptr;
+
// This is here rather than in the implementation class so that
// ViewportIntersection() can return a reference.
gfx::Rect viewport_intersection_rect_;
ScreenInfo screen_info_;
- gfx::Rect frame_rect_in_dip_;
- gfx::Rect frame_rect_in_pixels_;
+ gfx::Size local_frame_size_in_dip_;
+ gfx::Size local_frame_size_in_pixels_;
+ gfx::Rect screen_space_rect_in_dip_;
+ gfx::Rect screen_space_rect_in_pixels_;
viz::LocalSurfaceId local_surface_id_;
const bool use_zoom_for_device_scale_factor_;
diff --git a/chromium/content/browser/renderer_host/render_process_host_impl.cc b/chromium/content/browser/renderer_host/render_process_host_impl.cc
index 22c72f3ac92..0e57990b06a 100644
--- a/chromium/content/browser/renderer_host/render_process_host_impl.cc
+++ b/chromium/content/browser/renderer_host/render_process_host_impl.cc
@@ -2100,6 +2100,9 @@ void RenderProcessHostImpl::IncrementKeepAliveRefCount() {
DCHECK_CURRENTLY_ON(BrowserThread::UI);
DCHECK(!is_keep_alive_ref_count_disabled_);
++keep_alive_ref_count_;
+ if (keep_alive_ref_count_ - 1 == 0) {
+ GetRendererInterface()->SetSchedulerKeepActive(true);
+ }
}
void RenderProcessHostImpl::DecrementKeepAliveRefCount() {
@@ -2107,8 +2110,10 @@ void RenderProcessHostImpl::DecrementKeepAliveRefCount() {
DCHECK(!is_keep_alive_ref_count_disabled_);
DCHECK_GT(keep_alive_ref_count_, 0U);
--keep_alive_ref_count_;
- if (keep_alive_ref_count_ == 0)
+ if (keep_alive_ref_count_ == 0) {
Cleanup();
+ GetRendererInterface()->SetSchedulerKeepActive(false);
+ }
}
void RenderProcessHostImpl::DisableKeepAliveRefCount() {
diff --git a/chromium/content/browser/renderer_host/render_widget_host_view_child_frame.cc b/chromium/content/browser/renderer_host/render_widget_host_view_child_frame.cc
index efab4c1e53f..a408a685a3c 100644
--- a/chromium/content/browser/renderer_host/render_widget_host_view_child_frame.cc
+++ b/chromium/content/browser/renderer_host/render_widget_host_view_child_frame.cc
@@ -203,12 +203,11 @@ void RenderWidgetHostViewChildFrame::InitAsChild(gfx::NativeView parent_view) {
}
void RenderWidgetHostViewChildFrame::SetSize(const gfx::Size& size) {
- host_->WasResized();
+ // Resizing happens in CrossProcessFrameConnector for child frames.
}
void RenderWidgetHostViewChildFrame::SetBounds(const gfx::Rect& rect) {
- SetSize(rect.size());
-
+ // Resizing happens in CrossProcessFrameConnector for child frames.
if (rect != last_screen_rect_) {
last_screen_rect_ = rect;
host_->SendScreenRects();
@@ -256,16 +255,23 @@ bool RenderWidgetHostViewChildFrame::IsShowing() {
gfx::Rect RenderWidgetHostViewChildFrame::GetViewBounds() const {
gfx::Rect rect;
if (frame_connector_) {
- rect = frame_connector_->frame_rect_in_dip();
+ rect = frame_connector_->screen_space_rect_in_dip();
RenderWidgetHostView* parent_view =
frame_connector_->GetParentRenderWidgetHostView();
// The parent_view can be null in tests when using a TestWebContents.
if (parent_view) {
- // Translate frame_rect by the parent's RenderWidgetHostView offset.
+ // Translate screen_space_rect by the parent's RenderWidgetHostView
+ // offset.
rect.Offset(parent_view->GetViewBounds().OffsetFromOrigin());
}
+ // TODO(fsamuel): GetViewBounds is a bit of a mess. It's used to determine
+ // the size of the renderer content and where to place context menus and so
+ // on. We want the location of the frame in screen coordinates to place
+ // popups but we want the size in local coordinates to produce the right-
+ // sized CompositorFrames.
+ rect.set_size(frame_connector_->local_frame_size_in_dip());
}
return rect;
}
@@ -329,8 +335,10 @@ SkColor RenderWidgetHostViewChildFrame::background_color() const {
}
gfx::Size RenderWidgetHostViewChildFrame::GetPhysicalBackingSize() const {
+ // TODO(fsamuel): Consider renaming GetPhysicalBackingSize to
+ // GetCompositorViewportSize.
if (frame_connector_)
- return frame_connector_->frame_rect_in_pixels().size();
+ return frame_connector_->local_frame_size_in_pixels();
return gfx::Size();
}
diff --git a/chromium/content/browser/renderer_host/render_widget_host_view_child_frame_unittest.cc b/chromium/content/browser/renderer_host/render_widget_host_view_child_frame_unittest.cc
index 4a488039d49..04dbb195e72 100644
--- a/chromium/content/browser/renderer_host/render_widget_host_view_child_frame_unittest.cc
+++ b/chromium/content/browser/renderer_host/render_widget_host_view_child_frame_unittest.cc
@@ -16,6 +16,7 @@
#include "base/test/scoped_task_environment.h"
#include "base/threading/thread_task_runner_handle.h"
#include "build/build_config.h"
+#include "components/viz/common/surfaces/parent_local_surface_id_allocator.h"
#include "components/viz/common/surfaces/surface_sequence.h"
#include "components/viz/service/frame_sinks/compositor_frame_sink_support.h"
#include "components/viz/service/frame_sinks/frame_sink_manager_impl.h"
@@ -107,6 +108,7 @@ class RenderWidgetHostViewChildFrameTest : public testing::Test {
test_frame_connector_ =
new MockFrameConnectorDelegate(use_zoom_for_device_scale_factor);
+ test_frame_connector_->SetView(view_);
view_->SetFrameConnectorDelegate(test_frame_connector_);
viz::mojom::CompositorFrameSinkPtr sink;
@@ -345,14 +347,50 @@ TEST_F(RenderWidgetHostViewChildFrameZoomForDSFTest, PhysicalBackingSize) {
screen_info.device_scale_factor = 2.0f;
test_frame_connector_->SetScreenInfoForTesting(screen_info);
- gfx::Size frame_size_in_pixels(1276, 410);
- gfx::Rect frame_rect_in_pixels(frame_size_in_pixels);
- test_frame_connector_->SetRect(frame_rect_in_pixels);
- EXPECT_EQ(frame_size_in_pixels, view_->GetPhysicalBackingSize());
+ gfx::Size local_frame_size(1276, 410);
+ test_frame_connector_->SetLocalFrameSize(local_frame_size);
+ EXPECT_EQ(local_frame_size, view_->GetPhysicalBackingSize());
+
+ gfx::Rect screen_space_rect(local_frame_size);
+ screen_space_rect.set_origin(gfx::Point(230, 263));
+ test_frame_connector_->SetScreenSpaceRect(screen_space_rect);
+ EXPECT_EQ(local_frame_size, view_->GetPhysicalBackingSize());
+ EXPECT_EQ(gfx::Point(115, 131), view_->GetViewBounds().origin());
+ EXPECT_EQ(gfx::Point(230, 263),
+ test_frame_connector_->screen_space_rect_in_pixels().origin());
+}
+
+// Tests that WasResized is called only once and all the parameters change
+// atomically.
+TEST_F(RenderWidgetHostViewChildFrameTest, WasResizedOncePerChange) {
+ MockRenderProcessHost* process =
+ static_cast<MockRenderProcessHost*>(widget_host_->GetProcess());
+ process->Init();
+
+ widget_host_->Init();
+
+ constexpr gfx::Size physical_backing_size(100, 100);
+ constexpr gfx::Rect screen_space_rect(physical_backing_size);
+ viz::ParentLocalSurfaceIdAllocator allocator;
+ viz::LocalSurfaceId local_surface_id = allocator.GenerateId();
+ constexpr viz::FrameSinkId frame_sink_id(1, 1);
+ const viz::SurfaceId surface_id(frame_sink_id, local_surface_id);
+
+ process->sink().ClearMessages();
+
+ test_frame_connector_->UpdateResizeParams(
+ screen_space_rect, physical_backing_size, ScreenInfo(), 1u, surface_id);
+
+ ASSERT_EQ(1u, process->sink().message_count());
- frame_rect_in_pixels.set_origin(gfx::Point(230, 263));
- test_frame_connector_->SetRect(frame_rect_in_pixels);
- EXPECT_EQ(frame_size_in_pixels, view_->GetPhysicalBackingSize());
+ const IPC::Message* resize_msg =
+ process->sink().GetUniqueMessageMatching(ViewMsg_Resize::ID);
+ ASSERT_NE(nullptr, resize_msg);
+ ViewMsg_Resize::Param params;
+ ViewMsg_Resize::Read(resize_msg, &params);
+ EXPECT_EQ(physical_backing_size, std::get<0>(params).physical_backing_size);
+ EXPECT_EQ(screen_space_rect.size(), std::get<0>(params).new_size);
+ EXPECT_EQ(local_surface_id, std::get<0>(params).local_surface_id);
}
} // namespace content
diff --git a/chromium/content/browser/service_worker/embedded_worker_test_helper.cc b/chromium/content/browser/service_worker/embedded_worker_test_helper.cc
index 750a2511bf7..7703a6a0c1a 100644
--- a/chromium/content/browser/service_worker/embedded_worker_test_helper.cc
+++ b/chromium/content/browser/service_worker/embedded_worker_test_helper.cc
@@ -387,6 +387,7 @@ class EmbeddedWorkerTestHelper::MockRendererInterface : public mojom::Renderer {
}
void PurgePluginListCache(bool reload_pages) override { NOTREACHED(); }
void SetProcessBackgrounded(bool backgrounded) override { NOTREACHED(); }
+ void SetSchedulerKeepActive(bool keep_active) override { NOTREACHED(); }
void ProcessPurgeAndSuspend() override { NOTREACHED(); }
base::WeakPtr<EmbeddedWorkerTestHelper> helper_;
diff --git a/chromium/content/browser/service_worker/service_worker_handle.cc b/chromium/content/browser/service_worker/service_worker_handle.cc
index 8be8695ee1c..317aa612c86 100644
--- a/chromium/content/browser/service_worker/service_worker_handle.cc
+++ b/chromium/content/browser/service_worker/service_worker_handle.cc
@@ -10,6 +10,7 @@
#include "content/browser/service_worker/service_worker_type_converters.h"
#include "content/common/service_worker/service_worker_messages.h"
#include "content/common/service_worker/service_worker_types.h"
+#include "content/public/common/browser_side_navigation_policy.h"
#include "content/public/common/service_worker_modes.h"
namespace content {
diff --git a/chromium/content/browser/service_worker/service_worker_provider_host.cc b/chromium/content/browser/service_worker/service_worker_provider_host.cc
index 9e688a8de4e..7e17e98f26b 100644
--- a/chromium/content/browser/service_worker/service_worker_provider_host.cc
+++ b/chromium/content/browser/service_worker/service_worker_provider_host.cc
@@ -510,6 +510,8 @@ ServiceWorkerProviderHost::GetOrCreateServiceWorkerHandle(
if (!context_ || !version)
return blink::mojom::ServiceWorkerObjectInfo::New();
if (!dispatcher_host_) {
+ DCHECK(ServiceWorkerUtils::IsServicificationEnabled() ||
+ IsNavigationMojoResponseEnabled());
// This is called before the dispatcher host is created.
auto info = blink::mojom::ServiceWorkerObjectInfo::New();
info->handle_id = context_->GetNewServiceWorkerHandleId();
@@ -613,9 +615,12 @@ void ServiceWorkerProviderHost::CompleteNavigationInitialized(
if (!controller_)
return;
- if (ServiceWorkerUtils::IsServicificationEnabled()) {
- // S13nServiceWorker: register the controller service worker with the
- // pre-created handle ID.
+ if ((ServiceWorkerUtils::IsServicificationEnabled() ||
+ IsNavigationMojoResponseEnabled()) &&
+ precreated_controller_handle_id_ !=
+ blink::mojom::kInvalidServiceWorkerHandleId) {
+ // S13nServiceWorker: register the pre-created handle for the controller
+ // service worker with the dispatcher host, now that it exists.
DCHECK_NE(blink::mojom::kInvalidServiceWorkerHandleId,
precreated_controller_handle_id_);
std::unique_ptr<ServiceWorkerHandle> new_handle(
@@ -625,10 +630,12 @@ void ServiceWorkerProviderHost::CompleteNavigationInitialized(
dispatcher_host_->RegisterServiceWorkerHandle(std::move(new_handle));
}
- // In S13nServiceWorker case the controller is already sent in navigation
- // commit, but we still need this for S13nServiceWorker case for setting the
- // use counter correctly.
- // TODO(kinuko): Stop doing this in S13nServiceWorker case.
+ // In S13nServiceWorker/NavigationMojoResponse case the controller is already
+ // sent in navigation commit, but we still need this for
+ // S13nServiceWorker/NavigationMojoResponse case for setting the use counter
+ // correctly.
+ // TODO(kinuko): Stop doing this in S13nServiceWorker/NavigationMojoResponse
+ // case.
SendSetControllerServiceWorker(controller_.get(),
false /* notify_controllerchange */);
}
diff --git a/chromium/content/browser/service_worker/service_worker_provider_host.h b/chromium/content/browser/service_worker/service_worker_provider_host.h
index c976257f681..327ec3530c6 100644
--- a/chromium/content/browser/service_worker/service_worker_provider_host.h
+++ b/chromium/content/browser/service_worker/service_worker_provider_host.h
@@ -583,7 +583,7 @@ class CONTENT_EXPORT ServiceWorkerProviderHost
std::vector<base::Closure> queued_events_;
- // S13nServiceWorker:
+ // S13nServiceWorker/NavigationMojoResponse:
// A service worker handle ID for the controller service worker that is
// pre-created before the renderer process (and therefore the dispatcher host)
// is created.
diff --git a/chromium/content/browser/site_per_process_browsertest.cc b/chromium/content/browser/site_per_process_browsertest.cc
index 22e0ef83fb4..0565e9ddfa0 100644
--- a/chromium/content/browser/site_per_process_browsertest.cc
+++ b/chromium/content/browser/site_per_process_browsertest.cc
@@ -85,6 +85,7 @@
#include "content/shell/browser/shell.h"
#include "content/shell/common/shell_switches.h"
#include "content/test/content_browser_test_utils_internal.h"
+#include "content/test/did_commit_provisional_load_interceptor.h"
#include "content/test/mock_overscroll_observer.h"
#include "ipc/constants.mojom.h"
#include "ipc/ipc_security_test_util.h"
@@ -1189,6 +1190,51 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, TitleAfterCrossSiteIframe) {
EXPECT_EQ(expected_title, entry->GetTitle());
}
+// Test that the physical backing size and view bounds for a scaled out-of-
+// process iframe are set and updated correctly.
+IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, PhysicalBackingSizeTest) {
+ GURL main_url(embedded_test_server()->GetURL(
+ "a.com", "/frame_tree/page_with_scaled_frame.html"));
+ EXPECT_TRUE(NavigateToURL(shell(), main_url));
+
+ FrameTreeNode* root = static_cast<WebContentsImpl*>(shell()->web_contents())
+ ->GetFrameTree()
+ ->root();
+
+ ASSERT_EQ(1U, root->child_count());
+
+ FrameTreeNode* parent_iframe_node = root->child_at(0);
+
+ EXPECT_EQ(
+ " Site A ------------ proxies for B\n"
+ " +--Site A ------- proxies for B\n"
+ " +--Site B -- proxies for A\n"
+ "Where A = http://a.com/\n"
+ " B = http://baz.com/",
+ DepictFrameTree(root));
+
+ FrameTreeNode* nested_iframe_node = parent_iframe_node->child_at(0);
+ RenderFrameProxyHost* proxy_to_parent =
+ nested_iframe_node->render_manager()->GetProxyToParent();
+ CrossProcessFrameConnector* connector =
+ proxy_to_parent->cross_process_frame_connector();
+ RenderWidgetHostViewBase* rwhv_nested =
+ static_cast<RenderWidgetHostViewBase*>(
+ nested_iframe_node->current_frame_host()
+ ->GetRenderWidgetHost()
+ ->GetView());
+
+ WaitForChildFrameSurfaceReady(nested_iframe_node->current_frame_host());
+
+ // Verify that applying a CSS scale transform does not impact the size of the
+ // content of the nested iframe.
+ EXPECT_EQ(gfx::Size(50, 50), connector->screen_space_rect_in_dip().size());
+ EXPECT_EQ(gfx::Size(100, 100), rwhv_nested->GetViewBounds().size());
+ EXPECT_EQ(gfx::Size(100, 100), connector->local_frame_size_in_dip());
+ EXPECT_EQ(connector->local_frame_size_in_pixels(),
+ rwhv_nested->GetPhysicalBackingSize());
+}
+
// Test that the view bounds for an out-of-process iframe are set and updated
// correctly, including accounting for local frame offsets in the parent and
// scroll positions.
@@ -1224,7 +1270,6 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, ViewBoundsInNestedFrameTest) {
nested_iframe_node->current_frame_host()
->GetRenderWidgetHost()
->GetView());
-
WaitForChildFrameSurfaceReady(nested_iframe_node->current_frame_host());
float scale_factor = GetPageScaleFactor(shell());
@@ -6802,12 +6847,18 @@ class SitePerProcessMouseWheelBrowserTest : public SitePerProcessBrowserTest {
EXPECT_EQ("\"scroll: 3\"", reply);
}
+ protected:
+ base::test::ScopedFeatureList scroll_latching_feature_list_;
+
private:
RenderWidgetHostViewAura* rwhv_root_;
};
IN_PROC_BROWSER_TEST_F(SitePerProcessMouseWheelBrowserTest,
SubframeWheelEventsOnMainThread) {
+ scroll_latching_feature_list_.InitWithFeatures({},
+ {features::kTouchpadAndWheelScrollLatching,
+ features::kAsyncWheelEvents});
GURL main_url(embedded_test_server()->GetURL(
"/frame_tree/page_with_positioned_nested_frames.html"));
EXPECT_TRUE(NavigateToURL(shell(), main_url));
@@ -6823,6 +6874,7 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessMouseWheelBrowserTest,
// surface information required for event hit testing is ready.
RenderWidgetHostViewBase* child_rwhv = static_cast<RenderWidgetHostViewBase*>(
root->child_at(0)->current_frame_host()->GetView());
+ EXPECT_FALSE(child_rwhv->wheel_scroll_latching_enabled());
WaitForChildFrameSurfaceReady(root->child_at(0)->current_frame_host());
content::RenderFrameHostImpl* child = root->child_at(0)->current_frame_host();
@@ -6838,6 +6890,9 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessMouseWheelBrowserTest,
// the same page loaded in the mainframe.
IN_PROC_BROWSER_TEST_F(SitePerProcessMouseWheelBrowserTest,
MainframeWheelEventsOnMainThread) {
+ scroll_latching_feature_list_.InitWithFeatures({},
+ {features::kTouchpadAndWheelScrollLatching,
+ features::kAsyncWheelEvents});
GURL main_url(
embedded_test_server()->GetURL("/page_with_scrollable_div.html"));
EXPECT_TRUE(NavigateToURL(shell(), main_url));
@@ -6846,6 +6901,9 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessMouseWheelBrowserTest,
content::RenderFrameHostImpl* rfhi = root->current_frame_host();
SetupWheelAndScrollHandlers(rfhi);
+ EXPECT_FALSE(
+ rfhi->GetRenderWidgetHost()->GetView()->wheel_scroll_latching_enabled());
+
gfx::Point pos(10, 10);
RunTest(pos, rfhi->GetRenderWidgetHost()->GetView());
@@ -13365,4 +13423,260 @@ IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, HitTestNestedFrames) {
}
}
+namespace {
+
+// Intercepts the next DidCommitProvisionalLoad message for |deferred_url| in
+// any frame of the |web_contents|, and holds off on dispatching it until
+// *after* the DidCommitProvisionalLoad message for the next navigation in the
+// |web_contents| has been dispatched.
+//
+// Reversing the order in which the commit messages are dispatched simulates a
+// busy renderer that takes a very long time to actually commit the navigation
+// to |deferred_url| after receiving FrameNavigationControl::CommitNavigation;
+// whereas there is a fast cross-site navigation taking place in the same
+// frame which starts second but finishes first.
+class CommitMessageOrderReverser : public DidCommitProvisionalLoadInterceptor {
+ public:
+ using DidStartDeferringCommitCallback =
+ base::OnceCallback<void(RenderFrameHost*)>;
+
+ CommitMessageOrderReverser(
+ WebContents* web_contents,
+ const GURL& deferred_url,
+ DidStartDeferringCommitCallback deferred_url_triggered_action)
+ : DidCommitProvisionalLoadInterceptor(web_contents),
+ deferred_url_(deferred_url),
+ deferred_url_triggered_action_(
+ std::move(deferred_url_triggered_action)) {}
+ ~CommitMessageOrderReverser() override = default;
+
+ void WaitForBothCommits() { outer_run_loop.Run(); }
+
+ protected:
+ void WillDispatchDidCommitProvisionalLoad(
+ RenderFrameHost* render_frame_host,
+ ::FrameHostMsg_DidCommitProvisionalLoad_Params* params,
+ service_manager::mojom::InterfaceProviderRequest*
+ interface_provider_request) override {
+ // The DidCommitProvisionalLoad message is dispatched once this method
+ // returns, so to defer committing the the navigation to |deferred_url_|,
+ // run a nested message loop until the subsequent other commit message is
+ // dispatched.
+ if (params->url == deferred_url_) {
+ std::move(deferred_url_triggered_action_).Run(render_frame_host);
+
+ base::MessageLoop::ScopedNestableTaskAllower allow(
+ base::MessageLoop::current());
+ base::RunLoop nested_run_loop;
+ nested_loop_quit_ = nested_run_loop.QuitClosure();
+ nested_run_loop.Run();
+ outer_run_loop.Quit();
+ } else if (nested_loop_quit_) {
+ std::move(nested_loop_quit_).Run();
+ }
+ }
+
+ private:
+ base::RunLoop outer_run_loop;
+ base::OnceClosure nested_loop_quit_;
+
+ const GURL deferred_url_;
+ DidStartDeferringCommitCallback deferred_url_triggered_action_;
+
+ DISALLOW_COPY_AND_ASSIGN(CommitMessageOrderReverser);
+};
+
+} // namespace
+
+// Regression test for https://crbug.com/877239, simulating the following
+// scenario:
+//
+// 1) http://a.com/empty.html is loaded in a main frame.
+// 2) Dynamically by JS, a same-site child frame is added:
+// <iframe 'src=http://a.com/title1.html'/>.
+// 3) The initial byte of the response for `title1.html` arrives, causing
+// FrameMsg_CommitNavigation to be sent to the same renderer.
+// 4) Just before processing this message, however, `main.html` navigates
+// the iframe to http://baz.com/title2.html, which results in mojom::Frame::
+// BeginNavigation being called on the RenderFrameHost.
+// 5) Suppose that immediately afterwards, `main.html` enters a busy-loop.
+// 6) The cross site navigation in the child frame starts, the first response
+// byte arrives quickly, and thus the navigation commits quickly.
+// 6.1) FrameTreeNode::has_committed_real_load is set to true for the child.
+// 6.2) The same-site RenderFrame in the child FrameTreeNode is swapped out,
+// i.e. FrameMsg_SwapOut is sent.
+// 7) The renderer for site instance `a.com` exits from the busy loop,
+// and starts processing messages in order:
+// 7.1) The first being processed is FrameMsg_CommitNavigation, so a
+// provisional load is created and immediately committed to
+// http://a.com/title1.html.
+// 7.2) Because at the time the same-site child RenderFrame was created,
+// there had been no real load committed in the child frame, and because
+// the navigation from the initial empty document to the first real
+// document was same-origin, the global object is reused and the
+// RemoteInterfaceProvider of the RenderFrame is not rebound.
+// 7.3) The obsoleted load in the same-site child frame commits, calling
+// mojom::Frame::DidCommitProvisionalLoad, however, with
+// |interface_provider_request| being null.
+// 8) RenderFrameHostImpl::DidCommitProvisionalLoad sees that a real load was
+// already committed in the frame, but |interface_provider_request| is
+// missing. However, it also sees that the frame was waiting for a swap-out
+// ACK, so ignores the commit, and does not kill the renderer process.
+//
+// In the simulation of this scenario, we simulate (5) not by delaying
+// renderer-side processing of the CommmitNavigation message, but by delaying
+// browser-side processing of the response to it, of DidCommitProvisionalLoad.
+IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest,
+ InterfaceProviderRequestIsOptionalForRaceyFirstCommits) {
+ const GURL kMainFrameUrl(
+ embedded_test_server()->GetURL("a.com", "/empty.html"));
+ const GURL kSubframeSameSiteUrl(
+ embedded_test_server()->GetURL("a.com", "/title1.html"));
+ const GURL kCrossSiteSubframeUrl(
+ embedded_test_server()->GetURL("baz.com", "/title2.html"));
+
+ const auto kAddSameSiteDynamicSubframe = base::StringPrintf(
+ "var f = document.createElement(\"iframe\");"
+ "f.src=\"%s\";"
+ "document.body.append(f);",
+ kSubframeSameSiteUrl.spec().c_str());
+ const auto kNavigateSubframeCrossSite = base::StringPrintf(
+ "f.src = \"%s\";", kCrossSiteSubframeUrl.spec().c_str());
+ const std::string kExtractSubframeUrl =
+ "window.domAutomationController.send(f.src);";
+
+ ASSERT_TRUE(NavigateToURL(shell(), kMainFrameUrl));
+
+ const auto* main_rfh_site_instance =
+ shell()->web_contents()->GetMainFrame()->GetSiteInstance();
+
+ auto did_start_deferring_commit_callback =
+ base::BindLambdaForTesting([&](RenderFrameHost* subframe_rfh) {
+ // Verify that the subframe starts out as same-process with its parent.
+ ASSERT_EQ(main_rfh_site_instance, subframe_rfh->GetSiteInstance());
+
+ // Trigger the second commit now that we are deferring the first one.
+ ASSERT_TRUE(ExecuteScript(shell(), kNavigateSubframeCrossSite));
+ });
+
+ CommitMessageOrderReverser commit_order_reverser(
+ shell()->web_contents(), kSubframeSameSiteUrl /* deferred_url */,
+ did_start_deferring_commit_callback);
+
+ ASSERT_TRUE(ExecuteScript(shell(), kAddSameSiteDynamicSubframe));
+ commit_order_reverser.WaitForBothCommits();
+
+ // Verify that:
+ // - The cross-site navigation in the sub-frame was committed and the
+ // same-site navigation was ignored.
+ // - The parent frame thinks so, too.
+ // - The renderer process corresponding to the sub-frame with the ignored
+ // commit was not killed. This is verified implicitly: this is the same
+ // renderer process where the parent RenderFrame lives, so if the call to
+ // ExecuteScriptAndExtractString succeeds here, the process is still alive.
+ std::string actual_subframe_url;
+ ASSERT_TRUE(ExecuteScriptAndExtractString(shell(), kExtractSubframeUrl,
+ &actual_subframe_url));
+ EXPECT_EQ(kCrossSiteSubframeUrl.spec(), actual_subframe_url);
+}
+
+// Create an out-of-process iframe that causes itself to be detached during
+// its layout/animate phase. See https://crbug.com/802932.
+IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest, OOPIFDetachDuringAnimation) {
+ GURL main_url(embedded_test_server()->GetURL(
+ "a.com", "/frame_tree/frame-detached-in-animationstart-event.html"));
+ EXPECT_TRUE(NavigateToURL(shell(), main_url));
+ FrameTreeNode* root = web_contents()->GetFrameTree()->root();
+
+ EXPECT_EQ(
+ " Site A ------------ proxies for B\n"
+ " +--Site B ------- proxies for A\n"
+ " +--Site A -- proxies for B\n"
+ "Where A = http://a.com/\n"
+ " B = http://b.com/",
+ DepictFrameTree(root));
+
+ FrameTreeNode* nested_child = root->child_at(0)->child_at(0);
+ WaitForChildFrameSurfaceReady(nested_child->current_frame_host());
+
+ EXPECT_TRUE(
+ ExecuteScript(nested_child->current_frame_host(), "startTest();"));
+
+ // Test passes if the main renderer doesn't crash. Ping to verify.
+ bool success;
+ EXPECT_TRUE(ExecuteScriptAndExtractBool(
+ root->current_frame_host(), "window.domAutomationController.send(true);",
+ &success));
+ EXPECT_TRUE(success);
+}
+
+// Verifies that when navigating an OOPIF to same site and then canceling
+// navigation from beforeunload handler popup will not remove the
+// RemoteFrameView from OOPIF's owner element in the parent process. This test
+// uses OOPIF visibility to make sure RemoteFrameView exists after beforeunload
+// is handled.
+IN_PROC_BROWSER_TEST_F(SitePerProcessBrowserTest,
+ CanceledBeforeUnloadShouldNotClearRemoteFrameView) {
+ GURL a_url(embedded_test_server()->GetURL(
+ "a.com", "/cross_site_iframe_factory.html?a(b)"));
+ EXPECT_TRUE(NavigateToURL(shell(), a_url));
+
+ FrameTreeNode* child_node =
+ web_contents()->GetFrameTree()->root()->child_at(0);
+ GURL b_url(embedded_test_server()->GetURL(
+ "b.com", "/render_frame_host/beforeunload.html"));
+ NavigateFrameToURL(child_node, b_url);
+ FrameConnectorDelegate* frame_connector_delegate =
+ static_cast<RenderWidgetHostViewChildFrame*>(
+ child_node->current_frame_host()->GetView())
+ ->FrameConnectorForTesting();
+
+ // Need user gesture for 'beforeunload' to fire.
+ PrepContentsForBeforeUnloadTest(web_contents());
+
+ // Simulate user choosing to stay on the page after beforeunload fired.
+ SetShouldProceedOnBeforeUnload(shell(), true /* proceed */,
+ false /* success */);
+
+ // First, hide the <iframe>. This goes through RemoteFrameView::Hide() and
+ // eventually updates the FrameConnectorDelegate. Also,
+ // RemoteFrameView::self_visible_ will be set to false which can only be
+ // undone by calling RemoteFrameView::Show. Therefore, potential calls to
+ // RemoteFrameView::SetParentVisible(true) would not update the visibility at
+ // the browser side.
+ ASSERT_TRUE(ExecuteScript(
+ web_contents(),
+ "document.querySelector('iframe').style.visibility = 'hidden';"));
+ while (!frame_connector_delegate->IsHidden()) {
+ base::RunLoop run_loop;
+ base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
+ FROM_HERE, run_loop.QuitClosure(), TestTimeouts::tiny_timeout());
+ run_loop.Run();
+ }
+
+ // Now we navigate the child to about:blank, but since we do not proceed with
+ // the navigation, the OOPIF should stay alive and RemoteFrameView intact.
+ ASSERT_TRUE(ExecuteScript(
+ web_contents(), "document.querySelector('iframe').src = 'about:blank';"));
+ WaitForAppModalDialog(shell());
+
+ // Sanity check: We should still have an OOPIF and hence a RWHVCF.
+ ASSERT_TRUE(static_cast<RenderWidgetHostViewBase*>(
+ child_node->current_frame_host()->GetView())
+ ->IsRenderWidgetHostViewChildFrame());
+
+ // Now make the <iframe> visible again. This calls RemoteFrameView::Show()
+ // only if the RemoteFrameView is the EmbeddedContentView of the corresponding
+ // HTMLFrameOwnerElement.
+ ASSERT_TRUE(ExecuteScript(
+ web_contents(),
+ "document.querySelector('iframe').style.visibility = 'visible';"));
+ while (frame_connector_delegate->IsHidden()) {
+ base::RunLoop run_loop;
+ base::ThreadTaskRunnerHandle::Get()->PostDelayedTask(
+ FROM_HERE, run_loop.QuitClosure(), TestTimeouts::tiny_timeout());
+ run_loop.Run();
+ }
+}
+
} // namespace content
diff --git a/chromium/content/browser/top_document_isolation_browsertest.cc b/chromium/content/browser/top_document_isolation_browsertest.cc
index cedc2f9c64c..de9288e443b 100644
--- a/chromium/content/browser/top_document_isolation_browsertest.cc
+++ b/chromium/content/browser/top_document_isolation_browsertest.cc
@@ -596,20 +596,20 @@ IN_PROC_BROWSER_TEST_F(TopDocumentIsolationTest, PopupAndRedirection) {
DepictFrameTree(root()));
// The popup redirects itself to the advertiser's website (ad.com).
+ RenderFrameDeletedObserver deleted_observer(popup_root->current_frame_host());
RendererInitiatedNavigateToURL(popup_root, ad_url);
+ deleted_observer.WaitUntilDeleted();
// This must join its same-site opener, in the default subframe SiteInstance.
EXPECT_EQ(
- " Site A ------------ proxies for B C\n"
- " +--Site B ------- proxies for A C\n"
+ " Site A ------------ proxies for B\n"
+ " +--Site B ------- proxies for A\n"
"Where A = http://page.com/\n"
- " B = default subframe process\n"
- " C = http://adnetwork.com/",
+ " B = default subframe process",
DepictFrameTree(root()));
EXPECT_EQ(
- " Site C ------------ proxies for B\n"
- "Where B = default subframe process\n"
- " C = http://adnetwork.com/",
+ " Site B\n"
+ "Where B = default subframe process",
DepictFrameTree(popup_root));
}
diff --git a/chromium/content/common/frame.mojom b/chromium/content/common/frame.mojom
index 539864ca831..179cfb60f4f 100644
--- a/chromium/content/common/frame.mojom
+++ b/chromium/content/common/frame.mojom
@@ -62,9 +62,10 @@ interface FrameNavigationControl {
// also be provided by the browser as a a means for the renderer to load
// subresources where applicable.
//
- // When S13nServiceWorker is enabled, |controller_service_worker_info| may
- // also be provided by the browser if the frame that is being navigated
- // is supposed to be controlled by a Service Worker.
+ // When S13nServiceWorker/NavigationMojoResponse is enabled,
+ // |controller_service_worker_info| may also be provided by the browser if the
+ // frame that is being navigated is supposed to be controlled by a Service
+ // Worker.
//
// For automation driver-initiated navigations over the devtools protocol,
// |devtools_navigation_token_| is used to tag the navigation. This navigation
diff --git a/chromium/content/common/frame_messages.h b/chromium/content/common/frame_messages.h
index 7bce348a78d..3e4b79cce1a 100644
--- a/chromium/content/common/frame_messages.h
+++ b/chromium/content/common/frame_messages.h
@@ -1461,8 +1461,9 @@ IPC_MESSAGE_ROUTED3(FrameHostMsg_BeforeUnload_ACK,
IPC_MESSAGE_ROUTED0(FrameHostMsg_SwapOut_ACK)
// Tells the browser that a child's resize parameters have changed.
-IPC_MESSAGE_ROUTED4(FrameHostMsg_UpdateResizeParams,
- gfx::Rect /* frame_rect */,
+IPC_MESSAGE_ROUTED5(FrameHostMsg_UpdateResizeParams,
+ gfx::Rect /* screen_space_rect */,
+ gfx::Size /* local_frame_size */,
content::ScreenInfo /* screen_info */,
uint64_t /* sequence_number */,
viz::SurfaceId /* surface_id */)
diff --git a/chromium/content/common/renderer.mojom b/chromium/content/common/renderer.mojom
index afee0da7cd6..249bbb89925 100644
--- a/chromium/content/common/renderer.mojom
+++ b/chromium/content/common/renderer.mojom
@@ -240,6 +240,11 @@ interface Renderer {
// TODO(crbug:676224) Make this conditional on IPC_MESSAGE_LOG_ENABLED.
SetProcessBackgrounded(bool background);
+ // Tells the scheduler about "keep-alive" state which can be due to:
+ // service workers, shared workers, or fetch keep-alive.
+ // If set to true, then the scheduler should not freeze the renderer.
+ SetSchedulerKeepActive(bool keep_active);
+
// Tells the renderer process to purge and suspend.
ProcessPurgeAndSuspend();
};
diff --git a/chromium/content/public/common/content_features.cc b/chromium/content/public/common/content_features.cc
index 66f7c3b8aae..cf9b28c6237 100644
--- a/chromium/content/public/common/content_features.cc
+++ b/chromium/content/public/common/content_features.cc
@@ -122,7 +122,7 @@ const base::Feature kFontCacheScaling{"FontCacheScaling",
// same-origin to the top frame, or if a user gesture is being processed.
const base::Feature kFramebustingNeedsSameOriginOrUserGesture{
"FramebustingNeedsSameOriginOrUserGesture",
- base::FEATURE_ENABLED_BY_DEFAULT};
+ base::FEATURE_DISABLED_BY_DEFAULT};
// Enables extended Gamepad API features like motion tracking and haptics.
const base::Feature kGamepadExtensions{"GamepadExtensions",
diff --git a/chromium/content/renderer/device_sensors/fake_sensor_and_provider.cc b/chromium/content/renderer/device_sensors/fake_sensor_and_provider.cc
index 8fee527e212..8f475090a7e 100644
--- a/chromium/content/renderer/device_sensors/fake_sensor_and_provider.cc
+++ b/chromium/content/renderer/device_sensors/fake_sensor_and_provider.cc
@@ -20,6 +20,15 @@ FakeSensor::FakeSensor(device::mojom::SensorType sensor_type)
shared_buffer_handle_ = mojo::SharedBufferHandle::Create(
sizeof(device::SensorReadingSharedBuffer) *
static_cast<uint64_t>(device::mojom::SensorType::LAST));
+
+ if (!shared_buffer_handle_.is_valid())
+ return;
+
+ // Create read/write mapping now, to ensure it is kept writable
+ // after the region is sealed read-only on Android.
+ shared_buffer_mapping_ = shared_buffer_handle_->MapAtOffset(
+ device::mojom::SensorInitParams::kReadBufferSizeForTests,
+ GetBufferOffset());
}
FakeSensor::~FakeSensor() = default;
@@ -81,16 +90,12 @@ void FakeSensor::SetReading(device::SensorReading reading) {
}
void FakeSensor::SensorReadingChanged() {
- if (!shared_buffer_handle_.is_valid())
+ if (!shared_buffer_mapping_.get())
return;
- mojo::ScopedSharedBufferMapping shared_buffer =
- shared_buffer_handle_->MapAtOffset(
- device::mojom::SensorInitParams::kReadBufferSizeForTests,
- GetBufferOffset());
+ auto* buffer = static_cast<device::SensorReadingSharedBuffer*>(
+ shared_buffer_mapping_.get());
- device::SensorReadingSharedBuffer* buffer =
- static_cast<device::SensorReadingSharedBuffer*>(shared_buffer.get());
auto& seqlock = buffer->seqlock.value();
seqlock.WriteBegin();
buffer->reading = reading_;
diff --git a/chromium/content/renderer/device_sensors/fake_sensor_and_provider.h b/chromium/content/renderer/device_sensors/fake_sensor_and_provider.h
index d9a61387fd7..0fde38d3df1 100644
--- a/chromium/content/renderer/device_sensors/fake_sensor_and_provider.h
+++ b/chromium/content/renderer/device_sensors/fake_sensor_and_provider.h
@@ -57,6 +57,7 @@ class FakeSensor : public device::mojom::Sensor {
device::mojom::SensorType sensor_type_;
bool reading_notification_enabled_ = true;
mojo::ScopedSharedBufferHandle shared_buffer_handle_;
+ mojo::ScopedSharedBufferMapping shared_buffer_mapping_;
device::mojom::SensorClientPtr client_;
device::SensorReading reading_;
diff --git a/chromium/content/renderer/loader/site_isolation_stats_gatherer_browsertest.cc b/chromium/content/renderer/loader/site_isolation_stats_gatherer_browsertest.cc
index b0e75551bfa..9d1fed14ad2 100644
--- a/chromium/content/renderer/loader/site_isolation_stats_gatherer_browsertest.cc
+++ b/chromium/content/renderer/loader/site_isolation_stats_gatherer_browsertest.cc
@@ -143,7 +143,7 @@ IN_PROC_BROWSER_TEST_F(SiteIsolationStatsGathererBrowserTest,
// access, the XHR requests should succeed, but the UMA histograms should
// record that they would have been blocked. This test is only possible since
// we run the browser without the same origin policy.
- GURL foo("http://foo.com/cross_site_document_request.html");
+ GURL foo("http://foo.com/cross_site_document_blocking/request.html");
EXPECT_TRUE(NavigateToURL(shell(), foo));
@@ -199,7 +199,7 @@ IN_PROC_BROWSER_TEST_F(SiteIsolationStatsGathererBrowserTest,
// TODO(nick): Split up these cases, and add positive assertions here about
// what actually happens in these various resource-block cases.
- GURL foo("http://foo.com/cross_site_document_request_target.html");
+ GURL foo("http://foo.com/cross_site_document_blocking/request_target.html");
EXPECT_TRUE(NavigateToURL(shell(), foo));
}
diff --git a/chromium/content/renderer/media_capture_from_element/canvas_capture_handler.cc b/chromium/content/renderer/media_capture_from_element/canvas_capture_handler.cc
index 5274cea9893..fb30f7d73b1 100644
--- a/chromium/content/renderer/media_capture_from_element/canvas_capture_handler.cc
+++ b/chromium/content/renderer/media_capture_from_element/canvas_capture_handler.cc
@@ -289,6 +289,7 @@ void CanvasCaptureHandler::ReadARGBPixelsAsync(
base::Bind(&CanvasCaptureHandler::OnARGBPixelsReadAsync,
weak_ptr_factory_.GetWeakPtr(), image, temp_argb_frame,
timestamp, surface_origin != kTopLeft_GrSurfaceOrigin));
+ context_provider->InvalidateGrContext(kTextureBinding_GrGLBackendState);
}
void CanvasCaptureHandler::ReadYUVPixelsAsync(
diff --git a/chromium/content/renderer/pepper/video_decoder_shim.cc b/chromium/content/renderer/pepper/video_decoder_shim.cc
index d399b8a3028..63d241f5b54 100644
--- a/chromium/content/renderer/pepper/video_decoder_shim.cc
+++ b/chromium/content/renderer/pepper/video_decoder_shim.cc
@@ -37,7 +37,6 @@
#include "ppapi/c/pp_errors.h"
#include "services/ui/public/cpp/gpu/context_provider_command_buffer.h"
#include "third_party/skia/include/gpu/GrTypes.h"
-#include "ui/gfx/color_transform.h"
namespace content {
@@ -72,8 +71,7 @@ class VideoDecoderShim::YUVConverter {
void Convert(const scoped_refptr<media::VideoFrame>& frame, GLuint tex_out);
private:
- GLuint CreateShader(const gfx::ColorSpace& from_colorspace,
- const gfx::ColorSpace& to_colorspace);
+ GLuint CreateShader();
GLuint CompileShader(const char* name, GLuint type, const char* code);
GLuint CreateProgram(const char* name, GLuint vshader, GLuint fshader);
GLuint CreateTexture();
@@ -83,7 +81,6 @@ class VideoDecoderShim::YUVConverter {
GLuint frame_buffer_;
GLuint vertex_buffer_;
GLuint program_;
- gfx::ColorSpace last_color_space_;
GLuint y_texture_;
GLuint u_texture_;
@@ -102,6 +99,9 @@ class VideoDecoderShim::YUVConverter {
uint32_t uv_height_divisor_;
uint32_t uv_width_divisor_;
+ GLint yuv_matrix_loc_;
+ GLint yuv_adjust_loc_;
+
DISALLOW_COPY_AND_ASSIGN(YUVConverter);
};
@@ -124,7 +124,9 @@ VideoDecoderShim::YUVConverter::YUVConverter(
uv_width_(2),
uv_height_(2),
uv_height_divisor_(1),
- uv_width_divisor_(1) {
+ uv_width_divisor_(1),
+ yuv_matrix_loc_(0),
+ yuv_adjust_loc_(0) {
DCHECK(gl_);
}
@@ -233,9 +235,7 @@ GLuint VideoDecoderShim::YUVConverter::CreateProgram(const char* name,
return program;
}
-GLuint VideoDecoderShim::YUVConverter::CreateShader(
- const gfx::ColorSpace& from_colorspace,
- const gfx::ColorSpace& to_colorspace) {
+GLuint VideoDecoderShim::YUVConverter::CreateShader() {
const char* vert_shader =
"precision mediump float;\n"
"attribute vec2 position;\n"
@@ -246,32 +246,22 @@ GLuint VideoDecoderShim::YUVConverter::CreateShader(
" texcoord = position*0.5+0.5;\n"
"}";
- std::string frag_shader =
+ const char* frag_shader =
"precision mediump float;\n"
"varying vec2 texcoord;\n"
"uniform sampler2D y_sampler;\n"
"uniform sampler2D u_sampler;\n"
"uniform sampler2D v_sampler;\n"
- "uniform sampler2D a_sampler;\n";
-
- std::unique_ptr<gfx::ColorTransform> transform(
- gfx::ColorTransform::NewColorTransform(
- from_colorspace, to_colorspace,
- gfx::ColorTransform::Intent::INTENT_PERCEPTUAL));
- if (!transform->CanGetShaderSource()) {
- transform = gfx::ColorTransform::NewColorTransform(
- gfx::ColorSpace::CreateREC709(), gfx::ColorSpace::CreateSRGB(),
- gfx::ColorTransform::Intent::INTENT_PERCEPTUAL);
- }
- frag_shader += transform->GetShaderSource();
- frag_shader +=
+ "uniform sampler2D a_sampler;\n"
+ "uniform mat3 yuv_matrix;\n"
+ "uniform vec3 yuv_adjust;\n"
"void main()\n"
"{\n"
" vec3 yuv = vec3(texture2D(y_sampler, texcoord).x,\n"
" texture2D(u_sampler, texcoord).x,\n"
" texture2D(v_sampler, texcoord).x) +\n"
" yuv_adjust;\n"
- " gl_FragColor = vec4(DoColorConversion(yuv), texture2D(a_sampler, "
+ " gl_FragColor = vec4(yuv_matrix * yuv, texture2D(a_sampler, "
"texcoord).x);\n"
"}";
@@ -282,7 +272,7 @@ GLuint VideoDecoderShim::YUVConverter::CreateShader(
}
GLuint fragment_shader =
- CompileShader("Fragment Shader", GL_FRAGMENT_SHADER, frag_shader.c_str());
+ CompileShader("Fragment Shader", GL_FRAGMENT_SHADER, frag_shader);
if (!fragment_shader) {
gl_->DeleteShader(vertex_shader);
return 0;
@@ -319,6 +309,12 @@ GLuint VideoDecoderShim::YUVConverter::CreateShader(
gl_->UseProgram(0);
+ yuv_matrix_loc_ = gl_->GetUniformLocation(program, "yuv_matrix");
+ DCHECK(yuv_matrix_loc_ != -1);
+
+ yuv_adjust_loc_ = gl_->GetUniformLocation(program, "yuv_adjust");
+ DCHECK(yuv_adjust_loc_ != -1);
+
return program;
}
@@ -355,24 +351,65 @@ bool VideoDecoderShim::YUVConverter::Initialize() {
GL_STATIC_DRAW);
gl_->BindBuffer(GL_ARRAY_BUFFER, 0);
+ program_ = CreateShader();
+
gl_->TraceEndCHROMIUM();
context_provider_->InvalidateGrContext(kGrInvalidateState);
- return true;
+ return (program_ != 0);
}
void VideoDecoderShim::YUVConverter::Convert(
const scoped_refptr<media::VideoFrame>& frame,
GLuint tex_out) {
- if (frame->ColorSpace() != last_color_space_ || !program_) {
- last_color_space_ = frame->ColorSpace();
- if (program_)
- gl_->DeleteProgram(program_);
- program_ = CreateShader(last_color_space_, gfx::ColorSpace::CreateSRGB());
- }
+ const float* yuv_matrix = nullptr;
+ const float* yuv_adjust = nullptr;
if (video_format_ != frame->format()) {
+ // The constants below were taken from
+ // components/viz/service/display/gl_renderer.cc. These values are magic
+ // numbers that are used in the transformation from YUV to RGB color values.
+ // They are taken from the following webpage:
+ // http://www.fourcc.org/fccyvrgb.php
+ const float yuv_to_rgb_rec601[9] = {
+ 1.164f, 1.164f, 1.164f, 0.0f, -.391f, 2.018f, 1.596f, -.813f, 0.0f,
+ };
+ const float yuv_to_rgb_jpeg[9] = {
+ 1.f, 1.f, 1.f, 0.0f, -.34414f, 1.772f, 1.402f, -.71414f, 0.0f,
+ };
+ const float yuv_to_rgb_rec709[9] = {
+ 1.164f, 1.164f, 1.164f, 0.0f, -0.213f, 2.112f, 1.793f, -0.533f, 0.0f,
+ };
+
+ // These values map to 16, 128, and 128 respectively, and are computed
+ // as a fraction over 256 (e.g. 16 / 256 = 0.0625).
+ // They are used in the YUV to RGBA conversion formula:
+ // Y - 16 : Gives 16 values of head and footroom for overshooting
+ // U - 128 : Turns unsigned U into signed U [-128,127]
+ // V - 128 : Turns unsigned V into signed V [-128,127]
+ const float yuv_adjust_constrained[3] = {
+ -0.0625f, -0.5f, -0.5f,
+ };
+ // Same as above, but without the head and footroom.
+ const float yuv_adjust_full[3] = {
+ 0.0f, -0.5f, -0.5f,
+ };
+
+ yuv_adjust = yuv_adjust_constrained;
+ yuv_matrix = yuv_to_rgb_rec601;
+
+ int result;
+ if (frame->metadata()->GetInteger(media::VideoFrameMetadata::COLOR_SPACE,
+ &result)) {
+ if (result == media::COLOR_SPACE_JPEG) {
+ yuv_matrix = yuv_to_rgb_jpeg;
+ yuv_adjust = yuv_adjust_full;
+ } else if (result == media::COLOR_SPACE_HD_REC709) {
+ yuv_matrix = yuv_to_rgb_rec709;
+ }
+ }
+
switch (frame->format()) {
case media::PIXEL_FORMAT_I420A:
case media::PIXEL_FORMAT_I420:
@@ -512,6 +549,11 @@ void VideoDecoderShim::YUVConverter::Convert(
gl_->UseProgram(program_);
+ if (yuv_matrix) {
+ gl_->UniformMatrix3fv(yuv_matrix_loc_, 1, 0, yuv_matrix);
+ gl_->Uniform3fv(yuv_adjust_loc_, 1, yuv_adjust);
+ }
+
gl_->BindBuffer(GL_ARRAY_BUFFER, vertex_buffer_);
gl_->EnableVertexAttribArray(0);
gl_->VertexAttribPointer(0, 2, GL_FLOAT, GL_FALSE, 2 * sizeof(GLfloat),
diff --git a/chromium/content/renderer/render_frame_impl.cc b/chromium/content/renderer/render_frame_impl.cc
index f341fb4aec2..03f713d5ff9 100644
--- a/chromium/content/renderer/render_frame_impl.cc
+++ b/chromium/content/renderer/render_frame_impl.cc
@@ -5591,7 +5591,10 @@ bool RenderFrameImpl::UpdateNavigationHistory(
current_history_item_.SetTarget(
blink::WebString::FromUTF8(unique_name_helper_.value()));
bool is_new_navigation = commit_type == blink::kWebStandardCommit;
- if (is_new_navigation) {
+ if (request_params.should_clear_history_list) {
+ render_view_->history_list_offset_ = 0;
+ render_view_->history_list_length_ = 1;
+ } else if (is_new_navigation) {
DCHECK(!navigation_state->common_params().should_replace_current_entry ||
render_view_->history_list_length_ > 0);
if (!navigation_state->common_params().should_replace_current_entry) {
@@ -6652,10 +6655,6 @@ void RenderFrameImpl::PrepareRenderViewForNavigation(
request_params.current_history_list_offset;
render_view_->history_list_length_ =
request_params.current_history_list_length;
- if (request_params.should_clear_history_list) {
- CHECK_EQ(-1, render_view_->history_list_offset_);
- CHECK_EQ(0, render_view_->history_list_length_);
- }
}
void RenderFrameImpl::BeginNavigation(const NavigationPolicyInfo& info) {
diff --git a/chromium/content/renderer/render_frame_proxy.cc b/chromium/content/renderer/render_frame_proxy.cc
index 8f83112633c..e69044f38a3 100644
--- a/chromium/content/renderer/render_frame_proxy.cc
+++ b/chromium/content/renderer/render_frame_proxy.cc
@@ -351,10 +351,10 @@ void RenderFrameProxy::SetChildFrameSurface(
if (!enable_surface_synchronization_) {
compositing_helper_->SetPrimarySurfaceId(surface_info.id(),
- frame_rect().size());
+ local_frame_size());
}
compositing_helper_->SetFallbackSurfaceId(surface_info.id(),
- frame_rect().size(), sequence);
+ local_frame_size(), sequence);
}
bool RenderFrameProxy::OnMessageReceived(const IPC::Message& msg) {
@@ -550,8 +550,10 @@ void RenderFrameProxy::WasResized() {
bool synchronized_params_changed =
!sent_resize_params_ ||
- sent_resize_params_->frame_rect.size() !=
- pending_resize_params_.frame_rect.size() ||
+ sent_resize_params_->local_frame_size !=
+ pending_resize_params_.local_frame_size ||
+ sent_resize_params_->screen_space_rect.size() !=
+ pending_resize_params_.screen_space_rect.size() ||
sent_resize_params_->screen_info != pending_resize_params_.screen_info ||
sent_resize_params_->sequence_number !=
pending_resize_params_.sequence_number;
@@ -560,24 +562,27 @@ void RenderFrameProxy::WasResized() {
local_surface_id_ = parent_local_surface_id_allocator_.GenerateId();
viz::SurfaceId surface_id(frame_sink_id_, local_surface_id_);
- if (enable_surface_synchronization_)
- compositing_helper_->SetPrimarySurfaceId(surface_id, frame_rect().size());
+ if (enable_surface_synchronization_) {
+ compositing_helper_->SetPrimarySurfaceId(surface_id, local_frame_size());
+ }
bool rect_changed =
- !sent_resize_params_ ||
- sent_resize_params_->frame_rect != pending_resize_params_.frame_rect;
+ !sent_resize_params_ || sent_resize_params_->screen_space_rect !=
+ pending_resize_params_.screen_space_rect;
bool resize_params_changed = synchronized_params_changed || rect_changed;
#if defined(USE_AURA)
- if (rect_changed && mus_embedded_frame_)
- mus_embedded_frame_->SetWindowBounds(local_surface_id_, frame_rect());
+ if (rect_changed && mus_embedded_frame_) {
+ mus_embedded_frame_->SetWindowBounds(local_surface_id_,
+ gfx::Rect(local_frame_size()));
+ }
#endif
if (resize_params_changed) {
// Let the browser know about the updated view rect.
Send(new FrameHostMsg_UpdateResizeParams(
- routing_id_, frame_rect(), screen_info(), auto_size_sequence_number(),
- surface_id));
+ routing_id_, screen_space_rect(), local_frame_size(), screen_info(),
+ auto_size_sequence_number(), surface_id));
sent_resize_params_ = pending_resize_params_;
}
}
@@ -677,8 +682,12 @@ void RenderFrameProxy::Navigate(const blink::WebURLRequest& request,
Send(new FrameHostMsg_OpenURL(routing_id_, params));
}
-void RenderFrameProxy::FrameRectsChanged(const blink::WebRect& frame_rect) {
- pending_resize_params_.frame_rect = gfx::Rect(frame_rect);
+void RenderFrameProxy::FrameRectsChanged(
+ const blink::WebRect& local_frame_rect,
+ const blink::WebRect& screen_space_rect) {
+ pending_resize_params_.screen_space_rect = gfx::Rect(screen_space_rect);
+ pending_resize_params_.local_frame_size =
+ gfx::Size(local_frame_rect.width, local_frame_rect.height);
pending_resize_params_.screen_info = render_widget_->screen_info();
WasResized();
}
diff --git a/chromium/content/renderer/render_frame_proxy.h b/chromium/content/renderer/render_frame_proxy.h
index 10554f054f2..1e17312342c 100644
--- a/chromium/content/renderer/render_frame_proxy.h
+++ b/chromium/content/renderer/render_frame_proxy.h
@@ -151,8 +151,12 @@ class CONTENT_EXPORT RenderFrameProxy : public IPC::Listener,
void WasResized();
- const gfx::Rect& frame_rect() const {
- return pending_resize_params_.frame_rect;
+ const gfx::Rect& screen_space_rect() const {
+ return pending_resize_params_.screen_space_rect;
+ }
+
+ const gfx::Size& local_frame_size() const {
+ return pending_resize_params_.local_frame_size;
}
const ScreenInfo& screen_info() const {
@@ -173,7 +177,8 @@ class CONTENT_EXPORT RenderFrameProxy : public IPC::Listener,
blink::WebDOMMessageEvent event) override;
void Navigate(const blink::WebURLRequest& request,
bool should_replace_current_entry) override;
- void FrameRectsChanged(const blink::WebRect& frame_rect) override;
+ void FrameRectsChanged(const blink::WebRect& local_frame_rect,
+ const blink::WebRect& screen_space_rect) override;
void UpdateRemoteViewportIntersection(
const blink::WebRect& viewportIntersection) override;
void VisibilityChanged(bool visible) override;
@@ -270,7 +275,8 @@ class CONTENT_EXPORT RenderFrameProxy : public IPC::Listener,
// therefore don't care to synchronize ResizeParams with viz::LocalSurfaceIds.
// Perhaps this can be moved to ChildFrameCompositingHelper?
struct ResizeParams {
- gfx::Rect frame_rect;
+ gfx::Rect screen_space_rect;
+ gfx::Size local_frame_size;
ScreenInfo screen_info;
uint64_t sequence_number = 0lu;
};
diff --git a/chromium/content/renderer/render_thread_impl.cc b/chromium/content/renderer/render_thread_impl.cc
index 5140c716de7..d5f3d130b63 100644
--- a/chromium/content/renderer/render_thread_impl.cc
+++ b/chromium/content/renderer/render_thread_impl.cc
@@ -1744,6 +1744,10 @@ bool RenderThreadImpl::OnControlMessageReceived(const IPC::Message& msg) {
return false;
}
+void RenderThreadImpl::SetSchedulerKeepActive(bool keep_active) {
+ renderer_scheduler_->SetSchedulerKeepActive(keep_active);
+}
+
void RenderThreadImpl::SetProcessBackgrounded(bool backgrounded) {
// Set timer slack to maximum on main thread when in background.
base::TimerSlack timer_slack = base::TIMER_SLACK_NONE;
diff --git a/chromium/content/renderer/render_thread_impl.h b/chromium/content/renderer/render_thread_impl.h
index 8ceb3f2756e..929bf183454 100644
--- a/chromium/content/renderer/render_thread_impl.h
+++ b/chromium/content/renderer/render_thread_impl.h
@@ -610,6 +610,7 @@ class CONTENT_EXPORT RenderThreadImpl
const std::string& highlight_color) override;
void PurgePluginListCache(bool reload_pages) override;
void SetProcessBackgrounded(bool backgrounded) override;
+ void SetSchedulerKeepActive(bool keep_active) override;
void ProcessPurgeAndSuspend() override;
void OnMemoryPressure(
diff --git a/chromium/content/renderer/render_view_browsertest.cc b/chromium/content/renderer/render_view_browsertest.cc
index d8b4686339e..aa9b6311ad0 100644
--- a/chromium/content/renderer/render_view_browsertest.cc
+++ b/chromium/content/renderer/render_view_browsertest.cc
@@ -73,6 +73,7 @@
#include "third_party/WebKit/public/web/WebDeviceEmulationParams.h"
#include "third_party/WebKit/public/web/WebDocumentLoader.h"
#include "third_party/WebKit/public/web/WebFrameContentDumper.h"
+#include "third_party/WebKit/public/web/WebGlobalObjectReusePolicy.h"
#include "third_party/WebKit/public/web/WebHistoryCommitType.h"
#include "third_party/WebKit/public/web/WebHistoryItem.h"
#include "third_party/WebKit/public/web/WebInputMethodController.h"
@@ -2208,19 +2209,59 @@ TEST_F(RenderViewImplTest, HistoryIsProperlyUpdatedOnNavigation) {
EXPECT_EQ(0, view()->HistoryBackListCount() +
view()->HistoryForwardListCount() + 1);
- // Receive a Navigate message with history parameters.
+ // Receive a CommitNavigation message with history parameters.
RequestNavigationParams request_params;
- request_params.current_history_list_length = 2;
request_params.current_history_list_offset = 1;
- request_params.pending_history_list_offset = 2;
+ request_params.current_history_list_length = 2;
frame()->Navigate(CommonNavigationParams(), request_params);
- // The history list in RenderView should have been updated.
+ // The current history list in RenderView is updated.
EXPECT_EQ(1, view()->HistoryBackListCount());
EXPECT_EQ(2, view()->HistoryBackListCount() +
view()->HistoryForwardListCount() + 1);
}
+// Ensure the RenderViewImpl history list is properly updated when starting a
+// new history browser-initiated navigation.
+TEST_F(RenderViewImplTest, HistoryIsProperlyUpdatedOnHistoryNavigation) {
+ EXPECT_EQ(0, view()->HistoryBackListCount());
+ EXPECT_EQ(0, view()->HistoryBackListCount() +
+ view()->HistoryForwardListCount() + 1);
+
+ // Receive a CommitNavigation message with history parameters.
+ RequestNavigationParams request_params;
+ request_params.current_history_list_offset = 1;
+ request_params.current_history_list_length = 25;
+ request_params.pending_history_list_offset = 12;
+ request_params.nav_entry_id = 777;
+ frame()->Navigate(CommonNavigationParams(), request_params);
+
+ // The current history list in RenderView is updated.
+ EXPECT_EQ(12, view()->HistoryBackListCount());
+ EXPECT_EQ(25, view()->HistoryBackListCount() +
+ view()->HistoryForwardListCount() + 1);
+}
+
+// Ensure the RenderViewImpl history list is properly updated when starting a
+// new history browser-initiated navigation with should_clear_history_list
+TEST_F(RenderViewImplTest, HistoryIsProperlyUpdatedOnShouldClearHistoryList) {
+ EXPECT_EQ(0, view()->HistoryBackListCount());
+ EXPECT_EQ(0, view()->HistoryBackListCount() +
+ view()->HistoryForwardListCount() + 1);
+
+ // Receive a CommitNavigation message with history parameters.
+ RequestNavigationParams request_params;
+ request_params.current_history_list_offset = 12;
+ request_params.current_history_list_length = 25;
+ request_params.should_clear_history_list = true;
+ frame()->Navigate(CommonNavigationParams(), request_params);
+
+ // The current history list in RenderView is updated.
+ EXPECT_EQ(0, view()->HistoryBackListCount());
+ EXPECT_EQ(1, view()->HistoryBackListCount() +
+ view()->HistoryForwardListCount() + 1);
+}
+
// IPC Listener that runs a callback when a console.log() is executed from
// javascript.
class ConsoleCallbackFilter : public IPC::Listener {
diff --git a/chromium/content/renderer/render_view_impl.cc b/chromium/content/renderer/render_view_impl.cc
index 1d136aa56ff..6b128219c76 100644
--- a/chromium/content/renderer/render_view_impl.cc
+++ b/chromium/content/renderer/render_view_impl.cc
@@ -1207,8 +1207,10 @@ void RenderViewImpl::OnUpdateTargetURLAck() {
void RenderViewImpl::OnSetHistoryOffsetAndLength(int history_offset,
int history_length) {
- DCHECK_GE(history_offset, -1);
- DCHECK_GE(history_length, 0);
+ // -1 <= history_offset < history_length <= kMaxSessionHistoryEntries(50).
+ DCHECK_LE(-1, history_offset);
+ DCHECK_LT(history_offset, history_length);
+ DCHECK_LE(history_length, kMaxSessionHistoryEntries);
history_list_offset_ = history_offset;
history_list_length_ = history_length;
diff --git a/chromium/content/renderer/render_widget.cc b/chromium/content/renderer/render_widget.cc
index b50da9c78f1..b4f2716e358 100644
--- a/chromium/content/renderer/render_widget.cc
+++ b/chromium/content/renderer/render_widget.cc
@@ -770,18 +770,18 @@ void RenderWidget::OnClose() {
if (for_oopif_) {
// Widgets for frames may be created and closed at any time while the frame
- // is alive. However, the closing process must happen synchronously. Frame
- // widget and frames hold pointers to each other. If Close() is deferred to
- // the message loop like in the non-frame widget case, WebWidget::close()
- // can end up accessing members of an already-deleted frame.
- Close();
- } else {
- // If there is a Send call on the stack, then it could be dangerous to close
- // now. Post a task that only gets invoked when there are no nested message
- // loops.
- task_runner_->PostNonNestableTask(
- FROM_HERE, base::BindOnce(&RenderWidget::Close, this));
- }
+ // is alive. However, WebWidget must be closed synchronously because frame
+ // widgets and frames hold pointers to each other. The deferred call to
+ // Close() will complete cleanup and release |this|, but CloseWebWidget()
+ // prevents Close() from attempting to access members of an
+ // already-deleted frame.
+ CloseWebWidget();
+ }
+ // If there is a Send call on the stack, then it could be dangerous to close
+ // now. Post a task that only gets invoked when there are no nested message
+ // loops.
+ task_runner_->PostNonNestableTask(FROM_HERE,
+ base::BindOnce(&RenderWidget::Close, this));
// Balances the AddRef taken when we called AddRoute.
Release();
@@ -972,6 +972,8 @@ void RenderWidget::ApplyViewportDeltas(
const gfx::Vector2dF& elastic_overscroll_delta,
float page_scale,
float top_controls_delta) {
+ if (!GetWebWidget())
+ return;
GetWebWidget()->ApplyViewportDeltas(inner_delta, outer_delta,
elastic_overscroll_delta, page_scale,
top_controls_delta);
@@ -980,11 +982,15 @@ void RenderWidget::ApplyViewportDeltas(
void RenderWidget::RecordWheelAndTouchScrollingCount(
bool has_scrolled_by_wheel,
bool has_scrolled_by_touch) {
+ if (!GetWebWidget())
+ return;
GetWebWidget()->RecordWheelAndTouchScrollingCount(has_scrolled_by_wheel,
has_scrolled_by_touch);
}
void RenderWidget::BeginMainFrame(double frame_time_sec) {
+ if (!GetWebWidget())
+ return;
if (input_event_queue_) {
input_event_queue_->DispatchRafAlignedInput(
ui::EventTimeStampFromSeconds(frame_time_sec));
@@ -1034,6 +1040,9 @@ void RenderWidget::RequestScheduleAnimation() {
}
void RenderWidget::UpdateVisualState(VisualStateUpdate requested_update) {
+ if (!GetWebWidget())
+ return;
+
bool pre_paint_only = requested_update == VisualStateUpdate::kPrePaint;
WebWidget::LifecycleUpdate lifecycle_update =
pre_paint_only ? WebWidget::LifecycleUpdate::kPrePaint
@@ -1067,6 +1076,9 @@ void RenderWidget::RecordTimeToFirstActivePaint() {
void RenderWidget::WillBeginCompositorFrame() {
TRACE_EVENT0("gpu", "RenderWidget::willBeginCompositorFrame");
+ if (!GetWebWidget())
+ return;
+
GetWebWidget()->SetSuppressFrameRequestsWorkaroundFor704763Only(true);
// The UpdateTextInputState can result in further layout and possibly
@@ -1622,8 +1634,12 @@ void RenderWidget::CloseWidgetSoon() {
void RenderWidget::Close() {
screen_metrics_emulator_.reset();
- WillCloseLayerTreeView();
+ CloseWebWidget();
compositor_.reset();
+}
+
+void RenderWidget::CloseWebWidget() {
+ WillCloseLayerTreeView();
if (webwidget_internal_) {
webwidget_internal_->Close();
webwidget_internal_ = nullptr;
diff --git a/chromium/content/renderer/render_widget.h b/chromium/content/renderer/render_widget.h
index b7841f1a769..d1f298d2d2d 100644
--- a/chromium/content/renderer/render_widget.h
+++ b/chromium/content/renderer/render_widget.h
@@ -179,6 +179,8 @@ class CONTENT_EXPORT RenderWidget
int32_t routing_id() const { return routing_id_; }
CompositorDependencies* compositor_deps() const { return compositor_deps_; }
+
+ // This can return nullptr while the RenderWidget is closing.
virtual blink::WebWidget* GetWebWidget() const;
// Returns the current instance of WebInputMethodController which is to be
@@ -514,9 +516,14 @@ class CONTENT_EXPORT RenderWidget
gfx::Size GetSizeForWebWidget() const;
virtual void ResizeWebWidget();
- // Close the underlying WebWidget.
+ // Close the underlying WebWidget and stop the compositor.
virtual void Close();
+ // Just Close the WebWidget, in cases where the Close() will be deferred.
+ // It is safe to call this multiple times, which happens in the case of
+ // frame widgets beings closed, since subsequent calls are ignored.
+ void CloseWebWidget();
+
// Used to force the size of a window when running layout tests.
void SetWindowRectSynchronously(const gfx::Rect& new_window_rect);
#if BUILDFLAG(USE_EXTERNAL_POPUP_MENU)
diff --git a/chromium/content/renderer/service_worker/controller_service_worker_connector.cc b/chromium/content/renderer/service_worker/controller_service_worker_connector.cc
index 4f4645d4b0a..c8a8881c005 100644
--- a/chromium/content/renderer/service_worker/controller_service_worker_connector.cc
+++ b/chromium/content/renderer/service_worker/controller_service_worker_connector.cc
@@ -74,7 +74,8 @@ void ControllerServiceWorkerConnector::OnControllerConnectionClosed() {
void ControllerServiceWorkerConnector::ResetControllerConnection(
mojom::ControllerServiceWorkerPtr controller_ptr) {
- DCHECK_NE(State::kNoContainerHost, state_);
+ if (state_ == State::kNoContainerHost)
+ return;
controller_service_worker_ = std::move(controller_ptr);
if (controller_service_worker_) {
state_ = State::kConnected;
diff --git a/chromium/content/renderer/service_worker/service_worker_provider_context.cc b/chromium/content/renderer/service_worker/service_worker_provider_context.cc
index da917153605..8066d284123 100644
--- a/chromium/content/renderer/service_worker/service_worker_provider_context.cc
+++ b/chromium/content/renderer/service_worker/service_worker_provider_context.cc
@@ -15,6 +15,7 @@
#include "content/child/child_thread_impl.h"
#include "content/child/thread_safe_sender.h"
#include "content/common/service_worker/service_worker_utils.h"
+#include "content/public/common/browser_side_navigation_policy.h"
#include "content/public/common/service_names.mojom.h"
#include "content/public/renderer/child_url_loader_factory_getter.h"
#include "content/renderer/service_worker/controller_service_worker_connector.h"
@@ -114,13 +115,16 @@ ServiceWorkerProviderContext::ServiceWorkerProviderContext(
state_for_client_ = std::make_unique<ProviderStateForClient>(
std::move(default_loader_factory_getter));
- if (!CanCreateSubresourceLoaderFactory())
+ if (!CanCreateSubresourceLoaderFactory() &&
+ !IsNavigationMojoResponseEnabled()) {
return;
+ }
- // S13nServiceWorker:
+ // S13nServiceWorker/NavigationMojoResponse:
// Set up the URL loader factory for sending subresource requests to
// the controller.
- DCHECK(ServiceWorkerUtils::IsServicificationEnabled());
+ DCHECK(ServiceWorkerUtils::IsServicificationEnabled() ||
+ IsNavigationMojoResponseEnabled());
if (controller_info) {
SetController(std::move(controller_info),
std::vector<blink::mojom::WebFeature>(),
diff --git a/chromium/content/renderer/service_worker/service_worker_provider_context.h b/chromium/content/renderer/service_worker/service_worker_provider_context.h
index 440315d680c..be92aecc6bc 100644
--- a/chromium/content/renderer/service_worker/service_worker_provider_context.h
+++ b/chromium/content/renderer/service_worker/service_worker_provider_context.h
@@ -66,9 +66,10 @@ class CONTENT_EXPORT ServiceWorkerProviderContext
// the content::ServiceWorkerProviderHost that notifies of changes to the
// registration's and workers' status. |request| is bound with |binding_|.
//
- // For S13nServiceWorker:
- // |controller_info| contains the endpoint and object info that is needed to
- // set up the controller service worker for the client.
+ // For S13nServiceWorker/NavigationMojoResponse:
+ // |controller_info| contains the endpoint (which is non-null only when
+ // S13nServiceWorker is enabled) and object info that is needed to set up the
+ // controller service worker for the client.
// |default_loader_factory_getter| contains a set of default loader
// factories for the associated loading context, and is used when we
// create a subresource loader for controllees. This is non-null only
diff --git a/chromium/device/vr/orientation/orientation_device_unittest.cc b/chromium/device/vr/orientation/orientation_device_unittest.cc
index b9a23d4e21b..de8cb90b0ae 100644
--- a/chromium/device/vr/orientation/orientation_device_unittest.cc
+++ b/chromium/device/vr/orientation/orientation_device_unittest.cc
@@ -78,10 +78,14 @@ class VROrientationDeviceTest : public testing::Test {
fake_sensor_ = std::make_unique<FakeOrientationSensor>(
mojo::MakeRequest(&sensor_ptr_));
+
shared_buffer_handle_ = mojo::SharedBufferHandle::Create(
sizeof(SensorReadingSharedBuffer) *
static_cast<uint64_t>(mojom::SensorType::LAST));
+ shared_buffer_mapping_ = shared_buffer_handle_->MapAtOffset(
+ mojom::SensorInitParams::kReadBufferSizeForTests, GetBufferOffset());
+
fake_screen_ = std::make_unique<FakeScreen>();
display::Screen::SetScreenInstance(fake_screen_.get());
@@ -160,13 +164,11 @@ class VROrientationDeviceTest : public testing::Test {
}
void WriteToBuffer(gfx::Quaternion q) {
- mojo::ScopedSharedBufferMapping shared_buffer =
- shared_buffer_handle_->MapAtOffset(
- mojom::SensorInitParams::kReadBufferSizeForTests,
- GetBufferOffset());
+ if (!shared_buffer_mapping_)
+ return;
SensorReadingSharedBuffer* buffer =
- static_cast<SensorReadingSharedBuffer*>(shared_buffer.get());
+ static_cast<SensorReadingSharedBuffer*>(shared_buffer_mapping_.get());
auto& seqlock = buffer->seqlock.value();
seqlock.WriteBegin();
@@ -192,6 +194,7 @@ class VROrientationDeviceTest : public testing::Test {
std::unique_ptr<FakeOrientationSensor> fake_sensor_;
mojom::SensorPtrInfo sensor_ptr_;
mojo::ScopedSharedBufferHandle shared_buffer_handle_;
+ mojo::ScopedSharedBufferMapping shared_buffer_mapping_;
mojom::SensorClientPtr sensor_client_ptr_;
std::unique_ptr<FakeScreen> fake_screen_;
diff --git a/chromium/extensions/browser/api/feedback_private/feedback_private_api_chromeos_unittest.cc b/chromium/extensions/browser/api/feedback_private/feedback_private_api_chromeos_unittest.cc
index fe7f2d35e6d..ef44cf6ba27 100644
--- a/chromium/extensions/browser/api/feedback_private/feedback_private_api_chromeos_unittest.cc
+++ b/chromium/extensions/browser/api/feedback_private/feedback_private_api_chromeos_unittest.cc
@@ -281,6 +281,7 @@ TEST_F(FeedbackPrivateApiUnittest, ReadLogSourceMultipleSources) {
TEST_F(FeedbackPrivateApiUnittest, ReadLogSourceWithAccessTimeouts) {
const TimeDelta timeout(TimeDelta::FromMilliseconds(100));
+ LogSourceAccessManager::SetMaxNumBurstAccessesForTesting(1);
LogSourceAccessManager::SetRateLimitingTimeoutForTesting(&timeout);
base::SimpleTestTickClock* test_clock = new base::SimpleTestTickClock;
diff --git a/chromium/extensions/browser/api/feedback_private/log_source_access_manager.cc b/chromium/extensions/browser/api/feedback_private/log_source_access_manager.cc
index e709b041b50..e1e9bb99527 100644
--- a/chromium/extensions/browser/api/feedback_private/log_source_access_manager.cc
+++ b/chromium/extensions/browser/api/feedback_private/log_source_access_manager.cc
@@ -27,11 +27,18 @@ using ReadLogSourceParams = api::feedback_private::ReadLogSourceParams;
using ReadLogSourceResult = api::feedback_private::ReadLogSourceResult;
using SystemLogsResponse = system_logs::SystemLogsResponse;
+// Default value of |g_max_num_burst_accesses|.
+constexpr int kDefaultMaxNumBurstAccesses = 10;
+
// The minimum time between consecutive reads of a log source by a particular
// extension.
constexpr base::TimeDelta kDefaultRateLimitingTimeout =
base::TimeDelta::FromMilliseconds(1000);
+// The maximum number of accesses on a single log source that can be allowed
+// before the next recharge increment. See access_rate_limiter.h for more info.
+int g_max_num_burst_accesses = kDefaultMaxNumBurstAccesses;
+
// If this is null, then |kDefaultRateLimitingTimeoutMs| is used as the timeout.
const base::TimeDelta* g_rate_limiting_timeout = nullptr;
@@ -81,6 +88,12 @@ LogSourceAccessManager::LogSourceAccessManager(content::BrowserContext* context)
LogSourceAccessManager::~LogSourceAccessManager() {}
// static
+void LogSourceAccessManager::SetMaxNumBurstAccessesForTesting(
+ int num_accesses) {
+ g_max_num_burst_accesses = num_accesses;
+}
+
+// static
void LogSourceAccessManager::SetRateLimitingTimeoutForTesting(
const base::TimeDelta* timeout) {
g_rate_limiting_timeout = timeout;
@@ -228,7 +241,8 @@ bool LogSourceAccessManager::UpdateSourceAccessTime(ResourceId id) {
const SourceAndExtension& key = *iter->second;
if (rate_limiters_.find(key) == rate_limiters_.end()) {
rate_limiters_.emplace(
- key, std::make_unique<AccessRateLimiter>(1, GetMinTimeBetweenReads(),
+ key, std::make_unique<AccessRateLimiter>(g_max_num_burst_accesses,
+ GetMinTimeBetweenReads(),
tick_clock_.get()));
}
return rate_limiters_[key]->AttemptAccess();
diff --git a/chromium/extensions/browser/api/feedback_private/log_source_access_manager.h b/chromium/extensions/browser/api/feedback_private/log_source_access_manager.h
index 1b883362bcf..63159077c3d 100644
--- a/chromium/extensions/browser/api/feedback_private/log_source_access_manager.h
+++ b/chromium/extensions/browser/api/feedback_private/log_source_access_manager.h
@@ -36,6 +36,9 @@ class LogSourceAccessManager {
explicit LogSourceAccessManager(content::BrowserContext* context);
~LogSourceAccessManager();
+ // Call this to override the maximum burst access count of the rate limiter.
+ static void SetMaxNumBurstAccessesForTesting(int num_accesses);
+
// To override the default rate-limiting mechanism of this function, pass in
// a TimeDelta representing the desired minimum time between consecutive reads
// of a source from an extension. Does not take ownership of |timeout|. When
diff --git a/chromium/extensions/browser/api/media_perception_private/conversion_utils.cc b/chromium/extensions/browser/api/media_perception_private/conversion_utils.cc
index 0b9606aa1e3..d106312bf01 100644
--- a/chromium/extensions/browser/api/media_perception_private/conversion_utils.cc
+++ b/chromium/extensions/browser/api/media_perception_private/conversion_utils.cc
@@ -12,6 +12,127 @@ namespace media_perception_private {
namespace {
+std::unique_ptr<AudioSpectrogram> AudioSpectrogramProtoToIdl(
+ const mri::AudioSpectrogram& spectrogram) {
+ std::unique_ptr<AudioSpectrogram> spectrogram_result =
+ std::make_unique<AudioSpectrogram>();
+ if (spectrogram.values_size() > 0) {
+ spectrogram_result->values = std::make_unique<std::vector<double>>();
+ for (const auto& value : spectrogram.values()) {
+ spectrogram_result->values->emplace_back(value);
+ }
+ }
+ return spectrogram_result;
+}
+
+std::unique_ptr<AudioHumanPresenceDetection>
+AudioHumanPresenceDetectionProtoToIdl(
+ const mri::AudioHumanPresenceDetection& detection) {
+ std::unique_ptr<AudioHumanPresenceDetection> detection_result =
+ std::make_unique<AudioHumanPresenceDetection>();
+ if (detection.has_human_presence_likelihood()) {
+ detection_result->human_presence_likelihood =
+ std::make_unique<double>(detection.human_presence_likelihood());
+ }
+ if (detection.has_noise_spectrogram()) {
+ detection_result->noise_spectrogram =
+ AudioSpectrogramProtoToIdl(detection.noise_spectrogram());
+ }
+ if (detection.has_frame_spectrogram()) {
+ detection_result->frame_spectrogram =
+ AudioSpectrogramProtoToIdl(detection.frame_spectrogram());
+ }
+ return detection_result;
+}
+
+std::unique_ptr<AudioLocalization> AudioLocalizationProtoToIdl(
+ const mri::AudioLocalization& localization) {
+ std::unique_ptr<AudioLocalization> localization_result =
+ std::make_unique<AudioLocalization>();
+ if (localization.has_azimuth_radians()) {
+ localization_result->azimuth_radians =
+ std::make_unique<double>(localization.azimuth_radians());
+ }
+ if (localization.azimuth_scores_size() > 0) {
+ localization_result->azimuth_scores =
+ std::make_unique<std::vector<double>>();
+ for (const auto& score : localization.azimuth_scores()) {
+ localization_result->azimuth_scores->emplace_back(score);
+ }
+ }
+ return localization_result;
+}
+
+AudioPerception AudioPerceptionProtoToIdl(
+ const mri::AudioPerception& perception) {
+ AudioPerception perception_result;
+ if (perception.has_timestamp_us()) {
+ perception_result.timestamp_us =
+ std::make_unique<double>(perception.timestamp_us());
+ }
+ if (perception.has_audio_localization()) {
+ perception_result.audio_localization =
+ AudioLocalizationProtoToIdl(perception.audio_localization());
+ }
+ if (perception.has_audio_human_presence_detection()) {
+ perception_result.audio_human_presence_detection =
+ AudioHumanPresenceDetectionProtoToIdl(
+ perception.audio_human_presence_detection());
+ }
+ return perception_result;
+}
+
+LightCondition LightConditionProtoToIdl(
+ const mri::VideoHumanPresenceDetection::LightCondition& condition) {
+ switch (condition) {
+ case mri::VideoHumanPresenceDetection::UNSPECIFIED:
+ return LIGHT_CONDITION_UNSPECIFIED;
+ case mri::VideoHumanPresenceDetection::NO_CHANGE:
+ return LIGHT_CONDITION_NO_CHANGE;
+ case mri::VideoHumanPresenceDetection::TURNED_ON:
+ return LIGHT_CONDITION_TURNED_ON;
+ case mri::VideoHumanPresenceDetection::TURNED_OFF:
+ return LIGHT_CONDITION_TURNED_OFF;
+ case mri::VideoHumanPresenceDetection::DIMMER:
+ return LIGHT_CONDITION_DIMMER;
+ case mri::VideoHumanPresenceDetection::BRIGHTER:
+ return LIGHT_CONDITION_BRIGHTER;
+ case mri::VideoHumanPresenceDetection::BLACK_FRAME:
+ return LIGHT_CONDITION_BLACK_FRAME;
+ default:
+ NOTREACHED() << "Unknown light condition: " << condition;
+ return LIGHT_CONDITION_UNSPECIFIED;
+ }
+}
+
+std::unique_ptr<VideoHumanPresenceDetection>
+VideoHumanPresenceDetectionProtoToIdl(
+ const mri::VideoHumanPresenceDetection& detection) {
+ std::unique_ptr<VideoHumanPresenceDetection> detection_result =
+ std::make_unique<VideoHumanPresenceDetection>();
+ if (detection.has_human_presence_likelihood()) {
+ detection_result->human_presence_likelihood =
+ std::make_unique<double>(detection.human_presence_likelihood());
+ }
+
+ if (detection.has_motion_detected_likelihood()) {
+ detection_result->motion_detected_likelihood =
+ std::make_unique<double>(detection.motion_detected_likelihood());
+ }
+
+ if (detection.has_light_condition()) {
+ detection_result->light_condition =
+ LightConditionProtoToIdl(detection.light_condition());
+ }
+
+ if (detection.has_light_condition_likelihood()) {
+ detection_result->light_condition_likelihood =
+ std::make_unique<double>(detection.light_condition_likelihood());
+ }
+
+ return detection_result;
+}
+
std::unique_ptr<Point> PointProtoToIdl(const mri::Point& point) {
std::unique_ptr<Point> point_result = std::make_unique<Point>();
if (point.has_x())
@@ -157,6 +278,11 @@ FramePerception FramePerceptionProtoToIdl(
PacketLatencyProtoToIdl(packet_latency));
}
}
+ if (frame_perception.has_video_human_presence_detection()) {
+ frame_perception_result.video_human_presence_detection =
+ VideoHumanPresenceDetectionProtoToIdl(
+ frame_perception.video_human_presence_detection());
+ }
return frame_perception_result;
}
@@ -211,6 +337,11 @@ PerceptionSample PerceptionSampleProtoToIdl(
perception_sample_result.image_frame = std::make_unique<ImageFrame>(
ImageFrameProtoToIdl(perception_sample.image_frame()));
}
+ if (perception_sample.has_audio_perception()) {
+ perception_sample_result.audio_perception =
+ std::make_unique<AudioPerception>(
+ AudioPerceptionProtoToIdl(perception_sample.audio_perception()));
+ }
return perception_sample_result;
}
@@ -330,6 +461,16 @@ MediaPerception MediaPerceptionProtoToIdl(
FramePerceptionProtoToIdl(frame_perception));
}
}
+
+ if (media_perception.audio_perception_size() > 0) {
+ media_perception_result.audio_perceptions =
+ std::make_unique<std::vector<AudioPerception>>();
+ for (const auto& audio_perception : media_perception.audio_perception()) {
+ media_perception_result.audio_perceptions->emplace_back(
+ AudioPerceptionProtoToIdl(audio_perception));
+ }
+ }
+
return media_perception_result;
}
diff --git a/chromium/extensions/browser/api/media_perception_private/conversion_utils_unittest.cc b/chromium/extensions/browser/api/media_perception_private/conversion_utils_unittest.cc
index a19f6358cd4..483898e02c8 100644
--- a/chromium/extensions/browser/api/media_perception_private/conversion_utils_unittest.cc
+++ b/chromium/extensions/browser/api/media_perception_private/conversion_utils_unittest.cc
@@ -40,6 +40,29 @@ void InitializeVideoStreamParam(media_perception::VideoStreamParam& param,
param.frame_rate = std::make_unique<int>(frame_rate);
}
+void InitializeFakeAudioPerception(mri::AudioPerception* audio_perception) {
+ audio_perception->set_timestamp_us(10086);
+
+ mri::AudioLocalization* audio_localization =
+ audio_perception->mutable_audio_localization();
+ audio_localization->set_azimuth_radians(1.5);
+ audio_localization->add_azimuth_scores(2.0);
+ audio_localization->add_azimuth_scores(5.0);
+
+ mri::AudioHumanPresenceDetection* detection =
+ audio_perception->mutable_audio_human_presence_detection();
+ detection->set_human_presence_likelihood(0.4);
+
+ mri::AudioSpectrogram* noise_spectrogram =
+ detection->mutable_noise_spectrogram();
+ noise_spectrogram->add_values(0.1);
+ noise_spectrogram->add_values(0.2);
+
+ mri::AudioSpectrogram* frame_spectrogram =
+ detection->mutable_frame_spectrogram();
+ frame_spectrogram->add_values(0.3);
+}
+
void InitializeFakeFramePerception(const int index,
mri::FramePerception* frame_perception) {
frame_perception->set_frame_id(index);
@@ -92,6 +115,14 @@ void InitializeFakeFramePerception(const int index,
mri::Entity* entity_three = frame_perception->add_entity();
entity_three->set_type(mri::Entity::LABELED_REGION);
entity_three->set_label(kFakeEntityLabel3);
+
+ // Add fake video human presence detection.
+ mri::VideoHumanPresenceDetection* detection =
+ frame_perception->mutable_video_human_presence_detection();
+ detection->set_human_presence_likelihood(0.1);
+ detection->set_motion_detected_likelihood(0.2);
+ detection->set_light_condition(mri::VideoHumanPresenceDetection::BLACK_FRAME);
+ detection->set_light_condition_likelihood(0.3);
}
void ValidateFramePerceptionResult(
@@ -178,6 +209,54 @@ void ValidateFramePerceptionResult(
EXPECT_EQ(*entity_result_three.entity_label, kFakeEntityLabel3);
EXPECT_EQ(entity_result_three.type,
media_perception::ENTITY_TYPE_LABELED_REGION);
+
+ // Validate video human presence detection.
+ const media_perception::VideoHumanPresenceDetection* detection_result =
+ frame_perception_result.video_human_presence_detection.get();
+ ASSERT_TRUE(detection_result->human_presence_likelihood);
+ EXPECT_EQ(*detection_result->human_presence_likelihood, 0.1);
+ ASSERT_TRUE(detection_result->motion_detected_likelihood);
+ EXPECT_EQ(*detection_result->motion_detected_likelihood, 0.2);
+ EXPECT_EQ(detection_result->light_condition,
+ media_perception::LIGHT_CONDITION_BLACK_FRAME);
+ ASSERT_TRUE(detection_result->light_condition_likelihood);
+ EXPECT_EQ(*detection_result->light_condition_likelihood, 0.3);
+}
+
+void ValidateAudioPerceptionResult(
+ const media_perception::AudioPerception& audio_perception_result) {
+ ASSERT_TRUE(audio_perception_result.timestamp_us);
+ EXPECT_EQ(*audio_perception_result.timestamp_us, 10086);
+
+ // Validate audio localization.
+ const media_perception::AudioLocalization* audio_localization =
+ audio_perception_result.audio_localization.get();
+ ASSERT_TRUE(audio_localization);
+ ASSERT_TRUE(audio_localization->azimuth_radians);
+ EXPECT_EQ(*audio_localization->azimuth_radians, 1.5);
+ ASSERT_EQ(2u, audio_localization->azimuth_scores->size());
+ EXPECT_EQ(audio_localization->azimuth_scores->at(0), 2.0);
+ EXPECT_EQ(audio_localization->azimuth_scores->at(1), 5.0);
+
+ // Validate audio human presence detection.
+ const media_perception::AudioHumanPresenceDetection* presence_detection =
+ audio_perception_result.audio_human_presence_detection.get();
+ ASSERT_TRUE(presence_detection);
+ ASSERT_TRUE(presence_detection->human_presence_likelihood);
+ EXPECT_EQ(*presence_detection->human_presence_likelihood, 0.4);
+
+ const media_perception::AudioSpectrogram* noise_spectrogram =
+ presence_detection->noise_spectrogram.get();
+ ASSERT_TRUE(noise_spectrogram);
+ ASSERT_EQ(2u, noise_spectrogram->values->size());
+ EXPECT_EQ(noise_spectrogram->values->at(0), 0.1);
+ EXPECT_EQ(noise_spectrogram->values->at(1), 0.2);
+
+ const media_perception::AudioSpectrogram* frame_spectrogram =
+ presence_detection->frame_spectrogram.get();
+ ASSERT_TRUE(frame_spectrogram);
+ ASSERT_EQ(1u, frame_spectrogram->values->size());
+ EXPECT_EQ(frame_spectrogram->values->at(0), 0.3);
}
void InitializeFakeImageFrameData(mri::ImageFrame* image_frame) {
@@ -214,13 +293,20 @@ TEST(MediaPerceptionConversionUtilsTest, MediaPerceptionProtoToIdl) {
mri::FramePerception* frame_perception =
media_perception.add_frame_perception();
InitializeFakeFramePerception(kFrameId, frame_perception);
+ mri::AudioPerception* audio_perception =
+ media_perception.add_audio_perception();
+ InitializeFakeAudioPerception(audio_perception);
media_perception::MediaPerception media_perception_result =
media_perception::MediaPerceptionProtoToIdl(media_perception);
EXPECT_EQ(*media_perception_result.timestamp, 1);
ASSERT_TRUE(media_perception_result.frame_perceptions);
ASSERT_EQ(1u, media_perception_result.frame_perceptions->size());
+ ASSERT_TRUE(media_perception_result.audio_perceptions);
+ ASSERT_EQ(1u, media_perception_result.audio_perceptions->size());
ValidateFramePerceptionResult(
kFrameId, media_perception_result.frame_perceptions->at(0));
+ ValidateAudioPerceptionResult(
+ media_perception_result.audio_perceptions->at(0));
}
TEST(MediaPerceptionConversionUtilsTest, DiagnosticsProtoToIdl) {
diff --git a/chromium/extensions/browser/extension_function_histogram_value.h b/chromium/extensions/browser/extension_function_histogram_value.h
index c34e44801d0..b485a963bce 100644
--- a/chromium/extensions/browser/extension_function_histogram_value.h
+++ b/chromium/extensions/browser/extension_function_histogram_value.h
@@ -1272,6 +1272,7 @@ enum HistogramValue {
CRYPTOTOKENPRIVATE_ISAPPIDHASHINENTERPRISECONTEXT,
CRYPTOTOKENPRIVATE_CANAPPIDGETATTESTATION,
SYSTEM_DISPLAY_SETMIRRORMODE,
+ ACCESSIBILITY_PRIVATE_SENDSYNTHETICKEYEVENT,
// Last entry: Add new entries above, then run:
// python tools/metrics/histograms/update_extension_histograms.py
ENUM_BOUNDARY
diff --git a/chromium/extensions/browser/user_script_loader.cc b/chromium/extensions/browser/user_script_loader.cc
index 1b9d9fe8ed4..72ad10055d2 100644
--- a/chromium/extensions/browser/user_script_loader.cc
+++ b/chromium/extensions/browser/user_script_loader.cc
@@ -12,6 +12,7 @@
#include "base/memory/ptr_util.h"
#include "base/version.h"
+#include "build/build_config.h"
#include "content/public/browser/browser_context.h"
#include "content/public/browser/browser_thread.h"
#include "content/public/browser/notification_service.h"
@@ -336,6 +337,11 @@ std::unique_ptr<base::SharedMemory> UserScriptLoader::Serialize(
if (!readonly_handle.IsValid())
return std::unique_ptr<base::SharedMemory>();
+#if defined(OS_ANDROID)
+ // Seal the region read-only now. http://crbug.com/789959
+ readonly_handle.SetRegionReadOnly();
+#endif
+
return std::make_unique<base::SharedMemory>(readonly_handle,
/*read_only=*/true);
}
diff --git a/chromium/extensions/common/api/bluetooth_private.idl b/chromium/extensions/common/api/bluetooth_private.idl
index b2d760b9040..f3ff4ba07f9 100644
--- a/chromium/extensions/common/api/bluetooth_private.idl
+++ b/chromium/extensions/common/api/bluetooth_private.idl
@@ -123,7 +123,8 @@ namespace bluetoothPrivate {
// These functions all report failures via chrome.runtime.lastError.
interface Functions {
// Changes the state of the Bluetooth adapter.
- // |adapterState|:
+ // |adapterState|: The new state of the adapter.
+ // |callback|: Called when all the state changes have been completed.
static void setAdapterState(NewAdapterState adapterState,
optional VoidCallback callback);
diff --git a/chromium/extensions/common/api/media_perception_private.idl b/chromium/extensions/common/api/media_perception_private.idl
index 5925c021889..0d196d0f200 100644
--- a/chromium/extensions/common/api/media_perception_private.idl
+++ b/chromium/extensions/common/api/media_perception_private.idl
@@ -192,6 +192,47 @@ namespace mediaPerceptionPrivate {
long? latencyUsec;
};
+ // Type of lighting conditions.
+ enum LightCondition {
+ UNSPECIFIED,
+
+ // No noticeable change occurred.
+ NO_CHANGE,
+
+ // Light was switched on in the room.
+ TURNED_ON,
+
+ // Light was switched off in the room.
+ TURNED_OFF,
+
+ // Light gradually got dimmer (for example, due to a sunset).
+ DIMMER,
+
+ // Light gradually got brighter (for example, due to a sunrise).
+ BRIGHTER,
+
+ // Black frame was detected - the current frame contains only noise.
+ BLACK_FRAME
+ };
+
+ // Detection of human presence close to the camera.
+ dictionary VideoHumanPresenceDetection {
+ // Indicates a probability in [0, 1] interval that a human is present in
+ // the video frame.
+ double? humanPresenceLikelihood;
+
+ // Indicates a probability in [0, 1] that motion has been detected in the
+ // video frame.
+ double? motionDetectedLikelihood;
+
+ // Indicates lighting condition in the video frame.
+ LightCondition? lightCondition;
+
+ // Indicates a probablity in [0, 1] interval that
+ // <code>lightCondition</code> value is correct.
+ double? lightConditionLikelihood;
+ };
+
// The set of computer vision metadata for an image frame.
dictionary FramePerception {
long? frameId;
@@ -208,6 +249,53 @@ namespace mediaPerceptionPrivate {
// Processing latency for a list of packets.
PacketLatency[]? packetLatency;
+
+ // Human presence detection results for a video frame.
+ VideoHumanPresenceDetection? videoHumanPresenceDetection;
+ };
+
+ // An estimate of the direction that the sound is coming from.
+ dictionary AudioLocalization {
+ // An angle in radians in the horizontal plane. It roughly points to the
+ // peak in the probability distribution of azimuth defined below.
+ double? azimuthRadians;
+
+ // A probability distribution for the current snapshot in time that shows
+ // the likelihood of a sound source being at a particular azimuth. For
+ // example, <code>azimuthScores = [0.1, 0.2, 0.3, 0.4]</code> means that
+ // the probability that the sound is coming from an azimuth of 0, pi/2, pi,
+ // 3*pi/2 is 0.1, 0.2, 0.3 and 0.4, respectively.
+ double[]? azimuthScores;
+ };
+
+ // Spectrogram of an audio frame.
+ dictionary AudioSpectrogram {
+ double[]? values;
+ };
+
+ // Detection of human presence close to the microphone.
+ dictionary AudioHumanPresenceDetection {
+ // Indicates a probability in [0, 1] interval that a human has caused a
+ // sound close to the microphone.
+ double? humanPresenceLikelihood;
+
+ // Estimate of the noise spectrogram.
+ AudioSpectrogram? noiseSpectrogram;
+
+ // Spectrogram of an audio frame.
+ AudioSpectrogram? frameSpectrogram;
+ };
+
+ // Audio perception results for an audio frame.
+ dictionary AudioPerception {
+ // A timestamp in microseconds attached when this message was generated.
+ double? timestampUs;
+
+ // Audio localization results for an audio frame.
+ AudioLocalization? audioLocalization;
+
+ // Audio human presence detection results for an audio frame.
+ AudioHumanPresenceDetection? audioHumanPresenceDetection;
};
dictionary MediaPerception {
@@ -219,6 +307,9 @@ namespace mediaPerceptionPrivate {
// An array of framePerceptions.
FramePerception[]? framePerceptions;
+
+ // An array of audio perceptions.
+ AudioPerception[]? audioPerceptions;
};
enum ImageFormat {
@@ -247,6 +338,9 @@ namespace mediaPerceptionPrivate {
// The image frame data for the associated FramePerception object.
ImageFrame? imageFrame;
+
+ // The audio perception results for an audio frame.
+ AudioPerception? audioPerception;
};
dictionary Diagnostics {
diff --git a/chromium/gpu/config/gpu_lists_version.h b/chromium/gpu/config/gpu_lists_version.h
index 15104c20920..ad3a5e431c5 100644
--- a/chromium/gpu/config/gpu_lists_version.h
+++ b/chromium/gpu/config/gpu_lists_version.h
@@ -3,6 +3,6 @@
#ifndef GPU_CONFIG_GPU_LISTS_VERSION_H_
#define GPU_CONFIG_GPU_LISTS_VERSION_H_
-#define GPU_LISTS_VERSION "31566ac6591be7f470f68e5aefda035c36058ddc"
+#define GPU_LISTS_VERSION "a0bb379a4de011b41ea07da28716e685a1cf4579"
#endif // GPU_CONFIG_GPU_LISTS_VERSION_H_
diff --git a/chromium/ios/chrome/browser/ntp_snippets/BUILD.gn b/chromium/ios/chrome/browser/ntp_snippets/BUILD.gn
index 83f64df24e9..1edd5531407 100644
--- a/chromium/ios/chrome/browser/ntp_snippets/BUILD.gn
+++ b/chromium/ios/chrome/browser/ntp_snippets/BUILD.gn
@@ -33,6 +33,5 @@ source_set("ntp_snippets") {
"//ios/chrome/common",
"//ios/web",
"//net",
- "//services/identity/public/cpp",
]
}
diff --git a/chromium/ios/chrome/browser/ui/fullscreen/BUILD.gn b/chromium/ios/chrome/browser/ui/fullscreen/BUILD.gn
index 07727b1e21b..50e470c6df8 100644
--- a/chromium/ios/chrome/browser/ui/fullscreen/BUILD.gn
+++ b/chromium/ios/chrome/browser/ui/fullscreen/BUILD.gn
@@ -17,6 +17,8 @@ source_set("fullscreen") {
source_set("new_fullscreen") {
sources = [
+ "animated_scoped_fullscreen_disabler.h",
+ "animated_scoped_fullscreen_disabler.mm",
"fullscreen_controller.h",
"fullscreen_controller_factory.h",
"fullscreen_controller_observer.h",
@@ -36,6 +38,7 @@ source_set("new_fullscreen") {
"//components/keyed_service/ios",
"//ios/chrome/browser/ui/browser_list",
"//ios/chrome/browser/web_state_list",
+ "//ios/chrome/common",
]
}
@@ -64,17 +67,17 @@ source_set("new_fullscreen_internal") {
"fullscreen_model.h",
"fullscreen_model.mm",
"fullscreen_model_observer.h",
+ "fullscreen_system_notification_observer.h",
+ "fullscreen_system_notification_observer.mm",
"fullscreen_ui_updater.mm",
- "fullscreen_web_scroll_view_replacement_handler.h",
- "fullscreen_web_scroll_view_replacement_handler.mm",
"fullscreen_web_state_list_observer.h",
"fullscreen_web_state_list_observer.mm",
"fullscreen_web_state_observer.h",
"fullscreen_web_state_observer.mm",
+ "fullscreen_web_view_proxy_observer.h",
+ "fullscreen_web_view_proxy_observer.mm",
"fullscreen_web_view_scroll_view_replacement_util.h",
"fullscreen_web_view_scroll_view_replacement_util.mm",
- "system_notification_fullscreen_disabler.h",
- "system_notification_fullscreen_disabler.mm",
]
configs += [ "//build/config/compiler:enable_arc" ]
@@ -95,8 +98,14 @@ source_set("new_fullscreen_internal") {
source_set("new_fullscreen_ui") {
sources = [
+ "fullscreen_animator.h",
+ "fullscreen_animator.mm",
+ "fullscreen_foreground_animator.h",
+ "fullscreen_foreground_animator.mm",
"fullscreen_scroll_end_animator.h",
"fullscreen_scroll_end_animator.mm",
+ "fullscreen_scroll_to_top_animator.h",
+ "fullscreen_scroll_to_top_animator.mm",
"fullscreen_ui_element.h",
]
diff --git a/chromium/ios/chrome/browser/ui/fullscreen/test/BUILD.gn b/chromium/ios/chrome/browser/ui/fullscreen/test/BUILD.gn
index 7c40ad5bb6b..1a27ab5468e 100644
--- a/chromium/ios/chrome/browser/ui/fullscreen/test/BUILD.gn
+++ b/chromium/ios/chrome/browser/ui/fullscreen/test/BUILD.gn
@@ -11,6 +11,8 @@ source_set("test") {
"test_fullscreen_controller.mm",
"test_fullscreen_controller_observer.h",
"test_fullscreen_controller_observer.mm",
+ "test_fullscreen_mediator.h",
+ "test_fullscreen_mediator.mm",
"test_fullscreen_model_observer.h",
"test_fullscreen_model_observer.mm",
]
diff --git a/chromium/ipc/ipc_message_utils.cc b/chromium/ipc/ipc_message_utils.cc
index a18b60d5062..ebadd934f92 100644
--- a/chromium/ipc/ipc_message_utils.cc
+++ b/chromium/ipc/ipc_message_utils.cc
@@ -618,6 +618,15 @@ void ParamTraits<base::SharedMemoryHandle>::Write(base::Pickle* m,
// subtypes, both are transferred via file descriptor but need to be handled
// differently by the receiver. Write the type to distinguish.
WriteParam(m, p.GetType());
+ WriteParam(m, p.IsReadOnly());
+
+ // Ensure the region is read-only before sending it through IPC.
+ if (p.IsReadOnly()) {
+ if (!p.IsRegionReadOnly()) {
+ LOG(ERROR) << "Sending unsealed read-only region through IPC";
+ p.SetRegionReadOnly();
+ }
+ }
#endif
if (p.OwnershipPassesToIPC()) {
if (!m->WriteAttachment(new internal::PlatformFileAttachment(
@@ -670,8 +679,11 @@ bool ParamTraits<base::SharedMemoryHandle>::Read(const base::Pickle* m,
// Android uses both ashmen and AHardwareBuffer subtypes, get the actual type
// for use as a constructor argument alongside the file descriptor.
base::SharedMemoryHandle::Type android_subtype;
- if (!ReadParam(m, iter, &android_subtype))
+ bool is_read_only = false;
+ if (!ReadParam(m, iter, &android_subtype) ||
+ !ReadParam(m, iter, &is_read_only)) {
return false;
+ }
#endif
scoped_refptr<base::Pickle::Attachment> attachment;
if (!m->ReadAttachment(iter, &attachment))
@@ -706,6 +718,8 @@ bool ParamTraits<base::SharedMemoryHandle>::Read(const base::Pickle* m,
->TakePlatformFile(),
true),
static_cast<size_t>(size), guid);
+ if (is_read_only)
+ r->SetReadOnly();
#else
*r = base::SharedMemoryHandle(
base::FileDescriptor(
@@ -735,6 +749,10 @@ void ParamTraits<base::SharedMemoryHandle>::Log(const param_type& p,
LogParam(p.GetGUID(), l);
l->append("size: ");
LogParam(static_cast<uint64_t>(p.GetSize()), l);
+#if defined(OS_ANDROID)
+ l->append("read-only: ");
+ LogParam(p.IsReadOnly(), l);
+#endif
}
#if defined(OS_WIN)
diff --git a/chromium/media/audio/mac/audio_low_latency_input_mac.cc b/chromium/media/audio/mac/audio_low_latency_input_mac.cc
index bb09aaeec2a..9dd6d9ad2db 100644
--- a/chromium/media/audio/mac/audio_low_latency_input_mac.cc
+++ b/chromium/media/audio/mac/audio_low_latency_input_mac.cc
@@ -70,91 +70,6 @@ static std::ostream& operator<<(std::ostream& os,
return os;
}
-// Property address to monitor device changes. Use wildcards to match any and
-// all values for their associated type. Filtering for device-specific
-// notifications will take place in the callback.
-const AudioObjectPropertyAddress
- AUAudioInputStream::kDeviceChangePropertyAddress = {
- kAudioObjectPropertySelectorWildcard, kAudioObjectPropertyScopeWildcard,
- kAudioObjectPropertyElementWildcard};
-
-// Maps internal enumerator values (e.g. kAudioDevicePropertyDeviceHasChanged)
-// into local values that are suitable for UMA stats.
-// See AudioObjectPropertySelector in CoreAudio/AudioHardware.h for details.
-// TODO(henrika): ensure that the "other" bucket contains as few counts as
-// possible by adding more valid enumerators below.
-enum AudioDevicePropertyResult {
- PROPERTY_OTHER = 0, // Use for all non-supported property changes
- PROPERTY_DEVICE_HAS_CHANGED = 1,
- PROPERTY_IO_STOPPED_ABNORMALLY = 2,
- PROPERTY_HOG_MODE = 3,
- PROPERTY_BUFFER_FRAME_SIZE = 4,
- PROPERTY_BUFFER_FRAME_SIZE_RANGE = 5,
- PROPERTY_STREAM_CONFIGURATION = 6,
- PROPERTY_ACTUAL_SAMPLE_RATE = 7,
- PROPERTY_NOMINAL_SAMPLE_RATE = 8,
- PROPERTY_DEVICE_IS_RUNNING_SOMEWHERE = 9,
- PROPERTY_DEVICE_IS_RUNNING = 10,
- PROPERTY_DEVICE_IS_ALIVE = 11,
- PROPERTY_STREAM_PHYSICAL_FORMAT = 12,
- PROPERTY_JACK_IS_CONNECTED = 13,
- PROPERTY_PROCESSOR_OVERLOAD = 14,
- PROPERTY_DATA_SOURCES = 15,
- PROPERTY_DATA_SOURCE = 16,
- PROPERTY_VOLUME_DECIBELS = 17,
- PROPERTY_VOLUME_SCALAR = 18,
- PROPERTY_MUTE = 19,
- PROPERTY_PLUGIN = 20,
- PROPERTY_USES_VARIABLE_BUFFER_FRAME_SIZES = 21,
- PROPERTY_IO_CYCLE_USAGE = 22,
- PROPERTY_IO_PROC_STREAM_USAGE = 23,
- PROPERTY_CONFIGURATION_APPLICATION = 24,
- PROPERTY_DEVICE_UID = 25,
- PROPERTY_MODE_UID = 26,
- PROPERTY_TRANSPORT_TYPE = 27,
- PROPERTY_RELATED_DEVICES = 28,
- PROPERTY_CLOCK_DOMAIN = 29,
- PROPERTY_DEVICE_CAN_BE_DEFAULT_DEVICE = 30,
- PROPERTY_DEVICE_CAN_BE_DEFAULT_SYSTEM_DEVICE = 31,
- PROPERTY_LATENCY = 32,
- PROPERTY_STREAMS = 33,
- PROPERTY_CONTROL_LIST = 34,
- PROPERTY_SAFETY_OFFSET = 35,
- PROPERTY_AVAILABLE_NOMINAL_SAMPLE_RATES = 36,
- PROPERTY_ICON = 37,
- PROPERTY_IS_HIDDEN = 38,
- PROPERTY_PREFERRED_CHANNELS_FOR_STEREO = 39,
- PROPERTY_PREFERRED_CHANNEL_LAYOUT = 40,
- PROPERTY_VOLUME_RANGE_DECIBELS = 41,
- PROPERTY_VOLUME_SCALAR_TO_DECIBELS = 42,
- PROPERTY_VOLUME_DECIBEL_TO_SCALAR = 43,
- PROPERTY_STEREO_PAN = 44,
- PROPERTY_STEREO_PAN_CHANNELS = 45,
- PROPERTY_SOLO = 46,
- PROPERTY_PHANTOM_POWER = 47,
- PROPERTY_PHASE_INVERT = 48,
- PROPERTY_CLIP_LIGHT = 49,
- PROPERTY_TALKBACK = 50,
- PROPERTY_LISTENBACK = 51,
- PROPERTY_CLOCK_SOURCE = 52,
- PROPERTY_CLOCK_SOURCES = 53,
- PROPERTY_SUB_MUTE = 54,
- PROPERTY_MAX = PROPERTY_SUB_MUTE
-};
-
-// Add the provided value in |result| to a UMA histogram.
-static void LogDevicePropertyChange(bool startup_failed,
- AudioDevicePropertyResult result) {
- if (startup_failed) {
- UMA_HISTOGRAM_ENUMERATION(
- "Media.Audio.InputDevicePropertyChangedStartupFailedMac", result,
- PROPERTY_MAX + 1);
- } else {
- UMA_HISTOGRAM_ENUMERATION("Media.Audio.InputDevicePropertyChangedMac",
- result, PROPERTY_MAX + 1);
- }
-}
-
static OSStatus GetInputDeviceStreamFormat(
AudioUnit audio_unit,
AudioStreamBasicDescription* format) {
@@ -239,15 +154,13 @@ AUAudioInputStream::AUAudioInputStream(
start_was_deferred_(false),
buffer_size_was_changed_(false),
audio_unit_render_has_worked_(false),
- device_listener_is_active_(false),
noise_reduction_suppressed_(false),
last_sample_time_(0.0),
last_number_of_frames_(0),
total_lost_frames_(0),
largest_glitch_frames_(0),
glitches_detected_(0),
- log_callback_(log_callback),
- weak_factory_(this) {
+ log_callback_(log_callback) {
DCHECK(manager_);
CHECK(!log_callback_.Equals(AudioManager::LogCallback()));
@@ -291,7 +204,6 @@ AUAudioInputStream::AUAudioInputStream(
AUAudioInputStream::~AUAudioInputStream() {
DVLOG(1) << "~dtor";
- DCHECK(!device_listener_is_active_);
ReportAndResetStats();
}
@@ -309,9 +221,6 @@ bool AUAudioInputStream::Open() {
return false;
}
- // Start listening for changes in device properties.
- RegisterDeviceChangeListener();
-
// The requested sample-rate must match the hardware sample-rate.
int sample_rate =
AudioManagerMac::HardwareSampleRateForDevice(input_device_id_);
@@ -605,16 +514,9 @@ void AUAudioInputStream::Close() {
// Uninitialize and dispose the audio unit.
CloseAudioUnit();
- // Disable the listener for device property changes.
- DeRegisterDeviceChangeListener();
-
// Add more UMA stats but only if AGC was activated, i.e. for e.g. WebRTC
// audio input streams.
if (GetAutomaticGainControl()) {
- // Check if any device property changes are added by filtering out a
- // selected set of the |device_property_changes_map_| map. Add UMA stats
- // if valuable data is found.
- AddDevicePropertyChangesToUMA(false);
// Log whether call to Start() was deferred or not. To be compared with
// Media.Audio.InputStartWasDeferredMac which logs the same value but only
// when input audio fails to start.
@@ -974,82 +876,6 @@ OSStatus AUAudioInputStream::Provide(UInt32 number_of_frames,
return noErr;
}
-void AUAudioInputStream::DevicePropertyChangedOnMainThread(
- const std::vector<UInt32>& properties) {
- DCHECK(thread_checker_.CalledOnValidThread());
- DCHECK(device_listener_is_active_);
- // Use property as key to a map and increase its value. We are not
- // interested in all property changes but store all here anyhow.
- // Filtering will be done later in AddDevicePropertyChangesToUMA();
- for (auto property : properties) {
- DVLOG(2) << "=> " << FourCharFormatCodeToString(property);
- ++device_property_changes_map_[property];
- }
-}
-
-OSStatus AUAudioInputStream::OnDevicePropertyChanged(
- AudioObjectID object_id,
- UInt32 num_addresses,
- const AudioObjectPropertyAddress addresses[],
- void* context) {
- AUAudioInputStream* self = static_cast<AUAudioInputStream*>(context);
- return self->DevicePropertyChanged(object_id, num_addresses, addresses);
-}
-
-OSStatus AUAudioInputStream::DevicePropertyChanged(
- AudioObjectID object_id,
- UInt32 num_addresses,
- const AudioObjectPropertyAddress addresses[]) {
- if (object_id != input_device_id_)
- return noErr;
-
- // Listeners will be called when possibly many properties have changed.
- // Consequently, the implementation of a listener must go through the array of
- // addresses to see what exactly has changed. Copy values into a local vector
- // and update the |device_property_changes_map_| on the main thread to avoid
- // potential race conditions.
- std::vector<UInt32> properties;
- properties.reserve(num_addresses);
- for (UInt32 i = 0; i < num_addresses; ++i) {
- properties.push_back(addresses[i].mSelector);
- }
- manager_->GetTaskRunner()->PostTask(
- FROM_HERE,
- base::Bind(&AUAudioInputStream::DevicePropertyChangedOnMainThread,
- weak_factory_.GetWeakPtr(), properties));
- return noErr;
-}
-
-void AUAudioInputStream::RegisterDeviceChangeListener() {
- DCHECK(thread_checker_.CalledOnValidThread());
- DCHECK(!device_listener_is_active_);
- DVLOG(1) << "RegisterDeviceChangeListener";
- if (input_device_id_ == kAudioObjectUnknown)
- return;
- device_property_changes_map_.clear();
- OSStatus result = AudioObjectAddPropertyListener(
- input_device_id_, &kDeviceChangePropertyAddress,
- &AUAudioInputStream::OnDevicePropertyChanged, this);
- OSSTATUS_DLOG_IF(ERROR, result != noErr, result)
- << "AudioObjectAddPropertyListener() failed!";
- device_listener_is_active_ = (result == noErr);
-}
-
-void AUAudioInputStream::DeRegisterDeviceChangeListener() {
- DCHECK(thread_checker_.CalledOnValidThread());
- if (!device_listener_is_active_)
- return;
- DVLOG(1) << "DeRegisterDeviceChangeListener";
- if (input_device_id_ == kAudioObjectUnknown)
- return;
- device_listener_is_active_ = false;
- OSStatus result = AudioObjectRemovePropertyListener(
- input_device_id_, &kDeviceChangePropertyAddress,
- &AUAudioInputStream::OnDevicePropertyChanged, this);
- OSSTATUS_DLOG_IF(ERROR, result != noErr, result)
- << "AudioObjectRemovePropertyListener() failed!";
-}
-
int AUAudioInputStream::HardwareSampleRate() {
// Determine the default input device's sample-rate.
AudioDeviceID device_id = kAudioObjectUnknown;
@@ -1219,259 +1045,12 @@ void AUAudioInputStream::AddHistogramsForFailedStartup() {
// be fixed when we understand the problem better.
UMA_HISTOGRAM_BOOLEAN("Media.Audio.AutomaticGainControlMac",
GetAutomaticGainControl());
- // Disable the listener for device property changes. Ensures that we don't
- // need a lock when reading the map.
- DeRegisterDeviceChangeListener();
- // Check if any device property changes are added by filtering out a selected
- // set of the |device_property_changes_map_| map. Add UMA stats if valuable
- // data is found.
- AddDevicePropertyChangesToUMA(true);
// Add information about things like number of logical processors, number
// of system resume events etc.
AddSystemInfoToUMA(manager_->IsOnBatteryPower(),
manager_->GetNumberOfResumeNotifications());
}
-void AUAudioInputStream::AddDevicePropertyChangesToUMA(bool startup_failed) {
- DVLOG(1) << "AddDevicePropertyChangesToUMA";
- DCHECK(!device_listener_is_active_);
- // Scan the map of all available property changes (notification types) and
- // filter out some that make sense to add to UMA stats.
- // TODO(henrika): figure out if the set of stats is sufficient or not.
- for (const auto& entry : device_property_changes_map_) {
- UInt32 device_property = entry.first;
- int change_count = entry.second;
- AudioDevicePropertyResult uma_result = PROPERTY_OTHER;
- switch (device_property) {
- case kAudioDevicePropertyDeviceHasChanged:
- uma_result = PROPERTY_DEVICE_HAS_CHANGED;
- DVLOG(1) << "kAudioDevicePropertyDeviceHasChanged";
- break;
- case kAudioDevicePropertyIOStoppedAbnormally:
- uma_result = PROPERTY_IO_STOPPED_ABNORMALLY;
- DVLOG(1) << "kAudioDevicePropertyIOStoppedAbnormally";
- break;
- case kAudioDevicePropertyHogMode:
- uma_result = PROPERTY_HOG_MODE;
- DVLOG(1) << "kAudioDevicePropertyHogMode";
- break;
- case kAudioDevicePropertyBufferFrameSize:
- uma_result = PROPERTY_BUFFER_FRAME_SIZE;
- DVLOG(1) << "kAudioDevicePropertyBufferFrameSize";
- break;
- case kAudioDevicePropertyBufferFrameSizeRange:
- uma_result = PROPERTY_BUFFER_FRAME_SIZE_RANGE;
- DVLOG(1) << "kAudioDevicePropertyBufferFrameSizeRange";
- break;
- case kAudioDevicePropertyStreamConfiguration:
- uma_result = PROPERTY_STREAM_CONFIGURATION;
- DVLOG(1) << "kAudioDevicePropertyStreamConfiguration";
- break;
- case kAudioDevicePropertyActualSampleRate:
- uma_result = PROPERTY_ACTUAL_SAMPLE_RATE;
- DVLOG(1) << "kAudioDevicePropertyActualSampleRate";
- break;
- case kAudioDevicePropertyNominalSampleRate:
- uma_result = PROPERTY_NOMINAL_SAMPLE_RATE;
- DVLOG(1) << "kAudioDevicePropertyNominalSampleRate";
- break;
- case kAudioDevicePropertyDeviceIsRunningSomewhere:
- uma_result = PROPERTY_DEVICE_IS_RUNNING_SOMEWHERE;
- DVLOG(1) << "kAudioDevicePropertyDeviceIsRunningSomewhere";
- break;
- case kAudioDevicePropertyDeviceIsRunning:
- uma_result = PROPERTY_DEVICE_IS_RUNNING;
- DVLOG(1) << "kAudioDevicePropertyDeviceIsRunning";
- break;
- case kAudioDevicePropertyDeviceIsAlive:
- uma_result = PROPERTY_DEVICE_IS_ALIVE;
- DVLOG(1) << "kAudioDevicePropertyDeviceIsAlive";
- break;
- case kAudioStreamPropertyPhysicalFormat:
- uma_result = PROPERTY_STREAM_PHYSICAL_FORMAT;
- DVLOG(1) << "kAudioStreamPropertyPhysicalFormat";
- break;
- case kAudioDevicePropertyJackIsConnected:
- uma_result = PROPERTY_JACK_IS_CONNECTED;
- DVLOG(1) << "kAudioDevicePropertyJackIsConnected";
- break;
- case kAudioDeviceProcessorOverload:
- uma_result = PROPERTY_PROCESSOR_OVERLOAD;
- DVLOG(1) << "kAudioDeviceProcessorOverload";
- break;
- case kAudioDevicePropertyDataSources:
- uma_result = PROPERTY_DATA_SOURCES;
- DVLOG(1) << "kAudioDevicePropertyDataSources";
- break;
- case kAudioDevicePropertyDataSource:
- uma_result = PROPERTY_DATA_SOURCE;
- DVLOG(1) << "kAudioDevicePropertyDataSource";
- break;
- case kAudioDevicePropertyVolumeDecibels:
- uma_result = PROPERTY_VOLUME_DECIBELS;
- DVLOG(1) << "kAudioDevicePropertyVolumeDecibels";
- break;
- case kAudioDevicePropertyVolumeScalar:
- uma_result = PROPERTY_VOLUME_SCALAR;
- DVLOG(1) << "kAudioDevicePropertyVolumeScalar";
- break;
- case kAudioDevicePropertyMute:
- uma_result = PROPERTY_MUTE;
- DVLOG(1) << "kAudioDevicePropertyMute";
- break;
- case kAudioDevicePropertyPlugIn:
- uma_result = PROPERTY_PLUGIN;
- DVLOG(1) << "kAudioDevicePropertyPlugIn";
- break;
- case kAudioDevicePropertyUsesVariableBufferFrameSizes:
- uma_result = PROPERTY_USES_VARIABLE_BUFFER_FRAME_SIZES;
- DVLOG(1) << "kAudioDevicePropertyUsesVariableBufferFrameSizes";
- break;
- case kAudioDevicePropertyIOCycleUsage:
- uma_result = PROPERTY_IO_CYCLE_USAGE;
- DVLOG(1) << "kAudioDevicePropertyIOCycleUsage";
- break;
- case kAudioDevicePropertyIOProcStreamUsage:
- uma_result = PROPERTY_IO_PROC_STREAM_USAGE;
- DVLOG(1) << "kAudioDevicePropertyIOProcStreamUsage";
- break;
- case kAudioDevicePropertyConfigurationApplication:
- uma_result = PROPERTY_CONFIGURATION_APPLICATION;
- DVLOG(1) << "kAudioDevicePropertyConfigurationApplication";
- break;
- case kAudioDevicePropertyDeviceUID:
- uma_result = PROPERTY_DEVICE_UID;
- DVLOG(1) << "kAudioDevicePropertyDeviceUID";
- break;
- case kAudioDevicePropertyModelUID:
- uma_result = PROPERTY_MODE_UID;
- DVLOG(1) << "kAudioDevicePropertyModelUID";
- break;
- case kAudioDevicePropertyTransportType:
- uma_result = PROPERTY_TRANSPORT_TYPE;
- DVLOG(1) << "kAudioDevicePropertyTransportType";
- break;
- case kAudioDevicePropertyRelatedDevices:
- uma_result = PROPERTY_RELATED_DEVICES;
- DVLOG(1) << "kAudioDevicePropertyRelatedDevices";
- break;
- case kAudioDevicePropertyClockDomain:
- uma_result = PROPERTY_CLOCK_DOMAIN;
- DVLOG(1) << "kAudioDevicePropertyClockDomain";
- break;
- case kAudioDevicePropertyDeviceCanBeDefaultDevice:
- uma_result = PROPERTY_DEVICE_CAN_BE_DEFAULT_DEVICE;
- DVLOG(1) << "kAudioDevicePropertyDeviceCanBeDefaultDevice";
- break;
- case kAudioDevicePropertyDeviceCanBeDefaultSystemDevice:
- uma_result = PROPERTY_DEVICE_CAN_BE_DEFAULT_SYSTEM_DEVICE;
- DVLOG(1) << "kAudioDevicePropertyDeviceCanBeDefaultSystemDevice";
- break;
- case kAudioDevicePropertyLatency:
- uma_result = PROPERTY_LATENCY;
- DVLOG(1) << "kAudioDevicePropertyLatency";
- break;
- case kAudioDevicePropertyStreams:
- uma_result = PROPERTY_STREAMS;
- DVLOG(1) << "kAudioDevicePropertyStreams";
- break;
- case kAudioObjectPropertyControlList:
- uma_result = PROPERTY_CONTROL_LIST;
- DVLOG(1) << "kAudioObjectPropertyControlList";
- break;
- case kAudioDevicePropertySafetyOffset:
- uma_result = PROPERTY_SAFETY_OFFSET;
- DVLOG(1) << "kAudioDevicePropertySafetyOffset";
- break;
- case kAudioDevicePropertyAvailableNominalSampleRates:
- uma_result = PROPERTY_AVAILABLE_NOMINAL_SAMPLE_RATES;
- DVLOG(1) << "kAudioDevicePropertyAvailableNominalSampleRates";
- break;
- case kAudioDevicePropertyIcon:
- uma_result = PROPERTY_ICON;
- DVLOG(1) << "kAudioDevicePropertyIcon";
- break;
- case kAudioDevicePropertyIsHidden:
- uma_result = PROPERTY_IS_HIDDEN;
- DVLOG(1) << "kAudioDevicePropertyIsHidden";
- break;
- case kAudioDevicePropertyPreferredChannelsForStereo:
- uma_result = PROPERTY_PREFERRED_CHANNELS_FOR_STEREO;
- DVLOG(1) << "kAudioDevicePropertyPreferredChannelsForStereo";
- break;
- case kAudioDevicePropertyPreferredChannelLayout:
- uma_result = PROPERTY_PREFERRED_CHANNEL_LAYOUT;
- DVLOG(1) << "kAudioDevicePropertyPreferredChannelLayout";
- break;
- case kAudioDevicePropertyVolumeRangeDecibels:
- uma_result = PROPERTY_VOLUME_RANGE_DECIBELS;
- DVLOG(1) << "kAudioDevicePropertyVolumeRangeDecibels";
- break;
- case kAudioDevicePropertyVolumeScalarToDecibels:
- uma_result = PROPERTY_VOLUME_SCALAR_TO_DECIBELS;
- DVLOG(1) << "kAudioDevicePropertyVolumeScalarToDecibels";
- break;
- case kAudioDevicePropertyVolumeDecibelsToScalar:
- uma_result = PROPERTY_VOLUME_DECIBEL_TO_SCALAR;
- DVLOG(1) << "kAudioDevicePropertyVolumeDecibelsToScalar";
- break;
- case kAudioDevicePropertyStereoPan:
- uma_result = PROPERTY_STEREO_PAN;
- DVLOG(1) << "kAudioDevicePropertyStereoPan";
- break;
- case kAudioDevicePropertyStereoPanChannels:
- uma_result = PROPERTY_STEREO_PAN_CHANNELS;
- DVLOG(1) << "kAudioDevicePropertyStereoPanChannels";
- break;
- case kAudioDevicePropertySolo:
- uma_result = PROPERTY_SOLO;
- DVLOG(1) << "kAudioDevicePropertySolo";
- break;
- case kAudioDevicePropertyPhantomPower:
- uma_result = PROPERTY_PHANTOM_POWER;
- DVLOG(1) << "kAudioDevicePropertyPhantomPower";
- break;
- case kAudioDevicePropertyPhaseInvert:
- uma_result = PROPERTY_PHASE_INVERT;
- DVLOG(1) << "kAudioDevicePropertyPhaseInvert";
- break;
- case kAudioDevicePropertyClipLight:
- uma_result = PROPERTY_CLIP_LIGHT;
- DVLOG(1) << "kAudioDevicePropertyClipLight";
- break;
- case kAudioDevicePropertyTalkback:
- uma_result = PROPERTY_TALKBACK;
- DVLOG(1) << "kAudioDevicePropertyTalkback";
- break;
- case kAudioDevicePropertyListenback:
- uma_result = PROPERTY_LISTENBACK;
- DVLOG(1) << "kAudioDevicePropertyListenback";
- break;
- case kAudioDevicePropertyClockSource:
- uma_result = PROPERTY_CLOCK_SOURCE;
- DVLOG(1) << "kAudioDevicePropertyClockSource";
- break;
- case kAudioDevicePropertyClockSources:
- uma_result = PROPERTY_CLOCK_SOURCES;
- DVLOG(1) << "kAudioDevicePropertyClockSources";
- break;
- case kAudioDevicePropertySubMute:
- uma_result = PROPERTY_SUB_MUTE;
- DVLOG(1) << "kAudioDevicePropertySubMute";
- break;
- default:
- uma_result = PROPERTY_OTHER;
- DVLOG(1) << "Property change is ignored";
- break;
- }
- DVLOG(1) << "property: " << device_property << " ("
- << FourCharFormatCodeToString(device_property) << ")"
- << " changed: " << change_count;
- LogDevicePropertyChange(startup_failed, uma_result);
- }
- device_property_changes_map_.clear();
-}
-
void AUAudioInputStream::UpdateCaptureTimestamp(
const AudioTimeStamp* timestamp) {
if ((timestamp->mFlags & kAudioTimeStampSampleTimeValid) == 0)
diff --git a/chromium/media/audio/mac/audio_low_latency_input_mac.h b/chromium/media/audio/mac/audio_low_latency_input_mac.h
index 0c2acfaa2da..1e51116b8e1 100644
--- a/chromium/media/audio/mac/audio_low_latency_input_mac.h
+++ b/chromium/media/audio/mac/audio_low_latency_input_mac.h
@@ -39,14 +39,12 @@
#include <AudioUnit/AudioUnit.h>
#include <CoreAudio/CoreAudio.h>
-#include <map>
#include <memory>
#include <vector>
#include "base/atomicops.h"
#include "base/cancelable_callback.h"
#include "base/macros.h"
-#include "base/memory/weak_ptr.h"
#include "base/threading/thread_checker.h"
#include "base/time/time.h"
#include "base/timer/timer.h"
@@ -97,8 +95,6 @@ class MEDIA_EXPORT AUAudioInputStream
}
private:
- static const AudioObjectPropertyAddress kDeviceChangePropertyAddress;
-
// Callback functions called on a real-time priority I/O thread from the audio
// unit. These methods are called when recorded audio is available.
static OSStatus DataIsAvailable(void* context,
@@ -117,27 +113,6 @@ class MEDIA_EXPORT AUAudioInputStream
AudioBufferList* io_data,
const AudioTimeStamp* time_stamp);
- // Callback functions called on different system threads from the Core Audio
- // framework. These methods are called when device properties are changed.
- static OSStatus OnDevicePropertyChanged(
- AudioObjectID object_id,
- UInt32 num_addresses,
- const AudioObjectPropertyAddress addresses[],
- void* context);
- OSStatus DevicePropertyChanged(AudioObjectID object_id,
- UInt32 num_addresses,
- const AudioObjectPropertyAddress addresses[]);
-
- // Updates the |device_property_changes_map_| on the main browser thread,
- // (CrBrowserMain) which is the same thread as this instance is created on.
- void DevicePropertyChangedOnMainThread(const std::vector<UInt32>& properties);
-
- // Registers OnDevicePropertyChanged() to receive notifications when device
- // properties changes.
- void RegisterDeviceChangeListener();
- // Stop listening for changes in device properties.
- void DeRegisterDeviceChangeListener();
-
// Gets the current capture time.
base::TimeTicks GetCaptureTime(const AudioTimeStamp* input_time_stamp);
@@ -166,10 +141,6 @@ class MEDIA_EXPORT AUAudioInputStream
// Adds extra UMA stats when it has been detected that startup failed.
void AddHistogramsForFailedStartup();
- // Scans the map of all available property changes (notification types) and
- // filters out some that make sense to add to UMA stats.
- void AddDevicePropertyChangesToUMA(bool startup_failed);
-
// Updates capture timestamp, current lost frames, and total lost frames and
// glitches.
void UpdateCaptureTimestamp(const AudioTimeStamp* timestamp);
@@ -263,21 +234,6 @@ class MEDIA_EXPORT AUAudioInputStream
// Set to true once when AudioUnitRender() succeeds for the first time.
bool audio_unit_render_has_worked_;
- // Maps unique representations of device property notification types and
- // number of times we have been notified about a change in such a type.
- // While the notifier is active, this member is modified by several different
- // internal thread. My guess is that a serial dispatch queue is used under
- // the hood and it executes one task at a time in the order in which they are
- // added to the queue. The currently executing task runs on a distinct thread
- // (which can vary from task to task) that is managed by the dispatch queue.
- // The map is always read on the creating thread but only while the notifier
- // is disabled, hence no lock is required.
- std::map<UInt32, int> device_property_changes_map_;
-
- // Set to true when we are listening for changes in device properties.
- // Only touched on the creating thread.
- bool device_listener_is_active_;
-
// Set to true when we've successfully called SuppressNoiseReduction to
// disable ambient noise reduction.
bool noise_reduction_suppressed_;
@@ -299,11 +255,6 @@ class MEDIA_EXPORT AUAudioInputStream
// Callback to send statistics info.
AudioManager::LogCallback log_callback_;
- // Used to ensure DevicePropertyChangedOnMainThread() is not called when
- // this object is destroyed.
- // Note that, all member variables should appear before the WeakPtrFactory.
- base::WeakPtrFactory<AUAudioInputStream> weak_factory_;
-
DISALLOW_COPY_AND_ASSIGN(AUAudioInputStream);
};
diff --git a/chromium/media/audio/win/audio_low_latency_output_win.cc b/chromium/media/audio/win/audio_low_latency_output_win.cc
index 1a538d02b98..accbacb4aa0 100644
--- a/chromium/media/audio/win/audio_low_latency_output_win.cc
+++ b/chromium/media/audio/win/audio_low_latency_output_win.cc
@@ -251,17 +251,34 @@ void WASAPIAudioOutputStream::Start(AudioSourceCallback* callback) {
return;
}
- source_ = callback;
-
- // Ensure that the endpoint buffer is prepared with silence.
+ // Ensure that the endpoint buffer is prepared with silence. Also serves as
+ // a sanity check for the IAudioClient and IAudioRenderClient which may have
+ // been invalidated by Windows since the last Stop() call.
+ //
+ // While technically we only need to retry when WASAPI tells us the device has
+ // been invalidated (AUDCLNT_E_DEVICE_INVALIDATED), we retry for all errors
+ // for simplicity and due to large sites like YouTube reporting high success
+ // rates with a simple retry upon detection of an audio output error.
if (share_mode_ == AUDCLNT_SHAREMODE_SHARED) {
if (!CoreAudioUtil::FillRenderEndpointBufferWithSilence(
audio_client_.Get(), audio_render_client_.Get())) {
- LOG(ERROR) << "Failed to prepare endpoint buffers with silence.";
- callback->OnError();
- return;
+ DLOG(WARNING) << "Failed to prepare endpoint buffers with silence. "
+ "Attempting recovery with a new IAudioClient and "
+ "IAudioRenderClient.";
+
+ opened_ = false;
+ audio_client_.Reset();
+ audio_render_client_.Reset();
+ if (!Open() || !CoreAudioUtil::FillRenderEndpointBufferWithSilence(
+ audio_client_.Get(), audio_render_client_.Get())) {
+ DLOG(ERROR) << "Failed recovery of audio clients; Start() failed.";
+ callback->OnError();
+ return;
+ }
}
}
+
+ source_ = callback;
num_written_frames_ = endpoint_buffer_size_frames_;
// Create and start the thread that will drive the rendering by waiting for
diff --git a/chromium/media/audio/win/core_audio_util_win.cc b/chromium/media/audio/win/core_audio_util_win.cc
index 36dd9cd9aef..d8a20c84833 100644
--- a/chromium/media/audio/win/core_audio_util_win.cc
+++ b/chromium/media/audio/win/core_audio_util_win.cc
@@ -897,25 +897,36 @@ ComPtr<IAudioCaptureClient> CoreAudioUtil::CreateCaptureClient(
}
bool CoreAudioUtil::FillRenderEndpointBufferWithSilence(
- IAudioClient* client, IAudioRenderClient* render_client) {
+ IAudioClient* client,
+ IAudioRenderClient* render_client) {
UINT32 endpoint_buffer_size = 0;
- if (FAILED(client->GetBufferSize(&endpoint_buffer_size)))
+ if (FAILED(client->GetBufferSize(&endpoint_buffer_size))) {
+ PLOG(ERROR) << "Failed IAudioClient::GetBufferSize()";
return false;
+ }
UINT32 num_queued_frames = 0;
- if (FAILED(client->GetCurrentPadding(&num_queued_frames)))
+ if (FAILED(client->GetCurrentPadding(&num_queued_frames))) {
+ PLOG(ERROR) << "Failed IAudioClient::GetCurrentPadding()";
return false;
+ }
BYTE* data = NULL;
int num_frames_to_fill = endpoint_buffer_size - num_queued_frames;
- if (FAILED(render_client->GetBuffer(num_frames_to_fill, &data)))
+ if (FAILED(render_client->GetBuffer(num_frames_to_fill, &data))) {
+ PLOG(ERROR) << "Failed IAudioRenderClient::GetBuffer()";
return false;
+ }
// Using the AUDCLNT_BUFFERFLAGS_SILENT flag eliminates the need to
// explicitly write silence data to the rendering buffer.
- DVLOG(2) << "filling up " << num_frames_to_fill << " frames with silence";
- return SUCCEEDED(render_client->ReleaseBuffer(num_frames_to_fill,
- AUDCLNT_BUFFERFLAGS_SILENT));
+ if (FAILED(render_client->ReleaseBuffer(num_frames_to_fill,
+ AUDCLNT_BUFFERFLAGS_SILENT))) {
+ PLOG(ERROR) << "Failed IAudioRenderClient::ReleaseBuffer()";
+ return false;
+ }
+
+ return true;
}
bool CoreAudioUtil::GetDxDiagDetails(std::string* driver_name,
diff --git a/chromium/media/capture/video/chromeos/local_gpu_memory_buffer_manager.cc b/chromium/media/capture/video/chromeos/local_gpu_memory_buffer_manager.cc
index 7c213cb49b3..2396d59c7d3 100644
--- a/chromium/media/capture/video/chromeos/local_gpu_memory_buffer_manager.cc
+++ b/chromium/media/capture/video/chromeos/local_gpu_memory_buffer_manager.cc
@@ -69,11 +69,10 @@ class GpuMemoryBufferImplGbm : public gfx::GpuMemoryBuffer {
handle_.native_pixmap_handle.fds.push_back(
base::FileDescriptor(gbm_bo_get_fd(buffer_object), false));
for (size_t i = 0; i < gbm_bo_get_num_planes(buffer_object); ++i) {
- handle_.native_pixmap_handle.planes.push_back(gfx::NativePixmapPlane(
- gbm_bo_get_plane_stride(buffer_object, i),
- gbm_bo_get_plane_offset(buffer_object, i),
- gbm_bo_get_plane_size(buffer_object, i),
- gbm_bo_get_plane_format_modifier(buffer_object, i)));
+ handle_.native_pixmap_handle.planes.push_back(
+ gfx::NativePixmapPlane(gbm_bo_get_plane_stride(buffer_object, i),
+ gbm_bo_get_plane_offset(buffer_object, i),
+ gbm_bo_get_plane_size(buffer_object, i)));
}
}
diff --git a/chromium/media/capture/video/chromeos/mock_gpu_memory_buffer_manager.cc b/chromium/media/capture/video/chromeos/mock_gpu_memory_buffer_manager.cc
index 529f9da2ab6..9a45b69f3ce 100644
--- a/chromium/media/capture/video/chromeos/mock_gpu_memory_buffer_manager.cc
+++ b/chromium/media/capture/video/chromeos/mock_gpu_memory_buffer_manager.cc
@@ -35,10 +35,10 @@ MockGpuMemoryBufferManager::ReturnValidBuffer(
// Set a dummy fd since this is for testing only.
handle.native_pixmap_handle.fds.push_back(base::FileDescriptor(0, false));
handle.native_pixmap_handle.planes.push_back(
- gfx::NativePixmapPlane(size.width(), 0, size.width() * size.height(), 0));
+ gfx::NativePixmapPlane(size.width(), 0, size.width() * size.height()));
handle.native_pixmap_handle.planes.push_back(gfx::NativePixmapPlane(
size.width(), handle.native_pixmap_handle.planes[0].size,
- size.width() * size.height() / 2, 0));
+ size.width() * size.height() / 2));
auto mock_buffer = std::make_unique<MockGpuMemoryBuffer>();
ON_CALL(*mock_buffer, Map()).WillByDefault(Return(true));
diff --git a/chromium/media/capture/video/chromeos/stream_buffer_manager_unittest.cc b/chromium/media/capture/video/chromeos/stream_buffer_manager_unittest.cc
index db8634375bb..d1d5fdc488c 100644
--- a/chromium/media/capture/video/chromeos/stream_buffer_manager_unittest.cc
+++ b/chromium/media/capture/video/chromeos/stream_buffer_manager_unittest.cc
@@ -86,9 +86,9 @@ std::unique_ptr<gfx::GpuMemoryBuffer> CreateMockGpuMemoryBuffer(
fake_handle.native_pixmap_handle.fds.push_back(
base::FileDescriptor(0, false));
fake_handle.native_pixmap_handle.planes.push_back(
- gfx::NativePixmapPlane(1280, 0, 1280 * 720, 0));
+ gfx::NativePixmapPlane(1280, 0, 1280 * 720));
fake_handle.native_pixmap_handle.planes.push_back(
- gfx::NativePixmapPlane(1280, 0, 1280 * 720 / 2, 0));
+ gfx::NativePixmapPlane(1280, 0, 1280 * 720 / 2));
void* fake_mapped_address = reinterpret_cast<void*>(0xdeadbeef);
EXPECT_CALL(*mock_buffer, Map()).WillRepeatedly(Return(true));
diff --git a/chromium/media/gpu/v4l2/generic_v4l2_device.cc b/chromium/media/gpu/v4l2/generic_v4l2_device.cc
index 2e25b93b0c4..241598c39f1 100644
--- a/chromium/media/gpu/v4l2/generic_v4l2_device.cc
+++ b/chromium/media/gpu/v4l2/generic_v4l2_device.cc
@@ -323,7 +323,7 @@ scoped_refptr<gl::GLImage> GenericV4L2Device::CreateGLImage(
for (size_t p = 0; p < num_planes; ++p) {
native_pixmap_handle.planes.emplace_back(
VideoFrame::RowBytes(p, vf_format, size.width()), plane_offset,
- VideoFrame::PlaneSize(vf_format, p, size).GetArea(), 0);
+ VideoFrame::PlaneSize(vf_format, p, size).GetArea());
if (v4l2_plane + 1 < dmabuf_fds.size()) {
++v4l2_plane;
diff --git a/chromium/media/gpu/vaapi/vaapi_video_decode_accelerator.cc b/chromium/media/gpu/vaapi/vaapi_video_decode_accelerator.cc
index 7f2a5e8a62e..e8f7a373976 100644
--- a/chromium/media/gpu/vaapi/vaapi_video_decode_accelerator.cc
+++ b/chromium/media/gpu/vaapi/vaapi_video_decode_accelerator.cc
@@ -1055,17 +1055,8 @@ void VaapiVideoDecodeAccelerator::Cleanup() {
client_ptr_factory_.reset();
weak_this_factory_.InvalidateWeakPtrs();
- decoder_thread_task_runner_->DeleteSoon(FROM_HERE, decoder_.release());
- if (h264_accelerator_) {
- decoder_thread_task_runner_->DeleteSoon(FROM_HERE,
- h264_accelerator_.release());
- } else if (vp8_accelerator_) {
- decoder_thread_task_runner_->DeleteSoon(FROM_HERE,
- vp8_accelerator_.release());
- } else if (vp9_accelerator_) {
- decoder_thread_task_runner_->DeleteSoon(FROM_HERE,
- vp9_accelerator_.release());
- }
+ // TODO(mcasas): consider deleting |decoder_| and |*_accelerator_| on
+ // |decoder_thread_task_runner_|, https://crbug.com/789160.
// Signal all potential waiters on the decoder_thread_, let them early-exit,
// as we've just moved to the kDestroying state, and wait for all tasks
@@ -1154,7 +1145,8 @@ VaapiVideoDecodeAccelerator::VaapiH264Accelerator::VaapiH264Accelerator(
}
VaapiVideoDecodeAccelerator::VaapiH264Accelerator::~VaapiH264Accelerator() {
- DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
+ // TODO(mcasas): consider enabling the checker, https://crbug.com/789160
+ // DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
}
scoped_refptr<H264Picture>
@@ -1496,7 +1488,8 @@ VaapiVideoDecodeAccelerator::VaapiVP8Accelerator::VaapiVP8Accelerator(
}
VaapiVideoDecodeAccelerator::VaapiVP8Accelerator::~VaapiVP8Accelerator() {
- DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
+ // TODO(mcasas): consider enabling the checker, https://crbug.com/789160
+ // DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
}
scoped_refptr<VP8Picture>
@@ -1732,7 +1725,8 @@ VaapiVideoDecodeAccelerator::VaapiVP9Accelerator::VaapiVP9Accelerator(
}
VaapiVideoDecodeAccelerator::VaapiVP9Accelerator::~VaapiVP9Accelerator() {
- DCHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
+ // TODO(mcasas): consider enabling the checker, https://crbug.com/789160
+ // CHECK_CALLED_ON_VALID_SEQUENCE(sequence_checker_);
}
scoped_refptr<VP9Picture>
diff --git a/chromium/mojo/edk/embedder/platform_shared_buffer.cc b/chromium/mojo/edk/embedder/platform_shared_buffer.cc
index 6b445403341..c2a6b1de664 100644
--- a/chromium/mojo/edk/embedder/platform_shared_buffer.cc
+++ b/chromium/mojo/edk/embedder/platform_shared_buffer.cc
@@ -180,6 +180,34 @@ ScopedPlatformHandle PlatformSharedBuffer::DuplicatePlatformHandle() {
return SharedMemoryToPlatformHandle(handle);
}
+ScopedPlatformHandle PlatformSharedBuffer::DuplicatePlatformHandleForIPC() {
+ DCHECK(shared_memory_);
+ base::SharedMemoryHandle handle;
+ {
+ base::AutoLock locker(lock_);
+ handle = base::SharedMemory::DuplicateHandle(shared_memory_->handle());
+ }
+ if (!handle.IsValid())
+ return ScopedPlatformHandle();
+
+#if defined(OS_ANDROID)
+ if (handle.IsReadOnly()) {
+ // Trying to send a descriptor with the |read_only| property set
+ // while the region has not been sealed read-only yet is a programmer
+ // error. However, fixing all uses cases would require refactoring
+ // too much code for now. TODO(digit): See http://crbug.com/795291
+ //
+ // So just print an error. In the future, change this to DCHECK() to
+ // catch bad use cases, and refactor the appropriate code.
+ if (!handle.IsRegionReadOnly()) {
+ DLOG(ERROR) << "Forcing region read-only before Mojo serialization";
+ handle.SetRegionReadOnly();
+ }
+ }
+#endif
+ return SharedMemoryToPlatformHandle(handle);
+}
+
ScopedPlatformHandle PlatformSharedBuffer::PassPlatformHandle() {
DCHECK(HasOneRef());
diff --git a/chromium/mojo/edk/embedder/platform_shared_buffer.h b/chromium/mojo/edk/embedder/platform_shared_buffer.h
index 637fce24a9d..871c8319243 100644
--- a/chromium/mojo/edk/embedder/platform_shared_buffer.h
+++ b/chromium/mojo/edk/embedder/platform_shared_buffer.h
@@ -91,6 +91,12 @@ class MOJO_SYSTEM_IMPL_EXPORT PlatformSharedBuffer
// Duplicates the underlying platform handle and passes it to the caller.
ScopedPlatformHandle DuplicatePlatformHandle();
+ // Duplicate the underlying platform handle and passes it to the caller,
+ // for the purpose of serialization / IPC. The difference with
+ // DuplicatePlatformHandle() is that this also seals read-only regions
+ // on Android to ensure the receiver cannot map them writable.
+ ScopedPlatformHandle DuplicatePlatformHandleForIPC();
+
// Duplicates the underlying shared memory handle and passes it to the caller.
base::SharedMemoryHandle DuplicateSharedMemoryHandle();
diff --git a/chromium/mojo/edk/system/shared_buffer_dispatcher.cc b/chromium/mojo/edk/system/shared_buffer_dispatcher.cc
index 222cbab351c..f65fd88e36e 100644
--- a/chromium/mojo/edk/system/shared_buffer_dispatcher.cc
+++ b/chromium/mojo/edk/system/shared_buffer_dispatcher.cc
@@ -263,7 +263,7 @@ bool SharedBufferDispatcher::EndSerialize(void* destination,
serialized_state->guid_low = guid.GetLowForSerialization();
serialized_state->padding = 0;
- handles[0] = shared_buffer_->DuplicatePlatformHandle();
+ handles[0] = shared_buffer_->DuplicatePlatformHandleForIPC();
if (!handles[0].is_valid()) {
shared_buffer_ = nullptr;
return false;
diff --git a/chromium/mojo/edk/system/shared_buffer_dispatcher_unittest.cc b/chromium/mojo/edk/system/shared_buffer_dispatcher_unittest.cc
index c95bdc3b704..5348c5f18e4 100644
--- a/chromium/mojo/edk/system/shared_buffer_dispatcher_unittest.cc
+++ b/chromium/mojo/edk/system/shared_buffer_dispatcher_unittest.cc
@@ -217,12 +217,15 @@ TEST_F(SharedBufferDispatcherTest, DuplicateBufferHandleOptionsValid) {
SharedBufferDispatcher::kDefaultCreateOptions,
nullptr, 100, &dispatcher1));
+ // NOTE: On Android, once a region has been mapped read-only, it cannot
+ // be mapped writable anymore, so ensure that the READ_ONLY case
+ // appears last in the options[] table below.
MojoDuplicateBufferHandleOptions options[] = {
+ {sizeof(MojoDuplicateBufferHandleOptionsFlags), ~0u},
{sizeof(MojoDuplicateBufferHandleOptions),
MOJO_DUPLICATE_BUFFER_HANDLE_OPTIONS_FLAG_NONE},
{sizeof(MojoDuplicateBufferHandleOptions),
- MOJO_DUPLICATE_BUFFER_HANDLE_OPTIONS_FLAG_READ_ONLY},
- {sizeof(MojoDuplicateBufferHandleOptionsFlags), ~0u}};
+ MOJO_DUPLICATE_BUFFER_HANDLE_OPTIONS_FLAG_READ_ONLY}};
for (size_t i = 0; i < arraysize(options); i++) {
scoped_refptr<Dispatcher> dispatcher2;
EXPECT_EQ(MOJO_RESULT_OK, dispatcher1->DuplicateBufferHandle(
diff --git a/chromium/net/http/http_auth_handler_ntlm_portable.cc b/chromium/net/http/http_auth_handler_ntlm_portable.cc
index 140bf6cc7fd..a25da7c1555 100644
--- a/chromium/net/http/http_auth_handler_ntlm_portable.cc
+++ b/chromium/net/http/http_auth_handler_ntlm_portable.cc
@@ -40,7 +40,7 @@ HttpAuthHandlerNTLM::HttpAuthHandlerNTLM(
const HttpAuthPreferences* http_auth_preferences)
: ntlm_client_(ntlm::NtlmFeatures(
http_auth_preferences ? http_auth_preferences->NtlmV2Enabled()
- : false)) {}
+ : true)) {}
bool HttpAuthHandlerNTLM::NeedsIdentity() {
// This gets called for each round-trip. Only require identity on
diff --git a/chromium/net/http/http_cache_transaction.cc b/chromium/net/http/http_cache_transaction.cc
index 0dbacd48f37..77e1ae4de82 100644
--- a/chromium/net/http/http_cache_transaction.cc
+++ b/chromium/net/http/http_cache_transaction.cc
@@ -366,7 +366,7 @@ int HttpCache::Transaction::Read(IOBuffer* buf, int buf_len,
read_buf_ = buf;
io_buf_len_ = buf_len;
int rv = TransitionToReadingState();
- if (rv != OK)
+ if (rv != OK || next_state_ == STATE_NONE)
return rv;
rv = DoLoop(OK);
@@ -386,16 +386,20 @@ int HttpCache::Transaction::TransitionToReadingState() {
// LOAD_DISABLE_CACHE) or there was an error during the headers phase
// due to which the transaction cannot write to the cache or the consumer
// is reading the auth response from the network.
- // TODO(crbug.com/740947) to get rid of this state in future.
+ // TODO(http://crbug.com/740947) to get rid of this state in future.
next_state_ = STATE_NETWORK_READ;
return OK;
}
// If there is no network, and no cache entry, then there is nothing to read
- // from. An error state should be set for the next read, else this
- // transaction should have been terminated once it reached this state.
+ // from.
next_state_ = STATE_NONE;
- DCHECK_GT(OK, shared_writing_error_);
+
+ // An error state should be set for the next read, else this transaction
+ // should have been terminated once it reached this state. To assert we
+ // could dcheck that shared_writing_error_ is set to a valid error value but
+ // in some specific conditions (http://crbug.com/806344) it's possible that
+ // the consumer does an extra Read in which case the assert will fail.
return shared_writing_error_;
}
diff --git a/chromium/net/http/http_cache_unittest.cc b/chromium/net/http/http_cache_unittest.cc
index f834fa62a41..687751ad60f 100644
--- a/chromium/net/http/http_cache_unittest.cc
+++ b/chromium/net/http/http_cache_unittest.cc
@@ -3074,6 +3074,36 @@ TEST(HttpCache, SimpleGET_ParallelWritingVerifyNetworkBytes) {
kSimpleGET_Transaction);
}
+// Tests than extra Read from the consumer should not hang/crash the browser.
+TEST(HttpCache, SimpleGET_ExtraRead) {
+ MockHttpCache cache;
+ MockHttpRequest request(kSimpleGET_Transaction);
+ Context c;
+
+ c.result = cache.CreateTransaction(&c.trans);
+ ASSERT_THAT(c.result, IsOk());
+
+ c.result =
+ c.trans->Start(&request, c.callback.callback(), NetLogWithSource());
+
+ base::RunLoop().RunUntilIdle();
+
+ EXPECT_EQ(1, cache.network_layer()->transaction_count());
+ EXPECT_EQ(0, cache.disk_cache()->open_count());
+ EXPECT_EQ(1, cache.disk_cache()->create_count());
+
+ EXPECT_EQ(1, cache.GetCountWriterTransactions(kSimpleGET_Transaction.url));
+ EXPECT_EQ(0, cache.GetCountDoneHeadersQueue(kSimpleGET_Transaction.url));
+
+ ReadAndVerifyTransaction(c.trans.get(), kSimpleGET_Transaction);
+
+ // Perform an extra Read.
+ const int kBufferSize = 10;
+ scoped_refptr<IOBuffer> buffer(new IOBuffer(kBufferSize));
+ c.result = c.trans->Read(buffer.get(), kBufferSize, c.callback.callback());
+ EXPECT_EQ(0, c.result);
+}
+
// Tests when a writer is destroyed mid-read, all the other writer transactions
// can continue writing to the entry.
TEST(HttpCache, SimpleGET_ParallelValidationCancelWriter) {
diff --git a/chromium/net/http/http_network_transaction_unittest.cc b/chromium/net/http/http_network_transaction_unittest.cc
index 4f2f307f919..1ada2f11344 100644
--- a/chromium/net/http/http_network_transaction_unittest.cc
+++ b/chromium/net/http/http_network_transaction_unittest.cc
@@ -806,7 +806,7 @@ bool CheckNTLMServerAuth(const AuthChallengeInfo* auth_challenge) {
if (!auth_challenge)
return false;
EXPECT_FALSE(auth_challenge->is_proxy);
- EXPECT_EQ("https://172.22.68.17", auth_challenge->challenger.Serialize());
+ EXPECT_EQ("https://server", auth_challenge->challenger.Serialize());
EXPECT_EQ(std::string(), auth_challenge->realm);
EXPECT_EQ(kNtlmAuthScheme, auth_challenge->scheme);
return true;
@@ -6199,10 +6199,10 @@ TEST_F(HttpNetworkTransactionTest, BasicAuthProxyThenServer) {
// [1] https://msdn.microsoft.com/en-us/library/cc236621.aspx
// Enter the correct password and authenticate successfully.
-TEST_F(HttpNetworkTransactionTest, NTLMAuthV1) {
+TEST_F(HttpNetworkTransactionTest, NTLMAuthV2) {
HttpRequestInfo request;
request.method = "GET";
- request.url = GURL("https://172.22.68.17/kids/login.aspx");
+ request.url = GURL("https://server/kids/login.aspx");
// Ensure load is not disrupted by flags which suppress behaviour specific
// to other auth schemes.
@@ -6221,21 +6221,23 @@ TEST_F(HttpNetworkTransactionTest, NTLMAuthV1) {
reinterpret_cast<const char*>(ntlm::test::kExpectedNegotiateMsg),
arraysize(ntlm::test::kExpectedNegotiateMsg)),
&negotiate_msg);
- base::Base64Encode(base::StringPiece(reinterpret_cast<const char*>(
- ntlm::test::kChallengeMsgV1),
- arraysize(ntlm::test::kChallengeMsgV1)),
- &challenge_msg);
+ base::Base64Encode(
+ base::StringPiece(
+ reinterpret_cast<const char*>(ntlm::test::kChallengeMsgFromSpecV2),
+ arraysize(ntlm::test::kChallengeMsgFromSpecV2)),
+ &challenge_msg);
base::Base64Encode(
base::StringPiece(
reinterpret_cast<const char*>(
- ntlm::test::kExpectedAuthenticateMsgSpecResponseV1),
- arraysize(ntlm::test::kExpectedAuthenticateMsgSpecResponseV1)),
+ ntlm::test::kExpectedAuthenticateMsgEmptyChannelBindingsV2),
+ arraysize(
+ ntlm::test::kExpectedAuthenticateMsgEmptyChannelBindingsV2)),
&authenticate_msg);
MockWrite data_writes1[] = {
- MockWrite("GET /kids/login.aspx HTTP/1.1\r\n"
- "Host: 172.22.68.17\r\n"
- "Connection: keep-alive\r\n\r\n"),
+ MockWrite("GET /kids/login.aspx HTTP/1.1\r\n"
+ "Host: server\r\n"
+ "Connection: keep-alive\r\n\r\n"),
};
MockRead data_reads1[] = {
@@ -6255,7 +6257,7 @@ TEST_F(HttpNetworkTransactionTest, NTLMAuthV1) {
// request we should be issuing -- the final header line contains a Type
// 1 message.
MockWrite("GET /kids/login.aspx HTTP/1.1\r\n"
- "Host: 172.22.68.17\r\n"
+ "Host: server\r\n"
"Connection: keep-alive\r\n"
"Authorization: NTLM "),
MockWrite(negotiate_msg.c_str()), MockWrite("\r\n\r\n"),
@@ -6264,7 +6266,7 @@ TEST_F(HttpNetworkTransactionTest, NTLMAuthV1) {
// (using correct credentials). The second request continues on the
// same connection.
MockWrite("GET /kids/login.aspx HTTP/1.1\r\n"
- "Host: 172.22.68.17\r\n"
+ "Host: server\r\n"
"Connection: keep-alive\r\n"
"Authorization: NTLM "),
MockWrite(authenticate_msg.c_str()), MockWrite("\r\n\r\n"),
@@ -6353,10 +6355,10 @@ TEST_F(HttpNetworkTransactionTest, NTLMAuthV1) {
}
// Enter a wrong password, and then the correct one.
-TEST_F(HttpNetworkTransactionTest, NTLMAuthV1WrongThenRightPassword) {
+TEST_F(HttpNetworkTransactionTest, NTLMAuthV2WrongThenRightPassword) {
HttpRequestInfo request;
request.method = "GET";
- request.url = GURL("https://172.22.68.17/kids/login.aspx");
+ request.url = GURL("https://server/kids/login.aspx");
HttpAuthHandlerNTLM::ScopedProcSetter proc_setter(
MockGetMSTime, MockGenerateRandom, MockGetHostName);
@@ -6371,38 +6373,38 @@ TEST_F(HttpNetworkTransactionTest, NTLMAuthV1WrongThenRightPassword) {
reinterpret_cast<const char*>(ntlm::test::kExpectedNegotiateMsg),
arraysize(ntlm::test::kExpectedNegotiateMsg)),
&negotiate_msg);
- base::Base64Encode(base::StringPiece(reinterpret_cast<const char*>(
- ntlm::test::kChallengeMsgV1),
- arraysize(ntlm::test::kChallengeMsgV1)),
- &challenge_msg);
+ base::Base64Encode(
+ base::StringPiece(
+ reinterpret_cast<const char*>(ntlm::test::kChallengeMsgFromSpecV2),
+ arraysize(ntlm::test::kChallengeMsgFromSpecV2)),
+ &challenge_msg);
base::Base64Encode(
base::StringPiece(
reinterpret_cast<const char*>(
- ntlm::test::kExpectedAuthenticateMsgSpecResponseV1),
- arraysize(ntlm::test::kExpectedAuthenticateMsgSpecResponseV1)),
+ ntlm::test::kExpectedAuthenticateMsgEmptyChannelBindingsV2),
+ arraysize(
+ ntlm::test::kExpectedAuthenticateMsgEmptyChannelBindingsV2)),
&authenticate_msg);
// The authenticate message when |kWrongPassword| is sent.
std::string wrong_password_authenticate_msg(
- "TlRMTVNTUAADAAAAGAAYAEAAAAAYABgAWAAAAAwADABwAAAACAAIAHwAAAAQABAAhAAAAAAA"
- "AABAAAAAA4IIAKqqqqqqqqqqAAAAAAAAAAAAAAAAAAAAAF2npafgDxlql9qxEIhLlsuuJIEd"
- "NQHk7kQAbwBtAGEAaQBuAFUAcwBlAHIAQwBPAE0AUABVAFQARQBSAA==");
-
- // Sanity check that this is the same as |authenticate_msg| except for the
- // 24 bytes (32 encoded chars) of the NTLM Response.
+ "TlRMTVNTUAADAAAAGAAYAFgAAACKAIoAcAAAAAwADAD6AAAACAAIAAYBAAAQABAADgEAAAAA"
+ "AABYAAAAA4IIAAAAAAAAAAAAAPknEYqtJQtusopDRSfYzAAAAAAAAAAAAAAAAAAAAAAAAAAA"
+ "AAAAAOtVz38osnFdRRggUQHUJ3EBAQAAAAAAAIALyP0A1NIBqqqqqqqqqqoAAAAAAgAMAEQA"
+ "bwBtAGEAaQBuAAEADABTAGUAcgB2AGUAcgAGAAQAAgAAAAoAEAAAAAAAAAAAAAAAAAAAAAAA"
+ "CQAWAEgAVABUAFAALwBzAGUAcgB2AGUAcgAAAAAAAAAAAEQAbwBtAGEAaQBuAFUAcwBlAHIA"
+ "QwBPAE0AUABVAFQARQBSAA==");
+
+ // Sanity check that it's the same length as the correct authenticate message
+ // and that it's different.
ASSERT_EQ(authenticate_msg.length(),
wrong_password_authenticate_msg.length());
- ASSERT_EQ(authenticate_msg.length(), 200u);
- ASSERT_EQ(base::StringPiece(authenticate_msg.data(), 117),
- base::StringPiece(wrong_password_authenticate_msg.data(), 117));
- ASSERT_EQ(
- base::StringPiece(authenticate_msg.data() + 149, 51),
- base::StringPiece(wrong_password_authenticate_msg.data() + 149, 51));
+ ASSERT_NE(authenticate_msg, wrong_password_authenticate_msg);
MockWrite data_writes1[] = {
- MockWrite("GET /kids/login.aspx HTTP/1.1\r\n"
- "Host: 172.22.68.17\r\n"
- "Connection: keep-alive\r\n\r\n"),
+ MockWrite("GET /kids/login.aspx HTTP/1.1\r\n"
+ "Host: server\r\n"
+ "Connection: keep-alive\r\n\r\n"),
};
MockRead data_reads1[] = {
@@ -6422,7 +6424,7 @@ TEST_F(HttpNetworkTransactionTest, NTLMAuthV1WrongThenRightPassword) {
// request we should be issuing -- the final header line contains a Type
// 1 message.
MockWrite("GET /kids/login.aspx HTTP/1.1\r\n"
- "Host: 172.22.68.17\r\n"
+ "Host: server\r\n"
"Connection: keep-alive\r\n"
"Authorization: NTLM "),
MockWrite(negotiate_msg.c_str()), MockWrite("\r\n\r\n"),
@@ -6431,7 +6433,7 @@ TEST_F(HttpNetworkTransactionTest, NTLMAuthV1WrongThenRightPassword) {
// (using incorrect credentials). The second request continues on the
// same connection.
MockWrite("GET /kids/login.aspx HTTP/1.1\r\n"
- "Host: 172.22.68.17\r\n"
+ "Host: server\r\n"
"Connection: keep-alive\r\n"
"Authorization: NTLM "),
MockWrite(wrong_password_authenticate_msg.c_str()), MockWrite("\r\n\r\n"),
@@ -6458,7 +6460,7 @@ TEST_F(HttpNetworkTransactionTest, NTLMAuthV1WrongThenRightPassword) {
// request we should be issuing -- the final header line contains a Type
// 1 message.
MockWrite("GET /kids/login.aspx HTTP/1.1\r\n"
- "Host: 172.22.68.17\r\n"
+ "Host: server\r\n"
"Connection: keep-alive\r\n"
"Authorization: NTLM "),
MockWrite(negotiate_msg.c_str()), MockWrite("\r\n\r\n"),
@@ -6467,7 +6469,7 @@ TEST_F(HttpNetworkTransactionTest, NTLMAuthV1WrongThenRightPassword) {
// (the credentials for the origin server). The second request continues
// on the same connection.
MockWrite("GET /kids/login.aspx HTTP/1.1\r\n"
- "Host: 172.22.68.17\r\n"
+ "Host: server\r\n"
"Connection: keep-alive\r\n"
"Authorization: NTLM "),
MockWrite(authenticate_msg.c_str()), MockWrite("\r\n\r\n"),
@@ -6588,7 +6590,7 @@ TEST_F(HttpNetworkTransactionTest, NTLMOverHttp2) {
HttpAuthHandlerNTLM::ScopedProcSetter proc_setter(
MockGetMSTime, MockGenerateRandom, MockGetHostName);
- const char* kUrl = "https://172.22.68.17/kids/login.aspx";
+ const char* kUrl = "https://server/kids/login.aspx";
HttpRequestInfo request;
request.method = "GET";
@@ -6617,15 +6619,17 @@ TEST_F(HttpNetworkTransactionTest, NTLMOverHttp2) {
reinterpret_cast<const char*>(ntlm::test::kExpectedNegotiateMsg),
arraysize(ntlm::test::kExpectedNegotiateMsg)),
&negotiate_msg);
- base::Base64Encode(base::StringPiece(reinterpret_cast<const char*>(
- ntlm::test::kChallengeMsgV1),
- arraysize(ntlm::test::kChallengeMsgV1)),
- &challenge_msg);
+ base::Base64Encode(
+ base::StringPiece(
+ reinterpret_cast<const char*>(ntlm::test::kChallengeMsgFromSpecV2),
+ arraysize(ntlm::test::kChallengeMsgFromSpecV2)),
+ &challenge_msg);
base::Base64Encode(
base::StringPiece(
reinterpret_cast<const char*>(
- ntlm::test::kExpectedAuthenticateMsgSpecResponseV1),
- arraysize(ntlm::test::kExpectedAuthenticateMsgSpecResponseV1)),
+ ntlm::test::kExpectedAuthenticateMsgEmptyChannelBindingsV2),
+ arraysize(
+ ntlm::test::kExpectedAuthenticateMsgEmptyChannelBindingsV2)),
&authenticate_msg);
// Retry with authorization header.
@@ -6646,7 +6650,7 @@ TEST_F(HttpNetworkTransactionTest, NTLMOverHttp2) {
// request we should be issuing -- the final header line contains a Type
// 1 message.
MockWrite("GET /kids/login.aspx HTTP/1.1\r\n"
- "Host: 172.22.68.17\r\n"
+ "Host: server\r\n"
"Connection: keep-alive\r\n"
"Authorization: NTLM "),
MockWrite(negotiate_msg.c_str()), MockWrite("\r\n\r\n"),
@@ -6655,7 +6659,7 @@ TEST_F(HttpNetworkTransactionTest, NTLMOverHttp2) {
// (the credentials for the origin server). The second request continues
// on the same connection.
MockWrite("GET /kids/login.aspx HTTP/1.1\r\n"
- "Host: 172.22.68.17\r\n"
+ "Host: server\r\n"
"Connection: keep-alive\r\n"
"Authorization: NTLM "),
MockWrite(authenticate_msg.c_str()), MockWrite("\r\n\r\n"),
diff --git a/chromium/net/nqe/network_qualities_prefs_manager.cc b/chromium/net/nqe/network_qualities_prefs_manager.cc
index be3901575f4..a0091d90fb4 100644
--- a/chromium/net/nqe/network_qualities_prefs_manager.cc
+++ b/chromium/net/nqe/network_qualities_prefs_manager.cc
@@ -14,7 +14,6 @@
#include "base/threading/thread_checker.h"
#include "base/threading/thread_task_runner_handle.h"
#include "net/nqe/network_quality_estimator.h"
-#include "net/nqe/network_quality_estimator_params.h"
namespace net {
@@ -134,19 +133,6 @@ void NetworkQualitiesPrefsManager::OnChangeInCachedNetworkQualityOnPrefSequence(
if (network_id_string.find('.') != std::string::npos)
return;
- if (cached_network_quality.effective_connection_type() ==
- network_quality_estimator_->params()->GetDefaultECT(network_id.type)) {
- // No need to cache the network quality since the default network quality
- // (synthesized using the platform APIs) matches the observed network
- // quality.
- if (!prefs_->RemoveKey(network_id_string)) {
- // Return early since the prefs was unchanged.
- return;
- }
- pref_delegate_->SetDictionaryValue(*prefs_);
- return;
- }
-
prefs_->SetString(network_id_string,
GetNameForEffectiveConnectionType(
cached_network_quality.effective_connection_type()));
diff --git a/chromium/net/nqe/network_qualities_prefs_manager_unittest.cc b/chromium/net/nqe/network_qualities_prefs_manager_unittest.cc
index 44b228ca58a..8853684c1f7 100644
--- a/chromium/net/nqe/network_qualities_prefs_manager_unittest.cc
+++ b/chromium/net/nqe/network_qualities_prefs_manager_unittest.cc
@@ -173,11 +173,10 @@ TEST(NetworkQualitiesPrefManager, WriteWhenMatchingExpectedECT) {
estimator.RunOneRequest();
base::RunLoop().RunUntilIdle();
- // Cached network quality for |network_id| should be deleted from the prefs
- // since the expected network quality for |network_id| matches the observed
- // network quality.
- EXPECT_EQ(1u, manager.ForceReadPrefsForTesting().size());
- EXPECT_EQ(0u, manager.ForceReadPrefsForTesting().count(network_id));
+ // Network Quality should be persisted to disk even if it matches the typical
+ // quality of the network. See crbug.com/890859.
+ EXPECT_EQ(2u, manager.ForceReadPrefsForTesting().size());
+ EXPECT_EQ(1u, manager.ForceReadPrefsForTesting().count(network_id));
EXPECT_EQ(6u, prefs_delegate_ptr->write_count());
manager.ShutdownOnPrefSequence();
diff --git a/chromium/net/nqe/network_quality_estimator_params.cc b/chromium/net/nqe/network_quality_estimator_params.cc
index 28a9aaa9fb2..25151a528f9 100644
--- a/chromium/net/nqe/network_quality_estimator_params.cc
+++ b/chromium/net/nqe/network_quality_estimator_params.cc
@@ -634,23 +634,4 @@ NetworkQualityEstimatorParams::GetEffectiveConnectionTypeAlgorithm() const {
return effective_connection_type_algorithm_;
}
-EffectiveConnectionType NetworkQualityEstimatorParams::GetDefaultECT(
- NetworkChangeNotifier::ConnectionType connection_type) const {
- switch (connection_type) {
- case NetworkChangeNotifier::CONNECTION_UNKNOWN:
- case NetworkChangeNotifier::CONNECTION_ETHERNET:
- case NetworkChangeNotifier::CONNECTION_WIFI:
- case NetworkChangeNotifier::CONNECTION_4G:
- case NetworkChangeNotifier::CONNECTION_NONE:
- case NetworkChangeNotifier::CONNECTION_BLUETOOTH:
- return EFFECTIVE_CONNECTION_TYPE_4G;
- case NetworkChangeNotifier::CONNECTION_2G:
- return EFFECTIVE_CONNECTION_TYPE_2G;
- case NetworkChangeNotifier::CONNECTION_3G:
- return EFFECTIVE_CONNECTION_TYPE_3G;
- }
- NOTREACHED();
- return EFFECTIVE_CONNECTION_TYPE_4G;
-}
-
} // namespace net
diff --git a/chromium/net/nqe/network_quality_estimator_params.h b/chromium/net/nqe/network_quality_estimator_params.h
index 14078cdce23..422da33ea6f 100644
--- a/chromium/net/nqe/network_quality_estimator_params.h
+++ b/chromium/net/nqe/network_quality_estimator_params.h
@@ -249,10 +249,6 @@ class NET_EXPORT NetworkQualityEstimatorParams {
return socket_watchers_min_notification_interval_;
}
- // Returns the default effective connection type for a given connection type.
- EffectiveConnectionType GetDefaultECT(
- NetworkChangeNotifier::ConnectionType connection_type) const;
-
private:
// Map containing all field trial parameters related to
// NetworkQualityEstimator field trial.
diff --git a/chromium/net/nqe/network_quality_estimator_params_unittest.cc b/chromium/net/nqe/network_quality_estimator_params_unittest.cc
index f10db3e4ca6..3a9e56a81cb 100644
--- a/chromium/net/nqe/network_quality_estimator_params_unittest.cc
+++ b/chromium/net/nqe/network_quality_estimator_params_unittest.cc
@@ -140,61 +140,6 @@ TEST(NetworkQualityEstimatorParamsTest, ObtainAlgorithmToUseFromParams) {
}
}
-// Verify that for a given connection type, the default network quality values
-// lie in the same range of ECT as the value returned by GetDefaultECT().
-TEST(NetworkQualityEstimatorParamsTest, GetDefaultECT) {
- std::map<std::string, std::string> variation_params;
- NetworkQualityEstimatorParams params(variation_params);
-
- for (size_t i = 0; i < NetworkChangeNotifier::ConnectionType::CONNECTION_LAST;
- ++i) {
- NetworkChangeNotifier::ConnectionType connection_type =
- static_cast<NetworkChangeNotifier::ConnectionType>(i);
- EffectiveConnectionType ect = params.GetDefaultECT(connection_type);
- EXPECT_LE(EFFECTIVE_CONNECTION_TYPE_2G, ect);
-
- const nqe::internal::NetworkQuality& default_nq =
- params.DefaultObservation(connection_type);
-
- // Now verify that |default_nq| corresponds to |ect|.
- if (ect == EFFECTIVE_CONNECTION_TYPE_4G) {
- // If the expected effective connection type is 4G, then RTT values in
- // |default_nq| should be lower than the threshold for ECT of 3G.
- const nqe::internal::NetworkQuality& threshold_3g =
- params.ConnectionThreshold(EFFECTIVE_CONNECTION_TYPE_3G);
-
- EXPECT_LT(default_nq.http_rtt(), threshold_3g.http_rtt());
- EXPECT_LT(default_nq.transport_rtt(), threshold_3g.transport_rtt());
- EXPECT_TRUE(default_nq.downstream_throughput_kbps() >
- threshold_3g.downstream_throughput_kbps() ||
- threshold_3g.downstream_throughput_kbps() < 0);
- } else {
- // If the expected effective connection type is |ect|, then RTT values in
- // |default_nq| should be (i) higher than the threshold for ECT of |ect|
- // (ii) Lower than the threshold for |slower_ect|.
- const nqe::internal::NetworkQuality& threshold_ect =
- params.ConnectionThreshold(ect);
- EffectiveConnectionType slower_ect =
- static_cast<EffectiveConnectionType>(static_cast<int>(ect) - 1);
- const nqe::internal::NetworkQuality& threshold_slower_ect =
- params.ConnectionThreshold(slower_ect);
-
- EXPECT_GT(default_nq.http_rtt(), threshold_ect.http_rtt());
- EXPECT_GT(default_nq.transport_rtt(), threshold_ect.transport_rtt());
- EXPECT_TRUE(default_nq.downstream_throughput_kbps() <
- threshold_ect.downstream_throughput_kbps() ||
- threshold_ect.downstream_throughput_kbps() < 0);
-
- EXPECT_LT(default_nq.http_rtt(), threshold_slower_ect.http_rtt());
- EXPECT_LT(default_nq.transport_rtt(),
- threshold_slower_ect.transport_rtt());
- EXPECT_TRUE(default_nq.downstream_throughput_kbps() >
- threshold_slower_ect.downstream_throughput_kbps() ||
- threshold_slower_ect.downstream_throughput_kbps() < 0);
- }
- }
-}
-
// Verify ECT when forced ECT is Slow-2G-On-Cellular.
TEST(NetworkQualityEstimatorParamsTest, GetForcedECTCellularOnly) {
std::map<std::string, std::string> variation_params;
diff --git a/chromium/net/ntlm/ntlm_test_data.h b/chromium/net/ntlm/ntlm_test_data.h
index eed3b0d588b..996b058d332 100644
--- a/chromium/net/ntlm/ntlm_test_data.h
+++ b/chromium/net/ntlm/ntlm_test_data.h
@@ -524,6 +524,50 @@ constexpr uint8_t kExpectedAuthenticateMsgToOldV1ChallegeV2[] = {
'R', 0x00,
};
+// Expected V2 Authenticate message from this implementation when sent
+// |kChallengeMsgFromSpecV2|, no channel bindings exist, and the remote
+// server is named 'server' (with lowercase 's'). All the test data from the
+// spec uses 'Server' with an uppercase 'S'. Chrome lower cases the hostname
+// so this result vector is needed for an end to end test in
+// |HttpNetworkTransactionUnitTest|.
+//
+// The response is the same as |kExpectedAuthenticateMsgSpecResponseV2| with
+// the following differences.
+//
+// [72-87] - The MIC (hash of all messages) is different because the
+// message is different.
+// [112-127] - The cryptographic proof is different due to the changed
+// AvPairs below, which are inputs to the hash.
+// [225]- The 's' in the SPN AvPair is lowercase.
+// [200-215] - The channel binding AvPair in the target info is all zero. See
+// |kExpectedTargetInfoSpecResponseV2| for more information.
+constexpr uint8_t kExpectedAuthenticateMsgEmptyChannelBindingsV2[] = {
+ 'N', 'T', 'L', 'M', 'S', 'S', 'P', '\0', 0x03, 0x00, 0x00, 0x00,
+ 0x18, 0x00, 0x18, 0x00, 0x58, 0x00, 0x00, 0x00, 0x8a, 0x00, 0x8a, 0x00,
+ 0x70, 0x00, 0x00, 0x00, 0x0c, 0x00, 0x0c, 0x00, 0xfa, 0x00, 0x00, 0x00,
+ 0x08, 0x00, 0x08, 0x00, 0x06, 0x01, 0x00, 0x00, 0x10, 0x00, 0x10, 0x00,
+ 0x0e, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x58, 0x00, 0x00, 0x00,
+ 0x03, 0x82, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0xa7, 0x37, 0x50, 0x69, 0x59, 0xfe, 0xea, 0x74, 0xaa, 0x77, 0xa1, 0xc0,
+ 0x5b, 0xe2, 0x39, 0xa2, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0xfe, 0x4d, 0xec, 0x67, 0xcf, 0x4d, 0xbd, 0xf8,
+ 0xc7, 0xa7, 0x80, 0x89, 0xb1, 0xc5, 0x46, 0xa7, 0x01, 0x01, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x80, 0x0b, 0xc8, 0xfd, 0x00, 0xd4, 0xd2, 0x01,
+ 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0xaa, 0x00, 0x00, 0x00, 0x00,
+ 0x02, 0x00, 0x0c, 0x00, 'D', 0x00, 'o', 0x00, 'm', 0x00, 'a', 0x00,
+ 'i', 0x00, 'n', 0x00, 0x01, 0x00, 0x0c, 0x00, 'S', 0x00, 'e', 0x00,
+ 'r', 0x00, 'v', 0x00, 'e', 0x00, 'r', 0x00, 0x06, 0x00, 0x04, 0x00,
+ 0x02, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x09, 0x00, 0x16, 0x00, 'H', 0x00, 'T', 0x00, 'T', 0x00, 'P', 0x00,
+ '/', 0x00, 's', 0x00, 'e', 0x00, 'r', 0x00, 'v', 0x00, 'e', 0x00,
+ 'r', 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 'D', 0x00,
+ 'o', 0x00, 'm', 0x00, 'a', 0x00, 'i', 0x00, 'n', 0x00, 'U', 0x00,
+ 's', 0x00, 'e', 0x00, 'r', 0x00, 'C', 0x00, 'O', 0x00, 'M', 0x00,
+ 'P', 0x00, 'U', 0x00, 'T', 0x00, 'E', 0x00, 'R', 0x00,
+};
+
} // namespace test
} // namespace ntlm
} // namespace net
diff --git a/chromium/services/device/generic_sensor/platform_sensor_and_provider_unittest.cc b/chromium/services/device/generic_sensor/platform_sensor_and_provider_unittest.cc
index ac40516381c..b2c5a80eb5d 100644
--- a/chromium/services/device/generic_sensor/platform_sensor_and_provider_unittest.cc
+++ b/chromium/services/device/generic_sensor/platform_sensor_and_provider_unittest.cc
@@ -65,9 +65,8 @@ TEST_F(PlatformSensorProviderTest, ResourcesAreNotFreedOnPendingRequest) {
base::Bind([](scoped_refptr<PlatformSensor> s) { NOTREACHED(); }));
}
-// This test verifies that when sensor is stopped, shared buffer contents are
-// filled with default values.
-TEST_F(PlatformSensorProviderTest, SharedBufferCleared) {
+// This test verifies that the shared buffer's default values are 0.
+TEST_F(PlatformSensorProviderTest, SharedBufferDefaultValue) {
mojo::ScopedSharedBufferHandle handle = provider_->CloneSharedBufferHandle();
mojo::ScopedSharedBufferMapping mapping = handle->MapAtOffset(
sizeof(SensorReadingSharedBuffer),
@@ -76,7 +75,11 @@ TEST_F(PlatformSensorProviderTest, SharedBufferCleared) {
SensorReadingSharedBuffer* buffer =
static_cast<SensorReadingSharedBuffer*>(mapping.get());
EXPECT_THAT(buffer->reading.als.value, 0);
+}
+// This test verifies that when sensor is stopped, shared buffer contents are
+// filled with default values.
+TEST_F(PlatformSensorProviderTest, SharedBufferCleared) {
provider_->CreateSensor(
mojom::SensorType::AMBIENT_LIGHT,
base::Bind([](scoped_refptr<PlatformSensor> sensor) {
diff --git a/chromium/skia/ext/skia_commit_hash.h b/chromium/skia/ext/skia_commit_hash.h
index 3ee7fa32442..c34942f7b20 100644
--- a/chromium/skia/ext/skia_commit_hash.h
+++ b/chromium/skia/ext/skia_commit_hash.h
@@ -3,6 +3,6 @@
#ifndef SKIA_EXT_SKIA_COMMIT_HASH_H_
#define SKIA_EXT_SKIA_COMMIT_HASH_H_
-#define SKIA_COMMIT_HASH "dabbbe5b486443fd6e5ead56c01ba5bd877c80bd-"
+#define SKIA_COMMIT_HASH "a15e10c64c658749ec8ad4a143673d4a1e8fa2d1-"
#endif // SKIA_EXT_SKIA_COMMIT_HASH_H_
diff --git a/chromium/skia/public/interfaces/bitmap_skbitmap_struct_traits.cc b/chromium/skia/public/interfaces/bitmap_skbitmap_struct_traits.cc
index c05d22ee90b..2b2177e3b2a 100644
--- a/chromium/skia/public/interfaces/bitmap_skbitmap_struct_traits.cc
+++ b/chromium/skia/public/interfaces/bitmap_skbitmap_struct_traits.cc
@@ -74,8 +74,8 @@ skia::mojom::ColorType SkColorTypeToMojo(SkColorType type) {
return skia::mojom::ColorType::BGRA_8888;
case kGray_8_SkColorType:
return skia::mojom::ColorType::GRAY_8;
- case kRGBA_F16_SkColorType:
- // these are unsupported
+ default:
+ // Skia has color types not used by Chrome.
break;
}
NOTREACHED();
diff --git a/chromium/testing/variations/fieldtrial_testing_config.json b/chromium/testing/variations/fieldtrial_testing_config.json
index fa3521eca2e..b1b4de30922 100644
--- a/chromium/testing/variations/fieldtrial_testing_config.json
+++ b/chromium/testing/variations/fieldtrial_testing_config.json
@@ -2804,6 +2804,27 @@
]
}
],
+ "ReferrerChainDiagnose": [
+ {
+ "platforms": [
+ "chromeos",
+ "linux",
+ "mac",
+ "win"
+ ],
+ "experiments": [
+ {
+ "name": "Append5RecentNavigations",
+ "params": {
+ "recent_navigation_count": "5"
+ },
+ "enable_features": [
+ "AppendRecentNavigationEvents"
+ ]
+ }
+ ]
+ }
+ ],
"RefreshTokenDeviceId": [
{
"platforms": [
diff --git a/chromium/third_party/WebKit/Source/bindings/modules/v8/wasm/WasmResponseExtensions.cpp b/chromium/third_party/WebKit/Source/bindings/modules/v8/wasm/WasmResponseExtensions.cpp
index 3fd444cbf74..3a02e1f52bf 100644
--- a/chromium/third_party/WebKit/Source/bindings/modules/v8/wasm/WasmResponseExtensions.cpp
+++ b/chromium/third_party/WebKit/Source/bindings/modules/v8/wasm/WasmResponseExtensions.cpp
@@ -96,8 +96,16 @@ class FetchDataLoaderAsWasmModule final : public FetchDataLoader,
// what they are.
void AbortCompilation() {
ScriptState::Scope scope(script_state_.get());
- builder_.Abort(V8ThrowException::CreateTypeError(
- script_state_->GetIsolate(), "Could not download wasm module"));
+ if (!ScriptForbiddenScope::IsScriptForbidden()) {
+ builder_.Abort(V8ThrowException::CreateTypeError(
+ script_state_->GetIsolate(), "Could not download wasm module"));
+ } else {
+ // We are not allowed to execute a script, which indicates that we should
+ // not reject the promise of the streaming compilation. By passing no
+ // abort reason, we indicate the V8 side that the promise should not get
+ // rejected.
+ builder_.Abort(v8::Local<v8::Value>());
+ }
}
Member<BytesConsumer> consumer_;
Member<FetchDataLoader::Client> client_;
diff --git a/chromium/third_party/WebKit/Source/core/animation/EffectModel.cpp b/chromium/third_party/WebKit/Source/core/animation/EffectModel.cpp
index b20f62b1d62..cfbd18c645e 100644
--- a/chromium/third_party/WebKit/Source/core/animation/EffectModel.cpp
+++ b/chromium/third_party/WebKit/Source/core/animation/EffectModel.cpp
@@ -5,8 +5,25 @@
#include "core/animation/EffectModel.h"
#include "bindings/core/v8/ExceptionState.h"
+#include "core/animation/KeyframeEffectOptions.h"
+#include "platform/runtime_enabled_features.h"
namespace blink {
+EffectModel::CompositeOperation EffectModel::ExtractCompositeOperation(
+ const KeyframeEffectOptions& options) {
+ // We have to be careful to keep backwards compatible behavior here; no valid
+ // value of KeyframeEffectOptions should throw, even if it is unsupported in
+ // Chrome currently. Values we do not support should just be turned into
+ // kCompositeReplace.
+ //
+ // See http://crbug.com/806139.
+ if (RuntimeEnabledFeatures::CSSAdditiveAnimationsEnabled() &&
+ options.composite() == "add") {
+ return kCompositeAdd;
+ }
+ return kCompositeReplace;
+}
+
bool EffectModel::StringToCompositeOperation(String composite_string,
CompositeOperation& result,
ExceptionState* exception_state) {
diff --git a/chromium/third_party/WebKit/Source/core/animation/EffectModel.h b/chromium/third_party/WebKit/Source/core/animation/EffectModel.h
index 826c0906668..e86b3de96fc 100644
--- a/chromium/third_party/WebKit/Source/core/animation/EffectModel.h
+++ b/chromium/third_party/WebKit/Source/core/animation/EffectModel.h
@@ -41,6 +41,7 @@ namespace blink {
class ExceptionState;
class Interpolation;
+class KeyframeEffectOptions;
// Time independent representation of an Animation's content.
// Can be sampled for the active pairs of Keyframes (represented by
@@ -51,6 +52,10 @@ class CORE_EXPORT EffectModel : public GarbageCollectedFinalized<EffectModel> {
kCompositeReplace,
kCompositeAdd,
};
+ // Returns the correct CompositeOperation for a KeyframeEffectOptions,
+ // respecting any relevant RuntimeFeatures that are enabled or disabled.
+ static CompositeOperation ExtractCompositeOperation(
+ const KeyframeEffectOptions&);
static bool StringToCompositeOperation(String,
CompositeOperation&,
ExceptionState* = nullptr);
diff --git a/chromium/third_party/WebKit/Source/core/animation/ElementAnimation.cpp b/chromium/third_party/WebKit/Source/core/animation/ElementAnimation.cpp
index d165e421be2..5dd8f80193a 100644
--- a/chromium/third_party/WebKit/Source/core/animation/ElementAnimation.cpp
+++ b/chromium/third_party/WebKit/Source/core/animation/ElementAnimation.cpp
@@ -27,11 +27,9 @@ Animation* ElementAnimation::animate(
UnrestrictedDoubleOrKeyframeAnimationOptions options,
ExceptionState& exception_state) {
EffectModel::CompositeOperation composite = EffectModel::kCompositeReplace;
- if (options.IsKeyframeAnimationOptions() &&
- !EffectModel::StringToCompositeOperation(
- options.GetAsKeyframeAnimationOptions().composite(), composite,
- &exception_state)) {
- return nullptr;
+ if (options.IsKeyframeAnimationOptions()) {
+ composite = EffectModel::ExtractCompositeOperation(
+ options.GetAsKeyframeAnimationOptions());
}
KeyframeEffectModelBase* effect = EffectInput::Convert(
diff --git a/chromium/third_party/WebKit/Source/core/animation/KeyframeEffect.cpp b/chromium/third_party/WebKit/Source/core/animation/KeyframeEffect.cpp
index db6e5cfa886..51746ceb956 100644
--- a/chromium/third_party/WebKit/Source/core/animation/KeyframeEffect.cpp
+++ b/chromium/third_party/WebKit/Source/core/animation/KeyframeEffect.cpp
@@ -39,6 +39,7 @@
#include "core/animation/TimingInput.h"
#include "core/dom/Element.h"
#include "core/frame/UseCounter.h"
+#include "platform/runtime_enabled_features.h"
namespace blink {
@@ -69,11 +70,9 @@ KeyframeEffect* KeyframeEffect::Create(
return nullptr;
EffectModel::CompositeOperation composite = EffectModel::kCompositeReplace;
- if (options.IsKeyframeEffectOptions() &&
- !EffectModel::StringToCompositeOperation(
- options.GetAsKeyframeEffectOptions().composite(), composite,
- &exception_state)) {
- return nullptr;
+ if (options.IsKeyframeEffectOptions()) {
+ composite = EffectModel::ExtractCompositeOperation(
+ options.GetAsKeyframeEffectOptions());
}
KeyframeEffectModelBase* model = EffectInput::Convert(
diff --git a/chromium/third_party/WebKit/Source/core/animation/KeyframeEffectReadOnly.cpp b/chromium/third_party/WebKit/Source/core/animation/KeyframeEffectReadOnly.cpp
index c7745ad7397..64be8c6c0db 100644
--- a/chromium/third_party/WebKit/Source/core/animation/KeyframeEffectReadOnly.cpp
+++ b/chromium/third_party/WebKit/Source/core/animation/KeyframeEffectReadOnly.cpp
@@ -23,6 +23,7 @@
#include "core/paint/PaintLayer.h"
#include "core/svg/SVGElement.h"
#include "platform/bindings/ScriptState.h"
+#include "platform/runtime_enabled_features.h"
namespace blink {
@@ -54,11 +55,9 @@ KeyframeEffectReadOnly* KeyframeEffectReadOnly::Create(
return nullptr;
EffectModel::CompositeOperation composite = EffectModel::kCompositeReplace;
- if (options.IsKeyframeEffectOptions() &&
- !EffectModel::StringToCompositeOperation(
- options.GetAsKeyframeEffectOptions().composite(), composite,
- &exception_state)) {
- return nullptr;
+ if (options.IsKeyframeEffectOptions()) {
+ composite = EffectModel::ExtractCompositeOperation(
+ options.GetAsKeyframeEffectOptions());
}
KeyframeEffectModelBase* model = EffectInput::Convert(
diff --git a/chromium/third_party/WebKit/Source/core/dom/Document.cpp b/chromium/third_party/WebKit/Source/core/dom/Document.cpp
index 06cd8390dc6..7a4260bd3cf 100644
--- a/chromium/third_party/WebKit/Source/core/dom/Document.cpp
+++ b/chromium/third_party/WebKit/Source/core/dom/Document.cpp
@@ -2697,7 +2697,12 @@ void Document::Shutdown() {
// in LocalFrame::CreateView(). See also https://crbug.com/673170 and the
// comment in LocalFrameView::Dispose().
HTMLFrameOwnerElement* owner_element = frame_->DeprecatedLocalOwner();
- if (owner_element)
+
+ // In the case of a provisional frame, skip clearing the EmbeddedContentView.
+ // A provisional frame is not fully attached to the DOM yet and clearing the
+ // EmbeddedContentView here could clear a not-yet-swapped-out frame
+ // (https://crbug.com/807772).
+ if (owner_element && !frame_->IsProvisional())
owner_element->SetEmbeddedContentView(nullptr);
markers_->PrepareForDestruction();
diff --git a/chromium/third_party/WebKit/Source/core/events/BUILD.gn b/chromium/third_party/WebKit/Source/core/events/BUILD.gn
index 652a072baae..32d30c67dda 100644
--- a/chromium/third_party/WebKit/Source/core/events/BUILD.gn
+++ b/chromium/third_party/WebKit/Source/core/events/BUILD.gn
@@ -20,6 +20,8 @@ blink_core_sources("events") {
"ClipboardEvent.h",
"CompositionEvent.cpp",
"CompositionEvent.h",
+ "CurrentInputEvent.cpp",
+ "CurrentInputEvent.h",
"DragEvent.cpp",
"DragEvent.h",
"ErrorEvent.cpp",
diff --git a/chromium/third_party/WebKit/Source/core/events/CurrentInputEvent.cpp b/chromium/third_party/WebKit/Source/core/events/CurrentInputEvent.cpp
new file mode 100644
index 00000000000..67c2f989ad6
--- /dev/null
+++ b/chromium/third_party/WebKit/Source/core/events/CurrentInputEvent.cpp
@@ -0,0 +1,11 @@
+// Copyright 2018 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#include "core/events/CurrentInputEvent.h"
+
+namespace blink {
+
+const WebInputEvent* CurrentInputEvent::current_input_event_ = nullptr;
+
+} // namespace blink
diff --git a/chromium/third_party/WebKit/Source/core/events/CurrentInputEvent.h b/chromium/third_party/WebKit/Source/core/events/CurrentInputEvent.h
new file mode 100644
index 00000000000..c7c8a8fdefc
--- /dev/null
+++ b/chromium/third_party/WebKit/Source/core/events/CurrentInputEvent.h
@@ -0,0 +1,29 @@
+// Copyright 2018 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CurrentInputEvent_h
+#define CurrentInputEvent_h
+
+namespace blink {
+
+class WebFrameWidgetImpl;
+class WebInputEvent;
+class WebViewImpl;
+
+class CurrentInputEvent {
+ public:
+ // Gets the "current" input event - event that is currently being processed by
+ // either blink::WebViewImpl::HandleInputEventInternal or by
+ // blink::WebFrameWidgetImpl::HandleInputEventInternal
+ static const WebInputEvent* Get() { return current_input_event_; }
+
+ private:
+ friend class WebViewImpl;
+ friend class WebFrameWidgetImpl;
+ static const WebInputEvent* current_input_event_;
+};
+
+} // namespace blink
+
+#endif
diff --git a/chromium/third_party/WebKit/Source/core/events/MouseEvent.cpp b/chromium/third_party/WebKit/Source/core/events/MouseEvent.cpp
index aee2f31fdaa..e719d0b36f4 100644
--- a/chromium/third_party/WebKit/Source/core/events/MouseEvent.cpp
+++ b/chromium/third_party/WebKit/Source/core/events/MouseEvent.cpp
@@ -47,13 +47,12 @@ DoubleSize ContentsScrollOffset(AbstractView* abstract_view) {
LocalFrame* frame = ToLocalDOMWindow(abstract_view)->GetFrame();
if (!frame)
return DoubleSize();
- ScrollableArea* scrollable_area =
- frame->View()->LayoutViewportScrollableArea();
- if (!scrollable_area)
+ LocalFrameView* frame_view = frame->View();
+ if (!frame_view)
return DoubleSize();
float scale_factor = frame->PageZoomFactor();
- return DoubleSize(scrollable_area->ScrollOffsetInt().Width() / scale_factor,
- scrollable_area->ScrollOffsetInt().Height() / scale_factor);
+ return DoubleSize(frame_view->ScrollX() / scale_factor,
+ frame_view->ScrollY() / scale_factor);
}
float PageZoomFactor(const UIEvent* event) {
@@ -270,13 +269,15 @@ void MouseEvent::InitCoordinatesFromRootFrame(double window_x,
? ToLocalDOMWindow(view())->GetFrame()
: nullptr;
if (frame && HasPosition()) {
- scroll_offset = ContentsScrollOffset(view());
if (LocalFrameView* frame_view = frame->View()) {
adjusted_page_location =
- frame_view->RootFrameToDocument(FloatPoint(window_x, window_y));
+ frame_view->RootFrameToContents(FloatPoint(window_x, window_y));
+ scroll_offset = frame_view->GetScrollOffset();
float scale_factor = 1 / frame->PageZoomFactor();
- if (scale_factor != 1.0f)
+ if (scale_factor != 1.0f) {
adjusted_page_location.Scale(scale_factor, scale_factor);
+ scroll_offset.Scale(scale_factor, scale_factor);
+ }
}
}
@@ -497,16 +498,8 @@ DispatchEventResult MouseEvent::DispatchEvent(EventDispatcher& dispatcher) {
}
void MouseEvent::ComputePageLocation() {
- LocalFrame* frame = view() && view()->IsLocalDOMWindow()
- ? ToLocalDOMWindow(view())->GetFrame()
- : nullptr;
- if (frame && frame->View())
- absolute_location_ = frame->View()->DocumentToAbsolute(page_location_);
- else
- absolute_location_ = page_location_;
-
float scale_factor = PageZoomFactor(this);
- absolute_location_.Scale(scale_factor, scale_factor);
+ absolute_location_ = page_location_.ScaledBy(scale_factor);
}
void MouseEvent::ReceivedTarget() {
diff --git a/chromium/third_party/WebKit/Source/core/exported/LocalFrameClientImpl.cpp b/chromium/third_party/WebKit/Source/core/exported/LocalFrameClientImpl.cpp
index ce70025c531..d91485b8176 100644
--- a/chromium/third_party/WebKit/Source/core/exported/LocalFrameClientImpl.cpp
+++ b/chromium/third_party/WebKit/Source/core/exported/LocalFrameClientImpl.cpp
@@ -38,6 +38,7 @@
#include "core/CoreInitializer.h"
#include "core/dom/Document.h"
#include "core/dom/UserGestureIndicator.h"
+#include "core/events/CurrentInputEvent.h"
#include "core/events/MessageEvent.h"
#include "core/events/MouseEvent.h"
#include "core/events/UIEventWithKeyState.h"
@@ -479,7 +480,7 @@ void LocalFrameClientImpl::DispatchDidChangeThemeColor() {
}
static bool AllowCreatingBackgroundTabs() {
- const WebInputEvent* input_event = WebViewImpl::CurrentInputEvent();
+ const WebInputEvent* input_event = CurrentInputEvent::Get();
if (!input_event || (input_event->GetType() != WebInputEvent::kMouseUp &&
(input_event->GetType() != WebInputEvent::kRawKeyDown &&
input_event->GetType() != WebInputEvent::kKeyDown) &&
diff --git a/chromium/third_party/WebKit/Source/core/exported/WebDevToolsAgentImpl.cpp b/chromium/third_party/WebKit/Source/core/exported/WebDevToolsAgentImpl.cpp
index 5ba173cf6ca..9b0ec7152d3 100644
--- a/chromium/third_party/WebKit/Source/core/exported/WebDevToolsAgentImpl.cpp
+++ b/chromium/third_party/WebKit/Source/core/exported/WebDevToolsAgentImpl.cpp
@@ -211,7 +211,7 @@ class WebDevToolsAgentImpl::Session : public GarbageCollectedFinalized<Session>,
mojom::blink::DevToolsSessionAssociatedRequest main_request,
mojom::blink::DevToolsSessionRequest io_request,
const String& reattach_state);
- ~Session() override {}
+ ~Session() override;
virtual void Trace(blink::Visitor*);
void Detach();
@@ -250,6 +250,7 @@ class WebDevToolsAgentImpl::Session : public GarbageCollectedFinalized<Session>,
Member<InspectorPageAgent> page_agent_;
Member<InspectorTracingAgent> tracing_agent_;
Member<InspectorOverlayAgent> overlay_agent_;
+ bool detached_ = false;
DISALLOW_COPY_AND_ASSIGN(Session);
};
@@ -331,6 +332,10 @@ WebDevToolsAgentImpl::Session::Session(
InitializeInspectorSession(reattach_state);
}
+WebDevToolsAgentImpl::Session::~Session() {
+ DCHECK(detached_);
+}
+
void WebDevToolsAgentImpl::Session::Trace(blink::Visitor* visitor) {
visitor->Trace(agent_);
visitor->Trace(frame_);
@@ -341,6 +346,8 @@ void WebDevToolsAgentImpl::Session::Trace(blink::Visitor* visitor) {
}
void WebDevToolsAgentImpl::Session::Detach() {
+ DCHECK(!detached_);
+ detached_ = true;
agent_->DetachSession(this);
binding_.Close();
host_ptr_.reset();
@@ -392,6 +399,9 @@ void WebDevToolsAgentImpl::Session::SendProtocolMessage(int session_id,
int call_id,
const String& response,
const String& state) {
+ if (detached_)
+ return;
+
// Make tests more predictable by flushing all sessions before sending
// protocol response in any of them.
if (LayoutTestSupport::IsRunningLayoutTest() && call_id)
@@ -418,6 +428,18 @@ void WebDevToolsAgentImpl::Session::DispatchProtocolMessageInternal(
int call_id,
const String& method,
const String& message) {
+ // IOSession does not provide ordering guarantees relative to
+ // Session, so a command may come to IOSession after Session is detached,
+ // and get posted to main thread to this method.
+ //
+ // At the same time, Session may not be garbage collected yet
+ // (even though already detached), and CrossThreadWeakPersistent<Session>
+ // will still be valid.
+ //
+ // Both these factors combined may lead to this method being called after
+ // detach, so we have to check a flag here.
+ if (detached_)
+ return;
InspectorTaskRunner::IgnoreInterruptsScope scope(
MainThreadDebugger::Instance()->TaskRunner());
inspector_session_->DispatchProtocolMessage(method, message);
diff --git a/chromium/third_party/WebKit/Source/core/exported/WebFrame.cpp b/chromium/third_party/WebKit/Source/core/exported/WebFrame.cpp
index 0659c232a28..a8145c15e38 100644
--- a/chromium/third_party/WebKit/Source/core/exported/WebFrame.cpp
+++ b/chromium/third_party/WebKit/Source/core/exported/WebFrame.cpp
@@ -116,6 +116,7 @@ bool WebFrame::Swap(WebFrame* frame) {
TRACE_EVENT_INSTANT1("loading", "markAsMainFrame",
TRACE_EVENT_SCOPE_THREAD, "frame", &local_frame);
}
+ local_frame.SetIsProvisional(false);
} else {
ToWebRemoteFrameImpl(frame)->InitializeCoreFrame(*page, owner, name);
}
diff --git a/chromium/third_party/WebKit/Source/core/exported/WebViewImpl.cpp b/chromium/third_party/WebKit/Source/core/exported/WebViewImpl.cpp
index d0c5134a2ad..d91e3b14307 100644
--- a/chromium/third_party/WebKit/Source/core/exported/WebViewImpl.cpp
+++ b/chromium/third_party/WebKit/Source/core/exported/WebViewImpl.cpp
@@ -53,6 +53,7 @@
#include "core/editing/iterators/TextIterator.h"
#include "core/editing/serializers/HTMLInterchange.h"
#include "core/editing/serializers/Serialization.h"
+#include "core/events/CurrentInputEvent.h"
#include "core/events/KeyboardEvent.h"
#include "core/events/UIEventWithKeyState.h"
#include "core/events/WebInputEventConversion.h"
@@ -222,12 +223,6 @@ const double WebView::kTextSizeMultiplierRatio = 1.2;
const double WebView::kMinTextSizeMultiplier = 0.5;
const double WebView::kMaxTextSizeMultiplier = 3.0;
-const WebInputEvent* WebViewImpl::current_input_event_ = nullptr;
-
-const WebInputEvent* WebViewImpl::CurrentInputEvent() {
- return current_input_event_;
-}
-
// Used to defer all page activity in cases where the embedder wishes to run
// a nested event loop. Using a stack enables nesting of message loop
// invocations.
@@ -2020,8 +2015,8 @@ WebInputEventResult WebViewImpl::HandleInputEventInternal(
if (WebFrameWidgetBase::IgnoreInputEvents())
return WebInputEventResult::kNotHandled;
- AutoReset<const WebInputEvent*> current_event_change(&current_input_event_,
- &input_event);
+ AutoReset<const WebInputEvent*> current_event_change(
+ &CurrentInputEvent::current_input_event_, &input_event);
UIEventWithKeyState::ClearNewTabModifierSetFromIsolatedWorld();
bool is_pointer_locked = false;
@@ -3270,11 +3265,6 @@ WebInputMethodController* WebViewImpl::GetActiveWebInputMethodController()
return local_frame ? local_frame->GetInputMethodController() : nullptr;
}
-void WebViewImpl::RequestDecode(const PaintImage& image,
- base::OnceCallback<void(bool)> callback) {
- layer_tree_view_->RequestDecode(image, std::move(callback));
-}
-
Color WebViewImpl::BaseBackgroundColor() const {
return base_background_color_override_enabled_
? base_background_color_override_
diff --git a/chromium/third_party/WebKit/Source/core/exported/WebViewImpl.h b/chromium/third_party/WebKit/Source/core/exported/WebViewImpl.h
index 79a702679fe..a17a3af5ec2 100644
--- a/chromium/third_party/WebKit/Source/core/exported/WebViewImpl.h
+++ b/chromium/third_party/WebKit/Source/core/exported/WebViewImpl.h
@@ -104,7 +104,6 @@ class CORE_EXPORT WebViewImpl final
mojom::PageVisibilityState,
WebViewImpl* opener);
static HashSet<WebViewImpl*>& AllInstances();
- static const WebInputEvent* CurrentInputEvent();
// Returns true if popup menus should be rendered by the browser, false if
// they should be rendered by WebKit (which is the default).
static bool UseExternalPopupMenus();
@@ -471,8 +470,6 @@ class CORE_EXPORT WebViewImpl final
last_hidden_page_popup_ = page_popup;
}
- void RequestDecode(const PaintImage&, base::OnceCallback<void(bool)>);
-
private:
WebInputEventResult HandleInputEventInternal(
const WebCoalescedInputEvent&) override;
@@ -690,8 +687,6 @@ class CORE_EXPORT WebViewImpl final
bool override_compositor_visibility_;
Persistent<ResizeViewportAnchor> resize_viewport_anchor_;
-
- static const WebInputEvent* current_input_event_;
};
// We have no ways to check if the specified WebView is an instance of
diff --git a/chromium/third_party/WebKit/Source/core/frame/LocalFrame.h b/chromium/third_party/WebKit/Source/core/frame/LocalFrame.h
index ff53081b57b..1d782aea2cf 100644
--- a/chromium/third_party/WebKit/Source/core/frame/LocalFrame.h
+++ b/chromium/third_party/WebKit/Source/core/frame/LocalFrame.h
@@ -303,6 +303,11 @@ class CORE_EXPORT LocalFrame final : public Frame,
should_send_resource_timing_info_to_parent_ = false;
}
+ void SetIsProvisional(bool is_provisional) {
+ is_provisional_ = is_provisional;
+ }
+ bool IsProvisional() const { return is_provisional_; }
+
private:
friend class FrameNavigationDisabler;
@@ -343,6 +348,8 @@ class CORE_EXPORT LocalFrame final : public Frame,
const Member<InputMethodController> input_method_controller_;
const Member<TextSuggestionController> text_suggestion_controller_;
+ bool is_provisional_ = false;
+
int navigation_disable_count_;
// TODO(dcheng): In theory, this could be replaced by checking the
// FrameLoaderStateMachine if a real load has committed. Unfortunately, the
diff --git a/chromium/third_party/WebKit/Source/core/frame/LocalFrameView.cpp b/chromium/third_party/WebKit/Source/core/frame/LocalFrameView.cpp
index 36bd744668e..4041c89d3d9 100644
--- a/chromium/third_party/WebKit/Source/core/frame/LocalFrameView.cpp
+++ b/chromium/third_party/WebKit/Source/core/frame/LocalFrameView.cpp
@@ -3673,10 +3673,8 @@ IntPoint LocalFrameView::AbsoluteToRootFrame(
}
IntRect LocalFrameView::RootFrameToDocument(const IntRect& rect_in_root_frame) {
- IntPoint offset =
- FlooredIntPoint(RootFrameToDocument(rect_in_root_frame.Location()));
- IntRect local_rect = rect_in_root_frame;
- local_rect.SetLocation(offset);
+ IntRect local_rect = ConvertFromRootFrame(rect_in_root_frame);
+ local_rect.Move(LayoutViewportScrollableArea()->ScrollOffsetInt());
return local_rect;
}
diff --git a/chromium/third_party/WebKit/Source/core/frame/RemoteFrameClient.h b/chromium/third_party/WebKit/Source/core/frame/RemoteFrameClient.h
index 97562eba57e..4bd487be853 100644
--- a/chromium/third_party/WebKit/Source/core/frame/RemoteFrameClient.h
+++ b/chromium/third_party/WebKit/Source/core/frame/RemoteFrameClient.h
@@ -32,7 +32,12 @@ class RemoteFrameClient : public FrameClient {
scoped_refptr<const SecurityOrigin> target,
LocalFrame* source_frame) const = 0;
- virtual void FrameRectsChanged(const IntRect& frame_rect) = 0;
+ // Forwards a change to the rects of a remote frame. |local_frame_rect| is the
+ // size of the frame in its parent's coordinate space prior to applying CSS
+ // transforms. |screen_space_rect| is in the screen's coordinate space, after
+ // CSS transforms are applied.
+ virtual void FrameRectsChanged(const IntRect& local_frame_rect,
+ const IntRect& screen_space_rect) = 0;
virtual void UpdateRemoteViewportIntersection(
const IntRect& viewport_intersection) = 0;
diff --git a/chromium/third_party/WebKit/Source/core/frame/RemoteFrameClientImpl.cpp b/chromium/third_party/WebKit/Source/core/frame/RemoteFrameClientImpl.cpp
index 041b3879ab1..e50ac18552c 100644
--- a/chromium/third_party/WebKit/Source/core/frame/RemoteFrameClientImpl.cpp
+++ b/chromium/third_party/WebKit/Source/core/frame/RemoteFrameClientImpl.cpp
@@ -146,8 +146,10 @@ void RemoteFrameClientImpl::ForwardPostMessage(
}
}
-void RemoteFrameClientImpl::FrameRectsChanged(const IntRect& frame_rect) {
- web_frame_->Client()->FrameRectsChanged(frame_rect);
+void RemoteFrameClientImpl::FrameRectsChanged(
+ const IntRect& local_frame_rect,
+ const IntRect& screen_space_rect) {
+ web_frame_->Client()->FrameRectsChanged(local_frame_rect, screen_space_rect);
}
void RemoteFrameClientImpl::UpdateRemoteViewportIntersection(
diff --git a/chromium/third_party/WebKit/Source/core/frame/RemoteFrameClientImpl.h b/chromium/third_party/WebKit/Source/core/frame/RemoteFrameClientImpl.h
index 01bd810ab58..1cc8b94966f 100644
--- a/chromium/third_party/WebKit/Source/core/frame/RemoteFrameClientImpl.h
+++ b/chromium/third_party/WebKit/Source/core/frame/RemoteFrameClientImpl.h
@@ -36,7 +36,8 @@ class RemoteFrameClientImpl final : public RemoteFrameClient {
void ForwardPostMessage(MessageEvent*,
scoped_refptr<const SecurityOrigin> target,
LocalFrame* source) const override;
- void FrameRectsChanged(const IntRect& frame_rect) override;
+ void FrameRectsChanged(const IntRect& local_frame_rect,
+ const IntRect& screen_space_rect) override;
void UpdateRemoteViewportIntersection(const IntRect&) override;
void AdvanceFocus(WebFocusType, LocalFrame*) override;
void VisibilityChanged(bool visible) override;
diff --git a/chromium/third_party/WebKit/Source/core/frame/RemoteFrameView.cpp b/chromium/third_party/WebKit/Source/core/frame/RemoteFrameView.cpp
index 2518596fd3d..a6de9be480c 100644
--- a/chromium/third_party/WebKit/Source/core/frame/RemoteFrameView.cpp
+++ b/chromium/third_party/WebKit/Source/core/frame/RemoteFrameView.cpp
@@ -128,11 +128,13 @@ void RemoteFrameView::FrameRectsChanged() {
// Update the rect to reflect the position of the frame relative to the
// containing local frame root. The position of the local root within
// any remote frames, if any, is accounted for by the embedder.
- IntRect new_rect = frame_rect_;
+ IntRect screen_space_rect = frame_rect_;
- if (LocalFrameView* parent = ParentFrameView())
- new_rect = parent->ConvertToRootFrame(parent->ContentsToFrame(new_rect));
- remote_frame_->Client()->FrameRectsChanged(new_rect);
+ if (LocalFrameView* parent = ParentFrameView()) {
+ screen_space_rect =
+ parent->ConvertToRootFrame(parent->ContentsToFrame(screen_space_rect));
+ }
+ remote_frame_->Client()->FrameRectsChanged(frame_rect_, screen_space_rect);
}
void RemoteFrameView::UpdateGeometry() {
diff --git a/chromium/third_party/WebKit/Source/core/frame/UseCounter.cpp b/chromium/third_party/WebKit/Source/core/frame/UseCounter.cpp
index 84f99b2ecb1..9d7004958f6 100644
--- a/chromium/third_party/WebKit/Source/core/frame/UseCounter.cpp
+++ b/chromium/third_party/WebKit/Source/core/frame/UseCounter.cpp
@@ -1261,6 +1261,8 @@ void UseCounter::DidCommitLoad(const LocalFrame* frame) {
context_ = kDisabledContext;
else if (!frame->Client() || !frame->Client()->ShouldTrackUseCounter(url))
context_ = kDisabledContext;
+ else if (frame->GetDocument()->IsPrefetchOnly())
+ context_ = kDisabledContext;
else if (SchemeRegistry::ShouldTrackUsageMetricsForScheme(url.Protocol()))
context_ = kDefaultContext;
else
diff --git a/chromium/third_party/WebKit/Source/core/frame/WebFrameWidgetBase.cpp b/chromium/third_party/WebKit/Source/core/frame/WebFrameWidgetBase.cpp
index c11e1801fde..d5eed1d7441 100644
--- a/chromium/third_party/WebKit/Source/core/frame/WebFrameWidgetBase.cpp
+++ b/chromium/third_party/WebKit/Source/core/frame/WebFrameWidgetBase.cpp
@@ -273,7 +273,13 @@ void WebFrameWidgetBase::DidLosePointerLock() {
void WebFrameWidgetBase::RequestDecode(
const PaintImage& image,
base::OnceCallback<void(bool)> callback) {
- View()->RequestDecode(image, std::move(callback));
+ // If we have a LayerTreeView, propagate the request, otherwise fail it since
+ // otherwise it would remain in a unresolved and unrejected state.
+ if (WebLayerTreeView* layer_tree_view = GetLayerTreeView()) {
+ layer_tree_view->RequestDecode(image, std::move(callback));
+ } else {
+ std::move(callback).Run(false);
+ }
}
void WebFrameWidgetBase::Trace(blink::Visitor* visitor) {
diff --git a/chromium/third_party/WebKit/Source/core/frame/WebFrameWidgetImpl.cpp b/chromium/third_party/WebKit/Source/core/frame/WebFrameWidgetImpl.cpp
index 07c27016918..762800b7b34 100644
--- a/chromium/third_party/WebKit/Source/core/frame/WebFrameWidgetImpl.cpp
+++ b/chromium/third_party/WebKit/Source/core/frame/WebFrameWidgetImpl.cpp
@@ -31,6 +31,7 @@
#include "core/frame/WebFrameWidgetImpl.h"
#include <memory>
+#include <utility>
#include "build/build_config.h"
#include "core/dom/UserGestureIndicator.h"
@@ -41,6 +42,7 @@
#include "core/editing/PlainTextRange.h"
#include "core/editing/SelectionTemplate.h"
#include "core/editing/ime/InputMethodController.h"
+#include "core/events/CurrentInputEvent.h"
#include "core/events/WebInputEventConversion.h"
#include "core/exported/WebDevToolsAgentImpl.h"
#include "core/exported/WebPagePopupImpl.h"
@@ -379,8 +381,6 @@ WebHitTestResult WebFrameWidgetImpl::HitTestResultAt(const WebPoint& point) {
return CoreHitTestResultAt(point);
}
-const WebInputEvent* WebFrameWidgetImpl::current_input_event_ = nullptr;
-
WebInputEventResult WebFrameWidgetImpl::DispatchBufferedTouchEvents() {
if (doing_drag_and_drop_)
return WebInputEventResult::kHandledSuppressed;
@@ -434,8 +434,8 @@ WebInputEventResult WebFrameWidgetImpl::HandleInputEventInternal(
// FIXME: pass event to m_localRoot's WebDevToolsAgentImpl once available.
- AutoReset<const WebInputEvent*> current_event_change(&current_input_event_,
- &input_event);
+ AutoReset<const WebInputEvent*> current_event_change(
+ &CurrentInputEvent::current_input_event_, &input_event);
DCHECK(client_);
if (client_->IsPointerLocked() &&
diff --git a/chromium/third_party/WebKit/Source/core/frame/WebFrameWidgetImpl.h b/chromium/third_party/WebKit/Source/core/frame/WebFrameWidgetImpl.h
index 0500449e892..b2b8e202201 100644
--- a/chromium/third_party/WebKit/Source/core/frame/WebFrameWidgetImpl.h
+++ b/chromium/third_party/WebKit/Source/core/frame/WebFrameWidgetImpl.h
@@ -31,6 +31,8 @@
#ifndef WebFrameWidgetImpl_h
#define WebFrameWidgetImpl_h
+#include <memory>
+
#include "core/frame/WebFrameWidgetBase.h"
#include "core/frame/WebLocalFrameImpl.h"
#include "core/page/PageWidgetDelegate.h"
@@ -224,8 +226,6 @@ class WebFrameWidgetImpl final : public WebFrameWidgetBase,
// Represents whether or not this object should process incoming IME events.
bool ime_accept_events_;
- static const WebInputEvent* current_input_event_;
-
WebColor base_background_color_;
SelfKeepAlive<WebFrameWidgetImpl> self_keep_alive_;
diff --git a/chromium/third_party/WebKit/Source/core/frame/WebLocalFrameImpl.cpp b/chromium/third_party/WebKit/Source/core/frame/WebLocalFrameImpl.cpp
index 9ba0b146a1d..d0a16e6a457 100644
--- a/chromium/third_party/WebKit/Source/core/frame/WebLocalFrameImpl.cpp
+++ b/chromium/third_party/WebKit/Source/core/frame/WebLocalFrameImpl.cpp
@@ -1681,6 +1681,7 @@ WebLocalFrameImpl* WebLocalFrameImpl::CreateProvisional(
// which triggers a cross-process navigation.
new_frame->Loader().ForceSandboxFlags(static_cast<SandboxFlags>(flags));
}
+ new_frame->SetIsProvisional(true);
return web_frame;
}
diff --git a/chromium/third_party/WebKit/Source/core/fullscreen/Fullscreen.cpp b/chromium/third_party/WebKit/Source/core/fullscreen/Fullscreen.cpp
index 0cb243e60e3..c85d8b98c74 100644
--- a/chromium/third_party/WebKit/Source/core/fullscreen/Fullscreen.cpp
+++ b/chromium/third_party/WebKit/Source/core/fullscreen/Fullscreen.cpp
@@ -898,6 +898,12 @@ void Fullscreen::FullscreenElementChanged(Element* old_element,
if (LocalFrameView* frame_view = frame->View())
frame_view->SetNeedsPaintPropertyUpdate();
}
+
+ // Descendant frames may have been inert because their owner iframes were
+ // outside of fullscreen element. SetIsInert recurses through subframes to
+ // propagate the inert bit as needed.
+ frame->SetIsInert(GetDocument()->LocalOwner() &&
+ GetDocument()->LocalOwner()->IsInert());
}
// TODO(foolip): This should not call |UpdateStyleAndLayoutTree()|.
diff --git a/chromium/third_party/WebKit/Source/core/html/HTMLViewSourceDocument.cpp b/chromium/third_party/WebKit/Source/core/html/HTMLViewSourceDocument.cpp
index e14cfff0653..7a0b40a2e86 100644
--- a/chromium/third_party/WebKit/Source/core/html/HTMLViewSourceDocument.cpp
+++ b/chromium/third_party/WebKit/Source/core/html/HTMLViewSourceDocument.cpp
@@ -314,6 +314,9 @@ Element* HTMLViewSourceDocument::AddLink(const AtomicString& url,
anchor->setAttribute(classAttr, class_value);
anchor->setAttribute(targetAttr, "_blank");
anchor->setAttribute(hrefAttr, url);
+ // Disallow JavaScript hrefs. https://crbug.com/808407
+ if (anchor->Url().ProtocolIsJavaScript())
+ anchor->setAttribute(hrefAttr, "about:blank");
current_->ParserAppendChild(anchor);
return anchor;
}
diff --git a/chromium/third_party/WebKit/Source/core/html/canvas/HTMLCanvasElement.cpp b/chromium/third_party/WebKit/Source/core/html/canvas/HTMLCanvasElement.cpp
index 16a853fe00f..8f5c621ca93 100644
--- a/chromium/third_party/WebKit/Source/core/html/canvas/HTMLCanvasElement.cpp
+++ b/chromium/third_party/WebKit/Source/core/html/canvas/HTMLCanvasElement.cpp
@@ -1020,7 +1020,7 @@ CanvasResourceProvider* HTMLCanvasElement::ResourceProvider() const {
return webgl_resource_provider_.get();
}
-void HTMLCanvasElement::CreateResourceProviderInternal(
+void HTMLCanvasElement::CreateImageBufferInternal(
std::unique_ptr<Canvas2DLayerBridge> external_canvas2d_bridge) {
DCHECK(!canvas2d_bridge_ && !webgl_resource_provider_);
@@ -1043,18 +1043,19 @@ void HTMLCanvasElement::CreateResourceProviderInternal(
}
}
- if (canvas2d_bridge_) {
- canvas2d_bridge_->SetCanvasResourceHost(this);
- if (!canvas2d_bridge_->GetOrCreateResourceProvider())
- return;
- }
-
if (Is3d()) {
webgl_resource_provider_ = CanvasResourceProvider::Create(
size_, CanvasResourceProvider::kAcceleratedResourceUsage,
SharedGpuContext::ContextProviderWrapper(), 0, ColorParams());
if (!webgl_resource_provider_)
return;
+ } else {
+ DCHECK(Is2d());
+ if (canvas2d_bridge_) {
+ canvas2d_bridge_->SetCanvasResourceHost(this);
+ } else {
+ return;
+ }
}
did_fail_to_create_resource_provider_ = false;
@@ -1125,7 +1126,7 @@ bool HTMLCanvasElement::TryCreateImageBuffer() {
DCHECK(context_->GetContextType() !=
CanvasRenderingContext::kContextImageBitmap);
if (!HasImageBuffer() && !did_fail_to_create_resource_provider_) {
- CreateResourceProviderInternal(nullptr);
+ CreateImageBufferInternal(nullptr);
if (did_fail_to_create_resource_provider_ && Is2d() && !Size().IsEmpty()) {
context_->LoseContext(CanvasRenderingContext::kSyntheticLostContext);
}
@@ -1135,15 +1136,11 @@ bool HTMLCanvasElement::TryCreateImageBuffer() {
void HTMLCanvasElement::CreateImageBufferUsingSurfaceForTesting(
std::unique_ptr<Canvas2DLayerBridge> surface,
- const IntSize& size,
- bool is_resource_provider_needed) {
+ const IntSize& size) {
DiscardImageBuffer();
SetIntegralAttribute(widthAttr, size.Width());
SetIntegralAttribute(heightAttr, size.Height());
- CreateResourceProviderInternal(std::move(surface));
- if (!is_resource_provider_needed && canvas2d_bridge_) {
- canvas2d_bridge_->ResetResourceProvider();
- }
+ CreateImageBufferInternal(std::move(surface));
}
scoped_refptr<Image> HTMLCanvasElement::CopiedImage(
@@ -1554,6 +1551,7 @@ void HTMLCanvasElement::ReplaceExistingCanvas2DBuffer(
RestoreCanvasMatrixClipStack(new_buffer->Canvas());
canvas2d_bridge_ = std::move(new_buffer);
+ canvas2d_bridge_->SetCanvasResourceHost(this);
}
scoped_refptr<StaticBitmapImage> HTMLCanvasElement::NewImageSnapshot(
diff --git a/chromium/third_party/WebKit/Source/core/html/canvas/HTMLCanvasElement.h b/chromium/third_party/WebKit/Source/core/html/canvas/HTMLCanvasElement.h
index ba1d0fe34a5..c26a98bc2da 100644
--- a/chromium/third_party/WebKit/Source/core/html/canvas/HTMLCanvasElement.h
+++ b/chromium/third_party/WebKit/Source/core/html/canvas/HTMLCanvasElement.h
@@ -225,8 +225,7 @@ class CORE_EXPORT HTMLCanvasElement final
void CreateImageBufferUsingSurfaceForTesting(
std::unique_ptr<Canvas2DLayerBridge>,
- const IntSize&,
- bool is_resource_provider_needed = true);
+ const IntSize&);
static void RegisterRenderingContextFactory(
std::unique_ptr<CanvasRenderingContextFactory>);
@@ -312,7 +311,7 @@ class CORE_EXPORT HTMLCanvasElement final
std::unique_ptr<Canvas2DLayerBridge> CreateAccelerated2dBuffer(
int* msaa_sample_count);
std::unique_ptr<Canvas2DLayerBridge> CreateUnaccelerated2dBuffer();
- void CreateResourceProviderInternal(std::unique_ptr<Canvas2DLayerBridge>);
+ void CreateImageBufferInternal(std::unique_ptr<Canvas2DLayerBridge>);
void SetSurfaceSize(const IntSize&);
diff --git a/chromium/third_party/WebKit/Source/core/html/forms/ExternalPopupMenu.cpp b/chromium/third_party/WebKit/Source/core/html/forms/ExternalPopupMenu.cpp
index 2a5dff01aa2..fae579a353a 100644
--- a/chromium/third_party/WebKit/Source/core/html/forms/ExternalPopupMenu.cpp
+++ b/chromium/third_party/WebKit/Source/core/html/forms/ExternalPopupMenu.cpp
@@ -32,6 +32,7 @@
#include "build/build_config.h"
#include "core/dom/NodeComputedStyle.h"
+#include "core/events/CurrentInputEvent.h"
#include "core/exported/WebViewImpl.h"
#include "core/frame/LocalFrame.h"
#include "core/frame/LocalFrameView.h"
@@ -118,7 +119,7 @@ void ExternalPopupMenu::Show() {
if (!ShowInternal())
return;
#if defined(OS_MACOSX)
- const WebInputEvent* current_event = WebViewImpl::CurrentInputEvent();
+ const WebInputEvent* current_event = CurrentInputEvent::Get();
if (current_event && current_event->GetType() == WebInputEvent::kMouseDown) {
synthetic_event_ = WTF::WrapUnique(new WebMouseEvent);
*synthetic_event_ = *static_cast<const WebMouseEvent*>(current_event);
diff --git a/chromium/third_party/WebKit/Source/core/layout/LayoutBlock.cpp b/chromium/third_party/WebKit/Source/core/layout/LayoutBlock.cpp
index 0d245beea07..5659fab6f17 100644
--- a/chromium/third_party/WebKit/Source/core/layout/LayoutBlock.cpp
+++ b/chromium/third_party/WebKit/Source/core/layout/LayoutBlock.cpp
@@ -1989,6 +1989,7 @@ bool LayoutBlock::RecalcNormalFlowChildOverflowIfNeeded(
}
bool LayoutBlock::RecalcChildOverflowAfterStyleChange() {
+ DCHECK(!IsTable());
DCHECK(ChildNeedsOverflowRecalcAfterStyleChange());
ClearChildNeedsOverflowRecalcAfterStyleChange();
@@ -2032,6 +2033,11 @@ bool LayoutBlock::RecalcOverflowAfterStyleChange() {
if (!self_needs_overflow_recalc && !children_overflow_changed)
return false;
+ return RecalcSelfOverflowAfterStyleChange();
+}
+
+bool LayoutBlock::RecalcSelfOverflowAfterStyleChange() {
+ bool self_needs_overflow_recalc = SelfNeedsOverflowRecalcAfterStyleChange();
ClearSelfNeedsOverflowRecalcAfterStyleChange();
// If the current block needs layout, overflow will be recalculated during
// layout time anyway. We can safely exit here.
diff --git a/chromium/third_party/WebKit/Source/core/layout/LayoutBlock.h b/chromium/third_party/WebKit/Source/core/layout/LayoutBlock.h
index b2c5bea611d..cced70239ea 100644
--- a/chromium/third_party/WebKit/Source/core/layout/LayoutBlock.h
+++ b/chromium/third_party/WebKit/Source/core/layout/LayoutBlock.h
@@ -318,6 +318,7 @@ class CORE_EXPORT LayoutBlock : public LayoutBox {
protected:
bool RecalcNormalFlowChildOverflowIfNeeded(LayoutObject*);
bool RecalcPositionedDescendantsOverflowAfterStyleChange();
+ bool RecalcSelfOverflowAfterStyleChange();
public:
bool RecalcChildOverflowAfterStyleChange();
diff --git a/chromium/third_party/WebKit/Source/core/layout/LayoutFlexibleBox.cpp b/chromium/third_party/WebKit/Source/core/layout/LayoutFlexibleBox.cpp
index 5a7f59c0b83..07817cfd0db 100644
--- a/chromium/third_party/WebKit/Source/core/layout/LayoutFlexibleBox.cpp
+++ b/chromium/third_party/WebKit/Source/core/layout/LayoutFlexibleBox.cpp
@@ -299,22 +299,19 @@ bool LayoutFlexibleBox::HasLeftOverflow() const {
}
void LayoutFlexibleBox::MergeAnonymousFlexItems(LayoutObject* remove_child) {
- // When we remove a flex item, and the previous and next in-flow siblings of
- // the item are text nodes wrapped in anonymous flex items, the adjacent text
- // nodes need to be merged into the same flex item.
- LayoutObject* prev_in_flow =
- ToLayoutBox(remove_child)->PreviousInFlowSiblingBox();
- if (!prev_in_flow || !prev_in_flow->IsAnonymousBlock())
+ // When we remove a flex item, and the previous and next siblings of the item
+ // are text nodes wrapped in anonymous flex items, the adjacent text nodes
+ // need to be merged into the same flex item.
+ LayoutObject* prev = remove_child->PreviousSibling();
+ if (!prev || !prev->IsAnonymousBlock())
return;
- LayoutObject* next_in_flow =
- ToLayoutBox(remove_child)->NextInFlowSiblingBox();
- if (!next_in_flow || !next_in_flow->IsAnonymousBlock())
+ LayoutObject* next = remove_child->NextSibling();
+ if (!next || !next->IsAnonymousBlock())
return;
- ToLayoutBoxModelObject(next_in_flow)
- ->MoveAllChildrenTo(ToLayoutBoxModelObject(prev_in_flow));
- ToLayoutBlockFlow(next_in_flow)->DeleteLineBoxTree();
- next_in_flow->Destroy();
- intrinsic_size_along_main_axis_.erase(next_in_flow);
+ ToLayoutBoxModelObject(next)->MoveAllChildrenTo(ToLayoutBoxModelObject(prev));
+ ToLayoutBlockFlow(next)->DeleteLineBoxTree();
+ next->Destroy();
+ intrinsic_size_along_main_axis_.erase(next);
}
void LayoutFlexibleBox::RemoveChild(LayoutObject* child) {
diff --git a/chromium/third_party/WebKit/Source/core/layout/LayoutGrid.cpp b/chromium/third_party/WebKit/Source/core/layout/LayoutGrid.cpp
index 11af82406fc..8d336d4c0b4 100644
--- a/chromium/third_party/WebKit/Source/core/layout/LayoutGrid.cpp
+++ b/chromium/third_party/WebKit/Source/core/layout/LayoutGrid.cpp
@@ -1832,7 +1832,8 @@ GridAxisPosition LayoutGrid::ColumnAxisPositionForChild(
bool has_same_writing_mode =
child.StyleRef().GetWritingMode() == StyleRef().GetWritingMode();
bool child_is_ltr = child.StyleRef().IsLeftToRightDirection();
- if (!HasStaticPositionForChild(child, kForRows))
+ if (child.IsOutOfFlowPositioned() &&
+ !HasStaticPositionForChild(child, kForRows))
return kGridAxisStart;
switch (AlignSelfForChild(child).GetPosition()) {
@@ -1913,7 +1914,8 @@ GridAxisPosition LayoutGrid::RowAxisPositionForChild(
bool has_same_direction =
child.StyleRef().Direction() == StyleRef().Direction();
bool grid_is_ltr = StyleRef().IsLeftToRightDirection();
- if (!HasStaticPositionForChild(child, kForColumns))
+ if (child.IsOutOfFlowPositioned() &&
+ !HasStaticPositionForChild(child, kForColumns))
return kGridAxisStart;
switch (JustifySelfForChild(child).GetPosition()) {
diff --git a/chromium/third_party/WebKit/Source/core/layout/LayoutTable.cpp b/chromium/third_party/WebKit/Source/core/layout/LayoutTable.cpp
index 8ffdee7b110..a0b8c42f26f 100644
--- a/chromium/third_party/WebKit/Source/core/layout/LayoutTable.cpp
+++ b/chromium/third_party/WebKit/Source/core/layout/LayoutTable.cpp
@@ -566,6 +566,8 @@ void LayoutTable::SimplifiedNormalFlowLayout() {
}
bool LayoutTable::RecalcOverflowAfterStyleChange() {
+ RecalcSelfOverflowAfterStyleChange();
+
if (!ChildNeedsOverflowRecalcAfterStyleChange())
return false;
ClearChildNeedsOverflowRecalcAfterStyleChange();
diff --git a/chromium/third_party/WebKit/Source/core/layout/LayoutTableTest.cpp b/chromium/third_party/WebKit/Source/core/layout/LayoutTableTest.cpp
index 7437bc9abb9..221f532edec 100644
--- a/chromium/third_party/WebKit/Source/core/layout/LayoutTableTest.cpp
+++ b/chromium/third_party/WebKit/Source/core/layout/LayoutTableTest.cpp
@@ -18,6 +18,30 @@ class LayoutTableTest : public RenderingTest {
}
};
+TEST_F(LayoutTableTest, OverflowViaOutline) {
+ SetBodyInnerHTML(R"HTML(
+ <style>
+ div { display: table; width: 100px; height: 200px; }
+ </style>
+ <div id=target>
+ <div id=child></div>
+ </div>
+ )HTML");
+ auto* target = GetTableByElementId("target");
+ EXPECT_EQ(LayoutRect(0, 0, 100, 200), target->SelfVisualOverflowRect());
+ ToElement(target->GetNode())
+ ->setAttribute(HTMLNames::styleAttr, "outline: 2px solid black");
+
+ auto* child = GetTableByElementId("child");
+ ToElement(child->GetNode())
+ ->setAttribute(HTMLNames::styleAttr, "outline: 2px solid black");
+
+ target->GetFrameView()->UpdateAllLifecyclePhases();
+ EXPECT_EQ(LayoutRect(-2, -2, 104, 204), target->SelfVisualOverflowRect());
+
+ EXPECT_EQ(LayoutRect(-2, -2, 104, 204), child->SelfVisualOverflowRect());
+}
+
TEST_F(LayoutTableTest, OverflowWithCollapsedBorders) {
SetBodyInnerHTML(R"HTML(
<style>
diff --git a/chromium/third_party/WebKit/Source/core/layout/ScrollAnchor.cpp b/chromium/third_party/WebKit/Source/core/layout/ScrollAnchor.cpp
index 946db30cbcd..40599b4bfd9 100644
--- a/chromium/third_party/WebKit/Source/core/layout/ScrollAnchor.cpp
+++ b/chromium/third_party/WebKit/Source/core/layout/ScrollAnchor.cpp
@@ -306,6 +306,8 @@ void ScrollAnchor::FindAnchor() {
TRACE_EVENT0("blink", "ScrollAnchor::findAnchor");
SCOPED_BLINK_UMA_HISTOGRAM_TIMER("Layout.ScrollAnchor.TimeToFindAnchor");
FindAnchorRecursive(ScrollerLayoutBox(scroller_));
+ if (anchor_object_)
+ anchor_object_->SetIsScrollAnchorObject();
}
bool ScrollAnchor::FindAnchorRecursive(LayoutObject* candidate) {
@@ -390,7 +392,6 @@ void ScrollAnchor::NotifyBeforeLayout() {
if (!anchor_object_)
return;
- anchor_object_->SetIsScrollAnchorObject();
saved_relative_offset_ =
ComputeRelativeOffset(anchor_object_, scroller_, corner_);
}
@@ -527,7 +528,6 @@ bool ScrollAnchor::RestoreAnchor(const SerializedAnchor& serialized_anchor) {
saved_relative_offset_ =
ComputeRelativeOffset(anchor_object_, scroller_, corner_);
saved_selector_ = serialized_anchor.selector;
- anchor_object_->SetIsScrollAnchorObject();
restoration_status_histogram.Count(kSuccess);
return true;
diff --git a/chromium/third_party/WebKit/Source/core/layout/ScrollAnchorTest.cpp b/chromium/third_party/WebKit/Source/core/layout/ScrollAnchorTest.cpp
index 7bb0a652d4d..e332e289e64 100644
--- a/chromium/third_party/WebKit/Source/core/layout/ScrollAnchorTest.cpp
+++ b/chromium/third_party/WebKit/Source/core/layout/ScrollAnchorTest.cpp
@@ -548,6 +548,34 @@ TEST_P(ScrollAnchorTest, SerializeAnchorUsesTagname) {
ValidateSerializedAnchor("#ancestor>span", LayoutPoint(0, -50));
}
+TEST_P(ScrollAnchorTest, SerializeAnchorSetsIsAnchorBit) {
+ SetBodyInnerHTML(R"HTML(
+ <style>
+ body { height: 1000px; margin: 0; }
+ div { height: 100px; }
+ .scroller {
+ overflow: scroll;
+ width: 400px;
+ height: 400px;
+ }
+ </style>
+ <div id='s1' class='scroller'>
+ <div id='anchor'>abc</div>
+ </div>")HTML");
+
+ ScrollLayoutViewport(ScrollOffset(0, 50));
+ ValidateSerializedAnchor("#anchor", LayoutPoint(0, -50));
+
+ Element* s1 = GetDocument().getElementById("s1");
+ Element* anchor = GetDocument().getElementById("anchor");
+ // Remove the anchor. If the IsScrollAnchorOBject bit is set as it should be,
+ // the anchor object will get cleaned up correctly.
+ s1->RemoveChild(anchor);
+ // Trigger a re-layout, which will crash if it wasn't properly cleaned up when
+ // removing it from the DOM.
+ ScrollLayoutViewport(ScrollOffset(0, 25));
+}
+
TEST_P(ScrollAnchorTest, SerializeAnchorUsesClassname) {
SetBodyInnerHTML(R"HTML(
<style>
diff --git a/chromium/third_party/WebKit/Source/core/loader/EmptyClients.h b/chromium/third_party/WebKit/Source/core/loader/EmptyClients.h
index 6f157d8c638..ab7e39414d5 100644
--- a/chromium/third_party/WebKit/Source/core/loader/EmptyClients.h
+++ b/chromium/third_party/WebKit/Source/core/loader/EmptyClients.h
@@ -417,7 +417,8 @@ class CORE_EXPORT EmptyRemoteFrameClient : public RemoteFrameClient {
void ForwardPostMessage(MessageEvent*,
scoped_refptr<const SecurityOrigin> target,
LocalFrame* source_frame) const override {}
- void FrameRectsChanged(const IntRect& frame_rect) override {}
+ void FrameRectsChanged(const IntRect& local_frame_rect,
+ const IntRect& transformed_frame_rect) override {}
void UpdateRemoteViewportIntersection(
const IntRect& viewport_intersection) override {}
void AdvanceFocus(WebFocusType, LocalFrame* source) override {}
diff --git a/chromium/third_party/WebKit/Source/core/loader/InteractiveDetector.cpp b/chromium/third_party/WebKit/Source/core/loader/InteractiveDetector.cpp
index e8ba4dd4cd7..709e85f70ec 100644
--- a/chromium/third_party/WebKit/Source/core/loader/InteractiveDetector.cpp
+++ b/chromium/third_party/WebKit/Source/core/loader/InteractiveDetector.cpp
@@ -94,11 +94,17 @@ void InteractiveDetector::StartOrPostponeCITimer(double timer_fire_time) {
}
double InteractiveDetector::GetInteractiveTime() const {
- return interactive_time_;
+ // TODO(crbug.com/808685) Simplify FMP and TTI input invalidation.
+ return page_event_times_.first_meaningful_paint_invalidated
+ ? 0.0
+ : interactive_time_;
}
double InteractiveDetector::GetInteractiveDetectionTime() const {
- return interactive_detection_time_;
+ // TODO(crbug.com/808685) Simplify FMP and TTI input invalidation.
+ return page_event_times_.first_meaningful_paint_invalidated
+ ? 0.0
+ : interactive_detection_time_;
}
double InteractiveDetector::GetFirstInvalidatingInputTime() const {
@@ -182,10 +188,14 @@ void InteractiveDetector::OnLongTaskDetected(double start_time,
StartOrPostponeCITimer(end_time + kTimeToInteractiveWindowSeconds);
}
-void InteractiveDetector::OnFirstMeaningfulPaintDetected(double fmp_time) {
- DCHECK(page_event_times_.first_meaningful_paint ==
- 0.0); // Should not set FMP twice.
+void InteractiveDetector::OnFirstMeaningfulPaintDetected(
+ double fmp_time,
+ FirstMeaningfulPaintDetector::HadUserInput user_input_before_fmp) {
+ // Should not set FMP twice.
+ DCHECK(page_event_times_.first_meaningful_paint == 0.0);
page_event_times_.first_meaningful_paint = fmp_time;
+ page_event_times_.first_meaningful_paint_invalidated =
+ user_input_before_fmp == FirstMeaningfulPaintDetector::kHadUserInput;
if (CurrentTimeTicksInSeconds() - fmp_time >=
kTimeToInteractiveWindowSeconds) {
// We may have reached TTCI already. Check right away.
@@ -357,8 +367,13 @@ void InteractiveDetector::OnTimeToInteractiveDetected() {
GetSupplementable()->GetFrame(), "had_user_input_before_interactive",
had_user_input_before_interactive);
- if (GetSupplementable()->Loader())
- GetSupplementable()->Loader()->DidChangePerformanceTiming();
+ // We only send TTI to Performance Timing Observers if FMP was not invalidated
+ // by input.
+ // TODO(crbug.com/808685) Simplify FMP and TTI input invalidation.
+ if (!page_event_times_.first_meaningful_paint_invalidated) {
+ if (GetSupplementable()->Loader())
+ GetSupplementable()->Loader()->DidChangePerformanceTiming();
+ }
}
void InteractiveDetector::Trace(Visitor* visitor) {
diff --git a/chromium/third_party/WebKit/Source/core/loader/InteractiveDetector.h b/chromium/third_party/WebKit/Source/core/loader/InteractiveDetector.h
index 9036a008d42..e08bad8c9b4 100644
--- a/chromium/third_party/WebKit/Source/core/loader/InteractiveDetector.h
+++ b/chromium/third_party/WebKit/Source/core/loader/InteractiveDetector.h
@@ -7,6 +7,7 @@
#include "base/macros.h"
#include "core/CoreExport.h"
+#include "core/paint/FirstMeaningfulPaintDetector.h"
#include "platform/LongTaskDetector.h"
#include "platform/PODInterval.h"
#include "platform/Supplementable.h"
@@ -55,7 +56,9 @@ class CORE_EXPORT InteractiveDetector
void OnResourceLoadEnd(WTF::Optional<double> load_finish_time);
void SetNavigationStartTime(double navigation_start_time);
- void OnFirstMeaningfulPaintDetected(double fmp_time);
+ void OnFirstMeaningfulPaintDetected(
+ double fmp_time,
+ FirstMeaningfulPaintDetector::HadUserInput user_input_before_fmp);
void OnDomContentLoadedEnd(double dcl_time);
void OnInvalidatingInputEvent(double timestamp_seconds);
@@ -95,6 +98,7 @@ class CORE_EXPORT InteractiveDetector
double dom_content_loaded_end = 0.0;
double nav_start = 0.0;
double first_invalidating_input = 0.0;
+ bool first_meaningful_paint_invalidated = false;
} page_event_times_;
// Stores sufficiently long quiet windows on main thread and network.
diff --git a/chromium/third_party/WebKit/Source/core/loader/InteractiveDetectorTest.cpp b/chromium/third_party/WebKit/Source/core/loader/InteractiveDetectorTest.cpp
index 80b2c9f7409..90aa727a8b1 100644
--- a/chromium/third_party/WebKit/Source/core/loader/InteractiveDetectorTest.cpp
+++ b/chromium/third_party/WebKit/Source/core/loader/InteractiveDetectorTest.cpp
@@ -5,6 +5,7 @@
#include "core/loader/InteractiveDetector.h"
#include "core/dom/Document.h"
+#include "core/paint/FirstMeaningfulPaintDetector.h"
#include "core/testing/PageTestBase.h"
#include "platform/CrossThreadFunctional.h"
#include "platform/scheduler/renderer/renderer_scheduler_impl.h"
@@ -81,7 +82,8 @@ class InteractiveDetectorTest : public ::testing::Test {
void SimulateFMPDetected(double fmp_time, double detection_time) {
RunTillTimestamp(detection_time);
- detector_->OnFirstMeaningfulPaintDetected(fmp_time);
+ detector_->OnFirstMeaningfulPaintDetected(
+ fmp_time, FirstMeaningfulPaintDetector::kNoUserInput);
}
void SimulateInteractiveInvalidatingInput(double timestamp) {
@@ -395,6 +397,25 @@ TEST_F(InteractiveDetectorTest, InvalidatingUserInput) {
EXPECT_EQ(GetDetector()->GetFirstInvalidatingInputTime(), t0 + 5.0);
}
+TEST_F(InteractiveDetectorTest, InvalidatedFMP) {
+ double t0 = CurrentTimeTicksInSeconds();
+ SimulateNavigationStart(t0);
+ // Network is forever quiet for this test.
+ SetActiveConnections(1);
+ SimulateInteractiveInvalidatingInput(t0 + 1.0);
+ SimulateDOMContentLoadedEnd(t0 + 2.0);
+ RunTillTimestamp(t0 + 4.0); // FMP Detection time.
+ GetDetector()->OnFirstMeaningfulPaintDetected(
+ t0 + 3.0, FirstMeaningfulPaintDetector::kHadUserInput);
+ // Run till 5 seconds after FMP.
+ RunTillTimestamp((t0 + 3.0) + 5.0 + 0.1);
+ // Since FMP was invalidated, we do not have TTI or TTI Detection Time.
+ EXPECT_EQ(GetInteractiveTime(), 0.0);
+ EXPECT_EQ(GetDetector()->GetInteractiveDetectionTime(), 0.0);
+ // Invalidating input timestamp is available.
+ EXPECT_EQ(GetDetector()->GetFirstInvalidatingInputTime(), t0 + 1.0);
+}
+
class InteractiveDetectorTestWithDummyPage : public PageTestBase {
public:
// Public because it's executed on a task queue.
@@ -427,7 +448,8 @@ TEST_F(InteractiveDetectorTestWithDummyPage, TaskLongerThan5sBlocksTTI) {
// DummyPageHolder automatically fires DomContentLoadedEnd, but not First
// Meaningful Paint. We therefore manually Invoking the listener on
// InteractiveDetector.
- detector->OnFirstMeaningfulPaintDetected(t0 + 3.0);
+ detector->OnFirstMeaningfulPaintDetected(
+ t0 + 3.0, FirstMeaningfulPaintDetector::kNoUserInput);
// Post a task with 6 seconds duration.
PostCrossThreadTask(
@@ -451,7 +473,8 @@ TEST_F(InteractiveDetectorTestWithDummyPage, LongTaskAfterTTIDoesNothing) {
// DummyPageHolder automatically fires DomContentLoadedEnd, but not First
// Meaningful Paint. We therefore manually Invoking the listener on
// InteractiveDetector.
- detector->OnFirstMeaningfulPaintDetected(t0 + 3.0);
+ detector->OnFirstMeaningfulPaintDetected(
+ t0 + 3.0, FirstMeaningfulPaintDetector::kNoUserInput);
// Long task 1.
PostCrossThreadTask(
diff --git a/chromium/third_party/WebKit/Source/core/loader/modulescript/DocumentModuleScriptFetcher.cpp b/chromium/third_party/WebKit/Source/core/loader/modulescript/DocumentModuleScriptFetcher.cpp
index 12d33812943..be3ff6ce8f2 100644
--- a/chromium/third_party/WebKit/Source/core/loader/modulescript/DocumentModuleScriptFetcher.cpp
+++ b/chromium/third_party/WebKit/Source/core/loader/modulescript/DocumentModuleScriptFetcher.cpp
@@ -93,7 +93,8 @@ void DocumentModuleScriptFetcher::NotifyFinished(Resource* resource) {
ModuleScriptCreationParams params(
script_resource->GetResponse().Url(), script_resource->SourceText(),
script_resource->GetResourceRequest().GetFetchCredentialsMode(),
- script_resource->CalculateAccessControlStatus());
+ script_resource->CalculateAccessControlStatus(
+ fetcher_->Context().GetSecurityOrigin()));
Finalize(params, error_messages);
}
diff --git a/chromium/third_party/WebKit/Source/core/loader/resource/ImageResource.cpp b/chromium/third_party/WebKit/Source/core/loader/resource/ImageResource.cpp
index a9e3300f806..d4f2afd5aad 100644
--- a/chromium/third_party/WebKit/Source/core/loader/resource/ImageResource.cpp
+++ b/chromium/third_party/WebKit/Source/core/loader/resource/ImageResource.cpp
@@ -665,14 +665,15 @@ bool ImageResource::IsAccessAllowed(
const SecurityOrigin* security_origin,
ImageResourceInfo::DoesCurrentFrameHaveSingleSecurityOrigin
does_current_frame_has_single_security_origin) const {
- if (GetCORSStatus() == CORSStatus::kServiceWorkerOpaque)
- return false;
+ if (GetResponse().WasFetchedViaServiceWorker())
+ return GetCORSStatus() != CORSStatus::kServiceWorkerOpaque;
if (does_current_frame_has_single_security_origin !=
ImageResourceInfo::kHasSingleSecurityOrigin)
return false;
- if (IsSameOriginOrCORSSuccessful())
+ DCHECK(security_origin);
+ if (PassesAccessControlCheck(*security_origin))
return true;
return !security_origin->TaintsCanvas(GetResponse().Url());
diff --git a/chromium/third_party/WebKit/Source/core/loader/resource/ScriptResource.cpp b/chromium/third_party/WebKit/Source/core/loader/resource/ScriptResource.cpp
index 74b34063212..90c1a38c6d9 100644
--- a/chromium/third_party/WebKit/Source/core/loader/resource/ScriptResource.cpp
+++ b/chromium/third_party/WebKit/Source/core/loader/resource/ScriptResource.cpp
@@ -88,11 +88,15 @@ void ScriptResource::DestroyDecodedDataForFailedRevalidation() {
SetDecodedSize(0);
}
-AccessControlStatus ScriptResource::CalculateAccessControlStatus() const {
- if (GetCORSStatus() == CORSStatus::kServiceWorkerOpaque)
- return kOpaqueResource;
+AccessControlStatus ScriptResource::CalculateAccessControlStatus(
+ const SecurityOrigin* security_origin) const {
+ if (GetResponse().WasFetchedViaServiceWorker()) {
+ if (GetCORSStatus() == CORSStatus::kServiceWorkerOpaque)
+ return kOpaqueResource;
+ return kSharableCrossOrigin;
+ }
- if (IsSameOriginOrCORSSuccessful())
+ if (security_origin && PassesAccessControlCheck(*security_origin))
return kSharableCrossOrigin;
return kNotSharableCrossOrigin;
diff --git a/chromium/third_party/WebKit/Source/core/loader/resource/ScriptResource.h b/chromium/third_party/WebKit/Source/core/loader/resource/ScriptResource.h
index 9905d27e629..7764a3cecf6 100644
--- a/chromium/third_party/WebKit/Source/core/loader/resource/ScriptResource.h
+++ b/chromium/third_party/WebKit/Source/core/loader/resource/ScriptResource.h
@@ -68,7 +68,7 @@ class CORE_EXPORT ScriptResource final : public TextResource {
const String& SourceText();
- AccessControlStatus CalculateAccessControlStatus() const;
+ AccessControlStatus CalculateAccessControlStatus(const SecurityOrigin*) const;
private:
class ScriptResourceFactory : public ResourceFactory {
diff --git a/chromium/third_party/WebKit/Source/core/page/CreateWindow.cpp b/chromium/third_party/WebKit/Source/core/page/CreateWindow.cpp
index 062c79feff2..907a2d09573 100644
--- a/chromium/third_party/WebKit/Source/core/page/CreateWindow.cpp
+++ b/chromium/third_party/WebKit/Source/core/page/CreateWindow.cpp
@@ -28,6 +28,7 @@
#include "bindings/core/v8/ExceptionState.h"
#include "core/dom/Document.h"
+#include "core/events/CurrentInputEvent.h"
#include "core/events/UIEventWithKeyState.h"
#include "core/exported/WebViewImpl.h"
#include "core/frame/FrameClient.h"
@@ -286,8 +287,8 @@ static Frame* CreateNewWindow(LocalFrame& opener_frame,
if (!old_page)
return nullptr;
- policy = EffectiveNavigationPolicy(policy, WebViewImpl::CurrentInputEvent(),
- features);
+ policy =
+ EffectiveNavigationPolicy(policy, CurrentInputEvent::Get(), features);
const SandboxFlags sandbox_flags =
opener_frame.GetDocument()->IsSandboxed(
diff --git a/chromium/third_party/WebKit/Source/core/page/scrolling/ScrollingCoordinator.cpp b/chromium/third_party/WebKit/Source/core/page/scrolling/ScrollingCoordinator.cpp
index 043795220d9..90d635f1b8a 100644
--- a/chromium/third_party/WebKit/Source/core/page/scrolling/ScrollingCoordinator.cpp
+++ b/chromium/third_party/WebKit/Source/core/page/scrolling/ScrollingCoordinator.cpp
@@ -475,7 +475,22 @@ bool ScrollingCoordinator::ScrollableAreaScrollLayerDidChange(
FloatPoint scroll_position(scrollable_area->ScrollOrigin() +
scrollable_area->GetScrollOffset());
web_layer->SetScrollPosition(scroll_position);
- web_layer->SetBounds(scrollable_area->ContentsSize());
+ // TODO(bokan): This method shouldn't be resizing the layer geometry. That
+ // happens in CompositedLayerMapping::UpdateScrollingLayerGeometry.
+ LayoutSize subpixel_accumulation =
+ scrollable_area->Layer()
+ ? scrollable_area->Layer()->SubpixelAccumulation()
+ : LayoutSize();
+ LayoutSize contents_size =
+ scrollable_area->GetLayoutBox()
+ ? LayoutSize(scrollable_area->GetLayoutBox()->ScrollWidth(),
+ scrollable_area->GetLayoutBox()->ScrollHeight())
+ : LayoutSize(scrollable_area->ContentsSize());
+ IntSize scroll_contents_size =
+ PixelSnappedIntRect(
+ LayoutRect(LayoutPoint(subpixel_accumulation), contents_size))
+ .Size();
+ web_layer->SetBounds(scroll_contents_size);
// VisualViewport scrolling may involve pinch zoom and gets routed through
// WebViewImpl explicitly rather than via ScrollingCoordinator::DidScroll
// since it needs to be set in tandem with the page scale delta.
diff --git a/chromium/third_party/WebKit/Source/core/paint/InlineTextBoxPainter.cpp b/chromium/third_party/WebKit/Source/core/paint/InlineTextBoxPainter.cpp
index d24007e3c93..fa16c9b30d8 100644
--- a/chromium/third_party/WebKit/Source/core/paint/InlineTextBoxPainter.cpp
+++ b/chromium/third_party/WebKit/Source/core/paint/InlineTextBoxPainter.cpp
@@ -184,11 +184,10 @@ void InlineTextBoxPainter::Paint(const PaintInfo& paint_info,
LayoutRect box_rect(box_origin, LayoutSize(inline_text_box_.LogicalWidth(),
inline_text_box_.LogicalHeight()));
- int length = inline_text_box_.Len();
+ unsigned length = inline_text_box_.Len();
const String& layout_item_string =
inline_text_box_.GetLineLayoutItem().GetText();
- // TODO(szager): Figure out why this CHECK sometimes fails, it shouldn't.
- CHECK(inline_text_box_.Start() + length <= layout_item_string.length());
+
String first_line_string;
if (inline_text_box_.IsFirstLineStyle()) {
first_line_string = layout_item_string;
@@ -197,6 +196,17 @@ void InlineTextBoxPainter::Paint(const PaintInfo& paint_info,
inline_text_box_.IsFirstLineStyle()),
first_line_string,
inline_text_box_.GetLineLayoutItem().PreviousCharacter());
+ // TODO(crbug.com/795498): this is a hack. The root issue is that
+ // capitalizing letters can change the length of the backing string.
+ // That needs to be taken into account when computing the size of the box
+ // or its painting.
+ length = std::min(length, first_line_string.length());
+
+ // TODO(szager): Figure out why this CHECK sometimes fails, it shouldn't.
+ CHECK(inline_text_box_.Start() + length <= first_line_string.length());
+ } else {
+ // TODO(szager): Figure out why this CHECK sometimes fails, it shouldn't.
+ CHECK(inline_text_box_.Start() + length <= layout_item_string.length());
}
StringView string =
StringView(inline_text_box_.IsFirstLineStyle() ? first_line_string
diff --git a/chromium/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp b/chromium/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp
index 307dcd54216..b4f4ac773c4 100644
--- a/chromium/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp
+++ b/chromium/third_party/WebKit/Source/core/paint/PaintPropertyTreeBuilder.cpp
@@ -998,7 +998,8 @@ static LayoutPoint VisualOffsetFromPaintOffsetRoot(
const LayoutObject* paint_offset_root = context.current.paint_offset_root;
PaintLayer* painting_layer = paint_offset_root->PaintingLayer();
LayoutPoint result = child->VisualOffsetFromAncestor(painting_layer);
- if (!paint_offset_root->HasLayer()) {
+ if (!paint_offset_root->HasLayer() ||
+ ToLayoutBoxModelObject(paint_offset_root)->Layer() != painting_layer) {
result.Move(-paint_offset_root->OffsetFromAncestorContainer(
&painting_layer->GetLayoutObject()));
}
diff --git a/chromium/third_party/WebKit/Source/core/paint/PaintTiming.cpp b/chromium/third_party/WebKit/Source/core/paint/PaintTiming.cpp
index e03fdaf67da..c911772129f 100644
--- a/chromium/third_party/WebKit/Source/core/paint/PaintTiming.cpp
+++ b/chromium/third_party/WebKit/Source/core/paint/PaintTiming.cpp
@@ -113,7 +113,7 @@ void PaintTiming::SetFirstMeaningfulPaint(
InteractiveDetector* interactive_detector(
InteractiveDetector::From(*GetSupplementable()));
if (interactive_detector) {
- interactive_detector->OnFirstMeaningfulPaintDetected(swap_stamp);
+ interactive_detector->OnFirstMeaningfulPaintDetected(swap_stamp, had_input);
}
// Notify FMP for UMA only if there's no user input before FMP, so that layout
diff --git a/chromium/third_party/WebKit/Source/core/paint/compositing/CompositedLayerMapping.cpp b/chromium/third_party/WebKit/Source/core/paint/compositing/CompositedLayerMapping.cpp
index 423a303d7ed..49662e6f8b5 100644
--- a/chromium/third_party/WebKit/Source/core/paint/compositing/CompositedLayerMapping.cpp
+++ b/chromium/third_party/WebKit/Source/core/paint/compositing/CompositedLayerMapping.cpp
@@ -1658,8 +1658,13 @@ void CompositedLayerMapping::UpdateScrollingLayerGeometry(
bool overflow_clip_rect_offset_changed =
old_scrolling_layer_offset != scrolling_layer_->OffsetFromLayoutObject();
- IntSize scroll_size(layout_box.PixelSnappedScrollWidth(),
- layout_box.PixelSnappedScrollHeight());
+ IntSize scroll_size =
+ PixelSnappedIntRect(
+ LayoutRect(
+ LayoutPoint(owning_layer_.SubpixelAccumulation()),
+ LayoutSize(layout_box.ScrollWidth(), layout_box.ScrollHeight())))
+ .Size();
+
if (overflow_clip_rect_offset_changed)
scrolling_contents_layer_->SetNeedsDisplay();
diff --git a/chromium/third_party/WebKit/Source/core/paint/compositing/CompositedLayerMappingTest.cpp b/chromium/third_party/WebKit/Source/core/paint/compositing/CompositedLayerMappingTest.cpp
index 3f9fa345ef2..3ff16d66b34 100644
--- a/chromium/third_party/WebKit/Source/core/paint/compositing/CompositedLayerMappingTest.cpp
+++ b/chromium/third_party/WebKit/Source/core/paint/compositing/CompositedLayerMappingTest.cpp
@@ -2475,4 +2475,47 @@ TEST_P(CompositedLayerMappingTest, ForegroundLayerSizing) {
EXPECT_EQ(FloatSize(100, 100), mapping->ForegroundLayer()->Size());
}
+TEST_P(CompositedLayerMappingTest, ScrollLayerSizingSubpixelAccumulation) {
+ // This test verifies that when subpixel accumulation causes snapping it
+ // applies to both the scrolling and scrolling contents layers. Verify that
+ // the mapping doesn't have any vertical scrolling introduced as a result of
+ // the snapping behavior. https://crbug.com/801381.
+ GetDocument().GetFrame()->GetSettings()->SetPreferCompositingToLCDTextEnabled(
+ true);
+
+ // The values below are chosen so that the subpixel accumulation causes the
+ // pixel snapped height to be increased relative to snapping without it.
+ SetBodyInnerHTML(R"HTML(
+ <!DOCTYPE html>
+ <style>
+ body {
+ margin: 0;
+ }
+ #scroller {
+ position: relative;
+ top: 0.5625px;
+ width: 200px;
+ height: 200.8125px;
+ overflow: auto;
+ }
+ #space {
+ width: 1000px;
+ height: 200.8125px;
+ }
+ </style>
+ <div id="scroller">
+ <div id="space"></div>
+ </div>
+ )HTML");
+ GetDocument().View()->UpdateAllLifecyclePhases();
+ auto* mapping = ToLayoutBoxModelObject(GetLayoutObjectByElementId("scroller"))
+ ->Layer()
+ ->GetCompositedLayerMapping();
+ ASSERT_TRUE(mapping);
+ ASSERT_TRUE(mapping->ScrollingLayer());
+ ASSERT_TRUE(mapping->ScrollingContentsLayer());
+ EXPECT_EQ(mapping->ScrollingLayer()->Size().Height(),
+ mapping->ScrollingContentsLayer()->Size().Height());
+}
+
} // namespace blink
diff --git a/chromium/third_party/WebKit/Source/core/script/ClassicPendingScript.cpp b/chromium/third_party/WebKit/Source/core/script/ClassicPendingScript.cpp
index 4a377986144..a507399e3bd 100644
--- a/chromium/third_party/WebKit/Source/core/script/ClassicPendingScript.cpp
+++ b/chromium/third_party/WebKit/Source/core/script/ClassicPendingScript.cpp
@@ -250,8 +250,10 @@ ClassicScript* ClassicPendingScript::GetSource(const KURL& document_url,
// "the URL from which the script was obtained" [spec text]
// https://html.spec.whatwg.org/multipage/webappapis.html#concept-script-base-url
const KURL& base_url = source_code.Url();
- return ClassicScript::Create(source_code, base_url, options_,
- resource->CalculateAccessControlStatus());
+ return ClassicScript::Create(
+ source_code, base_url, options_,
+ resource->CalculateAccessControlStatus(
+ GetElement()->GetDocument().GetSecurityOrigin()));
}
void ClassicPendingScript::SetStreamer(ScriptStreamer* streamer) {
diff --git a/chromium/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.idl b/chromium/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.idl
index 433a2ba5206..5fdbc94ad86 100644
--- a/chromium/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.idl
+++ b/chromium/third_party/WebKit/Source/core/xmlhttprequest/XMLHttpRequest.idl
@@ -37,6 +37,8 @@ enum XMLHttpRequestResponseType {
"text",
};
+// TODO(foolip, gyuyoung): getResponseHeader, setRequestHeader, and open should
+// be replaced with ByteString or USVString.
[
ActiveScriptWrappable,
Constructor,
@@ -56,8 +58,8 @@ enum XMLHttpRequestResponseType {
// request
[RaisesException] void open(ByteString method, USVString url);
- [RaisesException] void open(ByteString method, USVString url, boolean async, optional USVString? username = null, optional USVString? password = null);
- [RaisesException] void setRequestHeader(ByteString name, ByteString value);
+ [RaisesException] void open(ByteString method, USVString url, boolean async, optional DOMString? username = null, optional DOMString? password = null);
+ [RaisesException] void setRequestHeader(DOMString name, DOMString value);
[RaisesException=Setter] attribute unsigned long timeout;
[RaisesException=Setter] attribute boolean withCredentials;
readonly attribute XMLHttpRequestUpload upload;
@@ -70,8 +72,8 @@ enum XMLHttpRequestResponseType {
readonly attribute USVString responseURL;
readonly attribute unsigned short status;
readonly attribute ByteString statusText;
- ByteString? getResponseHeader(ByteString name);
- ByteString getAllResponseHeaders();
+ DOMString? getResponseHeader(DOMString name);
+ DOMString getAllResponseHeaders();
[RaisesException] void overrideMimeType(DOMString mime);
[RaisesException=Setter] attribute XMLHttpRequestResponseType responseType;
[Custom=Getter, RaisesException=Getter] readonly attribute any response;
diff --git a/chromium/third_party/WebKit/Source/devtools/front_end/network/RequestPreviewView.js b/chromium/third_party/WebKit/Source/devtools/front_end/network/RequestPreviewView.js
index 1e46c9cf6cb..b5cda811432 100644
--- a/chromium/third_party/WebKit/Source/devtools/front_end/network/RequestPreviewView.js
+++ b/chromium/third_party/WebKit/Source/devtools/front_end/network/RequestPreviewView.js
@@ -54,22 +54,22 @@ Network.RequestPreviewView = class extends Network.RequestResponseView {
/**
* @return {!Promise<?UI.Widget>}
*/
- async _htmlErrorPreview() {
+ async _htmlPreview() {
var contentData = await this.request.contentData();
if (contentData.error)
return new UI.EmptyWidget(Common.UIString('Failed to load response data'));
- // We can assume the status code has been set already because fetching contentData should wait for request to be
- // finished.
- if (!this.request.hasErrorStatusCode())
- return null;
-
var whitelist = new Set(['text/html', 'text/plain', 'application/xhtml+xml']);
if (!whitelist.has(this.request.mimeType))
return null;
- var encodedContent = contentData.encoded ? contentData.content : btoa(contentData.content);
- var dataURL = Common.ContentProvider.contentAsDataURL(encodedContent, this.request.mimeType, true, 'utf-8');
+ // http://crbug.com/767393 - DevTools should recognize JSON regardless of the content type
+ var jsonView = await SourceFrame.JSONView.createView(contentData.content);
+ if (jsonView)
+ return jsonView;
+
+ var dataURL = Common.ContentProvider.contentAsDataURL(
+ contentData.content, this.request.mimeType, contentData.encoded, contentData.encoded ? 'utf-8' : null);
return dataURL ? new Network.RequestHTMLView(dataURL) : null;
}
@@ -78,7 +78,7 @@ Network.RequestPreviewView = class extends Network.RequestResponseView {
* @return {!Promise<!UI.Widget>}
*/
async createPreview() {
- var htmlErrorPreview = await this._htmlErrorPreview();
+ var htmlErrorPreview = await this._htmlPreview();
if (htmlErrorPreview)
return htmlErrorPreview;
diff --git a/chromium/third_party/WebKit/Source/devtools/front_end/network/ResourceWebSocketFrameView.js b/chromium/third_party/WebKit/Source/devtools/front_end/network/ResourceWebSocketFrameView.js
index 979567b4358..31732d337ef 100644
--- a/chromium/third_party/WebKit/Source/devtools/front_end/network/ResourceWebSocketFrameView.js
+++ b/chromium/third_party/WebKit/Source/devtools/front_end/network/ResourceWebSocketFrameView.js
@@ -169,11 +169,11 @@ Network.ResourceWebSocketFrameView = class extends UI.VBox {
this._currentSelectedNode = selectedNode;
var contentProvider = selectedNode.contentProvider();
var content = await contentProvider.requestContent();
- var parsedJSON = await SourceFrame.JSONView.parseJSON(content);
+ var jsonView = await SourceFrame.JSONView.createView(content);
if (this._currentSelectedNode !== selectedNode)
return;
- if (parsedJSON)
- this._splitWidget.setSidebarWidget(SourceFrame.JSONView.createSearchableView(parsedJSON));
+ if (jsonView)
+ this._splitWidget.setSidebarWidget(jsonView);
else
this._splitWidget.setSidebarWidget(new SourceFrame.ResourceSourceFrame(contentProvider));
}
diff --git a/chromium/third_party/WebKit/Source/devtools/front_end/resources/ServiceWorkersView.js b/chromium/third_party/WebKit/Source/devtools/front_end/resources/ServiceWorkersView.js
index 398f4512817..51e4082c046 100644
--- a/chromium/third_party/WebKit/Source/devtools/front_end/resources/ServiceWorkersView.js
+++ b/chromium/third_party/WebKit/Source/devtools/front_end/resources/ServiceWorkersView.js
@@ -33,7 +33,6 @@ Resources.ServiceWorkersView = class extends UI.VBox {
this._otherSWFilter.setAttribute('tabindex', 0);
this._otherSWFilter.setAttribute('role', 'switch');
this._otherSWFilter.setAttribute('aria-checked', false);
- this._otherSWFilter.addEventListener('click', () => this._toggleFilter());
this._otherSWFilter.addEventListener('keydown', event => {
if (isEnterKey(event) || event.keyCode === UI.KeyboardShortcut.Keys.Space.code)
this._toggleFilter();
@@ -41,6 +40,7 @@ Resources.ServiceWorkersView = class extends UI.VBox {
var filterLabel = this._otherSWFilter.createChild('label', 'service-worker-filter-label');
filterLabel.textContent = Common.UIString('Service workers from other domains');
filterLabel.setAttribute('for', 'expand-all');
+ filterLabel.addEventListener('click', () => this._toggleFilter());
var toolbar = new UI.Toolbar('service-worker-filter-toolbar', this._otherSWFilter);
this._filter = new UI.ToolbarInput('Filter', 1);
diff --git a/chromium/third_party/WebKit/Source/devtools/front_end/source_frame/JSONView.js b/chromium/third_party/WebKit/Source/devtools/front_end/source_frame/JSONView.js
index ca736d2320b..11fb04a21d8 100644
--- a/chromium/third_party/WebKit/Source/devtools/front_end/source_frame/JSONView.js
+++ b/chromium/third_party/WebKit/Source/devtools/front_end/source_frame/JSONView.js
@@ -29,7 +29,6 @@
*/
/**
* @implements {UI.Searchable}
- * @unrestricted
*/
SourceFrame.JSONView = class extends UI.VBox {
/**
@@ -37,6 +36,7 @@ SourceFrame.JSONView = class extends UI.VBox {
*/
constructor(parsedJSON) {
super();
+ this._initialized = false;
this.registerRequiredCSS('source_frame/jsonView.css');
this._parsedJSON = parsedJSON;
this.element.classList.add('json-view');
@@ -54,10 +54,15 @@ SourceFrame.JSONView = class extends UI.VBox {
}
/**
- * @param {!SourceFrame.ParsedJSON} parsedJSON
- * @return {!UI.SearchableView}
+ * @param {string} content
+ * @return {!Promise<?SourceFrame.JSONView>}
*/
- static createSearchableView(parsedJSON) {
+ static async createView(content) {
+ // We support non-strict JSON parsing by parsing an AST tree which is why we offload it to a worker.
+ var parsedJSON = await SourceFrame.JSONView._parseJSON(content);
+ if (!parsedJSON || typeof parsedJSON.data !== 'object')
+ return null;
+
var jsonView = new SourceFrame.JSONView(parsedJSON);
var searchableView = new UI.SearchableView(jsonView);
searchableView.setPlaceholder(Common.UIString('Find'));
@@ -71,7 +76,7 @@ SourceFrame.JSONView = class extends UI.VBox {
* @param {?string} text
* @return {!Promise<?SourceFrame.ParsedJSON>}
*/
- static parseJSON(text) {
+ static _parseJSON(text) {
var returnObj = null;
if (text)
returnObj = SourceFrame.JSONView._extractJSON(/** @type {string} */ (text));
diff --git a/chromium/third_party/WebKit/Source/devtools/front_end/source_frame/PreviewFactory.js b/chromium/third_party/WebKit/Source/devtools/front_end/source_frame/PreviewFactory.js
index bdf311ae2af..db35df48c87 100644
--- a/chromium/third_party/WebKit/Source/devtools/front_end/source_frame/PreviewFactory.js
+++ b/chromium/third_party/WebKit/Source/devtools/front_end/source_frame/PreviewFactory.js
@@ -28,10 +28,9 @@ SourceFrame.PreviewFactory = class {
if (parsedXML)
return SourceFrame.XMLView.createSearchableView(parsedXML);
- // We support non-strict JSON parsing by parsing an AST tree which is why we offload it to a worker.
- var parsedJSON = await SourceFrame.JSONView.parseJSON(content);
- if (parsedJSON && typeof parsedJSON.data === 'object')
- return SourceFrame.JSONView.createSearchableView(/** @type {!SourceFrame.ParsedJSON} */ (parsedJSON));
+ var jsonView = await SourceFrame.JSONView.createView(content);
+ if (jsonView)
+ return jsonView;
if (resourceType.isTextType()) {
var highlighterType = mimeType.replace(/;.*/, ''); // remove charset
diff --git a/chromium/third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp b/chromium/third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp
index ef3066752eb..f0a2d18901c 100644
--- a/chromium/third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp
+++ b/chromium/third_party/WebKit/Source/modules/accessibility/AXLayoutObject.cpp
@@ -713,8 +713,12 @@ bool AXLayoutObject::ComputeAccessibilityIsIgnored(
if (IsGenericFocusableElement() && node->hasChildren())
return false;
+ // Positioned elements and scrollable containers are important for
+ // determining bounding boxes.
if (IsScrollableContainer())
return false;
+ if (layout_object_->IsPositioned())
+ return false;
// Ignore layout objects that are block flows with inline children. These
// are usually dummy layout objects that pad out the tree, but there are
diff --git a/chromium/third_party/WebKit/Source/modules/accessibility/AXTableCell.cpp b/chromium/third_party/WebKit/Source/modules/accessibility/AXTableCell.cpp
index 013623b8d1b..a28e3b5fbd1 100644
--- a/chromium/third_party/WebKit/Source/modules/accessibility/AXTableCell.cpp
+++ b/chromium/third_party/WebKit/Source/modules/accessibility/AXTableCell.cpp
@@ -158,6 +158,14 @@ AccessibilityRole AXTableCell::ScanToDecideHeaderRole() {
if (IsColumnHeaderCell())
return kColumnHeaderRole;
+ // This occurs in an edge case that mixes non-table CSS into a
+ // table, and <th role="gridcell">, see bug 798410.
+ // The odd CSS causes the <th> to not be a LayoutTableCell,
+ // and the ARIA role causes it to fall through to here, because
+ // it is not an ARIA/HTML column/row header.
+ if (!layout_object_ || !layout_object_->IsTableCell())
+ return kCellRole; // <th role="gridcell">.
+
// Check the previous cell and the next cell on the same row.
LayoutTableCell* layout_cell = ToLayoutTableCell(layout_object_);
AccessibilityRole header_role = kCellRole;
diff --git a/chromium/third_party/WebKit/Source/modules/canvas/canvas2d/CanvasRenderingContext2DTest.cpp b/chromium/third_party/WebKit/Source/modules/canvas/canvas2d/CanvasRenderingContext2DTest.cpp
index 860774d7c8d..45ea58ee71c 100644
--- a/chromium/third_party/WebKit/Source/modules/canvas/canvas2d/CanvasRenderingContext2DTest.cpp
+++ b/chromium/third_party/WebKit/Source/modules/canvas/canvas2d/CanvasRenderingContext2DTest.cpp
@@ -1137,7 +1137,7 @@ TEST_F(CanvasRenderingContext2DTestWithTestingPlatform,
// Force hibernatation to occur in an immediate task.
bridge->DontUseIdleSchedulingForTesting();
CanvasElement().CreateImageBufferUsingSurfaceForTesting(std::move(bridge),
- size, false);
+ size);
EXPECT_TRUE(CanvasElement().Canvas2DBuffer()->IsAccelerated());
diff --git a/chromium/third_party/WebKit/Source/platform/DEPS b/chromium/third_party/WebKit/Source/platform/DEPS
index be636d6281c..b652b2d6534 100644
--- a/chromium/third_party/WebKit/Source/platform/DEPS
+++ b/chromium/third_party/WebKit/Source/platform/DEPS
@@ -35,6 +35,7 @@ include_rules = [
"+base/trace_event",
"+base/values.h",
"+base/lazy_instance.h",
+ "+net/base/escape.h",
"+net/http/http_util.h",
"+net/http/http_request_headers.h",
"+net/http/http_response_headers.h",
diff --git a/chromium/third_party/WebKit/Source/platform/exported/WebClipboardImpl.cpp b/chromium/third_party/WebKit/Source/platform/exported/WebClipboardImpl.cpp
index 7532f739156..6a582d78ffb 100644
--- a/chromium/third_party/WebKit/Source/platform/exported/WebClipboardImpl.cpp
+++ b/chromium/third_party/WebKit/Source/platform/exported/WebClipboardImpl.cpp
@@ -6,9 +6,11 @@
#include "build/build_config.h"
#include "mojo/public/cpp/system/platform_handle.h"
+#include "net/base/escape.h"
#include "public/platform/Platform.h"
#include "services/service_manager/public/cpp/connector.h"
#include "third_party/WebKit/Source/platform/clipboard/ClipboardMimeTypes.h"
+#include "third_party/WebKit/Source/platform/wtf/text/StringUTF8Adaptor.h"
#include "third_party/WebKit/public/platform/WebDragData.h"
#include "third_party/WebKit/public/platform/WebImage.h"
#include "third_party/WebKit/public/platform/WebSize.h"
@@ -52,16 +54,21 @@ DragData BuildDragData(const WebDragData& web_drag_data) {
};
#if !defined(OS_MACOSX)
+String EscapeForHTML(const String& str) {
+ std::string output =
+ net::EscapeForHTML(StringUTF8Adaptor(str).AsStringPiece());
+ return String(output.c_str());
+}
// TODO(slangley): crbug.com/775830 Remove the implementation of
// URLToImageMarkup from clipboard_utils.h once we can delete
// MockWebClipboardImpl.
WTF::String URLToImageMarkup(const WebURL& url, const WTF::String& title) {
WTF::String markup("<img src=\"");
- markup.append(EncodeWithURLEscapeSequences(url.GetString()));
+ markup.append(EscapeForHTML(url.GetString()));
markup.append("\"");
if (!title.IsEmpty()) {
markup.append(" alt=\"");
- markup.append(EncodeWithURLEscapeSequences(title));
+ markup.append(EscapeForHTML(title));
markup.append("\"");
}
markup.append("/>");
diff --git a/chromium/third_party/WebKit/Source/platform/fonts/shaping/ShapeResultBloberizer.cpp b/chromium/third_party/WebKit/Source/platform/fonts/shaping/ShapeResultBloberizer.cpp
index 0fb0f70e2d5..5649a47b11f 100644
--- a/chromium/third_party/WebKit/Source/platform/fonts/shaping/ShapeResultBloberizer.cpp
+++ b/chromium/third_party/WebKit/Source/platform/fonts/shaping/ShapeResultBloberizer.cpp
@@ -170,7 +170,6 @@ inline bool IsSkipInkException(const ShapeResultBloberizer& bloberizer,
// We want to skip descenders in general, but it is undesirable renderings for
// CJK characters.
return bloberizer.GetType() == ShapeResultBloberizer::Type::kTextIntercepts &&
- !text.Is8Bit() &&
!Character::CanTextDecorationSkipInk(
text.CodepointAt(character_index));
}
diff --git a/chromium/third_party/WebKit/Source/platform/graphics/CanvasResource.cpp b/chromium/third_party/WebKit/Source/platform/graphics/CanvasResource.cpp
index 418e296da4d..fef5cef0cc4 100644
--- a/chromium/third_party/WebKit/Source/platform/graphics/CanvasResource.cpp
+++ b/chromium/third_party/WebKit/Source/platform/graphics/CanvasResource.cpp
@@ -128,13 +128,9 @@ bool CanvasResource_Bitmap::IsValid() const {
void CanvasResource_Bitmap::TearDown() {
WaitSyncTokenBeforeRelease();
- auto gl = ContextGL();
- if (gl && HasGpuMailbox()) {
- DCHECK(image_->IsTextureBacked());
- // To avoid leaking Mailbox records, we must disassociate the mailbox
- // before image_ goes out of scope because skia might recycle the texture.
- gl->ProduceTextureDirectCHROMIUM(0, GetOrCreateGpuMailbox().name);
- }
+ // We must not disassociate the mailbox from the texture object here because
+ // the texture may be recycled by skia and the associated cached mailbox
+ // stored by GraphicsContext3DUtils.cpp must remain valid.
image_ = nullptr;
}
diff --git a/chromium/third_party/WebKit/Source/platform/graphics/CanvasResourceProvider.cpp b/chromium/third_party/WebKit/Source/platform/graphics/CanvasResourceProvider.cpp
index 6fb2bd3710d..7e97c858136 100644
--- a/chromium/third_party/WebKit/Source/platform/graphics/CanvasResourceProvider.cpp
+++ b/chromium/third_party/WebKit/Source/platform/graphics/CanvasResourceProvider.cpp
@@ -8,6 +8,7 @@
#include "gpu/GLES2/gl2extchromium.h"
#include "gpu/command_buffer/common/capabilities.h"
#include "gpu/command_buffer/common/gpu_memory_buffer_support.h"
+#include "platform/graphics/AcceleratedStaticBitmapImage.h"
#include "platform/graphics/CanvasResource.h"
#include "platform/graphics/StaticBitmapImage.h"
#include "platform/graphics/gpu/SharedGpuContext.h"
@@ -65,6 +66,14 @@ class CanvasResourceProvider_Texture : public CanvasResourceProvider {
->ContextProvider()
->GetCapabilities()
.disable_2d_canvas_copy_on_write) {
+ // A readback operation may alter the texture parameters, which may affect
+ // the compositor's behavior. Therefore, we must trigger copy-on-write
+ // even though we are not technically writing to the texture, only to its
+ // parameters.
+ // If this issue with readback affecting state is ever fixed, then we'll
+ // have to do this instead of triggering a copy-on-write:
+ // static_cast<AcceleratedStaticBitmapImage*>(image.get())
+ // ->RetainOriginalSkImageForCopyOnWrite();
GetSkSurface()->notifyContentWillChange(
SkSurface::kRetain_ContentChangeMode);
}
@@ -330,16 +339,8 @@ scoped_refptr<StaticBitmapImage> CanvasResourceProvider::Snapshot() {
scoped_refptr<StaticBitmapImage> image = StaticBitmapImage::Create(
GetSkSurface()->makeImageSnapshot(), ContextProviderWrapper());
if (IsAccelerated()) {
- // A readback operation may alter the texture parameters, which may affect
- // the compositor's behavior. Therefore, we must trigger copy-on-write
- // even though we are not technically writing to the texture, only to its
- // parameters.
- // If this issue with readback affecting state is ever fixed, then we'll
- // have to do this instead of triggering a copy-on-write:
- // static_cast<AcceleratedStaticBitmapImage*>(image.get())
- // ->RetainOriginalSkImageForCopyOnWrite();
- GetSkSurface()->notifyContentWillChange(
- SkSurface::kRetain_ContentChangeMode);
+ static_cast<AcceleratedStaticBitmapImage*>(image.get())
+ ->RetainOriginalSkImageForCopyOnWrite();
}
return image;
}
diff --git a/chromium/third_party/WebKit/Source/platform/graphics/CanvasResourceTest.cpp b/chromium/third_party/WebKit/Source/platform/graphics/CanvasResourceTest.cpp
index ae0d477a458..061afca7d10 100644
--- a/chromium/third_party/WebKit/Source/platform/graphics/CanvasResourceTest.cpp
+++ b/chromium/third_party/WebKit/Source/platform/graphics/CanvasResourceTest.cpp
@@ -105,10 +105,20 @@ TEST_F(CanvasResourceTest, SkiaResourceNoMailboxLeak) {
::testing::Mock::VerifyAndClearExpectations(&gl_);
// No expected call to DeleteTextures becaus skia recycles
+ // No expected call to ProduceTextureDirectCHROMIUM(0, *) because
+ // mailbox is cached by GraphicsContext3DUtils and therefore does not need to
+ // be orphaned.
+ EXPECT_CALL(gl_, ProduceTextureDirectCHROMIUM(0, _)).Times(0);
+ resource = nullptr;
+
+ ::testing::Mock::VerifyAndClearExpectations(&gl_);
+
+ // Purging skia's resource cache will finally delete the GrTexture, resulting
+ // in the mailbox being orphaned via ProduceTextureDirectCHROMIUM.
EXPECT_CALL(gl_,
ProduceTextureDirectCHROMIUM(0, Pointee(test_mailbox.name[0])))
- .Times(1);
- resource = nullptr;
+ .Times(0);
+ GetGrContext()->performDeferredCleanup(std::chrono::milliseconds(0));
::testing::Mock::VerifyAndClearExpectations(&gl_);
}
diff --git a/chromium/third_party/WebKit/Source/platform/graphics/Image.cpp b/chromium/third_party/WebKit/Source/platform/graphics/Image.cpp
index 72bb1e4dd34..0a27d58ad09 100644
--- a/chromium/third_party/WebKit/Source/platform/graphics/Image.cpp
+++ b/chromium/third_party/WebKit/Source/platform/graphics/Image.cpp
@@ -128,6 +128,9 @@ void Image::DrawTiledBackground(GraphicsContext& ctxt,
const FloatSize& scaled_tile_size,
SkBlendMode op,
const FloatSize& repeat_spacing) {
+ if (scaled_tile_size.IsEmpty())
+ return;
+
FloatSize intrinsic_tile_size(Size());
if (HasRelativeSize()) {
intrinsic_tile_size.SetWidth(scaled_tile_size.Width());
diff --git a/chromium/third_party/WebKit/Source/platform/image-decoders/png/PNGImageReader.cpp b/chromium/third_party/WebKit/Source/platform/image-decoders/png/PNGImageReader.cpp
index 93d7b82f80b..6fe439ecccd 100644
--- a/chromium/third_party/WebKit/Source/platform/image-decoders/png/PNGImageReader.cpp
+++ b/chromium/third_party/WebKit/Source/platform/image-decoders/png/PNGImageReader.cpp
@@ -97,6 +97,9 @@ PNGImageReader::PNGImageReader(PNGImageDecoder* decoder, size_t initial_offset)
info_ = png_create_info_struct(png_);
png_set_progressive_read_fn(png_, decoder_, nullptr, pngRowAvailable,
pngFrameComplete);
+ // This setting ensures that we display images with incorrect CMF bytes.
+ // See crbug.com/807324.
+ png_set_option(png_, PNG_MAXIMUM_INFLATE_WINDOW, PNG_OPTION_ON);
}
PNGImageReader::~PNGImageReader() {
diff --git a/chromium/third_party/WebKit/Source/platform/image-decoders/png/PNGImageReader.h b/chromium/third_party/WebKit/Source/platform/image-decoders/png/PNGImageReader.h
index c33851de37e..2dd2e32113d 100644
--- a/chromium/third_party/WebKit/Source/platform/image-decoders/png/PNGImageReader.h
+++ b/chromium/third_party/WebKit/Source/platform/image-decoders/png/PNGImageReader.h
@@ -33,6 +33,8 @@
#include "platform/wtf/Allocator.h"
#include "platform/wtf/PtrUtil.h"
#include "platform/wtf/Vector.h"
+
+#define PNG_SET_OPTION_SUPPORTED
#include "png.h"
#if !defined(PNG_LIBPNG_VER_MAJOR) || !defined(PNG_LIBPNG_VER_MINOR)
diff --git a/chromium/third_party/WebKit/Source/platform/loader/fetch/Resource.cpp b/chromium/third_party/WebKit/Source/platform/loader/fetch/Resource.cpp
index ef8db73bcfc..d7dec3cf8c0 100644
--- a/chromium/third_party/WebKit/Source/platform/loader/fetch/Resource.cpp
+++ b/chromium/third_party/WebKit/Source/platform/loader/fetch/Resource.cpp
@@ -36,6 +36,7 @@
#include "platform/SharedBuffer.h"
#include "platform/WebTaskRunner.h"
#include "platform/instrumentation/tracing/TraceEvent.h"
+#include "platform/loader/cors/CORS.h"
#include "platform/loader/fetch/CachedMetadata.h"
#include "platform/loader/fetch/FetchParameters.h"
#include "platform/loader/fetch/IntegrityMetadata.h"
@@ -453,6 +454,16 @@ AtomicString Resource::HttpContentType() const {
return GetResponse().HttpContentType();
}
+bool Resource::PassesAccessControlCheck(
+ const SecurityOrigin& security_origin) const {
+ WTF::Optional<network::mojom::CORSError> cors_error = CORS::CheckAccess(
+ GetResponse().Url(), GetResponse().HttpStatusCode(),
+ GetResponse().HttpHeaderFields(),
+ LastResourceRequest().GetFetchCredentialsMode(), security_origin);
+
+ return !cors_error;
+}
+
bool Resource::MustRefetchDueToIntegrityMetadata(
const FetchParameters& params) const {
if (params.IntegrityMetadata().IsEmpty())
diff --git a/chromium/third_party/WebKit/Source/platform/loader/fetch/Resource.h b/chromium/third_party/WebKit/Source/platform/loader/fetch/Resource.h
index 9f71669649c..dbdabbca76a 100644
--- a/chromium/third_party/WebKit/Source/platform/loader/fetch/Resource.h
+++ b/chromium/third_party/WebKit/Source/platform/loader/fetch/Resource.h
@@ -208,6 +208,8 @@ class PLATFORM_EXPORT Resource : public GarbageCollectedFinalized<Resource>,
virtual void Finish(double finish_time, WebTaskRunner*);
void FinishForTest() { Finish(0.0, nullptr); }
+ bool PassesAccessControlCheck(const SecurityOrigin&) const;
+
virtual scoped_refptr<const SharedBuffer> ResourceBuffer() const {
return data_;
}
diff --git a/chromium/third_party/WebKit/Source/platform/runtime_enabled_features.json5 b/chromium/third_party/WebKit/Source/platform/runtime_enabled_features.json5
index f82f29a3714..721a79ae888 100644
--- a/chromium/third_party/WebKit/Source/platform/runtime_enabled_features.json5
+++ b/chromium/third_party/WebKit/Source/platform/runtime_enabled_features.json5
@@ -211,6 +211,7 @@
{
name: "CSSAdditiveAnimations",
depends_on: ["StackedCSSPropertyAnimations"],
+ settable_from_internals: true,
status: "experimental",
},
{
@@ -397,18 +398,21 @@
},
{
name: "FeaturePolicyAutoplayFeature",
- status: "stable"
+ status: "stable",
+ depends_on: ["FeaturePolicy"]
},
{
name: "FeaturePolicyExperimentalFeatures",
},
{
name: "FeaturePolicyForPermissions",
- status: "stable"
+ status: "stable",
+ depends_on: ["FeaturePolicy"]
},
{
name: "FeaturePolicyJavaScriptInterface",
- status: "experimental"
+ status: "experimental",
+ depends_on: ["FeaturePolicy"]
},
{
name: "FetchRequestCache",
@@ -450,7 +454,7 @@
{
name: "FramebustingNeedsSameOriginOrUserGesture",
settable_from_internals: true,
- status: "stable",
+ status: "experimental",
},
{
name: "FramesTimingFunction",
@@ -1125,6 +1129,7 @@
},
{
name: "WebAnimationsAPI",
+ settable_from_internals: true,
status: "experimental",
},
{
diff --git a/chromium/third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl.cc b/chromium/third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl.cc
index 97c6844e047..e92f5a2a1c6 100644
--- a/chromium/third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl.cc
+++ b/chromium/third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl.cc
@@ -364,6 +364,11 @@ RendererSchedulerImpl::MainThreadOnly::MainThreadOnly(
renderer_scheduler_impl,
&renderer_scheduler_impl->tracing_controller_,
BackgroundStateToString),
+ keep_active_fetch_or_worker(false,
+ "RendererScheduler.RendererKeepAactive",
+ renderer_scheduler_impl,
+ &renderer_scheduler_impl->tracing_controller_,
+ YesNoStateToString),
stopping_when_backgrounded_enabled(
false,
"RendererScheduler.StoppingWhenBackgroundedEnabled",
@@ -910,6 +915,13 @@ void RendererSchedulerImpl::SetRendererBackgrounded(bool backgrounded) {
}
}
+void RendererSchedulerImpl::SetSchedulerKeepActive(bool keep_active) {
+ if (main_thread_only().keep_active_fetch_or_worker == keep_active)
+ return;
+ main_thread_only().keep_active_fetch_or_worker = keep_active;
+ UpdatePolicy();
+}
+
#if defined(OS_ANDROID)
void RendererSchedulerImpl::PauseTimersForAndroidWebView() {
main_thread_only().pause_timers_for_webview = true;
@@ -1347,7 +1359,8 @@ void RendererSchedulerImpl::UpdatePolicyLocked(UpdateType update_type) {
main_thread_only().stopped_when_backgrounded;
bool newly_stopped = false;
if (main_thread_only().renderer_backgrounded &&
- main_thread_only().stopping_when_backgrounded_enabled) {
+ main_thread_only().stopping_when_backgrounded_enabled &&
+ !main_thread_only().keep_active_fetch_or_worker) {
base::TimeTicks stop_at = main_thread_only().background_status_changed_at +
delay_for_background_tab_stopping_;
@@ -2010,6 +2023,8 @@ RendererSchedulerImpl::AsValueLocked(base::TimeTicks optional_now) const {
main_thread_only().have_reported_blocking_intervention_since_navigation);
state->SetBoolean("renderer_backgrounded",
main_thread_only().renderer_backgrounded);
+ state->SetBoolean("keep_active_fetch_or_worker",
+ main_thread_only().keep_active_fetch_or_worker);
state->SetBoolean("stopped_when_backgrounded",
main_thread_only().stopped_when_backgrounded);
state->SetDouble("now", (optional_now - base::TimeTicks()).InMillisecondsF());
diff --git a/chromium/third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl.h b/chromium/third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl.h
index 67cdaa35256..b6164bfa66d 100644
--- a/chromium/third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl.h
+++ b/chromium/third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl.h
@@ -137,6 +137,7 @@ class PLATFORM_EXPORT RendererSchedulerImpl
void DidAnimateForInputOnCompositorThread() override;
void SetRendererHidden(bool hidden) override;
void SetRendererBackgrounded(bool backgrounded) override;
+ void SetSchedulerKeepActive(bool keep_active) override;
#if defined(OS_ANDROID)
void PauseTimersForAndroidWebView();
void ResumeTimersForAndroidWebView();
@@ -663,6 +664,8 @@ class PLATFORM_EXPORT RendererSchedulerImpl
rail_mode_for_tracing; // Don't use except for tracing.
TraceableState<bool, kTracingCategoryNameDebug> renderer_hidden;
TraceableState<bool, kTracingCategoryNameDefault> renderer_backgrounded;
+ TraceableState<bool, kTracingCategoryNameDefault>
+ keep_active_fetch_or_worker;
TraceableState<bool, kTracingCategoryNameInfo>
stopping_when_backgrounded_enabled;
TraceableState<bool, kTracingCategoryNameInfo>
diff --git a/chromium/third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl_unittest.cc b/chromium/third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl_unittest.cc
index ed766279947..b1f55d3f53d 100644
--- a/chromium/third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl_unittest.cc
+++ b/chromium/third_party/WebKit/Source/platform/scheduler/renderer/renderer_scheduler_impl_unittest.cc
@@ -2612,6 +2612,72 @@ TEST_F(RendererSchedulerImplTest, TestRendererBackgroundedLoadingSuspension) {
EXPECT_THAT(run_order, ::testing::ElementsAre(std::string("L6")));
}
+TEST_F(RendererSchedulerImplTest, TestRendererBackgroundedRendererKeepActive) {
+ ScopedStopLoadingInBackgroundForTest stop_loading_enabler(true);
+ scheduler_->SetStoppingWhenBackgroundedEnabled(true);
+ scheduler_->SetSchedulerKeepActive(true);
+ std::vector<std::string> run_order;
+ PostTestTasks(&run_order, "L1 T1");
+
+ base::TimeTicks now;
+
+ // Keep-alive should prevent suspension of task queues.
+ // Though this has no effect until requisite time has elapsed.
+ scheduler_->SetRendererBackgrounded(true);
+ now += base::TimeDelta::FromMilliseconds(1100);
+ clock_.SetNowTicks(now);
+ RunUntilIdle();
+ EXPECT_THAT(run_order,
+ ::testing::ElementsAre(std::string("L1"), std::string("T1")));
+
+ run_order.clear();
+ PostTestTasks(&run_order, "L2 T2");
+
+ now += base::TimeDelta::FromSeconds(1);
+ clock_.SetNowTicks(now);
+ RunUntilIdle();
+ EXPECT_THAT(run_order,
+ ::testing::ElementsAre(std::string("L2"), std::string("T2")));
+
+ // Advance the time until after the scheduled timer queue suspension.
+ now = base::TimeTicks() + delay_for_background_tab_stopping() +
+ base::TimeDelta::FromMilliseconds(10);
+ run_order.clear();
+ clock_.SetNowTicks(now);
+ RunUntilIdle();
+ ASSERT_TRUE(run_order.empty());
+
+ // Keep-alive signal prevents suspension of task queues.
+ PostTestTasks(&run_order, "L3 T3 V1");
+ now += base::TimeDelta::FromSeconds(10);
+ clock_.SetNowTicks(now);
+ RunUntilIdle();
+ EXPECT_THAT(run_order,
+ ::testing::ElementsAre(std::string("L3"), std::string("T3"),
+ std::string("V1")));
+
+ run_order.clear();
+ clock_.SetNowTicks(now);
+ RunUntilIdle();
+ ASSERT_TRUE(run_order.empty());
+
+ // Setting Keep-alive to false triggers task queue suspension.
+ scheduler_->SetSchedulerKeepActive(false);
+ PostTestTasks(&run_order, "L4 T4");
+ now += base::TimeDelta::FromSeconds(10);
+ clock_.SetNowTicks(now);
+ RunUntilIdle();
+ ASSERT_TRUE(run_order.empty());
+
+ // Setting Keep-alive to true, undoes suspension.
+ scheduler_->SetSchedulerKeepActive(true);
+ now += base::TimeDelta::FromSeconds(10);
+ clock_.SetNowTicks(now);
+ RunUntilIdle();
+ EXPECT_THAT(run_order,
+ ::testing::ElementsAre(std::string("L4"), std::string("T4")));
+}
+
TEST_F(RendererSchedulerImplTest,
ExpensiveLoadingTasksNotBlockedTillFirstBeginMainFrame) {
std::vector<std::string> run_order;
diff --git a/chromium/third_party/WebKit/Source/platform/text/Character.cpp b/chromium/third_party/WebKit/Source/platform/text/Character.cpp
index ec7766a1eb3..aa971ab61f5 100644
--- a/chromium/third_party/WebKit/Source/platform/text/Character.cpp
+++ b/chromium/third_party/WebKit/Source/platform/text/Character.cpp
@@ -208,6 +208,10 @@ unsigned Character::ExpansionOpportunityCount(const UChar* characters,
}
bool Character::CanTextDecorationSkipInk(UChar32 codepoint) {
+ if (codepoint == kSolidusCharacter || codepoint == kReverseSolidusCharacter ||
+ codepoint == kLowLineCharacter)
+ return false;
+
if (Character::IsCJKIdeographOrSymbol(codepoint))
return false;
diff --git a/chromium/third_party/WebKit/Source/platform/wtf/text/CharacterNames.h b/chromium/third_party/WebKit/Source/platform/wtf/text/CharacterNames.h
index 7c1fe77ec03..fb449cc8e19 100644
--- a/chromium/third_party/WebKit/Source/platform/wtf/text/CharacterNames.h
+++ b/chromium/third_party/WebKit/Source/platform/wtf/text/CharacterNames.h
@@ -103,6 +103,7 @@ const UChar kPopDirectionalFormattingCharacter = 0x202C;
const UChar kPopDirectionalIsolateCharacter = 0x2069;
const UChar32 kRainbowCharacter = 0x1F308;
const UChar kReplacementCharacter = 0xFFFD;
+const UChar kReverseSolidusCharacter = 0x005C;
const UChar kRightDoubleQuotationMarkCharacter = 0x201D;
const UChar kRightSingleQuotationMarkCharacter = 0x2019;
const UChar kRightToLeftEmbedCharacter = 0x202B;
@@ -111,6 +112,7 @@ const UChar kRightToLeftMarkCharacter = 0x200F;
const UChar kRightToLeftOverrideCharacter = 0x202E;
const UChar kSesameDotCharacter = 0xFE45;
const UChar kSmallLetterSharpSCharacter = 0x00DF;
+const UChar kSolidusCharacter = 0x002F;
const UChar kSoftHyphenCharacter = 0x00AD;
const UChar kSpaceCharacter = 0x0020;
const UChar kStaffOfAesculapiusCharacter = 0x2695;
@@ -198,6 +200,7 @@ using WTF::Unicode::kPopDirectionalFormattingCharacter;
using WTF::Unicode::kPopDirectionalIsolateCharacter;
using WTF::Unicode::kRainbowCharacter;
using WTF::Unicode::kReplacementCharacter;
+using WTF::Unicode::kReverseSolidusCharacter;
using WTF::Unicode::kRightDoubleQuotationMarkCharacter;
using WTF::Unicode::kRightSingleQuotationMarkCharacter;
using WTF::Unicode::kRightToLeftEmbedCharacter;
@@ -207,6 +210,7 @@ using WTF::Unicode::kRightToLeftOverrideCharacter;
using WTF::Unicode::kSesameDotCharacter;
using WTF::Unicode::kSmallLetterSharpSCharacter;
using WTF::Unicode::kSoftHyphenCharacter;
+using WTF::Unicode::kSolidusCharacter;
using WTF::Unicode::kSpaceCharacter;
using WTF::Unicode::kStaffOfAesculapiusCharacter;
using WTF::Unicode::kTabulationCharacter;
diff --git a/chromium/third_party/WebKit/public/platform/scheduler/renderer/renderer_scheduler.h b/chromium/third_party/WebKit/public/platform/scheduler/renderer/renderer_scheduler.h
index 4bf0d7927cb..0d4a700ce03 100644
--- a/chromium/third_party/WebKit/public/platform/scheduler/renderer/renderer_scheduler.h
+++ b/chromium/third_party/WebKit/public/platform/scheduler/renderer/renderer_scheduler.h
@@ -128,6 +128,11 @@ class BLINK_PLATFORM_EXPORT RendererScheduler : public ChildScheduler {
// constructed. Must be called on the main thread.
virtual void SetRendererBackgrounded(bool backgrounded) = 0;
+ // Tells the scheduler about "keep-alive" state which can be due to:
+ // service workers, shared workers, or fetch keep-alive.
+ // If set to true, then the scheduler should not freeze the renderer.
+ virtual void SetSchedulerKeepActive(bool keep_active) = 0;
+
#if defined(OS_ANDROID)
// Android WebView has very strange WebView.pauseTimers/resumeTimers API.
// It's very old and very inconsistent. The API promises that this
diff --git a/chromium/third_party/WebKit/public/web/WebRemoteFrameClient.h b/chromium/third_party/WebKit/public/web/WebRemoteFrameClient.h
index 79b87a9575d..326a6b6b074 100644
--- a/chromium/third_party/WebKit/public/web/WebRemoteFrameClient.h
+++ b/chromium/third_party/WebKit/public/web/WebRemoteFrameClient.h
@@ -36,7 +36,8 @@ class WebRemoteFrameClient {
bool should_replace_current_entry) {}
virtual void Reload(WebFrameLoadType, ClientRedirectPolicy) {}
- virtual void FrameRectsChanged(const WebRect&) {}
+ virtual void FrameRectsChanged(const WebRect& local_frame_rect,
+ const WebRect& screen_space_rect) {}
virtual void UpdateRemoteViewportIntersection(
const WebRect& viewport_intersection) {}
diff --git a/chromium/third_party/WebKit/public/web/devtools_agent.mojom b/chromium/third_party/WebKit/public/web/devtools_agent.mojom
index b567e3965d9..ff19cbb1473 100644
--- a/chromium/third_party/WebKit/public/web/devtools_agent.mojom
+++ b/chromium/third_party/WebKit/public/web/devtools_agent.mojom
@@ -63,6 +63,12 @@ interface DevToolsAgent {
// On the other hand, we need to handle some of the messages on IO without
// going to UI first (as described above). This means an interface bound
// on IO thread. Thus a session per thread.
+ //
+ // Note that |io_session| is not associated with DevToolsAgent, and so
+ // there is no ordering guarantee for commands send to |io_session|
+ // relative to anything coming over regular |session|.
+ // For example, |session| may be already detached (interface unbound),
+ // while commands are still coming to |io_session|, and vice versa.
AttachDevToolsSession(associated DevToolsSessionHost host,
associated DevToolsSession& session,
DevToolsSession& io_session,
diff --git a/chromium/third_party/catapult/tracing/trace_viewer.gypi b/chromium/third_party/catapult/tracing/trace_viewer.gypi
index 7040cae504c..4d6b0647134 100644
--- a/chromium/third_party/catapult/tracing/trace_viewer.gypi
+++ b/chromium/third_party/catapult/tracing/trace_viewer.gypi
@@ -213,6 +213,7 @@
'tracing/metrics/system_health/time_to_interactive.html',
'tracing/metrics/system_health/utils.html',
'tracing/metrics/system_health/webview_startup_metric.html',
+ 'tracing/metrics/tabs_metric.html',
'tracing/metrics/tracing_metric.html',
'tracing/metrics/v8/execution_metric.html',
'tracing/metrics/v8/gc_metric.html',
diff --git a/chromium/third_party/libpng/BUILD.gn b/chromium/third_party/libpng/BUILD.gn
index e48c790326c..ebd7bd5acf7 100644
--- a/chromium/third_party/libpng/BUILD.gn
+++ b/chromium/third_party/libpng/BUILD.gn
@@ -62,7 +62,7 @@ source_set("libpng_sources") {
"pngwutil.c",
]
- defines = []
+ defines = [ "PNG_SET_OPTION_SUPPORTED" ]
cflags = []
if (current_cpu == "x86" || current_cpu == "x64") {
diff --git a/chromium/third_party/libxml/README.chromium b/chromium/third_party/libxml/README.chromium
index 8ba967d176d..9305528022a 100644
--- a/chromium/third_party/libxml/README.chromium
+++ b/chromium/third_party/libxml/README.chromium
@@ -1,6 +1,6 @@
Name: libxml
URL: http://xmlsoft.org
-Version: 2677fbf4a4a6dec69ff52265addab713fe48ad1f
+Version: 707ad080e61014ab4a6d60dc12875e233c1f673c
License: MIT
License File: src/Copyright
Security Critical: yes
diff --git a/chromium/third_party/libxml/chromium/chromium-issue-628581.patch b/chromium/third_party/libxml/chromium/chromium-issue-628581.patch
index 42b7c630c96..fb5d2a4fa47 100644
--- a/chromium/third_party/libxml/chromium/chromium-issue-628581.patch
+++ b/chromium/third_party/libxml/chromium/chromium-issue-628581.patch
@@ -71,7 +71,7 @@ index 53a6b7f0c961..e3136123dca6 100644
unsigned long oldnbent = ctxt->nbentities;
xmlChar *rep;
-+ ent->guard = XML_ENTITY_BEING_CHECKED;
++ ent->guard = XML_ENTITY_BEING_CHECKED;
ent->checked = 1;
++ctxt->depth;
@@ -79,10 +79,10 @@ index 53a6b7f0c961..e3136123dca6 100644
XML_SUBSTITUTE_REF, 0, 0, 0);
--ctxt->depth;
+ ent->guard = XML_ENTITY_NOT_BEING_CHECKED;
- if (ctxt->errNo == XML_ERR_ENTITY_LOOP) {
+ if ((rep == NULL) || (ctxt->errNo == XML_ERR_ENTITY_LOOP)) {
ent->content[0] = 0;
}
-@@ -7329,23 +7335,28 @@ xmlParseReference(xmlParserCtxtPtr ctxt) {
+@@ -7105,23 +7111,28 @@ xmlParseReference(xmlParserCtxtPtr ctxt) {
* if its replacement text matches the production labeled
* content.
*/
@@ -128,7 +128,7 @@ index 53a6b7f0c961..e3136123dca6 100644
/*
* Store the number of entities needing parsing for this entity
-@@ -7448,23 +7459,29 @@ xmlParseReference(xmlParserCtxtPtr ctxt) {
+@@ -7229,23 +7240,29 @@ xmlParseReference(xmlParserCtxtPtr ctxt) {
else
user_data = ctxt->userData;
diff --git a/chromium/third_party/libxml/linux/xml2-config b/chromium/third_party/libxml/linux/xml2-config
index 6ed8eb144eb..bb834c64d8d 100755
--- a/chromium/third_party/libxml/linux/xml2-config
+++ b/chromium/third_party/libxml/linux/xml2-config
@@ -86,12 +86,12 @@ while test $# -gt 0; do
then
if [ "-L${libdir}" = "-L/usr/lib" -o "-L${libdir}" = "-L/usr/lib64" ]
then
- echo -lxml2 -L/usr/lib/x86_64-linux-gnu -licui18n -licuuc -licudata -lm
+ echo -lxml2 -licui18n -licuuc -licudata -lm
else
- echo -L${libdir} -lxml2 -L/usr/lib/x86_64-linux-gnu -licui18n -licuuc -licudata -lm
+ echo -L${libdir} -lxml2 -licui18n -licuuc -licudata -lm
fi
else
- echo -L${libdir} -lxml2 -L/usr/lib/x86_64-linux-gnu -licui18n -licuuc -licudata -lm
+ echo -L${libdir} -lxml2 -licui18n -licuuc -licudata -lm
fi
;;
diff --git a/chromium/third_party/libxml/src/HTMLparser.c b/chromium/third_party/libxml/src/HTMLparser.c
index 7e243e600f8..9adeb1748d9 100644
--- a/chromium/third_party/libxml/src/HTMLparser.c
+++ b/chromium/third_party/libxml/src/HTMLparser.c
@@ -3635,7 +3635,7 @@ htmlCheckEncodingDirect(htmlParserCtxtPtr ctxt, const xmlChar *encoding) {
*/
processed = ctxt->input->cur - ctxt->input->base;
xmlBufShrink(ctxt->input->buf->buffer, processed);
- nbchars = xmlCharEncInput(ctxt->input->buf, 1);
+ nbchars = xmlCharEncInput(ctxt->input->buf, 0);
if (nbchars < 0) {
htmlParseErr(ctxt, XML_ERR_INVALID_ENCODING,
"htmlCheckEncoding: encoder error\n",
diff --git a/chromium/third_party/libxml/src/configure.ac b/chromium/third_party/libxml/src/configure.ac
index 988e32e553d..ebfa70221d1 100644
--- a/chromium/third_party/libxml/src/configure.ac
+++ b/chromium/third_party/libxml/src/configure.ac
@@ -769,9 +769,9 @@ else
fi
# warnings we'd like to see
- EXTRA_CFLAGS="${EXTRA_CFLAGS} -pedantic -W -Wformat -Wno-format-extra-args -Wunused -Wimplicit -Wreturn-type -Wswitch -Wcomment -Wtrigraphs -Wchar-subscripts -Wuninitialized -Wparentheses -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wredundant-decls"
+ EXTRA_CFLAGS="${EXTRA_CFLAGS} -pedantic -Wall -Wextra -Wshadow -Wpointer-arith -Wcast-align -Wwrite-strings -Waggregate-return -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Winline -Wredundant-decls"
# warnings we'd like to supress
- EXTRA_CFLAGS="${EXTRA_CFLAGS} -Wno-long-long"
+ EXTRA_CFLAGS="${EXTRA_CFLAGS} -Wno-long-long -Wno-format-extra-args -Wno-array-bounds"
case "${host}" in
alpha*-*-linux* )
EXTRA_CFLAGS="${EXTRA_CFLAGS} -mieee"
diff --git a/chromium/third_party/libxml/src/libxml2.spec b/chromium/third_party/libxml/src/libxml2.spec
index e0d24ffe28d..2b46112a633 100644
--- a/chromium/third_party/libxml/src/libxml2.spec
+++ b/chromium/third_party/libxml/src/libxml2.spec
@@ -203,6 +203,6 @@ rm -fr %{buildroot}
%endif # with_python3
%changelog
-* Wed Dec 13 2017 Daniel Veillard <veillard@redhat.com>
+* Tue Jan 30 2018 Daniel Veillard <veillard@redhat.com>
- upstream release 2.9.7 see http://xmlsoft.org/news.html
diff --git a/chromium/third_party/libxml/src/parser.c b/chromium/third_party/libxml/src/parser.c
index 6a34b270648..072b1293ea5 100644
--- a/chromium/third_party/libxml/src/parser.c
+++ b/chromium/third_party/libxml/src/parser.c
@@ -147,7 +147,7 @@ xmlParserEntityCheck(xmlParserCtxtPtr ctxt, size_t size,
unsigned long oldnbent = ctxt->nbentities;
xmlChar *rep;
- ent->guard = XML_ENTITY_BEING_CHECKED;
+ ent->guard = XML_ENTITY_BEING_CHECKED;
ent->checked = 1;
++ctxt->depth;
@@ -155,7 +155,7 @@ xmlParserEntityCheck(xmlParserCtxtPtr ctxt, size_t size,
XML_SUBSTITUTE_REF, 0, 0, 0);
--ctxt->depth;
ent->guard = XML_ENTITY_NOT_BEING_CHECKED;
- if (ctxt->errNo == XML_ERR_ENTITY_LOOP) {
+ if ((rep == NULL) || (ctxt->errNo == XML_ERR_ENTITY_LOOP)) {
ent->content[0] = 0;
}
@@ -3376,9 +3376,9 @@ xmlParseNCNameComplex(xmlParserCtxtPtr ctxt) {
*/
ctxt->input->cur -= l;
GROW;
- ctxt->input->cur += l;
if (ctxt->instate == XML_PARSER_EOF)
return(NULL);
+ ctxt->input->cur += l;
c = CUR_CHAR(l);
}
}
@@ -7200,6 +7200,8 @@ xmlParseReference(xmlParserCtxtPtr ctxt) {
(ret != XML_WAR_UNDECLARED_ENTITY)) {
xmlFatalErrMsgStr(ctxt, XML_ERR_UNDECLARED_ENTITY,
"Entity '%s' failed to parse\n", ent->name);
+ if (ent->content != NULL)
+ ent->content[0] = 0;
xmlParserEntityCheck(ctxt, 0, ent, 0);
} else if (list != NULL) {
xmlFreeNodeList(list);
@@ -12233,6 +12235,7 @@ xmldecl_done:
/* TODO 2.6.0 */
xmlGenericError(xmlGenericErrorContext,
"xmlParseChunk: encoder error\n");
+ xmlHaltParser(ctxt);
return(XML_ERR_INVALID_ENCODING);
}
xmlBufSetInputBaseCur(in->buffer, ctxt->input, base, current);
@@ -13381,6 +13384,7 @@ xmlParseBalancedChunkMemoryInternal(xmlParserCtxtPtr oldctxt,
ctxt->userData = ctxt;
if (ctxt->dict != NULL) xmlDictFree(ctxt->dict);
ctxt->dict = oldctxt->dict;
+ ctxt->input_id = oldctxt->input_id + 1;
ctxt->str_xml = xmlDictLookup(ctxt->dict, BAD_CAST "xml", 3);
ctxt->str_xmlns = xmlDictLookup(ctxt->dict, BAD_CAST "xmlns", 5);
ctxt->str_xml_ns = xmlDictLookup(ctxt->dict, XML_XML_NAMESPACE, 36);
@@ -13634,6 +13638,7 @@ xmlParseInNodeContext(xmlNodePtr node, const char *data, int datalen,
xmlDetectSAX2(ctxt);
ctxt->myDoc = doc;
/* parsing in context, i.e. as within existing content */
+ ctxt->input_id = 2;
ctxt->instate = XML_PARSER_CONTENT;
fake = xmlNewComment(NULL);
@@ -13846,6 +13851,7 @@ xmlParseBalancedChunkMemoryRecover(xmlDocPtr doc, xmlSAXHandlerPtr sax,
newDoc->oldNs = doc->oldNs;
}
ctxt->instate = XML_PARSER_CONTENT;
+ ctxt->input_id = 2;
ctxt->depth = depth;
/*
@@ -14006,6 +14012,11 @@ xmlCreateEntityParserCtxtInternal(const xmlChar *URL, const xmlChar *ID,
if (pctx != NULL) {
ctxt->options = pctx->options;
ctxt->_private = pctx->_private;
+ /*
+ * this is a subparser of pctx, so the input_id should be
+ * incremented to distinguish from main entity
+ */
+ ctxt->input_id = pctx->input_id + 1;
}
uri = xmlBuildURI(URL, base);
diff --git a/chromium/third_party/libxml/src/parserInternals.c b/chromium/third_party/libxml/src/parserInternals.c
index 9d45e5caa15..cfeb0a2ed60 100644
--- a/chromium/third_party/libxml/src/parserInternals.c
+++ b/chromium/third_party/libxml/src/parserInternals.c
@@ -1214,7 +1214,7 @@ xmlSwitchInputEncodingInt(xmlParserCtxtPtr ctxt, xmlParserInputPtr input,
/*
* convert as much as possible of the buffer
*/
- nbchars = xmlCharEncInput(input->buf, 1);
+ nbchars = xmlCharEncInput(input->buf, 0);
} else {
/*
* convert just enough to get
diff --git a/chromium/third_party/libxml/src/win32/Makefile.msvc b/chromium/third_party/libxml/src/win32/Makefile.msvc
index ff8378e29a9..491dc880128 100644
--- a/chromium/third_party/libxml/src/win32/Makefile.msvc
+++ b/chromium/third_party/libxml/src/win32/Makefile.msvc
@@ -22,6 +22,7 @@ AUTOCONF = .\config.msvc
XML_NAME = xml2
XML_BASENAME = lib$(XML_NAME)
XML_SO = $(XML_BASENAME).dll
+XML_RES = $(XML_BASENAME).res
XML_IMP = $(XML_BASENAME).lib
XML_DEF = $(XML_BASENAME).def
XML_A = $(XML_BASENAME)_a.lib
@@ -69,7 +70,11 @@ LIBS = $(LIBS) wsock32.lib ws2_32.lib
LIBS = $(LIBS) iconv.lib
!endif
!if "$(WITH_ICU)" == "1"
-LIBS = $(LIBS) icu.lib
+!if "$(STATIC)" == "1"
+LIBS = $(LIBS) advapi32.lib sicuuc.lib sicuin.lib sicudt.lib
+!else
+LIBS = $(LIBS) icuuc.lib icuin.lib icudt.lib
+!endif
!endif
!if "$(WITH_ZLIB)" == "1"
# could be named differently zdll or zlib
@@ -256,7 +261,10 @@ UTILS = $(BINDIR)\xmllint.exe\
$(BINDIR)\testXPath.exe\
$(BINDIR)\runtest.exe\
$(BINDIR)\runsuite.exe\
+ $(BINDIR)\runxmlconf.exe\
$(BINDIR)\testapi.exe\
+ $(BINDIR)\testchar.exe\
+ $(BINDIR)\testdict.exe\
$(BINDIR)\testlimits.exe\
$(BINDIR)\testrecurse.exe
@@ -367,11 +375,13 @@ $(XML_OBJS_A_DLL) : $(XML_INTDIR_A_DLL)
# Creates the export definition file (DEF) for libxml.
$(XML_INTDIR)\$(XML_DEF) : $(XML_INTDIR) $(XML_DEF).src
$(CPP) $(CPPFLAGS) $(XML_DEF).src > $(XML_INTDIR)\$(XML_DEF)
+$(XML_INTDIR)\$(XML_RES) : $(XML_INTDIR) libxml2.rc
+ rc -Fo $(XML_INTDIR)\$(XML_RES) libxml2.rc
# Creates the libxml shared object.
-$(BINDIR)\$(XML_SO) : $(BINDIR) $(XML_OBJS) $(XML_INTDIR)\$(XML_DEF)
+$(BINDIR)\$(XML_SO) : $(BINDIR) $(XML_OBJS) $(XML_INTDIR)\$(XML_DEF) $(XML_INTDIR)\$(XML_RES)
$(LD) $(LDFLAGS) /DLL \
- /IMPLIB:$(BINDIR)\$(XML_IMP) /OUT:$(BINDIR)\$(XML_SO) $(XML_OBJS) $(LIBS)
+ /IMPLIB:$(BINDIR)\$(XML_IMP) /OUT:$(BINDIR)\$(XML_SO) $(XML_OBJS) $(XML_INTDIR)\$(XML_RES) $(LIBS)
@$(_VC_MANIFEST_EMBED_DLL)
#$(BINDIR)\$(XML_SO) : $(BINDIR) $(XML_OBJS) $(XML_INTDIR)\$(XML_DEF)
diff --git a/chromium/third_party/libxml/src/win32/configure.js b/chromium/third_party/libxml/src/win32/configure.js
index 92b9ba052c2..dbf238c70c4 100644
--- a/chromium/third_party/libxml/src/win32/configure.js
+++ b/chromium/third_party/libxml/src/win32/configure.js
@@ -280,6 +280,18 @@ function discoverVersion()
vf.WriteLine("DYNRUNTIME=" + (dynruntime? "1" : "0"));
}
vf.Close();
+ versionFile = "rcVersion.h"
+ vf = fso.CreateTextFile(versionFile, true);
+ vf.WriteLine("/*");
+ vf.WriteLine(" " + versionFile);
+ vf.WriteLine(" This file is generated automatically by " + WScript.ScriptName + ".");
+ vf.WriteLine("*/");
+ vf.WriteBlankLines(1);
+ vf.WriteLine("#define LIBXML_MAJOR_VERSION " + verMajor);
+ vf.WriteLine("#define LIBXML_MINOR_VERSION " + verMinor);
+ vf.WriteLine("#define LIBXML_MICRO_VERSION " + verMicro);
+ vf.WriteLine("#define LIBXML_DOTTED_VERSION " + "\"" + verMajor + "." + verMinor + "." + verMicro + "\"");
+ vf.Close()
}
/* Configures libxml. This one will generate xmlversion.h from xmlversion.h.in
diff --git a/chromium/third_party/libxml/src/win32/libxml2.rc b/chromium/third_party/libxml/src/win32/libxml2.rc
new file mode 100644
index 00000000000..c774a5ee5a9
--- /dev/null
+++ b/chromium/third_party/libxml/src/win32/libxml2.rc
@@ -0,0 +1,36 @@
+#include <winver.h>
+#include "rcVersion.h"
+
+VS_VERSION_INFO VERSIONINFO
+ FILEVERSION LIBXML_MAJOR_VERSION,LIBXML_MINOR_VERSION,LIBXML_MICRO_VERSION,0
+ PRODUCTVERSION LIBXML_MAJOR_VERSION,LIBXML_MINOR_VERSION,LIBXML_MICRO_VERSION,0
+ FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
+#ifdef _DEBUG
+ FILEFLAGS VS_FF_DEBUG
+#else
+ FILEFLAGS 0
+#endif
+ FILEOS VOS__WINDOWS32
+ FILETYPE VFT_DLL
+ FILESUBTYPE VFT2_UNKNOWN // not used
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "04090000" /* Lang = US English, Charset = ASCII */
+ BEGIN
+ VALUE "FileDescription", "libxml2 library\0"
+ VALUE "FileVersion", LIBXML_DOTTED_VERSION "\0"
+ VALUE "InternalName", "libxml2.dll\0"
+ VALUE "LegalCopyright", "Copyright (C) Daniel Veillard\0"
+ VALUE "LegalTrademarks", "\0"
+ VALUE "OriginalFilename", "libxml2.dll\0"
+ VALUE "ProductName", "libxml2\0"
+ VALUE "ProductVersion", LIBXML_DOTTED_VERSION "\0"
+ VALUE "Comments", "For more information visit http://xmlsoft.org/\0"
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x0409, 0 /* US English, ASCII */
+ END
+END
diff --git a/chromium/third_party/libxml/src/xmlIO.c b/chromium/third_party/libxml/src/xmlIO.c
index f61dd05a905..8254347708f 100644
--- a/chromium/third_party/libxml/src/xmlIO.c
+++ b/chromium/third_party/libxml/src/xmlIO.c
@@ -3157,7 +3157,7 @@ xmlParserInputBufferPush(xmlParserInputBufferPtr in,
* convert as much as possible to the parser reading buffer.
*/
use = xmlBufUse(in->raw);
- nbchars = xmlCharEncInput(in, 1);
+ nbchars = xmlCharEncInput(in, 0);
if (nbchars < 0) {
xmlIOErr(XML_IO_ENCODER, NULL);
in->error = XML_IO_ENCODER;
@@ -3273,7 +3273,7 @@ xmlParserInputBufferGrow(xmlParserInputBufferPtr in, int len) {
* convert as much as possible to the parser reading buffer.
*/
use = xmlBufUse(in->raw);
- nbchars = xmlCharEncInput(in, 1);
+ nbchars = xmlCharEncInput(in, 0);
if (nbchars < 0) {
xmlIOErr(XML_IO_ENCODER, NULL);
in->error = XML_IO_ENCODER;
diff --git a/chromium/third_party/pdfium/core/fxcodec/jbig2/JBig2_HuffmanTable.cpp b/chromium/third_party/pdfium/core/fxcodec/jbig2/JBig2_HuffmanTable.cpp
index 1127f52a52c..83f9fed0102 100644
--- a/chromium/third_party/pdfium/core/fxcodec/jbig2/JBig2_HuffmanTable.cpp
+++ b/chromium/third_party/pdfium/core/fxcodec/jbig2/JBig2_HuffmanTable.cpp
@@ -53,9 +53,7 @@ bool CJBig2_HuffmanTable::ParseFromCodedBuffer(CJBig2_BitStream* pStream) {
uint32_t HTLOW;
uint32_t HTHIGH;
if (pStream->readInteger(&HTLOW) == -1 ||
- pStream->readInteger(&HTHIGH) == -1 ||
- HTLOW > static_cast<uint32_t>(std::numeric_limits<int>::max()) ||
- HTHIGH > static_cast<uint32_t>(std::numeric_limits<int>::max())) {
+ pStream->readInteger(&HTHIGH) == -1) {
return false;
}
@@ -87,6 +85,9 @@ bool CJBig2_HuffmanTable::ParseFromCodedBuffer(CJBig2_BitStream* pStream) {
return false;
RANGELEN[NTEMP] = 32;
+ if (low == std::numeric_limits<int>::min())
+ return false;
+
RANGELOW[NTEMP] = low - 1;
ExtendBuffers(true);
diff --git a/chromium/third_party/skia/gm/bitmapcopy.cpp b/chromium/third_party/skia/gm/bitmapcopy.cpp
index ec9e423d12e..94d6fe6e2ce 100644
--- a/chromium/third_party/skia/gm/bitmapcopy.cpp
+++ b/chromium/third_party/skia/gm/bitmapcopy.cpp
@@ -9,15 +9,22 @@
namespace skiagm {
-static const char* gColorTypeNames[] = {
- "unknown",
- "A8",
- "565",
- "4444",
- "8888",
- "8888",
- "Index8",
-};
+static const char* color_type_name(SkColorType colorType) {
+ switch (colorType) {
+ case kUnknown_SkColorType: return "unknown";
+ case kAlpha_8_SkColorType: return "A8";
+ case kRGB_565_SkColorType: return "565";
+ case kARGB_4444_SkColorType: return "4444";
+ case kRGBA_8888_SkColorType: return "8888";
+ case kRGB_888x_SkColorType: return "888x";
+ case kBGRA_8888_SkColorType: return "8888";
+ case kRGBA_1010102_SkColorType: return "1010102";
+ case kRGB_101010x_SkColorType: return "101010x";
+ case kGray_8_SkColorType: return "G8";
+ case kRGBA_F16_SkColorType: return "F16";
+ }
+ return "";
+}
constexpr SkColorType gColorTypes[] = {
kRGB_565_SkColorType,
@@ -84,7 +91,7 @@ protected:
height = paint.getFontSpacing();
}
for (unsigned i = 0; i < NUM_CONFIGS; i++) {
- const char* name = gColorTypeNames[src.colorType()];
+ const char* name = color_type_name(src.colorType());
SkScalar textWidth = paint.measureText(name, strlen(name));
if (textWidth > width) {
width = textWidth;
@@ -97,7 +104,7 @@ protected:
for (unsigned i = 0; i < NUM_CONFIGS; i++) {
canvas->save();
// Draw destination config name
- const char* name = gColorTypeNames[fDst[i].colorType()];
+ const char* name = color_type_name(fDst[i].colorType());
SkScalar textWidth = paint.measureText(name, strlen(name));
SkScalar x = (width - textWidth) / SkScalar(2);
SkScalar y = paint.getFontSpacing() / SkScalar(2);
diff --git a/chromium/third_party/skia/include/core/SkImageInfo.h b/chromium/third_party/skia/include/core/SkImageInfo.h
index 5d2b74af390..c38e56eaa01 100644
--- a/chromium/third_party/skia/include/core/SkImageInfo.h
+++ b/chromium/third_party/skia/include/core/SkImageInfo.h
@@ -58,6 +58,9 @@ static inline bool SkAlphaTypeIsValid(unsigned value) {
///////////////////////////////////////////////////////////////////////////////
+/** Temporary macro that allows us to add new color types without breaking Chrome compile. */
+#define SK_EXTENDED_COLOR_TYPES
+
/**
* Describes how to interpret the components of a pixel.
*
@@ -71,7 +74,10 @@ enum SkColorType {
kRGB_565_SkColorType,
kARGB_4444_SkColorType,
kRGBA_8888_SkColorType,
+ kRGB_888x_SkColorType,
kBGRA_8888_SkColorType,
+ kRGBA_1010102_SkColorType,
+ kRGB_101010x_SkColorType,
kGray_8_SkColorType,
kRGBA_F16_SkColorType,
@@ -87,39 +93,37 @@ enum SkColorType {
};
static int SkColorTypeBytesPerPixel(SkColorType ct) {
- static const uint8_t gSize[] = {
- 0, // Unknown
- 1, // Alpha_8
- 2, // RGB_565
- 2, // ARGB_4444
- 4, // RGBA_8888
- 4, // BGRA_8888
- 1, // kGray_8
- 8, // kRGBA_F16
- };
- static_assert(SK_ARRAY_COUNT(gSize) == (size_t)(kLastEnum_SkColorType + 1),
- "size_mismatch_with_SkColorType_enum");
-
- SkASSERT((size_t)ct < SK_ARRAY_COUNT(gSize));
- return gSize[ct];
+ switch (ct) {
+ case kUnknown_SkColorType: return 0;
+ case kAlpha_8_SkColorType: return 1;
+ case kRGB_565_SkColorType: return 2;
+ case kARGB_4444_SkColorType: return 2;
+ case kRGBA_8888_SkColorType: return 4;
+ case kBGRA_8888_SkColorType: return 4;
+ case kRGB_888x_SkColorType: return 4;
+ case kRGBA_1010102_SkColorType: return 4;
+ case kRGB_101010x_SkColorType: return 4;
+ case kGray_8_SkColorType: return 1;
+ case kRGBA_F16_SkColorType: return 8;
+ }
+ return 0;
}
static int SkColorTypeShiftPerPixel(SkColorType ct) {
- static const uint8_t gShift[] = {
- 0, // Unknown
- 0, // Alpha_8
- 1, // RGB_565
- 1, // ARGB_4444
- 2, // RGBA_8888
- 2, // BGRA_8888
- 0, // kGray_8
- 3, // kRGBA_F16
- };
- static_assert(SK_ARRAY_COUNT(gShift) == (size_t)(kLastEnum_SkColorType + 1),
- "size_mismatch_with_SkColorType_enum");
-
- SkASSERT((size_t)ct < SK_ARRAY_COUNT(gShift));
- return gShift[ct];
+ switch (ct) {
+ case kUnknown_SkColorType: return 0;
+ case kAlpha_8_SkColorType: return 0;
+ case kRGB_565_SkColorType: return 1;
+ case kARGB_4444_SkColorType: return 1;
+ case kRGBA_8888_SkColorType: return 2;
+ case kRGB_888x_SkColorType: return 2;
+ case kBGRA_8888_SkColorType: return 2;
+ case kRGBA_1010102_SkColorType: return 2;
+ case kRGB_101010x_SkColorType: return 2;
+ case kGray_8_SkColorType: return 0;
+ case kRGBA_F16_SkColorType: return 3;
+ }
+ return 0;
}
static inline size_t SkColorTypeMinRowBytes(SkColorType ct, int width) {
diff --git a/chromium/third_party/skia/src/codec/SkWebpCodec.cpp b/chromium/third_party/skia/src/codec/SkWebpCodec.cpp
index aa3547dca5e..2925a770200 100644
--- a/chromium/third_party/skia/src/codec/SkWebpCodec.cpp
+++ b/chromium/third_party/skia/src/codec/SkWebpCodec.cpp
@@ -326,6 +326,9 @@ static void pick_memory_stages(SkColorType ct, SkRasterPipeline::StockStage* loa
case kAlpha_8_SkColorType:
case kARGB_4444_SkColorType:
case kGray_8_SkColorType:
+ case kRGB_888x_SkColorType:
+ case kRGBA_1010102_SkColorType:
+ case kRGB_101010x_SkColorType:
SkASSERT(false);
break;
case kRGB_565_SkColorType:
diff --git a/chromium/third_party/skia/src/core/SkImageInfo.cpp b/chromium/third_party/skia/src/core/SkImageInfo.cpp
index e5c2d8c7768..50d6cca2650 100644
--- a/chromium/third_party/skia/src/core/SkImageInfo.cpp
+++ b/chromium/third_party/skia/src/core/SkImageInfo.cpp
@@ -22,51 +22,44 @@ enum Stored_SkColorType {
kIndex_8_Stored_SkColorType_DEPRECATED = 6,
kGray_8_Stored_SkColorType = 7,
kRGBA_F16_Stored_SkColorType = 8,
-
- kLast_Stored_SkColorType = kRGBA_F16_Stored_SkColorType,
-};
-
-// Index with Stored_SkColorType
-const SkColorType gStoredToLive[] = {
- kUnknown_SkColorType,
- kAlpha_8_SkColorType,
- kRGB_565_SkColorType,
- kARGB_4444_SkColorType,
- kRGBA_8888_SkColorType,
- kBGRA_8888_SkColorType,
- kUnknown_SkColorType, // was kIndex_8
- kGray_8_SkColorType,
- kRGBA_F16_SkColorType,
-};
-
-// Index with SkColorType
-const Stored_SkColorType gLiveToStored[] = {
- kUnknown_Stored_SkColorType,
- kAlpha_8_Stored_SkColorType,
- kRGB_565_Stored_SkColorType,
- kARGB_4444_Stored_SkColorType,
- kRGBA_8888_Stored_SkColorType,
- kBGRA_8888_Stored_SkColorType,
- kGray_8_Stored_SkColorType,
- kRGBA_F16_Stored_SkColorType,
+ kRGB_888x_Stored_SkColorType = 9,
+ kRGBA_1010102_Stored_SkColorType = 10,
+ kRGB_101010x_Stored_SkColorType = 11,
};
static uint8_t live_to_stored(unsigned ct) {
- static_assert(SK_ARRAY_COUNT(gLiveToStored) == (kLastEnum_SkColorType + 1), "");
-
- if (ct >= SK_ARRAY_COUNT(gLiveToStored)) {
- ct = kUnknown_SkColorType;
- }
- return gLiveToStored[ct];
+ switch (ct) {
+ case kUnknown_SkColorType: return kUnknown_Stored_SkColorType;
+ case kAlpha_8_SkColorType: return kAlpha_8_Stored_SkColorType;
+ case kRGB_565_SkColorType: return kRGB_565_Stored_SkColorType;
+ case kARGB_4444_SkColorType: return kARGB_4444_Stored_SkColorType;
+ case kRGBA_8888_SkColorType: return kRGBA_8888_Stored_SkColorType;
+ case kRGB_888x_SkColorType: return kRGB_888x_Stored_SkColorType;
+ case kBGRA_8888_SkColorType: return kBGRA_8888_Stored_SkColorType;
+ case kRGBA_1010102_SkColorType: return kRGBA_1010102_Stored_SkColorType;
+ case kRGB_101010x_SkColorType: return kRGB_101010x_Stored_SkColorType;
+ case kGray_8_SkColorType: return kGray_8_Stored_SkColorType;
+ case kRGBA_F16_SkColorType: return kRGBA_F16_Stored_SkColorType;
+ }
+ return kUnknown_Stored_SkColorType;
}
static SkColorType stored_to_live(unsigned stored) {
- static_assert(SK_ARRAY_COUNT(gStoredToLive) == (kLast_Stored_SkColorType + 1), "");
-
- if (stored >= SK_ARRAY_COUNT(gStoredToLive)) {
- stored = kUnknown_Stored_SkColorType;
- }
- return gStoredToLive[stored];
+ switch (stored) {
+ case kUnknown_Stored_SkColorType: return kUnknown_SkColorType;
+ case kAlpha_8_Stored_SkColorType: return kAlpha_8_SkColorType;
+ case kRGB_565_Stored_SkColorType: return kRGB_565_SkColorType;
+ case kARGB_4444_Stored_SkColorType: return kARGB_4444_SkColorType;
+ case kRGBA_8888_Stored_SkColorType: return kRGBA_8888_SkColorType;
+ case kRGB_888x_Stored_SkColorType: return kRGB_888x_SkColorType;
+ case kBGRA_8888_Stored_SkColorType: return kBGRA_8888_SkColorType;
+ case kRGBA_1010102_Stored_SkColorType: return kRGBA_1010102_SkColorType;
+ case kRGB_101010x_Stored_SkColorType: return kRGB_101010x_SkColorType;
+ case kIndex_8_Stored_SkColorType_DEPRECATED: return kUnknown_SkColorType;
+ case kGray_8_Stored_SkColorType: return kGray_8_SkColorType;
+ case kRGBA_F16_Stored_SkColorType: return kRGBA_F16_SkColorType;
+ }
+ return kUnknown_SkColorType;
}
///////////////////////////////////////////////////////////////////////////////////////////////////
diff --git a/chromium/third_party/skia/src/core/SkPaint.cpp b/chromium/third_party/skia/src/core/SkPaint.cpp
index d659b414109..548ab81dcbd 100644
--- a/chromium/third_party/skia/src/core/SkPaint.cpp
+++ b/chromium/third_party/skia/src/core/SkPaint.cpp
@@ -1957,6 +1957,11 @@ void SkPaint::unflatten(SkReadBuffer& buffer) {
bool SkPaint::getFillPath(const SkPath& src, SkPath* dst, const SkRect* cullRect,
SkScalar resScale) const {
+ if (!src.isFinite()) {
+ dst->reset();
+ return false;
+ }
+
SkStrokeRec rec(*this, resScale);
const SkPath* srcPtr = &src;
@@ -1977,6 +1982,11 @@ bool SkPaint::getFillPath(const SkPath& src, SkPath* dst, const SkRect* cullRect
*dst = *srcPtr;
}
}
+
+ if (!dst->isFinite()) {
+ dst->reset();
+ return false;
+ }
return !rec.isHairlineStyle();
}
diff --git a/chromium/third_party/skia/src/core/SkScan_AntiPath.cpp b/chromium/third_party/skia/src/core/SkScan_AntiPath.cpp
index 70c8d1f972d..db1527f6506 100644
--- a/chromium/third_party/skia/src/core/SkScan_AntiPath.cpp
+++ b/chromium/third_party/skia/src/core/SkScan_AntiPath.cpp
@@ -756,9 +756,8 @@ void SkScan::AntiFillPath(const SkPath& path, const SkRegion& origClip,
#include "SkRasterClip.h"
-void SkScan::FillPath(const SkPath& path, const SkRasterClip& clip,
- SkBlitter* blitter) {
- if (clip.isEmpty()) {
+void SkScan::FillPath(const SkPath& path, const SkRasterClip& clip, SkBlitter* blitter) {
+ if (clip.isEmpty() || !path.isFinite()) {
return;
}
@@ -776,7 +775,7 @@ void SkScan::FillPath(const SkPath& path, const SkRasterClip& clip,
void SkScan::AntiFillPath(const SkPath& path, const SkRasterClip& clip,
SkBlitter* blitter, bool forceDAA) {
- if (clip.isEmpty()) {
+ if (clip.isEmpty() || !path.isFinite()) {
return;
}
diff --git a/chromium/third_party/skia/src/gpu/SkGr.cpp b/chromium/third_party/skia/src/gpu/SkGr.cpp
index 8faa9d45578..c38f51260a1 100644
--- a/chromium/third_party/skia/src/gpu/SkGr.cpp
+++ b/chromium/third_party/skia/src/gpu/SkGr.cpp
@@ -285,9 +285,15 @@ GrPixelConfig SkImageInfo2GrPixelConfig(const SkColorType type, SkColorSpace* cs
? kSRGBA_8888_GrPixelConfig : kRGBA_8888_GrPixelConfig;
// TODO: We're checking for srgbSupport, but we can then end up picking sBGRA as our pixel
// config (which may not be supported). We need a better test here.
+ case kRGB_888x_SkColorType:
+ return kUnknown_GrPixelConfig;
case kBGRA_8888_SkColorType:
return (caps.srgbSupport() && cs && cs->gammaCloseToSRGB())
? kSBGRA_8888_GrPixelConfig : kBGRA_8888_GrPixelConfig;
+ case kRGBA_1010102_SkColorType:
+ return kUnknown_GrPixelConfig;
+ case kRGB_101010x_SkColorType:
+ return kUnknown_GrPixelConfig;
case kGray_8_SkColorType:
return kGray_8_GrPixelConfig;
case kRGBA_F16_SkColorType:
diff --git a/chromium/third_party/skia/src/gpu/gl/GrGLCaps.cpp b/chromium/third_party/skia/src/gpu/gl/GrGLCaps.cpp
index d310cd219be..4a36ce07aaa 100644
--- a/chromium/third_party/skia/src/gpu/gl/GrGLCaps.cpp
+++ b/chromium/third_party/skia/src/gpu/gl/GrGLCaps.cpp
@@ -2399,6 +2399,8 @@ bool validate_sized_format(GrGLenum format, SkColorType ct, GrPixelConfig* confi
*config = kSRGBA_8888_GrPixelConfig;
}
break;
+ case kRGB_888x_SkColorType:
+ return false;
case kBGRA_8888_SkColorType:
if (GR_GL_RGBA8 == format) {
if (kGL_GrGLStandard == standard) {
@@ -2412,6 +2414,10 @@ bool validate_sized_format(GrGLenum format, SkColorType ct, GrPixelConfig* confi
*config = kSBGRA_8888_GrPixelConfig;
}
break;
+ case kRGBA_1010102_SkColorType:
+ return false;
+ case kRGB_101010x_SkColorType:
+ return false;
case kGray_8_SkColorType:
if (GR_GL_LUMINANCE8 == format) {
*config = kGray_8_as_Lum_GrPixelConfig;
diff --git a/chromium/third_party/skia/src/gpu/vk/GrVkCaps.cpp b/chromium/third_party/skia/src/gpu/vk/GrVkCaps.cpp
index 40cb38f0e6e..3b1fc15526c 100644
--- a/chromium/third_party/skia/src/gpu/vk/GrVkCaps.cpp
+++ b/chromium/third_party/skia/src/gpu/vk/GrVkCaps.cpp
@@ -447,6 +447,8 @@ bool validate_image_info(const GrVkImageInfo* imageInfo, SkColorType ct, GrPixel
*config = kSRGBA_8888_GrPixelConfig;
}
break;
+ case kRGB_888x_SkColorType:
+ return false;
case kBGRA_8888_SkColorType:
if (VK_FORMAT_B8G8R8A8_UNORM == format) {
*config = kBGRA_8888_GrPixelConfig;
@@ -454,6 +456,10 @@ bool validate_image_info(const GrVkImageInfo* imageInfo, SkColorType ct, GrPixel
*config = kSBGRA_8888_GrPixelConfig;
}
break;
+ case kRGBA_1010102_SkColorType:
+ return false;
+ case kRGB_101010x_SkColorType:
+ return false;
case kGray_8_SkColorType:
if (VK_FORMAT_R8_UNORM == format) {
*config = kGray_8_as_Red_GrPixelConfig;
diff --git a/chromium/third_party/skia/src/image/SkImage_Lazy.cpp b/chromium/third_party/skia/src/image/SkImage_Lazy.cpp
index 53ebc0ccff2..a0369ccbe93 100644
--- a/chromium/third_party/skia/src/image/SkImage_Lazy.cpp
+++ b/chromium/third_party/skia/src/image/SkImage_Lazy.cpp
@@ -303,6 +303,9 @@ SkImageCacherator::CachedFormat SkImage_Lazy::chooseCacheFormat(SkColorSpace* ds
case kAlpha_8_SkColorType:
case kRGB_565_SkColorType:
case kARGB_4444_SkColorType:
+ case kRGB_888x_SkColorType:
+ case kRGBA_1010102_SkColorType:
+ case kRGB_101010x_SkColorType:
// We don't support color space on these formats, so always decode in legacy mode:
// TODO: Ask the codec to decode these to something else (at least sRGB 8888)?
return kLegacy_CachedFormat;
diff --git a/chromium/third_party/skia/tools/debugger/SkObjectParser.cpp b/chromium/third_party/skia/tools/debugger/SkObjectParser.cpp
index 1f483199937..352a01da237 100644
--- a/chromium/third_party/skia/tools/debugger/SkObjectParser.cpp
+++ b/chromium/third_party/skia/tools/debugger/SkObjectParser.cpp
@@ -27,15 +27,22 @@ SkString* SkObjectParser::BitmapToString(const SkBitmap& bitmap) {
mBitmap->append(" H: ");
mBitmap->appendS32(bitmap.height());
- const char* gColorTypeStrings[] = {
- "None", "A8", "565", "4444", "RGBA", "BGRA",
- "G8", "RGBAf16"
- };
- static_assert(kLastEnum_SkColorType + 1 == SK_ARRAY_COUNT(gColorTypeStrings),
- "colortype names do not match colortype enum");
-
+ const char* ctString = "<unknown>";
+ switch (bitmap.colorType()) {
+ case kUnknown_SkColorType: ctString = "None"; break;
+ case kAlpha_8_SkColorType: ctString = "A8"; break;
+ case kRGB_565_SkColorType: ctString = "565"; break;
+ case kARGB_4444_SkColorType: ctString = "4444"; break;
+ case kRGBA_8888_SkColorType: ctString = "RGBA"; break;
+ case kRGB_888x_SkColorType: ctString = "RGB"; break;
+ case kBGRA_8888_SkColorType: ctString = "BGRA"; break;
+ case kRGBA_1010102_SkColorType: ctString = "1010102"; break;
+ case kRGB_101010x_SkColorType: ctString = "101010x"; break;
+ case kGray_8_SkColorType: ctString = "G8"; break;
+ case kRGBA_F16_SkColorType: ctString = "RGBAf16"; break;
+ }
mBitmap->append(" ColorType: ");
- mBitmap->append(gColorTypeStrings[bitmap.colorType()]);
+ mBitmap->append(ctString);
if (bitmap.isOpaque()) {
mBitmap->append(" opaque");
diff --git a/chromium/third_party/wayland-protocols/LICENSE b/chromium/third_party/wayland-protocols/LICENSE
new file mode 100644
index 00000000000..8ab3291e385
--- /dev/null
+++ b/chromium/third_party/wayland-protocols/LICENSE
@@ -0,0 +1,33 @@
+Copyright © 2008-2013 Kristian Høgsberg
+Copyright © 2010-2013 Intel Corporation
+Copyright © 2013 Rafael Antognolli
+Copyright © 2013 Jasper St. Pierre
+Copyright © 2014 Jonas Ådahl
+Copyright © 2014 Jason Ekstrand
+Copyright © 2014-2015 Collabora, Ltd.
+Copyright © 2015 Red Hat Inc.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the "Software"),
+to deal in the Software without restriction, including without limitation
+the rights to use, copy, modify, merge, publish, distribute, sublicense,
+and/or sell copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice (including the next
+paragraph) shall be included in all copies or substantial portions of the
+Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
+
+---
+
+The above is the version of the MIT "Expat" License used by X.org:
+
+ http://cgit.freedesktop.org/xorg/xserver/tree/COPYING
diff --git a/chromium/third_party/wayland-protocols/OWNERS b/chromium/third_party/wayland-protocols/OWNERS
new file mode 100644
index 00000000000..fe51e0c4f9f
--- /dev/null
+++ b/chromium/third_party/wayland-protocols/OWNERS
@@ -0,0 +1,2 @@
+reveman@chromium.org
+piman@chromium.org
diff --git a/chromium/third_party/wayland-protocols/README.chromium b/chromium/third_party/wayland-protocols/README.chromium
new file mode 100644
index 00000000000..3527d0ee2fb
--- /dev/null
+++ b/chromium/third_party/wayland-protocols/README.chromium
@@ -0,0 +1,66 @@
+Name: wayland-protocols
+URL: http://wayland.freedesktop.org/
+Version: 1.8
+License: MIT
+License File: src/COPYING
+Security Critical: yes
+
+Description:
+wayland-protocols contains Wayland protocols that adds functionality not
+available in the Wayland core protocol. Such protocols either adds
+completely new functionality, or extends the functionality of some other
+protocol either in Wayland core, or some other protocol in
+wayland-protocols.
+
+To import a new snapshot of wayland-protocols:
+- Checkout the latest release tag: git checkout 1.8
+- Change the DEPS entry to the newly checked out commit.
+- Update generated files:
+ wayland-scanner code < src/unstable/xdg-shell/xdg-shell-unstable-v5.xml > protocol/xdg-shell-v5-protocol.c
+ wayland-scanner server-header < src/unstable/xdg-shell/xdg-shell-unstable-v5.xml > include/protocol/xdg-shell-unstable-v5-server-protocol.h
+ wayland-scanner client-header < src/unstable/xdg-shell/xdg-shell-unstable-v5.xml > include/protocol/xdg-shell-unstable-v5-client-protocol.h
+ wayland-scanner code < src/unstable/xdg-shell/xdg-shell-unstable-v6.xml > protocol/xdg-shell-v6-protocol.c
+ wayland-scanner server-header < src/unstable/xdg-shell/xdg-shell-unstable-v6.xml > include/protocol/xdg-shell-unstable-v6-server-protocol.h
+ wayland-scanner client-header < src/unstable/xdg-shell/xdg-shell-unstable-v6.xml > include/protocol/xdg-shell-unstable-v6-client-protocol.h
+ wayland-scanner code < src/unstable/linux-dmabuf/linux-dmabuf-unstable-v1.xml > protocol/linux-dmabuf-protocol.c
+ wayland-scanner server-header < src/unstable/linux-dmabuf/linux-dmabuf-unstable-v1.xml > include/protocol/linux-dmabuf-unstable-v1-server-protocol.h
+ wayland-scanner client-header < src/unstable/linux-dmabuf/linux-dmabuf-unstable-v1.xml > include/protocol/linux-dmabuf-unstable-v1-client-protocol.h
+ wayland-scanner code < src/stable/viewporter/viewporter.xml > protocol/viewporter-protocol.c
+ wayland-scanner server-header < src/stable/viewporter/viewporter.xml > include/protocol/viewporter-server-protocol.h
+ wayland-scanner client-header < src/stable/viewporter/viewporter.xml > include/protocol/viewporter-client-protocol.h
+ wayland-scanner code < src/stable/presentation-time/presentation-time.xml > protocol/presentation-time-protocol.c
+ wayland-scanner server-header < src/stable/presentation-time/presentation-time.xml > include/protocol/presentation-time-server-protocol.h
+ wayland-scanner client-header < src/stable/presentation-time/presentation-time.xml > include/protocol/presentation-time-client-protocol.h
+ wayland-scanner code < unstable/secure-output/secure-output-unstable-v1.xml > protocol/secure-output-protocol.c
+ wayland-scanner server-header < unstable/secure-output/secure-output-unstable-v1.xml > include/protocol/secure-output-unstable-v1-server-protocol.h
+ wayland-scanner client-header < unstable/secure-output/secure-output-unstable-v1.xml > include/protocol/secure-output-unstable-v1-client-protocol.h
+ wayland-scanner code < unstable/alpha-compositing/alpha-compositing-unstable-v1.xml > protocol/alpha-compositing-protocol.c
+ wayland-scanner server-header < unstable/alpha-compositing/alpha-compositing-unstable-v1.xml > include/protocol/alpha-compositing-unstable-v1-server-protocol.h
+ wayland-scanner client-header < unstable/alpha-compositing/alpha-compositing-unstable-v1.xml > include/protocol/alpha-compositing-unstable-v1-client-protocol.h
+ wayland-scanner code < unstable/remote-shell/remote-shell-unstable-v1.xml > protocol/remote-shell-protocol.c
+ wayland-scanner server-header < unstable/remote-shell/remote-shell-unstable-v1.xml > include/protocol/remote-shell-unstable-v1-server-protocol.h
+ wayland-scanner client-header < unstable/remote-shell/remote-shell-unstable-v1.xml > include/protocol/remote-shell-unstable-v1-client-protocol.h
+ wayland-scanner code < unstable/vsync-feedback/vsync-feedback-unstable-v1.xml > protocol/vsync-feedback-protocol.c
+ wayland-scanner server-header < unstable/vsync-feedback/vsync-feedback-unstable-v1.xml > include/protocol/vsync-feedback-unstable-v1-server-protocol.h
+ wayland-scanner client-header < unstable/vsync-feedback/vsync-feedback-unstable-v1.xml > include/protocol/vsync-feedback-unstable-v1-client-protocol.h
+ wayland-scanner code < unstable/gaming-input/gaming-input-unstable-v1.xml > protocol/gaming-input-protocol-v1.c
+ wayland-scanner server-header < unstable/gaming-input/gaming-input-unstable-v1.xml > include/protocol/gaming-input-unstable-v1-server-protocol.h
+ wayland-scanner client-header < unstable/gaming-input/gaming-input-unstable-v1.xml > include/protocol/gaming-input-unstable-v1-client-protocol.h
+ wayland-scanner code < unstable/gaming-input/gaming-input-unstable-v2.xml > protocol/gaming-input-protocol-v2.c
+ wayland-scanner server-header < unstable/gaming-input/gaming-input-unstable-v2.xml > include/protocol/gaming-input-unstable-v2-server-protocol.h
+ wayland-scanner client-header < unstable/gaming-input/gaming-input-unstable-v2.xml > include/protocol/gaming-input-unstable-v2-client-protocol.h
+ wayland-scanner code < unstable/stylus/stylus-unstable-v2.xml > protocol/stylus-protocol-v2.c
+ wayland-scanner server-header < unstable/stylus/stylus-unstable-v2.xml > include/protocol/stylus-unstable-v2-server-protocol.h
+ wayland-scanner client-header < unstable/stylus/stylus-unstable-v2.xml > include/protocol/stylus-unstable-v2-client-protocol.h
+ wayland-scanner code < unstable/keyboard/keyboard-configuration-unstable-v1.xml > protocol/keyboard-configuration-protocol.c
+ wayland-scanner server-header < unstable/keyboard/keyboard-configuration-unstable-v1.xml > include/protocol/keyboard-configuration-unstable-v1-server-protocol.h
+ wayland-scanner client-header < unstable/keyboard/keyboard-configuration-unstable-v1.xml > include/protocol/keyboard-configuration-unstable-v1-client-protocol.h
+ wayland-scanner code < unstable/stylus-tools/stylus-tools-unstable-v1.xml > protocol/stylus-tools-protocol.c
+ wayland-scanner server-header < unstable/stylus-tools/stylus-tools-unstable-v1.xml > include/protocol/stylus-tools-unstable-v1-server-protocol.h
+ wayland-scanner client-header < unstable/stylus-tools/stylus-tools-unstable-v1.xml > include/protocol/stylus-tools-unstable-v1-client-protocol.h
+ wayland-scanner code < unstable/keyboard/keyboard-extension-unstable-v1.xml > protocol/keyboard-extension-protocol.c
+ wayland-scanner server-header < unstable/keyboard/keyboard-extension-unstable-v1.xml > include/protocol/keyboard-extension-unstable-v1-server-protocol.h
+ wayland-scanner client-header < unstable/keyboard/keyboard-extension-unstable-v1.xml > include/protocol/keyboard-extension-unstable-v1-client-protocol.h
+ wayland-scanner client-header < src/unstable/pointer-gestures/pointer-gestures-unstable-v1.xml > include/protocol/pointer-gestures-unstable-v1-client-protocol.h
+ wayland-scanner server-header < src/unstable/pointer-gestures/pointer-gestures-unstable-v1.xml > include/protocol/pointer-gestures-unstable-v1-server-protocol.h
+- Update this README to reflect the new version number.
diff --git a/chromium/third_party/wayland-protocols/include/protocol/alpha-compositing-unstable-v1-client-protocol.h b/chromium/third_party/wayland-protocols/include/protocol/alpha-compositing-unstable-v1-client-protocol.h
new file mode 100644
index 00000000000..ed191fc7615
--- /dev/null
+++ b/chromium/third_party/wayland-protocols/include/protocol/alpha-compositing-unstable-v1-client-protocol.h
@@ -0,0 +1,308 @@
+/* Generated by wayland-scanner 1.13.0 */
+
+#ifndef ALPHA_COMPOSITING_UNSTABLE_V1_CLIENT_PROTOCOL_H
+#define ALPHA_COMPOSITING_UNSTABLE_V1_CLIENT_PROTOCOL_H
+
+#include <stdint.h>
+#include <stddef.h>
+#include "wayland-client.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @page page_alpha_compositing_unstable_v1 The alpha_compositing_unstable_v1 protocol
+ * Protocol for more advanced compositing and blending
+ *
+ * @section page_desc_alpha_compositing_unstable_v1 Description
+ *
+ * This protocol specifies a set of interfaces used to control the alpha
+ * compositing and blending of contents.
+ *
+ * Warning! The protocol described in this file is experimental and backward
+ * incompatible changes may be made. Backward compatible changes may be added
+ * together with the corresponding interface version bump. Backward
+ * incompatible changes are done by bumping the version number in the protocol
+ * and interface names and resetting the interface version. Once the protocol
+ * is to be declared stable, the 'z' prefix and the version number in the
+ * protocol and interface names are removed and the interface version number is
+ * reset.
+ *
+ * @section page_ifaces_alpha_compositing_unstable_v1 Interfaces
+ * - @subpage page_iface_zcr_alpha_compositing_v1 - alpha_compositing
+ * - @subpage page_iface_zcr_blending_v1 - blending interface to a wl_surface
+ * @section page_copyright_alpha_compositing_unstable_v1 Copyright
+ * <pre>
+ *
+ * Copyright 2016 The Chromium Authors.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ * </pre>
+ */
+struct wl_surface;
+struct zcr_alpha_compositing_v1;
+struct zcr_blending_v1;
+
+/**
+ * @page page_iface_zcr_alpha_compositing_v1 zcr_alpha_compositing_v1
+ * @section page_iface_zcr_alpha_compositing_v1_desc Description
+ *
+ * The global interface exposing compositing and blending capabilities is
+ * used to instantiate an interface extension for a wl_surface object.
+ * This extended interface will then allow the client to specify the
+ * blending equation and alpha value used for compositing the wl_surface.
+ * @section page_iface_zcr_alpha_compositing_v1_api API
+ * See @ref iface_zcr_alpha_compositing_v1.
+ */
+/**
+ * @defgroup iface_zcr_alpha_compositing_v1 The zcr_alpha_compositing_v1 interface
+ *
+ * The global interface exposing compositing and blending capabilities is
+ * used to instantiate an interface extension for a wl_surface object.
+ * This extended interface will then allow the client to specify the
+ * blending equation and alpha value used for compositing the wl_surface.
+ */
+extern const struct wl_interface zcr_alpha_compositing_v1_interface;
+/**
+ * @page page_iface_zcr_blending_v1 zcr_blending_v1
+ * @section page_iface_zcr_blending_v1_desc Description
+ *
+ * An additional interface to a wl_surface object, which allows the
+ * client to specify the blending equation used for compositing and
+ * an alpha value applied to the whole surface.
+ *
+ * If the wl_surface associated with the bledning object is destroyed,
+ * the blending object becomes inert.
+ *
+ * If the blending object is destroyed, the blending state is removed
+ * from the wl_surface. The change will be applied on the next
+ * wl_surface.commit.
+ * @section page_iface_zcr_blending_v1_api API
+ * See @ref iface_zcr_blending_v1.
+ */
+/**
+ * @defgroup iface_zcr_blending_v1 The zcr_blending_v1 interface
+ *
+ * An additional interface to a wl_surface object, which allows the
+ * client to specify the blending equation used for compositing and
+ * an alpha value applied to the whole surface.
+ *
+ * If the wl_surface associated with the bledning object is destroyed,
+ * the blending object becomes inert.
+ *
+ * If the blending object is destroyed, the blending state is removed
+ * from the wl_surface. The change will be applied on the next
+ * wl_surface.commit.
+ */
+extern const struct wl_interface zcr_blending_v1_interface;
+
+#ifndef ZCR_ALPHA_COMPOSITING_V1_ERROR_ENUM
+#define ZCR_ALPHA_COMPOSITING_V1_ERROR_ENUM
+enum zcr_alpha_compositing_v1_error {
+ /**
+ * the surface already has a blending object associated
+ */
+ ZCR_ALPHA_COMPOSITING_V1_ERROR_BLENDING_EXISTS = 0,
+};
+#endif /* ZCR_ALPHA_COMPOSITING_V1_ERROR_ENUM */
+
+#define ZCR_ALPHA_COMPOSITING_V1_DESTROY 0
+#define ZCR_ALPHA_COMPOSITING_V1_GET_BLENDING 1
+
+
+/**
+ * @ingroup iface_zcr_alpha_compositing_v1
+ */
+#define ZCR_ALPHA_COMPOSITING_V1_DESTROY_SINCE_VERSION 1
+/**
+ * @ingroup iface_zcr_alpha_compositing_v1
+ */
+#define ZCR_ALPHA_COMPOSITING_V1_GET_BLENDING_SINCE_VERSION 1
+
+/** @ingroup iface_zcr_alpha_compositing_v1 */
+static inline void
+zcr_alpha_compositing_v1_set_user_data(struct zcr_alpha_compositing_v1 *zcr_alpha_compositing_v1, void *user_data)
+{
+ wl_proxy_set_user_data((struct wl_proxy *) zcr_alpha_compositing_v1, user_data);
+}
+
+/** @ingroup iface_zcr_alpha_compositing_v1 */
+static inline void *
+zcr_alpha_compositing_v1_get_user_data(struct zcr_alpha_compositing_v1 *zcr_alpha_compositing_v1)
+{
+ return wl_proxy_get_user_data((struct wl_proxy *) zcr_alpha_compositing_v1);
+}
+
+static inline uint32_t
+zcr_alpha_compositing_v1_get_version(struct zcr_alpha_compositing_v1 *zcr_alpha_compositing_v1)
+{
+ return wl_proxy_get_version((struct wl_proxy *) zcr_alpha_compositing_v1);
+}
+
+/**
+ * @ingroup iface_zcr_alpha_compositing_v1
+ *
+ * Informs the server that the client will not be using this
+ * protocol object anymore. This does not affect any other objects,
+ * blending objects included.
+ */
+static inline void
+zcr_alpha_compositing_v1_destroy(struct zcr_alpha_compositing_v1 *zcr_alpha_compositing_v1)
+{
+ wl_proxy_marshal((struct wl_proxy *) zcr_alpha_compositing_v1,
+ ZCR_ALPHA_COMPOSITING_V1_DESTROY);
+
+ wl_proxy_destroy((struct wl_proxy *) zcr_alpha_compositing_v1);
+}
+
+/**
+ * @ingroup iface_zcr_alpha_compositing_v1
+ *
+ * Instantiate an interface extension for the given wl_surface to
+ * provide surface blending. If the given wl_surface already has
+ * a blending object associated, the blending_exists protocol error
+ * is raised.
+ */
+static inline struct zcr_blending_v1 *
+zcr_alpha_compositing_v1_get_blending(struct zcr_alpha_compositing_v1 *zcr_alpha_compositing_v1, struct wl_surface *surface)
+{
+ struct wl_proxy *id;
+
+ id = wl_proxy_marshal_constructor((struct wl_proxy *) zcr_alpha_compositing_v1,
+ ZCR_ALPHA_COMPOSITING_V1_GET_BLENDING, &zcr_blending_v1_interface, NULL, surface);
+
+ return (struct zcr_blending_v1 *) id;
+}
+
+#ifndef ZCR_BLENDING_V1_BLENDING_EQUATION_ENUM
+#define ZCR_BLENDING_V1_BLENDING_EQUATION_ENUM
+/**
+ * @ingroup iface_zcr_blending_v1
+ * different blending equations for compositing
+ *
+ * Blending equations that can be used when compositing a surface.
+ */
+enum zcr_blending_v1_blending_equation {
+ /**
+ * no blending
+ */
+ ZCR_BLENDING_V1_BLENDING_EQUATION_NONE = 0,
+ /**
+ * one / one_minus_src_alpha
+ */
+ ZCR_BLENDING_V1_BLENDING_EQUATION_PREMULT = 1,
+ /**
+ * src_alpha / one_minus_src_alpha
+ */
+ ZCR_BLENDING_V1_BLENDING_EQUATION_COVERAGE = 2,
+};
+#endif /* ZCR_BLENDING_V1_BLENDING_EQUATION_ENUM */
+
+#define ZCR_BLENDING_V1_DESTROY 0
+#define ZCR_BLENDING_V1_SET_BLENDING 1
+#define ZCR_BLENDING_V1_SET_ALPHA 2
+
+
+/**
+ * @ingroup iface_zcr_blending_v1
+ */
+#define ZCR_BLENDING_V1_DESTROY_SINCE_VERSION 1
+/**
+ * @ingroup iface_zcr_blending_v1
+ */
+#define ZCR_BLENDING_V1_SET_BLENDING_SINCE_VERSION 1
+/**
+ * @ingroup iface_zcr_blending_v1
+ */
+#define ZCR_BLENDING_V1_SET_ALPHA_SINCE_VERSION 1
+
+/** @ingroup iface_zcr_blending_v1 */
+static inline void
+zcr_blending_v1_set_user_data(struct zcr_blending_v1 *zcr_blending_v1, void *user_data)
+{
+ wl_proxy_set_user_data((struct wl_proxy *) zcr_blending_v1, user_data);
+}
+
+/** @ingroup iface_zcr_blending_v1 */
+static inline void *
+zcr_blending_v1_get_user_data(struct zcr_blending_v1 *zcr_blending_v1)
+{
+ return wl_proxy_get_user_data((struct wl_proxy *) zcr_blending_v1);
+}
+
+static inline uint32_t
+zcr_blending_v1_get_version(struct zcr_blending_v1 *zcr_blending_v1)
+{
+ return wl_proxy_get_version((struct wl_proxy *) zcr_blending_v1);
+}
+
+/**
+ * @ingroup iface_zcr_blending_v1
+ *
+ * The associated wl_surface's blending state is removed.
+ * The change is applied on the next wl_surface.commit.
+ */
+static inline void
+zcr_blending_v1_destroy(struct zcr_blending_v1 *zcr_blending_v1)
+{
+ wl_proxy_marshal((struct wl_proxy *) zcr_blending_v1,
+ ZCR_BLENDING_V1_DESTROY);
+
+ wl_proxy_destroy((struct wl_proxy *) zcr_blending_v1);
+}
+
+/**
+ * @ingroup iface_zcr_blending_v1
+ *
+ * Set the blending equation for compositing the wl_surface.
+ * See wp_alpha_compositing for the description.
+ *
+ * The blending equation state is double-buffered state,
+ * and will be applied on the next wl_surface.commit.
+ */
+static inline void
+zcr_blending_v1_set_blending(struct zcr_blending_v1 *zcr_blending_v1, uint32_t equation)
+{
+ wl_proxy_marshal((struct wl_proxy *) zcr_blending_v1,
+ ZCR_BLENDING_V1_SET_BLENDING, equation);
+}
+
+/**
+ * @ingroup iface_zcr_blending_v1
+ *
+ * Set the alpha value applied to the whole surface for compositing.
+ * See wp_alpha_compositing for the description.
+ *
+ * The alpha value state is double-buffered state,
+ * and will be applied on the next wl_surface.commit.
+ */
+static inline void
+zcr_blending_v1_set_alpha(struct zcr_blending_v1 *zcr_blending_v1, wl_fixed_t value)
+{
+ wl_proxy_marshal((struct wl_proxy *) zcr_blending_v1,
+ ZCR_BLENDING_V1_SET_ALPHA, value);
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/chromium/third_party/wayland-protocols/include/protocol/alpha-compositing-unstable-v1-server-protocol.h b/chromium/third_party/wayland-protocols/include/protocol/alpha-compositing-unstable-v1-server-protocol.h
new file mode 100644
index 00000000000..0a3d24bf4d3
--- /dev/null
+++ b/chromium/third_party/wayland-protocols/include/protocol/alpha-compositing-unstable-v1-server-protocol.h
@@ -0,0 +1,253 @@
+/* Generated by wayland-scanner 1.13.0 */
+
+#ifndef ALPHA_COMPOSITING_UNSTABLE_V1_SERVER_PROTOCOL_H
+#define ALPHA_COMPOSITING_UNSTABLE_V1_SERVER_PROTOCOL_H
+
+#include <stdint.h>
+#include <stddef.h>
+#include "wayland-server.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct wl_client;
+struct wl_resource;
+
+/**
+ * @page page_alpha_compositing_unstable_v1 The alpha_compositing_unstable_v1 protocol
+ * Protocol for more advanced compositing and blending
+ *
+ * @section page_desc_alpha_compositing_unstable_v1 Description
+ *
+ * This protocol specifies a set of interfaces used to control the alpha
+ * compositing and blending of contents.
+ *
+ * Warning! The protocol described in this file is experimental and backward
+ * incompatible changes may be made. Backward compatible changes may be added
+ * together with the corresponding interface version bump. Backward
+ * incompatible changes are done by bumping the version number in the protocol
+ * and interface names and resetting the interface version. Once the protocol
+ * is to be declared stable, the 'z' prefix and the version number in the
+ * protocol and interface names are removed and the interface version number is
+ * reset.
+ *
+ * @section page_ifaces_alpha_compositing_unstable_v1 Interfaces
+ * - @subpage page_iface_zcr_alpha_compositing_v1 - alpha_compositing
+ * - @subpage page_iface_zcr_blending_v1 - blending interface to a wl_surface
+ * @section page_copyright_alpha_compositing_unstable_v1 Copyright
+ * <pre>
+ *
+ * Copyright 2016 The Chromium Authors.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ * </pre>
+ */
+struct wl_surface;
+struct zcr_alpha_compositing_v1;
+struct zcr_blending_v1;
+
+/**
+ * @page page_iface_zcr_alpha_compositing_v1 zcr_alpha_compositing_v1
+ * @section page_iface_zcr_alpha_compositing_v1_desc Description
+ *
+ * The global interface exposing compositing and blending capabilities is
+ * used to instantiate an interface extension for a wl_surface object.
+ * This extended interface will then allow the client to specify the
+ * blending equation and alpha value used for compositing the wl_surface.
+ * @section page_iface_zcr_alpha_compositing_v1_api API
+ * See @ref iface_zcr_alpha_compositing_v1.
+ */
+/**
+ * @defgroup iface_zcr_alpha_compositing_v1 The zcr_alpha_compositing_v1 interface
+ *
+ * The global interface exposing compositing and blending capabilities is
+ * used to instantiate an interface extension for a wl_surface object.
+ * This extended interface will then allow the client to specify the
+ * blending equation and alpha value used for compositing the wl_surface.
+ */
+extern const struct wl_interface zcr_alpha_compositing_v1_interface;
+/**
+ * @page page_iface_zcr_blending_v1 zcr_blending_v1
+ * @section page_iface_zcr_blending_v1_desc Description
+ *
+ * An additional interface to a wl_surface object, which allows the
+ * client to specify the blending equation used for compositing and
+ * an alpha value applied to the whole surface.
+ *
+ * If the wl_surface associated with the bledning object is destroyed,
+ * the blending object becomes inert.
+ *
+ * If the blending object is destroyed, the blending state is removed
+ * from the wl_surface. The change will be applied on the next
+ * wl_surface.commit.
+ * @section page_iface_zcr_blending_v1_api API
+ * See @ref iface_zcr_blending_v1.
+ */
+/**
+ * @defgroup iface_zcr_blending_v1 The zcr_blending_v1 interface
+ *
+ * An additional interface to a wl_surface object, which allows the
+ * client to specify the blending equation used for compositing and
+ * an alpha value applied to the whole surface.
+ *
+ * If the wl_surface associated with the bledning object is destroyed,
+ * the blending object becomes inert.
+ *
+ * If the blending object is destroyed, the blending state is removed
+ * from the wl_surface. The change will be applied on the next
+ * wl_surface.commit.
+ */
+extern const struct wl_interface zcr_blending_v1_interface;
+
+#ifndef ZCR_ALPHA_COMPOSITING_V1_ERROR_ENUM
+#define ZCR_ALPHA_COMPOSITING_V1_ERROR_ENUM
+enum zcr_alpha_compositing_v1_error {
+ /**
+ * the surface already has a blending object associated
+ */
+ ZCR_ALPHA_COMPOSITING_V1_ERROR_BLENDING_EXISTS = 0,
+};
+#endif /* ZCR_ALPHA_COMPOSITING_V1_ERROR_ENUM */
+
+/**
+ * @ingroup iface_zcr_alpha_compositing_v1
+ * @struct zcr_alpha_compositing_v1_interface
+ */
+struct zcr_alpha_compositing_v1_interface {
+ /**
+ * unbind from the blending interface
+ *
+ * Informs the server that the client will not be using this
+ * protocol object anymore. This does not affect any other objects,
+ * blending objects included.
+ */
+ void (*destroy)(struct wl_client *client,
+ struct wl_resource *resource);
+ /**
+ * extend surface interface for blending
+ *
+ * Instantiate an interface extension for the given wl_surface to
+ * provide surface blending. If the given wl_surface already has a
+ * blending object associated, the blending_exists protocol error
+ * is raised.
+ * @param id the new blending interface id
+ * @param surface the surface
+ */
+ void (*get_blending)(struct wl_client *client,
+ struct wl_resource *resource,
+ uint32_t id,
+ struct wl_resource *surface);
+};
+
+
+/**
+ * @ingroup iface_zcr_alpha_compositing_v1
+ */
+#define ZCR_ALPHA_COMPOSITING_V1_DESTROY_SINCE_VERSION 1
+/**
+ * @ingroup iface_zcr_alpha_compositing_v1
+ */
+#define ZCR_ALPHA_COMPOSITING_V1_GET_BLENDING_SINCE_VERSION 1
+
+#ifndef ZCR_BLENDING_V1_BLENDING_EQUATION_ENUM
+#define ZCR_BLENDING_V1_BLENDING_EQUATION_ENUM
+/**
+ * @ingroup iface_zcr_blending_v1
+ * different blending equations for compositing
+ *
+ * Blending equations that can be used when compositing a surface.
+ */
+enum zcr_blending_v1_blending_equation {
+ /**
+ * no blending
+ */
+ ZCR_BLENDING_V1_BLENDING_EQUATION_NONE = 0,
+ /**
+ * one / one_minus_src_alpha
+ */
+ ZCR_BLENDING_V1_BLENDING_EQUATION_PREMULT = 1,
+ /**
+ * src_alpha / one_minus_src_alpha
+ */
+ ZCR_BLENDING_V1_BLENDING_EQUATION_COVERAGE = 2,
+};
+#endif /* ZCR_BLENDING_V1_BLENDING_EQUATION_ENUM */
+
+/**
+ * @ingroup iface_zcr_blending_v1
+ * @struct zcr_blending_v1_interface
+ */
+struct zcr_blending_v1_interface {
+ /**
+ * remove blending from the surface
+ *
+ * The associated wl_surface's blending state is removed. The
+ * change is applied on the next wl_surface.commit.
+ */
+ void (*destroy)(struct wl_client *client,
+ struct wl_resource *resource);
+ /**
+ * set the blending equation
+ *
+ * Set the blending equation for compositing the wl_surface. See
+ * wp_alpha_compositing for the description.
+ *
+ * The blending equation state is double-buffered state, and will
+ * be applied on the next wl_surface.commit.
+ * @param equation the new blending equation
+ */
+ void (*set_blending)(struct wl_client *client,
+ struct wl_resource *resource,
+ uint32_t equation);
+ /**
+ * set the alpha value
+ *
+ * Set the alpha value applied to the whole surface for
+ * compositing. See wp_alpha_compositing for the description.
+ *
+ * The alpha value state is double-buffered state, and will be
+ * applied on the next wl_surface.commit.
+ * @param value the new alpha value
+ */
+ void (*set_alpha)(struct wl_client *client,
+ struct wl_resource *resource,
+ wl_fixed_t value);
+};
+
+
+/**
+ * @ingroup iface_zcr_blending_v1
+ */
+#define ZCR_BLENDING_V1_DESTROY_SINCE_VERSION 1
+/**
+ * @ingroup iface_zcr_blending_v1
+ */
+#define ZCR_BLENDING_V1_SET_BLENDING_SINCE_VERSION 1
+/**
+ * @ingroup iface_zcr_blending_v1
+ */
+#define ZCR_BLENDING_V1_SET_ALPHA_SINCE_VERSION 1
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/chromium/third_party/wayland-protocols/include/protocol/gaming-input-unstable-v1-client-protocol.h b/chromium/third_party/wayland-protocols/include/protocol/gaming-input-unstable-v1-client-protocol.h
new file mode 100644
index 00000000000..66301bd626e
--- /dev/null
+++ b/chromium/third_party/wayland-protocols/include/protocol/gaming-input-unstable-v1-client-protocol.h
@@ -0,0 +1,332 @@
+/* Generated by wayland-scanner 1.13.0 */
+
+#ifndef GAMING_INPUT_UNSTABLE_V1_CLIENT_PROTOCOL_H
+#define GAMING_INPUT_UNSTABLE_V1_CLIENT_PROTOCOL_H
+
+#include <stdint.h>
+#include <stddef.h>
+#include "wayland-client.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @page page_gaming_input_unstable_v1 The gaming_input_unstable_v1 protocol
+ * @section page_ifaces_gaming_input_unstable_v1 Interfaces
+ * - @subpage page_iface_zcr_gaming_input_v1 - extends wl_seat with gaming input devices
+ * - @subpage page_iface_zcr_gamepad_v1 - gamepad input device
+ * @section page_copyright_gaming_input_unstable_v1 Copyright
+ * <pre>
+ *
+ * Copyright 2016 The Chromium Authors.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ * </pre>
+ */
+struct wl_seat;
+struct zcr_gamepad_v1;
+struct zcr_gaming_input_v1;
+
+/**
+ * @page page_iface_zcr_gaming_input_v1 zcr_gaming_input_v1
+ * @section page_iface_zcr_gaming_input_v1_desc Description
+ *
+ * A global interface to provide gaming input devices for a given seat.
+ *
+ * Currently only gamepad devices are supported.
+ *
+ * Warning! The protocol described in this file is experimental and
+ * backward incompatible changes may be made. Backward compatible changes
+ * may be added together with the corresponding uinterface version bump.
+ * Backward incompatible changes are done by bumping the version number in
+ * the protocol and uinterface names and resetting the interface version.
+ * Once the protocol is to be declared stable, the 'z' prefix and the
+ * version number in the protocol and interface names are removed and the
+ * interface version number is reset.
+ * @section page_iface_zcr_gaming_input_v1_api API
+ * See @ref iface_zcr_gaming_input_v1.
+ */
+/**
+ * @defgroup iface_zcr_gaming_input_v1 The zcr_gaming_input_v1 interface
+ *
+ * A global interface to provide gaming input devices for a given seat.
+ *
+ * Currently only gamepad devices are supported.
+ *
+ * Warning! The protocol described in this file is experimental and
+ * backward incompatible changes may be made. Backward compatible changes
+ * may be added together with the corresponding uinterface version bump.
+ * Backward incompatible changes are done by bumping the version number in
+ * the protocol and uinterface names and resetting the interface version.
+ * Once the protocol is to be declared stable, the 'z' prefix and the
+ * version number in the protocol and interface names are removed and the
+ * interface version number is reset.
+ */
+extern const struct wl_interface zcr_gaming_input_v1_interface;
+/**
+ * @page page_iface_zcr_gamepad_v1 zcr_gamepad_v1
+ * @section page_iface_zcr_gamepad_v1_desc Description
+ *
+ * The zcr_gamepad_v1 interface represents one or more gamepad input devices,
+ * which are reported as a normalized 'Standard Gamepad' as it is specified
+ * by the W3C Gamepad API at: https://w3c.github.io/gamepad/#remapping
+ * @section page_iface_zcr_gamepad_v1_api API
+ * See @ref iface_zcr_gamepad_v1.
+ */
+/**
+ * @defgroup iface_zcr_gamepad_v1 The zcr_gamepad_v1 interface
+ *
+ * The zcr_gamepad_v1 interface represents one or more gamepad input devices,
+ * which are reported as a normalized 'Standard Gamepad' as it is specified
+ * by the W3C Gamepad API at: https://w3c.github.io/gamepad/#remapping
+ */
+extern const struct wl_interface zcr_gamepad_v1_interface;
+
+#define ZCR_GAMING_INPUT_V1_GET_GAMEPAD 0
+
+
+/**
+ * @ingroup iface_zcr_gaming_input_v1
+ */
+#define ZCR_GAMING_INPUT_V1_GET_GAMEPAD_SINCE_VERSION 1
+
+/** @ingroup iface_zcr_gaming_input_v1 */
+static inline void
+zcr_gaming_input_v1_set_user_data(struct zcr_gaming_input_v1 *zcr_gaming_input_v1, void *user_data)
+{
+ wl_proxy_set_user_data((struct wl_proxy *) zcr_gaming_input_v1, user_data);
+}
+
+/** @ingroup iface_zcr_gaming_input_v1 */
+static inline void *
+zcr_gaming_input_v1_get_user_data(struct zcr_gaming_input_v1 *zcr_gaming_input_v1)
+{
+ return wl_proxy_get_user_data((struct wl_proxy *) zcr_gaming_input_v1);
+}
+
+static inline uint32_t
+zcr_gaming_input_v1_get_version(struct zcr_gaming_input_v1 *zcr_gaming_input_v1)
+{
+ return wl_proxy_get_version((struct wl_proxy *) zcr_gaming_input_v1);
+}
+
+/** @ingroup iface_zcr_gaming_input_v1 */
+static inline void
+zcr_gaming_input_v1_destroy(struct zcr_gaming_input_v1 *zcr_gaming_input_v1)
+{
+ wl_proxy_destroy((struct wl_proxy *) zcr_gaming_input_v1);
+}
+
+/**
+ * @ingroup iface_zcr_gaming_input_v1
+ *
+ * Create gamepad object. See zcr_gamepad_v1 interface for details.
+ */
+static inline struct zcr_gamepad_v1 *
+zcr_gaming_input_v1_get_gamepad(struct zcr_gaming_input_v1 *zcr_gaming_input_v1, struct wl_seat *seat)
+{
+ struct wl_proxy *id;
+
+ id = wl_proxy_marshal_constructor((struct wl_proxy *) zcr_gaming_input_v1,
+ ZCR_GAMING_INPUT_V1_GET_GAMEPAD, &zcr_gamepad_v1_interface, NULL, seat);
+
+ return (struct zcr_gamepad_v1 *) id;
+}
+
+#ifndef ZCR_GAMEPAD_V1_GAMEPAD_STATE_ENUM
+#define ZCR_GAMEPAD_V1_GAMEPAD_STATE_ENUM
+/**
+ * @ingroup iface_zcr_gamepad_v1
+ * connection state
+ */
+enum zcr_gamepad_v1_gamepad_state {
+ /**
+ * no gamepads are connected or on.
+ */
+ ZCR_GAMEPAD_V1_GAMEPAD_STATE_OFF = 0,
+ /**
+ * at least one gamepad is connected.
+ */
+ ZCR_GAMEPAD_V1_GAMEPAD_STATE_ON = 1,
+};
+#endif /* ZCR_GAMEPAD_V1_GAMEPAD_STATE_ENUM */
+
+#ifndef ZCR_GAMEPAD_V1_BUTTON_STATE_ENUM
+#define ZCR_GAMEPAD_V1_BUTTON_STATE_ENUM
+/**
+ * @ingroup iface_zcr_gamepad_v1
+ * physical button state
+ *
+ * Describes the physical state of a button that produced the button
+ * event.
+ */
+enum zcr_gamepad_v1_button_state {
+ /**
+ * the button is not pressed
+ */
+ ZCR_GAMEPAD_V1_BUTTON_STATE_RELEASED = 0,
+ /**
+ * the button is pressed
+ */
+ ZCR_GAMEPAD_V1_BUTTON_STATE_PRESSED = 1,
+};
+#endif /* ZCR_GAMEPAD_V1_BUTTON_STATE_ENUM */
+
+/**
+ * @ingroup iface_zcr_gamepad_v1
+ * @struct zcr_gamepad_v1_listener
+ */
+struct zcr_gamepad_v1_listener {
+ /**
+ * state change event
+ *
+ * Notification that this seat's connection state has changed.
+ * @param state new state
+ */
+ void (*state_change)(void *data,
+ struct zcr_gamepad_v1 *zcr_gamepad_v1,
+ uint32_t state);
+ /**
+ * axis change event
+ *
+ * Notification of axis change.
+ *
+ * The axis id specifies which axis has changed as defined by the
+ * W3C 'Standard Gamepad'.
+ *
+ * The value is calibrated and normalized to the -1 to 1 range.
+ * @param time timestamp with millisecond granularity
+ * @param axis axis that produced this event
+ * @param value new value of axis
+ */
+ void (*axis)(void *data,
+ struct zcr_gamepad_v1 *zcr_gamepad_v1,
+ uint32_t time,
+ uint32_t axis,
+ wl_fixed_t value);
+ /**
+ * Gamepad button changed
+ *
+ * Notification of button change.
+ *
+ * The button id specifies which button has changed as defined by
+ * the W3C 'Standard Gamepad'.
+ *
+ * A button can have a digital and an analog value. The analog
+ * value is normalized to a 0 to 1 range. If a button does not
+ * provide an analog value, it will be derived from the digital
+ * state.
+ * @param time timestamp with millisecond granularity
+ * @param button id of button
+ * @param state digital state of the button
+ * @param analog analog value of the button
+ */
+ void (*button)(void *data,
+ struct zcr_gamepad_v1 *zcr_gamepad_v1,
+ uint32_t time,
+ uint32_t button,
+ uint32_t state,
+ wl_fixed_t analog);
+ /**
+ * Notifies end of a series of gamepad changes.
+ *
+ * Indicates the end of a set of events that logically belong
+ * together. A client is expected to accumulate the data in all
+ * events within the frame before proceeding.
+ * @param time timestamp with millisecond granularity
+ */
+ void (*frame)(void *data,
+ struct zcr_gamepad_v1 *zcr_gamepad_v1,
+ uint32_t time);
+};
+
+/**
+ * @ingroup iface_zcr_gamepad_v1
+ */
+static inline int
+zcr_gamepad_v1_add_listener(struct zcr_gamepad_v1 *zcr_gamepad_v1,
+ const struct zcr_gamepad_v1_listener *listener, void *data)
+{
+ return wl_proxy_add_listener((struct wl_proxy *) zcr_gamepad_v1,
+ (void (**)(void)) listener, data);
+}
+
+#define ZCR_GAMEPAD_V1_DESTROY 0
+
+/**
+ * @ingroup iface_zcr_gamepad_v1
+ */
+#define ZCR_GAMEPAD_V1_STATE_CHANGE_SINCE_VERSION 1
+/**
+ * @ingroup iface_zcr_gamepad_v1
+ */
+#define ZCR_GAMEPAD_V1_AXIS_SINCE_VERSION 1
+/**
+ * @ingroup iface_zcr_gamepad_v1
+ */
+#define ZCR_GAMEPAD_V1_BUTTON_SINCE_VERSION 1
+/**
+ * @ingroup iface_zcr_gamepad_v1
+ */
+#define ZCR_GAMEPAD_V1_FRAME_SINCE_VERSION 1
+
+/**
+ * @ingroup iface_zcr_gamepad_v1
+ */
+#define ZCR_GAMEPAD_V1_DESTROY_SINCE_VERSION 1
+
+/** @ingroup iface_zcr_gamepad_v1 */
+static inline void
+zcr_gamepad_v1_set_user_data(struct zcr_gamepad_v1 *zcr_gamepad_v1, void *user_data)
+{
+ wl_proxy_set_user_data((struct wl_proxy *) zcr_gamepad_v1, user_data);
+}
+
+/** @ingroup iface_zcr_gamepad_v1 */
+static inline void *
+zcr_gamepad_v1_get_user_data(struct zcr_gamepad_v1 *zcr_gamepad_v1)
+{
+ return wl_proxy_get_user_data((struct wl_proxy *) zcr_gamepad_v1);
+}
+
+static inline uint32_t
+zcr_gamepad_v1_get_version(struct zcr_gamepad_v1 *zcr_gamepad_v1)
+{
+ return wl_proxy_get_version((struct wl_proxy *) zcr_gamepad_v1);
+}
+
+/**
+ * @ingroup iface_zcr_gamepad_v1
+ */
+static inline void
+zcr_gamepad_v1_destroy(struct zcr_gamepad_v1 *zcr_gamepad_v1)
+{
+ wl_proxy_marshal((struct wl_proxy *) zcr_gamepad_v1,
+ ZCR_GAMEPAD_V1_DESTROY);
+
+ wl_proxy_destroy((struct wl_proxy *) zcr_gamepad_v1);
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/chromium/third_party/wayland-protocols/include/protocol/gaming-input-unstable-v1-server-protocol.h b/chromium/third_party/wayland-protocols/include/protocol/gaming-input-unstable-v1-server-protocol.h
new file mode 100644
index 00000000000..7d065e017f2
--- /dev/null
+++ b/chromium/third_party/wayland-protocols/include/protocol/gaming-input-unstable-v1-server-protocol.h
@@ -0,0 +1,266 @@
+/* Generated by wayland-scanner 1.13.0 */
+
+#ifndef GAMING_INPUT_UNSTABLE_V1_SERVER_PROTOCOL_H
+#define GAMING_INPUT_UNSTABLE_V1_SERVER_PROTOCOL_H
+
+#include <stdint.h>
+#include <stddef.h>
+#include "wayland-server.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct wl_client;
+struct wl_resource;
+
+/**
+ * @page page_gaming_input_unstable_v1 The gaming_input_unstable_v1 protocol
+ * @section page_ifaces_gaming_input_unstable_v1 Interfaces
+ * - @subpage page_iface_zcr_gaming_input_v1 - extends wl_seat with gaming input devices
+ * - @subpage page_iface_zcr_gamepad_v1 - gamepad input device
+ * @section page_copyright_gaming_input_unstable_v1 Copyright
+ * <pre>
+ *
+ * Copyright 2016 The Chromium Authors.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ * </pre>
+ */
+struct wl_seat;
+struct zcr_gamepad_v1;
+struct zcr_gaming_input_v1;
+
+/**
+ * @page page_iface_zcr_gaming_input_v1 zcr_gaming_input_v1
+ * @section page_iface_zcr_gaming_input_v1_desc Description
+ *
+ * A global interface to provide gaming input devices for a given seat.
+ *
+ * Currently only gamepad devices are supported.
+ *
+ * Warning! The protocol described in this file is experimental and
+ * backward incompatible changes may be made. Backward compatible changes
+ * may be added together with the corresponding uinterface version bump.
+ * Backward incompatible changes are done by bumping the version number in
+ * the protocol and uinterface names and resetting the interface version.
+ * Once the protocol is to be declared stable, the 'z' prefix and the
+ * version number in the protocol and interface names are removed and the
+ * interface version number is reset.
+ * @section page_iface_zcr_gaming_input_v1_api API
+ * See @ref iface_zcr_gaming_input_v1.
+ */
+/**
+ * @defgroup iface_zcr_gaming_input_v1 The zcr_gaming_input_v1 interface
+ *
+ * A global interface to provide gaming input devices for a given seat.
+ *
+ * Currently only gamepad devices are supported.
+ *
+ * Warning! The protocol described in this file is experimental and
+ * backward incompatible changes may be made. Backward compatible changes
+ * may be added together with the corresponding uinterface version bump.
+ * Backward incompatible changes are done by bumping the version number in
+ * the protocol and uinterface names and resetting the interface version.
+ * Once the protocol is to be declared stable, the 'z' prefix and the
+ * version number in the protocol and interface names are removed and the
+ * interface version number is reset.
+ */
+extern const struct wl_interface zcr_gaming_input_v1_interface;
+/**
+ * @page page_iface_zcr_gamepad_v1 zcr_gamepad_v1
+ * @section page_iface_zcr_gamepad_v1_desc Description
+ *
+ * The zcr_gamepad_v1 interface represents one or more gamepad input devices,
+ * which are reported as a normalized 'Standard Gamepad' as it is specified
+ * by the W3C Gamepad API at: https://w3c.github.io/gamepad/#remapping
+ * @section page_iface_zcr_gamepad_v1_api API
+ * See @ref iface_zcr_gamepad_v1.
+ */
+/**
+ * @defgroup iface_zcr_gamepad_v1 The zcr_gamepad_v1 interface
+ *
+ * The zcr_gamepad_v1 interface represents one or more gamepad input devices,
+ * which are reported as a normalized 'Standard Gamepad' as it is specified
+ * by the W3C Gamepad API at: https://w3c.github.io/gamepad/#remapping
+ */
+extern const struct wl_interface zcr_gamepad_v1_interface;
+
+/**
+ * @ingroup iface_zcr_gaming_input_v1
+ * @struct zcr_gaming_input_v1_interface
+ */
+struct zcr_gaming_input_v1_interface {
+ /**
+ * get gamepad device assigned to seat
+ *
+ * Create gamepad object. See zcr_gamepad_v1 interface for
+ * details.
+ */
+ void (*get_gamepad)(struct wl_client *client,
+ struct wl_resource *resource,
+ uint32_t id,
+ struct wl_resource *seat);
+};
+
+
+/**
+ * @ingroup iface_zcr_gaming_input_v1
+ */
+#define ZCR_GAMING_INPUT_V1_GET_GAMEPAD_SINCE_VERSION 1
+
+#ifndef ZCR_GAMEPAD_V1_GAMEPAD_STATE_ENUM
+#define ZCR_GAMEPAD_V1_GAMEPAD_STATE_ENUM
+/**
+ * @ingroup iface_zcr_gamepad_v1
+ * connection state
+ */
+enum zcr_gamepad_v1_gamepad_state {
+ /**
+ * no gamepads are connected or on.
+ */
+ ZCR_GAMEPAD_V1_GAMEPAD_STATE_OFF = 0,
+ /**
+ * at least one gamepad is connected.
+ */
+ ZCR_GAMEPAD_V1_GAMEPAD_STATE_ON = 1,
+};
+#endif /* ZCR_GAMEPAD_V1_GAMEPAD_STATE_ENUM */
+
+#ifndef ZCR_GAMEPAD_V1_BUTTON_STATE_ENUM
+#define ZCR_GAMEPAD_V1_BUTTON_STATE_ENUM
+/**
+ * @ingroup iface_zcr_gamepad_v1
+ * physical button state
+ *
+ * Describes the physical state of a button that produced the button
+ * event.
+ */
+enum zcr_gamepad_v1_button_state {
+ /**
+ * the button is not pressed
+ */
+ ZCR_GAMEPAD_V1_BUTTON_STATE_RELEASED = 0,
+ /**
+ * the button is pressed
+ */
+ ZCR_GAMEPAD_V1_BUTTON_STATE_PRESSED = 1,
+};
+#endif /* ZCR_GAMEPAD_V1_BUTTON_STATE_ENUM */
+
+/**
+ * @ingroup iface_zcr_gamepad_v1
+ * @struct zcr_gamepad_v1_interface
+ */
+struct zcr_gamepad_v1_interface {
+ /**
+ * destroy gamepad object
+ *
+ *
+ */
+ void (*destroy)(struct wl_client *client,
+ struct wl_resource *resource);
+};
+
+#define ZCR_GAMEPAD_V1_STATE_CHANGE 0
+#define ZCR_GAMEPAD_V1_AXIS 1
+#define ZCR_GAMEPAD_V1_BUTTON 2
+#define ZCR_GAMEPAD_V1_FRAME 3
+
+/**
+ * @ingroup iface_zcr_gamepad_v1
+ */
+#define ZCR_GAMEPAD_V1_STATE_CHANGE_SINCE_VERSION 1
+/**
+ * @ingroup iface_zcr_gamepad_v1
+ */
+#define ZCR_GAMEPAD_V1_AXIS_SINCE_VERSION 1
+/**
+ * @ingroup iface_zcr_gamepad_v1
+ */
+#define ZCR_GAMEPAD_V1_BUTTON_SINCE_VERSION 1
+/**
+ * @ingroup iface_zcr_gamepad_v1
+ */
+#define ZCR_GAMEPAD_V1_FRAME_SINCE_VERSION 1
+
+/**
+ * @ingroup iface_zcr_gamepad_v1
+ */
+#define ZCR_GAMEPAD_V1_DESTROY_SINCE_VERSION 1
+
+/**
+ * @ingroup iface_zcr_gamepad_v1
+ * Sends an state_change event to the client owning the resource.
+ * @param resource_ The client's resource
+ * @param state new state
+ */
+static inline void
+zcr_gamepad_v1_send_state_change(struct wl_resource *resource_, uint32_t state)
+{
+ wl_resource_post_event(resource_, ZCR_GAMEPAD_V1_STATE_CHANGE, state);
+}
+
+/**
+ * @ingroup iface_zcr_gamepad_v1
+ * Sends an axis event to the client owning the resource.
+ * @param resource_ The client's resource
+ * @param time timestamp with millisecond granularity
+ * @param axis axis that produced this event
+ * @param value new value of axis
+ */
+static inline void
+zcr_gamepad_v1_send_axis(struct wl_resource *resource_, uint32_t time, uint32_t axis, wl_fixed_t value)
+{
+ wl_resource_post_event(resource_, ZCR_GAMEPAD_V1_AXIS, time, axis, value);
+}
+
+/**
+ * @ingroup iface_zcr_gamepad_v1
+ * Sends an button event to the client owning the resource.
+ * @param resource_ The client's resource
+ * @param time timestamp with millisecond granularity
+ * @param button id of button
+ * @param state digital state of the button
+ * @param analog analog value of the button
+ */
+static inline void
+zcr_gamepad_v1_send_button(struct wl_resource *resource_, uint32_t time, uint32_t button, uint32_t state, wl_fixed_t analog)
+{
+ wl_resource_post_event(resource_, ZCR_GAMEPAD_V1_BUTTON, time, button, state, analog);
+}
+
+/**
+ * @ingroup iface_zcr_gamepad_v1
+ * Sends an frame event to the client owning the resource.
+ * @param resource_ The client's resource
+ * @param time timestamp with millisecond granularity
+ */
+static inline void
+zcr_gamepad_v1_send_frame(struct wl_resource *resource_, uint32_t time)
+{
+ wl_resource_post_event(resource_, ZCR_GAMEPAD_V1_FRAME, time);
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/chromium/third_party/wayland-protocols/include/protocol/gaming-input-unstable-v2-client-protocol.h b/chromium/third_party/wayland-protocols/include/protocol/gaming-input-unstable-v2-client-protocol.h
new file mode 100644
index 00000000000..1c74e341141
--- /dev/null
+++ b/chromium/third_party/wayland-protocols/include/protocol/gaming-input-unstable-v2-client-protocol.h
@@ -0,0 +1,422 @@
+/* Generated by wayland-scanner 1.13.0 */
+
+#ifndef GAMING_INPUT_UNSTABLE_V2_CLIENT_PROTOCOL_H
+#define GAMING_INPUT_UNSTABLE_V2_CLIENT_PROTOCOL_H
+
+#include <stdint.h>
+#include <stddef.h>
+#include "wayland-client.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @page page_gaming_input_unstable_v2 The gaming_input_unstable_v2 protocol
+ * @section page_ifaces_gaming_input_unstable_v2 Interfaces
+ * - @subpage page_iface_zcr_gaming_input_v2 - extends wl_seat with gaming input devices
+ * - @subpage page_iface_zcr_gaming_seat_v2 - controller object for all gaming devices of a seat
+ * - @subpage page_iface_zcr_gamepad_v2 - gamepad input device
+ * @section page_copyright_gaming_input_unstable_v2 Copyright
+ * <pre>
+ *
+ * Copyright 2016 The Chromium Authors.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ * </pre>
+ */
+struct wl_seat;
+struct zcr_gamepad_v2;
+struct zcr_gaming_input_v2;
+struct zcr_gaming_seat_v2;
+
+/**
+ * @page page_iface_zcr_gaming_input_v2 zcr_gaming_input_v2
+ * @section page_iface_zcr_gaming_input_v2_desc Description
+ *
+ * A global interface to provide gaming input devices for a given seat.
+ *
+ * Currently only gamepad devices are supported.
+ *
+ * Warning! The protocol described in this file is experimental and
+ * backward incompatible changes may be made. Backward compatible changes
+ * may be added together with the corresponding uinterface version bump.
+ * Backward incompatible changes are done by bumping the version number in
+ * the protocol and uinterface names and resetting the interface version.
+ * Once the protocol is to be declared stable, the 'z' prefix and the
+ * version number in the protocol and interface names are removed and the
+ * interface version number is reset.
+ * @section page_iface_zcr_gaming_input_v2_api API
+ * See @ref iface_zcr_gaming_input_v2.
+ */
+/**
+ * @defgroup iface_zcr_gaming_input_v2 The zcr_gaming_input_v2 interface
+ *
+ * A global interface to provide gaming input devices for a given seat.
+ *
+ * Currently only gamepad devices are supported.
+ *
+ * Warning! The protocol described in this file is experimental and
+ * backward incompatible changes may be made. Backward compatible changes
+ * may be added together with the corresponding uinterface version bump.
+ * Backward incompatible changes are done by bumping the version number in
+ * the protocol and uinterface names and resetting the interface version.
+ * Once the protocol is to be declared stable, the 'z' prefix and the
+ * version number in the protocol and interface names are removed and the
+ * interface version number is reset.
+ */
+extern const struct wl_interface zcr_gaming_input_v2_interface;
+/**
+ * @page page_iface_zcr_gaming_seat_v2 zcr_gaming_seat_v2
+ * @section page_iface_zcr_gaming_seat_v2_desc Description
+ *
+ * An object that provides access to all the gaming devices of a seat.
+ * When a gamepad is connected, the compositor will send gamepad_added event.
+ * @section page_iface_zcr_gaming_seat_v2_api API
+ * See @ref iface_zcr_gaming_seat_v2.
+ */
+/**
+ * @defgroup iface_zcr_gaming_seat_v2 The zcr_gaming_seat_v2 interface
+ *
+ * An object that provides access to all the gaming devices of a seat.
+ * When a gamepad is connected, the compositor will send gamepad_added event.
+ */
+extern const struct wl_interface zcr_gaming_seat_v2_interface;
+/**
+ * @page page_iface_zcr_gamepad_v2 zcr_gamepad_v2
+ * @section page_iface_zcr_gamepad_v2_desc Description
+ *
+ * The zcr_gamepad_v2 interface represents one or more gamepad input devices,
+ * which are reported as a normalized 'Standard Gamepad' as it is specified
+ * by the W3C Gamepad API at: https://w3c.github.io/gamepad/#remapping
+ * @section page_iface_zcr_gamepad_v2_api API
+ * See @ref iface_zcr_gamepad_v2.
+ */
+/**
+ * @defgroup iface_zcr_gamepad_v2 The zcr_gamepad_v2 interface
+ *
+ * The zcr_gamepad_v2 interface represents one or more gamepad input devices,
+ * which are reported as a normalized 'Standard Gamepad' as it is specified
+ * by the W3C Gamepad API at: https://w3c.github.io/gamepad/#remapping
+ */
+extern const struct wl_interface zcr_gamepad_v2_interface;
+
+#define ZCR_GAMING_INPUT_V2_GET_GAMING_SEAT 0
+#define ZCR_GAMING_INPUT_V2_DESTROY 1
+
+
+/**
+ * @ingroup iface_zcr_gaming_input_v2
+ */
+#define ZCR_GAMING_INPUT_V2_GET_GAMING_SEAT_SINCE_VERSION 1
+/**
+ * @ingroup iface_zcr_gaming_input_v2
+ */
+#define ZCR_GAMING_INPUT_V2_DESTROY_SINCE_VERSION 1
+
+/** @ingroup iface_zcr_gaming_input_v2 */
+static inline void
+zcr_gaming_input_v2_set_user_data(struct zcr_gaming_input_v2 *zcr_gaming_input_v2, void *user_data)
+{
+ wl_proxy_set_user_data((struct wl_proxy *) zcr_gaming_input_v2, user_data);
+}
+
+/** @ingroup iface_zcr_gaming_input_v2 */
+static inline void *
+zcr_gaming_input_v2_get_user_data(struct zcr_gaming_input_v2 *zcr_gaming_input_v2)
+{
+ return wl_proxy_get_user_data((struct wl_proxy *) zcr_gaming_input_v2);
+}
+
+static inline uint32_t
+zcr_gaming_input_v2_get_version(struct zcr_gaming_input_v2 *zcr_gaming_input_v2)
+{
+ return wl_proxy_get_version((struct wl_proxy *) zcr_gaming_input_v2);
+}
+
+/**
+ * @ingroup iface_zcr_gaming_input_v2
+ *
+ * Get a gaming seat object for a given seat. Gaming seat provides access
+ * to gaming devices
+ */
+static inline struct zcr_gaming_seat_v2 *
+zcr_gaming_input_v2_get_gaming_seat(struct zcr_gaming_input_v2 *zcr_gaming_input_v2, struct wl_seat *seat)
+{
+ struct wl_proxy *gaming_seat;
+
+ gaming_seat = wl_proxy_marshal_constructor((struct wl_proxy *) zcr_gaming_input_v2,
+ ZCR_GAMING_INPUT_V2_GET_GAMING_SEAT, &zcr_gaming_seat_v2_interface, NULL, seat);
+
+ return (struct zcr_gaming_seat_v2 *) gaming_seat;
+}
+
+/**
+ * @ingroup iface_zcr_gaming_input_v2
+ *
+ * Destroy gaming_input object. Objects created from this object are
+ * unaffected and should be destroyed separately.
+ */
+static inline void
+zcr_gaming_input_v2_destroy(struct zcr_gaming_input_v2 *zcr_gaming_input_v2)
+{
+ wl_proxy_marshal((struct wl_proxy *) zcr_gaming_input_v2,
+ ZCR_GAMING_INPUT_V2_DESTROY);
+
+ wl_proxy_destroy((struct wl_proxy *) zcr_gaming_input_v2);
+}
+
+/**
+ * @ingroup iface_zcr_gaming_seat_v2
+ * @struct zcr_gaming_seat_v2_listener
+ */
+struct zcr_gaming_seat_v2_listener {
+ /**
+ * gamepad added event
+ *
+ * Notification that there is gamepad connected at this seat.
+ * @param gamepad new connected gamepad
+ */
+ void (*gamepad_added)(void *data,
+ struct zcr_gaming_seat_v2 *zcr_gaming_seat_v2,
+ struct zcr_gamepad_v2 *gamepad);
+};
+
+/**
+ * @ingroup iface_zcr_gaming_seat_v2
+ */
+static inline int
+zcr_gaming_seat_v2_add_listener(struct zcr_gaming_seat_v2 *zcr_gaming_seat_v2,
+ const struct zcr_gaming_seat_v2_listener *listener, void *data)
+{
+ return wl_proxy_add_listener((struct wl_proxy *) zcr_gaming_seat_v2,
+ (void (**)(void)) listener, data);
+}
+
+#define ZCR_GAMING_SEAT_V2_DESTROY 0
+
+/**
+ * @ingroup iface_zcr_gaming_seat_v2
+ */
+#define ZCR_GAMING_SEAT_V2_GAMEPAD_ADDED_SINCE_VERSION 1
+
+/**
+ * @ingroup iface_zcr_gaming_seat_v2
+ */
+#define ZCR_GAMING_SEAT_V2_DESTROY_SINCE_VERSION 1
+
+/** @ingroup iface_zcr_gaming_seat_v2 */
+static inline void
+zcr_gaming_seat_v2_set_user_data(struct zcr_gaming_seat_v2 *zcr_gaming_seat_v2, void *user_data)
+{
+ wl_proxy_set_user_data((struct wl_proxy *) zcr_gaming_seat_v2, user_data);
+}
+
+/** @ingroup iface_zcr_gaming_seat_v2 */
+static inline void *
+zcr_gaming_seat_v2_get_user_data(struct zcr_gaming_seat_v2 *zcr_gaming_seat_v2)
+{
+ return wl_proxy_get_user_data((struct wl_proxy *) zcr_gaming_seat_v2);
+}
+
+static inline uint32_t
+zcr_gaming_seat_v2_get_version(struct zcr_gaming_seat_v2 *zcr_gaming_seat_v2)
+{
+ return wl_proxy_get_version((struct wl_proxy *) zcr_gaming_seat_v2);
+}
+
+/**
+ * @ingroup iface_zcr_gaming_seat_v2
+ *
+ * Destroy gaming_seat object. Objects created from this object are
+ * unaffected and should be destroyed separately.
+ */
+static inline void
+zcr_gaming_seat_v2_destroy(struct zcr_gaming_seat_v2 *zcr_gaming_seat_v2)
+{
+ wl_proxy_marshal((struct wl_proxy *) zcr_gaming_seat_v2,
+ ZCR_GAMING_SEAT_V2_DESTROY);
+
+ wl_proxy_destroy((struct wl_proxy *) zcr_gaming_seat_v2);
+}
+
+#ifndef ZCR_GAMEPAD_V2_BUTTON_STATE_ENUM
+#define ZCR_GAMEPAD_V2_BUTTON_STATE_ENUM
+/**
+ * @ingroup iface_zcr_gamepad_v2
+ * physical button state
+ *
+ * Describes the physical state of a button that produced the button
+ * event.
+ */
+enum zcr_gamepad_v2_button_state {
+ /**
+ * the button is not pressed
+ */
+ ZCR_GAMEPAD_V2_BUTTON_STATE_RELEASED = 0,
+ /**
+ * the button is pressed
+ */
+ ZCR_GAMEPAD_V2_BUTTON_STATE_PRESSED = 1,
+};
+#endif /* ZCR_GAMEPAD_V2_BUTTON_STATE_ENUM */
+
+/**
+ * @ingroup iface_zcr_gamepad_v2
+ * @struct zcr_gamepad_v2_listener
+ */
+struct zcr_gamepad_v2_listener {
+ /**
+ * gamepad removed
+ *
+ * Removed event is send when the gamepad is disconnected. The
+ * client should expect no more event and call destroy.
+ *
+ * This event cannot be used as destructor as requests (e.g.
+ * vibration) might be added to this interface.
+ */
+ void (*removed)(void *data,
+ struct zcr_gamepad_v2 *zcr_gamepad_v2);
+ /**
+ * axis change event
+ *
+ * Notification of axis change.
+ *
+ * The axis id specifies which axis has changed as defined by the
+ * W3C 'Standard Gamepad'.
+ *
+ * The value is calibrated and normalized to the -1 to 1 range.
+ * @param time timestamp with millisecond granularity
+ * @param axis axis that produced this event
+ * @param value new value of axis
+ */
+ void (*axis)(void *data,
+ struct zcr_gamepad_v2 *zcr_gamepad_v2,
+ uint32_t time,
+ uint32_t axis,
+ wl_fixed_t value);
+ /**
+ * Gamepad button changed
+ *
+ * Notification of button change.
+ *
+ * The button id specifies which button has changed as defined by
+ * the W3C 'Standard Gamepad'.
+ *
+ * A button can have a digital and an analog value. The analog
+ * value is normalized to a 0 to 1 range. If a button does not
+ * provide an analog value, it will be derived from the digital
+ * state.
+ * @param time timestamp with millisecond granularity
+ * @param button id of button
+ * @param state digital state of the button
+ * @param analog analog value of the button
+ */
+ void (*button)(void *data,
+ struct zcr_gamepad_v2 *zcr_gamepad_v2,
+ uint32_t time,
+ uint32_t button,
+ uint32_t state,
+ wl_fixed_t analog);
+ /**
+ * Notifies end of a series of gamepad changes.
+ *
+ * Indicates the end of a set of events that logically belong
+ * together. A client is expected to accumulate the data in all
+ * events within the frame before proceeding.
+ * @param time timestamp with millisecond granularity
+ */
+ void (*frame)(void *data,
+ struct zcr_gamepad_v2 *zcr_gamepad_v2,
+ uint32_t time);
+};
+
+/**
+ * @ingroup iface_zcr_gamepad_v2
+ */
+static inline int
+zcr_gamepad_v2_add_listener(struct zcr_gamepad_v2 *zcr_gamepad_v2,
+ const struct zcr_gamepad_v2_listener *listener, void *data)
+{
+ return wl_proxy_add_listener((struct wl_proxy *) zcr_gamepad_v2,
+ (void (**)(void)) listener, data);
+}
+
+#define ZCR_GAMEPAD_V2_DESTROY 0
+
+/**
+ * @ingroup iface_zcr_gamepad_v2
+ */
+#define ZCR_GAMEPAD_V2_REMOVED_SINCE_VERSION 1
+/**
+ * @ingroup iface_zcr_gamepad_v2
+ */
+#define ZCR_GAMEPAD_V2_AXIS_SINCE_VERSION 1
+/**
+ * @ingroup iface_zcr_gamepad_v2
+ */
+#define ZCR_GAMEPAD_V2_BUTTON_SINCE_VERSION 1
+/**
+ * @ingroup iface_zcr_gamepad_v2
+ */
+#define ZCR_GAMEPAD_V2_FRAME_SINCE_VERSION 1
+
+/**
+ * @ingroup iface_zcr_gamepad_v2
+ */
+#define ZCR_GAMEPAD_V2_DESTROY_SINCE_VERSION 1
+
+/** @ingroup iface_zcr_gamepad_v2 */
+static inline void
+zcr_gamepad_v2_set_user_data(struct zcr_gamepad_v2 *zcr_gamepad_v2, void *user_data)
+{
+ wl_proxy_set_user_data((struct wl_proxy *) zcr_gamepad_v2, user_data);
+}
+
+/** @ingroup iface_zcr_gamepad_v2 */
+static inline void *
+zcr_gamepad_v2_get_user_data(struct zcr_gamepad_v2 *zcr_gamepad_v2)
+{
+ return wl_proxy_get_user_data((struct wl_proxy *) zcr_gamepad_v2);
+}
+
+static inline uint32_t
+zcr_gamepad_v2_get_version(struct zcr_gamepad_v2 *zcr_gamepad_v2)
+{
+ return wl_proxy_get_version((struct wl_proxy *) zcr_gamepad_v2);
+}
+
+/**
+ * @ingroup iface_zcr_gamepad_v2
+ */
+static inline void
+zcr_gamepad_v2_destroy(struct zcr_gamepad_v2 *zcr_gamepad_v2)
+{
+ wl_proxy_marshal((struct wl_proxy *) zcr_gamepad_v2,
+ ZCR_GAMEPAD_V2_DESTROY);
+
+ wl_proxy_destroy((struct wl_proxy *) zcr_gamepad_v2);
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/chromium/third_party/wayland-protocols/include/protocol/gaming-input-unstable-v2-server-protocol.h b/chromium/third_party/wayland-protocols/include/protocol/gaming-input-unstable-v2-server-protocol.h
new file mode 100644
index 00000000000..eeba3aeb93b
--- /dev/null
+++ b/chromium/third_party/wayland-protocols/include/protocol/gaming-input-unstable-v2-server-protocol.h
@@ -0,0 +1,316 @@
+/* Generated by wayland-scanner 1.13.0 */
+
+#ifndef GAMING_INPUT_UNSTABLE_V2_SERVER_PROTOCOL_H
+#define GAMING_INPUT_UNSTABLE_V2_SERVER_PROTOCOL_H
+
+#include <stdint.h>
+#include <stddef.h>
+#include "wayland-server.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct wl_client;
+struct wl_resource;
+
+/**
+ * @page page_gaming_input_unstable_v2 The gaming_input_unstable_v2 protocol
+ * @section page_ifaces_gaming_input_unstable_v2 Interfaces
+ * - @subpage page_iface_zcr_gaming_input_v2 - extends wl_seat with gaming input devices
+ * - @subpage page_iface_zcr_gaming_seat_v2 - controller object for all gaming devices of a seat
+ * - @subpage page_iface_zcr_gamepad_v2 - gamepad input device
+ * @section page_copyright_gaming_input_unstable_v2 Copyright
+ * <pre>
+ *
+ * Copyright 2016 The Chromium Authors.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ * </pre>
+ */
+struct wl_seat;
+struct zcr_gamepad_v2;
+struct zcr_gaming_input_v2;
+struct zcr_gaming_seat_v2;
+
+/**
+ * @page page_iface_zcr_gaming_input_v2 zcr_gaming_input_v2
+ * @section page_iface_zcr_gaming_input_v2_desc Description
+ *
+ * A global interface to provide gaming input devices for a given seat.
+ *
+ * Currently only gamepad devices are supported.
+ *
+ * Warning! The protocol described in this file is experimental and
+ * backward incompatible changes may be made. Backward compatible changes
+ * may be added together with the corresponding uinterface version bump.
+ * Backward incompatible changes are done by bumping the version number in
+ * the protocol and uinterface names and resetting the interface version.
+ * Once the protocol is to be declared stable, the 'z' prefix and the
+ * version number in the protocol and interface names are removed and the
+ * interface version number is reset.
+ * @section page_iface_zcr_gaming_input_v2_api API
+ * See @ref iface_zcr_gaming_input_v2.
+ */
+/**
+ * @defgroup iface_zcr_gaming_input_v2 The zcr_gaming_input_v2 interface
+ *
+ * A global interface to provide gaming input devices for a given seat.
+ *
+ * Currently only gamepad devices are supported.
+ *
+ * Warning! The protocol described in this file is experimental and
+ * backward incompatible changes may be made. Backward compatible changes
+ * may be added together with the corresponding uinterface version bump.
+ * Backward incompatible changes are done by bumping the version number in
+ * the protocol and uinterface names and resetting the interface version.
+ * Once the protocol is to be declared stable, the 'z' prefix and the
+ * version number in the protocol and interface names are removed and the
+ * interface version number is reset.
+ */
+extern const struct wl_interface zcr_gaming_input_v2_interface;
+/**
+ * @page page_iface_zcr_gaming_seat_v2 zcr_gaming_seat_v2
+ * @section page_iface_zcr_gaming_seat_v2_desc Description
+ *
+ * An object that provides access to all the gaming devices of a seat.
+ * When a gamepad is connected, the compositor will send gamepad_added event.
+ * @section page_iface_zcr_gaming_seat_v2_api API
+ * See @ref iface_zcr_gaming_seat_v2.
+ */
+/**
+ * @defgroup iface_zcr_gaming_seat_v2 The zcr_gaming_seat_v2 interface
+ *
+ * An object that provides access to all the gaming devices of a seat.
+ * When a gamepad is connected, the compositor will send gamepad_added event.
+ */
+extern const struct wl_interface zcr_gaming_seat_v2_interface;
+/**
+ * @page page_iface_zcr_gamepad_v2 zcr_gamepad_v2
+ * @section page_iface_zcr_gamepad_v2_desc Description
+ *
+ * The zcr_gamepad_v2 interface represents one or more gamepad input devices,
+ * which are reported as a normalized 'Standard Gamepad' as it is specified
+ * by the W3C Gamepad API at: https://w3c.github.io/gamepad/#remapping
+ * @section page_iface_zcr_gamepad_v2_api API
+ * See @ref iface_zcr_gamepad_v2.
+ */
+/**
+ * @defgroup iface_zcr_gamepad_v2 The zcr_gamepad_v2 interface
+ *
+ * The zcr_gamepad_v2 interface represents one or more gamepad input devices,
+ * which are reported as a normalized 'Standard Gamepad' as it is specified
+ * by the W3C Gamepad API at: https://w3c.github.io/gamepad/#remapping
+ */
+extern const struct wl_interface zcr_gamepad_v2_interface;
+
+/**
+ * @ingroup iface_zcr_gaming_input_v2
+ * @struct zcr_gaming_input_v2_interface
+ */
+struct zcr_gaming_input_v2_interface {
+ /**
+ * get a gaming seat
+ *
+ * Get a gaming seat object for a given seat. Gaming seat
+ * provides access to gaming devices
+ */
+ void (*get_gaming_seat)(struct wl_client *client,
+ struct wl_resource *resource,
+ uint32_t gaming_seat,
+ struct wl_resource *seat);
+ /**
+ * release the memory for the gaming input object
+ *
+ * Destroy gaming_input object. Objects created from this object
+ * are unaffected and should be destroyed separately.
+ */
+ void (*destroy)(struct wl_client *client,
+ struct wl_resource *resource);
+};
+
+
+/**
+ * @ingroup iface_zcr_gaming_input_v2
+ */
+#define ZCR_GAMING_INPUT_V2_GET_GAMING_SEAT_SINCE_VERSION 1
+/**
+ * @ingroup iface_zcr_gaming_input_v2
+ */
+#define ZCR_GAMING_INPUT_V2_DESTROY_SINCE_VERSION 1
+
+/**
+ * @ingroup iface_zcr_gaming_seat_v2
+ * @struct zcr_gaming_seat_v2_interface
+ */
+struct zcr_gaming_seat_v2_interface {
+ /**
+ * release the memory for the gaming seat object
+ *
+ * Destroy gaming_seat object. Objects created from this object
+ * are unaffected and should be destroyed separately.
+ */
+ void (*destroy)(struct wl_client *client,
+ struct wl_resource *resource);
+};
+
+#define ZCR_GAMING_SEAT_V2_GAMEPAD_ADDED 0
+
+/**
+ * @ingroup iface_zcr_gaming_seat_v2
+ */
+#define ZCR_GAMING_SEAT_V2_GAMEPAD_ADDED_SINCE_VERSION 1
+
+/**
+ * @ingroup iface_zcr_gaming_seat_v2
+ */
+#define ZCR_GAMING_SEAT_V2_DESTROY_SINCE_VERSION 1
+
+/**
+ * @ingroup iface_zcr_gaming_seat_v2
+ * Sends an gamepad_added event to the client owning the resource.
+ * @param resource_ The client's resource
+ * @param gamepad new connected gamepad
+ */
+static inline void
+zcr_gaming_seat_v2_send_gamepad_added(struct wl_resource *resource_, struct wl_resource *gamepad)
+{
+ wl_resource_post_event(resource_, ZCR_GAMING_SEAT_V2_GAMEPAD_ADDED, gamepad);
+}
+
+#ifndef ZCR_GAMEPAD_V2_BUTTON_STATE_ENUM
+#define ZCR_GAMEPAD_V2_BUTTON_STATE_ENUM
+/**
+ * @ingroup iface_zcr_gamepad_v2
+ * physical button state
+ *
+ * Describes the physical state of a button that produced the button
+ * event.
+ */
+enum zcr_gamepad_v2_button_state {
+ /**
+ * the button is not pressed
+ */
+ ZCR_GAMEPAD_V2_BUTTON_STATE_RELEASED = 0,
+ /**
+ * the button is pressed
+ */
+ ZCR_GAMEPAD_V2_BUTTON_STATE_PRESSED = 1,
+};
+#endif /* ZCR_GAMEPAD_V2_BUTTON_STATE_ENUM */
+
+/**
+ * @ingroup iface_zcr_gamepad_v2
+ * @struct zcr_gamepad_v2_interface
+ */
+struct zcr_gamepad_v2_interface {
+ /**
+ * destroy gamepad object
+ *
+ *
+ */
+ void (*destroy)(struct wl_client *client,
+ struct wl_resource *resource);
+};
+
+#define ZCR_GAMEPAD_V2_REMOVED 0
+#define ZCR_GAMEPAD_V2_AXIS 1
+#define ZCR_GAMEPAD_V2_BUTTON 2
+#define ZCR_GAMEPAD_V2_FRAME 3
+
+/**
+ * @ingroup iface_zcr_gamepad_v2
+ */
+#define ZCR_GAMEPAD_V2_REMOVED_SINCE_VERSION 1
+/**
+ * @ingroup iface_zcr_gamepad_v2
+ */
+#define ZCR_GAMEPAD_V2_AXIS_SINCE_VERSION 1
+/**
+ * @ingroup iface_zcr_gamepad_v2
+ */
+#define ZCR_GAMEPAD_V2_BUTTON_SINCE_VERSION 1
+/**
+ * @ingroup iface_zcr_gamepad_v2
+ */
+#define ZCR_GAMEPAD_V2_FRAME_SINCE_VERSION 1
+
+/**
+ * @ingroup iface_zcr_gamepad_v2
+ */
+#define ZCR_GAMEPAD_V2_DESTROY_SINCE_VERSION 1
+
+/**
+ * @ingroup iface_zcr_gamepad_v2
+ * Sends an removed event to the client owning the resource.
+ * @param resource_ The client's resource
+ */
+static inline void
+zcr_gamepad_v2_send_removed(struct wl_resource *resource_)
+{
+ wl_resource_post_event(resource_, ZCR_GAMEPAD_V2_REMOVED);
+}
+
+/**
+ * @ingroup iface_zcr_gamepad_v2
+ * Sends an axis event to the client owning the resource.
+ * @param resource_ The client's resource
+ * @param time timestamp with millisecond granularity
+ * @param axis axis that produced this event
+ * @param value new value of axis
+ */
+static inline void
+zcr_gamepad_v2_send_axis(struct wl_resource *resource_, uint32_t time, uint32_t axis, wl_fixed_t value)
+{
+ wl_resource_post_event(resource_, ZCR_GAMEPAD_V2_AXIS, time, axis, value);
+}
+
+/**
+ * @ingroup iface_zcr_gamepad_v2
+ * Sends an button event to the client owning the resource.
+ * @param resource_ The client's resource
+ * @param time timestamp with millisecond granularity
+ * @param button id of button
+ * @param state digital state of the button
+ * @param analog analog value of the button
+ */
+static inline void
+zcr_gamepad_v2_send_button(struct wl_resource *resource_, uint32_t time, uint32_t button, uint32_t state, wl_fixed_t analog)
+{
+ wl_resource_post_event(resource_, ZCR_GAMEPAD_V2_BUTTON, time, button, state, analog);
+}
+
+/**
+ * @ingroup iface_zcr_gamepad_v2
+ * Sends an frame event to the client owning the resource.
+ * @param resource_ The client's resource
+ * @param time timestamp with millisecond granularity
+ */
+static inline void
+zcr_gamepad_v2_send_frame(struct wl_resource *resource_, uint32_t time)
+{
+ wl_resource_post_event(resource_, ZCR_GAMEPAD_V2_FRAME, time);
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/chromium/third_party/wayland-protocols/include/protocol/keyboard-configuration-unstable-v1-client-protocol.h b/chromium/third_party/wayland-protocols/include/protocol/keyboard-configuration-unstable-v1-client-protocol.h
new file mode 100644
index 00000000000..5087c849a09
--- /dev/null
+++ b/chromium/third_party/wayland-protocols/include/protocol/keyboard-configuration-unstable-v1-client-protocol.h
@@ -0,0 +1,260 @@
+/* Generated by wayland-scanner 1.13.0 */
+
+#ifndef KEYBOARD_CONFIGURATION_UNSTABLE_V1_CLIENT_PROTOCOL_H
+#define KEYBOARD_CONFIGURATION_UNSTABLE_V1_CLIENT_PROTOCOL_H
+
+#include <stdint.h>
+#include <stddef.h>
+#include "wayland-client.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @page page_keyboard_configuration_unstable_v1 The keyboard_configuration_unstable_v1 protocol
+ * @section page_ifaces_keyboard_configuration_unstable_v1 Interfaces
+ * - @subpage page_iface_zcr_keyboard_configuration_v1 - extends wl_keyboard with events for device configuration change
+ * - @subpage page_iface_zcr_keyboard_device_configuration_v1 - extension of wl_keyboard protocol
+ * @section page_copyright_keyboard_configuration_unstable_v1 Copyright
+ * <pre>
+ *
+ * Copyright 2016 The Chromium Authors.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ * </pre>
+ */
+struct wl_keyboard;
+struct zcr_keyboard_configuration_v1;
+struct zcr_keyboard_device_configuration_v1;
+
+/**
+ * @page page_iface_zcr_keyboard_configuration_v1 zcr_keyboard_configuration_v1
+ * @section page_iface_zcr_keyboard_configuration_v1_desc Description
+ *
+ * Allows a wl_keyboard to notify device configuration change events of
+ * the keyboard to the client.
+ *
+ * Warning! The protocol described in this file is experimental and
+ * backward incompatible changes may be made. Backward compatible changes
+ * may be added together with the corresponding uinterface version bump.
+ * Backward incompatible changes are done by bumping the version number in
+ * the protocol and uinterface names and resetting the interface version.
+ * Once the protocol is to be declared stable, the 'z' prefix and the
+ * version number in the protocol and interface names are removed and the
+ * interface version number is reset.
+ * @section page_iface_zcr_keyboard_configuration_v1_api API
+ * See @ref iface_zcr_keyboard_configuration_v1.
+ */
+/**
+ * @defgroup iface_zcr_keyboard_configuration_v1 The zcr_keyboard_configuration_v1 interface
+ *
+ * Allows a wl_keyboard to notify device configuration change events of
+ * the keyboard to the client.
+ *
+ * Warning! The protocol described in this file is experimental and
+ * backward incompatible changes may be made. Backward compatible changes
+ * may be added together with the corresponding uinterface version bump.
+ * Backward incompatible changes are done by bumping the version number in
+ * the protocol and uinterface names and resetting the interface version.
+ * Once the protocol is to be declared stable, the 'z' prefix and the
+ * version number in the protocol and interface names are removed and the
+ * interface version number is reset.
+ */
+extern const struct wl_interface zcr_keyboard_configuration_v1_interface;
+/**
+ * @page page_iface_zcr_keyboard_device_configuration_v1 zcr_keyboard_device_configuration_v1
+ * @section page_iface_zcr_keyboard_device_configuration_v1_desc Description
+ *
+ * The zcr_keyboard_device_configuration_v1 interface extends the wl_keyboard
+ * interface with events to describe device configuration of a keyboard.
+ * @section page_iface_zcr_keyboard_device_configuration_v1_api API
+ * See @ref iface_zcr_keyboard_device_configuration_v1.
+ */
+/**
+ * @defgroup iface_zcr_keyboard_device_configuration_v1 The zcr_keyboard_device_configuration_v1 interface
+ *
+ * The zcr_keyboard_device_configuration_v1 interface extends the wl_keyboard
+ * interface with events to describe device configuration of a keyboard.
+ */
+extern const struct wl_interface zcr_keyboard_device_configuration_v1_interface;
+
+#ifndef ZCR_KEYBOARD_CONFIGURATION_V1_ERROR_ENUM
+#define ZCR_KEYBOARD_CONFIGURATION_V1_ERROR_ENUM
+enum zcr_keyboard_configuration_v1_error {
+ /**
+ * the keyboard already has a device configuration object associated
+ */
+ ZCR_KEYBOARD_CONFIGURATION_V1_ERROR_DEVICE_CONFIGURATION_EXISTS = 0,
+};
+#endif /* ZCR_KEYBOARD_CONFIGURATION_V1_ERROR_ENUM */
+
+#define ZCR_KEYBOARD_CONFIGURATION_V1_GET_KEYBOARD_DEVICE_CONFIGURATION 0
+
+
+/**
+ * @ingroup iface_zcr_keyboard_configuration_v1
+ */
+#define ZCR_KEYBOARD_CONFIGURATION_V1_GET_KEYBOARD_DEVICE_CONFIGURATION_SINCE_VERSION 1
+
+/** @ingroup iface_zcr_keyboard_configuration_v1 */
+static inline void
+zcr_keyboard_configuration_v1_set_user_data(struct zcr_keyboard_configuration_v1 *zcr_keyboard_configuration_v1, void *user_data)
+{
+ wl_proxy_set_user_data((struct wl_proxy *) zcr_keyboard_configuration_v1, user_data);
+}
+
+/** @ingroup iface_zcr_keyboard_configuration_v1 */
+static inline void *
+zcr_keyboard_configuration_v1_get_user_data(struct zcr_keyboard_configuration_v1 *zcr_keyboard_configuration_v1)
+{
+ return wl_proxy_get_user_data((struct wl_proxy *) zcr_keyboard_configuration_v1);
+}
+
+static inline uint32_t
+zcr_keyboard_configuration_v1_get_version(struct zcr_keyboard_configuration_v1 *zcr_keyboard_configuration_v1)
+{
+ return wl_proxy_get_version((struct wl_proxy *) zcr_keyboard_configuration_v1);
+}
+
+/** @ingroup iface_zcr_keyboard_configuration_v1 */
+static inline void
+zcr_keyboard_configuration_v1_destroy(struct zcr_keyboard_configuration_v1 *zcr_keyboard_configuration_v1)
+{
+ wl_proxy_destroy((struct wl_proxy *) zcr_keyboard_configuration_v1);
+}
+
+/**
+ * @ingroup iface_zcr_keyboard_configuration_v1
+ *
+ * Create keyboard_device_configuration object.
+ * See zcr_keyboard_device_configuration interface for details.
+ * If the given wl_keyboard object already has a device configuration
+ * object associated, the keyboard_device_configuration_exists protocol
+ * error is raised.
+ */
+static inline struct zcr_keyboard_device_configuration_v1 *
+zcr_keyboard_configuration_v1_get_keyboard_device_configuration(struct zcr_keyboard_configuration_v1 *zcr_keyboard_configuration_v1, struct wl_keyboard *keyboard)
+{
+ struct wl_proxy *id;
+
+ id = wl_proxy_marshal_constructor((struct wl_proxy *) zcr_keyboard_configuration_v1,
+ ZCR_KEYBOARD_CONFIGURATION_V1_GET_KEYBOARD_DEVICE_CONFIGURATION, &zcr_keyboard_device_configuration_v1_interface, NULL, keyboard);
+
+ return (struct zcr_keyboard_device_configuration_v1 *) id;
+}
+
+#ifndef ZCR_KEYBOARD_DEVICE_CONFIGURATION_V1_KEYBOARD_TYPE_ENUM
+#define ZCR_KEYBOARD_DEVICE_CONFIGURATION_V1_KEYBOARD_TYPE_ENUM
+/**
+ * @ingroup iface_zcr_keyboard_device_configuration_v1
+ * keyboard types
+ */
+enum zcr_keyboard_device_configuration_v1_keyboard_type {
+ /**
+ * Physical keyboard
+ */
+ ZCR_KEYBOARD_DEVICE_CONFIGURATION_V1_KEYBOARD_TYPE_PHYSICAL = 0,
+ /**
+ * Virtual keyboard
+ */
+ ZCR_KEYBOARD_DEVICE_CONFIGURATION_V1_KEYBOARD_TYPE_VIRTUAL = 1,
+};
+#endif /* ZCR_KEYBOARD_DEVICE_CONFIGURATION_V1_KEYBOARD_TYPE_ENUM */
+
+/**
+ * @ingroup iface_zcr_keyboard_device_configuration_v1
+ * @struct zcr_keyboard_device_configuration_v1_listener
+ */
+struct zcr_keyboard_device_configuration_v1_listener {
+ /**
+ * keyboard type changed
+ *
+ * Notification that the user is switching to new keyboard type.
+ *
+ * If this event is not received, the cleint has to assume a
+ * physical keyboard is in use.
+ * @param type new device type
+ */
+ void (*type_change)(void *data,
+ struct zcr_keyboard_device_configuration_v1 *zcr_keyboard_device_configuration_v1,
+ uint32_t type);
+};
+
+/**
+ * @ingroup iface_zcr_keyboard_device_configuration_v1
+ */
+static inline int
+zcr_keyboard_device_configuration_v1_add_listener(struct zcr_keyboard_device_configuration_v1 *zcr_keyboard_device_configuration_v1,
+ const struct zcr_keyboard_device_configuration_v1_listener *listener, void *data)
+{
+ return wl_proxy_add_listener((struct wl_proxy *) zcr_keyboard_device_configuration_v1,
+ (void (**)(void)) listener, data);
+}
+
+#define ZCR_KEYBOARD_DEVICE_CONFIGURATION_V1_DESTROY 0
+
+/**
+ * @ingroup iface_zcr_keyboard_device_configuration_v1
+ */
+#define ZCR_KEYBOARD_DEVICE_CONFIGURATION_V1_TYPE_CHANGE_SINCE_VERSION 1
+
+/**
+ * @ingroup iface_zcr_keyboard_device_configuration_v1
+ */
+#define ZCR_KEYBOARD_DEVICE_CONFIGURATION_V1_DESTROY_SINCE_VERSION 1
+
+/** @ingroup iface_zcr_keyboard_device_configuration_v1 */
+static inline void
+zcr_keyboard_device_configuration_v1_set_user_data(struct zcr_keyboard_device_configuration_v1 *zcr_keyboard_device_configuration_v1, void *user_data)
+{
+ wl_proxy_set_user_data((struct wl_proxy *) zcr_keyboard_device_configuration_v1, user_data);
+}
+
+/** @ingroup iface_zcr_keyboard_device_configuration_v1 */
+static inline void *
+zcr_keyboard_device_configuration_v1_get_user_data(struct zcr_keyboard_device_configuration_v1 *zcr_keyboard_device_configuration_v1)
+{
+ return wl_proxy_get_user_data((struct wl_proxy *) zcr_keyboard_device_configuration_v1);
+}
+
+static inline uint32_t
+zcr_keyboard_device_configuration_v1_get_version(struct zcr_keyboard_device_configuration_v1 *zcr_keyboard_device_configuration_v1)
+{
+ return wl_proxy_get_version((struct wl_proxy *) zcr_keyboard_device_configuration_v1);
+}
+
+/**
+ * @ingroup iface_zcr_keyboard_device_configuration_v1
+ */
+static inline void
+zcr_keyboard_device_configuration_v1_destroy(struct zcr_keyboard_device_configuration_v1 *zcr_keyboard_device_configuration_v1)
+{
+ wl_proxy_marshal((struct wl_proxy *) zcr_keyboard_device_configuration_v1,
+ ZCR_KEYBOARD_DEVICE_CONFIGURATION_V1_DESTROY);
+
+ wl_proxy_destroy((struct wl_proxy *) zcr_keyboard_device_configuration_v1);
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/chromium/third_party/wayland-protocols/include/protocol/keyboard-configuration-unstable-v1-server-protocol.h b/chromium/third_party/wayland-protocols/include/protocol/keyboard-configuration-unstable-v1-server-protocol.h
new file mode 100644
index 00000000000..bf17f5efd0e
--- /dev/null
+++ b/chromium/third_party/wayland-protocols/include/protocol/keyboard-configuration-unstable-v1-server-protocol.h
@@ -0,0 +1,198 @@
+/* Generated by wayland-scanner 1.13.0 */
+
+#ifndef KEYBOARD_CONFIGURATION_UNSTABLE_V1_SERVER_PROTOCOL_H
+#define KEYBOARD_CONFIGURATION_UNSTABLE_V1_SERVER_PROTOCOL_H
+
+#include <stdint.h>
+#include <stddef.h>
+#include "wayland-server.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct wl_client;
+struct wl_resource;
+
+/**
+ * @page page_keyboard_configuration_unstable_v1 The keyboard_configuration_unstable_v1 protocol
+ * @section page_ifaces_keyboard_configuration_unstable_v1 Interfaces
+ * - @subpage page_iface_zcr_keyboard_configuration_v1 - extends wl_keyboard with events for device configuration change
+ * - @subpage page_iface_zcr_keyboard_device_configuration_v1 - extension of wl_keyboard protocol
+ * @section page_copyright_keyboard_configuration_unstable_v1 Copyright
+ * <pre>
+ *
+ * Copyright 2016 The Chromium Authors.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ * </pre>
+ */
+struct wl_keyboard;
+struct zcr_keyboard_configuration_v1;
+struct zcr_keyboard_device_configuration_v1;
+
+/**
+ * @page page_iface_zcr_keyboard_configuration_v1 zcr_keyboard_configuration_v1
+ * @section page_iface_zcr_keyboard_configuration_v1_desc Description
+ *
+ * Allows a wl_keyboard to notify device configuration change events of
+ * the keyboard to the client.
+ *
+ * Warning! The protocol described in this file is experimental and
+ * backward incompatible changes may be made. Backward compatible changes
+ * may be added together with the corresponding uinterface version bump.
+ * Backward incompatible changes are done by bumping the version number in
+ * the protocol and uinterface names and resetting the interface version.
+ * Once the protocol is to be declared stable, the 'z' prefix and the
+ * version number in the protocol and interface names are removed and the
+ * interface version number is reset.
+ * @section page_iface_zcr_keyboard_configuration_v1_api API
+ * See @ref iface_zcr_keyboard_configuration_v1.
+ */
+/**
+ * @defgroup iface_zcr_keyboard_configuration_v1 The zcr_keyboard_configuration_v1 interface
+ *
+ * Allows a wl_keyboard to notify device configuration change events of
+ * the keyboard to the client.
+ *
+ * Warning! The protocol described in this file is experimental and
+ * backward incompatible changes may be made. Backward compatible changes
+ * may be added together with the corresponding uinterface version bump.
+ * Backward incompatible changes are done by bumping the version number in
+ * the protocol and uinterface names and resetting the interface version.
+ * Once the protocol is to be declared stable, the 'z' prefix and the
+ * version number in the protocol and interface names are removed and the
+ * interface version number is reset.
+ */
+extern const struct wl_interface zcr_keyboard_configuration_v1_interface;
+/**
+ * @page page_iface_zcr_keyboard_device_configuration_v1 zcr_keyboard_device_configuration_v1
+ * @section page_iface_zcr_keyboard_device_configuration_v1_desc Description
+ *
+ * The zcr_keyboard_device_configuration_v1 interface extends the wl_keyboard
+ * interface with events to describe device configuration of a keyboard.
+ * @section page_iface_zcr_keyboard_device_configuration_v1_api API
+ * See @ref iface_zcr_keyboard_device_configuration_v1.
+ */
+/**
+ * @defgroup iface_zcr_keyboard_device_configuration_v1 The zcr_keyboard_device_configuration_v1 interface
+ *
+ * The zcr_keyboard_device_configuration_v1 interface extends the wl_keyboard
+ * interface with events to describe device configuration of a keyboard.
+ */
+extern const struct wl_interface zcr_keyboard_device_configuration_v1_interface;
+
+#ifndef ZCR_KEYBOARD_CONFIGURATION_V1_ERROR_ENUM
+#define ZCR_KEYBOARD_CONFIGURATION_V1_ERROR_ENUM
+enum zcr_keyboard_configuration_v1_error {
+ /**
+ * the keyboard already has a device configuration object associated
+ */
+ ZCR_KEYBOARD_CONFIGURATION_V1_ERROR_DEVICE_CONFIGURATION_EXISTS = 0,
+};
+#endif /* ZCR_KEYBOARD_CONFIGURATION_V1_ERROR_ENUM */
+
+/**
+ * @ingroup iface_zcr_keyboard_configuration_v1
+ * @struct zcr_keyboard_configuration_v1_interface
+ */
+struct zcr_keyboard_configuration_v1_interface {
+ /**
+ * get keyboard_device_configuration interface for a keyboard
+ *
+ * Create keyboard_device_configuration object. See
+ * zcr_keyboard_device_configuration interface for details. If the
+ * given wl_keyboard object already has a device configuration
+ * object associated, the keyboard_device_configuration_exists
+ * protocol error is raised.
+ */
+ void (*get_keyboard_device_configuration)(struct wl_client *client,
+ struct wl_resource *resource,
+ uint32_t id,
+ struct wl_resource *keyboard);
+};
+
+
+/**
+ * @ingroup iface_zcr_keyboard_configuration_v1
+ */
+#define ZCR_KEYBOARD_CONFIGURATION_V1_GET_KEYBOARD_DEVICE_CONFIGURATION_SINCE_VERSION 1
+
+#ifndef ZCR_KEYBOARD_DEVICE_CONFIGURATION_V1_KEYBOARD_TYPE_ENUM
+#define ZCR_KEYBOARD_DEVICE_CONFIGURATION_V1_KEYBOARD_TYPE_ENUM
+/**
+ * @ingroup iface_zcr_keyboard_device_configuration_v1
+ * keyboard types
+ */
+enum zcr_keyboard_device_configuration_v1_keyboard_type {
+ /**
+ * Physical keyboard
+ */
+ ZCR_KEYBOARD_DEVICE_CONFIGURATION_V1_KEYBOARD_TYPE_PHYSICAL = 0,
+ /**
+ * Virtual keyboard
+ */
+ ZCR_KEYBOARD_DEVICE_CONFIGURATION_V1_KEYBOARD_TYPE_VIRTUAL = 1,
+};
+#endif /* ZCR_KEYBOARD_DEVICE_CONFIGURATION_V1_KEYBOARD_TYPE_ENUM */
+
+/**
+ * @ingroup iface_zcr_keyboard_device_configuration_v1
+ * @struct zcr_keyboard_device_configuration_v1_interface
+ */
+struct zcr_keyboard_device_configuration_v1_interface {
+ /**
+ * destroy keyboard_device_configuration object
+ *
+ *
+ */
+ void (*destroy)(struct wl_client *client,
+ struct wl_resource *resource);
+};
+
+#define ZCR_KEYBOARD_DEVICE_CONFIGURATION_V1_TYPE_CHANGE 0
+
+/**
+ * @ingroup iface_zcr_keyboard_device_configuration_v1
+ */
+#define ZCR_KEYBOARD_DEVICE_CONFIGURATION_V1_TYPE_CHANGE_SINCE_VERSION 1
+
+/**
+ * @ingroup iface_zcr_keyboard_device_configuration_v1
+ */
+#define ZCR_KEYBOARD_DEVICE_CONFIGURATION_V1_DESTROY_SINCE_VERSION 1
+
+/**
+ * @ingroup iface_zcr_keyboard_device_configuration_v1
+ * Sends an type_change event to the client owning the resource.
+ * @param resource_ The client's resource
+ * @param type new device type
+ */
+static inline void
+zcr_keyboard_device_configuration_v1_send_type_change(struct wl_resource *resource_, uint32_t type)
+{
+ wl_resource_post_event(resource_, ZCR_KEYBOARD_DEVICE_CONFIGURATION_V1_TYPE_CHANGE, type);
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/chromium/third_party/wayland-protocols/include/protocol/keyboard-extension-unstable-v1-client-protocol.h b/chromium/third_party/wayland-protocols/include/protocol/keyboard-extension-unstable-v1-client-protocol.h
new file mode 100644
index 00000000000..ce8571f9d29
--- /dev/null
+++ b/chromium/third_party/wayland-protocols/include/protocol/keyboard-extension-unstable-v1-client-protocol.h
@@ -0,0 +1,236 @@
+/* Generated by wayland-scanner 1.13.0 */
+
+#ifndef KEYBOARD_EXTENSION_UNSTABLE_V1_CLIENT_PROTOCOL_H
+#define KEYBOARD_EXTENSION_UNSTABLE_V1_CLIENT_PROTOCOL_H
+
+#include <stdint.h>
+#include <stddef.h>
+#include "wayland-client.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @page page_keyboard_extension_unstable_v1 The keyboard_extension_unstable_v1 protocol
+ * @section page_ifaces_keyboard_extension_unstable_v1 Interfaces
+ * - @subpage page_iface_zcr_keyboard_extension_v1 - extends wl_keyboard with ack_key events
+ * - @subpage page_iface_zcr_extended_keyboard_v1 - extension of wl_keyboard protocol
+ * @section page_copyright_keyboard_extension_unstable_v1 Copyright
+ * <pre>
+ *
+ * Copyright 2017 The Chromium Authors.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ * </pre>
+ */
+struct wl_keyboard;
+struct zcr_extended_keyboard_v1;
+struct zcr_keyboard_extension_v1;
+
+/**
+ * @page page_iface_zcr_keyboard_extension_v1 zcr_keyboard_extension_v1
+ * @section page_iface_zcr_keyboard_extension_v1_desc Description
+ *
+ * Allows a wl_keyboard to send ack_key requests for each key event of
+ * the keyboard to the server.
+ *
+ * Warning! The protocol described in this file is experimental and
+ * backward incompatible changes may be made. Backward compatible changes
+ * may be added together with the corresponding uinterface version bump.
+ * Backward incompatible changes are done by bumping the version number in
+ * the protocol and uinterface names and resetting the interface version.
+ * Once the protocol is to be declared stable, the 'z' prefix and the
+ * version number in the protocol and interface names are removed and the
+ * interface version number is reset.
+ * @section page_iface_zcr_keyboard_extension_v1_api API
+ * See @ref iface_zcr_keyboard_extension_v1.
+ */
+/**
+ * @defgroup iface_zcr_keyboard_extension_v1 The zcr_keyboard_extension_v1 interface
+ *
+ * Allows a wl_keyboard to send ack_key requests for each key event of
+ * the keyboard to the server.
+ *
+ * Warning! The protocol described in this file is experimental and
+ * backward incompatible changes may be made. Backward compatible changes
+ * may be added together with the corresponding uinterface version bump.
+ * Backward incompatible changes are done by bumping the version number in
+ * the protocol and uinterface names and resetting the interface version.
+ * Once the protocol is to be declared stable, the 'z' prefix and the
+ * version number in the protocol and interface names are removed and the
+ * interface version number is reset.
+ */
+extern const struct wl_interface zcr_keyboard_extension_v1_interface;
+/**
+ * @page page_iface_zcr_extended_keyboard_v1 zcr_extended_keyboard_v1
+ * @section page_iface_zcr_extended_keyboard_v1_desc Description
+ *
+ * The zcr_extended_keyboard_v1 interface extends the wl_keyboard interface
+ * with requests to notify whether sent key events are handled or not by
+ * the client.
+ * @section page_iface_zcr_extended_keyboard_v1_api API
+ * See @ref iface_zcr_extended_keyboard_v1.
+ */
+/**
+ * @defgroup iface_zcr_extended_keyboard_v1 The zcr_extended_keyboard_v1 interface
+ *
+ * The zcr_extended_keyboard_v1 interface extends the wl_keyboard interface
+ * with requests to notify whether sent key events are handled or not by
+ * the client.
+ */
+extern const struct wl_interface zcr_extended_keyboard_v1_interface;
+
+#ifndef ZCR_KEYBOARD_EXTENSION_V1_ERROR_ENUM
+#define ZCR_KEYBOARD_EXTENSION_V1_ERROR_ENUM
+enum zcr_keyboard_extension_v1_error {
+ /**
+ * the keyboard already has an extended_keyboard object associated
+ */
+ ZCR_KEYBOARD_EXTENSION_V1_ERROR_EXTENDED_KEYBOARD_EXISTS = 0,
+};
+#endif /* ZCR_KEYBOARD_EXTENSION_V1_ERROR_ENUM */
+
+#define ZCR_KEYBOARD_EXTENSION_V1_GET_EXTENDED_KEYBOARD 0
+
+
+/**
+ * @ingroup iface_zcr_keyboard_extension_v1
+ */
+#define ZCR_KEYBOARD_EXTENSION_V1_GET_EXTENDED_KEYBOARD_SINCE_VERSION 1
+
+/** @ingroup iface_zcr_keyboard_extension_v1 */
+static inline void
+zcr_keyboard_extension_v1_set_user_data(struct zcr_keyboard_extension_v1 *zcr_keyboard_extension_v1, void *user_data)
+{
+ wl_proxy_set_user_data((struct wl_proxy *) zcr_keyboard_extension_v1, user_data);
+}
+
+/** @ingroup iface_zcr_keyboard_extension_v1 */
+static inline void *
+zcr_keyboard_extension_v1_get_user_data(struct zcr_keyboard_extension_v1 *zcr_keyboard_extension_v1)
+{
+ return wl_proxy_get_user_data((struct wl_proxy *) zcr_keyboard_extension_v1);
+}
+
+static inline uint32_t
+zcr_keyboard_extension_v1_get_version(struct zcr_keyboard_extension_v1 *zcr_keyboard_extension_v1)
+{
+ return wl_proxy_get_version((struct wl_proxy *) zcr_keyboard_extension_v1);
+}
+
+/** @ingroup iface_zcr_keyboard_extension_v1 */
+static inline void
+zcr_keyboard_extension_v1_destroy(struct zcr_keyboard_extension_v1 *zcr_keyboard_extension_v1)
+{
+ wl_proxy_destroy((struct wl_proxy *) zcr_keyboard_extension_v1);
+}
+
+/**
+ * @ingroup iface_zcr_keyboard_extension_v1
+ *
+ * Create extended_keyboard object.
+ * See zcr_extended_keyboard interface for details.
+ * If the given wl_keyboard object already has a extended_keyboard object
+ * associated, the extended_keyboard_exists protocol error is raised.
+ */
+static inline struct zcr_extended_keyboard_v1 *
+zcr_keyboard_extension_v1_get_extended_keyboard(struct zcr_keyboard_extension_v1 *zcr_keyboard_extension_v1, struct wl_keyboard *keyboard)
+{
+ struct wl_proxy *id;
+
+ id = wl_proxy_marshal_constructor((struct wl_proxy *) zcr_keyboard_extension_v1,
+ ZCR_KEYBOARD_EXTENSION_V1_GET_EXTENDED_KEYBOARD, &zcr_extended_keyboard_v1_interface, NULL, keyboard);
+
+ return (struct zcr_extended_keyboard_v1 *) id;
+}
+
+#ifndef ZCR_EXTENDED_KEYBOARD_V1_HANDLED_STATE_ENUM
+#define ZCR_EXTENDED_KEYBOARD_V1_HANDLED_STATE_ENUM
+/**
+ * @ingroup iface_zcr_extended_keyboard_v1
+ * whether a key event is handled by client or not
+ */
+enum zcr_extended_keyboard_v1_handled_state {
+ ZCR_EXTENDED_KEYBOARD_V1_HANDLED_STATE_NOT_HANDLED = 0,
+ ZCR_EXTENDED_KEYBOARD_V1_HANDLED_STATE_HANDLED = 1,
+};
+#endif /* ZCR_EXTENDED_KEYBOARD_V1_HANDLED_STATE_ENUM */
+
+#define ZCR_EXTENDED_KEYBOARD_V1_DESTROY 0
+#define ZCR_EXTENDED_KEYBOARD_V1_ACK_KEY 1
+
+
+/**
+ * @ingroup iface_zcr_extended_keyboard_v1
+ */
+#define ZCR_EXTENDED_KEYBOARD_V1_DESTROY_SINCE_VERSION 1
+/**
+ * @ingroup iface_zcr_extended_keyboard_v1
+ */
+#define ZCR_EXTENDED_KEYBOARD_V1_ACK_KEY_SINCE_VERSION 1
+
+/** @ingroup iface_zcr_extended_keyboard_v1 */
+static inline void
+zcr_extended_keyboard_v1_set_user_data(struct zcr_extended_keyboard_v1 *zcr_extended_keyboard_v1, void *user_data)
+{
+ wl_proxy_set_user_data((struct wl_proxy *) zcr_extended_keyboard_v1, user_data);
+}
+
+/** @ingroup iface_zcr_extended_keyboard_v1 */
+static inline void *
+zcr_extended_keyboard_v1_get_user_data(struct zcr_extended_keyboard_v1 *zcr_extended_keyboard_v1)
+{
+ return wl_proxy_get_user_data((struct wl_proxy *) zcr_extended_keyboard_v1);
+}
+
+static inline uint32_t
+zcr_extended_keyboard_v1_get_version(struct zcr_extended_keyboard_v1 *zcr_extended_keyboard_v1)
+{
+ return wl_proxy_get_version((struct wl_proxy *) zcr_extended_keyboard_v1);
+}
+
+/**
+ * @ingroup iface_zcr_extended_keyboard_v1
+ */
+static inline void
+zcr_extended_keyboard_v1_destroy(struct zcr_extended_keyboard_v1 *zcr_extended_keyboard_v1)
+{
+ wl_proxy_marshal((struct wl_proxy *) zcr_extended_keyboard_v1,
+ ZCR_EXTENDED_KEYBOARD_V1_DESTROY);
+
+ wl_proxy_destroy((struct wl_proxy *) zcr_extended_keyboard_v1);
+}
+
+/**
+ * @ingroup iface_zcr_extended_keyboard_v1
+ */
+static inline void
+zcr_extended_keyboard_v1_ack_key(struct zcr_extended_keyboard_v1 *zcr_extended_keyboard_v1, uint32_t serial, uint32_t handled)
+{
+ wl_proxy_marshal((struct wl_proxy *) zcr_extended_keyboard_v1,
+ ZCR_EXTENDED_KEYBOARD_V1_ACK_KEY, serial, handled);
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/chromium/third_party/wayland-protocols/include/protocol/keyboard-extension-unstable-v1-server-protocol.h b/chromium/third_party/wayland-protocols/include/protocol/keyboard-extension-unstable-v1-server-protocol.h
new file mode 100644
index 00000000000..9eb8c2bae32
--- /dev/null
+++ b/chromium/third_party/wayland-protocols/include/protocol/keyboard-extension-unstable-v1-server-protocol.h
@@ -0,0 +1,188 @@
+/* Generated by wayland-scanner 1.13.0 */
+
+#ifndef KEYBOARD_EXTENSION_UNSTABLE_V1_SERVER_PROTOCOL_H
+#define KEYBOARD_EXTENSION_UNSTABLE_V1_SERVER_PROTOCOL_H
+
+#include <stdint.h>
+#include <stddef.h>
+#include "wayland-server.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct wl_client;
+struct wl_resource;
+
+/**
+ * @page page_keyboard_extension_unstable_v1 The keyboard_extension_unstable_v1 protocol
+ * @section page_ifaces_keyboard_extension_unstable_v1 Interfaces
+ * - @subpage page_iface_zcr_keyboard_extension_v1 - extends wl_keyboard with ack_key events
+ * - @subpage page_iface_zcr_extended_keyboard_v1 - extension of wl_keyboard protocol
+ * @section page_copyright_keyboard_extension_unstable_v1 Copyright
+ * <pre>
+ *
+ * Copyright 2017 The Chromium Authors.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ * </pre>
+ */
+struct wl_keyboard;
+struct zcr_extended_keyboard_v1;
+struct zcr_keyboard_extension_v1;
+
+/**
+ * @page page_iface_zcr_keyboard_extension_v1 zcr_keyboard_extension_v1
+ * @section page_iface_zcr_keyboard_extension_v1_desc Description
+ *
+ * Allows a wl_keyboard to send ack_key requests for each key event of
+ * the keyboard to the server.
+ *
+ * Warning! The protocol described in this file is experimental and
+ * backward incompatible changes may be made. Backward compatible changes
+ * may be added together with the corresponding uinterface version bump.
+ * Backward incompatible changes are done by bumping the version number in
+ * the protocol and uinterface names and resetting the interface version.
+ * Once the protocol is to be declared stable, the 'z' prefix and the
+ * version number in the protocol and interface names are removed and the
+ * interface version number is reset.
+ * @section page_iface_zcr_keyboard_extension_v1_api API
+ * See @ref iface_zcr_keyboard_extension_v1.
+ */
+/**
+ * @defgroup iface_zcr_keyboard_extension_v1 The zcr_keyboard_extension_v1 interface
+ *
+ * Allows a wl_keyboard to send ack_key requests for each key event of
+ * the keyboard to the server.
+ *
+ * Warning! The protocol described in this file is experimental and
+ * backward incompatible changes may be made. Backward compatible changes
+ * may be added together with the corresponding uinterface version bump.
+ * Backward incompatible changes are done by bumping the version number in
+ * the protocol and uinterface names and resetting the interface version.
+ * Once the protocol is to be declared stable, the 'z' prefix and the
+ * version number in the protocol and interface names are removed and the
+ * interface version number is reset.
+ */
+extern const struct wl_interface zcr_keyboard_extension_v1_interface;
+/**
+ * @page page_iface_zcr_extended_keyboard_v1 zcr_extended_keyboard_v1
+ * @section page_iface_zcr_extended_keyboard_v1_desc Description
+ *
+ * The zcr_extended_keyboard_v1 interface extends the wl_keyboard interface
+ * with requests to notify whether sent key events are handled or not by
+ * the client.
+ * @section page_iface_zcr_extended_keyboard_v1_api API
+ * See @ref iface_zcr_extended_keyboard_v1.
+ */
+/**
+ * @defgroup iface_zcr_extended_keyboard_v1 The zcr_extended_keyboard_v1 interface
+ *
+ * The zcr_extended_keyboard_v1 interface extends the wl_keyboard interface
+ * with requests to notify whether sent key events are handled or not by
+ * the client.
+ */
+extern const struct wl_interface zcr_extended_keyboard_v1_interface;
+
+#ifndef ZCR_KEYBOARD_EXTENSION_V1_ERROR_ENUM
+#define ZCR_KEYBOARD_EXTENSION_V1_ERROR_ENUM
+enum zcr_keyboard_extension_v1_error {
+ /**
+ * the keyboard already has an extended_keyboard object associated
+ */
+ ZCR_KEYBOARD_EXTENSION_V1_ERROR_EXTENDED_KEYBOARD_EXISTS = 0,
+};
+#endif /* ZCR_KEYBOARD_EXTENSION_V1_ERROR_ENUM */
+
+/**
+ * @ingroup iface_zcr_keyboard_extension_v1
+ * @struct zcr_keyboard_extension_v1_interface
+ */
+struct zcr_keyboard_extension_v1_interface {
+ /**
+ * get extended_keyboard for a keyboard
+ *
+ * Create extended_keyboard object. See zcr_extended_keyboard
+ * interface for details. If the given wl_keyboard object already
+ * has a extended_keyboard object associated, the
+ * extended_keyboard_exists protocol error is raised.
+ */
+ void (*get_extended_keyboard)(struct wl_client *client,
+ struct wl_resource *resource,
+ uint32_t id,
+ struct wl_resource *keyboard);
+};
+
+
+/**
+ * @ingroup iface_zcr_keyboard_extension_v1
+ */
+#define ZCR_KEYBOARD_EXTENSION_V1_GET_EXTENDED_KEYBOARD_SINCE_VERSION 1
+
+#ifndef ZCR_EXTENDED_KEYBOARD_V1_HANDLED_STATE_ENUM
+#define ZCR_EXTENDED_KEYBOARD_V1_HANDLED_STATE_ENUM
+/**
+ * @ingroup iface_zcr_extended_keyboard_v1
+ * whether a key event is handled by client or not
+ */
+enum zcr_extended_keyboard_v1_handled_state {
+ ZCR_EXTENDED_KEYBOARD_V1_HANDLED_STATE_NOT_HANDLED = 0,
+ ZCR_EXTENDED_KEYBOARD_V1_HANDLED_STATE_HANDLED = 1,
+};
+#endif /* ZCR_EXTENDED_KEYBOARD_V1_HANDLED_STATE_ENUM */
+
+/**
+ * @ingroup iface_zcr_extended_keyboard_v1
+ * @struct zcr_extended_keyboard_v1_interface
+ */
+struct zcr_extended_keyboard_v1_interface {
+ /**
+ * destroy extended_keyboard object
+ *
+ *
+ */
+ void (*destroy)(struct wl_client *client,
+ struct wl_resource *resource);
+ /**
+ * acknowledge a key event
+ *
+ *
+ */
+ void (*ack_key)(struct wl_client *client,
+ struct wl_resource *resource,
+ uint32_t serial,
+ uint32_t handled);
+};
+
+
+/**
+ * @ingroup iface_zcr_extended_keyboard_v1
+ */
+#define ZCR_EXTENDED_KEYBOARD_V1_DESTROY_SINCE_VERSION 1
+/**
+ * @ingroup iface_zcr_extended_keyboard_v1
+ */
+#define ZCR_EXTENDED_KEYBOARD_V1_ACK_KEY_SINCE_VERSION 1
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/chromium/third_party/wayland-protocols/include/protocol/linux-dmabuf-unstable-v1-client-protocol.h b/chromium/third_party/wayland-protocols/include/protocol/linux-dmabuf-unstable-v1-client-protocol.h
new file mode 100644
index 00000000000..95e6f0a0b0c
--- /dev/null
+++ b/chromium/third_party/wayland-protocols/include/protocol/linux-dmabuf-unstable-v1-client-protocol.h
@@ -0,0 +1,652 @@
+/* Generated by wayland-scanner 1.13.0 */
+
+#ifndef LINUX_DMABUF_UNSTABLE_V1_CLIENT_PROTOCOL_H
+#define LINUX_DMABUF_UNSTABLE_V1_CLIENT_PROTOCOL_H
+
+#include <stdint.h>
+#include <stddef.h>
+#include "wayland-client.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @page page_linux_dmabuf_unstable_v1 The linux_dmabuf_unstable_v1 protocol
+ * @section page_ifaces_linux_dmabuf_unstable_v1 Interfaces
+ * - @subpage page_iface_zwp_linux_dmabuf_v1 - factory for creating dmabuf-based wl_buffers
+ * - @subpage page_iface_zwp_linux_buffer_params_v1 - parameters for creating a dmabuf-based wl_buffer
+ * @section page_copyright_linux_dmabuf_unstable_v1 Copyright
+ * <pre>
+ *
+ * Copyright © 2014, 2015 Collabora, Ltd.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ * </pre>
+ */
+struct wl_buffer;
+struct zwp_linux_buffer_params_v1;
+struct zwp_linux_dmabuf_v1;
+
+/**
+ * @page page_iface_zwp_linux_dmabuf_v1 zwp_linux_dmabuf_v1
+ * @section page_iface_zwp_linux_dmabuf_v1_desc Description
+ *
+ * Following the interfaces from:
+ * https://www.khronos.org/registry/egl/extensions/EXT/EGL_EXT_image_dma_buf_import.txt
+ * and the Linux DRM sub-system's AddFb2 ioctl.
+ *
+ * This interface offers ways to create generic dmabuf-based
+ * wl_buffers. Immediately after a client binds to this interface,
+ * the set of supported formats and format modifiers is sent with
+ * 'format' and 'modifier' events.
+ *
+ * The following are required from clients:
+ *
+ * - Clients must ensure that either all data in the dma-buf is
+ * coherent for all subsequent read access or that coherency is
+ * correctly handled by the underlying kernel-side dma-buf
+ * implementation.
+ *
+ * - Don't make any more attachments after sending the buffer to the
+ * compositor. Making more attachments later increases the risk of
+ * the compositor not being able to use (re-import) an existing
+ * dmabuf-based wl_buffer.
+ *
+ * The underlying graphics stack must ensure the following:
+ *
+ * - The dmabuf file descriptors relayed to the server will stay valid
+ * for the whole lifetime of the wl_buffer. This means the server may
+ * at any time use those fds to import the dmabuf into any kernel
+ * sub-system that might accept it.
+ *
+ * To create a wl_buffer from one or more dmabufs, a client creates a
+ * zwp_linux_dmabuf_params_v1 object with a zwp_linux_dmabuf_v1.create_params
+ * request. All planes required by the intended format are added with
+ * the 'add' request. Finally, a 'create' or 'create_immed' request is
+ * issued, which has the following outcome depending on the import success.
+ *
+ * The 'create' request,
+ * - on success, triggers a 'created' event which provides the final
+ * wl_buffer to the client.
+ * - on failure, triggers a 'failed' event to convey that the server
+ * cannot use the dmabufs received from the client.
+ *
+ * For the 'create_immed' request,
+ * - on success, the server immediately imports the added dmabufs to
+ * create a wl_buffer. No event is sent from the server in this case.
+ * - on failure, the server can choose to either:
+ * - terminate the client by raising a fatal error.
+ * - mark the wl_buffer as failed, and send a 'failed' event to the
+ * client. If the client uses a failed wl_buffer as an argument to any
+ * request, the behaviour is compositor implementation-defined.
+ *
+ * Warning! The protocol described in this file is experimental and
+ * backward incompatible changes may be made. Backward compatible changes
+ * may be added together with the corresponding interface version bump.
+ * Backward incompatible changes are done by bumping the version number in
+ * the protocol and interface names and resetting the interface version.
+ * Once the protocol is to be declared stable, the 'z' prefix and the
+ * version number in the protocol and interface names are removed and the
+ * interface version number is reset.
+ * @section page_iface_zwp_linux_dmabuf_v1_api API
+ * See @ref iface_zwp_linux_dmabuf_v1.
+ */
+/**
+ * @defgroup iface_zwp_linux_dmabuf_v1 The zwp_linux_dmabuf_v1 interface
+ *
+ * Following the interfaces from:
+ * https://www.khronos.org/registry/egl/extensions/EXT/EGL_EXT_image_dma_buf_import.txt
+ * and the Linux DRM sub-system's AddFb2 ioctl.
+ *
+ * This interface offers ways to create generic dmabuf-based
+ * wl_buffers. Immediately after a client binds to this interface,
+ * the set of supported formats and format modifiers is sent with
+ * 'format' and 'modifier' events.
+ *
+ * The following are required from clients:
+ *
+ * - Clients must ensure that either all data in the dma-buf is
+ * coherent for all subsequent read access or that coherency is
+ * correctly handled by the underlying kernel-side dma-buf
+ * implementation.
+ *
+ * - Don't make any more attachments after sending the buffer to the
+ * compositor. Making more attachments later increases the risk of
+ * the compositor not being able to use (re-import) an existing
+ * dmabuf-based wl_buffer.
+ *
+ * The underlying graphics stack must ensure the following:
+ *
+ * - The dmabuf file descriptors relayed to the server will stay valid
+ * for the whole lifetime of the wl_buffer. This means the server may
+ * at any time use those fds to import the dmabuf into any kernel
+ * sub-system that might accept it.
+ *
+ * To create a wl_buffer from one or more dmabufs, a client creates a
+ * zwp_linux_dmabuf_params_v1 object with a zwp_linux_dmabuf_v1.create_params
+ * request. All planes required by the intended format are added with
+ * the 'add' request. Finally, a 'create' or 'create_immed' request is
+ * issued, which has the following outcome depending on the import success.
+ *
+ * The 'create' request,
+ * - on success, triggers a 'created' event which provides the final
+ * wl_buffer to the client.
+ * - on failure, triggers a 'failed' event to convey that the server
+ * cannot use the dmabufs received from the client.
+ *
+ * For the 'create_immed' request,
+ * - on success, the server immediately imports the added dmabufs to
+ * create a wl_buffer. No event is sent from the server in this case.
+ * - on failure, the server can choose to either:
+ * - terminate the client by raising a fatal error.
+ * - mark the wl_buffer as failed, and send a 'failed' event to the
+ * client. If the client uses a failed wl_buffer as an argument to any
+ * request, the behaviour is compositor implementation-defined.
+ *
+ * Warning! The protocol described in this file is experimental and
+ * backward incompatible changes may be made. Backward compatible changes
+ * may be added together with the corresponding interface version bump.
+ * Backward incompatible changes are done by bumping the version number in
+ * the protocol and interface names and resetting the interface version.
+ * Once the protocol is to be declared stable, the 'z' prefix and the
+ * version number in the protocol and interface names are removed and the
+ * interface version number is reset.
+ */
+extern const struct wl_interface zwp_linux_dmabuf_v1_interface;
+/**
+ * @page page_iface_zwp_linux_buffer_params_v1 zwp_linux_buffer_params_v1
+ * @section page_iface_zwp_linux_buffer_params_v1_desc Description
+ *
+ * This temporary object is a collection of dmabufs and other
+ * parameters that together form a single logical buffer. The temporary
+ * object may eventually create one wl_buffer unless cancelled by
+ * destroying it before requesting 'create'.
+ *
+ * Single-planar formats only require one dmabuf, however
+ * multi-planar formats may require more than one dmabuf. For all
+ * formats, an 'add' request must be called once per plane (even if the
+ * underlying dmabuf fd is identical).
+ *
+ * You must use consecutive plane indices ('plane_idx' argument for 'add')
+ * from zero to the number of planes used by the drm_fourcc format code.
+ * All planes required by the format must be given exactly once, but can
+ * be given in any order. Each plane index can be set only once.
+ * @section page_iface_zwp_linux_buffer_params_v1_api API
+ * See @ref iface_zwp_linux_buffer_params_v1.
+ */
+/**
+ * @defgroup iface_zwp_linux_buffer_params_v1 The zwp_linux_buffer_params_v1 interface
+ *
+ * This temporary object is a collection of dmabufs and other
+ * parameters that together form a single logical buffer. The temporary
+ * object may eventually create one wl_buffer unless cancelled by
+ * destroying it before requesting 'create'.
+ *
+ * Single-planar formats only require one dmabuf, however
+ * multi-planar formats may require more than one dmabuf. For all
+ * formats, an 'add' request must be called once per plane (even if the
+ * underlying dmabuf fd is identical).
+ *
+ * You must use consecutive plane indices ('plane_idx' argument for 'add')
+ * from zero to the number of planes used by the drm_fourcc format code.
+ * All planes required by the format must be given exactly once, but can
+ * be given in any order. Each plane index can be set only once.
+ */
+extern const struct wl_interface zwp_linux_buffer_params_v1_interface;
+
+/**
+ * @ingroup iface_zwp_linux_dmabuf_v1
+ * @struct zwp_linux_dmabuf_v1_listener
+ */
+struct zwp_linux_dmabuf_v1_listener {
+ /**
+ * supported buffer format
+ *
+ * This event advertises one buffer format that the server
+ * supports. All the supported formats are advertised once when the
+ * client binds to this interface. A roundtrip after binding
+ * guarantees that the client has received all supported formats.
+ *
+ * For the definition of the format codes, see the
+ * zwp_linux_buffer_params_v1::create request.
+ *
+ * Warning: the 'format' event is likely to be deprecated and
+ * replaced with the 'modifier' event introduced in
+ * zwp_linux_dmabuf_v1 version 3, described below. Please refrain
+ * from using the information received from this event.
+ * @param format DRM_FORMAT code
+ */
+ void (*format)(void *data,
+ struct zwp_linux_dmabuf_v1 *zwp_linux_dmabuf_v1,
+ uint32_t format);
+ /**
+ * supported buffer format modifier
+ *
+ * This event advertises the formats that the server supports,
+ * along with the modifiers supported for each format. All the
+ * supported modifiers for all the supported formats are advertised
+ * once when the client binds to this interface. A roundtrip after
+ * binding guarantees that the client has received all supported
+ * format-modifier pairs.
+ *
+ * For the definition of the format and modifier codes, see the
+ * zwp_linux_buffer_params_v1::create request.
+ * @param format DRM_FORMAT code
+ * @param modifier_hi high 32 bits of layout modifier
+ * @param modifier_lo low 32 bits of layout modifier
+ * @since 3
+ */
+ void (*modifier)(void *data,
+ struct zwp_linux_dmabuf_v1 *zwp_linux_dmabuf_v1,
+ uint32_t format,
+ uint32_t modifier_hi,
+ uint32_t modifier_lo);
+};
+
+/**
+ * @ingroup iface_zwp_linux_dmabuf_v1
+ */
+static inline int
+zwp_linux_dmabuf_v1_add_listener(struct zwp_linux_dmabuf_v1 *zwp_linux_dmabuf_v1,
+ const struct zwp_linux_dmabuf_v1_listener *listener, void *data)
+{
+ return wl_proxy_add_listener((struct wl_proxy *) zwp_linux_dmabuf_v1,
+ (void (**)(void)) listener, data);
+}
+
+#define ZWP_LINUX_DMABUF_V1_DESTROY 0
+#define ZWP_LINUX_DMABUF_V1_CREATE_PARAMS 1
+
+/**
+ * @ingroup iface_zwp_linux_dmabuf_v1
+ */
+#define ZWP_LINUX_DMABUF_V1_FORMAT_SINCE_VERSION 1
+/**
+ * @ingroup iface_zwp_linux_dmabuf_v1
+ */
+#define ZWP_LINUX_DMABUF_V1_MODIFIER_SINCE_VERSION 3
+
+/**
+ * @ingroup iface_zwp_linux_dmabuf_v1
+ */
+#define ZWP_LINUX_DMABUF_V1_DESTROY_SINCE_VERSION 1
+/**
+ * @ingroup iface_zwp_linux_dmabuf_v1
+ */
+#define ZWP_LINUX_DMABUF_V1_CREATE_PARAMS_SINCE_VERSION 1
+
+/** @ingroup iface_zwp_linux_dmabuf_v1 */
+static inline void
+zwp_linux_dmabuf_v1_set_user_data(struct zwp_linux_dmabuf_v1 *zwp_linux_dmabuf_v1, void *user_data)
+{
+ wl_proxy_set_user_data((struct wl_proxy *) zwp_linux_dmabuf_v1, user_data);
+}
+
+/** @ingroup iface_zwp_linux_dmabuf_v1 */
+static inline void *
+zwp_linux_dmabuf_v1_get_user_data(struct zwp_linux_dmabuf_v1 *zwp_linux_dmabuf_v1)
+{
+ return wl_proxy_get_user_data((struct wl_proxy *) zwp_linux_dmabuf_v1);
+}
+
+static inline uint32_t
+zwp_linux_dmabuf_v1_get_version(struct zwp_linux_dmabuf_v1 *zwp_linux_dmabuf_v1)
+{
+ return wl_proxy_get_version((struct wl_proxy *) zwp_linux_dmabuf_v1);
+}
+
+/**
+ * @ingroup iface_zwp_linux_dmabuf_v1
+ *
+ * Objects created through this interface, especially wl_buffers, will
+ * remain valid.
+ */
+static inline void
+zwp_linux_dmabuf_v1_destroy(struct zwp_linux_dmabuf_v1 *zwp_linux_dmabuf_v1)
+{
+ wl_proxy_marshal((struct wl_proxy *) zwp_linux_dmabuf_v1,
+ ZWP_LINUX_DMABUF_V1_DESTROY);
+
+ wl_proxy_destroy((struct wl_proxy *) zwp_linux_dmabuf_v1);
+}
+
+/**
+ * @ingroup iface_zwp_linux_dmabuf_v1
+ *
+ * This temporary object is used to collect multiple dmabuf handles into
+ * a single batch to create a wl_buffer. It can only be used once and
+ * should be destroyed after a 'created' or 'failed' event has been
+ * received.
+ */
+static inline struct zwp_linux_buffer_params_v1 *
+zwp_linux_dmabuf_v1_create_params(struct zwp_linux_dmabuf_v1 *zwp_linux_dmabuf_v1)
+{
+ struct wl_proxy *params_id;
+
+ params_id = wl_proxy_marshal_constructor((struct wl_proxy *) zwp_linux_dmabuf_v1,
+ ZWP_LINUX_DMABUF_V1_CREATE_PARAMS, &zwp_linux_buffer_params_v1_interface, NULL);
+
+ return (struct zwp_linux_buffer_params_v1 *) params_id;
+}
+
+#ifndef ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_ENUM
+#define ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_ENUM
+enum zwp_linux_buffer_params_v1_error {
+ /**
+ * the dmabuf_batch object has already been used to create a wl_buffer
+ */
+ ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_ALREADY_USED = 0,
+ /**
+ * plane index out of bounds
+ */
+ ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_PLANE_IDX = 1,
+ /**
+ * the plane index was already set
+ */
+ ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_PLANE_SET = 2,
+ /**
+ * missing or too many planes to create a buffer
+ */
+ ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_INCOMPLETE = 3,
+ /**
+ * format not supported
+ */
+ ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_INVALID_FORMAT = 4,
+ /**
+ * invalid width or height
+ */
+ ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_INVALID_DIMENSIONS = 5,
+ /**
+ * offset + stride * height goes out of dmabuf bounds
+ */
+ ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_OUT_OF_BOUNDS = 6,
+ /**
+ * invalid wl_buffer resulted from importing dmabufs via the create_immed request on given buffer_params
+ */
+ ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_INVALID_WL_BUFFER = 7,
+};
+#endif /* ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_ENUM */
+
+#ifndef ZWP_LINUX_BUFFER_PARAMS_V1_FLAGS_ENUM
+#define ZWP_LINUX_BUFFER_PARAMS_V1_FLAGS_ENUM
+enum zwp_linux_buffer_params_v1_flags {
+ /**
+ * contents are y-inverted
+ */
+ ZWP_LINUX_BUFFER_PARAMS_V1_FLAGS_Y_INVERT = 1,
+ /**
+ * content is interlaced
+ */
+ ZWP_LINUX_BUFFER_PARAMS_V1_FLAGS_INTERLACED = 2,
+ /**
+ * bottom field first
+ */
+ ZWP_LINUX_BUFFER_PARAMS_V1_FLAGS_BOTTOM_FIRST = 4,
+};
+#endif /* ZWP_LINUX_BUFFER_PARAMS_V1_FLAGS_ENUM */
+
+/**
+ * @ingroup iface_zwp_linux_buffer_params_v1
+ * @struct zwp_linux_buffer_params_v1_listener
+ */
+struct zwp_linux_buffer_params_v1_listener {
+ /**
+ * buffer creation succeeded
+ *
+ * This event indicates that the attempted buffer creation was
+ * successful. It provides the new wl_buffer referencing the
+ * dmabuf(s).
+ *
+ * Upon receiving this event, the client should destroy the
+ * zlinux_dmabuf_params object.
+ * @param buffer the newly created wl_buffer
+ */
+ void (*created)(void *data,
+ struct zwp_linux_buffer_params_v1 *zwp_linux_buffer_params_v1,
+ struct wl_buffer *buffer);
+ /**
+ * buffer creation failed
+ *
+ * This event indicates that the attempted buffer creation has
+ * failed. It usually means that one of the dmabuf constraints has
+ * not been fulfilled.
+ *
+ * Upon receiving this event, the client should destroy the
+ * zlinux_buffer_params object.
+ */
+ void (*failed)(void *data,
+ struct zwp_linux_buffer_params_v1 *zwp_linux_buffer_params_v1);
+};
+
+/**
+ * @ingroup iface_zwp_linux_buffer_params_v1
+ */
+static inline int
+zwp_linux_buffer_params_v1_add_listener(struct zwp_linux_buffer_params_v1 *zwp_linux_buffer_params_v1,
+ const struct zwp_linux_buffer_params_v1_listener *listener, void *data)
+{
+ return wl_proxy_add_listener((struct wl_proxy *) zwp_linux_buffer_params_v1,
+ (void (**)(void)) listener, data);
+}
+
+#define ZWP_LINUX_BUFFER_PARAMS_V1_DESTROY 0
+#define ZWP_LINUX_BUFFER_PARAMS_V1_ADD 1
+#define ZWP_LINUX_BUFFER_PARAMS_V1_CREATE 2
+#define ZWP_LINUX_BUFFER_PARAMS_V1_CREATE_IMMED 3
+
+/**
+ * @ingroup iface_zwp_linux_buffer_params_v1
+ */
+#define ZWP_LINUX_BUFFER_PARAMS_V1_CREATED_SINCE_VERSION 1
+/**
+ * @ingroup iface_zwp_linux_buffer_params_v1
+ */
+#define ZWP_LINUX_BUFFER_PARAMS_V1_FAILED_SINCE_VERSION 1
+
+/**
+ * @ingroup iface_zwp_linux_buffer_params_v1
+ */
+#define ZWP_LINUX_BUFFER_PARAMS_V1_DESTROY_SINCE_VERSION 1
+/**
+ * @ingroup iface_zwp_linux_buffer_params_v1
+ */
+#define ZWP_LINUX_BUFFER_PARAMS_V1_ADD_SINCE_VERSION 1
+/**
+ * @ingroup iface_zwp_linux_buffer_params_v1
+ */
+#define ZWP_LINUX_BUFFER_PARAMS_V1_CREATE_SINCE_VERSION 1
+/**
+ * @ingroup iface_zwp_linux_buffer_params_v1
+ */
+#define ZWP_LINUX_BUFFER_PARAMS_V1_CREATE_IMMED_SINCE_VERSION 2
+
+/** @ingroup iface_zwp_linux_buffer_params_v1 */
+static inline void
+zwp_linux_buffer_params_v1_set_user_data(struct zwp_linux_buffer_params_v1 *zwp_linux_buffer_params_v1, void *user_data)
+{
+ wl_proxy_set_user_data((struct wl_proxy *) zwp_linux_buffer_params_v1, user_data);
+}
+
+/** @ingroup iface_zwp_linux_buffer_params_v1 */
+static inline void *
+zwp_linux_buffer_params_v1_get_user_data(struct zwp_linux_buffer_params_v1 *zwp_linux_buffer_params_v1)
+{
+ return wl_proxy_get_user_data((struct wl_proxy *) zwp_linux_buffer_params_v1);
+}
+
+static inline uint32_t
+zwp_linux_buffer_params_v1_get_version(struct zwp_linux_buffer_params_v1 *zwp_linux_buffer_params_v1)
+{
+ return wl_proxy_get_version((struct wl_proxy *) zwp_linux_buffer_params_v1);
+}
+
+/**
+ * @ingroup iface_zwp_linux_buffer_params_v1
+ *
+ * Cleans up the temporary data sent to the server for dmabuf-based
+ * wl_buffer creation.
+ */
+static inline void
+zwp_linux_buffer_params_v1_destroy(struct zwp_linux_buffer_params_v1 *zwp_linux_buffer_params_v1)
+{
+ wl_proxy_marshal((struct wl_proxy *) zwp_linux_buffer_params_v1,
+ ZWP_LINUX_BUFFER_PARAMS_V1_DESTROY);
+
+ wl_proxy_destroy((struct wl_proxy *) zwp_linux_buffer_params_v1);
+}
+
+/**
+ * @ingroup iface_zwp_linux_buffer_params_v1
+ *
+ * This request adds one dmabuf to the set in this
+ * zwp_linux_buffer_params_v1.
+ *
+ * The 64-bit unsigned value combined from modifier_hi and modifier_lo
+ * is the dmabuf layout modifier. DRM AddFB2 ioctl calls this the
+ * fb modifier, which is defined in drm_mode.h of Linux UAPI.
+ * This is an opaque token. Drivers use this token to express tiling,
+ * compression, etc. driver-specific modifications to the base format
+ * defined by the DRM fourcc code.
+ *
+ * This request raises the PLANE_IDX error if plane_idx is too large.
+ * The error PLANE_SET is raised if attempting to set a plane that
+ * was already set.
+ */
+static inline void
+zwp_linux_buffer_params_v1_add(struct zwp_linux_buffer_params_v1 *zwp_linux_buffer_params_v1, int32_t fd, uint32_t plane_idx, uint32_t offset, uint32_t stride, uint32_t modifier_hi, uint32_t modifier_lo)
+{
+ wl_proxy_marshal((struct wl_proxy *) zwp_linux_buffer_params_v1,
+ ZWP_LINUX_BUFFER_PARAMS_V1_ADD, fd, plane_idx, offset, stride, modifier_hi, modifier_lo);
+}
+
+/**
+ * @ingroup iface_zwp_linux_buffer_params_v1
+ *
+ * This asks for creation of a wl_buffer from the added dmabuf
+ * buffers. The wl_buffer is not created immediately but returned via
+ * the 'created' event if the dmabuf sharing succeeds. The sharing
+ * may fail at runtime for reasons a client cannot predict, in
+ * which case the 'failed' event is triggered.
+ *
+ * The 'format' argument is a DRM_FORMAT code, as defined by the
+ * libdrm's drm_fourcc.h. The Linux kernel's DRM sub-system is the
+ * authoritative source on how the format codes should work.
+ *
+ * The 'flags' is a bitfield of the flags defined in enum "flags".
+ * 'y_invert' means the that the image needs to be y-flipped.
+ *
+ * Flag 'interlaced' means that the frame in the buffer is not
+ * progressive as usual, but interlaced. An interlaced buffer as
+ * supported here must always contain both top and bottom fields.
+ * The top field always begins on the first pixel row. The temporal
+ * ordering between the two fields is top field first, unless
+ * 'bottom_first' is specified. It is undefined whether 'bottom_first'
+ * is ignored if 'interlaced' is not set.
+ *
+ * This protocol does not convey any information about field rate,
+ * duration, or timing, other than the relative ordering between the
+ * two fields in one buffer. A compositor may have to estimate the
+ * intended field rate from the incoming buffer rate. It is undefined
+ * whether the time of receiving wl_surface.commit with a new buffer
+ * attached, applying the wl_surface state, wl_surface.frame callback
+ * trigger, presentation, or any other point in the compositor cycle
+ * is used to measure the frame or field times. There is no support
+ * for detecting missed or late frames/fields/buffers either, and
+ * there is no support whatsoever for cooperating with interlaced
+ * compositor output.
+ *
+ * The composited image quality resulting from the use of interlaced
+ * buffers is explicitly undefined. A compositor may use elaborate
+ * hardware features or software to deinterlace and create progressive
+ * output frames from a sequence of interlaced input buffers, or it
+ * may produce substandard image quality. However, compositors that
+ * cannot guarantee reasonable image quality in all cases are recommended
+ * to just reject all interlaced buffers.
+ *
+ * Any argument errors, including non-positive width or height,
+ * mismatch between the number of planes and the format, bad
+ * format, bad offset or stride, may be indicated by fatal protocol
+ * errors: INCOMPLETE, INVALID_FORMAT, INVALID_DIMENSIONS,
+ * OUT_OF_BOUNDS.
+ *
+ * Dmabuf import errors in the server that are not obvious client
+ * bugs are returned via the 'failed' event as non-fatal. This
+ * allows attempting dmabuf sharing and falling back in the client
+ * if it fails.
+ *
+ * This request can be sent only once in the object's lifetime, after
+ * which the only legal request is destroy. This object should be
+ * destroyed after issuing a 'create' request. Attempting to use this
+ * object after issuing 'create' raises ALREADY_USED protocol error.
+ *
+ * It is not mandatory to issue 'create'. If a client wants to
+ * cancel the buffer creation, it can just destroy this object.
+ */
+static inline void
+zwp_linux_buffer_params_v1_create(struct zwp_linux_buffer_params_v1 *zwp_linux_buffer_params_v1, int32_t width, int32_t height, uint32_t format, uint32_t flags)
+{
+ wl_proxy_marshal((struct wl_proxy *) zwp_linux_buffer_params_v1,
+ ZWP_LINUX_BUFFER_PARAMS_V1_CREATE, width, height, format, flags);
+}
+
+/**
+ * @ingroup iface_zwp_linux_buffer_params_v1
+ *
+ * This asks for immediate creation of a wl_buffer by importing the
+ * added dmabufs.
+ *
+ * In case of import success, no event is sent from the server, and the
+ * wl_buffer is ready to be used by the client.
+ *
+ * Upon import failure, either of the following may happen, as seen fit
+ * by the implementation:
+ * - the client is terminated with one of the following fatal protocol
+ * errors:
+ * - INCOMPLETE, INVALID_FORMAT, INVALID_DIMENSIONS, OUT_OF_BOUNDS,
+ * in case of argument errors such as mismatch between the number
+ * of planes and the format, bad format, non-positive width or
+ * height, or bad offset or stride.
+ * - INVALID_WL_BUFFER, in case the cause for failure is unknown or
+ * plaform specific.
+ * - the server creates an invalid wl_buffer, marks it as failed and
+ * sends a 'failed' event to the client. The result of using this
+ * invalid wl_buffer as an argument in any request by the client is
+ * defined by the compositor implementation.
+ *
+ * This takes the same arguments as a 'create' request, and obeys the
+ * same restrictions.
+ */
+static inline struct wl_buffer *
+zwp_linux_buffer_params_v1_create_immed(struct zwp_linux_buffer_params_v1 *zwp_linux_buffer_params_v1, int32_t width, int32_t height, uint32_t format, uint32_t flags)
+{
+ struct wl_proxy *buffer_id;
+
+ buffer_id = wl_proxy_marshal_constructor((struct wl_proxy *) zwp_linux_buffer_params_v1,
+ ZWP_LINUX_BUFFER_PARAMS_V1_CREATE_IMMED, &wl_buffer_interface, NULL, width, height, format, flags);
+
+ return (struct wl_buffer *) buffer_id;
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/chromium/third_party/wayland-protocols/include/protocol/linux-dmabuf-unstable-v1-server-protocol.h b/chromium/third_party/wayland-protocols/include/protocol/linux-dmabuf-unstable-v1-server-protocol.h
new file mode 100644
index 00000000000..775b18cdab3
--- /dev/null
+++ b/chromium/third_party/wayland-protocols/include/protocol/linux-dmabuf-unstable-v1-server-protocol.h
@@ -0,0 +1,563 @@
+/* Generated by wayland-scanner 1.13.0 */
+
+#ifndef LINUX_DMABUF_UNSTABLE_V1_SERVER_PROTOCOL_H
+#define LINUX_DMABUF_UNSTABLE_V1_SERVER_PROTOCOL_H
+
+#include <stdint.h>
+#include <stddef.h>
+#include "wayland-server.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct wl_client;
+struct wl_resource;
+
+/**
+ * @page page_linux_dmabuf_unstable_v1 The linux_dmabuf_unstable_v1 protocol
+ * @section page_ifaces_linux_dmabuf_unstable_v1 Interfaces
+ * - @subpage page_iface_zwp_linux_dmabuf_v1 - factory for creating dmabuf-based wl_buffers
+ * - @subpage page_iface_zwp_linux_buffer_params_v1 - parameters for creating a dmabuf-based wl_buffer
+ * @section page_copyright_linux_dmabuf_unstable_v1 Copyright
+ * <pre>
+ *
+ * Copyright © 2014, 2015 Collabora, Ltd.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ * </pre>
+ */
+struct wl_buffer;
+struct zwp_linux_buffer_params_v1;
+struct zwp_linux_dmabuf_v1;
+
+/**
+ * @page page_iface_zwp_linux_dmabuf_v1 zwp_linux_dmabuf_v1
+ * @section page_iface_zwp_linux_dmabuf_v1_desc Description
+ *
+ * Following the interfaces from:
+ * https://www.khronos.org/registry/egl/extensions/EXT/EGL_EXT_image_dma_buf_import.txt
+ * and the Linux DRM sub-system's AddFb2 ioctl.
+ *
+ * This interface offers ways to create generic dmabuf-based
+ * wl_buffers. Immediately after a client binds to this interface,
+ * the set of supported formats and format modifiers is sent with
+ * 'format' and 'modifier' events.
+ *
+ * The following are required from clients:
+ *
+ * - Clients must ensure that either all data in the dma-buf is
+ * coherent for all subsequent read access or that coherency is
+ * correctly handled by the underlying kernel-side dma-buf
+ * implementation.
+ *
+ * - Don't make any more attachments after sending the buffer to the
+ * compositor. Making more attachments later increases the risk of
+ * the compositor not being able to use (re-import) an existing
+ * dmabuf-based wl_buffer.
+ *
+ * The underlying graphics stack must ensure the following:
+ *
+ * - The dmabuf file descriptors relayed to the server will stay valid
+ * for the whole lifetime of the wl_buffer. This means the server may
+ * at any time use those fds to import the dmabuf into any kernel
+ * sub-system that might accept it.
+ *
+ * To create a wl_buffer from one or more dmabufs, a client creates a
+ * zwp_linux_dmabuf_params_v1 object with a zwp_linux_dmabuf_v1.create_params
+ * request. All planes required by the intended format are added with
+ * the 'add' request. Finally, a 'create' or 'create_immed' request is
+ * issued, which has the following outcome depending on the import success.
+ *
+ * The 'create' request,
+ * - on success, triggers a 'created' event which provides the final
+ * wl_buffer to the client.
+ * - on failure, triggers a 'failed' event to convey that the server
+ * cannot use the dmabufs received from the client.
+ *
+ * For the 'create_immed' request,
+ * - on success, the server immediately imports the added dmabufs to
+ * create a wl_buffer. No event is sent from the server in this case.
+ * - on failure, the server can choose to either:
+ * - terminate the client by raising a fatal error.
+ * - mark the wl_buffer as failed, and send a 'failed' event to the
+ * client. If the client uses a failed wl_buffer as an argument to any
+ * request, the behaviour is compositor implementation-defined.
+ *
+ * Warning! The protocol described in this file is experimental and
+ * backward incompatible changes may be made. Backward compatible changes
+ * may be added together with the corresponding interface version bump.
+ * Backward incompatible changes are done by bumping the version number in
+ * the protocol and interface names and resetting the interface version.
+ * Once the protocol is to be declared stable, the 'z' prefix and the
+ * version number in the protocol and interface names are removed and the
+ * interface version number is reset.
+ * @section page_iface_zwp_linux_dmabuf_v1_api API
+ * See @ref iface_zwp_linux_dmabuf_v1.
+ */
+/**
+ * @defgroup iface_zwp_linux_dmabuf_v1 The zwp_linux_dmabuf_v1 interface
+ *
+ * Following the interfaces from:
+ * https://www.khronos.org/registry/egl/extensions/EXT/EGL_EXT_image_dma_buf_import.txt
+ * and the Linux DRM sub-system's AddFb2 ioctl.
+ *
+ * This interface offers ways to create generic dmabuf-based
+ * wl_buffers. Immediately after a client binds to this interface,
+ * the set of supported formats and format modifiers is sent with
+ * 'format' and 'modifier' events.
+ *
+ * The following are required from clients:
+ *
+ * - Clients must ensure that either all data in the dma-buf is
+ * coherent for all subsequent read access or that coherency is
+ * correctly handled by the underlying kernel-side dma-buf
+ * implementation.
+ *
+ * - Don't make any more attachments after sending the buffer to the
+ * compositor. Making more attachments later increases the risk of
+ * the compositor not being able to use (re-import) an existing
+ * dmabuf-based wl_buffer.
+ *
+ * The underlying graphics stack must ensure the following:
+ *
+ * - The dmabuf file descriptors relayed to the server will stay valid
+ * for the whole lifetime of the wl_buffer. This means the server may
+ * at any time use those fds to import the dmabuf into any kernel
+ * sub-system that might accept it.
+ *
+ * To create a wl_buffer from one or more dmabufs, a client creates a
+ * zwp_linux_dmabuf_params_v1 object with a zwp_linux_dmabuf_v1.create_params
+ * request. All planes required by the intended format are added with
+ * the 'add' request. Finally, a 'create' or 'create_immed' request is
+ * issued, which has the following outcome depending on the import success.
+ *
+ * The 'create' request,
+ * - on success, triggers a 'created' event which provides the final
+ * wl_buffer to the client.
+ * - on failure, triggers a 'failed' event to convey that the server
+ * cannot use the dmabufs received from the client.
+ *
+ * For the 'create_immed' request,
+ * - on success, the server immediately imports the added dmabufs to
+ * create a wl_buffer. No event is sent from the server in this case.
+ * - on failure, the server can choose to either:
+ * - terminate the client by raising a fatal error.
+ * - mark the wl_buffer as failed, and send a 'failed' event to the
+ * client. If the client uses a failed wl_buffer as an argument to any
+ * request, the behaviour is compositor implementation-defined.
+ *
+ * Warning! The protocol described in this file is experimental and
+ * backward incompatible changes may be made. Backward compatible changes
+ * may be added together with the corresponding interface version bump.
+ * Backward incompatible changes are done by bumping the version number in
+ * the protocol and interface names and resetting the interface version.
+ * Once the protocol is to be declared stable, the 'z' prefix and the
+ * version number in the protocol and interface names are removed and the
+ * interface version number is reset.
+ */
+extern const struct wl_interface zwp_linux_dmabuf_v1_interface;
+/**
+ * @page page_iface_zwp_linux_buffer_params_v1 zwp_linux_buffer_params_v1
+ * @section page_iface_zwp_linux_buffer_params_v1_desc Description
+ *
+ * This temporary object is a collection of dmabufs and other
+ * parameters that together form a single logical buffer. The temporary
+ * object may eventually create one wl_buffer unless cancelled by
+ * destroying it before requesting 'create'.
+ *
+ * Single-planar formats only require one dmabuf, however
+ * multi-planar formats may require more than one dmabuf. For all
+ * formats, an 'add' request must be called once per plane (even if the
+ * underlying dmabuf fd is identical).
+ *
+ * You must use consecutive plane indices ('plane_idx' argument for 'add')
+ * from zero to the number of planes used by the drm_fourcc format code.
+ * All planes required by the format must be given exactly once, but can
+ * be given in any order. Each plane index can be set only once.
+ * @section page_iface_zwp_linux_buffer_params_v1_api API
+ * See @ref iface_zwp_linux_buffer_params_v1.
+ */
+/**
+ * @defgroup iface_zwp_linux_buffer_params_v1 The zwp_linux_buffer_params_v1 interface
+ *
+ * This temporary object is a collection of dmabufs and other
+ * parameters that together form a single logical buffer. The temporary
+ * object may eventually create one wl_buffer unless cancelled by
+ * destroying it before requesting 'create'.
+ *
+ * Single-planar formats only require one dmabuf, however
+ * multi-planar formats may require more than one dmabuf. For all
+ * formats, an 'add' request must be called once per plane (even if the
+ * underlying dmabuf fd is identical).
+ *
+ * You must use consecutive plane indices ('plane_idx' argument for 'add')
+ * from zero to the number of planes used by the drm_fourcc format code.
+ * All planes required by the format must be given exactly once, but can
+ * be given in any order. Each plane index can be set only once.
+ */
+extern const struct wl_interface zwp_linux_buffer_params_v1_interface;
+
+/**
+ * @ingroup iface_zwp_linux_dmabuf_v1
+ * @struct zwp_linux_dmabuf_v1_interface
+ */
+struct zwp_linux_dmabuf_v1_interface {
+ /**
+ * unbind the factory
+ *
+ * Objects created through this interface, especially wl_buffers,
+ * will remain valid.
+ */
+ void (*destroy)(struct wl_client *client,
+ struct wl_resource *resource);
+ /**
+ * create a temporary object for buffer parameters
+ *
+ * This temporary object is used to collect multiple dmabuf
+ * handles into a single batch to create a wl_buffer. It can only
+ * be used once and should be destroyed after a 'created' or
+ * 'failed' event has been received.
+ * @param params_id the new temporary
+ */
+ void (*create_params)(struct wl_client *client,
+ struct wl_resource *resource,
+ uint32_t params_id);
+};
+
+#define ZWP_LINUX_DMABUF_V1_FORMAT 0
+#define ZWP_LINUX_DMABUF_V1_MODIFIER 1
+
+/**
+ * @ingroup iface_zwp_linux_dmabuf_v1
+ */
+#define ZWP_LINUX_DMABUF_V1_FORMAT_SINCE_VERSION 1
+/**
+ * @ingroup iface_zwp_linux_dmabuf_v1
+ */
+#define ZWP_LINUX_DMABUF_V1_MODIFIER_SINCE_VERSION 3
+
+/**
+ * @ingroup iface_zwp_linux_dmabuf_v1
+ */
+#define ZWP_LINUX_DMABUF_V1_DESTROY_SINCE_VERSION 1
+/**
+ * @ingroup iface_zwp_linux_dmabuf_v1
+ */
+#define ZWP_LINUX_DMABUF_V1_CREATE_PARAMS_SINCE_VERSION 1
+
+/**
+ * @ingroup iface_zwp_linux_dmabuf_v1
+ * Sends an format event to the client owning the resource.
+ * @param resource_ The client's resource
+ * @param format DRM_FORMAT code
+ */
+static inline void
+zwp_linux_dmabuf_v1_send_format(struct wl_resource *resource_, uint32_t format)
+{
+ wl_resource_post_event(resource_, ZWP_LINUX_DMABUF_V1_FORMAT, format);
+}
+
+/**
+ * @ingroup iface_zwp_linux_dmabuf_v1
+ * Sends an modifier event to the client owning the resource.
+ * @param resource_ The client's resource
+ * @param format DRM_FORMAT code
+ * @param modifier_hi high 32 bits of layout modifier
+ * @param modifier_lo low 32 bits of layout modifier
+ */
+static inline void
+zwp_linux_dmabuf_v1_send_modifier(struct wl_resource *resource_, uint32_t format, uint32_t modifier_hi, uint32_t modifier_lo)
+{
+ wl_resource_post_event(resource_, ZWP_LINUX_DMABUF_V1_MODIFIER, format, modifier_hi, modifier_lo);
+}
+
+#ifndef ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_ENUM
+#define ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_ENUM
+enum zwp_linux_buffer_params_v1_error {
+ /**
+ * the dmabuf_batch object has already been used to create a wl_buffer
+ */
+ ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_ALREADY_USED = 0,
+ /**
+ * plane index out of bounds
+ */
+ ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_PLANE_IDX = 1,
+ /**
+ * the plane index was already set
+ */
+ ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_PLANE_SET = 2,
+ /**
+ * missing or too many planes to create a buffer
+ */
+ ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_INCOMPLETE = 3,
+ /**
+ * format not supported
+ */
+ ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_INVALID_FORMAT = 4,
+ /**
+ * invalid width or height
+ */
+ ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_INVALID_DIMENSIONS = 5,
+ /**
+ * offset + stride * height goes out of dmabuf bounds
+ */
+ ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_OUT_OF_BOUNDS = 6,
+ /**
+ * invalid wl_buffer resulted from importing dmabufs via the create_immed request on given buffer_params
+ */
+ ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_INVALID_WL_BUFFER = 7,
+};
+#endif /* ZWP_LINUX_BUFFER_PARAMS_V1_ERROR_ENUM */
+
+#ifndef ZWP_LINUX_BUFFER_PARAMS_V1_FLAGS_ENUM
+#define ZWP_LINUX_BUFFER_PARAMS_V1_FLAGS_ENUM
+enum zwp_linux_buffer_params_v1_flags {
+ /**
+ * contents are y-inverted
+ */
+ ZWP_LINUX_BUFFER_PARAMS_V1_FLAGS_Y_INVERT = 1,
+ /**
+ * content is interlaced
+ */
+ ZWP_LINUX_BUFFER_PARAMS_V1_FLAGS_INTERLACED = 2,
+ /**
+ * bottom field first
+ */
+ ZWP_LINUX_BUFFER_PARAMS_V1_FLAGS_BOTTOM_FIRST = 4,
+};
+#endif /* ZWP_LINUX_BUFFER_PARAMS_V1_FLAGS_ENUM */
+
+/**
+ * @ingroup iface_zwp_linux_buffer_params_v1
+ * @struct zwp_linux_buffer_params_v1_interface
+ */
+struct zwp_linux_buffer_params_v1_interface {
+ /**
+ * delete this object, used or not
+ *
+ * Cleans up the temporary data sent to the server for
+ * dmabuf-based wl_buffer creation.
+ */
+ void (*destroy)(struct wl_client *client,
+ struct wl_resource *resource);
+ /**
+ * add a dmabuf to the temporary set
+ *
+ * This request adds one dmabuf to the set in this
+ * zwp_linux_buffer_params_v1.
+ *
+ * The 64-bit unsigned value combined from modifier_hi and
+ * modifier_lo is the dmabuf layout modifier. DRM AddFB2 ioctl
+ * calls this the fb modifier, which is defined in drm_mode.h of
+ * Linux UAPI. This is an opaque token. Drivers use this token to
+ * express tiling, compression, etc. driver-specific modifications
+ * to the base format defined by the DRM fourcc code.
+ *
+ * This request raises the PLANE_IDX error if plane_idx is too
+ * large. The error PLANE_SET is raised if attempting to set a
+ * plane that was already set.
+ * @param fd dmabuf fd
+ * @param plane_idx plane index
+ * @param offset offset in bytes
+ * @param stride stride in bytes
+ * @param modifier_hi high 32 bits of layout modifier
+ * @param modifier_lo low 32 bits of layout modifier
+ */
+ void (*add)(struct wl_client *client,
+ struct wl_resource *resource,
+ int32_t fd,
+ uint32_t plane_idx,
+ uint32_t offset,
+ uint32_t stride,
+ uint32_t modifier_hi,
+ uint32_t modifier_lo);
+ /**
+ * create a wl_buffer from the given dmabufs
+ *
+ * This asks for creation of a wl_buffer from the added dmabuf
+ * buffers. The wl_buffer is not created immediately but returned
+ * via the 'created' event if the dmabuf sharing succeeds. The
+ * sharing may fail at runtime for reasons a client cannot predict,
+ * in which case the 'failed' event is triggered.
+ *
+ * The 'format' argument is a DRM_FORMAT code, as defined by the
+ * libdrm's drm_fourcc.h. The Linux kernel's DRM sub-system is the
+ * authoritative source on how the format codes should work.
+ *
+ * The 'flags' is a bitfield of the flags defined in enum "flags".
+ * 'y_invert' means the that the image needs to be y-flipped.
+ *
+ * Flag 'interlaced' means that the frame in the buffer is not
+ * progressive as usual, but interlaced. An interlaced buffer as
+ * supported here must always contain both top and bottom fields.
+ * The top field always begins on the first pixel row. The temporal
+ * ordering between the two fields is top field first, unless
+ * 'bottom_first' is specified. It is undefined whether
+ * 'bottom_first' is ignored if 'interlaced' is not set.
+ *
+ * This protocol does not convey any information about field rate,
+ * duration, or timing, other than the relative ordering between
+ * the two fields in one buffer. A compositor may have to estimate
+ * the intended field rate from the incoming buffer rate. It is
+ * undefined whether the time of receiving wl_surface.commit with a
+ * new buffer attached, applying the wl_surface state,
+ * wl_surface.frame callback trigger, presentation, or any other
+ * point in the compositor cycle is used to measure the frame or
+ * field times. There is no support for detecting missed or late
+ * frames/fields/buffers either, and there is no support whatsoever
+ * for cooperating with interlaced compositor output.
+ *
+ * The composited image quality resulting from the use of
+ * interlaced buffers is explicitly undefined. A compositor may use
+ * elaborate hardware features or software to deinterlace and
+ * create progressive output frames from a sequence of interlaced
+ * input buffers, or it may produce substandard image quality.
+ * However, compositors that cannot guarantee reasonable image
+ * quality in all cases are recommended to just reject all
+ * interlaced buffers.
+ *
+ * Any argument errors, including non-positive width or height,
+ * mismatch between the number of planes and the format, bad
+ * format, bad offset or stride, may be indicated by fatal protocol
+ * errors: INCOMPLETE, INVALID_FORMAT, INVALID_DIMENSIONS,
+ * OUT_OF_BOUNDS.
+ *
+ * Dmabuf import errors in the server that are not obvious client
+ * bugs are returned via the 'failed' event as non-fatal. This
+ * allows attempting dmabuf sharing and falling back in the client
+ * if it fails.
+ *
+ * This request can be sent only once in the object's lifetime,
+ * after which the only legal request is destroy. This object
+ * should be destroyed after issuing a 'create' request. Attempting
+ * to use this object after issuing 'create' raises ALREADY_USED
+ * protocol error.
+ *
+ * It is not mandatory to issue 'create'. If a client wants to
+ * cancel the buffer creation, it can just destroy this object.
+ * @param width base plane width in pixels
+ * @param height base plane height in pixels
+ * @param format DRM_FORMAT code
+ * @param flags see enum flags
+ */
+ void (*create)(struct wl_client *client,
+ struct wl_resource *resource,
+ int32_t width,
+ int32_t height,
+ uint32_t format,
+ uint32_t flags);
+ /**
+ * immediately create a wl_buffer from the given dmabufs
+ *
+ * This asks for immediate creation of a wl_buffer by importing
+ * the added dmabufs.
+ *
+ * In case of import success, no event is sent from the server, and
+ * the wl_buffer is ready to be used by the client.
+ *
+ * Upon import failure, either of the following may happen, as seen
+ * fit by the implementation: - the client is terminated with one
+ * of the following fatal protocol errors: - INCOMPLETE,
+ * INVALID_FORMAT, INVALID_DIMENSIONS, OUT_OF_BOUNDS, in case of
+ * argument errors such as mismatch between the number of planes
+ * and the format, bad format, non-positive width or height, or bad
+ * offset or stride. - INVALID_WL_BUFFER, in case the cause for
+ * failure is unknown or plaform specific. - the server creates an
+ * invalid wl_buffer, marks it as failed and sends a 'failed' event
+ * to the client. The result of using this invalid wl_buffer as an
+ * argument in any request by the client is defined by the
+ * compositor implementation.
+ *
+ * This takes the same arguments as a 'create' request, and obeys
+ * the same restrictions.
+ * @param buffer_id id for the newly created wl_buffer
+ * @param width base plane width in pixels
+ * @param height base plane height in pixels
+ * @param format DRM_FORMAT code
+ * @param flags see enum flags
+ * @since 2
+ */
+ void (*create_immed)(struct wl_client *client,
+ struct wl_resource *resource,
+ uint32_t buffer_id,
+ int32_t width,
+ int32_t height,
+ uint32_t format,
+ uint32_t flags);
+};
+
+#define ZWP_LINUX_BUFFER_PARAMS_V1_CREATED 0
+#define ZWP_LINUX_BUFFER_PARAMS_V1_FAILED 1
+
+/**
+ * @ingroup iface_zwp_linux_buffer_params_v1
+ */
+#define ZWP_LINUX_BUFFER_PARAMS_V1_CREATED_SINCE_VERSION 1
+/**
+ * @ingroup iface_zwp_linux_buffer_params_v1
+ */
+#define ZWP_LINUX_BUFFER_PARAMS_V1_FAILED_SINCE_VERSION 1
+
+/**
+ * @ingroup iface_zwp_linux_buffer_params_v1
+ */
+#define ZWP_LINUX_BUFFER_PARAMS_V1_DESTROY_SINCE_VERSION 1
+/**
+ * @ingroup iface_zwp_linux_buffer_params_v1
+ */
+#define ZWP_LINUX_BUFFER_PARAMS_V1_ADD_SINCE_VERSION 1
+/**
+ * @ingroup iface_zwp_linux_buffer_params_v1
+ */
+#define ZWP_LINUX_BUFFER_PARAMS_V1_CREATE_SINCE_VERSION 1
+/**
+ * @ingroup iface_zwp_linux_buffer_params_v1
+ */
+#define ZWP_LINUX_BUFFER_PARAMS_V1_CREATE_IMMED_SINCE_VERSION 2
+
+/**
+ * @ingroup iface_zwp_linux_buffer_params_v1
+ * Sends an created event to the client owning the resource.
+ * @param resource_ The client's resource
+ * @param buffer the newly created wl_buffer
+ */
+static inline void
+zwp_linux_buffer_params_v1_send_created(struct wl_resource *resource_, struct wl_resource *buffer)
+{
+ wl_resource_post_event(resource_, ZWP_LINUX_BUFFER_PARAMS_V1_CREATED, buffer);
+}
+
+/**
+ * @ingroup iface_zwp_linux_buffer_params_v1
+ * Sends an failed event to the client owning the resource.
+ * @param resource_ The client's resource
+ */
+static inline void
+zwp_linux_buffer_params_v1_send_failed(struct wl_resource *resource_)
+{
+ wl_resource_post_event(resource_, ZWP_LINUX_BUFFER_PARAMS_V1_FAILED);
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/chromium/third_party/wayland-protocols/include/protocol/pointer-gestures-unstable-v1-client-protocol.h b/chromium/third_party/wayland-protocols/include/protocol/pointer-gestures-unstable-v1-client-protocol.h
new file mode 100644
index 00000000000..7b7daabce92
--- /dev/null
+++ b/chromium/third_party/wayland-protocols/include/protocol/pointer-gestures-unstable-v1-client-protocol.h
@@ -0,0 +1,300 @@
+#ifndef POINTER_GESTURES_UNSTABLE_V1_CLIENT_PROTOCOL_H
+#define POINTER_GESTURES_UNSTABLE_V1_CLIENT_PROTOCOL_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <stdint.h>
+#include <stddef.h>
+#include "wayland-client.h"
+
+struct wl_client;
+struct wl_resource;
+
+struct zwp_pointer_gestures_v1;
+struct zwp_pointer_gesture_swipe_v1;
+struct zwp_pointer_gesture_pinch_v1;
+
+extern const struct wl_interface zwp_pointer_gestures_v1_interface;
+extern const struct wl_interface zwp_pointer_gesture_swipe_v1_interface;
+extern const struct wl_interface zwp_pointer_gesture_pinch_v1_interface;
+
+#define ZWP_POINTER_GESTURES_V1_GET_SWIPE_GESTURE 0
+#define ZWP_POINTER_GESTURES_V1_GET_PINCH_GESTURE 1
+
+static inline void
+zwp_pointer_gestures_v1_set_user_data(struct zwp_pointer_gestures_v1 *zwp_pointer_gestures_v1, void *user_data)
+{
+ wl_proxy_set_user_data((struct wl_proxy *) zwp_pointer_gestures_v1, user_data);
+}
+
+static inline void *
+zwp_pointer_gestures_v1_get_user_data(struct zwp_pointer_gestures_v1 *zwp_pointer_gestures_v1)
+{
+ return wl_proxy_get_user_data((struct wl_proxy *) zwp_pointer_gestures_v1);
+}
+
+static inline void
+zwp_pointer_gestures_v1_destroy(struct zwp_pointer_gestures_v1 *zwp_pointer_gestures_v1)
+{
+ wl_proxy_destroy((struct wl_proxy *) zwp_pointer_gestures_v1);
+}
+
+static inline struct zwp_pointer_gesture_swipe_v1 *
+zwp_pointer_gestures_v1_get_swipe_gesture(struct zwp_pointer_gestures_v1 *zwp_pointer_gestures_v1, struct wl_pointer *pointer)
+{
+ struct wl_proxy *id;
+
+ id = wl_proxy_marshal_constructor((struct wl_proxy *) zwp_pointer_gestures_v1,
+ ZWP_POINTER_GESTURES_V1_GET_SWIPE_GESTURE, &zwp_pointer_gesture_swipe_v1_interface, NULL, pointer);
+
+ return (struct zwp_pointer_gesture_swipe_v1 *) id;
+}
+
+static inline struct zwp_pointer_gesture_pinch_v1 *
+zwp_pointer_gestures_v1_get_pinch_gesture(struct zwp_pointer_gestures_v1 *zwp_pointer_gestures_v1, struct wl_pointer *pointer)
+{
+ struct wl_proxy *id;
+
+ id = wl_proxy_marshal_constructor((struct wl_proxy *) zwp_pointer_gestures_v1,
+ ZWP_POINTER_GESTURES_V1_GET_PINCH_GESTURE, &zwp_pointer_gesture_pinch_v1_interface, NULL, pointer);
+
+ return (struct zwp_pointer_gesture_pinch_v1 *) id;
+}
+
+/**
+ * zwp_pointer_gesture_swipe_v1 - a swipe gesture object
+ * @begin: multi-finger swipe begin
+ * @update: multi-finger swipe motion
+ * @end: multi-finger swipe end
+ *
+ * A swipe gesture object notifies a client about a multi-finger swipe
+ * gesture detected on an indirect input device such as a touchpad. The
+ * gesture is usually initiated by multiple fingers moving in the same
+ * direction but once initiated the direction may change. The precise
+ * conditions of when such a gesture is detected are
+ * implementation-dependent.
+ *
+ * A gesture consists of three stages: begin, update (optional) and end.
+ * There cannot be multiple simultaneous pinch or swipe gestures on a same
+ * pointer/seat, how compositors prevent these situations is
+ * implementation-dependent.
+ *
+ * A gesture may be cancelled by the compositor or the hardware. Clients
+ * should not consider performing permanent or irreversible actions until
+ * the end of a gesture has been received.
+ */
+struct zwp_pointer_gesture_swipe_v1_listener {
+ /**
+ * begin - multi-finger swipe begin
+ * @serial: (none)
+ * @time: timestamp with millisecond granularity
+ * @surface: (none)
+ * @fingers: number of fingers
+ *
+ * This event is sent when a multi-finger swipe gesture is
+ * detected on the device.
+ */
+ void (*begin)(void *data,
+ struct zwp_pointer_gesture_swipe_v1 *zwp_pointer_gesture_swipe_v1,
+ uint32_t serial,
+ uint32_t time,
+ struct wl_surface *surface,
+ uint32_t fingers);
+ /**
+ * update - multi-finger swipe motion
+ * @time: timestamp with millisecond granularity
+ * @dx: delta x coordinate in surface coordinate space
+ * @dy: delta y coordinate in surface coordinate space
+ *
+ * This event is sent when a multi-finger swipe gesture changes
+ * the position of the logical center.
+ *
+ * The dx and dy coordinates are relative coordinates of the
+ * logical center of the gesture compared to the previous event.
+ */
+ void (*update)(void *data,
+ struct zwp_pointer_gesture_swipe_v1 *zwp_pointer_gesture_swipe_v1,
+ uint32_t time,
+ wl_fixed_t dx,
+ wl_fixed_t dy);
+ /**
+ * end - multi-finger swipe end
+ * @serial: (none)
+ * @time: timestamp with millisecond granularity
+ * @cancelled: 1 if the gesture was cancelled, 0 otherwise
+ *
+ * This event is sent when a multi-finger swipe gesture ceases to
+ * be valid. This may happen when one or more fingers are lifted or
+ * the gesture is cancelled.
+ *
+ * When a gesture is cancelled, the client should undo state
+ * changes caused by this gesture. What causes a gesture to be
+ * cancelled is implementation-dependent.
+ */
+ void (*end)(void *data,
+ struct zwp_pointer_gesture_swipe_v1 *zwp_pointer_gesture_swipe_v1,
+ uint32_t serial,
+ uint32_t time,
+ int32_t cancelled);
+};
+
+static inline int
+zwp_pointer_gesture_swipe_v1_add_listener(struct zwp_pointer_gesture_swipe_v1 *zwp_pointer_gesture_swipe_v1,
+ const struct zwp_pointer_gesture_swipe_v1_listener *listener, void *data)
+{
+ return wl_proxy_add_listener((struct wl_proxy *) zwp_pointer_gesture_swipe_v1,
+ (void (**)(void)) listener, data);
+}
+
+#define ZWP_POINTER_GESTURE_SWIPE_V1_DESTROY 0
+
+static inline void
+zwp_pointer_gesture_swipe_v1_set_user_data(struct zwp_pointer_gesture_swipe_v1 *zwp_pointer_gesture_swipe_v1, void *user_data)
+{
+ wl_proxy_set_user_data((struct wl_proxy *) zwp_pointer_gesture_swipe_v1, user_data);
+}
+
+static inline void *
+zwp_pointer_gesture_swipe_v1_get_user_data(struct zwp_pointer_gesture_swipe_v1 *zwp_pointer_gesture_swipe_v1)
+{
+ return wl_proxy_get_user_data((struct wl_proxy *) zwp_pointer_gesture_swipe_v1);
+}
+
+static inline void
+zwp_pointer_gesture_swipe_v1_destroy(struct zwp_pointer_gesture_swipe_v1 *zwp_pointer_gesture_swipe_v1)
+{
+ wl_proxy_marshal((struct wl_proxy *) zwp_pointer_gesture_swipe_v1,
+ ZWP_POINTER_GESTURE_SWIPE_V1_DESTROY);
+
+ wl_proxy_destroy((struct wl_proxy *) zwp_pointer_gesture_swipe_v1);
+}
+
+/**
+ * zwp_pointer_gesture_pinch_v1 - a pinch gesture object
+ * @begin: multi-finger pinch begin
+ * @update: multi-finger pinch motion
+ * @end: multi-finger pinch end
+ *
+ * A pinch gesture object notifies a client about a multi-finger pinch
+ * gesture detected on an indirect input device such as a touchpad. The
+ * gesture is usually initiated by multiple fingers moving towards each
+ * other or away from each other, or by two or more fingers rotating around
+ * a logical center of gravity. The precise conditions of when such a
+ * gesture is detected are implementation-dependent.
+ *
+ * A gesture consists of three stages: begin, update (optional) and end.
+ * There cannot be multiple simultaneous pinch or swipe gestures on a same
+ * pointer/seat, how compositors prevent these situations is
+ * implementation-dependent.
+ *
+ * A gesture may be cancelled by the compositor or the hardware. Clients
+ * should not consider performing permanent or irreversible actions until
+ * the end of a gesture has been received.
+ */
+struct zwp_pointer_gesture_pinch_v1_listener {
+ /**
+ * begin - multi-finger pinch begin
+ * @serial: (none)
+ * @time: timestamp with millisecond granularity
+ * @surface: (none)
+ * @fingers: number of fingers
+ *
+ * This event is sent when a multi-finger pinch gesture is
+ * detected on the device.
+ */
+ void (*begin)(void *data,
+ struct zwp_pointer_gesture_pinch_v1 *zwp_pointer_gesture_pinch_v1,
+ uint32_t serial,
+ uint32_t time,
+ struct wl_surface *surface,
+ uint32_t fingers);
+ /**
+ * update - multi-finger pinch motion
+ * @time: timestamp with millisecond granularity
+ * @dx: delta x coordinate in surface coordinate space
+ * @dy: delta y coordinate in surface coordinate space
+ * @scale: scale relative to the initial finger position
+ * @rotation: angle in degrees cw relative to the previous event
+ *
+ * This event is sent when a multi-finger pinch gesture changes
+ * the position of the logical center, the rotation or the relative
+ * scale.
+ *
+ * The dx and dy coordinates are relative coordinates in the
+ * surface coordinate space of the logical center of the gesture.
+ *
+ * The scale factor is an absolute scale compared to the
+ * pointer_gesture_pinch.begin event, e.g. a scale of 2 means the
+ * fingers are now twice as far apart as on
+ * pointer_gesture_pinch.begin.
+ *
+ * The rotation is the relative angle in degrees clockwise compared
+ * to the previous pointer_gesture_pinch.begin or
+ * pointer_gesture_pinch.update event.
+ */
+ void (*update)(void *data,
+ struct zwp_pointer_gesture_pinch_v1 *zwp_pointer_gesture_pinch_v1,
+ uint32_t time,
+ wl_fixed_t dx,
+ wl_fixed_t dy,
+ wl_fixed_t scale,
+ wl_fixed_t rotation);
+ /**
+ * end - multi-finger pinch end
+ * @serial: (none)
+ * @time: timestamp with millisecond granularity
+ * @cancelled: 1 if the gesture was cancelled, 0 otherwise
+ *
+ * This event is sent when a multi-finger pinch gesture ceases to
+ * be valid. This may happen when one or more fingers are lifted or
+ * the gesture is cancelled.
+ *
+ * When a gesture is cancelled, the client should undo state
+ * changes caused by this gesture. What causes a gesture to be
+ * cancelled is implementation-dependent.
+ */
+ void (*end)(void *data,
+ struct zwp_pointer_gesture_pinch_v1 *zwp_pointer_gesture_pinch_v1,
+ uint32_t serial,
+ uint32_t time,
+ int32_t cancelled);
+};
+
+static inline int
+zwp_pointer_gesture_pinch_v1_add_listener(struct zwp_pointer_gesture_pinch_v1 *zwp_pointer_gesture_pinch_v1,
+ const struct zwp_pointer_gesture_pinch_v1_listener *listener, void *data)
+{
+ return wl_proxy_add_listener((struct wl_proxy *) zwp_pointer_gesture_pinch_v1,
+ (void (**)(void)) listener, data);
+}
+
+#define ZWP_POINTER_GESTURE_PINCH_V1_DESTROY 0
+
+static inline void
+zwp_pointer_gesture_pinch_v1_set_user_data(struct zwp_pointer_gesture_pinch_v1 *zwp_pointer_gesture_pinch_v1, void *user_data)
+{
+ wl_proxy_set_user_data((struct wl_proxy *) zwp_pointer_gesture_pinch_v1, user_data);
+}
+
+static inline void *
+zwp_pointer_gesture_pinch_v1_get_user_data(struct zwp_pointer_gesture_pinch_v1 *zwp_pointer_gesture_pinch_v1)
+{
+ return wl_proxy_get_user_data((struct wl_proxy *) zwp_pointer_gesture_pinch_v1);
+}
+
+static inline void
+zwp_pointer_gesture_pinch_v1_destroy(struct zwp_pointer_gesture_pinch_v1 *zwp_pointer_gesture_pinch_v1)
+{
+ wl_proxy_marshal((struct wl_proxy *) zwp_pointer_gesture_pinch_v1,
+ ZWP_POINTER_GESTURE_PINCH_V1_DESTROY);
+
+ wl_proxy_destroy((struct wl_proxy *) zwp_pointer_gesture_pinch_v1);
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/chromium/third_party/wayland-protocols/include/protocol/pointer-gestures-unstable-v1-server-protocol.h b/chromium/third_party/wayland-protocols/include/protocol/pointer-gestures-unstable-v1-server-protocol.h
new file mode 100644
index 00000000000..8c76ad5027f
--- /dev/null
+++ b/chromium/third_party/wayland-protocols/include/protocol/pointer-gestures-unstable-v1-server-protocol.h
@@ -0,0 +1,179 @@
+#ifndef POINTER_GESTURES_UNSTABLE_V1_SERVER_PROTOCOL_H
+#define POINTER_GESTURES_UNSTABLE_V1_SERVER_PROTOCOL_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#include <stdint.h>
+#include <stddef.h>
+#include "wayland-util.h"
+
+struct wl_client;
+struct wl_resource;
+
+struct zwp_pointer_gestures_v1;
+struct zwp_pointer_gesture_swipe_v1;
+struct zwp_pointer_gesture_pinch_v1;
+
+extern const struct wl_interface zwp_pointer_gestures_v1_interface;
+extern const struct wl_interface zwp_pointer_gesture_swipe_v1_interface;
+extern const struct wl_interface zwp_pointer_gesture_pinch_v1_interface;
+
+/**
+ * zwp_pointer_gestures_v1 - touchpad gestures
+ * @get_swipe_gesture: get swipe gesture
+ * @get_pinch_gesture: get pinch gesture
+ *
+ * A global interface to provide semantic touchpad gestures for a given
+ * pointer.
+ *
+ * Two gestures are currently supported: swipe and zoom/rotate. All
+ * gestures follow a three-stage cycle: begin, update, end and are
+ * identified by a unique id.
+ *
+ * Warning! The protocol described in this file is experimental and
+ * backward incompatible changes may be made. Backward compatible changes
+ * may be added together with the corresponding interface version bump.
+ * Backward incompatible changes are done by bumping the version number in
+ * the protocol and interface names and resetting the interface version.
+ * Once the protocol is to be declared stable, the 'z' prefix and the
+ * version number in the protocol and interface names are removed and the
+ * interface version number is reset.
+ */
+struct zwp_pointer_gestures_v1_interface {
+ /**
+ * get_swipe_gesture - get swipe gesture
+ * @id: (none)
+ * @pointer: (none)
+ *
+ * Create a swipe gesture object. See the
+ * wl_pointer_gesture_swipe interface for details.
+ */
+ void (*get_swipe_gesture)(struct wl_client *client,
+ struct wl_resource *resource,
+ uint32_t id,
+ struct wl_resource *pointer);
+ /**
+ * get_pinch_gesture - get pinch gesture
+ * @id: (none)
+ * @pointer: (none)
+ *
+ * Create a pinch gesture object. See the
+ * wl_pointer_gesture_pinch interface for details.
+ */
+ void (*get_pinch_gesture)(struct wl_client *client,
+ struct wl_resource *resource,
+ uint32_t id,
+ struct wl_resource *pointer);
+};
+
+/**
+ * zwp_pointer_gesture_swipe_v1 - a swipe gesture object
+ * @destroy: destroy the pointer swipe gesture object
+ *
+ * A swipe gesture object notifies a client about a multi-finger swipe
+ * gesture detected on an indirect input device such as a touchpad. The
+ * gesture is usually initiated by multiple fingers moving in the same
+ * direction but once initiated the direction may change. The precise
+ * conditions of when such a gesture is detected are
+ * implementation-dependent.
+ *
+ * A gesture consists of three stages: begin, update (optional) and end.
+ * There cannot be multiple simultaneous pinch or swipe gestures on a same
+ * pointer/seat, how compositors prevent these situations is
+ * implementation-dependent.
+ *
+ * A gesture may be cancelled by the compositor or the hardware. Clients
+ * should not consider performing permanent or irreversible actions until
+ * the end of a gesture has been received.
+ */
+struct zwp_pointer_gesture_swipe_v1_interface {
+ /**
+ * destroy - destroy the pointer swipe gesture object
+ *
+ *
+ */
+ void (*destroy)(struct wl_client *client,
+ struct wl_resource *resource);
+};
+
+#define ZWP_POINTER_GESTURE_SWIPE_V1_BEGIN 0
+#define ZWP_POINTER_GESTURE_SWIPE_V1_UPDATE 1
+#define ZWP_POINTER_GESTURE_SWIPE_V1_END 2
+
+static inline void
+zwp_pointer_gesture_swipe_v1_send_begin(struct wl_resource *resource_, uint32_t serial, uint32_t time, struct wl_resource *surface, uint32_t fingers)
+{
+ wl_resource_post_event(resource_, ZWP_POINTER_GESTURE_SWIPE_V1_BEGIN, serial, time, surface, fingers);
+}
+
+static inline void
+zwp_pointer_gesture_swipe_v1_send_update(struct wl_resource *resource_, uint32_t time, wl_fixed_t dx, wl_fixed_t dy)
+{
+ wl_resource_post_event(resource_, ZWP_POINTER_GESTURE_SWIPE_V1_UPDATE, time, dx, dy);
+}
+
+static inline void
+zwp_pointer_gesture_swipe_v1_send_end(struct wl_resource *resource_, uint32_t serial, uint32_t time, int32_t cancelled)
+{
+ wl_resource_post_event(resource_, ZWP_POINTER_GESTURE_SWIPE_V1_END, serial, time, cancelled);
+}
+
+/**
+ * zwp_pointer_gesture_pinch_v1 - a pinch gesture object
+ * @destroy: destroy the pinch gesture object
+ *
+ * A pinch gesture object notifies a client about a multi-finger pinch
+ * gesture detected on an indirect input device such as a touchpad. The
+ * gesture is usually initiated by multiple fingers moving towards each
+ * other or away from each other, or by two or more fingers rotating around
+ * a logical center of gravity. The precise conditions of when such a
+ * gesture is detected are implementation-dependent.
+ *
+ * A gesture consists of three stages: begin, update (optional) and end.
+ * There cannot be multiple simultaneous pinch or swipe gestures on a same
+ * pointer/seat, how compositors prevent these situations is
+ * implementation-dependent.
+ *
+ * A gesture may be cancelled by the compositor or the hardware. Clients
+ * should not consider performing permanent or irreversible actions until
+ * the end of a gesture has been received.
+ */
+struct zwp_pointer_gesture_pinch_v1_interface {
+ /**
+ * destroy - destroy the pinch gesture object
+ *
+ *
+ */
+ void (*destroy)(struct wl_client *client,
+ struct wl_resource *resource);
+};
+
+#define ZWP_POINTER_GESTURE_PINCH_V1_BEGIN 0
+#define ZWP_POINTER_GESTURE_PINCH_V1_UPDATE 1
+#define ZWP_POINTER_GESTURE_PINCH_V1_END 2
+
+static inline void
+zwp_pointer_gesture_pinch_v1_send_begin(struct wl_resource *resource_, uint32_t serial, uint32_t time, struct wl_resource *surface, uint32_t fingers)
+{
+ wl_resource_post_event(resource_, ZWP_POINTER_GESTURE_PINCH_V1_BEGIN, serial, time, surface, fingers);
+}
+
+static inline void
+zwp_pointer_gesture_pinch_v1_send_update(struct wl_resource *resource_, uint32_t time, wl_fixed_t dx, wl_fixed_t dy, wl_fixed_t scale, wl_fixed_t rotation)
+{
+ wl_resource_post_event(resource_, ZWP_POINTER_GESTURE_PINCH_V1_UPDATE, time, dx, dy, scale, rotation);
+}
+
+static inline void
+zwp_pointer_gesture_pinch_v1_send_end(struct wl_resource *resource_, uint32_t serial, uint32_t time, int32_t cancelled)
+{
+ wl_resource_post_event(resource_, ZWP_POINTER_GESTURE_PINCH_V1_END, serial, time, cancelled);
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/chromium/third_party/wayland-protocols/include/protocol/presentation-time-client-protocol.h b/chromium/third_party/wayland-protocols/include/protocol/presentation-time-client-protocol.h
new file mode 100644
index 00000000000..23c2ae8cd4c
--- /dev/null
+++ b/chromium/third_party/wayland-protocols/include/protocol/presentation-time-client-protocol.h
@@ -0,0 +1,497 @@
+/* Generated by wayland-scanner 1.13.0 */
+
+#ifndef PRESENTATION_TIME_CLIENT_PROTOCOL_H
+#define PRESENTATION_TIME_CLIENT_PROTOCOL_H
+
+#include <stdint.h>
+#include <stddef.h>
+#include "wayland-client.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @page page_presentation_time The presentation_time protocol
+ * @section page_ifaces_presentation_time Interfaces
+ * - @subpage page_iface_wp_presentation - timed presentation related wl_surface requests
+ * - @subpage page_iface_wp_presentation_feedback - presentation time feedback event
+ * @section page_copyright_presentation_time Copyright
+ * <pre>
+ *
+ * Copyright © 2013-2014 Collabora, Ltd.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ * </pre>
+ */
+struct wl_output;
+struct wl_surface;
+struct wp_presentation;
+struct wp_presentation_feedback;
+
+/**
+ * @page page_iface_wp_presentation wp_presentation
+ * @section page_iface_wp_presentation_desc Description
+ *
+ *
+ *
+ *
+ * The main feature of this interface is accurate presentation
+ * timing feedback to ensure smooth video playback while maintaining
+ * audio/video synchronization. Some features use the concept of a
+ * presentation clock, which is defined in the
+ * presentation.clock_id event.
+ *
+ * A content update for a wl_surface is submitted by a
+ * wl_surface.commit request. Request 'feedback' associates with
+ * the wl_surface.commit and provides feedback on the content
+ * update, particularly the final realized presentation time.
+ *
+ *
+ *
+ * When the final realized presentation time is available, e.g.
+ * after a framebuffer flip completes, the requested
+ * presentation_feedback.presented events are sent. The final
+ * presentation time can differ from the compositor's predicted
+ * display update time and the update's target time, especially
+ * when the compositor misses its target vertical blanking period.
+ * @section page_iface_wp_presentation_api API
+ * See @ref iface_wp_presentation.
+ */
+/**
+ * @defgroup iface_wp_presentation The wp_presentation interface
+ *
+ *
+ *
+ *
+ * The main feature of this interface is accurate presentation
+ * timing feedback to ensure smooth video playback while maintaining
+ * audio/video synchronization. Some features use the concept of a
+ * presentation clock, which is defined in the
+ * presentation.clock_id event.
+ *
+ * A content update for a wl_surface is submitted by a
+ * wl_surface.commit request. Request 'feedback' associates with
+ * the wl_surface.commit and provides feedback on the content
+ * update, particularly the final realized presentation time.
+ *
+ *
+ *
+ * When the final realized presentation time is available, e.g.
+ * after a framebuffer flip completes, the requested
+ * presentation_feedback.presented events are sent. The final
+ * presentation time can differ from the compositor's predicted
+ * display update time and the update's target time, especially
+ * when the compositor misses its target vertical blanking period.
+ */
+extern const struct wl_interface wp_presentation_interface;
+/**
+ * @page page_iface_wp_presentation_feedback wp_presentation_feedback
+ * @section page_iface_wp_presentation_feedback_desc Description
+ *
+ * A presentation_feedback object returns an indication that a
+ * wl_surface content update has become visible to the user.
+ * One object corresponds to one content update submission
+ * (wl_surface.commit). There are two possible outcomes: the
+ * content update is presented to the user, and a presentation
+ * timestamp delivered; or, the user did not see the content
+ * update because it was superseded or its surface destroyed,
+ * and the content update is discarded.
+ *
+ * Once a presentation_feedback object has delivered a 'presented'
+ * or 'discarded' event it is automatically destroyed.
+ * @section page_iface_wp_presentation_feedback_api API
+ * See @ref iface_wp_presentation_feedback.
+ */
+/**
+ * @defgroup iface_wp_presentation_feedback The wp_presentation_feedback interface
+ *
+ * A presentation_feedback object returns an indication that a
+ * wl_surface content update has become visible to the user.
+ * One object corresponds to one content update submission
+ * (wl_surface.commit). There are two possible outcomes: the
+ * content update is presented to the user, and a presentation
+ * timestamp delivered; or, the user did not see the content
+ * update because it was superseded or its surface destroyed,
+ * and the content update is discarded.
+ *
+ * Once a presentation_feedback object has delivered a 'presented'
+ * or 'discarded' event it is automatically destroyed.
+ */
+extern const struct wl_interface wp_presentation_feedback_interface;
+
+#ifndef WP_PRESENTATION_ERROR_ENUM
+#define WP_PRESENTATION_ERROR_ENUM
+/**
+ * @ingroup iface_wp_presentation
+ * fatal presentation errors
+ *
+ * These fatal protocol errors may be emitted in response to
+ * illegal presentation requests.
+ */
+enum wp_presentation_error {
+ /**
+ * invalid value in tv_nsec
+ */
+ WP_PRESENTATION_ERROR_INVALID_TIMESTAMP = 0,
+ /**
+ * invalid flag
+ */
+ WP_PRESENTATION_ERROR_INVALID_FLAG = 1,
+};
+#endif /* WP_PRESENTATION_ERROR_ENUM */
+
+/**
+ * @ingroup iface_wp_presentation
+ * @struct wp_presentation_listener
+ */
+struct wp_presentation_listener {
+ /**
+ * clock ID for timestamps
+ *
+ * This event tells the client in which clock domain the
+ * compositor interprets the timestamps used by the presentation
+ * extension. This clock is called the presentation clock.
+ *
+ * The compositor sends this event when the client binds to the
+ * presentation interface. The presentation clock does not change
+ * during the lifetime of the client connection.
+ *
+ * The clock identifier is platform dependent. On Linux/glibc, the
+ * identifier value is one of the clockid_t values accepted by
+ * clock_gettime(). clock_gettime() is defined by POSIX.1-2001.
+ *
+ * Timestamps in this clock domain are expressed as tv_sec_hi,
+ * tv_sec_lo, tv_nsec triples, each component being an unsigned
+ * 32-bit value. Whole seconds are in tv_sec which is a 64-bit
+ * value combined from tv_sec_hi and tv_sec_lo, and the additional
+ * fractional part in tv_nsec as nanoseconds. Hence, for valid
+ * timestamps tv_nsec must be in [0, 999999999].
+ *
+ * Note that clock_id applies only to the presentation clock, and
+ * implies nothing about e.g. the timestamps used in the Wayland
+ * core protocol input events.
+ *
+ * Compositors should prefer a clock which does not jump and is not
+ * slewed e.g. by NTP. The absolute value of the clock is
+ * irrelevant. Precision of one millisecond or better is
+ * recommended. Clients must be able to query the current clock
+ * value directly, not by asking the compositor.
+ * @param clk_id platform clock identifier
+ */
+ void (*clock_id)(void *data,
+ struct wp_presentation *wp_presentation,
+ uint32_t clk_id);
+};
+
+/**
+ * @ingroup iface_wp_presentation
+ */
+static inline int
+wp_presentation_add_listener(struct wp_presentation *wp_presentation,
+ const struct wp_presentation_listener *listener, void *data)
+{
+ return wl_proxy_add_listener((struct wl_proxy *) wp_presentation,
+ (void (**)(void)) listener, data);
+}
+
+#define WP_PRESENTATION_DESTROY 0
+#define WP_PRESENTATION_FEEDBACK 1
+
+/**
+ * @ingroup iface_wp_presentation
+ */
+#define WP_PRESENTATION_CLOCK_ID_SINCE_VERSION 1
+
+/**
+ * @ingroup iface_wp_presentation
+ */
+#define WP_PRESENTATION_DESTROY_SINCE_VERSION 1
+/**
+ * @ingroup iface_wp_presentation
+ */
+#define WP_PRESENTATION_FEEDBACK_SINCE_VERSION 1
+
+/** @ingroup iface_wp_presentation */
+static inline void
+wp_presentation_set_user_data(struct wp_presentation *wp_presentation, void *user_data)
+{
+ wl_proxy_set_user_data((struct wl_proxy *) wp_presentation, user_data);
+}
+
+/** @ingroup iface_wp_presentation */
+static inline void *
+wp_presentation_get_user_data(struct wp_presentation *wp_presentation)
+{
+ return wl_proxy_get_user_data((struct wl_proxy *) wp_presentation);
+}
+
+static inline uint32_t
+wp_presentation_get_version(struct wp_presentation *wp_presentation)
+{
+ return wl_proxy_get_version((struct wl_proxy *) wp_presentation);
+}
+
+/**
+ * @ingroup iface_wp_presentation
+ *
+ * Informs the server that the client will no longer be using
+ * this protocol object. Existing objects created by this object
+ * are not affected.
+ */
+static inline void
+wp_presentation_destroy(struct wp_presentation *wp_presentation)
+{
+ wl_proxy_marshal((struct wl_proxy *) wp_presentation,
+ WP_PRESENTATION_DESTROY);
+
+ wl_proxy_destroy((struct wl_proxy *) wp_presentation);
+}
+
+/**
+ * @ingroup iface_wp_presentation
+ *
+ * Request presentation feedback for the current content submission
+ * on the given surface. This creates a new presentation_feedback
+ * object, which will deliver the feedback information once. If
+ * multiple presentation_feedback objects are created for the same
+ * submission, they will all deliver the same information.
+ *
+ * For details on what information is returned, see the
+ * presentation_feedback interface.
+ */
+static inline struct wp_presentation_feedback *
+wp_presentation_feedback(struct wp_presentation *wp_presentation, struct wl_surface *surface)
+{
+ struct wl_proxy *callback;
+
+ callback = wl_proxy_marshal_constructor((struct wl_proxy *) wp_presentation,
+ WP_PRESENTATION_FEEDBACK, &wp_presentation_feedback_interface, surface, NULL);
+
+ return (struct wp_presentation_feedback *) callback;
+}
+
+#ifndef WP_PRESENTATION_FEEDBACK_KIND_ENUM
+#define WP_PRESENTATION_FEEDBACK_KIND_ENUM
+/**
+ * @ingroup iface_wp_presentation_feedback
+ * bitmask of flags in presented event
+ *
+ * These flags provide information about how the presentation of
+ * the related content update was done. The intent is to help
+ * clients assess the reliability of the feedback and the visual
+ * quality with respect to possible tearing and timings. The
+ * flags are:
+ *
+ * VSYNC:
+ * The presentation was synchronized to the "vertical retrace" by
+ * the display hardware such that tearing does not happen.
+ * Relying on user space scheduling is not acceptable for this
+ * flag. If presentation is done by a copy to the active
+ * frontbuffer, then it must guarantee that tearing cannot
+ * happen.
+ *
+ * HW_CLOCK:
+ * The display hardware provided measurements that the hardware
+ * driver converted into a presentation timestamp. Sampling a
+ * clock in user space is not acceptable for this flag.
+ *
+ * HW_COMPLETION:
+ * The display hardware signalled that it started using the new
+ * image content. The opposite of this is e.g. a timer being used
+ * to guess when the display hardware has switched to the new
+ * image content.
+ *
+ * ZERO_COPY:
+ * The presentation of this update was done zero-copy. This means
+ * the buffer from the client was given to display hardware as
+ * is, without copying it. Compositing with OpenGL counts as
+ * copying, even if textured directly from the client buffer.
+ * Possible zero-copy cases include direct scanout of a
+ * fullscreen surface and a surface on a hardware overlay.
+ */
+enum wp_presentation_feedback_kind {
+ /**
+ * presentation was vsync'd
+ */
+ WP_PRESENTATION_FEEDBACK_KIND_VSYNC = 0x1,
+ /**
+ * hardware provided the presentation timestamp
+ */
+ WP_PRESENTATION_FEEDBACK_KIND_HW_CLOCK = 0x2,
+ /**
+ * hardware signalled the start of the presentation
+ */
+ WP_PRESENTATION_FEEDBACK_KIND_HW_COMPLETION = 0x4,
+ /**
+ * presentation was done zero-copy
+ */
+ WP_PRESENTATION_FEEDBACK_KIND_ZERO_COPY = 0x8,
+};
+#endif /* WP_PRESENTATION_FEEDBACK_KIND_ENUM */
+
+/**
+ * @ingroup iface_wp_presentation_feedback
+ * @struct wp_presentation_feedback_listener
+ */
+struct wp_presentation_feedback_listener {
+ /**
+ * presentation synchronized to this output
+ *
+ * As presentation can be synchronized to only one output at a
+ * time, this event tells which output it was. This event is only
+ * sent prior to the presented event.
+ *
+ * As clients may bind to the same global wl_output multiple times,
+ * this event is sent for each bound instance that matches the
+ * synchronized output. If a client has not bound to the right
+ * wl_output global at all, this event is not sent.
+ * @param output presentation output
+ */
+ void (*sync_output)(void *data,
+ struct wp_presentation_feedback *wp_presentation_feedback,
+ struct wl_output *output);
+ /**
+ * the content update was displayed
+ *
+ * The associated content update was displayed to the user at the
+ * indicated time (tv_sec_hi/lo, tv_nsec). For the interpretation
+ * of the timestamp, see presentation.clock_id event.
+ *
+ * The timestamp corresponds to the time when the content update
+ * turned into light the first time on the surface's main output.
+ * Compositors may approximate this from the framebuffer flip
+ * completion events from the system, and the latency of the
+ * physical display path if known.
+ *
+ * This event is preceded by all related sync_output events telling
+ * which output's refresh cycle the feedback corresponds to, i.e.
+ * the main output for the surface. Compositors are recommended to
+ * choose the output containing the largest part of the wl_surface,
+ * or keeping the output they previously chose. Having a stable
+ * presentation output association helps clients predict future
+ * output refreshes (vblank).
+ *
+ * The 'refresh' argument gives the compositor's prediction of how
+ * many nanoseconds after tv_sec, tv_nsec the very next output
+ * refresh may occur. This is to further aid clients in predicting
+ * future refreshes, i.e., estimating the timestamps targeting the
+ * next few vblanks. If such prediction cannot usefully be done,
+ * the argument is zero.
+ *
+ * If the output does not have a constant refresh rate, explicit
+ * video mode switches excluded, then the refresh argument must be
+ * zero.
+ *
+ * The 64-bit value combined from seq_hi and seq_lo is the value of
+ * the output's vertical retrace counter when the content update
+ * was first scanned out to the display. This value must be
+ * compatible with the definition of MSC in GLX_OML_sync_control
+ * specification. Note, that if the display path has a non-zero
+ * latency, the time instant specified by this counter may differ
+ * from the timestamp's.
+ *
+ * If the output does not have a concept of vertical retrace or a
+ * refresh cycle, or the output device is self-refreshing without a
+ * way to query the refresh count, then the arguments seq_hi and
+ * seq_lo must be zero.
+ * @param tv_sec_hi high 32 bits of the seconds part of the presentation timestamp
+ * @param tv_sec_lo low 32 bits of the seconds part of the presentation timestamp
+ * @param tv_nsec nanoseconds part of the presentation timestamp
+ * @param refresh nanoseconds till next refresh
+ * @param seq_hi high 32 bits of refresh counter
+ * @param seq_lo low 32 bits of refresh counter
+ * @param flags combination of 'kind' values
+ */
+ void (*presented)(void *data,
+ struct wp_presentation_feedback *wp_presentation_feedback,
+ uint32_t tv_sec_hi,
+ uint32_t tv_sec_lo,
+ uint32_t tv_nsec,
+ uint32_t refresh,
+ uint32_t seq_hi,
+ uint32_t seq_lo,
+ uint32_t flags);
+ /**
+ * the content update was not displayed
+ *
+ * The content update was never displayed to the user.
+ */
+ void (*discarded)(void *data,
+ struct wp_presentation_feedback *wp_presentation_feedback);
+};
+
+/**
+ * @ingroup iface_wp_presentation_feedback
+ */
+static inline int
+wp_presentation_feedback_add_listener(struct wp_presentation_feedback *wp_presentation_feedback,
+ const struct wp_presentation_feedback_listener *listener, void *data)
+{
+ return wl_proxy_add_listener((struct wl_proxy *) wp_presentation_feedback,
+ (void (**)(void)) listener, data);
+}
+
+/**
+ * @ingroup iface_wp_presentation_feedback
+ */
+#define WP_PRESENTATION_FEEDBACK_SYNC_OUTPUT_SINCE_VERSION 1
+/**
+ * @ingroup iface_wp_presentation_feedback
+ */
+#define WP_PRESENTATION_FEEDBACK_PRESENTED_SINCE_VERSION 1
+/**
+ * @ingroup iface_wp_presentation_feedback
+ */
+#define WP_PRESENTATION_FEEDBACK_DISCARDED_SINCE_VERSION 1
+
+
+/** @ingroup iface_wp_presentation_feedback */
+static inline void
+wp_presentation_feedback_set_user_data(struct wp_presentation_feedback *wp_presentation_feedback, void *user_data)
+{
+ wl_proxy_set_user_data((struct wl_proxy *) wp_presentation_feedback, user_data);
+}
+
+/** @ingroup iface_wp_presentation_feedback */
+static inline void *
+wp_presentation_feedback_get_user_data(struct wp_presentation_feedback *wp_presentation_feedback)
+{
+ return wl_proxy_get_user_data((struct wl_proxy *) wp_presentation_feedback);
+}
+
+static inline uint32_t
+wp_presentation_feedback_get_version(struct wp_presentation_feedback *wp_presentation_feedback)
+{
+ return wl_proxy_get_version((struct wl_proxy *) wp_presentation_feedback);
+}
+
+/** @ingroup iface_wp_presentation_feedback */
+static inline void
+wp_presentation_feedback_destroy(struct wp_presentation_feedback *wp_presentation_feedback)
+{
+ wl_proxy_destroy((struct wl_proxy *) wp_presentation_feedback);
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/chromium/third_party/wayland-protocols/include/protocol/presentation-time-server-protocol.h b/chromium/third_party/wayland-protocols/include/protocol/presentation-time-server-protocol.h
new file mode 100644
index 00000000000..d2e24ddf07d
--- /dev/null
+++ b/chromium/third_party/wayland-protocols/include/protocol/presentation-time-server-protocol.h
@@ -0,0 +1,349 @@
+/* Generated by wayland-scanner 1.13.0 */
+
+#ifndef PRESENTATION_TIME_SERVER_PROTOCOL_H
+#define PRESENTATION_TIME_SERVER_PROTOCOL_H
+
+#include <stdint.h>
+#include <stddef.h>
+#include "wayland-server.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct wl_client;
+struct wl_resource;
+
+/**
+ * @page page_presentation_time The presentation_time protocol
+ * @section page_ifaces_presentation_time Interfaces
+ * - @subpage page_iface_wp_presentation - timed presentation related wl_surface requests
+ * - @subpage page_iface_wp_presentation_feedback - presentation time feedback event
+ * @section page_copyright_presentation_time Copyright
+ * <pre>
+ *
+ * Copyright © 2013-2014 Collabora, Ltd.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ * </pre>
+ */
+struct wl_output;
+struct wl_surface;
+struct wp_presentation;
+struct wp_presentation_feedback;
+
+/**
+ * @page page_iface_wp_presentation wp_presentation
+ * @section page_iface_wp_presentation_desc Description
+ *
+ *
+ *
+ *
+ * The main feature of this interface is accurate presentation
+ * timing feedback to ensure smooth video playback while maintaining
+ * audio/video synchronization. Some features use the concept of a
+ * presentation clock, which is defined in the
+ * presentation.clock_id event.
+ *
+ * A content update for a wl_surface is submitted by a
+ * wl_surface.commit request. Request 'feedback' associates with
+ * the wl_surface.commit and provides feedback on the content
+ * update, particularly the final realized presentation time.
+ *
+ *
+ *
+ * When the final realized presentation time is available, e.g.
+ * after a framebuffer flip completes, the requested
+ * presentation_feedback.presented events are sent. The final
+ * presentation time can differ from the compositor's predicted
+ * display update time and the update's target time, especially
+ * when the compositor misses its target vertical blanking period.
+ * @section page_iface_wp_presentation_api API
+ * See @ref iface_wp_presentation.
+ */
+/**
+ * @defgroup iface_wp_presentation The wp_presentation interface
+ *
+ *
+ *
+ *
+ * The main feature of this interface is accurate presentation
+ * timing feedback to ensure smooth video playback while maintaining
+ * audio/video synchronization. Some features use the concept of a
+ * presentation clock, which is defined in the
+ * presentation.clock_id event.
+ *
+ * A content update for a wl_surface is submitted by a
+ * wl_surface.commit request. Request 'feedback' associates with
+ * the wl_surface.commit and provides feedback on the content
+ * update, particularly the final realized presentation time.
+ *
+ *
+ *
+ * When the final realized presentation time is available, e.g.
+ * after a framebuffer flip completes, the requested
+ * presentation_feedback.presented events are sent. The final
+ * presentation time can differ from the compositor's predicted
+ * display update time and the update's target time, especially
+ * when the compositor misses its target vertical blanking period.
+ */
+extern const struct wl_interface wp_presentation_interface;
+/**
+ * @page page_iface_wp_presentation_feedback wp_presentation_feedback
+ * @section page_iface_wp_presentation_feedback_desc Description
+ *
+ * A presentation_feedback object returns an indication that a
+ * wl_surface content update has become visible to the user.
+ * One object corresponds to one content update submission
+ * (wl_surface.commit). There are two possible outcomes: the
+ * content update is presented to the user, and a presentation
+ * timestamp delivered; or, the user did not see the content
+ * update because it was superseded or its surface destroyed,
+ * and the content update is discarded.
+ *
+ * Once a presentation_feedback object has delivered a 'presented'
+ * or 'discarded' event it is automatically destroyed.
+ * @section page_iface_wp_presentation_feedback_api API
+ * See @ref iface_wp_presentation_feedback.
+ */
+/**
+ * @defgroup iface_wp_presentation_feedback The wp_presentation_feedback interface
+ *
+ * A presentation_feedback object returns an indication that a
+ * wl_surface content update has become visible to the user.
+ * One object corresponds to one content update submission
+ * (wl_surface.commit). There are two possible outcomes: the
+ * content update is presented to the user, and a presentation
+ * timestamp delivered; or, the user did not see the content
+ * update because it was superseded or its surface destroyed,
+ * and the content update is discarded.
+ *
+ * Once a presentation_feedback object has delivered a 'presented'
+ * or 'discarded' event it is automatically destroyed.
+ */
+extern const struct wl_interface wp_presentation_feedback_interface;
+
+#ifndef WP_PRESENTATION_ERROR_ENUM
+#define WP_PRESENTATION_ERROR_ENUM
+/**
+ * @ingroup iface_wp_presentation
+ * fatal presentation errors
+ *
+ * These fatal protocol errors may be emitted in response to
+ * illegal presentation requests.
+ */
+enum wp_presentation_error {
+ /**
+ * invalid value in tv_nsec
+ */
+ WP_PRESENTATION_ERROR_INVALID_TIMESTAMP = 0,
+ /**
+ * invalid flag
+ */
+ WP_PRESENTATION_ERROR_INVALID_FLAG = 1,
+};
+#endif /* WP_PRESENTATION_ERROR_ENUM */
+
+/**
+ * @ingroup iface_wp_presentation
+ * @struct wp_presentation_interface
+ */
+struct wp_presentation_interface {
+ /**
+ * unbind from the presentation interface
+ *
+ * Informs the server that the client will no longer be using
+ * this protocol object. Existing objects created by this object
+ * are not affected.
+ */
+ void (*destroy)(struct wl_client *client,
+ struct wl_resource *resource);
+ /**
+ * request presentation feedback information
+ *
+ * Request presentation feedback for the current content
+ * submission on the given surface. This creates a new
+ * presentation_feedback object, which will deliver the feedback
+ * information once. If multiple presentation_feedback objects are
+ * created for the same submission, they will all deliver the same
+ * information.
+ *
+ * For details on what information is returned, see the
+ * presentation_feedback interface.
+ * @param surface target surface
+ * @param callback new feedback object
+ */
+ void (*feedback)(struct wl_client *client,
+ struct wl_resource *resource,
+ struct wl_resource *surface,
+ uint32_t callback);
+};
+
+#define WP_PRESENTATION_CLOCK_ID 0
+
+/**
+ * @ingroup iface_wp_presentation
+ */
+#define WP_PRESENTATION_CLOCK_ID_SINCE_VERSION 1
+
+/**
+ * @ingroup iface_wp_presentation
+ */
+#define WP_PRESENTATION_DESTROY_SINCE_VERSION 1
+/**
+ * @ingroup iface_wp_presentation
+ */
+#define WP_PRESENTATION_FEEDBACK_SINCE_VERSION 1
+
+/**
+ * @ingroup iface_wp_presentation
+ * Sends an clock_id event to the client owning the resource.
+ * @param resource_ The client's resource
+ * @param clk_id platform clock identifier
+ */
+static inline void
+wp_presentation_send_clock_id(struct wl_resource *resource_, uint32_t clk_id)
+{
+ wl_resource_post_event(resource_, WP_PRESENTATION_CLOCK_ID, clk_id);
+}
+
+#ifndef WP_PRESENTATION_FEEDBACK_KIND_ENUM
+#define WP_PRESENTATION_FEEDBACK_KIND_ENUM
+/**
+ * @ingroup iface_wp_presentation_feedback
+ * bitmask of flags in presented event
+ *
+ * These flags provide information about how the presentation of
+ * the related content update was done. The intent is to help
+ * clients assess the reliability of the feedback and the visual
+ * quality with respect to possible tearing and timings. The
+ * flags are:
+ *
+ * VSYNC:
+ * The presentation was synchronized to the "vertical retrace" by
+ * the display hardware such that tearing does not happen.
+ * Relying on user space scheduling is not acceptable for this
+ * flag. If presentation is done by a copy to the active
+ * frontbuffer, then it must guarantee that tearing cannot
+ * happen.
+ *
+ * HW_CLOCK:
+ * The display hardware provided measurements that the hardware
+ * driver converted into a presentation timestamp. Sampling a
+ * clock in user space is not acceptable for this flag.
+ *
+ * HW_COMPLETION:
+ * The display hardware signalled that it started using the new
+ * image content. The opposite of this is e.g. a timer being used
+ * to guess when the display hardware has switched to the new
+ * image content.
+ *
+ * ZERO_COPY:
+ * The presentation of this update was done zero-copy. This means
+ * the buffer from the client was given to display hardware as
+ * is, without copying it. Compositing with OpenGL counts as
+ * copying, even if textured directly from the client buffer.
+ * Possible zero-copy cases include direct scanout of a
+ * fullscreen surface and a surface on a hardware overlay.
+ */
+enum wp_presentation_feedback_kind {
+ /**
+ * presentation was vsync'd
+ */
+ WP_PRESENTATION_FEEDBACK_KIND_VSYNC = 0x1,
+ /**
+ * hardware provided the presentation timestamp
+ */
+ WP_PRESENTATION_FEEDBACK_KIND_HW_CLOCK = 0x2,
+ /**
+ * hardware signalled the start of the presentation
+ */
+ WP_PRESENTATION_FEEDBACK_KIND_HW_COMPLETION = 0x4,
+ /**
+ * presentation was done zero-copy
+ */
+ WP_PRESENTATION_FEEDBACK_KIND_ZERO_COPY = 0x8,
+};
+#endif /* WP_PRESENTATION_FEEDBACK_KIND_ENUM */
+
+#define WP_PRESENTATION_FEEDBACK_SYNC_OUTPUT 0
+#define WP_PRESENTATION_FEEDBACK_PRESENTED 1
+#define WP_PRESENTATION_FEEDBACK_DISCARDED 2
+
+/**
+ * @ingroup iface_wp_presentation_feedback
+ */
+#define WP_PRESENTATION_FEEDBACK_SYNC_OUTPUT_SINCE_VERSION 1
+/**
+ * @ingroup iface_wp_presentation_feedback
+ */
+#define WP_PRESENTATION_FEEDBACK_PRESENTED_SINCE_VERSION 1
+/**
+ * @ingroup iface_wp_presentation_feedback
+ */
+#define WP_PRESENTATION_FEEDBACK_DISCARDED_SINCE_VERSION 1
+
+
+/**
+ * @ingroup iface_wp_presentation_feedback
+ * Sends an sync_output event to the client owning the resource.
+ * @param resource_ The client's resource
+ * @param output presentation output
+ */
+static inline void
+wp_presentation_feedback_send_sync_output(struct wl_resource *resource_, struct wl_resource *output)
+{
+ wl_resource_post_event(resource_, WP_PRESENTATION_FEEDBACK_SYNC_OUTPUT, output);
+}
+
+/**
+ * @ingroup iface_wp_presentation_feedback
+ * Sends an presented event to the client owning the resource.
+ * @param resource_ The client's resource
+ * @param tv_sec_hi high 32 bits of the seconds part of the presentation timestamp
+ * @param tv_sec_lo low 32 bits of the seconds part of the presentation timestamp
+ * @param tv_nsec nanoseconds part of the presentation timestamp
+ * @param refresh nanoseconds till next refresh
+ * @param seq_hi high 32 bits of refresh counter
+ * @param seq_lo low 32 bits of refresh counter
+ * @param flags combination of 'kind' values
+ */
+static inline void
+wp_presentation_feedback_send_presented(struct wl_resource *resource_, uint32_t tv_sec_hi, uint32_t tv_sec_lo, uint32_t tv_nsec, uint32_t refresh, uint32_t seq_hi, uint32_t seq_lo, uint32_t flags)
+{
+ wl_resource_post_event(resource_, WP_PRESENTATION_FEEDBACK_PRESENTED, tv_sec_hi, tv_sec_lo, tv_nsec, refresh, seq_hi, seq_lo, flags);
+}
+
+/**
+ * @ingroup iface_wp_presentation_feedback
+ * Sends an discarded event to the client owning the resource.
+ * @param resource_ The client's resource
+ */
+static inline void
+wp_presentation_feedback_send_discarded(struct wl_resource *resource_)
+{
+ wl_resource_post_event(resource_, WP_PRESENTATION_FEEDBACK_DISCARDED);
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/chromium/third_party/wayland-protocols/include/protocol/remote-shell-unstable-v1-client-protocol.h b/chromium/third_party/wayland-protocols/include/protocol/remote-shell-unstable-v1-client-protocol.h
new file mode 100644
index 00000000000..648fed5094c
--- /dev/null
+++ b/chromium/third_party/wayland-protocols/include/protocol/remote-shell-unstable-v1-client-protocol.h
@@ -0,0 +1,1543 @@
+/* Generated by wayland-scanner 1.14.0 */
+
+#ifndef REMOTE_SHELL_UNSTABLE_V1_CLIENT_PROTOCOL_H
+#define REMOTE_SHELL_UNSTABLE_V1_CLIENT_PROTOCOL_H
+
+#include <stdint.h>
+#include <stddef.h>
+#include "wayland-client.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @page page_remote_shell_unstable_v1 The remote_shell_unstable_v1 protocol
+ * Create remote desktop-style surfaces
+ *
+ * @section page_desc_remote_shell_unstable_v1 Description
+ *
+ * remote_shell allows clients to turn a wl_surface into a "real window"
+ * which can be stacked and activated by the user.
+ *
+ * Warning! The protocol described in this file is experimental and backward
+ * incompatible changes may be made. Backward compatible changes may be added
+ * together with the corresponding interface version bump. Backward
+ * incompatible changes are done by bumping the version number in the protocol
+ * and interface names and resetting the interface version. Once the protocol
+ * is to be declared stable, the 'z' prefix and the version number in the
+ * protocol and interface names are removed and the interface version number is
+ * reset.
+ *
+ * @section page_ifaces_remote_shell_unstable_v1 Interfaces
+ * - @subpage page_iface_zcr_remote_shell_v1 - remote_shell
+ * - @subpage page_iface_zcr_remote_surface_v1 - A desktop window
+ * - @subpage page_iface_zcr_notification_surface_v1 - A notification window
+ * @section page_copyright_remote_shell_unstable_v1 Copyright
+ * <pre>
+ *
+ * Copyright 2016 The Chromium Authors.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ * </pre>
+ */
+struct wl_surface;
+struct zcr_notification_surface_v1;
+struct zcr_remote_shell_v1;
+struct zcr_remote_surface_v1;
+
+/**
+ * @page page_iface_zcr_remote_shell_v1 zcr_remote_shell_v1
+ * @section page_iface_zcr_remote_shell_v1_desc Description
+ *
+ * The global interface that allows clients to turn a wl_surface into a
+ * "real window" which is remotely managed but can be stacked, activated
+ * and made fullscreen by the user.
+ * @section page_iface_zcr_remote_shell_v1_api API
+ * See @ref iface_zcr_remote_shell_v1.
+ */
+/**
+ * @defgroup iface_zcr_remote_shell_v1 The zcr_remote_shell_v1 interface
+ *
+ * The global interface that allows clients to turn a wl_surface into a
+ * "real window" which is remotely managed but can be stacked, activated
+ * and made fullscreen by the user.
+ */
+extern const struct wl_interface zcr_remote_shell_v1_interface;
+/**
+ * @page page_iface_zcr_remote_surface_v1 zcr_remote_surface_v1
+ * @section page_iface_zcr_remote_surface_v1_desc Description
+ *
+ * An interface that may be implemented by a wl_surface, for
+ * implementations that provide a desktop-style user interface
+ * and allows for remotely managed windows.
+ *
+ * It provides requests to treat surfaces like windows, allowing to set
+ * properties like app id and geometry.
+ *
+ * The client must call wl_surface.commit on the corresponding wl_surface
+ * for the remote_surface state to take effect.
+ *
+ * For a surface to be mapped by the compositor the client must have
+ * committed both an remote_surface state and a buffer.
+ * @section page_iface_zcr_remote_surface_v1_api API
+ * See @ref iface_zcr_remote_surface_v1.
+ */
+/**
+ * @defgroup iface_zcr_remote_surface_v1 The zcr_remote_surface_v1 interface
+ *
+ * An interface that may be implemented by a wl_surface, for
+ * implementations that provide a desktop-style user interface
+ * and allows for remotely managed windows.
+ *
+ * It provides requests to treat surfaces like windows, allowing to set
+ * properties like app id and geometry.
+ *
+ * The client must call wl_surface.commit on the corresponding wl_surface
+ * for the remote_surface state to take effect.
+ *
+ * For a surface to be mapped by the compositor the client must have
+ * committed both an remote_surface state and a buffer.
+ */
+extern const struct wl_interface zcr_remote_surface_v1_interface;
+/**
+ * @page page_iface_zcr_notification_surface_v1 zcr_notification_surface_v1
+ * @section page_iface_zcr_notification_surface_v1_desc Description
+ *
+ * An interface that may be implemented by a wl_surface to host
+ * notification contents.
+ * @section page_iface_zcr_notification_surface_v1_api API
+ * See @ref iface_zcr_notification_surface_v1.
+ */
+/**
+ * @defgroup iface_zcr_notification_surface_v1 The zcr_notification_surface_v1 interface
+ *
+ * An interface that may be implemented by a wl_surface to host
+ * notification contents.
+ */
+extern const struct wl_interface zcr_notification_surface_v1_interface;
+
+#ifndef ZCR_REMOTE_SHELL_V1_CONTAINER_ENUM
+#define ZCR_REMOTE_SHELL_V1_CONTAINER_ENUM
+/**
+ * @ingroup iface_zcr_remote_shell_v1
+ * containers for remote surfaces
+ *
+ * Determine how a remote surface should be stacked relative to other
+ * shell surfaces.
+ */
+enum zcr_remote_shell_v1_container {
+ /**
+ * default container
+ */
+ ZCR_REMOTE_SHELL_V1_CONTAINER_DEFAULT = 1,
+ /**
+ * system modal container
+ */
+ ZCR_REMOTE_SHELL_V1_CONTAINER_OVERLAY = 2,
+};
+#endif /* ZCR_REMOTE_SHELL_V1_CONTAINER_ENUM */
+
+#ifndef ZCR_REMOTE_SHELL_V1_STATE_TYPE_ENUM
+#define ZCR_REMOTE_SHELL_V1_STATE_TYPE_ENUM
+/**
+ * @ingroup iface_zcr_remote_shell_v1
+ * state types for remote surfaces
+ *
+ * Defines common show states for shell surfaces.
+ */
+enum zcr_remote_shell_v1_state_type {
+ /**
+ * normal window state
+ */
+ ZCR_REMOTE_SHELL_V1_STATE_TYPE_NORMAL = 1,
+ /**
+ * minimized window state
+ */
+ ZCR_REMOTE_SHELL_V1_STATE_TYPE_MINIMIZED = 2,
+ /**
+ * maximized window state
+ */
+ ZCR_REMOTE_SHELL_V1_STATE_TYPE_MAXIMIZED = 3,
+ /**
+ * fullscreen window state
+ */
+ ZCR_REMOTE_SHELL_V1_STATE_TYPE_FULLSCREEN = 4,
+ /**
+ * pinned window state
+ */
+ ZCR_REMOTE_SHELL_V1_STATE_TYPE_PINNED = 5,
+ /**
+ * trusted pinned window state
+ */
+ ZCR_REMOTE_SHELL_V1_STATE_TYPE_TRUSTED_PINNED = 6,
+ /**
+ * moving window state
+ */
+ ZCR_REMOTE_SHELL_V1_STATE_TYPE_MOVING = 7,
+ /**
+ * resizing window state
+ */
+ ZCR_REMOTE_SHELL_V1_STATE_TYPE_RESIZING = 8,
+};
+#endif /* ZCR_REMOTE_SHELL_V1_STATE_TYPE_ENUM */
+
+#ifndef ZCR_REMOTE_SHELL_V1_ERROR_ENUM
+#define ZCR_REMOTE_SHELL_V1_ERROR_ENUM
+enum zcr_remote_shell_v1_error {
+ /**
+ * given wl_surface has another role
+ */
+ ZCR_REMOTE_SHELL_V1_ERROR_ROLE = 0,
+ /**
+ * invalid notification key
+ */
+ ZCR_REMOTE_SHELL_V1_ERROR_INVALID_NOTIFICATION_KEY = 1,
+};
+#endif /* ZCR_REMOTE_SHELL_V1_ERROR_ENUM */
+
+#ifndef ZCR_REMOTE_SHELL_V1_LAYOUT_MODE_ENUM
+#define ZCR_REMOTE_SHELL_V1_LAYOUT_MODE_ENUM
+/**
+ * @ingroup iface_zcr_remote_shell_v1
+ * the layout mode
+ *
+ * Determine how a client should layout surfaces.
+ */
+enum zcr_remote_shell_v1_layout_mode {
+ /**
+ * multiple windows
+ */
+ ZCR_REMOTE_SHELL_V1_LAYOUT_MODE_WINDOWED = 1,
+ /**
+ * restricted mode for tablet
+ */
+ ZCR_REMOTE_SHELL_V1_LAYOUT_MODE_TABLET = 2,
+};
+#endif /* ZCR_REMOTE_SHELL_V1_LAYOUT_MODE_ENUM */
+
+/**
+ * @ingroup iface_zcr_remote_shell_v1
+ * @struct zcr_remote_shell_v1_listener
+ */
+struct zcr_remote_shell_v1_listener {
+ /**
+ * activated surface changed
+ *
+ * Notifies client that the activated surface changed.
+ */
+ void (*activated)(void *data,
+ struct zcr_remote_shell_v1 *zcr_remote_shell_v1,
+ struct wl_surface *gained_active,
+ struct wl_surface *lost_active);
+ /**
+ * suggests a re-configuration of remote shell
+ *
+ * [Deprecated] Suggests a re-configuration of remote shell.
+ */
+ void (*configuration_changed)(void *data,
+ struct zcr_remote_shell_v1 *zcr_remote_shell_v1,
+ int32_t width,
+ int32_t height,
+ int32_t transform,
+ wl_fixed_t scale_factor,
+ int32_t work_area_inset_left,
+ int32_t work_area_inset_top,
+ int32_t work_area_inset_right,
+ int32_t work_area_inset_bottom,
+ uint32_t layout_mode);
+ /**
+ * area of remote shell
+ *
+ * Defines an area of the remote shell used for layout. Each
+ * series of "workspace" events must be terminated by a "configure"
+ * event.
+ * @param is_internal 1 if screen is built-in
+ * @since 5
+ */
+ void (*workspace)(void *data,
+ struct zcr_remote_shell_v1 *zcr_remote_shell_v1,
+ uint32_t id_hi,
+ uint32_t id_lo,
+ int32_t x,
+ int32_t y,
+ int32_t width,
+ int32_t height,
+ int32_t inset_left,
+ int32_t inset_top,
+ int32_t inset_right,
+ int32_t inset_bottom,
+ int32_t transform,
+ wl_fixed_t scale_factor,
+ uint32_t is_internal);
+ /**
+ * suggests configuration of remote shell
+ *
+ * Suggests a new configuration of the remote shell. Preceded by
+ * a series of "workspace" events.
+ * @since 5
+ */
+ void (*configure)(void *data,
+ struct zcr_remote_shell_v1 *zcr_remote_shell_v1,
+ uint32_t layout_mode);
+ /**
+ * initialize scale configuration
+ *
+ * Sends the default device scale factor.
+ * @param scale DP to pixels ratio, in 8.24 fixed point format
+ * @since 8
+ */
+ void (*default_device_scale_factor)(void *data,
+ struct zcr_remote_shell_v1 *zcr_remote_shell_v1,
+ int32_t scale);
+};
+
+/**
+ * @ingroup iface_zcr_remote_shell_v1
+ */
+static inline int
+zcr_remote_shell_v1_add_listener(struct zcr_remote_shell_v1 *zcr_remote_shell_v1,
+ const struct zcr_remote_shell_v1_listener *listener, void *data)
+{
+ return wl_proxy_add_listener((struct wl_proxy *) zcr_remote_shell_v1,
+ (void (**)(void)) listener, data);
+}
+
+#define ZCR_REMOTE_SHELL_V1_DESTROY 0
+#define ZCR_REMOTE_SHELL_V1_GET_REMOTE_SURFACE 1
+#define ZCR_REMOTE_SHELL_V1_GET_NOTIFICATION_SURFACE 2
+
+/**
+ * @ingroup iface_zcr_remote_shell_v1
+ */
+#define ZCR_REMOTE_SHELL_V1_ACTIVATED_SINCE_VERSION 1
+/**
+ * @ingroup iface_zcr_remote_shell_v1
+ */
+#define ZCR_REMOTE_SHELL_V1_CONFIGURATION_CHANGED_SINCE_VERSION 1
+/**
+ * @ingroup iface_zcr_remote_shell_v1
+ */
+#define ZCR_REMOTE_SHELL_V1_WORKSPACE_SINCE_VERSION 5
+/**
+ * @ingroup iface_zcr_remote_shell_v1
+ */
+#define ZCR_REMOTE_SHELL_V1_CONFIGURE_SINCE_VERSION 5
+/**
+ * @ingroup iface_zcr_remote_shell_v1
+ */
+#define ZCR_REMOTE_SHELL_V1_DEFAULT_DEVICE_SCALE_FACTOR_SINCE_VERSION 8
+
+/**
+ * @ingroup iface_zcr_remote_shell_v1
+ */
+#define ZCR_REMOTE_SHELL_V1_DESTROY_SINCE_VERSION 1
+/**
+ * @ingroup iface_zcr_remote_shell_v1
+ */
+#define ZCR_REMOTE_SHELL_V1_GET_REMOTE_SURFACE_SINCE_VERSION 1
+/**
+ * @ingroup iface_zcr_remote_shell_v1
+ */
+#define ZCR_REMOTE_SHELL_V1_GET_NOTIFICATION_SURFACE_SINCE_VERSION 1
+
+/** @ingroup iface_zcr_remote_shell_v1 */
+static inline void
+zcr_remote_shell_v1_set_user_data(struct zcr_remote_shell_v1 *zcr_remote_shell_v1, void *user_data)
+{
+ wl_proxy_set_user_data((struct wl_proxy *) zcr_remote_shell_v1, user_data);
+}
+
+/** @ingroup iface_zcr_remote_shell_v1 */
+static inline void *
+zcr_remote_shell_v1_get_user_data(struct zcr_remote_shell_v1 *zcr_remote_shell_v1)
+{
+ return wl_proxy_get_user_data((struct wl_proxy *) zcr_remote_shell_v1);
+}
+
+static inline uint32_t
+zcr_remote_shell_v1_get_version(struct zcr_remote_shell_v1 *zcr_remote_shell_v1)
+{
+ return wl_proxy_get_version((struct wl_proxy *) zcr_remote_shell_v1);
+}
+
+/**
+ * @ingroup iface_zcr_remote_shell_v1
+ *
+ * Destroy this remote_shell object.
+ *
+ * Destroying a bound remote_shell object while there are surfaces
+ * still alive created by this remote_shell object instance is illegal
+ * and will result in a protocol error.
+ */
+static inline void
+zcr_remote_shell_v1_destroy(struct zcr_remote_shell_v1 *zcr_remote_shell_v1)
+{
+ wl_proxy_marshal((struct wl_proxy *) zcr_remote_shell_v1,
+ ZCR_REMOTE_SHELL_V1_DESTROY);
+
+ wl_proxy_destroy((struct wl_proxy *) zcr_remote_shell_v1);
+}
+
+/**
+ * @ingroup iface_zcr_remote_shell_v1
+ *
+ * This creates an remote_surface for the given surface and gives it the
+ * remote_surface role. A wl_surface can only be given a remote_surface
+ * role once. If get_remote_surface is called with a wl_surface that
+ * already has an active remote_surface associated with it, or if it had
+ * any other role, an error is raised.
+ *
+ * See the documentation of remote_surface for more details about what an
+ * remote_surface is and how it is used.
+ */
+static inline struct zcr_remote_surface_v1 *
+zcr_remote_shell_v1_get_remote_surface(struct zcr_remote_shell_v1 *zcr_remote_shell_v1, struct wl_surface *surface, uint32_t container)
+{
+ struct wl_proxy *id;
+
+ id = wl_proxy_marshal_constructor((struct wl_proxy *) zcr_remote_shell_v1,
+ ZCR_REMOTE_SHELL_V1_GET_REMOTE_SURFACE, &zcr_remote_surface_v1_interface, NULL, surface, container);
+
+ return (struct zcr_remote_surface_v1 *) id;
+}
+
+/**
+ * @ingroup iface_zcr_remote_shell_v1
+ *
+ * Creates a notification_surface for the given surface, gives it the
+ * notification_surface role and associated it with a notification id.
+ */
+static inline struct zcr_notification_surface_v1 *
+zcr_remote_shell_v1_get_notification_surface(struct zcr_remote_shell_v1 *zcr_remote_shell_v1, struct wl_surface *surface, const char *notification_key)
+{
+ struct wl_proxy *id;
+
+ id = wl_proxy_marshal_constructor((struct wl_proxy *) zcr_remote_shell_v1,
+ ZCR_REMOTE_SHELL_V1_GET_NOTIFICATION_SURFACE, &zcr_notification_surface_v1_interface, NULL, surface, notification_key);
+
+ return (struct zcr_notification_surface_v1 *) id;
+}
+
+#ifndef ZCR_REMOTE_SURFACE_V1_SYSTEMUI_VISIBILITY_STATE_ENUM
+#define ZCR_REMOTE_SURFACE_V1_SYSTEMUI_VISIBILITY_STATE_ENUM
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ * systemui visibility behavior
+ *
+ * Determine the visibility behavior of the system UI.
+ */
+enum zcr_remote_surface_v1_systemui_visibility_state {
+ /**
+ * system ui is visible
+ */
+ ZCR_REMOTE_SURFACE_V1_SYSTEMUI_VISIBILITY_STATE_VISIBLE = 1,
+ /**
+ * system ui autohides and is not sticky
+ */
+ ZCR_REMOTE_SURFACE_V1_SYSTEMUI_VISIBILITY_STATE_AUTOHIDE_NON_STICKY = 2,
+ /**
+ * system ui autohides and is sticky
+ */
+ ZCR_REMOTE_SURFACE_V1_SYSTEMUI_VISIBILITY_STATE_AUTOHIDE_STICKY = 3,
+};
+#endif /* ZCR_REMOTE_SURFACE_V1_SYSTEMUI_VISIBILITY_STATE_ENUM */
+
+#ifndef ZCR_REMOTE_SURFACE_V1_ORIENTATION_ENUM
+#define ZCR_REMOTE_SURFACE_V1_ORIENTATION_ENUM
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ * window orientation
+ *
+ * The orientation of the window.
+ */
+enum zcr_remote_surface_v1_orientation {
+ /**
+ * portrait
+ */
+ ZCR_REMOTE_SURFACE_V1_ORIENTATION_PORTRAIT = 1,
+ /**
+ * landscape
+ */
+ ZCR_REMOTE_SURFACE_V1_ORIENTATION_LANDSCAPE = 2,
+};
+#endif /* ZCR_REMOTE_SURFACE_V1_ORIENTATION_ENUM */
+
+#ifndef ZCR_REMOTE_SURFACE_V1_WINDOW_TYPE_ENUM
+#define ZCR_REMOTE_SURFACE_V1_WINDOW_TYPE_ENUM
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ * window type
+ *
+ * The type of the window.
+ */
+enum zcr_remote_surface_v1_window_type {
+ /**
+ * normal app window
+ */
+ ZCR_REMOTE_SURFACE_V1_WINDOW_TYPE_NORMAL = 1,
+ /**
+ * window is treated as systemui
+ */
+ ZCR_REMOTE_SURFACE_V1_WINDOW_TYPE_SYSTEM_UI = 2,
+};
+#endif /* ZCR_REMOTE_SURFACE_V1_WINDOW_TYPE_ENUM */
+
+#ifndef ZCR_REMOTE_SURFACE_V1_BOUNDS_CHANGE_REASON_ENUM
+#define ZCR_REMOTE_SURFACE_V1_BOUNDS_CHANGE_REASON_ENUM
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ * bounds_change_reason
+ *
+ * Specifies the cause of the window bounds change event.
+ */
+enum zcr_remote_surface_v1_bounds_change_reason {
+ /**
+ * the window is being moved by drag operation
+ */
+ ZCR_REMOTE_SURFACE_V1_BOUNDS_CHANGE_REASON_DRAG_MOVE = 1,
+ /**
+ * the window is being resized by drag operation.
+ */
+ ZCR_REMOTE_SURFACE_V1_BOUNDS_CHANGE_REASON_DRAG_RESIZE = 2,
+ /**
+ * the window is resized to left snapped state
+ */
+ ZCR_REMOTE_SURFACE_V1_BOUNDS_CHANGE_REASON_SNAP_TO_LEFT = 3,
+ /**
+ * the window is resized to right snapped state
+ */
+ ZCR_REMOTE_SURFACE_V1_BOUNDS_CHANGE_REASON_SNAP_TO_RIGHT = 4,
+ /**
+ * the window bounds is moved due to other WM operations
+ */
+ ZCR_REMOTE_SURFACE_V1_BOUNDS_CHANGE_REASON_MOVE = 5,
+ /**
+ * the window bounds is reiszed due to other WM operations
+ */
+ ZCR_REMOTE_SURFACE_V1_BOUNDS_CHANGE_REASON_RESIZE = 6,
+};
+#endif /* ZCR_REMOTE_SURFACE_V1_BOUNDS_CHANGE_REASON_ENUM */
+
+#ifndef ZCR_REMOTE_SURFACE_V1_RESIZE_DIRECTION_ENUM
+#define ZCR_REMOTE_SURFACE_V1_RESIZE_DIRECTION_ENUM
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ * resize direction
+ *
+ * The resize direction for drag operation
+ */
+enum zcr_remote_surface_v1_resize_direction {
+ /**
+ * move only, no resize
+ */
+ ZCR_REMOTE_SURFACE_V1_RESIZE_DIRECTION_NONE = 0,
+ /**
+ * resize to the left
+ */
+ ZCR_REMOTE_SURFACE_V1_RESIZE_DIRECTION_LEFT = 1,
+ /**
+ * resize to the top left
+ */
+ ZCR_REMOTE_SURFACE_V1_RESIZE_DIRECTION_TOPLEFT = 2,
+ /**
+ * resize to the top
+ */
+ ZCR_REMOTE_SURFACE_V1_RESIZE_DIRECTION_TOP = 3,
+ /**
+ * resize to the top right
+ */
+ ZCR_REMOTE_SURFACE_V1_RESIZE_DIRECTION_TOPRIGHT = 4,
+ /**
+ * resize to the right
+ */
+ ZCR_REMOTE_SURFACE_V1_RESIZE_DIRECTION_RIGHT = 5,
+ /**
+ * resize to the buttom right
+ */
+ ZCR_REMOTE_SURFACE_V1_RESIZE_DIRECTION_BOTTOMRIGHT = 6,
+ /**
+ * resize to the bottom
+ */
+ ZCR_REMOTE_SURFACE_V1_RESIZE_DIRECTION_BOTTOM = 7,
+ /**
+ * resize to the bottom left
+ */
+ ZCR_REMOTE_SURFACE_V1_RESIZE_DIRECTION_BOTTOMLEFT = 8,
+};
+#endif /* ZCR_REMOTE_SURFACE_V1_RESIZE_DIRECTION_ENUM */
+
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ * @struct zcr_remote_surface_v1_listener
+ */
+struct zcr_remote_surface_v1_listener {
+ /**
+ * surface wants to be closed
+ *
+ * The close event is sent by the compositor when the user wants
+ * the surface to be closed. This should be equivalent to the user
+ * clicking the close button in client-side decorations, if your
+ * application has any...
+ *
+ * This is only a request that the user intends to close your
+ * window. The client may choose to ignore this request, or show a
+ * dialog to ask the user to save their data...
+ */
+ void (*close)(void *data,
+ struct zcr_remote_surface_v1 *zcr_remote_surface_v1);
+ /**
+ * surface state type changed
+ *
+ * [Deprecated] The state_type_changed event is sent by the
+ * compositor when the surface state changed.
+ *
+ * This is an event to notify that the window state changed in
+ * compositor. The state change may be triggered by a client's
+ * request, or some user action directly handled by the compositor.
+ * The client may choose to ignore this event.
+ */
+ void (*state_type_changed)(void *data,
+ struct zcr_remote_surface_v1 *zcr_remote_surface_v1,
+ uint32_t state_type);
+ /**
+ * suggest a surface change
+ *
+ * The configure event asks the client to change surface state.
+ *
+ * The client must apply the origin offset to window positions in
+ * set_window_geometry requests.
+ *
+ * The states listed in the event are state_type values, and might
+ * change due to a client request or an event directly handled by
+ * the compositor.
+ *
+ * Clients should arrange their surface for the new state, and then
+ * send an ack_configure request with the serial sent in this
+ * configure event at some point before committing the new surface.
+ *
+ * If the client receives multiple configure events before it can
+ * respond to one, it is free to discard all but the last event it
+ * received.
+ * @since 5
+ */
+ void (*configure)(void *data,
+ struct zcr_remote_surface_v1 *zcr_remote_surface_v1,
+ int32_t origin_offset_x,
+ int32_t origin_offset_y,
+ struct wl_array *states,
+ uint32_t serial);
+ /**
+ * announce window geometry commit
+ *
+ * Notify the client of committed window geometry.
+ *
+ * The compositor sends this event when it commits window geometry.
+ * The client may use this information to convert coordinates of
+ * input events using the latest committed geometry.
+ * @since 9
+ */
+ void (*window_geometry_changed)(void *data,
+ struct zcr_remote_surface_v1 *zcr_remote_surface_v1,
+ int32_t x,
+ int32_t y,
+ int32_t width,
+ int32_t height);
+ /**
+ * The compositor requested to change the bounds
+ *
+ * The compositor requested to change its bounds.
+ * "bounds_chnage_reason" specifies the cause of the bounds change.
+ * The client may apply the different move/resize strategy
+ * depending on the reason.
+ *
+ * "display_id_hi", "display_id_lo" specifies in which workspace
+ * the surface should live in.
+ *
+ * The client responds with set_window_geometry request, with the
+ * bounds it is resized to (this may be different from the bounds
+ * requested).
+ *
+ * The client may ignore move request depending on the state, e.g,
+ * if it becomes resizable or other constrants.
+ * @since 10
+ */
+ void (*bounds_changed)(void *data,
+ struct zcr_remote_surface_v1 *zcr_remote_surface_v1,
+ uint32_t workspace_id_hi,
+ uint32_t workspace_id_lo,
+ int32_t x,
+ int32_t y,
+ int32_t width,
+ int32_t height,
+ uint32_t bounds_change_reason);
+ /**
+ * Notifies that a drag to move/resize started.
+ *
+ * Notifies a client that the compositor started drag operation.
+ * "direction" specifies which direction it is being resized.
+ * "none" direction means just move but not resize.
+ *
+ * This will be followed by series of the "bounds_changed" event
+ * with "drag_resize" or "drag_move" reasons to update the window
+ * bounds druing the drag operation.
+ * @since 10
+ */
+ void (*drag_started)(void *data,
+ struct zcr_remote_surface_v1 *zcr_remote_surface_v1,
+ uint32_t direction);
+ /**
+ * Notifies that a drag operation has finished.
+ *
+ * Called when the drag operation is finished. "x" and "y"
+ * specifies the position of the pointer device used to drag.
+ * "canceled" is true if the drag operation is aborted during drag
+ * (e.g. by capture change or user action.)
+ * @param canceled true if the operation was canceled
+ * @since 10
+ */
+ void (*drag_finished)(void *data,
+ struct zcr_remote_surface_v1 *zcr_remote_surface_v1,
+ int32_t x,
+ int32_t y,
+ int32_t canceled);
+};
+
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ */
+static inline int
+zcr_remote_surface_v1_add_listener(struct zcr_remote_surface_v1 *zcr_remote_surface_v1,
+ const struct zcr_remote_surface_v1_listener *listener, void *data)
+{
+ return wl_proxy_add_listener((struct wl_proxy *) zcr_remote_surface_v1,
+ (void (**)(void)) listener, data);
+}
+
+#define ZCR_REMOTE_SURFACE_V1_DESTROY 0
+#define ZCR_REMOTE_SURFACE_V1_SET_APP_ID 1
+#define ZCR_REMOTE_SURFACE_V1_SET_WINDOW_GEOMETRY 2
+#define ZCR_REMOTE_SURFACE_V1_SET_SCALE 3
+#define ZCR_REMOTE_SURFACE_V1_SET_RECTANGULAR_SHADOW 4
+#define ZCR_REMOTE_SURFACE_V1_SET_RECTANGULAR_SHADOW_BACKGROUND_OPACITY 5
+#define ZCR_REMOTE_SURFACE_V1_SET_TITLE 6
+#define ZCR_REMOTE_SURFACE_V1_SET_TOP_INSET 7
+#define ZCR_REMOTE_SURFACE_V1_ACTIVATE 8
+#define ZCR_REMOTE_SURFACE_V1_MAXIMIZE 9
+#define ZCR_REMOTE_SURFACE_V1_MINIMIZE 10
+#define ZCR_REMOTE_SURFACE_V1_RESTORE 11
+#define ZCR_REMOTE_SURFACE_V1_FULLSCREEN 12
+#define ZCR_REMOTE_SURFACE_V1_UNFULLSCREEN 13
+#define ZCR_REMOTE_SURFACE_V1_PIN 14
+#define ZCR_REMOTE_SURFACE_V1_UNPIN 15
+#define ZCR_REMOTE_SURFACE_V1_SET_SYSTEM_MODAL 16
+#define ZCR_REMOTE_SURFACE_V1_UNSET_SYSTEM_MODAL 17
+#define ZCR_REMOTE_SURFACE_V1_SET_RECTANGULAR_SURFACE_SHADOW 18
+#define ZCR_REMOTE_SURFACE_V1_SET_SYSTEMUI_VISIBILITY 19
+#define ZCR_REMOTE_SURFACE_V1_SET_ALWAYS_ON_TOP 20
+#define ZCR_REMOTE_SURFACE_V1_UNSET_ALWAYS_ON_TOP 21
+#define ZCR_REMOTE_SURFACE_V1_ACK_CONFIGURE 22
+#define ZCR_REMOTE_SURFACE_V1_MOVE 23
+#define ZCR_REMOTE_SURFACE_V1_SET_ORIENTATION 24
+#define ZCR_REMOTE_SURFACE_V1_SET_WINDOW_TYPE 25
+#define ZCR_REMOTE_SURFACE_V1_RESIZE 26
+#define ZCR_REMOTE_SURFACE_V1_SET_RESIZE_OUTSET 27
+#define ZCR_REMOTE_SURFACE_V1_START_MOVE 28
+#define ZCR_REMOTE_SURFACE_V1_SET_CAN_MAXIMIZE 29
+#define ZCR_REMOTE_SURFACE_V1_UNSET_CAN_MAXIMIZE 30
+#define ZCR_REMOTE_SURFACE_V1_SET_MIN_SIZE 31
+#define ZCR_REMOTE_SURFACE_V1_SET_MAX_SIZE 32
+
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ */
+#define ZCR_REMOTE_SURFACE_V1_CLOSE_SINCE_VERSION 1
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ */
+#define ZCR_REMOTE_SURFACE_V1_STATE_TYPE_CHANGED_SINCE_VERSION 1
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ */
+#define ZCR_REMOTE_SURFACE_V1_CONFIGURE_SINCE_VERSION 5
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ */
+#define ZCR_REMOTE_SURFACE_V1_WINDOW_GEOMETRY_CHANGED_SINCE_VERSION 9
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ */
+#define ZCR_REMOTE_SURFACE_V1_BOUNDS_CHANGED_SINCE_VERSION 10
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ */
+#define ZCR_REMOTE_SURFACE_V1_DRAG_STARTED_SINCE_VERSION 10
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ */
+#define ZCR_REMOTE_SURFACE_V1_DRAG_FINISHED_SINCE_VERSION 10
+
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ */
+#define ZCR_REMOTE_SURFACE_V1_DESTROY_SINCE_VERSION 1
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ */
+#define ZCR_REMOTE_SURFACE_V1_SET_APP_ID_SINCE_VERSION 1
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ */
+#define ZCR_REMOTE_SURFACE_V1_SET_WINDOW_GEOMETRY_SINCE_VERSION 1
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ */
+#define ZCR_REMOTE_SURFACE_V1_SET_SCALE_SINCE_VERSION 1
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ */
+#define ZCR_REMOTE_SURFACE_V1_SET_RECTANGULAR_SHADOW_SINCE_VERSION 1
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ */
+#define ZCR_REMOTE_SURFACE_V1_SET_RECTANGULAR_SHADOW_BACKGROUND_OPACITY_SINCE_VERSION 1
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ */
+#define ZCR_REMOTE_SURFACE_V1_SET_TITLE_SINCE_VERSION 1
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ */
+#define ZCR_REMOTE_SURFACE_V1_SET_TOP_INSET_SINCE_VERSION 1
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ */
+#define ZCR_REMOTE_SURFACE_V1_ACTIVATE_SINCE_VERSION 1
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ */
+#define ZCR_REMOTE_SURFACE_V1_MAXIMIZE_SINCE_VERSION 1
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ */
+#define ZCR_REMOTE_SURFACE_V1_MINIMIZE_SINCE_VERSION 1
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ */
+#define ZCR_REMOTE_SURFACE_V1_RESTORE_SINCE_VERSION 1
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ */
+#define ZCR_REMOTE_SURFACE_V1_FULLSCREEN_SINCE_VERSION 1
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ */
+#define ZCR_REMOTE_SURFACE_V1_UNFULLSCREEN_SINCE_VERSION 1
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ */
+#define ZCR_REMOTE_SURFACE_V1_PIN_SINCE_VERSION 1
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ */
+#define ZCR_REMOTE_SURFACE_V1_UNPIN_SINCE_VERSION 1
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ */
+#define ZCR_REMOTE_SURFACE_V1_SET_SYSTEM_MODAL_SINCE_VERSION 1
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ */
+#define ZCR_REMOTE_SURFACE_V1_UNSET_SYSTEM_MODAL_SINCE_VERSION 1
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ */
+#define ZCR_REMOTE_SURFACE_V1_SET_RECTANGULAR_SURFACE_SHADOW_SINCE_VERSION 2
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ */
+#define ZCR_REMOTE_SURFACE_V1_SET_SYSTEMUI_VISIBILITY_SINCE_VERSION 3
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ */
+#define ZCR_REMOTE_SURFACE_V1_SET_ALWAYS_ON_TOP_SINCE_VERSION 4
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ */
+#define ZCR_REMOTE_SURFACE_V1_UNSET_ALWAYS_ON_TOP_SINCE_VERSION 4
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ */
+#define ZCR_REMOTE_SURFACE_V1_ACK_CONFIGURE_SINCE_VERSION 5
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ */
+#define ZCR_REMOTE_SURFACE_V1_MOVE_SINCE_VERSION 5
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ */
+#define ZCR_REMOTE_SURFACE_V1_SET_ORIENTATION_SINCE_VERSION 6
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ */
+#define ZCR_REMOTE_SURFACE_V1_SET_WINDOW_TYPE_SINCE_VERSION 7
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ */
+#define ZCR_REMOTE_SURFACE_V1_RESIZE_SINCE_VERSION 9
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ */
+#define ZCR_REMOTE_SURFACE_V1_SET_RESIZE_OUTSET_SINCE_VERSION 9
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ */
+#define ZCR_REMOTE_SURFACE_V1_START_MOVE_SINCE_VERSION 10
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ */
+#define ZCR_REMOTE_SURFACE_V1_SET_CAN_MAXIMIZE_SINCE_VERSION 10
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ */
+#define ZCR_REMOTE_SURFACE_V1_UNSET_CAN_MAXIMIZE_SINCE_VERSION 10
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ */
+#define ZCR_REMOTE_SURFACE_V1_SET_MIN_SIZE_SINCE_VERSION 10
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ */
+#define ZCR_REMOTE_SURFACE_V1_SET_MAX_SIZE_SINCE_VERSION 10
+
+/** @ingroup iface_zcr_remote_surface_v1 */
+static inline void
+zcr_remote_surface_v1_set_user_data(struct zcr_remote_surface_v1 *zcr_remote_surface_v1, void *user_data)
+{
+ wl_proxy_set_user_data((struct wl_proxy *) zcr_remote_surface_v1, user_data);
+}
+
+/** @ingroup iface_zcr_remote_surface_v1 */
+static inline void *
+zcr_remote_surface_v1_get_user_data(struct zcr_remote_surface_v1 *zcr_remote_surface_v1)
+{
+ return wl_proxy_get_user_data((struct wl_proxy *) zcr_remote_surface_v1);
+}
+
+static inline uint32_t
+zcr_remote_surface_v1_get_version(struct zcr_remote_surface_v1 *zcr_remote_surface_v1)
+{
+ return wl_proxy_get_version((struct wl_proxy *) zcr_remote_surface_v1);
+}
+
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ *
+ * Unmap and destroy the window. The window will be effectively
+ * hidden from the user's point of view, and all state will be lost.
+ */
+static inline void
+zcr_remote_surface_v1_destroy(struct zcr_remote_surface_v1 *zcr_remote_surface_v1)
+{
+ wl_proxy_marshal((struct wl_proxy *) zcr_remote_surface_v1,
+ ZCR_REMOTE_SURFACE_V1_DESTROY);
+
+ wl_proxy_destroy((struct wl_proxy *) zcr_remote_surface_v1);
+}
+
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ *
+ * Set an application identifier for the surface.
+ */
+static inline void
+zcr_remote_surface_v1_set_app_id(struct zcr_remote_surface_v1 *zcr_remote_surface_v1, const char *app_id)
+{
+ wl_proxy_marshal((struct wl_proxy *) zcr_remote_surface_v1,
+ ZCR_REMOTE_SURFACE_V1_SET_APP_ID, app_id);
+}
+
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ *
+ * The window geometry of a window is its "visible bounds" from the
+ * user's perspective. Client-side decorations often have invisible
+ * portions like drop-shadows which should be ignored for the
+ * purposes of aligning, placing and constraining windows.
+ *
+ * The window geometry is double buffered, and will be applied at the
+ * time wl_surface.commit of the corresponding wl_surface is called.
+ *
+ * Once the window geometry of the surface is set once, it is not
+ * possible to unset it, and it will remain the same until
+ * set_window_geometry is called again, even if a new subsurface or
+ * buffer is attached.
+ *
+ * If never set, the value is the full bounds of the output. This
+ * updates dynamically on every commit.
+ *
+ * The arguments are given in the output coordinate space.
+ *
+ * The width and height must be greater than zero.
+ */
+static inline void
+zcr_remote_surface_v1_set_window_geometry(struct zcr_remote_surface_v1 *zcr_remote_surface_v1, int32_t x, int32_t y, int32_t width, int32_t height)
+{
+ wl_proxy_marshal((struct wl_proxy *) zcr_remote_surface_v1,
+ ZCR_REMOTE_SURFACE_V1_SET_WINDOW_GEOMETRY, x, y, width, height);
+}
+
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ *
+ * Set a scale factor that will be applied to surface and all descendants.
+ */
+static inline void
+zcr_remote_surface_v1_set_scale(struct zcr_remote_surface_v1 *zcr_remote_surface_v1, wl_fixed_t scale)
+{
+ wl_proxy_marshal((struct wl_proxy *) zcr_remote_surface_v1,
+ ZCR_REMOTE_SURFACE_V1_SET_SCALE, scale);
+}
+
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ *
+ * [Deprecated] Request that surface needs a rectangular shadow.
+ *
+ * This is only a request that the surface should have a rectangular
+ * shadow. The compositor may choose to ignore this request.
+ *
+ * The arguments are given in the output coordinate space and specifies
+ * the inner bounds of the shadow.
+ *
+ * The arguments are given in the output coordinate space.
+ * Specifying zero width and height will disable the shadow.
+ */
+static inline void
+zcr_remote_surface_v1_set_rectangular_shadow(struct zcr_remote_surface_v1 *zcr_remote_surface_v1, int32_t x, int32_t y, int32_t width, int32_t height)
+{
+ wl_proxy_marshal((struct wl_proxy *) zcr_remote_surface_v1,
+ ZCR_REMOTE_SURFACE_V1_SET_RECTANGULAR_SHADOW, x, y, width, height);
+}
+
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ *
+ * [Deprecated] Suggests the window's background opacity when the shadow is requested.
+ */
+static inline void
+zcr_remote_surface_v1_set_rectangular_shadow_background_opacity(struct zcr_remote_surface_v1 *zcr_remote_surface_v1, wl_fixed_t opacity)
+{
+ wl_proxy_marshal((struct wl_proxy *) zcr_remote_surface_v1,
+ ZCR_REMOTE_SURFACE_V1_SET_RECTANGULAR_SHADOW_BACKGROUND_OPACITY, opacity);
+}
+
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ *
+ * Set a short title for the surface.
+ *
+ * This string may be used to identify the surface in a task bar,
+ * window list, or other user interface elements provided by the
+ * compositor.
+ *
+ * The string must be encoded in UTF-8.
+ */
+static inline void
+zcr_remote_surface_v1_set_title(struct zcr_remote_surface_v1 *zcr_remote_surface_v1, const char *title)
+{
+ wl_proxy_marshal((struct wl_proxy *) zcr_remote_surface_v1,
+ ZCR_REMOTE_SURFACE_V1_SET_TITLE, title);
+}
+
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ *
+ * Set distance from the top of the surface to the contents.
+ *
+ * This distance typically represents the size of the window caption.
+ */
+static inline void
+zcr_remote_surface_v1_set_top_inset(struct zcr_remote_surface_v1 *zcr_remote_surface_v1, int32_t height)
+{
+ wl_proxy_marshal((struct wl_proxy *) zcr_remote_surface_v1,
+ ZCR_REMOTE_SURFACE_V1_SET_TOP_INSET, height);
+}
+
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ *
+ * Make the surface active and bring it to the front.
+ */
+static inline void
+zcr_remote_surface_v1_activate(struct zcr_remote_surface_v1 *zcr_remote_surface_v1, uint32_t serial)
+{
+ wl_proxy_marshal((struct wl_proxy *) zcr_remote_surface_v1,
+ ZCR_REMOTE_SURFACE_V1_ACTIVATE, serial);
+}
+
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ *
+ * Request that surface is maximized. The window geometry will be updated
+ * to whatever the compositor finds appropriate for a maximized window.
+ *
+ * This is only a request that the window should be maximized. The
+ * compositor may choose to ignore this request. The client should
+ * listen to set_maximized events to determine if the window was
+ * maximized or not.
+ */
+static inline void
+zcr_remote_surface_v1_maximize(struct zcr_remote_surface_v1 *zcr_remote_surface_v1)
+{
+ wl_proxy_marshal((struct wl_proxy *) zcr_remote_surface_v1,
+ ZCR_REMOTE_SURFACE_V1_MAXIMIZE);
+}
+
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ *
+ * Request that surface is minimized.
+ *
+ * This is only a request that the window should be minimized. The
+ * compositor may choose to ignore this request. The client should
+ * listen to set_minimized events to determine if the window was
+ * minimized or not.
+ */
+static inline void
+zcr_remote_surface_v1_minimize(struct zcr_remote_surface_v1 *zcr_remote_surface_v1)
+{
+ wl_proxy_marshal((struct wl_proxy *) zcr_remote_surface_v1,
+ ZCR_REMOTE_SURFACE_V1_MINIMIZE);
+}
+
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ *
+ * Request that surface is restored. This restores the window geometry
+ * to what it was before the window was minimized, maximized or made
+ * fullscreen.
+ *
+ * This is only a request that the window should be restored. The
+ * compositor may choose to ignore this request. The client should
+ * listen to unset_maximized, unset_minimize and unset_fullscreen
+ * events to determine if the window was restored or not.
+ */
+static inline void
+zcr_remote_surface_v1_restore(struct zcr_remote_surface_v1 *zcr_remote_surface_v1)
+{
+ wl_proxy_marshal((struct wl_proxy *) zcr_remote_surface_v1,
+ ZCR_REMOTE_SURFACE_V1_RESTORE);
+}
+
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ *
+ * Request that surface is made fullscreen.
+ *
+ * This is only a request that the window should be made fullscreen.
+ * The compositor may choose to ignore this request. The client should
+ * listen to set_fullscreen events to determine if the window was
+ * made fullscreen or not.
+ */
+static inline void
+zcr_remote_surface_v1_fullscreen(struct zcr_remote_surface_v1 *zcr_remote_surface_v1)
+{
+ wl_proxy_marshal((struct wl_proxy *) zcr_remote_surface_v1,
+ ZCR_REMOTE_SURFACE_V1_FULLSCREEN);
+}
+
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ *
+ * Request that surface is made unfullscreen.
+ *
+ * This is only a request that the window should be made unfullscreen.
+ * The compositor may choose to ignore this request. The client should
+ * listen to unset_fullscreen events to determine if the window was
+ * made unfullscreen or not.
+ */
+static inline void
+zcr_remote_surface_v1_unfullscreen(struct zcr_remote_surface_v1 *zcr_remote_surface_v1)
+{
+ wl_proxy_marshal((struct wl_proxy *) zcr_remote_surface_v1,
+ ZCR_REMOTE_SURFACE_V1_UNFULLSCREEN);
+}
+
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ *
+ * Request that surface is pinned.
+ *
+ * This is only a request that the window should be pinned.
+ * The compositor may choose to ignore this request. The client should
+ * listen to state_changed events to determine if the window was
+ * pinned or not. If trusted flag is non-zero, the app can prevent users
+ * from exiting the pinned mode.
+ */
+static inline void
+zcr_remote_surface_v1_pin(struct zcr_remote_surface_v1 *zcr_remote_surface_v1, int32_t trusted)
+{
+ wl_proxy_marshal((struct wl_proxy *) zcr_remote_surface_v1,
+ ZCR_REMOTE_SURFACE_V1_PIN, trusted);
+}
+
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ *
+ * Request that surface is unpinned.
+ *
+ * This is only a request that the window should be unpinned.
+ * The compositor may choose to ignore this request. The client should
+ * listen to unset_pinned events to determine if the window was
+ * unpinned or not.
+ */
+static inline void
+zcr_remote_surface_v1_unpin(struct zcr_remote_surface_v1 *zcr_remote_surface_v1)
+{
+ wl_proxy_marshal((struct wl_proxy *) zcr_remote_surface_v1,
+ ZCR_REMOTE_SURFACE_V1_UNPIN);
+}
+
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ *
+ * Suggests a surface should become system modal.
+ */
+static inline void
+zcr_remote_surface_v1_set_system_modal(struct zcr_remote_surface_v1 *zcr_remote_surface_v1)
+{
+ wl_proxy_marshal((struct wl_proxy *) zcr_remote_surface_v1,
+ ZCR_REMOTE_SURFACE_V1_SET_SYSTEM_MODAL);
+}
+
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ *
+ * Suggests a surface should become non system modal.
+ */
+static inline void
+zcr_remote_surface_v1_unset_system_modal(struct zcr_remote_surface_v1 *zcr_remote_surface_v1)
+{
+ wl_proxy_marshal((struct wl_proxy *) zcr_remote_surface_v1,
+ ZCR_REMOTE_SURFACE_V1_UNSET_SYSTEM_MODAL);
+}
+
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ *
+ * Request that surface needs a rectangular shadow.
+ *
+ * This is only a request that the surface should have a rectangular
+ * shadow. The compositor may choose to ignore this request.
+ *
+ * The arguments are given in the remote surface coordinate space and
+ * specifies inner bounds of the shadow. Specifying zero width and height
+ * will disable the shadow.
+ */
+static inline void
+zcr_remote_surface_v1_set_rectangular_surface_shadow(struct zcr_remote_surface_v1 *zcr_remote_surface_v1, int32_t x, int32_t y, int32_t width, int32_t height)
+{
+ wl_proxy_marshal((struct wl_proxy *) zcr_remote_surface_v1,
+ ZCR_REMOTE_SURFACE_V1_SET_RECTANGULAR_SURFACE_SHADOW, x, y, width, height);
+}
+
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ *
+ * Requests how the surface will change the visibility of the system UI when it is made active.
+ */
+static inline void
+zcr_remote_surface_v1_set_systemui_visibility(struct zcr_remote_surface_v1 *zcr_remote_surface_v1, uint32_t visibility)
+{
+ wl_proxy_marshal((struct wl_proxy *) zcr_remote_surface_v1,
+ ZCR_REMOTE_SURFACE_V1_SET_SYSTEMUI_VISIBILITY, visibility);
+}
+
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ *
+ * Request that surface is made to be always on top.
+ *
+ * This is only a request that the window should be always on top.
+ * The compositor may choose to ignore this request.
+ *
+ */
+static inline void
+zcr_remote_surface_v1_set_always_on_top(struct zcr_remote_surface_v1 *zcr_remote_surface_v1)
+{
+ wl_proxy_marshal((struct wl_proxy *) zcr_remote_surface_v1,
+ ZCR_REMOTE_SURFACE_V1_SET_ALWAYS_ON_TOP);
+}
+
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ *
+ * Request that surface is made to be not always on top.
+ *
+ * This is only a request that the window should be not always on top.
+ * The compositor may choose to ignore this request.
+ */
+static inline void
+zcr_remote_surface_v1_unset_always_on_top(struct zcr_remote_surface_v1 *zcr_remote_surface_v1)
+{
+ wl_proxy_marshal((struct wl_proxy *) zcr_remote_surface_v1,
+ ZCR_REMOTE_SURFACE_V1_UNSET_ALWAYS_ON_TOP);
+}
+
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ *
+ * When a configure event is received, if a client commits the
+ * surface in response to the configure event, then the client
+ * must make an ack_configure request sometime before the commit
+ * request, passing along the serial of the configure event.
+ *
+ * For instance, the compositor might use this information during display
+ * configuration to change its coordinate space for set_window_geometry
+ * requests only when the client has switched to the new coordinate space.
+ *
+ * If the client receives multiple configure events before it
+ * can respond to one, it only has to ack the last configure event.
+ *
+ * A client is not required to commit immediately after sending
+ * an ack_configure request - it may even ack_configure several times
+ * before its next surface commit.
+ *
+ * A client may send multiple ack_configure requests before committing, but
+ * only the last request sent before a commit indicates which configure
+ * event the client really is responding to.
+ */
+static inline void
+zcr_remote_surface_v1_ack_configure(struct zcr_remote_surface_v1 *zcr_remote_surface_v1, uint32_t serial)
+{
+ wl_proxy_marshal((struct wl_proxy *) zcr_remote_surface_v1,
+ ZCR_REMOTE_SURFACE_V1_ACK_CONFIGURE, serial);
+}
+
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ *
+ * Start an interactive, user-driven move of the surface.
+ *
+ * The compositor responds to this request with a configure event that
+ * transitions to the "moving" state. The client must only initiate motion
+ * after acknowledging the state change. The compositor can assume that
+ * subsequent set_window_geometry requests are position updates until the
+ * next state transition is acknowledged.
+ *
+ * The compositor may ignore move requests depending on the state of the
+ * surface, e.g. fullscreen or maximized.
+ */
+static inline void
+zcr_remote_surface_v1_move(struct zcr_remote_surface_v1 *zcr_remote_surface_v1)
+{
+ wl_proxy_marshal((struct wl_proxy *) zcr_remote_surface_v1,
+ ZCR_REMOTE_SURFACE_V1_MOVE);
+}
+
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ *
+ * Set an orientation for the surface.
+ */
+static inline void
+zcr_remote_surface_v1_set_orientation(struct zcr_remote_surface_v1 *zcr_remote_surface_v1, int32_t orientation)
+{
+ wl_proxy_marshal((struct wl_proxy *) zcr_remote_surface_v1,
+ ZCR_REMOTE_SURFACE_V1_SET_ORIENTATION, orientation);
+}
+
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ *
+ * Set the type of window. This is only a hint to the compositor and the
+ * compositor is free to ignore it.
+ */
+static inline void
+zcr_remote_surface_v1_set_window_type(struct zcr_remote_surface_v1 *zcr_remote_surface_v1, uint32_t type)
+{
+ wl_proxy_marshal((struct wl_proxy *) zcr_remote_surface_v1,
+ ZCR_REMOTE_SURFACE_V1_SET_WINDOW_TYPE, type);
+}
+
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ *
+ * Start an interactive, user-driven resize of the surface.
+ *
+ * The compositor responds to this request with a configure event that
+ * transitions to the "resizing" state. The client must only initiate
+ * resizing after acknowledging the state change. The compositor can assume
+ * that subsequent set_window_geometry requests are resizes until the next
+ * state transition is acknowledged.
+ *
+ * The compositor may ignore resize requests depending on the state of the
+ * surface, e.g. fullscreen or maximized.
+ */
+static inline void
+zcr_remote_surface_v1_resize(struct zcr_remote_surface_v1 *zcr_remote_surface_v1)
+{
+ wl_proxy_marshal((struct wl_proxy *) zcr_remote_surface_v1,
+ ZCR_REMOTE_SURFACE_V1_RESIZE);
+}
+
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ *
+ * Expand input region of surface with resize outset.
+ *
+ * The compositor clips the input region of each surface to its bounds,
+ * unless the client requests a resize outset. In that case, the input
+ * region of the root surface is expanded to allow for some leeway around
+ * visible bounds when starting a user-driven resize.
+ */
+static inline void
+zcr_remote_surface_v1_set_resize_outset(struct zcr_remote_surface_v1 *zcr_remote_surface_v1, int32_t outset)
+{
+ wl_proxy_marshal((struct wl_proxy *) zcr_remote_surface_v1,
+ ZCR_REMOTE_SURFACE_V1_SET_RESIZE_OUTSET, outset);
+}
+
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ *
+ * Request an interactive, user-driven move of the surface. "x"
+ * and "y" specifies the starting point of the pointer device
+ * that initiated the move.
+ *
+ * The compositor responds to this request with a drag_started
+ * event with "none" direction. Please see drag_started event
+ * for more details.
+ *
+ * The compositor may ignore move requests depending on the state of the
+ * surface, e.g. fullscreen or maximized.
+ */
+static inline void
+zcr_remote_surface_v1_start_move(struct zcr_remote_surface_v1 *zcr_remote_surface_v1, int32_t x, int32_t y)
+{
+ wl_proxy_marshal((struct wl_proxy *) zcr_remote_surface_v1,
+ ZCR_REMOTE_SURFACE_V1_START_MOVE, x, y);
+}
+
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ *
+ * Request that surface can be in maximzied state.
+ */
+static inline void
+zcr_remote_surface_v1_set_can_maximize(struct zcr_remote_surface_v1 *zcr_remote_surface_v1)
+{
+ wl_proxy_marshal((struct wl_proxy *) zcr_remote_surface_v1,
+ ZCR_REMOTE_SURFACE_V1_SET_CAN_MAXIMIZE);
+}
+
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ *
+ * Request that surface can not be in maximzied state.
+ */
+static inline void
+zcr_remote_surface_v1_unset_can_maximize(struct zcr_remote_surface_v1 *zcr_remote_surface_v1)
+{
+ wl_proxy_marshal((struct wl_proxy *) zcr_remote_surface_v1,
+ ZCR_REMOTE_SURFACE_V1_UNSET_CAN_MAXIMIZE);
+}
+
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ *
+ * Set a minimum size of the surface.
+ *
+ * Values set in this way are double-buffered. They will get
+ * applied on the next commit.
+ */
+static inline void
+zcr_remote_surface_v1_set_min_size(struct zcr_remote_surface_v1 *zcr_remote_surface_v1, int32_t width, int32_t height)
+{
+ wl_proxy_marshal((struct wl_proxy *) zcr_remote_surface_v1,
+ ZCR_REMOTE_SURFACE_V1_SET_MIN_SIZE, width, height);
+}
+
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ *
+ * Set a maximum size of the surface.
+ *
+ * Values set in this way are double-buffered. They will get
+ * applied on the next commit.
+ *
+ * Setting the same size as minimum size makes the surface
+ * unresizable.
+ */
+static inline void
+zcr_remote_surface_v1_set_max_size(struct zcr_remote_surface_v1 *zcr_remote_surface_v1, int32_t width, int32_t height)
+{
+ wl_proxy_marshal((struct wl_proxy *) zcr_remote_surface_v1,
+ ZCR_REMOTE_SURFACE_V1_SET_MAX_SIZE, width, height);
+}
+
+#define ZCR_NOTIFICATION_SURFACE_V1_DESTROY 0
+
+
+/**
+ * @ingroup iface_zcr_notification_surface_v1
+ */
+#define ZCR_NOTIFICATION_SURFACE_V1_DESTROY_SINCE_VERSION 1
+
+/** @ingroup iface_zcr_notification_surface_v1 */
+static inline void
+zcr_notification_surface_v1_set_user_data(struct zcr_notification_surface_v1 *zcr_notification_surface_v1, void *user_data)
+{
+ wl_proxy_set_user_data((struct wl_proxy *) zcr_notification_surface_v1, user_data);
+}
+
+/** @ingroup iface_zcr_notification_surface_v1 */
+static inline void *
+zcr_notification_surface_v1_get_user_data(struct zcr_notification_surface_v1 *zcr_notification_surface_v1)
+{
+ return wl_proxy_get_user_data((struct wl_proxy *) zcr_notification_surface_v1);
+}
+
+static inline uint32_t
+zcr_notification_surface_v1_get_version(struct zcr_notification_surface_v1 *zcr_notification_surface_v1)
+{
+ return wl_proxy_get_version((struct wl_proxy *) zcr_notification_surface_v1);
+}
+
+/**
+ * @ingroup iface_zcr_notification_surface_v1
+ *
+ * Unmap and destroy the notification surface.
+ */
+static inline void
+zcr_notification_surface_v1_destroy(struct zcr_notification_surface_v1 *zcr_notification_surface_v1)
+{
+ wl_proxy_marshal((struct wl_proxy *) zcr_notification_surface_v1,
+ ZCR_NOTIFICATION_SURFACE_V1_DESTROY);
+
+ wl_proxy_destroy((struct wl_proxy *) zcr_notification_surface_v1);
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/chromium/third_party/wayland-protocols/include/protocol/remote-shell-unstable-v1-server-protocol.h b/chromium/third_party/wayland-protocols/include/protocol/remote-shell-unstable-v1-server-protocol.h
new file mode 100644
index 00000000000..9c3356010e4
--- /dev/null
+++ b/chromium/third_party/wayland-protocols/include/protocol/remote-shell-unstable-v1-server-protocol.h
@@ -0,0 +1,1251 @@
+/* Generated by wayland-scanner 1.14.0 */
+
+#ifndef REMOTE_SHELL_UNSTABLE_V1_SERVER_PROTOCOL_H
+#define REMOTE_SHELL_UNSTABLE_V1_SERVER_PROTOCOL_H
+
+#include <stdint.h>
+#include <stddef.h>
+#include "wayland-server.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct wl_client;
+struct wl_resource;
+
+/**
+ * @page page_remote_shell_unstable_v1 The remote_shell_unstable_v1 protocol
+ * Create remote desktop-style surfaces
+ *
+ * @section page_desc_remote_shell_unstable_v1 Description
+ *
+ * remote_shell allows clients to turn a wl_surface into a "real window"
+ * which can be stacked and activated by the user.
+ *
+ * Warning! The protocol described in this file is experimental and backward
+ * incompatible changes may be made. Backward compatible changes may be added
+ * together with the corresponding interface version bump. Backward
+ * incompatible changes are done by bumping the version number in the protocol
+ * and interface names and resetting the interface version. Once the protocol
+ * is to be declared stable, the 'z' prefix and the version number in the
+ * protocol and interface names are removed and the interface version number is
+ * reset.
+ *
+ * @section page_ifaces_remote_shell_unstable_v1 Interfaces
+ * - @subpage page_iface_zcr_remote_shell_v1 - remote_shell
+ * - @subpage page_iface_zcr_remote_surface_v1 - A desktop window
+ * - @subpage page_iface_zcr_notification_surface_v1 - A notification window
+ * @section page_copyright_remote_shell_unstable_v1 Copyright
+ * <pre>
+ *
+ * Copyright 2016 The Chromium Authors.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ * </pre>
+ */
+struct wl_surface;
+struct zcr_notification_surface_v1;
+struct zcr_remote_shell_v1;
+struct zcr_remote_surface_v1;
+
+/**
+ * @page page_iface_zcr_remote_shell_v1 zcr_remote_shell_v1
+ * @section page_iface_zcr_remote_shell_v1_desc Description
+ *
+ * The global interface that allows clients to turn a wl_surface into a
+ * "real window" which is remotely managed but can be stacked, activated
+ * and made fullscreen by the user.
+ * @section page_iface_zcr_remote_shell_v1_api API
+ * See @ref iface_zcr_remote_shell_v1.
+ */
+/**
+ * @defgroup iface_zcr_remote_shell_v1 The zcr_remote_shell_v1 interface
+ *
+ * The global interface that allows clients to turn a wl_surface into a
+ * "real window" which is remotely managed but can be stacked, activated
+ * and made fullscreen by the user.
+ */
+extern const struct wl_interface zcr_remote_shell_v1_interface;
+/**
+ * @page page_iface_zcr_remote_surface_v1 zcr_remote_surface_v1
+ * @section page_iface_zcr_remote_surface_v1_desc Description
+ *
+ * An interface that may be implemented by a wl_surface, for
+ * implementations that provide a desktop-style user interface
+ * and allows for remotely managed windows.
+ *
+ * It provides requests to treat surfaces like windows, allowing to set
+ * properties like app id and geometry.
+ *
+ * The client must call wl_surface.commit on the corresponding wl_surface
+ * for the remote_surface state to take effect.
+ *
+ * For a surface to be mapped by the compositor the client must have
+ * committed both an remote_surface state and a buffer.
+ * @section page_iface_zcr_remote_surface_v1_api API
+ * See @ref iface_zcr_remote_surface_v1.
+ */
+/**
+ * @defgroup iface_zcr_remote_surface_v1 The zcr_remote_surface_v1 interface
+ *
+ * An interface that may be implemented by a wl_surface, for
+ * implementations that provide a desktop-style user interface
+ * and allows for remotely managed windows.
+ *
+ * It provides requests to treat surfaces like windows, allowing to set
+ * properties like app id and geometry.
+ *
+ * The client must call wl_surface.commit on the corresponding wl_surface
+ * for the remote_surface state to take effect.
+ *
+ * For a surface to be mapped by the compositor the client must have
+ * committed both an remote_surface state and a buffer.
+ */
+extern const struct wl_interface zcr_remote_surface_v1_interface;
+/**
+ * @page page_iface_zcr_notification_surface_v1 zcr_notification_surface_v1
+ * @section page_iface_zcr_notification_surface_v1_desc Description
+ *
+ * An interface that may be implemented by a wl_surface to host
+ * notification contents.
+ * @section page_iface_zcr_notification_surface_v1_api API
+ * See @ref iface_zcr_notification_surface_v1.
+ */
+/**
+ * @defgroup iface_zcr_notification_surface_v1 The zcr_notification_surface_v1 interface
+ *
+ * An interface that may be implemented by a wl_surface to host
+ * notification contents.
+ */
+extern const struct wl_interface zcr_notification_surface_v1_interface;
+
+#ifndef ZCR_REMOTE_SHELL_V1_CONTAINER_ENUM
+#define ZCR_REMOTE_SHELL_V1_CONTAINER_ENUM
+/**
+ * @ingroup iface_zcr_remote_shell_v1
+ * containers for remote surfaces
+ *
+ * Determine how a remote surface should be stacked relative to other
+ * shell surfaces.
+ */
+enum zcr_remote_shell_v1_container {
+ /**
+ * default container
+ */
+ ZCR_REMOTE_SHELL_V1_CONTAINER_DEFAULT = 1,
+ /**
+ * system modal container
+ */
+ ZCR_REMOTE_SHELL_V1_CONTAINER_OVERLAY = 2,
+};
+#endif /* ZCR_REMOTE_SHELL_V1_CONTAINER_ENUM */
+
+#ifndef ZCR_REMOTE_SHELL_V1_STATE_TYPE_ENUM
+#define ZCR_REMOTE_SHELL_V1_STATE_TYPE_ENUM
+/**
+ * @ingroup iface_zcr_remote_shell_v1
+ * state types for remote surfaces
+ *
+ * Defines common show states for shell surfaces.
+ */
+enum zcr_remote_shell_v1_state_type {
+ /**
+ * normal window state
+ */
+ ZCR_REMOTE_SHELL_V1_STATE_TYPE_NORMAL = 1,
+ /**
+ * minimized window state
+ */
+ ZCR_REMOTE_SHELL_V1_STATE_TYPE_MINIMIZED = 2,
+ /**
+ * maximized window state
+ */
+ ZCR_REMOTE_SHELL_V1_STATE_TYPE_MAXIMIZED = 3,
+ /**
+ * fullscreen window state
+ */
+ ZCR_REMOTE_SHELL_V1_STATE_TYPE_FULLSCREEN = 4,
+ /**
+ * pinned window state
+ */
+ ZCR_REMOTE_SHELL_V1_STATE_TYPE_PINNED = 5,
+ /**
+ * trusted pinned window state
+ */
+ ZCR_REMOTE_SHELL_V1_STATE_TYPE_TRUSTED_PINNED = 6,
+ /**
+ * moving window state
+ */
+ ZCR_REMOTE_SHELL_V1_STATE_TYPE_MOVING = 7,
+ /**
+ * resizing window state
+ */
+ ZCR_REMOTE_SHELL_V1_STATE_TYPE_RESIZING = 8,
+};
+#endif /* ZCR_REMOTE_SHELL_V1_STATE_TYPE_ENUM */
+
+#ifndef ZCR_REMOTE_SHELL_V1_ERROR_ENUM
+#define ZCR_REMOTE_SHELL_V1_ERROR_ENUM
+enum zcr_remote_shell_v1_error {
+ /**
+ * given wl_surface has another role
+ */
+ ZCR_REMOTE_SHELL_V1_ERROR_ROLE = 0,
+ /**
+ * invalid notification key
+ */
+ ZCR_REMOTE_SHELL_V1_ERROR_INVALID_NOTIFICATION_KEY = 1,
+};
+#endif /* ZCR_REMOTE_SHELL_V1_ERROR_ENUM */
+
+#ifndef ZCR_REMOTE_SHELL_V1_LAYOUT_MODE_ENUM
+#define ZCR_REMOTE_SHELL_V1_LAYOUT_MODE_ENUM
+/**
+ * @ingroup iface_zcr_remote_shell_v1
+ * the layout mode
+ *
+ * Determine how a client should layout surfaces.
+ */
+enum zcr_remote_shell_v1_layout_mode {
+ /**
+ * multiple windows
+ */
+ ZCR_REMOTE_SHELL_V1_LAYOUT_MODE_WINDOWED = 1,
+ /**
+ * restricted mode for tablet
+ */
+ ZCR_REMOTE_SHELL_V1_LAYOUT_MODE_TABLET = 2,
+};
+#endif /* ZCR_REMOTE_SHELL_V1_LAYOUT_MODE_ENUM */
+
+/**
+ * @ingroup iface_zcr_remote_shell_v1
+ * @struct zcr_remote_shell_v1_interface
+ */
+struct zcr_remote_shell_v1_interface {
+ /**
+ * destroy remote_shell
+ *
+ * Destroy this remote_shell object.
+ *
+ * Destroying a bound remote_shell object while there are surfaces
+ * still alive created by this remote_shell object instance is
+ * illegal and will result in a protocol error.
+ */
+ void (*destroy)(struct wl_client *client,
+ struct wl_resource *resource);
+ /**
+ * create a remote shell surface from a surface
+ *
+ * This creates an remote_surface for the given surface and gives
+ * it the remote_surface role. A wl_surface can only be given a
+ * remote_surface role once. If get_remote_surface is called with a
+ * wl_surface that already has an active remote_surface associated
+ * with it, or if it had any other role, an error is raised.
+ *
+ * See the documentation of remote_surface for more details about
+ * what an remote_surface is and how it is used.
+ */
+ void (*get_remote_surface)(struct wl_client *client,
+ struct wl_resource *resource,
+ uint32_t id,
+ struct wl_resource *surface,
+ uint32_t container);
+ /**
+ * create a notification surface from a surface
+ *
+ * Creates a notification_surface for the given surface, gives it
+ * the notification_surface role and associated it with a
+ * notification id.
+ */
+ void (*get_notification_surface)(struct wl_client *client,
+ struct wl_resource *resource,
+ uint32_t id,
+ struct wl_resource *surface,
+ const char *notification_key);
+};
+
+#define ZCR_REMOTE_SHELL_V1_ACTIVATED 0
+#define ZCR_REMOTE_SHELL_V1_CONFIGURATION_CHANGED 1
+#define ZCR_REMOTE_SHELL_V1_WORKSPACE 2
+#define ZCR_REMOTE_SHELL_V1_CONFIGURE 3
+#define ZCR_REMOTE_SHELL_V1_DEFAULT_DEVICE_SCALE_FACTOR 4
+
+/**
+ * @ingroup iface_zcr_remote_shell_v1
+ */
+#define ZCR_REMOTE_SHELL_V1_ACTIVATED_SINCE_VERSION 1
+/**
+ * @ingroup iface_zcr_remote_shell_v1
+ */
+#define ZCR_REMOTE_SHELL_V1_CONFIGURATION_CHANGED_SINCE_VERSION 1
+/**
+ * @ingroup iface_zcr_remote_shell_v1
+ */
+#define ZCR_REMOTE_SHELL_V1_WORKSPACE_SINCE_VERSION 5
+/**
+ * @ingroup iface_zcr_remote_shell_v1
+ */
+#define ZCR_REMOTE_SHELL_V1_CONFIGURE_SINCE_VERSION 5
+/**
+ * @ingroup iface_zcr_remote_shell_v1
+ */
+#define ZCR_REMOTE_SHELL_V1_DEFAULT_DEVICE_SCALE_FACTOR_SINCE_VERSION 8
+
+/**
+ * @ingroup iface_zcr_remote_shell_v1
+ */
+#define ZCR_REMOTE_SHELL_V1_DESTROY_SINCE_VERSION 1
+/**
+ * @ingroup iface_zcr_remote_shell_v1
+ */
+#define ZCR_REMOTE_SHELL_V1_GET_REMOTE_SURFACE_SINCE_VERSION 1
+/**
+ * @ingroup iface_zcr_remote_shell_v1
+ */
+#define ZCR_REMOTE_SHELL_V1_GET_NOTIFICATION_SURFACE_SINCE_VERSION 1
+
+/**
+ * @ingroup iface_zcr_remote_shell_v1
+ * Sends an activated event to the client owning the resource.
+ * @param resource_ The client's resource
+ */
+static inline void
+zcr_remote_shell_v1_send_activated(struct wl_resource *resource_, struct wl_resource *gained_active, struct wl_resource *lost_active)
+{
+ wl_resource_post_event(resource_, ZCR_REMOTE_SHELL_V1_ACTIVATED, gained_active, lost_active);
+}
+
+/**
+ * @ingroup iface_zcr_remote_shell_v1
+ * Sends an configuration_changed event to the client owning the resource.
+ * @param resource_ The client's resource
+ */
+static inline void
+zcr_remote_shell_v1_send_configuration_changed(struct wl_resource *resource_, int32_t width, int32_t height, int32_t transform, wl_fixed_t scale_factor, int32_t work_area_inset_left, int32_t work_area_inset_top, int32_t work_area_inset_right, int32_t work_area_inset_bottom, uint32_t layout_mode)
+{
+ wl_resource_post_event(resource_, ZCR_REMOTE_SHELL_V1_CONFIGURATION_CHANGED, width, height, transform, scale_factor, work_area_inset_left, work_area_inset_top, work_area_inset_right, work_area_inset_bottom, layout_mode);
+}
+
+/**
+ * @ingroup iface_zcr_remote_shell_v1
+ * Sends an workspace event to the client owning the resource.
+ * @param resource_ The client's resource
+ * @param is_internal 1 if screen is built-in
+ */
+static inline void
+zcr_remote_shell_v1_send_workspace(struct wl_resource *resource_, uint32_t id_hi, uint32_t id_lo, int32_t x, int32_t y, int32_t width, int32_t height, int32_t inset_left, int32_t inset_top, int32_t inset_right, int32_t inset_bottom, int32_t transform, wl_fixed_t scale_factor, uint32_t is_internal)
+{
+ wl_resource_post_event(resource_, ZCR_REMOTE_SHELL_V1_WORKSPACE, id_hi, id_lo, x, y, width, height, inset_left, inset_top, inset_right, inset_bottom, transform, scale_factor, is_internal);
+}
+
+/**
+ * @ingroup iface_zcr_remote_shell_v1
+ * Sends an configure event to the client owning the resource.
+ * @param resource_ The client's resource
+ */
+static inline void
+zcr_remote_shell_v1_send_configure(struct wl_resource *resource_, uint32_t layout_mode)
+{
+ wl_resource_post_event(resource_, ZCR_REMOTE_SHELL_V1_CONFIGURE, layout_mode);
+}
+
+/**
+ * @ingroup iface_zcr_remote_shell_v1
+ * Sends an default_device_scale_factor event to the client owning the resource.
+ * @param resource_ The client's resource
+ * @param scale DP to pixels ratio, in 8.24 fixed point format
+ */
+static inline void
+zcr_remote_shell_v1_send_default_device_scale_factor(struct wl_resource *resource_, int32_t scale)
+{
+ wl_resource_post_event(resource_, ZCR_REMOTE_SHELL_V1_DEFAULT_DEVICE_SCALE_FACTOR, scale);
+}
+
+#ifndef ZCR_REMOTE_SURFACE_V1_SYSTEMUI_VISIBILITY_STATE_ENUM
+#define ZCR_REMOTE_SURFACE_V1_SYSTEMUI_VISIBILITY_STATE_ENUM
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ * systemui visibility behavior
+ *
+ * Determine the visibility behavior of the system UI.
+ */
+enum zcr_remote_surface_v1_systemui_visibility_state {
+ /**
+ * system ui is visible
+ */
+ ZCR_REMOTE_SURFACE_V1_SYSTEMUI_VISIBILITY_STATE_VISIBLE = 1,
+ /**
+ * system ui autohides and is not sticky
+ */
+ ZCR_REMOTE_SURFACE_V1_SYSTEMUI_VISIBILITY_STATE_AUTOHIDE_NON_STICKY = 2,
+ /**
+ * system ui autohides and is sticky
+ */
+ ZCR_REMOTE_SURFACE_V1_SYSTEMUI_VISIBILITY_STATE_AUTOHIDE_STICKY = 3,
+};
+#endif /* ZCR_REMOTE_SURFACE_V1_SYSTEMUI_VISIBILITY_STATE_ENUM */
+
+#ifndef ZCR_REMOTE_SURFACE_V1_ORIENTATION_ENUM
+#define ZCR_REMOTE_SURFACE_V1_ORIENTATION_ENUM
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ * window orientation
+ *
+ * The orientation of the window.
+ */
+enum zcr_remote_surface_v1_orientation {
+ /**
+ * portrait
+ */
+ ZCR_REMOTE_SURFACE_V1_ORIENTATION_PORTRAIT = 1,
+ /**
+ * landscape
+ */
+ ZCR_REMOTE_SURFACE_V1_ORIENTATION_LANDSCAPE = 2,
+};
+#endif /* ZCR_REMOTE_SURFACE_V1_ORIENTATION_ENUM */
+
+#ifndef ZCR_REMOTE_SURFACE_V1_WINDOW_TYPE_ENUM
+#define ZCR_REMOTE_SURFACE_V1_WINDOW_TYPE_ENUM
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ * window type
+ *
+ * The type of the window.
+ */
+enum zcr_remote_surface_v1_window_type {
+ /**
+ * normal app window
+ */
+ ZCR_REMOTE_SURFACE_V1_WINDOW_TYPE_NORMAL = 1,
+ /**
+ * window is treated as systemui
+ */
+ ZCR_REMOTE_SURFACE_V1_WINDOW_TYPE_SYSTEM_UI = 2,
+};
+#endif /* ZCR_REMOTE_SURFACE_V1_WINDOW_TYPE_ENUM */
+
+#ifndef ZCR_REMOTE_SURFACE_V1_BOUNDS_CHANGE_REASON_ENUM
+#define ZCR_REMOTE_SURFACE_V1_BOUNDS_CHANGE_REASON_ENUM
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ * bounds_change_reason
+ *
+ * Specifies the cause of the window bounds change event.
+ */
+enum zcr_remote_surface_v1_bounds_change_reason {
+ /**
+ * the window is being moved by drag operation
+ */
+ ZCR_REMOTE_SURFACE_V1_BOUNDS_CHANGE_REASON_DRAG_MOVE = 1,
+ /**
+ * the window is being resized by drag operation.
+ */
+ ZCR_REMOTE_SURFACE_V1_BOUNDS_CHANGE_REASON_DRAG_RESIZE = 2,
+ /**
+ * the window is resized to left snapped state
+ */
+ ZCR_REMOTE_SURFACE_V1_BOUNDS_CHANGE_REASON_SNAP_TO_LEFT = 3,
+ /**
+ * the window is resized to right snapped state
+ */
+ ZCR_REMOTE_SURFACE_V1_BOUNDS_CHANGE_REASON_SNAP_TO_RIGHT = 4,
+ /**
+ * the window bounds is moved due to other WM operations
+ */
+ ZCR_REMOTE_SURFACE_V1_BOUNDS_CHANGE_REASON_MOVE = 5,
+ /**
+ * the window bounds is reiszed due to other WM operations
+ */
+ ZCR_REMOTE_SURFACE_V1_BOUNDS_CHANGE_REASON_RESIZE = 6,
+};
+#endif /* ZCR_REMOTE_SURFACE_V1_BOUNDS_CHANGE_REASON_ENUM */
+
+#ifndef ZCR_REMOTE_SURFACE_V1_RESIZE_DIRECTION_ENUM
+#define ZCR_REMOTE_SURFACE_V1_RESIZE_DIRECTION_ENUM
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ * resize direction
+ *
+ * The resize direction for drag operation
+ */
+enum zcr_remote_surface_v1_resize_direction {
+ /**
+ * move only, no resize
+ */
+ ZCR_REMOTE_SURFACE_V1_RESIZE_DIRECTION_NONE = 0,
+ /**
+ * resize to the left
+ */
+ ZCR_REMOTE_SURFACE_V1_RESIZE_DIRECTION_LEFT = 1,
+ /**
+ * resize to the top left
+ */
+ ZCR_REMOTE_SURFACE_V1_RESIZE_DIRECTION_TOPLEFT = 2,
+ /**
+ * resize to the top
+ */
+ ZCR_REMOTE_SURFACE_V1_RESIZE_DIRECTION_TOP = 3,
+ /**
+ * resize to the top right
+ */
+ ZCR_REMOTE_SURFACE_V1_RESIZE_DIRECTION_TOPRIGHT = 4,
+ /**
+ * resize to the right
+ */
+ ZCR_REMOTE_SURFACE_V1_RESIZE_DIRECTION_RIGHT = 5,
+ /**
+ * resize to the buttom right
+ */
+ ZCR_REMOTE_SURFACE_V1_RESIZE_DIRECTION_BOTTOMRIGHT = 6,
+ /**
+ * resize to the bottom
+ */
+ ZCR_REMOTE_SURFACE_V1_RESIZE_DIRECTION_BOTTOM = 7,
+ /**
+ * resize to the bottom left
+ */
+ ZCR_REMOTE_SURFACE_V1_RESIZE_DIRECTION_BOTTOMLEFT = 8,
+};
+#endif /* ZCR_REMOTE_SURFACE_V1_RESIZE_DIRECTION_ENUM */
+
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ * @struct zcr_remote_surface_v1_interface
+ */
+struct zcr_remote_surface_v1_interface {
+ /**
+ * Destroy the remote_surface
+ *
+ * Unmap and destroy the window. The window will be effectively
+ * hidden from the user's point of view, and all state will be
+ * lost.
+ */
+ void (*destroy)(struct wl_client *client,
+ struct wl_resource *resource);
+ /**
+ * set application ID
+ *
+ * Set an application identifier for the surface.
+ */
+ void (*set_app_id)(struct wl_client *client,
+ struct wl_resource *resource,
+ const char *app_id);
+ /**
+ * set the new window geometry
+ *
+ * The window geometry of a window is its "visible bounds" from
+ * the user's perspective. Client-side decorations often have
+ * invisible portions like drop-shadows which should be ignored for
+ * the purposes of aligning, placing and constraining windows.
+ *
+ * The window geometry is double buffered, and will be applied at
+ * the time wl_surface.commit of the corresponding wl_surface is
+ * called.
+ *
+ * Once the window geometry of the surface is set once, it is not
+ * possible to unset it, and it will remain the same until
+ * set_window_geometry is called again, even if a new subsurface or
+ * buffer is attached.
+ *
+ * If never set, the value is the full bounds of the output. This
+ * updates dynamically on every commit.
+ *
+ * The arguments are given in the output coordinate space.
+ *
+ * The width and height must be greater than zero.
+ */
+ void (*set_window_geometry)(struct wl_client *client,
+ struct wl_resource *resource,
+ int32_t x,
+ int32_t y,
+ int32_t width,
+ int32_t height);
+ /**
+ * set scale
+ *
+ * Set a scale factor that will be applied to surface and all
+ * descendants.
+ */
+ void (*set_scale)(struct wl_client *client,
+ struct wl_resource *resource,
+ wl_fixed_t scale);
+ /**
+ * set a rectangular shadow
+ *
+ * [Deprecated] Request that surface needs a rectangular shadow.
+ *
+ * This is only a request that the surface should have a
+ * rectangular shadow. The compositor may choose to ignore this
+ * request.
+ *
+ * The arguments are given in the output coordinate space and
+ * specifies the inner bounds of the shadow.
+ *
+ * The arguments are given in the output coordinate space.
+ * Specifying zero width and height will disable the shadow.
+ */
+ void (*set_rectangular_shadow)(struct wl_client *client,
+ struct wl_resource *resource,
+ int32_t x,
+ int32_t y,
+ int32_t width,
+ int32_t height);
+ /**
+ * suggests the window's background opacity
+ *
+ * [Deprecated] Suggests the window's background opacity when the
+ * shadow is requested.
+ */
+ void (*set_rectangular_shadow_background_opacity)(struct wl_client *client,
+ struct wl_resource *resource,
+ wl_fixed_t opacity);
+ /**
+ * set surface title
+ *
+ * Set a short title for the surface.
+ *
+ * This string may be used to identify the surface in a task bar,
+ * window list, or other user interface elements provided by the
+ * compositor.
+ *
+ * The string must be encoded in UTF-8.
+ */
+ void (*set_title)(struct wl_client *client,
+ struct wl_resource *resource,
+ const char *title);
+ /**
+ * set top inset for surface
+ *
+ * Set distance from the top of the surface to the contents.
+ *
+ * This distance typically represents the size of the window
+ * caption.
+ */
+ void (*set_top_inset)(struct wl_client *client,
+ struct wl_resource *resource,
+ int32_t height);
+ /**
+ * make the surface active
+ *
+ * Make the surface active and bring it to the front.
+ * @param serial the serial of the user event
+ */
+ void (*activate)(struct wl_client *client,
+ struct wl_resource *resource,
+ uint32_t serial);
+ /**
+ * maximize
+ *
+ * Request that surface is maximized. The window geometry will be
+ * updated to whatever the compositor finds appropriate for a
+ * maximized window.
+ *
+ * This is only a request that the window should be maximized. The
+ * compositor may choose to ignore this request. The client should
+ * listen to set_maximized events to determine if the window was
+ * maximized or not.
+ */
+ void (*maximize)(struct wl_client *client,
+ struct wl_resource *resource);
+ /**
+ * minimize
+ *
+ * Request that surface is minimized.
+ *
+ * This is only a request that the window should be minimized. The
+ * compositor may choose to ignore this request. The client should
+ * listen to set_minimized events to determine if the window was
+ * minimized or not.
+ */
+ void (*minimize)(struct wl_client *client,
+ struct wl_resource *resource);
+ /**
+ * restore
+ *
+ * Request that surface is restored. This restores the window
+ * geometry to what it was before the window was minimized,
+ * maximized or made fullscreen.
+ *
+ * This is only a request that the window should be restored. The
+ * compositor may choose to ignore this request. The client should
+ * listen to unset_maximized, unset_minimize and unset_fullscreen
+ * events to determine if the window was restored or not.
+ */
+ void (*restore)(struct wl_client *client,
+ struct wl_resource *resource);
+ /**
+ * fullscreen
+ *
+ * Request that surface is made fullscreen.
+ *
+ * This is only a request that the window should be made
+ * fullscreen. The compositor may choose to ignore this request.
+ * The client should listen to set_fullscreen events to determine
+ * if the window was made fullscreen or not.
+ */
+ void (*fullscreen)(struct wl_client *client,
+ struct wl_resource *resource);
+ /**
+ * unfullscreen
+ *
+ * Request that surface is made unfullscreen.
+ *
+ * This is only a request that the window should be made
+ * unfullscreen. The compositor may choose to ignore this request.
+ * The client should listen to unset_fullscreen events to determine
+ * if the window was made unfullscreen or not.
+ */
+ void (*unfullscreen)(struct wl_client *client,
+ struct wl_resource *resource);
+ /**
+ * pin
+ *
+ * Request that surface is pinned.
+ *
+ * This is only a request that the window should be pinned. The
+ * compositor may choose to ignore this request. The client should
+ * listen to state_changed events to determine if the window was
+ * pinned or not. If trusted flag is non-zero, the app can prevent
+ * users from exiting the pinned mode.
+ */
+ void (*pin)(struct wl_client *client,
+ struct wl_resource *resource,
+ int32_t trusted);
+ /**
+ * unpin
+ *
+ * Request that surface is unpinned.
+ *
+ * This is only a request that the window should be unpinned. The
+ * compositor may choose to ignore this request. The client should
+ * listen to unset_pinned events to determine if the window was
+ * unpinned or not.
+ */
+ void (*unpin)(struct wl_client *client,
+ struct wl_resource *resource);
+ /**
+ * suggests a re-layout of remote shell input area
+ *
+ * Suggests a surface should become system modal.
+ */
+ void (*set_system_modal)(struct wl_client *client,
+ struct wl_resource *resource);
+ /**
+ * suggests a re-layout of remote shell input area
+ *
+ * Suggests a surface should become non system modal.
+ */
+ void (*unset_system_modal)(struct wl_client *client,
+ struct wl_resource *resource);
+ /**
+ * set a rectangular shadow
+ *
+ * Request that surface needs a rectangular shadow.
+ *
+ * This is only a request that the surface should have a
+ * rectangular shadow. The compositor may choose to ignore this
+ * request.
+ *
+ * The arguments are given in the remote surface coordinate space
+ * and specifies inner bounds of the shadow. Specifying zero width
+ * and height will disable the shadow.
+ * @since 2
+ */
+ void (*set_rectangular_surface_shadow)(struct wl_client *client,
+ struct wl_resource *resource,
+ int32_t x,
+ int32_t y,
+ int32_t width,
+ int32_t height);
+ /**
+ * requests the system ui visibility behavior for the surface
+ *
+ * Requests how the surface will change the visibility of the
+ * system UI when it is made active.
+ * @since 3
+ */
+ void (*set_systemui_visibility)(struct wl_client *client,
+ struct wl_resource *resource,
+ uint32_t visibility);
+ /**
+ * set always on top
+ *
+ * Request that surface is made to be always on top.
+ *
+ * This is only a request that the window should be always on top.
+ * The compositor may choose to ignore this request.
+ * @since 4
+ */
+ void (*set_always_on_top)(struct wl_client *client,
+ struct wl_resource *resource);
+ /**
+ * unset always on top
+ *
+ * Request that surface is made to be not always on top.
+ *
+ * This is only a request that the window should be not always on
+ * top. The compositor may choose to ignore this request.
+ * @since 4
+ */
+ void (*unset_always_on_top)(struct wl_client *client,
+ struct wl_resource *resource);
+ /**
+ * ack a configure event
+ *
+ * When a configure event is received, if a client commits the
+ * surface in response to the configure event, then the client must
+ * make an ack_configure request sometime before the commit
+ * request, passing along the serial of the configure event.
+ *
+ * For instance, the compositor might use this information during
+ * display configuration to change its coordinate space for
+ * set_window_geometry requests only when the client has switched
+ * to the new coordinate space.
+ *
+ * If the client receives multiple configure events before it can
+ * respond to one, it only has to ack the last configure event.
+ *
+ * A client is not required to commit immediately after sending an
+ * ack_configure request - it may even ack_configure several times
+ * before its next surface commit.
+ *
+ * A client may send multiple ack_configure requests before
+ * committing, but only the last request sent before a commit
+ * indicates which configure event the client really is responding
+ * to.
+ * @param serial the serial from the configure event
+ * @since 5
+ */
+ void (*ack_configure)(struct wl_client *client,
+ struct wl_resource *resource,
+ uint32_t serial);
+ /**
+ * start an interactive move
+ *
+ * Start an interactive, user-driven move of the surface.
+ *
+ * The compositor responds to this request with a configure event
+ * that transitions to the "moving" state. The client must only
+ * initiate motion after acknowledging the state change. The
+ * compositor can assume that subsequent set_window_geometry
+ * requests are position updates until the next state transition is
+ * acknowledged.
+ *
+ * The compositor may ignore move requests depending on the state
+ * of the surface, e.g. fullscreen or maximized.
+ * @since 5
+ */
+ void (*move)(struct wl_client *client,
+ struct wl_resource *resource);
+ /**
+ * set orientation
+ *
+ * Set an orientation for the surface.
+ * @since 6
+ */
+ void (*set_orientation)(struct wl_client *client,
+ struct wl_resource *resource,
+ int32_t orientation);
+ /**
+ * set the type of the window
+ *
+ * Set the type of window. This is only a hint to the compositor
+ * and the compositor is free to ignore it.
+ * @param type type of the window
+ * @since 7
+ */
+ void (*set_window_type)(struct wl_client *client,
+ struct wl_resource *resource,
+ uint32_t type);
+ /**
+ * start an interactive resize
+ *
+ * Start an interactive, user-driven resize of the surface.
+ *
+ * The compositor responds to this request with a configure event
+ * that transitions to the "resizing" state. The client must only
+ * initiate resizing after acknowledging the state change. The
+ * compositor can assume that subsequent set_window_geometry
+ * requests are resizes until the next state transition is
+ * acknowledged.
+ *
+ * The compositor may ignore resize requests depending on the state
+ * of the surface, e.g. fullscreen or maximized.
+ * @since 9
+ */
+ void (*resize)(struct wl_client *client,
+ struct wl_resource *resource);
+ /**
+ * expand input region for resizing
+ *
+ * Expand input region of surface with resize outset.
+ *
+ * The compositor clips the input region of each surface to its
+ * bounds, unless the client requests a resize outset. In that
+ * case, the input region of the root surface is expanded to allow
+ * for some leeway around visible bounds when starting a
+ * user-driven resize.
+ * @since 9
+ */
+ void (*set_resize_outset)(struct wl_client *client,
+ struct wl_resource *resource,
+ int32_t outset);
+ /**
+ * start an interactive move
+ *
+ * Request an interactive, user-driven move of the surface. "x"
+ * and "y" specifies the starting point of the pointer device that
+ * initiated the move.
+ *
+ * The compositor responds to this request with a drag_started
+ * event with "none" direction. Please see drag_started event for
+ * more details.
+ *
+ * The compositor may ignore move requests depending on the state
+ * of the surface, e.g. fullscreen or maximized.
+ * @since 10
+ */
+ void (*start_move)(struct wl_client *client,
+ struct wl_resource *resource,
+ int32_t x,
+ int32_t y);
+ /**
+ * set can_maximize
+ *
+ * Request that surface can be in maximzied state.
+ * @since 10
+ */
+ void (*set_can_maximize)(struct wl_client *client,
+ struct wl_resource *resource);
+ /**
+ * unset can_maximize
+ *
+ * Request that surface can not be in maximzied state.
+ * @since 10
+ */
+ void (*unset_can_maximize)(struct wl_client *client,
+ struct wl_resource *resource);
+ /**
+ * set the minimum size
+ *
+ * Set a minimum size of the surface.
+ *
+ * Values set in this way are double-buffered. They will get
+ * applied on the next commit.
+ * @since 10
+ */
+ void (*set_min_size)(struct wl_client *client,
+ struct wl_resource *resource,
+ int32_t width,
+ int32_t height);
+ /**
+ * set the maximum size
+ *
+ * Set a maximum size of the surface.
+ *
+ * Values set in this way are double-buffered. They will get
+ * applied on the next commit.
+ *
+ * Setting the same size as minimum size makes the surface
+ * unresizable.
+ * @since 10
+ */
+ void (*set_max_size)(struct wl_client *client,
+ struct wl_resource *resource,
+ int32_t width,
+ int32_t height);
+};
+
+#define ZCR_REMOTE_SURFACE_V1_CLOSE 0
+#define ZCR_REMOTE_SURFACE_V1_STATE_TYPE_CHANGED 1
+#define ZCR_REMOTE_SURFACE_V1_CONFIGURE 2
+#define ZCR_REMOTE_SURFACE_V1_WINDOW_GEOMETRY_CHANGED 3
+#define ZCR_REMOTE_SURFACE_V1_BOUNDS_CHANGED 4
+#define ZCR_REMOTE_SURFACE_V1_DRAG_STARTED 5
+#define ZCR_REMOTE_SURFACE_V1_DRAG_FINISHED 6
+
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ */
+#define ZCR_REMOTE_SURFACE_V1_CLOSE_SINCE_VERSION 1
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ */
+#define ZCR_REMOTE_SURFACE_V1_STATE_TYPE_CHANGED_SINCE_VERSION 1
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ */
+#define ZCR_REMOTE_SURFACE_V1_CONFIGURE_SINCE_VERSION 5
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ */
+#define ZCR_REMOTE_SURFACE_V1_WINDOW_GEOMETRY_CHANGED_SINCE_VERSION 9
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ */
+#define ZCR_REMOTE_SURFACE_V1_BOUNDS_CHANGED_SINCE_VERSION 10
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ */
+#define ZCR_REMOTE_SURFACE_V1_DRAG_STARTED_SINCE_VERSION 10
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ */
+#define ZCR_REMOTE_SURFACE_V1_DRAG_FINISHED_SINCE_VERSION 10
+
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ */
+#define ZCR_REMOTE_SURFACE_V1_DESTROY_SINCE_VERSION 1
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ */
+#define ZCR_REMOTE_SURFACE_V1_SET_APP_ID_SINCE_VERSION 1
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ */
+#define ZCR_REMOTE_SURFACE_V1_SET_WINDOW_GEOMETRY_SINCE_VERSION 1
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ */
+#define ZCR_REMOTE_SURFACE_V1_SET_SCALE_SINCE_VERSION 1
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ */
+#define ZCR_REMOTE_SURFACE_V1_SET_RECTANGULAR_SHADOW_SINCE_VERSION 1
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ */
+#define ZCR_REMOTE_SURFACE_V1_SET_RECTANGULAR_SHADOW_BACKGROUND_OPACITY_SINCE_VERSION 1
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ */
+#define ZCR_REMOTE_SURFACE_V1_SET_TITLE_SINCE_VERSION 1
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ */
+#define ZCR_REMOTE_SURFACE_V1_SET_TOP_INSET_SINCE_VERSION 1
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ */
+#define ZCR_REMOTE_SURFACE_V1_ACTIVATE_SINCE_VERSION 1
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ */
+#define ZCR_REMOTE_SURFACE_V1_MAXIMIZE_SINCE_VERSION 1
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ */
+#define ZCR_REMOTE_SURFACE_V1_MINIMIZE_SINCE_VERSION 1
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ */
+#define ZCR_REMOTE_SURFACE_V1_RESTORE_SINCE_VERSION 1
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ */
+#define ZCR_REMOTE_SURFACE_V1_FULLSCREEN_SINCE_VERSION 1
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ */
+#define ZCR_REMOTE_SURFACE_V1_UNFULLSCREEN_SINCE_VERSION 1
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ */
+#define ZCR_REMOTE_SURFACE_V1_PIN_SINCE_VERSION 1
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ */
+#define ZCR_REMOTE_SURFACE_V1_UNPIN_SINCE_VERSION 1
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ */
+#define ZCR_REMOTE_SURFACE_V1_SET_SYSTEM_MODAL_SINCE_VERSION 1
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ */
+#define ZCR_REMOTE_SURFACE_V1_UNSET_SYSTEM_MODAL_SINCE_VERSION 1
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ */
+#define ZCR_REMOTE_SURFACE_V1_SET_RECTANGULAR_SURFACE_SHADOW_SINCE_VERSION 2
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ */
+#define ZCR_REMOTE_SURFACE_V1_SET_SYSTEMUI_VISIBILITY_SINCE_VERSION 3
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ */
+#define ZCR_REMOTE_SURFACE_V1_SET_ALWAYS_ON_TOP_SINCE_VERSION 4
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ */
+#define ZCR_REMOTE_SURFACE_V1_UNSET_ALWAYS_ON_TOP_SINCE_VERSION 4
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ */
+#define ZCR_REMOTE_SURFACE_V1_ACK_CONFIGURE_SINCE_VERSION 5
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ */
+#define ZCR_REMOTE_SURFACE_V1_MOVE_SINCE_VERSION 5
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ */
+#define ZCR_REMOTE_SURFACE_V1_SET_ORIENTATION_SINCE_VERSION 6
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ */
+#define ZCR_REMOTE_SURFACE_V1_SET_WINDOW_TYPE_SINCE_VERSION 7
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ */
+#define ZCR_REMOTE_SURFACE_V1_RESIZE_SINCE_VERSION 9
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ */
+#define ZCR_REMOTE_SURFACE_V1_SET_RESIZE_OUTSET_SINCE_VERSION 9
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ */
+#define ZCR_REMOTE_SURFACE_V1_START_MOVE_SINCE_VERSION 10
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ */
+#define ZCR_REMOTE_SURFACE_V1_SET_CAN_MAXIMIZE_SINCE_VERSION 10
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ */
+#define ZCR_REMOTE_SURFACE_V1_UNSET_CAN_MAXIMIZE_SINCE_VERSION 10
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ */
+#define ZCR_REMOTE_SURFACE_V1_SET_MIN_SIZE_SINCE_VERSION 10
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ */
+#define ZCR_REMOTE_SURFACE_V1_SET_MAX_SIZE_SINCE_VERSION 10
+
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ * Sends an close event to the client owning the resource.
+ * @param resource_ The client's resource
+ */
+static inline void
+zcr_remote_surface_v1_send_close(struct wl_resource *resource_)
+{
+ wl_resource_post_event(resource_, ZCR_REMOTE_SURFACE_V1_CLOSE);
+}
+
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ * Sends an state_type_changed event to the client owning the resource.
+ * @param resource_ The client's resource
+ */
+static inline void
+zcr_remote_surface_v1_send_state_type_changed(struct wl_resource *resource_, uint32_t state_type)
+{
+ wl_resource_post_event(resource_, ZCR_REMOTE_SURFACE_V1_STATE_TYPE_CHANGED, state_type);
+}
+
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ * Sends an configure event to the client owning the resource.
+ * @param resource_ The client's resource
+ */
+static inline void
+zcr_remote_surface_v1_send_configure(struct wl_resource *resource_, int32_t origin_offset_x, int32_t origin_offset_y, struct wl_array *states, uint32_t serial)
+{
+ wl_resource_post_event(resource_, ZCR_REMOTE_SURFACE_V1_CONFIGURE, origin_offset_x, origin_offset_y, states, serial);
+}
+
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ * Sends an window_geometry_changed event to the client owning the resource.
+ * @param resource_ The client's resource
+ */
+static inline void
+zcr_remote_surface_v1_send_window_geometry_changed(struct wl_resource *resource_, int32_t x, int32_t y, int32_t width, int32_t height)
+{
+ wl_resource_post_event(resource_, ZCR_REMOTE_SURFACE_V1_WINDOW_GEOMETRY_CHANGED, x, y, width, height);
+}
+
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ * Sends an bounds_changed event to the client owning the resource.
+ * @param resource_ The client's resource
+ */
+static inline void
+zcr_remote_surface_v1_send_bounds_changed(struct wl_resource *resource_, uint32_t workspace_id_hi, uint32_t workspace_id_lo, int32_t x, int32_t y, int32_t width, int32_t height, uint32_t bounds_change_reason)
+{
+ wl_resource_post_event(resource_, ZCR_REMOTE_SURFACE_V1_BOUNDS_CHANGED, workspace_id_hi, workspace_id_lo, x, y, width, height, bounds_change_reason);
+}
+
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ * Sends an drag_started event to the client owning the resource.
+ * @param resource_ The client's resource
+ */
+static inline void
+zcr_remote_surface_v1_send_drag_started(struct wl_resource *resource_, uint32_t direction)
+{
+ wl_resource_post_event(resource_, ZCR_REMOTE_SURFACE_V1_DRAG_STARTED, direction);
+}
+
+/**
+ * @ingroup iface_zcr_remote_surface_v1
+ * Sends an drag_finished event to the client owning the resource.
+ * @param resource_ The client's resource
+ * @param canceled true if the operation was canceled
+ */
+static inline void
+zcr_remote_surface_v1_send_drag_finished(struct wl_resource *resource_, int32_t x, int32_t y, int32_t canceled)
+{
+ wl_resource_post_event(resource_, ZCR_REMOTE_SURFACE_V1_DRAG_FINISHED, x, y, canceled);
+}
+
+/**
+ * @ingroup iface_zcr_notification_surface_v1
+ * @struct zcr_notification_surface_v1_interface
+ */
+struct zcr_notification_surface_v1_interface {
+ /**
+ * Destroy the notification_surface
+ *
+ * Unmap and destroy the notification surface.
+ */
+ void (*destroy)(struct wl_client *client,
+ struct wl_resource *resource);
+};
+
+
+/**
+ * @ingroup iface_zcr_notification_surface_v1
+ */
+#define ZCR_NOTIFICATION_SURFACE_V1_DESTROY_SINCE_VERSION 1
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/chromium/third_party/wayland-protocols/include/protocol/secure-output-unstable-v1-client-protocol.h b/chromium/third_party/wayland-protocols/include/protocol/secure-output-unstable-v1-client-protocol.h
new file mode 100644
index 00000000000..82c0a76aecd
--- /dev/null
+++ b/chromium/third_party/wayland-protocols/include/protocol/secure-output-unstable-v1-client-protocol.h
@@ -0,0 +1,272 @@
+/* Generated by wayland-scanner 1.13.0 */
+
+#ifndef SECURE_OUTPUT_UNSTABLE_V1_CLIENT_PROTOCOL_H
+#define SECURE_OUTPUT_UNSTABLE_V1_CLIENT_PROTOCOL_H
+
+#include <stdint.h>
+#include <stddef.h>
+#include "wayland-client.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @page page_secure_output_unstable_v1 The secure_output_unstable_v1 protocol
+ * Protocol for providing secure output
+ *
+ * @section page_desc_secure_output_unstable_v1 Description
+ *
+ * This protocol specifies a set of interfaces used to prevent surface
+ * contents from appearing in screenshots or from being visible on non-secure
+ * outputs.
+ *
+ * In order to prevent surface contents from appearing in screenshots or from
+ * being visible on non-secure outputs, a client must first bind the global
+ * interface "wp_secure_output" which, if a compositor supports secure output,
+ * is exposed by the registry. Using the bound global object, the client uses
+ * the "get_security" request to instantiate an interface extension for a
+ * wl_surface object. This extended interface will then allow surfaces
+ * to be marked as only visible on secure outputs.
+ *
+ * Warning! The protocol described in this file is experimental and backward
+ * incompatible changes may be made. Backward compatible changes may be added
+ * together with the corresponding interface version bump. Backward
+ * incompatible changes are done by bumping the version number in the protocol
+ * and interface names and resetting the interface version. Once the protocol
+ * is to be declared stable, the 'z' prefix and the version number in the
+ * protocol and interface names are removed and the interface version number is
+ * reset.
+ *
+ * @section page_ifaces_secure_output_unstable_v1 Interfaces
+ * - @subpage page_iface_zcr_secure_output_v1 - secure output
+ * - @subpage page_iface_zcr_security_v1 - security interface to a wl_surface
+ * @section page_copyright_secure_output_unstable_v1 Copyright
+ * <pre>
+ *
+ * Copyright 2016 The Chromium Authors.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ * </pre>
+ */
+struct wl_surface;
+struct zcr_secure_output_v1;
+struct zcr_security_v1;
+
+/**
+ * @page page_iface_zcr_secure_output_v1 zcr_secure_output_v1
+ * @section page_iface_zcr_secure_output_v1_desc Description
+ *
+ * The global interface exposing secure output capabilities is used
+ * to instantiate an interface extension for a wl_surface object.
+ * This extended interface will then allow surfaces to be marked as
+ * as only visible on secure outputs.
+ * @section page_iface_zcr_secure_output_v1_api API
+ * See @ref iface_zcr_secure_output_v1.
+ */
+/**
+ * @defgroup iface_zcr_secure_output_v1 The zcr_secure_output_v1 interface
+ *
+ * The global interface exposing secure output capabilities is used
+ * to instantiate an interface extension for a wl_surface object.
+ * This extended interface will then allow surfaces to be marked as
+ * as only visible on secure outputs.
+ */
+extern const struct wl_interface zcr_secure_output_v1_interface;
+/**
+ * @page page_iface_zcr_security_v1 zcr_security_v1
+ * @section page_iface_zcr_security_v1_desc Description
+ *
+ * An additional interface to a wl_surface object, which allows the
+ * client to specify that a surface should not appear in screenshots
+ * or be visible on non-secure outputs.
+ *
+ * If the wl_surface associated with the security object is destroyed,
+ * the security object becomes inert.
+ *
+ * If the security object is destroyed, the security state is removed
+ * from the wl_surface. The change will be applied on the next
+ * wl_surface.commit.
+ * @section page_iface_zcr_security_v1_api API
+ * See @ref iface_zcr_security_v1.
+ */
+/**
+ * @defgroup iface_zcr_security_v1 The zcr_security_v1 interface
+ *
+ * An additional interface to a wl_surface object, which allows the
+ * client to specify that a surface should not appear in screenshots
+ * or be visible on non-secure outputs.
+ *
+ * If the wl_surface associated with the security object is destroyed,
+ * the security object becomes inert.
+ *
+ * If the security object is destroyed, the security state is removed
+ * from the wl_surface. The change will be applied on the next
+ * wl_surface.commit.
+ */
+extern const struct wl_interface zcr_security_v1_interface;
+
+#ifndef ZCR_SECURE_OUTPUT_V1_ERROR_ENUM
+#define ZCR_SECURE_OUTPUT_V1_ERROR_ENUM
+enum zcr_secure_output_v1_error {
+ /**
+ * the surface already has a security object associated
+ */
+ ZCR_SECURE_OUTPUT_V1_ERROR_SECURITY_EXISTS = 0,
+};
+#endif /* ZCR_SECURE_OUTPUT_V1_ERROR_ENUM */
+
+#define ZCR_SECURE_OUTPUT_V1_DESTROY 0
+#define ZCR_SECURE_OUTPUT_V1_GET_SECURITY 1
+
+
+/**
+ * @ingroup iface_zcr_secure_output_v1
+ */
+#define ZCR_SECURE_OUTPUT_V1_DESTROY_SINCE_VERSION 1
+/**
+ * @ingroup iface_zcr_secure_output_v1
+ */
+#define ZCR_SECURE_OUTPUT_V1_GET_SECURITY_SINCE_VERSION 1
+
+/** @ingroup iface_zcr_secure_output_v1 */
+static inline void
+zcr_secure_output_v1_set_user_data(struct zcr_secure_output_v1 *zcr_secure_output_v1, void *user_data)
+{
+ wl_proxy_set_user_data((struct wl_proxy *) zcr_secure_output_v1, user_data);
+}
+
+/** @ingroup iface_zcr_secure_output_v1 */
+static inline void *
+zcr_secure_output_v1_get_user_data(struct zcr_secure_output_v1 *zcr_secure_output_v1)
+{
+ return wl_proxy_get_user_data((struct wl_proxy *) zcr_secure_output_v1);
+}
+
+static inline uint32_t
+zcr_secure_output_v1_get_version(struct zcr_secure_output_v1 *zcr_secure_output_v1)
+{
+ return wl_proxy_get_version((struct wl_proxy *) zcr_secure_output_v1);
+}
+
+/**
+ * @ingroup iface_zcr_secure_output_v1
+ *
+ * Informs the server that the client will not be using this
+ * protocol object anymore. This does not affect any other objects,
+ * security objects included.
+ */
+static inline void
+zcr_secure_output_v1_destroy(struct zcr_secure_output_v1 *zcr_secure_output_v1)
+{
+ wl_proxy_marshal((struct wl_proxy *) zcr_secure_output_v1,
+ ZCR_SECURE_OUTPUT_V1_DESTROY);
+
+ wl_proxy_destroy((struct wl_proxy *) zcr_secure_output_v1);
+}
+
+/**
+ * @ingroup iface_zcr_secure_output_v1
+ *
+ * Instantiate an interface extension for the given wl_surface to
+ * provide surface security. If the given wl_surface already has
+ * a security object associated, the security_exists protocol error
+ * is raised.
+ */
+static inline struct zcr_security_v1 *
+zcr_secure_output_v1_get_security(struct zcr_secure_output_v1 *zcr_secure_output_v1, struct wl_surface *surface)
+{
+ struct wl_proxy *id;
+
+ id = wl_proxy_marshal_constructor((struct wl_proxy *) zcr_secure_output_v1,
+ ZCR_SECURE_OUTPUT_V1_GET_SECURITY, &zcr_security_v1_interface, NULL, surface);
+
+ return (struct zcr_security_v1 *) id;
+}
+
+#define ZCR_SECURITY_V1_DESTROY 0
+#define ZCR_SECURITY_V1_ONLY_VISIBLE_ON_SECURE_OUTPUT 1
+
+
+/**
+ * @ingroup iface_zcr_security_v1
+ */
+#define ZCR_SECURITY_V1_DESTROY_SINCE_VERSION 1
+/**
+ * @ingroup iface_zcr_security_v1
+ */
+#define ZCR_SECURITY_V1_ONLY_VISIBLE_ON_SECURE_OUTPUT_SINCE_VERSION 1
+
+/** @ingroup iface_zcr_security_v1 */
+static inline void
+zcr_security_v1_set_user_data(struct zcr_security_v1 *zcr_security_v1, void *user_data)
+{
+ wl_proxy_set_user_data((struct wl_proxy *) zcr_security_v1, user_data);
+}
+
+/** @ingroup iface_zcr_security_v1 */
+static inline void *
+zcr_security_v1_get_user_data(struct zcr_security_v1 *zcr_security_v1)
+{
+ return wl_proxy_get_user_data((struct wl_proxy *) zcr_security_v1);
+}
+
+static inline uint32_t
+zcr_security_v1_get_version(struct zcr_security_v1 *zcr_security_v1)
+{
+ return wl_proxy_get_version((struct wl_proxy *) zcr_security_v1);
+}
+
+/**
+ * @ingroup iface_zcr_security_v1
+ *
+ * The associated wl_surface's security state is removed.
+ * The change is applied on the next wl_surface.commit.
+ */
+static inline void
+zcr_security_v1_destroy(struct zcr_security_v1 *zcr_security_v1)
+{
+ wl_proxy_marshal((struct wl_proxy *) zcr_security_v1,
+ ZCR_SECURITY_V1_DESTROY);
+
+ wl_proxy_destroy((struct wl_proxy *) zcr_security_v1);
+}
+
+/**
+ * @ingroup iface_zcr_security_v1
+ *
+ * Constrain visibility of wl_surface contents to secure outputs.
+ * See wp_secure_output for the description.
+ *
+ * The only visible on secure output state is double-buffered state,
+ * and will be applied on the next wl_surface.commit.
+ */
+static inline void
+zcr_security_v1_only_visible_on_secure_output(struct zcr_security_v1 *zcr_security_v1)
+{
+ wl_proxy_marshal((struct wl_proxy *) zcr_security_v1,
+ ZCR_SECURITY_V1_ONLY_VISIBLE_ON_SECURE_OUTPUT);
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/chromium/third_party/wayland-protocols/include/protocol/secure-output-unstable-v1-server-protocol.h b/chromium/third_party/wayland-protocols/include/protocol/secure-output-unstable-v1-server-protocol.h
new file mode 100644
index 00000000000..27c7d90ecdc
--- /dev/null
+++ b/chromium/third_party/wayland-protocols/include/protocol/secure-output-unstable-v1-server-protocol.h
@@ -0,0 +1,219 @@
+/* Generated by wayland-scanner 1.13.0 */
+
+#ifndef SECURE_OUTPUT_UNSTABLE_V1_SERVER_PROTOCOL_H
+#define SECURE_OUTPUT_UNSTABLE_V1_SERVER_PROTOCOL_H
+
+#include <stdint.h>
+#include <stddef.h>
+#include "wayland-server.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct wl_client;
+struct wl_resource;
+
+/**
+ * @page page_secure_output_unstable_v1 The secure_output_unstable_v1 protocol
+ * Protocol for providing secure output
+ *
+ * @section page_desc_secure_output_unstable_v1 Description
+ *
+ * This protocol specifies a set of interfaces used to prevent surface
+ * contents from appearing in screenshots or from being visible on non-secure
+ * outputs.
+ *
+ * In order to prevent surface contents from appearing in screenshots or from
+ * being visible on non-secure outputs, a client must first bind the global
+ * interface "wp_secure_output" which, if a compositor supports secure output,
+ * is exposed by the registry. Using the bound global object, the client uses
+ * the "get_security" request to instantiate an interface extension for a
+ * wl_surface object. This extended interface will then allow surfaces
+ * to be marked as only visible on secure outputs.
+ *
+ * Warning! The protocol described in this file is experimental and backward
+ * incompatible changes may be made. Backward compatible changes may be added
+ * together with the corresponding interface version bump. Backward
+ * incompatible changes are done by bumping the version number in the protocol
+ * and interface names and resetting the interface version. Once the protocol
+ * is to be declared stable, the 'z' prefix and the version number in the
+ * protocol and interface names are removed and the interface version number is
+ * reset.
+ *
+ * @section page_ifaces_secure_output_unstable_v1 Interfaces
+ * - @subpage page_iface_zcr_secure_output_v1 - secure output
+ * - @subpage page_iface_zcr_security_v1 - security interface to a wl_surface
+ * @section page_copyright_secure_output_unstable_v1 Copyright
+ * <pre>
+ *
+ * Copyright 2016 The Chromium Authors.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ * </pre>
+ */
+struct wl_surface;
+struct zcr_secure_output_v1;
+struct zcr_security_v1;
+
+/**
+ * @page page_iface_zcr_secure_output_v1 zcr_secure_output_v1
+ * @section page_iface_zcr_secure_output_v1_desc Description
+ *
+ * The global interface exposing secure output capabilities is used
+ * to instantiate an interface extension for a wl_surface object.
+ * This extended interface will then allow surfaces to be marked as
+ * as only visible on secure outputs.
+ * @section page_iface_zcr_secure_output_v1_api API
+ * See @ref iface_zcr_secure_output_v1.
+ */
+/**
+ * @defgroup iface_zcr_secure_output_v1 The zcr_secure_output_v1 interface
+ *
+ * The global interface exposing secure output capabilities is used
+ * to instantiate an interface extension for a wl_surface object.
+ * This extended interface will then allow surfaces to be marked as
+ * as only visible on secure outputs.
+ */
+extern const struct wl_interface zcr_secure_output_v1_interface;
+/**
+ * @page page_iface_zcr_security_v1 zcr_security_v1
+ * @section page_iface_zcr_security_v1_desc Description
+ *
+ * An additional interface to a wl_surface object, which allows the
+ * client to specify that a surface should not appear in screenshots
+ * or be visible on non-secure outputs.
+ *
+ * If the wl_surface associated with the security object is destroyed,
+ * the security object becomes inert.
+ *
+ * If the security object is destroyed, the security state is removed
+ * from the wl_surface. The change will be applied on the next
+ * wl_surface.commit.
+ * @section page_iface_zcr_security_v1_api API
+ * See @ref iface_zcr_security_v1.
+ */
+/**
+ * @defgroup iface_zcr_security_v1 The zcr_security_v1 interface
+ *
+ * An additional interface to a wl_surface object, which allows the
+ * client to specify that a surface should not appear in screenshots
+ * or be visible on non-secure outputs.
+ *
+ * If the wl_surface associated with the security object is destroyed,
+ * the security object becomes inert.
+ *
+ * If the security object is destroyed, the security state is removed
+ * from the wl_surface. The change will be applied on the next
+ * wl_surface.commit.
+ */
+extern const struct wl_interface zcr_security_v1_interface;
+
+#ifndef ZCR_SECURE_OUTPUT_V1_ERROR_ENUM
+#define ZCR_SECURE_OUTPUT_V1_ERROR_ENUM
+enum zcr_secure_output_v1_error {
+ /**
+ * the surface already has a security object associated
+ */
+ ZCR_SECURE_OUTPUT_V1_ERROR_SECURITY_EXISTS = 0,
+};
+#endif /* ZCR_SECURE_OUTPUT_V1_ERROR_ENUM */
+
+/**
+ * @ingroup iface_zcr_secure_output_v1
+ * @struct zcr_secure_output_v1_interface
+ */
+struct zcr_secure_output_v1_interface {
+ /**
+ * unbind from the secure output interface
+ *
+ * Informs the server that the client will not be using this
+ * protocol object anymore. This does not affect any other objects,
+ * security objects included.
+ */
+ void (*destroy)(struct wl_client *client,
+ struct wl_resource *resource);
+ /**
+ * extend surface interface for security
+ *
+ * Instantiate an interface extension for the given wl_surface to
+ * provide surface security. If the given wl_surface already has a
+ * security object associated, the security_exists protocol error
+ * is raised.
+ * @param id the new security interface id
+ * @param surface the surface
+ */
+ void (*get_security)(struct wl_client *client,
+ struct wl_resource *resource,
+ uint32_t id,
+ struct wl_resource *surface);
+};
+
+
+/**
+ * @ingroup iface_zcr_secure_output_v1
+ */
+#define ZCR_SECURE_OUTPUT_V1_DESTROY_SINCE_VERSION 1
+/**
+ * @ingroup iface_zcr_secure_output_v1
+ */
+#define ZCR_SECURE_OUTPUT_V1_GET_SECURITY_SINCE_VERSION 1
+
+/**
+ * @ingroup iface_zcr_security_v1
+ * @struct zcr_security_v1_interface
+ */
+struct zcr_security_v1_interface {
+ /**
+ * remove security from the surface
+ *
+ * The associated wl_surface's security state is removed. The
+ * change is applied on the next wl_surface.commit.
+ */
+ void (*destroy)(struct wl_client *client,
+ struct wl_resource *resource);
+ /**
+ * set the only visible on secure output state
+ *
+ * Constrain visibility of wl_surface contents to secure outputs.
+ * See wp_secure_output for the description.
+ *
+ * The only visible on secure output state is double-buffered
+ * state, and will be applied on the next wl_surface.commit.
+ */
+ void (*only_visible_on_secure_output)(struct wl_client *client,
+ struct wl_resource *resource);
+};
+
+
+/**
+ * @ingroup iface_zcr_security_v1
+ */
+#define ZCR_SECURITY_V1_DESTROY_SINCE_VERSION 1
+/**
+ * @ingroup iface_zcr_security_v1
+ */
+#define ZCR_SECURITY_V1_ONLY_VISIBLE_ON_SECURE_OUTPUT_SINCE_VERSION 1
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/chromium/third_party/wayland-protocols/include/protocol/stylus-tools-unstable-v1-client-protocol.h b/chromium/third_party/wayland-protocols/include/protocol/stylus-tools-unstable-v1-client-protocol.h
new file mode 100644
index 00000000000..1e1eb25dc5a
--- /dev/null
+++ b/chromium/third_party/wayland-protocols/include/protocol/stylus-tools-unstable-v1-client-protocol.h
@@ -0,0 +1,258 @@
+/* Generated by wayland-scanner 1.13.0 */
+
+#ifndef STYLUS_TOOLS_UNSTABLE_V1_CLIENT_PROTOCOL_H
+#define STYLUS_TOOLS_UNSTABLE_V1_CLIENT_PROTOCOL_H
+
+#include <stdint.h>
+#include <stddef.h>
+#include "wayland-client.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @page page_stylus_tools_unstable_v1 The stylus_tools_unstable_v1 protocol
+ * Protocol for the stylus tools
+ *
+ * @section page_desc_stylus_tools_unstable_v1 Description
+ *
+ * This protocol specifies a set of interfaces used to control the behavior
+ * of stylus tools.
+ *
+ * Warning! The protocol described in this file is experimental and backward
+ * incompatible changes may be made. Backward compatible changes may be added
+ * together with the corresponding interface version bump. Backward
+ * incompatible changes are done by bumping the version number in the protocol
+ * and interface names and resetting the interface version. Once the protocol
+ * is to be declared stable, the 'z' prefix and the version number in the
+ * protocol and interface names are removed and the interface version number is
+ * reset.
+ *
+ * @section page_ifaces_stylus_tools_unstable_v1 Interfaces
+ * - @subpage page_iface_zcr_stylus_tools_v1 - stylus_tools
+ * - @subpage page_iface_zcr_stylus_tool_v1 - stylus_tool interface to a wl_surface
+ * @section page_copyright_stylus_tools_unstable_v1 Copyright
+ * <pre>
+ *
+ * Copyright 2017 The Chromium Authors.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ * </pre>
+ */
+struct wl_surface;
+struct zcr_stylus_tool_v1;
+struct zcr_stylus_tools_v1;
+
+/**
+ * @page page_iface_zcr_stylus_tools_v1 zcr_stylus_tools_v1
+ * @section page_iface_zcr_stylus_tools_v1_desc Description
+ *
+ * The global interface is used to instantiate an interface extension for a
+ * wl_surface object. This extended interface will then allow the client to
+ * control the stylus-related behavior for input device event processing
+ * related to wl_surface.
+ * @section page_iface_zcr_stylus_tools_v1_api API
+ * See @ref iface_zcr_stylus_tools_v1.
+ */
+/**
+ * @defgroup iface_zcr_stylus_tools_v1 The zcr_stylus_tools_v1 interface
+ *
+ * The global interface is used to instantiate an interface extension for a
+ * wl_surface object. This extended interface will then allow the client to
+ * control the stylus-related behavior for input device event processing
+ * related to wl_surface.
+ */
+extern const struct wl_interface zcr_stylus_tools_v1_interface;
+/**
+ * @page page_iface_zcr_stylus_tool_v1 zcr_stylus_tool_v1
+ * @section page_iface_zcr_stylus_tool_v1_desc Description
+ *
+ * An additional interface to a wl_surface object, which allows the
+ * client to control the behavior of stylus tools.
+ *
+ * If the wl_surface associated with the stylus_tool object is destroyed,
+ * the stylus_tool object becomes inert.
+ *
+ * If the stylus_tool object is destroyed, the stylus_tool state is removed
+ * from the wl_surface. The change will be applied on the next
+ * wl_surface.commit.
+ * @section page_iface_zcr_stylus_tool_v1_api API
+ * See @ref iface_zcr_stylus_tool_v1.
+ */
+/**
+ * @defgroup iface_zcr_stylus_tool_v1 The zcr_stylus_tool_v1 interface
+ *
+ * An additional interface to a wl_surface object, which allows the
+ * client to control the behavior of stylus tools.
+ *
+ * If the wl_surface associated with the stylus_tool object is destroyed,
+ * the stylus_tool object becomes inert.
+ *
+ * If the stylus_tool object is destroyed, the stylus_tool state is removed
+ * from the wl_surface. The change will be applied on the next
+ * wl_surface.commit.
+ */
+extern const struct wl_interface zcr_stylus_tool_v1_interface;
+
+#ifndef ZCR_STYLUS_TOOLS_V1_ERROR_ENUM
+#define ZCR_STYLUS_TOOLS_V1_ERROR_ENUM
+enum zcr_stylus_tools_v1_error {
+ /**
+ * the surface already has a stylus_tool object associated
+ */
+ ZCR_STYLUS_TOOLS_V1_ERROR_STYLUS_TOOL_EXISTS = 0,
+};
+#endif /* ZCR_STYLUS_TOOLS_V1_ERROR_ENUM */
+
+#define ZCR_STYLUS_TOOLS_V1_DESTROY 0
+#define ZCR_STYLUS_TOOLS_V1_GET_STYLUS_TOOL 1
+
+
+/**
+ * @ingroup iface_zcr_stylus_tools_v1
+ */
+#define ZCR_STYLUS_TOOLS_V1_DESTROY_SINCE_VERSION 1
+/**
+ * @ingroup iface_zcr_stylus_tools_v1
+ */
+#define ZCR_STYLUS_TOOLS_V1_GET_STYLUS_TOOL_SINCE_VERSION 1
+
+/** @ingroup iface_zcr_stylus_tools_v1 */
+static inline void
+zcr_stylus_tools_v1_set_user_data(struct zcr_stylus_tools_v1 *zcr_stylus_tools_v1, void *user_data)
+{
+ wl_proxy_set_user_data((struct wl_proxy *) zcr_stylus_tools_v1, user_data);
+}
+
+/** @ingroup iface_zcr_stylus_tools_v1 */
+static inline void *
+zcr_stylus_tools_v1_get_user_data(struct zcr_stylus_tools_v1 *zcr_stylus_tools_v1)
+{
+ return wl_proxy_get_user_data((struct wl_proxy *) zcr_stylus_tools_v1);
+}
+
+static inline uint32_t
+zcr_stylus_tools_v1_get_version(struct zcr_stylus_tools_v1 *zcr_stylus_tools_v1)
+{
+ return wl_proxy_get_version((struct wl_proxy *) zcr_stylus_tools_v1);
+}
+
+/**
+ * @ingroup iface_zcr_stylus_tools_v1
+ *
+ * Informs the server that the client will not be using this
+ * protocol object anymore. This does not affect any other objects,
+ * stylus_tool objects included.
+ */
+static inline void
+zcr_stylus_tools_v1_destroy(struct zcr_stylus_tools_v1 *zcr_stylus_tools_v1)
+{
+ wl_proxy_marshal((struct wl_proxy *) zcr_stylus_tools_v1,
+ ZCR_STYLUS_TOOLS_V1_DESTROY);
+
+ wl_proxy_destroy((struct wl_proxy *) zcr_stylus_tools_v1);
+}
+
+/**
+ * @ingroup iface_zcr_stylus_tools_v1
+ *
+ * Instantiate an interface extension for the given wl_surface to
+ * provide access to the stylus tools features. If the given
+ * wl_surface already has an stylus_tool object associated,
+ * the stylus_tool_exists protocol protocol error is raised.
+ */
+static inline struct zcr_stylus_tool_v1 *
+zcr_stylus_tools_v1_get_stylus_tool(struct zcr_stylus_tools_v1 *zcr_stylus_tools_v1, struct wl_surface *surface)
+{
+ struct wl_proxy *id;
+
+ id = wl_proxy_marshal_constructor((struct wl_proxy *) zcr_stylus_tools_v1,
+ ZCR_STYLUS_TOOLS_V1_GET_STYLUS_TOOL, &zcr_stylus_tool_v1_interface, NULL, surface);
+
+ return (struct zcr_stylus_tool_v1 *) id;
+}
+
+#define ZCR_STYLUS_TOOL_V1_DESTROY 0
+#define ZCR_STYLUS_TOOL_V1_SET_STYLUS_ONLY 1
+
+
+/**
+ * @ingroup iface_zcr_stylus_tool_v1
+ */
+#define ZCR_STYLUS_TOOL_V1_DESTROY_SINCE_VERSION 1
+/**
+ * @ingroup iface_zcr_stylus_tool_v1
+ */
+#define ZCR_STYLUS_TOOL_V1_SET_STYLUS_ONLY_SINCE_VERSION 1
+
+/** @ingroup iface_zcr_stylus_tool_v1 */
+static inline void
+zcr_stylus_tool_v1_set_user_data(struct zcr_stylus_tool_v1 *zcr_stylus_tool_v1, void *user_data)
+{
+ wl_proxy_set_user_data((struct wl_proxy *) zcr_stylus_tool_v1, user_data);
+}
+
+/** @ingroup iface_zcr_stylus_tool_v1 */
+static inline void *
+zcr_stylus_tool_v1_get_user_data(struct zcr_stylus_tool_v1 *zcr_stylus_tool_v1)
+{
+ return wl_proxy_get_user_data((struct wl_proxy *) zcr_stylus_tool_v1);
+}
+
+static inline uint32_t
+zcr_stylus_tool_v1_get_version(struct zcr_stylus_tool_v1 *zcr_stylus_tool_v1)
+{
+ return wl_proxy_get_version((struct wl_proxy *) zcr_stylus_tool_v1);
+}
+
+/**
+ * @ingroup iface_zcr_stylus_tool_v1
+ *
+ * The associated wl_surface's stylus_tool state is removed.
+ * The change is applied on the next wl_surface.commit.
+ */
+static inline void
+zcr_stylus_tool_v1_destroy(struct zcr_stylus_tool_v1 *zcr_stylus_tool_v1)
+{
+ wl_proxy_marshal((struct wl_proxy *) zcr_stylus_tool_v1,
+ ZCR_STYLUS_TOOL_V1_DESTROY);
+
+ wl_proxy_destroy((struct wl_proxy *) zcr_stylus_tool_v1);
+}
+
+/**
+ * @ingroup iface_zcr_stylus_tool_v1
+ *
+ * Enables the "stylus-only" mode for input device event processing
+ * related to wl_surface.
+ */
+static inline void
+zcr_stylus_tool_v1_set_stylus_only(struct zcr_stylus_tool_v1 *zcr_stylus_tool_v1)
+{
+ wl_proxy_marshal((struct wl_proxy *) zcr_stylus_tool_v1,
+ ZCR_STYLUS_TOOL_V1_SET_STYLUS_ONLY);
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/chromium/third_party/wayland-protocols/include/protocol/stylus-tools-unstable-v1-server-protocol.h b/chromium/third_party/wayland-protocols/include/protocol/stylus-tools-unstable-v1-server-protocol.h
new file mode 100644
index 00000000000..b1b117e206e
--- /dev/null
+++ b/chromium/third_party/wayland-protocols/include/protocol/stylus-tools-unstable-v1-server-protocol.h
@@ -0,0 +1,205 @@
+/* Generated by wayland-scanner 1.13.0 */
+
+#ifndef STYLUS_TOOLS_UNSTABLE_V1_SERVER_PROTOCOL_H
+#define STYLUS_TOOLS_UNSTABLE_V1_SERVER_PROTOCOL_H
+
+#include <stdint.h>
+#include <stddef.h>
+#include "wayland-server.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct wl_client;
+struct wl_resource;
+
+/**
+ * @page page_stylus_tools_unstable_v1 The stylus_tools_unstable_v1 protocol
+ * Protocol for the stylus tools
+ *
+ * @section page_desc_stylus_tools_unstable_v1 Description
+ *
+ * This protocol specifies a set of interfaces used to control the behavior
+ * of stylus tools.
+ *
+ * Warning! The protocol described in this file is experimental and backward
+ * incompatible changes may be made. Backward compatible changes may be added
+ * together with the corresponding interface version bump. Backward
+ * incompatible changes are done by bumping the version number in the protocol
+ * and interface names and resetting the interface version. Once the protocol
+ * is to be declared stable, the 'z' prefix and the version number in the
+ * protocol and interface names are removed and the interface version number is
+ * reset.
+ *
+ * @section page_ifaces_stylus_tools_unstable_v1 Interfaces
+ * - @subpage page_iface_zcr_stylus_tools_v1 - stylus_tools
+ * - @subpage page_iface_zcr_stylus_tool_v1 - stylus_tool interface to a wl_surface
+ * @section page_copyright_stylus_tools_unstable_v1 Copyright
+ * <pre>
+ *
+ * Copyright 2017 The Chromium Authors.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ * </pre>
+ */
+struct wl_surface;
+struct zcr_stylus_tool_v1;
+struct zcr_stylus_tools_v1;
+
+/**
+ * @page page_iface_zcr_stylus_tools_v1 zcr_stylus_tools_v1
+ * @section page_iface_zcr_stylus_tools_v1_desc Description
+ *
+ * The global interface is used to instantiate an interface extension for a
+ * wl_surface object. This extended interface will then allow the client to
+ * control the stylus-related behavior for input device event processing
+ * related to wl_surface.
+ * @section page_iface_zcr_stylus_tools_v1_api API
+ * See @ref iface_zcr_stylus_tools_v1.
+ */
+/**
+ * @defgroup iface_zcr_stylus_tools_v1 The zcr_stylus_tools_v1 interface
+ *
+ * The global interface is used to instantiate an interface extension for a
+ * wl_surface object. This extended interface will then allow the client to
+ * control the stylus-related behavior for input device event processing
+ * related to wl_surface.
+ */
+extern const struct wl_interface zcr_stylus_tools_v1_interface;
+/**
+ * @page page_iface_zcr_stylus_tool_v1 zcr_stylus_tool_v1
+ * @section page_iface_zcr_stylus_tool_v1_desc Description
+ *
+ * An additional interface to a wl_surface object, which allows the
+ * client to control the behavior of stylus tools.
+ *
+ * If the wl_surface associated with the stylus_tool object is destroyed,
+ * the stylus_tool object becomes inert.
+ *
+ * If the stylus_tool object is destroyed, the stylus_tool state is removed
+ * from the wl_surface. The change will be applied on the next
+ * wl_surface.commit.
+ * @section page_iface_zcr_stylus_tool_v1_api API
+ * See @ref iface_zcr_stylus_tool_v1.
+ */
+/**
+ * @defgroup iface_zcr_stylus_tool_v1 The zcr_stylus_tool_v1 interface
+ *
+ * An additional interface to a wl_surface object, which allows the
+ * client to control the behavior of stylus tools.
+ *
+ * If the wl_surface associated with the stylus_tool object is destroyed,
+ * the stylus_tool object becomes inert.
+ *
+ * If the stylus_tool object is destroyed, the stylus_tool state is removed
+ * from the wl_surface. The change will be applied on the next
+ * wl_surface.commit.
+ */
+extern const struct wl_interface zcr_stylus_tool_v1_interface;
+
+#ifndef ZCR_STYLUS_TOOLS_V1_ERROR_ENUM
+#define ZCR_STYLUS_TOOLS_V1_ERROR_ENUM
+enum zcr_stylus_tools_v1_error {
+ /**
+ * the surface already has a stylus_tool object associated
+ */
+ ZCR_STYLUS_TOOLS_V1_ERROR_STYLUS_TOOL_EXISTS = 0,
+};
+#endif /* ZCR_STYLUS_TOOLS_V1_ERROR_ENUM */
+
+/**
+ * @ingroup iface_zcr_stylus_tools_v1
+ * @struct zcr_stylus_tools_v1_interface
+ */
+struct zcr_stylus_tools_v1_interface {
+ /**
+ * unbind from the stylus_tools interface
+ *
+ * Informs the server that the client will not be using this
+ * protocol object anymore. This does not affect any other objects,
+ * stylus_tool objects included.
+ */
+ void (*destroy)(struct wl_client *client,
+ struct wl_resource *resource);
+ /**
+ * extend surface interface for stylus_tool
+ *
+ * Instantiate an interface extension for the given wl_surface to
+ * provide access to the stylus tools features. If the given
+ * wl_surface already has an stylus_tool object associated, the
+ * stylus_tool_exists protocol protocol error is raised.
+ * @param id the new stylus_tool interface id
+ * @param surface the surface
+ */
+ void (*get_stylus_tool)(struct wl_client *client,
+ struct wl_resource *resource,
+ uint32_t id,
+ struct wl_resource *surface);
+};
+
+
+/**
+ * @ingroup iface_zcr_stylus_tools_v1
+ */
+#define ZCR_STYLUS_TOOLS_V1_DESTROY_SINCE_VERSION 1
+/**
+ * @ingroup iface_zcr_stylus_tools_v1
+ */
+#define ZCR_STYLUS_TOOLS_V1_GET_STYLUS_TOOL_SINCE_VERSION 1
+
+/**
+ * @ingroup iface_zcr_stylus_tool_v1
+ * @struct zcr_stylus_tool_v1_interface
+ */
+struct zcr_stylus_tool_v1_interface {
+ /**
+ * remove stylus_tool from the surface
+ *
+ * The associated wl_surface's stylus_tool state is removed. The
+ * change is applied on the next wl_surface.commit.
+ */
+ void (*destroy)(struct wl_client *client,
+ struct wl_resource *resource);
+ /**
+ * Set the stylus-only mode
+ *
+ * Enables the "stylus-only" mode for input device event
+ * processing related to wl_surface.
+ */
+ void (*set_stylus_only)(struct wl_client *client,
+ struct wl_resource *resource);
+};
+
+
+/**
+ * @ingroup iface_zcr_stylus_tool_v1
+ */
+#define ZCR_STYLUS_TOOL_V1_DESTROY_SINCE_VERSION 1
+/**
+ * @ingroup iface_zcr_stylus_tool_v1
+ */
+#define ZCR_STYLUS_TOOL_V1_SET_STYLUS_ONLY_SINCE_VERSION 1
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/chromium/third_party/wayland-protocols/include/protocol/stylus-unstable-v2-client-protocol.h b/chromium/third_party/wayland-protocols/include/protocol/stylus-unstable-v2-client-protocol.h
new file mode 100644
index 00000000000..0de3255e25b
--- /dev/null
+++ b/chromium/third_party/wayland-protocols/include/protocol/stylus-unstable-v2-client-protocol.h
@@ -0,0 +1,316 @@
+/* Generated by wayland-scanner 1.13.0 */
+
+#ifndef STYLUS_UNSTABLE_V2_CLIENT_PROTOCOL_H
+#define STYLUS_UNSTABLE_V2_CLIENT_PROTOCOL_H
+
+#include <stdint.h>
+#include <stddef.h>
+#include "wayland-client.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @page page_stylus_unstable_v2 The stylus_unstable_v2 protocol
+ * @section page_ifaces_stylus_unstable_v2 Interfaces
+ * - @subpage page_iface_zcr_stylus_v2 - extends wl_touch with events for on-screen stylus
+ * - @subpage page_iface_zcr_touch_stylus_v2 - stylus extension for touch
+ * @section page_copyright_stylus_unstable_v2 Copyright
+ * <pre>
+ *
+ * Copyright 2016 The Chromium Authors.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ * </pre>
+ */
+struct wl_touch;
+struct zcr_stylus_v2;
+struct zcr_touch_stylus_v2;
+
+/**
+ * @page page_iface_zcr_stylus_v2 zcr_stylus_v2
+ * @section page_iface_zcr_stylus_v2_desc Description
+ *
+ * Allows a wl_touch to report stylus specific information. The client can
+ * interpret the on-screen stylus like any other touch event, and use
+ * this protocol to obtain detail information about the type of stylus,
+ * as well as the force and tilt of the tool.
+ *
+ * These events are to be fired by the server within the same frame as other
+ * wl_touch events.
+ *
+ * Warning! The protocol described in this file is experimental and
+ * backward incompatible changes may be made. Backward compatible changes
+ * may be added together with the corresponding uinterface version bump.
+ * Backward incompatible changes are done by bumping the version number in
+ * the protocol and uinterface names and resetting the interface version.
+ * Once the protocol is to be declared stable, the 'z' prefix and the
+ * version number in the protocol and interface names are removed and the
+ * interface version number is reset.
+ * @section page_iface_zcr_stylus_v2_api API
+ * See @ref iface_zcr_stylus_v2.
+ */
+/**
+ * @defgroup iface_zcr_stylus_v2 The zcr_stylus_v2 interface
+ *
+ * Allows a wl_touch to report stylus specific information. The client can
+ * interpret the on-screen stylus like any other touch event, and use
+ * this protocol to obtain detail information about the type of stylus,
+ * as well as the force and tilt of the tool.
+ *
+ * These events are to be fired by the server within the same frame as other
+ * wl_touch events.
+ *
+ * Warning! The protocol described in this file is experimental and
+ * backward incompatible changes may be made. Backward compatible changes
+ * may be added together with the corresponding uinterface version bump.
+ * Backward incompatible changes are done by bumping the version number in
+ * the protocol and uinterface names and resetting the interface version.
+ * Once the protocol is to be declared stable, the 'z' prefix and the
+ * version number in the protocol and interface names are removed and the
+ * interface version number is reset.
+ */
+extern const struct wl_interface zcr_stylus_v2_interface;
+/**
+ * @page page_iface_zcr_touch_stylus_v2 zcr_touch_stylus_v2
+ * @section page_iface_zcr_touch_stylus_v2_desc Description
+ *
+ * The zcr_touch_stylus_v1 interface extends the wl_touch interface with
+ * events to describe details about a stylus.
+ * @section page_iface_zcr_touch_stylus_v2_api API
+ * See @ref iface_zcr_touch_stylus_v2.
+ */
+/**
+ * @defgroup iface_zcr_touch_stylus_v2 The zcr_touch_stylus_v2 interface
+ *
+ * The zcr_touch_stylus_v1 interface extends the wl_touch interface with
+ * events to describe details about a stylus.
+ */
+extern const struct wl_interface zcr_touch_stylus_v2_interface;
+
+#ifndef ZCR_STYLUS_V2_ERROR_ENUM
+#define ZCR_STYLUS_V2_ERROR_ENUM
+enum zcr_stylus_v2_error {
+ /**
+ * the touch already has a touch_stylus object associated
+ */
+ ZCR_STYLUS_V2_ERROR_TOUCH_STYLUS_EXISTS = 0,
+};
+#endif /* ZCR_STYLUS_V2_ERROR_ENUM */
+
+#define ZCR_STYLUS_V2_GET_TOUCH_STYLUS 0
+
+
+/**
+ * @ingroup iface_zcr_stylus_v2
+ */
+#define ZCR_STYLUS_V2_GET_TOUCH_STYLUS_SINCE_VERSION 1
+
+/** @ingroup iface_zcr_stylus_v2 */
+static inline void
+zcr_stylus_v2_set_user_data(struct zcr_stylus_v2 *zcr_stylus_v2, void *user_data)
+{
+ wl_proxy_set_user_data((struct wl_proxy *) zcr_stylus_v2, user_data);
+}
+
+/** @ingroup iface_zcr_stylus_v2 */
+static inline void *
+zcr_stylus_v2_get_user_data(struct zcr_stylus_v2 *zcr_stylus_v2)
+{
+ return wl_proxy_get_user_data((struct wl_proxy *) zcr_stylus_v2);
+}
+
+static inline uint32_t
+zcr_stylus_v2_get_version(struct zcr_stylus_v2 *zcr_stylus_v2)
+{
+ return wl_proxy_get_version((struct wl_proxy *) zcr_stylus_v2);
+}
+
+/** @ingroup iface_zcr_stylus_v2 */
+static inline void
+zcr_stylus_v2_destroy(struct zcr_stylus_v2 *zcr_stylus_v2)
+{
+ wl_proxy_destroy((struct wl_proxy *) zcr_stylus_v2);
+}
+
+/**
+ * @ingroup iface_zcr_stylus_v2
+ *
+ * Create touch_stylus object. See zcr_touch_stylus_v1 interface for
+ * details. If the given wl_touch already has a touch_stylus object
+ * associated, the touch_stylus_exists protocol error is raised.
+ */
+static inline struct zcr_touch_stylus_v2 *
+zcr_stylus_v2_get_touch_stylus(struct zcr_stylus_v2 *zcr_stylus_v2, struct wl_touch *touch)
+{
+ struct wl_proxy *id;
+
+ id = wl_proxy_marshal_constructor((struct wl_proxy *) zcr_stylus_v2,
+ ZCR_STYLUS_V2_GET_TOUCH_STYLUS, &zcr_touch_stylus_v2_interface, NULL, touch);
+
+ return (struct zcr_touch_stylus_v2 *) id;
+}
+
+#ifndef ZCR_TOUCH_STYLUS_V2_TOOL_TYPE_ENUM
+#define ZCR_TOUCH_STYLUS_V2_TOOL_TYPE_ENUM
+/**
+ * @ingroup iface_zcr_touch_stylus_v2
+ * tool type of device.
+ */
+enum zcr_touch_stylus_v2_tool_type {
+ /**
+ * Touch
+ */
+ ZCR_TOUCH_STYLUS_V2_TOOL_TYPE_TOUCH = 1,
+ /**
+ * Pen
+ */
+ ZCR_TOUCH_STYLUS_V2_TOOL_TYPE_PEN = 2,
+ /**
+ * Eraser
+ */
+ ZCR_TOUCH_STYLUS_V2_TOOL_TYPE_ERASER = 3,
+};
+#endif /* ZCR_TOUCH_STYLUS_V2_TOOL_TYPE_ENUM */
+
+/**
+ * @ingroup iface_zcr_touch_stylus_v2
+ * @struct zcr_touch_stylus_v2_listener
+ */
+struct zcr_touch_stylus_v2_listener {
+ /**
+ * sets tool type of touch
+ *
+ * Notification that the user is using a tool type other than
+ * touch. There can only be one tool in use at a time. This event
+ * is sent in the same frame as the wl_touch.down event. The tool
+ * type cannot change while a touch is being reported.
+ * @param id touch id
+ * @param type type of tool in use
+ */
+ void (*tool)(void *data,
+ struct zcr_touch_stylus_v2 *zcr_touch_stylus_v2,
+ uint32_t id,
+ uint32_t type);
+ /**
+ * force change event
+ *
+ * Notification of a change in physical force on the surface of
+ * the screen. The force is calibrated and normalized to the 0 to 1
+ * range.
+ * @param time timestamp with millisecond granularity
+ * @param id touch id
+ * @param force new value of force
+ */
+ void (*force)(void *data,
+ struct zcr_touch_stylus_v2 *zcr_touch_stylus_v2,
+ uint32_t time,
+ uint32_t id,
+ wl_fixed_t force);
+ /**
+ * tilt change event
+ *
+ * Notification of a change in tilt of a stylus.
+ *
+ * Measured from surface normal as plane angle in degrees, values
+ * lie in [-90,90]. A positive x is to the right and a positive y
+ * is towards the user.
+ * @param time timestamp with millisecond granularity
+ * @param id touch id
+ * @param tilt_x tilt in x direction
+ * @param tilt_y tilt in y direction
+ */
+ void (*tilt)(void *data,
+ struct zcr_touch_stylus_v2 *zcr_touch_stylus_v2,
+ uint32_t time,
+ uint32_t id,
+ wl_fixed_t tilt_x,
+ wl_fixed_t tilt_y);
+};
+
+/**
+ * @ingroup iface_zcr_touch_stylus_v2
+ */
+static inline int
+zcr_touch_stylus_v2_add_listener(struct zcr_touch_stylus_v2 *zcr_touch_stylus_v2,
+ const struct zcr_touch_stylus_v2_listener *listener, void *data)
+{
+ return wl_proxy_add_listener((struct wl_proxy *) zcr_touch_stylus_v2,
+ (void (**)(void)) listener, data);
+}
+
+#define ZCR_TOUCH_STYLUS_V2_DESTROY 0
+
+/**
+ * @ingroup iface_zcr_touch_stylus_v2
+ */
+#define ZCR_TOUCH_STYLUS_V2_TOOL_SINCE_VERSION 1
+/**
+ * @ingroup iface_zcr_touch_stylus_v2
+ */
+#define ZCR_TOUCH_STYLUS_V2_FORCE_SINCE_VERSION 1
+/**
+ * @ingroup iface_zcr_touch_stylus_v2
+ */
+#define ZCR_TOUCH_STYLUS_V2_TILT_SINCE_VERSION 1
+
+/**
+ * @ingroup iface_zcr_touch_stylus_v2
+ */
+#define ZCR_TOUCH_STYLUS_V2_DESTROY_SINCE_VERSION 1
+
+/** @ingroup iface_zcr_touch_stylus_v2 */
+static inline void
+zcr_touch_stylus_v2_set_user_data(struct zcr_touch_stylus_v2 *zcr_touch_stylus_v2, void *user_data)
+{
+ wl_proxy_set_user_data((struct wl_proxy *) zcr_touch_stylus_v2, user_data);
+}
+
+/** @ingroup iface_zcr_touch_stylus_v2 */
+static inline void *
+zcr_touch_stylus_v2_get_user_data(struct zcr_touch_stylus_v2 *zcr_touch_stylus_v2)
+{
+ return wl_proxy_get_user_data((struct wl_proxy *) zcr_touch_stylus_v2);
+}
+
+static inline uint32_t
+zcr_touch_stylus_v2_get_version(struct zcr_touch_stylus_v2 *zcr_touch_stylus_v2)
+{
+ return wl_proxy_get_version((struct wl_proxy *) zcr_touch_stylus_v2);
+}
+
+/**
+ * @ingroup iface_zcr_touch_stylus_v2
+ */
+static inline void
+zcr_touch_stylus_v2_destroy(struct zcr_touch_stylus_v2 *zcr_touch_stylus_v2)
+{
+ wl_proxy_marshal((struct wl_proxy *) zcr_touch_stylus_v2,
+ ZCR_TOUCH_STYLUS_V2_DESTROY);
+
+ wl_proxy_destroy((struct wl_proxy *) zcr_touch_stylus_v2);
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/chromium/third_party/wayland-protocols/include/protocol/stylus-unstable-v2-server-protocol.h b/chromium/third_party/wayland-protocols/include/protocol/stylus-unstable-v2-server-protocol.h
new file mode 100644
index 00000000000..bd951b66b09
--- /dev/null
+++ b/chromium/third_party/wayland-protocols/include/protocol/stylus-unstable-v2-server-protocol.h
@@ -0,0 +1,251 @@
+/* Generated by wayland-scanner 1.13.0 */
+
+#ifndef STYLUS_UNSTABLE_V2_SERVER_PROTOCOL_H
+#define STYLUS_UNSTABLE_V2_SERVER_PROTOCOL_H
+
+#include <stdint.h>
+#include <stddef.h>
+#include "wayland-server.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct wl_client;
+struct wl_resource;
+
+/**
+ * @page page_stylus_unstable_v2 The stylus_unstable_v2 protocol
+ * @section page_ifaces_stylus_unstable_v2 Interfaces
+ * - @subpage page_iface_zcr_stylus_v2 - extends wl_touch with events for on-screen stylus
+ * - @subpage page_iface_zcr_touch_stylus_v2 - stylus extension for touch
+ * @section page_copyright_stylus_unstable_v2 Copyright
+ * <pre>
+ *
+ * Copyright 2016 The Chromium Authors.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ * </pre>
+ */
+struct wl_touch;
+struct zcr_stylus_v2;
+struct zcr_touch_stylus_v2;
+
+/**
+ * @page page_iface_zcr_stylus_v2 zcr_stylus_v2
+ * @section page_iface_zcr_stylus_v2_desc Description
+ *
+ * Allows a wl_touch to report stylus specific information. The client can
+ * interpret the on-screen stylus like any other touch event, and use
+ * this protocol to obtain detail information about the type of stylus,
+ * as well as the force and tilt of the tool.
+ *
+ * These events are to be fired by the server within the same frame as other
+ * wl_touch events.
+ *
+ * Warning! The protocol described in this file is experimental and
+ * backward incompatible changes may be made. Backward compatible changes
+ * may be added together with the corresponding uinterface version bump.
+ * Backward incompatible changes are done by bumping the version number in
+ * the protocol and uinterface names and resetting the interface version.
+ * Once the protocol is to be declared stable, the 'z' prefix and the
+ * version number in the protocol and interface names are removed and the
+ * interface version number is reset.
+ * @section page_iface_zcr_stylus_v2_api API
+ * See @ref iface_zcr_stylus_v2.
+ */
+/**
+ * @defgroup iface_zcr_stylus_v2 The zcr_stylus_v2 interface
+ *
+ * Allows a wl_touch to report stylus specific information. The client can
+ * interpret the on-screen stylus like any other touch event, and use
+ * this protocol to obtain detail information about the type of stylus,
+ * as well as the force and tilt of the tool.
+ *
+ * These events are to be fired by the server within the same frame as other
+ * wl_touch events.
+ *
+ * Warning! The protocol described in this file is experimental and
+ * backward incompatible changes may be made. Backward compatible changes
+ * may be added together with the corresponding uinterface version bump.
+ * Backward incompatible changes are done by bumping the version number in
+ * the protocol and uinterface names and resetting the interface version.
+ * Once the protocol is to be declared stable, the 'z' prefix and the
+ * version number in the protocol and interface names are removed and the
+ * interface version number is reset.
+ */
+extern const struct wl_interface zcr_stylus_v2_interface;
+/**
+ * @page page_iface_zcr_touch_stylus_v2 zcr_touch_stylus_v2
+ * @section page_iface_zcr_touch_stylus_v2_desc Description
+ *
+ * The zcr_touch_stylus_v1 interface extends the wl_touch interface with
+ * events to describe details about a stylus.
+ * @section page_iface_zcr_touch_stylus_v2_api API
+ * See @ref iface_zcr_touch_stylus_v2.
+ */
+/**
+ * @defgroup iface_zcr_touch_stylus_v2 The zcr_touch_stylus_v2 interface
+ *
+ * The zcr_touch_stylus_v1 interface extends the wl_touch interface with
+ * events to describe details about a stylus.
+ */
+extern const struct wl_interface zcr_touch_stylus_v2_interface;
+
+#ifndef ZCR_STYLUS_V2_ERROR_ENUM
+#define ZCR_STYLUS_V2_ERROR_ENUM
+enum zcr_stylus_v2_error {
+ /**
+ * the touch already has a touch_stylus object associated
+ */
+ ZCR_STYLUS_V2_ERROR_TOUCH_STYLUS_EXISTS = 0,
+};
+#endif /* ZCR_STYLUS_V2_ERROR_ENUM */
+
+/**
+ * @ingroup iface_zcr_stylus_v2
+ * @struct zcr_stylus_v2_interface
+ */
+struct zcr_stylus_v2_interface {
+ /**
+ * get stylus interface for touch
+ *
+ * Create touch_stylus object. See zcr_touch_stylus_v1 interface
+ * for details. If the given wl_touch already has a touch_stylus
+ * object associated, the touch_stylus_exists protocol error is
+ * raised.
+ */
+ void (*get_touch_stylus)(struct wl_client *client,
+ struct wl_resource *resource,
+ uint32_t id,
+ struct wl_resource *touch);
+};
+
+
+/**
+ * @ingroup iface_zcr_stylus_v2
+ */
+#define ZCR_STYLUS_V2_GET_TOUCH_STYLUS_SINCE_VERSION 1
+
+#ifndef ZCR_TOUCH_STYLUS_V2_TOOL_TYPE_ENUM
+#define ZCR_TOUCH_STYLUS_V2_TOOL_TYPE_ENUM
+/**
+ * @ingroup iface_zcr_touch_stylus_v2
+ * tool type of device.
+ */
+enum zcr_touch_stylus_v2_tool_type {
+ /**
+ * Touch
+ */
+ ZCR_TOUCH_STYLUS_V2_TOOL_TYPE_TOUCH = 1,
+ /**
+ * Pen
+ */
+ ZCR_TOUCH_STYLUS_V2_TOOL_TYPE_PEN = 2,
+ /**
+ * Eraser
+ */
+ ZCR_TOUCH_STYLUS_V2_TOOL_TYPE_ERASER = 3,
+};
+#endif /* ZCR_TOUCH_STYLUS_V2_TOOL_TYPE_ENUM */
+
+/**
+ * @ingroup iface_zcr_touch_stylus_v2
+ * @struct zcr_touch_stylus_v2_interface
+ */
+struct zcr_touch_stylus_v2_interface {
+ /**
+ * destroy stylus object
+ *
+ *
+ */
+ void (*destroy)(struct wl_client *client,
+ struct wl_resource *resource);
+};
+
+#define ZCR_TOUCH_STYLUS_V2_TOOL 0
+#define ZCR_TOUCH_STYLUS_V2_FORCE 1
+#define ZCR_TOUCH_STYLUS_V2_TILT 2
+
+/**
+ * @ingroup iface_zcr_touch_stylus_v2
+ */
+#define ZCR_TOUCH_STYLUS_V2_TOOL_SINCE_VERSION 1
+/**
+ * @ingroup iface_zcr_touch_stylus_v2
+ */
+#define ZCR_TOUCH_STYLUS_V2_FORCE_SINCE_VERSION 1
+/**
+ * @ingroup iface_zcr_touch_stylus_v2
+ */
+#define ZCR_TOUCH_STYLUS_V2_TILT_SINCE_VERSION 1
+
+/**
+ * @ingroup iface_zcr_touch_stylus_v2
+ */
+#define ZCR_TOUCH_STYLUS_V2_DESTROY_SINCE_VERSION 1
+
+/**
+ * @ingroup iface_zcr_touch_stylus_v2
+ * Sends an tool event to the client owning the resource.
+ * @param resource_ The client's resource
+ * @param id touch id
+ * @param type type of tool in use
+ */
+static inline void
+zcr_touch_stylus_v2_send_tool(struct wl_resource *resource_, uint32_t id, uint32_t type)
+{
+ wl_resource_post_event(resource_, ZCR_TOUCH_STYLUS_V2_TOOL, id, type);
+}
+
+/**
+ * @ingroup iface_zcr_touch_stylus_v2
+ * Sends an force event to the client owning the resource.
+ * @param resource_ The client's resource
+ * @param time timestamp with millisecond granularity
+ * @param id touch id
+ * @param force new value of force
+ */
+static inline void
+zcr_touch_stylus_v2_send_force(struct wl_resource *resource_, uint32_t time, uint32_t id, wl_fixed_t force)
+{
+ wl_resource_post_event(resource_, ZCR_TOUCH_STYLUS_V2_FORCE, time, id, force);
+}
+
+/**
+ * @ingroup iface_zcr_touch_stylus_v2
+ * Sends an tilt event to the client owning the resource.
+ * @param resource_ The client's resource
+ * @param time timestamp with millisecond granularity
+ * @param id touch id
+ * @param tilt_x tilt in x direction
+ * @param tilt_y tilt in y direction
+ */
+static inline void
+zcr_touch_stylus_v2_send_tilt(struct wl_resource *resource_, uint32_t time, uint32_t id, wl_fixed_t tilt_x, wl_fixed_t tilt_y)
+{
+ wl_resource_post_event(resource_, ZCR_TOUCH_STYLUS_V2_TILT, time, id, tilt_x, tilt_y);
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/chromium/third_party/wayland-protocols/include/protocol/viewporter-client-protocol.h b/chromium/third_party/wayland-protocols/include/protocol/viewporter-client-protocol.h
new file mode 100644
index 00000000000..76af3603f89
--- /dev/null
+++ b/chromium/third_party/wayland-protocols/include/protocol/viewporter-client-protocol.h
@@ -0,0 +1,408 @@
+/* Generated by wayland-scanner 1.13.0 */
+
+#ifndef VIEWPORTER_CLIENT_PROTOCOL_H
+#define VIEWPORTER_CLIENT_PROTOCOL_H
+
+#include <stdint.h>
+#include <stddef.h>
+#include "wayland-client.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @page page_viewporter The viewporter protocol
+ * @section page_ifaces_viewporter Interfaces
+ * - @subpage page_iface_wp_viewporter - surface cropping and scaling
+ * - @subpage page_iface_wp_viewport - crop and scale interface to a wl_surface
+ * @section page_copyright_viewporter Copyright
+ * <pre>
+ *
+ * Copyright © 2013-2016 Collabora, Ltd.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ * </pre>
+ */
+struct wl_surface;
+struct wp_viewport;
+struct wp_viewporter;
+
+/**
+ * @page page_iface_wp_viewporter wp_viewporter
+ * @section page_iface_wp_viewporter_desc Description
+ *
+ * The global interface exposing surface cropping and scaling
+ * capabilities is used to instantiate an interface extension for a
+ * wl_surface object. This extended interface will then allow
+ * cropping and scaling the surface contents, effectively
+ * disconnecting the direct relationship between the buffer and the
+ * surface size.
+ * @section page_iface_wp_viewporter_api API
+ * See @ref iface_wp_viewporter.
+ */
+/**
+ * @defgroup iface_wp_viewporter The wp_viewporter interface
+ *
+ * The global interface exposing surface cropping and scaling
+ * capabilities is used to instantiate an interface extension for a
+ * wl_surface object. This extended interface will then allow
+ * cropping and scaling the surface contents, effectively
+ * disconnecting the direct relationship between the buffer and the
+ * surface size.
+ */
+extern const struct wl_interface wp_viewporter_interface;
+/**
+ * @page page_iface_wp_viewport wp_viewport
+ * @section page_iface_wp_viewport_desc Description
+ *
+ * An additional interface to a wl_surface object, which allows the
+ * client to specify the cropping and scaling of the surface
+ * contents.
+ *
+ * This interface works with two concepts: the source rectangle (src_x,
+ * src_y, src_width, src_height), and the destination size (dst_width,
+ * dst_height). The contents of the source rectangle are scaled to the
+ * destination size, and content outside the source rectangle is ignored.
+ * This state is double-buffered, and is applied on the next
+ * wl_surface.commit.
+ *
+ * The two parts of crop and scale state are independent: the source
+ * rectangle, and the destination size. Initially both are unset, that
+ * is, no scaling is applied. The whole of the current wl_buffer is
+ * used as the source, and the surface size is as defined in
+ * wl_surface.attach.
+ *
+ * If the destination size is set, it causes the surface size to become
+ * dst_width, dst_height. The source (rectangle) is scaled to exactly
+ * this size. This overrides whatever the attached wl_buffer size is,
+ * unless the wl_buffer is NULL. If the wl_buffer is NULL, the surface
+ * has no content and therefore no size. Otherwise, the size is always
+ * at least 1x1 in surface local coordinates.
+ *
+ * If the source rectangle is set, it defines what area of the wl_buffer is
+ * taken as the source. If the source rectangle is set and the destination
+ * size is not set, then src_width and src_height must be integers, and the
+ * surface size becomes the source rectangle size. This results in cropping
+ * without scaling. If src_width or src_height are not integers and
+ * destination size is not set, the bad_size protocol error is raised when
+ * the surface state is applied.
+ *
+ * The coordinate transformations from buffer pixel coordinates up to
+ * the surface-local coordinates happen in the following order:
+ * 1. buffer_transform (wl_surface.set_buffer_transform)
+ * 2. buffer_scale (wl_surface.set_buffer_scale)
+ * 3. crop and scale (wp_viewport.set*)
+ * This means, that the source rectangle coordinates of crop and scale
+ * are given in the coordinates after the buffer transform and scale,
+ * i.e. in the coordinates that would be the surface-local coordinates
+ * if the crop and scale was not applied.
+ *
+ * If src_x or src_y are negative, the bad_value protocol error is raised.
+ * Otherwise, if the source rectangle is partially or completely outside of
+ * the non-NULL wl_buffer, then the out_of_buffer protocol error is raised
+ * when the surface state is applied. A NULL wl_buffer does not raise the
+ * out_of_buffer error.
+ *
+ * The x, y arguments of wl_surface.attach are applied as normal to
+ * the surface. They indicate how many pixels to remove from the
+ * surface size from the left and the top. In other words, they are
+ * still in the surface-local coordinate system, just like dst_width
+ * and dst_height are.
+ *
+ * If the wl_surface associated with the wp_viewport is destroyed,
+ * all wp_viewport requests except 'destroy' raise the protocol error
+ * no_surface.
+ *
+ * If the wp_viewport object is destroyed, the crop and scale
+ * state is removed from the wl_surface. The change will be applied
+ * on the next wl_surface.commit.
+ * @section page_iface_wp_viewport_api API
+ * See @ref iface_wp_viewport.
+ */
+/**
+ * @defgroup iface_wp_viewport The wp_viewport interface
+ *
+ * An additional interface to a wl_surface object, which allows the
+ * client to specify the cropping and scaling of the surface
+ * contents.
+ *
+ * This interface works with two concepts: the source rectangle (src_x,
+ * src_y, src_width, src_height), and the destination size (dst_width,
+ * dst_height). The contents of the source rectangle are scaled to the
+ * destination size, and content outside the source rectangle is ignored.
+ * This state is double-buffered, and is applied on the next
+ * wl_surface.commit.
+ *
+ * The two parts of crop and scale state are independent: the source
+ * rectangle, and the destination size. Initially both are unset, that
+ * is, no scaling is applied. The whole of the current wl_buffer is
+ * used as the source, and the surface size is as defined in
+ * wl_surface.attach.
+ *
+ * If the destination size is set, it causes the surface size to become
+ * dst_width, dst_height. The source (rectangle) is scaled to exactly
+ * this size. This overrides whatever the attached wl_buffer size is,
+ * unless the wl_buffer is NULL. If the wl_buffer is NULL, the surface
+ * has no content and therefore no size. Otherwise, the size is always
+ * at least 1x1 in surface local coordinates.
+ *
+ * If the source rectangle is set, it defines what area of the wl_buffer is
+ * taken as the source. If the source rectangle is set and the destination
+ * size is not set, then src_width and src_height must be integers, and the
+ * surface size becomes the source rectangle size. This results in cropping
+ * without scaling. If src_width or src_height are not integers and
+ * destination size is not set, the bad_size protocol error is raised when
+ * the surface state is applied.
+ *
+ * The coordinate transformations from buffer pixel coordinates up to
+ * the surface-local coordinates happen in the following order:
+ * 1. buffer_transform (wl_surface.set_buffer_transform)
+ * 2. buffer_scale (wl_surface.set_buffer_scale)
+ * 3. crop and scale (wp_viewport.set*)
+ * This means, that the source rectangle coordinates of crop and scale
+ * are given in the coordinates after the buffer transform and scale,
+ * i.e. in the coordinates that would be the surface-local coordinates
+ * if the crop and scale was not applied.
+ *
+ * If src_x or src_y are negative, the bad_value protocol error is raised.
+ * Otherwise, if the source rectangle is partially or completely outside of
+ * the non-NULL wl_buffer, then the out_of_buffer protocol error is raised
+ * when the surface state is applied. A NULL wl_buffer does not raise the
+ * out_of_buffer error.
+ *
+ * The x, y arguments of wl_surface.attach are applied as normal to
+ * the surface. They indicate how many pixels to remove from the
+ * surface size from the left and the top. In other words, they are
+ * still in the surface-local coordinate system, just like dst_width
+ * and dst_height are.
+ *
+ * If the wl_surface associated with the wp_viewport is destroyed,
+ * all wp_viewport requests except 'destroy' raise the protocol error
+ * no_surface.
+ *
+ * If the wp_viewport object is destroyed, the crop and scale
+ * state is removed from the wl_surface. The change will be applied
+ * on the next wl_surface.commit.
+ */
+extern const struct wl_interface wp_viewport_interface;
+
+#ifndef WP_VIEWPORTER_ERROR_ENUM
+#define WP_VIEWPORTER_ERROR_ENUM
+enum wp_viewporter_error {
+ /**
+ * the surface already has a viewport object associated
+ */
+ WP_VIEWPORTER_ERROR_VIEWPORT_EXISTS = 0,
+};
+#endif /* WP_VIEWPORTER_ERROR_ENUM */
+
+#define WP_VIEWPORTER_DESTROY 0
+#define WP_VIEWPORTER_GET_VIEWPORT 1
+
+
+/**
+ * @ingroup iface_wp_viewporter
+ */
+#define WP_VIEWPORTER_DESTROY_SINCE_VERSION 1
+/**
+ * @ingroup iface_wp_viewporter
+ */
+#define WP_VIEWPORTER_GET_VIEWPORT_SINCE_VERSION 1
+
+/** @ingroup iface_wp_viewporter */
+static inline void
+wp_viewporter_set_user_data(struct wp_viewporter *wp_viewporter, void *user_data)
+{
+ wl_proxy_set_user_data((struct wl_proxy *) wp_viewporter, user_data);
+}
+
+/** @ingroup iface_wp_viewporter */
+static inline void *
+wp_viewporter_get_user_data(struct wp_viewporter *wp_viewporter)
+{
+ return wl_proxy_get_user_data((struct wl_proxy *) wp_viewporter);
+}
+
+static inline uint32_t
+wp_viewporter_get_version(struct wp_viewporter *wp_viewporter)
+{
+ return wl_proxy_get_version((struct wl_proxy *) wp_viewporter);
+}
+
+/**
+ * @ingroup iface_wp_viewporter
+ *
+ * Informs the server that the client will not be using this
+ * protocol object anymore. This does not affect any other objects,
+ * wp_viewport objects included.
+ */
+static inline void
+wp_viewporter_destroy(struct wp_viewporter *wp_viewporter)
+{
+ wl_proxy_marshal((struct wl_proxy *) wp_viewporter,
+ WP_VIEWPORTER_DESTROY);
+
+ wl_proxy_destroy((struct wl_proxy *) wp_viewporter);
+}
+
+/**
+ * @ingroup iface_wp_viewporter
+ *
+ * Instantiate an interface extension for the given wl_surface to
+ * crop and scale its content. If the given wl_surface already has
+ * a wp_viewport object associated, the viewport_exists
+ * protocol error is raised.
+ */
+static inline struct wp_viewport *
+wp_viewporter_get_viewport(struct wp_viewporter *wp_viewporter, struct wl_surface *surface)
+{
+ struct wl_proxy *id;
+
+ id = wl_proxy_marshal_constructor((struct wl_proxy *) wp_viewporter,
+ WP_VIEWPORTER_GET_VIEWPORT, &wp_viewport_interface, NULL, surface);
+
+ return (struct wp_viewport *) id;
+}
+
+#ifndef WP_VIEWPORT_ERROR_ENUM
+#define WP_VIEWPORT_ERROR_ENUM
+enum wp_viewport_error {
+ /**
+ * negative or zero values in width or height
+ */
+ WP_VIEWPORT_ERROR_BAD_VALUE = 0,
+ /**
+ * destination size is not integer
+ */
+ WP_VIEWPORT_ERROR_BAD_SIZE = 1,
+ /**
+ * source rectangle extends outside of the content area
+ */
+ WP_VIEWPORT_ERROR_OUT_OF_BUFFER = 2,
+ /**
+ * the wl_surface was destroyed
+ */
+ WP_VIEWPORT_ERROR_NO_SURFACE = 3,
+};
+#endif /* WP_VIEWPORT_ERROR_ENUM */
+
+#define WP_VIEWPORT_DESTROY 0
+#define WP_VIEWPORT_SET_SOURCE 1
+#define WP_VIEWPORT_SET_DESTINATION 2
+
+
+/**
+ * @ingroup iface_wp_viewport
+ */
+#define WP_VIEWPORT_DESTROY_SINCE_VERSION 1
+/**
+ * @ingroup iface_wp_viewport
+ */
+#define WP_VIEWPORT_SET_SOURCE_SINCE_VERSION 1
+/**
+ * @ingroup iface_wp_viewport
+ */
+#define WP_VIEWPORT_SET_DESTINATION_SINCE_VERSION 1
+
+/** @ingroup iface_wp_viewport */
+static inline void
+wp_viewport_set_user_data(struct wp_viewport *wp_viewport, void *user_data)
+{
+ wl_proxy_set_user_data((struct wl_proxy *) wp_viewport, user_data);
+}
+
+/** @ingroup iface_wp_viewport */
+static inline void *
+wp_viewport_get_user_data(struct wp_viewport *wp_viewport)
+{
+ return wl_proxy_get_user_data((struct wl_proxy *) wp_viewport);
+}
+
+static inline uint32_t
+wp_viewport_get_version(struct wp_viewport *wp_viewport)
+{
+ return wl_proxy_get_version((struct wl_proxy *) wp_viewport);
+}
+
+/**
+ * @ingroup iface_wp_viewport
+ *
+ * The associated wl_surface's crop and scale state is removed.
+ * The change is applied on the next wl_surface.commit.
+ */
+static inline void
+wp_viewport_destroy(struct wp_viewport *wp_viewport)
+{
+ wl_proxy_marshal((struct wl_proxy *) wp_viewport,
+ WP_VIEWPORT_DESTROY);
+
+ wl_proxy_destroy((struct wl_proxy *) wp_viewport);
+}
+
+/**
+ * @ingroup iface_wp_viewport
+ *
+ * Set the source rectangle of the associated wl_surface. See
+ * wp_viewport for the description, and relation to the wl_buffer
+ * size.
+ *
+ * If all of x, y, width and height are -1.0, the source rectangle is
+ * unset instead. Any other set of values where width or height are zero
+ * or negative, or x or y are negative, raise the bad_value protocol
+ * error.
+ *
+ * The crop and scale state is double-buffered state, and will be
+ * applied on the next wl_surface.commit.
+ */
+static inline void
+wp_viewport_set_source(struct wp_viewport *wp_viewport, wl_fixed_t x, wl_fixed_t y, wl_fixed_t width, wl_fixed_t height)
+{
+ wl_proxy_marshal((struct wl_proxy *) wp_viewport,
+ WP_VIEWPORT_SET_SOURCE, x, y, width, height);
+}
+
+/**
+ * @ingroup iface_wp_viewport
+ *
+ * Set the destination size of the associated wl_surface. See
+ * wp_viewport for the description, and relation to the wl_buffer
+ * size.
+ *
+ * If width is -1 and height is -1, the destination size is unset
+ * instead. Any other pair of values for width and height that
+ * contains zero or negative values raises the bad_value protocol
+ * error.
+ *
+ * The crop and scale state is double-buffered state, and will be
+ * applied on the next wl_surface.commit.
+ */
+static inline void
+wp_viewport_set_destination(struct wp_viewport *wp_viewport, int32_t width, int32_t height)
+{
+ wl_proxy_marshal((struct wl_proxy *) wp_viewport,
+ WP_VIEWPORT_SET_DESTINATION, width, height);
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/chromium/third_party/wayland-protocols/include/protocol/viewporter-server-protocol.h b/chromium/third_party/wayland-protocols/include/protocol/viewporter-server-protocol.h
new file mode 100644
index 00000000000..0bdb53a6755
--- /dev/null
+++ b/chromium/third_party/wayland-protocols/include/protocol/viewporter-server-protocol.h
@@ -0,0 +1,361 @@
+/* Generated by wayland-scanner 1.13.0 */
+
+#ifndef VIEWPORTER_SERVER_PROTOCOL_H
+#define VIEWPORTER_SERVER_PROTOCOL_H
+
+#include <stdint.h>
+#include <stddef.h>
+#include "wayland-server.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct wl_client;
+struct wl_resource;
+
+/**
+ * @page page_viewporter The viewporter protocol
+ * @section page_ifaces_viewporter Interfaces
+ * - @subpage page_iface_wp_viewporter - surface cropping and scaling
+ * - @subpage page_iface_wp_viewport - crop and scale interface to a wl_surface
+ * @section page_copyright_viewporter Copyright
+ * <pre>
+ *
+ * Copyright © 2013-2016 Collabora, Ltd.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ * </pre>
+ */
+struct wl_surface;
+struct wp_viewport;
+struct wp_viewporter;
+
+/**
+ * @page page_iface_wp_viewporter wp_viewporter
+ * @section page_iface_wp_viewporter_desc Description
+ *
+ * The global interface exposing surface cropping and scaling
+ * capabilities is used to instantiate an interface extension for a
+ * wl_surface object. This extended interface will then allow
+ * cropping and scaling the surface contents, effectively
+ * disconnecting the direct relationship between the buffer and the
+ * surface size.
+ * @section page_iface_wp_viewporter_api API
+ * See @ref iface_wp_viewporter.
+ */
+/**
+ * @defgroup iface_wp_viewporter The wp_viewporter interface
+ *
+ * The global interface exposing surface cropping and scaling
+ * capabilities is used to instantiate an interface extension for a
+ * wl_surface object. This extended interface will then allow
+ * cropping and scaling the surface contents, effectively
+ * disconnecting the direct relationship between the buffer and the
+ * surface size.
+ */
+extern const struct wl_interface wp_viewporter_interface;
+/**
+ * @page page_iface_wp_viewport wp_viewport
+ * @section page_iface_wp_viewport_desc Description
+ *
+ * An additional interface to a wl_surface object, which allows the
+ * client to specify the cropping and scaling of the surface
+ * contents.
+ *
+ * This interface works with two concepts: the source rectangle (src_x,
+ * src_y, src_width, src_height), and the destination size (dst_width,
+ * dst_height). The contents of the source rectangle are scaled to the
+ * destination size, and content outside the source rectangle is ignored.
+ * This state is double-buffered, and is applied on the next
+ * wl_surface.commit.
+ *
+ * The two parts of crop and scale state are independent: the source
+ * rectangle, and the destination size. Initially both are unset, that
+ * is, no scaling is applied. The whole of the current wl_buffer is
+ * used as the source, and the surface size is as defined in
+ * wl_surface.attach.
+ *
+ * If the destination size is set, it causes the surface size to become
+ * dst_width, dst_height. The source (rectangle) is scaled to exactly
+ * this size. This overrides whatever the attached wl_buffer size is,
+ * unless the wl_buffer is NULL. If the wl_buffer is NULL, the surface
+ * has no content and therefore no size. Otherwise, the size is always
+ * at least 1x1 in surface local coordinates.
+ *
+ * If the source rectangle is set, it defines what area of the wl_buffer is
+ * taken as the source. If the source rectangle is set and the destination
+ * size is not set, then src_width and src_height must be integers, and the
+ * surface size becomes the source rectangle size. This results in cropping
+ * without scaling. If src_width or src_height are not integers and
+ * destination size is not set, the bad_size protocol error is raised when
+ * the surface state is applied.
+ *
+ * The coordinate transformations from buffer pixel coordinates up to
+ * the surface-local coordinates happen in the following order:
+ * 1. buffer_transform (wl_surface.set_buffer_transform)
+ * 2. buffer_scale (wl_surface.set_buffer_scale)
+ * 3. crop and scale (wp_viewport.set*)
+ * This means, that the source rectangle coordinates of crop and scale
+ * are given in the coordinates after the buffer transform and scale,
+ * i.e. in the coordinates that would be the surface-local coordinates
+ * if the crop and scale was not applied.
+ *
+ * If src_x or src_y are negative, the bad_value protocol error is raised.
+ * Otherwise, if the source rectangle is partially or completely outside of
+ * the non-NULL wl_buffer, then the out_of_buffer protocol error is raised
+ * when the surface state is applied. A NULL wl_buffer does not raise the
+ * out_of_buffer error.
+ *
+ * The x, y arguments of wl_surface.attach are applied as normal to
+ * the surface. They indicate how many pixels to remove from the
+ * surface size from the left and the top. In other words, they are
+ * still in the surface-local coordinate system, just like dst_width
+ * and dst_height are.
+ *
+ * If the wl_surface associated with the wp_viewport is destroyed,
+ * all wp_viewport requests except 'destroy' raise the protocol error
+ * no_surface.
+ *
+ * If the wp_viewport object is destroyed, the crop and scale
+ * state is removed from the wl_surface. The change will be applied
+ * on the next wl_surface.commit.
+ * @section page_iface_wp_viewport_api API
+ * See @ref iface_wp_viewport.
+ */
+/**
+ * @defgroup iface_wp_viewport The wp_viewport interface
+ *
+ * An additional interface to a wl_surface object, which allows the
+ * client to specify the cropping and scaling of the surface
+ * contents.
+ *
+ * This interface works with two concepts: the source rectangle (src_x,
+ * src_y, src_width, src_height), and the destination size (dst_width,
+ * dst_height). The contents of the source rectangle are scaled to the
+ * destination size, and content outside the source rectangle is ignored.
+ * This state is double-buffered, and is applied on the next
+ * wl_surface.commit.
+ *
+ * The two parts of crop and scale state are independent: the source
+ * rectangle, and the destination size. Initially both are unset, that
+ * is, no scaling is applied. The whole of the current wl_buffer is
+ * used as the source, and the surface size is as defined in
+ * wl_surface.attach.
+ *
+ * If the destination size is set, it causes the surface size to become
+ * dst_width, dst_height. The source (rectangle) is scaled to exactly
+ * this size. This overrides whatever the attached wl_buffer size is,
+ * unless the wl_buffer is NULL. If the wl_buffer is NULL, the surface
+ * has no content and therefore no size. Otherwise, the size is always
+ * at least 1x1 in surface local coordinates.
+ *
+ * If the source rectangle is set, it defines what area of the wl_buffer is
+ * taken as the source. If the source rectangle is set and the destination
+ * size is not set, then src_width and src_height must be integers, and the
+ * surface size becomes the source rectangle size. This results in cropping
+ * without scaling. If src_width or src_height are not integers and
+ * destination size is not set, the bad_size protocol error is raised when
+ * the surface state is applied.
+ *
+ * The coordinate transformations from buffer pixel coordinates up to
+ * the surface-local coordinates happen in the following order:
+ * 1. buffer_transform (wl_surface.set_buffer_transform)
+ * 2. buffer_scale (wl_surface.set_buffer_scale)
+ * 3. crop and scale (wp_viewport.set*)
+ * This means, that the source rectangle coordinates of crop and scale
+ * are given in the coordinates after the buffer transform and scale,
+ * i.e. in the coordinates that would be the surface-local coordinates
+ * if the crop and scale was not applied.
+ *
+ * If src_x or src_y are negative, the bad_value protocol error is raised.
+ * Otherwise, if the source rectangle is partially or completely outside of
+ * the non-NULL wl_buffer, then the out_of_buffer protocol error is raised
+ * when the surface state is applied. A NULL wl_buffer does not raise the
+ * out_of_buffer error.
+ *
+ * The x, y arguments of wl_surface.attach are applied as normal to
+ * the surface. They indicate how many pixels to remove from the
+ * surface size from the left and the top. In other words, they are
+ * still in the surface-local coordinate system, just like dst_width
+ * and dst_height are.
+ *
+ * If the wl_surface associated with the wp_viewport is destroyed,
+ * all wp_viewport requests except 'destroy' raise the protocol error
+ * no_surface.
+ *
+ * If the wp_viewport object is destroyed, the crop and scale
+ * state is removed from the wl_surface. The change will be applied
+ * on the next wl_surface.commit.
+ */
+extern const struct wl_interface wp_viewport_interface;
+
+#ifndef WP_VIEWPORTER_ERROR_ENUM
+#define WP_VIEWPORTER_ERROR_ENUM
+enum wp_viewporter_error {
+ /**
+ * the surface already has a viewport object associated
+ */
+ WP_VIEWPORTER_ERROR_VIEWPORT_EXISTS = 0,
+};
+#endif /* WP_VIEWPORTER_ERROR_ENUM */
+
+/**
+ * @ingroup iface_wp_viewporter
+ * @struct wp_viewporter_interface
+ */
+struct wp_viewporter_interface {
+ /**
+ * unbind from the cropping and scaling interface
+ *
+ * Informs the server that the client will not be using this
+ * protocol object anymore. This does not affect any other objects,
+ * wp_viewport objects included.
+ */
+ void (*destroy)(struct wl_client *client,
+ struct wl_resource *resource);
+ /**
+ * extend surface interface for crop and scale
+ *
+ * Instantiate an interface extension for the given wl_surface to
+ * crop and scale its content. If the given wl_surface already has
+ * a wp_viewport object associated, the viewport_exists protocol
+ * error is raised.
+ * @param id the new viewport interface id
+ * @param surface the surface
+ */
+ void (*get_viewport)(struct wl_client *client,
+ struct wl_resource *resource,
+ uint32_t id,
+ struct wl_resource *surface);
+};
+
+
+/**
+ * @ingroup iface_wp_viewporter
+ */
+#define WP_VIEWPORTER_DESTROY_SINCE_VERSION 1
+/**
+ * @ingroup iface_wp_viewporter
+ */
+#define WP_VIEWPORTER_GET_VIEWPORT_SINCE_VERSION 1
+
+#ifndef WP_VIEWPORT_ERROR_ENUM
+#define WP_VIEWPORT_ERROR_ENUM
+enum wp_viewport_error {
+ /**
+ * negative or zero values in width or height
+ */
+ WP_VIEWPORT_ERROR_BAD_VALUE = 0,
+ /**
+ * destination size is not integer
+ */
+ WP_VIEWPORT_ERROR_BAD_SIZE = 1,
+ /**
+ * source rectangle extends outside of the content area
+ */
+ WP_VIEWPORT_ERROR_OUT_OF_BUFFER = 2,
+ /**
+ * the wl_surface was destroyed
+ */
+ WP_VIEWPORT_ERROR_NO_SURFACE = 3,
+};
+#endif /* WP_VIEWPORT_ERROR_ENUM */
+
+/**
+ * @ingroup iface_wp_viewport
+ * @struct wp_viewport_interface
+ */
+struct wp_viewport_interface {
+ /**
+ * remove scaling and cropping from the surface
+ *
+ * The associated wl_surface's crop and scale state is removed.
+ * The change is applied on the next wl_surface.commit.
+ */
+ void (*destroy)(struct wl_client *client,
+ struct wl_resource *resource);
+ /**
+ * set the source rectangle for cropping
+ *
+ * Set the source rectangle of the associated wl_surface. See
+ * wp_viewport for the description, and relation to the wl_buffer
+ * size.
+ *
+ * If all of x, y, width and height are -1.0, the source rectangle
+ * is unset instead. Any other set of values where width or height
+ * are zero or negative, or x or y are negative, raise the
+ * bad_value protocol error.
+ *
+ * The crop and scale state is double-buffered state, and will be
+ * applied on the next wl_surface.commit.
+ * @param x source rectangle x
+ * @param y source rectangle y
+ * @param width source rectangle width
+ * @param height source rectangle height
+ */
+ void (*set_source)(struct wl_client *client,
+ struct wl_resource *resource,
+ wl_fixed_t x,
+ wl_fixed_t y,
+ wl_fixed_t width,
+ wl_fixed_t height);
+ /**
+ * set the surface size for scaling
+ *
+ * Set the destination size of the associated wl_surface. See
+ * wp_viewport for the description, and relation to the wl_buffer
+ * size.
+ *
+ * If width is -1 and height is -1, the destination size is unset
+ * instead. Any other pair of values for width and height that
+ * contains zero or negative values raises the bad_value protocol
+ * error.
+ *
+ * The crop and scale state is double-buffered state, and will be
+ * applied on the next wl_surface.commit.
+ * @param width surface width
+ * @param height surface height
+ */
+ void (*set_destination)(struct wl_client *client,
+ struct wl_resource *resource,
+ int32_t width,
+ int32_t height);
+};
+
+
+/**
+ * @ingroup iface_wp_viewport
+ */
+#define WP_VIEWPORT_DESTROY_SINCE_VERSION 1
+/**
+ * @ingroup iface_wp_viewport
+ */
+#define WP_VIEWPORT_SET_SOURCE_SINCE_VERSION 1
+/**
+ * @ingroup iface_wp_viewport
+ */
+#define WP_VIEWPORT_SET_DESTINATION_SINCE_VERSION 1
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/chromium/third_party/wayland-protocols/include/protocol/vsync-feedback-unstable-v1-client-protocol.h b/chromium/third_party/wayland-protocols/include/protocol/vsync-feedback-unstable-v1-client-protocol.h
new file mode 100644
index 00000000000..5a37d0007c6
--- /dev/null
+++ b/chromium/third_party/wayland-protocols/include/protocol/vsync-feedback-unstable-v1-client-protocol.h
@@ -0,0 +1,257 @@
+/* Generated by wayland-scanner 1.13.0 */
+
+#ifndef VSYNC_FEEDBACK_UNSTABLE_V1_CLIENT_PROTOCOL_H
+#define VSYNC_FEEDBACK_UNSTABLE_V1_CLIENT_PROTOCOL_H
+
+#include <stdint.h>
+#include <stddef.h>
+#include "wayland-client.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @page page_vsync_feedback_unstable_v1 The vsync_feedback_unstable_v1 protocol
+ * Protocol for providing vertical synchronization timing
+ *
+ * @section page_desc_vsync_feedback_unstable_v1 Description
+ *
+ * This protocol specifies a set of interfaces used to inform the client about
+ * vertical synchronization timing in a precise way and without unnecessary
+ * overhead.
+ *
+ * Warning! The protocol described in this file is experimental and backward
+ * incompatible changes may be made. Backward compatible changes may be added
+ * together with the corresponding interface version bump. Backward
+ * incompatible changes are done by bumping the version number in the protocol
+ * and interface names and resetting the interface version. Once the protocol
+ * is to be declared stable, the version number in the protocol is removed and
+ * the interface version number is reset.
+ *
+ * @section page_ifaces_vsync_feedback_unstable_v1 Interfaces
+ * - @subpage page_iface_zcr_vsync_feedback_v1 - Protocol for providing vertical synchronization timing
+ * - @subpage page_iface_zcr_vsync_timing_v1 -
+ * @section page_copyright_vsync_feedback_unstable_v1 Copyright
+ * <pre>
+ *
+ * Copyright 2016 The Chromium Authors.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ * </pre>
+ */
+struct wl_output;
+struct zcr_vsync_feedback_v1;
+struct zcr_vsync_timing_v1;
+
+/**
+ * @page page_iface_zcr_vsync_feedback_v1 zcr_vsync_feedback_v1
+ * @section page_iface_zcr_vsync_feedback_v1_desc Description
+ *
+ * The global interface that allows clients to subscribe for vertical
+ * synchronization timing data for given wl_output.
+ * @section page_iface_zcr_vsync_feedback_v1_api API
+ * See @ref iface_zcr_vsync_feedback_v1.
+ */
+/**
+ * @defgroup iface_zcr_vsync_feedback_v1 The zcr_vsync_feedback_v1 interface
+ *
+ * The global interface that allows clients to subscribe for vertical
+ * synchronization timing data for given wl_output.
+ */
+extern const struct wl_interface zcr_vsync_feedback_v1_interface;
+/**
+ * @page page_iface_zcr_vsync_timing_v1 zcr_vsync_timing_v1
+ * @section page_iface_zcr_vsync_timing_v1_api API
+ * See @ref iface_zcr_vsync_timing_v1.
+ */
+/**
+ * @defgroup iface_zcr_vsync_timing_v1 The zcr_vsync_timing_v1 interface
+ */
+extern const struct wl_interface zcr_vsync_timing_v1_interface;
+
+#define ZCR_VSYNC_FEEDBACK_V1_DESTROY 0
+#define ZCR_VSYNC_FEEDBACK_V1_GET_VSYNC_TIMING 1
+
+
+/**
+ * @ingroup iface_zcr_vsync_feedback_v1
+ */
+#define ZCR_VSYNC_FEEDBACK_V1_DESTROY_SINCE_VERSION 1
+/**
+ * @ingroup iface_zcr_vsync_feedback_v1
+ */
+#define ZCR_VSYNC_FEEDBACK_V1_GET_VSYNC_TIMING_SINCE_VERSION 1
+
+/** @ingroup iface_zcr_vsync_feedback_v1 */
+static inline void
+zcr_vsync_feedback_v1_set_user_data(struct zcr_vsync_feedback_v1 *zcr_vsync_feedback_v1, void *user_data)
+{
+ wl_proxy_set_user_data((struct wl_proxy *) zcr_vsync_feedback_v1, user_data);
+}
+
+/** @ingroup iface_zcr_vsync_feedback_v1 */
+static inline void *
+zcr_vsync_feedback_v1_get_user_data(struct zcr_vsync_feedback_v1 *zcr_vsync_feedback_v1)
+{
+ return wl_proxy_get_user_data((struct wl_proxy *) zcr_vsync_feedback_v1);
+}
+
+static inline uint32_t
+zcr_vsync_feedback_v1_get_version(struct zcr_vsync_feedback_v1 *zcr_vsync_feedback_v1)
+{
+ return wl_proxy_get_version((struct wl_proxy *) zcr_vsync_feedback_v1);
+}
+
+/**
+ * @ingroup iface_zcr_vsync_feedback_v1
+ *
+ * Destroy this vsync feedback object. Existing vsync timing objects shall
+ * not be affected by this request.
+ */
+static inline void
+zcr_vsync_feedback_v1_destroy(struct zcr_vsync_feedback_v1 *zcr_vsync_feedback_v1)
+{
+ wl_proxy_marshal((struct wl_proxy *) zcr_vsync_feedback_v1,
+ ZCR_VSYNC_FEEDBACK_V1_DESTROY);
+
+ wl_proxy_destroy((struct wl_proxy *) zcr_vsync_feedback_v1);
+}
+
+/**
+ * @ingroup iface_zcr_vsync_feedback_v1
+ *
+ * Create a new vsync timing object that represents a subscription to
+ * vertical synchronization timing updates of given wl_output object.
+ *
+ * The newly created object will immediately signal an update to notify
+ * the subscriber of initial timing parameters.
+ */
+static inline struct zcr_vsync_timing_v1 *
+zcr_vsync_feedback_v1_get_vsync_timing(struct zcr_vsync_feedback_v1 *zcr_vsync_feedback_v1, struct wl_output *output)
+{
+ struct wl_proxy *id;
+
+ id = wl_proxy_marshal_constructor((struct wl_proxy *) zcr_vsync_feedback_v1,
+ ZCR_VSYNC_FEEDBACK_V1_GET_VSYNC_TIMING, &zcr_vsync_timing_v1_interface, NULL, output);
+
+ return (struct zcr_vsync_timing_v1 *) id;
+}
+
+/**
+ * @ingroup iface_zcr_vsync_timing_v1
+ * @struct zcr_vsync_timing_v1_listener
+ */
+struct zcr_vsync_timing_v1_listener {
+ /**
+ * vsync timing updated
+ *
+ * Notifies client that vertical synchronization timing of given
+ * wl_output has changed.
+ *
+ * Timing information consists of two data, timebase and interval.
+ * Timebase is an absolute timestamp of the vsync event that caused
+ * the timing to change. Interval is a period of time between
+ * subsequent vsync events.
+ *
+ * The unit of all above mentioned time values shall be
+ * microseconds and absolute timestamps should match the realm of
+ * the primary system monotonic counter, i.e. the POSIX
+ * clock_gettime(CLOCK_MONOTONIC). Data type of both values is
+ * defined to be a 64-bit unsigned integer, but since the biggest
+ * unsigned integer datatype defined by the Wayland protocol is the
+ * 32-bit uint, both timebase and interval are split into most
+ * significant and least significant part, suffixed by "_h" and
+ * "_l" respectively.
+ * @param timebase_l new vsync timebase (lower 32 bits)
+ * @param timebase_h new vsync timebase (upper 32 bits)
+ * @param interval_l new vsync interval (lower 32 bits)
+ * @param interval_h new vsync interval (upper 32 bits)
+ */
+ void (*update)(void *data,
+ struct zcr_vsync_timing_v1 *zcr_vsync_timing_v1,
+ uint32_t timebase_l,
+ uint32_t timebase_h,
+ uint32_t interval_l,
+ uint32_t interval_h);
+};
+
+/**
+ * @ingroup iface_zcr_vsync_timing_v1
+ */
+static inline int
+zcr_vsync_timing_v1_add_listener(struct zcr_vsync_timing_v1 *zcr_vsync_timing_v1,
+ const struct zcr_vsync_timing_v1_listener *listener, void *data)
+{
+ return wl_proxy_add_listener((struct wl_proxy *) zcr_vsync_timing_v1,
+ (void (**)(void)) listener, data);
+}
+
+#define ZCR_VSYNC_TIMING_V1_DESTROY 0
+
+/**
+ * @ingroup iface_zcr_vsync_timing_v1
+ */
+#define ZCR_VSYNC_TIMING_V1_UPDATE_SINCE_VERSION 1
+
+/**
+ * @ingroup iface_zcr_vsync_timing_v1
+ */
+#define ZCR_VSYNC_TIMING_V1_DESTROY_SINCE_VERSION 1
+
+/** @ingroup iface_zcr_vsync_timing_v1 */
+static inline void
+zcr_vsync_timing_v1_set_user_data(struct zcr_vsync_timing_v1 *zcr_vsync_timing_v1, void *user_data)
+{
+ wl_proxy_set_user_data((struct wl_proxy *) zcr_vsync_timing_v1, user_data);
+}
+
+/** @ingroup iface_zcr_vsync_timing_v1 */
+static inline void *
+zcr_vsync_timing_v1_get_user_data(struct zcr_vsync_timing_v1 *zcr_vsync_timing_v1)
+{
+ return wl_proxy_get_user_data((struct wl_proxy *) zcr_vsync_timing_v1);
+}
+
+static inline uint32_t
+zcr_vsync_timing_v1_get_version(struct zcr_vsync_timing_v1 *zcr_vsync_timing_v1)
+{
+ return wl_proxy_get_version((struct wl_proxy *) zcr_vsync_timing_v1);
+}
+
+/**
+ * @ingroup iface_zcr_vsync_timing_v1
+ *
+ * Destroy this vsync timing object.
+ */
+static inline void
+zcr_vsync_timing_v1_destroy(struct zcr_vsync_timing_v1 *zcr_vsync_timing_v1)
+{
+ wl_proxy_marshal((struct wl_proxy *) zcr_vsync_timing_v1,
+ ZCR_VSYNC_TIMING_V1_DESTROY);
+
+ wl_proxy_destroy((struct wl_proxy *) zcr_vsync_timing_v1);
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/chromium/third_party/wayland-protocols/include/protocol/vsync-feedback-unstable-v1-server-protocol.h b/chromium/third_party/wayland-protocols/include/protocol/vsync-feedback-unstable-v1-server-protocol.h
new file mode 100644
index 00000000000..67c1f8da480
--- /dev/null
+++ b/chromium/third_party/wayland-protocols/include/protocol/vsync-feedback-unstable-v1-server-protocol.h
@@ -0,0 +1,179 @@
+/* Generated by wayland-scanner 1.13.0 */
+
+#ifndef VSYNC_FEEDBACK_UNSTABLE_V1_SERVER_PROTOCOL_H
+#define VSYNC_FEEDBACK_UNSTABLE_V1_SERVER_PROTOCOL_H
+
+#include <stdint.h>
+#include <stddef.h>
+#include "wayland-server.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct wl_client;
+struct wl_resource;
+
+/**
+ * @page page_vsync_feedback_unstable_v1 The vsync_feedback_unstable_v1 protocol
+ * Protocol for providing vertical synchronization timing
+ *
+ * @section page_desc_vsync_feedback_unstable_v1 Description
+ *
+ * This protocol specifies a set of interfaces used to inform the client about
+ * vertical synchronization timing in a precise way and without unnecessary
+ * overhead.
+ *
+ * Warning! The protocol described in this file is experimental and backward
+ * incompatible changes may be made. Backward compatible changes may be added
+ * together with the corresponding interface version bump. Backward
+ * incompatible changes are done by bumping the version number in the protocol
+ * and interface names and resetting the interface version. Once the protocol
+ * is to be declared stable, the version number in the protocol is removed and
+ * the interface version number is reset.
+ *
+ * @section page_ifaces_vsync_feedback_unstable_v1 Interfaces
+ * - @subpage page_iface_zcr_vsync_feedback_v1 - Protocol for providing vertical synchronization timing
+ * - @subpage page_iface_zcr_vsync_timing_v1 -
+ * @section page_copyright_vsync_feedback_unstable_v1 Copyright
+ * <pre>
+ *
+ * Copyright 2016 The Chromium Authors.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ * </pre>
+ */
+struct wl_output;
+struct zcr_vsync_feedback_v1;
+struct zcr_vsync_timing_v1;
+
+/**
+ * @page page_iface_zcr_vsync_feedback_v1 zcr_vsync_feedback_v1
+ * @section page_iface_zcr_vsync_feedback_v1_desc Description
+ *
+ * The global interface that allows clients to subscribe for vertical
+ * synchronization timing data for given wl_output.
+ * @section page_iface_zcr_vsync_feedback_v1_api API
+ * See @ref iface_zcr_vsync_feedback_v1.
+ */
+/**
+ * @defgroup iface_zcr_vsync_feedback_v1 The zcr_vsync_feedback_v1 interface
+ *
+ * The global interface that allows clients to subscribe for vertical
+ * synchronization timing data for given wl_output.
+ */
+extern const struct wl_interface zcr_vsync_feedback_v1_interface;
+/**
+ * @page page_iface_zcr_vsync_timing_v1 zcr_vsync_timing_v1
+ * @section page_iface_zcr_vsync_timing_v1_api API
+ * See @ref iface_zcr_vsync_timing_v1.
+ */
+/**
+ * @defgroup iface_zcr_vsync_timing_v1 The zcr_vsync_timing_v1 interface
+ */
+extern const struct wl_interface zcr_vsync_timing_v1_interface;
+
+/**
+ * @ingroup iface_zcr_vsync_feedback_v1
+ * @struct zcr_vsync_feedback_v1_interface
+ */
+struct zcr_vsync_feedback_v1_interface {
+ /**
+ * destroy vsync feedback object
+ *
+ * Destroy this vsync feedback object. Existing vsync timing
+ * objects shall not be affected by this request.
+ */
+ void (*destroy)(struct wl_client *client,
+ struct wl_resource *resource);
+ /**
+ * get vsync timing object for given wl_output
+ *
+ * Create a new vsync timing object that represents a
+ * subscription to vertical synchronization timing updates of given
+ * wl_output object.
+ *
+ * The newly created object will immediately signal an update to
+ * notify the subscriber of initial timing parameters.
+ * @param id the new vsync timing interface id
+ * @param output the wl_output object to subscribe for timings of
+ */
+ void (*get_vsync_timing)(struct wl_client *client,
+ struct wl_resource *resource,
+ uint32_t id,
+ struct wl_resource *output);
+};
+
+
+/**
+ * @ingroup iface_zcr_vsync_feedback_v1
+ */
+#define ZCR_VSYNC_FEEDBACK_V1_DESTROY_SINCE_VERSION 1
+/**
+ * @ingroup iface_zcr_vsync_feedback_v1
+ */
+#define ZCR_VSYNC_FEEDBACK_V1_GET_VSYNC_TIMING_SINCE_VERSION 1
+
+/**
+ * @ingroup iface_zcr_vsync_timing_v1
+ * @struct zcr_vsync_timing_v1_interface
+ */
+struct zcr_vsync_timing_v1_interface {
+ /**
+ * destroy vsync timing object
+ *
+ * Destroy this vsync timing object.
+ */
+ void (*destroy)(struct wl_client *client,
+ struct wl_resource *resource);
+};
+
+#define ZCR_VSYNC_TIMING_V1_UPDATE 0
+
+/**
+ * @ingroup iface_zcr_vsync_timing_v1
+ */
+#define ZCR_VSYNC_TIMING_V1_UPDATE_SINCE_VERSION 1
+
+/**
+ * @ingroup iface_zcr_vsync_timing_v1
+ */
+#define ZCR_VSYNC_TIMING_V1_DESTROY_SINCE_VERSION 1
+
+/**
+ * @ingroup iface_zcr_vsync_timing_v1
+ * Sends an update event to the client owning the resource.
+ * @param resource_ The client's resource
+ * @param timebase_l new vsync timebase (lower 32 bits)
+ * @param timebase_h new vsync timebase (upper 32 bits)
+ * @param interval_l new vsync interval (lower 32 bits)
+ * @param interval_h new vsync interval (upper 32 bits)
+ */
+static inline void
+zcr_vsync_timing_v1_send_update(struct wl_resource *resource_, uint32_t timebase_l, uint32_t timebase_h, uint32_t interval_l, uint32_t interval_h)
+{
+ wl_resource_post_event(resource_, ZCR_VSYNC_TIMING_V1_UPDATE, timebase_l, timebase_h, interval_l, interval_h);
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/chromium/third_party/wayland-protocols/include/protocol/xdg-shell-unstable-v5-client-protocol.h b/chromium/third_party/wayland-protocols/include/protocol/xdg-shell-unstable-v5-client-protocol.h
new file mode 100644
index 00000000000..95d708514bb
--- /dev/null
+++ b/chromium/third_party/wayland-protocols/include/protocol/xdg-shell-unstable-v5-client-protocol.h
@@ -0,0 +1,1110 @@
+/* Generated by wayland-scanner 1.13.0 */
+
+#ifndef XDG_SHELL_UNSTABLE_V5_CLIENT_PROTOCOL_H
+#define XDG_SHELL_UNSTABLE_V5_CLIENT_PROTOCOL_H
+
+#include <stdint.h>
+#include <stddef.h>
+#include "wayland-client.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @page page_xdg_shell_unstable_v5 The xdg_shell_unstable_v5 protocol
+ * @section page_ifaces_xdg_shell_unstable_v5 Interfaces
+ * - @subpage page_iface_xdg_shell - create desktop-style surfaces
+ * - @subpage page_iface_xdg_surface - A desktop window
+ * - @subpage page_iface_xdg_popup - short-lived, popup surfaces for menus
+ * @section page_copyright_xdg_shell_unstable_v5 Copyright
+ * <pre>
+ *
+ * Copyright © 2008-2013 Kristian Høgsberg
+ * Copyright © 2013 Rafael Antognolli
+ * Copyright © 2013 Jasper St. Pierre
+ * Copyright © 2010-2013 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ * </pre>
+ */
+struct wl_output;
+struct wl_seat;
+struct wl_surface;
+struct xdg_popup;
+struct xdg_shell;
+struct xdg_surface;
+
+/**
+ * @page page_iface_xdg_shell xdg_shell
+ * @section page_iface_xdg_shell_desc Description
+ *
+ * xdg_shell allows clients to turn a wl_surface into a "real window"
+ * which can be dragged, resized, stacked, and moved around by the
+ * user. Everything about this interface is suited towards traditional
+ * desktop environments.
+ * @section page_iface_xdg_shell_api API
+ * See @ref iface_xdg_shell.
+ */
+/**
+ * @defgroup iface_xdg_shell The xdg_shell interface
+ *
+ * xdg_shell allows clients to turn a wl_surface into a "real window"
+ * which can be dragged, resized, stacked, and moved around by the
+ * user. Everything about this interface is suited towards traditional
+ * desktop environments.
+ */
+extern const struct wl_interface xdg_shell_interface;
+/**
+ * @page page_iface_xdg_surface xdg_surface
+ * @section page_iface_xdg_surface_desc Description
+ *
+ * An interface that may be implemented by a wl_surface, for
+ * implementations that provide a desktop-style user interface.
+ *
+ * It provides requests to treat surfaces like windows, allowing to set
+ * properties like maximized, fullscreen, minimized, and to move and resize
+ * them, and associate metadata like title and app id.
+ *
+ * The client must call wl_surface.commit on the corresponding wl_surface
+ * for the xdg_surface state to take effect. Prior to committing the new
+ * state, it can set up initial configuration, such as maximizing or setting
+ * a window geometry.
+ *
+ * Even without attaching a buffer the compositor must respond to initial
+ * committed configuration, for instance sending a configure event with
+ * expected window geometry if the client maximized its surface during
+ * initialization.
+ *
+ * For a surface to be mapped by the compositor the client must have
+ * committed both an xdg_surface state and a buffer.
+ * @section page_iface_xdg_surface_api API
+ * See @ref iface_xdg_surface.
+ */
+/**
+ * @defgroup iface_xdg_surface The xdg_surface interface
+ *
+ * An interface that may be implemented by a wl_surface, for
+ * implementations that provide a desktop-style user interface.
+ *
+ * It provides requests to treat surfaces like windows, allowing to set
+ * properties like maximized, fullscreen, minimized, and to move and resize
+ * them, and associate metadata like title and app id.
+ *
+ * The client must call wl_surface.commit on the corresponding wl_surface
+ * for the xdg_surface state to take effect. Prior to committing the new
+ * state, it can set up initial configuration, such as maximizing or setting
+ * a window geometry.
+ *
+ * Even without attaching a buffer the compositor must respond to initial
+ * committed configuration, for instance sending a configure event with
+ * expected window geometry if the client maximized its surface during
+ * initialization.
+ *
+ * For a surface to be mapped by the compositor the client must have
+ * committed both an xdg_surface state and a buffer.
+ */
+extern const struct wl_interface xdg_surface_interface;
+/**
+ * @page page_iface_xdg_popup xdg_popup
+ * @section page_iface_xdg_popup_desc Description
+ *
+ * A popup surface is a short-lived, temporary surface that can be
+ * used to implement menus. It takes an explicit grab on the surface
+ * that will be dismissed when the user dismisses the popup. This can
+ * be done by the user clicking outside the surface, using the keyboard,
+ * or even locking the screen through closing the lid or a timeout.
+ *
+ * When the popup is dismissed, a popup_done event will be sent out,
+ * and at the same time the surface will be unmapped. The xdg_popup
+ * object is now inert and cannot be reactivated, so clients should
+ * destroy it. Explicitly destroying the xdg_popup object will also
+ * dismiss the popup and unmap the surface.
+ *
+ * Clients will receive events for all their surfaces during this
+ * grab (which is an "owner-events" grab in X11 parlance). This is
+ * done so that users can navigate through submenus and other
+ * "nested" popup windows without having to dismiss the topmost
+ * popup.
+ *
+ * Clients that want to dismiss the popup when another surface of
+ * their own is clicked should dismiss the popup using the destroy
+ * request.
+ *
+ * The parent surface must have either an xdg_surface or xdg_popup
+ * role.
+ *
+ * Specifying an xdg_popup for the parent means that the popups are
+ * nested, with this popup now being the topmost popup. Nested
+ * popups must be destroyed in the reverse order they were created
+ * in, e.g. the only popup you are allowed to destroy at all times
+ * is the topmost one.
+ *
+ * If there is an existing popup when creating a new popup, the
+ * parent must be the current topmost popup.
+ *
+ * A parent surface must be mapped before the new popup is mapped.
+ *
+ * When compositors choose to dismiss a popup, they will likely
+ * dismiss every nested popup as well. When a compositor dismisses
+ * popups, it will follow the same dismissing order as required
+ * from the client.
+ *
+ * The x and y arguments passed when creating the popup object specify
+ * where the top left of the popup should be placed, relative to the
+ * local surface coordinates of the parent surface. See
+ * xdg_shell.get_xdg_popup.
+ *
+ * The client must call wl_surface.commit on the corresponding wl_surface
+ * for the xdg_popup state to take effect.
+ *
+ * For a surface to be mapped by the compositor the client must have
+ * committed both the xdg_popup state and a buffer.
+ * @section page_iface_xdg_popup_api API
+ * See @ref iface_xdg_popup.
+ */
+/**
+ * @defgroup iface_xdg_popup The xdg_popup interface
+ *
+ * A popup surface is a short-lived, temporary surface that can be
+ * used to implement menus. It takes an explicit grab on the surface
+ * that will be dismissed when the user dismisses the popup. This can
+ * be done by the user clicking outside the surface, using the keyboard,
+ * or even locking the screen through closing the lid or a timeout.
+ *
+ * When the popup is dismissed, a popup_done event will be sent out,
+ * and at the same time the surface will be unmapped. The xdg_popup
+ * object is now inert and cannot be reactivated, so clients should
+ * destroy it. Explicitly destroying the xdg_popup object will also
+ * dismiss the popup and unmap the surface.
+ *
+ * Clients will receive events for all their surfaces during this
+ * grab (which is an "owner-events" grab in X11 parlance). This is
+ * done so that users can navigate through submenus and other
+ * "nested" popup windows without having to dismiss the topmost
+ * popup.
+ *
+ * Clients that want to dismiss the popup when another surface of
+ * their own is clicked should dismiss the popup using the destroy
+ * request.
+ *
+ * The parent surface must have either an xdg_surface or xdg_popup
+ * role.
+ *
+ * Specifying an xdg_popup for the parent means that the popups are
+ * nested, with this popup now being the topmost popup. Nested
+ * popups must be destroyed in the reverse order they were created
+ * in, e.g. the only popup you are allowed to destroy at all times
+ * is the topmost one.
+ *
+ * If there is an existing popup when creating a new popup, the
+ * parent must be the current topmost popup.
+ *
+ * A parent surface must be mapped before the new popup is mapped.
+ *
+ * When compositors choose to dismiss a popup, they will likely
+ * dismiss every nested popup as well. When a compositor dismisses
+ * popups, it will follow the same dismissing order as required
+ * from the client.
+ *
+ * The x and y arguments passed when creating the popup object specify
+ * where the top left of the popup should be placed, relative to the
+ * local surface coordinates of the parent surface. See
+ * xdg_shell.get_xdg_popup.
+ *
+ * The client must call wl_surface.commit on the corresponding wl_surface
+ * for the xdg_popup state to take effect.
+ *
+ * For a surface to be mapped by the compositor the client must have
+ * committed both the xdg_popup state and a buffer.
+ */
+extern const struct wl_interface xdg_popup_interface;
+
+#ifndef XDG_SHELL_VERSION_ENUM
+#define XDG_SHELL_VERSION_ENUM
+/**
+ * @ingroup iface_xdg_shell
+ * latest protocol version
+ *
+ * The 'current' member of this enum gives the version of the
+ * protocol. Implementations can compare this to the version
+ * they implement using static_assert to ensure the protocol and
+ * implementation versions match.
+ */
+enum xdg_shell_version {
+ /**
+ * Always the latest version
+ */
+ XDG_SHELL_VERSION_CURRENT = 5,
+};
+#endif /* XDG_SHELL_VERSION_ENUM */
+
+#ifndef XDG_SHELL_ERROR_ENUM
+#define XDG_SHELL_ERROR_ENUM
+enum xdg_shell_error {
+ /**
+ * given wl_surface has another role
+ */
+ XDG_SHELL_ERROR_ROLE = 0,
+ /**
+ * xdg_shell was destroyed before children
+ */
+ XDG_SHELL_ERROR_DEFUNCT_SURFACES = 1,
+ /**
+ * the client tried to map or destroy a non-topmost popup
+ */
+ XDG_SHELL_ERROR_NOT_THE_TOPMOST_POPUP = 2,
+ /**
+ * the client specified an invalid popup parent surface
+ */
+ XDG_SHELL_ERROR_INVALID_POPUP_PARENT = 3,
+};
+#endif /* XDG_SHELL_ERROR_ENUM */
+
+/**
+ * @ingroup iface_xdg_shell
+ * @struct xdg_shell_listener
+ */
+struct xdg_shell_listener {
+ /**
+ * check if the client is alive
+ *
+ * The ping event asks the client if it's still alive. Pass the
+ * serial specified in the event back to the compositor by sending
+ * a "pong" request back with the specified serial.
+ *
+ * Compositors can use this to determine if the client is still
+ * alive. It's unspecified what will happen if the client doesn't
+ * respond to the ping request, or in what timeframe. Clients
+ * should try to respond in a reasonable amount of time.
+ *
+ * A compositor is free to ping in any way it wants, but a client
+ * must always respond to any xdg_shell object it created.
+ * @param serial pass this to the pong request
+ */
+ void (*ping)(void *data,
+ struct xdg_shell *xdg_shell,
+ uint32_t serial);
+};
+
+/**
+ * @ingroup iface_xdg_shell
+ */
+static inline int
+xdg_shell_add_listener(struct xdg_shell *xdg_shell,
+ const struct xdg_shell_listener *listener, void *data)
+{
+ return wl_proxy_add_listener((struct wl_proxy *) xdg_shell,
+ (void (**)(void)) listener, data);
+}
+
+#define XDG_SHELL_DESTROY 0
+#define XDG_SHELL_USE_UNSTABLE_VERSION 1
+#define XDG_SHELL_GET_XDG_SURFACE 2
+#define XDG_SHELL_GET_XDG_POPUP 3
+#define XDG_SHELL_PONG 4
+
+/**
+ * @ingroup iface_xdg_shell
+ */
+#define XDG_SHELL_PING_SINCE_VERSION 1
+
+/**
+ * @ingroup iface_xdg_shell
+ */
+#define XDG_SHELL_DESTROY_SINCE_VERSION 1
+/**
+ * @ingroup iface_xdg_shell
+ */
+#define XDG_SHELL_USE_UNSTABLE_VERSION_SINCE_VERSION 1
+/**
+ * @ingroup iface_xdg_shell
+ */
+#define XDG_SHELL_GET_XDG_SURFACE_SINCE_VERSION 1
+/**
+ * @ingroup iface_xdg_shell
+ */
+#define XDG_SHELL_GET_XDG_POPUP_SINCE_VERSION 1
+/**
+ * @ingroup iface_xdg_shell
+ */
+#define XDG_SHELL_PONG_SINCE_VERSION 1
+
+/** @ingroup iface_xdg_shell */
+static inline void
+xdg_shell_set_user_data(struct xdg_shell *xdg_shell, void *user_data)
+{
+ wl_proxy_set_user_data((struct wl_proxy *) xdg_shell, user_data);
+}
+
+/** @ingroup iface_xdg_shell */
+static inline void *
+xdg_shell_get_user_data(struct xdg_shell *xdg_shell)
+{
+ return wl_proxy_get_user_data((struct wl_proxy *) xdg_shell);
+}
+
+static inline uint32_t
+xdg_shell_get_version(struct xdg_shell *xdg_shell)
+{
+ return wl_proxy_get_version((struct wl_proxy *) xdg_shell);
+}
+
+/**
+ * @ingroup iface_xdg_shell
+ *
+ * Destroy this xdg_shell object.
+ *
+ * Destroying a bound xdg_shell object while there are surfaces
+ * still alive created by this xdg_shell object instance is illegal
+ * and will result in a protocol error.
+ */
+static inline void
+xdg_shell_destroy(struct xdg_shell *xdg_shell)
+{
+ wl_proxy_marshal((struct wl_proxy *) xdg_shell,
+ XDG_SHELL_DESTROY);
+
+ wl_proxy_destroy((struct wl_proxy *) xdg_shell);
+}
+
+/**
+ * @ingroup iface_xdg_shell
+ *
+ * Negotiate the unstable version of the interface. This
+ * mechanism is in place to ensure client and server agree on the
+ * unstable versions of the protocol that they speak or exit
+ * cleanly if they don't agree. This request will go away once
+ * the xdg-shell protocol is stable.
+ */
+static inline void
+xdg_shell_use_unstable_version(struct xdg_shell *xdg_shell, int32_t version)
+{
+ wl_proxy_marshal((struct wl_proxy *) xdg_shell,
+ XDG_SHELL_USE_UNSTABLE_VERSION, version);
+}
+
+/**
+ * @ingroup iface_xdg_shell
+ *
+ * This creates an xdg_surface for the given surface and gives it the
+ * xdg_surface role. A wl_surface can only be given an xdg_surface role
+ * once. If get_xdg_surface is called with a wl_surface that already has
+ * an active xdg_surface associated with it, or if it had any other role,
+ * an error is raised.
+ *
+ * See the documentation of xdg_surface for more details about what an
+ * xdg_surface is and how it is used.
+ */
+static inline struct xdg_surface *
+xdg_shell_get_xdg_surface(struct xdg_shell *xdg_shell, struct wl_surface *surface)
+{
+ struct wl_proxy *id;
+
+ id = wl_proxy_marshal_constructor((struct wl_proxy *) xdg_shell,
+ XDG_SHELL_GET_XDG_SURFACE, &xdg_surface_interface, NULL, surface);
+
+ return (struct xdg_surface *) id;
+}
+
+/**
+ * @ingroup iface_xdg_shell
+ *
+ * This creates an xdg_popup for the given surface and gives it the
+ * xdg_popup role. A wl_surface can only be given an xdg_popup role
+ * once. If get_xdg_popup is called with a wl_surface that already has
+ * an active xdg_popup associated with it, or if it had any other role,
+ * an error is raised.
+ *
+ * This request must be used in response to some sort of user action
+ * like a button press, key press, or touch down event.
+ *
+ * See the documentation of xdg_popup for more details about what an
+ * xdg_popup is and how it is used.
+ */
+static inline struct xdg_popup *
+xdg_shell_get_xdg_popup(struct xdg_shell *xdg_shell, struct wl_surface *surface, struct wl_surface *parent, struct wl_seat *seat, uint32_t serial, int32_t x, int32_t y)
+{
+ struct wl_proxy *id;
+
+ id = wl_proxy_marshal_constructor((struct wl_proxy *) xdg_shell,
+ XDG_SHELL_GET_XDG_POPUP, &xdg_popup_interface, NULL, surface, parent, seat, serial, x, y);
+
+ return (struct xdg_popup *) id;
+}
+
+/**
+ * @ingroup iface_xdg_shell
+ *
+ * A client must respond to a ping event with a pong request or
+ * the client may be deemed unresponsive.
+ */
+static inline void
+xdg_shell_pong(struct xdg_shell *xdg_shell, uint32_t serial)
+{
+ wl_proxy_marshal((struct wl_proxy *) xdg_shell,
+ XDG_SHELL_PONG, serial);
+}
+
+#ifndef XDG_SURFACE_RESIZE_EDGE_ENUM
+#define XDG_SURFACE_RESIZE_EDGE_ENUM
+/**
+ * @ingroup iface_xdg_surface
+ * edge values for resizing
+ *
+ * These values are used to indicate which edge of a surface
+ * is being dragged in a resize operation.
+ */
+enum xdg_surface_resize_edge {
+ XDG_SURFACE_RESIZE_EDGE_NONE = 0,
+ XDG_SURFACE_RESIZE_EDGE_TOP = 1,
+ XDG_SURFACE_RESIZE_EDGE_BOTTOM = 2,
+ XDG_SURFACE_RESIZE_EDGE_LEFT = 4,
+ XDG_SURFACE_RESIZE_EDGE_TOP_LEFT = 5,
+ XDG_SURFACE_RESIZE_EDGE_BOTTOM_LEFT = 6,
+ XDG_SURFACE_RESIZE_EDGE_RIGHT = 8,
+ XDG_SURFACE_RESIZE_EDGE_TOP_RIGHT = 9,
+ XDG_SURFACE_RESIZE_EDGE_BOTTOM_RIGHT = 10,
+};
+#endif /* XDG_SURFACE_RESIZE_EDGE_ENUM */
+
+#ifndef XDG_SURFACE_STATE_ENUM
+#define XDG_SURFACE_STATE_ENUM
+/**
+ * @ingroup iface_xdg_surface
+ * the surface is now activated
+ *
+ * Client window decorations should be painted as if the window is
+ * active. Do not assume this means that the window actually has
+ * keyboard or pointer focus.
+ */
+enum xdg_surface_state {
+ /**
+ * the surface is maximized
+ */
+ XDG_SURFACE_STATE_MAXIMIZED = 1,
+ /**
+ * the surface is fullscreen
+ */
+ XDG_SURFACE_STATE_FULLSCREEN = 2,
+ /**
+ * the surface is being resized
+ */
+ XDG_SURFACE_STATE_RESIZING = 3,
+ /**
+ * the surface is now activated
+ */
+ XDG_SURFACE_STATE_ACTIVATED = 4,
+};
+#endif /* XDG_SURFACE_STATE_ENUM */
+
+/**
+ * @ingroup iface_xdg_surface
+ * @struct xdg_surface_listener
+ */
+struct xdg_surface_listener {
+ /**
+ * suggest a surface change
+ *
+ * The configure event asks the client to resize its surface or
+ * to change its state.
+ *
+ * The width and height arguments specify a hint to the window
+ * about how its surface should be resized in window geometry
+ * coordinates. See set_window_geometry.
+ *
+ * If the width or height arguments are zero, it means the client
+ * should decide its own window dimension. This may happen when the
+ * compositor need to configure the state of the surface but
+ * doesn't have any information about any previous or expected
+ * dimension.
+ *
+ * The states listed in the event specify how the width/height
+ * arguments should be interpreted, and possibly how it should be
+ * drawn.
+ *
+ * Clients should arrange their surface for the new size and
+ * states, and then send a ack_configure request with the serial
+ * sent in this configure event at some point before committing the
+ * new surface.
+ *
+ * If the client receives multiple configure events before it can
+ * respond to one, it is free to discard all but the last event it
+ * received.
+ */
+ void (*configure)(void *data,
+ struct xdg_surface *xdg_surface,
+ int32_t width,
+ int32_t height,
+ struct wl_array *states,
+ uint32_t serial);
+ /**
+ * surface wants to be closed
+ *
+ * The close event is sent by the compositor when the user wants
+ * the surface to be closed. This should be equivalent to the user
+ * clicking the close button in client-side decorations, if your
+ * application has any...
+ *
+ * This is only a request that the user intends to close your
+ * window. The client may choose to ignore this request, or show a
+ * dialog to ask the user to save their data...
+ */
+ void (*close)(void *data,
+ struct xdg_surface *xdg_surface);
+};
+
+/**
+ * @ingroup iface_xdg_surface
+ */
+static inline int
+xdg_surface_add_listener(struct xdg_surface *xdg_surface,
+ const struct xdg_surface_listener *listener, void *data)
+{
+ return wl_proxy_add_listener((struct wl_proxy *) xdg_surface,
+ (void (**)(void)) listener, data);
+}
+
+#define XDG_SURFACE_DESTROY 0
+#define XDG_SURFACE_SET_PARENT 1
+#define XDG_SURFACE_SET_TITLE 2
+#define XDG_SURFACE_SET_APP_ID 3
+#define XDG_SURFACE_SHOW_WINDOW_MENU 4
+#define XDG_SURFACE_MOVE 5
+#define XDG_SURFACE_RESIZE 6
+#define XDG_SURFACE_ACK_CONFIGURE 7
+#define XDG_SURFACE_SET_WINDOW_GEOMETRY 8
+#define XDG_SURFACE_SET_MAXIMIZED 9
+#define XDG_SURFACE_UNSET_MAXIMIZED 10
+#define XDG_SURFACE_SET_FULLSCREEN 11
+#define XDG_SURFACE_UNSET_FULLSCREEN 12
+#define XDG_SURFACE_SET_MINIMIZED 13
+
+/**
+ * @ingroup iface_xdg_surface
+ */
+#define XDG_SURFACE_CONFIGURE_SINCE_VERSION 1
+/**
+ * @ingroup iface_xdg_surface
+ */
+#define XDG_SURFACE_CLOSE_SINCE_VERSION 1
+
+/**
+ * @ingroup iface_xdg_surface
+ */
+#define XDG_SURFACE_DESTROY_SINCE_VERSION 1
+/**
+ * @ingroup iface_xdg_surface
+ */
+#define XDG_SURFACE_SET_PARENT_SINCE_VERSION 1
+/**
+ * @ingroup iface_xdg_surface
+ */
+#define XDG_SURFACE_SET_TITLE_SINCE_VERSION 1
+/**
+ * @ingroup iface_xdg_surface
+ */
+#define XDG_SURFACE_SET_APP_ID_SINCE_VERSION 1
+/**
+ * @ingroup iface_xdg_surface
+ */
+#define XDG_SURFACE_SHOW_WINDOW_MENU_SINCE_VERSION 1
+/**
+ * @ingroup iface_xdg_surface
+ */
+#define XDG_SURFACE_MOVE_SINCE_VERSION 1
+/**
+ * @ingroup iface_xdg_surface
+ */
+#define XDG_SURFACE_RESIZE_SINCE_VERSION 1
+/**
+ * @ingroup iface_xdg_surface
+ */
+#define XDG_SURFACE_ACK_CONFIGURE_SINCE_VERSION 1
+/**
+ * @ingroup iface_xdg_surface
+ */
+#define XDG_SURFACE_SET_WINDOW_GEOMETRY_SINCE_VERSION 1
+/**
+ * @ingroup iface_xdg_surface
+ */
+#define XDG_SURFACE_SET_MAXIMIZED_SINCE_VERSION 1
+/**
+ * @ingroup iface_xdg_surface
+ */
+#define XDG_SURFACE_UNSET_MAXIMIZED_SINCE_VERSION 1
+/**
+ * @ingroup iface_xdg_surface
+ */
+#define XDG_SURFACE_SET_FULLSCREEN_SINCE_VERSION 1
+/**
+ * @ingroup iface_xdg_surface
+ */
+#define XDG_SURFACE_UNSET_FULLSCREEN_SINCE_VERSION 1
+/**
+ * @ingroup iface_xdg_surface
+ */
+#define XDG_SURFACE_SET_MINIMIZED_SINCE_VERSION 1
+
+/** @ingroup iface_xdg_surface */
+static inline void
+xdg_surface_set_user_data(struct xdg_surface *xdg_surface, void *user_data)
+{
+ wl_proxy_set_user_data((struct wl_proxy *) xdg_surface, user_data);
+}
+
+/** @ingroup iface_xdg_surface */
+static inline void *
+xdg_surface_get_user_data(struct xdg_surface *xdg_surface)
+{
+ return wl_proxy_get_user_data((struct wl_proxy *) xdg_surface);
+}
+
+static inline uint32_t
+xdg_surface_get_version(struct xdg_surface *xdg_surface)
+{
+ return wl_proxy_get_version((struct wl_proxy *) xdg_surface);
+}
+
+/**
+ * @ingroup iface_xdg_surface
+ *
+ * Unmap and destroy the window. The window will be effectively
+ * hidden from the user's point of view, and all state like
+ * maximization, fullscreen, and so on, will be lost.
+ */
+static inline void
+xdg_surface_destroy(struct xdg_surface *xdg_surface)
+{
+ wl_proxy_marshal((struct wl_proxy *) xdg_surface,
+ XDG_SURFACE_DESTROY);
+
+ wl_proxy_destroy((struct wl_proxy *) xdg_surface);
+}
+
+/**
+ * @ingroup iface_xdg_surface
+ *
+ * Set the "parent" of this surface. This window should be stacked
+ * above a parent. The parent surface must be mapped as long as this
+ * surface is mapped.
+ *
+ * Parent windows should be set on dialogs, toolboxes, or other
+ * "auxiliary" surfaces, so that the parent is raised when the dialog
+ * is raised.
+ */
+static inline void
+xdg_surface_set_parent(struct xdg_surface *xdg_surface, struct xdg_surface *parent)
+{
+ wl_proxy_marshal((struct wl_proxy *) xdg_surface,
+ XDG_SURFACE_SET_PARENT, parent);
+}
+
+/**
+ * @ingroup iface_xdg_surface
+ *
+ * Set a short title for the surface.
+ *
+ * This string may be used to identify the surface in a task bar,
+ * window list, or other user interface elements provided by the
+ * compositor.
+ *
+ * The string must be encoded in UTF-8.
+ */
+static inline void
+xdg_surface_set_title(struct xdg_surface *xdg_surface, const char *title)
+{
+ wl_proxy_marshal((struct wl_proxy *) xdg_surface,
+ XDG_SURFACE_SET_TITLE, title);
+}
+
+/**
+ * @ingroup iface_xdg_surface
+ *
+ * Set an application identifier for the surface.
+ *
+ * The app ID identifies the general class of applications to which
+ * the surface belongs. The compositor can use this to group multiple
+ * surfaces together, or to determine how to launch a new application.
+ *
+ * For D-Bus activatable applications, the app ID is used as the D-Bus
+ * service name.
+ *
+ * The compositor shell will try to group application surfaces together
+ * by their app ID. As a best practice, it is suggested to select app
+ * ID's that match the basename of the application's .desktop file.
+ * For example, "org.freedesktop.FooViewer" where the .desktop file is
+ * "org.freedesktop.FooViewer.desktop".
+ *
+ * See the desktop-entry specification [0] for more details on
+ * application identifiers and how they relate to well-known D-Bus
+ * names and .desktop files.
+ *
+ * [0] http://standards.freedesktop.org/desktop-entry-spec/
+ */
+static inline void
+xdg_surface_set_app_id(struct xdg_surface *xdg_surface, const char *app_id)
+{
+ wl_proxy_marshal((struct wl_proxy *) xdg_surface,
+ XDG_SURFACE_SET_APP_ID, app_id);
+}
+
+/**
+ * @ingroup iface_xdg_surface
+ *
+ * Clients implementing client-side decorations might want to show
+ * a context menu when right-clicking on the decorations, giving the
+ * user a menu that they can use to maximize or minimize the window.
+ *
+ * This request asks the compositor to pop up such a window menu at
+ * the given position, relative to the local surface coordinates of
+ * the parent surface. There are no guarantees as to what menu items
+ * the window menu contains.
+ *
+ * This request must be used in response to some sort of user action
+ * like a button press, key press, or touch down event.
+ */
+static inline void
+xdg_surface_show_window_menu(struct xdg_surface *xdg_surface, struct wl_seat *seat, uint32_t serial, int32_t x, int32_t y)
+{
+ wl_proxy_marshal((struct wl_proxy *) xdg_surface,
+ XDG_SURFACE_SHOW_WINDOW_MENU, seat, serial, x, y);
+}
+
+/**
+ * @ingroup iface_xdg_surface
+ *
+ * Start an interactive, user-driven move of the surface.
+ *
+ * This request must be used in response to some sort of user action
+ * like a button press, key press, or touch down event. The passed
+ * serial is used to determine the type of interactive move (touch,
+ * pointer, etc).
+ *
+ * The server may ignore move requests depending on the state of
+ * the surface (e.g. fullscreen or maximized), or if the passed serial
+ * is no longer valid.
+ *
+ * If triggered, the surface will lose the focus of the device
+ * (wl_pointer, wl_touch, etc) used for the move. It is up to the
+ * compositor to visually indicate that the move is taking place, such as
+ * updating a pointer cursor, during the move. There is no guarantee
+ * that the device focus will return when the move is completed.
+ */
+static inline void
+xdg_surface_move(struct xdg_surface *xdg_surface, struct wl_seat *seat, uint32_t serial)
+{
+ wl_proxy_marshal((struct wl_proxy *) xdg_surface,
+ XDG_SURFACE_MOVE, seat, serial);
+}
+
+/**
+ * @ingroup iface_xdg_surface
+ *
+ * Start a user-driven, interactive resize of the surface.
+ *
+ * This request must be used in response to some sort of user action
+ * like a button press, key press, or touch down event. The passed
+ * serial is used to determine the type of interactive resize (touch,
+ * pointer, etc).
+ *
+ * The server may ignore resize requests depending on the state of
+ * the surface (e.g. fullscreen or maximized).
+ *
+ * If triggered, the client will receive configure events with the
+ * "resize" state enum value and the expected sizes. See the "resize"
+ * enum value for more details about what is required. The client
+ * must also acknowledge configure events using "ack_configure". After
+ * the resize is completed, the client will receive another "configure"
+ * event without the resize state.
+ *
+ * If triggered, the surface also will lose the focus of the device
+ * (wl_pointer, wl_touch, etc) used for the resize. It is up to the
+ * compositor to visually indicate that the resize is taking place,
+ * such as updating a pointer cursor, during the resize. There is no
+ * guarantee that the device focus will return when the resize is
+ * completed.
+ *
+ * The edges parameter specifies how the surface should be resized,
+ * and is one of the values of the resize_edge enum. The compositor
+ * may use this information to update the surface position for
+ * example when dragging the top left corner. The compositor may also
+ * use this information to adapt its behavior, e.g. choose an
+ * appropriate cursor image.
+ */
+static inline void
+xdg_surface_resize(struct xdg_surface *xdg_surface, struct wl_seat *seat, uint32_t serial, uint32_t edges)
+{
+ wl_proxy_marshal((struct wl_proxy *) xdg_surface,
+ XDG_SURFACE_RESIZE, seat, serial, edges);
+}
+
+/**
+ * @ingroup iface_xdg_surface
+ *
+ * When a configure event is received, if a client commits the
+ * surface in response to the configure event, then the client
+ * must make an ack_configure request sometime before the commit
+ * request, passing along the serial of the configure event.
+ *
+ * For instance, the compositor might use this information to move
+ * a surface to the top left only when the client has drawn itself
+ * for the maximized or fullscreen state.
+ *
+ * If the client receives multiple configure events before it
+ * can respond to one, it only has to ack the last configure event.
+ *
+ * A client is not required to commit immediately after sending
+ * an ack_configure request - it may even ack_configure several times
+ * before its next surface commit.
+ *
+ * The compositor expects that the most recently received
+ * ack_configure request at the time of a commit indicates which
+ * configure event the client is responding to.
+ */
+static inline void
+xdg_surface_ack_configure(struct xdg_surface *xdg_surface, uint32_t serial)
+{
+ wl_proxy_marshal((struct wl_proxy *) xdg_surface,
+ XDG_SURFACE_ACK_CONFIGURE, serial);
+}
+
+/**
+ * @ingroup iface_xdg_surface
+ *
+ * The window geometry of a window is its "visible bounds" from the
+ * user's perspective. Client-side decorations often have invisible
+ * portions like drop-shadows which should be ignored for the
+ * purposes of aligning, placing and constraining windows.
+ *
+ * The window geometry is double buffered, and will be applied at the
+ * time wl_surface.commit of the corresponding wl_surface is called.
+ *
+ * Once the window geometry of the surface is set once, it is not
+ * possible to unset it, and it will remain the same until
+ * set_window_geometry is called again, even if a new subsurface or
+ * buffer is attached.
+ *
+ * If never set, the value is the full bounds of the surface,
+ * including any subsurfaces. This updates dynamically on every
+ * commit. This unset mode is meant for extremely simple clients.
+ *
+ * If responding to a configure event, the window geometry in here
+ * must respect the sizing negotiations specified by the states in
+ * the configure event.
+ *
+ * The arguments are given in the surface local coordinate space of
+ * the wl_surface associated with this xdg_surface.
+ *
+ * The width and height must be greater than zero.
+ */
+static inline void
+xdg_surface_set_window_geometry(struct xdg_surface *xdg_surface, int32_t x, int32_t y, int32_t width, int32_t height)
+{
+ wl_proxy_marshal((struct wl_proxy *) xdg_surface,
+ XDG_SURFACE_SET_WINDOW_GEOMETRY, x, y, width, height);
+}
+
+/**
+ * @ingroup iface_xdg_surface
+ *
+ * Maximize the surface.
+ *
+ * After requesting that the surface should be maximized, the compositor
+ * will respond by emitting a configure event with the "maximized" state
+ * and the required window geometry. The client should then update its
+ * content, drawing it in a maximized state, i.e. without shadow or other
+ * decoration outside of the window geometry. The client must also
+ * acknowledge the configure when committing the new content (see
+ * ack_configure).
+ *
+ * It is up to the compositor to decide how and where to maximize the
+ * surface, for example which output and what region of the screen should
+ * be used.
+ *
+ * If the surface was already maximized, the compositor will still emit
+ * a configure event with the "maximized" state.
+ */
+static inline void
+xdg_surface_set_maximized(struct xdg_surface *xdg_surface)
+{
+ wl_proxy_marshal((struct wl_proxy *) xdg_surface,
+ XDG_SURFACE_SET_MAXIMIZED);
+}
+
+/**
+ * @ingroup iface_xdg_surface
+ *
+ * Unmaximize the surface.
+ *
+ * After requesting that the surface should be unmaximized, the compositor
+ * will respond by emitting a configure event without the "maximized"
+ * state. If available, the compositor will include the window geometry
+ * dimensions the window had prior to being maximized in the configure
+ * request. The client must then update its content, drawing it in a
+ * regular state, i.e. potentially with shadow, etc. The client must also
+ * acknowledge the configure when committing the new content (see
+ * ack_configure).
+ *
+ * It is up to the compositor to position the surface after it was
+ * unmaximized; usually the position the surface had before maximizing, if
+ * applicable.
+ *
+ * If the surface was already not maximized, the compositor will still
+ * emit a configure event without the "maximized" state.
+ */
+static inline void
+xdg_surface_unset_maximized(struct xdg_surface *xdg_surface)
+{
+ wl_proxy_marshal((struct wl_proxy *) xdg_surface,
+ XDG_SURFACE_UNSET_MAXIMIZED);
+}
+
+/**
+ * @ingroup iface_xdg_surface
+ *
+ * Make the surface fullscreen.
+ *
+ * You can specify an output that you would prefer to be fullscreen.
+ * If this value is NULL, it's up to the compositor to choose which
+ * display will be used to map this surface.
+ *
+ * If the surface doesn't cover the whole output, the compositor will
+ * position the surface in the center of the output and compensate with
+ * black borders filling the rest of the output.
+ */
+static inline void
+xdg_surface_set_fullscreen(struct xdg_surface *xdg_surface, struct wl_output *output)
+{
+ wl_proxy_marshal((struct wl_proxy *) xdg_surface,
+ XDG_SURFACE_SET_FULLSCREEN, output);
+}
+
+/**
+ * @ingroup iface_xdg_surface
+ */
+static inline void
+xdg_surface_unset_fullscreen(struct xdg_surface *xdg_surface)
+{
+ wl_proxy_marshal((struct wl_proxy *) xdg_surface,
+ XDG_SURFACE_UNSET_FULLSCREEN);
+}
+
+/**
+ * @ingroup iface_xdg_surface
+ *
+ * Request that the compositor minimize your surface. There is no
+ * way to know if the surface is currently minimized, nor is there
+ * any way to unset minimization on this surface.
+ *
+ * If you are looking to throttle redrawing when minimized, please
+ * instead use the wl_surface.frame event for this, as this will
+ * also work with live previews on windows in Alt-Tab, Expose or
+ * similar compositor features.
+ */
+static inline void
+xdg_surface_set_minimized(struct xdg_surface *xdg_surface)
+{
+ wl_proxy_marshal((struct wl_proxy *) xdg_surface,
+ XDG_SURFACE_SET_MINIMIZED);
+}
+
+/**
+ * @ingroup iface_xdg_popup
+ * @struct xdg_popup_listener
+ */
+struct xdg_popup_listener {
+ /**
+ * popup interaction is done
+ *
+ * The popup_done event is sent out when a popup is dismissed by
+ * the compositor. The client should destroy the xdg_popup object
+ * at this point.
+ */
+ void (*popup_done)(void *data,
+ struct xdg_popup *xdg_popup);
+};
+
+/**
+ * @ingroup iface_xdg_popup
+ */
+static inline int
+xdg_popup_add_listener(struct xdg_popup *xdg_popup,
+ const struct xdg_popup_listener *listener, void *data)
+{
+ return wl_proxy_add_listener((struct wl_proxy *) xdg_popup,
+ (void (**)(void)) listener, data);
+}
+
+#define XDG_POPUP_DESTROY 0
+
+/**
+ * @ingroup iface_xdg_popup
+ */
+#define XDG_POPUP_POPUP_DONE_SINCE_VERSION 1
+
+/**
+ * @ingroup iface_xdg_popup
+ */
+#define XDG_POPUP_DESTROY_SINCE_VERSION 1
+
+/** @ingroup iface_xdg_popup */
+static inline void
+xdg_popup_set_user_data(struct xdg_popup *xdg_popup, void *user_data)
+{
+ wl_proxy_set_user_data((struct wl_proxy *) xdg_popup, user_data);
+}
+
+/** @ingroup iface_xdg_popup */
+static inline void *
+xdg_popup_get_user_data(struct xdg_popup *xdg_popup)
+{
+ return wl_proxy_get_user_data((struct wl_proxy *) xdg_popup);
+}
+
+static inline uint32_t
+xdg_popup_get_version(struct xdg_popup *xdg_popup)
+{
+ return wl_proxy_get_version((struct wl_proxy *) xdg_popup);
+}
+
+/**
+ * @ingroup iface_xdg_popup
+ *
+ * This destroys the popup. Explicitly destroying the xdg_popup
+ * object will also dismiss the popup, and unmap the surface.
+ *
+ * If this xdg_popup is not the "topmost" popup, a protocol error
+ * will be sent.
+ */
+static inline void
+xdg_popup_destroy(struct xdg_popup *xdg_popup)
+{
+ wl_proxy_marshal((struct wl_proxy *) xdg_popup,
+ XDG_POPUP_DESTROY);
+
+ wl_proxy_destroy((struct wl_proxy *) xdg_popup);
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/chromium/third_party/wayland-protocols/include/protocol/xdg-shell-unstable-v5-server-protocol.h b/chromium/third_party/wayland-protocols/include/protocol/xdg-shell-unstable-v5-server-protocol.h
new file mode 100644
index 00000000000..4ef85e7add2
--- /dev/null
+++ b/chromium/third_party/wayland-protocols/include/protocol/xdg-shell-unstable-v5-server-protocol.h
@@ -0,0 +1,903 @@
+/* Generated by wayland-scanner 1.13.0 */
+
+#ifndef XDG_SHELL_UNSTABLE_V5_SERVER_PROTOCOL_H
+#define XDG_SHELL_UNSTABLE_V5_SERVER_PROTOCOL_H
+
+#include <stdint.h>
+#include <stddef.h>
+#include "wayland-server.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct wl_client;
+struct wl_resource;
+
+/**
+ * @page page_xdg_shell_unstable_v5 The xdg_shell_unstable_v5 protocol
+ * @section page_ifaces_xdg_shell_unstable_v5 Interfaces
+ * - @subpage page_iface_xdg_shell - create desktop-style surfaces
+ * - @subpage page_iface_xdg_surface - A desktop window
+ * - @subpage page_iface_xdg_popup - short-lived, popup surfaces for menus
+ * @section page_copyright_xdg_shell_unstable_v5 Copyright
+ * <pre>
+ *
+ * Copyright © 2008-2013 Kristian Høgsberg
+ * Copyright © 2013 Rafael Antognolli
+ * Copyright © 2013 Jasper St. Pierre
+ * Copyright © 2010-2013 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ * </pre>
+ */
+struct wl_output;
+struct wl_seat;
+struct wl_surface;
+struct xdg_popup;
+struct xdg_shell;
+struct xdg_surface;
+
+/**
+ * @page page_iface_xdg_shell xdg_shell
+ * @section page_iface_xdg_shell_desc Description
+ *
+ * xdg_shell allows clients to turn a wl_surface into a "real window"
+ * which can be dragged, resized, stacked, and moved around by the
+ * user. Everything about this interface is suited towards traditional
+ * desktop environments.
+ * @section page_iface_xdg_shell_api API
+ * See @ref iface_xdg_shell.
+ */
+/**
+ * @defgroup iface_xdg_shell The xdg_shell interface
+ *
+ * xdg_shell allows clients to turn a wl_surface into a "real window"
+ * which can be dragged, resized, stacked, and moved around by the
+ * user. Everything about this interface is suited towards traditional
+ * desktop environments.
+ */
+extern const struct wl_interface xdg_shell_interface;
+/**
+ * @page page_iface_xdg_surface xdg_surface
+ * @section page_iface_xdg_surface_desc Description
+ *
+ * An interface that may be implemented by a wl_surface, for
+ * implementations that provide a desktop-style user interface.
+ *
+ * It provides requests to treat surfaces like windows, allowing to set
+ * properties like maximized, fullscreen, minimized, and to move and resize
+ * them, and associate metadata like title and app id.
+ *
+ * The client must call wl_surface.commit on the corresponding wl_surface
+ * for the xdg_surface state to take effect. Prior to committing the new
+ * state, it can set up initial configuration, such as maximizing or setting
+ * a window geometry.
+ *
+ * Even without attaching a buffer the compositor must respond to initial
+ * committed configuration, for instance sending a configure event with
+ * expected window geometry if the client maximized its surface during
+ * initialization.
+ *
+ * For a surface to be mapped by the compositor the client must have
+ * committed both an xdg_surface state and a buffer.
+ * @section page_iface_xdg_surface_api API
+ * See @ref iface_xdg_surface.
+ */
+/**
+ * @defgroup iface_xdg_surface The xdg_surface interface
+ *
+ * An interface that may be implemented by a wl_surface, for
+ * implementations that provide a desktop-style user interface.
+ *
+ * It provides requests to treat surfaces like windows, allowing to set
+ * properties like maximized, fullscreen, minimized, and to move and resize
+ * them, and associate metadata like title and app id.
+ *
+ * The client must call wl_surface.commit on the corresponding wl_surface
+ * for the xdg_surface state to take effect. Prior to committing the new
+ * state, it can set up initial configuration, such as maximizing or setting
+ * a window geometry.
+ *
+ * Even without attaching a buffer the compositor must respond to initial
+ * committed configuration, for instance sending a configure event with
+ * expected window geometry if the client maximized its surface during
+ * initialization.
+ *
+ * For a surface to be mapped by the compositor the client must have
+ * committed both an xdg_surface state and a buffer.
+ */
+extern const struct wl_interface xdg_surface_interface;
+/**
+ * @page page_iface_xdg_popup xdg_popup
+ * @section page_iface_xdg_popup_desc Description
+ *
+ * A popup surface is a short-lived, temporary surface that can be
+ * used to implement menus. It takes an explicit grab on the surface
+ * that will be dismissed when the user dismisses the popup. This can
+ * be done by the user clicking outside the surface, using the keyboard,
+ * or even locking the screen through closing the lid or a timeout.
+ *
+ * When the popup is dismissed, a popup_done event will be sent out,
+ * and at the same time the surface will be unmapped. The xdg_popup
+ * object is now inert and cannot be reactivated, so clients should
+ * destroy it. Explicitly destroying the xdg_popup object will also
+ * dismiss the popup and unmap the surface.
+ *
+ * Clients will receive events for all their surfaces during this
+ * grab (which is an "owner-events" grab in X11 parlance). This is
+ * done so that users can navigate through submenus and other
+ * "nested" popup windows without having to dismiss the topmost
+ * popup.
+ *
+ * Clients that want to dismiss the popup when another surface of
+ * their own is clicked should dismiss the popup using the destroy
+ * request.
+ *
+ * The parent surface must have either an xdg_surface or xdg_popup
+ * role.
+ *
+ * Specifying an xdg_popup for the parent means that the popups are
+ * nested, with this popup now being the topmost popup. Nested
+ * popups must be destroyed in the reverse order they were created
+ * in, e.g. the only popup you are allowed to destroy at all times
+ * is the topmost one.
+ *
+ * If there is an existing popup when creating a new popup, the
+ * parent must be the current topmost popup.
+ *
+ * A parent surface must be mapped before the new popup is mapped.
+ *
+ * When compositors choose to dismiss a popup, they will likely
+ * dismiss every nested popup as well. When a compositor dismisses
+ * popups, it will follow the same dismissing order as required
+ * from the client.
+ *
+ * The x and y arguments passed when creating the popup object specify
+ * where the top left of the popup should be placed, relative to the
+ * local surface coordinates of the parent surface. See
+ * xdg_shell.get_xdg_popup.
+ *
+ * The client must call wl_surface.commit on the corresponding wl_surface
+ * for the xdg_popup state to take effect.
+ *
+ * For a surface to be mapped by the compositor the client must have
+ * committed both the xdg_popup state and a buffer.
+ * @section page_iface_xdg_popup_api API
+ * See @ref iface_xdg_popup.
+ */
+/**
+ * @defgroup iface_xdg_popup The xdg_popup interface
+ *
+ * A popup surface is a short-lived, temporary surface that can be
+ * used to implement menus. It takes an explicit grab on the surface
+ * that will be dismissed when the user dismisses the popup. This can
+ * be done by the user clicking outside the surface, using the keyboard,
+ * or even locking the screen through closing the lid or a timeout.
+ *
+ * When the popup is dismissed, a popup_done event will be sent out,
+ * and at the same time the surface will be unmapped. The xdg_popup
+ * object is now inert and cannot be reactivated, so clients should
+ * destroy it. Explicitly destroying the xdg_popup object will also
+ * dismiss the popup and unmap the surface.
+ *
+ * Clients will receive events for all their surfaces during this
+ * grab (which is an "owner-events" grab in X11 parlance). This is
+ * done so that users can navigate through submenus and other
+ * "nested" popup windows without having to dismiss the topmost
+ * popup.
+ *
+ * Clients that want to dismiss the popup when another surface of
+ * their own is clicked should dismiss the popup using the destroy
+ * request.
+ *
+ * The parent surface must have either an xdg_surface or xdg_popup
+ * role.
+ *
+ * Specifying an xdg_popup for the parent means that the popups are
+ * nested, with this popup now being the topmost popup. Nested
+ * popups must be destroyed in the reverse order they were created
+ * in, e.g. the only popup you are allowed to destroy at all times
+ * is the topmost one.
+ *
+ * If there is an existing popup when creating a new popup, the
+ * parent must be the current topmost popup.
+ *
+ * A parent surface must be mapped before the new popup is mapped.
+ *
+ * When compositors choose to dismiss a popup, they will likely
+ * dismiss every nested popup as well. When a compositor dismisses
+ * popups, it will follow the same dismissing order as required
+ * from the client.
+ *
+ * The x and y arguments passed when creating the popup object specify
+ * where the top left of the popup should be placed, relative to the
+ * local surface coordinates of the parent surface. See
+ * xdg_shell.get_xdg_popup.
+ *
+ * The client must call wl_surface.commit on the corresponding wl_surface
+ * for the xdg_popup state to take effect.
+ *
+ * For a surface to be mapped by the compositor the client must have
+ * committed both the xdg_popup state and a buffer.
+ */
+extern const struct wl_interface xdg_popup_interface;
+
+#ifndef XDG_SHELL_VERSION_ENUM
+#define XDG_SHELL_VERSION_ENUM
+/**
+ * @ingroup iface_xdg_shell
+ * latest protocol version
+ *
+ * The 'current' member of this enum gives the version of the
+ * protocol. Implementations can compare this to the version
+ * they implement using static_assert to ensure the protocol and
+ * implementation versions match.
+ */
+enum xdg_shell_version {
+ /**
+ * Always the latest version
+ */
+ XDG_SHELL_VERSION_CURRENT = 5,
+};
+#endif /* XDG_SHELL_VERSION_ENUM */
+
+#ifndef XDG_SHELL_ERROR_ENUM
+#define XDG_SHELL_ERROR_ENUM
+enum xdg_shell_error {
+ /**
+ * given wl_surface has another role
+ */
+ XDG_SHELL_ERROR_ROLE = 0,
+ /**
+ * xdg_shell was destroyed before children
+ */
+ XDG_SHELL_ERROR_DEFUNCT_SURFACES = 1,
+ /**
+ * the client tried to map or destroy a non-topmost popup
+ */
+ XDG_SHELL_ERROR_NOT_THE_TOPMOST_POPUP = 2,
+ /**
+ * the client specified an invalid popup parent surface
+ */
+ XDG_SHELL_ERROR_INVALID_POPUP_PARENT = 3,
+};
+#endif /* XDG_SHELL_ERROR_ENUM */
+
+/**
+ * @ingroup iface_xdg_shell
+ * @struct xdg_shell_interface
+ */
+struct xdg_shell_interface {
+ /**
+ * destroy xdg_shell
+ *
+ * Destroy this xdg_shell object.
+ *
+ * Destroying a bound xdg_shell object while there are surfaces
+ * still alive created by this xdg_shell object instance is illegal
+ * and will result in a protocol error.
+ */
+ void (*destroy)(struct wl_client *client,
+ struct wl_resource *resource);
+ /**
+ * enable use of this unstable version
+ *
+ * Negotiate the unstable version of the interface. This
+ * mechanism is in place to ensure client and server agree on the
+ * unstable versions of the protocol that they speak or exit
+ * cleanly if they don't agree. This request will go away once the
+ * xdg-shell protocol is stable.
+ */
+ void (*use_unstable_version)(struct wl_client *client,
+ struct wl_resource *resource,
+ int32_t version);
+ /**
+ * create a shell surface from a surface
+ *
+ * This creates an xdg_surface for the given surface and gives it
+ * the xdg_surface role. A wl_surface can only be given an
+ * xdg_surface role once. If get_xdg_surface is called with a
+ * wl_surface that already has an active xdg_surface associated
+ * with it, or if it had any other role, an error is raised.
+ *
+ * See the documentation of xdg_surface for more details about what
+ * an xdg_surface is and how it is used.
+ */
+ void (*get_xdg_surface)(struct wl_client *client,
+ struct wl_resource *resource,
+ uint32_t id,
+ struct wl_resource *surface);
+ /**
+ * create a popup for a surface
+ *
+ * This creates an xdg_popup for the given surface and gives it
+ * the xdg_popup role. A wl_surface can only be given an xdg_popup
+ * role once. If get_xdg_popup is called with a wl_surface that
+ * already has an active xdg_popup associated with it, or if it had
+ * any other role, an error is raised.
+ *
+ * This request must be used in response to some sort of user
+ * action like a button press, key press, or touch down event.
+ *
+ * See the documentation of xdg_popup for more details about what
+ * an xdg_popup is and how it is used.
+ * @param seat the wl_seat of the user event
+ * @param serial the serial of the user event
+ */
+ void (*get_xdg_popup)(struct wl_client *client,
+ struct wl_resource *resource,
+ uint32_t id,
+ struct wl_resource *surface,
+ struct wl_resource *parent,
+ struct wl_resource *seat,
+ uint32_t serial,
+ int32_t x,
+ int32_t y);
+ /**
+ * respond to a ping event
+ *
+ * A client must respond to a ping event with a pong request or
+ * the client may be deemed unresponsive.
+ * @param serial serial of the ping event
+ */
+ void (*pong)(struct wl_client *client,
+ struct wl_resource *resource,
+ uint32_t serial);
+};
+
+#define XDG_SHELL_PING 0
+
+/**
+ * @ingroup iface_xdg_shell
+ */
+#define XDG_SHELL_PING_SINCE_VERSION 1
+
+/**
+ * @ingroup iface_xdg_shell
+ */
+#define XDG_SHELL_DESTROY_SINCE_VERSION 1
+/**
+ * @ingroup iface_xdg_shell
+ */
+#define XDG_SHELL_USE_UNSTABLE_VERSION_SINCE_VERSION 1
+/**
+ * @ingroup iface_xdg_shell
+ */
+#define XDG_SHELL_GET_XDG_SURFACE_SINCE_VERSION 1
+/**
+ * @ingroup iface_xdg_shell
+ */
+#define XDG_SHELL_GET_XDG_POPUP_SINCE_VERSION 1
+/**
+ * @ingroup iface_xdg_shell
+ */
+#define XDG_SHELL_PONG_SINCE_VERSION 1
+
+/**
+ * @ingroup iface_xdg_shell
+ * Sends an ping event to the client owning the resource.
+ * @param resource_ The client's resource
+ * @param serial pass this to the pong request
+ */
+static inline void
+xdg_shell_send_ping(struct wl_resource *resource_, uint32_t serial)
+{
+ wl_resource_post_event(resource_, XDG_SHELL_PING, serial);
+}
+
+#ifndef XDG_SURFACE_RESIZE_EDGE_ENUM
+#define XDG_SURFACE_RESIZE_EDGE_ENUM
+/**
+ * @ingroup iface_xdg_surface
+ * edge values for resizing
+ *
+ * These values are used to indicate which edge of a surface
+ * is being dragged in a resize operation.
+ */
+enum xdg_surface_resize_edge {
+ XDG_SURFACE_RESIZE_EDGE_NONE = 0,
+ XDG_SURFACE_RESIZE_EDGE_TOP = 1,
+ XDG_SURFACE_RESIZE_EDGE_BOTTOM = 2,
+ XDG_SURFACE_RESIZE_EDGE_LEFT = 4,
+ XDG_SURFACE_RESIZE_EDGE_TOP_LEFT = 5,
+ XDG_SURFACE_RESIZE_EDGE_BOTTOM_LEFT = 6,
+ XDG_SURFACE_RESIZE_EDGE_RIGHT = 8,
+ XDG_SURFACE_RESIZE_EDGE_TOP_RIGHT = 9,
+ XDG_SURFACE_RESIZE_EDGE_BOTTOM_RIGHT = 10,
+};
+#endif /* XDG_SURFACE_RESIZE_EDGE_ENUM */
+
+#ifndef XDG_SURFACE_STATE_ENUM
+#define XDG_SURFACE_STATE_ENUM
+/**
+ * @ingroup iface_xdg_surface
+ * the surface is now activated
+ *
+ * Client window decorations should be painted as if the window is
+ * active. Do not assume this means that the window actually has
+ * keyboard or pointer focus.
+ */
+enum xdg_surface_state {
+ /**
+ * the surface is maximized
+ */
+ XDG_SURFACE_STATE_MAXIMIZED = 1,
+ /**
+ * the surface is fullscreen
+ */
+ XDG_SURFACE_STATE_FULLSCREEN = 2,
+ /**
+ * the surface is being resized
+ */
+ XDG_SURFACE_STATE_RESIZING = 3,
+ /**
+ * the surface is now activated
+ */
+ XDG_SURFACE_STATE_ACTIVATED = 4,
+};
+#endif /* XDG_SURFACE_STATE_ENUM */
+
+/**
+ * @ingroup iface_xdg_surface
+ * @struct xdg_surface_interface
+ */
+struct xdg_surface_interface {
+ /**
+ * Destroy the xdg_surface
+ *
+ * Unmap and destroy the window. The window will be effectively
+ * hidden from the user's point of view, and all state like
+ * maximization, fullscreen, and so on, will be lost.
+ */
+ void (*destroy)(struct wl_client *client,
+ struct wl_resource *resource);
+ /**
+ * set the parent of this surface
+ *
+ * Set the "parent" of this surface. This window should be
+ * stacked above a parent. The parent surface must be mapped as
+ * long as this surface is mapped.
+ *
+ * Parent windows should be set on dialogs, toolboxes, or other
+ * "auxiliary" surfaces, so that the parent is raised when the
+ * dialog is raised.
+ */
+ void (*set_parent)(struct wl_client *client,
+ struct wl_resource *resource,
+ struct wl_resource *parent);
+ /**
+ * set surface title
+ *
+ * Set a short title for the surface.
+ *
+ * This string may be used to identify the surface in a task bar,
+ * window list, or other user interface elements provided by the
+ * compositor.
+ *
+ * The string must be encoded in UTF-8.
+ */
+ void (*set_title)(struct wl_client *client,
+ struct wl_resource *resource,
+ const char *title);
+ /**
+ * set application ID
+ *
+ * Set an application identifier for the surface.
+ *
+ * The app ID identifies the general class of applications to which
+ * the surface belongs. The compositor can use this to group
+ * multiple surfaces together, or to determine how to launch a new
+ * application.
+ *
+ * For D-Bus activatable applications, the app ID is used as the
+ * D-Bus service name.
+ *
+ * The compositor shell will try to group application surfaces
+ * together by their app ID. As a best practice, it is suggested to
+ * select app ID's that match the basename of the application's
+ * .desktop file. For example, "org.freedesktop.FooViewer" where
+ * the .desktop file is "org.freedesktop.FooViewer.desktop".
+ *
+ * See the desktop-entry specification [0] for more details on
+ * application identifiers and how they relate to well-known D-Bus
+ * names and .desktop files.
+ *
+ * [0] http://standards.freedesktop.org/desktop-entry-spec/
+ */
+ void (*set_app_id)(struct wl_client *client,
+ struct wl_resource *resource,
+ const char *app_id);
+ /**
+ * show the window menu
+ *
+ * Clients implementing client-side decorations might want to
+ * show a context menu when right-clicking on the decorations,
+ * giving the user a menu that they can use to maximize or minimize
+ * the window.
+ *
+ * This request asks the compositor to pop up such a window menu at
+ * the given position, relative to the local surface coordinates of
+ * the parent surface. There are no guarantees as to what menu
+ * items the window menu contains.
+ *
+ * This request must be used in response to some sort of user
+ * action like a button press, key press, or touch down event.
+ * @param seat the wl_seat of the user event
+ * @param serial the serial of the user event
+ * @param x the x position to pop up the window menu at
+ * @param y the y position to pop up the window menu at
+ */
+ void (*show_window_menu)(struct wl_client *client,
+ struct wl_resource *resource,
+ struct wl_resource *seat,
+ uint32_t serial,
+ int32_t x,
+ int32_t y);
+ /**
+ * start an interactive move
+ *
+ * Start an interactive, user-driven move of the surface.
+ *
+ * This request must be used in response to some sort of user
+ * action like a button press, key press, or touch down event. The
+ * passed serial is used to determine the type of interactive move
+ * (touch, pointer, etc).
+ *
+ * The server may ignore move requests depending on the state of
+ * the surface (e.g. fullscreen or maximized), or if the passed
+ * serial is no longer valid.
+ *
+ * If triggered, the surface will lose the focus of the device
+ * (wl_pointer, wl_touch, etc) used for the move. It is up to the
+ * compositor to visually indicate that the move is taking place,
+ * such as updating a pointer cursor, during the move. There is no
+ * guarantee that the device focus will return when the move is
+ * completed.
+ * @param seat the wl_seat of the user event
+ * @param serial the serial of the user event
+ */
+ void (*move)(struct wl_client *client,
+ struct wl_resource *resource,
+ struct wl_resource *seat,
+ uint32_t serial);
+ /**
+ * start an interactive resize
+ *
+ * Start a user-driven, interactive resize of the surface.
+ *
+ * This request must be used in response to some sort of user
+ * action like a button press, key press, or touch down event. The
+ * passed serial is used to determine the type of interactive
+ * resize (touch, pointer, etc).
+ *
+ * The server may ignore resize requests depending on the state of
+ * the surface (e.g. fullscreen or maximized).
+ *
+ * If triggered, the client will receive configure events with the
+ * "resize" state enum value and the expected sizes. See the
+ * "resize" enum value for more details about what is required. The
+ * client must also acknowledge configure events using
+ * "ack_configure". After the resize is completed, the client will
+ * receive another "configure" event without the resize state.
+ *
+ * If triggered, the surface also will lose the focus of the device
+ * (wl_pointer, wl_touch, etc) used for the resize. It is up to the
+ * compositor to visually indicate that the resize is taking place,
+ * such as updating a pointer cursor, during the resize. There is
+ * no guarantee that the device focus will return when the resize
+ * is completed.
+ *
+ * The edges parameter specifies how the surface should be resized,
+ * and is one of the values of the resize_edge enum. The compositor
+ * may use this information to update the surface position for
+ * example when dragging the top left corner. The compositor may
+ * also use this information to adapt its behavior, e.g. choose an
+ * appropriate cursor image.
+ * @param seat the wl_seat of the user event
+ * @param serial the serial of the user event
+ * @param edges which edge or corner is being dragged
+ */
+ void (*resize)(struct wl_client *client,
+ struct wl_resource *resource,
+ struct wl_resource *seat,
+ uint32_t serial,
+ uint32_t edges);
+ /**
+ * ack a configure event
+ *
+ * When a configure event is received, if a client commits the
+ * surface in response to the configure event, then the client must
+ * make an ack_configure request sometime before the commit
+ * request, passing along the serial of the configure event.
+ *
+ * For instance, the compositor might use this information to move
+ * a surface to the top left only when the client has drawn itself
+ * for the maximized or fullscreen state.
+ *
+ * If the client receives multiple configure events before it can
+ * respond to one, it only has to ack the last configure event.
+ *
+ * A client is not required to commit immediately after sending an
+ * ack_configure request - it may even ack_configure several times
+ * before its next surface commit.
+ *
+ * The compositor expects that the most recently received
+ * ack_configure request at the time of a commit indicates which
+ * configure event the client is responding to.
+ * @param serial the serial from the configure event
+ */
+ void (*ack_configure)(struct wl_client *client,
+ struct wl_resource *resource,
+ uint32_t serial);
+ /**
+ * set the new window geometry
+ *
+ * The window geometry of a window is its "visible bounds" from
+ * the user's perspective. Client-side decorations often have
+ * invisible portions like drop-shadows which should be ignored for
+ * the purposes of aligning, placing and constraining windows.
+ *
+ * The window geometry is double buffered, and will be applied at
+ * the time wl_surface.commit of the corresponding wl_surface is
+ * called.
+ *
+ * Once the window geometry of the surface is set once, it is not
+ * possible to unset it, and it will remain the same until
+ * set_window_geometry is called again, even if a new subsurface or
+ * buffer is attached.
+ *
+ * If never set, the value is the full bounds of the surface,
+ * including any subsurfaces. This updates dynamically on every
+ * commit. This unset mode is meant for extremely simple clients.
+ *
+ * If responding to a configure event, the window geometry in here
+ * must respect the sizing negotiations specified by the states in
+ * the configure event.
+ *
+ * The arguments are given in the surface local coordinate space of
+ * the wl_surface associated with this xdg_surface.
+ *
+ * The width and height must be greater than zero.
+ */
+ void (*set_window_geometry)(struct wl_client *client,
+ struct wl_resource *resource,
+ int32_t x,
+ int32_t y,
+ int32_t width,
+ int32_t height);
+ /**
+ * maximize the window
+ *
+ * Maximize the surface.
+ *
+ * After requesting that the surface should be maximized, the
+ * compositor will respond by emitting a configure event with the
+ * "maximized" state and the required window geometry. The client
+ * should then update its content, drawing it in a maximized state,
+ * i.e. without shadow or other decoration outside of the window
+ * geometry. The client must also acknowledge the configure when
+ * committing the new content (see ack_configure).
+ *
+ * It is up to the compositor to decide how and where to maximize
+ * the surface, for example which output and what region of the
+ * screen should be used.
+ *
+ * If the surface was already maximized, the compositor will still
+ * emit a configure event with the "maximized" state.
+ */
+ void (*set_maximized)(struct wl_client *client,
+ struct wl_resource *resource);
+ /**
+ * unmaximize the window
+ *
+ * Unmaximize the surface.
+ *
+ * After requesting that the surface should be unmaximized, the
+ * compositor will respond by emitting a configure event without
+ * the "maximized" state. If available, the compositor will include
+ * the window geometry dimensions the window had prior to being
+ * maximized in the configure request. The client must then update
+ * its content, drawing it in a regular state, i.e. potentially
+ * with shadow, etc. The client must also acknowledge the configure
+ * when committing the new content (see ack_configure).
+ *
+ * It is up to the compositor to position the surface after it was
+ * unmaximized; usually the position the surface had before
+ * maximizing, if applicable.
+ *
+ * If the surface was already not maximized, the compositor will
+ * still emit a configure event without the "maximized" state.
+ */
+ void (*unset_maximized)(struct wl_client *client,
+ struct wl_resource *resource);
+ /**
+ * set the window as fullscreen on a monitor
+ *
+ * Make the surface fullscreen.
+ *
+ * You can specify an output that you would prefer to be
+ * fullscreen. If this value is NULL, it's up to the compositor to
+ * choose which display will be used to map this surface.
+ *
+ * If the surface doesn't cover the whole output, the compositor
+ * will position the surface in the center of the output and
+ * compensate with black borders filling the rest of the output.
+ */
+ void (*set_fullscreen)(struct wl_client *client,
+ struct wl_resource *resource,
+ struct wl_resource *output);
+ /**
+ */
+ void (*unset_fullscreen)(struct wl_client *client,
+ struct wl_resource *resource);
+ /**
+ * set the window as minimized
+ *
+ * Request that the compositor minimize your surface. There is no
+ * way to know if the surface is currently minimized, nor is there
+ * any way to unset minimization on this surface.
+ *
+ * If you are looking to throttle redrawing when minimized, please
+ * instead use the wl_surface.frame event for this, as this will
+ * also work with live previews on windows in Alt-Tab, Expose or
+ * similar compositor features.
+ */
+ void (*set_minimized)(struct wl_client *client,
+ struct wl_resource *resource);
+};
+
+#define XDG_SURFACE_CONFIGURE 0
+#define XDG_SURFACE_CLOSE 1
+
+/**
+ * @ingroup iface_xdg_surface
+ */
+#define XDG_SURFACE_CONFIGURE_SINCE_VERSION 1
+/**
+ * @ingroup iface_xdg_surface
+ */
+#define XDG_SURFACE_CLOSE_SINCE_VERSION 1
+
+/**
+ * @ingroup iface_xdg_surface
+ */
+#define XDG_SURFACE_DESTROY_SINCE_VERSION 1
+/**
+ * @ingroup iface_xdg_surface
+ */
+#define XDG_SURFACE_SET_PARENT_SINCE_VERSION 1
+/**
+ * @ingroup iface_xdg_surface
+ */
+#define XDG_SURFACE_SET_TITLE_SINCE_VERSION 1
+/**
+ * @ingroup iface_xdg_surface
+ */
+#define XDG_SURFACE_SET_APP_ID_SINCE_VERSION 1
+/**
+ * @ingroup iface_xdg_surface
+ */
+#define XDG_SURFACE_SHOW_WINDOW_MENU_SINCE_VERSION 1
+/**
+ * @ingroup iface_xdg_surface
+ */
+#define XDG_SURFACE_MOVE_SINCE_VERSION 1
+/**
+ * @ingroup iface_xdg_surface
+ */
+#define XDG_SURFACE_RESIZE_SINCE_VERSION 1
+/**
+ * @ingroup iface_xdg_surface
+ */
+#define XDG_SURFACE_ACK_CONFIGURE_SINCE_VERSION 1
+/**
+ * @ingroup iface_xdg_surface
+ */
+#define XDG_SURFACE_SET_WINDOW_GEOMETRY_SINCE_VERSION 1
+/**
+ * @ingroup iface_xdg_surface
+ */
+#define XDG_SURFACE_SET_MAXIMIZED_SINCE_VERSION 1
+/**
+ * @ingroup iface_xdg_surface
+ */
+#define XDG_SURFACE_UNSET_MAXIMIZED_SINCE_VERSION 1
+/**
+ * @ingroup iface_xdg_surface
+ */
+#define XDG_SURFACE_SET_FULLSCREEN_SINCE_VERSION 1
+/**
+ * @ingroup iface_xdg_surface
+ */
+#define XDG_SURFACE_UNSET_FULLSCREEN_SINCE_VERSION 1
+/**
+ * @ingroup iface_xdg_surface
+ */
+#define XDG_SURFACE_SET_MINIMIZED_SINCE_VERSION 1
+
+/**
+ * @ingroup iface_xdg_surface
+ * Sends an configure event to the client owning the resource.
+ * @param resource_ The client's resource
+ */
+static inline void
+xdg_surface_send_configure(struct wl_resource *resource_, int32_t width, int32_t height, struct wl_array *states, uint32_t serial)
+{
+ wl_resource_post_event(resource_, XDG_SURFACE_CONFIGURE, width, height, states, serial);
+}
+
+/**
+ * @ingroup iface_xdg_surface
+ * Sends an close event to the client owning the resource.
+ * @param resource_ The client's resource
+ */
+static inline void
+xdg_surface_send_close(struct wl_resource *resource_)
+{
+ wl_resource_post_event(resource_, XDG_SURFACE_CLOSE);
+}
+
+/**
+ * @ingroup iface_xdg_popup
+ * @struct xdg_popup_interface
+ */
+struct xdg_popup_interface {
+ /**
+ * remove xdg_popup interface
+ *
+ * This destroys the popup. Explicitly destroying the xdg_popup
+ * object will also dismiss the popup, and unmap the surface.
+ *
+ * If this xdg_popup is not the "topmost" popup, a protocol error
+ * will be sent.
+ */
+ void (*destroy)(struct wl_client *client,
+ struct wl_resource *resource);
+};
+
+#define XDG_POPUP_POPUP_DONE 0
+
+/**
+ * @ingroup iface_xdg_popup
+ */
+#define XDG_POPUP_POPUP_DONE_SINCE_VERSION 1
+
+/**
+ * @ingroup iface_xdg_popup
+ */
+#define XDG_POPUP_DESTROY_SINCE_VERSION 1
+
+/**
+ * @ingroup iface_xdg_popup
+ * Sends an popup_done event to the client owning the resource.
+ * @param resource_ The client's resource
+ */
+static inline void
+xdg_popup_send_popup_done(struct wl_resource *resource_)
+{
+ wl_resource_post_event(resource_, XDG_POPUP_POPUP_DONE);
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/chromium/third_party/wayland-protocols/include/protocol/xdg-shell-unstable-v6-client-protocol.h b/chromium/third_party/wayland-protocols/include/protocol/xdg-shell-unstable-v6-client-protocol.h
new file mode 100644
index 00000000000..50475ca6274
--- /dev/null
+++ b/chromium/third_party/wayland-protocols/include/protocol/xdg-shell-unstable-v6-client-protocol.h
@@ -0,0 +1,1750 @@
+/* Generated by wayland-scanner 1.13.0 */
+
+#ifndef XDG_SHELL_UNSTABLE_V6_CLIENT_PROTOCOL_H
+#define XDG_SHELL_UNSTABLE_V6_CLIENT_PROTOCOL_H
+
+#include <stdint.h>
+#include <stddef.h>
+#include "wayland-client.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @page page_xdg_shell_unstable_v6 The xdg_shell_unstable_v6 protocol
+ * @section page_ifaces_xdg_shell_unstable_v6 Interfaces
+ * - @subpage page_iface_zxdg_shell_v6 - create desktop-style surfaces
+ * - @subpage page_iface_zxdg_positioner_v6 - child surface positioner
+ * - @subpage page_iface_zxdg_surface_v6 - desktop user interface surface base interface
+ * - @subpage page_iface_zxdg_toplevel_v6 - toplevel surface
+ * - @subpage page_iface_zxdg_popup_v6 - short-lived, popup surfaces for menus
+ * @section page_copyright_xdg_shell_unstable_v6 Copyright
+ * <pre>
+ *
+ * Copyright © 2008-2013 Kristian Høgsberg
+ * Copyright © 2013 Rafael Antognolli
+ * Copyright © 2013 Jasper St. Pierre
+ * Copyright © 2010-2013 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ * </pre>
+ */
+struct wl_output;
+struct wl_seat;
+struct wl_surface;
+struct zxdg_popup_v6;
+struct zxdg_positioner_v6;
+struct zxdg_shell_v6;
+struct zxdg_surface_v6;
+struct zxdg_toplevel_v6;
+
+/**
+ * @page page_iface_zxdg_shell_v6 zxdg_shell_v6
+ * @section page_iface_zxdg_shell_v6_desc Description
+ *
+ * xdg_shell allows clients to turn a wl_surface into a "real window"
+ * which can be dragged, resized, stacked, and moved around by the
+ * user. Everything about this interface is suited towards traditional
+ * desktop environments.
+ * @section page_iface_zxdg_shell_v6_api API
+ * See @ref iface_zxdg_shell_v6.
+ */
+/**
+ * @defgroup iface_zxdg_shell_v6 The zxdg_shell_v6 interface
+ *
+ * xdg_shell allows clients to turn a wl_surface into a "real window"
+ * which can be dragged, resized, stacked, and moved around by the
+ * user. Everything about this interface is suited towards traditional
+ * desktop environments.
+ */
+extern const struct wl_interface zxdg_shell_v6_interface;
+/**
+ * @page page_iface_zxdg_positioner_v6 zxdg_positioner_v6
+ * @section page_iface_zxdg_positioner_v6_desc Description
+ *
+ * The xdg_positioner provides a collection of rules for the placement of a
+ * child surface relative to a parent surface. Rules can be defined to ensure
+ * the child surface remains within the visible area's borders, and to
+ * specify how the child surface changes its position, such as sliding along
+ * an axis, or flipping around a rectangle. These positioner-created rules are
+ * constrained by the requirement that a child surface must intersect with or
+ * be at least partially adjacent to its parent surface.
+ *
+ * See the various requests for details about possible rules.
+ *
+ * At the time of the request, the compositor makes a copy of the rules
+ * specified by the xdg_positioner. Thus, after the request is complete the
+ * xdg_positioner object can be destroyed or reused; further changes to the
+ * object will have no effect on previous usages.
+ *
+ * For an xdg_positioner object to be considered complete, it must have a
+ * non-zero size set by set_size, and a non-zero anchor rectangle set by
+ * set_anchor_rect. Passing an incomplete xdg_positioner object when
+ * positioning a surface raises an error.
+ * @section page_iface_zxdg_positioner_v6_api API
+ * See @ref iface_zxdg_positioner_v6.
+ */
+/**
+ * @defgroup iface_zxdg_positioner_v6 The zxdg_positioner_v6 interface
+ *
+ * The xdg_positioner provides a collection of rules for the placement of a
+ * child surface relative to a parent surface. Rules can be defined to ensure
+ * the child surface remains within the visible area's borders, and to
+ * specify how the child surface changes its position, such as sliding along
+ * an axis, or flipping around a rectangle. These positioner-created rules are
+ * constrained by the requirement that a child surface must intersect with or
+ * be at least partially adjacent to its parent surface.
+ *
+ * See the various requests for details about possible rules.
+ *
+ * At the time of the request, the compositor makes a copy of the rules
+ * specified by the xdg_positioner. Thus, after the request is complete the
+ * xdg_positioner object can be destroyed or reused; further changes to the
+ * object will have no effect on previous usages.
+ *
+ * For an xdg_positioner object to be considered complete, it must have a
+ * non-zero size set by set_size, and a non-zero anchor rectangle set by
+ * set_anchor_rect. Passing an incomplete xdg_positioner object when
+ * positioning a surface raises an error.
+ */
+extern const struct wl_interface zxdg_positioner_v6_interface;
+/**
+ * @page page_iface_zxdg_surface_v6 zxdg_surface_v6
+ * @section page_iface_zxdg_surface_v6_desc Description
+ *
+ * An interface that may be implemented by a wl_surface, for
+ * implementations that provide a desktop-style user interface.
+ *
+ * It provides a base set of functionality required to construct user
+ * interface elements requiring management by the compositor, such as
+ * toplevel windows, menus, etc. The types of functionality are split into
+ * xdg_surface roles.
+ *
+ * Creating an xdg_surface does not set the role for a wl_surface. In order
+ * to map an xdg_surface, the client must create a role-specific object
+ * using, e.g., get_toplevel, get_popup. The wl_surface for any given
+ * xdg_surface can have at most one role, and may not be assigned any role
+ * not based on xdg_surface.
+ *
+ * A role must be assigned before any other requests are made to the
+ * xdg_surface object.
+ *
+ * The client must call wl_surface.commit on the corresponding wl_surface
+ * for the xdg_surface state to take effect.
+ *
+ * Creating an xdg_surface from a wl_surface which has a buffer attached or
+ * committed is a client error, and any attempts by a client to attach or
+ * manipulate a buffer prior to the first xdg_surface.configure call must
+ * also be treated as errors.
+ *
+ * For a surface to be mapped by the compositor, the following conditions
+ * must be met: (1) the client has assigned a xdg_surface based role to the
+ * surface, (2) the client has set and committed the xdg_surface state and
+ * the role dependent state to the surface and (3) the client has committed a
+ * buffer to the surface.
+ * @section page_iface_zxdg_surface_v6_api API
+ * See @ref iface_zxdg_surface_v6.
+ */
+/**
+ * @defgroup iface_zxdg_surface_v6 The zxdg_surface_v6 interface
+ *
+ * An interface that may be implemented by a wl_surface, for
+ * implementations that provide a desktop-style user interface.
+ *
+ * It provides a base set of functionality required to construct user
+ * interface elements requiring management by the compositor, such as
+ * toplevel windows, menus, etc. The types of functionality are split into
+ * xdg_surface roles.
+ *
+ * Creating an xdg_surface does not set the role for a wl_surface. In order
+ * to map an xdg_surface, the client must create a role-specific object
+ * using, e.g., get_toplevel, get_popup. The wl_surface for any given
+ * xdg_surface can have at most one role, and may not be assigned any role
+ * not based on xdg_surface.
+ *
+ * A role must be assigned before any other requests are made to the
+ * xdg_surface object.
+ *
+ * The client must call wl_surface.commit on the corresponding wl_surface
+ * for the xdg_surface state to take effect.
+ *
+ * Creating an xdg_surface from a wl_surface which has a buffer attached or
+ * committed is a client error, and any attempts by a client to attach or
+ * manipulate a buffer prior to the first xdg_surface.configure call must
+ * also be treated as errors.
+ *
+ * For a surface to be mapped by the compositor, the following conditions
+ * must be met: (1) the client has assigned a xdg_surface based role to the
+ * surface, (2) the client has set and committed the xdg_surface state and
+ * the role dependent state to the surface and (3) the client has committed a
+ * buffer to the surface.
+ */
+extern const struct wl_interface zxdg_surface_v6_interface;
+/**
+ * @page page_iface_zxdg_toplevel_v6 zxdg_toplevel_v6
+ * @section page_iface_zxdg_toplevel_v6_desc Description
+ *
+ * This interface defines an xdg_surface role which allows a surface to,
+ * among other things, set window-like properties such as maximize,
+ * fullscreen, and minimize, set application-specific metadata like title and
+ * id, and well as trigger user interactive operations such as interactive
+ * resize and move.
+ * @section page_iface_zxdg_toplevel_v6_api API
+ * See @ref iface_zxdg_toplevel_v6.
+ */
+/**
+ * @defgroup iface_zxdg_toplevel_v6 The zxdg_toplevel_v6 interface
+ *
+ * This interface defines an xdg_surface role which allows a surface to,
+ * among other things, set window-like properties such as maximize,
+ * fullscreen, and minimize, set application-specific metadata like title and
+ * id, and well as trigger user interactive operations such as interactive
+ * resize and move.
+ */
+extern const struct wl_interface zxdg_toplevel_v6_interface;
+/**
+ * @page page_iface_zxdg_popup_v6 zxdg_popup_v6
+ * @section page_iface_zxdg_popup_v6_desc Description
+ *
+ * A popup surface is a short-lived, temporary surface. It can be used to
+ * implement for example menus, popovers, tooltips and other similar user
+ * interface concepts.
+ *
+ * A popup can be made to take an explicit grab. See xdg_popup.grab for
+ * details.
+ *
+ * When the popup is dismissed, a popup_done event will be sent out, and at
+ * the same time the surface will be unmapped. See the xdg_popup.popup_done
+ * event for details.
+ *
+ * Explicitly destroying the xdg_popup object will also dismiss the popup and
+ * unmap the surface. Clients that want to dismiss the popup when another
+ * surface of their own is clicked should dismiss the popup using the destroy
+ * request.
+ *
+ * The parent surface must have either the xdg_toplevel or xdg_popup surface
+ * role.
+ *
+ * A newly created xdg_popup will be stacked on top of all previously created
+ * xdg_popup surfaces associated with the same xdg_toplevel.
+ *
+ * The parent of an xdg_popup must be mapped (see the xdg_surface
+ * description) before the xdg_popup itself.
+ *
+ * The x and y arguments passed when creating the popup object specify
+ * where the top left of the popup should be placed, relative to the
+ * local surface coordinates of the parent surface. See
+ * xdg_surface.get_popup. An xdg_popup must intersect with or be at least
+ * partially adjacent to its parent surface.
+ *
+ * The client must call wl_surface.commit on the corresponding wl_surface
+ * for the xdg_popup state to take effect.
+ * @section page_iface_zxdg_popup_v6_api API
+ * See @ref iface_zxdg_popup_v6.
+ */
+/**
+ * @defgroup iface_zxdg_popup_v6 The zxdg_popup_v6 interface
+ *
+ * A popup surface is a short-lived, temporary surface. It can be used to
+ * implement for example menus, popovers, tooltips and other similar user
+ * interface concepts.
+ *
+ * A popup can be made to take an explicit grab. See xdg_popup.grab for
+ * details.
+ *
+ * When the popup is dismissed, a popup_done event will be sent out, and at
+ * the same time the surface will be unmapped. See the xdg_popup.popup_done
+ * event for details.
+ *
+ * Explicitly destroying the xdg_popup object will also dismiss the popup and
+ * unmap the surface. Clients that want to dismiss the popup when another
+ * surface of their own is clicked should dismiss the popup using the destroy
+ * request.
+ *
+ * The parent surface must have either the xdg_toplevel or xdg_popup surface
+ * role.
+ *
+ * A newly created xdg_popup will be stacked on top of all previously created
+ * xdg_popup surfaces associated with the same xdg_toplevel.
+ *
+ * The parent of an xdg_popup must be mapped (see the xdg_surface
+ * description) before the xdg_popup itself.
+ *
+ * The x and y arguments passed when creating the popup object specify
+ * where the top left of the popup should be placed, relative to the
+ * local surface coordinates of the parent surface. See
+ * xdg_surface.get_popup. An xdg_popup must intersect with or be at least
+ * partially adjacent to its parent surface.
+ *
+ * The client must call wl_surface.commit on the corresponding wl_surface
+ * for the xdg_popup state to take effect.
+ */
+extern const struct wl_interface zxdg_popup_v6_interface;
+
+#ifndef ZXDG_SHELL_V6_ERROR_ENUM
+#define ZXDG_SHELL_V6_ERROR_ENUM
+enum zxdg_shell_v6_error {
+ /**
+ * given wl_surface has another role
+ */
+ ZXDG_SHELL_V6_ERROR_ROLE = 0,
+ /**
+ * xdg_shell was destroyed before children
+ */
+ ZXDG_SHELL_V6_ERROR_DEFUNCT_SURFACES = 1,
+ /**
+ * the client tried to map or destroy a non-topmost popup
+ */
+ ZXDG_SHELL_V6_ERROR_NOT_THE_TOPMOST_POPUP = 2,
+ /**
+ * the client specified an invalid popup parent surface
+ */
+ ZXDG_SHELL_V6_ERROR_INVALID_POPUP_PARENT = 3,
+ /**
+ * the client provided an invalid surface state
+ */
+ ZXDG_SHELL_V6_ERROR_INVALID_SURFACE_STATE = 4,
+ /**
+ * the client provided an invalid positioner
+ */
+ ZXDG_SHELL_V6_ERROR_INVALID_POSITIONER = 5,
+};
+#endif /* ZXDG_SHELL_V6_ERROR_ENUM */
+
+/**
+ * @ingroup iface_zxdg_shell_v6
+ * @struct zxdg_shell_v6_listener
+ */
+struct zxdg_shell_v6_listener {
+ /**
+ * check if the client is alive
+ *
+ * The ping event asks the client if it's still alive. Pass the
+ * serial specified in the event back to the compositor by sending
+ * a "pong" request back with the specified serial. See
+ * xdg_shell.ping.
+ *
+ * Compositors can use this to determine if the client is still
+ * alive. It's unspecified what will happen if the client doesn't
+ * respond to the ping request, or in what timeframe. Clients
+ * should try to respond in a reasonable amount of time.
+ *
+ * A compositor is free to ping in any way it wants, but a client
+ * must always respond to any xdg_shell object it created.
+ * @param serial pass this to the pong request
+ */
+ void (*ping)(void *data,
+ struct zxdg_shell_v6 *zxdg_shell_v6,
+ uint32_t serial);
+};
+
+/**
+ * @ingroup iface_zxdg_shell_v6
+ */
+static inline int
+zxdg_shell_v6_add_listener(struct zxdg_shell_v6 *zxdg_shell_v6,
+ const struct zxdg_shell_v6_listener *listener, void *data)
+{
+ return wl_proxy_add_listener((struct wl_proxy *) zxdg_shell_v6,
+ (void (**)(void)) listener, data);
+}
+
+#define ZXDG_SHELL_V6_DESTROY 0
+#define ZXDG_SHELL_V6_CREATE_POSITIONER 1
+#define ZXDG_SHELL_V6_GET_XDG_SURFACE 2
+#define ZXDG_SHELL_V6_PONG 3
+
+/**
+ * @ingroup iface_zxdg_shell_v6
+ */
+#define ZXDG_SHELL_V6_PING_SINCE_VERSION 1
+
+/**
+ * @ingroup iface_zxdg_shell_v6
+ */
+#define ZXDG_SHELL_V6_DESTROY_SINCE_VERSION 1
+/**
+ * @ingroup iface_zxdg_shell_v6
+ */
+#define ZXDG_SHELL_V6_CREATE_POSITIONER_SINCE_VERSION 1
+/**
+ * @ingroup iface_zxdg_shell_v6
+ */
+#define ZXDG_SHELL_V6_GET_XDG_SURFACE_SINCE_VERSION 1
+/**
+ * @ingroup iface_zxdg_shell_v6
+ */
+#define ZXDG_SHELL_V6_PONG_SINCE_VERSION 1
+
+/** @ingroup iface_zxdg_shell_v6 */
+static inline void
+zxdg_shell_v6_set_user_data(struct zxdg_shell_v6 *zxdg_shell_v6, void *user_data)
+{
+ wl_proxy_set_user_data((struct wl_proxy *) zxdg_shell_v6, user_data);
+}
+
+/** @ingroup iface_zxdg_shell_v6 */
+static inline void *
+zxdg_shell_v6_get_user_data(struct zxdg_shell_v6 *zxdg_shell_v6)
+{
+ return wl_proxy_get_user_data((struct wl_proxy *) zxdg_shell_v6);
+}
+
+static inline uint32_t
+zxdg_shell_v6_get_version(struct zxdg_shell_v6 *zxdg_shell_v6)
+{
+ return wl_proxy_get_version((struct wl_proxy *) zxdg_shell_v6);
+}
+
+/**
+ * @ingroup iface_zxdg_shell_v6
+ *
+ * Destroy this xdg_shell object.
+ *
+ * Destroying a bound xdg_shell object while there are surfaces
+ * still alive created by this xdg_shell object instance is illegal
+ * and will result in a protocol error.
+ */
+static inline void
+zxdg_shell_v6_destroy(struct zxdg_shell_v6 *zxdg_shell_v6)
+{
+ wl_proxy_marshal((struct wl_proxy *) zxdg_shell_v6,
+ ZXDG_SHELL_V6_DESTROY);
+
+ wl_proxy_destroy((struct wl_proxy *) zxdg_shell_v6);
+}
+
+/**
+ * @ingroup iface_zxdg_shell_v6
+ *
+ * Create a positioner object. A positioner object is used to position
+ * surfaces relative to some parent surface. See the interface description
+ * and xdg_surface.get_popup for details.
+ */
+static inline struct zxdg_positioner_v6 *
+zxdg_shell_v6_create_positioner(struct zxdg_shell_v6 *zxdg_shell_v6)
+{
+ struct wl_proxy *id;
+
+ id = wl_proxy_marshal_constructor((struct wl_proxy *) zxdg_shell_v6,
+ ZXDG_SHELL_V6_CREATE_POSITIONER, &zxdg_positioner_v6_interface, NULL);
+
+ return (struct zxdg_positioner_v6 *) id;
+}
+
+/**
+ * @ingroup iface_zxdg_shell_v6
+ *
+ * This creates an xdg_surface for the given surface. While xdg_surface
+ * itself is not a role, the corresponding surface may only be assigned
+ * a role extending xdg_surface, such as xdg_toplevel or xdg_popup.
+ *
+ * This creates an xdg_surface for the given surface. An xdg_surface is
+ * used as basis to define a role to a given surface, such as xdg_toplevel
+ * or xdg_popup. It also manages functionality shared between xdg_surface
+ * based surface roles.
+ *
+ * See the documentation of xdg_surface for more details about what an
+ * xdg_surface is and how it is used.
+ */
+static inline struct zxdg_surface_v6 *
+zxdg_shell_v6_get_xdg_surface(struct zxdg_shell_v6 *zxdg_shell_v6, struct wl_surface *surface)
+{
+ struct wl_proxy *id;
+
+ id = wl_proxy_marshal_constructor((struct wl_proxy *) zxdg_shell_v6,
+ ZXDG_SHELL_V6_GET_XDG_SURFACE, &zxdg_surface_v6_interface, NULL, surface);
+
+ return (struct zxdg_surface_v6 *) id;
+}
+
+/**
+ * @ingroup iface_zxdg_shell_v6
+ *
+ * A client must respond to a ping event with a pong request or
+ * the client may be deemed unresponsive. See xdg_shell.ping.
+ */
+static inline void
+zxdg_shell_v6_pong(struct zxdg_shell_v6 *zxdg_shell_v6, uint32_t serial)
+{
+ wl_proxy_marshal((struct wl_proxy *) zxdg_shell_v6,
+ ZXDG_SHELL_V6_PONG, serial);
+}
+
+#ifndef ZXDG_POSITIONER_V6_ERROR_ENUM
+#define ZXDG_POSITIONER_V6_ERROR_ENUM
+enum zxdg_positioner_v6_error {
+ /**
+ * invalid input provided
+ */
+ ZXDG_POSITIONER_V6_ERROR_INVALID_INPUT = 0,
+};
+#endif /* ZXDG_POSITIONER_V6_ERROR_ENUM */
+
+#ifndef ZXDG_POSITIONER_V6_ANCHOR_ENUM
+#define ZXDG_POSITIONER_V6_ANCHOR_ENUM
+enum zxdg_positioner_v6_anchor {
+ /**
+ * the center of the anchor rectangle
+ */
+ ZXDG_POSITIONER_V6_ANCHOR_NONE = 0,
+ /**
+ * the top edge of the anchor rectangle
+ */
+ ZXDG_POSITIONER_V6_ANCHOR_TOP = 1,
+ /**
+ * the bottom edge of the anchor rectangle
+ */
+ ZXDG_POSITIONER_V6_ANCHOR_BOTTOM = 2,
+ /**
+ * the left edge of the anchor rectangle
+ */
+ ZXDG_POSITIONER_V6_ANCHOR_LEFT = 4,
+ /**
+ * the right edge of the anchor rectangle
+ */
+ ZXDG_POSITIONER_V6_ANCHOR_RIGHT = 8,
+};
+#endif /* ZXDG_POSITIONER_V6_ANCHOR_ENUM */
+
+#ifndef ZXDG_POSITIONER_V6_GRAVITY_ENUM
+#define ZXDG_POSITIONER_V6_GRAVITY_ENUM
+enum zxdg_positioner_v6_gravity {
+ /**
+ * center over the anchor edge
+ */
+ ZXDG_POSITIONER_V6_GRAVITY_NONE = 0,
+ /**
+ * position above the anchor edge
+ */
+ ZXDG_POSITIONER_V6_GRAVITY_TOP = 1,
+ /**
+ * position below the anchor edge
+ */
+ ZXDG_POSITIONER_V6_GRAVITY_BOTTOM = 2,
+ /**
+ * position to the left of the anchor edge
+ */
+ ZXDG_POSITIONER_V6_GRAVITY_LEFT = 4,
+ /**
+ * position to the right of the anchor edge
+ */
+ ZXDG_POSITIONER_V6_GRAVITY_RIGHT = 8,
+};
+#endif /* ZXDG_POSITIONER_V6_GRAVITY_ENUM */
+
+#ifndef ZXDG_POSITIONER_V6_CONSTRAINT_ADJUSTMENT_ENUM
+#define ZXDG_POSITIONER_V6_CONSTRAINT_ADJUSTMENT_ENUM
+/**
+ * @ingroup iface_zxdg_positioner_v6
+ * vertically resize the surface
+ *
+ * Resize the surface vertically so that it is completely unconstrained.
+ */
+enum zxdg_positioner_v6_constraint_adjustment {
+ ZXDG_POSITIONER_V6_CONSTRAINT_ADJUSTMENT_NONE = 0,
+ ZXDG_POSITIONER_V6_CONSTRAINT_ADJUSTMENT_SLIDE_X = 1,
+ ZXDG_POSITIONER_V6_CONSTRAINT_ADJUSTMENT_SLIDE_Y = 2,
+ ZXDG_POSITIONER_V6_CONSTRAINT_ADJUSTMENT_FLIP_X = 4,
+ ZXDG_POSITIONER_V6_CONSTRAINT_ADJUSTMENT_FLIP_Y = 8,
+ ZXDG_POSITIONER_V6_CONSTRAINT_ADJUSTMENT_RESIZE_X = 16,
+ ZXDG_POSITIONER_V6_CONSTRAINT_ADJUSTMENT_RESIZE_Y = 32,
+};
+#endif /* ZXDG_POSITIONER_V6_CONSTRAINT_ADJUSTMENT_ENUM */
+
+#define ZXDG_POSITIONER_V6_DESTROY 0
+#define ZXDG_POSITIONER_V6_SET_SIZE 1
+#define ZXDG_POSITIONER_V6_SET_ANCHOR_RECT 2
+#define ZXDG_POSITIONER_V6_SET_ANCHOR 3
+#define ZXDG_POSITIONER_V6_SET_GRAVITY 4
+#define ZXDG_POSITIONER_V6_SET_CONSTRAINT_ADJUSTMENT 5
+#define ZXDG_POSITIONER_V6_SET_OFFSET 6
+
+
+/**
+ * @ingroup iface_zxdg_positioner_v6
+ */
+#define ZXDG_POSITIONER_V6_DESTROY_SINCE_VERSION 1
+/**
+ * @ingroup iface_zxdg_positioner_v6
+ */
+#define ZXDG_POSITIONER_V6_SET_SIZE_SINCE_VERSION 1
+/**
+ * @ingroup iface_zxdg_positioner_v6
+ */
+#define ZXDG_POSITIONER_V6_SET_ANCHOR_RECT_SINCE_VERSION 1
+/**
+ * @ingroup iface_zxdg_positioner_v6
+ */
+#define ZXDG_POSITIONER_V6_SET_ANCHOR_SINCE_VERSION 1
+/**
+ * @ingroup iface_zxdg_positioner_v6
+ */
+#define ZXDG_POSITIONER_V6_SET_GRAVITY_SINCE_VERSION 1
+/**
+ * @ingroup iface_zxdg_positioner_v6
+ */
+#define ZXDG_POSITIONER_V6_SET_CONSTRAINT_ADJUSTMENT_SINCE_VERSION 1
+/**
+ * @ingroup iface_zxdg_positioner_v6
+ */
+#define ZXDG_POSITIONER_V6_SET_OFFSET_SINCE_VERSION 1
+
+/** @ingroup iface_zxdg_positioner_v6 */
+static inline void
+zxdg_positioner_v6_set_user_data(struct zxdg_positioner_v6 *zxdg_positioner_v6, void *user_data)
+{
+ wl_proxy_set_user_data((struct wl_proxy *) zxdg_positioner_v6, user_data);
+}
+
+/** @ingroup iface_zxdg_positioner_v6 */
+static inline void *
+zxdg_positioner_v6_get_user_data(struct zxdg_positioner_v6 *zxdg_positioner_v6)
+{
+ return wl_proxy_get_user_data((struct wl_proxy *) zxdg_positioner_v6);
+}
+
+static inline uint32_t
+zxdg_positioner_v6_get_version(struct zxdg_positioner_v6 *zxdg_positioner_v6)
+{
+ return wl_proxy_get_version((struct wl_proxy *) zxdg_positioner_v6);
+}
+
+/**
+ * @ingroup iface_zxdg_positioner_v6
+ *
+ * Notify the compositor that the xdg_positioner will no longer be used.
+ */
+static inline void
+zxdg_positioner_v6_destroy(struct zxdg_positioner_v6 *zxdg_positioner_v6)
+{
+ wl_proxy_marshal((struct wl_proxy *) zxdg_positioner_v6,
+ ZXDG_POSITIONER_V6_DESTROY);
+
+ wl_proxy_destroy((struct wl_proxy *) zxdg_positioner_v6);
+}
+
+/**
+ * @ingroup iface_zxdg_positioner_v6
+ *
+ * Set the size of the surface that is to be positioned with the positioner
+ * object. The size is in surface-local coordinates and corresponds to the
+ * window geometry. See xdg_surface.set_window_geometry.
+ *
+ * If a zero or negative size is set the invalid_input error is raised.
+ */
+static inline void
+zxdg_positioner_v6_set_size(struct zxdg_positioner_v6 *zxdg_positioner_v6, int32_t width, int32_t height)
+{
+ wl_proxy_marshal((struct wl_proxy *) zxdg_positioner_v6,
+ ZXDG_POSITIONER_V6_SET_SIZE, width, height);
+}
+
+/**
+ * @ingroup iface_zxdg_positioner_v6
+ *
+ * Specify the anchor rectangle within the parent surface that the child
+ * surface will be placed relative to. The rectangle is relative to the
+ * window geometry as defined by xdg_surface.set_window_geometry of the
+ * parent surface. The rectangle must be at least 1x1 large.
+ *
+ * When the xdg_positioner object is used to position a child surface, the
+ * anchor rectangle may not extend outside the window geometry of the
+ * positioned child's parent surface.
+ *
+ * If a zero or negative size is set the invalid_input error is raised.
+ */
+static inline void
+zxdg_positioner_v6_set_anchor_rect(struct zxdg_positioner_v6 *zxdg_positioner_v6, int32_t x, int32_t y, int32_t width, int32_t height)
+{
+ wl_proxy_marshal((struct wl_proxy *) zxdg_positioner_v6,
+ ZXDG_POSITIONER_V6_SET_ANCHOR_RECT, x, y, width, height);
+}
+
+/**
+ * @ingroup iface_zxdg_positioner_v6
+ *
+ * Defines a set of edges for the anchor rectangle. These are used to
+ * derive an anchor point that the child surface will be positioned
+ * relative to. If two orthogonal edges are specified (e.g. 'top' and
+ * 'left'), then the anchor point will be the intersection of the edges
+ * (e.g. the top left position of the rectangle); otherwise, the derived
+ * anchor point will be centered on the specified edge, or in the center of
+ * the anchor rectangle if no edge is specified.
+ *
+ * If two parallel anchor edges are specified (e.g. 'left' and 'right'),
+ * the invalid_input error is raised.
+ */
+static inline void
+zxdg_positioner_v6_set_anchor(struct zxdg_positioner_v6 *zxdg_positioner_v6, uint32_t anchor)
+{
+ wl_proxy_marshal((struct wl_proxy *) zxdg_positioner_v6,
+ ZXDG_POSITIONER_V6_SET_ANCHOR, anchor);
+}
+
+/**
+ * @ingroup iface_zxdg_positioner_v6
+ *
+ * Defines in what direction a surface should be positioned, relative to
+ * the anchor point of the parent surface. If two orthogonal gravities are
+ * specified (e.g. 'bottom' and 'right'), then the child surface will be
+ * placed in the specified direction; otherwise, the child surface will be
+ * centered over the anchor point on any axis that had no gravity
+ * specified.
+ *
+ * If two parallel gravities are specified (e.g. 'left' and 'right'), the
+ * invalid_input error is raised.
+ */
+static inline void
+zxdg_positioner_v6_set_gravity(struct zxdg_positioner_v6 *zxdg_positioner_v6, uint32_t gravity)
+{
+ wl_proxy_marshal((struct wl_proxy *) zxdg_positioner_v6,
+ ZXDG_POSITIONER_V6_SET_GRAVITY, gravity);
+}
+
+/**
+ * @ingroup iface_zxdg_positioner_v6
+ *
+ * Specify how the window should be positioned if the originally intended
+ * position caused the surface to be constrained, meaning at least
+ * partially outside positioning boundaries set by the compositor. The
+ * adjustment is set by constructing a bitmask describing the adjustment to
+ * be made when the surface is constrained on that axis.
+ *
+ * If no bit for one axis is set, the compositor will assume that the child
+ * surface should not change its position on that axis when constrained.
+ *
+ * If more than one bit for one axis is set, the order of how adjustments
+ * are applied is specified in the corresponding adjustment descriptions.
+ *
+ * The default adjustment is none.
+ */
+static inline void
+zxdg_positioner_v6_set_constraint_adjustment(struct zxdg_positioner_v6 *zxdg_positioner_v6, uint32_t constraint_adjustment)
+{
+ wl_proxy_marshal((struct wl_proxy *) zxdg_positioner_v6,
+ ZXDG_POSITIONER_V6_SET_CONSTRAINT_ADJUSTMENT, constraint_adjustment);
+}
+
+/**
+ * @ingroup iface_zxdg_positioner_v6
+ *
+ * Specify the surface position offset relative to the position of the
+ * anchor on the anchor rectangle and the anchor on the surface. For
+ * example if the anchor of the anchor rectangle is at (x, y), the surface
+ * has the gravity bottom|right, and the offset is (ox, oy), the calculated
+ * surface position will be (x + ox, y + oy). The offset position of the
+ * surface is the one used for constraint testing. See
+ * set_constraint_adjustment.
+ *
+ * An example use case is placing a popup menu on top of a user interface
+ * element, while aligning the user interface element of the parent surface
+ * with some user interface element placed somewhere in the popup surface.
+ */
+static inline void
+zxdg_positioner_v6_set_offset(struct zxdg_positioner_v6 *zxdg_positioner_v6, int32_t x, int32_t y)
+{
+ wl_proxy_marshal((struct wl_proxy *) zxdg_positioner_v6,
+ ZXDG_POSITIONER_V6_SET_OFFSET, x, y);
+}
+
+#ifndef ZXDG_SURFACE_V6_ERROR_ENUM
+#define ZXDG_SURFACE_V6_ERROR_ENUM
+enum zxdg_surface_v6_error {
+ ZXDG_SURFACE_V6_ERROR_NOT_CONSTRUCTED = 1,
+ ZXDG_SURFACE_V6_ERROR_ALREADY_CONSTRUCTED = 2,
+ ZXDG_SURFACE_V6_ERROR_UNCONFIGURED_BUFFER = 3,
+};
+#endif /* ZXDG_SURFACE_V6_ERROR_ENUM */
+
+/**
+ * @ingroup iface_zxdg_surface_v6
+ * @struct zxdg_surface_v6_listener
+ */
+struct zxdg_surface_v6_listener {
+ /**
+ * suggest a surface change
+ *
+ * The configure event marks the end of a configure sequence. A
+ * configure sequence is a set of one or more events configuring
+ * the state of the xdg_surface, including the final
+ * xdg_surface.configure event.
+ *
+ * Where applicable, xdg_surface surface roles will during a
+ * configure sequence extend this event as a latched state sent as
+ * events before the xdg_surface.configure event. Such events
+ * should be considered to make up a set of atomically applied
+ * configuration states, where the xdg_surface.configure commits
+ * the accumulated state.
+ *
+ * Clients should arrange their surface for the new states, and
+ * then send an ack_configure request with the serial sent in this
+ * configure event at some point before committing the new surface.
+ *
+ * If the client receives multiple configure events before it can
+ * respond to one, it is free to discard all but the last event it
+ * received.
+ * @param serial serial of the configure event
+ */
+ void (*configure)(void *data,
+ struct zxdg_surface_v6 *zxdg_surface_v6,
+ uint32_t serial);
+};
+
+/**
+ * @ingroup iface_zxdg_surface_v6
+ */
+static inline int
+zxdg_surface_v6_add_listener(struct zxdg_surface_v6 *zxdg_surface_v6,
+ const struct zxdg_surface_v6_listener *listener, void *data)
+{
+ return wl_proxy_add_listener((struct wl_proxy *) zxdg_surface_v6,
+ (void (**)(void)) listener, data);
+}
+
+#define ZXDG_SURFACE_V6_DESTROY 0
+#define ZXDG_SURFACE_V6_GET_TOPLEVEL 1
+#define ZXDG_SURFACE_V6_GET_POPUP 2
+#define ZXDG_SURFACE_V6_SET_WINDOW_GEOMETRY 3
+#define ZXDG_SURFACE_V6_ACK_CONFIGURE 4
+
+/**
+ * @ingroup iface_zxdg_surface_v6
+ */
+#define ZXDG_SURFACE_V6_CONFIGURE_SINCE_VERSION 1
+
+/**
+ * @ingroup iface_zxdg_surface_v6
+ */
+#define ZXDG_SURFACE_V6_DESTROY_SINCE_VERSION 1
+/**
+ * @ingroup iface_zxdg_surface_v6
+ */
+#define ZXDG_SURFACE_V6_GET_TOPLEVEL_SINCE_VERSION 1
+/**
+ * @ingroup iface_zxdg_surface_v6
+ */
+#define ZXDG_SURFACE_V6_GET_POPUP_SINCE_VERSION 1
+/**
+ * @ingroup iface_zxdg_surface_v6
+ */
+#define ZXDG_SURFACE_V6_SET_WINDOW_GEOMETRY_SINCE_VERSION 1
+/**
+ * @ingroup iface_zxdg_surface_v6
+ */
+#define ZXDG_SURFACE_V6_ACK_CONFIGURE_SINCE_VERSION 1
+
+/** @ingroup iface_zxdg_surface_v6 */
+static inline void
+zxdg_surface_v6_set_user_data(struct zxdg_surface_v6 *zxdg_surface_v6, void *user_data)
+{
+ wl_proxy_set_user_data((struct wl_proxy *) zxdg_surface_v6, user_data);
+}
+
+/** @ingroup iface_zxdg_surface_v6 */
+static inline void *
+zxdg_surface_v6_get_user_data(struct zxdg_surface_v6 *zxdg_surface_v6)
+{
+ return wl_proxy_get_user_data((struct wl_proxy *) zxdg_surface_v6);
+}
+
+static inline uint32_t
+zxdg_surface_v6_get_version(struct zxdg_surface_v6 *zxdg_surface_v6)
+{
+ return wl_proxy_get_version((struct wl_proxy *) zxdg_surface_v6);
+}
+
+/**
+ * @ingroup iface_zxdg_surface_v6
+ *
+ * Destroy the xdg_surface object. An xdg_surface must only be destroyed
+ * after its role object has been destroyed.
+ */
+static inline void
+zxdg_surface_v6_destroy(struct zxdg_surface_v6 *zxdg_surface_v6)
+{
+ wl_proxy_marshal((struct wl_proxy *) zxdg_surface_v6,
+ ZXDG_SURFACE_V6_DESTROY);
+
+ wl_proxy_destroy((struct wl_proxy *) zxdg_surface_v6);
+}
+
+/**
+ * @ingroup iface_zxdg_surface_v6
+ *
+ * This creates an xdg_toplevel object for the given xdg_surface and gives
+ * the associated wl_surface the xdg_toplevel role.
+ *
+ * See the documentation of xdg_toplevel for more details about what an
+ * xdg_toplevel is and how it is used.
+ */
+static inline struct zxdg_toplevel_v6 *
+zxdg_surface_v6_get_toplevel(struct zxdg_surface_v6 *zxdg_surface_v6)
+{
+ struct wl_proxy *id;
+
+ id = wl_proxy_marshal_constructor((struct wl_proxy *) zxdg_surface_v6,
+ ZXDG_SURFACE_V6_GET_TOPLEVEL, &zxdg_toplevel_v6_interface, NULL);
+
+ return (struct zxdg_toplevel_v6 *) id;
+}
+
+/**
+ * @ingroup iface_zxdg_surface_v6
+ *
+ * This creates an xdg_popup object for the given xdg_surface and gives the
+ * associated wl_surface the xdg_popup role.
+ *
+ * See the documentation of xdg_popup for more details about what an
+ * xdg_popup is and how it is used.
+ */
+static inline struct zxdg_popup_v6 *
+zxdg_surface_v6_get_popup(struct zxdg_surface_v6 *zxdg_surface_v6, struct zxdg_surface_v6 *parent, struct zxdg_positioner_v6 *positioner)
+{
+ struct wl_proxy *id;
+
+ id = wl_proxy_marshal_constructor((struct wl_proxy *) zxdg_surface_v6,
+ ZXDG_SURFACE_V6_GET_POPUP, &zxdg_popup_v6_interface, NULL, parent, positioner);
+
+ return (struct zxdg_popup_v6 *) id;
+}
+
+/**
+ * @ingroup iface_zxdg_surface_v6
+ *
+ * The window geometry of a surface is its "visible bounds" from the
+ * user's perspective. Client-side decorations often have invisible
+ * portions like drop-shadows which should be ignored for the
+ * purposes of aligning, placing and constraining windows.
+ *
+ * The window geometry is double buffered, and will be applied at the
+ * time wl_surface.commit of the corresponding wl_surface is called.
+ *
+ * Once the window geometry of the surface is set, it is not possible to
+ * unset it, and it will remain the same until set_window_geometry is
+ * called again, even if a new subsurface or buffer is attached.
+ *
+ * If never set, the value is the full bounds of the surface,
+ * including any subsurfaces. This updates dynamically on every
+ * commit. This unset is meant for extremely simple clients.
+ *
+ * The arguments are given in the surface-local coordinate space of
+ * the wl_surface associated with this xdg_surface.
+ *
+ * The width and height must be greater than zero. Setting an invalid size
+ * will raise an error. When applied, the effective window geometry will be
+ * the set window geometry clamped to the bounding rectangle of the
+ * combined geometry of the surface of the xdg_surface and the associated
+ * subsurfaces.
+ */
+static inline void
+zxdg_surface_v6_set_window_geometry(struct zxdg_surface_v6 *zxdg_surface_v6, int32_t x, int32_t y, int32_t width, int32_t height)
+{
+ wl_proxy_marshal((struct wl_proxy *) zxdg_surface_v6,
+ ZXDG_SURFACE_V6_SET_WINDOW_GEOMETRY, x, y, width, height);
+}
+
+/**
+ * @ingroup iface_zxdg_surface_v6
+ *
+ * When a configure event is received, if a client commits the
+ * surface in response to the configure event, then the client
+ * must make an ack_configure request sometime before the commit
+ * request, passing along the serial of the configure event.
+ *
+ * For instance, for toplevel surfaces the compositor might use this
+ * information to move a surface to the top left only when the client has
+ * drawn itself for the maximized or fullscreen state.
+ *
+ * If the client receives multiple configure events before it
+ * can respond to one, it only has to ack the last configure event.
+ *
+ * A client is not required to commit immediately after sending
+ * an ack_configure request - it may even ack_configure several times
+ * before its next surface commit.
+ *
+ * A client may send multiple ack_configure requests before committing, but
+ * only the last request sent before a commit indicates which configure
+ * event the client really is responding to.
+ */
+static inline void
+zxdg_surface_v6_ack_configure(struct zxdg_surface_v6 *zxdg_surface_v6, uint32_t serial)
+{
+ wl_proxy_marshal((struct wl_proxy *) zxdg_surface_v6,
+ ZXDG_SURFACE_V6_ACK_CONFIGURE, serial);
+}
+
+#ifndef ZXDG_TOPLEVEL_V6_RESIZE_EDGE_ENUM
+#define ZXDG_TOPLEVEL_V6_RESIZE_EDGE_ENUM
+/**
+ * @ingroup iface_zxdg_toplevel_v6
+ * edge values for resizing
+ *
+ * These values are used to indicate which edge of a surface
+ * is being dragged in a resize operation.
+ */
+enum zxdg_toplevel_v6_resize_edge {
+ ZXDG_TOPLEVEL_V6_RESIZE_EDGE_NONE = 0,
+ ZXDG_TOPLEVEL_V6_RESIZE_EDGE_TOP = 1,
+ ZXDG_TOPLEVEL_V6_RESIZE_EDGE_BOTTOM = 2,
+ ZXDG_TOPLEVEL_V6_RESIZE_EDGE_LEFT = 4,
+ ZXDG_TOPLEVEL_V6_RESIZE_EDGE_TOP_LEFT = 5,
+ ZXDG_TOPLEVEL_V6_RESIZE_EDGE_BOTTOM_LEFT = 6,
+ ZXDG_TOPLEVEL_V6_RESIZE_EDGE_RIGHT = 8,
+ ZXDG_TOPLEVEL_V6_RESIZE_EDGE_TOP_RIGHT = 9,
+ ZXDG_TOPLEVEL_V6_RESIZE_EDGE_BOTTOM_RIGHT = 10,
+};
+#endif /* ZXDG_TOPLEVEL_V6_RESIZE_EDGE_ENUM */
+
+#ifndef ZXDG_TOPLEVEL_V6_STATE_ENUM
+#define ZXDG_TOPLEVEL_V6_STATE_ENUM
+/**
+ * @ingroup iface_zxdg_toplevel_v6
+ * the surface is now activated
+ *
+ * Client window decorations should be painted as if the window is
+ * active. Do not assume this means that the window actually has
+ * keyboard or pointer focus.
+ */
+enum zxdg_toplevel_v6_state {
+ /**
+ * the surface is maximized
+ */
+ ZXDG_TOPLEVEL_V6_STATE_MAXIMIZED = 1,
+ /**
+ * the surface is fullscreen
+ */
+ ZXDG_TOPLEVEL_V6_STATE_FULLSCREEN = 2,
+ /**
+ * the surface is being resized
+ */
+ ZXDG_TOPLEVEL_V6_STATE_RESIZING = 3,
+ /**
+ * the surface is now activated
+ */
+ ZXDG_TOPLEVEL_V6_STATE_ACTIVATED = 4,
+};
+#endif /* ZXDG_TOPLEVEL_V6_STATE_ENUM */
+
+/**
+ * @ingroup iface_zxdg_toplevel_v6
+ * @struct zxdg_toplevel_v6_listener
+ */
+struct zxdg_toplevel_v6_listener {
+ /**
+ * suggest a surface change
+ *
+ * This configure event asks the client to resize its toplevel
+ * surface or to change its state. The configured state should not
+ * be applied immediately. See xdg_surface.configure for details.
+ *
+ * The width and height arguments specify a hint to the window
+ * about how its surface should be resized in window geometry
+ * coordinates. See set_window_geometry.
+ *
+ * If the width or height arguments are zero, it means the client
+ * should decide its own window dimension. This may happen when the
+ * compositor needs to configure the state of the surface but
+ * doesn't have any information about any previous or expected
+ * dimension.
+ *
+ * The states listed in the event specify how the width/height
+ * arguments should be interpreted, and possibly how it should be
+ * drawn.
+ *
+ * Clients must send an ack_configure in response to this event.
+ * See xdg_surface.configure and xdg_surface.ack_configure for
+ * details.
+ */
+ void (*configure)(void *data,
+ struct zxdg_toplevel_v6 *zxdg_toplevel_v6,
+ int32_t width,
+ int32_t height,
+ struct wl_array *states);
+ /**
+ * surface wants to be closed
+ *
+ * The close event is sent by the compositor when the user wants
+ * the surface to be closed. This should be equivalent to the user
+ * clicking the close button in client-side decorations, if your
+ * application has any.
+ *
+ * This is only a request that the user intends to close the
+ * window. The client may choose to ignore this request, or show a
+ * dialog to ask the user to save their data, etc.
+ */
+ void (*close)(void *data,
+ struct zxdg_toplevel_v6 *zxdg_toplevel_v6);
+};
+
+/**
+ * @ingroup iface_zxdg_toplevel_v6
+ */
+static inline int
+zxdg_toplevel_v6_add_listener(struct zxdg_toplevel_v6 *zxdg_toplevel_v6,
+ const struct zxdg_toplevel_v6_listener *listener, void *data)
+{
+ return wl_proxy_add_listener((struct wl_proxy *) zxdg_toplevel_v6,
+ (void (**)(void)) listener, data);
+}
+
+#define ZXDG_TOPLEVEL_V6_DESTROY 0
+#define ZXDG_TOPLEVEL_V6_SET_PARENT 1
+#define ZXDG_TOPLEVEL_V6_SET_TITLE 2
+#define ZXDG_TOPLEVEL_V6_SET_APP_ID 3
+#define ZXDG_TOPLEVEL_V6_SHOW_WINDOW_MENU 4
+#define ZXDG_TOPLEVEL_V6_MOVE 5
+#define ZXDG_TOPLEVEL_V6_RESIZE 6
+#define ZXDG_TOPLEVEL_V6_SET_MAX_SIZE 7
+#define ZXDG_TOPLEVEL_V6_SET_MIN_SIZE 8
+#define ZXDG_TOPLEVEL_V6_SET_MAXIMIZED 9
+#define ZXDG_TOPLEVEL_V6_UNSET_MAXIMIZED 10
+#define ZXDG_TOPLEVEL_V6_SET_FULLSCREEN 11
+#define ZXDG_TOPLEVEL_V6_UNSET_FULLSCREEN 12
+#define ZXDG_TOPLEVEL_V6_SET_MINIMIZED 13
+
+/**
+ * @ingroup iface_zxdg_toplevel_v6
+ */
+#define ZXDG_TOPLEVEL_V6_CONFIGURE_SINCE_VERSION 1
+/**
+ * @ingroup iface_zxdg_toplevel_v6
+ */
+#define ZXDG_TOPLEVEL_V6_CLOSE_SINCE_VERSION 1
+
+/**
+ * @ingroup iface_zxdg_toplevel_v6
+ */
+#define ZXDG_TOPLEVEL_V6_DESTROY_SINCE_VERSION 1
+/**
+ * @ingroup iface_zxdg_toplevel_v6
+ */
+#define ZXDG_TOPLEVEL_V6_SET_PARENT_SINCE_VERSION 1
+/**
+ * @ingroup iface_zxdg_toplevel_v6
+ */
+#define ZXDG_TOPLEVEL_V6_SET_TITLE_SINCE_VERSION 1
+/**
+ * @ingroup iface_zxdg_toplevel_v6
+ */
+#define ZXDG_TOPLEVEL_V6_SET_APP_ID_SINCE_VERSION 1
+/**
+ * @ingroup iface_zxdg_toplevel_v6
+ */
+#define ZXDG_TOPLEVEL_V6_SHOW_WINDOW_MENU_SINCE_VERSION 1
+/**
+ * @ingroup iface_zxdg_toplevel_v6
+ */
+#define ZXDG_TOPLEVEL_V6_MOVE_SINCE_VERSION 1
+/**
+ * @ingroup iface_zxdg_toplevel_v6
+ */
+#define ZXDG_TOPLEVEL_V6_RESIZE_SINCE_VERSION 1
+/**
+ * @ingroup iface_zxdg_toplevel_v6
+ */
+#define ZXDG_TOPLEVEL_V6_SET_MAX_SIZE_SINCE_VERSION 1
+/**
+ * @ingroup iface_zxdg_toplevel_v6
+ */
+#define ZXDG_TOPLEVEL_V6_SET_MIN_SIZE_SINCE_VERSION 1
+/**
+ * @ingroup iface_zxdg_toplevel_v6
+ */
+#define ZXDG_TOPLEVEL_V6_SET_MAXIMIZED_SINCE_VERSION 1
+/**
+ * @ingroup iface_zxdg_toplevel_v6
+ */
+#define ZXDG_TOPLEVEL_V6_UNSET_MAXIMIZED_SINCE_VERSION 1
+/**
+ * @ingroup iface_zxdg_toplevel_v6
+ */
+#define ZXDG_TOPLEVEL_V6_SET_FULLSCREEN_SINCE_VERSION 1
+/**
+ * @ingroup iface_zxdg_toplevel_v6
+ */
+#define ZXDG_TOPLEVEL_V6_UNSET_FULLSCREEN_SINCE_VERSION 1
+/**
+ * @ingroup iface_zxdg_toplevel_v6
+ */
+#define ZXDG_TOPLEVEL_V6_SET_MINIMIZED_SINCE_VERSION 1
+
+/** @ingroup iface_zxdg_toplevel_v6 */
+static inline void
+zxdg_toplevel_v6_set_user_data(struct zxdg_toplevel_v6 *zxdg_toplevel_v6, void *user_data)
+{
+ wl_proxy_set_user_data((struct wl_proxy *) zxdg_toplevel_v6, user_data);
+}
+
+/** @ingroup iface_zxdg_toplevel_v6 */
+static inline void *
+zxdg_toplevel_v6_get_user_data(struct zxdg_toplevel_v6 *zxdg_toplevel_v6)
+{
+ return wl_proxy_get_user_data((struct wl_proxy *) zxdg_toplevel_v6);
+}
+
+static inline uint32_t
+zxdg_toplevel_v6_get_version(struct zxdg_toplevel_v6 *zxdg_toplevel_v6)
+{
+ return wl_proxy_get_version((struct wl_proxy *) zxdg_toplevel_v6);
+}
+
+/**
+ * @ingroup iface_zxdg_toplevel_v6
+ *
+ * Unmap and destroy the window. The window will be effectively
+ * hidden from the user's point of view, and all state like
+ * maximization, fullscreen, and so on, will be lost.
+ */
+static inline void
+zxdg_toplevel_v6_destroy(struct zxdg_toplevel_v6 *zxdg_toplevel_v6)
+{
+ wl_proxy_marshal((struct wl_proxy *) zxdg_toplevel_v6,
+ ZXDG_TOPLEVEL_V6_DESTROY);
+
+ wl_proxy_destroy((struct wl_proxy *) zxdg_toplevel_v6);
+}
+
+/**
+ * @ingroup iface_zxdg_toplevel_v6
+ *
+ * Set the "parent" of this surface. This window should be stacked
+ * above a parent. The parent surface must be mapped as long as this
+ * surface is mapped.
+ *
+ * Parent windows should be set on dialogs, toolboxes, or other
+ * "auxiliary" surfaces, so that the parent is raised when the dialog
+ * is raised.
+ */
+static inline void
+zxdg_toplevel_v6_set_parent(struct zxdg_toplevel_v6 *zxdg_toplevel_v6, struct zxdg_toplevel_v6 *parent)
+{
+ wl_proxy_marshal((struct wl_proxy *) zxdg_toplevel_v6,
+ ZXDG_TOPLEVEL_V6_SET_PARENT, parent);
+}
+
+/**
+ * @ingroup iface_zxdg_toplevel_v6
+ *
+ * Set a short title for the surface.
+ *
+ * This string may be used to identify the surface in a task bar,
+ * window list, or other user interface elements provided by the
+ * compositor.
+ *
+ * The string must be encoded in UTF-8.
+ */
+static inline void
+zxdg_toplevel_v6_set_title(struct zxdg_toplevel_v6 *zxdg_toplevel_v6, const char *title)
+{
+ wl_proxy_marshal((struct wl_proxy *) zxdg_toplevel_v6,
+ ZXDG_TOPLEVEL_V6_SET_TITLE, title);
+}
+
+/**
+ * @ingroup iface_zxdg_toplevel_v6
+ *
+ * Set an application identifier for the surface.
+ *
+ * The app ID identifies the general class of applications to which
+ * the surface belongs. The compositor can use this to group multiple
+ * surfaces together, or to determine how to launch a new application.
+ *
+ * For D-Bus activatable applications, the app ID is used as the D-Bus
+ * service name.
+ *
+ * The compositor shell will try to group application surfaces together
+ * by their app ID. As a best practice, it is suggested to select app
+ * ID's that match the basename of the application's .desktop file.
+ * For example, "org.freedesktop.FooViewer" where the .desktop file is
+ * "org.freedesktop.FooViewer.desktop".
+ *
+ * See the desktop-entry specification [0] for more details on
+ * application identifiers and how they relate to well-known D-Bus
+ * names and .desktop files.
+ *
+ * [0] http://standards.freedesktop.org/desktop-entry-spec/
+ */
+static inline void
+zxdg_toplevel_v6_set_app_id(struct zxdg_toplevel_v6 *zxdg_toplevel_v6, const char *app_id)
+{
+ wl_proxy_marshal((struct wl_proxy *) zxdg_toplevel_v6,
+ ZXDG_TOPLEVEL_V6_SET_APP_ID, app_id);
+}
+
+/**
+ * @ingroup iface_zxdg_toplevel_v6
+ *
+ * Clients implementing client-side decorations might want to show
+ * a context menu when right-clicking on the decorations, giving the
+ * user a menu that they can use to maximize or minimize the window.
+ *
+ * This request asks the compositor to pop up such a window menu at
+ * the given position, relative to the local surface coordinates of
+ * the parent surface. There are no guarantees as to what menu items
+ * the window menu contains.
+ *
+ * This request must be used in response to some sort of user action
+ * like a button press, key press, or touch down event.
+ */
+static inline void
+zxdg_toplevel_v6_show_window_menu(struct zxdg_toplevel_v6 *zxdg_toplevel_v6, struct wl_seat *seat, uint32_t serial, int32_t x, int32_t y)
+{
+ wl_proxy_marshal((struct wl_proxy *) zxdg_toplevel_v6,
+ ZXDG_TOPLEVEL_V6_SHOW_WINDOW_MENU, seat, serial, x, y);
+}
+
+/**
+ * @ingroup iface_zxdg_toplevel_v6
+ *
+ * Start an interactive, user-driven move of the surface.
+ *
+ * This request must be used in response to some sort of user action
+ * like a button press, key press, or touch down event. The passed
+ * serial is used to determine the type of interactive move (touch,
+ * pointer, etc).
+ *
+ * The server may ignore move requests depending on the state of
+ * the surface (e.g. fullscreen or maximized), or if the passed serial
+ * is no longer valid.
+ *
+ * If triggered, the surface will lose the focus of the device
+ * (wl_pointer, wl_touch, etc) used for the move. It is up to the
+ * compositor to visually indicate that the move is taking place, such as
+ * updating a pointer cursor, during the move. There is no guarantee
+ * that the device focus will return when the move is completed.
+ */
+static inline void
+zxdg_toplevel_v6_move(struct zxdg_toplevel_v6 *zxdg_toplevel_v6, struct wl_seat *seat, uint32_t serial)
+{
+ wl_proxy_marshal((struct wl_proxy *) zxdg_toplevel_v6,
+ ZXDG_TOPLEVEL_V6_MOVE, seat, serial);
+}
+
+/**
+ * @ingroup iface_zxdg_toplevel_v6
+ *
+ * Start a user-driven, interactive resize of the surface.
+ *
+ * This request must be used in response to some sort of user action
+ * like a button press, key press, or touch down event. The passed
+ * serial is used to determine the type of interactive resize (touch,
+ * pointer, etc).
+ *
+ * The server may ignore resize requests depending on the state of
+ * the surface (e.g. fullscreen or maximized).
+ *
+ * If triggered, the client will receive configure events with the
+ * "resize" state enum value and the expected sizes. See the "resize"
+ * enum value for more details about what is required. The client
+ * must also acknowledge configure events using "ack_configure". After
+ * the resize is completed, the client will receive another "configure"
+ * event without the resize state.
+ *
+ * If triggered, the surface also will lose the focus of the device
+ * (wl_pointer, wl_touch, etc) used for the resize. It is up to the
+ * compositor to visually indicate that the resize is taking place,
+ * such as updating a pointer cursor, during the resize. There is no
+ * guarantee that the device focus will return when the resize is
+ * completed.
+ *
+ * The edges parameter specifies how the surface should be resized,
+ * and is one of the values of the resize_edge enum. The compositor
+ * may use this information to update the surface position for
+ * example when dragging the top left corner. The compositor may also
+ * use this information to adapt its behavior, e.g. choose an
+ * appropriate cursor image.
+ */
+static inline void
+zxdg_toplevel_v6_resize(struct zxdg_toplevel_v6 *zxdg_toplevel_v6, struct wl_seat *seat, uint32_t serial, uint32_t edges)
+{
+ wl_proxy_marshal((struct wl_proxy *) zxdg_toplevel_v6,
+ ZXDG_TOPLEVEL_V6_RESIZE, seat, serial, edges);
+}
+
+/**
+ * @ingroup iface_zxdg_toplevel_v6
+ *
+ * Set a maximum size for the window.
+ *
+ * The client can specify a maximum size so that the compositor does
+ * not try to configure the window beyond this size.
+ *
+ * The width and height arguments are in window geometry coordinates.
+ * See xdg_surface.set_window_geometry.
+ *
+ * Values set in this way are double-buffered. They will get applied
+ * on the next commit.
+ *
+ * The compositor can use this information to allow or disallow
+ * different states like maximize or fullscreen and draw accurate
+ * animations.
+ *
+ * Similarly, a tiling window manager may use this information to
+ * place and resize client windows in a more effective way.
+ *
+ * The client should not rely on the compositor to obey the maximum
+ * size. The compositor may decide to ignore the values set by the
+ * client and request a larger size.
+ *
+ * If never set, or a value of zero in the request, means that the
+ * client has no expected maximum size in the given dimension.
+ * As a result, a client wishing to reset the maximum size
+ * to an unspecified state can use zero for width and height in the
+ * request.
+ *
+ * Requesting a maximum size to be smaller than the minimum size of
+ * a surface is illegal and will result in a protocol error.
+ *
+ * The width and height must be greater than or equal to zero. Using
+ * strictly negative values for width and height will result in a
+ * protocol error.
+ */
+static inline void
+zxdg_toplevel_v6_set_max_size(struct zxdg_toplevel_v6 *zxdg_toplevel_v6, int32_t width, int32_t height)
+{
+ wl_proxy_marshal((struct wl_proxy *) zxdg_toplevel_v6,
+ ZXDG_TOPLEVEL_V6_SET_MAX_SIZE, width, height);
+}
+
+/**
+ * @ingroup iface_zxdg_toplevel_v6
+ *
+ * Set a minimum size for the window.
+ *
+ * The client can specify a minimum size so that the compositor does
+ * not try to configure the window below this size.
+ *
+ * The width and height arguments are in window geometry coordinates.
+ * See xdg_surface.set_window_geometry.
+ *
+ * Values set in this way are double-buffered. They will get applied
+ * on the next commit.
+ *
+ * The compositor can use this information to allow or disallow
+ * different states like maximize or fullscreen and draw accurate
+ * animations.
+ *
+ * Similarly, a tiling window manager may use this information to
+ * place and resize client windows in a more effective way.
+ *
+ * The client should not rely on the compositor to obey the minimum
+ * size. The compositor may decide to ignore the values set by the
+ * client and request a smaller size.
+ *
+ * If never set, or a value of zero in the request, means that the
+ * client has no expected minimum size in the given dimension.
+ * As a result, a client wishing to reset the minimum size
+ * to an unspecified state can use zero for width and height in the
+ * request.
+ *
+ * Requesting a minimum size to be larger than the maximum size of
+ * a surface is illegal and will result in a protocol error.
+ *
+ * The width and height must be greater than or equal to zero. Using
+ * strictly negative values for width and height will result in a
+ * protocol error.
+ */
+static inline void
+zxdg_toplevel_v6_set_min_size(struct zxdg_toplevel_v6 *zxdg_toplevel_v6, int32_t width, int32_t height)
+{
+ wl_proxy_marshal((struct wl_proxy *) zxdg_toplevel_v6,
+ ZXDG_TOPLEVEL_V6_SET_MIN_SIZE, width, height);
+}
+
+/**
+ * @ingroup iface_zxdg_toplevel_v6
+ *
+ * Maximize the surface.
+ *
+ * After requesting that the surface should be maximized, the compositor
+ * will respond by emitting a configure event with the "maximized" state
+ * and the required window geometry. The client should then update its
+ * content, drawing it in a maximized state, i.e. without shadow or other
+ * decoration outside of the window geometry. The client must also
+ * acknowledge the configure when committing the new content (see
+ * ack_configure).
+ *
+ * It is up to the compositor to decide how and where to maximize the
+ * surface, for example which output and what region of the screen should
+ * be used.
+ *
+ * If the surface was already maximized, the compositor will still emit
+ * a configure event with the "maximized" state.
+ */
+static inline void
+zxdg_toplevel_v6_set_maximized(struct zxdg_toplevel_v6 *zxdg_toplevel_v6)
+{
+ wl_proxy_marshal((struct wl_proxy *) zxdg_toplevel_v6,
+ ZXDG_TOPLEVEL_V6_SET_MAXIMIZED);
+}
+
+/**
+ * @ingroup iface_zxdg_toplevel_v6
+ *
+ * Unmaximize the surface.
+ *
+ * After requesting that the surface should be unmaximized, the compositor
+ * will respond by emitting a configure event without the "maximized"
+ * state. If available, the compositor will include the window geometry
+ * dimensions the window had prior to being maximized in the configure
+ * request. The client must then update its content, drawing it in a
+ * regular state, i.e. potentially with shadow, etc. The client must also
+ * acknowledge the configure when committing the new content (see
+ * ack_configure).
+ *
+ * It is up to the compositor to position the surface after it was
+ * unmaximized; usually the position the surface had before maximizing, if
+ * applicable.
+ *
+ * If the surface was already not maximized, the compositor will still
+ * emit a configure event without the "maximized" state.
+ */
+static inline void
+zxdg_toplevel_v6_unset_maximized(struct zxdg_toplevel_v6 *zxdg_toplevel_v6)
+{
+ wl_proxy_marshal((struct wl_proxy *) zxdg_toplevel_v6,
+ ZXDG_TOPLEVEL_V6_UNSET_MAXIMIZED);
+}
+
+/**
+ * @ingroup iface_zxdg_toplevel_v6
+ *
+ * Make the surface fullscreen.
+ *
+ * You can specify an output that you would prefer to be fullscreen.
+ * If this value is NULL, it's up to the compositor to choose which
+ * display will be used to map this surface.
+ *
+ * If the surface doesn't cover the whole output, the compositor will
+ * position the surface in the center of the output and compensate with
+ * black borders filling the rest of the output.
+ */
+static inline void
+zxdg_toplevel_v6_set_fullscreen(struct zxdg_toplevel_v6 *zxdg_toplevel_v6, struct wl_output *output)
+{
+ wl_proxy_marshal((struct wl_proxy *) zxdg_toplevel_v6,
+ ZXDG_TOPLEVEL_V6_SET_FULLSCREEN, output);
+}
+
+/**
+ * @ingroup iface_zxdg_toplevel_v6
+ */
+static inline void
+zxdg_toplevel_v6_unset_fullscreen(struct zxdg_toplevel_v6 *zxdg_toplevel_v6)
+{
+ wl_proxy_marshal((struct wl_proxy *) zxdg_toplevel_v6,
+ ZXDG_TOPLEVEL_V6_UNSET_FULLSCREEN);
+}
+
+/**
+ * @ingroup iface_zxdg_toplevel_v6
+ *
+ * Request that the compositor minimize your surface. There is no
+ * way to know if the surface is currently minimized, nor is there
+ * any way to unset minimization on this surface.
+ *
+ * If you are looking to throttle redrawing when minimized, please
+ * instead use the wl_surface.frame event for this, as this will
+ * also work with live previews on windows in Alt-Tab, Expose or
+ * similar compositor features.
+ */
+static inline void
+zxdg_toplevel_v6_set_minimized(struct zxdg_toplevel_v6 *zxdg_toplevel_v6)
+{
+ wl_proxy_marshal((struct wl_proxy *) zxdg_toplevel_v6,
+ ZXDG_TOPLEVEL_V6_SET_MINIMIZED);
+}
+
+#ifndef ZXDG_POPUP_V6_ERROR_ENUM
+#define ZXDG_POPUP_V6_ERROR_ENUM
+enum zxdg_popup_v6_error {
+ /**
+ * tried to grab after being mapped
+ */
+ ZXDG_POPUP_V6_ERROR_INVALID_GRAB = 0,
+};
+#endif /* ZXDG_POPUP_V6_ERROR_ENUM */
+
+/**
+ * @ingroup iface_zxdg_popup_v6
+ * @struct zxdg_popup_v6_listener
+ */
+struct zxdg_popup_v6_listener {
+ /**
+ * configure the popup surface
+ *
+ * This event asks the popup surface to configure itself given
+ * the configuration. The configured state should not be applied
+ * immediately. See xdg_surface.configure for details.
+ *
+ * The x and y arguments represent the position the popup was
+ * placed at given the xdg_positioner rule, relative to the upper
+ * left corner of the window geometry of the parent surface.
+ * @param x x position relative to parent surface window geometry
+ * @param y y position relative to parent surface window geometry
+ * @param width window geometry width
+ * @param height window geometry height
+ */
+ void (*configure)(void *data,
+ struct zxdg_popup_v6 *zxdg_popup_v6,
+ int32_t x,
+ int32_t y,
+ int32_t width,
+ int32_t height);
+ /**
+ * popup interaction is done
+ *
+ * The popup_done event is sent out when a popup is dismissed by
+ * the compositor. The client should destroy the xdg_popup object
+ * at this point.
+ */
+ void (*popup_done)(void *data,
+ struct zxdg_popup_v6 *zxdg_popup_v6);
+};
+
+/**
+ * @ingroup iface_zxdg_popup_v6
+ */
+static inline int
+zxdg_popup_v6_add_listener(struct zxdg_popup_v6 *zxdg_popup_v6,
+ const struct zxdg_popup_v6_listener *listener, void *data)
+{
+ return wl_proxy_add_listener((struct wl_proxy *) zxdg_popup_v6,
+ (void (**)(void)) listener, data);
+}
+
+#define ZXDG_POPUP_V6_DESTROY 0
+#define ZXDG_POPUP_V6_GRAB 1
+
+/**
+ * @ingroup iface_zxdg_popup_v6
+ */
+#define ZXDG_POPUP_V6_CONFIGURE_SINCE_VERSION 1
+/**
+ * @ingroup iface_zxdg_popup_v6
+ */
+#define ZXDG_POPUP_V6_POPUP_DONE_SINCE_VERSION 1
+
+/**
+ * @ingroup iface_zxdg_popup_v6
+ */
+#define ZXDG_POPUP_V6_DESTROY_SINCE_VERSION 1
+/**
+ * @ingroup iface_zxdg_popup_v6
+ */
+#define ZXDG_POPUP_V6_GRAB_SINCE_VERSION 1
+
+/** @ingroup iface_zxdg_popup_v6 */
+static inline void
+zxdg_popup_v6_set_user_data(struct zxdg_popup_v6 *zxdg_popup_v6, void *user_data)
+{
+ wl_proxy_set_user_data((struct wl_proxy *) zxdg_popup_v6, user_data);
+}
+
+/** @ingroup iface_zxdg_popup_v6 */
+static inline void *
+zxdg_popup_v6_get_user_data(struct zxdg_popup_v6 *zxdg_popup_v6)
+{
+ return wl_proxy_get_user_data((struct wl_proxy *) zxdg_popup_v6);
+}
+
+static inline uint32_t
+zxdg_popup_v6_get_version(struct zxdg_popup_v6 *zxdg_popup_v6)
+{
+ return wl_proxy_get_version((struct wl_proxy *) zxdg_popup_v6);
+}
+
+/**
+ * @ingroup iface_zxdg_popup_v6
+ *
+ * This destroys the popup. Explicitly destroying the xdg_popup
+ * object will also dismiss the popup, and unmap the surface.
+ *
+ * If this xdg_popup is not the "topmost" popup, a protocol error
+ * will be sent.
+ */
+static inline void
+zxdg_popup_v6_destroy(struct zxdg_popup_v6 *zxdg_popup_v6)
+{
+ wl_proxy_marshal((struct wl_proxy *) zxdg_popup_v6,
+ ZXDG_POPUP_V6_DESTROY);
+
+ wl_proxy_destroy((struct wl_proxy *) zxdg_popup_v6);
+}
+
+/**
+ * @ingroup iface_zxdg_popup_v6
+ *
+ * This request makes the created popup take an explicit grab. An explicit
+ * grab will be dismissed when the user dismisses the popup, or when the
+ * client destroys the xdg_popup. This can be done by the user clicking
+ * outside the surface, using the keyboard, or even locking the screen
+ * through closing the lid or a timeout.
+ *
+ * If the compositor denies the grab, the popup will be immediately
+ * dismissed.
+ *
+ * This request must be used in response to some sort of user action like a
+ * button press, key press, or touch down event. The serial number of the
+ * event should be passed as 'serial'.
+ *
+ * The parent of a grabbing popup must either be an xdg_toplevel surface or
+ * another xdg_popup with an explicit grab. If the parent is another
+ * xdg_popup it means that the popups are nested, with this popup now being
+ * the topmost popup.
+ *
+ * Nested popups must be destroyed in the reverse order they were created
+ * in, e.g. the only popup you are allowed to destroy at all times is the
+ * topmost one.
+ *
+ * When compositors choose to dismiss a popup, they may dismiss every
+ * nested grabbing popup as well. When a compositor dismisses popups, it
+ * will follow the same dismissing order as required from the client.
+ *
+ * The parent of a grabbing popup must either be another xdg_popup with an
+ * active explicit grab, or an xdg_popup or xdg_toplevel, if there are no
+ * explicit grabs already taken.
+ *
+ * If the topmost grabbing popup is destroyed, the grab will be returned to
+ * the parent of the popup, if that parent previously had an explicit grab.
+ *
+ * If the parent is a grabbing popup which has already been dismissed, this
+ * popup will be immediately dismissed. If the parent is a popup that did
+ * not take an explicit grab, an error will be raised.
+ *
+ * During a popup grab, the client owning the grab will receive pointer
+ * and touch events for all their surfaces as normal (similar to an
+ * "owner-events" grab in X11 parlance), while the top most grabbing popup
+ * will always have keyboard focus.
+ */
+static inline void
+zxdg_popup_v6_grab(struct zxdg_popup_v6 *zxdg_popup_v6, struct wl_seat *seat, uint32_t serial)
+{
+ wl_proxy_marshal((struct wl_proxy *) zxdg_popup_v6,
+ ZXDG_POPUP_V6_GRAB, seat, serial);
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/chromium/third_party/wayland-protocols/include/protocol/xdg-shell-unstable-v6-server-protocol.h b/chromium/third_party/wayland-protocols/include/protocol/xdg-shell-unstable-v6-server-protocol.h
new file mode 100644
index 00000000000..57dc92bfcb5
--- /dev/null
+++ b/chromium/third_party/wayland-protocols/include/protocol/xdg-shell-unstable-v6-server-protocol.h
@@ -0,0 +1,1441 @@
+/* Generated by wayland-scanner 1.13.0 */
+
+#ifndef XDG_SHELL_UNSTABLE_V6_SERVER_PROTOCOL_H
+#define XDG_SHELL_UNSTABLE_V6_SERVER_PROTOCOL_H
+
+#include <stdint.h>
+#include <stddef.h>
+#include "wayland-server.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct wl_client;
+struct wl_resource;
+
+/**
+ * @page page_xdg_shell_unstable_v6 The xdg_shell_unstable_v6 protocol
+ * @section page_ifaces_xdg_shell_unstable_v6 Interfaces
+ * - @subpage page_iface_zxdg_shell_v6 - create desktop-style surfaces
+ * - @subpage page_iface_zxdg_positioner_v6 - child surface positioner
+ * - @subpage page_iface_zxdg_surface_v6 - desktop user interface surface base interface
+ * - @subpage page_iface_zxdg_toplevel_v6 - toplevel surface
+ * - @subpage page_iface_zxdg_popup_v6 - short-lived, popup surfaces for menus
+ * @section page_copyright_xdg_shell_unstable_v6 Copyright
+ * <pre>
+ *
+ * Copyright © 2008-2013 Kristian Høgsberg
+ * Copyright © 2013 Rafael Antognolli
+ * Copyright © 2013 Jasper St. Pierre
+ * Copyright © 2010-2013 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ * </pre>
+ */
+struct wl_output;
+struct wl_seat;
+struct wl_surface;
+struct zxdg_popup_v6;
+struct zxdg_positioner_v6;
+struct zxdg_shell_v6;
+struct zxdg_surface_v6;
+struct zxdg_toplevel_v6;
+
+/**
+ * @page page_iface_zxdg_shell_v6 zxdg_shell_v6
+ * @section page_iface_zxdg_shell_v6_desc Description
+ *
+ * xdg_shell allows clients to turn a wl_surface into a "real window"
+ * which can be dragged, resized, stacked, and moved around by the
+ * user. Everything about this interface is suited towards traditional
+ * desktop environments.
+ * @section page_iface_zxdg_shell_v6_api API
+ * See @ref iface_zxdg_shell_v6.
+ */
+/**
+ * @defgroup iface_zxdg_shell_v6 The zxdg_shell_v6 interface
+ *
+ * xdg_shell allows clients to turn a wl_surface into a "real window"
+ * which can be dragged, resized, stacked, and moved around by the
+ * user. Everything about this interface is suited towards traditional
+ * desktop environments.
+ */
+extern const struct wl_interface zxdg_shell_v6_interface;
+/**
+ * @page page_iface_zxdg_positioner_v6 zxdg_positioner_v6
+ * @section page_iface_zxdg_positioner_v6_desc Description
+ *
+ * The xdg_positioner provides a collection of rules for the placement of a
+ * child surface relative to a parent surface. Rules can be defined to ensure
+ * the child surface remains within the visible area's borders, and to
+ * specify how the child surface changes its position, such as sliding along
+ * an axis, or flipping around a rectangle. These positioner-created rules are
+ * constrained by the requirement that a child surface must intersect with or
+ * be at least partially adjacent to its parent surface.
+ *
+ * See the various requests for details about possible rules.
+ *
+ * At the time of the request, the compositor makes a copy of the rules
+ * specified by the xdg_positioner. Thus, after the request is complete the
+ * xdg_positioner object can be destroyed or reused; further changes to the
+ * object will have no effect on previous usages.
+ *
+ * For an xdg_positioner object to be considered complete, it must have a
+ * non-zero size set by set_size, and a non-zero anchor rectangle set by
+ * set_anchor_rect. Passing an incomplete xdg_positioner object when
+ * positioning a surface raises an error.
+ * @section page_iface_zxdg_positioner_v6_api API
+ * See @ref iface_zxdg_positioner_v6.
+ */
+/**
+ * @defgroup iface_zxdg_positioner_v6 The zxdg_positioner_v6 interface
+ *
+ * The xdg_positioner provides a collection of rules for the placement of a
+ * child surface relative to a parent surface. Rules can be defined to ensure
+ * the child surface remains within the visible area's borders, and to
+ * specify how the child surface changes its position, such as sliding along
+ * an axis, or flipping around a rectangle. These positioner-created rules are
+ * constrained by the requirement that a child surface must intersect with or
+ * be at least partially adjacent to its parent surface.
+ *
+ * See the various requests for details about possible rules.
+ *
+ * At the time of the request, the compositor makes a copy of the rules
+ * specified by the xdg_positioner. Thus, after the request is complete the
+ * xdg_positioner object can be destroyed or reused; further changes to the
+ * object will have no effect on previous usages.
+ *
+ * For an xdg_positioner object to be considered complete, it must have a
+ * non-zero size set by set_size, and a non-zero anchor rectangle set by
+ * set_anchor_rect. Passing an incomplete xdg_positioner object when
+ * positioning a surface raises an error.
+ */
+extern const struct wl_interface zxdg_positioner_v6_interface;
+/**
+ * @page page_iface_zxdg_surface_v6 zxdg_surface_v6
+ * @section page_iface_zxdg_surface_v6_desc Description
+ *
+ * An interface that may be implemented by a wl_surface, for
+ * implementations that provide a desktop-style user interface.
+ *
+ * It provides a base set of functionality required to construct user
+ * interface elements requiring management by the compositor, such as
+ * toplevel windows, menus, etc. The types of functionality are split into
+ * xdg_surface roles.
+ *
+ * Creating an xdg_surface does not set the role for a wl_surface. In order
+ * to map an xdg_surface, the client must create a role-specific object
+ * using, e.g., get_toplevel, get_popup. The wl_surface for any given
+ * xdg_surface can have at most one role, and may not be assigned any role
+ * not based on xdg_surface.
+ *
+ * A role must be assigned before any other requests are made to the
+ * xdg_surface object.
+ *
+ * The client must call wl_surface.commit on the corresponding wl_surface
+ * for the xdg_surface state to take effect.
+ *
+ * Creating an xdg_surface from a wl_surface which has a buffer attached or
+ * committed is a client error, and any attempts by a client to attach or
+ * manipulate a buffer prior to the first xdg_surface.configure call must
+ * also be treated as errors.
+ *
+ * For a surface to be mapped by the compositor, the following conditions
+ * must be met: (1) the client has assigned a xdg_surface based role to the
+ * surface, (2) the client has set and committed the xdg_surface state and
+ * the role dependent state to the surface and (3) the client has committed a
+ * buffer to the surface.
+ * @section page_iface_zxdg_surface_v6_api API
+ * See @ref iface_zxdg_surface_v6.
+ */
+/**
+ * @defgroup iface_zxdg_surface_v6 The zxdg_surface_v6 interface
+ *
+ * An interface that may be implemented by a wl_surface, for
+ * implementations that provide a desktop-style user interface.
+ *
+ * It provides a base set of functionality required to construct user
+ * interface elements requiring management by the compositor, such as
+ * toplevel windows, menus, etc. The types of functionality are split into
+ * xdg_surface roles.
+ *
+ * Creating an xdg_surface does not set the role for a wl_surface. In order
+ * to map an xdg_surface, the client must create a role-specific object
+ * using, e.g., get_toplevel, get_popup. The wl_surface for any given
+ * xdg_surface can have at most one role, and may not be assigned any role
+ * not based on xdg_surface.
+ *
+ * A role must be assigned before any other requests are made to the
+ * xdg_surface object.
+ *
+ * The client must call wl_surface.commit on the corresponding wl_surface
+ * for the xdg_surface state to take effect.
+ *
+ * Creating an xdg_surface from a wl_surface which has a buffer attached or
+ * committed is a client error, and any attempts by a client to attach or
+ * manipulate a buffer prior to the first xdg_surface.configure call must
+ * also be treated as errors.
+ *
+ * For a surface to be mapped by the compositor, the following conditions
+ * must be met: (1) the client has assigned a xdg_surface based role to the
+ * surface, (2) the client has set and committed the xdg_surface state and
+ * the role dependent state to the surface and (3) the client has committed a
+ * buffer to the surface.
+ */
+extern const struct wl_interface zxdg_surface_v6_interface;
+/**
+ * @page page_iface_zxdg_toplevel_v6 zxdg_toplevel_v6
+ * @section page_iface_zxdg_toplevel_v6_desc Description
+ *
+ * This interface defines an xdg_surface role which allows a surface to,
+ * among other things, set window-like properties such as maximize,
+ * fullscreen, and minimize, set application-specific metadata like title and
+ * id, and well as trigger user interactive operations such as interactive
+ * resize and move.
+ * @section page_iface_zxdg_toplevel_v6_api API
+ * See @ref iface_zxdg_toplevel_v6.
+ */
+/**
+ * @defgroup iface_zxdg_toplevel_v6 The zxdg_toplevel_v6 interface
+ *
+ * This interface defines an xdg_surface role which allows a surface to,
+ * among other things, set window-like properties such as maximize,
+ * fullscreen, and minimize, set application-specific metadata like title and
+ * id, and well as trigger user interactive operations such as interactive
+ * resize and move.
+ */
+extern const struct wl_interface zxdg_toplevel_v6_interface;
+/**
+ * @page page_iface_zxdg_popup_v6 zxdg_popup_v6
+ * @section page_iface_zxdg_popup_v6_desc Description
+ *
+ * A popup surface is a short-lived, temporary surface. It can be used to
+ * implement for example menus, popovers, tooltips and other similar user
+ * interface concepts.
+ *
+ * A popup can be made to take an explicit grab. See xdg_popup.grab for
+ * details.
+ *
+ * When the popup is dismissed, a popup_done event will be sent out, and at
+ * the same time the surface will be unmapped. See the xdg_popup.popup_done
+ * event for details.
+ *
+ * Explicitly destroying the xdg_popup object will also dismiss the popup and
+ * unmap the surface. Clients that want to dismiss the popup when another
+ * surface of their own is clicked should dismiss the popup using the destroy
+ * request.
+ *
+ * The parent surface must have either the xdg_toplevel or xdg_popup surface
+ * role.
+ *
+ * A newly created xdg_popup will be stacked on top of all previously created
+ * xdg_popup surfaces associated with the same xdg_toplevel.
+ *
+ * The parent of an xdg_popup must be mapped (see the xdg_surface
+ * description) before the xdg_popup itself.
+ *
+ * The x and y arguments passed when creating the popup object specify
+ * where the top left of the popup should be placed, relative to the
+ * local surface coordinates of the parent surface. See
+ * xdg_surface.get_popup. An xdg_popup must intersect with or be at least
+ * partially adjacent to its parent surface.
+ *
+ * The client must call wl_surface.commit on the corresponding wl_surface
+ * for the xdg_popup state to take effect.
+ * @section page_iface_zxdg_popup_v6_api API
+ * See @ref iface_zxdg_popup_v6.
+ */
+/**
+ * @defgroup iface_zxdg_popup_v6 The zxdg_popup_v6 interface
+ *
+ * A popup surface is a short-lived, temporary surface. It can be used to
+ * implement for example menus, popovers, tooltips and other similar user
+ * interface concepts.
+ *
+ * A popup can be made to take an explicit grab. See xdg_popup.grab for
+ * details.
+ *
+ * When the popup is dismissed, a popup_done event will be sent out, and at
+ * the same time the surface will be unmapped. See the xdg_popup.popup_done
+ * event for details.
+ *
+ * Explicitly destroying the xdg_popup object will also dismiss the popup and
+ * unmap the surface. Clients that want to dismiss the popup when another
+ * surface of their own is clicked should dismiss the popup using the destroy
+ * request.
+ *
+ * The parent surface must have either the xdg_toplevel or xdg_popup surface
+ * role.
+ *
+ * A newly created xdg_popup will be stacked on top of all previously created
+ * xdg_popup surfaces associated with the same xdg_toplevel.
+ *
+ * The parent of an xdg_popup must be mapped (see the xdg_surface
+ * description) before the xdg_popup itself.
+ *
+ * The x and y arguments passed when creating the popup object specify
+ * where the top left of the popup should be placed, relative to the
+ * local surface coordinates of the parent surface. See
+ * xdg_surface.get_popup. An xdg_popup must intersect with or be at least
+ * partially adjacent to its parent surface.
+ *
+ * The client must call wl_surface.commit on the corresponding wl_surface
+ * for the xdg_popup state to take effect.
+ */
+extern const struct wl_interface zxdg_popup_v6_interface;
+
+#ifndef ZXDG_SHELL_V6_ERROR_ENUM
+#define ZXDG_SHELL_V6_ERROR_ENUM
+enum zxdg_shell_v6_error {
+ /**
+ * given wl_surface has another role
+ */
+ ZXDG_SHELL_V6_ERROR_ROLE = 0,
+ /**
+ * xdg_shell was destroyed before children
+ */
+ ZXDG_SHELL_V6_ERROR_DEFUNCT_SURFACES = 1,
+ /**
+ * the client tried to map or destroy a non-topmost popup
+ */
+ ZXDG_SHELL_V6_ERROR_NOT_THE_TOPMOST_POPUP = 2,
+ /**
+ * the client specified an invalid popup parent surface
+ */
+ ZXDG_SHELL_V6_ERROR_INVALID_POPUP_PARENT = 3,
+ /**
+ * the client provided an invalid surface state
+ */
+ ZXDG_SHELL_V6_ERROR_INVALID_SURFACE_STATE = 4,
+ /**
+ * the client provided an invalid positioner
+ */
+ ZXDG_SHELL_V6_ERROR_INVALID_POSITIONER = 5,
+};
+#endif /* ZXDG_SHELL_V6_ERROR_ENUM */
+
+/**
+ * @ingroup iface_zxdg_shell_v6
+ * @struct zxdg_shell_v6_interface
+ */
+struct zxdg_shell_v6_interface {
+ /**
+ * destroy xdg_shell
+ *
+ * Destroy this xdg_shell object.
+ *
+ * Destroying a bound xdg_shell object while there are surfaces
+ * still alive created by this xdg_shell object instance is illegal
+ * and will result in a protocol error.
+ */
+ void (*destroy)(struct wl_client *client,
+ struct wl_resource *resource);
+ /**
+ * create a positioner object
+ *
+ * Create a positioner object. A positioner object is used to
+ * position surfaces relative to some parent surface. See the
+ * interface description and xdg_surface.get_popup for details.
+ */
+ void (*create_positioner)(struct wl_client *client,
+ struct wl_resource *resource,
+ uint32_t id);
+ /**
+ * create a shell surface from a surface
+ *
+ * This creates an xdg_surface for the given surface. While
+ * xdg_surface itself is not a role, the corresponding surface may
+ * only be assigned a role extending xdg_surface, such as
+ * xdg_toplevel or xdg_popup.
+ *
+ * This creates an xdg_surface for the given surface. An
+ * xdg_surface is used as basis to define a role to a given
+ * surface, such as xdg_toplevel or xdg_popup. It also manages
+ * functionality shared between xdg_surface based surface roles.
+ *
+ * See the documentation of xdg_surface for more details about what
+ * an xdg_surface is and how it is used.
+ */
+ void (*get_xdg_surface)(struct wl_client *client,
+ struct wl_resource *resource,
+ uint32_t id,
+ struct wl_resource *surface);
+ /**
+ * respond to a ping event
+ *
+ * A client must respond to a ping event with a pong request or
+ * the client may be deemed unresponsive. See xdg_shell.ping.
+ * @param serial serial of the ping event
+ */
+ void (*pong)(struct wl_client *client,
+ struct wl_resource *resource,
+ uint32_t serial);
+};
+
+#define ZXDG_SHELL_V6_PING 0
+
+/**
+ * @ingroup iface_zxdg_shell_v6
+ */
+#define ZXDG_SHELL_V6_PING_SINCE_VERSION 1
+
+/**
+ * @ingroup iface_zxdg_shell_v6
+ */
+#define ZXDG_SHELL_V6_DESTROY_SINCE_VERSION 1
+/**
+ * @ingroup iface_zxdg_shell_v6
+ */
+#define ZXDG_SHELL_V6_CREATE_POSITIONER_SINCE_VERSION 1
+/**
+ * @ingroup iface_zxdg_shell_v6
+ */
+#define ZXDG_SHELL_V6_GET_XDG_SURFACE_SINCE_VERSION 1
+/**
+ * @ingroup iface_zxdg_shell_v6
+ */
+#define ZXDG_SHELL_V6_PONG_SINCE_VERSION 1
+
+/**
+ * @ingroup iface_zxdg_shell_v6
+ * Sends an ping event to the client owning the resource.
+ * @param resource_ The client's resource
+ * @param serial pass this to the pong request
+ */
+static inline void
+zxdg_shell_v6_send_ping(struct wl_resource *resource_, uint32_t serial)
+{
+ wl_resource_post_event(resource_, ZXDG_SHELL_V6_PING, serial);
+}
+
+#ifndef ZXDG_POSITIONER_V6_ERROR_ENUM
+#define ZXDG_POSITIONER_V6_ERROR_ENUM
+enum zxdg_positioner_v6_error {
+ /**
+ * invalid input provided
+ */
+ ZXDG_POSITIONER_V6_ERROR_INVALID_INPUT = 0,
+};
+#endif /* ZXDG_POSITIONER_V6_ERROR_ENUM */
+
+#ifndef ZXDG_POSITIONER_V6_ANCHOR_ENUM
+#define ZXDG_POSITIONER_V6_ANCHOR_ENUM
+enum zxdg_positioner_v6_anchor {
+ /**
+ * the center of the anchor rectangle
+ */
+ ZXDG_POSITIONER_V6_ANCHOR_NONE = 0,
+ /**
+ * the top edge of the anchor rectangle
+ */
+ ZXDG_POSITIONER_V6_ANCHOR_TOP = 1,
+ /**
+ * the bottom edge of the anchor rectangle
+ */
+ ZXDG_POSITIONER_V6_ANCHOR_BOTTOM = 2,
+ /**
+ * the left edge of the anchor rectangle
+ */
+ ZXDG_POSITIONER_V6_ANCHOR_LEFT = 4,
+ /**
+ * the right edge of the anchor rectangle
+ */
+ ZXDG_POSITIONER_V6_ANCHOR_RIGHT = 8,
+};
+#endif /* ZXDG_POSITIONER_V6_ANCHOR_ENUM */
+
+#ifndef ZXDG_POSITIONER_V6_GRAVITY_ENUM
+#define ZXDG_POSITIONER_V6_GRAVITY_ENUM
+enum zxdg_positioner_v6_gravity {
+ /**
+ * center over the anchor edge
+ */
+ ZXDG_POSITIONER_V6_GRAVITY_NONE = 0,
+ /**
+ * position above the anchor edge
+ */
+ ZXDG_POSITIONER_V6_GRAVITY_TOP = 1,
+ /**
+ * position below the anchor edge
+ */
+ ZXDG_POSITIONER_V6_GRAVITY_BOTTOM = 2,
+ /**
+ * position to the left of the anchor edge
+ */
+ ZXDG_POSITIONER_V6_GRAVITY_LEFT = 4,
+ /**
+ * position to the right of the anchor edge
+ */
+ ZXDG_POSITIONER_V6_GRAVITY_RIGHT = 8,
+};
+#endif /* ZXDG_POSITIONER_V6_GRAVITY_ENUM */
+
+#ifndef ZXDG_POSITIONER_V6_CONSTRAINT_ADJUSTMENT_ENUM
+#define ZXDG_POSITIONER_V6_CONSTRAINT_ADJUSTMENT_ENUM
+/**
+ * @ingroup iface_zxdg_positioner_v6
+ * vertically resize the surface
+ *
+ * Resize the surface vertically so that it is completely unconstrained.
+ */
+enum zxdg_positioner_v6_constraint_adjustment {
+ ZXDG_POSITIONER_V6_CONSTRAINT_ADJUSTMENT_NONE = 0,
+ ZXDG_POSITIONER_V6_CONSTRAINT_ADJUSTMENT_SLIDE_X = 1,
+ ZXDG_POSITIONER_V6_CONSTRAINT_ADJUSTMENT_SLIDE_Y = 2,
+ ZXDG_POSITIONER_V6_CONSTRAINT_ADJUSTMENT_FLIP_X = 4,
+ ZXDG_POSITIONER_V6_CONSTRAINT_ADJUSTMENT_FLIP_Y = 8,
+ ZXDG_POSITIONER_V6_CONSTRAINT_ADJUSTMENT_RESIZE_X = 16,
+ ZXDG_POSITIONER_V6_CONSTRAINT_ADJUSTMENT_RESIZE_Y = 32,
+};
+#endif /* ZXDG_POSITIONER_V6_CONSTRAINT_ADJUSTMENT_ENUM */
+
+/**
+ * @ingroup iface_zxdg_positioner_v6
+ * @struct zxdg_positioner_v6_interface
+ */
+struct zxdg_positioner_v6_interface {
+ /**
+ * destroy the xdg_positioner object
+ *
+ * Notify the compositor that the xdg_positioner will no longer
+ * be used.
+ */
+ void (*destroy)(struct wl_client *client,
+ struct wl_resource *resource);
+ /**
+ * set the size of the to-be positioned rectangle
+ *
+ * Set the size of the surface that is to be positioned with the
+ * positioner object. The size is in surface-local coordinates and
+ * corresponds to the window geometry. See
+ * xdg_surface.set_window_geometry.
+ *
+ * If a zero or negative size is set the invalid_input error is
+ * raised.
+ * @param width width of positioned rectangle
+ * @param height height of positioned rectangle
+ */
+ void (*set_size)(struct wl_client *client,
+ struct wl_resource *resource,
+ int32_t width,
+ int32_t height);
+ /**
+ * set the anchor rectangle within the parent surface
+ *
+ * Specify the anchor rectangle within the parent surface that
+ * the child surface will be placed relative to. The rectangle is
+ * relative to the window geometry as defined by
+ * xdg_surface.set_window_geometry of the parent surface. The
+ * rectangle must be at least 1x1 large.
+ *
+ * When the xdg_positioner object is used to position a child
+ * surface, the anchor rectangle may not extend outside the window
+ * geometry of the positioned child's parent surface.
+ *
+ * If a zero or negative size is set the invalid_input error is
+ * raised.
+ * @param x x position of anchor rectangle
+ * @param y y position of anchor rectangle
+ * @param width width of anchor rectangle
+ * @param height height of anchor rectangle
+ */
+ void (*set_anchor_rect)(struct wl_client *client,
+ struct wl_resource *resource,
+ int32_t x,
+ int32_t y,
+ int32_t width,
+ int32_t height);
+ /**
+ * set anchor rectangle anchor edges
+ *
+ * Defines a set of edges for the anchor rectangle. These are
+ * used to derive an anchor point that the child surface will be
+ * positioned relative to. If two orthogonal edges are specified
+ * (e.g. 'top' and 'left'), then the anchor point will be the
+ * intersection of the edges (e.g. the top left position of the
+ * rectangle); otherwise, the derived anchor point will be centered
+ * on the specified edge, or in the center of the anchor rectangle
+ * if no edge is specified.
+ *
+ * If two parallel anchor edges are specified (e.g. 'left' and
+ * 'right'), the invalid_input error is raised.
+ * @param anchor bit mask of anchor edges
+ */
+ void (*set_anchor)(struct wl_client *client,
+ struct wl_resource *resource,
+ uint32_t anchor);
+ /**
+ * set child surface gravity
+ *
+ * Defines in what direction a surface should be positioned,
+ * relative to the anchor point of the parent surface. If two
+ * orthogonal gravities are specified (e.g. 'bottom' and 'right'),
+ * then the child surface will be placed in the specified
+ * direction; otherwise, the child surface will be centered over
+ * the anchor point on any axis that had no gravity specified.
+ *
+ * If two parallel gravities are specified (e.g. 'left' and
+ * 'right'), the invalid_input error is raised.
+ * @param gravity bit mask of gravity directions
+ */
+ void (*set_gravity)(struct wl_client *client,
+ struct wl_resource *resource,
+ uint32_t gravity);
+ /**
+ * set the adjustment to be done when constrained
+ *
+ * Specify how the window should be positioned if the originally
+ * intended position caused the surface to be constrained, meaning
+ * at least partially outside positioning boundaries set by the
+ * compositor. The adjustment is set by constructing a bitmask
+ * describing the adjustment to be made when the surface is
+ * constrained on that axis.
+ *
+ * If no bit for one axis is set, the compositor will assume that
+ * the child surface should not change its position on that axis
+ * when constrained.
+ *
+ * If more than one bit for one axis is set, the order of how
+ * adjustments are applied is specified in the corresponding
+ * adjustment descriptions.
+ *
+ * The default adjustment is none.
+ * @param constraint_adjustment bit mask of constraint adjustments
+ */
+ void (*set_constraint_adjustment)(struct wl_client *client,
+ struct wl_resource *resource,
+ uint32_t constraint_adjustment);
+ /**
+ * set surface position offset
+ *
+ * Specify the surface position offset relative to the position
+ * of the anchor on the anchor rectangle and the anchor on the
+ * surface. For example if the anchor of the anchor rectangle is at
+ * (x, y), the surface has the gravity bottom|right, and the offset
+ * is (ox, oy), the calculated surface position will be (x + ox, y
+ * + oy). The offset position of the surface is the one used for
+ * constraint testing. See set_constraint_adjustment.
+ *
+ * An example use case is placing a popup menu on top of a user
+ * interface element, while aligning the user interface element of
+ * the parent surface with some user interface element placed
+ * somewhere in the popup surface.
+ * @param x surface position x offset
+ * @param y surface position y offset
+ */
+ void (*set_offset)(struct wl_client *client,
+ struct wl_resource *resource,
+ int32_t x,
+ int32_t y);
+};
+
+
+/**
+ * @ingroup iface_zxdg_positioner_v6
+ */
+#define ZXDG_POSITIONER_V6_DESTROY_SINCE_VERSION 1
+/**
+ * @ingroup iface_zxdg_positioner_v6
+ */
+#define ZXDG_POSITIONER_V6_SET_SIZE_SINCE_VERSION 1
+/**
+ * @ingroup iface_zxdg_positioner_v6
+ */
+#define ZXDG_POSITIONER_V6_SET_ANCHOR_RECT_SINCE_VERSION 1
+/**
+ * @ingroup iface_zxdg_positioner_v6
+ */
+#define ZXDG_POSITIONER_V6_SET_ANCHOR_SINCE_VERSION 1
+/**
+ * @ingroup iface_zxdg_positioner_v6
+ */
+#define ZXDG_POSITIONER_V6_SET_GRAVITY_SINCE_VERSION 1
+/**
+ * @ingroup iface_zxdg_positioner_v6
+ */
+#define ZXDG_POSITIONER_V6_SET_CONSTRAINT_ADJUSTMENT_SINCE_VERSION 1
+/**
+ * @ingroup iface_zxdg_positioner_v6
+ */
+#define ZXDG_POSITIONER_V6_SET_OFFSET_SINCE_VERSION 1
+
+#ifndef ZXDG_SURFACE_V6_ERROR_ENUM
+#define ZXDG_SURFACE_V6_ERROR_ENUM
+enum zxdg_surface_v6_error {
+ ZXDG_SURFACE_V6_ERROR_NOT_CONSTRUCTED = 1,
+ ZXDG_SURFACE_V6_ERROR_ALREADY_CONSTRUCTED = 2,
+ ZXDG_SURFACE_V6_ERROR_UNCONFIGURED_BUFFER = 3,
+};
+#endif /* ZXDG_SURFACE_V6_ERROR_ENUM */
+
+/**
+ * @ingroup iface_zxdg_surface_v6
+ * @struct zxdg_surface_v6_interface
+ */
+struct zxdg_surface_v6_interface {
+ /**
+ * destroy the xdg_surface
+ *
+ * Destroy the xdg_surface object. An xdg_surface must only be
+ * destroyed after its role object has been destroyed.
+ */
+ void (*destroy)(struct wl_client *client,
+ struct wl_resource *resource);
+ /**
+ * assign the xdg_toplevel surface role
+ *
+ * This creates an xdg_toplevel object for the given xdg_surface
+ * and gives the associated wl_surface the xdg_toplevel role.
+ *
+ * See the documentation of xdg_toplevel for more details about
+ * what an xdg_toplevel is and how it is used.
+ */
+ void (*get_toplevel)(struct wl_client *client,
+ struct wl_resource *resource,
+ uint32_t id);
+ /**
+ * assign the xdg_popup surface role
+ *
+ * This creates an xdg_popup object for the given xdg_surface and
+ * gives the associated wl_surface the xdg_popup role.
+ *
+ * See the documentation of xdg_popup for more details about what
+ * an xdg_popup is and how it is used.
+ */
+ void (*get_popup)(struct wl_client *client,
+ struct wl_resource *resource,
+ uint32_t id,
+ struct wl_resource *parent,
+ struct wl_resource *positioner);
+ /**
+ * set the new window geometry
+ *
+ * The window geometry of a surface is its "visible bounds" from
+ * the user's perspective. Client-side decorations often have
+ * invisible portions like drop-shadows which should be ignored for
+ * the purposes of aligning, placing and constraining windows.
+ *
+ * The window geometry is double buffered, and will be applied at
+ * the time wl_surface.commit of the corresponding wl_surface is
+ * called.
+ *
+ * Once the window geometry of the surface is set, it is not
+ * possible to unset it, and it will remain the same until
+ * set_window_geometry is called again, even if a new subsurface or
+ * buffer is attached.
+ *
+ * If never set, the value is the full bounds of the surface,
+ * including any subsurfaces. This updates dynamically on every
+ * commit. This unset is meant for extremely simple clients.
+ *
+ * The arguments are given in the surface-local coordinate space of
+ * the wl_surface associated with this xdg_surface.
+ *
+ * The width and height must be greater than zero. Setting an
+ * invalid size will raise an error. When applied, the effective
+ * window geometry will be the set window geometry clamped to the
+ * bounding rectangle of the combined geometry of the surface of
+ * the xdg_surface and the associated subsurfaces.
+ */
+ void (*set_window_geometry)(struct wl_client *client,
+ struct wl_resource *resource,
+ int32_t x,
+ int32_t y,
+ int32_t width,
+ int32_t height);
+ /**
+ * ack a configure event
+ *
+ * When a configure event is received, if a client commits the
+ * surface in response to the configure event, then the client must
+ * make an ack_configure request sometime before the commit
+ * request, passing along the serial of the configure event.
+ *
+ * For instance, for toplevel surfaces the compositor might use
+ * this information to move a surface to the top left only when the
+ * client has drawn itself for the maximized or fullscreen state.
+ *
+ * If the client receives multiple configure events before it can
+ * respond to one, it only has to ack the last configure event.
+ *
+ * A client is not required to commit immediately after sending an
+ * ack_configure request - it may even ack_configure several times
+ * before its next surface commit.
+ *
+ * A client may send multiple ack_configure requests before
+ * committing, but only the last request sent before a commit
+ * indicates which configure event the client really is responding
+ * to.
+ * @param serial the serial from the configure event
+ */
+ void (*ack_configure)(struct wl_client *client,
+ struct wl_resource *resource,
+ uint32_t serial);
+};
+
+#define ZXDG_SURFACE_V6_CONFIGURE 0
+
+/**
+ * @ingroup iface_zxdg_surface_v6
+ */
+#define ZXDG_SURFACE_V6_CONFIGURE_SINCE_VERSION 1
+
+/**
+ * @ingroup iface_zxdg_surface_v6
+ */
+#define ZXDG_SURFACE_V6_DESTROY_SINCE_VERSION 1
+/**
+ * @ingroup iface_zxdg_surface_v6
+ */
+#define ZXDG_SURFACE_V6_GET_TOPLEVEL_SINCE_VERSION 1
+/**
+ * @ingroup iface_zxdg_surface_v6
+ */
+#define ZXDG_SURFACE_V6_GET_POPUP_SINCE_VERSION 1
+/**
+ * @ingroup iface_zxdg_surface_v6
+ */
+#define ZXDG_SURFACE_V6_SET_WINDOW_GEOMETRY_SINCE_VERSION 1
+/**
+ * @ingroup iface_zxdg_surface_v6
+ */
+#define ZXDG_SURFACE_V6_ACK_CONFIGURE_SINCE_VERSION 1
+
+/**
+ * @ingroup iface_zxdg_surface_v6
+ * Sends an configure event to the client owning the resource.
+ * @param resource_ The client's resource
+ * @param serial serial of the configure event
+ */
+static inline void
+zxdg_surface_v6_send_configure(struct wl_resource *resource_, uint32_t serial)
+{
+ wl_resource_post_event(resource_, ZXDG_SURFACE_V6_CONFIGURE, serial);
+}
+
+#ifndef ZXDG_TOPLEVEL_V6_RESIZE_EDGE_ENUM
+#define ZXDG_TOPLEVEL_V6_RESIZE_EDGE_ENUM
+/**
+ * @ingroup iface_zxdg_toplevel_v6
+ * edge values for resizing
+ *
+ * These values are used to indicate which edge of a surface
+ * is being dragged in a resize operation.
+ */
+enum zxdg_toplevel_v6_resize_edge {
+ ZXDG_TOPLEVEL_V6_RESIZE_EDGE_NONE = 0,
+ ZXDG_TOPLEVEL_V6_RESIZE_EDGE_TOP = 1,
+ ZXDG_TOPLEVEL_V6_RESIZE_EDGE_BOTTOM = 2,
+ ZXDG_TOPLEVEL_V6_RESIZE_EDGE_LEFT = 4,
+ ZXDG_TOPLEVEL_V6_RESIZE_EDGE_TOP_LEFT = 5,
+ ZXDG_TOPLEVEL_V6_RESIZE_EDGE_BOTTOM_LEFT = 6,
+ ZXDG_TOPLEVEL_V6_RESIZE_EDGE_RIGHT = 8,
+ ZXDG_TOPLEVEL_V6_RESIZE_EDGE_TOP_RIGHT = 9,
+ ZXDG_TOPLEVEL_V6_RESIZE_EDGE_BOTTOM_RIGHT = 10,
+};
+#endif /* ZXDG_TOPLEVEL_V6_RESIZE_EDGE_ENUM */
+
+#ifndef ZXDG_TOPLEVEL_V6_STATE_ENUM
+#define ZXDG_TOPLEVEL_V6_STATE_ENUM
+/**
+ * @ingroup iface_zxdg_toplevel_v6
+ * the surface is now activated
+ *
+ * Client window decorations should be painted as if the window is
+ * active. Do not assume this means that the window actually has
+ * keyboard or pointer focus.
+ */
+enum zxdg_toplevel_v6_state {
+ /**
+ * the surface is maximized
+ */
+ ZXDG_TOPLEVEL_V6_STATE_MAXIMIZED = 1,
+ /**
+ * the surface is fullscreen
+ */
+ ZXDG_TOPLEVEL_V6_STATE_FULLSCREEN = 2,
+ /**
+ * the surface is being resized
+ */
+ ZXDG_TOPLEVEL_V6_STATE_RESIZING = 3,
+ /**
+ * the surface is now activated
+ */
+ ZXDG_TOPLEVEL_V6_STATE_ACTIVATED = 4,
+};
+#endif /* ZXDG_TOPLEVEL_V6_STATE_ENUM */
+
+/**
+ * @ingroup iface_zxdg_toplevel_v6
+ * @struct zxdg_toplevel_v6_interface
+ */
+struct zxdg_toplevel_v6_interface {
+ /**
+ * destroy the xdg_toplevel
+ *
+ * Unmap and destroy the window. The window will be effectively
+ * hidden from the user's point of view, and all state like
+ * maximization, fullscreen, and so on, will be lost.
+ */
+ void (*destroy)(struct wl_client *client,
+ struct wl_resource *resource);
+ /**
+ * set the parent of this surface
+ *
+ * Set the "parent" of this surface. This window should be
+ * stacked above a parent. The parent surface must be mapped as
+ * long as this surface is mapped.
+ *
+ * Parent windows should be set on dialogs, toolboxes, or other
+ * "auxiliary" surfaces, so that the parent is raised when the
+ * dialog is raised.
+ */
+ void (*set_parent)(struct wl_client *client,
+ struct wl_resource *resource,
+ struct wl_resource *parent);
+ /**
+ * set surface title
+ *
+ * Set a short title for the surface.
+ *
+ * This string may be used to identify the surface in a task bar,
+ * window list, or other user interface elements provided by the
+ * compositor.
+ *
+ * The string must be encoded in UTF-8.
+ */
+ void (*set_title)(struct wl_client *client,
+ struct wl_resource *resource,
+ const char *title);
+ /**
+ * set application ID
+ *
+ * Set an application identifier for the surface.
+ *
+ * The app ID identifies the general class of applications to which
+ * the surface belongs. The compositor can use this to group
+ * multiple surfaces together, or to determine how to launch a new
+ * application.
+ *
+ * For D-Bus activatable applications, the app ID is used as the
+ * D-Bus service name.
+ *
+ * The compositor shell will try to group application surfaces
+ * together by their app ID. As a best practice, it is suggested to
+ * select app ID's that match the basename of the application's
+ * .desktop file. For example, "org.freedesktop.FooViewer" where
+ * the .desktop file is "org.freedesktop.FooViewer.desktop".
+ *
+ * See the desktop-entry specification [0] for more details on
+ * application identifiers and how they relate to well-known D-Bus
+ * names and .desktop files.
+ *
+ * [0] http://standards.freedesktop.org/desktop-entry-spec/
+ */
+ void (*set_app_id)(struct wl_client *client,
+ struct wl_resource *resource,
+ const char *app_id);
+ /**
+ * show the window menu
+ *
+ * Clients implementing client-side decorations might want to
+ * show a context menu when right-clicking on the decorations,
+ * giving the user a menu that they can use to maximize or minimize
+ * the window.
+ *
+ * This request asks the compositor to pop up such a window menu at
+ * the given position, relative to the local surface coordinates of
+ * the parent surface. There are no guarantees as to what menu
+ * items the window menu contains.
+ *
+ * This request must be used in response to some sort of user
+ * action like a button press, key press, or touch down event.
+ * @param seat the wl_seat of the user event
+ * @param serial the serial of the user event
+ * @param x the x position to pop up the window menu at
+ * @param y the y position to pop up the window menu at
+ */
+ void (*show_window_menu)(struct wl_client *client,
+ struct wl_resource *resource,
+ struct wl_resource *seat,
+ uint32_t serial,
+ int32_t x,
+ int32_t y);
+ /**
+ * start an interactive move
+ *
+ * Start an interactive, user-driven move of the surface.
+ *
+ * This request must be used in response to some sort of user
+ * action like a button press, key press, or touch down event. The
+ * passed serial is used to determine the type of interactive move
+ * (touch, pointer, etc).
+ *
+ * The server may ignore move requests depending on the state of
+ * the surface (e.g. fullscreen or maximized), or if the passed
+ * serial is no longer valid.
+ *
+ * If triggered, the surface will lose the focus of the device
+ * (wl_pointer, wl_touch, etc) used for the move. It is up to the
+ * compositor to visually indicate that the move is taking place,
+ * such as updating a pointer cursor, during the move. There is no
+ * guarantee that the device focus will return when the move is
+ * completed.
+ * @param seat the wl_seat of the user event
+ * @param serial the serial of the user event
+ */
+ void (*move)(struct wl_client *client,
+ struct wl_resource *resource,
+ struct wl_resource *seat,
+ uint32_t serial);
+ /**
+ * start an interactive resize
+ *
+ * Start a user-driven, interactive resize of the surface.
+ *
+ * This request must be used in response to some sort of user
+ * action like a button press, key press, or touch down event. The
+ * passed serial is used to determine the type of interactive
+ * resize (touch, pointer, etc).
+ *
+ * The server may ignore resize requests depending on the state of
+ * the surface (e.g. fullscreen or maximized).
+ *
+ * If triggered, the client will receive configure events with the
+ * "resize" state enum value and the expected sizes. See the
+ * "resize" enum value for more details about what is required. The
+ * client must also acknowledge configure events using
+ * "ack_configure". After the resize is completed, the client will
+ * receive another "configure" event without the resize state.
+ *
+ * If triggered, the surface also will lose the focus of the device
+ * (wl_pointer, wl_touch, etc) used for the resize. It is up to the
+ * compositor to visually indicate that the resize is taking place,
+ * such as updating a pointer cursor, during the resize. There is
+ * no guarantee that the device focus will return when the resize
+ * is completed.
+ *
+ * The edges parameter specifies how the surface should be resized,
+ * and is one of the values of the resize_edge enum. The compositor
+ * may use this information to update the surface position for
+ * example when dragging the top left corner. The compositor may
+ * also use this information to adapt its behavior, e.g. choose an
+ * appropriate cursor image.
+ * @param seat the wl_seat of the user event
+ * @param serial the serial of the user event
+ * @param edges which edge or corner is being dragged
+ */
+ void (*resize)(struct wl_client *client,
+ struct wl_resource *resource,
+ struct wl_resource *seat,
+ uint32_t serial,
+ uint32_t edges);
+ /**
+ * set the maximum size
+ *
+ * Set a maximum size for the window.
+ *
+ * The client can specify a maximum size so that the compositor
+ * does not try to configure the window beyond this size.
+ *
+ * The width and height arguments are in window geometry
+ * coordinates. See xdg_surface.set_window_geometry.
+ *
+ * Values set in this way are double-buffered. They will get
+ * applied on the next commit.
+ *
+ * The compositor can use this information to allow or disallow
+ * different states like maximize or fullscreen and draw accurate
+ * animations.
+ *
+ * Similarly, a tiling window manager may use this information to
+ * place and resize client windows in a more effective way.
+ *
+ * The client should not rely on the compositor to obey the maximum
+ * size. The compositor may decide to ignore the values set by the
+ * client and request a larger size.
+ *
+ * If never set, or a value of zero in the request, means that the
+ * client has no expected maximum size in the given dimension. As a
+ * result, a client wishing to reset the maximum size to an
+ * unspecified state can use zero for width and height in the
+ * request.
+ *
+ * Requesting a maximum size to be smaller than the minimum size of
+ * a surface is illegal and will result in a protocol error.
+ *
+ * The width and height must be greater than or equal to zero.
+ * Using strictly negative values for width and height will result
+ * in a protocol error.
+ */
+ void (*set_max_size)(struct wl_client *client,
+ struct wl_resource *resource,
+ int32_t width,
+ int32_t height);
+ /**
+ * set the minimum size
+ *
+ * Set a minimum size for the window.
+ *
+ * The client can specify a minimum size so that the compositor
+ * does not try to configure the window below this size.
+ *
+ * The width and height arguments are in window geometry
+ * coordinates. See xdg_surface.set_window_geometry.
+ *
+ * Values set in this way are double-buffered. They will get
+ * applied on the next commit.
+ *
+ * The compositor can use this information to allow or disallow
+ * different states like maximize or fullscreen and draw accurate
+ * animations.
+ *
+ * Similarly, a tiling window manager may use this information to
+ * place and resize client windows in a more effective way.
+ *
+ * The client should not rely on the compositor to obey the minimum
+ * size. The compositor may decide to ignore the values set by the
+ * client and request a smaller size.
+ *
+ * If never set, or a value of zero in the request, means that the
+ * client has no expected minimum size in the given dimension. As a
+ * result, a client wishing to reset the minimum size to an
+ * unspecified state can use zero for width and height in the
+ * request.
+ *
+ * Requesting a minimum size to be larger than the maximum size of
+ * a surface is illegal and will result in a protocol error.
+ *
+ * The width and height must be greater than or equal to zero.
+ * Using strictly negative values for width and height will result
+ * in a protocol error.
+ */
+ void (*set_min_size)(struct wl_client *client,
+ struct wl_resource *resource,
+ int32_t width,
+ int32_t height);
+ /**
+ * maximize the window
+ *
+ * Maximize the surface.
+ *
+ * After requesting that the surface should be maximized, the
+ * compositor will respond by emitting a configure event with the
+ * "maximized" state and the required window geometry. The client
+ * should then update its content, drawing it in a maximized state,
+ * i.e. without shadow or other decoration outside of the window
+ * geometry. The client must also acknowledge the configure when
+ * committing the new content (see ack_configure).
+ *
+ * It is up to the compositor to decide how and where to maximize
+ * the surface, for example which output and what region of the
+ * screen should be used.
+ *
+ * If the surface was already maximized, the compositor will still
+ * emit a configure event with the "maximized" state.
+ */
+ void (*set_maximized)(struct wl_client *client,
+ struct wl_resource *resource);
+ /**
+ * unmaximize the window
+ *
+ * Unmaximize the surface.
+ *
+ * After requesting that the surface should be unmaximized, the
+ * compositor will respond by emitting a configure event without
+ * the "maximized" state. If available, the compositor will include
+ * the window geometry dimensions the window had prior to being
+ * maximized in the configure request. The client must then update
+ * its content, drawing it in a regular state, i.e. potentially
+ * with shadow, etc. The client must also acknowledge the configure
+ * when committing the new content (see ack_configure).
+ *
+ * It is up to the compositor to position the surface after it was
+ * unmaximized; usually the position the surface had before
+ * maximizing, if applicable.
+ *
+ * If the surface was already not maximized, the compositor will
+ * still emit a configure event without the "maximized" state.
+ */
+ void (*unset_maximized)(struct wl_client *client,
+ struct wl_resource *resource);
+ /**
+ * set the window as fullscreen on a monitor
+ *
+ * Make the surface fullscreen.
+ *
+ * You can specify an output that you would prefer to be
+ * fullscreen. If this value is NULL, it's up to the compositor to
+ * choose which display will be used to map this surface.
+ *
+ * If the surface doesn't cover the whole output, the compositor
+ * will position the surface in the center of the output and
+ * compensate with black borders filling the rest of the output.
+ */
+ void (*set_fullscreen)(struct wl_client *client,
+ struct wl_resource *resource,
+ struct wl_resource *output);
+ /**
+ */
+ void (*unset_fullscreen)(struct wl_client *client,
+ struct wl_resource *resource);
+ /**
+ * set the window as minimized
+ *
+ * Request that the compositor minimize your surface. There is no
+ * way to know if the surface is currently minimized, nor is there
+ * any way to unset minimization on this surface.
+ *
+ * If you are looking to throttle redrawing when minimized, please
+ * instead use the wl_surface.frame event for this, as this will
+ * also work with live previews on windows in Alt-Tab, Expose or
+ * similar compositor features.
+ */
+ void (*set_minimized)(struct wl_client *client,
+ struct wl_resource *resource);
+};
+
+#define ZXDG_TOPLEVEL_V6_CONFIGURE 0
+#define ZXDG_TOPLEVEL_V6_CLOSE 1
+
+/**
+ * @ingroup iface_zxdg_toplevel_v6
+ */
+#define ZXDG_TOPLEVEL_V6_CONFIGURE_SINCE_VERSION 1
+/**
+ * @ingroup iface_zxdg_toplevel_v6
+ */
+#define ZXDG_TOPLEVEL_V6_CLOSE_SINCE_VERSION 1
+
+/**
+ * @ingroup iface_zxdg_toplevel_v6
+ */
+#define ZXDG_TOPLEVEL_V6_DESTROY_SINCE_VERSION 1
+/**
+ * @ingroup iface_zxdg_toplevel_v6
+ */
+#define ZXDG_TOPLEVEL_V6_SET_PARENT_SINCE_VERSION 1
+/**
+ * @ingroup iface_zxdg_toplevel_v6
+ */
+#define ZXDG_TOPLEVEL_V6_SET_TITLE_SINCE_VERSION 1
+/**
+ * @ingroup iface_zxdg_toplevel_v6
+ */
+#define ZXDG_TOPLEVEL_V6_SET_APP_ID_SINCE_VERSION 1
+/**
+ * @ingroup iface_zxdg_toplevel_v6
+ */
+#define ZXDG_TOPLEVEL_V6_SHOW_WINDOW_MENU_SINCE_VERSION 1
+/**
+ * @ingroup iface_zxdg_toplevel_v6
+ */
+#define ZXDG_TOPLEVEL_V6_MOVE_SINCE_VERSION 1
+/**
+ * @ingroup iface_zxdg_toplevel_v6
+ */
+#define ZXDG_TOPLEVEL_V6_RESIZE_SINCE_VERSION 1
+/**
+ * @ingroup iface_zxdg_toplevel_v6
+ */
+#define ZXDG_TOPLEVEL_V6_SET_MAX_SIZE_SINCE_VERSION 1
+/**
+ * @ingroup iface_zxdg_toplevel_v6
+ */
+#define ZXDG_TOPLEVEL_V6_SET_MIN_SIZE_SINCE_VERSION 1
+/**
+ * @ingroup iface_zxdg_toplevel_v6
+ */
+#define ZXDG_TOPLEVEL_V6_SET_MAXIMIZED_SINCE_VERSION 1
+/**
+ * @ingroup iface_zxdg_toplevel_v6
+ */
+#define ZXDG_TOPLEVEL_V6_UNSET_MAXIMIZED_SINCE_VERSION 1
+/**
+ * @ingroup iface_zxdg_toplevel_v6
+ */
+#define ZXDG_TOPLEVEL_V6_SET_FULLSCREEN_SINCE_VERSION 1
+/**
+ * @ingroup iface_zxdg_toplevel_v6
+ */
+#define ZXDG_TOPLEVEL_V6_UNSET_FULLSCREEN_SINCE_VERSION 1
+/**
+ * @ingroup iface_zxdg_toplevel_v6
+ */
+#define ZXDG_TOPLEVEL_V6_SET_MINIMIZED_SINCE_VERSION 1
+
+/**
+ * @ingroup iface_zxdg_toplevel_v6
+ * Sends an configure event to the client owning the resource.
+ * @param resource_ The client's resource
+ */
+static inline void
+zxdg_toplevel_v6_send_configure(struct wl_resource *resource_, int32_t width, int32_t height, struct wl_array *states)
+{
+ wl_resource_post_event(resource_, ZXDG_TOPLEVEL_V6_CONFIGURE, width, height, states);
+}
+
+/**
+ * @ingroup iface_zxdg_toplevel_v6
+ * Sends an close event to the client owning the resource.
+ * @param resource_ The client's resource
+ */
+static inline void
+zxdg_toplevel_v6_send_close(struct wl_resource *resource_)
+{
+ wl_resource_post_event(resource_, ZXDG_TOPLEVEL_V6_CLOSE);
+}
+
+#ifndef ZXDG_POPUP_V6_ERROR_ENUM
+#define ZXDG_POPUP_V6_ERROR_ENUM
+enum zxdg_popup_v6_error {
+ /**
+ * tried to grab after being mapped
+ */
+ ZXDG_POPUP_V6_ERROR_INVALID_GRAB = 0,
+};
+#endif /* ZXDG_POPUP_V6_ERROR_ENUM */
+
+/**
+ * @ingroup iface_zxdg_popup_v6
+ * @struct zxdg_popup_v6_interface
+ */
+struct zxdg_popup_v6_interface {
+ /**
+ * remove xdg_popup interface
+ *
+ * This destroys the popup. Explicitly destroying the xdg_popup
+ * object will also dismiss the popup, and unmap the surface.
+ *
+ * If this xdg_popup is not the "topmost" popup, a protocol error
+ * will be sent.
+ */
+ void (*destroy)(struct wl_client *client,
+ struct wl_resource *resource);
+ /**
+ * make the popup take an explicit grab
+ *
+ * This request makes the created popup take an explicit grab. An
+ * explicit grab will be dismissed when the user dismisses the
+ * popup, or when the client destroys the xdg_popup. This can be
+ * done by the user clicking outside the surface, using the
+ * keyboard, or even locking the screen through closing the lid or
+ * a timeout.
+ *
+ * If the compositor denies the grab, the popup will be immediately
+ * dismissed.
+ *
+ * This request must be used in response to some sort of user
+ * action like a button press, key press, or touch down event. The
+ * serial number of the event should be passed as 'serial'.
+ *
+ * The parent of a grabbing popup must either be an xdg_toplevel
+ * surface or another xdg_popup with an explicit grab. If the
+ * parent is another xdg_popup it means that the popups are nested,
+ * with this popup now being the topmost popup.
+ *
+ * Nested popups must be destroyed in the reverse order they were
+ * created in, e.g. the only popup you are allowed to destroy at
+ * all times is the topmost one.
+ *
+ * When compositors choose to dismiss a popup, they may dismiss
+ * every nested grabbing popup as well. When a compositor dismisses
+ * popups, it will follow the same dismissing order as required
+ * from the client.
+ *
+ * The parent of a grabbing popup must either be another xdg_popup
+ * with an active explicit grab, or an xdg_popup or xdg_toplevel,
+ * if there are no explicit grabs already taken.
+ *
+ * If the topmost grabbing popup is destroyed, the grab will be
+ * returned to the parent of the popup, if that parent previously
+ * had an explicit grab.
+ *
+ * If the parent is a grabbing popup which has already been
+ * dismissed, this popup will be immediately dismissed. If the
+ * parent is a popup that did not take an explicit grab, an error
+ * will be raised.
+ *
+ * During a popup grab, the client owning the grab will receive
+ * pointer and touch events for all their surfaces as normal
+ * (similar to an "owner-events" grab in X11 parlance), while the
+ * top most grabbing popup will always have keyboard focus.
+ * @param seat the wl_seat of the user event
+ * @param serial the serial of the user event
+ */
+ void (*grab)(struct wl_client *client,
+ struct wl_resource *resource,
+ struct wl_resource *seat,
+ uint32_t serial);
+};
+
+#define ZXDG_POPUP_V6_CONFIGURE 0
+#define ZXDG_POPUP_V6_POPUP_DONE 1
+
+/**
+ * @ingroup iface_zxdg_popup_v6
+ */
+#define ZXDG_POPUP_V6_CONFIGURE_SINCE_VERSION 1
+/**
+ * @ingroup iface_zxdg_popup_v6
+ */
+#define ZXDG_POPUP_V6_POPUP_DONE_SINCE_VERSION 1
+
+/**
+ * @ingroup iface_zxdg_popup_v6
+ */
+#define ZXDG_POPUP_V6_DESTROY_SINCE_VERSION 1
+/**
+ * @ingroup iface_zxdg_popup_v6
+ */
+#define ZXDG_POPUP_V6_GRAB_SINCE_VERSION 1
+
+/**
+ * @ingroup iface_zxdg_popup_v6
+ * Sends an configure event to the client owning the resource.
+ * @param resource_ The client's resource
+ * @param x x position relative to parent surface window geometry
+ * @param y y position relative to parent surface window geometry
+ * @param width window geometry width
+ * @param height window geometry height
+ */
+static inline void
+zxdg_popup_v6_send_configure(struct wl_resource *resource_, int32_t x, int32_t y, int32_t width, int32_t height)
+{
+ wl_resource_post_event(resource_, ZXDG_POPUP_V6_CONFIGURE, x, y, width, height);
+}
+
+/**
+ * @ingroup iface_zxdg_popup_v6
+ * Sends an popup_done event to the client owning the resource.
+ * @param resource_ The client's resource
+ */
+static inline void
+zxdg_popup_v6_send_popup_done(struct wl_resource *resource_)
+{
+ wl_resource_post_event(resource_, ZXDG_POPUP_V6_POPUP_DONE);
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/chromium/third_party/wayland-protocols/protocol/alpha-compositing-protocol.c b/chromium/third_party/wayland-protocols/protocol/alpha-compositing-protocol.c
new file mode 100644
index 00000000000..271b2c72add
--- /dev/null
+++ b/chromium/third_party/wayland-protocols/protocol/alpha-compositing-protocol.c
@@ -0,0 +1,61 @@
+/* Generated by wayland-scanner 1.13.0 */
+
+/*
+ * Copyright 2016 The Chromium Authors.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+#include <stdlib.h>
+#include <stdint.h>
+#include "wayland-util.h"
+
+extern const struct wl_interface wl_surface_interface;
+extern const struct wl_interface zcr_blending_v1_interface;
+
+static const struct wl_interface *types[] = {
+ NULL,
+ &zcr_blending_v1_interface,
+ &wl_surface_interface,
+};
+
+static const struct wl_message zcr_alpha_compositing_v1_requests[] = {
+ { "destroy", "", types + 0 },
+ { "get_blending", "no", types + 1 },
+};
+
+WL_EXPORT const struct wl_interface zcr_alpha_compositing_v1_interface = {
+ "zcr_alpha_compositing_v1", 1,
+ 2, zcr_alpha_compositing_v1_requests,
+ 0, NULL,
+};
+
+static const struct wl_message zcr_blending_v1_requests[] = {
+ { "destroy", "", types + 0 },
+ { "set_blending", "u", types + 0 },
+ { "set_alpha", "f", types + 0 },
+};
+
+WL_EXPORT const struct wl_interface zcr_blending_v1_interface = {
+ "zcr_blending_v1", 1,
+ 3, zcr_blending_v1_requests,
+ 0, NULL,
+};
+
diff --git a/chromium/third_party/wayland-protocols/protocol/gaming-input-protocol-v1.c b/chromium/third_party/wayland-protocols/protocol/gaming-input-protocol-v1.c
new file mode 100644
index 00000000000..27e1294f0af
--- /dev/null
+++ b/chromium/third_party/wayland-protocols/protocol/gaming-input-protocol-v1.c
@@ -0,0 +1,68 @@
+/* Generated by wayland-scanner 1.13.0 */
+
+/*
+ * Copyright 2016 The Chromium Authors.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+#include <stdlib.h>
+#include <stdint.h>
+#include "wayland-util.h"
+
+extern const struct wl_interface wl_seat_interface;
+extern const struct wl_interface zcr_gamepad_v1_interface;
+
+static const struct wl_interface *types[] = {
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ &zcr_gamepad_v1_interface,
+ &wl_seat_interface,
+};
+
+static const struct wl_message zcr_gaming_input_v1_requests[] = {
+ { "get_gamepad", "no", types + 4 },
+};
+
+WL_EXPORT const struct wl_interface zcr_gaming_input_v1_interface = {
+ "zcr_gaming_input_v1", 1,
+ 1, zcr_gaming_input_v1_requests,
+ 0, NULL,
+};
+
+static const struct wl_message zcr_gamepad_v1_requests[] = {
+ { "destroy", "", types + 0 },
+};
+
+static const struct wl_message zcr_gamepad_v1_events[] = {
+ { "state_change", "u", types + 0 },
+ { "axis", "uuf", types + 0 },
+ { "button", "uuuf", types + 0 },
+ { "frame", "u", types + 0 },
+};
+
+WL_EXPORT const struct wl_interface zcr_gamepad_v1_interface = {
+ "zcr_gamepad_v1", 1,
+ 1, zcr_gamepad_v1_requests,
+ 4, zcr_gamepad_v1_events,
+};
+
diff --git a/chromium/third_party/wayland-protocols/protocol/gaming-input-protocol-v2.c b/chromium/third_party/wayland-protocols/protocol/gaming-input-protocol-v2.c
new file mode 100644
index 00000000000..6ddcf3f9dd9
--- /dev/null
+++ b/chromium/third_party/wayland-protocols/protocol/gaming-input-protocol-v2.c
@@ -0,0 +1,85 @@
+/* Generated by wayland-scanner 1.13.0 */
+
+/*
+ * Copyright 2016 The Chromium Authors.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+#include <stdlib.h>
+#include <stdint.h>
+#include "wayland-util.h"
+
+extern const struct wl_interface wl_seat_interface;
+extern const struct wl_interface zcr_gamepad_v2_interface;
+extern const struct wl_interface zcr_gaming_seat_v2_interface;
+
+static const struct wl_interface *types[] = {
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ &zcr_gaming_seat_v2_interface,
+ &wl_seat_interface,
+ &zcr_gamepad_v2_interface,
+};
+
+static const struct wl_message zcr_gaming_input_v2_requests[] = {
+ { "get_gaming_seat", "no", types + 4 },
+ { "destroy", "", types + 0 },
+};
+
+WL_EXPORT const struct wl_interface zcr_gaming_input_v2_interface = {
+ "zcr_gaming_input_v2", 1,
+ 2, zcr_gaming_input_v2_requests,
+ 0, NULL,
+};
+
+static const struct wl_message zcr_gaming_seat_v2_requests[] = {
+ { "destroy", "", types + 0 },
+};
+
+static const struct wl_message zcr_gaming_seat_v2_events[] = {
+ { "gamepad_added", "n", types + 6 },
+};
+
+WL_EXPORT const struct wl_interface zcr_gaming_seat_v2_interface = {
+ "zcr_gaming_seat_v2", 1,
+ 1, zcr_gaming_seat_v2_requests,
+ 1, zcr_gaming_seat_v2_events,
+};
+
+static const struct wl_message zcr_gamepad_v2_requests[] = {
+ { "destroy", "", types + 0 },
+};
+
+static const struct wl_message zcr_gamepad_v2_events[] = {
+ { "removed", "", types + 0 },
+ { "axis", "uuf", types + 0 },
+ { "button", "uuuf", types + 0 },
+ { "frame", "u", types + 0 },
+};
+
+WL_EXPORT const struct wl_interface zcr_gamepad_v2_interface = {
+ "zcr_gamepad_v2", 1,
+ 1, zcr_gamepad_v2_requests,
+ 4, zcr_gamepad_v2_events,
+};
+
diff --git a/chromium/third_party/wayland-protocols/protocol/keyboard-configuration-protocol.c b/chromium/third_party/wayland-protocols/protocol/keyboard-configuration-protocol.c
new file mode 100644
index 00000000000..0a8abf7b65b
--- /dev/null
+++ b/chromium/third_party/wayland-protocols/protocol/keyboard-configuration-protocol.c
@@ -0,0 +1,62 @@
+/* Generated by wayland-scanner 1.13.0 */
+
+/*
+ * Copyright 2016 The Chromium Authors.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+#include <stdlib.h>
+#include <stdint.h>
+#include "wayland-util.h"
+
+extern const struct wl_interface wl_keyboard_interface;
+extern const struct wl_interface zcr_keyboard_device_configuration_v1_interface;
+
+static const struct wl_interface *types[] = {
+ NULL,
+ &zcr_keyboard_device_configuration_v1_interface,
+ &wl_keyboard_interface,
+};
+
+static const struct wl_message zcr_keyboard_configuration_v1_requests[] = {
+ { "get_keyboard_device_configuration", "no", types + 1 },
+};
+
+WL_EXPORT const struct wl_interface zcr_keyboard_configuration_v1_interface = {
+ "zcr_keyboard_configuration_v1", 2,
+ 1, zcr_keyboard_configuration_v1_requests,
+ 0, NULL,
+};
+
+static const struct wl_message zcr_keyboard_device_configuration_v1_requests[] = {
+ { "destroy", "", types + 0 },
+};
+
+static const struct wl_message zcr_keyboard_device_configuration_v1_events[] = {
+ { "type_change", "u", types + 0 },
+};
+
+WL_EXPORT const struct wl_interface zcr_keyboard_device_configuration_v1_interface = {
+ "zcr_keyboard_device_configuration_v1", 1,
+ 1, zcr_keyboard_device_configuration_v1_requests,
+ 1, zcr_keyboard_device_configuration_v1_events,
+};
+
diff --git a/chromium/third_party/wayland-protocols/protocol/keyboard-extension-protocol.c b/chromium/third_party/wayland-protocols/protocol/keyboard-extension-protocol.c
new file mode 100644
index 00000000000..fb2ea2ba520
--- /dev/null
+++ b/chromium/third_party/wayland-protocols/protocol/keyboard-extension-protocol.c
@@ -0,0 +1,60 @@
+/* Generated by wayland-scanner 1.13.0 */
+
+/*
+ * Copyright 2017 The Chromium Authors.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+#include <stdlib.h>
+#include <stdint.h>
+#include "wayland-util.h"
+
+extern const struct wl_interface wl_keyboard_interface;
+extern const struct wl_interface zcr_extended_keyboard_v1_interface;
+
+static const struct wl_interface *types[] = {
+ NULL,
+ NULL,
+ &zcr_extended_keyboard_v1_interface,
+ &wl_keyboard_interface,
+};
+
+static const struct wl_message zcr_keyboard_extension_v1_requests[] = {
+ { "get_extended_keyboard", "no", types + 2 },
+};
+
+WL_EXPORT const struct wl_interface zcr_keyboard_extension_v1_interface = {
+ "zcr_keyboard_extension_v1", 1,
+ 1, zcr_keyboard_extension_v1_requests,
+ 0, NULL,
+};
+
+static const struct wl_message zcr_extended_keyboard_v1_requests[] = {
+ { "destroy", "", types + 0 },
+ { "ack_key", "uu", types + 0 },
+};
+
+WL_EXPORT const struct wl_interface zcr_extended_keyboard_v1_interface = {
+ "zcr_extended_keyboard_v1", 1,
+ 2, zcr_extended_keyboard_v1_requests,
+ 0, NULL,
+};
+
diff --git a/chromium/third_party/wayland-protocols/protocol/linux-dmabuf-protocol.c b/chromium/third_party/wayland-protocols/protocol/linux-dmabuf-protocol.c
new file mode 100644
index 00000000000..d27b9bee7fb
--- /dev/null
+++ b/chromium/third_party/wayland-protocols/protocol/linux-dmabuf-protocol.c
@@ -0,0 +1,82 @@
+/* Generated by wayland-scanner 1.13.0 */
+
+/*
+ * Copyright © 2014, 2015 Collabora, Ltd.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+#include <stdlib.h>
+#include <stdint.h>
+#include "wayland-util.h"
+
+extern const struct wl_interface wl_buffer_interface;
+extern const struct wl_interface zwp_linux_buffer_params_v1_interface;
+
+static const struct wl_interface *types[] = {
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ &zwp_linux_buffer_params_v1_interface,
+ &wl_buffer_interface,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ &wl_buffer_interface,
+};
+
+static const struct wl_message zwp_linux_dmabuf_v1_requests[] = {
+ { "destroy", "", types + 0 },
+ { "create_params", "n", types + 6 },
+};
+
+static const struct wl_message zwp_linux_dmabuf_v1_events[] = {
+ { "format", "u", types + 0 },
+ { "modifier", "3uuu", types + 0 },
+};
+
+WL_EXPORT const struct wl_interface zwp_linux_dmabuf_v1_interface = {
+ "zwp_linux_dmabuf_v1", 3,
+ 2, zwp_linux_dmabuf_v1_requests,
+ 2, zwp_linux_dmabuf_v1_events,
+};
+
+static const struct wl_message zwp_linux_buffer_params_v1_requests[] = {
+ { "destroy", "", types + 0 },
+ { "add", "huuuuu", types + 0 },
+ { "create", "iiuu", types + 0 },
+ { "create_immed", "2niiuu", types + 7 },
+};
+
+static const struct wl_message zwp_linux_buffer_params_v1_events[] = {
+ { "created", "n", types + 12 },
+ { "failed", "", types + 0 },
+};
+
+WL_EXPORT const struct wl_interface zwp_linux_buffer_params_v1_interface = {
+ "zwp_linux_buffer_params_v1", 3,
+ 4, zwp_linux_buffer_params_v1_requests,
+ 2, zwp_linux_buffer_params_v1_events,
+};
+
diff --git a/chromium/third_party/wayland-protocols/protocol/pointer-gestures-v1-protocol.c b/chromium/third_party/wayland-protocols/protocol/pointer-gestures-v1-protocol.c
new file mode 100644
index 00000000000..6e54eb9f184
--- /dev/null
+++ b/chromium/third_party/wayland-protocols/protocol/pointer-gestures-v1-protocol.c
@@ -0,0 +1,74 @@
+#include <stdlib.h>
+#include <stdint.h>
+#include "wayland-util.h"
+
+extern const struct wl_interface zwp_pointer_gesture_swipe_v1_interface;
+extern const struct wl_interface wl_pointer_interface;
+extern const struct wl_interface zwp_pointer_gesture_pinch_v1_interface;
+extern const struct wl_interface wl_pointer_interface;
+extern const struct wl_interface wl_surface_interface;
+extern const struct wl_interface wl_surface_interface;
+
+static const struct wl_interface *types[] = {
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ &zwp_pointer_gesture_swipe_v1_interface,
+ &wl_pointer_interface,
+ &zwp_pointer_gesture_pinch_v1_interface,
+ &wl_pointer_interface,
+ NULL,
+ NULL,
+ &wl_surface_interface,
+ NULL,
+ NULL,
+ NULL,
+ &wl_surface_interface,
+ NULL,
+};
+
+static const struct wl_message zwp_pointer_gestures_v1_requests[] = {
+ { "get_swipe_gesture", "no", types + 5 },
+ { "get_pinch_gesture", "no", types + 7 },
+};
+
+WL_EXPORT const struct wl_interface zwp_pointer_gestures_v1_interface = {
+ "zwp_pointer_gestures_v1", 1,
+ 2, zwp_pointer_gestures_v1_requests,
+ 0, NULL,
+};
+
+static const struct wl_message zwp_pointer_gesture_swipe_v1_requests[] = {
+ { "destroy", "", types + 0 },
+};
+
+static const struct wl_message zwp_pointer_gesture_swipe_v1_events[] = {
+ { "begin", "uuou", types + 9 },
+ { "update", "uff", types + 0 },
+ { "end", "uui", types + 0 },
+};
+
+WL_EXPORT const struct wl_interface zwp_pointer_gesture_swipe_v1_interface = {
+ "zwp_pointer_gesture_swipe_v1", 1,
+ 1, zwp_pointer_gesture_swipe_v1_requests,
+ 3, zwp_pointer_gesture_swipe_v1_events,
+};
+
+static const struct wl_message zwp_pointer_gesture_pinch_v1_requests[] = {
+ { "destroy", "", types + 0 },
+};
+
+static const struct wl_message zwp_pointer_gesture_pinch_v1_events[] = {
+ { "begin", "uuou", types + 13 },
+ { "update", "uffff", types + 0 },
+ { "end", "uui", types + 0 },
+};
+
+WL_EXPORT const struct wl_interface zwp_pointer_gesture_pinch_v1_interface = {
+ "zwp_pointer_gesture_pinch_v1", 1,
+ 1, zwp_pointer_gesture_pinch_v1_requests,
+ 3, zwp_pointer_gesture_pinch_v1_events,
+};
+
diff --git a/chromium/third_party/wayland-protocols/protocol/presentation-time-protocol.c b/chromium/third_party/wayland-protocols/protocol/presentation-time-protocol.c
new file mode 100644
index 00000000000..c3423f487e9
--- /dev/null
+++ b/chromium/third_party/wayland-protocols/protocol/presentation-time-protocol.c
@@ -0,0 +1,73 @@
+/* Generated by wayland-scanner 1.13.0 */
+
+/*
+ * Copyright © 2013-2014 Collabora, Ltd.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+#include <stdlib.h>
+#include <stdint.h>
+#include "wayland-util.h"
+
+extern const struct wl_interface wl_output_interface;
+extern const struct wl_interface wl_surface_interface;
+extern const struct wl_interface wp_presentation_feedback_interface;
+
+static const struct wl_interface *types[] = {
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ &wl_surface_interface,
+ &wp_presentation_feedback_interface,
+ &wl_output_interface,
+};
+
+static const struct wl_message wp_presentation_requests[] = {
+ { "destroy", "", types + 0 },
+ { "feedback", "on", types + 7 },
+};
+
+static const struct wl_message wp_presentation_events[] = {
+ { "clock_id", "u", types + 0 },
+};
+
+WL_EXPORT const struct wl_interface wp_presentation_interface = {
+ "wp_presentation", 1,
+ 2, wp_presentation_requests,
+ 1, wp_presentation_events,
+};
+
+static const struct wl_message wp_presentation_feedback_events[] = {
+ { "sync_output", "o", types + 9 },
+ { "presented", "uuuuuuu", types + 0 },
+ { "discarded", "", types + 0 },
+};
+
+WL_EXPORT const struct wl_interface wp_presentation_feedback_interface = {
+ "wp_presentation_feedback", 1,
+ 0, NULL,
+ 3, wp_presentation_feedback_events,
+};
+
diff --git a/chromium/third_party/wayland-protocols/protocol/remote-shell-protocol.c b/chromium/third_party/wayland-protocols/protocol/remote-shell-protocol.c
new file mode 100644
index 00000000000..99e967b4e62
--- /dev/null
+++ b/chromium/third_party/wayland-protocols/protocol/remote-shell-protocol.c
@@ -0,0 +1,139 @@
+/* Generated by wayland-scanner 1.14.0 */
+
+/*
+ * Copyright 2016 The Chromium Authors.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+#include <stdlib.h>
+#include <stdint.h>
+#include "wayland-util.h"
+
+extern const struct wl_interface wl_surface_interface;
+extern const struct wl_interface zcr_notification_surface_v1_interface;
+extern const struct wl_interface zcr_remote_surface_v1_interface;
+
+static const struct wl_interface *types[] = {
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ &zcr_remote_surface_v1_interface,
+ &wl_surface_interface,
+ NULL,
+ &zcr_notification_surface_v1_interface,
+ &wl_surface_interface,
+ NULL,
+ &wl_surface_interface,
+ &wl_surface_interface,
+};
+
+static const struct wl_message zcr_remote_shell_v1_requests[] = {
+ { "destroy", "", types + 0 },
+ { "get_remote_surface", "nou", types + 13 },
+ { "get_notification_surface", "nos", types + 16 },
+};
+
+static const struct wl_message zcr_remote_shell_v1_events[] = {
+ { "activated", "?o?o", types + 19 },
+ { "configuration_changed", "iiifiiiiu", types + 0 },
+ { "workspace", "5uuiiiiiiiiifu", types + 0 },
+ { "configure", "5u", types + 0 },
+ { "default_device_scale_factor", "8i", types + 0 },
+};
+
+WL_EXPORT const struct wl_interface zcr_remote_shell_v1_interface = {
+ "zcr_remote_shell_v1", 10,
+ 3, zcr_remote_shell_v1_requests,
+ 5, zcr_remote_shell_v1_events,
+};
+
+static const struct wl_message zcr_remote_surface_v1_requests[] = {
+ { "destroy", "", types + 0 },
+ { "set_app_id", "s", types + 0 },
+ { "set_window_geometry", "iiii", types + 0 },
+ { "set_scale", "f", types + 0 },
+ { "set_rectangular_shadow", "iiii", types + 0 },
+ { "set_rectangular_shadow_background_opacity", "f", types + 0 },
+ { "set_title", "s", types + 0 },
+ { "set_top_inset", "i", types + 0 },
+ { "activate", "u", types + 0 },
+ { "maximize", "", types + 0 },
+ { "minimize", "", types + 0 },
+ { "restore", "", types + 0 },
+ { "fullscreen", "", types + 0 },
+ { "unfullscreen", "", types + 0 },
+ { "pin", "i", types + 0 },
+ { "unpin", "", types + 0 },
+ { "set_system_modal", "", types + 0 },
+ { "unset_system_modal", "", types + 0 },
+ { "set_rectangular_surface_shadow", "2iiii", types + 0 },
+ { "set_systemui_visibility", "3u", types + 0 },
+ { "set_always_on_top", "4", types + 0 },
+ { "unset_always_on_top", "4", types + 0 },
+ { "ack_configure", "5u", types + 0 },
+ { "move", "5", types + 0 },
+ { "set_orientation", "6i", types + 0 },
+ { "set_window_type", "7u", types + 0 },
+ { "resize", "9", types + 0 },
+ { "set_resize_outset", "9i", types + 0 },
+ { "start_move", "10ii", types + 0 },
+ { "set_can_maximize", "10", types + 0 },
+ { "unset_can_maximize", "10", types + 0 },
+ { "set_min_size", "10ii", types + 0 },
+ { "set_max_size", "10ii", types + 0 },
+};
+
+static const struct wl_message zcr_remote_surface_v1_events[] = {
+ { "close", "", types + 0 },
+ { "state_type_changed", "u", types + 0 },
+ { "configure", "5iiau", types + 0 },
+ { "window_geometry_changed", "9iiii", types + 0 },
+ { "bounds_changed", "10uuiiiiu", types + 0 },
+ { "drag_started", "10u", types + 0 },
+ { "drag_finished", "10iii", types + 0 },
+};
+
+WL_EXPORT const struct wl_interface zcr_remote_surface_v1_interface = {
+ "zcr_remote_surface_v1", 10,
+ 33, zcr_remote_surface_v1_requests,
+ 7, zcr_remote_surface_v1_events,
+};
+
+static const struct wl_message zcr_notification_surface_v1_requests[] = {
+ { "destroy", "", types + 0 },
+};
+
+WL_EXPORT const struct wl_interface zcr_notification_surface_v1_interface = {
+ "zcr_notification_surface_v1", 1,
+ 1, zcr_notification_surface_v1_requests,
+ 0, NULL,
+};
+
diff --git a/chromium/third_party/wayland-protocols/protocol/secure-output-protocol.c b/chromium/third_party/wayland-protocols/protocol/secure-output-protocol.c
new file mode 100644
index 00000000000..1ecc6466fb7
--- /dev/null
+++ b/chromium/third_party/wayland-protocols/protocol/secure-output-protocol.c
@@ -0,0 +1,59 @@
+/* Generated by wayland-scanner 1.13.0 */
+
+/*
+ * Copyright 2016 The Chromium Authors.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+#include <stdlib.h>
+#include <stdint.h>
+#include "wayland-util.h"
+
+extern const struct wl_interface wl_surface_interface;
+extern const struct wl_interface zcr_security_v1_interface;
+
+static const struct wl_interface *types[] = {
+ &zcr_security_v1_interface,
+ &wl_surface_interface,
+};
+
+static const struct wl_message zcr_secure_output_v1_requests[] = {
+ { "destroy", "", types + 0 },
+ { "get_security", "no", types + 0 },
+};
+
+WL_EXPORT const struct wl_interface zcr_secure_output_v1_interface = {
+ "zcr_secure_output_v1", 1,
+ 2, zcr_secure_output_v1_requests,
+ 0, NULL,
+};
+
+static const struct wl_message zcr_security_v1_requests[] = {
+ { "destroy", "", types + 0 },
+ { "only_visible_on_secure_output", "", types + 0 },
+};
+
+WL_EXPORT const struct wl_interface zcr_security_v1_interface = {
+ "zcr_security_v1", 1,
+ 2, zcr_security_v1_requests,
+ 0, NULL,
+};
+
diff --git a/chromium/third_party/wayland-protocols/protocol/stylus-protocol-v2.c b/chromium/third_party/wayland-protocols/protocol/stylus-protocol-v2.c
new file mode 100644
index 00000000000..055a1e8a56c
--- /dev/null
+++ b/chromium/third_party/wayland-protocols/protocol/stylus-protocol-v2.c
@@ -0,0 +1,67 @@
+/* Generated by wayland-scanner 1.13.0 */
+
+/*
+ * Copyright 2016 The Chromium Authors.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+#include <stdlib.h>
+#include <stdint.h>
+#include "wayland-util.h"
+
+extern const struct wl_interface wl_touch_interface;
+extern const struct wl_interface zcr_touch_stylus_v2_interface;
+
+static const struct wl_interface *types[] = {
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ &zcr_touch_stylus_v2_interface,
+ &wl_touch_interface,
+};
+
+static const struct wl_message zcr_stylus_v2_requests[] = {
+ { "get_touch_stylus", "no", types + 4 },
+};
+
+WL_EXPORT const struct wl_interface zcr_stylus_v2_interface = {
+ "zcr_stylus_v2", 1,
+ 1, zcr_stylus_v2_requests,
+ 0, NULL,
+};
+
+static const struct wl_message zcr_touch_stylus_v2_requests[] = {
+ { "destroy", "", types + 0 },
+};
+
+static const struct wl_message zcr_touch_stylus_v2_events[] = {
+ { "tool", "uu", types + 0 },
+ { "force", "uuf", types + 0 },
+ { "tilt", "uuff", types + 0 },
+};
+
+WL_EXPORT const struct wl_interface zcr_touch_stylus_v2_interface = {
+ "zcr_touch_stylus_v2", 1,
+ 1, zcr_touch_stylus_v2_requests,
+ 3, zcr_touch_stylus_v2_events,
+};
+
diff --git a/chromium/third_party/wayland-protocols/protocol/stylus-tools-protocol.c b/chromium/third_party/wayland-protocols/protocol/stylus-tools-protocol.c
new file mode 100644
index 00000000000..3e7a04ed9b5
--- /dev/null
+++ b/chromium/third_party/wayland-protocols/protocol/stylus-tools-protocol.c
@@ -0,0 +1,59 @@
+/* Generated by wayland-scanner 1.13.0 */
+
+/*
+ * Copyright 2017 The Chromium Authors.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+#include <stdlib.h>
+#include <stdint.h>
+#include "wayland-util.h"
+
+extern const struct wl_interface wl_surface_interface;
+extern const struct wl_interface zcr_stylus_tool_v1_interface;
+
+static const struct wl_interface *types[] = {
+ &zcr_stylus_tool_v1_interface,
+ &wl_surface_interface,
+};
+
+static const struct wl_message zcr_stylus_tools_v1_requests[] = {
+ { "destroy", "", types + 0 },
+ { "get_stylus_tool", "no", types + 0 },
+};
+
+WL_EXPORT const struct wl_interface zcr_stylus_tools_v1_interface = {
+ "zcr_stylus_tools_v1", 1,
+ 2, zcr_stylus_tools_v1_requests,
+ 0, NULL,
+};
+
+static const struct wl_message zcr_stylus_tool_v1_requests[] = {
+ { "destroy", "", types + 0 },
+ { "set_stylus_only", "", types + 0 },
+};
+
+WL_EXPORT const struct wl_interface zcr_stylus_tool_v1_interface = {
+ "zcr_stylus_tool_v1", 1,
+ 2, zcr_stylus_tool_v1_requests,
+ 0, NULL,
+};
+
diff --git a/chromium/third_party/wayland-protocols/protocol/viewporter-protocol.c b/chromium/third_party/wayland-protocols/protocol/viewporter-protocol.c
new file mode 100644
index 00000000000..8bc362c7097
--- /dev/null
+++ b/chromium/third_party/wayland-protocols/protocol/viewporter-protocol.c
@@ -0,0 +1,64 @@
+/* Generated by wayland-scanner 1.13.0 */
+
+/*
+ * Copyright © 2013-2016 Collabora, Ltd.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+#include <stdlib.h>
+#include <stdint.h>
+#include "wayland-util.h"
+
+extern const struct wl_interface wl_surface_interface;
+extern const struct wl_interface wp_viewport_interface;
+
+static const struct wl_interface *types[] = {
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ &wp_viewport_interface,
+ &wl_surface_interface,
+};
+
+static const struct wl_message wp_viewporter_requests[] = {
+ { "destroy", "", types + 0 },
+ { "get_viewport", "no", types + 4 },
+};
+
+WL_EXPORT const struct wl_interface wp_viewporter_interface = {
+ "wp_viewporter", 1,
+ 2, wp_viewporter_requests,
+ 0, NULL,
+};
+
+static const struct wl_message wp_viewport_requests[] = {
+ { "destroy", "", types + 0 },
+ { "set_source", "ffff", types + 0 },
+ { "set_destination", "ii", types + 0 },
+};
+
+WL_EXPORT const struct wl_interface wp_viewport_interface = {
+ "wp_viewport", 1,
+ 3, wp_viewport_requests,
+ 0, NULL,
+};
+
diff --git a/chromium/third_party/wayland-protocols/protocol/vsync-feedback-protocol.c b/chromium/third_party/wayland-protocols/protocol/vsync-feedback-protocol.c
new file mode 100644
index 00000000000..c9627d2a366
--- /dev/null
+++ b/chromium/third_party/wayland-protocols/protocol/vsync-feedback-protocol.c
@@ -0,0 +1,66 @@
+/* Generated by wayland-scanner 1.13.0 */
+
+/*
+ * Copyright 2016 The Chromium Authors.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+#include <stdlib.h>
+#include <stdint.h>
+#include "wayland-util.h"
+
+extern const struct wl_interface wl_output_interface;
+extern const struct wl_interface zcr_vsync_timing_v1_interface;
+
+static const struct wl_interface *types[] = {
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ &zcr_vsync_timing_v1_interface,
+ &wl_output_interface,
+};
+
+static const struct wl_message zcr_vsync_feedback_v1_requests[] = {
+ { "destroy", "", types + 0 },
+ { "get_vsync_timing", "n?o", types + 4 },
+};
+
+WL_EXPORT const struct wl_interface zcr_vsync_feedback_v1_interface = {
+ "zcr_vsync_feedback_v1", 1,
+ 2, zcr_vsync_feedback_v1_requests,
+ 0, NULL,
+};
+
+static const struct wl_message zcr_vsync_timing_v1_requests[] = {
+ { "destroy", "", types + 0 },
+};
+
+static const struct wl_message zcr_vsync_timing_v1_events[] = {
+ { "update", "uuuu", types + 0 },
+};
+
+WL_EXPORT const struct wl_interface zcr_vsync_timing_v1_interface = {
+ "zcr_vsync_timing_v1", 1,
+ 1, zcr_vsync_timing_v1_requests,
+ 1, zcr_vsync_timing_v1_events,
+};
+
diff --git a/chromium/third_party/wayland-protocols/protocol/xdg-shell-v5-protocol.c b/chromium/third_party/wayland-protocols/protocol/xdg-shell-v5-protocol.c
new file mode 100644
index 00000000000..f2646a2ddfc
--- /dev/null
+++ b/chromium/third_party/wayland-protocols/protocol/xdg-shell-v5-protocol.c
@@ -0,0 +1,125 @@
+/* Generated by wayland-scanner 1.13.0 */
+
+/*
+ * Copyright © 2008-2013 Kristian Høgsberg
+ * Copyright © 2013 Rafael Antognolli
+ * Copyright © 2013 Jasper St. Pierre
+ * Copyright © 2010-2013 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+#include <stdlib.h>
+#include <stdint.h>
+#include "wayland-util.h"
+
+extern const struct wl_interface wl_output_interface;
+extern const struct wl_interface wl_seat_interface;
+extern const struct wl_interface wl_surface_interface;
+extern const struct wl_interface xdg_popup_interface;
+extern const struct wl_interface xdg_surface_interface;
+
+static const struct wl_interface *types[] = {
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ &xdg_surface_interface,
+ &wl_surface_interface,
+ &xdg_popup_interface,
+ &wl_surface_interface,
+ &wl_surface_interface,
+ &wl_seat_interface,
+ NULL,
+ NULL,
+ NULL,
+ &xdg_surface_interface,
+ &wl_seat_interface,
+ NULL,
+ NULL,
+ NULL,
+ &wl_seat_interface,
+ NULL,
+ &wl_seat_interface,
+ NULL,
+ NULL,
+ &wl_output_interface,
+};
+
+static const struct wl_message xdg_shell_requests[] = {
+ { "destroy", "", types + 0 },
+ { "use_unstable_version", "i", types + 0 },
+ { "get_xdg_surface", "no", types + 4 },
+ { "get_xdg_popup", "nooouii", types + 6 },
+ { "pong", "u", types + 0 },
+};
+
+static const struct wl_message xdg_shell_events[] = {
+ { "ping", "u", types + 0 },
+};
+
+WL_EXPORT const struct wl_interface xdg_shell_interface = {
+ "xdg_shell", 1,
+ 5, xdg_shell_requests,
+ 1, xdg_shell_events,
+};
+
+static const struct wl_message xdg_surface_requests[] = {
+ { "destroy", "", types + 0 },
+ { "set_parent", "?o", types + 13 },
+ { "set_title", "s", types + 0 },
+ { "set_app_id", "s", types + 0 },
+ { "show_window_menu", "ouii", types + 14 },
+ { "move", "ou", types + 18 },
+ { "resize", "ouu", types + 20 },
+ { "ack_configure", "u", types + 0 },
+ { "set_window_geometry", "iiii", types + 0 },
+ { "set_maximized", "", types + 0 },
+ { "unset_maximized", "", types + 0 },
+ { "set_fullscreen", "?o", types + 23 },
+ { "unset_fullscreen", "", types + 0 },
+ { "set_minimized", "", types + 0 },
+};
+
+static const struct wl_message xdg_surface_events[] = {
+ { "configure", "iiau", types + 0 },
+ { "close", "", types + 0 },
+};
+
+WL_EXPORT const struct wl_interface xdg_surface_interface = {
+ "xdg_surface", 1,
+ 14, xdg_surface_requests,
+ 2, xdg_surface_events,
+};
+
+static const struct wl_message xdg_popup_requests[] = {
+ { "destroy", "", types + 0 },
+};
+
+static const struct wl_message xdg_popup_events[] = {
+ { "popup_done", "", types + 0 },
+};
+
+WL_EXPORT const struct wl_interface xdg_popup_interface = {
+ "xdg_popup", 1,
+ 1, xdg_popup_requests,
+ 1, xdg_popup_events,
+};
+
diff --git a/chromium/third_party/wayland-protocols/protocol/xdg-shell-v6-protocol.c b/chromium/third_party/wayland-protocols/protocol/xdg-shell-v6-protocol.c
new file mode 100644
index 00000000000..ce44a5ee18d
--- /dev/null
+++ b/chromium/third_party/wayland-protocols/protocol/xdg-shell-v6-protocol.c
@@ -0,0 +1,162 @@
+/* Generated by wayland-scanner 1.13.0 */
+
+/*
+ * Copyright © 2008-2013 Kristian Høgsberg
+ * Copyright © 2013 Rafael Antognolli
+ * Copyright © 2013 Jasper St. Pierre
+ * Copyright © 2010-2013 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ * DEALINGS IN THE SOFTWARE.
+ */
+
+#include <stdlib.h>
+#include <stdint.h>
+#include "wayland-util.h"
+
+extern const struct wl_interface wl_output_interface;
+extern const struct wl_interface wl_seat_interface;
+extern const struct wl_interface wl_surface_interface;
+extern const struct wl_interface zxdg_popup_v6_interface;
+extern const struct wl_interface zxdg_positioner_v6_interface;
+extern const struct wl_interface zxdg_surface_v6_interface;
+extern const struct wl_interface zxdg_toplevel_v6_interface;
+
+static const struct wl_interface *types[] = {
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ &zxdg_positioner_v6_interface,
+ &zxdg_surface_v6_interface,
+ &wl_surface_interface,
+ &zxdg_toplevel_v6_interface,
+ &zxdg_popup_v6_interface,
+ &zxdg_surface_v6_interface,
+ &zxdg_positioner_v6_interface,
+ &zxdg_toplevel_v6_interface,
+ &wl_seat_interface,
+ NULL,
+ NULL,
+ NULL,
+ &wl_seat_interface,
+ NULL,
+ &wl_seat_interface,
+ NULL,
+ NULL,
+ &wl_output_interface,
+ &wl_seat_interface,
+ NULL,
+};
+
+static const struct wl_message zxdg_shell_v6_requests[] = {
+ { "destroy", "", types + 0 },
+ { "create_positioner", "n", types + 4 },
+ { "get_xdg_surface", "no", types + 5 },
+ { "pong", "u", types + 0 },
+};
+
+static const struct wl_message zxdg_shell_v6_events[] = {
+ { "ping", "u", types + 0 },
+};
+
+WL_EXPORT const struct wl_interface zxdg_shell_v6_interface = {
+ "zxdg_shell_v6", 1,
+ 4, zxdg_shell_v6_requests,
+ 1, zxdg_shell_v6_events,
+};
+
+static const struct wl_message zxdg_positioner_v6_requests[] = {
+ { "destroy", "", types + 0 },
+ { "set_size", "ii", types + 0 },
+ { "set_anchor_rect", "iiii", types + 0 },
+ { "set_anchor", "u", types + 0 },
+ { "set_gravity", "u", types + 0 },
+ { "set_constraint_adjustment", "u", types + 0 },
+ { "set_offset", "ii", types + 0 },
+};
+
+WL_EXPORT const struct wl_interface zxdg_positioner_v6_interface = {
+ "zxdg_positioner_v6", 1,
+ 7, zxdg_positioner_v6_requests,
+ 0, NULL,
+};
+
+static const struct wl_message zxdg_surface_v6_requests[] = {
+ { "destroy", "", types + 0 },
+ { "get_toplevel", "n", types + 7 },
+ { "get_popup", "noo", types + 8 },
+ { "set_window_geometry", "iiii", types + 0 },
+ { "ack_configure", "u", types + 0 },
+};
+
+static const struct wl_message zxdg_surface_v6_events[] = {
+ { "configure", "u", types + 0 },
+};
+
+WL_EXPORT const struct wl_interface zxdg_surface_v6_interface = {
+ "zxdg_surface_v6", 1,
+ 5, zxdg_surface_v6_requests,
+ 1, zxdg_surface_v6_events,
+};
+
+static const struct wl_message zxdg_toplevel_v6_requests[] = {
+ { "destroy", "", types + 0 },
+ { "set_parent", "?o", types + 11 },
+ { "set_title", "s", types + 0 },
+ { "set_app_id", "s", types + 0 },
+ { "show_window_menu", "ouii", types + 12 },
+ { "move", "ou", types + 16 },
+ { "resize", "ouu", types + 18 },
+ { "set_max_size", "ii", types + 0 },
+ { "set_min_size", "ii", types + 0 },
+ { "set_maximized", "", types + 0 },
+ { "unset_maximized", "", types + 0 },
+ { "set_fullscreen", "?o", types + 21 },
+ { "unset_fullscreen", "", types + 0 },
+ { "set_minimized", "", types + 0 },
+};
+
+static const struct wl_message zxdg_toplevel_v6_events[] = {
+ { "configure", "iia", types + 0 },
+ { "close", "", types + 0 },
+};
+
+WL_EXPORT const struct wl_interface zxdg_toplevel_v6_interface = {
+ "zxdg_toplevel_v6", 1,
+ 14, zxdg_toplevel_v6_requests,
+ 2, zxdg_toplevel_v6_events,
+};
+
+static const struct wl_message zxdg_popup_v6_requests[] = {
+ { "destroy", "", types + 0 },
+ { "grab", "ou", types + 22 },
+};
+
+static const struct wl_message zxdg_popup_v6_events[] = {
+ { "configure", "iiii", types + 0 },
+ { "popup_done", "", types + 0 },
+};
+
+WL_EXPORT const struct wl_interface zxdg_popup_v6_interface = {
+ "zxdg_popup_v6", 1,
+ 2, zxdg_popup_v6_requests,
+ 2, zxdg_popup_v6_events,
+};
+
diff --git a/chromium/third_party/wayland-protocols/src/COPYING b/chromium/third_party/wayland-protocols/src/COPYING
new file mode 100644
index 00000000000..8ab3291e385
--- /dev/null
+++ b/chromium/third_party/wayland-protocols/src/COPYING
@@ -0,0 +1,33 @@
+Copyright © 2008-2013 Kristian Høgsberg
+Copyright © 2010-2013 Intel Corporation
+Copyright © 2013 Rafael Antognolli
+Copyright © 2013 Jasper St. Pierre
+Copyright © 2014 Jonas Ådahl
+Copyright © 2014 Jason Ekstrand
+Copyright © 2014-2015 Collabora, Ltd.
+Copyright © 2015 Red Hat Inc.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the "Software"),
+to deal in the Software without restriction, including without limitation
+the rights to use, copy, modify, merge, publish, distribute, sublicense,
+and/or sell copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice (including the next
+paragraph) shall be included in all copies or substantial portions of the
+Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
+
+---
+
+The above is the version of the MIT "Expat" License used by X.org:
+
+ http://cgit.freedesktop.org/xorg/xserver/tree/COPYING
diff --git a/chromium/third_party/wayland-protocols/src/Makefile.am b/chromium/third_party/wayland-protocols/src/Makefile.am
new file mode 100644
index 00000000000..e693afa5bd6
--- /dev/null
+++ b/chromium/third_party/wayland-protocols/src/Makefile.am
@@ -0,0 +1,39 @@
+unstable_protocols = \
+ unstable/pointer-gestures/pointer-gestures-unstable-v1.xml \
+ unstable/fullscreen-shell/fullscreen-shell-unstable-v1.xml \
+ unstable/linux-dmabuf/linux-dmabuf-unstable-v1.xml \
+ unstable/text-input/text-input-unstable-v1.xml \
+ unstable/input-method/input-method-unstable-v1.xml \
+ unstable/xdg-shell/xdg-shell-unstable-v5.xml \
+ unstable/xdg-shell/xdg-shell-unstable-v6.xml \
+ unstable/relative-pointer/relative-pointer-unstable-v1.xml \
+ unstable/pointer-constraints/pointer-constraints-unstable-v1.xml \
+ unstable/tablet/tablet-unstable-v1.xml \
+ unstable/tablet/tablet-unstable-v2.xml \
+ unstable/xdg-foreign/xdg-foreign-unstable-v1.xml \
+ unstable/idle-inhibit/idle-inhibit-unstable-v1.xml \
+ $(NULL)
+
+stable_protocols = \
+ stable/presentation-time/presentation-time.xml \
+ stable/viewporter/viewporter.xml \
+ $(NULL)
+
+nobase_dist_pkgdata_DATA = \
+ $(unstable_protocols) \
+ $(stable_protocols) \
+ $(NULL)
+
+dist_noinst_DATA = \
+ $(sort $(foreach p,$(unstable_protocols),$(dir $p)README)) \
+ $(sort $(foreach p,$(stable_protocols),$(dir $p)README)) \
+ $(NULL)
+
+noarch_pkgconfig_DATA = wayland-protocols.pc
+
+dist_check_SCRIPTS = tests/scan.sh
+
+TESTS = $(unstable_protocols) $(stable_protocols)
+TEST_EXTENSIONS = .xml
+AM_TESTS_ENVIRONMENT = SCANNER='$(wayland_scanner)'; export SCANNER;
+XML_LOG_COMPILER = $(srcdir)/tests/scan.sh
diff --git a/chromium/third_party/wayland-protocols/src/README b/chromium/third_party/wayland-protocols/src/README
new file mode 100644
index 00000000000..da1f1d5b37a
--- /dev/null
+++ b/chromium/third_party/wayland-protocols/src/README
@@ -0,0 +1,141 @@
+Wayland protocols
+-----------------
+
+wayland-protocols contains Wayland protocols that add functionality not
+available in the Wayland core protocol. Such protocols either add
+completely new functionality, or extend the functionality of some other
+protocol either in Wayland core, or some other protocol in
+wayland-protocols.
+
+A protocol in wayland-protocols consists of a directory containing a set
+of XML files containing the protocol specification, and a README file
+containing detailed state and a list of maintainers.
+
+Protocol directory tree structure
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+Protocols may be 'stable', 'unstable' or 'deprecated', and the interface
+and protocol names as well as place in the directory tree will reflect
+this.
+
+A stable protocol is a protocol which has been declared stable by
+the maintainers. Changes to such protocols will always be backward
+compatible.
+
+An unstable protocol is a protocol currently under development and this
+will be reflected in the protocol and interface names. See <<Unstable
+naming convention>>.
+
+A deprecated protocol is a protocol that has either been replaced by some
+other protocol, or declared undesirable for some other reason. No more
+changes will be made to a deprecated protocol.
+
+Depending on which of the above states the protocol is in, the protocol
+is placed within the toplevel directory containing the protocols with the
+same state. Stable protocols are placed in the +stable/+ directory,
+unstable protocols are placed in the +unstable/+ directory, and
+deprecated protocols are placed in the +deprecated/+ directory.
+
+Protocol development procedure
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+To propose a new protocol, create a patch adding the relevant files and
+Makefile.am entry to the wayland-protocols git repository with the
+explanation and motivation in the commit message. Then send the patch to
+the wayland-devel@lists.freedesktop.org mailing list using
+'git send-email' with the subject prefix 'RFC wayland-protocols' or
+'PATCH wayland-protocols' depending on what state the protocol is in.
+
+To propose changes to existing protocols, create a patch with the
+changes and send it to the list mentioned above while also CC:ing the
+maintainers mentioned in the README file. Use the same rule for adding a
+subject prefix as above and method for sending the patch.
+
+If the changes are backward incompatible changes to an unstable protocol,
+see <<Unstable protocol changes>>.
+
+Interface naming convention
+~~~~~~~~~~~~~~~~~~~~~~~~~~~
+All protocols should avoid using generic namespaces or no namespaces in
+the protocol interface names in order to minimize risk that the generated
+C API collides with other C API. Interface names that may collide with
+interface names from other protocols should also be avoided.
+
+For generic protocols not limited to certain configurations (such as
+specific desktop environment or operating system) the +wp_+ prefix
+should be used on all interfaces in the protocol.
+
+For operating system specific protocols, the interfaces should be
+prefixed with both +wp_+ and the operating system, for example
++wp_linux_+, or +wp_freebsd_+, etc.
+
+Unstable naming convention
+~~~~~~~~~~~~~~~~~~~~~~~~~~
+Unstable protocols have a special naming convention in order to make it
+possible to make discoverable backward incompatible changes.
+
+An unstable protocol has at least two versions: the major version, which
+represents backward incompatible changes, and the minor version, which
+represents backward compatible changes to the interfaces in the protocol.
+
+The major version is part of the XML file name, the protocol name in the
+XML, and interface names in the protocol.
+
+Minor versions are the version attributes of the interfaces in the XML.
+There may be more than one minor version per protocol, if there are more
+than one global.
+
+The XML file and protocol name also has the word 'unstable' in them, and
+all of the interfaces in the protocol are prefixed with +z+ and
+suffixed with the major version number.
+
+For example, an unstable protocol called foo-bar with major version 2
+containing the two interfaces wp_foo and wp_bar both minor version 1 will
+be placed in the directory +unstable/foo-bar/+ consisting of one file
+called +README+ and one called +foo-bar-unstable-v2.xml+. The XML file
+will consist of two interfaces called +zwp_foo_v2+ and +zwp_bar_v2+ with
+the +version+ attribute set to +1+.
+
+Unstable protocol changes
+~~~~~~~~~~~~~~~~~~~~~~~~~
+During the development of a new protocol it is possible that backward
+incompatible changes are needed. Such a change needs to be represented
+in the major and minor versions of the protocol.
+
+Assuming a backward incompatible change is needed, the procedure for how to
+do so is the following:
+
+ . Make a copy of the XML file with the major version increased by +1+.
+ . Increase the major version number in the protocol XML by +1+.
+ . Increase the major version number in all of the interfaces in the
+ XML by +1+.
+ . Reset the minor version number (interface version attribute) of all
+ the interfaces to +1+.
+
+Backward compatible changes within a major unstable version can be done
+in the regular way as done in core Wayland or in stable protocols.
+
+Declaring a protocol stable
+~~~~~~~~~~~~~~~~~~~~~~~~~~~
+Once it is decided that a protocol should be declared stable, meaning no
+more backward incompatible changes will ever be allowed, one last
+breakage is needed.
+
+The procedure of doing this is the following:
+
+ . Create a new directory in the +stable/+ toplevel directory with the
+ same name as the protocol directory in the +unstable/+ directory.
+ . Copy the final version of the XML that is the version that was
+ decided to be declared stable into the new directory. The target name
+ should be the same name as the protocol directory but with the +.xml+
+ suffix.
+ . Rename the name of the protocol in the XML by removing the
+ 'unstable' part and the major version number.
+ . Remove the +z+ prefix and the major version number suffix from all
+ of the interfaces in the protocol.
+ . Reset all of the interface version attributes to +1+.
+ . Update the +README+ file in the unstable directory and create a new
+ +README+ file in the new directory.
+
+Releases
+~~~~~~~~
+Each release of wayland-protocols finalizes the version of the protocols
+to their state they had at that time.
diff --git a/chromium/third_party/wayland-protocols/src/autogen.sh b/chromium/third_party/wayland-protocols/src/autogen.sh
new file mode 100755
index 00000000000..b08bc831f64
--- /dev/null
+++ b/chromium/third_party/wayland-protocols/src/autogen.sh
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+test -n "$srcdir" || srcdir=`dirname "$0"`
+test -n "$srcdir" || srcdir=.
+(
+ cd "$srcdir" &&
+ autoreconf --force -v --install
+) || exit
+test -n "$NOCONFIGURE" || "$srcdir/configure" "$@"
diff --git a/chromium/third_party/wayland-protocols/src/configure.ac b/chromium/third_party/wayland-protocols/src/configure.ac
new file mode 100644
index 00000000000..e98bceb575f
--- /dev/null
+++ b/chromium/third_party/wayland-protocols/src/configure.ac
@@ -0,0 +1,45 @@
+AC_PREREQ([2.64])
+
+m4_define([wayland_protocols_major_version], [1])
+m4_define([wayland_protocols_minor_version], [8])
+m4_define([wayland_protocols_version],
+ [wayland_protocols_major_version.wayland_protocols_minor_version])
+
+AC_INIT([wayland-protocols],
+ [wayland_protocols_version],
+ [https://bugs.freedesktop.org/enter_bug.cgi?product=Wayland&component=wayland&version=unspecified],
+ [wayland-protocols],
+ [http://wayland.freedesktop.org/])
+
+AC_CONFIG_MACRO_DIR([m4])
+
+AC_SUBST([WAYLAND_PROTOCOLS_VERSION], [wayland_protocols_version])
+
+AC_ARG_VAR([wayland_scanner], [The wayland-scanner executable])
+AC_PATH_PROG([wayland_scanner], [wayland-scanner])
+if test x$wayland_scanner = x; then
+ if test "x$cross_compiling" != "xyes"; then
+ PKG_CHECK_MODULES(WAYLAND_SCANNER, [wayland-scanner])
+ wayland_scanner=`$PKG_CONFIG --variable=wayland_scanner wayland-scanner`
+ else
+ AC_MSG_WARN([You are cross compiling without wayland-scanner in your path. make check will fail.])
+ fi
+fi
+
+AM_INIT_AUTOMAKE([1.11 foreign no-dist-gzip dist-xz])
+
+AM_SILENT_RULES([yes])
+
+PKG_NOARCH_INSTALLDIR
+
+AC_CONFIG_FILES([
+ Makefile
+ wayland-protocols.pc
+ wayland-protocols-uninstalled.pc
+ ])
+AC_OUTPUT
+
+AC_MSG_RESULT([
+ Version ${WAYLAND_PROTOCOLS_VERSION}
+ Prefix ${prefix}
+ ])
diff --git a/chromium/third_party/wayland-protocols/src/m4/compat.m4 b/chromium/third_party/wayland-protocols/src/m4/compat.m4
new file mode 100644
index 00000000000..290ef035f14
--- /dev/null
+++ b/chromium/third_party/wayland-protocols/src/m4/compat.m4
@@ -0,0 +1,12 @@
+dnl noarch_pkgconfigdir only available in pkg-config 0.27 and newer
+dnl http://lists.freedesktop.org/archives/pkg-config/2012-July/000875.html
+dnl Ubuntu 14.04 provides only pkg-config 0.26 so lacks this function.
+dnl
+dnl The Wayland project maintains automated builds for Ubuntu 14.04 in
+dnl a Launchpad PPA. 14.04 is a Long Term Support distro release, which
+dnl will reach EOL April 2019, however the Wayland PPA may stop targeting
+dnl it some time after the next LTS release (April 2016).
+m4_ifndef([PKG_NOARCH_INSTALLDIR], [AC_DEFUN([PKG_NOARCH_INSTALLDIR], [
+ noarch_pkgconfigdir='${datadir}'/pkgconfig
+ AC_SUBST([noarch_pkgconfigdir])
+])])
diff --git a/chromium/third_party/wayland-protocols/src/stable/presentation-time/README b/chromium/third_party/wayland-protocols/src/stable/presentation-time/README
new file mode 100644
index 00000000000..c7781ea802f
--- /dev/null
+++ b/chromium/third_party/wayland-protocols/src/stable/presentation-time/README
@@ -0,0 +1,5 @@
+Presentation time protocol
+
+Maintainers:
+Pekka Paalanen <pekka.paalanen@collabora.co.uk>
+
diff --git a/chromium/third_party/wayland-protocols/src/stable/presentation-time/presentation-time.xml b/chromium/third_party/wayland-protocols/src/stable/presentation-time/presentation-time.xml
new file mode 100644
index 00000000000..a46994c8d2c
--- /dev/null
+++ b/chromium/third_party/wayland-protocols/src/stable/presentation-time/presentation-time.xml
@@ -0,0 +1,266 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<protocol name="presentation_time">
+<!-- wrap:70 -->
+
+ <copyright>
+ Copyright © 2013-2014 Collabora, Ltd.
+
+ Permission is hereby granted, free of charge, to any person obtaining a
+ copy of this software and associated documentation files (the "Software"),
+ to deal in the Software without restriction, including without limitation
+ the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ and/or sell copies of the Software, and to permit persons to whom the
+ Software is furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice (including the next
+ paragraph) shall be included in all copies or substantial portions of the
+ Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ DEALINGS IN THE SOFTWARE.
+ </copyright>
+
+ <interface name="wp_presentation" version="1">
+ <description summary="timed presentation related wl_surface requests">
+
+<!-- Introduction -->
+
+ The main feature of this interface is accurate presentation
+ timing feedback to ensure smooth video playback while maintaining
+ audio/video synchronization. Some features use the concept of a
+ presentation clock, which is defined in the
+ presentation.clock_id event.
+
+ A content update for a wl_surface is submitted by a
+ wl_surface.commit request. Request 'feedback' associates with
+ the wl_surface.commit and provides feedback on the content
+ update, particularly the final realized presentation time.
+
+<!-- Completing presentation -->
+
+ When the final realized presentation time is available, e.g.
+ after a framebuffer flip completes, the requested
+ presentation_feedback.presented events are sent. The final
+ presentation time can differ from the compositor's predicted
+ display update time and the update's target time, especially
+ when the compositor misses its target vertical blanking period.
+ </description>
+
+ <enum name="error">
+ <description summary="fatal presentation errors">
+ These fatal protocol errors may be emitted in response to
+ illegal presentation requests.
+ </description>
+ <entry name="invalid_timestamp" value="0"
+ summary="invalid value in tv_nsec"/>
+ <entry name="invalid_flag" value="1"
+ summary="invalid flag"/>
+ </enum>
+
+ <request name="destroy" type="destructor">
+ <description summary="unbind from the presentation interface">
+ Informs the server that the client will no longer be using
+ this protocol object. Existing objects created by this object
+ are not affected.
+ </description>
+ </request>
+
+ <request name="feedback">
+ <description summary="request presentation feedback information">
+ Request presentation feedback for the current content submission
+ on the given surface. This creates a new presentation_feedback
+ object, which will deliver the feedback information once. If
+ multiple presentation_feedback objects are created for the same
+ submission, they will all deliver the same information.
+
+ For details on what information is returned, see the
+ presentation_feedback interface.
+ </description>
+ <arg name="surface" type="object" interface="wl_surface"
+ summary="target surface"/>
+ <arg name="callback" type="new_id" interface="wp_presentation_feedback"
+ summary="new feedback object"/>
+ </request>
+
+ <event name="clock_id">
+ <description summary="clock ID for timestamps">
+ This event tells the client in which clock domain the
+ compositor interprets the timestamps used by the presentation
+ extension. This clock is called the presentation clock.
+
+ The compositor sends this event when the client binds to the
+ presentation interface. The presentation clock does not change
+ during the lifetime of the client connection.
+
+ The clock identifier is platform dependent. On Linux/glibc,
+ the identifier value is one of the clockid_t values accepted
+ by clock_gettime(). clock_gettime() is defined by
+ POSIX.1-2001.
+
+ Timestamps in this clock domain are expressed as tv_sec_hi,
+ tv_sec_lo, tv_nsec triples, each component being an unsigned
+ 32-bit value. Whole seconds are in tv_sec which is a 64-bit
+ value combined from tv_sec_hi and tv_sec_lo, and the
+ additional fractional part in tv_nsec as nanoseconds. Hence,
+ for valid timestamps tv_nsec must be in [0, 999999999].
+
+ Note that clock_id applies only to the presentation clock,
+ and implies nothing about e.g. the timestamps used in the
+ Wayland core protocol input events.
+
+ Compositors should prefer a clock which does not jump and is
+ not slewed e.g. by NTP. The absolute value of the clock is
+ irrelevant. Precision of one millisecond or better is
+ recommended. Clients must be able to query the current clock
+ value directly, not by asking the compositor.
+ </description>
+ <arg name="clk_id" type="uint" summary="platform clock identifier"/>
+ </event>
+
+ </interface>
+
+ <interface name="wp_presentation_feedback" version="1">
+ <description summary="presentation time feedback event">
+ A presentation_feedback object returns an indication that a
+ wl_surface content update has become visible to the user.
+ One object corresponds to one content update submission
+ (wl_surface.commit). There are two possible outcomes: the
+ content update is presented to the user, and a presentation
+ timestamp delivered; or, the user did not see the content
+ update because it was superseded or its surface destroyed,
+ and the content update is discarded.
+
+ Once a presentation_feedback object has delivered a 'presented'
+ or 'discarded' event it is automatically destroyed.
+ </description>
+
+ <event name="sync_output">
+ <description summary="presentation synchronized to this output">
+ As presentation can be synchronized to only one output at a
+ time, this event tells which output it was. This event is only
+ sent prior to the presented event.
+
+ As clients may bind to the same global wl_output multiple
+ times, this event is sent for each bound instance that matches
+ the synchronized output. If a client has not bound to the
+ right wl_output global at all, this event is not sent.
+ </description>
+ <arg name="output" type="object" interface="wl_output"
+ summary="presentation output"/>
+ </event>
+
+ <enum name="kind">
+ <description summary="bitmask of flags in presented event">
+ These flags provide information about how the presentation of
+ the related content update was done. The intent is to help
+ clients assess the reliability of the feedback and the visual
+ quality with respect to possible tearing and timings. The
+ flags are:
+
+ VSYNC:
+ The presentation was synchronized to the "vertical retrace" by
+ the display hardware such that tearing does not happen.
+ Relying on user space scheduling is not acceptable for this
+ flag. If presentation is done by a copy to the active
+ frontbuffer, then it must guarantee that tearing cannot
+ happen.
+
+ HW_CLOCK:
+ The display hardware provided measurements that the hardware
+ driver converted into a presentation timestamp. Sampling a
+ clock in user space is not acceptable for this flag.
+
+ HW_COMPLETION:
+ The display hardware signalled that it started using the new
+ image content. The opposite of this is e.g. a timer being used
+ to guess when the display hardware has switched to the new
+ image content.
+
+ ZERO_COPY:
+ The presentation of this update was done zero-copy. This means
+ the buffer from the client was given to display hardware as
+ is, without copying it. Compositing with OpenGL counts as
+ copying, even if textured directly from the client buffer.
+ Possible zero-copy cases include direct scanout of a
+ fullscreen surface and a surface on a hardware overlay.
+ </description>
+ <entry name="vsync" value="0x1" summary="presentation was vsync'd"/>
+ <entry name="hw_clock" value="0x2"
+ summary="hardware provided the presentation timestamp"/>
+ <entry name="hw_completion" value="0x4"
+ summary="hardware signalled the start of the presentation"/>
+ <entry name="zero_copy" value="0x8"
+ summary="presentation was done zero-copy"/>
+ </enum>
+
+ <event name="presented">
+ <description summary="the content update was displayed">
+ The associated content update was displayed to the user at the
+ indicated time (tv_sec_hi/lo, tv_nsec). For the interpretation of
+ the timestamp, see presentation.clock_id event.
+
+ The timestamp corresponds to the time when the content update
+ turned into light the first time on the surface's main output.
+ Compositors may approximate this from the framebuffer flip
+ completion events from the system, and the latency of the
+ physical display path if known.
+
+ This event is preceded by all related sync_output events
+ telling which output's refresh cycle the feedback corresponds
+ to, i.e. the main output for the surface. Compositors are
+ recommended to choose the output containing the largest part
+ of the wl_surface, or keeping the output they previously
+ chose. Having a stable presentation output association helps
+ clients predict future output refreshes (vblank).
+
+ The 'refresh' argument gives the compositor's prediction of how
+ many nanoseconds after tv_sec, tv_nsec the very next output
+ refresh may occur. This is to further aid clients in
+ predicting future refreshes, i.e., estimating the timestamps
+ targeting the next few vblanks. If such prediction cannot
+ usefully be done, the argument is zero.
+
+ If the output does not have a constant refresh rate, explicit
+ video mode switches excluded, then the refresh argument must
+ be zero.
+
+ The 64-bit value combined from seq_hi and seq_lo is the value
+ of the output's vertical retrace counter when the content
+ update was first scanned out to the display. This value must
+ be compatible with the definition of MSC in
+ GLX_OML_sync_control specification. Note, that if the display
+ path has a non-zero latency, the time instant specified by
+ this counter may differ from the timestamp's.
+
+ If the output does not have a concept of vertical retrace or a
+ refresh cycle, or the output device is self-refreshing without
+ a way to query the refresh count, then the arguments seq_hi
+ and seq_lo must be zero.
+ </description>
+ <arg name="tv_sec_hi" type="uint"
+ summary="high 32 bits of the seconds part of the presentation timestamp"/>
+ <arg name="tv_sec_lo" type="uint"
+ summary="low 32 bits of the seconds part of the presentation timestamp"/>
+ <arg name="tv_nsec" type="uint"
+ summary="nanoseconds part of the presentation timestamp"/>
+ <arg name="refresh" type="uint" summary="nanoseconds till next refresh"/>
+ <arg name="seq_hi" type="uint"
+ summary="high 32 bits of refresh counter"/>
+ <arg name="seq_lo" type="uint"
+ summary="low 32 bits of refresh counter"/>
+ <arg name="flags" type="uint" summary="combination of 'kind' values"/>
+ </event>
+
+ <event name="discarded">
+ <description summary="the content update was not displayed">
+ The content update was never displayed to the user.
+ </description>
+ </event>
+ </interface>
+
+</protocol>
diff --git a/chromium/third_party/wayland-protocols/src/stable/viewporter/README b/chromium/third_party/wayland-protocols/src/stable/viewporter/README
new file mode 100644
index 00000000000..e09057b16cb
--- /dev/null
+++ b/chromium/third_party/wayland-protocols/src/stable/viewporter/README
@@ -0,0 +1,7 @@
+Viewporter: cropping and scaling extension for surface contents
+
+Previously known as wl_scaler.
+
+Maintainers:
+Pekka Paalanen <pekka.paalanen@collabora.co.uk>
+
diff --git a/chromium/third_party/wayland-protocols/src/stable/viewporter/viewporter.xml b/chromium/third_party/wayland-protocols/src/stable/viewporter/viewporter.xml
new file mode 100644
index 00000000000..c732d8c35bc
--- /dev/null
+++ b/chromium/third_party/wayland-protocols/src/stable/viewporter/viewporter.xml
@@ -0,0 +1,186 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<protocol name="viewporter">
+
+ <copyright>
+ Copyright © 2013-2016 Collabora, Ltd.
+
+ Permission is hereby granted, free of charge, to any person obtaining a
+ copy of this software and associated documentation files (the "Software"),
+ to deal in the Software without restriction, including without limitation
+ the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ and/or sell copies of the Software, and to permit persons to whom the
+ Software is furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice (including the next
+ paragraph) shall be included in all copies or substantial portions of the
+ Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ DEALINGS IN THE SOFTWARE.
+ </copyright>
+
+ <interface name="wp_viewporter" version="1">
+ <description summary="surface cropping and scaling">
+ The global interface exposing surface cropping and scaling
+ capabilities is used to instantiate an interface extension for a
+ wl_surface object. This extended interface will then allow
+ cropping and scaling the surface contents, effectively
+ disconnecting the direct relationship between the buffer and the
+ surface size.
+ </description>
+
+ <request name="destroy" type="destructor">
+ <description summary="unbind from the cropping and scaling interface">
+ Informs the server that the client will not be using this
+ protocol object anymore. This does not affect any other objects,
+ wp_viewport objects included.
+ </description>
+ </request>
+
+ <enum name="error">
+ <entry name="viewport_exists" value="0"
+ summary="the surface already has a viewport object associated"/>
+ </enum>
+
+ <request name="get_viewport">
+ <description summary="extend surface interface for crop and scale">
+ Instantiate an interface extension for the given wl_surface to
+ crop and scale its content. If the given wl_surface already has
+ a wp_viewport object associated, the viewport_exists
+ protocol error is raised.
+ </description>
+ <arg name="id" type="new_id" interface="wp_viewport"
+ summary="the new viewport interface id"/>
+ <arg name="surface" type="object" interface="wl_surface"
+ summary="the surface"/>
+ </request>
+ </interface>
+
+ <interface name="wp_viewport" version="1">
+ <description summary="crop and scale interface to a wl_surface">
+ An additional interface to a wl_surface object, which allows the
+ client to specify the cropping and scaling of the surface
+ contents.
+
+ This interface works with two concepts: the source rectangle (src_x,
+ src_y, src_width, src_height), and the destination size (dst_width,
+ dst_height). The contents of the source rectangle are scaled to the
+ destination size, and content outside the source rectangle is ignored.
+ This state is double-buffered, and is applied on the next
+ wl_surface.commit.
+
+ The two parts of crop and scale state are independent: the source
+ rectangle, and the destination size. Initially both are unset, that
+ is, no scaling is applied. The whole of the current wl_buffer is
+ used as the source, and the surface size is as defined in
+ wl_surface.attach.
+
+ If the destination size is set, it causes the surface size to become
+ dst_width, dst_height. The source (rectangle) is scaled to exactly
+ this size. This overrides whatever the attached wl_buffer size is,
+ unless the wl_buffer is NULL. If the wl_buffer is NULL, the surface
+ has no content and therefore no size. Otherwise, the size is always
+ at least 1x1 in surface local coordinates.
+
+ If the source rectangle is set, it defines what area of the wl_buffer is
+ taken as the source. If the source rectangle is set and the destination
+ size is not set, then src_width and src_height must be integers, and the
+ surface size becomes the source rectangle size. This results in cropping
+ without scaling. If src_width or src_height are not integers and
+ destination size is not set, the bad_size protocol error is raised when
+ the surface state is applied.
+
+ The coordinate transformations from buffer pixel coordinates up to
+ the surface-local coordinates happen in the following order:
+ 1. buffer_transform (wl_surface.set_buffer_transform)
+ 2. buffer_scale (wl_surface.set_buffer_scale)
+ 3. crop and scale (wp_viewport.set*)
+ This means, that the source rectangle coordinates of crop and scale
+ are given in the coordinates after the buffer transform and scale,
+ i.e. in the coordinates that would be the surface-local coordinates
+ if the crop and scale was not applied.
+
+ If src_x or src_y are negative, the bad_value protocol error is raised.
+ Otherwise, if the source rectangle is partially or completely outside of
+ the non-NULL wl_buffer, then the out_of_buffer protocol error is raised
+ when the surface state is applied. A NULL wl_buffer does not raise the
+ out_of_buffer error.
+
+ The x, y arguments of wl_surface.attach are applied as normal to
+ the surface. They indicate how many pixels to remove from the
+ surface size from the left and the top. In other words, they are
+ still in the surface-local coordinate system, just like dst_width
+ and dst_height are.
+
+ If the wl_surface associated with the wp_viewport is destroyed,
+ all wp_viewport requests except 'destroy' raise the protocol error
+ no_surface.
+
+ If the wp_viewport object is destroyed, the crop and scale
+ state is removed from the wl_surface. The change will be applied
+ on the next wl_surface.commit.
+ </description>
+
+ <request name="destroy" type="destructor">
+ <description summary="remove scaling and cropping from the surface">
+ The associated wl_surface's crop and scale state is removed.
+ The change is applied on the next wl_surface.commit.
+ </description>
+ </request>
+
+ <enum name="error">
+ <entry name="bad_value" value="0"
+ summary="negative or zero values in width or height"/>
+ <entry name="bad_size" value="1"
+ summary="destination size is not integer"/>
+ <entry name="out_of_buffer" value="2"
+ summary="source rectangle extends outside of the content area"/>
+ <entry name="no_surface" value="3"
+ summary="the wl_surface was destroyed"/>
+ </enum>
+
+ <request name="set_source">
+ <description summary="set the source rectangle for cropping">
+ Set the source rectangle of the associated wl_surface. See
+ wp_viewport for the description, and relation to the wl_buffer
+ size.
+
+ If all of x, y, width and height are -1.0, the source rectangle is
+ unset instead. Any other set of values where width or height are zero
+ or negative, or x or y are negative, raise the bad_value protocol
+ error.
+
+ The crop and scale state is double-buffered state, and will be
+ applied on the next wl_surface.commit.
+ </description>
+ <arg name="x" type="fixed" summary="source rectangle x"/>
+ <arg name="y" type="fixed" summary="source rectangle y"/>
+ <arg name="width" type="fixed" summary="source rectangle width"/>
+ <arg name="height" type="fixed" summary="source rectangle height"/>
+ </request>
+
+ <request name="set_destination">
+ <description summary="set the surface size for scaling">
+ Set the destination size of the associated wl_surface. See
+ wp_viewport for the description, and relation to the wl_buffer
+ size.
+
+ If width is -1 and height is -1, the destination size is unset
+ instead. Any other pair of values for width and height that
+ contains zero or negative values raises the bad_value protocol
+ error.
+
+ The crop and scale state is double-buffered state, and will be
+ applied on the next wl_surface.commit.
+ </description>
+ <arg name="width" type="int" summary="surface width"/>
+ <arg name="height" type="int" summary="surface height"/>
+ </request>
+ </interface>
+
+</protocol>
diff --git a/chromium/third_party/wayland-protocols/src/unstable/fullscreen-shell/README b/chromium/third_party/wayland-protocols/src/unstable/fullscreen-shell/README
new file mode 100644
index 00000000000..5ad740f5e79
--- /dev/null
+++ b/chromium/third_party/wayland-protocols/src/unstable/fullscreen-shell/README
@@ -0,0 +1,4 @@
+Fullscreen shell protocol
+
+Maintainers:
+Jason Ekstrand <jason@jlekstrand.net>
diff --git a/chromium/third_party/wayland-protocols/src/unstable/fullscreen-shell/fullscreen-shell-unstable-v1.xml b/chromium/third_party/wayland-protocols/src/unstable/fullscreen-shell/fullscreen-shell-unstable-v1.xml
new file mode 100644
index 00000000000..7d141ee3cbe
--- /dev/null
+++ b/chromium/third_party/wayland-protocols/src/unstable/fullscreen-shell/fullscreen-shell-unstable-v1.xml
@@ -0,0 +1,220 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<protocol name="fullscreen_shell_unstable_v1">
+
+ <interface name="zwp_fullscreen_shell_v1" version="1">
+ <description summary="displays a single surface per output">
+ Displays a single surface per output.
+
+ This interface provides a mechanism for a single client to display
+ simple full-screen surfaces. While there technically may be multiple
+ clients bound to this interface, only one of those clients should be
+ shown at a time.
+
+ To present a surface, the client uses either the present_surface or
+ present_surface_for_mode requests. Presenting a surface takes effect
+ on the next wl_surface.commit. See the individual requests for
+ details about scaling and mode switches.
+
+ The client can have at most one surface per output at any time.
+ Requesting a surface to be presented on an output that already has a
+ surface replaces the previously presented surface. Presenting a null
+ surface removes its content and effectively disables the output.
+ Exactly what happens when an output is "disabled" is
+ compositor-specific. The same surface may be presented on multiple
+ outputs simultaneously.
+
+ Once a surface is presented on an output, it stays on that output
+ until either the client removes it or the compositor destroys the
+ output. This way, the client can update the output's contents by
+ simply attaching a new buffer.
+
+ Warning! The protocol described in this file is experimental and
+ backward incompatible changes may be made. Backward compatible changes
+ may be added together with the corresponding interface version bump.
+ Backward incompatible changes are done by bumping the version number in
+ the protocol and interface names and resetting the interface version.
+ Once the protocol is to be declared stable, the 'z' prefix and the
+ version number in the protocol and interface names are removed and the
+ interface version number is reset.
+ </description>
+
+ <request name="release" type="destructor">
+ <description summary="release the wl_fullscreen_shell interface">
+ Release the binding from the wl_fullscreen_shell interface.
+
+ This destroys the server-side object and frees this binding. If
+ the client binds to wl_fullscreen_shell multiple times, it may wish
+ to free some of those bindings.
+ </description>
+ </request>
+
+ <enum name="capability">
+ <description summary="capabilities advertised by the compositor">
+ Various capabilities that can be advertised by the compositor. They
+ are advertised one-at-a-time when the wl_fullscreen_shell interface is
+ bound. See the wl_fullscreen_shell.capability event for more details.
+
+ ARBITRARY_MODES:
+ This is a hint to the client that indicates that the compositor is
+ capable of setting practically any mode on its outputs. If this
+ capability is provided, wl_fullscreen_shell.present_surface_for_mode
+ will almost never fail and clients should feel free to set whatever
+ mode they like. If the compositor does not advertise this, it may
+ still support some modes that are not advertised through wl_global.mode
+ but it is less likely.
+
+ CURSOR_PLANE:
+ This is a hint to the client that indicates that the compositor can
+ handle a cursor surface from the client without actually compositing.
+ This may be because of a hardware cursor plane or some other mechanism.
+ If the compositor does not advertise this capability then setting
+ wl_pointer.cursor may degrade performance or be ignored entirely. If
+ CURSOR_PLANE is not advertised, it is recommended that the client draw
+ its own cursor and set wl_pointer.cursor(NULL).
+ </description>
+ <entry name="arbitrary_modes" value="1" summary="compositor is capable of almost any output mode"/>
+ <entry name="cursor_plane" value="2" summary="compositor has a separate cursor plane"/>
+ </enum>
+
+ <event name="capability">
+ <description summary="advertises a capability of the compositor">
+ Advertises a single capability of the compositor.
+
+ When the wl_fullscreen_shell interface is bound, this event is emitted
+ once for each capability advertised. Valid capabilities are given by
+ the wl_fullscreen_shell.capability enum. If clients want to take
+ advantage of any of these capabilities, they should use a
+ wl_display.sync request immediately after binding to ensure that they
+ receive all the capability events.
+ </description>
+ <arg name="capability" type="uint"/>
+ </event>
+
+ <enum name="present_method">
+ <description summary="different method to set the surface fullscreen">
+ Hints to indicate to the compositor how to deal with a conflict
+ between the dimensions of the surface and the dimensions of the
+ output. The compositor is free to ignore this parameter.
+ </description>
+ <entry name="default" value="0" summary="no preference, apply default policy"/>
+ <entry name="center" value="1" summary="center the surface on the output"/>
+ <entry name="zoom" value="2" summary="scale the surface, preserving aspect ratio, to the largest size that will fit on the output" />
+ <entry name="zoom_crop" value="3" summary="scale the surface, preserving aspect ratio, to fully fill the output cropping if needed" />
+ <entry name="stretch" value="4" summary="scale the surface to the size of the output ignoring aspect ratio" />
+ </enum>
+
+ <request name="present_surface">
+ <description summary="present surface for display">
+ Present a surface on the given output.
+
+ If the output is null, the compositor will present the surface on
+ whatever display (or displays) it thinks best. In particular, this
+ may replace any or all surfaces currently presented so it should
+ not be used in combination with placing surfaces on specific
+ outputs.
+
+ The method parameter is a hint to the compositor for how the surface
+ is to be presented. In particular, it tells the compositor how to
+ handle a size mismatch between the presented surface and the
+ output. The compositor is free to ignore this parameter.
+
+ The "zoom", "zoom_crop", and "stretch" methods imply a scaling
+ operation on the surface. This will override any kind of output
+ scaling, so the buffer_scale property of the surface is effectively
+ ignored.
+ </description>
+ <arg name="surface" type="object" interface="wl_surface" allow-null="true"/>
+ <arg name="method" type="uint"/>
+ <arg name="output" type="object" interface="wl_output" allow-null="true"/>
+ </request>
+
+ <request name="present_surface_for_mode">
+ <description summary="present surface for display at a particular mode">
+ Presents a surface on the given output for a particular mode.
+
+ If the current size of the output differs from that of the surface,
+ the compositor will attempt to change the size of the output to
+ match the surface. The result of the mode-switch operation will be
+ returned via the provided wl_fullscreen_shell_mode_feedback object.
+
+ If the current output mode matches the one requested or if the
+ compositor successfully switches the mode to match the surface,
+ then the mode_successful event will be sent and the output will
+ contain the contents of the given surface. If the compositor
+ cannot match the output size to the surface size, the mode_failed
+ will be sent and the output will contain the contents of the
+ previously presented surface (if any). If another surface is
+ presented on the given output before either of these has a chance
+ to happen, the present_cancelled event will be sent.
+
+ Due to race conditions and other issues unknown to the client, no
+ mode-switch operation is guaranteed to succeed. However, if the
+ mode is one advertised by wl_output.mode or if the compositor
+ advertises the ARBITRARY_MODES capability, then the client should
+ expect that the mode-switch operation will usually succeed.
+
+ If the size of the presented surface changes, the resulting output
+ is undefined. The compositor may attempt to change the output mode
+ to compensate. However, there is no guarantee that a suitable mode
+ will be found and the client has no way to be notified of success
+ or failure.
+
+ The framerate parameter specifies the desired framerate for the
+ output in mHz. The compositor is free to ignore this parameter. A
+ value of 0 indicates that the client has no preference.
+
+ If the value of wl_output.scale differs from wl_surface.buffer_scale,
+ then the compositor may choose a mode that matches either the buffer
+ size or the surface size. In either case, the surface will fill the
+ output.
+ </description>
+ <arg name="surface" type="object" interface="wl_surface"/>
+ <arg name="output" type="object" interface="wl_output"/>
+ <arg name="framerate" type="int"/>
+ <arg name="feedback" type="new_id" interface="zwp_fullscreen_shell_mode_feedback_v1"/>
+ </request>
+
+ <enum name="error">
+ <description summary="wl_fullscreen_shell error values">
+ These errors can be emitted in response to wl_fullscreen_shell requests.
+ </description>
+ <entry name="invalid_method" value="0" summary="present_method is not known"/>
+ </enum>
+ </interface>
+
+ <interface name="zwp_fullscreen_shell_mode_feedback_v1" version="1">
+ <event name="mode_successful">
+ <description summary="mode switch succeeded">
+ This event indicates that the attempted mode switch operation was
+ successful. A surface of the size requested in the mode switch
+ will fill the output without scaling.
+
+ Upon receiving this event, the client should destroy the
+ wl_fullscreen_shell_mode_feedback object.
+ </description>
+ </event>
+
+ <event name="mode_failed">
+ <description summary="mode switch failed">
+ This event indicates that the attempted mode switch operation
+ failed. This may be because the requested output mode is not
+ possible or it may mean that the compositor does not want to allow it.
+
+ Upon receiving this event, the client should destroy the
+ wl_fullscreen_shell_mode_feedback object.
+ </description>
+ </event>
+
+ <event name="present_cancelled">
+ <description summary="mode switch cancelled">
+ This event indicates that the attempted mode switch operation was
+ cancelled. Most likely this is because the client requested a
+ second mode switch before the first one completed.
+
+ Upon receiving this event, the client should destroy the
+ wl_fullscreen_shell_mode_feedback object.
+ </description>
+ </event>
+ </interface>
+
+</protocol>
diff --git a/chromium/third_party/wayland-protocols/src/unstable/idle-inhibit/README b/chromium/third_party/wayland-protocols/src/unstable/idle-inhibit/README
new file mode 100644
index 00000000000..396e8716269
--- /dev/null
+++ b/chromium/third_party/wayland-protocols/src/unstable/idle-inhibit/README
@@ -0,0 +1,4 @@
+Screensaver inhibition protocol
+
+Maintainers:
+Bryce Harrington <bryce@osg.samsung.com>
diff --git a/chromium/third_party/wayland-protocols/src/unstable/idle-inhibit/idle-inhibit-unstable-v1.xml b/chromium/third_party/wayland-protocols/src/unstable/idle-inhibit/idle-inhibit-unstable-v1.xml
new file mode 100644
index 00000000000..9c06cdcba6c
--- /dev/null
+++ b/chromium/third_party/wayland-protocols/src/unstable/idle-inhibit/idle-inhibit-unstable-v1.xml
@@ -0,0 +1,83 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<protocol name="idle_inhibit_unstable_v1">
+
+ <copyright>
+ Copyright © 2015 Samsung Electronics Co., Ltd
+
+ Permission is hereby granted, free of charge, to any person obtaining a
+ copy of this software and associated documentation files (the "Software"),
+ to deal in the Software without restriction, including without limitation
+ the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ and/or sell copies of the Software, and to permit persons to whom the
+ Software is furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice (including the next
+ paragraph) shall be included in all copies or substantial portions of the
+ Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ DEALINGS IN THE SOFTWARE.
+ </copyright>
+
+ <interface name="zwp_idle_inhibit_manager_v1" version="1">
+ <description summary="control behavior when display idles">
+ This interface permits inhibiting the idle behavior such as screen
+ blanking, locking, and screensaving. The client binds the idle manager
+ globally, then creates idle-inhibitor objects for each surface.
+
+ Warning! The protocol described in this file is experimental and
+ backward incompatible changes may be made. Backward compatible changes
+ may be added together with the corresponding interface version bump.
+ Backward incompatible changes are done by bumping the version number in
+ the protocol and interface names and resetting the interface version.
+ Once the protocol is to be declared stable, the 'z' prefix and the
+ version number in the protocol and interface names are removed and the
+ interface version number is reset.
+ </description>
+
+ <request name="destroy" type="destructor">
+ <description summary="destroy the idle inhibitor object">
+ Destroy the inhibit manager.
+ </description>
+ </request>
+
+ <request name="create_inhibitor">
+ <description summary="create a new inhibitor object">
+ Create a new inhibitor object associated with the given surface.
+ </description>
+ <arg name="id" type="new_id" interface="zwp_idle_inhibitor_v1"/>
+ <arg name="surface" type="object" interface="wl_surface"
+ summary="the surface that inhibits the idle behavior"/>
+ </request>
+
+ </interface>
+
+ <interface name="zwp_idle_inhibitor_v1" version="1">
+ <description summary="context object for inhibiting idle behavior">
+ An idle inhibitor prevents the output that the associated surface is
+ visible on from being set to a state where it is not visually usable due
+ to lack of user interaction (e.g. blanked, dimmed, locked, set to power
+ save, etc.) Any screensaver processes are also blocked from displaying.
+
+ If the surface is destroyed, unmapped, becomes occluded, loses
+ visibility, or otherwise becomes not visually relevant for the user, the
+ idle inhibitor will not be honored by the compositor; if the surface
+ subsequently regains visibility the inhibitor takes effect once again.
+ Likewise, the inhibitor isn't honored if the system was already idled at
+ the time the inhibitor was established, although if the system later
+ de-idles and re-idles the inhibitor will take effect.
+ </description>
+
+ <request name="destroy" type="destructor">
+ <description summary="destroy the idle inhibitor object">
+ Remove the inhibitor effect from the associated wl_surface.
+ </description>
+ </request>
+
+ </interface>
+</protocol>
diff --git a/chromium/third_party/wayland-protocols/src/unstable/input-method/README b/chromium/third_party/wayland-protocols/src/unstable/input-method/README
new file mode 100644
index 00000000000..c95ba72789b
--- /dev/null
+++ b/chromium/third_party/wayland-protocols/src/unstable/input-method/README
@@ -0,0 +1,4 @@
+Input method protocol
+
+Maintainers:
+Jan Arne Petersen <janarne@gmail.com>
diff --git a/chromium/third_party/wayland-protocols/src/unstable/input-method/input-method-unstable-v1.xml b/chromium/third_party/wayland-protocols/src/unstable/input-method/input-method-unstable-v1.xml
new file mode 100644
index 00000000000..e9d93ba609e
--- /dev/null
+++ b/chromium/third_party/wayland-protocols/src/unstable/input-method/input-method-unstable-v1.xml
@@ -0,0 +1,305 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<protocol name="input_method_unstable_v1">
+
+ <copyright>
+ Copyright © 2012, 2013 Intel Corporation
+
+ Permission is hereby granted, free of charge, to any person obtaining a
+ copy of this software and associated documentation files (the "Software"),
+ to deal in the Software without restriction, including without limitation
+ the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ and/or sell copies of the Software, and to permit persons to whom the
+ Software is furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice (including the next
+ paragraph) shall be included in all copies or substantial portions of the
+ Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ DEALINGS IN THE SOFTWARE.
+ </copyright>
+
+ <interface name="zwp_input_method_context_v1" version="1">
+ <description summary="input method context">
+ Corresponds to a text input on the input method side. An input method context
+ is created on text input activation on the input method side. It allows
+ receiving information about the text input from the application via events.
+ Input method contexts do not keep state after deactivation and should be
+ destroyed after deactivation is handled.
+
+ Text is generally UTF-8 encoded, indices and lengths are in bytes.
+
+ Serials are used to synchronize the state between the text input and
+ an input method. New serials are sent by the text input in the
+ commit_state request and are used by the input method to indicate
+ the known text input state in events like preedit_string, commit_string,
+ and keysym. The text input can then ignore events from the input method
+ which are based on an outdated state (for example after a reset).
+
+ Warning! The protocol described in this file is experimental and
+ backward incompatible changes may be made. Backward compatible changes
+ may be added together with the corresponding interface version bump.
+ Backward incompatible changes are done by bumping the version number in
+ the protocol and interface names and resetting the interface version.
+ Once the protocol is to be declared stable, the 'z' prefix and the
+ version number in the protocol and interface names are removed and the
+ interface version number is reset.
+ </description>
+
+ <request name="destroy" type="destructor"/>
+
+ <request name="commit_string">
+ <description summary="commit string">
+ Send the commit string text for insertion to the application.
+
+ The text to commit could be either just a single character after a key
+ press or the result of some composing (pre-edit). It could be also an
+ empty text when some text should be removed (see
+ delete_surrounding_text) or when the input cursor should be moved (see
+ cursor_position).
+
+ Any previously set composing text will be removed.
+ </description>
+ <arg name="serial" type="uint" summary="serial of the latest known text input state"/>
+ <arg name="text" type="string"/>
+ </request>
+
+ <request name="preedit_string">
+ <description summary="pre-edit string">
+ Send the pre-edit string text to the application text input.
+
+ The commit text can be used to replace the pre-edit text on reset (for
+ example on unfocus).
+
+ Previously sent preedit_style and preedit_cursor requests are also
+ processed by the text_input.
+ </description>
+ <arg name="serial" type="uint" summary="serial of the latest known text input state"/>
+ <arg name="text" type="string"/>
+ <arg name="commit" type="string"/>
+ </request>
+
+ <request name="preedit_styling">
+ <description summary="pre-edit styling">
+ Set the styling information on composing text. The style is applied for
+ length in bytes from index relative to the beginning of
+ the composing text (as byte offset). Multiple styles can
+ be applied to a composing text.
+
+ This request should be sent before sending a preedit_string request.
+ </description>
+ <arg name="index" type="uint"/>
+ <arg name="length" type="uint"/>
+ <arg name="style" type="uint"/>
+ </request>
+
+ <request name="preedit_cursor">
+ <description summary="pre-edit cursor">
+ Set the cursor position inside the composing text (as byte offset)
+ relative to the start of the composing text.
+
+ When index is negative no cursor should be displayed.
+
+ This request should be sent before sending a preedit_string request.
+ </description>
+ <arg name="index" type="int"/>
+ </request>
+
+ <request name="delete_surrounding_text">
+ <description summary="delete text">
+ Remove the surrounding text.
+
+ This request will be handled on the text_input side directly following
+ a commit_string request.
+ </description>
+ <arg name="index" type="int"/>
+ <arg name="length" type="uint"/>
+ </request>
+
+ <request name="cursor_position">
+ <description summary="set cursor to a new position">
+ Set the cursor and anchor to a new position. Index is the new cursor
+ position in bytes (when >= 0 this is relative to the end of the inserted text,
+ otherwise it is relative to the beginning of the inserted text). Anchor is
+ the new anchor position in bytes (when >= 0 this is relative to the end of the
+ inserted text, otherwise it is relative to the beginning of the inserted
+ text). When there should be no selected text, anchor should be the same
+ as index.
+
+ This request will be handled on the text_input side directly following
+ a commit_string request.
+ </description>
+ <arg name="index" type="int"/>
+ <arg name="anchor" type="int"/>
+ </request>
+
+ <request name="modifiers_map">
+ <arg name="map" type="array"/>
+ </request>
+
+ <request name="keysym">
+ <description summary="keysym">
+ Notify when a key event was sent. Key events should not be used for
+ normal text input operations, which should be done with commit_string,
+ delete_surrounding_text, etc. The key event follows the wl_keyboard key
+ event convention. Sym is an XKB keysym, state is a wl_keyboard key_state.
+ </description>
+ <arg name="serial" type="uint" summary="serial of the latest known text input state"/>
+ <arg name="time" type="uint"/>
+ <arg name="sym" type="uint"/>
+ <arg name="state" type="uint"/>
+ <arg name="modifiers" type="uint"/>
+ </request>
+
+ <request name="grab_keyboard">
+ <description summary="grab hardware keyboard">
+ Allow an input method to receive hardware keyboard input and process
+ key events to generate text events (with pre-edit) over the wire. This
+ allows input methods which compose multiple key events for inputting
+ text like it is done for CJK languages.
+ </description>
+ <arg name="keyboard" type="new_id" interface="wl_keyboard"/>
+ </request>
+
+ <request name="key">
+ <description summary="forward key event">
+ Forward a wl_keyboard::key event to the client that was not processed
+ by the input method itself. Should be used when filtering key events
+ with grab_keyboard. The arguments should be the ones from the
+ wl_keyboard::key event.
+
+ For generating custom key events use the keysym request instead.
+ </description>
+ <arg name="serial" type="uint" summary="serial from wl_keyboard::key"/>
+ <arg name="time" type="uint" summary="time from wl_keyboard::key"/>
+ <arg name="key" type="uint" summary="key from wl_keyboard::key"/>
+ <arg name="state" type="uint" summary="state from wl_keyboard::key"/>
+ </request>
+
+ <request name="modifiers">
+ <description summary="forward modifiers event">
+ Forward a wl_keyboard::modifiers event to the client that was not
+ processed by the input method itself. Should be used when filtering
+ key events with grab_keyboard. The arguments should be the ones
+ from the wl_keyboard::modifiers event.
+ </description>
+ <arg name="serial" type="uint" summary="serial from wl_keyboard::modifiers"/>
+ <arg name="mods_depressed" type="uint" summary="mods_depressed from wl_keyboard::modifiers"/>
+ <arg name="mods_latched" type="uint" summary="mods_latched from wl_keyboard::modifiers"/>
+ <arg name="mods_locked" type="uint" summary="mods_locked from wl_keyboard::modifiers"/>
+ <arg name="group" type="uint" summary="group from wl_keyboard::modifiers"/>
+ </request>
+
+ <request name="language">
+ <arg name="serial" type="uint" summary="serial of the latest known text input state"/>
+ <arg name="language" type="string"/>
+ </request>
+
+ <request name="text_direction">
+ <arg name="serial" type="uint" summary="serial of the latest known text input state"/>
+ <arg name="direction" type="uint"/>
+ </request>
+
+ <event name="surrounding_text">
+ <description summary="surrounding text event">
+ The plain surrounding text around the input position. Cursor is the
+ position in bytes within the surrounding text relative to the beginning
+ of the text. Anchor is the position in bytes of the selection anchor
+ within the surrounding text relative to the beginning of the text. If
+ there is no selected text then anchor is the same as cursor.
+ </description>
+ <arg name="text" type="string"/>
+ <arg name="cursor" type="uint"/>
+ <arg name="anchor" type="uint"/>
+ </event>
+
+ <event name="reset">
+ </event>
+
+ <event name="content_type">
+ <arg name="hint" type="uint"/>
+ <arg name="purpose" type="uint"/>
+ </event>
+
+ <event name="invoke_action">
+ <arg name="button" type="uint"/>
+ <arg name="index" type="uint"/>
+ </event>
+
+ <event name="commit_state">
+ <arg name="serial" type="uint" summary="serial of text input state"/>
+ </event>
+
+ <event name="preferred_language">
+ <arg name="language" type="string"/>
+ </event>
+ </interface>
+
+ <interface name="zwp_input_method_v1" version="1">
+ <description summary="input method">
+ An input method object is responsible for composing text in response to
+ input from hardware or virtual keyboards. There is one input method
+ object per seat. On activate there is a new input method context object
+ created which allows the input method to communicate with the text input.
+ </description>
+
+ <event name="activate">
+ <description summary="activate event">
+ A text input was activated. Creates an input method context object
+ which allows communication with the text input.
+ </description>
+ <arg name="id" type="new_id" interface="zwp_input_method_context_v1"/>
+ </event>
+
+ <event name="deactivate">
+ <description summary="deactivate event">
+ The text input corresponding to the context argument was deactivated.
+ The input method context should be destroyed after deactivation is
+ handled.
+ </description>
+ <arg name="context" type="object" interface="zwp_input_method_context_v1"/>
+ </event>
+ </interface>
+
+ <interface name="zwp_input_panel_v1" version="1">
+ <description summary="interface for implementing keyboards">
+ Only one client can bind this interface at a time.
+ </description>
+
+ <request name="get_input_panel_surface">
+ <arg name="id" type="new_id" interface="zwp_input_panel_surface_v1"/>
+ <arg name="surface" type="object" interface="wl_surface"/>
+ </request>
+ </interface>
+
+ <interface name="zwp_input_panel_surface_v1" version="1">
+ <enum name="position">
+ <entry name="center_bottom" value="0"/>
+ </enum>
+
+ <request name="set_toplevel">
+ <description summary="set the surface type as a keyboard">
+ Set the input_panel_surface type to keyboard.
+
+ A keyboard surface is only shown when a text input is active.
+ </description>
+ <arg name="output" type="object" interface="wl_output"/>
+ <arg name="position" type="uint"/>
+ </request>
+
+ <request name="set_overlay_panel">
+ <description summary="set the surface type as an overlay panel">
+ Set the input_panel_surface to be an overlay panel.
+
+ This is shown near the input cursor above the application window when
+ a text input is active.
+ </description>
+ </request>
+ </interface>
+
+</protocol>
diff --git a/chromium/third_party/wayland-protocols/src/unstable/linux-dmabuf/README b/chromium/third_party/wayland-protocols/src/unstable/linux-dmabuf/README
new file mode 100644
index 00000000000..cdedf98a5a8
--- /dev/null
+++ b/chromium/third_party/wayland-protocols/src/unstable/linux-dmabuf/README
@@ -0,0 +1,5 @@
+Linux DMA-BUF protocol
+
+Maintainers:
+Pekka Paalanen <pekka.paalanen@collabora.co.uk>
+Daniel Stone <daniels@collabora.com>
diff --git a/chromium/third_party/wayland-protocols/src/unstable/linux-dmabuf/linux-dmabuf-unstable-v1.xml b/chromium/third_party/wayland-protocols/src/unstable/linux-dmabuf/linux-dmabuf-unstable-v1.xml
new file mode 100644
index 00000000000..154afe23e1b
--- /dev/null
+++ b/chromium/third_party/wayland-protocols/src/unstable/linux-dmabuf/linux-dmabuf-unstable-v1.xml
@@ -0,0 +1,348 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<protocol name="linux_dmabuf_unstable_v1">
+
+ <copyright>
+ Copyright © 2014, 2015 Collabora, Ltd.
+
+ Permission is hereby granted, free of charge, to any person obtaining a
+ copy of this software and associated documentation files (the "Software"),
+ to deal in the Software without restriction, including without limitation
+ the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ and/or sell copies of the Software, and to permit persons to whom the
+ Software is furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice (including the next
+ paragraph) shall be included in all copies or substantial portions of the
+ Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ DEALINGS IN THE SOFTWARE.
+ </copyright>
+
+ <interface name="zwp_linux_dmabuf_v1" version="3">
+ <description summary="factory for creating dmabuf-based wl_buffers">
+ Following the interfaces from:
+ https://www.khronos.org/registry/egl/extensions/EXT/EGL_EXT_image_dma_buf_import.txt
+ and the Linux DRM sub-system's AddFb2 ioctl.
+
+ This interface offers ways to create generic dmabuf-based
+ wl_buffers. Immediately after a client binds to this interface,
+ the set of supported formats and format modifiers is sent with
+ 'format' and 'modifier' events.
+
+ The following are required from clients:
+
+ - Clients must ensure that either all data in the dma-buf is
+ coherent for all subsequent read access or that coherency is
+ correctly handled by the underlying kernel-side dma-buf
+ implementation.
+
+ - Don't make any more attachments after sending the buffer to the
+ compositor. Making more attachments later increases the risk of
+ the compositor not being able to use (re-import) an existing
+ dmabuf-based wl_buffer.
+
+ The underlying graphics stack must ensure the following:
+
+ - The dmabuf file descriptors relayed to the server will stay valid
+ for the whole lifetime of the wl_buffer. This means the server may
+ at any time use those fds to import the dmabuf into any kernel
+ sub-system that might accept it.
+
+ To create a wl_buffer from one or more dmabufs, a client creates a
+ zwp_linux_dmabuf_params_v1 object with a zwp_linux_dmabuf_v1.create_params
+ request. All planes required by the intended format are added with
+ the 'add' request. Finally, a 'create' or 'create_immed' request is
+ issued, which has the following outcome depending on the import success.
+
+ The 'create' request,
+ - on success, triggers a 'created' event which provides the final
+ wl_buffer to the client.
+ - on failure, triggers a 'failed' event to convey that the server
+ cannot use the dmabufs received from the client.
+
+ For the 'create_immed' request,
+ - on success, the server immediately imports the added dmabufs to
+ create a wl_buffer. No event is sent from the server in this case.
+ - on failure, the server can choose to either:
+ - terminate the client by raising a fatal error.
+ - mark the wl_buffer as failed, and send a 'failed' event to the
+ client. If the client uses a failed wl_buffer as an argument to any
+ request, the behaviour is compositor implementation-defined.
+
+ Warning! The protocol described in this file is experimental and
+ backward incompatible changes may be made. Backward compatible changes
+ may be added together with the corresponding interface version bump.
+ Backward incompatible changes are done by bumping the version number in
+ the protocol and interface names and resetting the interface version.
+ Once the protocol is to be declared stable, the 'z' prefix and the
+ version number in the protocol and interface names are removed and the
+ interface version number is reset.
+ </description>
+
+ <request name="destroy" type="destructor">
+ <description summary="unbind the factory">
+ Objects created through this interface, especially wl_buffers, will
+ remain valid.
+ </description>
+ </request>
+
+ <request name="create_params">
+ <description summary="create a temporary object for buffer parameters">
+ This temporary object is used to collect multiple dmabuf handles into
+ a single batch to create a wl_buffer. It can only be used once and
+ should be destroyed after a 'created' or 'failed' event has been
+ received.
+ </description>
+ <arg name="params_id" type="new_id" interface="zwp_linux_buffer_params_v1"
+ summary="the new temporary"/>
+ </request>
+
+ <event name="format">
+ <description summary="supported buffer format">
+ This event advertises one buffer format that the server supports.
+ All the supported formats are advertised once when the client
+ binds to this interface. A roundtrip after binding guarantees
+ that the client has received all supported formats.
+
+ For the definition of the format codes, see the
+ zwp_linux_buffer_params_v1::create request.
+
+ Warning: the 'format' event is likely to be deprecated and replaced
+ with the 'modifier' event introduced in zwp_linux_dmabuf_v1
+ version 3, described below. Please refrain from using the information
+ received from this event.
+ </description>
+ <arg name="format" type="uint" summary="DRM_FORMAT code"/>
+ </event>
+
+ <event name="modifier" since="3">
+ <description summary="supported buffer format modifier">
+ This event advertises the formats that the server supports, along with
+ the modifiers supported for each format. All the supported modifiers
+ for all the supported formats are advertised once when the client
+ binds to this interface. A roundtrip after binding guarantees that
+ the client has received all supported format-modifier pairs.
+
+ For the definition of the format and modifier codes, see the
+ zwp_linux_buffer_params_v1::create request.
+ </description>
+ <arg name="format" type="uint" summary="DRM_FORMAT code"/>
+ <arg name="modifier_hi" type="uint"
+ summary="high 32 bits of layout modifier"/>
+ <arg name="modifier_lo" type="uint"
+ summary="low 32 bits of layout modifier"/>
+ </event>
+ </interface>
+
+ <interface name="zwp_linux_buffer_params_v1" version="3">
+ <description summary="parameters for creating a dmabuf-based wl_buffer">
+ This temporary object is a collection of dmabufs and other
+ parameters that together form a single logical buffer. The temporary
+ object may eventually create one wl_buffer unless cancelled by
+ destroying it before requesting 'create'.
+
+ Single-planar formats only require one dmabuf, however
+ multi-planar formats may require more than one dmabuf. For all
+ formats, an 'add' request must be called once per plane (even if the
+ underlying dmabuf fd is identical).
+
+ You must use consecutive plane indices ('plane_idx' argument for 'add')
+ from zero to the number of planes used by the drm_fourcc format code.
+ All planes required by the format must be given exactly once, but can
+ be given in any order. Each plane index can be set only once.
+ </description>
+
+ <enum name="error">
+ <entry name="already_used" value="0"
+ summary="the dmabuf_batch object has already been used to create a wl_buffer"/>
+ <entry name="plane_idx" value="1"
+ summary="plane index out of bounds"/>
+ <entry name="plane_set" value="2"
+ summary="the plane index was already set"/>
+ <entry name="incomplete" value="3"
+ summary="missing or too many planes to create a buffer"/>
+ <entry name="invalid_format" value="4"
+ summary="format not supported"/>
+ <entry name="invalid_dimensions" value="5"
+ summary="invalid width or height"/>
+ <entry name="out_of_bounds" value="6"
+ summary="offset + stride * height goes out of dmabuf bounds"/>
+ <entry name="invalid_wl_buffer" value="7"
+ summary="invalid wl_buffer resulted from importing dmabufs via
+ the create_immed request on given buffer_params"/>
+ </enum>
+
+ <request name="destroy" type="destructor">
+ <description summary="delete this object, used or not">
+ Cleans up the temporary data sent to the server for dmabuf-based
+ wl_buffer creation.
+ </description>
+ </request>
+
+ <request name="add">
+ <description summary="add a dmabuf to the temporary set">
+ This request adds one dmabuf to the set in this
+ zwp_linux_buffer_params_v1.
+
+ The 64-bit unsigned value combined from modifier_hi and modifier_lo
+ is the dmabuf layout modifier. DRM AddFB2 ioctl calls this the
+ fb modifier, which is defined in drm_mode.h of Linux UAPI.
+ This is an opaque token. Drivers use this token to express tiling,
+ compression, etc. driver-specific modifications to the base format
+ defined by the DRM fourcc code.
+
+ This request raises the PLANE_IDX error if plane_idx is too large.
+ The error PLANE_SET is raised if attempting to set a plane that
+ was already set.
+ </description>
+ <arg name="fd" type="fd" summary="dmabuf fd"/>
+ <arg name="plane_idx" type="uint" summary="plane index"/>
+ <arg name="offset" type="uint" summary="offset in bytes"/>
+ <arg name="stride" type="uint" summary="stride in bytes"/>
+ <arg name="modifier_hi" type="uint"
+ summary="high 32 bits of layout modifier"/>
+ <arg name="modifier_lo" type="uint"
+ summary="low 32 bits of layout modifier"/>
+ </request>
+
+ <enum name="flags">
+ <entry name="y_invert" value="1" summary="contents are y-inverted"/>
+ <entry name="interlaced" value="2" summary="content is interlaced"/>
+ <entry name="bottom_first" value="4" summary="bottom field first"/>
+ </enum>
+
+ <request name="create">
+ <description summary="create a wl_buffer from the given dmabufs">
+ This asks for creation of a wl_buffer from the added dmabuf
+ buffers. The wl_buffer is not created immediately but returned via
+ the 'created' event if the dmabuf sharing succeeds. The sharing
+ may fail at runtime for reasons a client cannot predict, in
+ which case the 'failed' event is triggered.
+
+ The 'format' argument is a DRM_FORMAT code, as defined by the
+ libdrm's drm_fourcc.h. The Linux kernel's DRM sub-system is the
+ authoritative source on how the format codes should work.
+
+ The 'flags' is a bitfield of the flags defined in enum "flags".
+ 'y_invert' means the that the image needs to be y-flipped.
+
+ Flag 'interlaced' means that the frame in the buffer is not
+ progressive as usual, but interlaced. An interlaced buffer as
+ supported here must always contain both top and bottom fields.
+ The top field always begins on the first pixel row. The temporal
+ ordering between the two fields is top field first, unless
+ 'bottom_first' is specified. It is undefined whether 'bottom_first'
+ is ignored if 'interlaced' is not set.
+
+ This protocol does not convey any information about field rate,
+ duration, or timing, other than the relative ordering between the
+ two fields in one buffer. A compositor may have to estimate the
+ intended field rate from the incoming buffer rate. It is undefined
+ whether the time of receiving wl_surface.commit with a new buffer
+ attached, applying the wl_surface state, wl_surface.frame callback
+ trigger, presentation, or any other point in the compositor cycle
+ is used to measure the frame or field times. There is no support
+ for detecting missed or late frames/fields/buffers either, and
+ there is no support whatsoever for cooperating with interlaced
+ compositor output.
+
+ The composited image quality resulting from the use of interlaced
+ buffers is explicitly undefined. A compositor may use elaborate
+ hardware features or software to deinterlace and create progressive
+ output frames from a sequence of interlaced input buffers, or it
+ may produce substandard image quality. However, compositors that
+ cannot guarantee reasonable image quality in all cases are recommended
+ to just reject all interlaced buffers.
+
+ Any argument errors, including non-positive width or height,
+ mismatch between the number of planes and the format, bad
+ format, bad offset or stride, may be indicated by fatal protocol
+ errors: INCOMPLETE, INVALID_FORMAT, INVALID_DIMENSIONS,
+ OUT_OF_BOUNDS.
+
+ Dmabuf import errors in the server that are not obvious client
+ bugs are returned via the 'failed' event as non-fatal. This
+ allows attempting dmabuf sharing and falling back in the client
+ if it fails.
+
+ This request can be sent only once in the object's lifetime, after
+ which the only legal request is destroy. This object should be
+ destroyed after issuing a 'create' request. Attempting to use this
+ object after issuing 'create' raises ALREADY_USED protocol error.
+
+ It is not mandatory to issue 'create'. If a client wants to
+ cancel the buffer creation, it can just destroy this object.
+ </description>
+ <arg name="width" type="int" summary="base plane width in pixels"/>
+ <arg name="height" type="int" summary="base plane height in pixels"/>
+ <arg name="format" type="uint" summary="DRM_FORMAT code"/>
+ <arg name="flags" type="uint" summary="see enum flags"/>
+ </request>
+
+ <event name="created">
+ <description summary="buffer creation succeeded">
+ This event indicates that the attempted buffer creation was
+ successful. It provides the new wl_buffer referencing the dmabuf(s).
+
+ Upon receiving this event, the client should destroy the
+ zlinux_dmabuf_params object.
+ </description>
+ <arg name="buffer" type="new_id" interface="wl_buffer"
+ summary="the newly created wl_buffer"/>
+ </event>
+
+ <event name="failed">
+ <description summary="buffer creation failed">
+ This event indicates that the attempted buffer creation has
+ failed. It usually means that one of the dmabuf constraints
+ has not been fulfilled.
+
+ Upon receiving this event, the client should destroy the
+ zlinux_buffer_params object.
+ </description>
+ </event>
+
+ <request name="create_immed" since="2">
+ <description summary="immediately create a wl_buffer from the given
+ dmabufs">
+ This asks for immediate creation of a wl_buffer by importing the
+ added dmabufs.
+
+ In case of import success, no event is sent from the server, and the
+ wl_buffer is ready to be used by the client.
+
+ Upon import failure, either of the following may happen, as seen fit
+ by the implementation:
+ - the client is terminated with one of the following fatal protocol
+ errors:
+ - INCOMPLETE, INVALID_FORMAT, INVALID_DIMENSIONS, OUT_OF_BOUNDS,
+ in case of argument errors such as mismatch between the number
+ of planes and the format, bad format, non-positive width or
+ height, or bad offset or stride.
+ - INVALID_WL_BUFFER, in case the cause for failure is unknown or
+ plaform specific.
+ - the server creates an invalid wl_buffer, marks it as failed and
+ sends a 'failed' event to the client. The result of using this
+ invalid wl_buffer as an argument in any request by the client is
+ defined by the compositor implementation.
+
+ This takes the same arguments as a 'create' request, and obeys the
+ same restrictions.
+ </description>
+ <arg name="buffer_id" type="new_id" interface="wl_buffer"
+ summary="id for the newly created wl_buffer"/>
+ <arg name="width" type="int" summary="base plane width in pixels"/>
+ <arg name="height" type="int" summary="base plane height in pixels"/>
+ <arg name="format" type="uint" summary="DRM_FORMAT code"/>
+ <arg name="flags" type="uint" summary="see enum flags"/>
+ </request>
+
+ </interface>
+
+</protocol>
diff --git a/chromium/third_party/wayland-protocols/src/unstable/pointer-constraints/README b/chromium/third_party/wayland-protocols/src/unstable/pointer-constraints/README
new file mode 100644
index 00000000000..8a242f8d7e5
--- /dev/null
+++ b/chromium/third_party/wayland-protocols/src/unstable/pointer-constraints/README
@@ -0,0 +1,4 @@
+Pointer constraints protocol
+
+Maintainers:
+Jonas Ã…dahl <jadahl@gmail.com>
diff --git a/chromium/third_party/wayland-protocols/src/unstable/pointer-constraints/pointer-constraints-unstable-v1.xml b/chromium/third_party/wayland-protocols/src/unstable/pointer-constraints/pointer-constraints-unstable-v1.xml
new file mode 100644
index 00000000000..4e67a13c981
--- /dev/null
+++ b/chromium/third_party/wayland-protocols/src/unstable/pointer-constraints/pointer-constraints-unstable-v1.xml
@@ -0,0 +1,339 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<protocol name="pointer_constraints_unstable_v1">
+
+ <copyright>
+ Copyright © 2014 Jonas Ådahl
+ Copyright © 2015 Red Hat Inc.
+
+ Permission is hereby granted, free of charge, to any person obtaining a
+ copy of this software and associated documentation files (the "Software"),
+ to deal in the Software without restriction, including without limitation
+ the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ and/or sell copies of the Software, and to permit persons to whom the
+ Software is furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice (including the next
+ paragraph) shall be included in all copies or substantial portions of the
+ Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ DEALINGS IN THE SOFTWARE.
+ </copyright>
+
+ <description summary="protocol for constraining pointer motions">
+ This protocol specifies a set of interfaces used for adding constraints to
+ the motion of a pointer. Possible constraints include confining pointer
+ motions to a given region, or locking it to its current position.
+
+ In order to constrain the pointer, a client must first bind the global
+ interface "wp_pointer_constraints" which, if a compositor supports pointer
+ constraints, is exposed by the registry. Using the bound global object, the
+ client uses the request that corresponds to the type of constraint it wants
+ to make. See wp_pointer_constraints for more details.
+
+ Warning! The protocol described in this file is experimental and backward
+ incompatible changes may be made. Backward compatible changes may be added
+ together with the corresponding interface version bump. Backward
+ incompatible changes are done by bumping the version number in the protocol
+ and interface names and resetting the interface version. Once the protocol
+ is to be declared stable, the 'z' prefix and the version number in the
+ protocol and interface names are removed and the interface version number is
+ reset.
+ </description>
+
+ <interface name="zwp_pointer_constraints_v1" version="1">
+ <description summary="constrain the movement of a pointer">
+ The global interface exposing pointer constraining functionality. It
+ exposes two requests: lock_pointer for locking the pointer to its
+ position, and confine_pointer for locking the pointer to a region.
+
+ The lock_pointer and confine_pointer requests create the objects
+ wp_locked_pointer and wp_confined_pointer respectively, and the client can
+ use these objects to interact with the lock.
+
+ For any surface, only one lock or confinement may be active across all
+ wl_pointer objects of the same seat. If a lock or confinement is requested
+ when another lock or confinement is active or requested on the same surface
+ and with any of the wl_pointer objects of the same seat, an
+ 'already_constrained' error will be raised.
+ </description>
+
+ <enum name="error">
+ <description summary="wp_pointer_constraints error values">
+ These errors can be emitted in response to wp_pointer_constraints
+ requests.
+ </description>
+ <entry name="already_constrained" value="1"
+ summary="pointer constraint already requested on that surface"/>
+ </enum>
+
+ <enum name="lifetime">
+ <description summary="constraint lifetime">
+ These values represent different lifetime semantics. They are passed
+ as arguments to the factory requests to specify how the constraint
+ lifetimes should be managed.
+ </description>
+ <entry name="oneshot" value="1">
+ <description summary="the pointer constraint is defunct once deactivated">
+ A oneshot pointer constraint will never reactivate once it has been
+ deactivated. See the corresponding deactivation event
+ (wp_locked_pointer.unlocked and wp_confined_pointer.unconfined) for
+ details.
+ </description>
+ </entry>
+ <entry name="persistent" value="2">
+ <description summary="the pointer constraint may reactivate">
+ A persistent pointer constraint may again reactivate once it has
+ been deactivated. See the corresponding deactivation event
+ (wp_locked_pointer.unlocked and wp_confined_pointer.unconfined) for
+ details.
+ </description>
+ </entry>
+ </enum>
+
+ <request name="destroy" type="destructor">
+ <description summary="destroy the pointer constraints manager object">
+ Used by the client to notify the server that it will no longer use this
+ pointer constraints object.
+ </description>
+ </request>
+
+ <request name="lock_pointer">
+ <description summary="lock pointer to a position">
+ The lock_pointer request lets the client request to disable movements of
+ the virtual pointer (i.e. the cursor), effectively locking the pointer
+ to a position. This request may not take effect immediately; in the
+ future, when the compositor deems implementation-specific constraints
+ are satisfied, the pointer lock will be activated and the compositor
+ sends a locked event.
+
+ The protocol provides no guarantee that the constraints are ever
+ satisfied, and does not require the compositor to send an error if the
+ constraints cannot ever be satisfied. It is thus possible to request a
+ lock that will never activate.
+
+ There may not be another pointer constraint of any kind requested or
+ active on the surface for any of the wl_pointer objects of the seat of
+ the passed pointer when requesting a lock. If there is, an error will be
+ raised. See general pointer lock documentation for more details.
+
+ The intersection of the region passed with this request and the input
+ region of the surface is used to determine where the pointer must be
+ in order for the lock to activate. It is up to the compositor whether to
+ warp the pointer or require some kind of user interaction for the lock
+ to activate. If the region is null the surface input region is used.
+
+ A surface may receive pointer focus without the lock being activated.
+
+ The request creates a new object wp_locked_pointer which is used to
+ interact with the lock as well as receive updates about its state. See
+ the the description of wp_locked_pointer for further information.
+
+ Note that while a pointer is locked, the wl_pointer objects of the
+ corresponding seat will not emit any wl_pointer.motion events, but
+ relative motion events will still be emitted via wp_relative_pointer
+ objects of the same seat. wl_pointer.axis and wl_pointer.button events
+ are unaffected.
+ </description>
+ <arg name="id" type="new_id" interface="zwp_locked_pointer_v1"/>
+ <arg name="surface" type="object" interface="wl_surface"
+ summary="surface to lock pointer to"/>
+ <arg name="pointer" type="object" interface="wl_pointer"
+ summary="the pointer that should be locked"/>
+ <arg name="region" type="object" interface="wl_region" allow-null="true"
+ summary="region of surface"/>
+ <arg name="lifetime" type="uint" summary="lock lifetime"/>
+ </request>
+
+ <request name="confine_pointer">
+ <description summary="confine pointer to a region">
+ The confine_pointer request lets the client request to confine the
+ pointer cursor to a given region. This request may not take effect
+ immediately; in the future, when the compositor deems implementation-
+ specific constraints are satisfied, the pointer confinement will be
+ activated and the compositor sends a confined event.
+
+ The intersection of the region passed with this request and the input
+ region of the surface is used to determine where the pointer must be
+ in order for the confinement to activate. It is up to the compositor
+ whether to warp the pointer or require some kind of user interaction for
+ the confinement to activate. If the region is null the surface input
+ region is used.
+
+ The request will create a new object wp_confined_pointer which is used
+ to interact with the confinement as well as receive updates about its
+ state. See the the description of wp_confined_pointer for further
+ information.
+ </description>
+ <arg name="id" type="new_id" interface="zwp_confined_pointer_v1"/>
+ <arg name="surface" type="object" interface="wl_surface"
+ summary="surface to lock pointer to"/>
+ <arg name="pointer" type="object" interface="wl_pointer"
+ summary="the pointer that should be confined"/>
+ <arg name="region" type="object" interface="wl_region" allow-null="true"
+ summary="region of surface"/>
+ <arg name="lifetime" type="uint" summary="confinement lifetime"/>
+ </request>
+ </interface>
+
+ <interface name="zwp_locked_pointer_v1" version="1">
+ <description summary="receive relative pointer motion events">
+ The wp_locked_pointer interface represents a locked pointer state.
+
+ While the lock of this object is active, the wl_pointer objects of the
+ associated seat will not emit any wl_pointer.motion events.
+
+ This object will send the event 'locked' when the lock is activated.
+ Whenever the lock is activated, it is guaranteed that the locked surface
+ will already have received pointer focus and that the pointer will be
+ within the region passed to the request creating this object.
+
+ To unlock the pointer, send the destroy request. This will also destroy
+ the wp_locked_pointer object.
+
+ If the compositor decides to unlock the pointer the unlocked event is
+ sent. See wp_locked_pointer.unlock for details.
+
+ When unlocking, the compositor may warp the cursor position to the set
+ cursor position hint. If it does, it will not result in any relative
+ motion events emitted via wp_relative_pointer.
+
+ If the surface the lock was requested on is destroyed and the lock is not
+ yet activated, the wp_locked_pointer object is now defunct and must be
+ destroyed.
+ </description>
+
+ <request name="destroy" type="destructor">
+ <description summary="destroy the locked pointer object">
+ Destroy the locked pointer object. If applicable, the compositor will
+ unlock the pointer.
+ </description>
+ </request>
+
+ <request name="set_cursor_position_hint">
+ <description summary="set the pointer cursor position hint">
+ Set the cursor position hint relative to the top left corner of the
+ surface.
+
+ If the client is drawing its own cursor, it should update the position
+ hint to the position of its own cursor. A compositor may use this
+ information to warp the pointer upon unlock in order to avoid pointer
+ jumps.
+
+ The cursor position hint is double buffered. The new hint will only take
+ effect when the associated surface gets it pending state applied. See
+ wl_surface.commit for details.
+ </description>
+ <arg name="surface_x" type="fixed"
+ summary="surface-local x coordinate"/>
+ <arg name="surface_y" type="fixed"
+ summary="surface-local y coordinate"/>
+ </request>
+
+ <request name="set_region">
+ <description summary="set a new lock region">
+ Set a new region used to lock the pointer.
+
+ The new lock region is double-buffered. The new lock region will
+ only take effect when the associated surface gets its pending state
+ applied. See wl_surface.commit for details.
+
+ For details about the lock region, see wp_locked_pointer.
+ </description>
+ <arg name="region" type="object" interface="wl_region" allow-null="true"
+ summary="region of surface"/>
+ </request>
+
+ <event name="locked">
+ <description summary="lock activation event">
+ Notification that the pointer lock of the seat's pointer is activated.
+ </description>
+ </event>
+
+ <event name="unlocked">
+ <description summary="lock deactivation event">
+ Notification that the pointer lock of the seat's pointer is no longer
+ active. If this is a oneshot pointer lock (see
+ wp_pointer_constraints.lifetime) this object is now defunct and should
+ be destroyed. If this is a persistent pointer lock (see
+ wp_pointer_constraints.lifetime) this pointer lock may again
+ reactivate in the future.
+ </description>
+ </event>
+ </interface>
+
+ <interface name="zwp_confined_pointer_v1" version="1">
+ <description summary="confined pointer object">
+ The wp_confined_pointer interface represents a confined pointer state.
+
+ This object will send the event 'confined' when the confinement is
+ activated. Whenever the confinement is activated, it is guaranteed that
+ the surface the pointer is confined to will already have received pointer
+ focus and that the pointer will be within the region passed to the request
+ creating this object. It is up to the compositor to decide whether this
+ requires some user interaction and if the pointer will warp to within the
+ passed region if outside.
+
+ To unconfine the pointer, send the destroy request. This will also destroy
+ the wp_confined_pointer object.
+
+ If the compositor decides to unconfine the pointer the unconfined event is
+ sent. The wp_confined_pointer object is at this point defunct and should
+ be destroyed.
+ </description>
+
+ <request name="destroy" type="destructor">
+ <description summary="destroy the confined pointer object">
+ Destroy the confined pointer object. If applicable, the compositor will
+ unconfine the pointer.
+ </description>
+ </request>
+
+ <request name="set_region">
+ <description summary="set a new confine region">
+ Set a new region used to confine the pointer.
+
+ The new confine region is double-buffered. The new confine region will
+ only take effect when the associated surface gets its pending state
+ applied. See wl_surface.commit for details.
+
+ If the confinement is active when the new confinement region is applied
+ and the pointer ends up outside of newly applied region, the pointer may
+ warped to a position within the new confinement region. If warped, a
+ wl_pointer.motion event will be emitted, but no
+ wp_relative_pointer.relative_motion event.
+
+ The compositor may also, instead of using the new region, unconfine the
+ pointer.
+
+ For details about the confine region, see wp_confined_pointer.
+ </description>
+ <arg name="region" type="object" interface="wl_region" allow-null="true"
+ summary="region of surface"/>
+ </request>
+
+ <event name="confined">
+ <description summary="pointer confined">
+ Notification that the pointer confinement of the seat's pointer is
+ activated.
+ </description>
+ </event>
+
+ <event name="unconfined">
+ <description summary="pointer unconfined">
+ Notification that the pointer confinement of the seat's pointer is no
+ longer active. If this is a oneshot pointer confinement (see
+ wp_pointer_constraints.lifetime) this object is now defunct and should
+ be destroyed. If this is a persistent pointer confinement (see
+ wp_pointer_constraints.lifetime) this pointer confinement may again
+ reactivate in the future.
+ </description>
+ </event>
+ </interface>
+
+</protocol>
diff --git a/chromium/third_party/wayland-protocols/src/unstable/pointer-gestures/README b/chromium/third_party/wayland-protocols/src/unstable/pointer-gestures/README
new file mode 100644
index 00000000000..a419632b0f5
--- /dev/null
+++ b/chromium/third_party/wayland-protocols/src/unstable/pointer-gestures/README
@@ -0,0 +1,4 @@
+Pointer gestures protocol
+
+Maintainers:
+Carlos Garnacho <carlosg@gnome.org>
diff --git a/chromium/third_party/wayland-protocols/src/unstable/pointer-gestures/pointer-gestures-unstable-v1.xml b/chromium/third_party/wayland-protocols/src/unstable/pointer-gestures/pointer-gestures-unstable-v1.xml
new file mode 100644
index 00000000000..5b7132c8dd1
--- /dev/null
+++ b/chromium/third_party/wayland-protocols/src/unstable/pointer-gestures/pointer-gestures-unstable-v1.xml
@@ -0,0 +1,177 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<protocol name="pointer_gestures_unstable_v1">
+
+ <interface name="zwp_pointer_gestures_v1" version="1">
+ <description summary="touchpad gestures">
+ A global interface to provide semantic touchpad gestures for a given
+ pointer.
+
+ Two gestures are currently supported: swipe and zoom/rotate.
+ All gestures follow a three-stage cycle: begin, update, end and
+ are identified by a unique id.
+
+ Warning! The protocol described in this file is experimental and
+ backward incompatible changes may be made. Backward compatible changes
+ may be added together with the corresponding interface version bump.
+ Backward incompatible changes are done by bumping the version number in
+ the protocol and interface names and resetting the interface version.
+ Once the protocol is to be declared stable, the 'z' prefix and the
+ version number in the protocol and interface names are removed and the
+ interface version number is reset.
+ </description>
+
+ <request name="get_swipe_gesture">
+ <description summary="get swipe gesture">
+ Create a swipe gesture object. See the
+ wl_pointer_gesture_swipe interface for details.
+ </description>
+ <arg name="id" type="new_id" interface="zwp_pointer_gesture_swipe_v1"/>
+ <arg name="pointer" type="object" interface="wl_pointer"/>
+ </request>
+
+ <request name="get_pinch_gesture">
+ <description summary="get pinch gesture">
+ Create a pinch gesture object. See the
+ wl_pointer_gesture_pinch interface for details.
+ </description>
+ <arg name="id" type="new_id" interface="zwp_pointer_gesture_pinch_v1"/>
+ <arg name="pointer" type="object" interface="wl_pointer"/>
+ </request>
+ </interface>
+
+ <interface name="zwp_pointer_gesture_swipe_v1" version="1">
+ <description summary="a swipe gesture object">
+ A swipe gesture object notifies a client about a multi-finger swipe
+ gesture detected on an indirect input device such as a touchpad.
+ The gesture is usually initiated by multiple fingers moving in the
+ same direction but once initiated the direction may change.
+ The precise conditions of when such a gesture is detected are
+ implementation-dependent.
+
+ A gesture consists of three stages: begin, update (optional) and end.
+ There cannot be multiple simultaneous pinch or swipe gestures on a
+ same pointer/seat, how compositors prevent these situations is
+ implementation-dependent.
+
+ A gesture may be cancelled by the compositor or the hardware.
+ Clients should not consider performing permanent or irreversible
+ actions until the end of a gesture has been received.
+ </description>
+
+ <request name="destroy" type="destructor">
+ <description summary="destroy the pointer swipe gesture object"/>
+ </request>
+
+ <event name="begin">
+ <description summary="multi-finger swipe begin">
+ This event is sent when a multi-finger swipe gesture is detected
+ on the device.
+ </description>
+ <arg name="serial" type="uint"/>
+ <arg name="time" type="uint" summary="timestamp with millisecond granularity"/>
+ <arg name="surface" type="object" interface="wl_surface"/>
+ <arg name="fingers" type="uint" summary="number of fingers"/>
+ </event>
+
+ <event name="update">
+ <description summary="multi-finger swipe motion">
+ This event is sent when a multi-finger swipe gesture changes the
+ position of the logical center.
+
+ The dx and dy coordinates are relative coordinates of the logical
+ center of the gesture compared to the previous event.
+ </description>
+ <arg name="time" type="uint" summary="timestamp with millisecond granularity"/>
+ <arg name="dx" type="fixed" summary="delta x coordinate in surface coordinate space"/>
+ <arg name="dy" type="fixed" summary="delta y coordinate in surface coordinate space"/>
+ </event>
+
+ <event name="end">
+ <description summary="multi-finger swipe end">
+ This event is sent when a multi-finger swipe gesture ceases to
+ be valid. This may happen when one or more fingers are lifted or
+ the gesture is cancelled.
+
+ When a gesture is cancelled, the client should undo state changes
+ caused by this gesture. What causes a gesture to be cancelled is
+ implementation-dependent.
+ </description>
+ <arg name="serial" type="uint"/>
+ <arg name="time" type="uint" summary="timestamp with millisecond granularity"/>
+ <arg name="cancelled" type="int" summary="1 if the gesture was cancelled, 0 otherwise"/>
+ </event>
+ </interface>
+
+ <interface name="zwp_pointer_gesture_pinch_v1" version="1">
+ <description summary="a pinch gesture object">
+ A pinch gesture object notifies a client about a multi-finger pinch
+ gesture detected on an indirect input device such as a touchpad.
+ The gesture is usually initiated by multiple fingers moving towards
+ each other or away from each other, or by two or more fingers rotating
+ around a logical center of gravity. The precise conditions of when
+ such a gesture is detected are implementation-dependent.
+
+ A gesture consists of three stages: begin, update (optional) and end.
+ There cannot be multiple simultaneous pinch or swipe gestures on a
+ same pointer/seat, how compositors prevent these situations is
+ implementation-dependent.
+
+ A gesture may be cancelled by the compositor or the hardware.
+ Clients should not consider performing permanent or irreversible
+ actions until the end of a gesture has been received.
+ </description>
+
+ <request name="destroy" type="destructor">
+ <description summary="destroy the pinch gesture object"/>
+ </request>
+
+ <event name="begin">
+ <description summary="multi-finger pinch begin">
+ This event is sent when a multi-finger pinch gesture is detected
+ on the device.
+ </description>
+ <arg name="serial" type="uint"/>
+ <arg name="time" type="uint" summary="timestamp with millisecond granularity"/>
+ <arg name="surface" type="object" interface="wl_surface"/>
+ <arg name="fingers" type="uint" summary="number of fingers"/>
+ </event>
+
+ <event name="update">
+ <description summary="multi-finger pinch motion">
+ This event is sent when a multi-finger pinch gesture changes the
+ position of the logical center, the rotation or the relative scale.
+
+ The dx and dy coordinates are relative coordinates in the
+ surface coordinate space of the logical center of the gesture.
+
+ The scale factor is an absolute scale compared to the
+ pointer_gesture_pinch.begin event, e.g. a scale of 2 means the fingers
+ are now twice as far apart as on pointer_gesture_pinch.begin.
+
+ The rotation is the relative angle in degrees clockwise compared to the previous
+ pointer_gesture_pinch.begin or pointer_gesture_pinch.update event.
+ </description>
+ <arg name="time" type="uint" summary="timestamp with millisecond granularity"/>
+ <arg name="dx" type="fixed" summary="delta x coordinate in surface coordinate space"/>
+ <arg name="dy" type="fixed" summary="delta y coordinate in surface coordinate space"/>
+ <arg name="scale" type="fixed" summary="scale relative to the initial finger position"/>
+ <arg name="rotation" type="fixed" summary="angle in degrees cw relative to the previous event"/>
+ </event>
+
+ <event name="end">
+ <description summary="multi-finger pinch end">
+ This event is sent when a multi-finger pinch gesture ceases to
+ be valid. This may happen when one or more fingers are lifted or
+ the gesture is cancelled.
+
+ When a gesture is cancelled, the client should undo state changes
+ caused by this gesture. What causes a gesture to be cancelled is
+ implementation-dependent.
+ </description>
+ <arg name="serial" type="uint"/>
+ <arg name="time" type="uint" summary="timestamp with millisecond granularity"/>
+ <arg name="cancelled" type="int" summary="1 if the gesture was cancelled, 0 otherwise"/>
+ </event>
+ </interface>
+
+</protocol>
diff --git a/chromium/third_party/wayland-protocols/src/unstable/relative-pointer/README b/chromium/third_party/wayland-protocols/src/unstable/relative-pointer/README
new file mode 100644
index 00000000000..64c42a126e7
--- /dev/null
+++ b/chromium/third_party/wayland-protocols/src/unstable/relative-pointer/README
@@ -0,0 +1,4 @@
+Relative pointer protocol
+
+Maintainers:
+Jonas Ã…dahl <jadahl@gmail.com>
diff --git a/chromium/third_party/wayland-protocols/src/unstable/relative-pointer/relative-pointer-unstable-v1.xml b/chromium/third_party/wayland-protocols/src/unstable/relative-pointer/relative-pointer-unstable-v1.xml
new file mode 100644
index 00000000000..ca6f81d12ac
--- /dev/null
+++ b/chromium/third_party/wayland-protocols/src/unstable/relative-pointer/relative-pointer-unstable-v1.xml
@@ -0,0 +1,136 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<protocol name="relative_pointer_unstable_v1">
+
+ <copyright>
+ Copyright © 2014 Jonas Ådahl
+ Copyright © 2015 Red Hat Inc.
+
+ Permission is hereby granted, free of charge, to any person obtaining a
+ copy of this software and associated documentation files (the "Software"),
+ to deal in the Software without restriction, including without limitation
+ the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ and/or sell copies of the Software, and to permit persons to whom the
+ Software is furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice (including the next
+ paragraph) shall be included in all copies or substantial portions of the
+ Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ DEALINGS IN THE SOFTWARE.
+ </copyright>
+
+ <description summary="protocol for relative pointer motion events">
+ This protocol specifies a set of interfaces used for making clients able to
+ receive relative pointer events not obstructed by barriers (such as the
+ monitor edge or other pointer barriers).
+
+ To start receiving relative pointer events, a client must first bind the
+ global interface "wp_relative_pointer_manager" which, if a compositor
+ supports relative pointer motion events, is exposed by the registry. After
+ having created the relative pointer manager proxy object, the client uses
+ it to create the actual relative pointer object using the
+ "get_relative_pointer" request given a wl_pointer. The relative pointer
+ motion events will then, when applicable, be transmitted via the proxy of
+ the newly created relative pointer object. See the documentation of the
+ relative pointer interface for more details.
+
+ Warning! The protocol described in this file is experimental and backward
+ incompatible changes may be made. Backward compatible changes may be added
+ together with the corresponding interface version bump. Backward
+ incompatible changes are done by bumping the version number in the protocol
+ and interface names and resetting the interface version. Once the protocol
+ is to be declared stable, the 'z' prefix and the version number in the
+ protocol and interface names are removed and the interface version number is
+ reset.
+ </description>
+
+ <interface name="zwp_relative_pointer_manager_v1" version="1">
+ <description summary="get relative pointer objects">
+ A global interface used for getting the relative pointer object for a
+ given pointer.
+ </description>
+
+ <request name="destroy" type="destructor">
+ <description summary="destroy the relative pointer manager object">
+ Used by the client to notify the server that it will no longer use this
+ relative pointer manager object.
+ </description>
+ </request>
+
+ <request name="get_relative_pointer">
+ <description summary="get a relative pointer object">
+ Create a relative pointer interface given a wl_pointer object. See the
+ wp_relative_pointer interface for more details.
+ </description>
+ <arg name="id" type="new_id" interface="zwp_relative_pointer_v1"/>
+ <arg name="pointer" type="object" interface="wl_pointer"/>
+ </request>
+ </interface>
+
+ <interface name="zwp_relative_pointer_v1" version="1">
+ <description summary="relative pointer object">
+ A wp_relative_pointer object is an extension to the wl_pointer interface
+ used for emitting relative pointer events. It shares the same focus as
+ wl_pointer objects of the same seat and will only emit events when it has
+ focus.
+ </description>
+
+ <request name="destroy" type="destructor">
+ <description summary="release the relative pointer object"/>
+ </request>
+
+ <event name="relative_motion">
+ <description summary="relative pointer motion">
+ Relative x/y pointer motion from the pointer of the seat associated with
+ this object.
+
+ A relative motion is in the same dimension as regular wl_pointer motion
+ events, except they do not represent an absolute position. For example,
+ moving a pointer from (x, y) to (x', y') would have the equivalent
+ relative motion (x' - x, y' - y). If a pointer motion caused the
+ absolute pointer position to be clipped by for example the edge of the
+ monitor, the relative motion is unaffected by the clipping and will
+ represent the unclipped motion.
+
+ This event also contains non-accelerated motion deltas. The
+ non-accelerated delta is, when applicable, the regular pointer motion
+ delta as it was before having applied motion acceleration and other
+ transformations such as normalization.
+
+ Note that the non-accelerated delta does not represent 'raw' events as
+ they were read from some device. Pointer motion acceleration is device-
+ and configuration-specific and non-accelerated deltas and accelerated
+ deltas may have the same value on some devices.
+
+ Relative motions are not coupled to wl_pointer.motion events, and can be
+ sent in combination with such events, but also independently. There may
+ also be scenarios where wl_pointer.motion is sent, but there is no
+ relative motion. The order of an absolute and relative motion event
+ originating from the same physical motion is not guaranteed.
+
+ If the client needs button events or focus state, it can receive them
+ from a wl_pointer object of the same seat that the wp_relative_pointer
+ object is associated with.
+ </description>
+ <arg name="utime_hi" type="uint"
+ summary="high 32 bits of a 64 bit timestamp with microsecond granularity"/>
+ <arg name="utime_lo" type="uint"
+ summary="low 32 bits of a 64 bit timestamp with microsecond granularity"/>
+ <arg name="dx" type="fixed"
+ summary="the x component of the motion vector"/>
+ <arg name="dy" type="fixed"
+ summary="the y component of the motion vector"/>
+ <arg name="dx_unaccel" type="fixed"
+ summary="the x component of the unaccelerated motion vector"/>
+ <arg name="dy_unaccel" type="fixed"
+ summary="the y component of the unaccelerated motion vector"/>
+ </event>
+ </interface>
+
+</protocol>
diff --git a/chromium/third_party/wayland-protocols/src/unstable/tablet/README b/chromium/third_party/wayland-protocols/src/unstable/tablet/README
new file mode 100644
index 00000000000..7ba8e77a13a
--- /dev/null
+++ b/chromium/third_party/wayland-protocols/src/unstable/tablet/README
@@ -0,0 +1,4 @@
+Tablet protocol
+
+Maintainers:
+Peter Hutterer <peter.hutterer@who-t.net>
diff --git a/chromium/third_party/wayland-protocols/src/unstable/tablet/tablet-unstable-v1.xml b/chromium/third_party/wayland-protocols/src/unstable/tablet/tablet-unstable-v1.xml
new file mode 100644
index 00000000000..6db9c05a415
--- /dev/null
+++ b/chromium/third_party/wayland-protocols/src/unstable/tablet/tablet-unstable-v1.xml
@@ -0,0 +1,640 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<protocol name="tablet_unstable_v1">
+
+ <copyright>
+ Copyright 2014 © Stephen "Lyude" Chandler Paul
+ Copyright 2015-2016 © Red Hat, Inc.
+
+ Permission is hereby granted, free of charge, to any person
+ obtaining a copy of this software and associated documentation files
+ (the "Software"), to deal in the Software without restriction,
+ including without limitation the rights to use, copy, modify, merge,
+ publish, distribute, sublicense, and/or sell copies of the Software,
+ and to permit persons to whom the Software is furnished to do so,
+ subject to the following conditions:
+
+ The above copyright notice and this permission notice (including the
+ next paragraph) shall be included in all copies or substantial
+ portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ SOFTWARE.
+ </copyright>
+
+ <description summary="Wayland protocol for graphics tablets">
+ This description provides a high-level overview of the interplay between
+ the interfaces defined this protocol. For details, see the protocol
+ specification.
+
+ More than one tablet may exist, and device-specifics matter. Tablets are
+ not represented by a single virtual device like wl_pointer. A client
+ binds to the tablet manager object which is just a proxy object. From
+ that, the client requests wp_tablet_manager.get_tablet_seat(wl_seat)
+ and that returns the actual interface that has all the tablets. With
+ this indirection, we can avoid merging wp_tablet into the actual Wayland
+ protocol, a long-term benefit.
+
+ The wp_tablet_seat sends a "tablet added" event for each tablet
+ connected. That event is followed by descriptive events about the
+ hardware; currently that includes events for name, vid/pid and
+ a wp_tablet.path event that describes a local path. This path can be
+ used to uniquely identify a tablet or get more information through
+ libwacom. Emulated or nested tablets can skip any of those, e.g. a
+ virtual tablet may not have a vid/pid. The sequence of descriptive
+ events is terminated by a wp_tablet.done event to signal that a client
+ may now finalize any initialization for that tablet.
+
+ Events from tablets require a tool in proximity. Tools are also managed
+ by the tablet seat; a "tool added" event is sent whenever a tool is new
+ to the compositor. That event is followed by a number of descriptive
+ events about the hardware; currently that includes capabilities,
+ hardware id and serial number, and tool type. Similar to the tablet
+ interface, a wp_tablet_tool.done event is sent to terminate that initial
+ sequence.
+
+ Any event from a tool happens on the wp_tablet_tool interface. When the
+ tool gets into proximity of the tablet, a proximity_in event is sent on
+ the wp_tablet_tool interface, listing the tablet and the surface. That
+ event is followed by a motion event with the coordinates. After that,
+ it's the usual motion, axis, button, etc. events. The protocol's
+ serialisation means events are grouped by wp_tablet_tool.frame events.
+
+ Two special events (that don't exist in X) are down and up. They signal
+ "tip touching the surface". For tablets without real proximity
+ detection, the sequence is: proximity_in, motion, down, frame.
+
+ When the tool leaves proximity, a proximity_out event is sent. If any
+ button is still down, a button release event is sent before this
+ proximity event. These button events are sent in the same frame as the
+ proximity event to signal to the client that the buttons were held when
+ the tool left proximity.
+
+ If the tool moves out of the surface but stays in proximity (i.e.
+ between windows), compositor-specific grab policies apply. This usually
+ means that the proximity-out is delayed until all buttons are released.
+
+ Moving a tool physically from one tablet to the other has no real effect
+ on the protocol, since we already have the tool object from the "tool
+ added" event. All the information is already there and the proximity
+ events on both tablets are all a client needs to reconstruct what
+ happened.
+
+ Some extra axes are normalized, i.e. the client knows the range as
+ specified in the protocol (e.g. [0, 65535]), the granularity however is
+ unknown. The current normalized axes are pressure, distance, and slider.
+
+ Other extra axes are in physical units as specified in the protocol.
+ The current extra axes with physical units are tilt, rotation and
+ wheel rotation.
+
+ Since tablets work independently of the pointer controlled by the mouse,
+ the focus handling is independent too and controlled by proximity.
+ The wp_tablet_tool.set_cursor request sets a tool-specific cursor.
+ This cursor surface may be the same as the mouse cursor, and it may be
+ the same across tools but it is possible to be more fine-grained. For
+ example, a client may set different cursors for the pen and eraser.
+
+ Tools are generally independent of tablets and it is
+ compositor-specific policy when a tool can be removed. Common approaches
+ will likely include some form of removing a tool when all tablets the
+ tool was used on are removed.
+
+ Warning! The protocol described in this file is experimental and
+ backward incompatible changes may be made. Backward compatible changes
+ may be added together with the corresponding interface version bump.
+ Backward incompatible changes are done by bumping the version number in
+ the protocol and interface names and resetting the interface version.
+ Once the protocol is to be declared stable, the 'z' prefix and the
+ version number in the protocol and interface names are removed and the
+ interface version number is reset.
+ </description>
+
+ <interface name="zwp_tablet_manager_v1" version="1">
+ <description summary="controller object for graphic tablet devices">
+ An object that provides access to the graphics tablets available on this
+ system. All tablets are associated with a seat, to get access to the
+ actual tablets, use wp_tablet_manager.get_tablet_seat.
+ </description>
+
+ <request name="get_tablet_seat">
+ <description summary="get the tablet seat">
+ Get the wp_tablet_seat object for the given seat. This object
+ provides access to all graphics tablets in this seat.
+ </description>
+ <arg name="tablet_seat" type="new_id" interface="zwp_tablet_seat_v1"/>
+ <arg name="seat" type="object" interface="wl_seat" summary="The wl_seat object to retrieve the tablets for" />
+ </request>
+
+ <request name="destroy" type="destructor">
+ <description summary="release the memory for the tablet manager object">
+ Destroy the wp_tablet_manager object. Objects created from this
+ object are unaffected and should be destroyed separately.
+ </description>
+ </request>
+ </interface>
+
+ <interface name="zwp_tablet_seat_v1" version="1">
+ <description summary="controller object for graphic tablet devices of a seat">
+ An object that provides access to the graphics tablets available on this
+ seat. After binding to this interface, the compositor sends a set of
+ wp_tablet_seat.tablet_added and wp_tablet_seat.tool_added events.
+ </description>
+
+ <request name="destroy" type="destructor">
+ <description summary="release the memory for the tablet seat object">
+ Destroy the wp_tablet_seat object. Objects created from this
+ object are unaffected and should be destroyed separately.
+ </description>
+ </request>
+
+ <event name="tablet_added">
+ <description summary="new device notification">
+ This event is sent whenever a new tablet becomes available on this
+ seat. This event only provides the object id of the tablet, any
+ static information about the tablet (device name, vid/pid, etc.) is
+ sent through the wp_tablet interface.
+ </description>
+ <arg name="id" type="new_id" interface="zwp_tablet_v1" summary="the newly added graphics tablet"/>
+ </event>
+
+ <event name="tool_added">
+ <description summary="a new tool has been used with a tablet">
+ This event is sent whenever a tool that has not previously been used
+ with a tablet comes into use. This event only provides the object id
+ of the tool; any static information about the tool (capabilities,
+ type, etc.) is sent through the wp_tablet_tool interface.
+ </description>
+ <arg name="id" type="new_id" interface="zwp_tablet_tool_v1" summary="the newly added tablet tool"/>
+ </event>
+ </interface>
+
+ <interface name="zwp_tablet_tool_v1" version="1">
+ <description summary="a physical tablet tool">
+ An object that represents a physical tool that has been, or is
+ currently in use with a tablet in this seat. Each wp_tablet_tool
+ object stays valid until the client destroys it; the compositor
+ reuses the wp_tablet_tool object to indicate that the object's
+ respective physical tool has come into proximity of a tablet again.
+
+ A wp_tablet_tool object's relation to a physical tool depends on the
+ tablet's ability to report serial numbers. If the tablet supports
+ this capability, then the object represents a specific physical tool
+ and can be identified even when used on multiple tablets.
+
+ A tablet tool has a number of static characteristics, e.g. tool type,
+ hardware_serial and capabilities. These capabilities are sent in an
+ event sequence after the wp_tablet_seat.tool_added event before any
+ actual events from this tool. This initial event sequence is
+ terminated by a wp_tablet_tool.done event.
+
+ Tablet tool events are grouped by wp_tablet_tool.frame events.
+ Any events received before a wp_tablet_tool.frame event should be
+ considered part of the same hardware state change.
+ </description>
+
+ <request name="set_cursor">
+ <description summary="set the tablet tool's surface">
+ Sets the surface of the cursor used for this tool on the given
+ tablet. This request only takes effect if the tool is in proximity
+ of one of the requesting client's surfaces or the surface parameter
+ is the current pointer surface. If there was a previous surface set
+ with this request it is replaced. If surface is NULL, the cursor
+ image is hidden.
+
+ The parameters hotspot_x and hotspot_y define the position of the
+ pointer surface relative to the pointer location. Its top-left corner
+ is always at (x, y) - (hotspot_x, hotspot_y), where (x, y) are the
+ coordinates of the pointer location, in surface-local coordinates.
+
+ On surface.attach requests to the pointer surface, hotspot_x and
+ hotspot_y are decremented by the x and y parameters passed to the
+ request. Attach must be confirmed by wl_surface.commit as usual.
+
+ The hotspot can also be updated by passing the currently set pointer
+ surface to this request with new values for hotspot_x and hotspot_y.
+
+ The current and pending input regions of the wl_surface are cleared,
+ and wl_surface.set_input_region is ignored until the wl_surface is no
+ longer used as the cursor. When the use as a cursor ends, the current
+ and pending input regions become undefined, and the wl_surface is
+ unmapped.
+
+ This request gives the surface the role of a cursor. The role
+ assigned by this request is the same as assigned by
+ wl_pointer.set_cursor meaning the same surface can be
+ used both as a wl_pointer cursor and a wp_tablet cursor. If the
+ surface already has another role, it raises a protocol error.
+ The surface may be used on multiple tablets and across multiple
+ seats.
+ </description>
+ <arg name="serial" type="uint" summary="serial of the enter event"/>
+ <arg name="surface" type="object" interface="wl_surface" allow-null="true"/>
+ <arg name="hotspot_x" type="int" summary="surface-local x coordinate"/>
+ <arg name="hotspot_y" type="int" summary="surface-local y coordinate"/>
+ </request>
+
+ <request name="destroy" type="destructor">
+ <description summary="destroy the tool object">
+ This destroys the client's resource for this tool object.
+ </description>
+ </request>
+
+ <enum name="type">
+ <description summary="a physical tool type">
+ Describes the physical type of a tool. The physical type of a tool
+ generally defines its base usage.
+
+ The mouse tool represents a mouse-shaped tool that is not a relative
+ device but bound to the tablet's surface, providing absolute
+ coordinates.
+
+ The lens tool is a mouse-shaped tool with an attached lens to
+ provide precision focus.
+ </description>
+ <entry name="pen" value="0x140" summary="Pen"/>
+ <entry name="eraser" value="0x141" summary="Eraser"/>
+ <entry name="brush" value="0x142" summary="Brush"/>
+ <entry name="pencil" value="0x143" summary="Pencil"/>
+ <entry name="airbrush" value="0x144" summary="Airbrush"/>
+ <entry name="finger" value="0x145" summary="Finger"/>
+ <entry name="mouse" value="0x146" summary="Mouse"/>
+ <entry name="lens" value="0x147" summary="Lens"/>
+ </enum>
+
+ <event name="type">
+ <description summary="tool type">
+ The tool type is the high-level type of the tool and usually decides
+ the interaction expected from this tool.
+
+ This event is sent in the initial burst of events before the
+ wp_tablet_tool.done event.
+ </description>
+ <arg name="tool_type" type="uint" enum="type" summary="the physical tool type"/>
+ </event>
+
+ <event name="hardware_serial">
+ <description summary="unique hardware serial number of the tool">
+ If the physical tool can be identified by a unique 64-bit serial
+ number, this event notifies the client of this serial number.
+
+ If multiple tablets are available in the same seat and the tool is
+ uniquely identifiable by the serial number, that tool may move
+ between tablets.
+
+ Otherwise, if the tool has no serial number and this event is
+ missing, the tool is tied to the tablet it first comes into
+ proximity with. Even if the physical tool is used on multiple
+ tablets, separate wp_tablet_tool objects will be created, one per
+ tablet.
+
+ This event is sent in the initial burst of events before the
+ wp_tablet_tool.done event.
+ </description>
+ <arg name="hardware_serial_hi" type="uint" summary="the unique serial number of the tool, most significant bits"/>
+ <arg name="hardware_serial_lo" type="uint" summary="the unique serial number of the tool, least significant bits"/>
+ </event>
+
+ <event name="hardware_id_wacom">
+ <description summary="hardware id notification in Wacom's format">
+ This event notifies the client of a hardware id available on this tool.
+
+ The hardware id is a device-specific 64-bit id that provides extra
+ information about the tool in use, beyond the wl_tool.type
+ enumeration. The format of the id is specific to tablets made by
+ Wacom Inc. For example, the hardware id of a Wacom Grip
+ Pen (a stylus) is 0x802.
+
+ This event is sent in the initial burst of events before the
+ wp_tablet_tool.done event.
+ </description>
+ <arg name="hardware_id_hi" type="uint" summary="the hardware id, most significant bits"/>
+ <arg name="hardware_id_lo" type="uint" summary="the hardware id, least significant bits"/>
+ </event>
+
+ <enum name="capability">
+ <description summary="capability flags for a tool">
+ Describes extra capabilities on a tablet.
+
+ Any tool must provide x and y values, extra axes are
+ device-specific.
+ </description>
+ <entry name="tilt" value="1" summary="Tilt axes"/>
+ <entry name="pressure" value="2" summary="Pressure axis"/>
+ <entry name="distance" value="3" summary="Distance axis"/>
+ <entry name="rotation" value="4" summary="Z-rotation axis"/>
+ <entry name="slider" value="5" summary="Slider axis"/>
+ <entry name="wheel" value="6" summary="Wheel axis"/>
+ </enum>
+
+ <event name="capability">
+ <description summary="tool capability notification">
+ This event notifies the client of any capabilities of this tool,
+ beyond the main set of x/y axes and tip up/down detection.
+
+ One event is sent for each extra capability available on this tool.
+
+ This event is sent in the initial burst of events before the
+ wp_tablet_tool.done event.
+ </description>
+ <arg name="capability" type="uint" enum="capability" summary="the capability"/>
+ </event>
+
+ <event name="done">
+ <description summary="tool description events sequence complete">
+ This event signals the end of the initial burst of descriptive
+ events. A client may consider the static description of the tool to
+ be complete and finalize initialization of the tool.
+ </description>
+ </event>
+
+ <event name="removed">
+ <description summary="tool removed">
+ This event is sent when the tool is removed from the system and will
+ send no further events. Should the physical tool come back into
+ proximity later, a new wp_tablet_tool object will be created.
+
+ It is compositor-dependent when a tool is removed. A compositor may
+ remove a tool on proximity out, tablet removal or any other reason.
+ A compositor may also keep a tool alive until shutdown.
+
+ If the tool is currently in proximity, a proximity_out event will be
+ sent before the removed event. See wp_tablet_tool.proximity_out for
+ the handling of any buttons logically down.
+
+ When this event is received, the client must wp_tablet_tool.destroy
+ the object.
+ </description>
+ </event>
+
+ <event name="proximity_in">
+ <description summary="proximity in event">
+ Notification that this tool is focused on a certain surface.
+
+ This event can be received when the tool has moved from one surface to
+ another, or when the tool has come back into proximity above the
+ surface.
+
+ If any button is logically down when the tool comes into proximity,
+ the respective button event is sent after the proximity_in event but
+ within the same frame as the proximity_in event.
+ </description>
+ <arg name="serial" type="uint"/>
+ <arg name="tablet" type="object" interface="zwp_tablet_v1" summary="The tablet the tool is in proximity of"/>
+ <arg name="surface" type="object" interface="wl_surface" summary="The current surface the tablet tool is over"/>
+ </event>
+
+ <event name="proximity_out">
+ <description summary="proximity out event">
+ Notification that this tool has either left proximity, or is no
+ longer focused on a certain surface.
+
+ When the tablet tool leaves proximity of the tablet, button release
+ events are sent for each button that was held down at the time of
+ leaving proximity. These events are sent before the proximity_out
+ event but within the same wp_tablet.frame.
+
+ If the tool stays within proximity of the tablet, but the focus
+ changes from one surface to another, a button release event may not
+ be sent until the button is actually released or the tool leaves the
+ proximity of the tablet.
+ </description>
+ </event>
+
+ <event name="down">
+ <description summary="tablet tool is making contact">
+ Sent whenever the tablet tool comes in contact with the surface of the
+ tablet.
+
+ If the tool is already in contact with the tablet when entering the
+ input region, the client owning said region will receive a
+ wp_tablet.proximity_in event, followed by a wp_tablet.down
+ event and a wp_tablet.frame event.
+
+ Note that this event describes logical contact, not physical
+ contact. On some devices, a compositor may not consider a tool in
+ logical contact until a minimum physical pressure threshold is
+ exceeded.
+ </description>
+ <arg name="serial" type="uint"/>
+ </event>
+
+ <event name="up">
+ <description summary="tablet tool is no longer making contact">
+ Sent whenever the tablet tool stops making contact with the surface of
+ the tablet, or when the tablet tool moves out of the input region
+ and the compositor grab (if any) is dismissed.
+
+ If the tablet tool moves out of the input region while in contact
+ with the surface of the tablet and the compositor does not have an
+ ongoing grab on the surface, the client owning said region will
+ receive a wp_tablet.up event, followed by a wp_tablet.proximity_out
+ event and a wp_tablet.frame event. If the compositor has an ongoing
+ grab on this device, this event sequence is sent whenever the grab
+ is dismissed in the future.
+
+ Note that this event describes logical contact, not physical
+ contact. On some devices, a compositor may not consider a tool out
+ of logical contact until physical pressure falls below a specific
+ threshold.
+ </description>
+ </event>
+
+ <event name="motion">
+ <description summary="motion event">
+ Sent whenever a tablet tool moves.
+ </description>
+ <arg name="x" type="fixed" summary="surface-local x coordinate"/>
+ <arg name="y" type="fixed" summary="surface-local y coordinate"/>
+ </event>
+
+ <event name="pressure">
+ <description summary="pressure change event">
+ Sent whenever the pressure axis on a tool changes. The value of this
+ event is normalized to a value between 0 and 65535.
+
+ Note that pressure may be nonzero even when a tool is not in logical
+ contact. See the down and up events for more details.
+ </description>
+ <arg name="pressure" type="uint" summary="The current pressure value"/>
+ </event>
+
+ <event name="distance">
+ <description summary="distance change event">
+ Sent whenever the distance axis on a tool changes. The value of this
+ event is normalized to a value between 0 and 65535.
+
+ Note that distance may be nonzero even when a tool is not in logical
+ contact. See the down and up events for more details.
+ </description>
+ <arg name="distance" type="uint" summary="The current distance value"/>
+ </event>
+
+ <event name="tilt">
+ <description summary="tilt change event">
+ Sent whenever one or both of the tilt axes on a tool change. Each tilt
+ value is in 0.01 of a degree, relative to the z-axis of the tablet.
+ The angle is positive when the top of a tool tilts along the
+ positive x or y axis.
+ </description>
+ <arg name="tilt_x" type="int" summary="The current value of the X tilt axis"/>
+ <arg name="tilt_y" type="int" summary="The current value of the Y tilt axis"/>
+ </event>
+
+ <event name="rotation">
+ <description summary="z-rotation change event">
+ Sent whenever the z-rotation axis on the tool changes. The
+ rotation value is in 0.01 of a degree clockwise from the tool's
+ logical neutral position.
+ </description>
+ <arg name="degrees" type="int" summary="The current rotation of the Z axis"/>
+ </event>
+
+ <event name="slider">
+ <description summary="Slider position change event">
+ Sent whenever the slider position on the tool changes. The
+ value is normalized between -65535 and 65535, with 0 as the logical
+ neutral position of the slider.
+
+ The slider is available on e.g. the Wacom Airbrush tool.
+ </description>
+ <arg name="position" type="int" summary="The current position of slider"/>
+ </event>
+
+ <event name="wheel">
+ <description summary="Wheel delta event">
+ Sent whenever the wheel on the tool emits an event. This event
+ contains two values for the same axis change. The degrees value is
+ in 0.01 of a degree in the same orientation as the
+ wl_pointer.vertical_scroll axis. The clicks value is in discrete
+ logical clicks of the mouse wheel. This value may be zero if the
+ movement of the wheel was less than one logical click.
+
+ Clients should choose either value and avoid mixing degrees and
+ clicks. The compositor may accumulate values smaller than a logical
+ click and emulate click events when a certain threshold is met.
+ Thus, wl_tablet_tool.wheel events with non-zero clicks values may
+ have different degrees values.
+ </description>
+ <arg name="degrees" type="int" summary="The wheel delta in 0.01 of a degree"/>
+ <arg name="clicks" type="int" summary="The wheel delta in discrete clicks"/>
+ </event>
+
+ <enum name="button_state">
+ <description summary="physical button state">
+ Describes the physical state of a button that produced the button event.
+ </description>
+ <entry name="released" value="0" summary="button is not pressed"/>
+ <entry name="pressed" value="1" summary="button is pressed"/>
+ </enum>
+
+ <event name="button">
+ <description summary="button event">
+ Sent whenever a button on the tool is pressed or released.
+
+ If a button is held down when the tool moves in or out of proximity,
+ button events are generated by the compositor. See
+ wp_tablet_tool.proximity_in and wp_tablet_tool.proximity_out for
+ details.
+ </description>
+ <arg name="serial" type="uint"/>
+ <arg name="button" type="uint" summary="The button whose state has changed"/>
+ <arg name="state" type="uint" enum="button_state" summary="Whether the button was pressed or released"/>
+ </event>
+
+ <event name="frame">
+ <description summary="frame event">
+ Marks the end of a series of axis and/or button updates from the
+ tablet. The Wayland protocol requires axis updates to be sent
+ sequentially, however all events within a frame should be considered
+ one hardware event.
+ </description>
+ <arg name="time" type="uint" summary="The time of the event with millisecond granularity"/>
+ </event>
+
+ <enum name="error">
+ <entry name="role" value="0" summary="given wl_surface has another role"/>
+ </enum>
+ </interface>
+
+ <interface name="zwp_tablet_v1" version="1">
+ <description summary="graphics tablet device">
+ The wp_tablet interface represents one graphics tablet device. The
+ tablet interface itself does not generate events; all events are
+ generated by wp_tablet_tool objects when in proximity above a tablet.
+
+ A tablet has a number of static characteristics, e.g. device name and
+ pid/vid. These capabilities are sent in an event sequence after the
+ wp_tablet_seat.tablet_added event. This initial event sequence is
+ terminated by a wp_tablet.done event.
+ </description>
+
+ <request name="destroy" type="destructor">
+ <description summary="destroy the tablet object">
+ This destroys the client's resource for this tablet object.
+ </description>
+ </request>
+
+ <event name="name">
+ <description summary="tablet device name">
+ This event is sent in the initial burst of events before the
+ wp_tablet.done event.
+ </description>
+ <arg name="name" type="string" summary="the device name"/>
+ </event>
+
+ <event name="id">
+ <description summary="tablet device USB vendor/product id">
+ This event is sent in the initial burst of events before the
+ wp_tablet.done event.
+ </description>
+ <arg name="vid" type="uint" summary="USB vendor id"/>
+ <arg name="pid" type="uint" summary="USB product id"/>
+ </event>
+
+ <event name="path">
+ <description summary="path to the device">
+ A system-specific device path that indicates which device is behind
+ this wp_tablet. This information may be used to gather additional
+ information about the device, e.g. through libwacom.
+
+ A device may have more than one device path. If so, multiple
+ wp_tablet.path events are sent. A device may be emulated and not
+ have a device path, and in that case this event will not be sent.
+
+ The format of the path is unspecified, it may be a device node, a
+ sysfs path, or some other identifier. It is up to the client to
+ identify the string provided.
+
+ This event is sent in the initial burst of events before the
+ wp_tablet.done event.
+ </description>
+ <arg name="path" type="string" summary="path to local device"/>
+ </event>
+
+ <event name="done">
+ <description summary="tablet description events sequence complete">
+ This event is sent immediately to signal the end of the initial
+ burst of descriptive events. A client may consider the static
+ description of the tablet to be complete and finalize initialization
+ of the tablet.
+ </description>
+ </event>
+
+ <event name="removed">
+ <description summary="tablet removed event">
+ Sent when the tablet has been removed from the system. When a tablet
+ is removed, some tools may be removed.
+
+ When this event is received, the client must wp_tablet.destroy
+ the object.
+ </description>
+ </event>
+ </interface>
+
+</protocol>
diff --git a/chromium/third_party/wayland-protocols/src/unstable/tablet/tablet-unstable-v2.xml b/chromium/third_party/wayland-protocols/src/unstable/tablet/tablet-unstable-v2.xml
new file mode 100644
index 00000000000..b286d964af8
--- /dev/null
+++ b/chromium/third_party/wayland-protocols/src/unstable/tablet/tablet-unstable-v2.xml
@@ -0,0 +1,1178 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<protocol name="tablet_unstable_v2">
+
+ <copyright>
+ Copyright 2014 © Stephen "Lyude" Chandler Paul
+ Copyright 2015-2016 © Red Hat, Inc.
+
+ Permission is hereby granted, free of charge, to any person
+ obtaining a copy of this software and associated documentation files
+ (the "Software"), to deal in the Software without restriction,
+ including without limitation the rights to use, copy, modify, merge,
+ publish, distribute, sublicense, and/or sell copies of the Software,
+ and to permit persons to whom the Software is furnished to do so,
+ subject to the following conditions:
+
+ The above copyright notice and this permission notice (including the
+ next paragraph) shall be included in all copies or substantial
+ portions of the Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ SOFTWARE.
+ </copyright>
+
+ <description summary="Wayland protocol for graphics tablets">
+ This description provides a high-level overview of the interplay between
+ the interfaces defined this protocol. For details, see the protocol
+ specification.
+
+ More than one tablet may exist, and device-specifics matter. Tablets are
+ not represented by a single virtual device like wl_pointer. A client
+ binds to the tablet manager object which is just a proxy object. From
+ that, the client requests wp_tablet_manager.get_tablet_seat(wl_seat)
+ and that returns the actual interface that has all the tablets. With
+ this indirection, we can avoid merging wp_tablet into the actual Wayland
+ protocol, a long-term benefit.
+
+ The wp_tablet_seat sends a "tablet added" event for each tablet
+ connected. That event is followed by descriptive events about the
+ hardware; currently that includes events for name, vid/pid and
+ a wp_tablet.path event that describes a local path. This path can be
+ used to uniquely identify a tablet or get more information through
+ libwacom. Emulated or nested tablets can skip any of those, e.g. a
+ virtual tablet may not have a vid/pid. The sequence of descriptive
+ events is terminated by a wp_tablet.done event to signal that a client
+ may now finalize any initialization for that tablet.
+
+ Events from tablets require a tool in proximity. Tools are also managed
+ by the tablet seat; a "tool added" event is sent whenever a tool is new
+ to the compositor. That event is followed by a number of descriptive
+ events about the hardware; currently that includes capabilities,
+ hardware id and serial number, and tool type. Similar to the tablet
+ interface, a wp_tablet_tool.done event is sent to terminate that initial
+ sequence.
+
+ Any event from a tool happens on the wp_tablet_tool interface. When the
+ tool gets into proximity of the tablet, a proximity_in event is sent on
+ the wp_tablet_tool interface, listing the tablet and the surface. That
+ event is followed by a motion event with the coordinates. After that,
+ it's the usual motion, axis, button, etc. events. The protocol's
+ serialisation means events are grouped by wp_tablet_tool.frame events.
+
+ Two special events (that don't exist in X) are down and up. They signal
+ "tip touching the surface". For tablets without real proximity
+ detection, the sequence is: proximity_in, motion, down, frame.
+
+ When the tool leaves proximity, a proximity_out event is sent. If any
+ button is still down, a button release event is sent before this
+ proximity event. These button events are sent in the same frame as the
+ proximity event to signal to the client that the buttons were held when
+ the tool left proximity.
+
+ If the tool moves out of the surface but stays in proximity (i.e.
+ between windows), compositor-specific grab policies apply. This usually
+ means that the proximity-out is delayed until all buttons are released.
+
+ Moving a tool physically from one tablet to the other has no real effect
+ on the protocol, since we already have the tool object from the "tool
+ added" event. All the information is already there and the proximity
+ events on both tablets are all a client needs to reconstruct what
+ happened.
+
+ Some extra axes are normalized, i.e. the client knows the range as
+ specified in the protocol (e.g. [0, 65535]), the granularity however is
+ unknown. The current normalized axes are pressure, distance, and slider.
+
+ Other extra axes are in physical units as specified in the protocol.
+ The current extra axes with physical units are tilt, rotation and
+ wheel rotation.
+
+ Since tablets work independently of the pointer controlled by the mouse,
+ the focus handling is independent too and controlled by proximity.
+ The wp_tablet_tool.set_cursor request sets a tool-specific cursor.
+ This cursor surface may be the same as the mouse cursor, and it may be
+ the same across tools but it is possible to be more fine-grained. For
+ example, a client may set different cursors for the pen and eraser.
+
+ Tools are generally independent of tablets and it is
+ compositor-specific policy when a tool can be removed. Common approaches
+ will likely include some form of removing a tool when all tablets the
+ tool was used on are removed.
+
+ Warning! The protocol described in this file is experimental and
+ backward incompatible changes may be made. Backward compatible changes
+ may be added together with the corresponding interface version bump.
+ Backward incompatible changes are done by bumping the version number in
+ the protocol and interface names and resetting the interface version.
+ Once the protocol is to be declared stable, the 'z' prefix and the
+ version number in the protocol and interface names are removed and the
+ interface version number is reset.
+ </description>
+
+ <interface name="zwp_tablet_manager_v2" version="1">
+ <description summary="controller object for graphic tablet devices">
+ An object that provides access to the graphics tablets available on this
+ system. All tablets are associated with a seat, to get access to the
+ actual tablets, use wp_tablet_manager.get_tablet_seat.
+ </description>
+
+ <request name="get_tablet_seat">
+ <description summary="get the tablet seat">
+ Get the wp_tablet_seat object for the given seat. This object
+ provides access to all graphics tablets in this seat.
+ </description>
+ <arg name="tablet_seat" type="new_id" interface="zwp_tablet_seat_v2"/>
+ <arg name="seat" type="object" interface="wl_seat" summary="The wl_seat object to retrieve the tablets for" />
+ </request>
+
+ <request name="destroy" type="destructor">
+ <description summary="release the memory for the tablet manager object">
+ Destroy the wp_tablet_manager object. Objects created from this
+ object are unaffected and should be destroyed separately.
+ </description>
+ </request>
+ </interface>
+
+ <interface name="zwp_tablet_seat_v2" version="1">
+ <description summary="controller object for graphic tablet devices of a seat">
+ An object that provides access to the graphics tablets available on this
+ seat. After binding to this interface, the compositor sends a set of
+ wp_tablet_seat.tablet_added and wp_tablet_seat.tool_added events.
+ </description>
+
+ <request name="destroy" type="destructor">
+ <description summary="release the memory for the tablet seat object">
+ Destroy the wp_tablet_seat object. Objects created from this
+ object are unaffected and should be destroyed separately.
+ </description>
+ </request>
+
+ <event name="tablet_added">
+ <description summary="new device notification">
+ This event is sent whenever a new tablet becomes available on this
+ seat. This event only provides the object id of the tablet, any
+ static information about the tablet (device name, vid/pid, etc.) is
+ sent through the wp_tablet interface.
+ </description>
+ <arg name="id" type="new_id" interface="zwp_tablet_v2" summary="the newly added graphics tablet"/>
+ </event>
+
+ <event name="tool_added">
+ <description summary="a new tool has been used with a tablet">
+ This event is sent whenever a tool that has not previously been used
+ with a tablet comes into use. This event only provides the object id
+ of the tool; any static information about the tool (capabilities,
+ type, etc.) is sent through the wp_tablet_tool interface.
+ </description>
+ <arg name="id" type="new_id" interface="zwp_tablet_tool_v2" summary="the newly added tablet tool"/>
+ </event>
+
+ <event name="pad_added">
+ <description summary="new pad notification">
+ This event is sent whenever a new pad is known to the system. Typically,
+ pads are physically attached to tablets and a pad_added event is
+ sent immediately after the wp_tablet_seat.tablet_added.
+ However, some standalone pad devices logically attach to tablets at
+ runtime, and the client must wait for wp_tablet_pad.enter to know
+ the tablet a pad is attached to.
+
+ This event only provides the object id of the pad. All further
+ features (buttons, strips, rings) are sent through the wp_tablet_pad
+ interface.
+ </description>
+ <arg name="id" type="new_id" interface="zwp_tablet_pad_v2" summary="the newly added pad"/>
+ </event>
+ </interface>
+
+ <interface name="zwp_tablet_tool_v2" version="1">
+ <description summary="a physical tablet tool">
+ An object that represents a physical tool that has been, or is
+ currently in use with a tablet in this seat. Each wp_tablet_tool
+ object stays valid until the client destroys it; the compositor
+ reuses the wp_tablet_tool object to indicate that the object's
+ respective physical tool has come into proximity of a tablet again.
+
+ A wp_tablet_tool object's relation to a physical tool depends on the
+ tablet's ability to report serial numbers. If the tablet supports
+ this capability, then the object represents a specific physical tool
+ and can be identified even when used on multiple tablets.
+
+ A tablet tool has a number of static characteristics, e.g. tool type,
+ hardware_serial and capabilities. These capabilities are sent in an
+ event sequence after the wp_tablet_seat.tool_added event before any
+ actual events from this tool. This initial event sequence is
+ terminated by a wp_tablet_tool.done event.
+
+ Tablet tool events are grouped by wp_tablet_tool.frame events.
+ Any events received before a wp_tablet_tool.frame event should be
+ considered part of the same hardware state change.
+ </description>
+
+ <request name="set_cursor">
+ <description summary="set the tablet tool's surface">
+ Sets the surface of the cursor used for this tool on the given
+ tablet. This request only takes effect if the tool is in proximity
+ of one of the requesting client's surfaces or the surface parameter
+ is the current pointer surface. If there was a previous surface set
+ with this request it is replaced. If surface is NULL, the cursor
+ image is hidden.
+
+ The parameters hotspot_x and hotspot_y define the position of the
+ pointer surface relative to the pointer location. Its top-left corner
+ is always at (x, y) - (hotspot_x, hotspot_y), where (x, y) are the
+ coordinates of the pointer location, in surface-local coordinates.
+
+ On surface.attach requests to the pointer surface, hotspot_x and
+ hotspot_y are decremented by the x and y parameters passed to the
+ request. Attach must be confirmed by wl_surface.commit as usual.
+
+ The hotspot can also be updated by passing the currently set pointer
+ surface to this request with new values for hotspot_x and hotspot_y.
+
+ The current and pending input regions of the wl_surface are cleared,
+ and wl_surface.set_input_region is ignored until the wl_surface is no
+ longer used as the cursor. When the use as a cursor ends, the current
+ and pending input regions become undefined, and the wl_surface is
+ unmapped.
+
+ This request gives the surface the role of a wp_tablet_tool cursor. A
+ surface may only ever be used as the cursor surface for one
+ wp_tablet_tool. If the surface already has another role or has
+ previously been used as cursor surface for a different tool, a
+ protocol error is raised.
+ </description>
+ <arg name="serial" type="uint" summary="serial of the enter event"/>
+ <arg name="surface" type="object" interface="wl_surface" allow-null="true"/>
+ <arg name="hotspot_x" type="int" summary="surface-local x coordinate"/>
+ <arg name="hotspot_y" type="int" summary="surface-local y coordinate"/>
+ </request>
+
+ <request name="destroy" type="destructor">
+ <description summary="destroy the tool object">
+ This destroys the client's resource for this tool object.
+ </description>
+ </request>
+
+ <enum name="type">
+ <description summary="a physical tool type">
+ Describes the physical type of a tool. The physical type of a tool
+ generally defines its base usage.
+
+ The mouse tool represents a mouse-shaped tool that is not a relative
+ device but bound to the tablet's surface, providing absolute
+ coordinates.
+
+ The lens tool is a mouse-shaped tool with an attached lens to
+ provide precision focus.
+ </description>
+ <entry name="pen" value="0x140" summary="Pen"/>
+ <entry name="eraser" value="0x141" summary="Eraser"/>
+ <entry name="brush" value="0x142" summary="Brush"/>
+ <entry name="pencil" value="0x143" summary="Pencil"/>
+ <entry name="airbrush" value="0x144" summary="Airbrush"/>
+ <entry name="finger" value="0x145" summary="Finger"/>
+ <entry name="mouse" value="0x146" summary="Mouse"/>
+ <entry name="lens" value="0x147" summary="Lens"/>
+ </enum>
+
+ <event name="type">
+ <description summary="tool type">
+ The tool type is the high-level type of the tool and usually decides
+ the interaction expected from this tool.
+
+ This event is sent in the initial burst of events before the
+ wp_tablet_tool.done event.
+ </description>
+ <arg name="tool_type" type="uint" enum="type" summary="the physical tool type"/>
+ </event>
+
+ <event name="hardware_serial">
+ <description summary="unique hardware serial number of the tool">
+ If the physical tool can be identified by a unique 64-bit serial
+ number, this event notifies the client of this serial number.
+
+ If multiple tablets are available in the same seat and the tool is
+ uniquely identifiable by the serial number, that tool may move
+ between tablets.
+
+ Otherwise, if the tool has no serial number and this event is
+ missing, the tool is tied to the tablet it first comes into
+ proximity with. Even if the physical tool is used on multiple
+ tablets, separate wp_tablet_tool objects will be created, one per
+ tablet.
+
+ This event is sent in the initial burst of events before the
+ wp_tablet_tool.done event.
+ </description>
+ <arg name="hardware_serial_hi" type="uint" summary="the unique serial number of the tool, most significant bits"/>
+ <arg name="hardware_serial_lo" type="uint" summary="the unique serial number of the tool, least significant bits"/>
+ </event>
+
+ <event name="hardware_id_wacom">
+ <description summary="hardware id notification in Wacom's format">
+ This event notifies the client of a hardware id available on this tool.
+
+ The hardware id is a device-specific 64-bit id that provides extra
+ information about the tool in use, beyond the wl_tool.type
+ enumeration. The format of the id is specific to tablets made by
+ Wacom Inc. For example, the hardware id of a Wacom Grip
+ Pen (a stylus) is 0x802.
+
+ This event is sent in the initial burst of events before the
+ wp_tablet_tool.done event.
+ </description>
+ <arg name="hardware_id_hi" type="uint" summary="the hardware id, most significant bits"/>
+ <arg name="hardware_id_lo" type="uint" summary="the hardware id, least significant bits"/>
+ </event>
+
+ <enum name="capability">
+ <description summary="capability flags for a tool">
+ Describes extra capabilities on a tablet.
+
+ Any tool must provide x and y values, extra axes are
+ device-specific.
+ </description>
+ <entry name="tilt" value="1" summary="Tilt axes"/>
+ <entry name="pressure" value="2" summary="Pressure axis"/>
+ <entry name="distance" value="3" summary="Distance axis"/>
+ <entry name="rotation" value="4" summary="Z-rotation axis"/>
+ <entry name="slider" value="5" summary="Slider axis"/>
+ <entry name="wheel" value="6" summary="Wheel axis"/>
+ </enum>
+
+ <event name="capability">
+ <description summary="tool capability notification">
+ This event notifies the client of any capabilities of this tool,
+ beyond the main set of x/y axes and tip up/down detection.
+
+ One event is sent for each extra capability available on this tool.
+
+ This event is sent in the initial burst of events before the
+ wp_tablet_tool.done event.
+ </description>
+ <arg name="capability" type="uint" enum="capability" summary="the capability"/>
+ </event>
+
+ <event name="done">
+ <description summary="tool description events sequence complete">
+ This event signals the end of the initial burst of descriptive
+ events. A client may consider the static description of the tool to
+ be complete and finalize initialization of the tool.
+ </description>
+ </event>
+
+ <event name="removed">
+ <description summary="tool removed">
+ This event is sent when the tool is removed from the system and will
+ send no further events. Should the physical tool come back into
+ proximity later, a new wp_tablet_tool object will be created.
+
+ It is compositor-dependent when a tool is removed. A compositor may
+ remove a tool on proximity out, tablet removal or any other reason.
+ A compositor may also keep a tool alive until shutdown.
+
+ If the tool is currently in proximity, a proximity_out event will be
+ sent before the removed event. See wp_tablet_tool.proximity_out for
+ the handling of any buttons logically down.
+
+ When this event is received, the client must wp_tablet_tool.destroy
+ the object.
+ </description>
+ </event>
+
+ <event name="proximity_in">
+ <description summary="proximity in event">
+ Notification that this tool is focused on a certain surface.
+
+ This event can be received when the tool has moved from one surface to
+ another, or when the tool has come back into proximity above the
+ surface.
+
+ If any button is logically down when the tool comes into proximity,
+ the respective button event is sent after the proximity_in event but
+ within the same frame as the proximity_in event.
+ </description>
+ <arg name="serial" type="uint"/>
+ <arg name="tablet" type="object" interface="zwp_tablet_v2" summary="The tablet the tool is in proximity of"/>
+ <arg name="surface" type="object" interface="wl_surface" summary="The current surface the tablet tool is over"/>
+ </event>
+
+ <event name="proximity_out">
+ <description summary="proximity out event">
+ Notification that this tool has either left proximity, or is no
+ longer focused on a certain surface.
+
+ When the tablet tool leaves proximity of the tablet, button release
+ events are sent for each button that was held down at the time of
+ leaving proximity. These events are sent before the proximity_out
+ event but within the same wp_tablet.frame.
+
+ If the tool stays within proximity of the tablet, but the focus
+ changes from one surface to another, a button release event may not
+ be sent until the button is actually released or the tool leaves the
+ proximity of the tablet.
+ </description>
+ </event>
+
+ <event name="down">
+ <description summary="tablet tool is making contact">
+ Sent whenever the tablet tool comes in contact with the surface of the
+ tablet.
+
+ If the tool is already in contact with the tablet when entering the
+ input region, the client owning said region will receive a
+ wp_tablet.proximity_in event, followed by a wp_tablet.down
+ event and a wp_tablet.frame event.
+
+ Note that this event describes logical contact, not physical
+ contact. On some devices, a compositor may not consider a tool in
+ logical contact until a minimum physical pressure threshold is
+ exceeded.
+ </description>
+ <arg name="serial" type="uint"/>
+ </event>
+
+ <event name="up">
+ <description summary="tablet tool is no longer making contact">
+ Sent whenever the tablet tool stops making contact with the surface of
+ the tablet, or when the tablet tool moves out of the input region
+ and the compositor grab (if any) is dismissed.
+
+ If the tablet tool moves out of the input region while in contact
+ with the surface of the tablet and the compositor does not have an
+ ongoing grab on the surface, the client owning said region will
+ receive a wp_tablet.up event, followed by a wp_tablet.proximity_out
+ event and a wp_tablet.frame event. If the compositor has an ongoing
+ grab on this device, this event sequence is sent whenever the grab
+ is dismissed in the future.
+
+ Note that this event describes logical contact, not physical
+ contact. On some devices, a compositor may not consider a tool out
+ of logical contact until physical pressure falls below a specific
+ threshold.
+ </description>
+ </event>
+
+ <event name="motion">
+ <description summary="motion event">
+ Sent whenever a tablet tool moves.
+ </description>
+ <arg name="x" type="fixed" summary="surface-local x coordinate"/>
+ <arg name="y" type="fixed" summary="surface-local y coordinate"/>
+ </event>
+
+ <event name="pressure">
+ <description summary="pressure change event">
+ Sent whenever the pressure axis on a tool changes. The value of this
+ event is normalized to a value between 0 and 65535.
+
+ Note that pressure may be nonzero even when a tool is not in logical
+ contact. See the down and up events for more details.
+ </description>
+ <arg name="pressure" type="uint" summary="The current pressure value"/>
+ </event>
+
+ <event name="distance">
+ <description summary="distance change event">
+ Sent whenever the distance axis on a tool changes. The value of this
+ event is normalized to a value between 0 and 65535.
+
+ Note that distance may be nonzero even when a tool is not in logical
+ contact. See the down and up events for more details.
+ </description>
+ <arg name="distance" type="uint" summary="The current distance value"/>
+ </event>
+
+ <event name="tilt">
+ <description summary="tilt change event">
+ Sent whenever one or both of the tilt axes on a tool change. Each tilt
+ value is in degrees, relative to the z-axis of the tablet.
+ The angle is positive when the top of a tool tilts along the
+ positive x or y axis.
+ </description>
+ <arg name="tilt_x" type="fixed" summary="The current value of the X tilt axis"/>
+ <arg name="tilt_y" type="fixed" summary="The current value of the Y tilt axis"/>
+ </event>
+
+ <event name="rotation">
+ <description summary="z-rotation change event">
+ Sent whenever the z-rotation axis on the tool changes. The
+ rotation value is in degrees clockwise from the tool's
+ logical neutral position.
+ </description>
+ <arg name="degrees" type="fixed" summary="The current rotation of the Z axis"/>
+ </event>
+
+ <event name="slider">
+ <description summary="Slider position change event">
+ Sent whenever the slider position on the tool changes. The
+ value is normalized between -65535 and 65535, with 0 as the logical
+ neutral position of the slider.
+
+ The slider is available on e.g. the Wacom Airbrush tool.
+ </description>
+ <arg name="position" type="int" summary="The current position of slider"/>
+ </event>
+
+ <event name="wheel">
+ <description summary="Wheel delta event">
+ Sent whenever the wheel on the tool emits an event. This event
+ contains two values for the same axis change. The degrees value is
+ in the same orientation as the wl_pointer.vertical_scroll axis. The
+ clicks value is in discrete logical clicks of the mouse wheel. This
+ value may be zero if the movement of the wheel was less
+ than one logical click.
+
+ Clients should choose either value and avoid mixing degrees and
+ clicks. The compositor may accumulate values smaller than a logical
+ click and emulate click events when a certain threshold is met.
+ Thus, wl_tablet_tool.wheel events with non-zero clicks values may
+ have different degrees values.
+ </description>
+ <arg name="degrees" type="fixed" summary="The wheel delta in degrees"/>
+ <arg name="clicks" type="int" summary="The wheel delta in discrete clicks"/>
+ </event>
+
+ <enum name="button_state">
+ <description summary="physical button state">
+ Describes the physical state of a button that produced the button event.
+ </description>
+ <entry name="released" value="0" summary="button is not pressed"/>
+ <entry name="pressed" value="1" summary="button is pressed"/>
+ </enum>
+
+ <event name="button">
+ <description summary="button event">
+ Sent whenever a button on the tool is pressed or released.
+
+ If a button is held down when the tool moves in or out of proximity,
+ button events are generated by the compositor. See
+ wp_tablet_tool.proximity_in and wp_tablet_tool.proximity_out for
+ details.
+ </description>
+ <arg name="serial" type="uint"/>
+ <arg name="button" type="uint" summary="The button whose state has changed"/>
+ <arg name="state" type="uint" enum="button_state" summary="Whether the button was pressed or released"/>
+ </event>
+
+ <event name="frame">
+ <description summary="frame event">
+ Marks the end of a series of axis and/or button updates from the
+ tablet. The Wayland protocol requires axis updates to be sent
+ sequentially, however all events within a frame should be considered
+ one hardware event.
+ </description>
+ <arg name="time" type="uint" summary="The time of the event with millisecond granularity"/>
+ </event>
+
+ <enum name="error">
+ <entry name="role" value="0" summary="given wl_surface has another role"/>
+ </enum>
+ </interface>
+
+ <interface name="zwp_tablet_v2" version="1">
+ <description summary="graphics tablet device">
+ The wp_tablet interface represents one graphics tablet device. The
+ tablet interface itself does not generate events; all events are
+ generated by wp_tablet_tool objects when in proximity above a tablet.
+
+ A tablet has a number of static characteristics, e.g. device name and
+ pid/vid. These capabilities are sent in an event sequence after the
+ wp_tablet_seat.tablet_added event. This initial event sequence is
+ terminated by a wp_tablet.done event.
+ </description>
+
+ <request name="destroy" type="destructor">
+ <description summary="destroy the tablet object">
+ This destroys the client's resource for this tablet object.
+ </description>
+ </request>
+
+ <event name="name">
+ <description summary="tablet device name">
+ This event is sent in the initial burst of events before the
+ wp_tablet.done event.
+ </description>
+ <arg name="name" type="string" summary="the device name"/>
+ </event>
+
+ <event name="id">
+ <description summary="tablet device USB vendor/product id">
+ This event is sent in the initial burst of events before the
+ wp_tablet.done event.
+ </description>
+ <arg name="vid" type="uint" summary="USB vendor id"/>
+ <arg name="pid" type="uint" summary="USB product id"/>
+ </event>
+
+ <event name="path">
+ <description summary="path to the device">
+ A system-specific device path that indicates which device is behind
+ this wp_tablet. This information may be used to gather additional
+ information about the device, e.g. through libwacom.
+
+ A device may have more than one device path. If so, multiple
+ wp_tablet.path events are sent. A device may be emulated and not
+ have a device path, and in that case this event will not be sent.
+
+ The format of the path is unspecified, it may be a device node, a
+ sysfs path, or some other identifier. It is up to the client to
+ identify the string provided.
+
+ This event is sent in the initial burst of events before the
+ wp_tablet.done event.
+ </description>
+ <arg name="path" type="string" summary="path to local device"/>
+ </event>
+
+ <event name="done">
+ <description summary="tablet description events sequence complete">
+ This event is sent immediately to signal the end of the initial
+ burst of descriptive events. A client may consider the static
+ description of the tablet to be complete and finalize initialization
+ of the tablet.
+ </description>
+ </event>
+
+ <event name="removed">
+ <description summary="tablet removed event">
+ Sent when the tablet has been removed from the system. When a tablet
+ is removed, some tools may be removed.
+
+ When this event is received, the client must wp_tablet.destroy
+ the object.
+ </description>
+ </event>
+ </interface>
+
+ <interface name="zwp_tablet_pad_ring_v2" version="1">
+ <description summary="pad ring">
+ A circular interaction area, such as the touch ring on the Wacom Intuos
+ Pro series tablets.
+
+ Events on a ring are logically grouped by the wl_tablet_pad_ring.frame
+ event.
+ </description>
+
+ <request name="set_feedback">
+ <description summary="set compositor feedback">
+ Request that the compositor use the provided feedback string
+ associated with this ring. This request should be issued immediately
+ after a wp_tablet_pad_group.mode_switch event from the corresponding
+ group is received, or whenever the ring is mapped to a different
+ action. See wp_tablet_pad_group.mode_switch for more details.
+
+ Clients are encouraged to provide context-aware descriptions for
+ the actions associated with the ring; compositors may use this
+ information to offer visual feedback about the button layout
+ (eg. on-screen displays).
+
+ The provided string 'description' is a UTF-8 encoded string to be
+ associated with this ring, and is considered user-visible; general
+ internationalization rules apply.
+
+ The serial argument will be that of the last
+ wp_tablet_pad_group.mode_switch event received for the group of this
+ ring. Requests providing other serials than the most recent one will be
+ ignored.
+ </description>
+ <arg name="description" type="string" summary="ring description"/>
+ <arg name="serial" type="uint" summary="serial of the mode switch event"/>
+ </request>
+
+ <request name="destroy" type="destructor">
+ <description summary="destroy the ring object">
+ This destroys the client's resource for this ring object.
+ </description>
+ </request>
+
+ <enum name="source">
+ <description summary="ring axis source">
+ Describes the source types for ring events. This indicates to the
+ client how a ring event was physically generated; a client may
+ adjust the user interface accordingly. For example, events
+ from a "finger" source may trigger kinetic scrolling.
+ </description>
+ <entry name="finger" value="1" summary="finger"/>
+ </enum>
+
+ <event name="source">
+ <description summary="ring event source">
+ Source information for ring events.
+
+ This event does not occur on its own. It is sent before a
+ wp_tablet_pad_ring.frame event and carries the source information
+ for all events within that frame.
+
+ The source specifies how this event was generated. If the source is
+ wp_tablet_pad_ring.source.finger, a wp_tablet_pad_ring.stop event
+ will be sent when the user lifts the finger off the device.
+
+ This event is optional. If the source is unknown for an interaction,
+ no event is sent.
+ </description>
+ <arg name="source" type="uint" enum="source" summary="the event source"/>
+ </event>
+
+ <event name="angle">
+ <description summary="angle changed">
+ Sent whenever the angle on a ring changes.
+
+ The angle is provided in degrees clockwise from the logical
+ north of the ring in the pad's current rotation.
+ </description>
+ <arg name="degrees" type="fixed" summary="the current angle in degrees"/>
+ </event>
+
+ <event name="stop">
+ <description summary="interaction stopped">
+ Stop notification for ring events.
+
+ For some wp_tablet_pad_ring.source types, a wp_tablet_pad_ring.stop
+ event is sent to notify a client that the interaction with the ring
+ has terminated. This enables the client to implement kinetic scrolling.
+ See the wp_tablet_pad_ring.source documentation for information on
+ when this event may be generated.
+
+ Any wp_tablet_pad_ring.angle events with the same source after this
+ event should be considered as the start of a new interaction.
+ </description>
+ </event>
+
+ <event name="frame">
+ <description summary="end of a ring event sequence">
+ Indicates the end of a set of ring events that logically belong
+ together. A client is expected to accumulate the data in all events
+ within the frame before proceeding.
+
+ All wp_tablet_pad_ring events before a wp_tablet_pad_ring.frame event belong
+ logically together. For example, on termination of a finger interaction
+ on a ring the compositor will send a wp_tablet_pad_ring.source event,
+ a wp_tablet_pad_ring.stop event and a wp_tablet_pad_ring.frame event.
+
+ A wp_tablet_pad_ring.frame event is sent for every logical event
+ group, even if the group only contains a single wp_tablet_pad_ring
+ event. Specifically, a client may get a sequence: angle, frame,
+ angle, frame, etc.
+ </description>
+ <arg name="time" type="uint" summary="timestamp with millisecond granularity"/>
+ </event>
+ </interface>
+
+ <interface name="zwp_tablet_pad_strip_v2" version="1">
+ <description summary="pad strip">
+ A linear interaction area, such as the strips found in Wacom Cintiq
+ models.
+
+ Events on a strip are logically grouped by the wl_tablet_pad_strip.frame
+ event.
+ </description>
+
+ <request name="set_feedback">
+ <description summary="set compositor feedback">
+ Requests the compositor to use the provided feedback string
+ associated with this strip. This request should be issued immediately
+ after a wp_tablet_pad_group.mode_switch event from the corresponding
+ group is received, or whenever the strip is mapped to a different
+ action. See wp_tablet_pad_group.mode_switch for more details.
+
+ Clients are encouraged to provide context-aware descriptions for
+ the actions associated with the strip, and compositors may use this
+ information to offer visual feedback about the button layout
+ (eg. on-screen displays).
+
+ The provided string 'description' is a UTF-8 encoded string to be
+ associated with this ring, and is considered user-visible; general
+ internationalization rules apply.
+
+ The serial argument will be that of the last
+ wp_tablet_pad_group.mode_switch event received for the group of this
+ strip. Requests providing other serials than the most recent one will be
+ ignored.
+ </description>
+ <arg name="description" type="string" summary="strip description"/>
+ <arg name="serial" type="uint" summary="serial of the mode switch event"/>
+ </request>
+
+ <request name="destroy" type="destructor">
+ <description summary="destroy the strip object">
+ This destroys the client's resource for this strip object.
+ </description>
+ </request>
+
+ <enum name="source">
+ <description summary="strip axis source">
+ Describes the source types for strip events. This indicates to the
+ client how a strip event was physically generated; a client may
+ adjust the user interface accordingly. For example, events
+ from a "finger" source may trigger kinetic scrolling.
+ </description>
+ <entry name="finger" value="1" summary="finger"/>
+ </enum>
+
+ <event name="source">
+ <description summary="strip event source">
+ Source information for strip events.
+
+ This event does not occur on its own. It is sent before a
+ wp_tablet_pad_strip.frame event and carries the source information
+ for all events within that frame.
+
+ The source specifies how this event was generated. If the source is
+ wp_tablet_pad_strip.source.finger, a wp_tablet_pad_strip.stop event
+ will be sent when the user lifts their finger off the device.
+
+ This event is optional. If the source is unknown for an interaction,
+ no event is sent.
+ </description>
+ <arg name="source" type="uint" enum="source" summary="the event source"/>
+ </event>
+
+ <event name="position">
+ <description summary="position changed">
+ Sent whenever the position on a strip changes.
+
+ The position is normalized to a range of [0, 65535], the 0-value
+ represents the top-most and/or left-most position of the strip in
+ the pad's current rotation.
+ </description>
+ <arg name="position" type="uint" summary="the current position"/>
+ </event>
+
+ <event name="stop">
+ <description summary="interaction stopped">
+ Stop notification for strip events.
+
+ For some wp_tablet_pad_strip.source types, a wp_tablet_pad_strip.stop
+ event is sent to notify a client that the interaction with the strip
+ has terminated. This enables the client to implement kinetic
+ scrolling. See the wp_tablet_pad_strip.source documentation for
+ information on when this event may be generated.
+
+ Any wp_tablet_pad_strip.position events with the same source after this
+ event should be considered as the start of a new interaction.
+ </description>
+ </event>
+
+ <event name="frame">
+ <description summary="end of a strip event sequence">
+ Indicates the end of a set of events that represent one logical
+ hardware strip event. A client is expected to accumulate the data
+ in all events within the frame before proceeding.
+
+ All wp_tablet_pad_strip events before a wp_tablet_pad_strip.frame event belong
+ logically together. For example, on termination of a finger interaction
+ on a strip the compositor will send a wp_tablet_pad_strip.source event,
+ a wp_tablet_pad_strip.stop event and a wp_tablet_pad_strip.frame
+ event.
+
+ A wp_tablet_pad_strip.frame event is sent for every logical event
+ group, even if the group only contains a single wp_tablet_pad_strip
+ event. Specifically, a client may get a sequence: position, frame,
+ position, frame, etc.
+ </description>
+ <arg name="time" type="uint" summary="timestamp with millisecond granularity"/>
+ </event>
+ </interface>
+
+ <interface name="zwp_tablet_pad_group_v2" version="1">
+ <description summary="a set of buttons, rings and strips">
+ A pad group describes a distinct (sub)set of buttons, rings and strips
+ present in the tablet. The criteria of this grouping is usually positional,
+ eg. if a tablet has buttons on the left and right side, 2 groups will be
+ presented. The physical arrangement of groups is undisclosed and may
+ change on the fly.
+
+ Pad groups will announce their features during pad initialization. Between
+ the corresponding wp_tablet_pad.group event and wp_tablet_pad_group.done, the
+ pad group will announce the buttons, rings and strips contained in it,
+ plus the number of supported modes.
+
+ Modes are a mechanism to allow multiple groups of actions for every element
+ in the pad group. The number of groups and available modes in each is
+ persistent across device plugs. The current mode is user-switchable, it
+ will be announced through the wp_tablet_pad_group.mode_switch event both
+ whenever it is switched, and after wp_tablet_pad.enter.
+
+ The current mode logically applies to all elements in the pad group,
+ although it is at clients' discretion whether to actually perform different
+ actions, and/or issue the respective .set_feedback requests to notify the
+ compositor. See the wp_tablet_pad_group.mode_switch event for more details.
+ </description>
+
+ <request name="destroy" type="destructor">
+ <description summary="destroy the pad object">
+ Destroy the wp_tablet_pad_group object. Objects created from this object
+ are unaffected and should be destroyed separately.
+ </description>
+ </request>
+
+ <event name="buttons">
+ <description summary="buttons announced">
+ Sent on wp_tablet_pad_group initialization to announce the available
+ buttons in the group. Button indices start at 0, a button may only be
+ in one group at a time.
+
+ This event is first sent in the initial burst of events before the
+ wp_tablet_pad_group.done event.
+
+ Some buttons are reserved by the compositor. These buttons may not be
+ assigned to any wp_tablet_pad_group. Compositors may broadcast this
+ event in the case of changes to the mapping of these reserved buttons.
+ If the compositor happens to reserve all buttons in a group, this event
+ will be sent with an empty array.
+ </description>
+ <arg name="buttons" type="array" summary="buttons in this group"/>
+ </event>
+
+ <event name="ring">
+ <description summary="ring announced">
+ Sent on wp_tablet_pad_group initialization to announce available rings.
+ One event is sent for each ring available on this pad group.
+
+ This event is sent in the initial burst of events before the
+ wp_tablet_pad_group.done event.
+ </description>
+ <arg name="ring" type="new_id" interface="zwp_tablet_pad_ring_v2"/>
+ </event>
+
+ <event name="strip">
+ <description summary="strip announced">
+ Sent on wp_tablet_pad initialization to announce available strips.
+ One event is sent for each strip available on this pad group.
+
+ This event is sent in the initial burst of events before the
+ wp_tablet_pad_group.done event.
+ </description>
+ <arg name="strip" type="new_id" interface="zwp_tablet_pad_strip_v2"/>
+ </event>
+
+ <event name="modes">
+ <description summary="mode-switch ability announced">
+ Sent on wp_tablet_pad_group initialization to announce that the pad
+ group may switch between modes. A client may use a mode to store a
+ specific configuration for buttons, rings and strips and use the
+ wl_tablet_pad_group.mode_switch event to toggle between these
+ configurations. Mode indices start at 0.
+
+ Switching modes is compositor-dependent. See the
+ wp_tablet_pad_group.mode_switch event for more details.
+
+ This event is sent in the initial burst of events before the
+ wp_tablet_pad_group.done event. This event is only sent when more than
+ more than one mode is available.
+ </description>
+ <arg name="modes" type="uint" summary="the number of modes"/>
+ </event>
+
+ <event name="done">
+ <description summary="tablet group description events sequence complete">
+ This event is sent immediately to signal the end of the initial
+ burst of descriptive events. A client may consider the static
+ description of the tablet to be complete and finalize initialization
+ of the tablet group.
+ </description>
+ </event>
+
+ <event name="mode_switch">
+ <description summary="mode switch event">
+ Notification that the mode was switched.
+
+ A mode applies to all buttons, rings and strips in a group
+ simultaneously, but a client is not required to assign different actions
+ for each mode. For example, a client may have mode-specific button
+ mappings but map the ring to vertical scrolling in all modes. Mode
+ indices start at 0.
+
+ Switching modes is compositor-dependent. The compositor may provide
+ visual cues to the client about the mode, e.g. by toggling LEDs on
+ the tablet device. Mode-switching may be software-controlled or
+ controlled by one or more physical buttons. For example, on a Wacom
+ Intuos Pro, the button inside the ring may be assigned to switch
+ between modes.
+
+ The compositor will also send this event after wp_tablet_pad.enter on
+ each group in order to notify of the current mode. Groups that only
+ feature one mode will use mode=0 when emitting this event.
+
+ If a button action in the new mode differs from the action in the
+ previous mode, the client should immediately issue a
+ wp_tablet_pad.set_feedback request for each changed button.
+
+ If a ring or strip action in the new mode differs from the action
+ in the previous mode, the client should immediately issue a
+ wp_tablet_ring.set_feedback or wp_tablet_strip.set_feedback request
+ for each changed ring or strip.
+ </description>
+ <arg name="time" type="uint" summary="the time of the event with millisecond granularity"/>
+ <arg name="serial" type="uint"/>
+ <arg name="mode" type="uint" summary="the new mode of the pad"/>
+ </event>
+ </interface>
+
+ <interface name="zwp_tablet_pad_v2" version="1">
+ <description summary="a set of buttons, rings and strips">
+ A pad device is a set of buttons, rings and strips
+ usually physically present on the tablet device itself. Some
+ exceptions exist where the pad device is physically detached, e.g. the
+ Wacom ExpressKey Remote.
+
+ Pad devices have no axes that control the cursor and are generally
+ auxiliary devices to the tool devices used on the tablet surface.
+
+ A pad device has a number of static characteristics, e.g. the number
+ of rings. These capabilities are sent in an event sequence after the
+ wp_tablet_seat.pad_added event before any actual events from this pad.
+ This initial event sequence is terminated by a wp_tablet_pad.done
+ event.
+
+ All pad features (buttons, rings and strips) are logically divided into
+ groups and all pads have at least one group. The available groups are
+ notified through the wp_tablet_pad.group event; the compositor will
+ emit one event per group before emitting wp_tablet_pad.done.
+
+ Groups may have multiple modes. Modes allow clients to map multiple
+ actions to a single pad feature. Only one mode can be active per group,
+ although different groups may have different active modes.
+ </description>
+
+ <request name="set_feedback">
+ <description summary="set compositor feedback">
+ Requests the compositor to use the provided feedback string
+ associated with this button. This request should be issued immediately
+ after a wp_tablet_pad_group.mode_switch event from the corresponding
+ group is received, or whenever a button is mapped to a different
+ action. See wp_tablet_pad_group.mode_switch for more details.
+
+ Clients are encouraged to provide context-aware descriptions for
+ the actions associated with each button, and compositors may use
+ this information to offer visual feedback on the button layout
+ (e.g. on-screen displays).
+
+ Button indices start at 0. Setting the feedback string on a button
+ that is reserved by the compositor (i.e. not belonging to any
+ wp_tablet_pad_group) does not generate an error but the compositor
+ is free to ignore the request.
+
+ The provided string 'description' is a UTF-8 encoded string to be
+ associated with this ring, and is considered user-visible; general
+ internationalization rules apply.
+
+ The serial argument will be that of the last
+ wp_tablet_pad_group.mode_switch event received for the group of this
+ button. Requests providing other serials than the most recent one will
+ be ignored.
+ </description>
+ <arg name="button" type="uint" summary="button index"/>
+ <arg name="description" type="string" summary="button description"/>
+ <arg name="serial" type="uint" summary="serial of the mode switch event"/>
+ </request>
+
+ <request name="destroy" type="destructor">
+ <description summary="destroy the pad object">
+ Destroy the wp_tablet_pad object. Objects created from this object
+ are unaffected and should be destroyed separately.
+ </description>
+ </request>
+
+ <event name="group">
+ <description summary="group announced">
+ Sent on wp_tablet_pad initialization to announce available groups.
+ One event is sent for each pad group available.
+
+ This event is sent in the initial burst of events before the
+ wp_tablet_pad.done event. At least one group will be announced.
+ </description>
+ <arg name="pad_group" type="new_id" interface="zwp_tablet_pad_group_v2"/>
+ </event>
+
+ <event name="path">
+ <description summary="path to the device">
+ A system-specific device path that indicates which device is behind
+ this wp_tablet_pad. This information may be used to gather additional
+ information about the device, e.g. through libwacom.
+
+ The format of the path is unspecified, it may be a device node, a
+ sysfs path, or some other identifier. It is up to the client to
+ identify the string provided.
+
+ This event is sent in the initial burst of events before the
+ wp_tablet_pad.done event.
+ </description>
+ <arg name="path" type="string" summary="path to local device"/>
+ </event>
+
+ <event name="buttons">
+ <description summary="buttons announced">
+ Sent on wp_tablet_pad initialization to announce the available
+ buttons.
+
+ This event is sent in the initial burst of events before the
+ wp_tablet_pad.done event. This event is only sent when at least one
+ button is available.
+ </description>
+ <arg name="buttons" type="uint" summary="the number of buttons"/>
+ </event>
+
+ <event name="done">
+ <description summary="pad description event sequence complete">
+ This event signals the end of the initial burst of descriptive
+ events. A client may consider the static description of the pad to
+ be complete and finalize initialization of the pad.
+ </description>
+ </event>
+
+ <enum name="button_state">
+ <description summary="physical button state">
+ Describes the physical state of a button that caused the button
+ event.
+ </description>
+ <entry name="released" value="0" summary="the button is not pressed"/>
+ <entry name="pressed" value="1" summary="the button is pressed"/>
+ </enum>
+
+ <event name="button">
+ <description summary="physical button state">
+ Sent whenever the physical state of a button changes.
+ </description>
+ <arg name="time" type="uint" summary="the time of the event with millisecond granularity"/>
+ <arg name="button" type="uint" summary="the index of the button that changed state"/>
+ <arg name="state" type="uint" enum="button_state"/>
+ </event>
+
+ <event name="enter">
+ <description summary="enter event">
+ Notification that this pad is focused on the specified surface.
+ </description>
+ <arg name="serial" type="uint" summary="serial number of the enter event"/>
+ <arg name="tablet" type="object" interface="zwp_tablet_v2" summary="the tablet the pad is attached to"/>
+ <arg name="surface" type="object" interface="wl_surface" summary="surface the pad is focused on"/>
+ </event>
+
+ <event name="leave">
+ <description summary="enter event">
+ Notification that this pad is no longer focused on the specified
+ surface.
+ </description>
+ <arg name="serial" type="uint" summary="serial number of the leave event"/>
+ <arg name="surface" type="object" interface="wl_surface" summary="surface the pad is no longer focused on"/>
+ </event>
+
+ <event name="removed">
+ <description summary="pad removed event">
+ Sent when the pad has been removed from the system. When a tablet
+ is removed its pad(s) will be removed too.
+
+ When this event is received, the client must destroy all rings, strips
+ and groups that were offered by this pad, and issue wp_tablet_pad.destroy
+ the pad itself.
+ </description>
+ </event>
+ </interface>
+</protocol>
diff --git a/chromium/third_party/wayland-protocols/src/unstable/text-input/README b/chromium/third_party/wayland-protocols/src/unstable/text-input/README
new file mode 100644
index 00000000000..afa4bacf521
--- /dev/null
+++ b/chromium/third_party/wayland-protocols/src/unstable/text-input/README
@@ -0,0 +1,4 @@
+Text input protocol
+
+Maintainers:
+Jan Arne Petersen <janarne@gmail.com>
diff --git a/chromium/third_party/wayland-protocols/src/unstable/text-input/text-input-unstable-v1.xml b/chromium/third_party/wayland-protocols/src/unstable/text-input/text-input-unstable-v1.xml
new file mode 100644
index 00000000000..29a217ebe2e
--- /dev/null
+++ b/chromium/third_party/wayland-protocols/src/unstable/text-input/text-input-unstable-v1.xml
@@ -0,0 +1,385 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<protocol name="text_input_unstable_v1">
+
+ <copyright>
+ Copyright © 2012, 2013 Intel Corporation
+
+ Permission is hereby granted, free of charge, to any person obtaining a
+ copy of this software and associated documentation files (the "Software"),
+ to deal in the Software without restriction, including without limitation
+ the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ and/or sell copies of the Software, and to permit persons to whom the
+ Software is furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice (including the next
+ paragraph) shall be included in all copies or substantial portions of the
+ Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ DEALINGS IN THE SOFTWARE.
+ </copyright>
+
+ <interface name="zwp_text_input_v1" version="1">
+ <description summary="text input">
+ An object used for text input. Adds support for text input and input
+ methods to applications. A text_input object is created from a
+ wl_text_input_manager and corresponds typically to a text entry in an
+ application.
+
+ Requests are used to activate/deactivate the text_input object and set
+ state information like surrounding and selected text or the content type.
+ The information about entered text is sent to the text_input object via
+ the pre-edit and commit events. Using this interface removes the need
+ for applications to directly process hardware key events and compose text
+ out of them.
+
+ Text is generally UTF-8 encoded, indices and lengths are in bytes.
+
+ Serials are used to synchronize the state between the text input and
+ an input method. New serials are sent by the text input in the
+ commit_state request and are used by the input method to indicate
+ the known text input state in events like preedit_string, commit_string,
+ and keysym. The text input can then ignore events from the input method
+ which are based on an outdated state (for example after a reset).
+
+ Warning! The protocol described in this file is experimental and
+ backward incompatible changes may be made. Backward compatible changes
+ may be added together with the corresponding interface version bump.
+ Backward incompatible changes are done by bumping the version number in
+ the protocol and interface names and resetting the interface version.
+ Once the protocol is to be declared stable, the 'z' prefix and the
+ version number in the protocol and interface names are removed and the
+ interface version number is reset.
+ </description>
+
+ <request name="activate">
+ <description summary="request activation">
+ Requests the text_input object to be activated (typically when the
+ text entry gets focus).
+
+ The seat argument is a wl_seat which maintains the focus for this
+ activation. The surface argument is a wl_surface assigned to the
+ text_input object and tracked for focus lost. The enter event
+ is emitted on successful activation.
+ </description>
+ <arg name="seat" type="object" interface="wl_seat"/>
+ <arg name="surface" type="object" interface="wl_surface"/>
+ </request>
+
+ <request name="deactivate">
+ <description summary="request deactivation">
+ Requests the text_input object to be deactivated (typically when the
+ text entry lost focus). The seat argument is a wl_seat which was used
+ for activation.
+ </description>
+ <arg name="seat" type="object" interface="wl_seat"/>
+ </request>
+
+ <request name="show_input_panel">
+ <description summary="show input panels">
+ Requests input panels (virtual keyboard) to show.
+ </description>
+ </request>
+
+ <request name="hide_input_panel">
+ <description summary="hide input panels">
+ Requests input panels (virtual keyboard) to hide.
+ </description>
+ </request>
+
+ <request name="reset">
+ <description summary="reset">
+ Should be called by an editor widget when the input state should be
+ reset, for example after the text was changed outside of the normal
+ input method flow.
+ </description>
+ </request>
+
+ <request name="set_surrounding_text">
+ <description summary="sets the surrounding text">
+ Sets the plain surrounding text around the input position. Text is
+ UTF-8 encoded. Cursor is the byte offset within the
+ surrounding text. Anchor is the byte offset of the
+ selection anchor within the surrounding text. If there is no selected
+ text anchor, then it is the same as cursor.
+ </description>
+ <arg name="text" type="string"/>
+ <arg name="cursor" type="uint"/>
+ <arg name="anchor" type="uint"/>
+ </request>
+
+ <enum name="content_hint">
+ <description summary="content hint">
+ Content hint is a bitmask to allow to modify the behavior of the text
+ input.
+ </description>
+ <entry name="none" value="0x0" summary="no special behaviour"/>
+ <entry name="default" value="0x7" summary="auto completion, correction and capitalization"/>
+ <entry name="password" value="0xc0" summary="hidden and sensitive text"/>
+ <entry name="auto_completion" value="0x1" summary="suggest word completions"/>
+ <entry name="auto_correction" value="0x2" summary="suggest word corrections"/>
+ <entry name="auto_capitalization" value="0x4" summary="switch to uppercase letters at the start of a sentence"/>
+ <entry name="lowercase" value="0x8" summary="prefer lowercase letters"/>
+ <entry name="uppercase" value="0x10" summary="prefer uppercase letters"/>
+ <entry name="titlecase" value="0x20" summary="prefer casing for titles and headings (can be language dependent)"/>
+ <entry name="hidden_text" value="0x40" summary="characters should be hidden"/>
+ <entry name="sensitive_data" value="0x80" summary="typed text should not be stored"/>
+ <entry name="latin" value="0x100" summary="just latin characters should be entered"/>
+ <entry name="multiline" value="0x200" summary="the text input is multiline"/>
+ </enum>
+
+ <enum name="content_purpose">
+ <description summary="content purpose">
+ The content purpose allows to specify the primary purpose of a text
+ input.
+
+ This allows an input method to show special purpose input panels with
+ extra characters or to disallow some characters.
+ </description>
+ <entry name="normal" value="0" summary="default input, allowing all characters"/>
+ <entry name="alpha" value="1" summary="allow only alphabetic characters"/>
+ <entry name="digits" value="2" summary="allow only digits"/>
+ <entry name="number" value="3" summary="input a number (including decimal separator and sign)"/>
+ <entry name="phone" value="4" summary="input a phone number"/>
+ <entry name="url" value="5" summary="input an URL"/>
+ <entry name="email" value="6" summary="input an email address"/>
+ <entry name="name" value="7" summary="input a name of a person"/>
+ <entry name="password" value="8" summary="input a password (combine with password or sensitive_data hint)"/>
+ <entry name="date" value="9" summary="input a date"/>
+ <entry name="time" value="10" summary="input a time"/>
+ <entry name="datetime" value="11" summary="input a date and time"/>
+ <entry name="terminal" value="12" summary="input for a terminal"/>
+ </enum>
+
+ <request name="set_content_type">
+ <description summary="set content purpose and hint">
+ Sets the content purpose and content hint. While the purpose is the
+ basic purpose of an input field, the hint flags allow to modify some
+ of the behavior.
+
+ When no content type is explicitly set, a normal content purpose with
+ default hints (auto completion, auto correction, auto capitalization)
+ should be assumed.
+ </description>
+ <arg name="hint" type="uint"/>
+ <arg name="purpose" type="uint"/>
+ </request>
+
+ <request name="set_cursor_rectangle">
+ <arg name="x" type="int"/>
+ <arg name="y" type="int"/>
+ <arg name="width" type="int"/>
+ <arg name="height" type="int"/>
+ </request>
+
+ <request name="set_preferred_language">
+ <description summary="sets preferred language">
+ Sets a specific language. This allows for example a virtual keyboard to
+ show a language specific layout. The "language" argument is an RFC-3066
+ format language tag.
+
+ It could be used for example in a word processor to indicate the
+ language of the currently edited document or in an instant message
+ application which tracks languages of contacts.
+ </description>
+ <arg name="language" type="string"/>
+ </request>
+
+ <request name="commit_state">
+ <arg name="serial" type="uint" summary="used to identify the known state"/>
+ </request>
+
+ <request name="invoke_action">
+ <arg name="button" type="uint"/>
+ <arg name="index" type="uint"/>
+ </request>
+
+ <event name="enter">
+ <description summary="enter event">
+ Notify the text_input object when it received focus. Typically in
+ response to an activate request.
+ </description>
+ <arg name="surface" type="object" interface="wl_surface"/>
+ </event>
+
+ <event name="leave">
+ <description summary="leave event">
+ Notify the text_input object when it lost focus. Either in response
+ to a deactivate request or when the assigned surface lost focus or was
+ destroyed.
+ </description>
+ </event>
+
+ <event name="modifiers_map">
+ <description summary="modifiers map">
+ Transfer an array of 0-terminated modifier names. The position in
+ the array is the index of the modifier as used in the modifiers
+ bitmask in the keysym event.
+ </description>
+ <arg name="map" type="array"/>
+ </event>
+
+ <event name="input_panel_state">
+ <description summary="state of the input panel">
+ Notify when the visibility state of the input panel changed.
+ </description>
+ <arg name="state" type="uint"/>
+ </event>
+
+ <event name="preedit_string">
+ <description summary="pre-edit">
+ Notify when a new composing text (pre-edit) should be set around the
+ current cursor position. Any previously set composing text should
+ be removed.
+
+ The commit text can be used to replace the preedit text on reset
+ (for example on unfocus).
+
+ The text input should also handle all preedit_style and preedit_cursor
+ events occurring directly before preedit_string.
+ </description>
+ <arg name="serial" type="uint" summary="serial of the latest known text input state"/>
+ <arg name="text" type="string"/>
+ <arg name="commit" type="string"/>
+ </event>
+
+ <enum name="preedit_style">
+ <entry name="default" value="0" summary="default style for composing text"/>
+ <entry name="none" value="1" summary="style should be the same as in non-composing text"/>
+ <entry name="active" value="2"/>
+ <entry name="inactive" value="3"/>
+ <entry name="highlight" value="4"/>
+ <entry name="underline" value="5"/>
+ <entry name="selection" value="6"/>
+ <entry name="incorrect" value="7"/>
+ </enum>
+
+ <event name="preedit_styling">
+ <description summary="pre-edit styling">
+ Sets styling information on composing text. The style is applied for
+ length bytes from index relative to the beginning of the composing
+ text (as byte offset). Multiple styles can
+ be applied to a composing text by sending multiple preedit_styling
+ events.
+
+ This event is handled as part of a following preedit_string event.
+ </description>
+ <arg name="index" type="uint"/>
+ <arg name="length" type="uint"/>
+ <arg name="style" type="uint"/>
+ </event>
+
+ <event name="preedit_cursor">
+ <description summary="pre-edit cursor">
+ Sets the cursor position inside the composing text (as byte
+ offset) relative to the start of the composing text. When index is a
+ negative number no cursor is shown.
+
+ This event is handled as part of a following preedit_string event.
+ </description>
+ <arg name="index" type="int"/>
+ </event>
+
+ <event name="commit_string">
+ <description summary="commit">
+ Notify when text should be inserted into the editor widget. The text to
+ commit could be either just a single character after a key press or the
+ result of some composing (pre-edit). It could also be an empty text
+ when some text should be removed (see delete_surrounding_text) or when
+ the input cursor should be moved (see cursor_position).
+
+ Any previously set composing text should be removed.
+ </description>
+ <arg name="serial" type="uint" summary="serial of the latest known text input state"/>
+ <arg name="text" type="string"/>
+ </event>
+
+ <event name="cursor_position">
+ <description summary="set cursor to new position">
+ Notify when the cursor or anchor position should be modified.
+
+ This event should be handled as part of a following commit_string
+ event.
+ </description>
+ <arg name="index" type="int"/>
+ <arg name="anchor" type="int"/>
+ </event>
+
+ <event name="delete_surrounding_text">
+ <description summary="delete surrounding text">
+ Notify when the text around the current cursor position should be
+ deleted.
+
+ Index is relative to the current cursor (in bytes).
+ Length is the length of deleted text (in bytes).
+
+ This event should be handled as part of a following commit_string
+ event.
+ </description>
+ <arg name="index" type="int"/>
+ <arg name="length" type="uint"/>
+ </event>
+
+ <event name="keysym">
+ <description summary="keysym">
+ Notify when a key event was sent. Key events should not be used
+ for normal text input operations, which should be done with
+ commit_string, delete_surrounding_text, etc. The key event follows
+ the wl_keyboard key event convention. Sym is an XKB keysym, state a
+ wl_keyboard key_state. Modifiers are a mask for effective modifiers
+ (where the modifier indices are set by the modifiers_map event)
+ </description>
+ <arg name="serial" type="uint" summary="serial of the latest known text input state"/>
+ <arg name="time" type="uint"/>
+ <arg name="sym" type="uint"/>
+ <arg name="state" type="uint"/>
+ <arg name="modifiers" type="uint"/>
+ </event>
+
+ <event name="language">
+ <description summary="language">
+ Sets the language of the input text. The "language" argument is an
+ RFC-3066 format language tag.
+ </description>
+ <arg name="serial" type="uint" summary="serial of the latest known text input state"/>
+ <arg name="language" type="string"/>
+ </event>
+
+ <enum name="text_direction">
+ <entry name="auto" value="0" summary="automatic text direction based on text and language"/>
+ <entry name="ltr" value="1" summary="left-to-right"/>
+ <entry name="rtl" value="2" summary="right-to-left"/>
+ </enum>
+
+ <event name="text_direction">
+ <description summary="text direction">
+ Sets the text direction of input text.
+
+ It is mainly needed for showing an input cursor on the correct side of
+ the editor when there is no input done yet and making sure neutral
+ direction text is laid out properly.
+ </description>
+ <arg name="serial" type="uint" summary="serial of the latest known text input state"/>
+ <arg name="direction" type="uint"/>
+ </event>
+ </interface>
+
+ <interface name="zwp_text_input_manager_v1" version="1">
+ <description summary="text input manager">
+ A factory for text_input objects. This object is a global singleton.
+ </description>
+
+ <request name="create_text_input">
+ <description summary="create text input">
+ Creates a new text_input object.
+ </description>
+ <arg name="id" type="new_id" interface="zwp_text_input_v1"/>
+ </request>
+ </interface>
+
+</protocol>
diff --git a/chromium/third_party/wayland-protocols/src/unstable/xdg-foreign/README b/chromium/third_party/wayland-protocols/src/unstable/xdg-foreign/README
new file mode 100644
index 00000000000..f5bcb838f34
--- /dev/null
+++ b/chromium/third_party/wayland-protocols/src/unstable/xdg-foreign/README
@@ -0,0 +1,4 @@
+xdg foreign protocol
+
+Maintainers:
+Jonas Ã…dahl <jadahl@gmail.com>
diff --git a/chromium/third_party/wayland-protocols/src/unstable/xdg-foreign/xdg-foreign-unstable-v1.xml b/chromium/third_party/wayland-protocols/src/unstable/xdg-foreign/xdg-foreign-unstable-v1.xml
new file mode 100644
index 00000000000..062b09041a2
--- /dev/null
+++ b/chromium/third_party/wayland-protocols/src/unstable/xdg-foreign/xdg-foreign-unstable-v1.xml
@@ -0,0 +1,182 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<protocol name="xdg_foreign_unstable_v1">
+
+ <copyright>
+ Copyright © 2015-2016 Red Hat Inc.
+
+ Permission is hereby granted, free of charge, to any person obtaining a
+ copy of this software and associated documentation files (the "Software"),
+ to deal in the Software without restriction, including without limitation
+ the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ and/or sell copies of the Software, and to permit persons to whom the
+ Software is furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice (including the next
+ paragraph) shall be included in all copies or substantial portions of the
+ Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ DEALINGS IN THE SOFTWARE.
+ </copyright>
+
+ <description summary="Protocol for exporting xdg surface handles">
+ This protocol specifies a way for making it possible to reference a surface
+ of a different client. With such a reference, a client can, by using the
+ interfaces provided by this protocol, manipulate the relationship between
+ its own surfaces and the surface of some other client. For example, stack
+ some of its own surface above the other clients surface.
+
+ In order for a client A to get a reference of a surface of client B, client
+ B must first export its surface using xdg_exporter.export. Upon doing this,
+ client B will receive a handle (a unique string) that it may share with
+ client A in some way (for example D-Bus). After client A has received the
+ handle from client B, it may use xdg_importer.import to create a reference
+ to the surface client B just exported. See the corresponding requests for
+ details.
+
+ A possible use case for this is out-of-process dialogs. For example when a
+ sandboxed client without file system access needs the user to select a file
+ on the file system, given sandbox environment support, it can export its
+ surface, passing the exported surface handle to an unsandboxed process that
+ can show a file browser dialog and stack it above the sandboxed client's
+ surface.
+
+ Warning! The protocol described in this file is experimental and backward
+ incompatible changes may be made. Backward compatible changes may be added
+ together with the corresponding interface version bump. Backward
+ incompatible changes are done by bumping the version number in the protocol
+ and interface names and resetting the interface version. Once the protocol
+ is to be declared stable, the 'z' prefix and the version number in the
+ protocol and interface names are removed and the interface version number is
+ reset.
+ </description>
+
+ <interface name="zxdg_exporter_v1" version="1">
+ <description summary="interface for exporting surfaces">
+ A global interface used for exporting surfaces that can later be imported
+ using xdg_importer.
+ </description>
+
+ <request name="destroy" type="destructor">
+ <description summary="destroy the xdg_exporter object">
+ Notify the compositor that the xdg_exporter object will no longer be
+ used.
+ </description>
+ </request>
+
+ <request name="export">
+ <description summary="export a surface">
+ The export request exports the passed surface so that it can later be
+ imported via xdg_importer. When called, a new xdg_exported object will
+ be created and xdg_exported.handle will be sent immediately. See the
+ corresponding interface and event for details.
+
+ A surface may be exported multiple times, and each exported handle may
+ be used to create a xdg_imported multiple times. Only xdg_surface
+ surfaces may be exported.
+ </description>
+ <arg name="id" type="new_id" interface="zxdg_exported_v1"
+ summary="the new xdg_exported object"/>
+ <arg name="surface" type="object" interface="wl_surface"
+ summary="the surface to export"/>
+ </request>
+ </interface>
+
+ <interface name="zxdg_importer_v1" version="1">
+ <description summary="interface for importing surfaces">
+ A global interface used for importing surfaces exported by xdg_exporter.
+ With this interface, a client can create a reference to a surface of
+ another client.
+ </description>
+
+ <request name="destroy" type="destructor">
+ <description summary="destroy the xdg_importer object">
+ Notify the compositor that the xdg_importer object will no longer be
+ used.
+ </description>
+ </request>
+
+ <request name="import">
+ <description summary="import a surface">
+ The import request imports a surface from any client given a handle
+ retrieved by exporting said surface using xdg_exporter.export. When
+ called, a new xdg_imported object will be created. This new object
+ represents the imported surface, and the importing client can
+ manipulate its relationship using it. See xdg_imported for details.
+ </description>
+ <arg name="id" type="new_id" interface="zxdg_imported_v1"
+ summary="the new xdg_imported object"/>
+ <arg name="handle" type="string"
+ summary="the exported surface handle"/>
+ </request>
+ </interface>
+
+ <interface name="zxdg_exported_v1" version="1">
+ <description summary="an exported surface handle">
+ A xdg_exported object represents an exported reference to a surface. The
+ exported surface may be referenced as long as the xdg_exported object not
+ destroyed. Destroying the xdg_exported invalidates any relationship the
+ importer may have established using xdg_imported.
+ </description>
+
+ <request name="destroy" type="destructor">
+ <description summary="unexport the exported surface">
+ Revoke the previously exported surface. This invalidates any
+ relationship the importer may have set up using the xdg_imported created
+ given the handle sent via xdg_exported.handle.
+ </description>
+ </request>
+
+ <event name="handle">
+ <description summary="the exported surface handle">
+ The handle event contains the unique handle of this exported surface
+ reference. It may be shared with any client, which then can use it to
+ import the surface by calling xdg_importer.import. A handle may be
+ used to import the surface multiple times.
+ </description>
+ <arg name="handle" type="string" summary="the exported surface handle"/>
+ </event>
+ </interface>
+
+ <interface name="zxdg_imported_v1" version="1">
+ <description summary="an imported surface handle">
+ A xdg_imported object represents an imported reference to surface exported
+ by some client. A client can use this interface to manipulate
+ relationships between its own surfaces and the imported surface.
+ </description>
+
+ <request name="destroy" type="destructor">
+ <description summary="destroy the xdg_imported object">
+ Notify the compositor that it will no longer use the xdg_imported
+ object. Any relationship that may have been set up will at this point
+ be invalidated.
+ </description>
+ </request>
+
+ <request name="set_parent_of">
+ <description summary="set as the parent of some surface">
+ Set the imported surface as the parent of some surface of the client.
+ The passed surface must be a toplevel xdg_surface. Calling this function
+ sets up a surface to surface relation with the same stacking and positioning
+ semantics as xdg_surface.set_parent.
+ </description>
+ <arg name="surface" type="object" interface="wl_surface"
+ summary="the child surface"/>
+ </request>
+
+ <event name="destroyed">
+ <description summary="the imported surface handle has been destroyed">
+ The imported surface handle has been destroyed and any relationship set
+ up has been invalidated. This may happen for various reasons, for
+ example if the exported surface or the exported surface handle has been
+ destroyed, if the handle used for importing was invalid.
+ </description>
+ </event>
+ </interface>
+
+</protocol>
diff --git a/chromium/third_party/wayland-protocols/src/unstable/xdg-shell/README b/chromium/third_party/wayland-protocols/src/unstable/xdg-shell/README
new file mode 100644
index 00000000000..96ae4ef0073
--- /dev/null
+++ b/chromium/third_party/wayland-protocols/src/unstable/xdg-shell/README
@@ -0,0 +1,4 @@
+xdg shell protocol
+
+Maintainers:
+Jasper St. Pierre <jstpierre@mecheye.net>
diff --git a/chromium/third_party/wayland-protocols/src/unstable/xdg-shell/xdg-shell-unstable-v5.xml b/chromium/third_party/wayland-protocols/src/unstable/xdg-shell/xdg-shell-unstable-v5.xml
new file mode 100644
index 00000000000..ef0180d0107
--- /dev/null
+++ b/chromium/third_party/wayland-protocols/src/unstable/xdg-shell/xdg-shell-unstable-v5.xml
@@ -0,0 +1,623 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<protocol name="xdg_shell_unstable_v5">
+
+ <copyright>
+ Copyright © 2008-2013 Kristian Høgsberg
+ Copyright © 2013 Rafael Antognolli
+ Copyright © 2013 Jasper St. Pierre
+ Copyright © 2010-2013 Intel Corporation
+
+ Permission is hereby granted, free of charge, to any person obtaining a
+ copy of this software and associated documentation files (the "Software"),
+ to deal in the Software without restriction, including without limitation
+ the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ and/or sell copies of the Software, and to permit persons to whom the
+ Software is furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice (including the next
+ paragraph) shall be included in all copies or substantial portions of the
+ Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ DEALINGS IN THE SOFTWARE.
+ </copyright>
+
+ <interface name="xdg_shell" version="1">
+ <description summary="create desktop-style surfaces">
+ xdg_shell allows clients to turn a wl_surface into a "real window"
+ which can be dragged, resized, stacked, and moved around by the
+ user. Everything about this interface is suited towards traditional
+ desktop environments.
+ </description>
+
+ <enum name="version">
+ <description summary="latest protocol version">
+ The 'current' member of this enum gives the version of the
+ protocol. Implementations can compare this to the version
+ they implement using static_assert to ensure the protocol and
+ implementation versions match.
+ </description>
+ <entry name="current" value="5" summary="Always the latest version"/>
+ </enum>
+
+ <enum name="error">
+ <entry name="role" value="0" summary="given wl_surface has another role"/>
+ <entry name="defunct_surfaces" value="1" summary="xdg_shell was destroyed before children"/>
+ <entry name="not_the_topmost_popup" value="2" summary="the client tried to map or destroy a non-topmost popup"/>
+ <entry name="invalid_popup_parent" value="3" summary="the client specified an invalid popup parent surface"/>
+ </enum>
+
+ <request name="destroy" type="destructor">
+ <description summary="destroy xdg_shell">
+ Destroy this xdg_shell object.
+
+ Destroying a bound xdg_shell object while there are surfaces
+ still alive created by this xdg_shell object instance is illegal
+ and will result in a protocol error.
+ </description>
+ </request>
+
+ <request name="use_unstable_version">
+ <description summary="enable use of this unstable version">
+ Negotiate the unstable version of the interface. This
+ mechanism is in place to ensure client and server agree on the
+ unstable versions of the protocol that they speak or exit
+ cleanly if they don't agree. This request will go away once
+ the xdg-shell protocol is stable.
+ </description>
+ <arg name="version" type="int"/>
+ </request>
+
+ <request name="get_xdg_surface">
+ <description summary="create a shell surface from a surface">
+ This creates an xdg_surface for the given surface and gives it the
+ xdg_surface role. A wl_surface can only be given an xdg_surface role
+ once. If get_xdg_surface is called with a wl_surface that already has
+ an active xdg_surface associated with it, or if it had any other role,
+ an error is raised.
+
+ See the documentation of xdg_surface for more details about what an
+ xdg_surface is and how it is used.
+ </description>
+ <arg name="id" type="new_id" interface="xdg_surface"/>
+ <arg name="surface" type="object" interface="wl_surface"/>
+ </request>
+
+ <request name="get_xdg_popup">
+ <description summary="create a popup for a surface">
+ This creates an xdg_popup for the given surface and gives it the
+ xdg_popup role. A wl_surface can only be given an xdg_popup role
+ once. If get_xdg_popup is called with a wl_surface that already has
+ an active xdg_popup associated with it, or if it had any other role,
+ an error is raised.
+
+ This request must be used in response to some sort of user action
+ like a button press, key press, or touch down event.
+
+ See the documentation of xdg_popup for more details about what an
+ xdg_popup is and how it is used.
+ </description>
+ <arg name="id" type="new_id" interface="xdg_popup"/>
+ <arg name="surface" type="object" interface="wl_surface"/>
+ <arg name="parent" type="object" interface="wl_surface"/>
+ <arg name="seat" type="object" interface="wl_seat" summary="the wl_seat of the user event"/>
+ <arg name="serial" type="uint" summary="the serial of the user event"/>
+ <arg name="x" type="int"/>
+ <arg name="y" type="int"/>
+ </request>
+
+ <event name="ping">
+ <description summary="check if the client is alive">
+ The ping event asks the client if it's still alive. Pass the
+ serial specified in the event back to the compositor by sending
+ a "pong" request back with the specified serial.
+
+ Compositors can use this to determine if the client is still
+ alive. It's unspecified what will happen if the client doesn't
+ respond to the ping request, or in what timeframe. Clients should
+ try to respond in a reasonable amount of time.
+
+ A compositor is free to ping in any way it wants, but a client must
+ always respond to any xdg_shell object it created.
+ </description>
+ <arg name="serial" type="uint" summary="pass this to the pong request"/>
+ </event>
+
+ <request name="pong">
+ <description summary="respond to a ping event">
+ A client must respond to a ping event with a pong request or
+ the client may be deemed unresponsive.
+ </description>
+ <arg name="serial" type="uint" summary="serial of the ping event"/>
+ </request>
+ </interface>
+
+ <interface name="xdg_surface" version="1">
+ <description summary="A desktop window">
+ An interface that may be implemented by a wl_surface, for
+ implementations that provide a desktop-style user interface.
+
+ It provides requests to treat surfaces like windows, allowing to set
+ properties like maximized, fullscreen, minimized, and to move and resize
+ them, and associate metadata like title and app id.
+
+ The client must call wl_surface.commit on the corresponding wl_surface
+ for the xdg_surface state to take effect. Prior to committing the new
+ state, it can set up initial configuration, such as maximizing or setting
+ a window geometry.
+
+ Even without attaching a buffer the compositor must respond to initial
+ committed configuration, for instance sending a configure event with
+ expected window geometry if the client maximized its surface during
+ initialization.
+
+ For a surface to be mapped by the compositor the client must have
+ committed both an xdg_surface state and a buffer.
+ </description>
+
+ <request name="destroy" type="destructor">
+ <description summary="Destroy the xdg_surface">
+ Unmap and destroy the window. The window will be effectively
+ hidden from the user's point of view, and all state like
+ maximization, fullscreen, and so on, will be lost.
+ </description>
+ </request>
+
+ <request name="set_parent">
+ <description summary="set the parent of this surface">
+ Set the "parent" of this surface. This window should be stacked
+ above a parent. The parent surface must be mapped as long as this
+ surface is mapped.
+
+ Parent windows should be set on dialogs, toolboxes, or other
+ "auxiliary" surfaces, so that the parent is raised when the dialog
+ is raised.
+ </description>
+ <arg name="parent" type="object" interface="xdg_surface" allow-null="true"/>
+ </request>
+
+ <request name="set_title">
+ <description summary="set surface title">
+ Set a short title for the surface.
+
+ This string may be used to identify the surface in a task bar,
+ window list, or other user interface elements provided by the
+ compositor.
+
+ The string must be encoded in UTF-8.
+ </description>
+ <arg name="title" type="string"/>
+ </request>
+
+ <request name="set_app_id">
+ <description summary="set application ID">
+ Set an application identifier for the surface.
+
+ The app ID identifies the general class of applications to which
+ the surface belongs. The compositor can use this to group multiple
+ surfaces together, or to determine how to launch a new application.
+
+ For D-Bus activatable applications, the app ID is used as the D-Bus
+ service name.
+
+ The compositor shell will try to group application surfaces together
+ by their app ID. As a best practice, it is suggested to select app
+ ID's that match the basename of the application's .desktop file.
+ For example, "org.freedesktop.FooViewer" where the .desktop file is
+ "org.freedesktop.FooViewer.desktop".
+
+ See the desktop-entry specification [0] for more details on
+ application identifiers and how they relate to well-known D-Bus
+ names and .desktop files.
+
+ [0] http://standards.freedesktop.org/desktop-entry-spec/
+ </description>
+ <arg name="app_id" type="string"/>
+ </request>
+
+ <request name="show_window_menu">
+ <description summary="show the window menu">
+ Clients implementing client-side decorations might want to show
+ a context menu when right-clicking on the decorations, giving the
+ user a menu that they can use to maximize or minimize the window.
+
+ This request asks the compositor to pop up such a window menu at
+ the given position, relative to the local surface coordinates of
+ the parent surface. There are no guarantees as to what menu items
+ the window menu contains.
+
+ This request must be used in response to some sort of user action
+ like a button press, key press, or touch down event.
+ </description>
+ <arg name="seat" type="object" interface="wl_seat" summary="the wl_seat of the user event"/>
+ <arg name="serial" type="uint" summary="the serial of the user event"/>
+ <arg name="x" type="int" summary="the x position to pop up the window menu at"/>
+ <arg name="y" type="int" summary="the y position to pop up the window menu at"/>
+ </request>
+
+ <request name="move">
+ <description summary="start an interactive move">
+ Start an interactive, user-driven move of the surface.
+
+ This request must be used in response to some sort of user action
+ like a button press, key press, or touch down event. The passed
+ serial is used to determine the type of interactive move (touch,
+ pointer, etc).
+
+ The server may ignore move requests depending on the state of
+ the surface (e.g. fullscreen or maximized), or if the passed serial
+ is no longer valid.
+
+ If triggered, the surface will lose the focus of the device
+ (wl_pointer, wl_touch, etc) used for the move. It is up to the
+ compositor to visually indicate that the move is taking place, such as
+ updating a pointer cursor, during the move. There is no guarantee
+ that the device focus will return when the move is completed.
+ </description>
+ <arg name="seat" type="object" interface="wl_seat" summary="the wl_seat of the user event"/>
+ <arg name="serial" type="uint" summary="the serial of the user event"/>
+ </request>
+
+ <enum name="resize_edge">
+ <description summary="edge values for resizing">
+ These values are used to indicate which edge of a surface
+ is being dragged in a resize operation.
+ </description>
+ <entry name="none" value="0"/>
+ <entry name="top" value="1"/>
+ <entry name="bottom" value="2"/>
+ <entry name="left" value="4"/>
+ <entry name="top_left" value="5"/>
+ <entry name="bottom_left" value="6"/>
+ <entry name="right" value="8"/>
+ <entry name="top_right" value="9"/>
+ <entry name="bottom_right" value="10"/>
+ </enum>
+
+ <request name="resize">
+ <description summary="start an interactive resize">
+ Start a user-driven, interactive resize of the surface.
+
+ This request must be used in response to some sort of user action
+ like a button press, key press, or touch down event. The passed
+ serial is used to determine the type of interactive resize (touch,
+ pointer, etc).
+
+ The server may ignore resize requests depending on the state of
+ the surface (e.g. fullscreen or maximized).
+
+ If triggered, the client will receive configure events with the
+ "resize" state enum value and the expected sizes. See the "resize"
+ enum value for more details about what is required. The client
+ must also acknowledge configure events using "ack_configure". After
+ the resize is completed, the client will receive another "configure"
+ event without the resize state.
+
+ If triggered, the surface also will lose the focus of the device
+ (wl_pointer, wl_touch, etc) used for the resize. It is up to the
+ compositor to visually indicate that the resize is taking place,
+ such as updating a pointer cursor, during the resize. There is no
+ guarantee that the device focus will return when the resize is
+ completed.
+
+ The edges parameter specifies how the surface should be resized,
+ and is one of the values of the resize_edge enum. The compositor
+ may use this information to update the surface position for
+ example when dragging the top left corner. The compositor may also
+ use this information to adapt its behavior, e.g. choose an
+ appropriate cursor image.
+ </description>
+ <arg name="seat" type="object" interface="wl_seat" summary="the wl_seat of the user event"/>
+ <arg name="serial" type="uint" summary="the serial of the user event"/>
+ <arg name="edges" type="uint" summary="which edge or corner is being dragged"/>
+ </request>
+
+ <enum name="state">
+ <description summary="types of state on the surface">
+ The different state values used on the surface. This is designed for
+ state values like maximized, fullscreen. It is paired with the
+ configure event to ensure that both the client and the compositor
+ setting the state can be synchronized.
+
+ States set in this way are double-buffered. They will get applied on
+ the next commit.
+
+ Desktop environments may extend this enum by taking up a range of
+ values and documenting the range they chose in this description.
+ They are not required to document the values for the range that they
+ chose. Ideally, any good extensions from a desktop environment should
+ make its way into standardization into this enum.
+
+ The current reserved ranges are:
+
+ 0x0000 - 0x0FFF: xdg-shell core values, documented below.
+ 0x1000 - 0x1FFF: GNOME
+ 0x2000 - 0x2FFF: EFL
+ </description>
+ <entry name="maximized" value="1" summary="the surface is maximized">
+ <description summary="the surface is maximized">
+ The surface is maximized. The window geometry specified in the configure
+ event must be obeyed by the client.
+ </description>
+ </entry>
+ <entry name="fullscreen" value="2" summary="the surface is fullscreen">
+ <description summary="the surface is fullscreen">
+ The surface is fullscreen. The window geometry specified in the configure
+ event must be obeyed by the client.
+ </description>
+ </entry>
+ <entry name="resizing" value="3" summary="the surface is being resized">
+ <description summary="the surface is being resized">
+ The surface is being resized. The window geometry specified in the
+ configure event is a maximum; the client cannot resize beyond it.
+ Clients that have aspect ratio or cell sizing configuration can use
+ a smaller size, however.
+ </description>
+ </entry>
+ <entry name="activated" value="4" summary="the surface is now activated">
+ <description summary="the surface is now activated">
+ Client window decorations should be painted as if the window is
+ active. Do not assume this means that the window actually has
+ keyboard or pointer focus.
+ </description>
+ </entry>
+ </enum>
+
+ <event name="configure">
+ <description summary="suggest a surface change">
+ The configure event asks the client to resize its surface or to
+ change its state.
+
+ The width and height arguments specify a hint to the window
+ about how its surface should be resized in window geometry
+ coordinates. See set_window_geometry.
+
+ If the width or height arguments are zero, it means the client
+ should decide its own window dimension. This may happen when the
+ compositor need to configure the state of the surface but doesn't
+ have any information about any previous or expected dimension.
+
+ The states listed in the event specify how the width/height
+ arguments should be interpreted, and possibly how it should be
+ drawn.
+
+ Clients should arrange their surface for the new size and
+ states, and then send a ack_configure request with the serial
+ sent in this configure event at some point before committing
+ the new surface.
+
+ If the client receives multiple configure events before it
+ can respond to one, it is free to discard all but the last
+ event it received.
+ </description>
+ <arg name="width" type="int"/>
+ <arg name="height" type="int"/>
+ <arg name="states" type="array"/>
+ <arg name="serial" type="uint"/>
+ </event>
+
+ <request name="ack_configure">
+ <description summary="ack a configure event">
+ When a configure event is received, if a client commits the
+ surface in response to the configure event, then the client
+ must make an ack_configure request sometime before the commit
+ request, passing along the serial of the configure event.
+
+ For instance, the compositor might use this information to move
+ a surface to the top left only when the client has drawn itself
+ for the maximized or fullscreen state.
+
+ If the client receives multiple configure events before it
+ can respond to one, it only has to ack the last configure event.
+
+ A client is not required to commit immediately after sending
+ an ack_configure request - it may even ack_configure several times
+ before its next surface commit.
+
+ The compositor expects that the most recently received
+ ack_configure request at the time of a commit indicates which
+ configure event the client is responding to.
+ </description>
+ <arg name="serial" type="uint" summary="the serial from the configure event"/>
+ </request>
+
+ <request name="set_window_geometry">
+ <description summary="set the new window geometry">
+ The window geometry of a window is its "visible bounds" from the
+ user's perspective. Client-side decorations often have invisible
+ portions like drop-shadows which should be ignored for the
+ purposes of aligning, placing and constraining windows.
+
+ The window geometry is double buffered, and will be applied at the
+ time wl_surface.commit of the corresponding wl_surface is called.
+
+ Once the window geometry of the surface is set once, it is not
+ possible to unset it, and it will remain the same until
+ set_window_geometry is called again, even if a new subsurface or
+ buffer is attached.
+
+ If never set, the value is the full bounds of the surface,
+ including any subsurfaces. This updates dynamically on every
+ commit. This unset mode is meant for extremely simple clients.
+
+ If responding to a configure event, the window geometry in here
+ must respect the sizing negotiations specified by the states in
+ the configure event.
+
+ The arguments are given in the surface local coordinate space of
+ the wl_surface associated with this xdg_surface.
+
+ The width and height must be greater than zero.
+ </description>
+ <arg name="x" type="int"/>
+ <arg name="y" type="int"/>
+ <arg name="width" type="int"/>
+ <arg name="height" type="int"/>
+ </request>
+
+ <request name="set_maximized">
+ <description summary="maximize the window">
+ Maximize the surface.
+
+ After requesting that the surface should be maximized, the compositor
+ will respond by emitting a configure event with the "maximized" state
+ and the required window geometry. The client should then update its
+ content, drawing it in a maximized state, i.e. without shadow or other
+ decoration outside of the window geometry. The client must also
+ acknowledge the configure when committing the new content (see
+ ack_configure).
+
+ It is up to the compositor to decide how and where to maximize the
+ surface, for example which output and what region of the screen should
+ be used.
+
+ If the surface was already maximized, the compositor will still emit
+ a configure event with the "maximized" state.
+ </description>
+ </request>
+
+ <request name="unset_maximized">
+ <description summary="unmaximize the window">
+ Unmaximize the surface.
+
+ After requesting that the surface should be unmaximized, the compositor
+ will respond by emitting a configure event without the "maximized"
+ state. If available, the compositor will include the window geometry
+ dimensions the window had prior to being maximized in the configure
+ request. The client must then update its content, drawing it in a
+ regular state, i.e. potentially with shadow, etc. The client must also
+ acknowledge the configure when committing the new content (see
+ ack_configure).
+
+ It is up to the compositor to position the surface after it was
+ unmaximized; usually the position the surface had before maximizing, if
+ applicable.
+
+ If the surface was already not maximized, the compositor will still
+ emit a configure event without the "maximized" state.
+ </description>
+ </request>
+
+ <request name="set_fullscreen">
+ <description summary="set the window as fullscreen on a monitor">
+ Make the surface fullscreen.
+
+ You can specify an output that you would prefer to be fullscreen.
+ If this value is NULL, it's up to the compositor to choose which
+ display will be used to map this surface.
+
+ If the surface doesn't cover the whole output, the compositor will
+ position the surface in the center of the output and compensate with
+ black borders filling the rest of the output.
+ </description>
+ <arg name="output" type="object" interface="wl_output" allow-null="true"/>
+ </request>
+ <request name="unset_fullscreen" />
+
+ <request name="set_minimized">
+ <description summary="set the window as minimized">
+ Request that the compositor minimize your surface. There is no
+ way to know if the surface is currently minimized, nor is there
+ any way to unset minimization on this surface.
+
+ If you are looking to throttle redrawing when minimized, please
+ instead use the wl_surface.frame event for this, as this will
+ also work with live previews on windows in Alt-Tab, Expose or
+ similar compositor features.
+ </description>
+ </request>
+
+ <event name="close">
+ <description summary="surface wants to be closed">
+ The close event is sent by the compositor when the user
+ wants the surface to be closed. This should be equivalent to
+ the user clicking the close button in client-side decorations,
+ if your application has any...
+
+ This is only a request that the user intends to close your
+ window. The client may choose to ignore this request, or show
+ a dialog to ask the user to save their data...
+ </description>
+ </event>
+ </interface>
+
+ <interface name="xdg_popup" version="1">
+ <description summary="short-lived, popup surfaces for menus">
+ A popup surface is a short-lived, temporary surface that can be
+ used to implement menus. It takes an explicit grab on the surface
+ that will be dismissed when the user dismisses the popup. This can
+ be done by the user clicking outside the surface, using the keyboard,
+ or even locking the screen through closing the lid or a timeout.
+
+ When the popup is dismissed, a popup_done event will be sent out,
+ and at the same time the surface will be unmapped. The xdg_popup
+ object is now inert and cannot be reactivated, so clients should
+ destroy it. Explicitly destroying the xdg_popup object will also
+ dismiss the popup and unmap the surface.
+
+ Clients will receive events for all their surfaces during this
+ grab (which is an "owner-events" grab in X11 parlance). This is
+ done so that users can navigate through submenus and other
+ "nested" popup windows without having to dismiss the topmost
+ popup.
+
+ Clients that want to dismiss the popup when another surface of
+ their own is clicked should dismiss the popup using the destroy
+ request.
+
+ The parent surface must have either an xdg_surface or xdg_popup
+ role.
+
+ Specifying an xdg_popup for the parent means that the popups are
+ nested, with this popup now being the topmost popup. Nested
+ popups must be destroyed in the reverse order they were created
+ in, e.g. the only popup you are allowed to destroy at all times
+ is the topmost one.
+
+ If there is an existing popup when creating a new popup, the
+ parent must be the current topmost popup.
+
+ A parent surface must be mapped before the new popup is mapped.
+
+ When compositors choose to dismiss a popup, they will likely
+ dismiss every nested popup as well. When a compositor dismisses
+ popups, it will follow the same dismissing order as required
+ from the client.
+
+ The x and y arguments passed when creating the popup object specify
+ where the top left of the popup should be placed, relative to the
+ local surface coordinates of the parent surface. See
+ xdg_shell.get_xdg_popup.
+
+ The client must call wl_surface.commit on the corresponding wl_surface
+ for the xdg_popup state to take effect.
+
+ For a surface to be mapped by the compositor the client must have
+ committed both the xdg_popup state and a buffer.
+ </description>
+
+ <request name="destroy" type="destructor">
+ <description summary="remove xdg_popup interface">
+ This destroys the popup. Explicitly destroying the xdg_popup
+ object will also dismiss the popup, and unmap the surface.
+
+ If this xdg_popup is not the "topmost" popup, a protocol error
+ will be sent.
+ </description>
+ </request>
+
+ <event name="popup_done">
+ <description summary="popup interaction is done">
+ The popup_done event is sent out when a popup is dismissed by the
+ compositor. The client should destroy the xdg_popup object at this
+ point.
+ </description>
+ </event>
+
+ </interface>
+</protocol>
diff --git a/chromium/third_party/wayland-protocols/src/unstable/xdg-shell/xdg-shell-unstable-v6.xml b/chromium/third_party/wayland-protocols/src/unstable/xdg-shell/xdg-shell-unstable-v6.xml
new file mode 100644
index 00000000000..1c0f92452b9
--- /dev/null
+++ b/chromium/third_party/wayland-protocols/src/unstable/xdg-shell/xdg-shell-unstable-v6.xml
@@ -0,0 +1,1044 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<protocol name="xdg_shell_unstable_v6">
+
+ <copyright>
+ Copyright © 2008-2013 Kristian Høgsberg
+ Copyright © 2013 Rafael Antognolli
+ Copyright © 2013 Jasper St. Pierre
+ Copyright © 2010-2013 Intel Corporation
+
+ Permission is hereby granted, free of charge, to any person obtaining a
+ copy of this software and associated documentation files (the "Software"),
+ to deal in the Software without restriction, including without limitation
+ the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ and/or sell copies of the Software, and to permit persons to whom the
+ Software is furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice (including the next
+ paragraph) shall be included in all copies or substantial portions of the
+ Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ DEALINGS IN THE SOFTWARE.
+ </copyright>
+
+ <interface name="zxdg_shell_v6" version="1">
+ <description summary="create desktop-style surfaces">
+ xdg_shell allows clients to turn a wl_surface into a "real window"
+ which can be dragged, resized, stacked, and moved around by the
+ user. Everything about this interface is suited towards traditional
+ desktop environments.
+ </description>
+
+ <enum name="error">
+ <entry name="role" value="0" summary="given wl_surface has another role"/>
+ <entry name="defunct_surfaces" value="1"
+ summary="xdg_shell was destroyed before children"/>
+ <entry name="not_the_topmost_popup" value="2"
+ summary="the client tried to map or destroy a non-topmost popup"/>
+ <entry name="invalid_popup_parent" value="3"
+ summary="the client specified an invalid popup parent surface"/>
+ <entry name="invalid_surface_state" value="4"
+ summary="the client provided an invalid surface state"/>
+ <entry name="invalid_positioner" value="5"
+ summary="the client provided an invalid positioner"/>
+ </enum>
+
+ <request name="destroy" type="destructor">
+ <description summary="destroy xdg_shell">
+ Destroy this xdg_shell object.
+
+ Destroying a bound xdg_shell object while there are surfaces
+ still alive created by this xdg_shell object instance is illegal
+ and will result in a protocol error.
+ </description>
+ </request>
+
+ <request name="create_positioner">
+ <description summary="create a positioner object">
+ Create a positioner object. A positioner object is used to position
+ surfaces relative to some parent surface. See the interface description
+ and xdg_surface.get_popup for details.
+ </description>
+ <arg name="id" type="new_id" interface="zxdg_positioner_v6"/>
+ </request>
+
+ <request name="get_xdg_surface">
+ <description summary="create a shell surface from a surface">
+ This creates an xdg_surface for the given surface. While xdg_surface
+ itself is not a role, the corresponding surface may only be assigned
+ a role extending xdg_surface, such as xdg_toplevel or xdg_popup.
+
+ This creates an xdg_surface for the given surface. An xdg_surface is
+ used as basis to define a role to a given surface, such as xdg_toplevel
+ or xdg_popup. It also manages functionality shared between xdg_surface
+ based surface roles.
+
+ See the documentation of xdg_surface for more details about what an
+ xdg_surface is and how it is used.
+ </description>
+ <arg name="id" type="new_id" interface="zxdg_surface_v6"/>
+ <arg name="surface" type="object" interface="wl_surface"/>
+ </request>
+
+ <request name="pong">
+ <description summary="respond to a ping event">
+ A client must respond to a ping event with a pong request or
+ the client may be deemed unresponsive. See xdg_shell.ping.
+ </description>
+ <arg name="serial" type="uint" summary="serial of the ping event"/>
+ </request>
+
+ <event name="ping">
+ <description summary="check if the client is alive">
+ The ping event asks the client if it's still alive. Pass the
+ serial specified in the event back to the compositor by sending
+ a "pong" request back with the specified serial. See xdg_shell.ping.
+
+ Compositors can use this to determine if the client is still
+ alive. It's unspecified what will happen if the client doesn't
+ respond to the ping request, or in what timeframe. Clients should
+ try to respond in a reasonable amount of time.
+
+ A compositor is free to ping in any way it wants, but a client must
+ always respond to any xdg_shell object it created.
+ </description>
+ <arg name="serial" type="uint" summary="pass this to the pong request"/>
+ </event>
+ </interface>
+
+ <interface name="zxdg_positioner_v6" version="1">
+ <description summary="child surface positioner">
+ The xdg_positioner provides a collection of rules for the placement of a
+ child surface relative to a parent surface. Rules can be defined to ensure
+ the child surface remains within the visible area's borders, and to
+ specify how the child surface changes its position, such as sliding along
+ an axis, or flipping around a rectangle. These positioner-created rules are
+ constrained by the requirement that a child surface must intersect with or
+ be at least partially adjacent to its parent surface.
+
+ See the various requests for details about possible rules.
+
+ At the time of the request, the compositor makes a copy of the rules
+ specified by the xdg_positioner. Thus, after the request is complete the
+ xdg_positioner object can be destroyed or reused; further changes to the
+ object will have no effect on previous usages.
+
+ For an xdg_positioner object to be considered complete, it must have a
+ non-zero size set by set_size, and a non-zero anchor rectangle set by
+ set_anchor_rect. Passing an incomplete xdg_positioner object when
+ positioning a surface raises an error.
+ </description>
+
+ <enum name="error">
+ <entry name="invalid_input" value="0" summary="invalid input provided"/>
+ </enum>
+
+ <request name="destroy" type="destructor">
+ <description summary="destroy the xdg_positioner object">
+ Notify the compositor that the xdg_positioner will no longer be used.
+ </description>
+ </request>
+
+ <request name="set_size">
+ <description summary="set the size of the to-be positioned rectangle">
+ Set the size of the surface that is to be positioned with the positioner
+ object. The size is in surface-local coordinates and corresponds to the
+ window geometry. See xdg_surface.set_window_geometry.
+
+ If a zero or negative size is set the invalid_input error is raised.
+ </description>
+ <arg name="width" type="int" summary="width of positioned rectangle"/>
+ <arg name="height" type="int" summary="height of positioned rectangle"/>
+ </request>
+
+ <request name="set_anchor_rect">
+ <description summary="set the anchor rectangle within the parent surface">
+ Specify the anchor rectangle within the parent surface that the child
+ surface will be placed relative to. The rectangle is relative to the
+ window geometry as defined by xdg_surface.set_window_geometry of the
+ parent surface. The rectangle must be at least 1x1 large.
+
+ When the xdg_positioner object is used to position a child surface, the
+ anchor rectangle may not extend outside the window geometry of the
+ positioned child's parent surface.
+
+ If a zero or negative size is set the invalid_input error is raised.
+ </description>
+ <arg name="x" type="int" summary="x position of anchor rectangle"/>
+ <arg name="y" type="int" summary="y position of anchor rectangle"/>
+ <arg name="width" type="int" summary="width of anchor rectangle"/>
+ <arg name="height" type="int" summary="height of anchor rectangle"/>
+ </request>
+
+ <enum name="anchor" bitfield="true">
+ <entry name="none" value="0"
+ summary="the center of the anchor rectangle"/>
+ <entry name="top" value="1"
+ summary="the top edge of the anchor rectangle"/>
+ <entry name="bottom" value="2"
+ summary="the bottom edge of the anchor rectangle"/>
+ <entry name="left" value="4"
+ summary="the left edge of the anchor rectangle"/>
+ <entry name="right" value="8"
+ summary="the right edge of the anchor rectangle"/>
+ </enum>
+
+ <request name="set_anchor">
+ <description summary="set anchor rectangle anchor edges">
+ Defines a set of edges for the anchor rectangle. These are used to
+ derive an anchor point that the child surface will be positioned
+ relative to. If two orthogonal edges are specified (e.g. 'top' and
+ 'left'), then the anchor point will be the intersection of the edges
+ (e.g. the top left position of the rectangle); otherwise, the derived
+ anchor point will be centered on the specified edge, or in the center of
+ the anchor rectangle if no edge is specified.
+
+ If two parallel anchor edges are specified (e.g. 'left' and 'right'),
+ the invalid_input error is raised.
+ </description>
+ <arg name="anchor" type="uint" enum="anchor"
+ summary="bit mask of anchor edges"/>
+ </request>
+
+ <enum name="gravity" bitfield="true">
+ <entry name="none" value="0"
+ summary="center over the anchor edge"/>
+ <entry name="top" value="1"
+ summary="position above the anchor edge"/>
+ <entry name="bottom" value="2"
+ summary="position below the anchor edge"/>
+ <entry name="left" value="4"
+ summary="position to the left of the anchor edge"/>
+ <entry name="right" value="8"
+ summary="position to the right of the anchor edge"/>
+ </enum>
+
+ <request name="set_gravity">
+ <description summary="set child surface gravity">
+ Defines in what direction a surface should be positioned, relative to
+ the anchor point of the parent surface. If two orthogonal gravities are
+ specified (e.g. 'bottom' and 'right'), then the child surface will be
+ placed in the specified direction; otherwise, the child surface will be
+ centered over the anchor point on any axis that had no gravity
+ specified.
+
+ If two parallel gravities are specified (e.g. 'left' and 'right'), the
+ invalid_input error is raised.
+ </description>
+ <arg name="gravity" type="uint" enum="gravity"
+ summary="bit mask of gravity directions"/>
+ </request>
+
+ <enum name="constraint_adjustment" bitfield="true">
+ <description summary="constraint adjustments">
+ The constraint adjustment value define ways the compositor will adjust
+ the position of the surface, if the unadjusted position would result
+ in the surface being partly constrained.
+
+ Whether a surface is considered 'constrained' is left to the compositor
+ to determine. For example, the surface may be partly outside the
+ compositor's defined 'work area', thus necessitating the child surface's
+ position be adjusted until it is entirely inside the work area.
+
+ The adjustments can be combined, according to a defined precedence: 1)
+ Flip, 2) Slide, 3) Resize.
+ </description>
+ <entry name="none" value="0">
+ <description summary="don't move the child surface when constrained">
+ Don't alter the surface position even if it is constrained on some
+ axis, for example partially outside the edge of a monitor.
+ </description>
+ </entry>
+ <entry name="slide_x" value="1">
+ <description summary="move along the x axis until unconstrained">
+ Slide the surface along the x axis until it is no longer constrained.
+
+ First try to slide towards the direction of the gravity on the x axis
+ until either the edge in the opposite direction of the gravity is
+ unconstrained or the edge in the direction of the gravity is
+ constrained.
+
+ Then try to slide towards the opposite direction of the gravity on the
+ x axis until either the edge in the direction of the gravity is
+ unconstrained or the edge in the opposite direction of the gravity is
+ constrained.
+ </description>
+ </entry>
+ <entry name="slide_y" value="2">
+ <description summary="move along the y axis until unconstrained">
+ Slide the surface along the y axis until it is no longer constrained.
+
+ First try to slide towards the direction of the gravity on the y axis
+ until either the edge in the opposite direction of the gravity is
+ unconstrained or the edge in the direction of the gravity is
+ constrained.
+
+ Then try to slide towards the opposite direction of the gravity on the
+ y axis until either the edge in the direction of the gravity is
+ unconstrained or the edge in the opposite direction of the gravity is
+ constrained.
+ </description>
+ </entry>
+ <entry name="flip_x" value="4">
+ <description summary="invert the anchor and gravity on the x axis">
+ Invert the anchor and gravity on the x axis if the surface is
+ constrained on the x axis. For example, if the left edge of the
+ surface is constrained, the gravity is 'left' and the anchor is
+ 'left', change the gravity to 'right' and the anchor to 'right'.
+
+ If the adjusted position also ends up being constrained, the resulting
+ position of the flip_x adjustment will be the one before the
+ adjustment.
+ </description>
+ </entry>
+ <entry name="flip_y" value="8">
+ <description summary="invert the anchor and gravity on the y axis">
+ Invert the anchor and gravity on the y axis if the surface is
+ constrained on the y axis. For example, if the bottom edge of the
+ surface is constrained, the gravity is 'bottom' and the anchor is
+ 'bottom', change the gravity to 'top' and the anchor to 'top'.
+
+ If the adjusted position also ends up being constrained, the resulting
+ position of the flip_y adjustment will be the one before the
+ adjustment.
+ </description>
+ </entry>
+ <entry name="resize_x" value="16">
+ <description summary="horizontally resize the surface">
+ Resize the surface horizontally so that it is completely
+ unconstrained.
+ </description>
+ </entry>
+ <entry name="resize_y" value="32">
+ <description summary="vertically resize the surface">
+ Resize the surface vertically so that it is completely unconstrained.
+ </description>
+ </entry>
+ </enum>
+
+ <request name="set_constraint_adjustment">
+ <description summary="set the adjustment to be done when constrained">
+ Specify how the window should be positioned if the originally intended
+ position caused the surface to be constrained, meaning at least
+ partially outside positioning boundaries set by the compositor. The
+ adjustment is set by constructing a bitmask describing the adjustment to
+ be made when the surface is constrained on that axis.
+
+ If no bit for one axis is set, the compositor will assume that the child
+ surface should not change its position on that axis when constrained.
+
+ If more than one bit for one axis is set, the order of how adjustments
+ are applied is specified in the corresponding adjustment descriptions.
+
+ The default adjustment is none.
+ </description>
+ <arg name="constraint_adjustment" type="uint"
+ summary="bit mask of constraint adjustments"/>
+ </request>
+
+ <request name="set_offset">
+ <description summary="set surface position offset">
+ Specify the surface position offset relative to the position of the
+ anchor on the anchor rectangle and the anchor on the surface. For
+ example if the anchor of the anchor rectangle is at (x, y), the surface
+ has the gravity bottom|right, and the offset is (ox, oy), the calculated
+ surface position will be (x + ox, y + oy). The offset position of the
+ surface is the one used for constraint testing. See
+ set_constraint_adjustment.
+
+ An example use case is placing a popup menu on top of a user interface
+ element, while aligning the user interface element of the parent surface
+ with some user interface element placed somewhere in the popup surface.
+ </description>
+ <arg name="x" type="int" summary="surface position x offset"/>
+ <arg name="y" type="int" summary="surface position y offset"/>
+ </request>
+ </interface>
+
+ <interface name="zxdg_surface_v6" version="1">
+ <description summary="desktop user interface surface base interface">
+ An interface that may be implemented by a wl_surface, for
+ implementations that provide a desktop-style user interface.
+
+ It provides a base set of functionality required to construct user
+ interface elements requiring management by the compositor, such as
+ toplevel windows, menus, etc. The types of functionality are split into
+ xdg_surface roles.
+
+ Creating an xdg_surface does not set the role for a wl_surface. In order
+ to map an xdg_surface, the client must create a role-specific object
+ using, e.g., get_toplevel, get_popup. The wl_surface for any given
+ xdg_surface can have at most one role, and may not be assigned any role
+ not based on xdg_surface.
+
+ A role must be assigned before any other requests are made to the
+ xdg_surface object.
+
+ The client must call wl_surface.commit on the corresponding wl_surface
+ for the xdg_surface state to take effect.
+
+ Creating an xdg_surface from a wl_surface which has a buffer attached or
+ committed is a client error, and any attempts by a client to attach or
+ manipulate a buffer prior to the first xdg_surface.configure call must
+ also be treated as errors.
+
+ For a surface to be mapped by the compositor, the following conditions
+ must be met: (1) the client has assigned a xdg_surface based role to the
+ surface, (2) the client has set and committed the xdg_surface state and
+ the role dependent state to the surface and (3) the client has committed a
+ buffer to the surface.
+ </description>
+
+ <enum name="error">
+ <entry name="not_constructed" value="1"/>
+ <entry name="already_constructed" value="2"/>
+ <entry name="unconfigured_buffer" value="3"/>
+ </enum>
+
+ <request name="destroy" type="destructor">
+ <description summary="destroy the xdg_surface">
+ Destroy the xdg_surface object. An xdg_surface must only be destroyed
+ after its role object has been destroyed.
+ </description>
+ </request>
+
+ <request name="get_toplevel">
+ <description summary="assign the xdg_toplevel surface role">
+ This creates an xdg_toplevel object for the given xdg_surface and gives
+ the associated wl_surface the xdg_toplevel role.
+
+ See the documentation of xdg_toplevel for more details about what an
+ xdg_toplevel is and how it is used.
+ </description>
+ <arg name="id" type="new_id" interface="zxdg_toplevel_v6"/>
+ </request>
+
+ <request name="get_popup">
+ <description summary="assign the xdg_popup surface role">
+ This creates an xdg_popup object for the given xdg_surface and gives the
+ associated wl_surface the xdg_popup role.
+
+ See the documentation of xdg_popup for more details about what an
+ xdg_popup is and how it is used.
+ </description>
+ <arg name="id" type="new_id" interface="zxdg_popup_v6"/>
+ <arg name="parent" type="object" interface="zxdg_surface_v6"/>
+ <arg name="positioner" type="object" interface="zxdg_positioner_v6"/>
+ </request>
+
+ <request name="set_window_geometry">
+ <description summary="set the new window geometry">
+ The window geometry of a surface is its "visible bounds" from the
+ user's perspective. Client-side decorations often have invisible
+ portions like drop-shadows which should be ignored for the
+ purposes of aligning, placing and constraining windows.
+
+ The window geometry is double buffered, and will be applied at the
+ time wl_surface.commit of the corresponding wl_surface is called.
+
+ Once the window geometry of the surface is set, it is not possible to
+ unset it, and it will remain the same until set_window_geometry is
+ called again, even if a new subsurface or buffer is attached.
+
+ If never set, the value is the full bounds of the surface,
+ including any subsurfaces. This updates dynamically on every
+ commit. This unset is meant for extremely simple clients.
+
+ The arguments are given in the surface-local coordinate space of
+ the wl_surface associated with this xdg_surface.
+
+ The width and height must be greater than zero. Setting an invalid size
+ will raise an error. When applied, the effective window geometry will be
+ the set window geometry clamped to the bounding rectangle of the
+ combined geometry of the surface of the xdg_surface and the associated
+ subsurfaces.
+ </description>
+ <arg name="x" type="int"/>
+ <arg name="y" type="int"/>
+ <arg name="width" type="int"/>
+ <arg name="height" type="int"/>
+ </request>
+
+ <request name="ack_configure">
+ <description summary="ack a configure event">
+ When a configure event is received, if a client commits the
+ surface in response to the configure event, then the client
+ must make an ack_configure request sometime before the commit
+ request, passing along the serial of the configure event.
+
+ For instance, for toplevel surfaces the compositor might use this
+ information to move a surface to the top left only when the client has
+ drawn itself for the maximized or fullscreen state.
+
+ If the client receives multiple configure events before it
+ can respond to one, it only has to ack the last configure event.
+
+ A client is not required to commit immediately after sending
+ an ack_configure request - it may even ack_configure several times
+ before its next surface commit.
+
+ A client may send multiple ack_configure requests before committing, but
+ only the last request sent before a commit indicates which configure
+ event the client really is responding to.
+ </description>
+ <arg name="serial" type="uint" summary="the serial from the configure event"/>
+ </request>
+
+ <event name="configure">
+ <description summary="suggest a surface change">
+ The configure event marks the end of a configure sequence. A configure
+ sequence is a set of one or more events configuring the state of the
+ xdg_surface, including the final xdg_surface.configure event.
+
+ Where applicable, xdg_surface surface roles will during a configure
+ sequence extend this event as a latched state sent as events before the
+ xdg_surface.configure event. Such events should be considered to make up
+ a set of atomically applied configuration states, where the
+ xdg_surface.configure commits the accumulated state.
+
+ Clients should arrange their surface for the new states, and then send
+ an ack_configure request with the serial sent in this configure event at
+ some point before committing the new surface.
+
+ If the client receives multiple configure events before it can respond
+ to one, it is free to discard all but the last event it received.
+ </description>
+ <arg name="serial" type="uint" summary="serial of the configure event"/>
+ </event>
+ </interface>
+
+ <interface name="zxdg_toplevel_v6" version="1">
+ <description summary="toplevel surface">
+ This interface defines an xdg_surface role which allows a surface to,
+ among other things, set window-like properties such as maximize,
+ fullscreen, and minimize, set application-specific metadata like title and
+ id, and well as trigger user interactive operations such as interactive
+ resize and move.
+ </description>
+
+ <request name="destroy" type="destructor">
+ <description summary="destroy the xdg_toplevel">
+ Unmap and destroy the window. The window will be effectively
+ hidden from the user's point of view, and all state like
+ maximization, fullscreen, and so on, will be lost.
+ </description>
+ </request>
+
+ <request name="set_parent">
+ <description summary="set the parent of this surface">
+ Set the "parent" of this surface. This window should be stacked
+ above a parent. The parent surface must be mapped as long as this
+ surface is mapped.
+
+ Parent windows should be set on dialogs, toolboxes, or other
+ "auxiliary" surfaces, so that the parent is raised when the dialog
+ is raised.
+ </description>
+ <arg name="parent" type="object" interface="zxdg_toplevel_v6" allow-null="true"/>
+ </request>
+
+ <request name="set_title">
+ <description summary="set surface title">
+ Set a short title for the surface.
+
+ This string may be used to identify the surface in a task bar,
+ window list, or other user interface elements provided by the
+ compositor.
+
+ The string must be encoded in UTF-8.
+ </description>
+ <arg name="title" type="string"/>
+ </request>
+
+ <request name="set_app_id">
+ <description summary="set application ID">
+ Set an application identifier for the surface.
+
+ The app ID identifies the general class of applications to which
+ the surface belongs. The compositor can use this to group multiple
+ surfaces together, or to determine how to launch a new application.
+
+ For D-Bus activatable applications, the app ID is used as the D-Bus
+ service name.
+
+ The compositor shell will try to group application surfaces together
+ by their app ID. As a best practice, it is suggested to select app
+ ID's that match the basename of the application's .desktop file.
+ For example, "org.freedesktop.FooViewer" where the .desktop file is
+ "org.freedesktop.FooViewer.desktop".
+
+ See the desktop-entry specification [0] for more details on
+ application identifiers and how they relate to well-known D-Bus
+ names and .desktop files.
+
+ [0] http://standards.freedesktop.org/desktop-entry-spec/
+ </description>
+ <arg name="app_id" type="string"/>
+ </request>
+
+ <request name="show_window_menu">
+ <description summary="show the window menu">
+ Clients implementing client-side decorations might want to show
+ a context menu when right-clicking on the decorations, giving the
+ user a menu that they can use to maximize or minimize the window.
+
+ This request asks the compositor to pop up such a window menu at
+ the given position, relative to the local surface coordinates of
+ the parent surface. There are no guarantees as to what menu items
+ the window menu contains.
+
+ This request must be used in response to some sort of user action
+ like a button press, key press, or touch down event.
+ </description>
+ <arg name="seat" type="object" interface="wl_seat" summary="the wl_seat of the user event"/>
+ <arg name="serial" type="uint" summary="the serial of the user event"/>
+ <arg name="x" type="int" summary="the x position to pop up the window menu at"/>
+ <arg name="y" type="int" summary="the y position to pop up the window menu at"/>
+ </request>
+
+ <request name="move">
+ <description summary="start an interactive move">
+ Start an interactive, user-driven move of the surface.
+
+ This request must be used in response to some sort of user action
+ like a button press, key press, or touch down event. The passed
+ serial is used to determine the type of interactive move (touch,
+ pointer, etc).
+
+ The server may ignore move requests depending on the state of
+ the surface (e.g. fullscreen or maximized), or if the passed serial
+ is no longer valid.
+
+ If triggered, the surface will lose the focus of the device
+ (wl_pointer, wl_touch, etc) used for the move. It is up to the
+ compositor to visually indicate that the move is taking place, such as
+ updating a pointer cursor, during the move. There is no guarantee
+ that the device focus will return when the move is completed.
+ </description>
+ <arg name="seat" type="object" interface="wl_seat" summary="the wl_seat of the user event"/>
+ <arg name="serial" type="uint" summary="the serial of the user event"/>
+ </request>
+
+ <enum name="resize_edge">
+ <description summary="edge values for resizing">
+ These values are used to indicate which edge of a surface
+ is being dragged in a resize operation.
+ </description>
+ <entry name="none" value="0"/>
+ <entry name="top" value="1"/>
+ <entry name="bottom" value="2"/>
+ <entry name="left" value="4"/>
+ <entry name="top_left" value="5"/>
+ <entry name="bottom_left" value="6"/>
+ <entry name="right" value="8"/>
+ <entry name="top_right" value="9"/>
+ <entry name="bottom_right" value="10"/>
+ </enum>
+
+ <request name="resize">
+ <description summary="start an interactive resize">
+ Start a user-driven, interactive resize of the surface.
+
+ This request must be used in response to some sort of user action
+ like a button press, key press, or touch down event. The passed
+ serial is used to determine the type of interactive resize (touch,
+ pointer, etc).
+
+ The server may ignore resize requests depending on the state of
+ the surface (e.g. fullscreen or maximized).
+
+ If triggered, the client will receive configure events with the
+ "resize" state enum value and the expected sizes. See the "resize"
+ enum value for more details about what is required. The client
+ must also acknowledge configure events using "ack_configure". After
+ the resize is completed, the client will receive another "configure"
+ event without the resize state.
+
+ If triggered, the surface also will lose the focus of the device
+ (wl_pointer, wl_touch, etc) used for the resize. It is up to the
+ compositor to visually indicate that the resize is taking place,
+ such as updating a pointer cursor, during the resize. There is no
+ guarantee that the device focus will return when the resize is
+ completed.
+
+ The edges parameter specifies how the surface should be resized,
+ and is one of the values of the resize_edge enum. The compositor
+ may use this information to update the surface position for
+ example when dragging the top left corner. The compositor may also
+ use this information to adapt its behavior, e.g. choose an
+ appropriate cursor image.
+ </description>
+ <arg name="seat" type="object" interface="wl_seat" summary="the wl_seat of the user event"/>
+ <arg name="serial" type="uint" summary="the serial of the user event"/>
+ <arg name="edges" type="uint" summary="which edge or corner is being dragged"/>
+ </request>
+
+ <enum name="state">
+ <description summary="types of state on the surface">
+ The different state values used on the surface. This is designed for
+ state values like maximized, fullscreen. It is paired with the
+ configure event to ensure that both the client and the compositor
+ setting the state can be synchronized.
+
+ States set in this way are double-buffered. They will get applied on
+ the next commit.
+ </description>
+ <entry name="maximized" value="1" summary="the surface is maximized">
+ <description summary="the surface is maximized">
+ The surface is maximized. The window geometry specified in the configure
+ event must be obeyed by the client.
+ </description>
+ </entry>
+ <entry name="fullscreen" value="2" summary="the surface is fullscreen">
+ <description summary="the surface is fullscreen">
+ The surface is fullscreen. The window geometry specified in the configure
+ event must be obeyed by the client.
+ </description>
+ </entry>
+ <entry name="resizing" value="3" summary="the surface is being resized">
+ <description summary="the surface is being resized">
+ The surface is being resized. The window geometry specified in the
+ configure event is a maximum; the client cannot resize beyond it.
+ Clients that have aspect ratio or cell sizing configuration can use
+ a smaller size, however.
+ </description>
+ </entry>
+ <entry name="activated" value="4" summary="the surface is now activated">
+ <description summary="the surface is now activated">
+ Client window decorations should be painted as if the window is
+ active. Do not assume this means that the window actually has
+ keyboard or pointer focus.
+ </description>
+ </entry>
+ </enum>
+
+ <request name="set_max_size">
+ <description summary="set the maximum size">
+ Set a maximum size for the window.
+
+ The client can specify a maximum size so that the compositor does
+ not try to configure the window beyond this size.
+
+ The width and height arguments are in window geometry coordinates.
+ See xdg_surface.set_window_geometry.
+
+ Values set in this way are double-buffered. They will get applied
+ on the next commit.
+
+ The compositor can use this information to allow or disallow
+ different states like maximize or fullscreen and draw accurate
+ animations.
+
+ Similarly, a tiling window manager may use this information to
+ place and resize client windows in a more effective way.
+
+ The client should not rely on the compositor to obey the maximum
+ size. The compositor may decide to ignore the values set by the
+ client and request a larger size.
+
+ If never set, or a value of zero in the request, means that the
+ client has no expected maximum size in the given dimension.
+ As a result, a client wishing to reset the maximum size
+ to an unspecified state can use zero for width and height in the
+ request.
+
+ Requesting a maximum size to be smaller than the minimum size of
+ a surface is illegal and will result in a protocol error.
+
+ The width and height must be greater than or equal to zero. Using
+ strictly negative values for width and height will result in a
+ protocol error.
+ </description>
+ <arg name="width" type="int"/>
+ <arg name="height" type="int"/>
+ </request>
+
+ <request name="set_min_size">
+ <description summary="set the minimum size">
+ Set a minimum size for the window.
+
+ The client can specify a minimum size so that the compositor does
+ not try to configure the window below this size.
+
+ The width and height arguments are in window geometry coordinates.
+ See xdg_surface.set_window_geometry.
+
+ Values set in this way are double-buffered. They will get applied
+ on the next commit.
+
+ The compositor can use this information to allow or disallow
+ different states like maximize or fullscreen and draw accurate
+ animations.
+
+ Similarly, a tiling window manager may use this information to
+ place and resize client windows in a more effective way.
+
+ The client should not rely on the compositor to obey the minimum
+ size. The compositor may decide to ignore the values set by the
+ client and request a smaller size.
+
+ If never set, or a value of zero in the request, means that the
+ client has no expected minimum size in the given dimension.
+ As a result, a client wishing to reset the minimum size
+ to an unspecified state can use zero for width and height in the
+ request.
+
+ Requesting a minimum size to be larger than the maximum size of
+ a surface is illegal and will result in a protocol error.
+
+ The width and height must be greater than or equal to zero. Using
+ strictly negative values for width and height will result in a
+ protocol error.
+ </description>
+ <arg name="width" type="int"/>
+ <arg name="height" type="int"/>
+ </request>
+
+ <request name="set_maximized">
+ <description summary="maximize the window">
+ Maximize the surface.
+
+ After requesting that the surface should be maximized, the compositor
+ will respond by emitting a configure event with the "maximized" state
+ and the required window geometry. The client should then update its
+ content, drawing it in a maximized state, i.e. without shadow or other
+ decoration outside of the window geometry. The client must also
+ acknowledge the configure when committing the new content (see
+ ack_configure).
+
+ It is up to the compositor to decide how and where to maximize the
+ surface, for example which output and what region of the screen should
+ be used.
+
+ If the surface was already maximized, the compositor will still emit
+ a configure event with the "maximized" state.
+ </description>
+ </request>
+
+ <request name="unset_maximized">
+ <description summary="unmaximize the window">
+ Unmaximize the surface.
+
+ After requesting that the surface should be unmaximized, the compositor
+ will respond by emitting a configure event without the "maximized"
+ state. If available, the compositor will include the window geometry
+ dimensions the window had prior to being maximized in the configure
+ request. The client must then update its content, drawing it in a
+ regular state, i.e. potentially with shadow, etc. The client must also
+ acknowledge the configure when committing the new content (see
+ ack_configure).
+
+ It is up to the compositor to position the surface after it was
+ unmaximized; usually the position the surface had before maximizing, if
+ applicable.
+
+ If the surface was already not maximized, the compositor will still
+ emit a configure event without the "maximized" state.
+ </description>
+ </request>
+
+ <request name="set_fullscreen">
+ <description summary="set the window as fullscreen on a monitor">
+ Make the surface fullscreen.
+
+ You can specify an output that you would prefer to be fullscreen.
+ If this value is NULL, it's up to the compositor to choose which
+ display will be used to map this surface.
+
+ If the surface doesn't cover the whole output, the compositor will
+ position the surface in the center of the output and compensate with
+ black borders filling the rest of the output.
+ </description>
+ <arg name="output" type="object" interface="wl_output" allow-null="true"/>
+ </request>
+ <request name="unset_fullscreen" />
+
+ <request name="set_minimized">
+ <description summary="set the window as minimized">
+ Request that the compositor minimize your surface. There is no
+ way to know if the surface is currently minimized, nor is there
+ any way to unset minimization on this surface.
+
+ If you are looking to throttle redrawing when minimized, please
+ instead use the wl_surface.frame event for this, as this will
+ also work with live previews on windows in Alt-Tab, Expose or
+ similar compositor features.
+ </description>
+ </request>
+
+ <event name="configure">
+ <description summary="suggest a surface change">
+ This configure event asks the client to resize its toplevel surface or
+ to change its state. The configured state should not be applied
+ immediately. See xdg_surface.configure for details.
+
+ The width and height arguments specify a hint to the window
+ about how its surface should be resized in window geometry
+ coordinates. See set_window_geometry.
+
+ If the width or height arguments are zero, it means the client
+ should decide its own window dimension. This may happen when the
+ compositor needs to configure the state of the surface but doesn't
+ have any information about any previous or expected dimension.
+
+ The states listed in the event specify how the width/height
+ arguments should be interpreted, and possibly how it should be
+ drawn.
+
+ Clients must send an ack_configure in response to this event. See
+ xdg_surface.configure and xdg_surface.ack_configure for details.
+ </description>
+ <arg name="width" type="int"/>
+ <arg name="height" type="int"/>
+ <arg name="states" type="array"/>
+ </event>
+
+ <event name="close">
+ <description summary="surface wants to be closed">
+ The close event is sent by the compositor when the user
+ wants the surface to be closed. This should be equivalent to
+ the user clicking the close button in client-side decorations,
+ if your application has any.
+
+ This is only a request that the user intends to close the
+ window. The client may choose to ignore this request, or show
+ a dialog to ask the user to save their data, etc.
+ </description>
+ </event>
+ </interface>
+
+ <interface name="zxdg_popup_v6" version="1">
+ <description summary="short-lived, popup surfaces for menus">
+ A popup surface is a short-lived, temporary surface. It can be used to
+ implement for example menus, popovers, tooltips and other similar user
+ interface concepts.
+
+ A popup can be made to take an explicit grab. See xdg_popup.grab for
+ details.
+
+ When the popup is dismissed, a popup_done event will be sent out, and at
+ the same time the surface will be unmapped. See the xdg_popup.popup_done
+ event for details.
+
+ Explicitly destroying the xdg_popup object will also dismiss the popup and
+ unmap the surface. Clients that want to dismiss the popup when another
+ surface of their own is clicked should dismiss the popup using the destroy
+ request.
+
+ The parent surface must have either the xdg_toplevel or xdg_popup surface
+ role.
+
+ A newly created xdg_popup will be stacked on top of all previously created
+ xdg_popup surfaces associated with the same xdg_toplevel.
+
+ The parent of an xdg_popup must be mapped (see the xdg_surface
+ description) before the xdg_popup itself.
+
+ The x and y arguments passed when creating the popup object specify
+ where the top left of the popup should be placed, relative to the
+ local surface coordinates of the parent surface. See
+ xdg_surface.get_popup. An xdg_popup must intersect with or be at least
+ partially adjacent to its parent surface.
+
+ The client must call wl_surface.commit on the corresponding wl_surface
+ for the xdg_popup state to take effect.
+ </description>
+
+ <enum name="error">
+ <entry name="invalid_grab" value="0"
+ summary="tried to grab after being mapped"/>
+ </enum>
+
+ <request name="destroy" type="destructor">
+ <description summary="remove xdg_popup interface">
+ This destroys the popup. Explicitly destroying the xdg_popup
+ object will also dismiss the popup, and unmap the surface.
+
+ If this xdg_popup is not the "topmost" popup, a protocol error
+ will be sent.
+ </description>
+ </request>
+
+ <request name="grab">
+ <description summary="make the popup take an explicit grab">
+ This request makes the created popup take an explicit grab. An explicit
+ grab will be dismissed when the user dismisses the popup, or when the
+ client destroys the xdg_popup. This can be done by the user clicking
+ outside the surface, using the keyboard, or even locking the screen
+ through closing the lid or a timeout.
+
+ If the compositor denies the grab, the popup will be immediately
+ dismissed.
+
+ This request must be used in response to some sort of user action like a
+ button press, key press, or touch down event. The serial number of the
+ event should be passed as 'serial'.
+
+ The parent of a grabbing popup must either be an xdg_toplevel surface or
+ another xdg_popup with an explicit grab. If the parent is another
+ xdg_popup it means that the popups are nested, with this popup now being
+ the topmost popup.
+
+ Nested popups must be destroyed in the reverse order they were created
+ in, e.g. the only popup you are allowed to destroy at all times is the
+ topmost one.
+
+ When compositors choose to dismiss a popup, they may dismiss every
+ nested grabbing popup as well. When a compositor dismisses popups, it
+ will follow the same dismissing order as required from the client.
+
+ The parent of a grabbing popup must either be another xdg_popup with an
+ active explicit grab, or an xdg_popup or xdg_toplevel, if there are no
+ explicit grabs already taken.
+
+ If the topmost grabbing popup is destroyed, the grab will be returned to
+ the parent of the popup, if that parent previously had an explicit grab.
+
+ If the parent is a grabbing popup which has already been dismissed, this
+ popup will be immediately dismissed. If the parent is a popup that did
+ not take an explicit grab, an error will be raised.
+
+ During a popup grab, the client owning the grab will receive pointer
+ and touch events for all their surfaces as normal (similar to an
+ "owner-events" grab in X11 parlance), while the top most grabbing popup
+ will always have keyboard focus.
+ </description>
+ <arg name="seat" type="object" interface="wl_seat"
+ summary="the wl_seat of the user event"/>
+ <arg name="serial" type="uint" summary="the serial of the user event"/>
+ </request>
+
+ <event name="configure">
+ <description summary="configure the popup surface">
+ This event asks the popup surface to configure itself given the
+ configuration. The configured state should not be applied immediately.
+ See xdg_surface.configure for details.
+
+ The x and y arguments represent the position the popup was placed at
+ given the xdg_positioner rule, relative to the upper left corner of the
+ window geometry of the parent surface.
+ </description>
+ <arg name="x" type="int"
+ summary="x position relative to parent surface window geometry"/>
+ <arg name="y" type="int"
+ summary="y position relative to parent surface window geometry"/>
+ <arg name="width" type="int" summary="window geometry width"/>
+ <arg name="height" type="int" summary="window geometry height"/>
+ </event>
+
+ <event name="popup_done">
+ <description summary="popup interaction is done">
+ The popup_done event is sent out when a popup is dismissed by the
+ compositor. The client should destroy the xdg_popup object at this
+ point.
+ </description>
+ </event>
+
+ </interface>
+</protocol>
diff --git a/chromium/third_party/wayland-protocols/src/wayland-protocols-uninstalled.pc.in b/chromium/third_party/wayland-protocols/src/wayland-protocols-uninstalled.pc.in
new file mode 100644
index 00000000000..cf7adf257a7
--- /dev/null
+++ b/chromium/third_party/wayland-protocols/src/wayland-protocols-uninstalled.pc.in
@@ -0,0 +1,5 @@
+pkgdatadir=@abs_top_srcdir@
+
+Name: Wayland Protocols
+Description: Wayland protocol files (not installed)
+Version: @WAYLAND_PROTOCOLS_VERSION@
diff --git a/chromium/third_party/wayland-protocols/src/wayland-protocols.pc.in b/chromium/third_party/wayland-protocols/src/wayland-protocols.pc.in
new file mode 100644
index 00000000000..a26744cd748
--- /dev/null
+++ b/chromium/third_party/wayland-protocols/src/wayland-protocols.pc.in
@@ -0,0 +1,7 @@
+prefix=@prefix@
+datarootdir=@datarootdir@
+pkgdatadir=@datadir@/@PACKAGE@
+
+Name: Wayland Protocols
+Description: Wayland protocol files
+Version: @WAYLAND_PROTOCOLS_VERSION@
diff --git a/chromium/third_party/wayland-protocols/unstable/alpha-compositing/README b/chromium/third_party/wayland-protocols/unstable/alpha-compositing/README
new file mode 100644
index 00000000000..a98ad0ed84d
--- /dev/null
+++ b/chromium/third_party/wayland-protocols/unstable/alpha-compositing/README
@@ -0,0 +1,4 @@
+Alpha compositing protocol
+
+Maintainers:
+David Reveman <reveman@chromium.org>
diff --git a/chromium/third_party/wayland-protocols/unstable/alpha-compositing/alpha-compositing-unstable-v1.xml b/chromium/third_party/wayland-protocols/unstable/alpha-compositing/alpha-compositing-unstable-v1.xml
new file mode 100644
index 00000000000..6f67669b965
--- /dev/null
+++ b/chromium/third_party/wayland-protocols/unstable/alpha-compositing/alpha-compositing-unstable-v1.xml
@@ -0,0 +1,130 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<protocol name="alpha_compositing_unstable_v1">
+
+ <copyright>
+ Copyright 2016 The Chromium Authors.
+
+ Permission is hereby granted, free of charge, to any person obtaining a
+ copy of this software and associated documentation files (the "Software"),
+ to deal in the Software without restriction, including without limitation
+ the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ and/or sell copies of the Software, and to permit persons to whom the
+ Software is furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice (including the next
+ paragraph) shall be included in all copies or substantial portions of the
+ Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ DEALINGS IN THE SOFTWARE.
+ </copyright>
+
+ <description summary="Protocol for more advanced compositing and blending">
+ This protocol specifies a set of interfaces used to control the alpha
+ compositing and blending of contents.
+
+ Warning! The protocol described in this file is experimental and backward
+ incompatible changes may be made. Backward compatible changes may be added
+ together with the corresponding interface version bump. Backward
+ incompatible changes are done by bumping the version number in the protocol
+ and interface names and resetting the interface version. Once the protocol
+ is to be declared stable, the 'z' prefix and the version number in the
+ protocol and interface names are removed and the interface version number is
+ reset.
+ </description>
+
+ <interface name="zcr_alpha_compositing_v1" version="1">
+ <description summary="alpha_compositing">
+ The global interface exposing compositing and blending capabilities is
+ used to instantiate an interface extension for a wl_surface object.
+ This extended interface will then allow the client to specify the
+ blending equation and alpha value used for compositing the wl_surface.
+ </description>
+
+ <request name="destroy" type="destructor">
+ <description summary="unbind from the blending interface">
+ Informs the server that the client will not be using this
+ protocol object anymore. This does not affect any other objects,
+ blending objects included.
+ </description>
+ </request>
+
+ <enum name="error">
+ <entry name="blending_exists" value="0"
+ summary="the surface already has a blending object associated"/>
+ </enum>
+
+ <request name="get_blending">
+ <description summary="extend surface interface for blending">
+ Instantiate an interface extension for the given wl_surface to
+ provide surface blending. If the given wl_surface already has
+ a blending object associated, the blending_exists protocol error
+ is raised.
+ </description>
+
+ <arg name="id" type="new_id" interface="zcr_blending_v1"
+ summary="the new blending interface id"/>
+ <arg name="surface" type="object" interface="wl_surface"
+ summary="the surface"/>
+ </request>
+ </interface>
+
+ <interface name="zcr_blending_v1" version="1">
+ <description summary="blending interface to a wl_surface">
+ An additional interface to a wl_surface object, which allows the
+ client to specify the blending equation used for compositing and
+ an alpha value applied to the whole surface.
+
+ If the wl_surface associated with the bledning object is destroyed,
+ the blending object becomes inert.
+
+ If the blending object is destroyed, the blending state is removed
+ from the wl_surface. The change will be applied on the next
+ wl_surface.commit.
+ </description>
+
+ <request name="destroy" type="destructor">
+ <description summary="remove blending from the surface">
+ The associated wl_surface's blending state is removed.
+ The change is applied on the next wl_surface.commit.
+ </description>
+ </request>
+
+ <enum name="blending_equation">
+ <description summary="different blending equations for compositing">
+ Blending equations that can be used when compositing a surface.
+ </description>
+ <entry name="none" value="0" summary="no blending"/>
+ <entry name="premult" value="1" summary="one / one_minus_src_alpha"/>
+ <entry name="coverage" value="2" summary="src_alpha / one_minus_src_alpha" />
+ </enum>
+
+ <request name="set_blending">
+ <description summary="set the blending equation">
+ Set the blending equation for compositing the wl_surface.
+ See wp_alpha_compositing for the description.
+
+ The blending equation state is double-buffered state,
+ and will be applied on the next wl_surface.commit.
+ </description>
+ <arg name="equation" type="uint" summary="the new blending equation"/>
+ </request>
+
+ <request name="set_alpha">
+ <description summary="set the alpha value">
+ Set the alpha value applied to the whole surface for compositing.
+ See wp_alpha_compositing for the description.
+
+ The alpha value state is double-buffered state,
+ and will be applied on the next wl_surface.commit.
+ </description>
+ <arg name="value" type="fixed" summary="the new alpha value"/>
+ </request>
+ </interface>
+
+</protocol>
diff --git a/chromium/third_party/wayland-protocols/unstable/gaming-input/README b/chromium/third_party/wayland-protocols/unstable/gaming-input/README
new file mode 100644
index 00000000000..388c8aa487e
--- /dev/null
+++ b/chromium/third_party/wayland-protocols/unstable/gaming-input/README
@@ -0,0 +1,4 @@
+Gamepads protocol
+
+Maintainers:
+Dennis Kempin <denniskempin@chromium.org>
diff --git a/chromium/third_party/wayland-protocols/unstable/gaming-input/gaming-input-unstable-v1.xml b/chromium/third_party/wayland-protocols/unstable/gaming-input/gaming-input-unstable-v1.xml
new file mode 100644
index 00000000000..8ae1872f089
--- /dev/null
+++ b/chromium/third_party/wayland-protocols/unstable/gaming-input/gaming-input-unstable-v1.xml
@@ -0,0 +1,127 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<protocol name="gaming_input_unstable_v1">
+
+ <copyright>
+ Copyright 2016 The Chromium Authors.
+
+ Permission is hereby granted, free of charge, to any person obtaining a
+ copy of this software and associated documentation files (the "Software"),
+ to deal in the Software without restriction, including without limitation
+ the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ and/or sell copies of the Software, and to permit persons to whom the
+ Software is furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice (including the next
+ paragraph) shall be included in all copies or substantial portions of the
+ Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ DEALINGS IN THE SOFTWARE.
+ </copyright>
+
+ <interface name="zcr_gaming_input_v1" version="1">
+ <description summary="extends wl_seat with gaming input devices">
+ A global interface to provide gaming input devices for a given seat.
+
+ Currently only gamepad devices are supported.
+
+ Warning! The protocol described in this file is experimental and
+ backward incompatible changes may be made. Backward compatible changes
+ may be added together with the corresponding uinterface version bump.
+ Backward incompatible changes are done by bumping the version number in
+ the protocol and uinterface names and resetting the interface version.
+ Once the protocol is to be declared stable, the 'z' prefix and the
+ version number in the protocol and interface names are removed and the
+ interface version number is reset.
+ </description>
+
+ <request name="get_gamepad">
+ <description summary="get gamepad device assigned to seat">
+ Create gamepad object. See zcr_gamepad_v1 interface for details.
+ </description>
+ <arg name="id" type="new_id" interface="zcr_gamepad_v1"/>
+ <arg name="seat" type="object" interface="wl_seat"/>
+ </request>
+ </interface>
+
+ <interface name="zcr_gamepad_v1" version="1">
+ <description summary="gamepad input device">
+ The zcr_gamepad_v1 interface represents one or more gamepad input devices,
+ which are reported as a normalized 'Standard Gamepad' as it is specified
+ by the W3C Gamepad API at: https://w3c.github.io/gamepad/#remapping
+ </description>
+
+ <request name="destroy" type="destructor">
+ <description summary="destroy gamepad object"/>
+ </request>
+
+ <enum name="gamepad_state">
+ <description summary="connection state"/>
+ <entry name="off" value="0" summary="no gamepads are connected or on."/>
+ <entry name="on" value="1" summary="at least one gamepad is connected."/>
+ </enum>
+
+ <event name="state_change">
+ <description summary="state change event">
+ Notification that this seat's connection state has changed.
+ </description>
+ <arg name="state" type="uint" enum="gamepad_state" summary="new state"/>
+ </event>
+
+ <event name="axis">
+ <description summary="axis change event">
+ Notification of axis change.
+
+ The axis id specifies which axis has changed as defined by the W3C
+ 'Standard Gamepad'.
+
+ The value is calibrated and normalized to the -1 to 1 range.
+ </description>
+ <arg name="time" type="uint" summary="timestamp with millisecond granularity"/>
+ <arg name="axis" type="uint" summary="axis that produced this event"/>
+ <arg name="value" type="fixed" summary="new value of axis"/>
+ </event>
+
+ <enum name="button_state">
+ <description summary="physical button state">
+ Describes the physical state of a button that produced the button
+ event.
+ </description>
+ <entry name="released" value="0" summary="the button is not pressed"/>
+ <entry name="pressed" value="1" summary="the button is pressed"/>
+ </enum>
+
+ <event name="button">
+ <description summary="Gamepad button changed">
+ Notification of button change.
+
+ The button id specifies which button has changed as defined by the W3C
+ 'Standard Gamepad'.
+
+ A button can have a digital and an analog value. The analog value is
+ normalized to a 0 to 1 range.
+ If a button does not provide an analog value, it will be derived from
+ the digital state.
+ </description>
+ <arg name="time" type="uint" summary="timestamp with millisecond granularity"/>
+ <arg name="button" type="uint" summary="id of button"/>
+ <arg name="state" type="uint" enum="button_state" summary="digital state of the button"/>
+ <arg name="analog" type="fixed" summary="analog value of the button"/>
+ </event>
+
+ <event name="frame">
+ <description summary="Notifies end of a series of gamepad changes.">
+ Indicates the end of a set of events that logically belong together.
+ A client is expected to accumulate the data in all events within the
+ frame before proceeding.
+ </description>
+ <arg name="time" type="uint" summary="timestamp with millisecond granularity"/>
+ </event>
+ </interface>
+
+</protocol>
diff --git a/chromium/third_party/wayland-protocols/unstable/gaming-input/gaming-input-unstable-v2.xml b/chromium/third_party/wayland-protocols/unstable/gaming-input/gaming-input-unstable-v2.xml
new file mode 100644
index 00000000000..9e9f35ec8b8
--- /dev/null
+++ b/chromium/third_party/wayland-protocols/unstable/gaming-input/gaming-input-unstable-v2.xml
@@ -0,0 +1,152 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<protocol name="gaming_input_unstable_v2">
+
+ <copyright>
+ Copyright 2016 The Chromium Authors.
+
+ Permission is hereby granted, free of charge, to any person obtaining a
+ copy of this software and associated documentation files (the "Software"),
+ to deal in the Software without restriction, including without limitation
+ the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ and/or sell copies of the Software, and to permit persons to whom the
+ Software is furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice (including the next
+ paragraph) shall be included in all copies or substantial portions of the
+ Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ DEALINGS IN THE SOFTWARE.
+ </copyright>
+
+ <interface name="zcr_gaming_input_v2" version="1">
+ <description summary="extends wl_seat with gaming input devices">
+ A global interface to provide gaming input devices for a given seat.
+
+ Currently only gamepad devices are supported.
+
+ Warning! The protocol described in this file is experimental and
+ backward incompatible changes may be made. Backward compatible changes
+ may be added together with the corresponding uinterface version bump.
+ Backward incompatible changes are done by bumping the version number in
+ the protocol and uinterface names and resetting the interface version.
+ Once the protocol is to be declared stable, the 'z' prefix and the
+ version number in the protocol and interface names are removed and the
+ interface version number is reset.
+ </description>
+
+ <request name="get_gaming_seat">
+ <description summary="get a gaming seat">
+ Get a gaming seat object for a given seat. Gaming seat provides access
+ to gaming devices
+ </description>
+ <arg name="gaming_seat" type="new_id" interface="zcr_gaming_seat_v2"/>
+ <arg name="seat" type="object" interface="wl_seat"/>
+ </request>
+
+ <request name="destroy" type="destructor">
+ <description summary="release the memory for the gaming input object">
+ Destroy gaming_input object. Objects created from this object are
+ unaffected and should be destroyed separately.
+ </description>
+ </request>
+ </interface>
+
+ <interface name="zcr_gaming_seat_v2" version="1">
+ <description summary="controller object for all gaming devices of a seat">
+ An object that provides access to all the gaming devices of a seat.
+ When a gamepad is connected, the compositor will send gamepad_added event.
+ </description>
+
+ <request name="destroy" type="destructor">
+ <description summary="release the memory for the gaming seat object">
+ Destroy gaming_seat object. Objects created from this object are
+ unaffected and should be destroyed separately.
+ </description>
+ </request>
+
+ <event name="gamepad_added">
+ <description summary="gamepad added event">
+ Notification that there is gamepad connected at this seat.
+ </description>
+ <arg name="gamepad" type="new_id" interface="zcr_gamepad_v2" summary="new connected gamepad"/>
+ </event>
+ </interface>
+
+ <interface name="zcr_gamepad_v2" version="1">
+ <description summary="gamepad input device">
+ The zcr_gamepad_v2 interface represents one or more gamepad input devices,
+ which are reported as a normalized 'Standard Gamepad' as it is specified
+ by the W3C Gamepad API at: https://w3c.github.io/gamepad/#remapping
+ </description>
+
+ <request name="destroy" type="destructor">
+ <description summary="destroy gamepad object"/>
+ </request>
+
+ <event name="removed">
+ <description summary="gamepad removed">
+ Removed event is send when the gamepad is disconnected. The client should
+ expect no more event and call destroy.
+
+ This event cannot be used as destructor as requests (e.g. vibration) might
+ be added to this interface.
+ </description>
+ </event>
+
+ <event name="axis">
+ <description summary="axis change event">
+ Notification of axis change.
+
+ The axis id specifies which axis has changed as defined by the W3C
+ 'Standard Gamepad'.
+
+ The value is calibrated and normalized to the -1 to 1 range.
+ </description>
+ <arg name="time" type="uint" summary="timestamp with millisecond granularity"/>
+ <arg name="axis" type="uint" summary="axis that produced this event"/>
+ <arg name="value" type="fixed" summary="new value of axis"/>
+ </event>
+
+ <enum name="button_state">
+ <description summary="physical button state">
+ Describes the physical state of a button that produced the button
+ event.
+ </description>
+ <entry name="released" value="0" summary="the button is not pressed"/>
+ <entry name="pressed" value="1" summary="the button is pressed"/>
+ </enum>
+
+ <event name="button">
+ <description summary="Gamepad button changed">
+ Notification of button change.
+
+ The button id specifies which button has changed as defined by the W3C
+ 'Standard Gamepad'.
+
+ A button can have a digital and an analog value. The analog value is
+ normalized to a 0 to 1 range.
+ If a button does not provide an analog value, it will be derived from
+ the digital state.
+ </description>
+ <arg name="time" type="uint" summary="timestamp with millisecond granularity"/>
+ <arg name="button" type="uint" summary="id of button"/>
+ <arg name="state" type="uint" enum="button_state" summary="digital state of the button"/>
+ <arg name="analog" type="fixed" summary="analog value of the button"/>
+ </event>
+
+ <event name="frame">
+ <description summary="Notifies end of a series of gamepad changes.">
+ Indicates the end of a set of events that logically belong together.
+ A client is expected to accumulate the data in all events within the
+ frame before proceeding.
+ </description>
+ <arg name="time" type="uint" summary="timestamp with millisecond granularity"/>
+ </event>
+ </interface>
+</protocol>
diff --git a/chromium/third_party/wayland-protocols/unstable/keyboard/README b/chromium/third_party/wayland-protocols/unstable/keyboard/README
new file mode 100644
index 00000000000..700fff91073
--- /dev/null
+++ b/chromium/third_party/wayland-protocols/unstable/keyboard/README
@@ -0,0 +1,4 @@
+Extensions of wl_keyboard protocol.
+
+Maintainers:
+Yuichiro Hanada <yhanada@chromium.org>
diff --git a/chromium/third_party/wayland-protocols/unstable/keyboard/keyboard-configuration-unstable-v1.xml b/chromium/third_party/wayland-protocols/unstable/keyboard/keyboard-configuration-unstable-v1.xml
new file mode 100644
index 00000000000..8d3cf72b4d4
--- /dev/null
+++ b/chromium/third_party/wayland-protocols/unstable/keyboard/keyboard-configuration-unstable-v1.xml
@@ -0,0 +1,87 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<protocol name="keyboard_configuration_unstable_v1">
+
+ <copyright>
+ Copyright 2016 The Chromium Authors.
+
+ Permission is hereby granted, free of charge, to any person obtaining a
+ copy of this software and associated documentation files (the "Software"),
+ to deal in the Software without restriction, including without limitation
+ the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ and/or sell copies of the Software, and to permit persons to whom the
+ Software is furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice (including the next
+ paragraph) shall be included in all copies or substantial portions of the
+ Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ DEALINGS IN THE SOFTWARE.
+ </copyright>
+
+ <interface name="zcr_keyboard_configuration_v1" version="2">
+ <description summary="extends wl_keyboard with events for device configuration change">
+ Allows a wl_keyboard to notify device configuration change events of
+ the keyboard to the client.
+
+ Warning! The protocol described in this file is experimental and
+ backward incompatible changes may be made. Backward compatible changes
+ may be added together with the corresponding uinterface version bump.
+ Backward incompatible changes are done by bumping the version number in
+ the protocol and uinterface names and resetting the interface version.
+ Once the protocol is to be declared stable, the 'z' prefix and the
+ version number in the protocol and interface names are removed and the
+ interface version number is reset.
+ </description>
+
+ <enum name="error">
+ <entry name="device_configuration_exists" value="0"
+ summary="the keyboard already has a device configuration object associated"/>
+ </enum>
+
+ <request name="get_keyboard_device_configuration">
+ <description summary="get keyboard_device_configuration interface for a keyboard">
+ Create keyboard_device_configuration object.
+ See zcr_keyboard_device_configuration interface for details.
+ If the given wl_keyboard object already has a device configuration
+ object associated, the keyboard_device_configuration_exists protocol
+ error is raised.
+ </description>
+ <arg name="id" type="new_id" interface="zcr_keyboard_device_configuration_v1"/>
+ <arg name="keyboard" type="object" interface="wl_keyboard"/>
+ </request>
+ </interface>
+
+ <interface name="zcr_keyboard_device_configuration_v1" version="1">
+ <description summary="extension of wl_keyboard protocol">
+ The zcr_keyboard_device_configuration_v1 interface extends the wl_keyboard
+ interface with events to describe device configuration of a keyboard.
+ </description>
+
+ <request name="destroy" type="destructor">
+ <description summary="destroy keyboard_device_configuration object"/>
+ </request>
+
+ <enum name="keyboard_type">
+ <description summary="keyboard types"/>
+ <entry name="physical" value="0" summary="Physical keyboard"/>
+ <entry name="virtual" value="1" summary="Virtual keyboard"/>
+ </enum>
+
+ <event name="type_change">
+ <description summary="keyboard type changed">
+ Notification that the user is switching to new keyboard type.
+
+ If this event is not received, the cleint has to assume a physical
+ keyboard is in use.
+ </description>
+ <arg name="type" type="uint" enum="keyboard_type" summary="new device type"/>
+ </event>
+ </interface>
+
+</protocol>
diff --git a/chromium/third_party/wayland-protocols/unstable/keyboard/keyboard-extension-unstable-v1.xml b/chromium/third_party/wayland-protocols/unstable/keyboard/keyboard-extension-unstable-v1.xml
new file mode 100644
index 00000000000..a90604dc262
--- /dev/null
+++ b/chromium/third_party/wayland-protocols/unstable/keyboard/keyboard-extension-unstable-v1.xml
@@ -0,0 +1,82 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<protocol name="keyboard_extension_unstable_v1">
+
+ <copyright>
+ Copyright 2017 The Chromium Authors.
+
+ Permission is hereby granted, free of charge, to any person obtaining a
+ copy of this software and associated documentation files (the "Software"),
+ to deal in the Software without restriction, including without limitation
+ the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ and/or sell copies of the Software, and to permit persons to whom the
+ Software is furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice (including the next
+ paragraph) shall be included in all copies or substantial portions of the
+ Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ DEALINGS IN THE SOFTWARE.
+ </copyright>
+
+ <interface name="zcr_keyboard_extension_v1" version="1">
+ <description summary="extends wl_keyboard with ack_key events">
+ Allows a wl_keyboard to send ack_key requests for each key event of
+ the keyboard to the server.
+
+ Warning! The protocol described in this file is experimental and
+ backward incompatible changes may be made. Backward compatible changes
+ may be added together with the corresponding uinterface version bump.
+ Backward incompatible changes are done by bumping the version number in
+ the protocol and uinterface names and resetting the interface version.
+ Once the protocol is to be declared stable, the 'z' prefix and the
+ version number in the protocol and interface names are removed and the
+ interface version number is reset.
+ </description>
+
+ <enum name="error">
+ <entry name="extended_keyboard_exists" value="0"
+ summary="the keyboard already has an extended_keyboard object associated"/>
+ </enum>
+
+ <request name="get_extended_keyboard">
+ <description summary="get extended_keyboard for a keyboard">
+ Create extended_keyboard object.
+ See zcr_extended_keyboard interface for details.
+ If the given wl_keyboard object already has a extended_keyboard object
+ associated, the extended_keyboard_exists protocol error is raised.
+ </description>
+ <arg name="id" type="new_id" interface="zcr_extended_keyboard_v1"/>
+ <arg name="keyboard" type="object" interface="wl_keyboard"/>
+ </request>
+ </interface>
+
+ <interface name="zcr_extended_keyboard_v1" version="1">
+ <description summary="extension of wl_keyboard protocol">
+ The zcr_extended_keyboard_v1 interface extends the wl_keyboard interface
+ with requests to notify whether sent key events are handled or not by
+ the client.
+ </description>
+
+ <request name="destroy" type="destructor">
+ <description summary="destroy extended_keyboard object"/>
+ </request>
+
+ <enum name="handled_state">
+ <description summary="whether a key event is handled by client or not"/>
+ <entry name="not_handled" value="0"/>
+ <entry name="handled" value="1"/>
+ </enum>
+
+ <request name="ack_key">
+ <description summary="acknowledge a key event"/>
+ <arg name="serial" type="uint"/>
+ <arg name="handled" type="uint" enum="handled_state"/>
+ </request>
+ </interface>
+</protocol>
diff --git a/chromium/third_party/wayland-protocols/unstable/remote-shell/README b/chromium/third_party/wayland-protocols/unstable/remote-shell/README
new file mode 100644
index 00000000000..5df5b13761d
--- /dev/null
+++ b/chromium/third_party/wayland-protocols/unstable/remote-shell/README
@@ -0,0 +1,4 @@
+Nested shell protocol
+
+Maintainers:
+David Reveman <reveman@chromium.org>
diff --git a/chromium/third_party/wayland-protocols/unstable/remote-shell/remote-shell-unstable-v1.xml b/chromium/third_party/wayland-protocols/unstable/remote-shell/remote-shell-unstable-v1.xml
new file mode 100644
index 00000000000..3005449749a
--- /dev/null
+++ b/chromium/third_party/wayland-protocols/unstable/remote-shell/remote-shell-unstable-v1.xml
@@ -0,0 +1,776 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<protocol name="remote_shell_unstable_v1">
+
+ <copyright>
+ Copyright 2016 The Chromium Authors.
+
+ Permission is hereby granted, free of charge, to any person obtaining a
+ copy of this software and associated documentation files (the "Software"),
+ to deal in the Software without restriction, including without limitation
+ the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ and/or sell copies of the Software, and to permit persons to whom the
+ Software is furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice (including the next
+ paragraph) shall be included in all copies or substantial portions of the
+ Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ DEALINGS IN THE SOFTWARE.
+ </copyright>
+
+ <description summary="Create remote desktop-style surfaces">
+ remote_shell allows clients to turn a wl_surface into a "real window"
+ which can be stacked and activated by the user.
+
+ Warning! The protocol described in this file is experimental and backward
+ incompatible changes may be made. Backward compatible changes may be added
+ together with the corresponding interface version bump. Backward
+ incompatible changes are done by bumping the version number in the protocol
+ and interface names and resetting the interface version. Once the protocol
+ is to be declared stable, the 'z' prefix and the version number in the
+ protocol and interface names are removed and the interface version number is
+ reset.
+ </description>
+
+ <interface name="zcr_remote_shell_v1" version="10">
+ <description summary="remote_shell">
+ The global interface that allows clients to turn a wl_surface into a
+ "real window" which is remotely managed but can be stacked, activated
+ and made fullscreen by the user.
+ </description>
+
+ <enum name="container">
+ <description summary="containers for remote surfaces">
+ Determine how a remote surface should be stacked relative to other
+ shell surfaces.
+ </description>
+ <entry name="default" value="1" summary="default container"/>
+ <entry name="overlay" value="2" summary="system modal container"/>
+ </enum>
+
+ <enum name="state_type">
+ <description summary="state types for remote surfaces">
+ Defines common show states for shell surfaces.
+ </description>
+ <entry name="normal" value="1" summary="normal window state"/>
+ <entry name="minimized" value="2" summary="minimized window state"/>
+ <entry name="maximized" value="3" summary="maximized window state"/>
+ <entry name="fullscreen" value="4" summary="fullscreen window state"/>
+ <entry name="pinned" value="5" summary="pinned window state"/>
+ <entry name="trusted_pinned" value="6" summary="trusted pinned window state"/>
+ <entry name="moving" value="7" summary="moving window state"/>
+ <entry name="resizing" value="8" summary="resizing window state"/>
+ </enum>
+
+ <enum name="error">
+ <entry name="role" value="0" summary="given wl_surface has another role"/>
+ <entry name="invalid_notification_key" value="1"
+ summary="invalid notification key"/>
+ </enum>
+
+ <enum name="layout_mode">
+ <description summary="the layout mode">
+ Determine how a client should layout surfaces.
+ </description>
+ <entry name="windowed" value="1" summary="multiple windows"/>
+ <entry name="tablet" value="2" summary="restricted mode for tablet"/>
+ </enum>
+
+ <request name="destroy" type="destructor">
+ <description summary="destroy remote_shell">
+ Destroy this remote_shell object.
+
+ Destroying a bound remote_shell object while there are surfaces
+ still alive created by this remote_shell object instance is illegal
+ and will result in a protocol error.
+ </description>
+ </request>
+
+ <request name="get_remote_surface">
+ <description summary="create a remote shell surface from a surface">
+ This creates an remote_surface for the given surface and gives it the
+ remote_surface role. A wl_surface can only be given a remote_surface
+ role once. If get_remote_surface is called with a wl_surface that
+ already has an active remote_surface associated with it, or if it had
+ any other role, an error is raised.
+
+ See the documentation of remote_surface for more details about what an
+ remote_surface is and how it is used.
+ </description>
+ <arg name="id" type="new_id" interface="zcr_remote_surface_v1"/>
+ <arg name="surface" type="object" interface="wl_surface"/>
+ <arg name="container" type="uint"/>
+ </request>
+
+ <event name="activated">
+ <description summary="activated surface changed">
+ Notifies client that the activated surface changed.
+ </description>
+ <arg name="gained_active" type="object" interface="wl_surface" allow-null="true"/>
+ <arg name="lost_active" type="object" interface="wl_surface" allow-null="true"/>
+ </event>
+
+ <request name="get_notification_surface">
+ <description summary="create a notification surface from a surface">
+ Creates a notification_surface for the given surface, gives it the
+ notification_surface role and associated it with a notification id.
+ </description>
+ <arg name="id" type="new_id" interface="zcr_notification_surface_v1"/>
+ <arg name="surface" type="object" interface="wl_surface"/>
+ <arg name="notification_key" type="string" />
+ </request>
+
+ <event name="configuration_changed">
+ <description summary="suggests a re-configuration of remote shell">
+ [Deprecated] Suggests a re-configuration of remote shell.
+ </description>
+ <arg name="width" type="int"/>
+ <arg name="height" type="int"/>
+ <arg name="transform" type="int"/>
+ <arg name="scale_factor" type="fixed"/>
+ <arg name="work_area_inset_left" type="int"/>
+ <arg name="work_area_inset_top" type="int"/>
+ <arg name="work_area_inset_right" type="int"/>
+ <arg name="work_area_inset_bottom" type="int"/>
+ <arg name="layout_mode" type="uint"/>
+ </event>
+
+ <!-- Version 5 additions -->
+
+ <event name="workspace" since="5">
+ <description summary="area of remote shell">
+ Defines an area of the remote shell used for layout. Each series of
+ "workspace" events must be terminated by a "configure" event.
+ </description>
+ <arg name="id_hi" type="uint"/>
+ <arg name="id_lo" type="uint"/>
+ <arg name="x" type="int"/>
+ <arg name="y" type="int"/>
+ <arg name="width" type="int"/>
+ <arg name="height" type="int"/>
+ <arg name="inset_left" type="int"/>
+ <arg name="inset_top" type="int"/>
+ <arg name="inset_right" type="int"/>
+ <arg name="inset_bottom" type="int"/>
+ <arg name="transform" type="int"/>
+ <arg name="scale_factor" type="fixed"/>
+ <arg name="is_internal" type="uint" summary="1 if screen is built-in"/>
+ </event>
+
+ <event name="configure" since="5">
+ <description summary="suggests configuration of remote shell">
+ Suggests a new configuration of the remote shell. Preceded by a series
+ of "workspace" events.
+ </description>
+ <arg name="layout_mode" type="uint"/>
+ </event>
+
+ <!-- Version 8 additions -->
+
+ <event name="default_device_scale_factor" since="8">
+ <description summary="initialize scale configuration">
+ Sends the default device scale factor.
+ </description>
+ <arg name="scale" type="int" summary="DP to pixels ratio, in 8.24 fixed point format"/>
+ </event>
+ </interface>
+
+ <interface name="zcr_remote_surface_v1" version="10">
+ <description summary="A desktop window">
+ An interface that may be implemented by a wl_surface, for
+ implementations that provide a desktop-style user interface
+ and allows for remotely managed windows.
+
+ It provides requests to treat surfaces like windows, allowing to set
+ properties like app id and geometry.
+
+ The client must call wl_surface.commit on the corresponding wl_surface
+ for the remote_surface state to take effect.
+
+ For a surface to be mapped by the compositor the client must have
+ committed both an remote_surface state and a buffer.
+ </description>
+
+ <enum name="systemui_visibility_state">
+ <description summary="systemui visibility behavior">
+ Determine the visibility behavior of the system UI.
+ </description>
+ <entry name="visible" value="1" summary="system ui is visible"/>
+ <entry name="autohide_non_sticky" value="2" summary="system ui autohides and is not sticky"/>
+ <entry name="autohide_sticky" value="3" summary="system ui autohides and is sticky"/>
+ </enum>
+
+ <enum name="orientation">
+ <description summary="window orientation">
+ The orientation of the window.
+ </description>
+ <entry name="portrait" value="1" summary="portrait"/>
+ <entry name="landscape" value="2" summary="landscape"/>
+ </enum>
+
+ <enum name="window_type">
+ <description summary="window type">
+ The type of the window.
+ </description>
+ <entry name="normal" value="1" summary="normal app window"/>
+ <entry name="system_ui" value="2" summary="window is treated as systemui"/>
+ </enum>
+
+ <request name="destroy" type="destructor">
+ <description summary="Destroy the remote_surface">
+ Unmap and destroy the window. The window will be effectively
+ hidden from the user's point of view, and all state will be lost.
+ </description>
+ </request>
+
+ <request name="set_app_id">
+ <description summary="set application ID">
+ Set an application identifier for the surface.
+ </description>
+ <arg name="app_id" type="string"/>
+ </request>
+
+ <request name="set_window_geometry">
+ <description summary="set the new window geometry">
+ The window geometry of a window is its "visible bounds" from the
+ user's perspective. Client-side decorations often have invisible
+ portions like drop-shadows which should be ignored for the
+ purposes of aligning, placing and constraining windows.
+
+ The window geometry is double buffered, and will be applied at the
+ time wl_surface.commit of the corresponding wl_surface is called.
+
+ Once the window geometry of the surface is set once, it is not
+ possible to unset it, and it will remain the same until
+ set_window_geometry is called again, even if a new subsurface or
+ buffer is attached.
+
+ If never set, the value is the full bounds of the output. This
+ updates dynamically on every commit.
+
+ The arguments are given in the output coordinate space.
+
+ The width and height must be greater than zero.
+ </description>
+ <arg name="x" type="int"/>
+ <arg name="y" type="int"/>
+ <arg name="width" type="int"/>
+ <arg name="height" type="int"/>
+ </request>
+
+ <request name="set_scale">
+ <description summary="set scale">
+ Set a scale factor that will be applied to surface and all descendants.
+ </description>
+ <arg name="scale" type="fixed"/>
+ </request>
+
+ <request name="set_rectangular_shadow">
+ <description summary="set a rectangular shadow">
+ [Deprecated] Request that surface needs a rectangular shadow.
+
+ This is only a request that the surface should have a rectangular
+ shadow. The compositor may choose to ignore this request.
+
+ The arguments are given in the output coordinate space and specifies
+ the inner bounds of the shadow.
+
+ The arguments are given in the output coordinate space.
+ Specifying zero width and height will disable the shadow.
+ </description>
+ <arg name="x" type="int"/>
+ <arg name="y" type="int"/>
+ <arg name="width" type="int"/>
+ <arg name="height" type="int"/>
+ </request>
+
+ <request name="set_rectangular_shadow_background_opacity">
+ <description summary="suggests the window's background opacity">
+ [Deprecated] Suggests the window's background opacity when the shadow is requested.
+ </description>
+ <arg name="opacity" type="fixed"/>
+ </request>
+
+ <request name="set_title">
+ <description summary="set surface title">
+ Set a short title for the surface.
+
+ This string may be used to identify the surface in a task bar,
+ window list, or other user interface elements provided by the
+ compositor.
+
+ The string must be encoded in UTF-8.
+ </description>
+ <arg name="title" type="string"/>
+ </request>
+
+ <request name="set_top_inset">
+ <description summary="set top inset for surface">
+ Set distance from the top of the surface to the contents.
+
+ This distance typically represents the size of the window caption.
+ </description>
+ <arg name="height" type="int"/>
+ </request>
+
+ <request name="activate">
+ <description summary="make the surface active">
+ Make the surface active and bring it to the front.
+ </description>
+ <arg name="serial" type="uint" summary="the serial of the user event"/>
+ </request>
+
+ <request name="maximize">
+ <description summary="maximize">
+ Request that surface is maximized. The window geometry will be updated
+ to whatever the compositor finds appropriate for a maximized window.
+
+ This is only a request that the window should be maximized. The
+ compositor may choose to ignore this request. The client should
+ listen to set_maximized events to determine if the window was
+ maximized or not.
+ </description>
+ </request>
+
+ <request name="minimize">
+ <description summary="minimize">
+ Request that surface is minimized.
+
+ This is only a request that the window should be minimized. The
+ compositor may choose to ignore this request. The client should
+ listen to set_minimized events to determine if the window was
+ minimized or not.
+ </description>
+ </request>
+
+ <request name="restore">
+ <description summary="restore">
+ Request that surface is restored. This restores the window geometry
+ to what it was before the window was minimized, maximized or made
+ fullscreen.
+
+ This is only a request that the window should be restored. The
+ compositor may choose to ignore this request. The client should
+ listen to unset_maximized, unset_minimize and unset_fullscreen
+ events to determine if the window was restored or not.
+ </description>
+ </request>
+
+ <request name="fullscreen">
+ <description summary="fullscreen">
+ Request that surface is made fullscreen.
+
+ This is only a request that the window should be made fullscreen.
+ The compositor may choose to ignore this request. The client should
+ listen to set_fullscreen events to determine if the window was
+ made fullscreen or not.
+ </description>
+ </request>
+
+ <request name="unfullscreen">
+ <description summary="unfullscreen">
+ Request that surface is made unfullscreen.
+
+ This is only a request that the window should be made unfullscreen.
+ The compositor may choose to ignore this request. The client should
+ listen to unset_fullscreen events to determine if the window was
+ made unfullscreen or not.
+ </description>
+ </request>
+
+ <request name="pin">
+ <description summary="pin">
+ Request that surface is pinned.
+
+ This is only a request that the window should be pinned.
+ The compositor may choose to ignore this request. The client should
+ listen to state_changed events to determine if the window was
+ pinned or not. If trusted flag is non-zero, the app can prevent users
+ from exiting the pinned mode.
+ </description>
+ <arg name="trusted" type="int"/>
+ </request>
+
+ <request name="unpin">
+ <description summary="unpin">
+ Request that surface is unpinned.
+
+ This is only a request that the window should be unpinned.
+ The compositor may choose to ignore this request. The client should
+ listen to unset_pinned events to determine if the window was
+ unpinned or not.
+ </description>
+ </request>
+
+ <request name="set_system_modal">
+ <description summary="suggests a re-layout of remote shell input area">
+ Suggests a surface should become system modal.
+ </description>
+ </request>
+
+ <request name="unset_system_modal">
+ <description summary="suggests a re-layout of remote shell input area">
+ Suggests a surface should become non system modal.
+ </description>
+ </request>
+
+ <event name="close">
+ <description summary="surface wants to be closed">
+ The close event is sent by the compositor when the user
+ wants the surface to be closed. This should be equivalent to
+ the user clicking the close button in client-side decorations,
+ if your application has any...
+
+ This is only a request that the user intends to close your
+ window. The client may choose to ignore this request, or show
+ a dialog to ask the user to save their data...
+ </description>
+ </event>
+
+ <event name="state_type_changed">
+ <description summary="surface state type changed">
+ [Deprecated] The state_type_changed event is sent by the compositor when
+ the surface state changed.
+
+ This is an event to notify that the window state changed in compositor.
+ The state change may be triggered by a client's request, or some user
+ action directly handled by the compositor. The client may choose to
+ ignore this event.
+ </description>
+ <arg name="state_type" type="uint"/>
+ </event>
+
+ <!-- Version 2 additions -->
+
+ <request name="set_rectangular_surface_shadow" since="2">
+ <description summary="set a rectangular shadow">
+ Request that surface needs a rectangular shadow.
+
+ This is only a request that the surface should have a rectangular
+ shadow. The compositor may choose to ignore this request.
+
+ The arguments are given in the remote surface coordinate space and
+ specifies inner bounds of the shadow. Specifying zero width and height
+ will disable the shadow.
+ </description>
+ <arg name="x" type="int"/>
+ <arg name="y" type="int"/>
+ <arg name="width" type="int"/>
+ <arg name="height" type="int"/>
+ </request>
+
+ <!-- Version 3 additions -->
+ <request name="set_systemui_visibility" since="3">
+ <description summary="requests the system ui visibility behavior for the surface">
+ Requests how the surface will change the visibility of the system UI when it is made active.
+ </description>
+ <arg name="visibility" type="uint"/>
+ </request>
+
+ <!-- Version 4 additions -->
+
+ <request name="set_always_on_top" since="4">
+ <description summary="set always on top">
+ Request that surface is made to be always on top.
+
+ This is only a request that the window should be always on top.
+ The compositor may choose to ignore this request.
+
+ </description>
+ </request>
+
+ <request name="unset_always_on_top" since="4">
+ <description summary="unset always on top">
+ Request that surface is made to be not always on top.
+
+ This is only a request that the window should be not always on top.
+ The compositor may choose to ignore this request.
+ </description>
+ </request>
+
+ <!-- Version 5 additions -->
+
+ <event name="configure" since="5">
+ <description summary="suggest a surface change">
+ The configure event asks the client to change surface state.
+
+ The client must apply the origin offset to window positions in
+ set_window_geometry requests.
+
+ The states listed in the event are state_type values, and might change
+ due to a client request or an event directly handled by the compositor.
+
+ Clients should arrange their surface for the new state, and then send an
+ ack_configure request with the serial sent in this configure event at
+ some point before committing the new surface.
+
+ If the client receives multiple configure events before it can respond
+ to one, it is free to discard all but the last event it received.
+ </description>
+ <arg name="origin_offset_x" type="int"/>
+ <arg name="origin_offset_y" type="int"/>
+ <arg name="states" type="array"/>
+ <arg name="serial" type="uint"/>
+ </event>
+
+ <request name="ack_configure" since="5">
+ <description summary="ack a configure event">
+ When a configure event is received, if a client commits the
+ surface in response to the configure event, then the client
+ must make an ack_configure request sometime before the commit
+ request, passing along the serial of the configure event.
+
+ For instance, the compositor might use this information during display
+ configuration to change its coordinate space for set_window_geometry
+ requests only when the client has switched to the new coordinate space.
+
+ If the client receives multiple configure events before it
+ can respond to one, it only has to ack the last configure event.
+
+ A client is not required to commit immediately after sending
+ an ack_configure request - it may even ack_configure several times
+ before its next surface commit.
+
+ A client may send multiple ack_configure requests before committing, but
+ only the last request sent before a commit indicates which configure
+ event the client really is responding to.
+ </description>
+ <arg name="serial" type="uint" summary="the serial from the configure event"/>
+ </request>
+
+ <request name="move" since="5">
+ <description summary="start an interactive move">
+ Start an interactive, user-driven move of the surface.
+
+ The compositor responds to this request with a configure event that
+ transitions to the "moving" state. The client must only initiate motion
+ after acknowledging the state change. The compositor can assume that
+ subsequent set_window_geometry requests are position updates until the
+ next state transition is acknowledged.
+
+ The compositor may ignore move requests depending on the state of the
+ surface, e.g. fullscreen or maximized.
+ </description>
+ </request>
+
+ <!-- Version 6 additions -->
+
+ <request name="set_orientation" since="6">
+ <description summary="set orientation">
+ Set an orientation for the surface.
+ </description>
+ <arg name="orientation" type="int"/>
+ </request>
+
+ <!-- Version 7 additions -->
+
+ <request name="set_window_type" since="7">
+ <description summary="set the type of the window">
+ Set the type of window. This is only a hint to the compositor and the
+ compositor is free to ignore it.
+ </description>
+ <arg name="type" type="uint" summary="type of the window"/>
+ </request>
+
+ <!-- Version 9 additions -->
+
+ <request name="resize" since="9">
+ <description summary="start an interactive resize">
+ Start an interactive, user-driven resize of the surface.
+
+ The compositor responds to this request with a configure event that
+ transitions to the "resizing" state. The client must only initiate
+ resizing after acknowledging the state change. The compositor can assume
+ that subsequent set_window_geometry requests are resizes until the next
+ state transition is acknowledged.
+
+ The compositor may ignore resize requests depending on the state of the
+ surface, e.g. fullscreen or maximized.
+ </description>
+ </request>
+
+ <request name="set_resize_outset" since="9">
+ <description summary="expand input region for resizing">
+ Expand input region of surface with resize outset.
+
+ The compositor clips the input region of each surface to its bounds,
+ unless the client requests a resize outset. In that case, the input
+ region of the root surface is expanded to allow for some leeway around
+ visible bounds when starting a user-driven resize.
+ </description>
+ <arg name="outset" type="int"/>
+ </request>
+
+ <event name="window_geometry_changed" since="9">
+ <description summary="announce window geometry commit">
+ Notify the client of committed window geometry.
+
+ The compositor sends this event when it commits window geometry. The
+ client may use this information to convert coordinates of input events
+ using the latest committed geometry.
+ </description>
+ <arg name="x" type="int"/>
+ <arg name="y" type="int"/>
+ <arg name="width" type="int"/>
+ <arg name="height" type="int"/>
+ </event>
+
+ <!-- Version 10 additions -->
+ <enum name="bounds_change_reason">
+ <description summary="bounds_change_reason">
+ Specifies the cause of the window bounds change event.
+ </description>
+ <entry name="drag_move" value="1" summary="the window is being moved by drag operation"/>
+ <entry name="drag_resize" value="2" summary="the window is being resized by drag operation."/>
+ <entry name="snap_to_left" value="3"
+ summary="the window is resized to left snapped state"/>
+ <entry name="snap_to_right" value="4"
+ summary="the window is resized to right snapped state"/>
+ <entry name="move" value="5"
+ summary="the window bounds is moved due to other WM operations"/>
+ <entry name="resize" value="6"
+ summary="the window bounds is reiszed due to other WM operations"/>
+ </enum>
+
+ <event name="bounds_changed" since="10">
+ <description summary="The compositor requested to change the bounds">
+ The compositor requested to change its
+ bounds. "bounds_change_reason" specifies the cause of the
+ bounds change. The client may apply the different move/resize
+ strategy depending on the reason.
+
+ "display_id_hi", "display_id_lo" specifies in which workspace
+ the surface should live in.
+
+ The client responds with set_window_geometry request, with the
+ bounds it is resized to (this may be different from the bounds
+ requested).
+
+ The client may ignore move request depending on the state,
+ e.g, if it becomes resizable or other constrants.
+ </description>
+ <arg name="workspace_id_hi" type="uint"/>
+ <arg name="workspace_id_lo" type="uint"/>
+ <arg name="x" type="int"/>
+ <arg name="y" type="int"/>
+ <arg name="width" type="int"/>
+ <arg name="height" type="int"/>
+ <arg name="bounds_change_reason" type="uint"/>
+ </event>
+
+ <request name="start_move" since="10">
+ <description summary="start an interactive move">
+ Request an interactive, user-driven move of the surface. "x"
+ and "y" specifies the starting point of the pointer device
+ that initiated the move.
+
+ The compositor responds to this request with a drag_started
+ event with "none" direction. Please see drag_started event
+ for more details.
+
+ The compositor may ignore move requests depending on the state of the
+ surface, e.g. fullscreen or maximized.
+ </description>
+ <arg name="x" type="int"/>
+ <arg name="y" type="int"/>
+ </request>
+
+ <enum name="resize_direction">
+ <description summary="resize direction">
+ The resize direction for drag operation
+ </description>
+ <entry name="none" value="0" summary="move only, no resize"/>
+ <entry name="left" value="1" summary="resize to the left"/>
+ <entry name="topleft" value="2" summary="resize to the top left"/>
+ <entry name="top" value="3" summary="resize to the top"/>
+ <entry name="topright" value="4" summary="resize to the top right"/>
+ <entry name="right" value="5" summary="resize to the right"/>
+ <entry name="bottomright" value="6" summary="resize to the buttom right"/>
+ <entry name="bottom" value="7" summary="resize to the bottom"/>
+ <entry name="bottomleft" value="8" summary="resize to the bottom left"/>
+ </enum>
+
+ <event name="drag_started" since="10">
+ <description summary="Notifies that a drag to move/resize started.">
+ Notifies a client that the compositor started drag
+ operation. "direction" specifies which direction it is being
+ resized. "none" direction means just move but not resize.
+
+ This will be followed by series of the "bounds_changed" event
+ with "drag_resize" or "drag_move" reasons to update the window
+ bounds druing the drag operation.
+ </description>
+ <arg name="direction" type="uint"/>
+ </event>
+
+ <event name="drag_finished" since="10">
+ <description summary="Notifies that a drag operation has finished.">
+ Called when the drag operation is finished. "x" and "y"
+ specifies the position of the pointer device used to drag.
+ "canceled" is true if the drag operation is aborted during
+ drag (e.g. by capture change or user action.)
+ </description>
+ <arg name="x" type="int"/>
+ <arg name="y" type="int"/>
+ <arg name="canceled" type="int" summary="true if the operation was canceled"/>
+ </event>
+
+ <request name="set_can_maximize" since="10">
+ <description summary="set can_maximize">
+ Request that surface can be in maximzied state.
+ </description>
+ </request>
+
+ <request name="unset_can_maximize" since="10">
+ <description summary="unset can_maximize">
+ Request that surface can not be in maximzied state.
+ </description>
+ </request>
+
+ <request name="set_min_size" since="10">
+ <description summary="set the minimum size">
+ Set a minimum size of the surface.
+
+ Values set in this way are double-buffered. They will get
+ applied on the next commit.
+ </description>
+ <arg name="width" type="int"/>
+ <arg name="height" type="int"/>
+ </request>
+
+ <request name="set_max_size" since="10">
+ <description summary="set the maximum size">
+ Set a maximum size of the surface.
+
+ Values set in this way are double-buffered. They will get
+ applied on the next commit.
+
+ Setting the same size as minimum size makes the surface
+ unresizable.
+ </description>
+ <arg name="width" type="int"/>
+ <arg name="height" type="int"/>
+ </request>
+
+ </interface>
+
+ <interface name="zcr_notification_surface_v1" version="1">
+ <description summary="A notification window">
+ An interface that may be implemented by a wl_surface to host
+ notification contents.
+ </description>
+
+ <request name="destroy" type="destructor">
+ <description summary="Destroy the notification_surface">
+ Unmap and destroy the notification surface.
+ </description>
+ </request>
+ </interface>
+
+</protocol>
diff --git a/chromium/third_party/wayland-protocols/unstable/secure-output/README b/chromium/third_party/wayland-protocols/unstable/secure-output/README
new file mode 100644
index 00000000000..3251af981e8
--- /dev/null
+++ b/chromium/third_party/wayland-protocols/unstable/secure-output/README
@@ -0,0 +1,4 @@
+Secure output protocol
+
+Maintainers:
+David Reveman <reveman@chromium.org>
diff --git a/chromium/third_party/wayland-protocols/unstable/secure-output/secure-output-unstable-v1.xml b/chromium/third_party/wayland-protocols/unstable/secure-output/secure-output-unstable-v1.xml
new file mode 100644
index 00000000000..ebcff9755e7
--- /dev/null
+++ b/chromium/third_party/wayland-protocols/unstable/secure-output/secure-output-unstable-v1.xml
@@ -0,0 +1,118 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<protocol name="secure_output_unstable_v1">
+
+ <copyright>
+ Copyright 2016 The Chromium Authors.
+
+ Permission is hereby granted, free of charge, to any person obtaining a
+ copy of this software and associated documentation files (the "Software"),
+ to deal in the Software without restriction, including without limitation
+ the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ and/or sell copies of the Software, and to permit persons to whom the
+ Software is furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice (including the next
+ paragraph) shall be included in all copies or substantial portions of the
+ Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ DEALINGS IN THE SOFTWARE.
+ </copyright>
+
+ <description summary="Protocol for providing secure output">
+ This protocol specifies a set of interfaces used to prevent surface
+ contents from appearing in screenshots or from being visible on non-secure
+ outputs.
+
+ In order to prevent surface contents from appearing in screenshots or from
+ being visible on non-secure outputs, a client must first bind the global
+ interface "wp_secure_output" which, if a compositor supports secure output,
+ is exposed by the registry. Using the bound global object, the client uses
+ the "get_security" request to instantiate an interface extension for a
+ wl_surface object. This extended interface will then allow surfaces
+ to be marked as only visible on secure outputs.
+
+ Warning! The protocol described in this file is experimental and backward
+ incompatible changes may be made. Backward compatible changes may be added
+ together with the corresponding interface version bump. Backward
+ incompatible changes are done by bumping the version number in the protocol
+ and interface names and resetting the interface version. Once the protocol
+ is to be declared stable, the 'z' prefix and the version number in the
+ protocol and interface names are removed and the interface version number is
+ reset.
+ </description>
+
+ <interface name="zcr_secure_output_v1" version="1">
+ <description summary="secure output">
+ The global interface exposing secure output capabilities is used
+ to instantiate an interface extension for a wl_surface object.
+ This extended interface will then allow surfaces to be marked as
+ as only visible on secure outputs.
+ </description>
+
+ <request name="destroy" type="destructor">
+ <description summary="unbind from the secure output interface">
+ Informs the server that the client will not be using this
+ protocol object anymore. This does not affect any other objects,
+ security objects included.
+ </description>
+ </request>
+
+ <enum name="error">
+ <entry name="security_exists" value="0"
+ summary="the surface already has a security object associated"/>
+ </enum>
+
+ <request name="get_security">
+ <description summary="extend surface interface for security">
+ Instantiate an interface extension for the given wl_surface to
+ provide surface security. If the given wl_surface already has
+ a security object associated, the security_exists protocol error
+ is raised.
+ </description>
+
+ <arg name="id" type="new_id" interface="zcr_security_v1"
+ summary="the new security interface id"/>
+ <arg name="surface" type="object" interface="wl_surface"
+ summary="the surface"/>
+ </request>
+ </interface>
+
+ <interface name="zcr_security_v1" version="1">
+ <description summary="security interface to a wl_surface">
+ An additional interface to a wl_surface object, which allows the
+ client to specify that a surface should not appear in screenshots
+ or be visible on non-secure outputs.
+
+ If the wl_surface associated with the security object is destroyed,
+ the security object becomes inert.
+
+ If the security object is destroyed, the security state is removed
+ from the wl_surface. The change will be applied on the next
+ wl_surface.commit.
+ </description>
+
+ <request name="destroy" type="destructor">
+ <description summary="remove security from the surface">
+ The associated wl_surface's security state is removed.
+ The change is applied on the next wl_surface.commit.
+ </description>
+ </request>
+
+ <request name="only_visible_on_secure_output">
+ <description summary="set the only visible on secure output state">
+ Constrain visibility of wl_surface contents to secure outputs.
+ See wp_secure_output for the description.
+
+ The only visible on secure output state is double-buffered state,
+ and will be applied on the next wl_surface.commit.
+ </description>
+ </request>
+ </interface>
+
+</protocol>
diff --git a/chromium/third_party/wayland-protocols/unstable/stylus-tools/README b/chromium/third_party/wayland-protocols/unstable/stylus-tools/README
new file mode 100644
index 00000000000..b7ca3cf3edf
--- /dev/null
+++ b/chromium/third_party/wayland-protocols/unstable/stylus-tools/README
@@ -0,0 +1,4 @@
+Stylus tools protocol
+
+Maintainers:
+Vladislav Kaznacheev <kaznacheev@chromium.org>
diff --git a/chromium/third_party/wayland-protocols/unstable/stylus-tools/stylus-tools-unstable-v1.xml b/chromium/third_party/wayland-protocols/unstable/stylus-tools/stylus-tools-unstable-v1.xml
new file mode 100644
index 00000000000..0d753c5d5a1
--- /dev/null
+++ b/chromium/third_party/wayland-protocols/unstable/stylus-tools/stylus-tools-unstable-v1.xml
@@ -0,0 +1,105 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<protocol name="stylus_tools_unstable_v1">
+
+ <copyright>
+ Copyright 2017 The Chromium Authors.
+
+ Permission is hereby granted, free of charge, to any person obtaining a
+ copy of this software and associated documentation files (the "Software"),
+ to deal in the Software without restriction, including without limitation
+ the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ and/or sell copies of the Software, and to permit persons to whom the
+ Software is furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice (including the next
+ paragraph) shall be included in all copies or substantial portions of the
+ Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ DEALINGS IN THE SOFTWARE.
+</copyright>
+
+ <description summary="Protocol for the stylus tools">
+ This protocol specifies a set of interfaces used to control the behavior
+ of stylus tools.
+
+ Warning! The protocol described in this file is experimental and backward
+ incompatible changes may be made. Backward compatible changes may be added
+ together with the corresponding interface version bump. Backward
+ incompatible changes are done by bumping the version number in the protocol
+ and interface names and resetting the interface version. Once the protocol
+ is to be declared stable, the 'z' prefix and the version number in the
+ protocol and interface names are removed and the interface version number is
+ reset.
+ </description>
+
+ <interface name="zcr_stylus_tools_v1" version="1">
+ <description summary="stylus_tools">
+ The global interface is used to instantiate an interface extension for a
+ wl_surface object. This extended interface will then allow the client to
+ control the stylus-related behavior for input device event processing
+ related to wl_surface.
+ </description>
+
+ <request name="destroy" type="destructor">
+ <description summary="unbind from the stylus_tools interface">
+ Informs the server that the client will not be using this
+ protocol object anymore. This does not affect any other objects,
+ stylus_tool objects included.
+ </description>
+ </request>
+
+ <enum name="error">
+ <entry name="stylus_tool_exists" value="0"
+ summary="the surface already has a stylus_tool object associated"/>
+ </enum>
+
+ <request name="get_stylus_tool">
+ <description summary="extend surface interface for stylus_tool">
+ Instantiate an interface extension for the given wl_surface to
+ provide access to the stylus tools features. If the given
+ wl_surface already has an stylus_tool object associated,
+ the stylus_tool_exists protocol protocol error is raised.
+ </description>
+
+ <arg name="id" type="new_id" interface="zcr_stylus_tool_v1"
+ summary="the new stylus_tool interface id"/>
+ <arg name="surface" type="object" interface="wl_surface"
+ summary="the surface"/>
+ </request>
+ </interface>
+
+ <interface name="zcr_stylus_tool_v1" version="1">
+ <description summary="stylus_tool interface to a wl_surface">
+ An additional interface to a wl_surface object, which allows the
+ client to control the behavior of stylus tools.
+
+ If the wl_surface associated with the stylus_tool object is destroyed,
+ the stylus_tool object becomes inert.
+
+ If the stylus_tool object is destroyed, the stylus_tool state is removed
+ from the wl_surface. The change will be applied on the next
+ wl_surface.commit.
+ </description>
+
+ <request name="destroy" type="destructor">
+ <description summary="remove stylus_tool from the surface">
+ The associated wl_surface's stylus_tool state is removed.
+ The change is applied on the next wl_surface.commit.
+ </description>
+ </request>
+
+ <request name="set_stylus_only">
+ <description summary="Set the stylus-only mode">
+ Enables the "stylus-only" mode for input device event processing
+ related to wl_surface.
+ </description>
+ </request>
+ </interface>
+
+</protocol>
diff --git a/chromium/third_party/wayland-protocols/unstable/stylus/README b/chromium/third_party/wayland-protocols/unstable/stylus/README
new file mode 100644
index 00000000000..cd60ae52727
--- /dev/null
+++ b/chromium/third_party/wayland-protocols/unstable/stylus/README
@@ -0,0 +1,4 @@
+Extension of pointer protocol with details for on-screen stylus
+
+Maintainers:
+Dennis Kempin <denniskempin@chromium.org>
diff --git a/chromium/third_party/wayland-protocols/unstable/stylus/stylus-unstable-v2.xml b/chromium/third_party/wayland-protocols/unstable/stylus/stylus-unstable-v2.xml
new file mode 100644
index 00000000000..8465f076824
--- /dev/null
+++ b/chromium/third_party/wayland-protocols/unstable/stylus/stylus-unstable-v2.xml
@@ -0,0 +1,116 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<protocol name="stylus_unstable_v2">
+
+ <copyright>
+ Copyright 2016 The Chromium Authors.
+
+ Permission is hereby granted, free of charge, to any person obtaining a
+ copy of this software and associated documentation files (the "Software"),
+ to deal in the Software without restriction, including without limitation
+ the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ and/or sell copies of the Software, and to permit persons to whom the
+ Software is furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice (including the next
+ paragraph) shall be included in all copies or substantial portions of the
+ Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ DEALINGS IN THE SOFTWARE.
+ </copyright>
+
+ <interface name="zcr_stylus_v2" version="1">
+ <description summary="extends wl_touch with events for on-screen stylus">
+ Allows a wl_touch to report stylus specific information. The client can
+ interpret the on-screen stylus like any other touch event, and use
+ this protocol to obtain detail information about the type of stylus,
+ as well as the force and tilt of the tool.
+
+ These events are to be fired by the server within the same frame as other
+ wl_touch events.
+
+ Warning! The protocol described in this file is experimental and
+ backward incompatible changes may be made. Backward compatible changes
+ may be added together with the corresponding uinterface version bump.
+ Backward incompatible changes are done by bumping the version number in
+ the protocol and uinterface names and resetting the interface version.
+ Once the protocol is to be declared stable, the 'z' prefix and the
+ version number in the protocol and interface names are removed and the
+ interface version number is reset.
+ </description>
+
+ <enum name="error">
+ <entry name="touch_stylus_exists" value="0"
+ summary="the touch already has a touch_stylus object associated"/>
+ </enum>
+
+ <request name="get_touch_stylus">
+ <description summary="get stylus interface for touch">
+ Create touch_stylus object. See zcr_touch_stylus_v1 interface for
+ details. If the given wl_touch already has a touch_stylus object
+ associated, the touch_stylus_exists protocol error is raised.
+ </description>
+ <arg name="id" type="new_id" interface="zcr_touch_stylus_v2"/>
+ <arg name="touch" type="object" interface="wl_touch"/>
+ </request>
+ </interface>
+
+ <interface name="zcr_touch_stylus_v2" version="1">
+ <description summary="stylus extension for touch">
+ The zcr_touch_stylus_v1 interface extends the wl_touch interface with
+ events to describe details about a stylus.
+ </description>
+
+ <request name="destroy" type="destructor">
+ <description summary="destroy stylus object"/>
+ </request>
+
+ <enum name="tool_type">
+ <description summary="tool type of device."/>
+ <entry name="touch" value="1" summary="Touch"/>
+ <entry name="pen" value="2" summary="Pen"/>
+ <entry name="eraser" value="3" summary="Eraser"/>
+ </enum>
+
+ <event name="tool">
+ <description summary="sets tool type of touch">
+ Notification that the user is using a tool type other than touch. There
+ can only be one tool in use at a time.
+ This event is sent in the same frame as the wl_touch.down event. The
+ tool type cannot change while a touch is being reported.
+ </description>
+ <arg name="id" type="uint" summary="touch id"/>
+ <arg name="type" type="uint" enum="tool_type" summary="type of tool in use"/>
+ </event>
+
+ <event name="force">
+ <description summary="force change event">
+ Notification of a change in physical force on the surface of the screen.
+ The force is calibrated and normalized to the 0 to 1 range.
+ </description>
+ <arg name="time" type="uint" summary="timestamp with millisecond granularity"/>
+ <arg name="id" type="uint" summary="touch id"/>
+ <arg name="force" type="fixed" summary="new value of force"/>
+ </event>
+
+ <event name="tilt">
+ <description summary="tilt change event">
+ Notification of a change in tilt of a stylus.
+
+ Measured from surface normal as plane angle in degrees, values lie in
+ [-90,90]. A positive x is to the right and a positive y is towards the
+ user.
+ </description>
+ <arg name="time" type="uint" summary="timestamp with millisecond granularity"/>
+ <arg name="id" type="uint" summary="touch id"/>
+ <arg name="tilt_x" type="fixed" summary="tilt in x direction"/>
+ <arg name="tilt_y" type="fixed" summary="tilt in y direction"/>
+ </event>
+ </interface>
+
+</protocol>
diff --git a/chromium/third_party/wayland-protocols/unstable/vsync-feedback/README b/chromium/third_party/wayland-protocols/unstable/vsync-feedback/README
new file mode 100644
index 00000000000..f57e594b105
--- /dev/null
+++ b/chromium/third_party/wayland-protocols/unstable/vsync-feedback/README
@@ -0,0 +1,4 @@
+Vertical synchronization timing feedback protocol
+
+Maintainers:
+Tomasz Figa <tfiga@chromium.org>
diff --git a/chromium/third_party/wayland-protocols/unstable/vsync-feedback/vsync-feedback-unstable-v1.xml b/chromium/third_party/wayland-protocols/unstable/vsync-feedback/vsync-feedback-unstable-v1.xml
new file mode 100644
index 00000000000..79211ffe5fd
--- /dev/null
+++ b/chromium/third_party/wayland-protocols/unstable/vsync-feedback/vsync-feedback-unstable-v1.xml
@@ -0,0 +1,99 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<protocol name="vsync_feedback_unstable_v1">
+
+ <copyright>
+ Copyright 2016 The Chromium Authors.
+
+ Permission is hereby granted, free of charge, to any person obtaining a
+ copy of this software and associated documentation files (the "Software"),
+ to deal in the Software without restriction, including without limitation
+ the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ and/or sell copies of the Software, and to permit persons to whom the
+ Software is furnished to do so, subject to the following conditions:
+
+ The above copyright notice and this permission notice (including the next
+ paragraph) shall be included in all copies or substantial portions of the
+ Software.
+
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+ DEALINGS IN THE SOFTWARE.
+ </copyright>
+
+ <description summary="Protocol for providing vertical synchronization timing">
+ This protocol specifies a set of interfaces used to inform the client about
+ vertical synchronization timing in a precise way and without unnecessary
+ overhead.
+
+ Warning! The protocol described in this file is experimental and backward
+ incompatible changes may be made. Backward compatible changes may be added
+ together with the corresponding interface version bump. Backward
+ incompatible changes are done by bumping the version number in the protocol
+ and interface names and resetting the interface version. Once the protocol
+ is to be declared stable, the version number in the protocol is removed and
+ the interface version number is reset.
+ </description>
+
+ <interface name="zcr_vsync_feedback_v1" version="1">
+ <description summary="Protocol for providing vertical synchronization timing">
+ The global interface that allows clients to subscribe for vertical
+ synchronization timing data for given wl_output.
+ </description>
+
+ <request name="destroy" type="destructor">
+ <description summary="destroy vsync feedback object">
+ Destroy this vsync feedback object. Existing vsync timing objects shall
+ not be affected by this request.
+ </description>
+ </request>
+
+ <request name="get_vsync_timing">
+ <description summary="get vsync timing object for given wl_output">
+ Create a new vsync timing object that represents a subscription to
+ vertical synchronization timing updates of given wl_output object.
+
+ The newly created object will immediately signal an update to notify
+ the subscriber of initial timing parameters.
+ </description>
+ <arg name="id" type="new_id" interface="zcr_vsync_timing_v1" summary="the new vsync timing interface id"/>
+ <arg name="output" type="object" interface="wl_output" summary="the wl_output object to subscribe for timings of" allow-null="true"/>
+ </request>
+ </interface>
+
+ <interface name="zcr_vsync_timing_v1" version="1">
+ <request name="destroy" type="destructor">
+ <description summary="destroy vsync timing object">
+ Destroy this vsync timing object.
+ </description>
+ </request>
+
+ <event name="update">
+ <description summary="vsync timing updated">
+ Notifies client that vertical synchronization timing of given wl_output
+ has changed.
+
+ Timing information consists of two data, timebase and interval. Timebase
+ is an absolute timestamp of the vsync event that caused the timing to
+ change. Interval is a period of time between subsequent vsync events.
+
+ The unit of all above mentioned time values shall be microseconds and
+ absolute timestamps should match the realm of the primary system
+ monotonic counter, i.e. the POSIX clock_gettime(CLOCK_MONOTONIC). Data
+ type of both values is defined to be a 64-bit unsigned integer, but
+ since the biggest unsigned integer datatype defined by the Wayland
+ protocol is the 32-bit uint, both timebase and interval are split into
+ most significant and least significant part, suffixed by "_h" and "_l"
+ respectively.
+ </description>
+ <arg name="timebase_l" type="uint" summary="new vsync timebase (lower 32 bits)"/>
+ <arg name="timebase_h" type="uint" summary="new vsync timebase (upper 32 bits)"/>
+ <arg name="interval_l" type="uint" summary="new vsync interval (lower 32 bits)"/>
+ <arg name="interval_h" type="uint" summary="new vsync interval (upper 32 bits)"/>
+ </event>
+ </interface>
+
+</protocol>
diff --git a/chromium/third_party/wayland/LICENSE b/chromium/third_party/wayland/LICENSE
new file mode 100644
index 00000000000..bd433a832eb
--- /dev/null
+++ b/chromium/third_party/wayland/LICENSE
@@ -0,0 +1,25 @@
+wayland/COPYING
+
+Copyright © 2008-2012 Kristian Høgsberg
+Copyright © 2010-2012 Intel Corporation
+Copyright © 2011 Benjamin Franzke
+Copyright © 2012 Collabora, Ltd.
+
+Permission is hereby granted, free of charge, to any person obtaining a
+copy of this software and associated documentation files (the "Software"),
+to deal in the Software without restriction, including without limitation
+the rights to use, copy, modify, merge, publish, distribute, sublicense,
+and/or sell copies of the Software, and to permit persons to whom the
+Software is furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice (including the next
+paragraph) shall be included in all copies or substantial portions of the
+Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
+DEALINGS IN THE SOFTWARE.
diff --git a/chromium/third_party/wayland/OWNERS b/chromium/third_party/wayland/OWNERS
new file mode 100644
index 00000000000..fe51e0c4f9f
--- /dev/null
+++ b/chromium/third_party/wayland/OWNERS
@@ -0,0 +1,2 @@
+reveman@chromium.org
+piman@chromium.org
diff --git a/chromium/third_party/wayland/README.chromium b/chromium/third_party/wayland/README.chromium
new file mode 100644
index 00000000000..3cc66368875
--- /dev/null
+++ b/chromium/third_party/wayland/README.chromium
@@ -0,0 +1,22 @@
+Name: wayland
+URL: http://wayland.freedesktop.org/
+Version: 1.13.0
+License: MIT
+License File: src/COPYING
+Security Critical: yes
+
+Description:
+Wayland is a protocol for a compositor to talk to its clients as well as a C
+library implementation of that protocol.
+
+Modifications:
+- None
+
+To import a new snapshot of wayland:
+- Checkout the latest release tag: git checkout 1.13.0
+- Change the DEPS entry to the newly checked out commit.
+- Update generated files:
+ ./autogen.sh && make
+ rsync -R $(git ls-files --others '*.h') ../include
+ rsync -R $(git ls-files --others 'protocol/*-protocol.c') ..
+- Update this README to reflect the new version number.
diff --git a/chromium/third_party/wayland/include/config.h b/chromium/third_party/wayland/include/config.h
new file mode 100644
index 00000000000..1d8e4819077
--- /dev/null
+++ b/chromium/third_party/wayland/include/config.h
@@ -0,0 +1,81 @@
+/* config.h. Generated from config.h.in by configure. */
+/* config.h.in. Generated from configure.ac by autoheader. */
+
+/* Define to 1 if you have the `accept4' function. */
+#define HAVE_ACCEPT4 1
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+#define HAVE_DLFCN_H 1
+
+/* Define to 1 if you have the <execinfo.h> header file. */
+#define HAVE_EXECINFO_H 1
+
+/* Define to 1 if you have the <expat.h> header file. */
+/* #undef HAVE_EXPAT_H */
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#define HAVE_INTTYPES_H 1
+
+/* libxml-2.0 is available */
+#define HAVE_LIBXML 1
+
+/* Define to 1 if you have the <memory.h> header file. */
+#define HAVE_MEMORY_H 1
+
+/* Define to 1 if you have the `mkostemp' function. */
+#define HAVE_MKOSTEMP 1
+
+/* Define to 1 if you have the `posix_fallocate' function. */
+#define HAVE_POSIX_FALLOCATE 1
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#define HAVE_STDINT_H 1
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#define HAVE_STDLIB_H 1
+
+/* Define to 1 if you have the <strings.h> header file. */
+#define HAVE_STRINGS_H 1
+
+/* Define to 1 if you have the <string.h> header file. */
+#define HAVE_STRING_H 1
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#define HAVE_SYS_STAT_H 1
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#define HAVE_SYS_TYPES_H 1
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#define HAVE_UNISTD_H 1
+
+/* Define to the sub-directory in which libtool stores uninstalled libraries.
+ */
+#define LT_OBJDIR ".libs/"
+
+/* Name of package */
+#define PACKAGE "wayland"
+
+/* Define to the address where bug reports for this package should be sent. */
+#define PACKAGE_BUGREPORT "https://bugs.freedesktop.org/enter_bug.cgi?product=Wayland&component=wayland&version=1.13.0"
+
+/* Define to the full name of this package. */
+#define PACKAGE_NAME "wayland"
+
+/* Define to the full name and version of this package. */
+#define PACKAGE_STRING "wayland 1.13.0"
+
+/* Define to the one symbol short name of this package. */
+#define PACKAGE_TARNAME "wayland"
+
+/* Define to the home page for this package. */
+#define PACKAGE_URL "http://wayland.freedesktop.org/"
+
+/* Define to the version of this package. */
+#define PACKAGE_VERSION "1.13.0"
+
+/* Define to 1 if you have the ANSI C header files. */
+#define STDC_HEADERS 1
+
+/* Version number of package */
+#define VERSION "1.13.0"
diff --git a/chromium/third_party/wayland/include/protocol/wayland-client-protocol-core.h b/chromium/third_party/wayland/include/protocol/wayland-client-protocol-core.h
new file mode 100644
index 00000000000..6c84fd1c151
--- /dev/null
+++ b/chromium/third_party/wayland/include/protocol/wayland-client-protocol-core.h
@@ -0,0 +1,5587 @@
+/* Generated by wayland-scanner 1.13.0 */
+
+#ifndef WAYLAND_CLIENT_PROTOCOL_H
+#define WAYLAND_CLIENT_PROTOCOL_H
+
+#include <stdint.h>
+#include <stddef.h>
+#include "wayland-client-core.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @page page_wayland The wayland protocol
+ * @section page_ifaces_wayland Interfaces
+ * - @subpage page_iface_wl_display - core global object
+ * - @subpage page_iface_wl_registry - global registry object
+ * - @subpage page_iface_wl_callback - callback object
+ * - @subpage page_iface_wl_compositor - the compositor singleton
+ * - @subpage page_iface_wl_shm_pool - a shared memory pool
+ * - @subpage page_iface_wl_shm - shared memory support
+ * - @subpage page_iface_wl_buffer - content for a wl_surface
+ * - @subpage page_iface_wl_data_offer - offer to transfer data
+ * - @subpage page_iface_wl_data_source - offer to transfer data
+ * - @subpage page_iface_wl_data_device - data transfer device
+ * - @subpage page_iface_wl_data_device_manager - data transfer interface
+ * - @subpage page_iface_wl_shell - create desktop-style surfaces
+ * - @subpage page_iface_wl_shell_surface - desktop-style metadata interface
+ * - @subpage page_iface_wl_surface - an onscreen surface
+ * - @subpage page_iface_wl_seat - group of input devices
+ * - @subpage page_iface_wl_pointer - pointer input device
+ * - @subpage page_iface_wl_keyboard - keyboard input device
+ * - @subpage page_iface_wl_touch - touchscreen input device
+ * - @subpage page_iface_wl_output - compositor output region
+ * - @subpage page_iface_wl_region - region interface
+ * - @subpage page_iface_wl_subcompositor - sub-surface compositing
+ * - @subpage page_iface_wl_subsurface - sub-surface interface to a wl_surface
+ * @section page_copyright_wayland Copyright
+ * <pre>
+ *
+ * Copyright © 2008-2011 Kristian Høgsberg
+ * Copyright © 2010-2011 Intel Corporation
+ * Copyright © 2012-2013 Collabora, Ltd.
+ *
+ * Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation files
+ * (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial
+ * portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ * </pre>
+ */
+struct wl_buffer;
+struct wl_callback;
+struct wl_compositor;
+struct wl_data_device;
+struct wl_data_device_manager;
+struct wl_data_offer;
+struct wl_data_source;
+struct wl_display;
+struct wl_keyboard;
+struct wl_output;
+struct wl_pointer;
+struct wl_region;
+struct wl_registry;
+struct wl_seat;
+struct wl_shell;
+struct wl_shell_surface;
+struct wl_shm;
+struct wl_shm_pool;
+struct wl_subcompositor;
+struct wl_subsurface;
+struct wl_surface;
+struct wl_touch;
+
+/**
+ * @page page_iface_wl_display wl_display
+ * @section page_iface_wl_display_desc Description
+ *
+ * The core global object. This is a special singleton object. It
+ * is used for internal Wayland protocol features.
+ * @section page_iface_wl_display_api API
+ * See @ref iface_wl_display.
+ */
+/**
+ * @defgroup iface_wl_display The wl_display interface
+ *
+ * The core global object. This is a special singleton object. It
+ * is used for internal Wayland protocol features.
+ */
+extern const struct wl_interface wl_display_interface;
+/**
+ * @page page_iface_wl_registry wl_registry
+ * @section page_iface_wl_registry_desc Description
+ *
+ * The singleton global registry object. The server has a number of
+ * global objects that are available to all clients. These objects
+ * typically represent an actual object in the server (for example,
+ * an input device) or they are singleton objects that provide
+ * extension functionality.
+ *
+ * When a client creates a registry object, the registry object
+ * will emit a global event for each global currently in the
+ * registry. Globals come and go as a result of device or
+ * monitor hotplugs, reconfiguration or other events, and the
+ * registry will send out global and global_remove events to
+ * keep the client up to date with the changes. To mark the end
+ * of the initial burst of events, the client can use the
+ * wl_display.sync request immediately after calling
+ * wl_display.get_registry.
+ *
+ * A client can bind to a global object by using the bind
+ * request. This creates a client-side handle that lets the object
+ * emit events to the client and lets the client invoke requests on
+ * the object.
+ * @section page_iface_wl_registry_api API
+ * See @ref iface_wl_registry.
+ */
+/**
+ * @defgroup iface_wl_registry The wl_registry interface
+ *
+ * The singleton global registry object. The server has a number of
+ * global objects that are available to all clients. These objects
+ * typically represent an actual object in the server (for example,
+ * an input device) or they are singleton objects that provide
+ * extension functionality.
+ *
+ * When a client creates a registry object, the registry object
+ * will emit a global event for each global currently in the
+ * registry. Globals come and go as a result of device or
+ * monitor hotplugs, reconfiguration or other events, and the
+ * registry will send out global and global_remove events to
+ * keep the client up to date with the changes. To mark the end
+ * of the initial burst of events, the client can use the
+ * wl_display.sync request immediately after calling
+ * wl_display.get_registry.
+ *
+ * A client can bind to a global object by using the bind
+ * request. This creates a client-side handle that lets the object
+ * emit events to the client and lets the client invoke requests on
+ * the object.
+ */
+extern const struct wl_interface wl_registry_interface;
+/**
+ * @page page_iface_wl_callback wl_callback
+ * @section page_iface_wl_callback_desc Description
+ *
+ * Clients can handle the 'done' event to get notified when
+ * the related request is done.
+ * @section page_iface_wl_callback_api API
+ * See @ref iface_wl_callback.
+ */
+/**
+ * @defgroup iface_wl_callback The wl_callback interface
+ *
+ * Clients can handle the 'done' event to get notified when
+ * the related request is done.
+ */
+extern const struct wl_interface wl_callback_interface;
+/**
+ * @page page_iface_wl_compositor wl_compositor
+ * @section page_iface_wl_compositor_desc Description
+ *
+ * A compositor. This object is a singleton global. The
+ * compositor is in charge of combining the contents of multiple
+ * surfaces into one displayable output.
+ * @section page_iface_wl_compositor_api API
+ * See @ref iface_wl_compositor.
+ */
+/**
+ * @defgroup iface_wl_compositor The wl_compositor interface
+ *
+ * A compositor. This object is a singleton global. The
+ * compositor is in charge of combining the contents of multiple
+ * surfaces into one displayable output.
+ */
+extern const struct wl_interface wl_compositor_interface;
+/**
+ * @page page_iface_wl_shm_pool wl_shm_pool
+ * @section page_iface_wl_shm_pool_desc Description
+ *
+ * The wl_shm_pool object encapsulates a piece of memory shared
+ * between the compositor and client. Through the wl_shm_pool
+ * object, the client can allocate shared memory wl_buffer objects.
+ * All objects created through the same pool share the same
+ * underlying mapped memory. Reusing the mapped memory avoids the
+ * setup/teardown overhead and is useful when interactively resizing
+ * a surface or for many small buffers.
+ * @section page_iface_wl_shm_pool_api API
+ * See @ref iface_wl_shm_pool.
+ */
+/**
+ * @defgroup iface_wl_shm_pool The wl_shm_pool interface
+ *
+ * The wl_shm_pool object encapsulates a piece of memory shared
+ * between the compositor and client. Through the wl_shm_pool
+ * object, the client can allocate shared memory wl_buffer objects.
+ * All objects created through the same pool share the same
+ * underlying mapped memory. Reusing the mapped memory avoids the
+ * setup/teardown overhead and is useful when interactively resizing
+ * a surface or for many small buffers.
+ */
+extern const struct wl_interface wl_shm_pool_interface;
+/**
+ * @page page_iface_wl_shm wl_shm
+ * @section page_iface_wl_shm_desc Description
+ *
+ * A singleton global object that provides support for shared
+ * memory.
+ *
+ * Clients can create wl_shm_pool objects using the create_pool
+ * request.
+ *
+ * At connection setup time, the wl_shm object emits one or more
+ * format events to inform clients about the valid pixel formats
+ * that can be used for buffers.
+ * @section page_iface_wl_shm_api API
+ * See @ref iface_wl_shm.
+ */
+/**
+ * @defgroup iface_wl_shm The wl_shm interface
+ *
+ * A singleton global object that provides support for shared
+ * memory.
+ *
+ * Clients can create wl_shm_pool objects using the create_pool
+ * request.
+ *
+ * At connection setup time, the wl_shm object emits one or more
+ * format events to inform clients about the valid pixel formats
+ * that can be used for buffers.
+ */
+extern const struct wl_interface wl_shm_interface;
+/**
+ * @page page_iface_wl_buffer wl_buffer
+ * @section page_iface_wl_buffer_desc Description
+ *
+ * A buffer provides the content for a wl_surface. Buffers are
+ * created through factory interfaces such as wl_drm, wl_shm or
+ * similar. It has a width and a height and can be attached to a
+ * wl_surface, but the mechanism by which a client provides and
+ * updates the contents is defined by the buffer factory interface.
+ * @section page_iface_wl_buffer_api API
+ * See @ref iface_wl_buffer.
+ */
+/**
+ * @defgroup iface_wl_buffer The wl_buffer interface
+ *
+ * A buffer provides the content for a wl_surface. Buffers are
+ * created through factory interfaces such as wl_drm, wl_shm or
+ * similar. It has a width and a height and can be attached to a
+ * wl_surface, but the mechanism by which a client provides and
+ * updates the contents is defined by the buffer factory interface.
+ */
+extern const struct wl_interface wl_buffer_interface;
+/**
+ * @page page_iface_wl_data_offer wl_data_offer
+ * @section page_iface_wl_data_offer_desc Description
+ *
+ * A wl_data_offer represents a piece of data offered for transfer
+ * by another client (the source client). It is used by the
+ * copy-and-paste and drag-and-drop mechanisms. The offer
+ * describes the different mime types that the data can be
+ * converted to and provides the mechanism for transferring the
+ * data directly from the source client.
+ * @section page_iface_wl_data_offer_api API
+ * See @ref iface_wl_data_offer.
+ */
+/**
+ * @defgroup iface_wl_data_offer The wl_data_offer interface
+ *
+ * A wl_data_offer represents a piece of data offered for transfer
+ * by another client (the source client). It is used by the
+ * copy-and-paste and drag-and-drop mechanisms. The offer
+ * describes the different mime types that the data can be
+ * converted to and provides the mechanism for transferring the
+ * data directly from the source client.
+ */
+extern const struct wl_interface wl_data_offer_interface;
+/**
+ * @page page_iface_wl_data_source wl_data_source
+ * @section page_iface_wl_data_source_desc Description
+ *
+ * The wl_data_source object is the source side of a wl_data_offer.
+ * It is created by the source client in a data transfer and
+ * provides a way to describe the offered data and a way to respond
+ * to requests to transfer the data.
+ * @section page_iface_wl_data_source_api API
+ * See @ref iface_wl_data_source.
+ */
+/**
+ * @defgroup iface_wl_data_source The wl_data_source interface
+ *
+ * The wl_data_source object is the source side of a wl_data_offer.
+ * It is created by the source client in a data transfer and
+ * provides a way to describe the offered data and a way to respond
+ * to requests to transfer the data.
+ */
+extern const struct wl_interface wl_data_source_interface;
+/**
+ * @page page_iface_wl_data_device wl_data_device
+ * @section page_iface_wl_data_device_desc Description
+ *
+ * There is one wl_data_device per seat which can be obtained
+ * from the global wl_data_device_manager singleton.
+ *
+ * A wl_data_device provides access to inter-client data transfer
+ * mechanisms such as copy-and-paste and drag-and-drop.
+ * @section page_iface_wl_data_device_api API
+ * See @ref iface_wl_data_device.
+ */
+/**
+ * @defgroup iface_wl_data_device The wl_data_device interface
+ *
+ * There is one wl_data_device per seat which can be obtained
+ * from the global wl_data_device_manager singleton.
+ *
+ * A wl_data_device provides access to inter-client data transfer
+ * mechanisms such as copy-and-paste and drag-and-drop.
+ */
+extern const struct wl_interface wl_data_device_interface;
+/**
+ * @page page_iface_wl_data_device_manager wl_data_device_manager
+ * @section page_iface_wl_data_device_manager_desc Description
+ *
+ * The wl_data_device_manager is a singleton global object that
+ * provides access to inter-client data transfer mechanisms such as
+ * copy-and-paste and drag-and-drop. These mechanisms are tied to
+ * a wl_seat and this interface lets a client get a wl_data_device
+ * corresponding to a wl_seat.
+ *
+ * Depending on the version bound, the objects created from the bound
+ * wl_data_device_manager object will have different requirements for
+ * functioning properly. See wl_data_source.set_actions,
+ * wl_data_offer.accept and wl_data_offer.finish for details.
+ * @section page_iface_wl_data_device_manager_api API
+ * See @ref iface_wl_data_device_manager.
+ */
+/**
+ * @defgroup iface_wl_data_device_manager The wl_data_device_manager interface
+ *
+ * The wl_data_device_manager is a singleton global object that
+ * provides access to inter-client data transfer mechanisms such as
+ * copy-and-paste and drag-and-drop. These mechanisms are tied to
+ * a wl_seat and this interface lets a client get a wl_data_device
+ * corresponding to a wl_seat.
+ *
+ * Depending on the version bound, the objects created from the bound
+ * wl_data_device_manager object will have different requirements for
+ * functioning properly. See wl_data_source.set_actions,
+ * wl_data_offer.accept and wl_data_offer.finish for details.
+ */
+extern const struct wl_interface wl_data_device_manager_interface;
+/**
+ * @page page_iface_wl_shell wl_shell
+ * @section page_iface_wl_shell_desc Description
+ *
+ * This interface is implemented by servers that provide
+ * desktop-style user interfaces.
+ *
+ * It allows clients to associate a wl_shell_surface with
+ * a basic surface.
+ * @section page_iface_wl_shell_api API
+ * See @ref iface_wl_shell.
+ */
+/**
+ * @defgroup iface_wl_shell The wl_shell interface
+ *
+ * This interface is implemented by servers that provide
+ * desktop-style user interfaces.
+ *
+ * It allows clients to associate a wl_shell_surface with
+ * a basic surface.
+ */
+extern const struct wl_interface wl_shell_interface;
+/**
+ * @page page_iface_wl_shell_surface wl_shell_surface
+ * @section page_iface_wl_shell_surface_desc Description
+ *
+ * An interface that may be implemented by a wl_surface, for
+ * implementations that provide a desktop-style user interface.
+ *
+ * It provides requests to treat surfaces like toplevel, fullscreen
+ * or popup windows, move, resize or maximize them, associate
+ * metadata like title and class, etc.
+ *
+ * On the server side the object is automatically destroyed when
+ * the related wl_surface is destroyed. On the client side,
+ * wl_shell_surface_destroy() must be called before destroying
+ * the wl_surface object.
+ * @section page_iface_wl_shell_surface_api API
+ * See @ref iface_wl_shell_surface.
+ */
+/**
+ * @defgroup iface_wl_shell_surface The wl_shell_surface interface
+ *
+ * An interface that may be implemented by a wl_surface, for
+ * implementations that provide a desktop-style user interface.
+ *
+ * It provides requests to treat surfaces like toplevel, fullscreen
+ * or popup windows, move, resize or maximize them, associate
+ * metadata like title and class, etc.
+ *
+ * On the server side the object is automatically destroyed when
+ * the related wl_surface is destroyed. On the client side,
+ * wl_shell_surface_destroy() must be called before destroying
+ * the wl_surface object.
+ */
+extern const struct wl_interface wl_shell_surface_interface;
+/**
+ * @page page_iface_wl_surface wl_surface
+ * @section page_iface_wl_surface_desc Description
+ *
+ * A surface is a rectangular area that is displayed on the screen.
+ * It has a location, size and pixel contents.
+ *
+ * The size of a surface (and relative positions on it) is described
+ * in surface-local coordinates, which may differ from the buffer
+ * coordinates of the pixel content, in case a buffer_transform
+ * or a buffer_scale is used.
+ *
+ * A surface without a "role" is fairly useless: a compositor does
+ * not know where, when or how to present it. The role is the
+ * purpose of a wl_surface. Examples of roles are a cursor for a
+ * pointer (as set by wl_pointer.set_cursor), a drag icon
+ * (wl_data_device.start_drag), a sub-surface
+ * (wl_subcompositor.get_subsurface), and a window as defined by a
+ * shell protocol (e.g. wl_shell.get_shell_surface).
+ *
+ * A surface can have only one role at a time. Initially a
+ * wl_surface does not have a role. Once a wl_surface is given a
+ * role, it is set permanently for the whole lifetime of the
+ * wl_surface object. Giving the current role again is allowed,
+ * unless explicitly forbidden by the relevant interface
+ * specification.
+ *
+ * Surface roles are given by requests in other interfaces such as
+ * wl_pointer.set_cursor. The request should explicitly mention
+ * that this request gives a role to a wl_surface. Often, this
+ * request also creates a new protocol object that represents the
+ * role and adds additional functionality to wl_surface. When a
+ * client wants to destroy a wl_surface, they must destroy this 'role
+ * object' before the wl_surface.
+ *
+ * Destroying the role object does not remove the role from the
+ * wl_surface, but it may stop the wl_surface from "playing the role".
+ * For instance, if a wl_subsurface object is destroyed, the wl_surface
+ * it was created for will be unmapped and forget its position and
+ * z-order. It is allowed to create a wl_subsurface for the same
+ * wl_surface again, but it is not allowed to use the wl_surface as
+ * a cursor (cursor is a different role than sub-surface, and role
+ * switching is not allowed).
+ * @section page_iface_wl_surface_api API
+ * See @ref iface_wl_surface.
+ */
+/**
+ * @defgroup iface_wl_surface The wl_surface interface
+ *
+ * A surface is a rectangular area that is displayed on the screen.
+ * It has a location, size and pixel contents.
+ *
+ * The size of a surface (and relative positions on it) is described
+ * in surface-local coordinates, which may differ from the buffer
+ * coordinates of the pixel content, in case a buffer_transform
+ * or a buffer_scale is used.
+ *
+ * A surface without a "role" is fairly useless: a compositor does
+ * not know where, when or how to present it. The role is the
+ * purpose of a wl_surface. Examples of roles are a cursor for a
+ * pointer (as set by wl_pointer.set_cursor), a drag icon
+ * (wl_data_device.start_drag), a sub-surface
+ * (wl_subcompositor.get_subsurface), and a window as defined by a
+ * shell protocol (e.g. wl_shell.get_shell_surface).
+ *
+ * A surface can have only one role at a time. Initially a
+ * wl_surface does not have a role. Once a wl_surface is given a
+ * role, it is set permanently for the whole lifetime of the
+ * wl_surface object. Giving the current role again is allowed,
+ * unless explicitly forbidden by the relevant interface
+ * specification.
+ *
+ * Surface roles are given by requests in other interfaces such as
+ * wl_pointer.set_cursor. The request should explicitly mention
+ * that this request gives a role to a wl_surface. Often, this
+ * request also creates a new protocol object that represents the
+ * role and adds additional functionality to wl_surface. When a
+ * client wants to destroy a wl_surface, they must destroy this 'role
+ * object' before the wl_surface.
+ *
+ * Destroying the role object does not remove the role from the
+ * wl_surface, but it may stop the wl_surface from "playing the role".
+ * For instance, if a wl_subsurface object is destroyed, the wl_surface
+ * it was created for will be unmapped and forget its position and
+ * z-order. It is allowed to create a wl_subsurface for the same
+ * wl_surface again, but it is not allowed to use the wl_surface as
+ * a cursor (cursor is a different role than sub-surface, and role
+ * switching is not allowed).
+ */
+extern const struct wl_interface wl_surface_interface;
+/**
+ * @page page_iface_wl_seat wl_seat
+ * @section page_iface_wl_seat_desc Description
+ *
+ * A seat is a group of keyboards, pointer and touch devices. This
+ * object is published as a global during start up, or when such a
+ * device is hot plugged. A seat typically has a pointer and
+ * maintains a keyboard focus and a pointer focus.
+ * @section page_iface_wl_seat_api API
+ * See @ref iface_wl_seat.
+ */
+/**
+ * @defgroup iface_wl_seat The wl_seat interface
+ *
+ * A seat is a group of keyboards, pointer and touch devices. This
+ * object is published as a global during start up, or when such a
+ * device is hot plugged. A seat typically has a pointer and
+ * maintains a keyboard focus and a pointer focus.
+ */
+extern const struct wl_interface wl_seat_interface;
+/**
+ * @page page_iface_wl_pointer wl_pointer
+ * @section page_iface_wl_pointer_desc Description
+ *
+ * The wl_pointer interface represents one or more input devices,
+ * such as mice, which control the pointer location and pointer_focus
+ * of a seat.
+ *
+ * The wl_pointer interface generates motion, enter and leave
+ * events for the surfaces that the pointer is located over,
+ * and button and axis events for button presses, button releases
+ * and scrolling.
+ * @section page_iface_wl_pointer_api API
+ * See @ref iface_wl_pointer.
+ */
+/**
+ * @defgroup iface_wl_pointer The wl_pointer interface
+ *
+ * The wl_pointer interface represents one or more input devices,
+ * such as mice, which control the pointer location and pointer_focus
+ * of a seat.
+ *
+ * The wl_pointer interface generates motion, enter and leave
+ * events for the surfaces that the pointer is located over,
+ * and button and axis events for button presses, button releases
+ * and scrolling.
+ */
+extern const struct wl_interface wl_pointer_interface;
+/**
+ * @page page_iface_wl_keyboard wl_keyboard
+ * @section page_iface_wl_keyboard_desc Description
+ *
+ * The wl_keyboard interface represents one or more keyboards
+ * associated with a seat.
+ * @section page_iface_wl_keyboard_api API
+ * See @ref iface_wl_keyboard.
+ */
+/**
+ * @defgroup iface_wl_keyboard The wl_keyboard interface
+ *
+ * The wl_keyboard interface represents one or more keyboards
+ * associated with a seat.
+ */
+extern const struct wl_interface wl_keyboard_interface;
+/**
+ * @page page_iface_wl_touch wl_touch
+ * @section page_iface_wl_touch_desc Description
+ *
+ * The wl_touch interface represents a touchscreen
+ * associated with a seat.
+ *
+ * Touch interactions can consist of one or more contacts.
+ * For each contact, a series of events is generated, starting
+ * with a down event, followed by zero or more motion events,
+ * and ending with an up event. Events relating to the same
+ * contact point can be identified by the ID of the sequence.
+ * @section page_iface_wl_touch_api API
+ * See @ref iface_wl_touch.
+ */
+/**
+ * @defgroup iface_wl_touch The wl_touch interface
+ *
+ * The wl_touch interface represents a touchscreen
+ * associated with a seat.
+ *
+ * Touch interactions can consist of one or more contacts.
+ * For each contact, a series of events is generated, starting
+ * with a down event, followed by zero or more motion events,
+ * and ending with an up event. Events relating to the same
+ * contact point can be identified by the ID of the sequence.
+ */
+extern const struct wl_interface wl_touch_interface;
+/**
+ * @page page_iface_wl_output wl_output
+ * @section page_iface_wl_output_desc Description
+ *
+ * An output describes part of the compositor geometry. The
+ * compositor works in the 'compositor coordinate system' and an
+ * output corresponds to a rectangular area in that space that is
+ * actually visible. This typically corresponds to a monitor that
+ * displays part of the compositor space. This object is published
+ * as global during start up, or when a monitor is hotplugged.
+ * @section page_iface_wl_output_api API
+ * See @ref iface_wl_output.
+ */
+/**
+ * @defgroup iface_wl_output The wl_output interface
+ *
+ * An output describes part of the compositor geometry. The
+ * compositor works in the 'compositor coordinate system' and an
+ * output corresponds to a rectangular area in that space that is
+ * actually visible. This typically corresponds to a monitor that
+ * displays part of the compositor space. This object is published
+ * as global during start up, or when a monitor is hotplugged.
+ */
+extern const struct wl_interface wl_output_interface;
+/**
+ * @page page_iface_wl_region wl_region
+ * @section page_iface_wl_region_desc Description
+ *
+ * A region object describes an area.
+ *
+ * Region objects are used to describe the opaque and input
+ * regions of a surface.
+ * @section page_iface_wl_region_api API
+ * See @ref iface_wl_region.
+ */
+/**
+ * @defgroup iface_wl_region The wl_region interface
+ *
+ * A region object describes an area.
+ *
+ * Region objects are used to describe the opaque and input
+ * regions of a surface.
+ */
+extern const struct wl_interface wl_region_interface;
+/**
+ * @page page_iface_wl_subcompositor wl_subcompositor
+ * @section page_iface_wl_subcompositor_desc Description
+ *
+ * The global interface exposing sub-surface compositing capabilities.
+ * A wl_surface, that has sub-surfaces associated, is called the
+ * parent surface. Sub-surfaces can be arbitrarily nested and create
+ * a tree of sub-surfaces.
+ *
+ * The root surface in a tree of sub-surfaces is the main
+ * surface. The main surface cannot be a sub-surface, because
+ * sub-surfaces must always have a parent.
+ *
+ * A main surface with its sub-surfaces forms a (compound) window.
+ * For window management purposes, this set of wl_surface objects is
+ * to be considered as a single window, and it should also behave as
+ * such.
+ *
+ * The aim of sub-surfaces is to offload some of the compositing work
+ * within a window from clients to the compositor. A prime example is
+ * a video player with decorations and video in separate wl_surface
+ * objects. This should allow the compositor to pass YUV video buffer
+ * processing to dedicated overlay hardware when possible.
+ * @section page_iface_wl_subcompositor_api API
+ * See @ref iface_wl_subcompositor.
+ */
+/**
+ * @defgroup iface_wl_subcompositor The wl_subcompositor interface
+ *
+ * The global interface exposing sub-surface compositing capabilities.
+ * A wl_surface, that has sub-surfaces associated, is called the
+ * parent surface. Sub-surfaces can be arbitrarily nested and create
+ * a tree of sub-surfaces.
+ *
+ * The root surface in a tree of sub-surfaces is the main
+ * surface. The main surface cannot be a sub-surface, because
+ * sub-surfaces must always have a parent.
+ *
+ * A main surface with its sub-surfaces forms a (compound) window.
+ * For window management purposes, this set of wl_surface objects is
+ * to be considered as a single window, and it should also behave as
+ * such.
+ *
+ * The aim of sub-surfaces is to offload some of the compositing work
+ * within a window from clients to the compositor. A prime example is
+ * a video player with decorations and video in separate wl_surface
+ * objects. This should allow the compositor to pass YUV video buffer
+ * processing to dedicated overlay hardware when possible.
+ */
+extern const struct wl_interface wl_subcompositor_interface;
+/**
+ * @page page_iface_wl_subsurface wl_subsurface
+ * @section page_iface_wl_subsurface_desc Description
+ *
+ * An additional interface to a wl_surface object, which has been
+ * made a sub-surface. A sub-surface has one parent surface. A
+ * sub-surface's size and position are not limited to that of the parent.
+ * Particularly, a sub-surface is not automatically clipped to its
+ * parent's area.
+ *
+ * A sub-surface becomes mapped, when a non-NULL wl_buffer is applied
+ * and the parent surface is mapped. The order of which one happens
+ * first is irrelevant. A sub-surface is hidden if the parent becomes
+ * hidden, or if a NULL wl_buffer is applied. These rules apply
+ * recursively through the tree of surfaces.
+ *
+ * The behaviour of a wl_surface.commit request on a sub-surface
+ * depends on the sub-surface's mode. The possible modes are
+ * synchronized and desynchronized, see methods
+ * wl_subsurface.set_sync and wl_subsurface.set_desync. Synchronized
+ * mode caches the wl_surface state to be applied when the parent's
+ * state gets applied, and desynchronized mode applies the pending
+ * wl_surface state directly. A sub-surface is initially in the
+ * synchronized mode.
+ *
+ * Sub-surfaces have also other kind of state, which is managed by
+ * wl_subsurface requests, as opposed to wl_surface requests. This
+ * state includes the sub-surface position relative to the parent
+ * surface (wl_subsurface.set_position), and the stacking order of
+ * the parent and its sub-surfaces (wl_subsurface.place_above and
+ * .place_below). This state is applied when the parent surface's
+ * wl_surface state is applied, regardless of the sub-surface's mode.
+ * As the exception, set_sync and set_desync are effective immediately.
+ *
+ * The main surface can be thought to be always in desynchronized mode,
+ * since it does not have a parent in the sub-surfaces sense.
+ *
+ * Even if a sub-surface is in desynchronized mode, it will behave as
+ * in synchronized mode, if its parent surface behaves as in
+ * synchronized mode. This rule is applied recursively throughout the
+ * tree of surfaces. This means, that one can set a sub-surface into
+ * synchronized mode, and then assume that all its child and grand-child
+ * sub-surfaces are synchronized, too, without explicitly setting them.
+ *
+ * If the wl_surface associated with the wl_subsurface is destroyed, the
+ * wl_subsurface object becomes inert. Note, that destroying either object
+ * takes effect immediately. If you need to synchronize the removal
+ * of a sub-surface to the parent surface update, unmap the sub-surface
+ * first by attaching a NULL wl_buffer, update parent, and then destroy
+ * the sub-surface.
+ *
+ * If the parent wl_surface object is destroyed, the sub-surface is
+ * unmapped.
+ * @section page_iface_wl_subsurface_api API
+ * See @ref iface_wl_subsurface.
+ */
+/**
+ * @defgroup iface_wl_subsurface The wl_subsurface interface
+ *
+ * An additional interface to a wl_surface object, which has been
+ * made a sub-surface. A sub-surface has one parent surface. A
+ * sub-surface's size and position are not limited to that of the parent.
+ * Particularly, a sub-surface is not automatically clipped to its
+ * parent's area.
+ *
+ * A sub-surface becomes mapped, when a non-NULL wl_buffer is applied
+ * and the parent surface is mapped. The order of which one happens
+ * first is irrelevant. A sub-surface is hidden if the parent becomes
+ * hidden, or if a NULL wl_buffer is applied. These rules apply
+ * recursively through the tree of surfaces.
+ *
+ * The behaviour of a wl_surface.commit request on a sub-surface
+ * depends on the sub-surface's mode. The possible modes are
+ * synchronized and desynchronized, see methods
+ * wl_subsurface.set_sync and wl_subsurface.set_desync. Synchronized
+ * mode caches the wl_surface state to be applied when the parent's
+ * state gets applied, and desynchronized mode applies the pending
+ * wl_surface state directly. A sub-surface is initially in the
+ * synchronized mode.
+ *
+ * Sub-surfaces have also other kind of state, which is managed by
+ * wl_subsurface requests, as opposed to wl_surface requests. This
+ * state includes the sub-surface position relative to the parent
+ * surface (wl_subsurface.set_position), and the stacking order of
+ * the parent and its sub-surfaces (wl_subsurface.place_above and
+ * .place_below). This state is applied when the parent surface's
+ * wl_surface state is applied, regardless of the sub-surface's mode.
+ * As the exception, set_sync and set_desync are effective immediately.
+ *
+ * The main surface can be thought to be always in desynchronized mode,
+ * since it does not have a parent in the sub-surfaces sense.
+ *
+ * Even if a sub-surface is in desynchronized mode, it will behave as
+ * in synchronized mode, if its parent surface behaves as in
+ * synchronized mode. This rule is applied recursively throughout the
+ * tree of surfaces. This means, that one can set a sub-surface into
+ * synchronized mode, and then assume that all its child and grand-child
+ * sub-surfaces are synchronized, too, without explicitly setting them.
+ *
+ * If the wl_surface associated with the wl_subsurface is destroyed, the
+ * wl_subsurface object becomes inert. Note, that destroying either object
+ * takes effect immediately. If you need to synchronize the removal
+ * of a sub-surface to the parent surface update, unmap the sub-surface
+ * first by attaching a NULL wl_buffer, update parent, and then destroy
+ * the sub-surface.
+ *
+ * If the parent wl_surface object is destroyed, the sub-surface is
+ * unmapped.
+ */
+extern const struct wl_interface wl_subsurface_interface;
+
+#ifndef WL_DISPLAY_ERROR_ENUM
+#define WL_DISPLAY_ERROR_ENUM
+/**
+ * @ingroup iface_wl_display
+ * global error values
+ *
+ * These errors are global and can be emitted in response to any
+ * server request.
+ */
+enum wl_display_error {
+ /**
+ * server couldn't find object
+ */
+ WL_DISPLAY_ERROR_INVALID_OBJECT = 0,
+ /**
+ * method doesn't exist on the specified interface
+ */
+ WL_DISPLAY_ERROR_INVALID_METHOD = 1,
+ /**
+ * server is out of memory
+ */
+ WL_DISPLAY_ERROR_NO_MEMORY = 2,
+};
+#endif /* WL_DISPLAY_ERROR_ENUM */
+
+/**
+ * @ingroup iface_wl_display
+ * @struct wl_display_listener
+ */
+struct wl_display_listener {
+ /**
+ * fatal error event
+ *
+ * The error event is sent out when a fatal (non-recoverable)
+ * error has occurred. The object_id argument is the object where
+ * the error occurred, most often in response to a request to that
+ * object. The code identifies the error and is defined by the
+ * object interface. As such, each interface defines its own set of
+ * error codes. The message is a brief description of the error,
+ * for (debugging) convenience.
+ * @param object_id object where the error occurred
+ * @param code error code
+ * @param message error description
+ */
+ void (*error)(void *data,
+ struct wl_display *wl_display,
+ void *object_id,
+ uint32_t code,
+ const char *message);
+ /**
+ * acknowledge object ID deletion
+ *
+ * This event is used internally by the object ID management
+ * logic. When a client deletes an object, the server will send
+ * this event to acknowledge that it has seen the delete request.
+ * When the client receives this event, it will know that it can
+ * safely reuse the object ID.
+ * @param id deleted object ID
+ */
+ void (*delete_id)(void *data,
+ struct wl_display *wl_display,
+ uint32_t id);
+};
+
+/**
+ * @ingroup iface_wl_display
+ */
+static inline int
+wl_display_add_listener(struct wl_display *wl_display,
+ const struct wl_display_listener *listener, void *data)
+{
+ return wl_proxy_add_listener((struct wl_proxy *) wl_display,
+ (void (**)(void)) listener, data);
+}
+
+#define WL_DISPLAY_SYNC 0
+#define WL_DISPLAY_GET_REGISTRY 1
+
+/**
+ * @ingroup iface_wl_display
+ */
+#define WL_DISPLAY_ERROR_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_display
+ */
+#define WL_DISPLAY_DELETE_ID_SINCE_VERSION 1
+
+/**
+ * @ingroup iface_wl_display
+ */
+#define WL_DISPLAY_SYNC_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_display
+ */
+#define WL_DISPLAY_GET_REGISTRY_SINCE_VERSION 1
+
+/** @ingroup iface_wl_display */
+static inline void
+wl_display_set_user_data(struct wl_display *wl_display, void *user_data)
+{
+ wl_proxy_set_user_data((struct wl_proxy *) wl_display, user_data);
+}
+
+/** @ingroup iface_wl_display */
+static inline void *
+wl_display_get_user_data(struct wl_display *wl_display)
+{
+ return wl_proxy_get_user_data((struct wl_proxy *) wl_display);
+}
+
+static inline uint32_t
+wl_display_get_version(struct wl_display *wl_display)
+{
+ return wl_proxy_get_version((struct wl_proxy *) wl_display);
+}
+
+/**
+ * @ingroup iface_wl_display
+ *
+ * The sync request asks the server to emit the 'done' event
+ * on the returned wl_callback object. Since requests are
+ * handled in-order and events are delivered in-order, this can
+ * be used as a barrier to ensure all previous requests and the
+ * resulting events have been handled.
+ *
+ * The object returned by this request will be destroyed by the
+ * compositor after the callback is fired and as such the client must not
+ * attempt to use it after that point.
+ *
+ * The callback_data passed in the callback is the event serial.
+ */
+static inline struct wl_callback *
+wl_display_sync(struct wl_display *wl_display)
+{
+ struct wl_proxy *callback;
+
+ callback = wl_proxy_marshal_constructor((struct wl_proxy *) wl_display,
+ WL_DISPLAY_SYNC, &wl_callback_interface, NULL);
+
+ return (struct wl_callback *) callback;
+}
+
+/**
+ * @ingroup iface_wl_display
+ *
+ * This request creates a registry object that allows the client
+ * to list and bind the global objects available from the
+ * compositor.
+ */
+static inline struct wl_registry *
+wl_display_get_registry(struct wl_display *wl_display)
+{
+ struct wl_proxy *registry;
+
+ registry = wl_proxy_marshal_constructor((struct wl_proxy *) wl_display,
+ WL_DISPLAY_GET_REGISTRY, &wl_registry_interface, NULL);
+
+ return (struct wl_registry *) registry;
+}
+
+/**
+ * @ingroup iface_wl_registry
+ * @struct wl_registry_listener
+ */
+struct wl_registry_listener {
+ /**
+ * announce global object
+ *
+ * Notify the client of global objects.
+ *
+ * The event notifies the client that a global object with the
+ * given name is now available, and it implements the given version
+ * of the given interface.
+ * @param name numeric name of the global object
+ * @param interface interface implemented by the object
+ * @param version interface version
+ */
+ void (*global)(void *data,
+ struct wl_registry *wl_registry,
+ uint32_t name,
+ const char *interface,
+ uint32_t version);
+ /**
+ * announce removal of global object
+ *
+ * Notify the client of removed global objects.
+ *
+ * This event notifies the client that the global identified by
+ * name is no longer available. If the client bound to the global
+ * using the bind request, the client should now destroy that
+ * object.
+ *
+ * The object remains valid and requests to the object will be
+ * ignored until the client destroys it, to avoid races between the
+ * global going away and a client sending a request to it.
+ * @param name numeric name of the global object
+ */
+ void (*global_remove)(void *data,
+ struct wl_registry *wl_registry,
+ uint32_t name);
+};
+
+/**
+ * @ingroup iface_wl_registry
+ */
+static inline int
+wl_registry_add_listener(struct wl_registry *wl_registry,
+ const struct wl_registry_listener *listener, void *data)
+{
+ return wl_proxy_add_listener((struct wl_proxy *) wl_registry,
+ (void (**)(void)) listener, data);
+}
+
+#define WL_REGISTRY_BIND 0
+
+/**
+ * @ingroup iface_wl_registry
+ */
+#define WL_REGISTRY_GLOBAL_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_registry
+ */
+#define WL_REGISTRY_GLOBAL_REMOVE_SINCE_VERSION 1
+
+/**
+ * @ingroup iface_wl_registry
+ */
+#define WL_REGISTRY_BIND_SINCE_VERSION 1
+
+/** @ingroup iface_wl_registry */
+static inline void
+wl_registry_set_user_data(struct wl_registry *wl_registry, void *user_data)
+{
+ wl_proxy_set_user_data((struct wl_proxy *) wl_registry, user_data);
+}
+
+/** @ingroup iface_wl_registry */
+static inline void *
+wl_registry_get_user_data(struct wl_registry *wl_registry)
+{
+ return wl_proxy_get_user_data((struct wl_proxy *) wl_registry);
+}
+
+static inline uint32_t
+wl_registry_get_version(struct wl_registry *wl_registry)
+{
+ return wl_proxy_get_version((struct wl_proxy *) wl_registry);
+}
+
+/** @ingroup iface_wl_registry */
+static inline void
+wl_registry_destroy(struct wl_registry *wl_registry)
+{
+ wl_proxy_destroy((struct wl_proxy *) wl_registry);
+}
+
+/**
+ * @ingroup iface_wl_registry
+ *
+ * Binds a new, client-created object to the server using the
+ * specified name as the identifier.
+ */
+static inline void *
+wl_registry_bind(struct wl_registry *wl_registry, uint32_t name, const struct wl_interface *interface, uint32_t version)
+{
+ struct wl_proxy *id;
+
+ id = wl_proxy_marshal_constructor_versioned((struct wl_proxy *) wl_registry,
+ WL_REGISTRY_BIND, interface, version, name, interface->name, version, NULL);
+
+ return (void *) id;
+}
+
+/**
+ * @ingroup iface_wl_callback
+ * @struct wl_callback_listener
+ */
+struct wl_callback_listener {
+ /**
+ * done event
+ *
+ * Notify the client when the related request is done.
+ * @param callback_data request-specific data for the callback
+ */
+ void (*done)(void *data,
+ struct wl_callback *wl_callback,
+ uint32_t callback_data);
+};
+
+/**
+ * @ingroup iface_wl_callback
+ */
+static inline int
+wl_callback_add_listener(struct wl_callback *wl_callback,
+ const struct wl_callback_listener *listener, void *data)
+{
+ return wl_proxy_add_listener((struct wl_proxy *) wl_callback,
+ (void (**)(void)) listener, data);
+}
+
+/**
+ * @ingroup iface_wl_callback
+ */
+#define WL_CALLBACK_DONE_SINCE_VERSION 1
+
+
+/** @ingroup iface_wl_callback */
+static inline void
+wl_callback_set_user_data(struct wl_callback *wl_callback, void *user_data)
+{
+ wl_proxy_set_user_data((struct wl_proxy *) wl_callback, user_data);
+}
+
+/** @ingroup iface_wl_callback */
+static inline void *
+wl_callback_get_user_data(struct wl_callback *wl_callback)
+{
+ return wl_proxy_get_user_data((struct wl_proxy *) wl_callback);
+}
+
+static inline uint32_t
+wl_callback_get_version(struct wl_callback *wl_callback)
+{
+ return wl_proxy_get_version((struct wl_proxy *) wl_callback);
+}
+
+/** @ingroup iface_wl_callback */
+static inline void
+wl_callback_destroy(struct wl_callback *wl_callback)
+{
+ wl_proxy_destroy((struct wl_proxy *) wl_callback);
+}
+
+#define WL_COMPOSITOR_CREATE_SURFACE 0
+#define WL_COMPOSITOR_CREATE_REGION 1
+
+
+/**
+ * @ingroup iface_wl_compositor
+ */
+#define WL_COMPOSITOR_CREATE_SURFACE_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_compositor
+ */
+#define WL_COMPOSITOR_CREATE_REGION_SINCE_VERSION 1
+
+/** @ingroup iface_wl_compositor */
+static inline void
+wl_compositor_set_user_data(struct wl_compositor *wl_compositor, void *user_data)
+{
+ wl_proxy_set_user_data((struct wl_proxy *) wl_compositor, user_data);
+}
+
+/** @ingroup iface_wl_compositor */
+static inline void *
+wl_compositor_get_user_data(struct wl_compositor *wl_compositor)
+{
+ return wl_proxy_get_user_data((struct wl_proxy *) wl_compositor);
+}
+
+static inline uint32_t
+wl_compositor_get_version(struct wl_compositor *wl_compositor)
+{
+ return wl_proxy_get_version((struct wl_proxy *) wl_compositor);
+}
+
+/** @ingroup iface_wl_compositor */
+static inline void
+wl_compositor_destroy(struct wl_compositor *wl_compositor)
+{
+ wl_proxy_destroy((struct wl_proxy *) wl_compositor);
+}
+
+/**
+ * @ingroup iface_wl_compositor
+ *
+ * Ask the compositor to create a new surface.
+ */
+static inline struct wl_surface *
+wl_compositor_create_surface(struct wl_compositor *wl_compositor)
+{
+ struct wl_proxy *id;
+
+ id = wl_proxy_marshal_constructor((struct wl_proxy *) wl_compositor,
+ WL_COMPOSITOR_CREATE_SURFACE, &wl_surface_interface, NULL);
+
+ return (struct wl_surface *) id;
+}
+
+/**
+ * @ingroup iface_wl_compositor
+ *
+ * Ask the compositor to create a new region.
+ */
+static inline struct wl_region *
+wl_compositor_create_region(struct wl_compositor *wl_compositor)
+{
+ struct wl_proxy *id;
+
+ id = wl_proxy_marshal_constructor((struct wl_proxy *) wl_compositor,
+ WL_COMPOSITOR_CREATE_REGION, &wl_region_interface, NULL);
+
+ return (struct wl_region *) id;
+}
+
+#define WL_SHM_POOL_CREATE_BUFFER 0
+#define WL_SHM_POOL_DESTROY 1
+#define WL_SHM_POOL_RESIZE 2
+
+
+/**
+ * @ingroup iface_wl_shm_pool
+ */
+#define WL_SHM_POOL_CREATE_BUFFER_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_shm_pool
+ */
+#define WL_SHM_POOL_DESTROY_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_shm_pool
+ */
+#define WL_SHM_POOL_RESIZE_SINCE_VERSION 1
+
+/** @ingroup iface_wl_shm_pool */
+static inline void
+wl_shm_pool_set_user_data(struct wl_shm_pool *wl_shm_pool, void *user_data)
+{
+ wl_proxy_set_user_data((struct wl_proxy *) wl_shm_pool, user_data);
+}
+
+/** @ingroup iface_wl_shm_pool */
+static inline void *
+wl_shm_pool_get_user_data(struct wl_shm_pool *wl_shm_pool)
+{
+ return wl_proxy_get_user_data((struct wl_proxy *) wl_shm_pool);
+}
+
+static inline uint32_t
+wl_shm_pool_get_version(struct wl_shm_pool *wl_shm_pool)
+{
+ return wl_proxy_get_version((struct wl_proxy *) wl_shm_pool);
+}
+
+/**
+ * @ingroup iface_wl_shm_pool
+ *
+ * Create a wl_buffer object from the pool.
+ *
+ * The buffer is created offset bytes into the pool and has
+ * width and height as specified. The stride argument specifies
+ * the number of bytes from the beginning of one row to the beginning
+ * of the next. The format is the pixel format of the buffer and
+ * must be one of those advertised through the wl_shm.format event.
+ *
+ * A buffer will keep a reference to the pool it was created from
+ * so it is valid to destroy the pool immediately after creating
+ * a buffer from it.
+ */
+static inline struct wl_buffer *
+wl_shm_pool_create_buffer(struct wl_shm_pool *wl_shm_pool, int32_t offset, int32_t width, int32_t height, int32_t stride, uint32_t format)
+{
+ struct wl_proxy *id;
+
+ id = wl_proxy_marshal_constructor((struct wl_proxy *) wl_shm_pool,
+ WL_SHM_POOL_CREATE_BUFFER, &wl_buffer_interface, NULL, offset, width, height, stride, format);
+
+ return (struct wl_buffer *) id;
+}
+
+/**
+ * @ingroup iface_wl_shm_pool
+ *
+ * Destroy the shared memory pool.
+ *
+ * The mmapped memory will be released when all
+ * buffers that have been created from this pool
+ * are gone.
+ */
+static inline void
+wl_shm_pool_destroy(struct wl_shm_pool *wl_shm_pool)
+{
+ wl_proxy_marshal((struct wl_proxy *) wl_shm_pool,
+ WL_SHM_POOL_DESTROY);
+
+ wl_proxy_destroy((struct wl_proxy *) wl_shm_pool);
+}
+
+/**
+ * @ingroup iface_wl_shm_pool
+ *
+ * This request will cause the server to remap the backing memory
+ * for the pool from the file descriptor passed when the pool was
+ * created, but using the new size. This request can only be
+ * used to make the pool bigger.
+ */
+static inline void
+wl_shm_pool_resize(struct wl_shm_pool *wl_shm_pool, int32_t size)
+{
+ wl_proxy_marshal((struct wl_proxy *) wl_shm_pool,
+ WL_SHM_POOL_RESIZE, size);
+}
+
+#ifndef WL_SHM_ERROR_ENUM
+#define WL_SHM_ERROR_ENUM
+/**
+ * @ingroup iface_wl_shm
+ * wl_shm error values
+ *
+ * These errors can be emitted in response to wl_shm requests.
+ */
+enum wl_shm_error {
+ /**
+ * buffer format is not known
+ */
+ WL_SHM_ERROR_INVALID_FORMAT = 0,
+ /**
+ * invalid size or stride during pool or buffer creation
+ */
+ WL_SHM_ERROR_INVALID_STRIDE = 1,
+ /**
+ * mmapping the file descriptor failed
+ */
+ WL_SHM_ERROR_INVALID_FD = 2,
+};
+#endif /* WL_SHM_ERROR_ENUM */
+
+#ifndef WL_SHM_FORMAT_ENUM
+#define WL_SHM_FORMAT_ENUM
+/**
+ * @ingroup iface_wl_shm
+ * pixel formats
+ *
+ * This describes the memory layout of an individual pixel.
+ *
+ * All renderers should support argb8888 and xrgb8888 but any other
+ * formats are optional and may not be supported by the particular
+ * renderer in use.
+ *
+ * The drm format codes match the macros defined in drm_fourcc.h.
+ * The formats actually supported by the compositor will be
+ * reported by the format event.
+ */
+enum wl_shm_format {
+ /**
+ * 32-bit ARGB format, [31:0] A:R:G:B 8:8:8:8 little endian
+ */
+ WL_SHM_FORMAT_ARGB8888 = 0,
+ /**
+ * 32-bit RGB format, [31:0] x:R:G:B 8:8:8:8 little endian
+ */
+ WL_SHM_FORMAT_XRGB8888 = 1,
+ /**
+ * 8-bit color index format, [7:0] C
+ */
+ WL_SHM_FORMAT_C8 = 0x20203843,
+ /**
+ * 8-bit RGB format, [7:0] R:G:B 3:3:2
+ */
+ WL_SHM_FORMAT_RGB332 = 0x38424752,
+ /**
+ * 8-bit BGR format, [7:0] B:G:R 2:3:3
+ */
+ WL_SHM_FORMAT_BGR233 = 0x38524742,
+ /**
+ * 16-bit xRGB format, [15:0] x:R:G:B 4:4:4:4 little endian
+ */
+ WL_SHM_FORMAT_XRGB4444 = 0x32315258,
+ /**
+ * 16-bit xBGR format, [15:0] x:B:G:R 4:4:4:4 little endian
+ */
+ WL_SHM_FORMAT_XBGR4444 = 0x32314258,
+ /**
+ * 16-bit RGBx format, [15:0] R:G:B:x 4:4:4:4 little endian
+ */
+ WL_SHM_FORMAT_RGBX4444 = 0x32315852,
+ /**
+ * 16-bit BGRx format, [15:0] B:G:R:x 4:4:4:4 little endian
+ */
+ WL_SHM_FORMAT_BGRX4444 = 0x32315842,
+ /**
+ * 16-bit ARGB format, [15:0] A:R:G:B 4:4:4:4 little endian
+ */
+ WL_SHM_FORMAT_ARGB4444 = 0x32315241,
+ /**
+ * 16-bit ABGR format, [15:0] A:B:G:R 4:4:4:4 little endian
+ */
+ WL_SHM_FORMAT_ABGR4444 = 0x32314241,
+ /**
+ * 16-bit RBGA format, [15:0] R:G:B:A 4:4:4:4 little endian
+ */
+ WL_SHM_FORMAT_RGBA4444 = 0x32314152,
+ /**
+ * 16-bit BGRA format, [15:0] B:G:R:A 4:4:4:4 little endian
+ */
+ WL_SHM_FORMAT_BGRA4444 = 0x32314142,
+ /**
+ * 16-bit xRGB format, [15:0] x:R:G:B 1:5:5:5 little endian
+ */
+ WL_SHM_FORMAT_XRGB1555 = 0x35315258,
+ /**
+ * 16-bit xBGR 1555 format, [15:0] x:B:G:R 1:5:5:5 little endian
+ */
+ WL_SHM_FORMAT_XBGR1555 = 0x35314258,
+ /**
+ * 16-bit RGBx 5551 format, [15:0] R:G:B:x 5:5:5:1 little endian
+ */
+ WL_SHM_FORMAT_RGBX5551 = 0x35315852,
+ /**
+ * 16-bit BGRx 5551 format, [15:0] B:G:R:x 5:5:5:1 little endian
+ */
+ WL_SHM_FORMAT_BGRX5551 = 0x35315842,
+ /**
+ * 16-bit ARGB 1555 format, [15:0] A:R:G:B 1:5:5:5 little endian
+ */
+ WL_SHM_FORMAT_ARGB1555 = 0x35315241,
+ /**
+ * 16-bit ABGR 1555 format, [15:0] A:B:G:R 1:5:5:5 little endian
+ */
+ WL_SHM_FORMAT_ABGR1555 = 0x35314241,
+ /**
+ * 16-bit RGBA 5551 format, [15:0] R:G:B:A 5:5:5:1 little endian
+ */
+ WL_SHM_FORMAT_RGBA5551 = 0x35314152,
+ /**
+ * 16-bit BGRA 5551 format, [15:0] B:G:R:A 5:5:5:1 little endian
+ */
+ WL_SHM_FORMAT_BGRA5551 = 0x35314142,
+ /**
+ * 16-bit RGB 565 format, [15:0] R:G:B 5:6:5 little endian
+ */
+ WL_SHM_FORMAT_RGB565 = 0x36314752,
+ /**
+ * 16-bit BGR 565 format, [15:0] B:G:R 5:6:5 little endian
+ */
+ WL_SHM_FORMAT_BGR565 = 0x36314742,
+ /**
+ * 24-bit RGB format, [23:0] R:G:B little endian
+ */
+ WL_SHM_FORMAT_RGB888 = 0x34324752,
+ /**
+ * 24-bit BGR format, [23:0] B:G:R little endian
+ */
+ WL_SHM_FORMAT_BGR888 = 0x34324742,
+ /**
+ * 32-bit xBGR format, [31:0] x:B:G:R 8:8:8:8 little endian
+ */
+ WL_SHM_FORMAT_XBGR8888 = 0x34324258,
+ /**
+ * 32-bit RGBx format, [31:0] R:G:B:x 8:8:8:8 little endian
+ */
+ WL_SHM_FORMAT_RGBX8888 = 0x34325852,
+ /**
+ * 32-bit BGRx format, [31:0] B:G:R:x 8:8:8:8 little endian
+ */
+ WL_SHM_FORMAT_BGRX8888 = 0x34325842,
+ /**
+ * 32-bit ABGR format, [31:0] A:B:G:R 8:8:8:8 little endian
+ */
+ WL_SHM_FORMAT_ABGR8888 = 0x34324241,
+ /**
+ * 32-bit RGBA format, [31:0] R:G:B:A 8:8:8:8 little endian
+ */
+ WL_SHM_FORMAT_RGBA8888 = 0x34324152,
+ /**
+ * 32-bit BGRA format, [31:0] B:G:R:A 8:8:8:8 little endian
+ */
+ WL_SHM_FORMAT_BGRA8888 = 0x34324142,
+ /**
+ * 32-bit xRGB format, [31:0] x:R:G:B 2:10:10:10 little endian
+ */
+ WL_SHM_FORMAT_XRGB2101010 = 0x30335258,
+ /**
+ * 32-bit xBGR format, [31:0] x:B:G:R 2:10:10:10 little endian
+ */
+ WL_SHM_FORMAT_XBGR2101010 = 0x30334258,
+ /**
+ * 32-bit RGBx format, [31:0] R:G:B:x 10:10:10:2 little endian
+ */
+ WL_SHM_FORMAT_RGBX1010102 = 0x30335852,
+ /**
+ * 32-bit BGRx format, [31:0] B:G:R:x 10:10:10:2 little endian
+ */
+ WL_SHM_FORMAT_BGRX1010102 = 0x30335842,
+ /**
+ * 32-bit ARGB format, [31:0] A:R:G:B 2:10:10:10 little endian
+ */
+ WL_SHM_FORMAT_ARGB2101010 = 0x30335241,
+ /**
+ * 32-bit ABGR format, [31:0] A:B:G:R 2:10:10:10 little endian
+ */
+ WL_SHM_FORMAT_ABGR2101010 = 0x30334241,
+ /**
+ * 32-bit RGBA format, [31:0] R:G:B:A 10:10:10:2 little endian
+ */
+ WL_SHM_FORMAT_RGBA1010102 = 0x30334152,
+ /**
+ * 32-bit BGRA format, [31:0] B:G:R:A 10:10:10:2 little endian
+ */
+ WL_SHM_FORMAT_BGRA1010102 = 0x30334142,
+ /**
+ * packed YCbCr format, [31:0] Cr0:Y1:Cb0:Y0 8:8:8:8 little endian
+ */
+ WL_SHM_FORMAT_YUYV = 0x56595559,
+ /**
+ * packed YCbCr format, [31:0] Cb0:Y1:Cr0:Y0 8:8:8:8 little endian
+ */
+ WL_SHM_FORMAT_YVYU = 0x55595659,
+ /**
+ * packed YCbCr format, [31:0] Y1:Cr0:Y0:Cb0 8:8:8:8 little endian
+ */
+ WL_SHM_FORMAT_UYVY = 0x59565955,
+ /**
+ * packed YCbCr format, [31:0] Y1:Cb0:Y0:Cr0 8:8:8:8 little endian
+ */
+ WL_SHM_FORMAT_VYUY = 0x59555956,
+ /**
+ * packed AYCbCr format, [31:0] A:Y:Cb:Cr 8:8:8:8 little endian
+ */
+ WL_SHM_FORMAT_AYUV = 0x56555941,
+ /**
+ * 2 plane YCbCr Cr:Cb format, 2x2 subsampled Cr:Cb plane
+ */
+ WL_SHM_FORMAT_NV12 = 0x3231564e,
+ /**
+ * 2 plane YCbCr Cb:Cr format, 2x2 subsampled Cb:Cr plane
+ */
+ WL_SHM_FORMAT_NV21 = 0x3132564e,
+ /**
+ * 2 plane YCbCr Cr:Cb format, 2x1 subsampled Cr:Cb plane
+ */
+ WL_SHM_FORMAT_NV16 = 0x3631564e,
+ /**
+ * 2 plane YCbCr Cb:Cr format, 2x1 subsampled Cb:Cr plane
+ */
+ WL_SHM_FORMAT_NV61 = 0x3136564e,
+ /**
+ * 3 plane YCbCr format, 4x4 subsampled Cb (1) and Cr (2) planes
+ */
+ WL_SHM_FORMAT_YUV410 = 0x39565559,
+ /**
+ * 3 plane YCbCr format, 4x4 subsampled Cr (1) and Cb (2) planes
+ */
+ WL_SHM_FORMAT_YVU410 = 0x39555659,
+ /**
+ * 3 plane YCbCr format, 4x1 subsampled Cb (1) and Cr (2) planes
+ */
+ WL_SHM_FORMAT_YUV411 = 0x31315559,
+ /**
+ * 3 plane YCbCr format, 4x1 subsampled Cr (1) and Cb (2) planes
+ */
+ WL_SHM_FORMAT_YVU411 = 0x31315659,
+ /**
+ * 3 plane YCbCr format, 2x2 subsampled Cb (1) and Cr (2) planes
+ */
+ WL_SHM_FORMAT_YUV420 = 0x32315559,
+ /**
+ * 3 plane YCbCr format, 2x2 subsampled Cr (1) and Cb (2) planes
+ */
+ WL_SHM_FORMAT_YVU420 = 0x32315659,
+ /**
+ * 3 plane YCbCr format, 2x1 subsampled Cb (1) and Cr (2) planes
+ */
+ WL_SHM_FORMAT_YUV422 = 0x36315559,
+ /**
+ * 3 plane YCbCr format, 2x1 subsampled Cr (1) and Cb (2) planes
+ */
+ WL_SHM_FORMAT_YVU422 = 0x36315659,
+ /**
+ * 3 plane YCbCr format, non-subsampled Cb (1) and Cr (2) planes
+ */
+ WL_SHM_FORMAT_YUV444 = 0x34325559,
+ /**
+ * 3 plane YCbCr format, non-subsampled Cr (1) and Cb (2) planes
+ */
+ WL_SHM_FORMAT_YVU444 = 0x34325659,
+};
+#endif /* WL_SHM_FORMAT_ENUM */
+
+/**
+ * @ingroup iface_wl_shm
+ * @struct wl_shm_listener
+ */
+struct wl_shm_listener {
+ /**
+ * pixel format description
+ *
+ * Informs the client about a valid pixel format that can be used
+ * for buffers. Known formats include argb8888 and xrgb8888.
+ * @param format buffer pixel format
+ */
+ void (*format)(void *data,
+ struct wl_shm *wl_shm,
+ uint32_t format);
+};
+
+/**
+ * @ingroup iface_wl_shm
+ */
+static inline int
+wl_shm_add_listener(struct wl_shm *wl_shm,
+ const struct wl_shm_listener *listener, void *data)
+{
+ return wl_proxy_add_listener((struct wl_proxy *) wl_shm,
+ (void (**)(void)) listener, data);
+}
+
+#define WL_SHM_CREATE_POOL 0
+
+/**
+ * @ingroup iface_wl_shm
+ */
+#define WL_SHM_FORMAT_SINCE_VERSION 1
+
+/**
+ * @ingroup iface_wl_shm
+ */
+#define WL_SHM_CREATE_POOL_SINCE_VERSION 1
+
+/** @ingroup iface_wl_shm */
+static inline void
+wl_shm_set_user_data(struct wl_shm *wl_shm, void *user_data)
+{
+ wl_proxy_set_user_data((struct wl_proxy *) wl_shm, user_data);
+}
+
+/** @ingroup iface_wl_shm */
+static inline void *
+wl_shm_get_user_data(struct wl_shm *wl_shm)
+{
+ return wl_proxy_get_user_data((struct wl_proxy *) wl_shm);
+}
+
+static inline uint32_t
+wl_shm_get_version(struct wl_shm *wl_shm)
+{
+ return wl_proxy_get_version((struct wl_proxy *) wl_shm);
+}
+
+/** @ingroup iface_wl_shm */
+static inline void
+wl_shm_destroy(struct wl_shm *wl_shm)
+{
+ wl_proxy_destroy((struct wl_proxy *) wl_shm);
+}
+
+/**
+ * @ingroup iface_wl_shm
+ *
+ * Create a new wl_shm_pool object.
+ *
+ * The pool can be used to create shared memory based buffer
+ * objects. The server will mmap size bytes of the passed file
+ * descriptor, to use as backing memory for the pool.
+ */
+static inline struct wl_shm_pool *
+wl_shm_create_pool(struct wl_shm *wl_shm, int32_t fd, int32_t size)
+{
+ struct wl_proxy *id;
+
+ id = wl_proxy_marshal_constructor((struct wl_proxy *) wl_shm,
+ WL_SHM_CREATE_POOL, &wl_shm_pool_interface, NULL, fd, size);
+
+ return (struct wl_shm_pool *) id;
+}
+
+/**
+ * @ingroup iface_wl_buffer
+ * @struct wl_buffer_listener
+ */
+struct wl_buffer_listener {
+ /**
+ * compositor releases buffer
+ *
+ * Sent when this wl_buffer is no longer used by the compositor.
+ * The client is now free to reuse or destroy this buffer and its
+ * backing storage.
+ *
+ * If a client receives a release event before the frame callback
+ * requested in the same wl_surface.commit that attaches this
+ * wl_buffer to a surface, then the client is immediately free to
+ * reuse the buffer and its backing storage, and does not need a
+ * second buffer for the next surface content update. Typically
+ * this is possible, when the compositor maintains a copy of the
+ * wl_surface contents, e.g. as a GL texture. This is an important
+ * optimization for GL(ES) compositors with wl_shm clients.
+ */
+ void (*release)(void *data,
+ struct wl_buffer *wl_buffer);
+};
+
+/**
+ * @ingroup iface_wl_buffer
+ */
+static inline int
+wl_buffer_add_listener(struct wl_buffer *wl_buffer,
+ const struct wl_buffer_listener *listener, void *data)
+{
+ return wl_proxy_add_listener((struct wl_proxy *) wl_buffer,
+ (void (**)(void)) listener, data);
+}
+
+#define WL_BUFFER_DESTROY 0
+
+/**
+ * @ingroup iface_wl_buffer
+ */
+#define WL_BUFFER_RELEASE_SINCE_VERSION 1
+
+/**
+ * @ingroup iface_wl_buffer
+ */
+#define WL_BUFFER_DESTROY_SINCE_VERSION 1
+
+/** @ingroup iface_wl_buffer */
+static inline void
+wl_buffer_set_user_data(struct wl_buffer *wl_buffer, void *user_data)
+{
+ wl_proxy_set_user_data((struct wl_proxy *) wl_buffer, user_data);
+}
+
+/** @ingroup iface_wl_buffer */
+static inline void *
+wl_buffer_get_user_data(struct wl_buffer *wl_buffer)
+{
+ return wl_proxy_get_user_data((struct wl_proxy *) wl_buffer);
+}
+
+static inline uint32_t
+wl_buffer_get_version(struct wl_buffer *wl_buffer)
+{
+ return wl_proxy_get_version((struct wl_proxy *) wl_buffer);
+}
+
+/**
+ * @ingroup iface_wl_buffer
+ *
+ * Destroy a buffer. If and how you need to release the backing
+ * storage is defined by the buffer factory interface.
+ *
+ * For possible side-effects to a surface, see wl_surface.attach.
+ */
+static inline void
+wl_buffer_destroy(struct wl_buffer *wl_buffer)
+{
+ wl_proxy_marshal((struct wl_proxy *) wl_buffer,
+ WL_BUFFER_DESTROY);
+
+ wl_proxy_destroy((struct wl_proxy *) wl_buffer);
+}
+
+#ifndef WL_DATA_OFFER_ERROR_ENUM
+#define WL_DATA_OFFER_ERROR_ENUM
+enum wl_data_offer_error {
+ /**
+ * finish request was called untimely
+ */
+ WL_DATA_OFFER_ERROR_INVALID_FINISH = 0,
+ /**
+ * action mask contains invalid values
+ */
+ WL_DATA_OFFER_ERROR_INVALID_ACTION_MASK = 1,
+ /**
+ * action argument has an invalid value
+ */
+ WL_DATA_OFFER_ERROR_INVALID_ACTION = 2,
+ /**
+ * offer doesn't accept this request
+ */
+ WL_DATA_OFFER_ERROR_INVALID_OFFER = 3,
+};
+#endif /* WL_DATA_OFFER_ERROR_ENUM */
+
+/**
+ * @ingroup iface_wl_data_offer
+ * @struct wl_data_offer_listener
+ */
+struct wl_data_offer_listener {
+ /**
+ * advertise offered mime type
+ *
+ * Sent immediately after creating the wl_data_offer object. One
+ * event per offered mime type.
+ * @param mime_type offered mime type
+ */
+ void (*offer)(void *data,
+ struct wl_data_offer *wl_data_offer,
+ const char *mime_type);
+ /**
+ * notify the source-side available actions
+ *
+ * This event indicates the actions offered by the data source.
+ * It will be sent right after wl_data_device.enter, or anytime the
+ * source side changes its offered actions through
+ * wl_data_source.set_actions.
+ * @param source_actions actions offered by the data source
+ * @since 3
+ */
+ void (*source_actions)(void *data,
+ struct wl_data_offer *wl_data_offer,
+ uint32_t source_actions);
+ /**
+ * notify the selected action
+ *
+ * This event indicates the action selected by the compositor
+ * after matching the source/destination side actions. Only one
+ * action (or none) will be offered here.
+ *
+ * This event can be emitted multiple times during the
+ * drag-and-drop operation in response to destination side action
+ * changes through wl_data_offer.set_actions.
+ *
+ * This event will no longer be emitted after wl_data_device.drop
+ * happened on the drag-and-drop destination, the client must honor
+ * the last action received, or the last preferred one set through
+ * wl_data_offer.set_actions when handling an "ask" action.
+ *
+ * Compositors may also change the selected action on the fly,
+ * mainly in response to keyboard modifier changes during the
+ * drag-and-drop operation.
+ *
+ * The most recent action received is always the valid one. Prior
+ * to receiving wl_data_device.drop, the chosen action may change
+ * (e.g. due to keyboard modifiers being pressed). At the time of
+ * receiving wl_data_device.drop the drag-and-drop destination must
+ * honor the last action received.
+ *
+ * Action changes may still happen after wl_data_device.drop,
+ * especially on "ask" actions, where the drag-and-drop destination
+ * may choose another action afterwards. Action changes happening
+ * at this stage are always the result of inter-client negotiation,
+ * the compositor shall no longer be able to induce a different
+ * action.
+ *
+ * Upon "ask" actions, it is expected that the drag-and-drop
+ * destination may potentially choose a different action and/or
+ * mime type, based on wl_data_offer.source_actions and finally
+ * chosen by the user (e.g. popping up a menu with the available
+ * options). The final wl_data_offer.set_actions and
+ * wl_data_offer.accept requests must happen before the call to
+ * wl_data_offer.finish.
+ * @param dnd_action action selected by the compositor
+ * @since 3
+ */
+ void (*action)(void *data,
+ struct wl_data_offer *wl_data_offer,
+ uint32_t dnd_action);
+};
+
+/**
+ * @ingroup iface_wl_data_offer
+ */
+static inline int
+wl_data_offer_add_listener(struct wl_data_offer *wl_data_offer,
+ const struct wl_data_offer_listener *listener, void *data)
+{
+ return wl_proxy_add_listener((struct wl_proxy *) wl_data_offer,
+ (void (**)(void)) listener, data);
+}
+
+#define WL_DATA_OFFER_ACCEPT 0
+#define WL_DATA_OFFER_RECEIVE 1
+#define WL_DATA_OFFER_DESTROY 2
+#define WL_DATA_OFFER_FINISH 3
+#define WL_DATA_OFFER_SET_ACTIONS 4
+
+/**
+ * @ingroup iface_wl_data_offer
+ */
+#define WL_DATA_OFFER_OFFER_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_data_offer
+ */
+#define WL_DATA_OFFER_SOURCE_ACTIONS_SINCE_VERSION 3
+/**
+ * @ingroup iface_wl_data_offer
+ */
+#define WL_DATA_OFFER_ACTION_SINCE_VERSION 3
+
+/**
+ * @ingroup iface_wl_data_offer
+ */
+#define WL_DATA_OFFER_ACCEPT_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_data_offer
+ */
+#define WL_DATA_OFFER_RECEIVE_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_data_offer
+ */
+#define WL_DATA_OFFER_DESTROY_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_data_offer
+ */
+#define WL_DATA_OFFER_FINISH_SINCE_VERSION 3
+/**
+ * @ingroup iface_wl_data_offer
+ */
+#define WL_DATA_OFFER_SET_ACTIONS_SINCE_VERSION 3
+
+/** @ingroup iface_wl_data_offer */
+static inline void
+wl_data_offer_set_user_data(struct wl_data_offer *wl_data_offer, void *user_data)
+{
+ wl_proxy_set_user_data((struct wl_proxy *) wl_data_offer, user_data);
+}
+
+/** @ingroup iface_wl_data_offer */
+static inline void *
+wl_data_offer_get_user_data(struct wl_data_offer *wl_data_offer)
+{
+ return wl_proxy_get_user_data((struct wl_proxy *) wl_data_offer);
+}
+
+static inline uint32_t
+wl_data_offer_get_version(struct wl_data_offer *wl_data_offer)
+{
+ return wl_proxy_get_version((struct wl_proxy *) wl_data_offer);
+}
+
+/**
+ * @ingroup iface_wl_data_offer
+ *
+ * Indicate that the client can accept the given mime type, or
+ * NULL for not accepted.
+ *
+ * For objects of version 2 or older, this request is used by the
+ * client to give feedback whether the client can receive the given
+ * mime type, or NULL if none is accepted; the feedback does not
+ * determine whether the drag-and-drop operation succeeds or not.
+ *
+ * For objects of version 3 or newer, this request determines the
+ * final result of the drag-and-drop operation. If the end result
+ * is that no mime types were accepted, the drag-and-drop operation
+ * will be cancelled and the corresponding drag source will receive
+ * wl_data_source.cancelled. Clients may still use this event in
+ * conjunction with wl_data_source.action for feedback.
+ */
+static inline void
+wl_data_offer_accept(struct wl_data_offer *wl_data_offer, uint32_t serial, const char *mime_type)
+{
+ wl_proxy_marshal((struct wl_proxy *) wl_data_offer,
+ WL_DATA_OFFER_ACCEPT, serial, mime_type);
+}
+
+/**
+ * @ingroup iface_wl_data_offer
+ *
+ * To transfer the offered data, the client issues this request
+ * and indicates the mime type it wants to receive. The transfer
+ * happens through the passed file descriptor (typically created
+ * with the pipe system call). The source client writes the data
+ * in the mime type representation requested and then closes the
+ * file descriptor.
+ *
+ * The receiving client reads from the read end of the pipe until
+ * EOF and then closes its end, at which point the transfer is
+ * complete.
+ *
+ * This request may happen multiple times for different mime types,
+ * both before and after wl_data_device.drop. Drag-and-drop destination
+ * clients may preemptively fetch data or examine it more closely to
+ * determine acceptance.
+ */
+static inline void
+wl_data_offer_receive(struct wl_data_offer *wl_data_offer, const char *mime_type, int32_t fd)
+{
+ wl_proxy_marshal((struct wl_proxy *) wl_data_offer,
+ WL_DATA_OFFER_RECEIVE, mime_type, fd);
+}
+
+/**
+ * @ingroup iface_wl_data_offer
+ *
+ * Destroy the data offer.
+ */
+static inline void
+wl_data_offer_destroy(struct wl_data_offer *wl_data_offer)
+{
+ wl_proxy_marshal((struct wl_proxy *) wl_data_offer,
+ WL_DATA_OFFER_DESTROY);
+
+ wl_proxy_destroy((struct wl_proxy *) wl_data_offer);
+}
+
+/**
+ * @ingroup iface_wl_data_offer
+ *
+ * Notifies the compositor that the drag destination successfully
+ * finished the drag-and-drop operation.
+ *
+ * Upon receiving this request, the compositor will emit
+ * wl_data_source.dnd_finished on the drag source client.
+ *
+ * It is a client error to perform other requests than
+ * wl_data_offer.destroy after this one. It is also an error to perform
+ * this request after a NULL mime type has been set in
+ * wl_data_offer.accept or no action was received through
+ * wl_data_offer.action.
+ */
+static inline void
+wl_data_offer_finish(struct wl_data_offer *wl_data_offer)
+{
+ wl_proxy_marshal((struct wl_proxy *) wl_data_offer,
+ WL_DATA_OFFER_FINISH);
+}
+
+/**
+ * @ingroup iface_wl_data_offer
+ *
+ * Sets the actions that the destination side client supports for
+ * this operation. This request may trigger the emission of
+ * wl_data_source.action and wl_data_offer.action events if the compositor
+ * needs to change the selected action.
+ *
+ * This request can be called multiple times throughout the
+ * drag-and-drop operation, typically in response to wl_data_device.enter
+ * or wl_data_device.motion events.
+ *
+ * This request determines the final result of the drag-and-drop
+ * operation. If the end result is that no action is accepted,
+ * the drag source will receive wl_drag_source.cancelled.
+ *
+ * The dnd_actions argument must contain only values expressed in the
+ * wl_data_device_manager.dnd_actions enum, and the preferred_action
+ * argument must only contain one of those values set, otherwise it
+ * will result in a protocol error.
+ *
+ * While managing an "ask" action, the destination drag-and-drop client
+ * may perform further wl_data_offer.receive requests, and is expected
+ * to perform one last wl_data_offer.set_actions request with a preferred
+ * action other than "ask" (and optionally wl_data_offer.accept) before
+ * requesting wl_data_offer.finish, in order to convey the action selected
+ * by the user. If the preferred action is not in the
+ * wl_data_offer.source_actions mask, an error will be raised.
+ *
+ * If the "ask" action is dismissed (e.g. user cancellation), the client
+ * is expected to perform wl_data_offer.destroy right away.
+ *
+ * This request can only be made on drag-and-drop offers, a protocol error
+ * will be raised otherwise.
+ */
+static inline void
+wl_data_offer_set_actions(struct wl_data_offer *wl_data_offer, uint32_t dnd_actions, uint32_t preferred_action)
+{
+ wl_proxy_marshal((struct wl_proxy *) wl_data_offer,
+ WL_DATA_OFFER_SET_ACTIONS, dnd_actions, preferred_action);
+}
+
+#ifndef WL_DATA_SOURCE_ERROR_ENUM
+#define WL_DATA_SOURCE_ERROR_ENUM
+enum wl_data_source_error {
+ /**
+ * action mask contains invalid values
+ */
+ WL_DATA_SOURCE_ERROR_INVALID_ACTION_MASK = 0,
+ /**
+ * source doesn't accept this request
+ */
+ WL_DATA_SOURCE_ERROR_INVALID_SOURCE = 1,
+};
+#endif /* WL_DATA_SOURCE_ERROR_ENUM */
+
+/**
+ * @ingroup iface_wl_data_source
+ * @struct wl_data_source_listener
+ */
+struct wl_data_source_listener {
+ /**
+ * a target accepts an offered mime type
+ *
+ * Sent when a target accepts pointer_focus or motion events. If
+ * a target does not accept any of the offered types, type is NULL.
+ *
+ * Used for feedback during drag-and-drop.
+ * @param mime_type mime type accepted by the target
+ */
+ void (*target)(void *data,
+ struct wl_data_source *wl_data_source,
+ const char *mime_type);
+ /**
+ * send the data
+ *
+ * Request for data from the client. Send the data as the
+ * specified mime type over the passed file descriptor, then close
+ * it.
+ * @param mime_type mime type for the data
+ * @param fd file descriptor for the data
+ */
+ void (*send)(void *data,
+ struct wl_data_source *wl_data_source,
+ const char *mime_type,
+ int32_t fd);
+ /**
+ * selection was cancelled
+ *
+ * This data source is no longer valid. There are several reasons
+ * why this could happen:
+ *
+ * - The data source has been replaced by another data source. -
+ * The drag-and-drop operation was performed, but the drop
+ * destination did not accept any of the mime types offered through
+ * wl_data_source.target. - The drag-and-drop operation was
+ * performed, but the drop destination did not select any of the
+ * actions present in the mask offered through
+ * wl_data_source.action. - The drag-and-drop operation was
+ * performed but didn't happen over a surface. - The compositor
+ * cancelled the drag-and-drop operation (e.g. compositor dependent
+ * timeouts to avoid stale drag-and-drop transfers).
+ *
+ * The client should clean up and destroy this data source.
+ *
+ * For objects of version 2 or older, wl_data_source.cancelled will
+ * only be emitted if the data source was replaced by another data
+ * source.
+ */
+ void (*cancelled)(void *data,
+ struct wl_data_source *wl_data_source);
+ /**
+ * the drag-and-drop operation physically finished
+ *
+ * The user performed the drop action. This event does not
+ * indicate acceptance, wl_data_source.cancelled may still be
+ * emitted afterwards if the drop destination does not accept any
+ * mime type.
+ *
+ * However, this event might however not be received if the
+ * compositor cancelled the drag-and-drop operation before this
+ * event could happen.
+ *
+ * Note that the data_source may still be used in the future and
+ * should not be destroyed here.
+ * @since 3
+ */
+ void (*dnd_drop_performed)(void *data,
+ struct wl_data_source *wl_data_source);
+ /**
+ * the drag-and-drop operation concluded
+ *
+ * The drop destination finished interoperating with this data
+ * source, so the client is now free to destroy this data source
+ * and free all associated data.
+ *
+ * If the action used to perform the operation was "move", the
+ * source can now delete the transferred data.
+ * @since 3
+ */
+ void (*dnd_finished)(void *data,
+ struct wl_data_source *wl_data_source);
+ /**
+ * notify the selected action
+ *
+ * This event indicates the action selected by the compositor
+ * after matching the source/destination side actions. Only one
+ * action (or none) will be offered here.
+ *
+ * This event can be emitted multiple times during the
+ * drag-and-drop operation, mainly in response to destination side
+ * changes through wl_data_offer.set_actions, and as the data
+ * device enters/leaves surfaces.
+ *
+ * It is only possible to receive this event after
+ * wl_data_source.dnd_drop_performed if the drag-and-drop operation
+ * ended in an "ask" action, in which case the final
+ * wl_data_source.action event will happen immediately before
+ * wl_data_source.dnd_finished.
+ *
+ * Compositors may also change the selected action on the fly,
+ * mainly in response to keyboard modifier changes during the
+ * drag-and-drop operation.
+ *
+ * The most recent action received is always the valid one. The
+ * chosen action may change alongside negotiation (e.g. an "ask"
+ * action can turn into a "move" operation), so the effects of the
+ * final action must always be applied in
+ * wl_data_offer.dnd_finished.
+ *
+ * Clients can trigger cursor surface changes from this point, so
+ * they reflect the current action.
+ * @param dnd_action action selected by the compositor
+ * @since 3
+ */
+ void (*action)(void *data,
+ struct wl_data_source *wl_data_source,
+ uint32_t dnd_action);
+};
+
+/**
+ * @ingroup iface_wl_data_source
+ */
+static inline int
+wl_data_source_add_listener(struct wl_data_source *wl_data_source,
+ const struct wl_data_source_listener *listener, void *data)
+{
+ return wl_proxy_add_listener((struct wl_proxy *) wl_data_source,
+ (void (**)(void)) listener, data);
+}
+
+#define WL_DATA_SOURCE_OFFER 0
+#define WL_DATA_SOURCE_DESTROY 1
+#define WL_DATA_SOURCE_SET_ACTIONS 2
+
+/**
+ * @ingroup iface_wl_data_source
+ */
+#define WL_DATA_SOURCE_TARGET_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_data_source
+ */
+#define WL_DATA_SOURCE_SEND_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_data_source
+ */
+#define WL_DATA_SOURCE_CANCELLED_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_data_source
+ */
+#define WL_DATA_SOURCE_DND_DROP_PERFORMED_SINCE_VERSION 3
+/**
+ * @ingroup iface_wl_data_source
+ */
+#define WL_DATA_SOURCE_DND_FINISHED_SINCE_VERSION 3
+/**
+ * @ingroup iface_wl_data_source
+ */
+#define WL_DATA_SOURCE_ACTION_SINCE_VERSION 3
+
+/**
+ * @ingroup iface_wl_data_source
+ */
+#define WL_DATA_SOURCE_OFFER_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_data_source
+ */
+#define WL_DATA_SOURCE_DESTROY_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_data_source
+ */
+#define WL_DATA_SOURCE_SET_ACTIONS_SINCE_VERSION 3
+
+/** @ingroup iface_wl_data_source */
+static inline void
+wl_data_source_set_user_data(struct wl_data_source *wl_data_source, void *user_data)
+{
+ wl_proxy_set_user_data((struct wl_proxy *) wl_data_source, user_data);
+}
+
+/** @ingroup iface_wl_data_source */
+static inline void *
+wl_data_source_get_user_data(struct wl_data_source *wl_data_source)
+{
+ return wl_proxy_get_user_data((struct wl_proxy *) wl_data_source);
+}
+
+static inline uint32_t
+wl_data_source_get_version(struct wl_data_source *wl_data_source)
+{
+ return wl_proxy_get_version((struct wl_proxy *) wl_data_source);
+}
+
+/**
+ * @ingroup iface_wl_data_source
+ *
+ * This request adds a mime type to the set of mime types
+ * advertised to targets. Can be called several times to offer
+ * multiple types.
+ */
+static inline void
+wl_data_source_offer(struct wl_data_source *wl_data_source, const char *mime_type)
+{
+ wl_proxy_marshal((struct wl_proxy *) wl_data_source,
+ WL_DATA_SOURCE_OFFER, mime_type);
+}
+
+/**
+ * @ingroup iface_wl_data_source
+ *
+ * Destroy the data source.
+ */
+static inline void
+wl_data_source_destroy(struct wl_data_source *wl_data_source)
+{
+ wl_proxy_marshal((struct wl_proxy *) wl_data_source,
+ WL_DATA_SOURCE_DESTROY);
+
+ wl_proxy_destroy((struct wl_proxy *) wl_data_source);
+}
+
+/**
+ * @ingroup iface_wl_data_source
+ *
+ * Sets the actions that the source side client supports for this
+ * operation. This request may trigger wl_data_source.action and
+ * wl_data_offer.action events if the compositor needs to change the
+ * selected action.
+ *
+ * The dnd_actions argument must contain only values expressed in the
+ * wl_data_device_manager.dnd_actions enum, otherwise it will result
+ * in a protocol error.
+ *
+ * This request must be made once only, and can only be made on sources
+ * used in drag-and-drop, so it must be performed before
+ * wl_data_device.start_drag. Attempting to use the source other than
+ * for drag-and-drop will raise a protocol error.
+ */
+static inline void
+wl_data_source_set_actions(struct wl_data_source *wl_data_source, uint32_t dnd_actions)
+{
+ wl_proxy_marshal((struct wl_proxy *) wl_data_source,
+ WL_DATA_SOURCE_SET_ACTIONS, dnd_actions);
+}
+
+#ifndef WL_DATA_DEVICE_ERROR_ENUM
+#define WL_DATA_DEVICE_ERROR_ENUM
+enum wl_data_device_error {
+ /**
+ * given wl_surface has another role
+ */
+ WL_DATA_DEVICE_ERROR_ROLE = 0,
+};
+#endif /* WL_DATA_DEVICE_ERROR_ENUM */
+
+/**
+ * @ingroup iface_wl_data_device
+ * @struct wl_data_device_listener
+ */
+struct wl_data_device_listener {
+ /**
+ * introduce a new wl_data_offer
+ *
+ * The data_offer event introduces a new wl_data_offer object,
+ * which will subsequently be used in either the data_device.enter
+ * event (for drag-and-drop) or the data_device.selection event
+ * (for selections). Immediately following the
+ * data_device_data_offer event, the new data_offer object will
+ * send out data_offer.offer events to describe the mime types it
+ * offers.
+ * @param id the new data_offer object
+ */
+ void (*data_offer)(void *data,
+ struct wl_data_device *wl_data_device,
+ struct wl_data_offer *id);
+ /**
+ * initiate drag-and-drop session
+ *
+ * This event is sent when an active drag-and-drop pointer enters
+ * a surface owned by the client. The position of the pointer at
+ * enter time is provided by the x and y arguments, in
+ * surface-local coordinates.
+ * @param serial serial number of the enter event
+ * @param surface client surface entered
+ * @param x surface-local x coordinate
+ * @param y surface-local y coordinate
+ * @param id source data_offer object
+ */
+ void (*enter)(void *data,
+ struct wl_data_device *wl_data_device,
+ uint32_t serial,
+ struct wl_surface *surface,
+ wl_fixed_t x,
+ wl_fixed_t y,
+ struct wl_data_offer *id);
+ /**
+ * end drag-and-drop session
+ *
+ * This event is sent when the drag-and-drop pointer leaves the
+ * surface and the session ends. The client must destroy the
+ * wl_data_offer introduced at enter time at this point.
+ */
+ void (*leave)(void *data,
+ struct wl_data_device *wl_data_device);
+ /**
+ * drag-and-drop session motion
+ *
+ * This event is sent when the drag-and-drop pointer moves within
+ * the currently focused surface. The new position of the pointer
+ * is provided by the x and y arguments, in surface-local
+ * coordinates.
+ * @param time timestamp with millisecond granularity
+ * @param x surface-local x coordinate
+ * @param y surface-local y coordinate
+ */
+ void (*motion)(void *data,
+ struct wl_data_device *wl_data_device,
+ uint32_t time,
+ wl_fixed_t x,
+ wl_fixed_t y);
+ /**
+ * end drag-and-drop session successfully
+ *
+ * The event is sent when a drag-and-drop operation is ended
+ * because the implicit grab is removed.
+ *
+ * The drag-and-drop destination is expected to honor the last
+ * action received through wl_data_offer.action, if the resulting
+ * action is "copy" or "move", the destination can still perform
+ * wl_data_offer.receive requests, and is expected to end all
+ * transfers with a wl_data_offer.finish request.
+ *
+ * If the resulting action is "ask", the action will not be
+ * considered final. The drag-and-drop destination is expected to
+ * perform one last wl_data_offer.set_actions request, or
+ * wl_data_offer.destroy in order to cancel the operation.
+ */
+ void (*drop)(void *data,
+ struct wl_data_device *wl_data_device);
+ /**
+ * advertise new selection
+ *
+ * The selection event is sent out to notify the client of a new
+ * wl_data_offer for the selection for this device. The
+ * data_device.data_offer and the data_offer.offer events are sent
+ * out immediately before this event to introduce the data offer
+ * object. The selection event is sent to a client immediately
+ * before receiving keyboard focus and when a new selection is set
+ * while the client has keyboard focus. The data_offer is valid
+ * until a new data_offer or NULL is received or until the client
+ * loses keyboard focus. The client must destroy the previous
+ * selection data_offer, if any, upon receiving this event.
+ * @param id selection data_offer object
+ */
+ void (*selection)(void *data,
+ struct wl_data_device *wl_data_device,
+ struct wl_data_offer *id);
+};
+
+/**
+ * @ingroup iface_wl_data_device
+ */
+static inline int
+wl_data_device_add_listener(struct wl_data_device *wl_data_device,
+ const struct wl_data_device_listener *listener, void *data)
+{
+ return wl_proxy_add_listener((struct wl_proxy *) wl_data_device,
+ (void (**)(void)) listener, data);
+}
+
+#define WL_DATA_DEVICE_START_DRAG 0
+#define WL_DATA_DEVICE_SET_SELECTION 1
+#define WL_DATA_DEVICE_RELEASE 2
+
+/**
+ * @ingroup iface_wl_data_device
+ */
+#define WL_DATA_DEVICE_DATA_OFFER_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_data_device
+ */
+#define WL_DATA_DEVICE_ENTER_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_data_device
+ */
+#define WL_DATA_DEVICE_LEAVE_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_data_device
+ */
+#define WL_DATA_DEVICE_MOTION_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_data_device
+ */
+#define WL_DATA_DEVICE_DROP_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_data_device
+ */
+#define WL_DATA_DEVICE_SELECTION_SINCE_VERSION 1
+
+/**
+ * @ingroup iface_wl_data_device
+ */
+#define WL_DATA_DEVICE_START_DRAG_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_data_device
+ */
+#define WL_DATA_DEVICE_SET_SELECTION_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_data_device
+ */
+#define WL_DATA_DEVICE_RELEASE_SINCE_VERSION 2
+
+/** @ingroup iface_wl_data_device */
+static inline void
+wl_data_device_set_user_data(struct wl_data_device *wl_data_device, void *user_data)
+{
+ wl_proxy_set_user_data((struct wl_proxy *) wl_data_device, user_data);
+}
+
+/** @ingroup iface_wl_data_device */
+static inline void *
+wl_data_device_get_user_data(struct wl_data_device *wl_data_device)
+{
+ return wl_proxy_get_user_data((struct wl_proxy *) wl_data_device);
+}
+
+static inline uint32_t
+wl_data_device_get_version(struct wl_data_device *wl_data_device)
+{
+ return wl_proxy_get_version((struct wl_proxy *) wl_data_device);
+}
+
+/** @ingroup iface_wl_data_device */
+static inline void
+wl_data_device_destroy(struct wl_data_device *wl_data_device)
+{
+ wl_proxy_destroy((struct wl_proxy *) wl_data_device);
+}
+
+/**
+ * @ingroup iface_wl_data_device
+ *
+ * This request asks the compositor to start a drag-and-drop
+ * operation on behalf of the client.
+ *
+ * The source argument is the data source that provides the data
+ * for the eventual data transfer. If source is NULL, enter, leave
+ * and motion events are sent only to the client that initiated the
+ * drag and the client is expected to handle the data passing
+ * internally.
+ *
+ * The origin surface is the surface where the drag originates and
+ * the client must have an active implicit grab that matches the
+ * serial.
+ *
+ * The icon surface is an optional (can be NULL) surface that
+ * provides an icon to be moved around with the cursor. Initially,
+ * the top-left corner of the icon surface is placed at the cursor
+ * hotspot, but subsequent wl_surface.attach request can move the
+ * relative position. Attach requests must be confirmed with
+ * wl_surface.commit as usual. The icon surface is given the role of
+ * a drag-and-drop icon. If the icon surface already has another role,
+ * it raises a protocol error.
+ *
+ * The current and pending input regions of the icon wl_surface are
+ * cleared, and wl_surface.set_input_region is ignored until the
+ * wl_surface is no longer used as the icon surface. When the use
+ * as an icon ends, the current and pending input regions become
+ * undefined, and the wl_surface is unmapped.
+ */
+static inline void
+wl_data_device_start_drag(struct wl_data_device *wl_data_device, struct wl_data_source *source, struct wl_surface *origin, struct wl_surface *icon, uint32_t serial)
+{
+ wl_proxy_marshal((struct wl_proxy *) wl_data_device,
+ WL_DATA_DEVICE_START_DRAG, source, origin, icon, serial);
+}
+
+/**
+ * @ingroup iface_wl_data_device
+ *
+ * This request asks the compositor to set the selection
+ * to the data from the source on behalf of the client.
+ *
+ * To unset the selection, set the source to NULL.
+ */
+static inline void
+wl_data_device_set_selection(struct wl_data_device *wl_data_device, struct wl_data_source *source, uint32_t serial)
+{
+ wl_proxy_marshal((struct wl_proxy *) wl_data_device,
+ WL_DATA_DEVICE_SET_SELECTION, source, serial);
+}
+
+/**
+ * @ingroup iface_wl_data_device
+ *
+ * This request destroys the data device.
+ */
+static inline void
+wl_data_device_release(struct wl_data_device *wl_data_device)
+{
+ wl_proxy_marshal((struct wl_proxy *) wl_data_device,
+ WL_DATA_DEVICE_RELEASE);
+
+ wl_proxy_destroy((struct wl_proxy *) wl_data_device);
+}
+
+#ifndef WL_DATA_DEVICE_MANAGER_DND_ACTION_ENUM
+#define WL_DATA_DEVICE_MANAGER_DND_ACTION_ENUM
+/**
+ * @ingroup iface_wl_data_device_manager
+ * drag and drop actions
+ *
+ * This is a bitmask of the available/preferred actions in a
+ * drag-and-drop operation.
+ *
+ * In the compositor, the selected action is a result of matching the
+ * actions offered by the source and destination sides. "action" events
+ * with a "none" action will be sent to both source and destination if
+ * there is no match. All further checks will effectively happen on
+ * (source actions ∩ destination actions).
+ *
+ * In addition, compositors may also pick different actions in
+ * reaction to key modifiers being pressed. One common design that
+ * is used in major toolkits (and the behavior recommended for
+ * compositors) is:
+ *
+ * - If no modifiers are pressed, the first match (in bit order)
+ * will be used.
+ * - Pressing Shift selects "move", if enabled in the mask.
+ * - Pressing Control selects "copy", if enabled in the mask.
+ *
+ * Behavior beyond that is considered implementation-dependent.
+ * Compositors may for example bind other modifiers (like Alt/Meta)
+ * or drags initiated with other buttons than BTN_LEFT to specific
+ * actions (e.g. "ask").
+ */
+enum wl_data_device_manager_dnd_action {
+ /**
+ * no action
+ */
+ WL_DATA_DEVICE_MANAGER_DND_ACTION_NONE = 0,
+ /**
+ * copy action
+ */
+ WL_DATA_DEVICE_MANAGER_DND_ACTION_COPY = 1,
+ /**
+ * move action
+ */
+ WL_DATA_DEVICE_MANAGER_DND_ACTION_MOVE = 2,
+ /**
+ * ask action
+ */
+ WL_DATA_DEVICE_MANAGER_DND_ACTION_ASK = 4,
+};
+#endif /* WL_DATA_DEVICE_MANAGER_DND_ACTION_ENUM */
+
+#define WL_DATA_DEVICE_MANAGER_CREATE_DATA_SOURCE 0
+#define WL_DATA_DEVICE_MANAGER_GET_DATA_DEVICE 1
+
+
+/**
+ * @ingroup iface_wl_data_device_manager
+ */
+#define WL_DATA_DEVICE_MANAGER_CREATE_DATA_SOURCE_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_data_device_manager
+ */
+#define WL_DATA_DEVICE_MANAGER_GET_DATA_DEVICE_SINCE_VERSION 1
+
+/** @ingroup iface_wl_data_device_manager */
+static inline void
+wl_data_device_manager_set_user_data(struct wl_data_device_manager *wl_data_device_manager, void *user_data)
+{
+ wl_proxy_set_user_data((struct wl_proxy *) wl_data_device_manager, user_data);
+}
+
+/** @ingroup iface_wl_data_device_manager */
+static inline void *
+wl_data_device_manager_get_user_data(struct wl_data_device_manager *wl_data_device_manager)
+{
+ return wl_proxy_get_user_data((struct wl_proxy *) wl_data_device_manager);
+}
+
+static inline uint32_t
+wl_data_device_manager_get_version(struct wl_data_device_manager *wl_data_device_manager)
+{
+ return wl_proxy_get_version((struct wl_proxy *) wl_data_device_manager);
+}
+
+/** @ingroup iface_wl_data_device_manager */
+static inline void
+wl_data_device_manager_destroy(struct wl_data_device_manager *wl_data_device_manager)
+{
+ wl_proxy_destroy((struct wl_proxy *) wl_data_device_manager);
+}
+
+/**
+ * @ingroup iface_wl_data_device_manager
+ *
+ * Create a new data source.
+ */
+static inline struct wl_data_source *
+wl_data_device_manager_create_data_source(struct wl_data_device_manager *wl_data_device_manager)
+{
+ struct wl_proxy *id;
+
+ id = wl_proxy_marshal_constructor((struct wl_proxy *) wl_data_device_manager,
+ WL_DATA_DEVICE_MANAGER_CREATE_DATA_SOURCE, &wl_data_source_interface, NULL);
+
+ return (struct wl_data_source *) id;
+}
+
+/**
+ * @ingroup iface_wl_data_device_manager
+ *
+ * Create a new data device for a given seat.
+ */
+static inline struct wl_data_device *
+wl_data_device_manager_get_data_device(struct wl_data_device_manager *wl_data_device_manager, struct wl_seat *seat)
+{
+ struct wl_proxy *id;
+
+ id = wl_proxy_marshal_constructor((struct wl_proxy *) wl_data_device_manager,
+ WL_DATA_DEVICE_MANAGER_GET_DATA_DEVICE, &wl_data_device_interface, NULL, seat);
+
+ return (struct wl_data_device *) id;
+}
+
+#ifndef WL_SHELL_ERROR_ENUM
+#define WL_SHELL_ERROR_ENUM
+enum wl_shell_error {
+ /**
+ * given wl_surface has another role
+ */
+ WL_SHELL_ERROR_ROLE = 0,
+};
+#endif /* WL_SHELL_ERROR_ENUM */
+
+#define WL_SHELL_GET_SHELL_SURFACE 0
+
+
+/**
+ * @ingroup iface_wl_shell
+ */
+#define WL_SHELL_GET_SHELL_SURFACE_SINCE_VERSION 1
+
+/** @ingroup iface_wl_shell */
+static inline void
+wl_shell_set_user_data(struct wl_shell *wl_shell, void *user_data)
+{
+ wl_proxy_set_user_data((struct wl_proxy *) wl_shell, user_data);
+}
+
+/** @ingroup iface_wl_shell */
+static inline void *
+wl_shell_get_user_data(struct wl_shell *wl_shell)
+{
+ return wl_proxy_get_user_data((struct wl_proxy *) wl_shell);
+}
+
+static inline uint32_t
+wl_shell_get_version(struct wl_shell *wl_shell)
+{
+ return wl_proxy_get_version((struct wl_proxy *) wl_shell);
+}
+
+/** @ingroup iface_wl_shell */
+static inline void
+wl_shell_destroy(struct wl_shell *wl_shell)
+{
+ wl_proxy_destroy((struct wl_proxy *) wl_shell);
+}
+
+/**
+ * @ingroup iface_wl_shell
+ *
+ * Create a shell surface for an existing surface. This gives
+ * the wl_surface the role of a shell surface. If the wl_surface
+ * already has another role, it raises a protocol error.
+ *
+ * Only one shell surface can be associated with a given surface.
+ */
+static inline struct wl_shell_surface *
+wl_shell_get_shell_surface(struct wl_shell *wl_shell, struct wl_surface *surface)
+{
+ struct wl_proxy *id;
+
+ id = wl_proxy_marshal_constructor((struct wl_proxy *) wl_shell,
+ WL_SHELL_GET_SHELL_SURFACE, &wl_shell_surface_interface, NULL, surface);
+
+ return (struct wl_shell_surface *) id;
+}
+
+#ifndef WL_SHELL_SURFACE_RESIZE_ENUM
+#define WL_SHELL_SURFACE_RESIZE_ENUM
+/**
+ * @ingroup iface_wl_shell_surface
+ * edge values for resizing
+ *
+ * These values are used to indicate which edge of a surface
+ * is being dragged in a resize operation. The server may
+ * use this information to adapt its behavior, e.g. choose
+ * an appropriate cursor image.
+ */
+enum wl_shell_surface_resize {
+ /**
+ * no edge
+ */
+ WL_SHELL_SURFACE_RESIZE_NONE = 0,
+ /**
+ * top edge
+ */
+ WL_SHELL_SURFACE_RESIZE_TOP = 1,
+ /**
+ * bottom edge
+ */
+ WL_SHELL_SURFACE_RESIZE_BOTTOM = 2,
+ /**
+ * left edge
+ */
+ WL_SHELL_SURFACE_RESIZE_LEFT = 4,
+ /**
+ * top and left edges
+ */
+ WL_SHELL_SURFACE_RESIZE_TOP_LEFT = 5,
+ /**
+ * bottom and left edges
+ */
+ WL_SHELL_SURFACE_RESIZE_BOTTOM_LEFT = 6,
+ /**
+ * right edge
+ */
+ WL_SHELL_SURFACE_RESIZE_RIGHT = 8,
+ /**
+ * top and right edges
+ */
+ WL_SHELL_SURFACE_RESIZE_TOP_RIGHT = 9,
+ /**
+ * bottom and right edges
+ */
+ WL_SHELL_SURFACE_RESIZE_BOTTOM_RIGHT = 10,
+};
+#endif /* WL_SHELL_SURFACE_RESIZE_ENUM */
+
+#ifndef WL_SHELL_SURFACE_TRANSIENT_ENUM
+#define WL_SHELL_SURFACE_TRANSIENT_ENUM
+/**
+ * @ingroup iface_wl_shell_surface
+ * details of transient behaviour
+ *
+ * These flags specify details of the expected behaviour
+ * of transient surfaces. Used in the set_transient request.
+ */
+enum wl_shell_surface_transient {
+ /**
+ * do not set keyboard focus
+ */
+ WL_SHELL_SURFACE_TRANSIENT_INACTIVE = 0x1,
+};
+#endif /* WL_SHELL_SURFACE_TRANSIENT_ENUM */
+
+#ifndef WL_SHELL_SURFACE_FULLSCREEN_METHOD_ENUM
+#define WL_SHELL_SURFACE_FULLSCREEN_METHOD_ENUM
+/**
+ * @ingroup iface_wl_shell_surface
+ * different method to set the surface fullscreen
+ *
+ * Hints to indicate to the compositor how to deal with a conflict
+ * between the dimensions of the surface and the dimensions of the
+ * output. The compositor is free to ignore this parameter.
+ */
+enum wl_shell_surface_fullscreen_method {
+ /**
+ * no preference, apply default policy
+ */
+ WL_SHELL_SURFACE_FULLSCREEN_METHOD_DEFAULT = 0,
+ /**
+ * scale, preserve the surface's aspect ratio and center on output
+ */
+ WL_SHELL_SURFACE_FULLSCREEN_METHOD_SCALE = 1,
+ /**
+ * switch output mode to the smallest mode that can fit the surface, add black borders to compensate size mismatch
+ */
+ WL_SHELL_SURFACE_FULLSCREEN_METHOD_DRIVER = 2,
+ /**
+ * no upscaling, center on output and add black borders to compensate size mismatch
+ */
+ WL_SHELL_SURFACE_FULLSCREEN_METHOD_FILL = 3,
+};
+#endif /* WL_SHELL_SURFACE_FULLSCREEN_METHOD_ENUM */
+
+/**
+ * @ingroup iface_wl_shell_surface
+ * @struct wl_shell_surface_listener
+ */
+struct wl_shell_surface_listener {
+ /**
+ * ping client
+ *
+ * Ping a client to check if it is receiving events and sending
+ * requests. A client is expected to reply with a pong request.
+ * @param serial serial number of the ping
+ */
+ void (*ping)(void *data,
+ struct wl_shell_surface *wl_shell_surface,
+ uint32_t serial);
+ /**
+ * suggest resize
+ *
+ * The configure event asks the client to resize its surface.
+ *
+ * The size is a hint, in the sense that the client is free to
+ * ignore it if it doesn't resize, pick a smaller size (to satisfy
+ * aspect ratio or resize in steps of NxM pixels).
+ *
+ * The edges parameter provides a hint about how the surface was
+ * resized. The client may use this information to decide how to
+ * adjust its content to the new size (e.g. a scrolling area might
+ * adjust its content position to leave the viewable content
+ * unmoved).
+ *
+ * The client is free to dismiss all but the last configure event
+ * it received.
+ *
+ * The width and height arguments specify the size of the window in
+ * surface-local coordinates.
+ * @param edges how the surface was resized
+ * @param width new width of the surface
+ * @param height new height of the surface
+ */
+ void (*configure)(void *data,
+ struct wl_shell_surface *wl_shell_surface,
+ uint32_t edges,
+ int32_t width,
+ int32_t height);
+ /**
+ * popup interaction is done
+ *
+ * The popup_done event is sent out when a popup grab is broken,
+ * that is, when the user clicks a surface that doesn't belong to
+ * the client owning the popup surface.
+ */
+ void (*popup_done)(void *data,
+ struct wl_shell_surface *wl_shell_surface);
+};
+
+/**
+ * @ingroup iface_wl_shell_surface
+ */
+static inline int
+wl_shell_surface_add_listener(struct wl_shell_surface *wl_shell_surface,
+ const struct wl_shell_surface_listener *listener, void *data)
+{
+ return wl_proxy_add_listener((struct wl_proxy *) wl_shell_surface,
+ (void (**)(void)) listener, data);
+}
+
+#define WL_SHELL_SURFACE_PONG 0
+#define WL_SHELL_SURFACE_MOVE 1
+#define WL_SHELL_SURFACE_RESIZE 2
+#define WL_SHELL_SURFACE_SET_TOPLEVEL 3
+#define WL_SHELL_SURFACE_SET_TRANSIENT 4
+#define WL_SHELL_SURFACE_SET_FULLSCREEN 5
+#define WL_SHELL_SURFACE_SET_POPUP 6
+#define WL_SHELL_SURFACE_SET_MAXIMIZED 7
+#define WL_SHELL_SURFACE_SET_TITLE 8
+#define WL_SHELL_SURFACE_SET_CLASS 9
+
+/**
+ * @ingroup iface_wl_shell_surface
+ */
+#define WL_SHELL_SURFACE_PING_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_shell_surface
+ */
+#define WL_SHELL_SURFACE_CONFIGURE_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_shell_surface
+ */
+#define WL_SHELL_SURFACE_POPUP_DONE_SINCE_VERSION 1
+
+/**
+ * @ingroup iface_wl_shell_surface
+ */
+#define WL_SHELL_SURFACE_PONG_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_shell_surface
+ */
+#define WL_SHELL_SURFACE_MOVE_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_shell_surface
+ */
+#define WL_SHELL_SURFACE_RESIZE_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_shell_surface
+ */
+#define WL_SHELL_SURFACE_SET_TOPLEVEL_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_shell_surface
+ */
+#define WL_SHELL_SURFACE_SET_TRANSIENT_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_shell_surface
+ */
+#define WL_SHELL_SURFACE_SET_FULLSCREEN_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_shell_surface
+ */
+#define WL_SHELL_SURFACE_SET_POPUP_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_shell_surface
+ */
+#define WL_SHELL_SURFACE_SET_MAXIMIZED_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_shell_surface
+ */
+#define WL_SHELL_SURFACE_SET_TITLE_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_shell_surface
+ */
+#define WL_SHELL_SURFACE_SET_CLASS_SINCE_VERSION 1
+
+/** @ingroup iface_wl_shell_surface */
+static inline void
+wl_shell_surface_set_user_data(struct wl_shell_surface *wl_shell_surface, void *user_data)
+{
+ wl_proxy_set_user_data((struct wl_proxy *) wl_shell_surface, user_data);
+}
+
+/** @ingroup iface_wl_shell_surface */
+static inline void *
+wl_shell_surface_get_user_data(struct wl_shell_surface *wl_shell_surface)
+{
+ return wl_proxy_get_user_data((struct wl_proxy *) wl_shell_surface);
+}
+
+static inline uint32_t
+wl_shell_surface_get_version(struct wl_shell_surface *wl_shell_surface)
+{
+ return wl_proxy_get_version((struct wl_proxy *) wl_shell_surface);
+}
+
+/** @ingroup iface_wl_shell_surface */
+static inline void
+wl_shell_surface_destroy(struct wl_shell_surface *wl_shell_surface)
+{
+ wl_proxy_destroy((struct wl_proxy *) wl_shell_surface);
+}
+
+/**
+ * @ingroup iface_wl_shell_surface
+ *
+ * A client must respond to a ping event with a pong request or
+ * the client may be deemed unresponsive.
+ */
+static inline void
+wl_shell_surface_pong(struct wl_shell_surface *wl_shell_surface, uint32_t serial)
+{
+ wl_proxy_marshal((struct wl_proxy *) wl_shell_surface,
+ WL_SHELL_SURFACE_PONG, serial);
+}
+
+/**
+ * @ingroup iface_wl_shell_surface
+ *
+ * Start a pointer-driven move of the surface.
+ *
+ * This request must be used in response to a button press event.
+ * The server may ignore move requests depending on the state of
+ * the surface (e.g. fullscreen or maximized).
+ */
+static inline void
+wl_shell_surface_move(struct wl_shell_surface *wl_shell_surface, struct wl_seat *seat, uint32_t serial)
+{
+ wl_proxy_marshal((struct wl_proxy *) wl_shell_surface,
+ WL_SHELL_SURFACE_MOVE, seat, serial);
+}
+
+/**
+ * @ingroup iface_wl_shell_surface
+ *
+ * Start a pointer-driven resizing of the surface.
+ *
+ * This request must be used in response to a button press event.
+ * The server may ignore resize requests depending on the state of
+ * the surface (e.g. fullscreen or maximized).
+ */
+static inline void
+wl_shell_surface_resize(struct wl_shell_surface *wl_shell_surface, struct wl_seat *seat, uint32_t serial, uint32_t edges)
+{
+ wl_proxy_marshal((struct wl_proxy *) wl_shell_surface,
+ WL_SHELL_SURFACE_RESIZE, seat, serial, edges);
+}
+
+/**
+ * @ingroup iface_wl_shell_surface
+ *
+ * Map the surface as a toplevel surface.
+ *
+ * A toplevel surface is not fullscreen, maximized or transient.
+ */
+static inline void
+wl_shell_surface_set_toplevel(struct wl_shell_surface *wl_shell_surface)
+{
+ wl_proxy_marshal((struct wl_proxy *) wl_shell_surface,
+ WL_SHELL_SURFACE_SET_TOPLEVEL);
+}
+
+/**
+ * @ingroup iface_wl_shell_surface
+ *
+ * Map the surface relative to an existing surface.
+ *
+ * The x and y arguments specify the location of the upper left
+ * corner of the surface relative to the upper left corner of the
+ * parent surface, in surface-local coordinates.
+ *
+ * The flags argument controls details of the transient behaviour.
+ */
+static inline void
+wl_shell_surface_set_transient(struct wl_shell_surface *wl_shell_surface, struct wl_surface *parent, int32_t x, int32_t y, uint32_t flags)
+{
+ wl_proxy_marshal((struct wl_proxy *) wl_shell_surface,
+ WL_SHELL_SURFACE_SET_TRANSIENT, parent, x, y, flags);
+}
+
+/**
+ * @ingroup iface_wl_shell_surface
+ *
+ * Map the surface as a fullscreen surface.
+ *
+ * If an output parameter is given then the surface will be made
+ * fullscreen on that output. If the client does not specify the
+ * output then the compositor will apply its policy - usually
+ * choosing the output on which the surface has the biggest surface
+ * area.
+ *
+ * The client may specify a method to resolve a size conflict
+ * between the output size and the surface size - this is provided
+ * through the method parameter.
+ *
+ * The framerate parameter is used only when the method is set
+ * to "driver", to indicate the preferred framerate. A value of 0
+ * indicates that the client does not care about framerate. The
+ * framerate is specified in mHz, that is framerate of 60000 is 60Hz.
+ *
+ * A method of "scale" or "driver" implies a scaling operation of
+ * the surface, either via a direct scaling operation or a change of
+ * the output mode. This will override any kind of output scaling, so
+ * that mapping a surface with a buffer size equal to the mode can
+ * fill the screen independent of buffer_scale.
+ *
+ * A method of "fill" means we don't scale up the buffer, however
+ * any output scale is applied. This means that you may run into
+ * an edge case where the application maps a buffer with the same
+ * size of the output mode but buffer_scale 1 (thus making a
+ * surface larger than the output). In this case it is allowed to
+ * downscale the results to fit the screen.
+ *
+ * The compositor must reply to this request with a configure event
+ * with the dimensions for the output on which the surface will
+ * be made fullscreen.
+ */
+static inline void
+wl_shell_surface_set_fullscreen(struct wl_shell_surface *wl_shell_surface, uint32_t method, uint32_t framerate, struct wl_output *output)
+{
+ wl_proxy_marshal((struct wl_proxy *) wl_shell_surface,
+ WL_SHELL_SURFACE_SET_FULLSCREEN, method, framerate, output);
+}
+
+/**
+ * @ingroup iface_wl_shell_surface
+ *
+ * Map the surface as a popup.
+ *
+ * A popup surface is a transient surface with an added pointer
+ * grab.
+ *
+ * An existing implicit grab will be changed to owner-events mode,
+ * and the popup grab will continue after the implicit grab ends
+ * (i.e. releasing the mouse button does not cause the popup to
+ * be unmapped).
+ *
+ * The popup grab continues until the window is destroyed or a
+ * mouse button is pressed in any other client's window. A click
+ * in any of the client's surfaces is reported as normal, however,
+ * clicks in other clients' surfaces will be discarded and trigger
+ * the callback.
+ *
+ * The x and y arguments specify the location of the upper left
+ * corner of the surface relative to the upper left corner of the
+ * parent surface, in surface-local coordinates.
+ */
+static inline void
+wl_shell_surface_set_popup(struct wl_shell_surface *wl_shell_surface, struct wl_seat *seat, uint32_t serial, struct wl_surface *parent, int32_t x, int32_t y, uint32_t flags)
+{
+ wl_proxy_marshal((struct wl_proxy *) wl_shell_surface,
+ WL_SHELL_SURFACE_SET_POPUP, seat, serial, parent, x, y, flags);
+}
+
+/**
+ * @ingroup iface_wl_shell_surface
+ *
+ * Map the surface as a maximized surface.
+ *
+ * If an output parameter is given then the surface will be
+ * maximized on that output. If the client does not specify the
+ * output then the compositor will apply its policy - usually
+ * choosing the output on which the surface has the biggest surface
+ * area.
+ *
+ * The compositor will reply with a configure event telling
+ * the expected new surface size. The operation is completed
+ * on the next buffer attach to this surface.
+ *
+ * A maximized surface typically fills the entire output it is
+ * bound to, except for desktop elements such as panels. This is
+ * the main difference between a maximized shell surface and a
+ * fullscreen shell surface.
+ *
+ * The details depend on the compositor implementation.
+ */
+static inline void
+wl_shell_surface_set_maximized(struct wl_shell_surface *wl_shell_surface, struct wl_output *output)
+{
+ wl_proxy_marshal((struct wl_proxy *) wl_shell_surface,
+ WL_SHELL_SURFACE_SET_MAXIMIZED, output);
+}
+
+/**
+ * @ingroup iface_wl_shell_surface
+ *
+ * Set a short title for the surface.
+ *
+ * This string may be used to identify the surface in a task bar,
+ * window list, or other user interface elements provided by the
+ * compositor.
+ *
+ * The string must be encoded in UTF-8.
+ */
+static inline void
+wl_shell_surface_set_title(struct wl_shell_surface *wl_shell_surface, const char *title)
+{
+ wl_proxy_marshal((struct wl_proxy *) wl_shell_surface,
+ WL_SHELL_SURFACE_SET_TITLE, title);
+}
+
+/**
+ * @ingroup iface_wl_shell_surface
+ *
+ * Set a class for the surface.
+ *
+ * The surface class identifies the general class of applications
+ * to which the surface belongs. A common convention is to use the
+ * file name (or the full path if it is a non-standard location) of
+ * the application's .desktop file as the class.
+ */
+static inline void
+wl_shell_surface_set_class(struct wl_shell_surface *wl_shell_surface, const char *class_)
+{
+ wl_proxy_marshal((struct wl_proxy *) wl_shell_surface,
+ WL_SHELL_SURFACE_SET_CLASS, class_);
+}
+
+#ifndef WL_SURFACE_ERROR_ENUM
+#define WL_SURFACE_ERROR_ENUM
+/**
+ * @ingroup iface_wl_surface
+ * wl_surface error values
+ *
+ * These errors can be emitted in response to wl_surface requests.
+ */
+enum wl_surface_error {
+ /**
+ * buffer scale value is invalid
+ */
+ WL_SURFACE_ERROR_INVALID_SCALE = 0,
+ /**
+ * buffer transform value is invalid
+ */
+ WL_SURFACE_ERROR_INVALID_TRANSFORM = 1,
+};
+#endif /* WL_SURFACE_ERROR_ENUM */
+
+/**
+ * @ingroup iface_wl_surface
+ * @struct wl_surface_listener
+ */
+struct wl_surface_listener {
+ /**
+ * surface enters an output
+ *
+ * This is emitted whenever a surface's creation, movement, or
+ * resizing results in some part of it being within the scanout
+ * region of an output.
+ *
+ * Note that a surface may be overlapping with zero or more
+ * outputs.
+ * @param output output entered by the surface
+ */
+ void (*enter)(void *data,
+ struct wl_surface *wl_surface,
+ struct wl_output *output);
+ /**
+ * surface leaves an output
+ *
+ * This is emitted whenever a surface's creation, movement, or
+ * resizing results in it no longer having any part of it within
+ * the scanout region of an output.
+ * @param output output left by the surface
+ */
+ void (*leave)(void *data,
+ struct wl_surface *wl_surface,
+ struct wl_output *output);
+};
+
+/**
+ * @ingroup iface_wl_surface
+ */
+static inline int
+wl_surface_add_listener(struct wl_surface *wl_surface,
+ const struct wl_surface_listener *listener, void *data)
+{
+ return wl_proxy_add_listener((struct wl_proxy *) wl_surface,
+ (void (**)(void)) listener, data);
+}
+
+#define WL_SURFACE_DESTROY 0
+#define WL_SURFACE_ATTACH 1
+#define WL_SURFACE_DAMAGE 2
+#define WL_SURFACE_FRAME 3
+#define WL_SURFACE_SET_OPAQUE_REGION 4
+#define WL_SURFACE_SET_INPUT_REGION 5
+#define WL_SURFACE_COMMIT 6
+#define WL_SURFACE_SET_BUFFER_TRANSFORM 7
+#define WL_SURFACE_SET_BUFFER_SCALE 8
+#define WL_SURFACE_DAMAGE_BUFFER 9
+
+/**
+ * @ingroup iface_wl_surface
+ */
+#define WL_SURFACE_ENTER_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_surface
+ */
+#define WL_SURFACE_LEAVE_SINCE_VERSION 1
+
+/**
+ * @ingroup iface_wl_surface
+ */
+#define WL_SURFACE_DESTROY_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_surface
+ */
+#define WL_SURFACE_ATTACH_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_surface
+ */
+#define WL_SURFACE_DAMAGE_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_surface
+ */
+#define WL_SURFACE_FRAME_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_surface
+ */
+#define WL_SURFACE_SET_OPAQUE_REGION_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_surface
+ */
+#define WL_SURFACE_SET_INPUT_REGION_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_surface
+ */
+#define WL_SURFACE_COMMIT_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_surface
+ */
+#define WL_SURFACE_SET_BUFFER_TRANSFORM_SINCE_VERSION 2
+/**
+ * @ingroup iface_wl_surface
+ */
+#define WL_SURFACE_SET_BUFFER_SCALE_SINCE_VERSION 3
+/**
+ * @ingroup iface_wl_surface
+ */
+#define WL_SURFACE_DAMAGE_BUFFER_SINCE_VERSION 4
+
+/** @ingroup iface_wl_surface */
+static inline void
+wl_surface_set_user_data(struct wl_surface *wl_surface, void *user_data)
+{
+ wl_proxy_set_user_data((struct wl_proxy *) wl_surface, user_data);
+}
+
+/** @ingroup iface_wl_surface */
+static inline void *
+wl_surface_get_user_data(struct wl_surface *wl_surface)
+{
+ return wl_proxy_get_user_data((struct wl_proxy *) wl_surface);
+}
+
+static inline uint32_t
+wl_surface_get_version(struct wl_surface *wl_surface)
+{
+ return wl_proxy_get_version((struct wl_proxy *) wl_surface);
+}
+
+/**
+ * @ingroup iface_wl_surface
+ *
+ * Deletes the surface and invalidates its object ID.
+ */
+static inline void
+wl_surface_destroy(struct wl_surface *wl_surface)
+{
+ wl_proxy_marshal((struct wl_proxy *) wl_surface,
+ WL_SURFACE_DESTROY);
+
+ wl_proxy_destroy((struct wl_proxy *) wl_surface);
+}
+
+/**
+ * @ingroup iface_wl_surface
+ *
+ * Set a buffer as the content of this surface.
+ *
+ * The new size of the surface is calculated based on the buffer
+ * size transformed by the inverse buffer_transform and the
+ * inverse buffer_scale. This means that the supplied buffer
+ * must be an integer multiple of the buffer_scale.
+ *
+ * The x and y arguments specify the location of the new pending
+ * buffer's upper left corner, relative to the current buffer's upper
+ * left corner, in surface-local coordinates. In other words, the
+ * x and y, combined with the new surface size define in which
+ * directions the surface's size changes.
+ *
+ * Surface contents are double-buffered state, see wl_surface.commit.
+ *
+ * The initial surface contents are void; there is no content.
+ * wl_surface.attach assigns the given wl_buffer as the pending
+ * wl_buffer. wl_surface.commit makes the pending wl_buffer the new
+ * surface contents, and the size of the surface becomes the size
+ * calculated from the wl_buffer, as described above. After commit,
+ * there is no pending buffer until the next attach.
+ *
+ * Committing a pending wl_buffer allows the compositor to read the
+ * pixels in the wl_buffer. The compositor may access the pixels at
+ * any time after the wl_surface.commit request. When the compositor
+ * will not access the pixels anymore, it will send the
+ * wl_buffer.release event. Only after receiving wl_buffer.release,
+ * the client may reuse the wl_buffer. A wl_buffer that has been
+ * attached and then replaced by another attach instead of committed
+ * will not receive a release event, and is not used by the
+ * compositor.
+ *
+ * Destroying the wl_buffer after wl_buffer.release does not change
+ * the surface contents. However, if the client destroys the
+ * wl_buffer before receiving the wl_buffer.release event, the surface
+ * contents become undefined immediately.
+ *
+ * If wl_surface.attach is sent with a NULL wl_buffer, the
+ * following wl_surface.commit will remove the surface content.
+ */
+static inline void
+wl_surface_attach(struct wl_surface *wl_surface, struct wl_buffer *buffer, int32_t x, int32_t y)
+{
+ wl_proxy_marshal((struct wl_proxy *) wl_surface,
+ WL_SURFACE_ATTACH, buffer, x, y);
+}
+
+/**
+ * @ingroup iface_wl_surface
+ *
+ * This request is used to describe the regions where the pending
+ * buffer is different from the current surface contents, and where
+ * the surface therefore needs to be repainted. The compositor
+ * ignores the parts of the damage that fall outside of the surface.
+ *
+ * Damage is double-buffered state, see wl_surface.commit.
+ *
+ * The damage rectangle is specified in surface-local coordinates,
+ * where x and y specify the upper left corner of the damage rectangle.
+ *
+ * The initial value for pending damage is empty: no damage.
+ * wl_surface.damage adds pending damage: the new pending damage
+ * is the union of old pending damage and the given rectangle.
+ *
+ * wl_surface.commit assigns pending damage as the current damage,
+ * and clears pending damage. The server will clear the current
+ * damage as it repaints the surface.
+ *
+ * Alternatively, damage can be posted with wl_surface.damage_buffer
+ * which uses buffer coordinates instead of surface coordinates,
+ * and is probably the preferred and intuitive way of doing this.
+ */
+static inline void
+wl_surface_damage(struct wl_surface *wl_surface, int32_t x, int32_t y, int32_t width, int32_t height)
+{
+ wl_proxy_marshal((struct wl_proxy *) wl_surface,
+ WL_SURFACE_DAMAGE, x, y, width, height);
+}
+
+/**
+ * @ingroup iface_wl_surface
+ *
+ * Request a notification when it is a good time to start drawing a new
+ * frame, by creating a frame callback. This is useful for throttling
+ * redrawing operations, and driving animations.
+ *
+ * When a client is animating on a wl_surface, it can use the 'frame'
+ * request to get notified when it is a good time to draw and commit the
+ * next frame of animation. If the client commits an update earlier than
+ * that, it is likely that some updates will not make it to the display,
+ * and the client is wasting resources by drawing too often.
+ *
+ * The frame request will take effect on the next wl_surface.commit.
+ * The notification will only be posted for one frame unless
+ * requested again. For a wl_surface, the notifications are posted in
+ * the order the frame requests were committed.
+ *
+ * The server must send the notifications so that a client
+ * will not send excessive updates, while still allowing
+ * the highest possible update rate for clients that wait for the reply
+ * before drawing again. The server should give some time for the client
+ * to draw and commit after sending the frame callback events to let it
+ * hit the next output refresh.
+ *
+ * A server should avoid signaling the frame callbacks if the
+ * surface is not visible in any way, e.g. the surface is off-screen,
+ * or completely obscured by other opaque surfaces.
+ *
+ * The object returned by this request will be destroyed by the
+ * compositor after the callback is fired and as such the client must not
+ * attempt to use it after that point.
+ *
+ * The callback_data passed in the callback is the current time, in
+ * milliseconds, with an undefined base.
+ */
+static inline struct wl_callback *
+wl_surface_frame(struct wl_surface *wl_surface)
+{
+ struct wl_proxy *callback;
+
+ callback = wl_proxy_marshal_constructor((struct wl_proxy *) wl_surface,
+ WL_SURFACE_FRAME, &wl_callback_interface, NULL);
+
+ return (struct wl_callback *) callback;
+}
+
+/**
+ * @ingroup iface_wl_surface
+ *
+ * This request sets the region of the surface that contains
+ * opaque content.
+ *
+ * The opaque region is an optimization hint for the compositor
+ * that lets it optimize the redrawing of content behind opaque
+ * regions. Setting an opaque region is not required for correct
+ * behaviour, but marking transparent content as opaque will result
+ * in repaint artifacts.
+ *
+ * The opaque region is specified in surface-local coordinates.
+ *
+ * The compositor ignores the parts of the opaque region that fall
+ * outside of the surface.
+ *
+ * Opaque region is double-buffered state, see wl_surface.commit.
+ *
+ * wl_surface.set_opaque_region changes the pending opaque region.
+ * wl_surface.commit copies the pending region to the current region.
+ * Otherwise, the pending and current regions are never changed.
+ *
+ * The initial value for an opaque region is empty. Setting the pending
+ * opaque region has copy semantics, and the wl_region object can be
+ * destroyed immediately. A NULL wl_region causes the pending opaque
+ * region to be set to empty.
+ */
+static inline void
+wl_surface_set_opaque_region(struct wl_surface *wl_surface, struct wl_region *region)
+{
+ wl_proxy_marshal((struct wl_proxy *) wl_surface,
+ WL_SURFACE_SET_OPAQUE_REGION, region);
+}
+
+/**
+ * @ingroup iface_wl_surface
+ *
+ * This request sets the region of the surface that can receive
+ * pointer and touch events.
+ *
+ * Input events happening outside of this region will try the next
+ * surface in the server surface stack. The compositor ignores the
+ * parts of the input region that fall outside of the surface.
+ *
+ * The input region is specified in surface-local coordinates.
+ *
+ * Input region is double-buffered state, see wl_surface.commit.
+ *
+ * wl_surface.set_input_region changes the pending input region.
+ * wl_surface.commit copies the pending region to the current region.
+ * Otherwise the pending and current regions are never changed,
+ * except cursor and icon surfaces are special cases, see
+ * wl_pointer.set_cursor and wl_data_device.start_drag.
+ *
+ * The initial value for an input region is infinite. That means the
+ * whole surface will accept input. Setting the pending input region
+ * has copy semantics, and the wl_region object can be destroyed
+ * immediately. A NULL wl_region causes the input region to be set
+ * to infinite.
+ */
+static inline void
+wl_surface_set_input_region(struct wl_surface *wl_surface, struct wl_region *region)
+{
+ wl_proxy_marshal((struct wl_proxy *) wl_surface,
+ WL_SURFACE_SET_INPUT_REGION, region);
+}
+
+/**
+ * @ingroup iface_wl_surface
+ *
+ * Surface state (input, opaque, and damage regions, attached buffers,
+ * etc.) is double-buffered. Protocol requests modify the pending state,
+ * as opposed to the current state in use by the compositor. A commit
+ * request atomically applies all pending state, replacing the current
+ * state. After commit, the new pending state is as documented for each
+ * related request.
+ *
+ * On commit, a pending wl_buffer is applied first, and all other state
+ * second. This means that all coordinates in double-buffered state are
+ * relative to the new wl_buffer coming into use, except for
+ * wl_surface.attach itself. If there is no pending wl_buffer, the
+ * coordinates are relative to the current surface contents.
+ *
+ * All requests that need a commit to become effective are documented
+ * to affect double-buffered state.
+ *
+ * Other interfaces may add further double-buffered surface state.
+ */
+static inline void
+wl_surface_commit(struct wl_surface *wl_surface)
+{
+ wl_proxy_marshal((struct wl_proxy *) wl_surface,
+ WL_SURFACE_COMMIT);
+}
+
+/**
+ * @ingroup iface_wl_surface
+ *
+ * This request sets an optional transformation on how the compositor
+ * interprets the contents of the buffer attached to the surface. The
+ * accepted values for the transform parameter are the values for
+ * wl_output.transform.
+ *
+ * Buffer transform is double-buffered state, see wl_surface.commit.
+ *
+ * A newly created surface has its buffer transformation set to normal.
+ *
+ * wl_surface.set_buffer_transform changes the pending buffer
+ * transformation. wl_surface.commit copies the pending buffer
+ * transformation to the current one. Otherwise, the pending and current
+ * values are never changed.
+ *
+ * The purpose of this request is to allow clients to render content
+ * according to the output transform, thus permitting the compositor to
+ * use certain optimizations even if the display is rotated. Using
+ * hardware overlays and scanning out a client buffer for fullscreen
+ * surfaces are examples of such optimizations. Those optimizations are
+ * highly dependent on the compositor implementation, so the use of this
+ * request should be considered on a case-by-case basis.
+ *
+ * Note that if the transform value includes 90 or 270 degree rotation,
+ * the width of the buffer will become the surface height and the height
+ * of the buffer will become the surface width.
+ *
+ * If transform is not one of the values from the
+ * wl_output.transform enum the invalid_transform protocol error
+ * is raised.
+ */
+static inline void
+wl_surface_set_buffer_transform(struct wl_surface *wl_surface, int32_t transform)
+{
+ wl_proxy_marshal((struct wl_proxy *) wl_surface,
+ WL_SURFACE_SET_BUFFER_TRANSFORM, transform);
+}
+
+/**
+ * @ingroup iface_wl_surface
+ *
+ * This request sets an optional scaling factor on how the compositor
+ * interprets the contents of the buffer attached to the window.
+ *
+ * Buffer scale is double-buffered state, see wl_surface.commit.
+ *
+ * A newly created surface has its buffer scale set to 1.
+ *
+ * wl_surface.set_buffer_scale changes the pending buffer scale.
+ * wl_surface.commit copies the pending buffer scale to the current one.
+ * Otherwise, the pending and current values are never changed.
+ *
+ * The purpose of this request is to allow clients to supply higher
+ * resolution buffer data for use on high resolution outputs. It is
+ * intended that you pick the same buffer scale as the scale of the
+ * output that the surface is displayed on. This means the compositor
+ * can avoid scaling when rendering the surface on that output.
+ *
+ * Note that if the scale is larger than 1, then you have to attach
+ * a buffer that is larger (by a factor of scale in each dimension)
+ * than the desired surface size.
+ *
+ * If scale is not positive the invalid_scale protocol error is
+ * raised.
+ */
+static inline void
+wl_surface_set_buffer_scale(struct wl_surface *wl_surface, int32_t scale)
+{
+ wl_proxy_marshal((struct wl_proxy *) wl_surface,
+ WL_SURFACE_SET_BUFFER_SCALE, scale);
+}
+
+/**
+ * @ingroup iface_wl_surface
+ *
+ * This request is used to describe the regions where the pending
+ * buffer is different from the current surface contents, and where
+ * the surface therefore needs to be repainted. The compositor
+ * ignores the parts of the damage that fall outside of the surface.
+ *
+ * Damage is double-buffered state, see wl_surface.commit.
+ *
+ * The damage rectangle is specified in buffer coordinates,
+ * where x and y specify the upper left corner of the damage rectangle.
+ *
+ * The initial value for pending damage is empty: no damage.
+ * wl_surface.damage_buffer adds pending damage: the new pending
+ * damage is the union of old pending damage and the given rectangle.
+ *
+ * wl_surface.commit assigns pending damage as the current damage,
+ * and clears pending damage. The server will clear the current
+ * damage as it repaints the surface.
+ *
+ * This request differs from wl_surface.damage in only one way - it
+ * takes damage in buffer coordinates instead of surface-local
+ * coordinates. While this generally is more intuitive than surface
+ * coordinates, it is especially desirable when using wp_viewport
+ * or when a drawing library (like EGL) is unaware of buffer scale
+ * and buffer transform.
+ *
+ * Note: Because buffer transformation changes and damage requests may
+ * be interleaved in the protocol stream, it is impossible to determine
+ * the actual mapping between surface and buffer damage until
+ * wl_surface.commit time. Therefore, compositors wishing to take both
+ * kinds of damage into account will have to accumulate damage from the
+ * two requests separately and only transform from one to the other
+ * after receiving the wl_surface.commit.
+ */
+static inline void
+wl_surface_damage_buffer(struct wl_surface *wl_surface, int32_t x, int32_t y, int32_t width, int32_t height)
+{
+ wl_proxy_marshal((struct wl_proxy *) wl_surface,
+ WL_SURFACE_DAMAGE_BUFFER, x, y, width, height);
+}
+
+#ifndef WL_SEAT_CAPABILITY_ENUM
+#define WL_SEAT_CAPABILITY_ENUM
+/**
+ * @ingroup iface_wl_seat
+ * seat capability bitmask
+ *
+ * This is a bitmask of capabilities this seat has; if a member is
+ * set, then it is present on the seat.
+ */
+enum wl_seat_capability {
+ /**
+ * the seat has pointer devices
+ */
+ WL_SEAT_CAPABILITY_POINTER = 1,
+ /**
+ * the seat has one or more keyboards
+ */
+ WL_SEAT_CAPABILITY_KEYBOARD = 2,
+ /**
+ * the seat has touch devices
+ */
+ WL_SEAT_CAPABILITY_TOUCH = 4,
+};
+#endif /* WL_SEAT_CAPABILITY_ENUM */
+
+/**
+ * @ingroup iface_wl_seat
+ * @struct wl_seat_listener
+ */
+struct wl_seat_listener {
+ /**
+ * seat capabilities changed
+ *
+ * This is emitted whenever a seat gains or loses the pointer,
+ * keyboard or touch capabilities. The argument is a capability
+ * enum containing the complete set of capabilities this seat has.
+ *
+ * When the pointer capability is added, a client may create a
+ * wl_pointer object using the wl_seat.get_pointer request. This
+ * object will receive pointer events until the capability is
+ * removed in the future.
+ *
+ * When the pointer capability is removed, a client should destroy
+ * the wl_pointer objects associated with the seat where the
+ * capability was removed, using the wl_pointer.release request. No
+ * further pointer events will be received on these objects.
+ *
+ * In some compositors, if a seat regains the pointer capability
+ * and a client has a previously obtained wl_pointer object of
+ * version 4 or less, that object may start sending pointer events
+ * again. This behavior is considered a misinterpretation of the
+ * intended behavior and must not be relied upon by the client.
+ * wl_pointer objects of version 5 or later must not send events if
+ * created before the most recent event notifying the client of an
+ * added pointer capability.
+ *
+ * The above behavior also applies to wl_keyboard and wl_touch with
+ * the keyboard and touch capabilities, respectively.
+ * @param capabilities capabilities of the seat
+ */
+ void (*capabilities)(void *data,
+ struct wl_seat *wl_seat,
+ uint32_t capabilities);
+ /**
+ * unique identifier for this seat
+ *
+ * In a multiseat configuration this can be used by the client to
+ * help identify which physical devices the seat represents. Based
+ * on the seat configuration used by the compositor.
+ * @param name seat identifier
+ * @since 2
+ */
+ void (*name)(void *data,
+ struct wl_seat *wl_seat,
+ const char *name);
+};
+
+/**
+ * @ingroup iface_wl_seat
+ */
+static inline int
+wl_seat_add_listener(struct wl_seat *wl_seat,
+ const struct wl_seat_listener *listener, void *data)
+{
+ return wl_proxy_add_listener((struct wl_proxy *) wl_seat,
+ (void (**)(void)) listener, data);
+}
+
+#define WL_SEAT_GET_POINTER 0
+#define WL_SEAT_GET_KEYBOARD 1
+#define WL_SEAT_GET_TOUCH 2
+#define WL_SEAT_RELEASE 3
+
+/**
+ * @ingroup iface_wl_seat
+ */
+#define WL_SEAT_CAPABILITIES_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_seat
+ */
+#define WL_SEAT_NAME_SINCE_VERSION 2
+
+/**
+ * @ingroup iface_wl_seat
+ */
+#define WL_SEAT_GET_POINTER_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_seat
+ */
+#define WL_SEAT_GET_KEYBOARD_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_seat
+ */
+#define WL_SEAT_GET_TOUCH_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_seat
+ */
+#define WL_SEAT_RELEASE_SINCE_VERSION 5
+
+/** @ingroup iface_wl_seat */
+static inline void
+wl_seat_set_user_data(struct wl_seat *wl_seat, void *user_data)
+{
+ wl_proxy_set_user_data((struct wl_proxy *) wl_seat, user_data);
+}
+
+/** @ingroup iface_wl_seat */
+static inline void *
+wl_seat_get_user_data(struct wl_seat *wl_seat)
+{
+ return wl_proxy_get_user_data((struct wl_proxy *) wl_seat);
+}
+
+static inline uint32_t
+wl_seat_get_version(struct wl_seat *wl_seat)
+{
+ return wl_proxy_get_version((struct wl_proxy *) wl_seat);
+}
+
+/** @ingroup iface_wl_seat */
+static inline void
+wl_seat_destroy(struct wl_seat *wl_seat)
+{
+ wl_proxy_destroy((struct wl_proxy *) wl_seat);
+}
+
+/**
+ * @ingroup iface_wl_seat
+ *
+ * The ID provided will be initialized to the wl_pointer interface
+ * for this seat.
+ *
+ * This request only takes effect if the seat has the pointer
+ * capability, or has had the pointer capability in the past.
+ * It is a protocol violation to issue this request on a seat that has
+ * never had the pointer capability.
+ */
+static inline struct wl_pointer *
+wl_seat_get_pointer(struct wl_seat *wl_seat)
+{
+ struct wl_proxy *id;
+
+ id = wl_proxy_marshal_constructor((struct wl_proxy *) wl_seat,
+ WL_SEAT_GET_POINTER, &wl_pointer_interface, NULL);
+
+ return (struct wl_pointer *) id;
+}
+
+/**
+ * @ingroup iface_wl_seat
+ *
+ * The ID provided will be initialized to the wl_keyboard interface
+ * for this seat.
+ *
+ * This request only takes effect if the seat has the keyboard
+ * capability, or has had the keyboard capability in the past.
+ * It is a protocol violation to issue this request on a seat that has
+ * never had the keyboard capability.
+ */
+static inline struct wl_keyboard *
+wl_seat_get_keyboard(struct wl_seat *wl_seat)
+{
+ struct wl_proxy *id;
+
+ id = wl_proxy_marshal_constructor((struct wl_proxy *) wl_seat,
+ WL_SEAT_GET_KEYBOARD, &wl_keyboard_interface, NULL);
+
+ return (struct wl_keyboard *) id;
+}
+
+/**
+ * @ingroup iface_wl_seat
+ *
+ * The ID provided will be initialized to the wl_touch interface
+ * for this seat.
+ *
+ * This request only takes effect if the seat has the touch
+ * capability, or has had the touch capability in the past.
+ * It is a protocol violation to issue this request on a seat that has
+ * never had the touch capability.
+ */
+static inline struct wl_touch *
+wl_seat_get_touch(struct wl_seat *wl_seat)
+{
+ struct wl_proxy *id;
+
+ id = wl_proxy_marshal_constructor((struct wl_proxy *) wl_seat,
+ WL_SEAT_GET_TOUCH, &wl_touch_interface, NULL);
+
+ return (struct wl_touch *) id;
+}
+
+/**
+ * @ingroup iface_wl_seat
+ *
+ * Using this request a client can tell the server that it is not going to
+ * use the seat object anymore.
+ */
+static inline void
+wl_seat_release(struct wl_seat *wl_seat)
+{
+ wl_proxy_marshal((struct wl_proxy *) wl_seat,
+ WL_SEAT_RELEASE);
+
+ wl_proxy_destroy((struct wl_proxy *) wl_seat);
+}
+
+#ifndef WL_POINTER_ERROR_ENUM
+#define WL_POINTER_ERROR_ENUM
+enum wl_pointer_error {
+ /**
+ * given wl_surface has another role
+ */
+ WL_POINTER_ERROR_ROLE = 0,
+};
+#endif /* WL_POINTER_ERROR_ENUM */
+
+#ifndef WL_POINTER_BUTTON_STATE_ENUM
+#define WL_POINTER_BUTTON_STATE_ENUM
+/**
+ * @ingroup iface_wl_pointer
+ * physical button state
+ *
+ * Describes the physical state of a button that produced the button
+ * event.
+ */
+enum wl_pointer_button_state {
+ /**
+ * the button is not pressed
+ */
+ WL_POINTER_BUTTON_STATE_RELEASED = 0,
+ /**
+ * the button is pressed
+ */
+ WL_POINTER_BUTTON_STATE_PRESSED = 1,
+};
+#endif /* WL_POINTER_BUTTON_STATE_ENUM */
+
+#ifndef WL_POINTER_AXIS_ENUM
+#define WL_POINTER_AXIS_ENUM
+/**
+ * @ingroup iface_wl_pointer
+ * axis types
+ *
+ * Describes the axis types of scroll events.
+ */
+enum wl_pointer_axis {
+ /**
+ * vertical axis
+ */
+ WL_POINTER_AXIS_VERTICAL_SCROLL = 0,
+ /**
+ * horizontal axis
+ */
+ WL_POINTER_AXIS_HORIZONTAL_SCROLL = 1,
+};
+#endif /* WL_POINTER_AXIS_ENUM */
+
+#ifndef WL_POINTER_AXIS_SOURCE_ENUM
+#define WL_POINTER_AXIS_SOURCE_ENUM
+/**
+ * @ingroup iface_wl_pointer
+ * axis source types
+ *
+ * Describes the source types for axis events. This indicates to the
+ * client how an axis event was physically generated; a client may
+ * adjust the user interface accordingly. For example, scroll events
+ * from a "finger" source may be in a smooth coordinate space with
+ * kinetic scrolling whereas a "wheel" source may be in discrete steps
+ * of a number of lines.
+ *
+ * The "continuous" axis source is a device generating events in a
+ * continuous coordinate space, but using something other than a
+ * finger. One example for this source is button-based scrolling where
+ * the vertical motion of a device is converted to scroll events while
+ * a button is held down.
+ *
+ * The "wheel tilt" axis source indicates that the actual device is a
+ * wheel but the scroll event is not caused by a rotation but a
+ * (usually sideways) tilt of the wheel.
+ */
+enum wl_pointer_axis_source {
+ /**
+ * a physical wheel rotation
+ */
+ WL_POINTER_AXIS_SOURCE_WHEEL = 0,
+ /**
+ * finger on a touch surface
+ */
+ WL_POINTER_AXIS_SOURCE_FINGER = 1,
+ /**
+ * continuous coordinate space
+ */
+ WL_POINTER_AXIS_SOURCE_CONTINUOUS = 2,
+ /**
+ * a physical wheel tilt
+ * @since 6
+ */
+ WL_POINTER_AXIS_SOURCE_WHEEL_TILT = 3,
+};
+/**
+ * @ingroup iface_wl_pointer
+ */
+#define WL_POINTER_AXIS_SOURCE_WHEEL_TILT_SINCE_VERSION 6
+#endif /* WL_POINTER_AXIS_SOURCE_ENUM */
+
+/**
+ * @ingroup iface_wl_pointer
+ * @struct wl_pointer_listener
+ */
+struct wl_pointer_listener {
+ /**
+ * enter event
+ *
+ * Notification that this seat's pointer is focused on a certain
+ * surface.
+ *
+ * When a seat's focus enters a surface, the pointer image is
+ * undefined and a client should respond to this event by setting
+ * an appropriate pointer image with the set_cursor request.
+ * @param serial serial number of the enter event
+ * @param surface surface entered by the pointer
+ * @param surface_x surface-local x coordinate
+ * @param surface_y surface-local y coordinate
+ */
+ void (*enter)(void *data,
+ struct wl_pointer *wl_pointer,
+ uint32_t serial,
+ struct wl_surface *surface,
+ wl_fixed_t surface_x,
+ wl_fixed_t surface_y);
+ /**
+ * leave event
+ *
+ * Notification that this seat's pointer is no longer focused on
+ * a certain surface.
+ *
+ * The leave notification is sent before the enter notification for
+ * the new focus.
+ * @param serial serial number of the leave event
+ * @param surface surface left by the pointer
+ */
+ void (*leave)(void *data,
+ struct wl_pointer *wl_pointer,
+ uint32_t serial,
+ struct wl_surface *surface);
+ /**
+ * pointer motion event
+ *
+ * Notification of pointer location change. The arguments
+ * surface_x and surface_y are the location relative to the focused
+ * surface.
+ * @param time timestamp with millisecond granularity
+ * @param surface_x surface-local x coordinate
+ * @param surface_y surface-local y coordinate
+ */
+ void (*motion)(void *data,
+ struct wl_pointer *wl_pointer,
+ uint32_t time,
+ wl_fixed_t surface_x,
+ wl_fixed_t surface_y);
+ /**
+ * pointer button event
+ *
+ * Mouse button click and release notifications.
+ *
+ * The location of the click is given by the last motion or enter
+ * event. The time argument is a timestamp with millisecond
+ * granularity, with an undefined base.
+ *
+ * The button is a button code as defined in the Linux kernel's
+ * linux/input-event-codes.h header file, e.g. BTN_LEFT.
+ *
+ * Any 16-bit button code value is reserved for future additions to
+ * the kernel's event code list. All other button codes above
+ * 0xFFFF are currently undefined but may be used in future
+ * versions of this protocol.
+ * @param serial serial number of the button event
+ * @param time timestamp with millisecond granularity
+ * @param button button that produced the event
+ * @param state physical state of the button
+ */
+ void (*button)(void *data,
+ struct wl_pointer *wl_pointer,
+ uint32_t serial,
+ uint32_t time,
+ uint32_t button,
+ uint32_t state);
+ /**
+ * axis event
+ *
+ * Scroll and other axis notifications.
+ *
+ * For scroll events (vertical and horizontal scroll axes), the
+ * value parameter is the length of a vector along the specified
+ * axis in a coordinate space identical to those of motion events,
+ * representing a relative movement along the specified axis.
+ *
+ * For devices that support movements non-parallel to axes multiple
+ * axis events will be emitted.
+ *
+ * When applicable, for example for touch pads, the server can
+ * choose to emit scroll events where the motion vector is
+ * equivalent to a motion event vector.
+ *
+ * When applicable, a client can transform its content relative to
+ * the scroll distance.
+ * @param time timestamp with millisecond granularity
+ * @param axis axis type
+ * @param value length of vector in surface-local coordinate space
+ */
+ void (*axis)(void *data,
+ struct wl_pointer *wl_pointer,
+ uint32_t time,
+ uint32_t axis,
+ wl_fixed_t value);
+ /**
+ * end of a pointer event sequence
+ *
+ * Indicates the end of a set of events that logically belong
+ * together. A client is expected to accumulate the data in all
+ * events within the frame before proceeding.
+ *
+ * All wl_pointer events before a wl_pointer.frame event belong
+ * logically together. For example, in a diagonal scroll motion the
+ * compositor will send an optional wl_pointer.axis_source event,
+ * two wl_pointer.axis events (horizontal and vertical) and finally
+ * a wl_pointer.frame event. The client may use this information to
+ * calculate a diagonal vector for scrolling.
+ *
+ * When multiple wl_pointer.axis events occur within the same
+ * frame, the motion vector is the combined motion of all events.
+ * When a wl_pointer.axis and a wl_pointer.axis_stop event occur
+ * within the same frame, this indicates that axis movement in one
+ * axis has stopped but continues in the other axis. When multiple
+ * wl_pointer.axis_stop events occur within the same frame, this
+ * indicates that these axes stopped in the same instance.
+ *
+ * A wl_pointer.frame event is sent for every logical event group,
+ * even if the group only contains a single wl_pointer event.
+ * Specifically, a client may get a sequence: motion, frame,
+ * button, frame, axis, frame, axis_stop, frame.
+ *
+ * The wl_pointer.enter and wl_pointer.leave events are logical
+ * events generated by the compositor and not the hardware. These
+ * events are also grouped by a wl_pointer.frame. When a pointer
+ * moves from one surface to another, a compositor should group the
+ * wl_pointer.leave event within the same wl_pointer.frame.
+ * However, a client must not rely on wl_pointer.leave and
+ * wl_pointer.enter being in the same wl_pointer.frame.
+ * Compositor-specific policies may require the wl_pointer.leave
+ * and wl_pointer.enter event being split across multiple
+ * wl_pointer.frame groups.
+ * @since 5
+ */
+ void (*frame)(void *data,
+ struct wl_pointer *wl_pointer);
+ /**
+ * axis source event
+ *
+ * Source information for scroll and other axes.
+ *
+ * This event does not occur on its own. It is sent before a
+ * wl_pointer.frame event and carries the source information for
+ * all events within that frame.
+ *
+ * The source specifies how this event was generated. If the source
+ * is wl_pointer.axis_source.finger, a wl_pointer.axis_stop event
+ * will be sent when the user lifts the finger off the device.
+ *
+ * If the source is wl_pointer.axis_source.wheel,
+ * wl_pointer.axis_source.wheel_tilt or
+ * wl_pointer.axis_source.continuous, a wl_pointer.axis_stop event
+ * may or may not be sent. Whether a compositor sends an axis_stop
+ * event for these sources is hardware-specific and
+ * implementation-dependent; clients must not rely on receiving an
+ * axis_stop event for these scroll sources and should treat scroll
+ * sequences from these scroll sources as unterminated by default.
+ *
+ * This event is optional. If the source is unknown for a
+ * particular axis event sequence, no event is sent. Only one
+ * wl_pointer.axis_source event is permitted per frame.
+ *
+ * The order of wl_pointer.axis_discrete and wl_pointer.axis_source
+ * is not guaranteed.
+ * @param axis_source source of the axis event
+ * @since 5
+ */
+ void (*axis_source)(void *data,
+ struct wl_pointer *wl_pointer,
+ uint32_t axis_source);
+ /**
+ * axis stop event
+ *
+ * Stop notification for scroll and other axes.
+ *
+ * For some wl_pointer.axis_source types, a wl_pointer.axis_stop
+ * event is sent to notify a client that the axis sequence has
+ * terminated. This enables the client to implement kinetic
+ * scrolling. See the wl_pointer.axis_source documentation for
+ * information on when this event may be generated.
+ *
+ * Any wl_pointer.axis events with the same axis_source after this
+ * event should be considered as the start of a new axis motion.
+ *
+ * The timestamp is to be interpreted identical to the timestamp in
+ * the wl_pointer.axis event. The timestamp value may be the same
+ * as a preceding wl_pointer.axis event.
+ * @param time timestamp with millisecond granularity
+ * @param axis the axis stopped with this event
+ * @since 5
+ */
+ void (*axis_stop)(void *data,
+ struct wl_pointer *wl_pointer,
+ uint32_t time,
+ uint32_t axis);
+ /**
+ * axis click event
+ *
+ * Discrete step information for scroll and other axes.
+ *
+ * This event carries the axis value of the wl_pointer.axis event
+ * in discrete steps (e.g. mouse wheel clicks).
+ *
+ * This event does not occur on its own, it is coupled with a
+ * wl_pointer.axis event that represents this axis value on a
+ * continuous scale. The protocol guarantees that each
+ * axis_discrete event is always followed by exactly one axis event
+ * with the same axis number within the same wl_pointer.frame. Note
+ * that the protocol allows for other events to occur between the
+ * axis_discrete and its coupled axis event, including other
+ * axis_discrete or axis events.
+ *
+ * This event is optional; continuous scrolling devices like
+ * two-finger scrolling on touchpads do not have discrete steps and
+ * do not generate this event.
+ *
+ * The discrete value carries the directional information. e.g. a
+ * value of -2 is two steps towards the negative direction of this
+ * axis.
+ *
+ * The axis number is identical to the axis number in the
+ * associated axis event.
+ *
+ * The order of wl_pointer.axis_discrete and wl_pointer.axis_source
+ * is not guaranteed.
+ * @param axis axis type
+ * @param discrete number of steps
+ * @since 5
+ */
+ void (*axis_discrete)(void *data,
+ struct wl_pointer *wl_pointer,
+ uint32_t axis,
+ int32_t discrete);
+};
+
+/**
+ * @ingroup iface_wl_pointer
+ */
+static inline int
+wl_pointer_add_listener(struct wl_pointer *wl_pointer,
+ const struct wl_pointer_listener *listener, void *data)
+{
+ return wl_proxy_add_listener((struct wl_proxy *) wl_pointer,
+ (void (**)(void)) listener, data);
+}
+
+#define WL_POINTER_SET_CURSOR 0
+#define WL_POINTER_RELEASE 1
+
+/**
+ * @ingroup iface_wl_pointer
+ */
+#define WL_POINTER_ENTER_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_pointer
+ */
+#define WL_POINTER_LEAVE_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_pointer
+ */
+#define WL_POINTER_MOTION_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_pointer
+ */
+#define WL_POINTER_BUTTON_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_pointer
+ */
+#define WL_POINTER_AXIS_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_pointer
+ */
+#define WL_POINTER_FRAME_SINCE_VERSION 5
+/**
+ * @ingroup iface_wl_pointer
+ */
+#define WL_POINTER_AXIS_SOURCE_SINCE_VERSION 5
+/**
+ * @ingroup iface_wl_pointer
+ */
+#define WL_POINTER_AXIS_STOP_SINCE_VERSION 5
+/**
+ * @ingroup iface_wl_pointer
+ */
+#define WL_POINTER_AXIS_DISCRETE_SINCE_VERSION 5
+
+/**
+ * @ingroup iface_wl_pointer
+ */
+#define WL_POINTER_SET_CURSOR_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_pointer
+ */
+#define WL_POINTER_RELEASE_SINCE_VERSION 3
+
+/** @ingroup iface_wl_pointer */
+static inline void
+wl_pointer_set_user_data(struct wl_pointer *wl_pointer, void *user_data)
+{
+ wl_proxy_set_user_data((struct wl_proxy *) wl_pointer, user_data);
+}
+
+/** @ingroup iface_wl_pointer */
+static inline void *
+wl_pointer_get_user_data(struct wl_pointer *wl_pointer)
+{
+ return wl_proxy_get_user_data((struct wl_proxy *) wl_pointer);
+}
+
+static inline uint32_t
+wl_pointer_get_version(struct wl_pointer *wl_pointer)
+{
+ return wl_proxy_get_version((struct wl_proxy *) wl_pointer);
+}
+
+/** @ingroup iface_wl_pointer */
+static inline void
+wl_pointer_destroy(struct wl_pointer *wl_pointer)
+{
+ wl_proxy_destroy((struct wl_proxy *) wl_pointer);
+}
+
+/**
+ * @ingroup iface_wl_pointer
+ *
+ * Set the pointer surface, i.e., the surface that contains the
+ * pointer image (cursor). This request gives the surface the role
+ * of a cursor. If the surface already has another role, it raises
+ * a protocol error.
+ *
+ * The cursor actually changes only if the pointer
+ * focus for this device is one of the requesting client's surfaces
+ * or the surface parameter is the current pointer surface. If
+ * there was a previous surface set with this request it is
+ * replaced. If surface is NULL, the pointer image is hidden.
+ *
+ * The parameters hotspot_x and hotspot_y define the position of
+ * the pointer surface relative to the pointer location. Its
+ * top-left corner is always at (x, y) - (hotspot_x, hotspot_y),
+ * where (x, y) are the coordinates of the pointer location, in
+ * surface-local coordinates.
+ *
+ * On surface.attach requests to the pointer surface, hotspot_x
+ * and hotspot_y are decremented by the x and y parameters
+ * passed to the request. Attach must be confirmed by
+ * wl_surface.commit as usual.
+ *
+ * The hotspot can also be updated by passing the currently set
+ * pointer surface to this request with new values for hotspot_x
+ * and hotspot_y.
+ *
+ * The current and pending input regions of the wl_surface are
+ * cleared, and wl_surface.set_input_region is ignored until the
+ * wl_surface is no longer used as the cursor. When the use as a
+ * cursor ends, the current and pending input regions become
+ * undefined, and the wl_surface is unmapped.
+ */
+static inline void
+wl_pointer_set_cursor(struct wl_pointer *wl_pointer, uint32_t serial, struct wl_surface *surface, int32_t hotspot_x, int32_t hotspot_y)
+{
+ wl_proxy_marshal((struct wl_proxy *) wl_pointer,
+ WL_POINTER_SET_CURSOR, serial, surface, hotspot_x, hotspot_y);
+}
+
+/**
+ * @ingroup iface_wl_pointer
+ *
+ * Using this request a client can tell the server that it is not going to
+ * use the pointer object anymore.
+ *
+ * This request destroys the pointer proxy object, so clients must not call
+ * wl_pointer_destroy() after using this request.
+ */
+static inline void
+wl_pointer_release(struct wl_pointer *wl_pointer)
+{
+ wl_proxy_marshal((struct wl_proxy *) wl_pointer,
+ WL_POINTER_RELEASE);
+
+ wl_proxy_destroy((struct wl_proxy *) wl_pointer);
+}
+
+#ifndef WL_KEYBOARD_KEYMAP_FORMAT_ENUM
+#define WL_KEYBOARD_KEYMAP_FORMAT_ENUM
+/**
+ * @ingroup iface_wl_keyboard
+ * keyboard mapping format
+ *
+ * This specifies the format of the keymap provided to the
+ * client with the wl_keyboard.keymap event.
+ */
+enum wl_keyboard_keymap_format {
+ /**
+ * no keymap; client must understand how to interpret the raw keycode
+ */
+ WL_KEYBOARD_KEYMAP_FORMAT_NO_KEYMAP = 0,
+ /**
+ * libxkbcommon compatible; to determine the xkb keycode, clients must add 8 to the key event keycode
+ */
+ WL_KEYBOARD_KEYMAP_FORMAT_XKB_V1 = 1,
+};
+#endif /* WL_KEYBOARD_KEYMAP_FORMAT_ENUM */
+
+#ifndef WL_KEYBOARD_KEY_STATE_ENUM
+#define WL_KEYBOARD_KEY_STATE_ENUM
+/**
+ * @ingroup iface_wl_keyboard
+ * physical key state
+ *
+ * Describes the physical state of a key that produced the key event.
+ */
+enum wl_keyboard_key_state {
+ /**
+ * key is not pressed
+ */
+ WL_KEYBOARD_KEY_STATE_RELEASED = 0,
+ /**
+ * key is pressed
+ */
+ WL_KEYBOARD_KEY_STATE_PRESSED = 1,
+};
+#endif /* WL_KEYBOARD_KEY_STATE_ENUM */
+
+/**
+ * @ingroup iface_wl_keyboard
+ * @struct wl_keyboard_listener
+ */
+struct wl_keyboard_listener {
+ /**
+ * keyboard mapping
+ *
+ * This event provides a file descriptor to the client which can
+ * be memory-mapped to provide a keyboard mapping description.
+ * @param format keymap format
+ * @param fd keymap file descriptor
+ * @param size keymap size, in bytes
+ */
+ void (*keymap)(void *data,
+ struct wl_keyboard *wl_keyboard,
+ uint32_t format,
+ int32_t fd,
+ uint32_t size);
+ /**
+ * enter event
+ *
+ * Notification that this seat's keyboard focus is on a certain
+ * surface.
+ * @param serial serial number of the enter event
+ * @param surface surface gaining keyboard focus
+ * @param keys the currently pressed keys
+ */
+ void (*enter)(void *data,
+ struct wl_keyboard *wl_keyboard,
+ uint32_t serial,
+ struct wl_surface *surface,
+ struct wl_array *keys);
+ /**
+ * leave event
+ *
+ * Notification that this seat's keyboard focus is no longer on a
+ * certain surface.
+ *
+ * The leave notification is sent before the enter notification for
+ * the new focus.
+ * @param serial serial number of the leave event
+ * @param surface surface that lost keyboard focus
+ */
+ void (*leave)(void *data,
+ struct wl_keyboard *wl_keyboard,
+ uint32_t serial,
+ struct wl_surface *surface);
+ /**
+ * key event
+ *
+ * A key was pressed or released. The time argument is a
+ * timestamp with millisecond granularity, with an undefined base.
+ * @param serial serial number of the key event
+ * @param time timestamp with millisecond granularity
+ * @param key key that produced the event
+ * @param state physical state of the key
+ */
+ void (*key)(void *data,
+ struct wl_keyboard *wl_keyboard,
+ uint32_t serial,
+ uint32_t time,
+ uint32_t key,
+ uint32_t state);
+ /**
+ * modifier and group state
+ *
+ * Notifies clients that the modifier and/or group state has
+ * changed, and it should update its local state.
+ * @param serial serial number of the modifiers event
+ * @param mods_depressed depressed modifiers
+ * @param mods_latched latched modifiers
+ * @param mods_locked locked modifiers
+ * @param group keyboard layout
+ */
+ void (*modifiers)(void *data,
+ struct wl_keyboard *wl_keyboard,
+ uint32_t serial,
+ uint32_t mods_depressed,
+ uint32_t mods_latched,
+ uint32_t mods_locked,
+ uint32_t group);
+ /**
+ * repeat rate and delay
+ *
+ * Informs the client about the keyboard's repeat rate and delay.
+ *
+ * This event is sent as soon as the wl_keyboard object has been
+ * created, and is guaranteed to be received by the client before
+ * any key press event.
+ *
+ * Negative values for either rate or delay are illegal. A rate of
+ * zero will disable any repeating (regardless of the value of
+ * delay).
+ *
+ * This event can be sent later on as well with a new value if
+ * necessary, so clients should continue listening for the event
+ * past the creation of wl_keyboard.
+ * @param rate the rate of repeating keys in characters per second
+ * @param delay delay in milliseconds since key down until repeating starts
+ * @since 4
+ */
+ void (*repeat_info)(void *data,
+ struct wl_keyboard *wl_keyboard,
+ int32_t rate,
+ int32_t delay);
+};
+
+/**
+ * @ingroup iface_wl_keyboard
+ */
+static inline int
+wl_keyboard_add_listener(struct wl_keyboard *wl_keyboard,
+ const struct wl_keyboard_listener *listener, void *data)
+{
+ return wl_proxy_add_listener((struct wl_proxy *) wl_keyboard,
+ (void (**)(void)) listener, data);
+}
+
+#define WL_KEYBOARD_RELEASE 0
+
+/**
+ * @ingroup iface_wl_keyboard
+ */
+#define WL_KEYBOARD_KEYMAP_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_keyboard
+ */
+#define WL_KEYBOARD_ENTER_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_keyboard
+ */
+#define WL_KEYBOARD_LEAVE_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_keyboard
+ */
+#define WL_KEYBOARD_KEY_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_keyboard
+ */
+#define WL_KEYBOARD_MODIFIERS_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_keyboard
+ */
+#define WL_KEYBOARD_REPEAT_INFO_SINCE_VERSION 4
+
+/**
+ * @ingroup iface_wl_keyboard
+ */
+#define WL_KEYBOARD_RELEASE_SINCE_VERSION 3
+
+/** @ingroup iface_wl_keyboard */
+static inline void
+wl_keyboard_set_user_data(struct wl_keyboard *wl_keyboard, void *user_data)
+{
+ wl_proxy_set_user_data((struct wl_proxy *) wl_keyboard, user_data);
+}
+
+/** @ingroup iface_wl_keyboard */
+static inline void *
+wl_keyboard_get_user_data(struct wl_keyboard *wl_keyboard)
+{
+ return wl_proxy_get_user_data((struct wl_proxy *) wl_keyboard);
+}
+
+static inline uint32_t
+wl_keyboard_get_version(struct wl_keyboard *wl_keyboard)
+{
+ return wl_proxy_get_version((struct wl_proxy *) wl_keyboard);
+}
+
+/** @ingroup iface_wl_keyboard */
+static inline void
+wl_keyboard_destroy(struct wl_keyboard *wl_keyboard)
+{
+ wl_proxy_destroy((struct wl_proxy *) wl_keyboard);
+}
+
+/**
+ * @ingroup iface_wl_keyboard
+ */
+static inline void
+wl_keyboard_release(struct wl_keyboard *wl_keyboard)
+{
+ wl_proxy_marshal((struct wl_proxy *) wl_keyboard,
+ WL_KEYBOARD_RELEASE);
+
+ wl_proxy_destroy((struct wl_proxy *) wl_keyboard);
+}
+
+/**
+ * @ingroup iface_wl_touch
+ * @struct wl_touch_listener
+ */
+struct wl_touch_listener {
+ /**
+ * touch down event and beginning of a touch sequence
+ *
+ * A new touch point has appeared on the surface. This touch
+ * point is assigned a unique ID. Future events from this touch
+ * point reference this ID. The ID ceases to be valid after a touch
+ * up event and may be reused in the future.
+ * @param serial serial number of the touch down event
+ * @param time timestamp with millisecond granularity
+ * @param surface surface touched
+ * @param id the unique ID of this touch point
+ * @param x surface-local x coordinate
+ * @param y surface-local y coordinate
+ */
+ void (*down)(void *data,
+ struct wl_touch *wl_touch,
+ uint32_t serial,
+ uint32_t time,
+ struct wl_surface *surface,
+ int32_t id,
+ wl_fixed_t x,
+ wl_fixed_t y);
+ /**
+ * end of a touch event sequence
+ *
+ * The touch point has disappeared. No further events will be
+ * sent for this touch point and the touch point's ID is released
+ * and may be reused in a future touch down event.
+ * @param serial serial number of the touch up event
+ * @param time timestamp with millisecond granularity
+ * @param id the unique ID of this touch point
+ */
+ void (*up)(void *data,
+ struct wl_touch *wl_touch,
+ uint32_t serial,
+ uint32_t time,
+ int32_t id);
+ /**
+ * update of touch point coordinates
+ *
+ * A touch point has changed coordinates.
+ * @param time timestamp with millisecond granularity
+ * @param id the unique ID of this touch point
+ * @param x surface-local x coordinate
+ * @param y surface-local y coordinate
+ */
+ void (*motion)(void *data,
+ struct wl_touch *wl_touch,
+ uint32_t time,
+ int32_t id,
+ wl_fixed_t x,
+ wl_fixed_t y);
+ /**
+ * end of touch frame event
+ *
+ * Indicates the end of a set of events that logically belong
+ * together. A client is expected to accumulate the data in all
+ * events within the frame before proceeding.
+ *
+ * A wl_touch.frame terminates at least one event but otherwise no
+ * guarantee is provided about the set of events within a frame. A
+ * client must assume that any state not updated in a frame is
+ * unchanged from the previously known state.
+ */
+ void (*frame)(void *data,
+ struct wl_touch *wl_touch);
+ /**
+ * touch session cancelled
+ *
+ * Sent if the compositor decides the touch stream is a global
+ * gesture. No further events are sent to the clients from that
+ * particular gesture. Touch cancellation applies to all touch
+ * points currently active on this client's surface. The client is
+ * responsible for finalizing the touch points, future touch points
+ * on this surface may reuse the touch point ID.
+ */
+ void (*cancel)(void *data,
+ struct wl_touch *wl_touch);
+ /**
+ * update shape of touch point
+ *
+ * Sent when a touchpoint has changed its shape.
+ *
+ * This event does not occur on its own. It is sent before a
+ * wl_touch.frame event and carries the new shape information for
+ * any previously reported, or new touch points of that frame.
+ *
+ * Other events describing the touch point such as wl_touch.down,
+ * wl_touch.motion or wl_touch.orientation may be sent within the
+ * same wl_touch.frame. A client should treat these events as a
+ * single logical touch point update. The order of wl_touch.shape,
+ * wl_touch.orientation and wl_touch.motion is not guaranteed. A
+ * wl_touch.down event is guaranteed to occur before the first
+ * wl_touch.shape event for this touch ID but both events may occur
+ * within the same wl_touch.frame.
+ *
+ * A touchpoint shape is approximated by an ellipse through the
+ * major and minor axis length. The major axis length describes the
+ * longer diameter of the ellipse, while the minor axis length
+ * describes the shorter diameter. Major and minor are orthogonal
+ * and both are specified in surface-local coordinates. The center
+ * of the ellipse is always at the touchpoint location as reported
+ * by wl_touch.down or wl_touch.move.
+ *
+ * This event is only sent by the compositor if the touch device
+ * supports shape reports. The client has to make reasonable
+ * assumptions about the shape if it did not receive this event.
+ * @param id the unique ID of this touch point
+ * @param major length of the major axis in surface-local coordinates
+ * @param minor length of the minor axis in surface-local coordinates
+ * @since 6
+ */
+ void (*shape)(void *data,
+ struct wl_touch *wl_touch,
+ int32_t id,
+ wl_fixed_t major,
+ wl_fixed_t minor);
+ /**
+ * update orientation of touch point
+ *
+ * Sent when a touchpoint has changed its orientation.
+ *
+ * This event does not occur on its own. It is sent before a
+ * wl_touch.frame event and carries the new shape information for
+ * any previously reported, or new touch points of that frame.
+ *
+ * Other events describing the touch point such as wl_touch.down,
+ * wl_touch.motion or wl_touch.shape may be sent within the same
+ * wl_touch.frame. A client should treat these events as a single
+ * logical touch point update. The order of wl_touch.shape,
+ * wl_touch.orientation and wl_touch.motion is not guaranteed. A
+ * wl_touch.down event is guaranteed to occur before the first
+ * wl_touch.orientation event for this touch ID but both events may
+ * occur within the same wl_touch.frame.
+ *
+ * The orientation describes the clockwise angle of a touchpoint's
+ * major axis to the positive surface y-axis and is normalized to
+ * the -180 to +180 degree range. The granularity of orientation
+ * depends on the touch device, some devices only support binary
+ * rotation values between 0 and 90 degrees.
+ *
+ * This event is only sent by the compositor if the touch device
+ * supports orientation reports.
+ * @param id the unique ID of this touch point
+ * @param orientation angle between major axis and positive surface y-axis in degrees
+ * @since 6
+ */
+ void (*orientation)(void *data,
+ struct wl_touch *wl_touch,
+ int32_t id,
+ wl_fixed_t orientation);
+};
+
+/**
+ * @ingroup iface_wl_touch
+ */
+static inline int
+wl_touch_add_listener(struct wl_touch *wl_touch,
+ const struct wl_touch_listener *listener, void *data)
+{
+ return wl_proxy_add_listener((struct wl_proxy *) wl_touch,
+ (void (**)(void)) listener, data);
+}
+
+#define WL_TOUCH_RELEASE 0
+
+/**
+ * @ingroup iface_wl_touch
+ */
+#define WL_TOUCH_DOWN_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_touch
+ */
+#define WL_TOUCH_UP_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_touch
+ */
+#define WL_TOUCH_MOTION_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_touch
+ */
+#define WL_TOUCH_FRAME_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_touch
+ */
+#define WL_TOUCH_CANCEL_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_touch
+ */
+#define WL_TOUCH_SHAPE_SINCE_VERSION 6
+/**
+ * @ingroup iface_wl_touch
+ */
+#define WL_TOUCH_ORIENTATION_SINCE_VERSION 6
+
+/**
+ * @ingroup iface_wl_touch
+ */
+#define WL_TOUCH_RELEASE_SINCE_VERSION 3
+
+/** @ingroup iface_wl_touch */
+static inline void
+wl_touch_set_user_data(struct wl_touch *wl_touch, void *user_data)
+{
+ wl_proxy_set_user_data((struct wl_proxy *) wl_touch, user_data);
+}
+
+/** @ingroup iface_wl_touch */
+static inline void *
+wl_touch_get_user_data(struct wl_touch *wl_touch)
+{
+ return wl_proxy_get_user_data((struct wl_proxy *) wl_touch);
+}
+
+static inline uint32_t
+wl_touch_get_version(struct wl_touch *wl_touch)
+{
+ return wl_proxy_get_version((struct wl_proxy *) wl_touch);
+}
+
+/** @ingroup iface_wl_touch */
+static inline void
+wl_touch_destroy(struct wl_touch *wl_touch)
+{
+ wl_proxy_destroy((struct wl_proxy *) wl_touch);
+}
+
+/**
+ * @ingroup iface_wl_touch
+ */
+static inline void
+wl_touch_release(struct wl_touch *wl_touch)
+{
+ wl_proxy_marshal((struct wl_proxy *) wl_touch,
+ WL_TOUCH_RELEASE);
+
+ wl_proxy_destroy((struct wl_proxy *) wl_touch);
+}
+
+#ifndef WL_OUTPUT_SUBPIXEL_ENUM
+#define WL_OUTPUT_SUBPIXEL_ENUM
+/**
+ * @ingroup iface_wl_output
+ * subpixel geometry information
+ *
+ * This enumeration describes how the physical
+ * pixels on an output are laid out.
+ */
+enum wl_output_subpixel {
+ /**
+ * unknown geometry
+ */
+ WL_OUTPUT_SUBPIXEL_UNKNOWN = 0,
+ /**
+ * no geometry
+ */
+ WL_OUTPUT_SUBPIXEL_NONE = 1,
+ /**
+ * horizontal RGB
+ */
+ WL_OUTPUT_SUBPIXEL_HORIZONTAL_RGB = 2,
+ /**
+ * horizontal BGR
+ */
+ WL_OUTPUT_SUBPIXEL_HORIZONTAL_BGR = 3,
+ /**
+ * vertical RGB
+ */
+ WL_OUTPUT_SUBPIXEL_VERTICAL_RGB = 4,
+ /**
+ * vertical BGR
+ */
+ WL_OUTPUT_SUBPIXEL_VERTICAL_BGR = 5,
+};
+#endif /* WL_OUTPUT_SUBPIXEL_ENUM */
+
+#ifndef WL_OUTPUT_TRANSFORM_ENUM
+#define WL_OUTPUT_TRANSFORM_ENUM
+/**
+ * @ingroup iface_wl_output
+ * transform from framebuffer to output
+ *
+ * This describes the transform that a compositor will apply to a
+ * surface to compensate for the rotation or mirroring of an
+ * output device.
+ *
+ * The flipped values correspond to an initial flip around a
+ * vertical axis followed by rotation.
+ *
+ * The purpose is mainly to allow clients to render accordingly and
+ * tell the compositor, so that for fullscreen surfaces, the
+ * compositor will still be able to scan out directly from client
+ * surfaces.
+ */
+enum wl_output_transform {
+ /**
+ * no transform
+ */
+ WL_OUTPUT_TRANSFORM_NORMAL = 0,
+ /**
+ * 90 degrees counter-clockwise
+ */
+ WL_OUTPUT_TRANSFORM_90 = 1,
+ /**
+ * 180 degrees counter-clockwise
+ */
+ WL_OUTPUT_TRANSFORM_180 = 2,
+ /**
+ * 270 degrees counter-clockwise
+ */
+ WL_OUTPUT_TRANSFORM_270 = 3,
+ /**
+ * 180 degree flip around a vertical axis
+ */
+ WL_OUTPUT_TRANSFORM_FLIPPED = 4,
+ /**
+ * flip and rotate 90 degrees counter-clockwise
+ */
+ WL_OUTPUT_TRANSFORM_FLIPPED_90 = 5,
+ /**
+ * flip and rotate 180 degrees counter-clockwise
+ */
+ WL_OUTPUT_TRANSFORM_FLIPPED_180 = 6,
+ /**
+ * flip and rotate 270 degrees counter-clockwise
+ */
+ WL_OUTPUT_TRANSFORM_FLIPPED_270 = 7,
+};
+#endif /* WL_OUTPUT_TRANSFORM_ENUM */
+
+#ifndef WL_OUTPUT_MODE_ENUM
+#define WL_OUTPUT_MODE_ENUM
+/**
+ * @ingroup iface_wl_output
+ * mode information
+ *
+ * These flags describe properties of an output mode.
+ * They are used in the flags bitfield of the mode event.
+ */
+enum wl_output_mode {
+ /**
+ * indicates this is the current mode
+ */
+ WL_OUTPUT_MODE_CURRENT = 0x1,
+ /**
+ * indicates this is the preferred mode
+ */
+ WL_OUTPUT_MODE_PREFERRED = 0x2,
+};
+#endif /* WL_OUTPUT_MODE_ENUM */
+
+/**
+ * @ingroup iface_wl_output
+ * @struct wl_output_listener
+ */
+struct wl_output_listener {
+ /**
+ * properties of the output
+ *
+ * The geometry event describes geometric properties of the
+ * output. The event is sent when binding to the output object and
+ * whenever any of the properties change.
+ * @param x x position within the global compositor space
+ * @param y y position within the global compositor space
+ * @param physical_width width in millimeters of the output
+ * @param physical_height height in millimeters of the output
+ * @param subpixel subpixel orientation of the output
+ * @param make textual description of the manufacturer
+ * @param model textual description of the model
+ * @param transform transform that maps framebuffer to output
+ */
+ void (*geometry)(void *data,
+ struct wl_output *wl_output,
+ int32_t x,
+ int32_t y,
+ int32_t physical_width,
+ int32_t physical_height,
+ int32_t subpixel,
+ const char *make,
+ const char *model,
+ int32_t transform);
+ /**
+ * advertise available modes for the output
+ *
+ * The mode event describes an available mode for the output.
+ *
+ * The event is sent when binding to the output object and there
+ * will always be one mode, the current mode. The event is sent
+ * again if an output changes mode, for the mode that is now
+ * current. In other words, the current mode is always the last
+ * mode that was received with the current flag set.
+ *
+ * The size of a mode is given in physical hardware units of the
+ * output device. This is not necessarily the same as the output
+ * size in the global compositor space. For instance, the output
+ * may be scaled, as described in wl_output.scale, or transformed,
+ * as described in wl_output.transform.
+ * @param flags bitfield of mode flags
+ * @param width width of the mode in hardware units
+ * @param height height of the mode in hardware units
+ * @param refresh vertical refresh rate in mHz
+ */
+ void (*mode)(void *data,
+ struct wl_output *wl_output,
+ uint32_t flags,
+ int32_t width,
+ int32_t height,
+ int32_t refresh);
+ /**
+ * sent all information about output
+ *
+ * This event is sent after all other properties have been sent
+ * after binding to the output object and after any other property
+ * changes done after that. This allows changes to the output
+ * properties to be seen as atomic, even if they happen via
+ * multiple events.
+ * @since 2
+ */
+ void (*done)(void *data,
+ struct wl_output *wl_output);
+ /**
+ * output scaling properties
+ *
+ * This event contains scaling geometry information that is not
+ * in the geometry event. It may be sent after binding the output
+ * object or if the output scale changes later. If it is not sent,
+ * the client should assume a scale of 1.
+ *
+ * A scale larger than 1 means that the compositor will
+ * automatically scale surface buffers by this amount when
+ * rendering. This is used for very high resolution displays where
+ * applications rendering at the native resolution would be too
+ * small to be legible.
+ *
+ * It is intended that scaling aware clients track the current
+ * output of a surface, and if it is on a scaled output it should
+ * use wl_surface.set_buffer_scale with the scale of the output.
+ * That way the compositor can avoid scaling the surface, and the
+ * client can supply a higher detail image.
+ * @param factor scaling factor of output
+ * @since 2
+ */
+ void (*scale)(void *data,
+ struct wl_output *wl_output,
+ int32_t factor);
+};
+
+/**
+ * @ingroup iface_wl_output
+ */
+static inline int
+wl_output_add_listener(struct wl_output *wl_output,
+ const struct wl_output_listener *listener, void *data)
+{
+ return wl_proxy_add_listener((struct wl_proxy *) wl_output,
+ (void (**)(void)) listener, data);
+}
+
+#define WL_OUTPUT_RELEASE 0
+
+/**
+ * @ingroup iface_wl_output
+ */
+#define WL_OUTPUT_GEOMETRY_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_output
+ */
+#define WL_OUTPUT_MODE_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_output
+ */
+#define WL_OUTPUT_DONE_SINCE_VERSION 2
+/**
+ * @ingroup iface_wl_output
+ */
+#define WL_OUTPUT_SCALE_SINCE_VERSION 2
+
+/**
+ * @ingroup iface_wl_output
+ */
+#define WL_OUTPUT_RELEASE_SINCE_VERSION 3
+
+/** @ingroup iface_wl_output */
+static inline void
+wl_output_set_user_data(struct wl_output *wl_output, void *user_data)
+{
+ wl_proxy_set_user_data((struct wl_proxy *) wl_output, user_data);
+}
+
+/** @ingroup iface_wl_output */
+static inline void *
+wl_output_get_user_data(struct wl_output *wl_output)
+{
+ return wl_proxy_get_user_data((struct wl_proxy *) wl_output);
+}
+
+static inline uint32_t
+wl_output_get_version(struct wl_output *wl_output)
+{
+ return wl_proxy_get_version((struct wl_proxy *) wl_output);
+}
+
+/** @ingroup iface_wl_output */
+static inline void
+wl_output_destroy(struct wl_output *wl_output)
+{
+ wl_proxy_destroy((struct wl_proxy *) wl_output);
+}
+
+/**
+ * @ingroup iface_wl_output
+ *
+ * Using this request a client can tell the server that it is not going to
+ * use the output object anymore.
+ */
+static inline void
+wl_output_release(struct wl_output *wl_output)
+{
+ wl_proxy_marshal((struct wl_proxy *) wl_output,
+ WL_OUTPUT_RELEASE);
+
+ wl_proxy_destroy((struct wl_proxy *) wl_output);
+}
+
+#define WL_REGION_DESTROY 0
+#define WL_REGION_ADD 1
+#define WL_REGION_SUBTRACT 2
+
+
+/**
+ * @ingroup iface_wl_region
+ */
+#define WL_REGION_DESTROY_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_region
+ */
+#define WL_REGION_ADD_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_region
+ */
+#define WL_REGION_SUBTRACT_SINCE_VERSION 1
+
+/** @ingroup iface_wl_region */
+static inline void
+wl_region_set_user_data(struct wl_region *wl_region, void *user_data)
+{
+ wl_proxy_set_user_data((struct wl_proxy *) wl_region, user_data);
+}
+
+/** @ingroup iface_wl_region */
+static inline void *
+wl_region_get_user_data(struct wl_region *wl_region)
+{
+ return wl_proxy_get_user_data((struct wl_proxy *) wl_region);
+}
+
+static inline uint32_t
+wl_region_get_version(struct wl_region *wl_region)
+{
+ return wl_proxy_get_version((struct wl_proxy *) wl_region);
+}
+
+/**
+ * @ingroup iface_wl_region
+ *
+ * Destroy the region. This will invalidate the object ID.
+ */
+static inline void
+wl_region_destroy(struct wl_region *wl_region)
+{
+ wl_proxy_marshal((struct wl_proxy *) wl_region,
+ WL_REGION_DESTROY);
+
+ wl_proxy_destroy((struct wl_proxy *) wl_region);
+}
+
+/**
+ * @ingroup iface_wl_region
+ *
+ * Add the specified rectangle to the region.
+ */
+static inline void
+wl_region_add(struct wl_region *wl_region, int32_t x, int32_t y, int32_t width, int32_t height)
+{
+ wl_proxy_marshal((struct wl_proxy *) wl_region,
+ WL_REGION_ADD, x, y, width, height);
+}
+
+/**
+ * @ingroup iface_wl_region
+ *
+ * Subtract the specified rectangle from the region.
+ */
+static inline void
+wl_region_subtract(struct wl_region *wl_region, int32_t x, int32_t y, int32_t width, int32_t height)
+{
+ wl_proxy_marshal((struct wl_proxy *) wl_region,
+ WL_REGION_SUBTRACT, x, y, width, height);
+}
+
+#ifndef WL_SUBCOMPOSITOR_ERROR_ENUM
+#define WL_SUBCOMPOSITOR_ERROR_ENUM
+enum wl_subcompositor_error {
+ /**
+ * the to-be sub-surface is invalid
+ */
+ WL_SUBCOMPOSITOR_ERROR_BAD_SURFACE = 0,
+};
+#endif /* WL_SUBCOMPOSITOR_ERROR_ENUM */
+
+#define WL_SUBCOMPOSITOR_DESTROY 0
+#define WL_SUBCOMPOSITOR_GET_SUBSURFACE 1
+
+
+/**
+ * @ingroup iface_wl_subcompositor
+ */
+#define WL_SUBCOMPOSITOR_DESTROY_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_subcompositor
+ */
+#define WL_SUBCOMPOSITOR_GET_SUBSURFACE_SINCE_VERSION 1
+
+/** @ingroup iface_wl_subcompositor */
+static inline void
+wl_subcompositor_set_user_data(struct wl_subcompositor *wl_subcompositor, void *user_data)
+{
+ wl_proxy_set_user_data((struct wl_proxy *) wl_subcompositor, user_data);
+}
+
+/** @ingroup iface_wl_subcompositor */
+static inline void *
+wl_subcompositor_get_user_data(struct wl_subcompositor *wl_subcompositor)
+{
+ return wl_proxy_get_user_data((struct wl_proxy *) wl_subcompositor);
+}
+
+static inline uint32_t
+wl_subcompositor_get_version(struct wl_subcompositor *wl_subcompositor)
+{
+ return wl_proxy_get_version((struct wl_proxy *) wl_subcompositor);
+}
+
+/**
+ * @ingroup iface_wl_subcompositor
+ *
+ * Informs the server that the client will not be using this
+ * protocol object anymore. This does not affect any other
+ * objects, wl_subsurface objects included.
+ */
+static inline void
+wl_subcompositor_destroy(struct wl_subcompositor *wl_subcompositor)
+{
+ wl_proxy_marshal((struct wl_proxy *) wl_subcompositor,
+ WL_SUBCOMPOSITOR_DESTROY);
+
+ wl_proxy_destroy((struct wl_proxy *) wl_subcompositor);
+}
+
+/**
+ * @ingroup iface_wl_subcompositor
+ *
+ * Create a sub-surface interface for the given surface, and
+ * associate it with the given parent surface. This turns a
+ * plain wl_surface into a sub-surface.
+ *
+ * The to-be sub-surface must not already have another role, and it
+ * must not have an existing wl_subsurface object. Otherwise a protocol
+ * error is raised.
+ */
+static inline struct wl_subsurface *
+wl_subcompositor_get_subsurface(struct wl_subcompositor *wl_subcompositor, struct wl_surface *surface, struct wl_surface *parent)
+{
+ struct wl_proxy *id;
+
+ id = wl_proxy_marshal_constructor((struct wl_proxy *) wl_subcompositor,
+ WL_SUBCOMPOSITOR_GET_SUBSURFACE, &wl_subsurface_interface, NULL, surface, parent);
+
+ return (struct wl_subsurface *) id;
+}
+
+#ifndef WL_SUBSURFACE_ERROR_ENUM
+#define WL_SUBSURFACE_ERROR_ENUM
+enum wl_subsurface_error {
+ /**
+ * wl_surface is not a sibling or the parent
+ */
+ WL_SUBSURFACE_ERROR_BAD_SURFACE = 0,
+};
+#endif /* WL_SUBSURFACE_ERROR_ENUM */
+
+#define WL_SUBSURFACE_DESTROY 0
+#define WL_SUBSURFACE_SET_POSITION 1
+#define WL_SUBSURFACE_PLACE_ABOVE 2
+#define WL_SUBSURFACE_PLACE_BELOW 3
+#define WL_SUBSURFACE_SET_SYNC 4
+#define WL_SUBSURFACE_SET_DESYNC 5
+
+
+/**
+ * @ingroup iface_wl_subsurface
+ */
+#define WL_SUBSURFACE_DESTROY_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_subsurface
+ */
+#define WL_SUBSURFACE_SET_POSITION_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_subsurface
+ */
+#define WL_SUBSURFACE_PLACE_ABOVE_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_subsurface
+ */
+#define WL_SUBSURFACE_PLACE_BELOW_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_subsurface
+ */
+#define WL_SUBSURFACE_SET_SYNC_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_subsurface
+ */
+#define WL_SUBSURFACE_SET_DESYNC_SINCE_VERSION 1
+
+/** @ingroup iface_wl_subsurface */
+static inline void
+wl_subsurface_set_user_data(struct wl_subsurface *wl_subsurface, void *user_data)
+{
+ wl_proxy_set_user_data((struct wl_proxy *) wl_subsurface, user_data);
+}
+
+/** @ingroup iface_wl_subsurface */
+static inline void *
+wl_subsurface_get_user_data(struct wl_subsurface *wl_subsurface)
+{
+ return wl_proxy_get_user_data((struct wl_proxy *) wl_subsurface);
+}
+
+static inline uint32_t
+wl_subsurface_get_version(struct wl_subsurface *wl_subsurface)
+{
+ return wl_proxy_get_version((struct wl_proxy *) wl_subsurface);
+}
+
+/**
+ * @ingroup iface_wl_subsurface
+ *
+ * The sub-surface interface is removed from the wl_surface object
+ * that was turned into a sub-surface with a
+ * wl_subcompositor.get_subsurface request. The wl_surface's association
+ * to the parent is deleted, and the wl_surface loses its role as
+ * a sub-surface. The wl_surface is unmapped.
+ */
+static inline void
+wl_subsurface_destroy(struct wl_subsurface *wl_subsurface)
+{
+ wl_proxy_marshal((struct wl_proxy *) wl_subsurface,
+ WL_SUBSURFACE_DESTROY);
+
+ wl_proxy_destroy((struct wl_proxy *) wl_subsurface);
+}
+
+/**
+ * @ingroup iface_wl_subsurface
+ *
+ * This schedules a sub-surface position change.
+ * The sub-surface will be moved so that its origin (top left
+ * corner pixel) will be at the location x, y of the parent surface
+ * coordinate system. The coordinates are not restricted to the parent
+ * surface area. Negative values are allowed.
+ *
+ * The scheduled coordinates will take effect whenever the state of the
+ * parent surface is applied. When this happens depends on whether the
+ * parent surface is in synchronized mode or not. See
+ * wl_subsurface.set_sync and wl_subsurface.set_desync for details.
+ *
+ * If more than one set_position request is invoked by the client before
+ * the commit of the parent surface, the position of a new request always
+ * replaces the scheduled position from any previous request.
+ *
+ * The initial position is 0, 0.
+ */
+static inline void
+wl_subsurface_set_position(struct wl_subsurface *wl_subsurface, int32_t x, int32_t y)
+{
+ wl_proxy_marshal((struct wl_proxy *) wl_subsurface,
+ WL_SUBSURFACE_SET_POSITION, x, y);
+}
+
+/**
+ * @ingroup iface_wl_subsurface
+ *
+ * This sub-surface is taken from the stack, and put back just
+ * above the reference surface, changing the z-order of the sub-surfaces.
+ * The reference surface must be one of the sibling surfaces, or the
+ * parent surface. Using any other surface, including this sub-surface,
+ * will cause a protocol error.
+ *
+ * The z-order is double-buffered. Requests are handled in order and
+ * applied immediately to a pending state. The final pending state is
+ * copied to the active state the next time the state of the parent
+ * surface is applied. When this happens depends on whether the parent
+ * surface is in synchronized mode or not. See wl_subsurface.set_sync and
+ * wl_subsurface.set_desync for details.
+ *
+ * A new sub-surface is initially added as the top-most in the stack
+ * of its siblings and parent.
+ */
+static inline void
+wl_subsurface_place_above(struct wl_subsurface *wl_subsurface, struct wl_surface *sibling)
+{
+ wl_proxy_marshal((struct wl_proxy *) wl_subsurface,
+ WL_SUBSURFACE_PLACE_ABOVE, sibling);
+}
+
+/**
+ * @ingroup iface_wl_subsurface
+ *
+ * The sub-surface is placed just below the reference surface.
+ * See wl_subsurface.place_above.
+ */
+static inline void
+wl_subsurface_place_below(struct wl_subsurface *wl_subsurface, struct wl_surface *sibling)
+{
+ wl_proxy_marshal((struct wl_proxy *) wl_subsurface,
+ WL_SUBSURFACE_PLACE_BELOW, sibling);
+}
+
+/**
+ * @ingroup iface_wl_subsurface
+ *
+ * Change the commit behaviour of the sub-surface to synchronized
+ * mode, also described as the parent dependent mode.
+ *
+ * In synchronized mode, wl_surface.commit on a sub-surface will
+ * accumulate the committed state in a cache, but the state will
+ * not be applied and hence will not change the compositor output.
+ * The cached state is applied to the sub-surface immediately after
+ * the parent surface's state is applied. This ensures atomic
+ * updates of the parent and all its synchronized sub-surfaces.
+ * Applying the cached state will invalidate the cache, so further
+ * parent surface commits do not (re-)apply old state.
+ *
+ * See wl_subsurface for the recursive effect of this mode.
+ */
+static inline void
+wl_subsurface_set_sync(struct wl_subsurface *wl_subsurface)
+{
+ wl_proxy_marshal((struct wl_proxy *) wl_subsurface,
+ WL_SUBSURFACE_SET_SYNC);
+}
+
+/**
+ * @ingroup iface_wl_subsurface
+ *
+ * Change the commit behaviour of the sub-surface to desynchronized
+ * mode, also described as independent or freely running mode.
+ *
+ * In desynchronized mode, wl_surface.commit on a sub-surface will
+ * apply the pending state directly, without caching, as happens
+ * normally with a wl_surface. Calling wl_surface.commit on the
+ * parent surface has no effect on the sub-surface's wl_surface
+ * state. This mode allows a sub-surface to be updated on its own.
+ *
+ * If cached state exists when wl_surface.commit is called in
+ * desynchronized mode, the pending state is added to the cached
+ * state, and applied as a whole. This invalidates the cache.
+ *
+ * Note: even if a sub-surface is set to desynchronized, a parent
+ * sub-surface may override it to behave as synchronized. For details,
+ * see wl_subsurface.
+ *
+ * If a surface's parent surface behaves as desynchronized, then
+ * the cached state is applied on set_desync.
+ */
+static inline void
+wl_subsurface_set_desync(struct wl_subsurface *wl_subsurface)
+{
+ wl_proxy_marshal((struct wl_proxy *) wl_subsurface,
+ WL_SUBSURFACE_SET_DESYNC);
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/chromium/third_party/wayland/include/protocol/wayland-client-protocol.h b/chromium/third_party/wayland/include/protocol/wayland-client-protocol.h
new file mode 100644
index 00000000000..07935344357
--- /dev/null
+++ b/chromium/third_party/wayland/include/protocol/wayland-client-protocol.h
@@ -0,0 +1,5587 @@
+/* Generated by wayland-scanner 1.13.0 */
+
+#ifndef WAYLAND_CLIENT_PROTOCOL_H
+#define WAYLAND_CLIENT_PROTOCOL_H
+
+#include <stdint.h>
+#include <stddef.h>
+#include "wayland-client.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+/**
+ * @page page_wayland The wayland protocol
+ * @section page_ifaces_wayland Interfaces
+ * - @subpage page_iface_wl_display - core global object
+ * - @subpage page_iface_wl_registry - global registry object
+ * - @subpage page_iface_wl_callback - callback object
+ * - @subpage page_iface_wl_compositor - the compositor singleton
+ * - @subpage page_iface_wl_shm_pool - a shared memory pool
+ * - @subpage page_iface_wl_shm - shared memory support
+ * - @subpage page_iface_wl_buffer - content for a wl_surface
+ * - @subpage page_iface_wl_data_offer - offer to transfer data
+ * - @subpage page_iface_wl_data_source - offer to transfer data
+ * - @subpage page_iface_wl_data_device - data transfer device
+ * - @subpage page_iface_wl_data_device_manager - data transfer interface
+ * - @subpage page_iface_wl_shell - create desktop-style surfaces
+ * - @subpage page_iface_wl_shell_surface - desktop-style metadata interface
+ * - @subpage page_iface_wl_surface - an onscreen surface
+ * - @subpage page_iface_wl_seat - group of input devices
+ * - @subpage page_iface_wl_pointer - pointer input device
+ * - @subpage page_iface_wl_keyboard - keyboard input device
+ * - @subpage page_iface_wl_touch - touchscreen input device
+ * - @subpage page_iface_wl_output - compositor output region
+ * - @subpage page_iface_wl_region - region interface
+ * - @subpage page_iface_wl_subcompositor - sub-surface compositing
+ * - @subpage page_iface_wl_subsurface - sub-surface interface to a wl_surface
+ * @section page_copyright_wayland Copyright
+ * <pre>
+ *
+ * Copyright © 2008-2011 Kristian Høgsberg
+ * Copyright © 2010-2011 Intel Corporation
+ * Copyright © 2012-2013 Collabora, Ltd.
+ *
+ * Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation files
+ * (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial
+ * portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ * </pre>
+ */
+struct wl_buffer;
+struct wl_callback;
+struct wl_compositor;
+struct wl_data_device;
+struct wl_data_device_manager;
+struct wl_data_offer;
+struct wl_data_source;
+struct wl_display;
+struct wl_keyboard;
+struct wl_output;
+struct wl_pointer;
+struct wl_region;
+struct wl_registry;
+struct wl_seat;
+struct wl_shell;
+struct wl_shell_surface;
+struct wl_shm;
+struct wl_shm_pool;
+struct wl_subcompositor;
+struct wl_subsurface;
+struct wl_surface;
+struct wl_touch;
+
+/**
+ * @page page_iface_wl_display wl_display
+ * @section page_iface_wl_display_desc Description
+ *
+ * The core global object. This is a special singleton object. It
+ * is used for internal Wayland protocol features.
+ * @section page_iface_wl_display_api API
+ * See @ref iface_wl_display.
+ */
+/**
+ * @defgroup iface_wl_display The wl_display interface
+ *
+ * The core global object. This is a special singleton object. It
+ * is used for internal Wayland protocol features.
+ */
+extern const struct wl_interface wl_display_interface;
+/**
+ * @page page_iface_wl_registry wl_registry
+ * @section page_iface_wl_registry_desc Description
+ *
+ * The singleton global registry object. The server has a number of
+ * global objects that are available to all clients. These objects
+ * typically represent an actual object in the server (for example,
+ * an input device) or they are singleton objects that provide
+ * extension functionality.
+ *
+ * When a client creates a registry object, the registry object
+ * will emit a global event for each global currently in the
+ * registry. Globals come and go as a result of device or
+ * monitor hotplugs, reconfiguration or other events, and the
+ * registry will send out global and global_remove events to
+ * keep the client up to date with the changes. To mark the end
+ * of the initial burst of events, the client can use the
+ * wl_display.sync request immediately after calling
+ * wl_display.get_registry.
+ *
+ * A client can bind to a global object by using the bind
+ * request. This creates a client-side handle that lets the object
+ * emit events to the client and lets the client invoke requests on
+ * the object.
+ * @section page_iface_wl_registry_api API
+ * See @ref iface_wl_registry.
+ */
+/**
+ * @defgroup iface_wl_registry The wl_registry interface
+ *
+ * The singleton global registry object. The server has a number of
+ * global objects that are available to all clients. These objects
+ * typically represent an actual object in the server (for example,
+ * an input device) or they are singleton objects that provide
+ * extension functionality.
+ *
+ * When a client creates a registry object, the registry object
+ * will emit a global event for each global currently in the
+ * registry. Globals come and go as a result of device or
+ * monitor hotplugs, reconfiguration or other events, and the
+ * registry will send out global and global_remove events to
+ * keep the client up to date with the changes. To mark the end
+ * of the initial burst of events, the client can use the
+ * wl_display.sync request immediately after calling
+ * wl_display.get_registry.
+ *
+ * A client can bind to a global object by using the bind
+ * request. This creates a client-side handle that lets the object
+ * emit events to the client and lets the client invoke requests on
+ * the object.
+ */
+extern const struct wl_interface wl_registry_interface;
+/**
+ * @page page_iface_wl_callback wl_callback
+ * @section page_iface_wl_callback_desc Description
+ *
+ * Clients can handle the 'done' event to get notified when
+ * the related request is done.
+ * @section page_iface_wl_callback_api API
+ * See @ref iface_wl_callback.
+ */
+/**
+ * @defgroup iface_wl_callback The wl_callback interface
+ *
+ * Clients can handle the 'done' event to get notified when
+ * the related request is done.
+ */
+extern const struct wl_interface wl_callback_interface;
+/**
+ * @page page_iface_wl_compositor wl_compositor
+ * @section page_iface_wl_compositor_desc Description
+ *
+ * A compositor. This object is a singleton global. The
+ * compositor is in charge of combining the contents of multiple
+ * surfaces into one displayable output.
+ * @section page_iface_wl_compositor_api API
+ * See @ref iface_wl_compositor.
+ */
+/**
+ * @defgroup iface_wl_compositor The wl_compositor interface
+ *
+ * A compositor. This object is a singleton global. The
+ * compositor is in charge of combining the contents of multiple
+ * surfaces into one displayable output.
+ */
+extern const struct wl_interface wl_compositor_interface;
+/**
+ * @page page_iface_wl_shm_pool wl_shm_pool
+ * @section page_iface_wl_shm_pool_desc Description
+ *
+ * The wl_shm_pool object encapsulates a piece of memory shared
+ * between the compositor and client. Through the wl_shm_pool
+ * object, the client can allocate shared memory wl_buffer objects.
+ * All objects created through the same pool share the same
+ * underlying mapped memory. Reusing the mapped memory avoids the
+ * setup/teardown overhead and is useful when interactively resizing
+ * a surface or for many small buffers.
+ * @section page_iface_wl_shm_pool_api API
+ * See @ref iface_wl_shm_pool.
+ */
+/**
+ * @defgroup iface_wl_shm_pool The wl_shm_pool interface
+ *
+ * The wl_shm_pool object encapsulates a piece of memory shared
+ * between the compositor and client. Through the wl_shm_pool
+ * object, the client can allocate shared memory wl_buffer objects.
+ * All objects created through the same pool share the same
+ * underlying mapped memory. Reusing the mapped memory avoids the
+ * setup/teardown overhead and is useful when interactively resizing
+ * a surface or for many small buffers.
+ */
+extern const struct wl_interface wl_shm_pool_interface;
+/**
+ * @page page_iface_wl_shm wl_shm
+ * @section page_iface_wl_shm_desc Description
+ *
+ * A singleton global object that provides support for shared
+ * memory.
+ *
+ * Clients can create wl_shm_pool objects using the create_pool
+ * request.
+ *
+ * At connection setup time, the wl_shm object emits one or more
+ * format events to inform clients about the valid pixel formats
+ * that can be used for buffers.
+ * @section page_iface_wl_shm_api API
+ * See @ref iface_wl_shm.
+ */
+/**
+ * @defgroup iface_wl_shm The wl_shm interface
+ *
+ * A singleton global object that provides support for shared
+ * memory.
+ *
+ * Clients can create wl_shm_pool objects using the create_pool
+ * request.
+ *
+ * At connection setup time, the wl_shm object emits one or more
+ * format events to inform clients about the valid pixel formats
+ * that can be used for buffers.
+ */
+extern const struct wl_interface wl_shm_interface;
+/**
+ * @page page_iface_wl_buffer wl_buffer
+ * @section page_iface_wl_buffer_desc Description
+ *
+ * A buffer provides the content for a wl_surface. Buffers are
+ * created through factory interfaces such as wl_drm, wl_shm or
+ * similar. It has a width and a height and can be attached to a
+ * wl_surface, but the mechanism by which a client provides and
+ * updates the contents is defined by the buffer factory interface.
+ * @section page_iface_wl_buffer_api API
+ * See @ref iface_wl_buffer.
+ */
+/**
+ * @defgroup iface_wl_buffer The wl_buffer interface
+ *
+ * A buffer provides the content for a wl_surface. Buffers are
+ * created through factory interfaces such as wl_drm, wl_shm or
+ * similar. It has a width and a height and can be attached to a
+ * wl_surface, but the mechanism by which a client provides and
+ * updates the contents is defined by the buffer factory interface.
+ */
+extern const struct wl_interface wl_buffer_interface;
+/**
+ * @page page_iface_wl_data_offer wl_data_offer
+ * @section page_iface_wl_data_offer_desc Description
+ *
+ * A wl_data_offer represents a piece of data offered for transfer
+ * by another client (the source client). It is used by the
+ * copy-and-paste and drag-and-drop mechanisms. The offer
+ * describes the different mime types that the data can be
+ * converted to and provides the mechanism for transferring the
+ * data directly from the source client.
+ * @section page_iface_wl_data_offer_api API
+ * See @ref iface_wl_data_offer.
+ */
+/**
+ * @defgroup iface_wl_data_offer The wl_data_offer interface
+ *
+ * A wl_data_offer represents a piece of data offered for transfer
+ * by another client (the source client). It is used by the
+ * copy-and-paste and drag-and-drop mechanisms. The offer
+ * describes the different mime types that the data can be
+ * converted to and provides the mechanism for transferring the
+ * data directly from the source client.
+ */
+extern const struct wl_interface wl_data_offer_interface;
+/**
+ * @page page_iface_wl_data_source wl_data_source
+ * @section page_iface_wl_data_source_desc Description
+ *
+ * The wl_data_source object is the source side of a wl_data_offer.
+ * It is created by the source client in a data transfer and
+ * provides a way to describe the offered data and a way to respond
+ * to requests to transfer the data.
+ * @section page_iface_wl_data_source_api API
+ * See @ref iface_wl_data_source.
+ */
+/**
+ * @defgroup iface_wl_data_source The wl_data_source interface
+ *
+ * The wl_data_source object is the source side of a wl_data_offer.
+ * It is created by the source client in a data transfer and
+ * provides a way to describe the offered data and a way to respond
+ * to requests to transfer the data.
+ */
+extern const struct wl_interface wl_data_source_interface;
+/**
+ * @page page_iface_wl_data_device wl_data_device
+ * @section page_iface_wl_data_device_desc Description
+ *
+ * There is one wl_data_device per seat which can be obtained
+ * from the global wl_data_device_manager singleton.
+ *
+ * A wl_data_device provides access to inter-client data transfer
+ * mechanisms such as copy-and-paste and drag-and-drop.
+ * @section page_iface_wl_data_device_api API
+ * See @ref iface_wl_data_device.
+ */
+/**
+ * @defgroup iface_wl_data_device The wl_data_device interface
+ *
+ * There is one wl_data_device per seat which can be obtained
+ * from the global wl_data_device_manager singleton.
+ *
+ * A wl_data_device provides access to inter-client data transfer
+ * mechanisms such as copy-and-paste and drag-and-drop.
+ */
+extern const struct wl_interface wl_data_device_interface;
+/**
+ * @page page_iface_wl_data_device_manager wl_data_device_manager
+ * @section page_iface_wl_data_device_manager_desc Description
+ *
+ * The wl_data_device_manager is a singleton global object that
+ * provides access to inter-client data transfer mechanisms such as
+ * copy-and-paste and drag-and-drop. These mechanisms are tied to
+ * a wl_seat and this interface lets a client get a wl_data_device
+ * corresponding to a wl_seat.
+ *
+ * Depending on the version bound, the objects created from the bound
+ * wl_data_device_manager object will have different requirements for
+ * functioning properly. See wl_data_source.set_actions,
+ * wl_data_offer.accept and wl_data_offer.finish for details.
+ * @section page_iface_wl_data_device_manager_api API
+ * See @ref iface_wl_data_device_manager.
+ */
+/**
+ * @defgroup iface_wl_data_device_manager The wl_data_device_manager interface
+ *
+ * The wl_data_device_manager is a singleton global object that
+ * provides access to inter-client data transfer mechanisms such as
+ * copy-and-paste and drag-and-drop. These mechanisms are tied to
+ * a wl_seat and this interface lets a client get a wl_data_device
+ * corresponding to a wl_seat.
+ *
+ * Depending on the version bound, the objects created from the bound
+ * wl_data_device_manager object will have different requirements for
+ * functioning properly. See wl_data_source.set_actions,
+ * wl_data_offer.accept and wl_data_offer.finish for details.
+ */
+extern const struct wl_interface wl_data_device_manager_interface;
+/**
+ * @page page_iface_wl_shell wl_shell
+ * @section page_iface_wl_shell_desc Description
+ *
+ * This interface is implemented by servers that provide
+ * desktop-style user interfaces.
+ *
+ * It allows clients to associate a wl_shell_surface with
+ * a basic surface.
+ * @section page_iface_wl_shell_api API
+ * See @ref iface_wl_shell.
+ */
+/**
+ * @defgroup iface_wl_shell The wl_shell interface
+ *
+ * This interface is implemented by servers that provide
+ * desktop-style user interfaces.
+ *
+ * It allows clients to associate a wl_shell_surface with
+ * a basic surface.
+ */
+extern const struct wl_interface wl_shell_interface;
+/**
+ * @page page_iface_wl_shell_surface wl_shell_surface
+ * @section page_iface_wl_shell_surface_desc Description
+ *
+ * An interface that may be implemented by a wl_surface, for
+ * implementations that provide a desktop-style user interface.
+ *
+ * It provides requests to treat surfaces like toplevel, fullscreen
+ * or popup windows, move, resize or maximize them, associate
+ * metadata like title and class, etc.
+ *
+ * On the server side the object is automatically destroyed when
+ * the related wl_surface is destroyed. On the client side,
+ * wl_shell_surface_destroy() must be called before destroying
+ * the wl_surface object.
+ * @section page_iface_wl_shell_surface_api API
+ * See @ref iface_wl_shell_surface.
+ */
+/**
+ * @defgroup iface_wl_shell_surface The wl_shell_surface interface
+ *
+ * An interface that may be implemented by a wl_surface, for
+ * implementations that provide a desktop-style user interface.
+ *
+ * It provides requests to treat surfaces like toplevel, fullscreen
+ * or popup windows, move, resize or maximize them, associate
+ * metadata like title and class, etc.
+ *
+ * On the server side the object is automatically destroyed when
+ * the related wl_surface is destroyed. On the client side,
+ * wl_shell_surface_destroy() must be called before destroying
+ * the wl_surface object.
+ */
+extern const struct wl_interface wl_shell_surface_interface;
+/**
+ * @page page_iface_wl_surface wl_surface
+ * @section page_iface_wl_surface_desc Description
+ *
+ * A surface is a rectangular area that is displayed on the screen.
+ * It has a location, size and pixel contents.
+ *
+ * The size of a surface (and relative positions on it) is described
+ * in surface-local coordinates, which may differ from the buffer
+ * coordinates of the pixel content, in case a buffer_transform
+ * or a buffer_scale is used.
+ *
+ * A surface without a "role" is fairly useless: a compositor does
+ * not know where, when or how to present it. The role is the
+ * purpose of a wl_surface. Examples of roles are a cursor for a
+ * pointer (as set by wl_pointer.set_cursor), a drag icon
+ * (wl_data_device.start_drag), a sub-surface
+ * (wl_subcompositor.get_subsurface), and a window as defined by a
+ * shell protocol (e.g. wl_shell.get_shell_surface).
+ *
+ * A surface can have only one role at a time. Initially a
+ * wl_surface does not have a role. Once a wl_surface is given a
+ * role, it is set permanently for the whole lifetime of the
+ * wl_surface object. Giving the current role again is allowed,
+ * unless explicitly forbidden by the relevant interface
+ * specification.
+ *
+ * Surface roles are given by requests in other interfaces such as
+ * wl_pointer.set_cursor. The request should explicitly mention
+ * that this request gives a role to a wl_surface. Often, this
+ * request also creates a new protocol object that represents the
+ * role and adds additional functionality to wl_surface. When a
+ * client wants to destroy a wl_surface, they must destroy this 'role
+ * object' before the wl_surface.
+ *
+ * Destroying the role object does not remove the role from the
+ * wl_surface, but it may stop the wl_surface from "playing the role".
+ * For instance, if a wl_subsurface object is destroyed, the wl_surface
+ * it was created for will be unmapped and forget its position and
+ * z-order. It is allowed to create a wl_subsurface for the same
+ * wl_surface again, but it is not allowed to use the wl_surface as
+ * a cursor (cursor is a different role than sub-surface, and role
+ * switching is not allowed).
+ * @section page_iface_wl_surface_api API
+ * See @ref iface_wl_surface.
+ */
+/**
+ * @defgroup iface_wl_surface The wl_surface interface
+ *
+ * A surface is a rectangular area that is displayed on the screen.
+ * It has a location, size and pixel contents.
+ *
+ * The size of a surface (and relative positions on it) is described
+ * in surface-local coordinates, which may differ from the buffer
+ * coordinates of the pixel content, in case a buffer_transform
+ * or a buffer_scale is used.
+ *
+ * A surface without a "role" is fairly useless: a compositor does
+ * not know where, when or how to present it. The role is the
+ * purpose of a wl_surface. Examples of roles are a cursor for a
+ * pointer (as set by wl_pointer.set_cursor), a drag icon
+ * (wl_data_device.start_drag), a sub-surface
+ * (wl_subcompositor.get_subsurface), and a window as defined by a
+ * shell protocol (e.g. wl_shell.get_shell_surface).
+ *
+ * A surface can have only one role at a time. Initially a
+ * wl_surface does not have a role. Once a wl_surface is given a
+ * role, it is set permanently for the whole lifetime of the
+ * wl_surface object. Giving the current role again is allowed,
+ * unless explicitly forbidden by the relevant interface
+ * specification.
+ *
+ * Surface roles are given by requests in other interfaces such as
+ * wl_pointer.set_cursor. The request should explicitly mention
+ * that this request gives a role to a wl_surface. Often, this
+ * request also creates a new protocol object that represents the
+ * role and adds additional functionality to wl_surface. When a
+ * client wants to destroy a wl_surface, they must destroy this 'role
+ * object' before the wl_surface.
+ *
+ * Destroying the role object does not remove the role from the
+ * wl_surface, but it may stop the wl_surface from "playing the role".
+ * For instance, if a wl_subsurface object is destroyed, the wl_surface
+ * it was created for will be unmapped and forget its position and
+ * z-order. It is allowed to create a wl_subsurface for the same
+ * wl_surface again, but it is not allowed to use the wl_surface as
+ * a cursor (cursor is a different role than sub-surface, and role
+ * switching is not allowed).
+ */
+extern const struct wl_interface wl_surface_interface;
+/**
+ * @page page_iface_wl_seat wl_seat
+ * @section page_iface_wl_seat_desc Description
+ *
+ * A seat is a group of keyboards, pointer and touch devices. This
+ * object is published as a global during start up, or when such a
+ * device is hot plugged. A seat typically has a pointer and
+ * maintains a keyboard focus and a pointer focus.
+ * @section page_iface_wl_seat_api API
+ * See @ref iface_wl_seat.
+ */
+/**
+ * @defgroup iface_wl_seat The wl_seat interface
+ *
+ * A seat is a group of keyboards, pointer and touch devices. This
+ * object is published as a global during start up, or when such a
+ * device is hot plugged. A seat typically has a pointer and
+ * maintains a keyboard focus and a pointer focus.
+ */
+extern const struct wl_interface wl_seat_interface;
+/**
+ * @page page_iface_wl_pointer wl_pointer
+ * @section page_iface_wl_pointer_desc Description
+ *
+ * The wl_pointer interface represents one or more input devices,
+ * such as mice, which control the pointer location and pointer_focus
+ * of a seat.
+ *
+ * The wl_pointer interface generates motion, enter and leave
+ * events for the surfaces that the pointer is located over,
+ * and button and axis events for button presses, button releases
+ * and scrolling.
+ * @section page_iface_wl_pointer_api API
+ * See @ref iface_wl_pointer.
+ */
+/**
+ * @defgroup iface_wl_pointer The wl_pointer interface
+ *
+ * The wl_pointer interface represents one or more input devices,
+ * such as mice, which control the pointer location and pointer_focus
+ * of a seat.
+ *
+ * The wl_pointer interface generates motion, enter and leave
+ * events for the surfaces that the pointer is located over,
+ * and button and axis events for button presses, button releases
+ * and scrolling.
+ */
+extern const struct wl_interface wl_pointer_interface;
+/**
+ * @page page_iface_wl_keyboard wl_keyboard
+ * @section page_iface_wl_keyboard_desc Description
+ *
+ * The wl_keyboard interface represents one or more keyboards
+ * associated with a seat.
+ * @section page_iface_wl_keyboard_api API
+ * See @ref iface_wl_keyboard.
+ */
+/**
+ * @defgroup iface_wl_keyboard The wl_keyboard interface
+ *
+ * The wl_keyboard interface represents one or more keyboards
+ * associated with a seat.
+ */
+extern const struct wl_interface wl_keyboard_interface;
+/**
+ * @page page_iface_wl_touch wl_touch
+ * @section page_iface_wl_touch_desc Description
+ *
+ * The wl_touch interface represents a touchscreen
+ * associated with a seat.
+ *
+ * Touch interactions can consist of one or more contacts.
+ * For each contact, a series of events is generated, starting
+ * with a down event, followed by zero or more motion events,
+ * and ending with an up event. Events relating to the same
+ * contact point can be identified by the ID of the sequence.
+ * @section page_iface_wl_touch_api API
+ * See @ref iface_wl_touch.
+ */
+/**
+ * @defgroup iface_wl_touch The wl_touch interface
+ *
+ * The wl_touch interface represents a touchscreen
+ * associated with a seat.
+ *
+ * Touch interactions can consist of one or more contacts.
+ * For each contact, a series of events is generated, starting
+ * with a down event, followed by zero or more motion events,
+ * and ending with an up event. Events relating to the same
+ * contact point can be identified by the ID of the sequence.
+ */
+extern const struct wl_interface wl_touch_interface;
+/**
+ * @page page_iface_wl_output wl_output
+ * @section page_iface_wl_output_desc Description
+ *
+ * An output describes part of the compositor geometry. The
+ * compositor works in the 'compositor coordinate system' and an
+ * output corresponds to a rectangular area in that space that is
+ * actually visible. This typically corresponds to a monitor that
+ * displays part of the compositor space. This object is published
+ * as global during start up, or when a monitor is hotplugged.
+ * @section page_iface_wl_output_api API
+ * See @ref iface_wl_output.
+ */
+/**
+ * @defgroup iface_wl_output The wl_output interface
+ *
+ * An output describes part of the compositor geometry. The
+ * compositor works in the 'compositor coordinate system' and an
+ * output corresponds to a rectangular area in that space that is
+ * actually visible. This typically corresponds to a monitor that
+ * displays part of the compositor space. This object is published
+ * as global during start up, or when a monitor is hotplugged.
+ */
+extern const struct wl_interface wl_output_interface;
+/**
+ * @page page_iface_wl_region wl_region
+ * @section page_iface_wl_region_desc Description
+ *
+ * A region object describes an area.
+ *
+ * Region objects are used to describe the opaque and input
+ * regions of a surface.
+ * @section page_iface_wl_region_api API
+ * See @ref iface_wl_region.
+ */
+/**
+ * @defgroup iface_wl_region The wl_region interface
+ *
+ * A region object describes an area.
+ *
+ * Region objects are used to describe the opaque and input
+ * regions of a surface.
+ */
+extern const struct wl_interface wl_region_interface;
+/**
+ * @page page_iface_wl_subcompositor wl_subcompositor
+ * @section page_iface_wl_subcompositor_desc Description
+ *
+ * The global interface exposing sub-surface compositing capabilities.
+ * A wl_surface, that has sub-surfaces associated, is called the
+ * parent surface. Sub-surfaces can be arbitrarily nested and create
+ * a tree of sub-surfaces.
+ *
+ * The root surface in a tree of sub-surfaces is the main
+ * surface. The main surface cannot be a sub-surface, because
+ * sub-surfaces must always have a parent.
+ *
+ * A main surface with its sub-surfaces forms a (compound) window.
+ * For window management purposes, this set of wl_surface objects is
+ * to be considered as a single window, and it should also behave as
+ * such.
+ *
+ * The aim of sub-surfaces is to offload some of the compositing work
+ * within a window from clients to the compositor. A prime example is
+ * a video player with decorations and video in separate wl_surface
+ * objects. This should allow the compositor to pass YUV video buffer
+ * processing to dedicated overlay hardware when possible.
+ * @section page_iface_wl_subcompositor_api API
+ * See @ref iface_wl_subcompositor.
+ */
+/**
+ * @defgroup iface_wl_subcompositor The wl_subcompositor interface
+ *
+ * The global interface exposing sub-surface compositing capabilities.
+ * A wl_surface, that has sub-surfaces associated, is called the
+ * parent surface. Sub-surfaces can be arbitrarily nested and create
+ * a tree of sub-surfaces.
+ *
+ * The root surface in a tree of sub-surfaces is the main
+ * surface. The main surface cannot be a sub-surface, because
+ * sub-surfaces must always have a parent.
+ *
+ * A main surface with its sub-surfaces forms a (compound) window.
+ * For window management purposes, this set of wl_surface objects is
+ * to be considered as a single window, and it should also behave as
+ * such.
+ *
+ * The aim of sub-surfaces is to offload some of the compositing work
+ * within a window from clients to the compositor. A prime example is
+ * a video player with decorations and video in separate wl_surface
+ * objects. This should allow the compositor to pass YUV video buffer
+ * processing to dedicated overlay hardware when possible.
+ */
+extern const struct wl_interface wl_subcompositor_interface;
+/**
+ * @page page_iface_wl_subsurface wl_subsurface
+ * @section page_iface_wl_subsurface_desc Description
+ *
+ * An additional interface to a wl_surface object, which has been
+ * made a sub-surface. A sub-surface has one parent surface. A
+ * sub-surface's size and position are not limited to that of the parent.
+ * Particularly, a sub-surface is not automatically clipped to its
+ * parent's area.
+ *
+ * A sub-surface becomes mapped, when a non-NULL wl_buffer is applied
+ * and the parent surface is mapped. The order of which one happens
+ * first is irrelevant. A sub-surface is hidden if the parent becomes
+ * hidden, or if a NULL wl_buffer is applied. These rules apply
+ * recursively through the tree of surfaces.
+ *
+ * The behaviour of a wl_surface.commit request on a sub-surface
+ * depends on the sub-surface's mode. The possible modes are
+ * synchronized and desynchronized, see methods
+ * wl_subsurface.set_sync and wl_subsurface.set_desync. Synchronized
+ * mode caches the wl_surface state to be applied when the parent's
+ * state gets applied, and desynchronized mode applies the pending
+ * wl_surface state directly. A sub-surface is initially in the
+ * synchronized mode.
+ *
+ * Sub-surfaces have also other kind of state, which is managed by
+ * wl_subsurface requests, as opposed to wl_surface requests. This
+ * state includes the sub-surface position relative to the parent
+ * surface (wl_subsurface.set_position), and the stacking order of
+ * the parent and its sub-surfaces (wl_subsurface.place_above and
+ * .place_below). This state is applied when the parent surface's
+ * wl_surface state is applied, regardless of the sub-surface's mode.
+ * As the exception, set_sync and set_desync are effective immediately.
+ *
+ * The main surface can be thought to be always in desynchronized mode,
+ * since it does not have a parent in the sub-surfaces sense.
+ *
+ * Even if a sub-surface is in desynchronized mode, it will behave as
+ * in synchronized mode, if its parent surface behaves as in
+ * synchronized mode. This rule is applied recursively throughout the
+ * tree of surfaces. This means, that one can set a sub-surface into
+ * synchronized mode, and then assume that all its child and grand-child
+ * sub-surfaces are synchronized, too, without explicitly setting them.
+ *
+ * If the wl_surface associated with the wl_subsurface is destroyed, the
+ * wl_subsurface object becomes inert. Note, that destroying either object
+ * takes effect immediately. If you need to synchronize the removal
+ * of a sub-surface to the parent surface update, unmap the sub-surface
+ * first by attaching a NULL wl_buffer, update parent, and then destroy
+ * the sub-surface.
+ *
+ * If the parent wl_surface object is destroyed, the sub-surface is
+ * unmapped.
+ * @section page_iface_wl_subsurface_api API
+ * See @ref iface_wl_subsurface.
+ */
+/**
+ * @defgroup iface_wl_subsurface The wl_subsurface interface
+ *
+ * An additional interface to a wl_surface object, which has been
+ * made a sub-surface. A sub-surface has one parent surface. A
+ * sub-surface's size and position are not limited to that of the parent.
+ * Particularly, a sub-surface is not automatically clipped to its
+ * parent's area.
+ *
+ * A sub-surface becomes mapped, when a non-NULL wl_buffer is applied
+ * and the parent surface is mapped. The order of which one happens
+ * first is irrelevant. A sub-surface is hidden if the parent becomes
+ * hidden, or if a NULL wl_buffer is applied. These rules apply
+ * recursively through the tree of surfaces.
+ *
+ * The behaviour of a wl_surface.commit request on a sub-surface
+ * depends on the sub-surface's mode. The possible modes are
+ * synchronized and desynchronized, see methods
+ * wl_subsurface.set_sync and wl_subsurface.set_desync. Synchronized
+ * mode caches the wl_surface state to be applied when the parent's
+ * state gets applied, and desynchronized mode applies the pending
+ * wl_surface state directly. A sub-surface is initially in the
+ * synchronized mode.
+ *
+ * Sub-surfaces have also other kind of state, which is managed by
+ * wl_subsurface requests, as opposed to wl_surface requests. This
+ * state includes the sub-surface position relative to the parent
+ * surface (wl_subsurface.set_position), and the stacking order of
+ * the parent and its sub-surfaces (wl_subsurface.place_above and
+ * .place_below). This state is applied when the parent surface's
+ * wl_surface state is applied, regardless of the sub-surface's mode.
+ * As the exception, set_sync and set_desync are effective immediately.
+ *
+ * The main surface can be thought to be always in desynchronized mode,
+ * since it does not have a parent in the sub-surfaces sense.
+ *
+ * Even if a sub-surface is in desynchronized mode, it will behave as
+ * in synchronized mode, if its parent surface behaves as in
+ * synchronized mode. This rule is applied recursively throughout the
+ * tree of surfaces. This means, that one can set a sub-surface into
+ * synchronized mode, and then assume that all its child and grand-child
+ * sub-surfaces are synchronized, too, without explicitly setting them.
+ *
+ * If the wl_surface associated with the wl_subsurface is destroyed, the
+ * wl_subsurface object becomes inert. Note, that destroying either object
+ * takes effect immediately. If you need to synchronize the removal
+ * of a sub-surface to the parent surface update, unmap the sub-surface
+ * first by attaching a NULL wl_buffer, update parent, and then destroy
+ * the sub-surface.
+ *
+ * If the parent wl_surface object is destroyed, the sub-surface is
+ * unmapped.
+ */
+extern const struct wl_interface wl_subsurface_interface;
+
+#ifndef WL_DISPLAY_ERROR_ENUM
+#define WL_DISPLAY_ERROR_ENUM
+/**
+ * @ingroup iface_wl_display
+ * global error values
+ *
+ * These errors are global and can be emitted in response to any
+ * server request.
+ */
+enum wl_display_error {
+ /**
+ * server couldn't find object
+ */
+ WL_DISPLAY_ERROR_INVALID_OBJECT = 0,
+ /**
+ * method doesn't exist on the specified interface
+ */
+ WL_DISPLAY_ERROR_INVALID_METHOD = 1,
+ /**
+ * server is out of memory
+ */
+ WL_DISPLAY_ERROR_NO_MEMORY = 2,
+};
+#endif /* WL_DISPLAY_ERROR_ENUM */
+
+/**
+ * @ingroup iface_wl_display
+ * @struct wl_display_listener
+ */
+struct wl_display_listener {
+ /**
+ * fatal error event
+ *
+ * The error event is sent out when a fatal (non-recoverable)
+ * error has occurred. The object_id argument is the object where
+ * the error occurred, most often in response to a request to that
+ * object. The code identifies the error and is defined by the
+ * object interface. As such, each interface defines its own set of
+ * error codes. The message is a brief description of the error,
+ * for (debugging) convenience.
+ * @param object_id object where the error occurred
+ * @param code error code
+ * @param message error description
+ */
+ void (*error)(void *data,
+ struct wl_display *wl_display,
+ void *object_id,
+ uint32_t code,
+ const char *message);
+ /**
+ * acknowledge object ID deletion
+ *
+ * This event is used internally by the object ID management
+ * logic. When a client deletes an object, the server will send
+ * this event to acknowledge that it has seen the delete request.
+ * When the client receives this event, it will know that it can
+ * safely reuse the object ID.
+ * @param id deleted object ID
+ */
+ void (*delete_id)(void *data,
+ struct wl_display *wl_display,
+ uint32_t id);
+};
+
+/**
+ * @ingroup iface_wl_display
+ */
+static inline int
+wl_display_add_listener(struct wl_display *wl_display,
+ const struct wl_display_listener *listener, void *data)
+{
+ return wl_proxy_add_listener((struct wl_proxy *) wl_display,
+ (void (**)(void)) listener, data);
+}
+
+#define WL_DISPLAY_SYNC 0
+#define WL_DISPLAY_GET_REGISTRY 1
+
+/**
+ * @ingroup iface_wl_display
+ */
+#define WL_DISPLAY_ERROR_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_display
+ */
+#define WL_DISPLAY_DELETE_ID_SINCE_VERSION 1
+
+/**
+ * @ingroup iface_wl_display
+ */
+#define WL_DISPLAY_SYNC_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_display
+ */
+#define WL_DISPLAY_GET_REGISTRY_SINCE_VERSION 1
+
+/** @ingroup iface_wl_display */
+static inline void
+wl_display_set_user_data(struct wl_display *wl_display, void *user_data)
+{
+ wl_proxy_set_user_data((struct wl_proxy *) wl_display, user_data);
+}
+
+/** @ingroup iface_wl_display */
+static inline void *
+wl_display_get_user_data(struct wl_display *wl_display)
+{
+ return wl_proxy_get_user_data((struct wl_proxy *) wl_display);
+}
+
+static inline uint32_t
+wl_display_get_version(struct wl_display *wl_display)
+{
+ return wl_proxy_get_version((struct wl_proxy *) wl_display);
+}
+
+/**
+ * @ingroup iface_wl_display
+ *
+ * The sync request asks the server to emit the 'done' event
+ * on the returned wl_callback object. Since requests are
+ * handled in-order and events are delivered in-order, this can
+ * be used as a barrier to ensure all previous requests and the
+ * resulting events have been handled.
+ *
+ * The object returned by this request will be destroyed by the
+ * compositor after the callback is fired and as such the client must not
+ * attempt to use it after that point.
+ *
+ * The callback_data passed in the callback is the event serial.
+ */
+static inline struct wl_callback *
+wl_display_sync(struct wl_display *wl_display)
+{
+ struct wl_proxy *callback;
+
+ callback = wl_proxy_marshal_constructor((struct wl_proxy *) wl_display,
+ WL_DISPLAY_SYNC, &wl_callback_interface, NULL);
+
+ return (struct wl_callback *) callback;
+}
+
+/**
+ * @ingroup iface_wl_display
+ *
+ * This request creates a registry object that allows the client
+ * to list and bind the global objects available from the
+ * compositor.
+ */
+static inline struct wl_registry *
+wl_display_get_registry(struct wl_display *wl_display)
+{
+ struct wl_proxy *registry;
+
+ registry = wl_proxy_marshal_constructor((struct wl_proxy *) wl_display,
+ WL_DISPLAY_GET_REGISTRY, &wl_registry_interface, NULL);
+
+ return (struct wl_registry *) registry;
+}
+
+/**
+ * @ingroup iface_wl_registry
+ * @struct wl_registry_listener
+ */
+struct wl_registry_listener {
+ /**
+ * announce global object
+ *
+ * Notify the client of global objects.
+ *
+ * The event notifies the client that a global object with the
+ * given name is now available, and it implements the given version
+ * of the given interface.
+ * @param name numeric name of the global object
+ * @param interface interface implemented by the object
+ * @param version interface version
+ */
+ void (*global)(void *data,
+ struct wl_registry *wl_registry,
+ uint32_t name,
+ const char *interface,
+ uint32_t version);
+ /**
+ * announce removal of global object
+ *
+ * Notify the client of removed global objects.
+ *
+ * This event notifies the client that the global identified by
+ * name is no longer available. If the client bound to the global
+ * using the bind request, the client should now destroy that
+ * object.
+ *
+ * The object remains valid and requests to the object will be
+ * ignored until the client destroys it, to avoid races between the
+ * global going away and a client sending a request to it.
+ * @param name numeric name of the global object
+ */
+ void (*global_remove)(void *data,
+ struct wl_registry *wl_registry,
+ uint32_t name);
+};
+
+/**
+ * @ingroup iface_wl_registry
+ */
+static inline int
+wl_registry_add_listener(struct wl_registry *wl_registry,
+ const struct wl_registry_listener *listener, void *data)
+{
+ return wl_proxy_add_listener((struct wl_proxy *) wl_registry,
+ (void (**)(void)) listener, data);
+}
+
+#define WL_REGISTRY_BIND 0
+
+/**
+ * @ingroup iface_wl_registry
+ */
+#define WL_REGISTRY_GLOBAL_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_registry
+ */
+#define WL_REGISTRY_GLOBAL_REMOVE_SINCE_VERSION 1
+
+/**
+ * @ingroup iface_wl_registry
+ */
+#define WL_REGISTRY_BIND_SINCE_VERSION 1
+
+/** @ingroup iface_wl_registry */
+static inline void
+wl_registry_set_user_data(struct wl_registry *wl_registry, void *user_data)
+{
+ wl_proxy_set_user_data((struct wl_proxy *) wl_registry, user_data);
+}
+
+/** @ingroup iface_wl_registry */
+static inline void *
+wl_registry_get_user_data(struct wl_registry *wl_registry)
+{
+ return wl_proxy_get_user_data((struct wl_proxy *) wl_registry);
+}
+
+static inline uint32_t
+wl_registry_get_version(struct wl_registry *wl_registry)
+{
+ return wl_proxy_get_version((struct wl_proxy *) wl_registry);
+}
+
+/** @ingroup iface_wl_registry */
+static inline void
+wl_registry_destroy(struct wl_registry *wl_registry)
+{
+ wl_proxy_destroy((struct wl_proxy *) wl_registry);
+}
+
+/**
+ * @ingroup iface_wl_registry
+ *
+ * Binds a new, client-created object to the server using the
+ * specified name as the identifier.
+ */
+static inline void *
+wl_registry_bind(struct wl_registry *wl_registry, uint32_t name, const struct wl_interface *interface, uint32_t version)
+{
+ struct wl_proxy *id;
+
+ id = wl_proxy_marshal_constructor_versioned((struct wl_proxy *) wl_registry,
+ WL_REGISTRY_BIND, interface, version, name, interface->name, version, NULL);
+
+ return (void *) id;
+}
+
+/**
+ * @ingroup iface_wl_callback
+ * @struct wl_callback_listener
+ */
+struct wl_callback_listener {
+ /**
+ * done event
+ *
+ * Notify the client when the related request is done.
+ * @param callback_data request-specific data for the callback
+ */
+ void (*done)(void *data,
+ struct wl_callback *wl_callback,
+ uint32_t callback_data);
+};
+
+/**
+ * @ingroup iface_wl_callback
+ */
+static inline int
+wl_callback_add_listener(struct wl_callback *wl_callback,
+ const struct wl_callback_listener *listener, void *data)
+{
+ return wl_proxy_add_listener((struct wl_proxy *) wl_callback,
+ (void (**)(void)) listener, data);
+}
+
+/**
+ * @ingroup iface_wl_callback
+ */
+#define WL_CALLBACK_DONE_SINCE_VERSION 1
+
+
+/** @ingroup iface_wl_callback */
+static inline void
+wl_callback_set_user_data(struct wl_callback *wl_callback, void *user_data)
+{
+ wl_proxy_set_user_data((struct wl_proxy *) wl_callback, user_data);
+}
+
+/** @ingroup iface_wl_callback */
+static inline void *
+wl_callback_get_user_data(struct wl_callback *wl_callback)
+{
+ return wl_proxy_get_user_data((struct wl_proxy *) wl_callback);
+}
+
+static inline uint32_t
+wl_callback_get_version(struct wl_callback *wl_callback)
+{
+ return wl_proxy_get_version((struct wl_proxy *) wl_callback);
+}
+
+/** @ingroup iface_wl_callback */
+static inline void
+wl_callback_destroy(struct wl_callback *wl_callback)
+{
+ wl_proxy_destroy((struct wl_proxy *) wl_callback);
+}
+
+#define WL_COMPOSITOR_CREATE_SURFACE 0
+#define WL_COMPOSITOR_CREATE_REGION 1
+
+
+/**
+ * @ingroup iface_wl_compositor
+ */
+#define WL_COMPOSITOR_CREATE_SURFACE_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_compositor
+ */
+#define WL_COMPOSITOR_CREATE_REGION_SINCE_VERSION 1
+
+/** @ingroup iface_wl_compositor */
+static inline void
+wl_compositor_set_user_data(struct wl_compositor *wl_compositor, void *user_data)
+{
+ wl_proxy_set_user_data((struct wl_proxy *) wl_compositor, user_data);
+}
+
+/** @ingroup iface_wl_compositor */
+static inline void *
+wl_compositor_get_user_data(struct wl_compositor *wl_compositor)
+{
+ return wl_proxy_get_user_data((struct wl_proxy *) wl_compositor);
+}
+
+static inline uint32_t
+wl_compositor_get_version(struct wl_compositor *wl_compositor)
+{
+ return wl_proxy_get_version((struct wl_proxy *) wl_compositor);
+}
+
+/** @ingroup iface_wl_compositor */
+static inline void
+wl_compositor_destroy(struct wl_compositor *wl_compositor)
+{
+ wl_proxy_destroy((struct wl_proxy *) wl_compositor);
+}
+
+/**
+ * @ingroup iface_wl_compositor
+ *
+ * Ask the compositor to create a new surface.
+ */
+static inline struct wl_surface *
+wl_compositor_create_surface(struct wl_compositor *wl_compositor)
+{
+ struct wl_proxy *id;
+
+ id = wl_proxy_marshal_constructor((struct wl_proxy *) wl_compositor,
+ WL_COMPOSITOR_CREATE_SURFACE, &wl_surface_interface, NULL);
+
+ return (struct wl_surface *) id;
+}
+
+/**
+ * @ingroup iface_wl_compositor
+ *
+ * Ask the compositor to create a new region.
+ */
+static inline struct wl_region *
+wl_compositor_create_region(struct wl_compositor *wl_compositor)
+{
+ struct wl_proxy *id;
+
+ id = wl_proxy_marshal_constructor((struct wl_proxy *) wl_compositor,
+ WL_COMPOSITOR_CREATE_REGION, &wl_region_interface, NULL);
+
+ return (struct wl_region *) id;
+}
+
+#define WL_SHM_POOL_CREATE_BUFFER 0
+#define WL_SHM_POOL_DESTROY 1
+#define WL_SHM_POOL_RESIZE 2
+
+
+/**
+ * @ingroup iface_wl_shm_pool
+ */
+#define WL_SHM_POOL_CREATE_BUFFER_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_shm_pool
+ */
+#define WL_SHM_POOL_DESTROY_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_shm_pool
+ */
+#define WL_SHM_POOL_RESIZE_SINCE_VERSION 1
+
+/** @ingroup iface_wl_shm_pool */
+static inline void
+wl_shm_pool_set_user_data(struct wl_shm_pool *wl_shm_pool, void *user_data)
+{
+ wl_proxy_set_user_data((struct wl_proxy *) wl_shm_pool, user_data);
+}
+
+/** @ingroup iface_wl_shm_pool */
+static inline void *
+wl_shm_pool_get_user_data(struct wl_shm_pool *wl_shm_pool)
+{
+ return wl_proxy_get_user_data((struct wl_proxy *) wl_shm_pool);
+}
+
+static inline uint32_t
+wl_shm_pool_get_version(struct wl_shm_pool *wl_shm_pool)
+{
+ return wl_proxy_get_version((struct wl_proxy *) wl_shm_pool);
+}
+
+/**
+ * @ingroup iface_wl_shm_pool
+ *
+ * Create a wl_buffer object from the pool.
+ *
+ * The buffer is created offset bytes into the pool and has
+ * width and height as specified. The stride argument specifies
+ * the number of bytes from the beginning of one row to the beginning
+ * of the next. The format is the pixel format of the buffer and
+ * must be one of those advertised through the wl_shm.format event.
+ *
+ * A buffer will keep a reference to the pool it was created from
+ * so it is valid to destroy the pool immediately after creating
+ * a buffer from it.
+ */
+static inline struct wl_buffer *
+wl_shm_pool_create_buffer(struct wl_shm_pool *wl_shm_pool, int32_t offset, int32_t width, int32_t height, int32_t stride, uint32_t format)
+{
+ struct wl_proxy *id;
+
+ id = wl_proxy_marshal_constructor((struct wl_proxy *) wl_shm_pool,
+ WL_SHM_POOL_CREATE_BUFFER, &wl_buffer_interface, NULL, offset, width, height, stride, format);
+
+ return (struct wl_buffer *) id;
+}
+
+/**
+ * @ingroup iface_wl_shm_pool
+ *
+ * Destroy the shared memory pool.
+ *
+ * The mmapped memory will be released when all
+ * buffers that have been created from this pool
+ * are gone.
+ */
+static inline void
+wl_shm_pool_destroy(struct wl_shm_pool *wl_shm_pool)
+{
+ wl_proxy_marshal((struct wl_proxy *) wl_shm_pool,
+ WL_SHM_POOL_DESTROY);
+
+ wl_proxy_destroy((struct wl_proxy *) wl_shm_pool);
+}
+
+/**
+ * @ingroup iface_wl_shm_pool
+ *
+ * This request will cause the server to remap the backing memory
+ * for the pool from the file descriptor passed when the pool was
+ * created, but using the new size. This request can only be
+ * used to make the pool bigger.
+ */
+static inline void
+wl_shm_pool_resize(struct wl_shm_pool *wl_shm_pool, int32_t size)
+{
+ wl_proxy_marshal((struct wl_proxy *) wl_shm_pool,
+ WL_SHM_POOL_RESIZE, size);
+}
+
+#ifndef WL_SHM_ERROR_ENUM
+#define WL_SHM_ERROR_ENUM
+/**
+ * @ingroup iface_wl_shm
+ * wl_shm error values
+ *
+ * These errors can be emitted in response to wl_shm requests.
+ */
+enum wl_shm_error {
+ /**
+ * buffer format is not known
+ */
+ WL_SHM_ERROR_INVALID_FORMAT = 0,
+ /**
+ * invalid size or stride during pool or buffer creation
+ */
+ WL_SHM_ERROR_INVALID_STRIDE = 1,
+ /**
+ * mmapping the file descriptor failed
+ */
+ WL_SHM_ERROR_INVALID_FD = 2,
+};
+#endif /* WL_SHM_ERROR_ENUM */
+
+#ifndef WL_SHM_FORMAT_ENUM
+#define WL_SHM_FORMAT_ENUM
+/**
+ * @ingroup iface_wl_shm
+ * pixel formats
+ *
+ * This describes the memory layout of an individual pixel.
+ *
+ * All renderers should support argb8888 and xrgb8888 but any other
+ * formats are optional and may not be supported by the particular
+ * renderer in use.
+ *
+ * The drm format codes match the macros defined in drm_fourcc.h.
+ * The formats actually supported by the compositor will be
+ * reported by the format event.
+ */
+enum wl_shm_format {
+ /**
+ * 32-bit ARGB format, [31:0] A:R:G:B 8:8:8:8 little endian
+ */
+ WL_SHM_FORMAT_ARGB8888 = 0,
+ /**
+ * 32-bit RGB format, [31:0] x:R:G:B 8:8:8:8 little endian
+ */
+ WL_SHM_FORMAT_XRGB8888 = 1,
+ /**
+ * 8-bit color index format, [7:0] C
+ */
+ WL_SHM_FORMAT_C8 = 0x20203843,
+ /**
+ * 8-bit RGB format, [7:0] R:G:B 3:3:2
+ */
+ WL_SHM_FORMAT_RGB332 = 0x38424752,
+ /**
+ * 8-bit BGR format, [7:0] B:G:R 2:3:3
+ */
+ WL_SHM_FORMAT_BGR233 = 0x38524742,
+ /**
+ * 16-bit xRGB format, [15:0] x:R:G:B 4:4:4:4 little endian
+ */
+ WL_SHM_FORMAT_XRGB4444 = 0x32315258,
+ /**
+ * 16-bit xBGR format, [15:0] x:B:G:R 4:4:4:4 little endian
+ */
+ WL_SHM_FORMAT_XBGR4444 = 0x32314258,
+ /**
+ * 16-bit RGBx format, [15:0] R:G:B:x 4:4:4:4 little endian
+ */
+ WL_SHM_FORMAT_RGBX4444 = 0x32315852,
+ /**
+ * 16-bit BGRx format, [15:0] B:G:R:x 4:4:4:4 little endian
+ */
+ WL_SHM_FORMAT_BGRX4444 = 0x32315842,
+ /**
+ * 16-bit ARGB format, [15:0] A:R:G:B 4:4:4:4 little endian
+ */
+ WL_SHM_FORMAT_ARGB4444 = 0x32315241,
+ /**
+ * 16-bit ABGR format, [15:0] A:B:G:R 4:4:4:4 little endian
+ */
+ WL_SHM_FORMAT_ABGR4444 = 0x32314241,
+ /**
+ * 16-bit RBGA format, [15:0] R:G:B:A 4:4:4:4 little endian
+ */
+ WL_SHM_FORMAT_RGBA4444 = 0x32314152,
+ /**
+ * 16-bit BGRA format, [15:0] B:G:R:A 4:4:4:4 little endian
+ */
+ WL_SHM_FORMAT_BGRA4444 = 0x32314142,
+ /**
+ * 16-bit xRGB format, [15:0] x:R:G:B 1:5:5:5 little endian
+ */
+ WL_SHM_FORMAT_XRGB1555 = 0x35315258,
+ /**
+ * 16-bit xBGR 1555 format, [15:0] x:B:G:R 1:5:5:5 little endian
+ */
+ WL_SHM_FORMAT_XBGR1555 = 0x35314258,
+ /**
+ * 16-bit RGBx 5551 format, [15:0] R:G:B:x 5:5:5:1 little endian
+ */
+ WL_SHM_FORMAT_RGBX5551 = 0x35315852,
+ /**
+ * 16-bit BGRx 5551 format, [15:0] B:G:R:x 5:5:5:1 little endian
+ */
+ WL_SHM_FORMAT_BGRX5551 = 0x35315842,
+ /**
+ * 16-bit ARGB 1555 format, [15:0] A:R:G:B 1:5:5:5 little endian
+ */
+ WL_SHM_FORMAT_ARGB1555 = 0x35315241,
+ /**
+ * 16-bit ABGR 1555 format, [15:0] A:B:G:R 1:5:5:5 little endian
+ */
+ WL_SHM_FORMAT_ABGR1555 = 0x35314241,
+ /**
+ * 16-bit RGBA 5551 format, [15:0] R:G:B:A 5:5:5:1 little endian
+ */
+ WL_SHM_FORMAT_RGBA5551 = 0x35314152,
+ /**
+ * 16-bit BGRA 5551 format, [15:0] B:G:R:A 5:5:5:1 little endian
+ */
+ WL_SHM_FORMAT_BGRA5551 = 0x35314142,
+ /**
+ * 16-bit RGB 565 format, [15:0] R:G:B 5:6:5 little endian
+ */
+ WL_SHM_FORMAT_RGB565 = 0x36314752,
+ /**
+ * 16-bit BGR 565 format, [15:0] B:G:R 5:6:5 little endian
+ */
+ WL_SHM_FORMAT_BGR565 = 0x36314742,
+ /**
+ * 24-bit RGB format, [23:0] R:G:B little endian
+ */
+ WL_SHM_FORMAT_RGB888 = 0x34324752,
+ /**
+ * 24-bit BGR format, [23:0] B:G:R little endian
+ */
+ WL_SHM_FORMAT_BGR888 = 0x34324742,
+ /**
+ * 32-bit xBGR format, [31:0] x:B:G:R 8:8:8:8 little endian
+ */
+ WL_SHM_FORMAT_XBGR8888 = 0x34324258,
+ /**
+ * 32-bit RGBx format, [31:0] R:G:B:x 8:8:8:8 little endian
+ */
+ WL_SHM_FORMAT_RGBX8888 = 0x34325852,
+ /**
+ * 32-bit BGRx format, [31:0] B:G:R:x 8:8:8:8 little endian
+ */
+ WL_SHM_FORMAT_BGRX8888 = 0x34325842,
+ /**
+ * 32-bit ABGR format, [31:0] A:B:G:R 8:8:8:8 little endian
+ */
+ WL_SHM_FORMAT_ABGR8888 = 0x34324241,
+ /**
+ * 32-bit RGBA format, [31:0] R:G:B:A 8:8:8:8 little endian
+ */
+ WL_SHM_FORMAT_RGBA8888 = 0x34324152,
+ /**
+ * 32-bit BGRA format, [31:0] B:G:R:A 8:8:8:8 little endian
+ */
+ WL_SHM_FORMAT_BGRA8888 = 0x34324142,
+ /**
+ * 32-bit xRGB format, [31:0] x:R:G:B 2:10:10:10 little endian
+ */
+ WL_SHM_FORMAT_XRGB2101010 = 0x30335258,
+ /**
+ * 32-bit xBGR format, [31:0] x:B:G:R 2:10:10:10 little endian
+ */
+ WL_SHM_FORMAT_XBGR2101010 = 0x30334258,
+ /**
+ * 32-bit RGBx format, [31:0] R:G:B:x 10:10:10:2 little endian
+ */
+ WL_SHM_FORMAT_RGBX1010102 = 0x30335852,
+ /**
+ * 32-bit BGRx format, [31:0] B:G:R:x 10:10:10:2 little endian
+ */
+ WL_SHM_FORMAT_BGRX1010102 = 0x30335842,
+ /**
+ * 32-bit ARGB format, [31:0] A:R:G:B 2:10:10:10 little endian
+ */
+ WL_SHM_FORMAT_ARGB2101010 = 0x30335241,
+ /**
+ * 32-bit ABGR format, [31:0] A:B:G:R 2:10:10:10 little endian
+ */
+ WL_SHM_FORMAT_ABGR2101010 = 0x30334241,
+ /**
+ * 32-bit RGBA format, [31:0] R:G:B:A 10:10:10:2 little endian
+ */
+ WL_SHM_FORMAT_RGBA1010102 = 0x30334152,
+ /**
+ * 32-bit BGRA format, [31:0] B:G:R:A 10:10:10:2 little endian
+ */
+ WL_SHM_FORMAT_BGRA1010102 = 0x30334142,
+ /**
+ * packed YCbCr format, [31:0] Cr0:Y1:Cb0:Y0 8:8:8:8 little endian
+ */
+ WL_SHM_FORMAT_YUYV = 0x56595559,
+ /**
+ * packed YCbCr format, [31:0] Cb0:Y1:Cr0:Y0 8:8:8:8 little endian
+ */
+ WL_SHM_FORMAT_YVYU = 0x55595659,
+ /**
+ * packed YCbCr format, [31:0] Y1:Cr0:Y0:Cb0 8:8:8:8 little endian
+ */
+ WL_SHM_FORMAT_UYVY = 0x59565955,
+ /**
+ * packed YCbCr format, [31:0] Y1:Cb0:Y0:Cr0 8:8:8:8 little endian
+ */
+ WL_SHM_FORMAT_VYUY = 0x59555956,
+ /**
+ * packed AYCbCr format, [31:0] A:Y:Cb:Cr 8:8:8:8 little endian
+ */
+ WL_SHM_FORMAT_AYUV = 0x56555941,
+ /**
+ * 2 plane YCbCr Cr:Cb format, 2x2 subsampled Cr:Cb plane
+ */
+ WL_SHM_FORMAT_NV12 = 0x3231564e,
+ /**
+ * 2 plane YCbCr Cb:Cr format, 2x2 subsampled Cb:Cr plane
+ */
+ WL_SHM_FORMAT_NV21 = 0x3132564e,
+ /**
+ * 2 plane YCbCr Cr:Cb format, 2x1 subsampled Cr:Cb plane
+ */
+ WL_SHM_FORMAT_NV16 = 0x3631564e,
+ /**
+ * 2 plane YCbCr Cb:Cr format, 2x1 subsampled Cb:Cr plane
+ */
+ WL_SHM_FORMAT_NV61 = 0x3136564e,
+ /**
+ * 3 plane YCbCr format, 4x4 subsampled Cb (1) and Cr (2) planes
+ */
+ WL_SHM_FORMAT_YUV410 = 0x39565559,
+ /**
+ * 3 plane YCbCr format, 4x4 subsampled Cr (1) and Cb (2) planes
+ */
+ WL_SHM_FORMAT_YVU410 = 0x39555659,
+ /**
+ * 3 plane YCbCr format, 4x1 subsampled Cb (1) and Cr (2) planes
+ */
+ WL_SHM_FORMAT_YUV411 = 0x31315559,
+ /**
+ * 3 plane YCbCr format, 4x1 subsampled Cr (1) and Cb (2) planes
+ */
+ WL_SHM_FORMAT_YVU411 = 0x31315659,
+ /**
+ * 3 plane YCbCr format, 2x2 subsampled Cb (1) and Cr (2) planes
+ */
+ WL_SHM_FORMAT_YUV420 = 0x32315559,
+ /**
+ * 3 plane YCbCr format, 2x2 subsampled Cr (1) and Cb (2) planes
+ */
+ WL_SHM_FORMAT_YVU420 = 0x32315659,
+ /**
+ * 3 plane YCbCr format, 2x1 subsampled Cb (1) and Cr (2) planes
+ */
+ WL_SHM_FORMAT_YUV422 = 0x36315559,
+ /**
+ * 3 plane YCbCr format, 2x1 subsampled Cr (1) and Cb (2) planes
+ */
+ WL_SHM_FORMAT_YVU422 = 0x36315659,
+ /**
+ * 3 plane YCbCr format, non-subsampled Cb (1) and Cr (2) planes
+ */
+ WL_SHM_FORMAT_YUV444 = 0x34325559,
+ /**
+ * 3 plane YCbCr format, non-subsampled Cr (1) and Cb (2) planes
+ */
+ WL_SHM_FORMAT_YVU444 = 0x34325659,
+};
+#endif /* WL_SHM_FORMAT_ENUM */
+
+/**
+ * @ingroup iface_wl_shm
+ * @struct wl_shm_listener
+ */
+struct wl_shm_listener {
+ /**
+ * pixel format description
+ *
+ * Informs the client about a valid pixel format that can be used
+ * for buffers. Known formats include argb8888 and xrgb8888.
+ * @param format buffer pixel format
+ */
+ void (*format)(void *data,
+ struct wl_shm *wl_shm,
+ uint32_t format);
+};
+
+/**
+ * @ingroup iface_wl_shm
+ */
+static inline int
+wl_shm_add_listener(struct wl_shm *wl_shm,
+ const struct wl_shm_listener *listener, void *data)
+{
+ return wl_proxy_add_listener((struct wl_proxy *) wl_shm,
+ (void (**)(void)) listener, data);
+}
+
+#define WL_SHM_CREATE_POOL 0
+
+/**
+ * @ingroup iface_wl_shm
+ */
+#define WL_SHM_FORMAT_SINCE_VERSION 1
+
+/**
+ * @ingroup iface_wl_shm
+ */
+#define WL_SHM_CREATE_POOL_SINCE_VERSION 1
+
+/** @ingroup iface_wl_shm */
+static inline void
+wl_shm_set_user_data(struct wl_shm *wl_shm, void *user_data)
+{
+ wl_proxy_set_user_data((struct wl_proxy *) wl_shm, user_data);
+}
+
+/** @ingroup iface_wl_shm */
+static inline void *
+wl_shm_get_user_data(struct wl_shm *wl_shm)
+{
+ return wl_proxy_get_user_data((struct wl_proxy *) wl_shm);
+}
+
+static inline uint32_t
+wl_shm_get_version(struct wl_shm *wl_shm)
+{
+ return wl_proxy_get_version((struct wl_proxy *) wl_shm);
+}
+
+/** @ingroup iface_wl_shm */
+static inline void
+wl_shm_destroy(struct wl_shm *wl_shm)
+{
+ wl_proxy_destroy((struct wl_proxy *) wl_shm);
+}
+
+/**
+ * @ingroup iface_wl_shm
+ *
+ * Create a new wl_shm_pool object.
+ *
+ * The pool can be used to create shared memory based buffer
+ * objects. The server will mmap size bytes of the passed file
+ * descriptor, to use as backing memory for the pool.
+ */
+static inline struct wl_shm_pool *
+wl_shm_create_pool(struct wl_shm *wl_shm, int32_t fd, int32_t size)
+{
+ struct wl_proxy *id;
+
+ id = wl_proxy_marshal_constructor((struct wl_proxy *) wl_shm,
+ WL_SHM_CREATE_POOL, &wl_shm_pool_interface, NULL, fd, size);
+
+ return (struct wl_shm_pool *) id;
+}
+
+/**
+ * @ingroup iface_wl_buffer
+ * @struct wl_buffer_listener
+ */
+struct wl_buffer_listener {
+ /**
+ * compositor releases buffer
+ *
+ * Sent when this wl_buffer is no longer used by the compositor.
+ * The client is now free to reuse or destroy this buffer and its
+ * backing storage.
+ *
+ * If a client receives a release event before the frame callback
+ * requested in the same wl_surface.commit that attaches this
+ * wl_buffer to a surface, then the client is immediately free to
+ * reuse the buffer and its backing storage, and does not need a
+ * second buffer for the next surface content update. Typically
+ * this is possible, when the compositor maintains a copy of the
+ * wl_surface contents, e.g. as a GL texture. This is an important
+ * optimization for GL(ES) compositors with wl_shm clients.
+ */
+ void (*release)(void *data,
+ struct wl_buffer *wl_buffer);
+};
+
+/**
+ * @ingroup iface_wl_buffer
+ */
+static inline int
+wl_buffer_add_listener(struct wl_buffer *wl_buffer,
+ const struct wl_buffer_listener *listener, void *data)
+{
+ return wl_proxy_add_listener((struct wl_proxy *) wl_buffer,
+ (void (**)(void)) listener, data);
+}
+
+#define WL_BUFFER_DESTROY 0
+
+/**
+ * @ingroup iface_wl_buffer
+ */
+#define WL_BUFFER_RELEASE_SINCE_VERSION 1
+
+/**
+ * @ingroup iface_wl_buffer
+ */
+#define WL_BUFFER_DESTROY_SINCE_VERSION 1
+
+/** @ingroup iface_wl_buffer */
+static inline void
+wl_buffer_set_user_data(struct wl_buffer *wl_buffer, void *user_data)
+{
+ wl_proxy_set_user_data((struct wl_proxy *) wl_buffer, user_data);
+}
+
+/** @ingroup iface_wl_buffer */
+static inline void *
+wl_buffer_get_user_data(struct wl_buffer *wl_buffer)
+{
+ return wl_proxy_get_user_data((struct wl_proxy *) wl_buffer);
+}
+
+static inline uint32_t
+wl_buffer_get_version(struct wl_buffer *wl_buffer)
+{
+ return wl_proxy_get_version((struct wl_proxy *) wl_buffer);
+}
+
+/**
+ * @ingroup iface_wl_buffer
+ *
+ * Destroy a buffer. If and how you need to release the backing
+ * storage is defined by the buffer factory interface.
+ *
+ * For possible side-effects to a surface, see wl_surface.attach.
+ */
+static inline void
+wl_buffer_destroy(struct wl_buffer *wl_buffer)
+{
+ wl_proxy_marshal((struct wl_proxy *) wl_buffer,
+ WL_BUFFER_DESTROY);
+
+ wl_proxy_destroy((struct wl_proxy *) wl_buffer);
+}
+
+#ifndef WL_DATA_OFFER_ERROR_ENUM
+#define WL_DATA_OFFER_ERROR_ENUM
+enum wl_data_offer_error {
+ /**
+ * finish request was called untimely
+ */
+ WL_DATA_OFFER_ERROR_INVALID_FINISH = 0,
+ /**
+ * action mask contains invalid values
+ */
+ WL_DATA_OFFER_ERROR_INVALID_ACTION_MASK = 1,
+ /**
+ * action argument has an invalid value
+ */
+ WL_DATA_OFFER_ERROR_INVALID_ACTION = 2,
+ /**
+ * offer doesn't accept this request
+ */
+ WL_DATA_OFFER_ERROR_INVALID_OFFER = 3,
+};
+#endif /* WL_DATA_OFFER_ERROR_ENUM */
+
+/**
+ * @ingroup iface_wl_data_offer
+ * @struct wl_data_offer_listener
+ */
+struct wl_data_offer_listener {
+ /**
+ * advertise offered mime type
+ *
+ * Sent immediately after creating the wl_data_offer object. One
+ * event per offered mime type.
+ * @param mime_type offered mime type
+ */
+ void (*offer)(void *data,
+ struct wl_data_offer *wl_data_offer,
+ const char *mime_type);
+ /**
+ * notify the source-side available actions
+ *
+ * This event indicates the actions offered by the data source.
+ * It will be sent right after wl_data_device.enter, or anytime the
+ * source side changes its offered actions through
+ * wl_data_source.set_actions.
+ * @param source_actions actions offered by the data source
+ * @since 3
+ */
+ void (*source_actions)(void *data,
+ struct wl_data_offer *wl_data_offer,
+ uint32_t source_actions);
+ /**
+ * notify the selected action
+ *
+ * This event indicates the action selected by the compositor
+ * after matching the source/destination side actions. Only one
+ * action (or none) will be offered here.
+ *
+ * This event can be emitted multiple times during the
+ * drag-and-drop operation in response to destination side action
+ * changes through wl_data_offer.set_actions.
+ *
+ * This event will no longer be emitted after wl_data_device.drop
+ * happened on the drag-and-drop destination, the client must honor
+ * the last action received, or the last preferred one set through
+ * wl_data_offer.set_actions when handling an "ask" action.
+ *
+ * Compositors may also change the selected action on the fly,
+ * mainly in response to keyboard modifier changes during the
+ * drag-and-drop operation.
+ *
+ * The most recent action received is always the valid one. Prior
+ * to receiving wl_data_device.drop, the chosen action may change
+ * (e.g. due to keyboard modifiers being pressed). At the time of
+ * receiving wl_data_device.drop the drag-and-drop destination must
+ * honor the last action received.
+ *
+ * Action changes may still happen after wl_data_device.drop,
+ * especially on "ask" actions, where the drag-and-drop destination
+ * may choose another action afterwards. Action changes happening
+ * at this stage are always the result of inter-client negotiation,
+ * the compositor shall no longer be able to induce a different
+ * action.
+ *
+ * Upon "ask" actions, it is expected that the drag-and-drop
+ * destination may potentially choose a different action and/or
+ * mime type, based on wl_data_offer.source_actions and finally
+ * chosen by the user (e.g. popping up a menu with the available
+ * options). The final wl_data_offer.set_actions and
+ * wl_data_offer.accept requests must happen before the call to
+ * wl_data_offer.finish.
+ * @param dnd_action action selected by the compositor
+ * @since 3
+ */
+ void (*action)(void *data,
+ struct wl_data_offer *wl_data_offer,
+ uint32_t dnd_action);
+};
+
+/**
+ * @ingroup iface_wl_data_offer
+ */
+static inline int
+wl_data_offer_add_listener(struct wl_data_offer *wl_data_offer,
+ const struct wl_data_offer_listener *listener, void *data)
+{
+ return wl_proxy_add_listener((struct wl_proxy *) wl_data_offer,
+ (void (**)(void)) listener, data);
+}
+
+#define WL_DATA_OFFER_ACCEPT 0
+#define WL_DATA_OFFER_RECEIVE 1
+#define WL_DATA_OFFER_DESTROY 2
+#define WL_DATA_OFFER_FINISH 3
+#define WL_DATA_OFFER_SET_ACTIONS 4
+
+/**
+ * @ingroup iface_wl_data_offer
+ */
+#define WL_DATA_OFFER_OFFER_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_data_offer
+ */
+#define WL_DATA_OFFER_SOURCE_ACTIONS_SINCE_VERSION 3
+/**
+ * @ingroup iface_wl_data_offer
+ */
+#define WL_DATA_OFFER_ACTION_SINCE_VERSION 3
+
+/**
+ * @ingroup iface_wl_data_offer
+ */
+#define WL_DATA_OFFER_ACCEPT_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_data_offer
+ */
+#define WL_DATA_OFFER_RECEIVE_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_data_offer
+ */
+#define WL_DATA_OFFER_DESTROY_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_data_offer
+ */
+#define WL_DATA_OFFER_FINISH_SINCE_VERSION 3
+/**
+ * @ingroup iface_wl_data_offer
+ */
+#define WL_DATA_OFFER_SET_ACTIONS_SINCE_VERSION 3
+
+/** @ingroup iface_wl_data_offer */
+static inline void
+wl_data_offer_set_user_data(struct wl_data_offer *wl_data_offer, void *user_data)
+{
+ wl_proxy_set_user_data((struct wl_proxy *) wl_data_offer, user_data);
+}
+
+/** @ingroup iface_wl_data_offer */
+static inline void *
+wl_data_offer_get_user_data(struct wl_data_offer *wl_data_offer)
+{
+ return wl_proxy_get_user_data((struct wl_proxy *) wl_data_offer);
+}
+
+static inline uint32_t
+wl_data_offer_get_version(struct wl_data_offer *wl_data_offer)
+{
+ return wl_proxy_get_version((struct wl_proxy *) wl_data_offer);
+}
+
+/**
+ * @ingroup iface_wl_data_offer
+ *
+ * Indicate that the client can accept the given mime type, or
+ * NULL for not accepted.
+ *
+ * For objects of version 2 or older, this request is used by the
+ * client to give feedback whether the client can receive the given
+ * mime type, or NULL if none is accepted; the feedback does not
+ * determine whether the drag-and-drop operation succeeds or not.
+ *
+ * For objects of version 3 or newer, this request determines the
+ * final result of the drag-and-drop operation. If the end result
+ * is that no mime types were accepted, the drag-and-drop operation
+ * will be cancelled and the corresponding drag source will receive
+ * wl_data_source.cancelled. Clients may still use this event in
+ * conjunction with wl_data_source.action for feedback.
+ */
+static inline void
+wl_data_offer_accept(struct wl_data_offer *wl_data_offer, uint32_t serial, const char *mime_type)
+{
+ wl_proxy_marshal((struct wl_proxy *) wl_data_offer,
+ WL_DATA_OFFER_ACCEPT, serial, mime_type);
+}
+
+/**
+ * @ingroup iface_wl_data_offer
+ *
+ * To transfer the offered data, the client issues this request
+ * and indicates the mime type it wants to receive. The transfer
+ * happens through the passed file descriptor (typically created
+ * with the pipe system call). The source client writes the data
+ * in the mime type representation requested and then closes the
+ * file descriptor.
+ *
+ * The receiving client reads from the read end of the pipe until
+ * EOF and then closes its end, at which point the transfer is
+ * complete.
+ *
+ * This request may happen multiple times for different mime types,
+ * both before and after wl_data_device.drop. Drag-and-drop destination
+ * clients may preemptively fetch data or examine it more closely to
+ * determine acceptance.
+ */
+static inline void
+wl_data_offer_receive(struct wl_data_offer *wl_data_offer, const char *mime_type, int32_t fd)
+{
+ wl_proxy_marshal((struct wl_proxy *) wl_data_offer,
+ WL_DATA_OFFER_RECEIVE, mime_type, fd);
+}
+
+/**
+ * @ingroup iface_wl_data_offer
+ *
+ * Destroy the data offer.
+ */
+static inline void
+wl_data_offer_destroy(struct wl_data_offer *wl_data_offer)
+{
+ wl_proxy_marshal((struct wl_proxy *) wl_data_offer,
+ WL_DATA_OFFER_DESTROY);
+
+ wl_proxy_destroy((struct wl_proxy *) wl_data_offer);
+}
+
+/**
+ * @ingroup iface_wl_data_offer
+ *
+ * Notifies the compositor that the drag destination successfully
+ * finished the drag-and-drop operation.
+ *
+ * Upon receiving this request, the compositor will emit
+ * wl_data_source.dnd_finished on the drag source client.
+ *
+ * It is a client error to perform other requests than
+ * wl_data_offer.destroy after this one. It is also an error to perform
+ * this request after a NULL mime type has been set in
+ * wl_data_offer.accept or no action was received through
+ * wl_data_offer.action.
+ */
+static inline void
+wl_data_offer_finish(struct wl_data_offer *wl_data_offer)
+{
+ wl_proxy_marshal((struct wl_proxy *) wl_data_offer,
+ WL_DATA_OFFER_FINISH);
+}
+
+/**
+ * @ingroup iface_wl_data_offer
+ *
+ * Sets the actions that the destination side client supports for
+ * this operation. This request may trigger the emission of
+ * wl_data_source.action and wl_data_offer.action events if the compositor
+ * needs to change the selected action.
+ *
+ * This request can be called multiple times throughout the
+ * drag-and-drop operation, typically in response to wl_data_device.enter
+ * or wl_data_device.motion events.
+ *
+ * This request determines the final result of the drag-and-drop
+ * operation. If the end result is that no action is accepted,
+ * the drag source will receive wl_drag_source.cancelled.
+ *
+ * The dnd_actions argument must contain only values expressed in the
+ * wl_data_device_manager.dnd_actions enum, and the preferred_action
+ * argument must only contain one of those values set, otherwise it
+ * will result in a protocol error.
+ *
+ * While managing an "ask" action, the destination drag-and-drop client
+ * may perform further wl_data_offer.receive requests, and is expected
+ * to perform one last wl_data_offer.set_actions request with a preferred
+ * action other than "ask" (and optionally wl_data_offer.accept) before
+ * requesting wl_data_offer.finish, in order to convey the action selected
+ * by the user. If the preferred action is not in the
+ * wl_data_offer.source_actions mask, an error will be raised.
+ *
+ * If the "ask" action is dismissed (e.g. user cancellation), the client
+ * is expected to perform wl_data_offer.destroy right away.
+ *
+ * This request can only be made on drag-and-drop offers, a protocol error
+ * will be raised otherwise.
+ */
+static inline void
+wl_data_offer_set_actions(struct wl_data_offer *wl_data_offer, uint32_t dnd_actions, uint32_t preferred_action)
+{
+ wl_proxy_marshal((struct wl_proxy *) wl_data_offer,
+ WL_DATA_OFFER_SET_ACTIONS, dnd_actions, preferred_action);
+}
+
+#ifndef WL_DATA_SOURCE_ERROR_ENUM
+#define WL_DATA_SOURCE_ERROR_ENUM
+enum wl_data_source_error {
+ /**
+ * action mask contains invalid values
+ */
+ WL_DATA_SOURCE_ERROR_INVALID_ACTION_MASK = 0,
+ /**
+ * source doesn't accept this request
+ */
+ WL_DATA_SOURCE_ERROR_INVALID_SOURCE = 1,
+};
+#endif /* WL_DATA_SOURCE_ERROR_ENUM */
+
+/**
+ * @ingroup iface_wl_data_source
+ * @struct wl_data_source_listener
+ */
+struct wl_data_source_listener {
+ /**
+ * a target accepts an offered mime type
+ *
+ * Sent when a target accepts pointer_focus or motion events. If
+ * a target does not accept any of the offered types, type is NULL.
+ *
+ * Used for feedback during drag-and-drop.
+ * @param mime_type mime type accepted by the target
+ */
+ void (*target)(void *data,
+ struct wl_data_source *wl_data_source,
+ const char *mime_type);
+ /**
+ * send the data
+ *
+ * Request for data from the client. Send the data as the
+ * specified mime type over the passed file descriptor, then close
+ * it.
+ * @param mime_type mime type for the data
+ * @param fd file descriptor for the data
+ */
+ void (*send)(void *data,
+ struct wl_data_source *wl_data_source,
+ const char *mime_type,
+ int32_t fd);
+ /**
+ * selection was cancelled
+ *
+ * This data source is no longer valid. There are several reasons
+ * why this could happen:
+ *
+ * - The data source has been replaced by another data source. -
+ * The drag-and-drop operation was performed, but the drop
+ * destination did not accept any of the mime types offered through
+ * wl_data_source.target. - The drag-and-drop operation was
+ * performed, but the drop destination did not select any of the
+ * actions present in the mask offered through
+ * wl_data_source.action. - The drag-and-drop operation was
+ * performed but didn't happen over a surface. - The compositor
+ * cancelled the drag-and-drop operation (e.g. compositor dependent
+ * timeouts to avoid stale drag-and-drop transfers).
+ *
+ * The client should clean up and destroy this data source.
+ *
+ * For objects of version 2 or older, wl_data_source.cancelled will
+ * only be emitted if the data source was replaced by another data
+ * source.
+ */
+ void (*cancelled)(void *data,
+ struct wl_data_source *wl_data_source);
+ /**
+ * the drag-and-drop operation physically finished
+ *
+ * The user performed the drop action. This event does not
+ * indicate acceptance, wl_data_source.cancelled may still be
+ * emitted afterwards if the drop destination does not accept any
+ * mime type.
+ *
+ * However, this event might however not be received if the
+ * compositor cancelled the drag-and-drop operation before this
+ * event could happen.
+ *
+ * Note that the data_source may still be used in the future and
+ * should not be destroyed here.
+ * @since 3
+ */
+ void (*dnd_drop_performed)(void *data,
+ struct wl_data_source *wl_data_source);
+ /**
+ * the drag-and-drop operation concluded
+ *
+ * The drop destination finished interoperating with this data
+ * source, so the client is now free to destroy this data source
+ * and free all associated data.
+ *
+ * If the action used to perform the operation was "move", the
+ * source can now delete the transferred data.
+ * @since 3
+ */
+ void (*dnd_finished)(void *data,
+ struct wl_data_source *wl_data_source);
+ /**
+ * notify the selected action
+ *
+ * This event indicates the action selected by the compositor
+ * after matching the source/destination side actions. Only one
+ * action (or none) will be offered here.
+ *
+ * This event can be emitted multiple times during the
+ * drag-and-drop operation, mainly in response to destination side
+ * changes through wl_data_offer.set_actions, and as the data
+ * device enters/leaves surfaces.
+ *
+ * It is only possible to receive this event after
+ * wl_data_source.dnd_drop_performed if the drag-and-drop operation
+ * ended in an "ask" action, in which case the final
+ * wl_data_source.action event will happen immediately before
+ * wl_data_source.dnd_finished.
+ *
+ * Compositors may also change the selected action on the fly,
+ * mainly in response to keyboard modifier changes during the
+ * drag-and-drop operation.
+ *
+ * The most recent action received is always the valid one. The
+ * chosen action may change alongside negotiation (e.g. an "ask"
+ * action can turn into a "move" operation), so the effects of the
+ * final action must always be applied in
+ * wl_data_offer.dnd_finished.
+ *
+ * Clients can trigger cursor surface changes from this point, so
+ * they reflect the current action.
+ * @param dnd_action action selected by the compositor
+ * @since 3
+ */
+ void (*action)(void *data,
+ struct wl_data_source *wl_data_source,
+ uint32_t dnd_action);
+};
+
+/**
+ * @ingroup iface_wl_data_source
+ */
+static inline int
+wl_data_source_add_listener(struct wl_data_source *wl_data_source,
+ const struct wl_data_source_listener *listener, void *data)
+{
+ return wl_proxy_add_listener((struct wl_proxy *) wl_data_source,
+ (void (**)(void)) listener, data);
+}
+
+#define WL_DATA_SOURCE_OFFER 0
+#define WL_DATA_SOURCE_DESTROY 1
+#define WL_DATA_SOURCE_SET_ACTIONS 2
+
+/**
+ * @ingroup iface_wl_data_source
+ */
+#define WL_DATA_SOURCE_TARGET_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_data_source
+ */
+#define WL_DATA_SOURCE_SEND_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_data_source
+ */
+#define WL_DATA_SOURCE_CANCELLED_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_data_source
+ */
+#define WL_DATA_SOURCE_DND_DROP_PERFORMED_SINCE_VERSION 3
+/**
+ * @ingroup iface_wl_data_source
+ */
+#define WL_DATA_SOURCE_DND_FINISHED_SINCE_VERSION 3
+/**
+ * @ingroup iface_wl_data_source
+ */
+#define WL_DATA_SOURCE_ACTION_SINCE_VERSION 3
+
+/**
+ * @ingroup iface_wl_data_source
+ */
+#define WL_DATA_SOURCE_OFFER_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_data_source
+ */
+#define WL_DATA_SOURCE_DESTROY_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_data_source
+ */
+#define WL_DATA_SOURCE_SET_ACTIONS_SINCE_VERSION 3
+
+/** @ingroup iface_wl_data_source */
+static inline void
+wl_data_source_set_user_data(struct wl_data_source *wl_data_source, void *user_data)
+{
+ wl_proxy_set_user_data((struct wl_proxy *) wl_data_source, user_data);
+}
+
+/** @ingroup iface_wl_data_source */
+static inline void *
+wl_data_source_get_user_data(struct wl_data_source *wl_data_source)
+{
+ return wl_proxy_get_user_data((struct wl_proxy *) wl_data_source);
+}
+
+static inline uint32_t
+wl_data_source_get_version(struct wl_data_source *wl_data_source)
+{
+ return wl_proxy_get_version((struct wl_proxy *) wl_data_source);
+}
+
+/**
+ * @ingroup iface_wl_data_source
+ *
+ * This request adds a mime type to the set of mime types
+ * advertised to targets. Can be called several times to offer
+ * multiple types.
+ */
+static inline void
+wl_data_source_offer(struct wl_data_source *wl_data_source, const char *mime_type)
+{
+ wl_proxy_marshal((struct wl_proxy *) wl_data_source,
+ WL_DATA_SOURCE_OFFER, mime_type);
+}
+
+/**
+ * @ingroup iface_wl_data_source
+ *
+ * Destroy the data source.
+ */
+static inline void
+wl_data_source_destroy(struct wl_data_source *wl_data_source)
+{
+ wl_proxy_marshal((struct wl_proxy *) wl_data_source,
+ WL_DATA_SOURCE_DESTROY);
+
+ wl_proxy_destroy((struct wl_proxy *) wl_data_source);
+}
+
+/**
+ * @ingroup iface_wl_data_source
+ *
+ * Sets the actions that the source side client supports for this
+ * operation. This request may trigger wl_data_source.action and
+ * wl_data_offer.action events if the compositor needs to change the
+ * selected action.
+ *
+ * The dnd_actions argument must contain only values expressed in the
+ * wl_data_device_manager.dnd_actions enum, otherwise it will result
+ * in a protocol error.
+ *
+ * This request must be made once only, and can only be made on sources
+ * used in drag-and-drop, so it must be performed before
+ * wl_data_device.start_drag. Attempting to use the source other than
+ * for drag-and-drop will raise a protocol error.
+ */
+static inline void
+wl_data_source_set_actions(struct wl_data_source *wl_data_source, uint32_t dnd_actions)
+{
+ wl_proxy_marshal((struct wl_proxy *) wl_data_source,
+ WL_DATA_SOURCE_SET_ACTIONS, dnd_actions);
+}
+
+#ifndef WL_DATA_DEVICE_ERROR_ENUM
+#define WL_DATA_DEVICE_ERROR_ENUM
+enum wl_data_device_error {
+ /**
+ * given wl_surface has another role
+ */
+ WL_DATA_DEVICE_ERROR_ROLE = 0,
+};
+#endif /* WL_DATA_DEVICE_ERROR_ENUM */
+
+/**
+ * @ingroup iface_wl_data_device
+ * @struct wl_data_device_listener
+ */
+struct wl_data_device_listener {
+ /**
+ * introduce a new wl_data_offer
+ *
+ * The data_offer event introduces a new wl_data_offer object,
+ * which will subsequently be used in either the data_device.enter
+ * event (for drag-and-drop) or the data_device.selection event
+ * (for selections). Immediately following the
+ * data_device_data_offer event, the new data_offer object will
+ * send out data_offer.offer events to describe the mime types it
+ * offers.
+ * @param id the new data_offer object
+ */
+ void (*data_offer)(void *data,
+ struct wl_data_device *wl_data_device,
+ struct wl_data_offer *id);
+ /**
+ * initiate drag-and-drop session
+ *
+ * This event is sent when an active drag-and-drop pointer enters
+ * a surface owned by the client. The position of the pointer at
+ * enter time is provided by the x and y arguments, in
+ * surface-local coordinates.
+ * @param serial serial number of the enter event
+ * @param surface client surface entered
+ * @param x surface-local x coordinate
+ * @param y surface-local y coordinate
+ * @param id source data_offer object
+ */
+ void (*enter)(void *data,
+ struct wl_data_device *wl_data_device,
+ uint32_t serial,
+ struct wl_surface *surface,
+ wl_fixed_t x,
+ wl_fixed_t y,
+ struct wl_data_offer *id);
+ /**
+ * end drag-and-drop session
+ *
+ * This event is sent when the drag-and-drop pointer leaves the
+ * surface and the session ends. The client must destroy the
+ * wl_data_offer introduced at enter time at this point.
+ */
+ void (*leave)(void *data,
+ struct wl_data_device *wl_data_device);
+ /**
+ * drag-and-drop session motion
+ *
+ * This event is sent when the drag-and-drop pointer moves within
+ * the currently focused surface. The new position of the pointer
+ * is provided by the x and y arguments, in surface-local
+ * coordinates.
+ * @param time timestamp with millisecond granularity
+ * @param x surface-local x coordinate
+ * @param y surface-local y coordinate
+ */
+ void (*motion)(void *data,
+ struct wl_data_device *wl_data_device,
+ uint32_t time,
+ wl_fixed_t x,
+ wl_fixed_t y);
+ /**
+ * end drag-and-drop session successfully
+ *
+ * The event is sent when a drag-and-drop operation is ended
+ * because the implicit grab is removed.
+ *
+ * The drag-and-drop destination is expected to honor the last
+ * action received through wl_data_offer.action, if the resulting
+ * action is "copy" or "move", the destination can still perform
+ * wl_data_offer.receive requests, and is expected to end all
+ * transfers with a wl_data_offer.finish request.
+ *
+ * If the resulting action is "ask", the action will not be
+ * considered final. The drag-and-drop destination is expected to
+ * perform one last wl_data_offer.set_actions request, or
+ * wl_data_offer.destroy in order to cancel the operation.
+ */
+ void (*drop)(void *data,
+ struct wl_data_device *wl_data_device);
+ /**
+ * advertise new selection
+ *
+ * The selection event is sent out to notify the client of a new
+ * wl_data_offer for the selection for this device. The
+ * data_device.data_offer and the data_offer.offer events are sent
+ * out immediately before this event to introduce the data offer
+ * object. The selection event is sent to a client immediately
+ * before receiving keyboard focus and when a new selection is set
+ * while the client has keyboard focus. The data_offer is valid
+ * until a new data_offer or NULL is received or until the client
+ * loses keyboard focus. The client must destroy the previous
+ * selection data_offer, if any, upon receiving this event.
+ * @param id selection data_offer object
+ */
+ void (*selection)(void *data,
+ struct wl_data_device *wl_data_device,
+ struct wl_data_offer *id);
+};
+
+/**
+ * @ingroup iface_wl_data_device
+ */
+static inline int
+wl_data_device_add_listener(struct wl_data_device *wl_data_device,
+ const struct wl_data_device_listener *listener, void *data)
+{
+ return wl_proxy_add_listener((struct wl_proxy *) wl_data_device,
+ (void (**)(void)) listener, data);
+}
+
+#define WL_DATA_DEVICE_START_DRAG 0
+#define WL_DATA_DEVICE_SET_SELECTION 1
+#define WL_DATA_DEVICE_RELEASE 2
+
+/**
+ * @ingroup iface_wl_data_device
+ */
+#define WL_DATA_DEVICE_DATA_OFFER_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_data_device
+ */
+#define WL_DATA_DEVICE_ENTER_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_data_device
+ */
+#define WL_DATA_DEVICE_LEAVE_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_data_device
+ */
+#define WL_DATA_DEVICE_MOTION_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_data_device
+ */
+#define WL_DATA_DEVICE_DROP_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_data_device
+ */
+#define WL_DATA_DEVICE_SELECTION_SINCE_VERSION 1
+
+/**
+ * @ingroup iface_wl_data_device
+ */
+#define WL_DATA_DEVICE_START_DRAG_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_data_device
+ */
+#define WL_DATA_DEVICE_SET_SELECTION_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_data_device
+ */
+#define WL_DATA_DEVICE_RELEASE_SINCE_VERSION 2
+
+/** @ingroup iface_wl_data_device */
+static inline void
+wl_data_device_set_user_data(struct wl_data_device *wl_data_device, void *user_data)
+{
+ wl_proxy_set_user_data((struct wl_proxy *) wl_data_device, user_data);
+}
+
+/** @ingroup iface_wl_data_device */
+static inline void *
+wl_data_device_get_user_data(struct wl_data_device *wl_data_device)
+{
+ return wl_proxy_get_user_data((struct wl_proxy *) wl_data_device);
+}
+
+static inline uint32_t
+wl_data_device_get_version(struct wl_data_device *wl_data_device)
+{
+ return wl_proxy_get_version((struct wl_proxy *) wl_data_device);
+}
+
+/** @ingroup iface_wl_data_device */
+static inline void
+wl_data_device_destroy(struct wl_data_device *wl_data_device)
+{
+ wl_proxy_destroy((struct wl_proxy *) wl_data_device);
+}
+
+/**
+ * @ingroup iface_wl_data_device
+ *
+ * This request asks the compositor to start a drag-and-drop
+ * operation on behalf of the client.
+ *
+ * The source argument is the data source that provides the data
+ * for the eventual data transfer. If source is NULL, enter, leave
+ * and motion events are sent only to the client that initiated the
+ * drag and the client is expected to handle the data passing
+ * internally.
+ *
+ * The origin surface is the surface where the drag originates and
+ * the client must have an active implicit grab that matches the
+ * serial.
+ *
+ * The icon surface is an optional (can be NULL) surface that
+ * provides an icon to be moved around with the cursor. Initially,
+ * the top-left corner of the icon surface is placed at the cursor
+ * hotspot, but subsequent wl_surface.attach request can move the
+ * relative position. Attach requests must be confirmed with
+ * wl_surface.commit as usual. The icon surface is given the role of
+ * a drag-and-drop icon. If the icon surface already has another role,
+ * it raises a protocol error.
+ *
+ * The current and pending input regions of the icon wl_surface are
+ * cleared, and wl_surface.set_input_region is ignored until the
+ * wl_surface is no longer used as the icon surface. When the use
+ * as an icon ends, the current and pending input regions become
+ * undefined, and the wl_surface is unmapped.
+ */
+static inline void
+wl_data_device_start_drag(struct wl_data_device *wl_data_device, struct wl_data_source *source, struct wl_surface *origin, struct wl_surface *icon, uint32_t serial)
+{
+ wl_proxy_marshal((struct wl_proxy *) wl_data_device,
+ WL_DATA_DEVICE_START_DRAG, source, origin, icon, serial);
+}
+
+/**
+ * @ingroup iface_wl_data_device
+ *
+ * This request asks the compositor to set the selection
+ * to the data from the source on behalf of the client.
+ *
+ * To unset the selection, set the source to NULL.
+ */
+static inline void
+wl_data_device_set_selection(struct wl_data_device *wl_data_device, struct wl_data_source *source, uint32_t serial)
+{
+ wl_proxy_marshal((struct wl_proxy *) wl_data_device,
+ WL_DATA_DEVICE_SET_SELECTION, source, serial);
+}
+
+/**
+ * @ingroup iface_wl_data_device
+ *
+ * This request destroys the data device.
+ */
+static inline void
+wl_data_device_release(struct wl_data_device *wl_data_device)
+{
+ wl_proxy_marshal((struct wl_proxy *) wl_data_device,
+ WL_DATA_DEVICE_RELEASE);
+
+ wl_proxy_destroy((struct wl_proxy *) wl_data_device);
+}
+
+#ifndef WL_DATA_DEVICE_MANAGER_DND_ACTION_ENUM
+#define WL_DATA_DEVICE_MANAGER_DND_ACTION_ENUM
+/**
+ * @ingroup iface_wl_data_device_manager
+ * drag and drop actions
+ *
+ * This is a bitmask of the available/preferred actions in a
+ * drag-and-drop operation.
+ *
+ * In the compositor, the selected action is a result of matching the
+ * actions offered by the source and destination sides. "action" events
+ * with a "none" action will be sent to both source and destination if
+ * there is no match. All further checks will effectively happen on
+ * (source actions ∩ destination actions).
+ *
+ * In addition, compositors may also pick different actions in
+ * reaction to key modifiers being pressed. One common design that
+ * is used in major toolkits (and the behavior recommended for
+ * compositors) is:
+ *
+ * - If no modifiers are pressed, the first match (in bit order)
+ * will be used.
+ * - Pressing Shift selects "move", if enabled in the mask.
+ * - Pressing Control selects "copy", if enabled in the mask.
+ *
+ * Behavior beyond that is considered implementation-dependent.
+ * Compositors may for example bind other modifiers (like Alt/Meta)
+ * or drags initiated with other buttons than BTN_LEFT to specific
+ * actions (e.g. "ask").
+ */
+enum wl_data_device_manager_dnd_action {
+ /**
+ * no action
+ */
+ WL_DATA_DEVICE_MANAGER_DND_ACTION_NONE = 0,
+ /**
+ * copy action
+ */
+ WL_DATA_DEVICE_MANAGER_DND_ACTION_COPY = 1,
+ /**
+ * move action
+ */
+ WL_DATA_DEVICE_MANAGER_DND_ACTION_MOVE = 2,
+ /**
+ * ask action
+ */
+ WL_DATA_DEVICE_MANAGER_DND_ACTION_ASK = 4,
+};
+#endif /* WL_DATA_DEVICE_MANAGER_DND_ACTION_ENUM */
+
+#define WL_DATA_DEVICE_MANAGER_CREATE_DATA_SOURCE 0
+#define WL_DATA_DEVICE_MANAGER_GET_DATA_DEVICE 1
+
+
+/**
+ * @ingroup iface_wl_data_device_manager
+ */
+#define WL_DATA_DEVICE_MANAGER_CREATE_DATA_SOURCE_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_data_device_manager
+ */
+#define WL_DATA_DEVICE_MANAGER_GET_DATA_DEVICE_SINCE_VERSION 1
+
+/** @ingroup iface_wl_data_device_manager */
+static inline void
+wl_data_device_manager_set_user_data(struct wl_data_device_manager *wl_data_device_manager, void *user_data)
+{
+ wl_proxy_set_user_data((struct wl_proxy *) wl_data_device_manager, user_data);
+}
+
+/** @ingroup iface_wl_data_device_manager */
+static inline void *
+wl_data_device_manager_get_user_data(struct wl_data_device_manager *wl_data_device_manager)
+{
+ return wl_proxy_get_user_data((struct wl_proxy *) wl_data_device_manager);
+}
+
+static inline uint32_t
+wl_data_device_manager_get_version(struct wl_data_device_manager *wl_data_device_manager)
+{
+ return wl_proxy_get_version((struct wl_proxy *) wl_data_device_manager);
+}
+
+/** @ingroup iface_wl_data_device_manager */
+static inline void
+wl_data_device_manager_destroy(struct wl_data_device_manager *wl_data_device_manager)
+{
+ wl_proxy_destroy((struct wl_proxy *) wl_data_device_manager);
+}
+
+/**
+ * @ingroup iface_wl_data_device_manager
+ *
+ * Create a new data source.
+ */
+static inline struct wl_data_source *
+wl_data_device_manager_create_data_source(struct wl_data_device_manager *wl_data_device_manager)
+{
+ struct wl_proxy *id;
+
+ id = wl_proxy_marshal_constructor((struct wl_proxy *) wl_data_device_manager,
+ WL_DATA_DEVICE_MANAGER_CREATE_DATA_SOURCE, &wl_data_source_interface, NULL);
+
+ return (struct wl_data_source *) id;
+}
+
+/**
+ * @ingroup iface_wl_data_device_manager
+ *
+ * Create a new data device for a given seat.
+ */
+static inline struct wl_data_device *
+wl_data_device_manager_get_data_device(struct wl_data_device_manager *wl_data_device_manager, struct wl_seat *seat)
+{
+ struct wl_proxy *id;
+
+ id = wl_proxy_marshal_constructor((struct wl_proxy *) wl_data_device_manager,
+ WL_DATA_DEVICE_MANAGER_GET_DATA_DEVICE, &wl_data_device_interface, NULL, seat);
+
+ return (struct wl_data_device *) id;
+}
+
+#ifndef WL_SHELL_ERROR_ENUM
+#define WL_SHELL_ERROR_ENUM
+enum wl_shell_error {
+ /**
+ * given wl_surface has another role
+ */
+ WL_SHELL_ERROR_ROLE = 0,
+};
+#endif /* WL_SHELL_ERROR_ENUM */
+
+#define WL_SHELL_GET_SHELL_SURFACE 0
+
+
+/**
+ * @ingroup iface_wl_shell
+ */
+#define WL_SHELL_GET_SHELL_SURFACE_SINCE_VERSION 1
+
+/** @ingroup iface_wl_shell */
+static inline void
+wl_shell_set_user_data(struct wl_shell *wl_shell, void *user_data)
+{
+ wl_proxy_set_user_data((struct wl_proxy *) wl_shell, user_data);
+}
+
+/** @ingroup iface_wl_shell */
+static inline void *
+wl_shell_get_user_data(struct wl_shell *wl_shell)
+{
+ return wl_proxy_get_user_data((struct wl_proxy *) wl_shell);
+}
+
+static inline uint32_t
+wl_shell_get_version(struct wl_shell *wl_shell)
+{
+ return wl_proxy_get_version((struct wl_proxy *) wl_shell);
+}
+
+/** @ingroup iface_wl_shell */
+static inline void
+wl_shell_destroy(struct wl_shell *wl_shell)
+{
+ wl_proxy_destroy((struct wl_proxy *) wl_shell);
+}
+
+/**
+ * @ingroup iface_wl_shell
+ *
+ * Create a shell surface for an existing surface. This gives
+ * the wl_surface the role of a shell surface. If the wl_surface
+ * already has another role, it raises a protocol error.
+ *
+ * Only one shell surface can be associated with a given surface.
+ */
+static inline struct wl_shell_surface *
+wl_shell_get_shell_surface(struct wl_shell *wl_shell, struct wl_surface *surface)
+{
+ struct wl_proxy *id;
+
+ id = wl_proxy_marshal_constructor((struct wl_proxy *) wl_shell,
+ WL_SHELL_GET_SHELL_SURFACE, &wl_shell_surface_interface, NULL, surface);
+
+ return (struct wl_shell_surface *) id;
+}
+
+#ifndef WL_SHELL_SURFACE_RESIZE_ENUM
+#define WL_SHELL_SURFACE_RESIZE_ENUM
+/**
+ * @ingroup iface_wl_shell_surface
+ * edge values for resizing
+ *
+ * These values are used to indicate which edge of a surface
+ * is being dragged in a resize operation. The server may
+ * use this information to adapt its behavior, e.g. choose
+ * an appropriate cursor image.
+ */
+enum wl_shell_surface_resize {
+ /**
+ * no edge
+ */
+ WL_SHELL_SURFACE_RESIZE_NONE = 0,
+ /**
+ * top edge
+ */
+ WL_SHELL_SURFACE_RESIZE_TOP = 1,
+ /**
+ * bottom edge
+ */
+ WL_SHELL_SURFACE_RESIZE_BOTTOM = 2,
+ /**
+ * left edge
+ */
+ WL_SHELL_SURFACE_RESIZE_LEFT = 4,
+ /**
+ * top and left edges
+ */
+ WL_SHELL_SURFACE_RESIZE_TOP_LEFT = 5,
+ /**
+ * bottom and left edges
+ */
+ WL_SHELL_SURFACE_RESIZE_BOTTOM_LEFT = 6,
+ /**
+ * right edge
+ */
+ WL_SHELL_SURFACE_RESIZE_RIGHT = 8,
+ /**
+ * top and right edges
+ */
+ WL_SHELL_SURFACE_RESIZE_TOP_RIGHT = 9,
+ /**
+ * bottom and right edges
+ */
+ WL_SHELL_SURFACE_RESIZE_BOTTOM_RIGHT = 10,
+};
+#endif /* WL_SHELL_SURFACE_RESIZE_ENUM */
+
+#ifndef WL_SHELL_SURFACE_TRANSIENT_ENUM
+#define WL_SHELL_SURFACE_TRANSIENT_ENUM
+/**
+ * @ingroup iface_wl_shell_surface
+ * details of transient behaviour
+ *
+ * These flags specify details of the expected behaviour
+ * of transient surfaces. Used in the set_transient request.
+ */
+enum wl_shell_surface_transient {
+ /**
+ * do not set keyboard focus
+ */
+ WL_SHELL_SURFACE_TRANSIENT_INACTIVE = 0x1,
+};
+#endif /* WL_SHELL_SURFACE_TRANSIENT_ENUM */
+
+#ifndef WL_SHELL_SURFACE_FULLSCREEN_METHOD_ENUM
+#define WL_SHELL_SURFACE_FULLSCREEN_METHOD_ENUM
+/**
+ * @ingroup iface_wl_shell_surface
+ * different method to set the surface fullscreen
+ *
+ * Hints to indicate to the compositor how to deal with a conflict
+ * between the dimensions of the surface and the dimensions of the
+ * output. The compositor is free to ignore this parameter.
+ */
+enum wl_shell_surface_fullscreen_method {
+ /**
+ * no preference, apply default policy
+ */
+ WL_SHELL_SURFACE_FULLSCREEN_METHOD_DEFAULT = 0,
+ /**
+ * scale, preserve the surface's aspect ratio and center on output
+ */
+ WL_SHELL_SURFACE_FULLSCREEN_METHOD_SCALE = 1,
+ /**
+ * switch output mode to the smallest mode that can fit the surface, add black borders to compensate size mismatch
+ */
+ WL_SHELL_SURFACE_FULLSCREEN_METHOD_DRIVER = 2,
+ /**
+ * no upscaling, center on output and add black borders to compensate size mismatch
+ */
+ WL_SHELL_SURFACE_FULLSCREEN_METHOD_FILL = 3,
+};
+#endif /* WL_SHELL_SURFACE_FULLSCREEN_METHOD_ENUM */
+
+/**
+ * @ingroup iface_wl_shell_surface
+ * @struct wl_shell_surface_listener
+ */
+struct wl_shell_surface_listener {
+ /**
+ * ping client
+ *
+ * Ping a client to check if it is receiving events and sending
+ * requests. A client is expected to reply with a pong request.
+ * @param serial serial number of the ping
+ */
+ void (*ping)(void *data,
+ struct wl_shell_surface *wl_shell_surface,
+ uint32_t serial);
+ /**
+ * suggest resize
+ *
+ * The configure event asks the client to resize its surface.
+ *
+ * The size is a hint, in the sense that the client is free to
+ * ignore it if it doesn't resize, pick a smaller size (to satisfy
+ * aspect ratio or resize in steps of NxM pixels).
+ *
+ * The edges parameter provides a hint about how the surface was
+ * resized. The client may use this information to decide how to
+ * adjust its content to the new size (e.g. a scrolling area might
+ * adjust its content position to leave the viewable content
+ * unmoved).
+ *
+ * The client is free to dismiss all but the last configure event
+ * it received.
+ *
+ * The width and height arguments specify the size of the window in
+ * surface-local coordinates.
+ * @param edges how the surface was resized
+ * @param width new width of the surface
+ * @param height new height of the surface
+ */
+ void (*configure)(void *data,
+ struct wl_shell_surface *wl_shell_surface,
+ uint32_t edges,
+ int32_t width,
+ int32_t height);
+ /**
+ * popup interaction is done
+ *
+ * The popup_done event is sent out when a popup grab is broken,
+ * that is, when the user clicks a surface that doesn't belong to
+ * the client owning the popup surface.
+ */
+ void (*popup_done)(void *data,
+ struct wl_shell_surface *wl_shell_surface);
+};
+
+/**
+ * @ingroup iface_wl_shell_surface
+ */
+static inline int
+wl_shell_surface_add_listener(struct wl_shell_surface *wl_shell_surface,
+ const struct wl_shell_surface_listener *listener, void *data)
+{
+ return wl_proxy_add_listener((struct wl_proxy *) wl_shell_surface,
+ (void (**)(void)) listener, data);
+}
+
+#define WL_SHELL_SURFACE_PONG 0
+#define WL_SHELL_SURFACE_MOVE 1
+#define WL_SHELL_SURFACE_RESIZE 2
+#define WL_SHELL_SURFACE_SET_TOPLEVEL 3
+#define WL_SHELL_SURFACE_SET_TRANSIENT 4
+#define WL_SHELL_SURFACE_SET_FULLSCREEN 5
+#define WL_SHELL_SURFACE_SET_POPUP 6
+#define WL_SHELL_SURFACE_SET_MAXIMIZED 7
+#define WL_SHELL_SURFACE_SET_TITLE 8
+#define WL_SHELL_SURFACE_SET_CLASS 9
+
+/**
+ * @ingroup iface_wl_shell_surface
+ */
+#define WL_SHELL_SURFACE_PING_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_shell_surface
+ */
+#define WL_SHELL_SURFACE_CONFIGURE_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_shell_surface
+ */
+#define WL_SHELL_SURFACE_POPUP_DONE_SINCE_VERSION 1
+
+/**
+ * @ingroup iface_wl_shell_surface
+ */
+#define WL_SHELL_SURFACE_PONG_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_shell_surface
+ */
+#define WL_SHELL_SURFACE_MOVE_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_shell_surface
+ */
+#define WL_SHELL_SURFACE_RESIZE_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_shell_surface
+ */
+#define WL_SHELL_SURFACE_SET_TOPLEVEL_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_shell_surface
+ */
+#define WL_SHELL_SURFACE_SET_TRANSIENT_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_shell_surface
+ */
+#define WL_SHELL_SURFACE_SET_FULLSCREEN_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_shell_surface
+ */
+#define WL_SHELL_SURFACE_SET_POPUP_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_shell_surface
+ */
+#define WL_SHELL_SURFACE_SET_MAXIMIZED_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_shell_surface
+ */
+#define WL_SHELL_SURFACE_SET_TITLE_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_shell_surface
+ */
+#define WL_SHELL_SURFACE_SET_CLASS_SINCE_VERSION 1
+
+/** @ingroup iface_wl_shell_surface */
+static inline void
+wl_shell_surface_set_user_data(struct wl_shell_surface *wl_shell_surface, void *user_data)
+{
+ wl_proxy_set_user_data((struct wl_proxy *) wl_shell_surface, user_data);
+}
+
+/** @ingroup iface_wl_shell_surface */
+static inline void *
+wl_shell_surface_get_user_data(struct wl_shell_surface *wl_shell_surface)
+{
+ return wl_proxy_get_user_data((struct wl_proxy *) wl_shell_surface);
+}
+
+static inline uint32_t
+wl_shell_surface_get_version(struct wl_shell_surface *wl_shell_surface)
+{
+ return wl_proxy_get_version((struct wl_proxy *) wl_shell_surface);
+}
+
+/** @ingroup iface_wl_shell_surface */
+static inline void
+wl_shell_surface_destroy(struct wl_shell_surface *wl_shell_surface)
+{
+ wl_proxy_destroy((struct wl_proxy *) wl_shell_surface);
+}
+
+/**
+ * @ingroup iface_wl_shell_surface
+ *
+ * A client must respond to a ping event with a pong request or
+ * the client may be deemed unresponsive.
+ */
+static inline void
+wl_shell_surface_pong(struct wl_shell_surface *wl_shell_surface, uint32_t serial)
+{
+ wl_proxy_marshal((struct wl_proxy *) wl_shell_surface,
+ WL_SHELL_SURFACE_PONG, serial);
+}
+
+/**
+ * @ingroup iface_wl_shell_surface
+ *
+ * Start a pointer-driven move of the surface.
+ *
+ * This request must be used in response to a button press event.
+ * The server may ignore move requests depending on the state of
+ * the surface (e.g. fullscreen or maximized).
+ */
+static inline void
+wl_shell_surface_move(struct wl_shell_surface *wl_shell_surface, struct wl_seat *seat, uint32_t serial)
+{
+ wl_proxy_marshal((struct wl_proxy *) wl_shell_surface,
+ WL_SHELL_SURFACE_MOVE, seat, serial);
+}
+
+/**
+ * @ingroup iface_wl_shell_surface
+ *
+ * Start a pointer-driven resizing of the surface.
+ *
+ * This request must be used in response to a button press event.
+ * The server may ignore resize requests depending on the state of
+ * the surface (e.g. fullscreen or maximized).
+ */
+static inline void
+wl_shell_surface_resize(struct wl_shell_surface *wl_shell_surface, struct wl_seat *seat, uint32_t serial, uint32_t edges)
+{
+ wl_proxy_marshal((struct wl_proxy *) wl_shell_surface,
+ WL_SHELL_SURFACE_RESIZE, seat, serial, edges);
+}
+
+/**
+ * @ingroup iface_wl_shell_surface
+ *
+ * Map the surface as a toplevel surface.
+ *
+ * A toplevel surface is not fullscreen, maximized or transient.
+ */
+static inline void
+wl_shell_surface_set_toplevel(struct wl_shell_surface *wl_shell_surface)
+{
+ wl_proxy_marshal((struct wl_proxy *) wl_shell_surface,
+ WL_SHELL_SURFACE_SET_TOPLEVEL);
+}
+
+/**
+ * @ingroup iface_wl_shell_surface
+ *
+ * Map the surface relative to an existing surface.
+ *
+ * The x and y arguments specify the location of the upper left
+ * corner of the surface relative to the upper left corner of the
+ * parent surface, in surface-local coordinates.
+ *
+ * The flags argument controls details of the transient behaviour.
+ */
+static inline void
+wl_shell_surface_set_transient(struct wl_shell_surface *wl_shell_surface, struct wl_surface *parent, int32_t x, int32_t y, uint32_t flags)
+{
+ wl_proxy_marshal((struct wl_proxy *) wl_shell_surface,
+ WL_SHELL_SURFACE_SET_TRANSIENT, parent, x, y, flags);
+}
+
+/**
+ * @ingroup iface_wl_shell_surface
+ *
+ * Map the surface as a fullscreen surface.
+ *
+ * If an output parameter is given then the surface will be made
+ * fullscreen on that output. If the client does not specify the
+ * output then the compositor will apply its policy - usually
+ * choosing the output on which the surface has the biggest surface
+ * area.
+ *
+ * The client may specify a method to resolve a size conflict
+ * between the output size and the surface size - this is provided
+ * through the method parameter.
+ *
+ * The framerate parameter is used only when the method is set
+ * to "driver", to indicate the preferred framerate. A value of 0
+ * indicates that the client does not care about framerate. The
+ * framerate is specified in mHz, that is framerate of 60000 is 60Hz.
+ *
+ * A method of "scale" or "driver" implies a scaling operation of
+ * the surface, either via a direct scaling operation or a change of
+ * the output mode. This will override any kind of output scaling, so
+ * that mapping a surface with a buffer size equal to the mode can
+ * fill the screen independent of buffer_scale.
+ *
+ * A method of "fill" means we don't scale up the buffer, however
+ * any output scale is applied. This means that you may run into
+ * an edge case where the application maps a buffer with the same
+ * size of the output mode but buffer_scale 1 (thus making a
+ * surface larger than the output). In this case it is allowed to
+ * downscale the results to fit the screen.
+ *
+ * The compositor must reply to this request with a configure event
+ * with the dimensions for the output on which the surface will
+ * be made fullscreen.
+ */
+static inline void
+wl_shell_surface_set_fullscreen(struct wl_shell_surface *wl_shell_surface, uint32_t method, uint32_t framerate, struct wl_output *output)
+{
+ wl_proxy_marshal((struct wl_proxy *) wl_shell_surface,
+ WL_SHELL_SURFACE_SET_FULLSCREEN, method, framerate, output);
+}
+
+/**
+ * @ingroup iface_wl_shell_surface
+ *
+ * Map the surface as a popup.
+ *
+ * A popup surface is a transient surface with an added pointer
+ * grab.
+ *
+ * An existing implicit grab will be changed to owner-events mode,
+ * and the popup grab will continue after the implicit grab ends
+ * (i.e. releasing the mouse button does not cause the popup to
+ * be unmapped).
+ *
+ * The popup grab continues until the window is destroyed or a
+ * mouse button is pressed in any other client's window. A click
+ * in any of the client's surfaces is reported as normal, however,
+ * clicks in other clients' surfaces will be discarded and trigger
+ * the callback.
+ *
+ * The x and y arguments specify the location of the upper left
+ * corner of the surface relative to the upper left corner of the
+ * parent surface, in surface-local coordinates.
+ */
+static inline void
+wl_shell_surface_set_popup(struct wl_shell_surface *wl_shell_surface, struct wl_seat *seat, uint32_t serial, struct wl_surface *parent, int32_t x, int32_t y, uint32_t flags)
+{
+ wl_proxy_marshal((struct wl_proxy *) wl_shell_surface,
+ WL_SHELL_SURFACE_SET_POPUP, seat, serial, parent, x, y, flags);
+}
+
+/**
+ * @ingroup iface_wl_shell_surface
+ *
+ * Map the surface as a maximized surface.
+ *
+ * If an output parameter is given then the surface will be
+ * maximized on that output. If the client does not specify the
+ * output then the compositor will apply its policy - usually
+ * choosing the output on which the surface has the biggest surface
+ * area.
+ *
+ * The compositor will reply with a configure event telling
+ * the expected new surface size. The operation is completed
+ * on the next buffer attach to this surface.
+ *
+ * A maximized surface typically fills the entire output it is
+ * bound to, except for desktop elements such as panels. This is
+ * the main difference between a maximized shell surface and a
+ * fullscreen shell surface.
+ *
+ * The details depend on the compositor implementation.
+ */
+static inline void
+wl_shell_surface_set_maximized(struct wl_shell_surface *wl_shell_surface, struct wl_output *output)
+{
+ wl_proxy_marshal((struct wl_proxy *) wl_shell_surface,
+ WL_SHELL_SURFACE_SET_MAXIMIZED, output);
+}
+
+/**
+ * @ingroup iface_wl_shell_surface
+ *
+ * Set a short title for the surface.
+ *
+ * This string may be used to identify the surface in a task bar,
+ * window list, or other user interface elements provided by the
+ * compositor.
+ *
+ * The string must be encoded in UTF-8.
+ */
+static inline void
+wl_shell_surface_set_title(struct wl_shell_surface *wl_shell_surface, const char *title)
+{
+ wl_proxy_marshal((struct wl_proxy *) wl_shell_surface,
+ WL_SHELL_SURFACE_SET_TITLE, title);
+}
+
+/**
+ * @ingroup iface_wl_shell_surface
+ *
+ * Set a class for the surface.
+ *
+ * The surface class identifies the general class of applications
+ * to which the surface belongs. A common convention is to use the
+ * file name (or the full path if it is a non-standard location) of
+ * the application's .desktop file as the class.
+ */
+static inline void
+wl_shell_surface_set_class(struct wl_shell_surface *wl_shell_surface, const char *class_)
+{
+ wl_proxy_marshal((struct wl_proxy *) wl_shell_surface,
+ WL_SHELL_SURFACE_SET_CLASS, class_);
+}
+
+#ifndef WL_SURFACE_ERROR_ENUM
+#define WL_SURFACE_ERROR_ENUM
+/**
+ * @ingroup iface_wl_surface
+ * wl_surface error values
+ *
+ * These errors can be emitted in response to wl_surface requests.
+ */
+enum wl_surface_error {
+ /**
+ * buffer scale value is invalid
+ */
+ WL_SURFACE_ERROR_INVALID_SCALE = 0,
+ /**
+ * buffer transform value is invalid
+ */
+ WL_SURFACE_ERROR_INVALID_TRANSFORM = 1,
+};
+#endif /* WL_SURFACE_ERROR_ENUM */
+
+/**
+ * @ingroup iface_wl_surface
+ * @struct wl_surface_listener
+ */
+struct wl_surface_listener {
+ /**
+ * surface enters an output
+ *
+ * This is emitted whenever a surface's creation, movement, or
+ * resizing results in some part of it being within the scanout
+ * region of an output.
+ *
+ * Note that a surface may be overlapping with zero or more
+ * outputs.
+ * @param output output entered by the surface
+ */
+ void (*enter)(void *data,
+ struct wl_surface *wl_surface,
+ struct wl_output *output);
+ /**
+ * surface leaves an output
+ *
+ * This is emitted whenever a surface's creation, movement, or
+ * resizing results in it no longer having any part of it within
+ * the scanout region of an output.
+ * @param output output left by the surface
+ */
+ void (*leave)(void *data,
+ struct wl_surface *wl_surface,
+ struct wl_output *output);
+};
+
+/**
+ * @ingroup iface_wl_surface
+ */
+static inline int
+wl_surface_add_listener(struct wl_surface *wl_surface,
+ const struct wl_surface_listener *listener, void *data)
+{
+ return wl_proxy_add_listener((struct wl_proxy *) wl_surface,
+ (void (**)(void)) listener, data);
+}
+
+#define WL_SURFACE_DESTROY 0
+#define WL_SURFACE_ATTACH 1
+#define WL_SURFACE_DAMAGE 2
+#define WL_SURFACE_FRAME 3
+#define WL_SURFACE_SET_OPAQUE_REGION 4
+#define WL_SURFACE_SET_INPUT_REGION 5
+#define WL_SURFACE_COMMIT 6
+#define WL_SURFACE_SET_BUFFER_TRANSFORM 7
+#define WL_SURFACE_SET_BUFFER_SCALE 8
+#define WL_SURFACE_DAMAGE_BUFFER 9
+
+/**
+ * @ingroup iface_wl_surface
+ */
+#define WL_SURFACE_ENTER_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_surface
+ */
+#define WL_SURFACE_LEAVE_SINCE_VERSION 1
+
+/**
+ * @ingroup iface_wl_surface
+ */
+#define WL_SURFACE_DESTROY_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_surface
+ */
+#define WL_SURFACE_ATTACH_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_surface
+ */
+#define WL_SURFACE_DAMAGE_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_surface
+ */
+#define WL_SURFACE_FRAME_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_surface
+ */
+#define WL_SURFACE_SET_OPAQUE_REGION_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_surface
+ */
+#define WL_SURFACE_SET_INPUT_REGION_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_surface
+ */
+#define WL_SURFACE_COMMIT_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_surface
+ */
+#define WL_SURFACE_SET_BUFFER_TRANSFORM_SINCE_VERSION 2
+/**
+ * @ingroup iface_wl_surface
+ */
+#define WL_SURFACE_SET_BUFFER_SCALE_SINCE_VERSION 3
+/**
+ * @ingroup iface_wl_surface
+ */
+#define WL_SURFACE_DAMAGE_BUFFER_SINCE_VERSION 4
+
+/** @ingroup iface_wl_surface */
+static inline void
+wl_surface_set_user_data(struct wl_surface *wl_surface, void *user_data)
+{
+ wl_proxy_set_user_data((struct wl_proxy *) wl_surface, user_data);
+}
+
+/** @ingroup iface_wl_surface */
+static inline void *
+wl_surface_get_user_data(struct wl_surface *wl_surface)
+{
+ return wl_proxy_get_user_data((struct wl_proxy *) wl_surface);
+}
+
+static inline uint32_t
+wl_surface_get_version(struct wl_surface *wl_surface)
+{
+ return wl_proxy_get_version((struct wl_proxy *) wl_surface);
+}
+
+/**
+ * @ingroup iface_wl_surface
+ *
+ * Deletes the surface and invalidates its object ID.
+ */
+static inline void
+wl_surface_destroy(struct wl_surface *wl_surface)
+{
+ wl_proxy_marshal((struct wl_proxy *) wl_surface,
+ WL_SURFACE_DESTROY);
+
+ wl_proxy_destroy((struct wl_proxy *) wl_surface);
+}
+
+/**
+ * @ingroup iface_wl_surface
+ *
+ * Set a buffer as the content of this surface.
+ *
+ * The new size of the surface is calculated based on the buffer
+ * size transformed by the inverse buffer_transform and the
+ * inverse buffer_scale. This means that the supplied buffer
+ * must be an integer multiple of the buffer_scale.
+ *
+ * The x and y arguments specify the location of the new pending
+ * buffer's upper left corner, relative to the current buffer's upper
+ * left corner, in surface-local coordinates. In other words, the
+ * x and y, combined with the new surface size define in which
+ * directions the surface's size changes.
+ *
+ * Surface contents are double-buffered state, see wl_surface.commit.
+ *
+ * The initial surface contents are void; there is no content.
+ * wl_surface.attach assigns the given wl_buffer as the pending
+ * wl_buffer. wl_surface.commit makes the pending wl_buffer the new
+ * surface contents, and the size of the surface becomes the size
+ * calculated from the wl_buffer, as described above. After commit,
+ * there is no pending buffer until the next attach.
+ *
+ * Committing a pending wl_buffer allows the compositor to read the
+ * pixels in the wl_buffer. The compositor may access the pixels at
+ * any time after the wl_surface.commit request. When the compositor
+ * will not access the pixels anymore, it will send the
+ * wl_buffer.release event. Only after receiving wl_buffer.release,
+ * the client may reuse the wl_buffer. A wl_buffer that has been
+ * attached and then replaced by another attach instead of committed
+ * will not receive a release event, and is not used by the
+ * compositor.
+ *
+ * Destroying the wl_buffer after wl_buffer.release does not change
+ * the surface contents. However, if the client destroys the
+ * wl_buffer before receiving the wl_buffer.release event, the surface
+ * contents become undefined immediately.
+ *
+ * If wl_surface.attach is sent with a NULL wl_buffer, the
+ * following wl_surface.commit will remove the surface content.
+ */
+static inline void
+wl_surface_attach(struct wl_surface *wl_surface, struct wl_buffer *buffer, int32_t x, int32_t y)
+{
+ wl_proxy_marshal((struct wl_proxy *) wl_surface,
+ WL_SURFACE_ATTACH, buffer, x, y);
+}
+
+/**
+ * @ingroup iface_wl_surface
+ *
+ * This request is used to describe the regions where the pending
+ * buffer is different from the current surface contents, and where
+ * the surface therefore needs to be repainted. The compositor
+ * ignores the parts of the damage that fall outside of the surface.
+ *
+ * Damage is double-buffered state, see wl_surface.commit.
+ *
+ * The damage rectangle is specified in surface-local coordinates,
+ * where x and y specify the upper left corner of the damage rectangle.
+ *
+ * The initial value for pending damage is empty: no damage.
+ * wl_surface.damage adds pending damage: the new pending damage
+ * is the union of old pending damage and the given rectangle.
+ *
+ * wl_surface.commit assigns pending damage as the current damage,
+ * and clears pending damage. The server will clear the current
+ * damage as it repaints the surface.
+ *
+ * Alternatively, damage can be posted with wl_surface.damage_buffer
+ * which uses buffer coordinates instead of surface coordinates,
+ * and is probably the preferred and intuitive way of doing this.
+ */
+static inline void
+wl_surface_damage(struct wl_surface *wl_surface, int32_t x, int32_t y, int32_t width, int32_t height)
+{
+ wl_proxy_marshal((struct wl_proxy *) wl_surface,
+ WL_SURFACE_DAMAGE, x, y, width, height);
+}
+
+/**
+ * @ingroup iface_wl_surface
+ *
+ * Request a notification when it is a good time to start drawing a new
+ * frame, by creating a frame callback. This is useful for throttling
+ * redrawing operations, and driving animations.
+ *
+ * When a client is animating on a wl_surface, it can use the 'frame'
+ * request to get notified when it is a good time to draw and commit the
+ * next frame of animation. If the client commits an update earlier than
+ * that, it is likely that some updates will not make it to the display,
+ * and the client is wasting resources by drawing too often.
+ *
+ * The frame request will take effect on the next wl_surface.commit.
+ * The notification will only be posted for one frame unless
+ * requested again. For a wl_surface, the notifications are posted in
+ * the order the frame requests were committed.
+ *
+ * The server must send the notifications so that a client
+ * will not send excessive updates, while still allowing
+ * the highest possible update rate for clients that wait for the reply
+ * before drawing again. The server should give some time for the client
+ * to draw and commit after sending the frame callback events to let it
+ * hit the next output refresh.
+ *
+ * A server should avoid signaling the frame callbacks if the
+ * surface is not visible in any way, e.g. the surface is off-screen,
+ * or completely obscured by other opaque surfaces.
+ *
+ * The object returned by this request will be destroyed by the
+ * compositor after the callback is fired and as such the client must not
+ * attempt to use it after that point.
+ *
+ * The callback_data passed in the callback is the current time, in
+ * milliseconds, with an undefined base.
+ */
+static inline struct wl_callback *
+wl_surface_frame(struct wl_surface *wl_surface)
+{
+ struct wl_proxy *callback;
+
+ callback = wl_proxy_marshal_constructor((struct wl_proxy *) wl_surface,
+ WL_SURFACE_FRAME, &wl_callback_interface, NULL);
+
+ return (struct wl_callback *) callback;
+}
+
+/**
+ * @ingroup iface_wl_surface
+ *
+ * This request sets the region of the surface that contains
+ * opaque content.
+ *
+ * The opaque region is an optimization hint for the compositor
+ * that lets it optimize the redrawing of content behind opaque
+ * regions. Setting an opaque region is not required for correct
+ * behaviour, but marking transparent content as opaque will result
+ * in repaint artifacts.
+ *
+ * The opaque region is specified in surface-local coordinates.
+ *
+ * The compositor ignores the parts of the opaque region that fall
+ * outside of the surface.
+ *
+ * Opaque region is double-buffered state, see wl_surface.commit.
+ *
+ * wl_surface.set_opaque_region changes the pending opaque region.
+ * wl_surface.commit copies the pending region to the current region.
+ * Otherwise, the pending and current regions are never changed.
+ *
+ * The initial value for an opaque region is empty. Setting the pending
+ * opaque region has copy semantics, and the wl_region object can be
+ * destroyed immediately. A NULL wl_region causes the pending opaque
+ * region to be set to empty.
+ */
+static inline void
+wl_surface_set_opaque_region(struct wl_surface *wl_surface, struct wl_region *region)
+{
+ wl_proxy_marshal((struct wl_proxy *) wl_surface,
+ WL_SURFACE_SET_OPAQUE_REGION, region);
+}
+
+/**
+ * @ingroup iface_wl_surface
+ *
+ * This request sets the region of the surface that can receive
+ * pointer and touch events.
+ *
+ * Input events happening outside of this region will try the next
+ * surface in the server surface stack. The compositor ignores the
+ * parts of the input region that fall outside of the surface.
+ *
+ * The input region is specified in surface-local coordinates.
+ *
+ * Input region is double-buffered state, see wl_surface.commit.
+ *
+ * wl_surface.set_input_region changes the pending input region.
+ * wl_surface.commit copies the pending region to the current region.
+ * Otherwise the pending and current regions are never changed,
+ * except cursor and icon surfaces are special cases, see
+ * wl_pointer.set_cursor and wl_data_device.start_drag.
+ *
+ * The initial value for an input region is infinite. That means the
+ * whole surface will accept input. Setting the pending input region
+ * has copy semantics, and the wl_region object can be destroyed
+ * immediately. A NULL wl_region causes the input region to be set
+ * to infinite.
+ */
+static inline void
+wl_surface_set_input_region(struct wl_surface *wl_surface, struct wl_region *region)
+{
+ wl_proxy_marshal((struct wl_proxy *) wl_surface,
+ WL_SURFACE_SET_INPUT_REGION, region);
+}
+
+/**
+ * @ingroup iface_wl_surface
+ *
+ * Surface state (input, opaque, and damage regions, attached buffers,
+ * etc.) is double-buffered. Protocol requests modify the pending state,
+ * as opposed to the current state in use by the compositor. A commit
+ * request atomically applies all pending state, replacing the current
+ * state. After commit, the new pending state is as documented for each
+ * related request.
+ *
+ * On commit, a pending wl_buffer is applied first, and all other state
+ * second. This means that all coordinates in double-buffered state are
+ * relative to the new wl_buffer coming into use, except for
+ * wl_surface.attach itself. If there is no pending wl_buffer, the
+ * coordinates are relative to the current surface contents.
+ *
+ * All requests that need a commit to become effective are documented
+ * to affect double-buffered state.
+ *
+ * Other interfaces may add further double-buffered surface state.
+ */
+static inline void
+wl_surface_commit(struct wl_surface *wl_surface)
+{
+ wl_proxy_marshal((struct wl_proxy *) wl_surface,
+ WL_SURFACE_COMMIT);
+}
+
+/**
+ * @ingroup iface_wl_surface
+ *
+ * This request sets an optional transformation on how the compositor
+ * interprets the contents of the buffer attached to the surface. The
+ * accepted values for the transform parameter are the values for
+ * wl_output.transform.
+ *
+ * Buffer transform is double-buffered state, see wl_surface.commit.
+ *
+ * A newly created surface has its buffer transformation set to normal.
+ *
+ * wl_surface.set_buffer_transform changes the pending buffer
+ * transformation. wl_surface.commit copies the pending buffer
+ * transformation to the current one. Otherwise, the pending and current
+ * values are never changed.
+ *
+ * The purpose of this request is to allow clients to render content
+ * according to the output transform, thus permitting the compositor to
+ * use certain optimizations even if the display is rotated. Using
+ * hardware overlays and scanning out a client buffer for fullscreen
+ * surfaces are examples of such optimizations. Those optimizations are
+ * highly dependent on the compositor implementation, so the use of this
+ * request should be considered on a case-by-case basis.
+ *
+ * Note that if the transform value includes 90 or 270 degree rotation,
+ * the width of the buffer will become the surface height and the height
+ * of the buffer will become the surface width.
+ *
+ * If transform is not one of the values from the
+ * wl_output.transform enum the invalid_transform protocol error
+ * is raised.
+ */
+static inline void
+wl_surface_set_buffer_transform(struct wl_surface *wl_surface, int32_t transform)
+{
+ wl_proxy_marshal((struct wl_proxy *) wl_surface,
+ WL_SURFACE_SET_BUFFER_TRANSFORM, transform);
+}
+
+/**
+ * @ingroup iface_wl_surface
+ *
+ * This request sets an optional scaling factor on how the compositor
+ * interprets the contents of the buffer attached to the window.
+ *
+ * Buffer scale is double-buffered state, see wl_surface.commit.
+ *
+ * A newly created surface has its buffer scale set to 1.
+ *
+ * wl_surface.set_buffer_scale changes the pending buffer scale.
+ * wl_surface.commit copies the pending buffer scale to the current one.
+ * Otherwise, the pending and current values are never changed.
+ *
+ * The purpose of this request is to allow clients to supply higher
+ * resolution buffer data for use on high resolution outputs. It is
+ * intended that you pick the same buffer scale as the scale of the
+ * output that the surface is displayed on. This means the compositor
+ * can avoid scaling when rendering the surface on that output.
+ *
+ * Note that if the scale is larger than 1, then you have to attach
+ * a buffer that is larger (by a factor of scale in each dimension)
+ * than the desired surface size.
+ *
+ * If scale is not positive the invalid_scale protocol error is
+ * raised.
+ */
+static inline void
+wl_surface_set_buffer_scale(struct wl_surface *wl_surface, int32_t scale)
+{
+ wl_proxy_marshal((struct wl_proxy *) wl_surface,
+ WL_SURFACE_SET_BUFFER_SCALE, scale);
+}
+
+/**
+ * @ingroup iface_wl_surface
+ *
+ * This request is used to describe the regions where the pending
+ * buffer is different from the current surface contents, and where
+ * the surface therefore needs to be repainted. The compositor
+ * ignores the parts of the damage that fall outside of the surface.
+ *
+ * Damage is double-buffered state, see wl_surface.commit.
+ *
+ * The damage rectangle is specified in buffer coordinates,
+ * where x and y specify the upper left corner of the damage rectangle.
+ *
+ * The initial value for pending damage is empty: no damage.
+ * wl_surface.damage_buffer adds pending damage: the new pending
+ * damage is the union of old pending damage and the given rectangle.
+ *
+ * wl_surface.commit assigns pending damage as the current damage,
+ * and clears pending damage. The server will clear the current
+ * damage as it repaints the surface.
+ *
+ * This request differs from wl_surface.damage in only one way - it
+ * takes damage in buffer coordinates instead of surface-local
+ * coordinates. While this generally is more intuitive than surface
+ * coordinates, it is especially desirable when using wp_viewport
+ * or when a drawing library (like EGL) is unaware of buffer scale
+ * and buffer transform.
+ *
+ * Note: Because buffer transformation changes and damage requests may
+ * be interleaved in the protocol stream, it is impossible to determine
+ * the actual mapping between surface and buffer damage until
+ * wl_surface.commit time. Therefore, compositors wishing to take both
+ * kinds of damage into account will have to accumulate damage from the
+ * two requests separately and only transform from one to the other
+ * after receiving the wl_surface.commit.
+ */
+static inline void
+wl_surface_damage_buffer(struct wl_surface *wl_surface, int32_t x, int32_t y, int32_t width, int32_t height)
+{
+ wl_proxy_marshal((struct wl_proxy *) wl_surface,
+ WL_SURFACE_DAMAGE_BUFFER, x, y, width, height);
+}
+
+#ifndef WL_SEAT_CAPABILITY_ENUM
+#define WL_SEAT_CAPABILITY_ENUM
+/**
+ * @ingroup iface_wl_seat
+ * seat capability bitmask
+ *
+ * This is a bitmask of capabilities this seat has; if a member is
+ * set, then it is present on the seat.
+ */
+enum wl_seat_capability {
+ /**
+ * the seat has pointer devices
+ */
+ WL_SEAT_CAPABILITY_POINTER = 1,
+ /**
+ * the seat has one or more keyboards
+ */
+ WL_SEAT_CAPABILITY_KEYBOARD = 2,
+ /**
+ * the seat has touch devices
+ */
+ WL_SEAT_CAPABILITY_TOUCH = 4,
+};
+#endif /* WL_SEAT_CAPABILITY_ENUM */
+
+/**
+ * @ingroup iface_wl_seat
+ * @struct wl_seat_listener
+ */
+struct wl_seat_listener {
+ /**
+ * seat capabilities changed
+ *
+ * This is emitted whenever a seat gains or loses the pointer,
+ * keyboard or touch capabilities. The argument is a capability
+ * enum containing the complete set of capabilities this seat has.
+ *
+ * When the pointer capability is added, a client may create a
+ * wl_pointer object using the wl_seat.get_pointer request. This
+ * object will receive pointer events until the capability is
+ * removed in the future.
+ *
+ * When the pointer capability is removed, a client should destroy
+ * the wl_pointer objects associated with the seat where the
+ * capability was removed, using the wl_pointer.release request. No
+ * further pointer events will be received on these objects.
+ *
+ * In some compositors, if a seat regains the pointer capability
+ * and a client has a previously obtained wl_pointer object of
+ * version 4 or less, that object may start sending pointer events
+ * again. This behavior is considered a misinterpretation of the
+ * intended behavior and must not be relied upon by the client.
+ * wl_pointer objects of version 5 or later must not send events if
+ * created before the most recent event notifying the client of an
+ * added pointer capability.
+ *
+ * The above behavior also applies to wl_keyboard and wl_touch with
+ * the keyboard and touch capabilities, respectively.
+ * @param capabilities capabilities of the seat
+ */
+ void (*capabilities)(void *data,
+ struct wl_seat *wl_seat,
+ uint32_t capabilities);
+ /**
+ * unique identifier for this seat
+ *
+ * In a multiseat configuration this can be used by the client to
+ * help identify which physical devices the seat represents. Based
+ * on the seat configuration used by the compositor.
+ * @param name seat identifier
+ * @since 2
+ */
+ void (*name)(void *data,
+ struct wl_seat *wl_seat,
+ const char *name);
+};
+
+/**
+ * @ingroup iface_wl_seat
+ */
+static inline int
+wl_seat_add_listener(struct wl_seat *wl_seat,
+ const struct wl_seat_listener *listener, void *data)
+{
+ return wl_proxy_add_listener((struct wl_proxy *) wl_seat,
+ (void (**)(void)) listener, data);
+}
+
+#define WL_SEAT_GET_POINTER 0
+#define WL_SEAT_GET_KEYBOARD 1
+#define WL_SEAT_GET_TOUCH 2
+#define WL_SEAT_RELEASE 3
+
+/**
+ * @ingroup iface_wl_seat
+ */
+#define WL_SEAT_CAPABILITIES_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_seat
+ */
+#define WL_SEAT_NAME_SINCE_VERSION 2
+
+/**
+ * @ingroup iface_wl_seat
+ */
+#define WL_SEAT_GET_POINTER_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_seat
+ */
+#define WL_SEAT_GET_KEYBOARD_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_seat
+ */
+#define WL_SEAT_GET_TOUCH_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_seat
+ */
+#define WL_SEAT_RELEASE_SINCE_VERSION 5
+
+/** @ingroup iface_wl_seat */
+static inline void
+wl_seat_set_user_data(struct wl_seat *wl_seat, void *user_data)
+{
+ wl_proxy_set_user_data((struct wl_proxy *) wl_seat, user_data);
+}
+
+/** @ingroup iface_wl_seat */
+static inline void *
+wl_seat_get_user_data(struct wl_seat *wl_seat)
+{
+ return wl_proxy_get_user_data((struct wl_proxy *) wl_seat);
+}
+
+static inline uint32_t
+wl_seat_get_version(struct wl_seat *wl_seat)
+{
+ return wl_proxy_get_version((struct wl_proxy *) wl_seat);
+}
+
+/** @ingroup iface_wl_seat */
+static inline void
+wl_seat_destroy(struct wl_seat *wl_seat)
+{
+ wl_proxy_destroy((struct wl_proxy *) wl_seat);
+}
+
+/**
+ * @ingroup iface_wl_seat
+ *
+ * The ID provided will be initialized to the wl_pointer interface
+ * for this seat.
+ *
+ * This request only takes effect if the seat has the pointer
+ * capability, or has had the pointer capability in the past.
+ * It is a protocol violation to issue this request on a seat that has
+ * never had the pointer capability.
+ */
+static inline struct wl_pointer *
+wl_seat_get_pointer(struct wl_seat *wl_seat)
+{
+ struct wl_proxy *id;
+
+ id = wl_proxy_marshal_constructor((struct wl_proxy *) wl_seat,
+ WL_SEAT_GET_POINTER, &wl_pointer_interface, NULL);
+
+ return (struct wl_pointer *) id;
+}
+
+/**
+ * @ingroup iface_wl_seat
+ *
+ * The ID provided will be initialized to the wl_keyboard interface
+ * for this seat.
+ *
+ * This request only takes effect if the seat has the keyboard
+ * capability, or has had the keyboard capability in the past.
+ * It is a protocol violation to issue this request on a seat that has
+ * never had the keyboard capability.
+ */
+static inline struct wl_keyboard *
+wl_seat_get_keyboard(struct wl_seat *wl_seat)
+{
+ struct wl_proxy *id;
+
+ id = wl_proxy_marshal_constructor((struct wl_proxy *) wl_seat,
+ WL_SEAT_GET_KEYBOARD, &wl_keyboard_interface, NULL);
+
+ return (struct wl_keyboard *) id;
+}
+
+/**
+ * @ingroup iface_wl_seat
+ *
+ * The ID provided will be initialized to the wl_touch interface
+ * for this seat.
+ *
+ * This request only takes effect if the seat has the touch
+ * capability, or has had the touch capability in the past.
+ * It is a protocol violation to issue this request on a seat that has
+ * never had the touch capability.
+ */
+static inline struct wl_touch *
+wl_seat_get_touch(struct wl_seat *wl_seat)
+{
+ struct wl_proxy *id;
+
+ id = wl_proxy_marshal_constructor((struct wl_proxy *) wl_seat,
+ WL_SEAT_GET_TOUCH, &wl_touch_interface, NULL);
+
+ return (struct wl_touch *) id;
+}
+
+/**
+ * @ingroup iface_wl_seat
+ *
+ * Using this request a client can tell the server that it is not going to
+ * use the seat object anymore.
+ */
+static inline void
+wl_seat_release(struct wl_seat *wl_seat)
+{
+ wl_proxy_marshal((struct wl_proxy *) wl_seat,
+ WL_SEAT_RELEASE);
+
+ wl_proxy_destroy((struct wl_proxy *) wl_seat);
+}
+
+#ifndef WL_POINTER_ERROR_ENUM
+#define WL_POINTER_ERROR_ENUM
+enum wl_pointer_error {
+ /**
+ * given wl_surface has another role
+ */
+ WL_POINTER_ERROR_ROLE = 0,
+};
+#endif /* WL_POINTER_ERROR_ENUM */
+
+#ifndef WL_POINTER_BUTTON_STATE_ENUM
+#define WL_POINTER_BUTTON_STATE_ENUM
+/**
+ * @ingroup iface_wl_pointer
+ * physical button state
+ *
+ * Describes the physical state of a button that produced the button
+ * event.
+ */
+enum wl_pointer_button_state {
+ /**
+ * the button is not pressed
+ */
+ WL_POINTER_BUTTON_STATE_RELEASED = 0,
+ /**
+ * the button is pressed
+ */
+ WL_POINTER_BUTTON_STATE_PRESSED = 1,
+};
+#endif /* WL_POINTER_BUTTON_STATE_ENUM */
+
+#ifndef WL_POINTER_AXIS_ENUM
+#define WL_POINTER_AXIS_ENUM
+/**
+ * @ingroup iface_wl_pointer
+ * axis types
+ *
+ * Describes the axis types of scroll events.
+ */
+enum wl_pointer_axis {
+ /**
+ * vertical axis
+ */
+ WL_POINTER_AXIS_VERTICAL_SCROLL = 0,
+ /**
+ * horizontal axis
+ */
+ WL_POINTER_AXIS_HORIZONTAL_SCROLL = 1,
+};
+#endif /* WL_POINTER_AXIS_ENUM */
+
+#ifndef WL_POINTER_AXIS_SOURCE_ENUM
+#define WL_POINTER_AXIS_SOURCE_ENUM
+/**
+ * @ingroup iface_wl_pointer
+ * axis source types
+ *
+ * Describes the source types for axis events. This indicates to the
+ * client how an axis event was physically generated; a client may
+ * adjust the user interface accordingly. For example, scroll events
+ * from a "finger" source may be in a smooth coordinate space with
+ * kinetic scrolling whereas a "wheel" source may be in discrete steps
+ * of a number of lines.
+ *
+ * The "continuous" axis source is a device generating events in a
+ * continuous coordinate space, but using something other than a
+ * finger. One example for this source is button-based scrolling where
+ * the vertical motion of a device is converted to scroll events while
+ * a button is held down.
+ *
+ * The "wheel tilt" axis source indicates that the actual device is a
+ * wheel but the scroll event is not caused by a rotation but a
+ * (usually sideways) tilt of the wheel.
+ */
+enum wl_pointer_axis_source {
+ /**
+ * a physical wheel rotation
+ */
+ WL_POINTER_AXIS_SOURCE_WHEEL = 0,
+ /**
+ * finger on a touch surface
+ */
+ WL_POINTER_AXIS_SOURCE_FINGER = 1,
+ /**
+ * continuous coordinate space
+ */
+ WL_POINTER_AXIS_SOURCE_CONTINUOUS = 2,
+ /**
+ * a physical wheel tilt
+ * @since 6
+ */
+ WL_POINTER_AXIS_SOURCE_WHEEL_TILT = 3,
+};
+/**
+ * @ingroup iface_wl_pointer
+ */
+#define WL_POINTER_AXIS_SOURCE_WHEEL_TILT_SINCE_VERSION 6
+#endif /* WL_POINTER_AXIS_SOURCE_ENUM */
+
+/**
+ * @ingroup iface_wl_pointer
+ * @struct wl_pointer_listener
+ */
+struct wl_pointer_listener {
+ /**
+ * enter event
+ *
+ * Notification that this seat's pointer is focused on a certain
+ * surface.
+ *
+ * When a seat's focus enters a surface, the pointer image is
+ * undefined and a client should respond to this event by setting
+ * an appropriate pointer image with the set_cursor request.
+ * @param serial serial number of the enter event
+ * @param surface surface entered by the pointer
+ * @param surface_x surface-local x coordinate
+ * @param surface_y surface-local y coordinate
+ */
+ void (*enter)(void *data,
+ struct wl_pointer *wl_pointer,
+ uint32_t serial,
+ struct wl_surface *surface,
+ wl_fixed_t surface_x,
+ wl_fixed_t surface_y);
+ /**
+ * leave event
+ *
+ * Notification that this seat's pointer is no longer focused on
+ * a certain surface.
+ *
+ * The leave notification is sent before the enter notification for
+ * the new focus.
+ * @param serial serial number of the leave event
+ * @param surface surface left by the pointer
+ */
+ void (*leave)(void *data,
+ struct wl_pointer *wl_pointer,
+ uint32_t serial,
+ struct wl_surface *surface);
+ /**
+ * pointer motion event
+ *
+ * Notification of pointer location change. The arguments
+ * surface_x and surface_y are the location relative to the focused
+ * surface.
+ * @param time timestamp with millisecond granularity
+ * @param surface_x surface-local x coordinate
+ * @param surface_y surface-local y coordinate
+ */
+ void (*motion)(void *data,
+ struct wl_pointer *wl_pointer,
+ uint32_t time,
+ wl_fixed_t surface_x,
+ wl_fixed_t surface_y);
+ /**
+ * pointer button event
+ *
+ * Mouse button click and release notifications.
+ *
+ * The location of the click is given by the last motion or enter
+ * event. The time argument is a timestamp with millisecond
+ * granularity, with an undefined base.
+ *
+ * The button is a button code as defined in the Linux kernel's
+ * linux/input-event-codes.h header file, e.g. BTN_LEFT.
+ *
+ * Any 16-bit button code value is reserved for future additions to
+ * the kernel's event code list. All other button codes above
+ * 0xFFFF are currently undefined but may be used in future
+ * versions of this protocol.
+ * @param serial serial number of the button event
+ * @param time timestamp with millisecond granularity
+ * @param button button that produced the event
+ * @param state physical state of the button
+ */
+ void (*button)(void *data,
+ struct wl_pointer *wl_pointer,
+ uint32_t serial,
+ uint32_t time,
+ uint32_t button,
+ uint32_t state);
+ /**
+ * axis event
+ *
+ * Scroll and other axis notifications.
+ *
+ * For scroll events (vertical and horizontal scroll axes), the
+ * value parameter is the length of a vector along the specified
+ * axis in a coordinate space identical to those of motion events,
+ * representing a relative movement along the specified axis.
+ *
+ * For devices that support movements non-parallel to axes multiple
+ * axis events will be emitted.
+ *
+ * When applicable, for example for touch pads, the server can
+ * choose to emit scroll events where the motion vector is
+ * equivalent to a motion event vector.
+ *
+ * When applicable, a client can transform its content relative to
+ * the scroll distance.
+ * @param time timestamp with millisecond granularity
+ * @param axis axis type
+ * @param value length of vector in surface-local coordinate space
+ */
+ void (*axis)(void *data,
+ struct wl_pointer *wl_pointer,
+ uint32_t time,
+ uint32_t axis,
+ wl_fixed_t value);
+ /**
+ * end of a pointer event sequence
+ *
+ * Indicates the end of a set of events that logically belong
+ * together. A client is expected to accumulate the data in all
+ * events within the frame before proceeding.
+ *
+ * All wl_pointer events before a wl_pointer.frame event belong
+ * logically together. For example, in a diagonal scroll motion the
+ * compositor will send an optional wl_pointer.axis_source event,
+ * two wl_pointer.axis events (horizontal and vertical) and finally
+ * a wl_pointer.frame event. The client may use this information to
+ * calculate a diagonal vector for scrolling.
+ *
+ * When multiple wl_pointer.axis events occur within the same
+ * frame, the motion vector is the combined motion of all events.
+ * When a wl_pointer.axis and a wl_pointer.axis_stop event occur
+ * within the same frame, this indicates that axis movement in one
+ * axis has stopped but continues in the other axis. When multiple
+ * wl_pointer.axis_stop events occur within the same frame, this
+ * indicates that these axes stopped in the same instance.
+ *
+ * A wl_pointer.frame event is sent for every logical event group,
+ * even if the group only contains a single wl_pointer event.
+ * Specifically, a client may get a sequence: motion, frame,
+ * button, frame, axis, frame, axis_stop, frame.
+ *
+ * The wl_pointer.enter and wl_pointer.leave events are logical
+ * events generated by the compositor and not the hardware. These
+ * events are also grouped by a wl_pointer.frame. When a pointer
+ * moves from one surface to another, a compositor should group the
+ * wl_pointer.leave event within the same wl_pointer.frame.
+ * However, a client must not rely on wl_pointer.leave and
+ * wl_pointer.enter being in the same wl_pointer.frame.
+ * Compositor-specific policies may require the wl_pointer.leave
+ * and wl_pointer.enter event being split across multiple
+ * wl_pointer.frame groups.
+ * @since 5
+ */
+ void (*frame)(void *data,
+ struct wl_pointer *wl_pointer);
+ /**
+ * axis source event
+ *
+ * Source information for scroll and other axes.
+ *
+ * This event does not occur on its own. It is sent before a
+ * wl_pointer.frame event and carries the source information for
+ * all events within that frame.
+ *
+ * The source specifies how this event was generated. If the source
+ * is wl_pointer.axis_source.finger, a wl_pointer.axis_stop event
+ * will be sent when the user lifts the finger off the device.
+ *
+ * If the source is wl_pointer.axis_source.wheel,
+ * wl_pointer.axis_source.wheel_tilt or
+ * wl_pointer.axis_source.continuous, a wl_pointer.axis_stop event
+ * may or may not be sent. Whether a compositor sends an axis_stop
+ * event for these sources is hardware-specific and
+ * implementation-dependent; clients must not rely on receiving an
+ * axis_stop event for these scroll sources and should treat scroll
+ * sequences from these scroll sources as unterminated by default.
+ *
+ * This event is optional. If the source is unknown for a
+ * particular axis event sequence, no event is sent. Only one
+ * wl_pointer.axis_source event is permitted per frame.
+ *
+ * The order of wl_pointer.axis_discrete and wl_pointer.axis_source
+ * is not guaranteed.
+ * @param axis_source source of the axis event
+ * @since 5
+ */
+ void (*axis_source)(void *data,
+ struct wl_pointer *wl_pointer,
+ uint32_t axis_source);
+ /**
+ * axis stop event
+ *
+ * Stop notification for scroll and other axes.
+ *
+ * For some wl_pointer.axis_source types, a wl_pointer.axis_stop
+ * event is sent to notify a client that the axis sequence has
+ * terminated. This enables the client to implement kinetic
+ * scrolling. See the wl_pointer.axis_source documentation for
+ * information on when this event may be generated.
+ *
+ * Any wl_pointer.axis events with the same axis_source after this
+ * event should be considered as the start of a new axis motion.
+ *
+ * The timestamp is to be interpreted identical to the timestamp in
+ * the wl_pointer.axis event. The timestamp value may be the same
+ * as a preceding wl_pointer.axis event.
+ * @param time timestamp with millisecond granularity
+ * @param axis the axis stopped with this event
+ * @since 5
+ */
+ void (*axis_stop)(void *data,
+ struct wl_pointer *wl_pointer,
+ uint32_t time,
+ uint32_t axis);
+ /**
+ * axis click event
+ *
+ * Discrete step information for scroll and other axes.
+ *
+ * This event carries the axis value of the wl_pointer.axis event
+ * in discrete steps (e.g. mouse wheel clicks).
+ *
+ * This event does not occur on its own, it is coupled with a
+ * wl_pointer.axis event that represents this axis value on a
+ * continuous scale. The protocol guarantees that each
+ * axis_discrete event is always followed by exactly one axis event
+ * with the same axis number within the same wl_pointer.frame. Note
+ * that the protocol allows for other events to occur between the
+ * axis_discrete and its coupled axis event, including other
+ * axis_discrete or axis events.
+ *
+ * This event is optional; continuous scrolling devices like
+ * two-finger scrolling on touchpads do not have discrete steps and
+ * do not generate this event.
+ *
+ * The discrete value carries the directional information. e.g. a
+ * value of -2 is two steps towards the negative direction of this
+ * axis.
+ *
+ * The axis number is identical to the axis number in the
+ * associated axis event.
+ *
+ * The order of wl_pointer.axis_discrete and wl_pointer.axis_source
+ * is not guaranteed.
+ * @param axis axis type
+ * @param discrete number of steps
+ * @since 5
+ */
+ void (*axis_discrete)(void *data,
+ struct wl_pointer *wl_pointer,
+ uint32_t axis,
+ int32_t discrete);
+};
+
+/**
+ * @ingroup iface_wl_pointer
+ */
+static inline int
+wl_pointer_add_listener(struct wl_pointer *wl_pointer,
+ const struct wl_pointer_listener *listener, void *data)
+{
+ return wl_proxy_add_listener((struct wl_proxy *) wl_pointer,
+ (void (**)(void)) listener, data);
+}
+
+#define WL_POINTER_SET_CURSOR 0
+#define WL_POINTER_RELEASE 1
+
+/**
+ * @ingroup iface_wl_pointer
+ */
+#define WL_POINTER_ENTER_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_pointer
+ */
+#define WL_POINTER_LEAVE_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_pointer
+ */
+#define WL_POINTER_MOTION_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_pointer
+ */
+#define WL_POINTER_BUTTON_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_pointer
+ */
+#define WL_POINTER_AXIS_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_pointer
+ */
+#define WL_POINTER_FRAME_SINCE_VERSION 5
+/**
+ * @ingroup iface_wl_pointer
+ */
+#define WL_POINTER_AXIS_SOURCE_SINCE_VERSION 5
+/**
+ * @ingroup iface_wl_pointer
+ */
+#define WL_POINTER_AXIS_STOP_SINCE_VERSION 5
+/**
+ * @ingroup iface_wl_pointer
+ */
+#define WL_POINTER_AXIS_DISCRETE_SINCE_VERSION 5
+
+/**
+ * @ingroup iface_wl_pointer
+ */
+#define WL_POINTER_SET_CURSOR_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_pointer
+ */
+#define WL_POINTER_RELEASE_SINCE_VERSION 3
+
+/** @ingroup iface_wl_pointer */
+static inline void
+wl_pointer_set_user_data(struct wl_pointer *wl_pointer, void *user_data)
+{
+ wl_proxy_set_user_data((struct wl_proxy *) wl_pointer, user_data);
+}
+
+/** @ingroup iface_wl_pointer */
+static inline void *
+wl_pointer_get_user_data(struct wl_pointer *wl_pointer)
+{
+ return wl_proxy_get_user_data((struct wl_proxy *) wl_pointer);
+}
+
+static inline uint32_t
+wl_pointer_get_version(struct wl_pointer *wl_pointer)
+{
+ return wl_proxy_get_version((struct wl_proxy *) wl_pointer);
+}
+
+/** @ingroup iface_wl_pointer */
+static inline void
+wl_pointer_destroy(struct wl_pointer *wl_pointer)
+{
+ wl_proxy_destroy((struct wl_proxy *) wl_pointer);
+}
+
+/**
+ * @ingroup iface_wl_pointer
+ *
+ * Set the pointer surface, i.e., the surface that contains the
+ * pointer image (cursor). This request gives the surface the role
+ * of a cursor. If the surface already has another role, it raises
+ * a protocol error.
+ *
+ * The cursor actually changes only if the pointer
+ * focus for this device is one of the requesting client's surfaces
+ * or the surface parameter is the current pointer surface. If
+ * there was a previous surface set with this request it is
+ * replaced. If surface is NULL, the pointer image is hidden.
+ *
+ * The parameters hotspot_x and hotspot_y define the position of
+ * the pointer surface relative to the pointer location. Its
+ * top-left corner is always at (x, y) - (hotspot_x, hotspot_y),
+ * where (x, y) are the coordinates of the pointer location, in
+ * surface-local coordinates.
+ *
+ * On surface.attach requests to the pointer surface, hotspot_x
+ * and hotspot_y are decremented by the x and y parameters
+ * passed to the request. Attach must be confirmed by
+ * wl_surface.commit as usual.
+ *
+ * The hotspot can also be updated by passing the currently set
+ * pointer surface to this request with new values for hotspot_x
+ * and hotspot_y.
+ *
+ * The current and pending input regions of the wl_surface are
+ * cleared, and wl_surface.set_input_region is ignored until the
+ * wl_surface is no longer used as the cursor. When the use as a
+ * cursor ends, the current and pending input regions become
+ * undefined, and the wl_surface is unmapped.
+ */
+static inline void
+wl_pointer_set_cursor(struct wl_pointer *wl_pointer, uint32_t serial, struct wl_surface *surface, int32_t hotspot_x, int32_t hotspot_y)
+{
+ wl_proxy_marshal((struct wl_proxy *) wl_pointer,
+ WL_POINTER_SET_CURSOR, serial, surface, hotspot_x, hotspot_y);
+}
+
+/**
+ * @ingroup iface_wl_pointer
+ *
+ * Using this request a client can tell the server that it is not going to
+ * use the pointer object anymore.
+ *
+ * This request destroys the pointer proxy object, so clients must not call
+ * wl_pointer_destroy() after using this request.
+ */
+static inline void
+wl_pointer_release(struct wl_pointer *wl_pointer)
+{
+ wl_proxy_marshal((struct wl_proxy *) wl_pointer,
+ WL_POINTER_RELEASE);
+
+ wl_proxy_destroy((struct wl_proxy *) wl_pointer);
+}
+
+#ifndef WL_KEYBOARD_KEYMAP_FORMAT_ENUM
+#define WL_KEYBOARD_KEYMAP_FORMAT_ENUM
+/**
+ * @ingroup iface_wl_keyboard
+ * keyboard mapping format
+ *
+ * This specifies the format of the keymap provided to the
+ * client with the wl_keyboard.keymap event.
+ */
+enum wl_keyboard_keymap_format {
+ /**
+ * no keymap; client must understand how to interpret the raw keycode
+ */
+ WL_KEYBOARD_KEYMAP_FORMAT_NO_KEYMAP = 0,
+ /**
+ * libxkbcommon compatible; to determine the xkb keycode, clients must add 8 to the key event keycode
+ */
+ WL_KEYBOARD_KEYMAP_FORMAT_XKB_V1 = 1,
+};
+#endif /* WL_KEYBOARD_KEYMAP_FORMAT_ENUM */
+
+#ifndef WL_KEYBOARD_KEY_STATE_ENUM
+#define WL_KEYBOARD_KEY_STATE_ENUM
+/**
+ * @ingroup iface_wl_keyboard
+ * physical key state
+ *
+ * Describes the physical state of a key that produced the key event.
+ */
+enum wl_keyboard_key_state {
+ /**
+ * key is not pressed
+ */
+ WL_KEYBOARD_KEY_STATE_RELEASED = 0,
+ /**
+ * key is pressed
+ */
+ WL_KEYBOARD_KEY_STATE_PRESSED = 1,
+};
+#endif /* WL_KEYBOARD_KEY_STATE_ENUM */
+
+/**
+ * @ingroup iface_wl_keyboard
+ * @struct wl_keyboard_listener
+ */
+struct wl_keyboard_listener {
+ /**
+ * keyboard mapping
+ *
+ * This event provides a file descriptor to the client which can
+ * be memory-mapped to provide a keyboard mapping description.
+ * @param format keymap format
+ * @param fd keymap file descriptor
+ * @param size keymap size, in bytes
+ */
+ void (*keymap)(void *data,
+ struct wl_keyboard *wl_keyboard,
+ uint32_t format,
+ int32_t fd,
+ uint32_t size);
+ /**
+ * enter event
+ *
+ * Notification that this seat's keyboard focus is on a certain
+ * surface.
+ * @param serial serial number of the enter event
+ * @param surface surface gaining keyboard focus
+ * @param keys the currently pressed keys
+ */
+ void (*enter)(void *data,
+ struct wl_keyboard *wl_keyboard,
+ uint32_t serial,
+ struct wl_surface *surface,
+ struct wl_array *keys);
+ /**
+ * leave event
+ *
+ * Notification that this seat's keyboard focus is no longer on a
+ * certain surface.
+ *
+ * The leave notification is sent before the enter notification for
+ * the new focus.
+ * @param serial serial number of the leave event
+ * @param surface surface that lost keyboard focus
+ */
+ void (*leave)(void *data,
+ struct wl_keyboard *wl_keyboard,
+ uint32_t serial,
+ struct wl_surface *surface);
+ /**
+ * key event
+ *
+ * A key was pressed or released. The time argument is a
+ * timestamp with millisecond granularity, with an undefined base.
+ * @param serial serial number of the key event
+ * @param time timestamp with millisecond granularity
+ * @param key key that produced the event
+ * @param state physical state of the key
+ */
+ void (*key)(void *data,
+ struct wl_keyboard *wl_keyboard,
+ uint32_t serial,
+ uint32_t time,
+ uint32_t key,
+ uint32_t state);
+ /**
+ * modifier and group state
+ *
+ * Notifies clients that the modifier and/or group state has
+ * changed, and it should update its local state.
+ * @param serial serial number of the modifiers event
+ * @param mods_depressed depressed modifiers
+ * @param mods_latched latched modifiers
+ * @param mods_locked locked modifiers
+ * @param group keyboard layout
+ */
+ void (*modifiers)(void *data,
+ struct wl_keyboard *wl_keyboard,
+ uint32_t serial,
+ uint32_t mods_depressed,
+ uint32_t mods_latched,
+ uint32_t mods_locked,
+ uint32_t group);
+ /**
+ * repeat rate and delay
+ *
+ * Informs the client about the keyboard's repeat rate and delay.
+ *
+ * This event is sent as soon as the wl_keyboard object has been
+ * created, and is guaranteed to be received by the client before
+ * any key press event.
+ *
+ * Negative values for either rate or delay are illegal. A rate of
+ * zero will disable any repeating (regardless of the value of
+ * delay).
+ *
+ * This event can be sent later on as well with a new value if
+ * necessary, so clients should continue listening for the event
+ * past the creation of wl_keyboard.
+ * @param rate the rate of repeating keys in characters per second
+ * @param delay delay in milliseconds since key down until repeating starts
+ * @since 4
+ */
+ void (*repeat_info)(void *data,
+ struct wl_keyboard *wl_keyboard,
+ int32_t rate,
+ int32_t delay);
+};
+
+/**
+ * @ingroup iface_wl_keyboard
+ */
+static inline int
+wl_keyboard_add_listener(struct wl_keyboard *wl_keyboard,
+ const struct wl_keyboard_listener *listener, void *data)
+{
+ return wl_proxy_add_listener((struct wl_proxy *) wl_keyboard,
+ (void (**)(void)) listener, data);
+}
+
+#define WL_KEYBOARD_RELEASE 0
+
+/**
+ * @ingroup iface_wl_keyboard
+ */
+#define WL_KEYBOARD_KEYMAP_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_keyboard
+ */
+#define WL_KEYBOARD_ENTER_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_keyboard
+ */
+#define WL_KEYBOARD_LEAVE_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_keyboard
+ */
+#define WL_KEYBOARD_KEY_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_keyboard
+ */
+#define WL_KEYBOARD_MODIFIERS_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_keyboard
+ */
+#define WL_KEYBOARD_REPEAT_INFO_SINCE_VERSION 4
+
+/**
+ * @ingroup iface_wl_keyboard
+ */
+#define WL_KEYBOARD_RELEASE_SINCE_VERSION 3
+
+/** @ingroup iface_wl_keyboard */
+static inline void
+wl_keyboard_set_user_data(struct wl_keyboard *wl_keyboard, void *user_data)
+{
+ wl_proxy_set_user_data((struct wl_proxy *) wl_keyboard, user_data);
+}
+
+/** @ingroup iface_wl_keyboard */
+static inline void *
+wl_keyboard_get_user_data(struct wl_keyboard *wl_keyboard)
+{
+ return wl_proxy_get_user_data((struct wl_proxy *) wl_keyboard);
+}
+
+static inline uint32_t
+wl_keyboard_get_version(struct wl_keyboard *wl_keyboard)
+{
+ return wl_proxy_get_version((struct wl_proxy *) wl_keyboard);
+}
+
+/** @ingroup iface_wl_keyboard */
+static inline void
+wl_keyboard_destroy(struct wl_keyboard *wl_keyboard)
+{
+ wl_proxy_destroy((struct wl_proxy *) wl_keyboard);
+}
+
+/**
+ * @ingroup iface_wl_keyboard
+ */
+static inline void
+wl_keyboard_release(struct wl_keyboard *wl_keyboard)
+{
+ wl_proxy_marshal((struct wl_proxy *) wl_keyboard,
+ WL_KEYBOARD_RELEASE);
+
+ wl_proxy_destroy((struct wl_proxy *) wl_keyboard);
+}
+
+/**
+ * @ingroup iface_wl_touch
+ * @struct wl_touch_listener
+ */
+struct wl_touch_listener {
+ /**
+ * touch down event and beginning of a touch sequence
+ *
+ * A new touch point has appeared on the surface. This touch
+ * point is assigned a unique ID. Future events from this touch
+ * point reference this ID. The ID ceases to be valid after a touch
+ * up event and may be reused in the future.
+ * @param serial serial number of the touch down event
+ * @param time timestamp with millisecond granularity
+ * @param surface surface touched
+ * @param id the unique ID of this touch point
+ * @param x surface-local x coordinate
+ * @param y surface-local y coordinate
+ */
+ void (*down)(void *data,
+ struct wl_touch *wl_touch,
+ uint32_t serial,
+ uint32_t time,
+ struct wl_surface *surface,
+ int32_t id,
+ wl_fixed_t x,
+ wl_fixed_t y);
+ /**
+ * end of a touch event sequence
+ *
+ * The touch point has disappeared. No further events will be
+ * sent for this touch point and the touch point's ID is released
+ * and may be reused in a future touch down event.
+ * @param serial serial number of the touch up event
+ * @param time timestamp with millisecond granularity
+ * @param id the unique ID of this touch point
+ */
+ void (*up)(void *data,
+ struct wl_touch *wl_touch,
+ uint32_t serial,
+ uint32_t time,
+ int32_t id);
+ /**
+ * update of touch point coordinates
+ *
+ * A touch point has changed coordinates.
+ * @param time timestamp with millisecond granularity
+ * @param id the unique ID of this touch point
+ * @param x surface-local x coordinate
+ * @param y surface-local y coordinate
+ */
+ void (*motion)(void *data,
+ struct wl_touch *wl_touch,
+ uint32_t time,
+ int32_t id,
+ wl_fixed_t x,
+ wl_fixed_t y);
+ /**
+ * end of touch frame event
+ *
+ * Indicates the end of a set of events that logically belong
+ * together. A client is expected to accumulate the data in all
+ * events within the frame before proceeding.
+ *
+ * A wl_touch.frame terminates at least one event but otherwise no
+ * guarantee is provided about the set of events within a frame. A
+ * client must assume that any state not updated in a frame is
+ * unchanged from the previously known state.
+ */
+ void (*frame)(void *data,
+ struct wl_touch *wl_touch);
+ /**
+ * touch session cancelled
+ *
+ * Sent if the compositor decides the touch stream is a global
+ * gesture. No further events are sent to the clients from that
+ * particular gesture. Touch cancellation applies to all touch
+ * points currently active on this client's surface. The client is
+ * responsible for finalizing the touch points, future touch points
+ * on this surface may reuse the touch point ID.
+ */
+ void (*cancel)(void *data,
+ struct wl_touch *wl_touch);
+ /**
+ * update shape of touch point
+ *
+ * Sent when a touchpoint has changed its shape.
+ *
+ * This event does not occur on its own. It is sent before a
+ * wl_touch.frame event and carries the new shape information for
+ * any previously reported, or new touch points of that frame.
+ *
+ * Other events describing the touch point such as wl_touch.down,
+ * wl_touch.motion or wl_touch.orientation may be sent within the
+ * same wl_touch.frame. A client should treat these events as a
+ * single logical touch point update. The order of wl_touch.shape,
+ * wl_touch.orientation and wl_touch.motion is not guaranteed. A
+ * wl_touch.down event is guaranteed to occur before the first
+ * wl_touch.shape event for this touch ID but both events may occur
+ * within the same wl_touch.frame.
+ *
+ * A touchpoint shape is approximated by an ellipse through the
+ * major and minor axis length. The major axis length describes the
+ * longer diameter of the ellipse, while the minor axis length
+ * describes the shorter diameter. Major and minor are orthogonal
+ * and both are specified in surface-local coordinates. The center
+ * of the ellipse is always at the touchpoint location as reported
+ * by wl_touch.down or wl_touch.move.
+ *
+ * This event is only sent by the compositor if the touch device
+ * supports shape reports. The client has to make reasonable
+ * assumptions about the shape if it did not receive this event.
+ * @param id the unique ID of this touch point
+ * @param major length of the major axis in surface-local coordinates
+ * @param minor length of the minor axis in surface-local coordinates
+ * @since 6
+ */
+ void (*shape)(void *data,
+ struct wl_touch *wl_touch,
+ int32_t id,
+ wl_fixed_t major,
+ wl_fixed_t minor);
+ /**
+ * update orientation of touch point
+ *
+ * Sent when a touchpoint has changed its orientation.
+ *
+ * This event does not occur on its own. It is sent before a
+ * wl_touch.frame event and carries the new shape information for
+ * any previously reported, or new touch points of that frame.
+ *
+ * Other events describing the touch point such as wl_touch.down,
+ * wl_touch.motion or wl_touch.shape may be sent within the same
+ * wl_touch.frame. A client should treat these events as a single
+ * logical touch point update. The order of wl_touch.shape,
+ * wl_touch.orientation and wl_touch.motion is not guaranteed. A
+ * wl_touch.down event is guaranteed to occur before the first
+ * wl_touch.orientation event for this touch ID but both events may
+ * occur within the same wl_touch.frame.
+ *
+ * The orientation describes the clockwise angle of a touchpoint's
+ * major axis to the positive surface y-axis and is normalized to
+ * the -180 to +180 degree range. The granularity of orientation
+ * depends on the touch device, some devices only support binary
+ * rotation values between 0 and 90 degrees.
+ *
+ * This event is only sent by the compositor if the touch device
+ * supports orientation reports.
+ * @param id the unique ID of this touch point
+ * @param orientation angle between major axis and positive surface y-axis in degrees
+ * @since 6
+ */
+ void (*orientation)(void *data,
+ struct wl_touch *wl_touch,
+ int32_t id,
+ wl_fixed_t orientation);
+};
+
+/**
+ * @ingroup iface_wl_touch
+ */
+static inline int
+wl_touch_add_listener(struct wl_touch *wl_touch,
+ const struct wl_touch_listener *listener, void *data)
+{
+ return wl_proxy_add_listener((struct wl_proxy *) wl_touch,
+ (void (**)(void)) listener, data);
+}
+
+#define WL_TOUCH_RELEASE 0
+
+/**
+ * @ingroup iface_wl_touch
+ */
+#define WL_TOUCH_DOWN_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_touch
+ */
+#define WL_TOUCH_UP_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_touch
+ */
+#define WL_TOUCH_MOTION_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_touch
+ */
+#define WL_TOUCH_FRAME_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_touch
+ */
+#define WL_TOUCH_CANCEL_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_touch
+ */
+#define WL_TOUCH_SHAPE_SINCE_VERSION 6
+/**
+ * @ingroup iface_wl_touch
+ */
+#define WL_TOUCH_ORIENTATION_SINCE_VERSION 6
+
+/**
+ * @ingroup iface_wl_touch
+ */
+#define WL_TOUCH_RELEASE_SINCE_VERSION 3
+
+/** @ingroup iface_wl_touch */
+static inline void
+wl_touch_set_user_data(struct wl_touch *wl_touch, void *user_data)
+{
+ wl_proxy_set_user_data((struct wl_proxy *) wl_touch, user_data);
+}
+
+/** @ingroup iface_wl_touch */
+static inline void *
+wl_touch_get_user_data(struct wl_touch *wl_touch)
+{
+ return wl_proxy_get_user_data((struct wl_proxy *) wl_touch);
+}
+
+static inline uint32_t
+wl_touch_get_version(struct wl_touch *wl_touch)
+{
+ return wl_proxy_get_version((struct wl_proxy *) wl_touch);
+}
+
+/** @ingroup iface_wl_touch */
+static inline void
+wl_touch_destroy(struct wl_touch *wl_touch)
+{
+ wl_proxy_destroy((struct wl_proxy *) wl_touch);
+}
+
+/**
+ * @ingroup iface_wl_touch
+ */
+static inline void
+wl_touch_release(struct wl_touch *wl_touch)
+{
+ wl_proxy_marshal((struct wl_proxy *) wl_touch,
+ WL_TOUCH_RELEASE);
+
+ wl_proxy_destroy((struct wl_proxy *) wl_touch);
+}
+
+#ifndef WL_OUTPUT_SUBPIXEL_ENUM
+#define WL_OUTPUT_SUBPIXEL_ENUM
+/**
+ * @ingroup iface_wl_output
+ * subpixel geometry information
+ *
+ * This enumeration describes how the physical
+ * pixels on an output are laid out.
+ */
+enum wl_output_subpixel {
+ /**
+ * unknown geometry
+ */
+ WL_OUTPUT_SUBPIXEL_UNKNOWN = 0,
+ /**
+ * no geometry
+ */
+ WL_OUTPUT_SUBPIXEL_NONE = 1,
+ /**
+ * horizontal RGB
+ */
+ WL_OUTPUT_SUBPIXEL_HORIZONTAL_RGB = 2,
+ /**
+ * horizontal BGR
+ */
+ WL_OUTPUT_SUBPIXEL_HORIZONTAL_BGR = 3,
+ /**
+ * vertical RGB
+ */
+ WL_OUTPUT_SUBPIXEL_VERTICAL_RGB = 4,
+ /**
+ * vertical BGR
+ */
+ WL_OUTPUT_SUBPIXEL_VERTICAL_BGR = 5,
+};
+#endif /* WL_OUTPUT_SUBPIXEL_ENUM */
+
+#ifndef WL_OUTPUT_TRANSFORM_ENUM
+#define WL_OUTPUT_TRANSFORM_ENUM
+/**
+ * @ingroup iface_wl_output
+ * transform from framebuffer to output
+ *
+ * This describes the transform that a compositor will apply to a
+ * surface to compensate for the rotation or mirroring of an
+ * output device.
+ *
+ * The flipped values correspond to an initial flip around a
+ * vertical axis followed by rotation.
+ *
+ * The purpose is mainly to allow clients to render accordingly and
+ * tell the compositor, so that for fullscreen surfaces, the
+ * compositor will still be able to scan out directly from client
+ * surfaces.
+ */
+enum wl_output_transform {
+ /**
+ * no transform
+ */
+ WL_OUTPUT_TRANSFORM_NORMAL = 0,
+ /**
+ * 90 degrees counter-clockwise
+ */
+ WL_OUTPUT_TRANSFORM_90 = 1,
+ /**
+ * 180 degrees counter-clockwise
+ */
+ WL_OUTPUT_TRANSFORM_180 = 2,
+ /**
+ * 270 degrees counter-clockwise
+ */
+ WL_OUTPUT_TRANSFORM_270 = 3,
+ /**
+ * 180 degree flip around a vertical axis
+ */
+ WL_OUTPUT_TRANSFORM_FLIPPED = 4,
+ /**
+ * flip and rotate 90 degrees counter-clockwise
+ */
+ WL_OUTPUT_TRANSFORM_FLIPPED_90 = 5,
+ /**
+ * flip and rotate 180 degrees counter-clockwise
+ */
+ WL_OUTPUT_TRANSFORM_FLIPPED_180 = 6,
+ /**
+ * flip and rotate 270 degrees counter-clockwise
+ */
+ WL_OUTPUT_TRANSFORM_FLIPPED_270 = 7,
+};
+#endif /* WL_OUTPUT_TRANSFORM_ENUM */
+
+#ifndef WL_OUTPUT_MODE_ENUM
+#define WL_OUTPUT_MODE_ENUM
+/**
+ * @ingroup iface_wl_output
+ * mode information
+ *
+ * These flags describe properties of an output mode.
+ * They are used in the flags bitfield of the mode event.
+ */
+enum wl_output_mode {
+ /**
+ * indicates this is the current mode
+ */
+ WL_OUTPUT_MODE_CURRENT = 0x1,
+ /**
+ * indicates this is the preferred mode
+ */
+ WL_OUTPUT_MODE_PREFERRED = 0x2,
+};
+#endif /* WL_OUTPUT_MODE_ENUM */
+
+/**
+ * @ingroup iface_wl_output
+ * @struct wl_output_listener
+ */
+struct wl_output_listener {
+ /**
+ * properties of the output
+ *
+ * The geometry event describes geometric properties of the
+ * output. The event is sent when binding to the output object and
+ * whenever any of the properties change.
+ * @param x x position within the global compositor space
+ * @param y y position within the global compositor space
+ * @param physical_width width in millimeters of the output
+ * @param physical_height height in millimeters of the output
+ * @param subpixel subpixel orientation of the output
+ * @param make textual description of the manufacturer
+ * @param model textual description of the model
+ * @param transform transform that maps framebuffer to output
+ */
+ void (*geometry)(void *data,
+ struct wl_output *wl_output,
+ int32_t x,
+ int32_t y,
+ int32_t physical_width,
+ int32_t physical_height,
+ int32_t subpixel,
+ const char *make,
+ const char *model,
+ int32_t transform);
+ /**
+ * advertise available modes for the output
+ *
+ * The mode event describes an available mode for the output.
+ *
+ * The event is sent when binding to the output object and there
+ * will always be one mode, the current mode. The event is sent
+ * again if an output changes mode, for the mode that is now
+ * current. In other words, the current mode is always the last
+ * mode that was received with the current flag set.
+ *
+ * The size of a mode is given in physical hardware units of the
+ * output device. This is not necessarily the same as the output
+ * size in the global compositor space. For instance, the output
+ * may be scaled, as described in wl_output.scale, or transformed,
+ * as described in wl_output.transform.
+ * @param flags bitfield of mode flags
+ * @param width width of the mode in hardware units
+ * @param height height of the mode in hardware units
+ * @param refresh vertical refresh rate in mHz
+ */
+ void (*mode)(void *data,
+ struct wl_output *wl_output,
+ uint32_t flags,
+ int32_t width,
+ int32_t height,
+ int32_t refresh);
+ /**
+ * sent all information about output
+ *
+ * This event is sent after all other properties have been sent
+ * after binding to the output object and after any other property
+ * changes done after that. This allows changes to the output
+ * properties to be seen as atomic, even if they happen via
+ * multiple events.
+ * @since 2
+ */
+ void (*done)(void *data,
+ struct wl_output *wl_output);
+ /**
+ * output scaling properties
+ *
+ * This event contains scaling geometry information that is not
+ * in the geometry event. It may be sent after binding the output
+ * object or if the output scale changes later. If it is not sent,
+ * the client should assume a scale of 1.
+ *
+ * A scale larger than 1 means that the compositor will
+ * automatically scale surface buffers by this amount when
+ * rendering. This is used for very high resolution displays where
+ * applications rendering at the native resolution would be too
+ * small to be legible.
+ *
+ * It is intended that scaling aware clients track the current
+ * output of a surface, and if it is on a scaled output it should
+ * use wl_surface.set_buffer_scale with the scale of the output.
+ * That way the compositor can avoid scaling the surface, and the
+ * client can supply a higher detail image.
+ * @param factor scaling factor of output
+ * @since 2
+ */
+ void (*scale)(void *data,
+ struct wl_output *wl_output,
+ int32_t factor);
+};
+
+/**
+ * @ingroup iface_wl_output
+ */
+static inline int
+wl_output_add_listener(struct wl_output *wl_output,
+ const struct wl_output_listener *listener, void *data)
+{
+ return wl_proxy_add_listener((struct wl_proxy *) wl_output,
+ (void (**)(void)) listener, data);
+}
+
+#define WL_OUTPUT_RELEASE 0
+
+/**
+ * @ingroup iface_wl_output
+ */
+#define WL_OUTPUT_GEOMETRY_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_output
+ */
+#define WL_OUTPUT_MODE_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_output
+ */
+#define WL_OUTPUT_DONE_SINCE_VERSION 2
+/**
+ * @ingroup iface_wl_output
+ */
+#define WL_OUTPUT_SCALE_SINCE_VERSION 2
+
+/**
+ * @ingroup iface_wl_output
+ */
+#define WL_OUTPUT_RELEASE_SINCE_VERSION 3
+
+/** @ingroup iface_wl_output */
+static inline void
+wl_output_set_user_data(struct wl_output *wl_output, void *user_data)
+{
+ wl_proxy_set_user_data((struct wl_proxy *) wl_output, user_data);
+}
+
+/** @ingroup iface_wl_output */
+static inline void *
+wl_output_get_user_data(struct wl_output *wl_output)
+{
+ return wl_proxy_get_user_data((struct wl_proxy *) wl_output);
+}
+
+static inline uint32_t
+wl_output_get_version(struct wl_output *wl_output)
+{
+ return wl_proxy_get_version((struct wl_proxy *) wl_output);
+}
+
+/** @ingroup iface_wl_output */
+static inline void
+wl_output_destroy(struct wl_output *wl_output)
+{
+ wl_proxy_destroy((struct wl_proxy *) wl_output);
+}
+
+/**
+ * @ingroup iface_wl_output
+ *
+ * Using this request a client can tell the server that it is not going to
+ * use the output object anymore.
+ */
+static inline void
+wl_output_release(struct wl_output *wl_output)
+{
+ wl_proxy_marshal((struct wl_proxy *) wl_output,
+ WL_OUTPUT_RELEASE);
+
+ wl_proxy_destroy((struct wl_proxy *) wl_output);
+}
+
+#define WL_REGION_DESTROY 0
+#define WL_REGION_ADD 1
+#define WL_REGION_SUBTRACT 2
+
+
+/**
+ * @ingroup iface_wl_region
+ */
+#define WL_REGION_DESTROY_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_region
+ */
+#define WL_REGION_ADD_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_region
+ */
+#define WL_REGION_SUBTRACT_SINCE_VERSION 1
+
+/** @ingroup iface_wl_region */
+static inline void
+wl_region_set_user_data(struct wl_region *wl_region, void *user_data)
+{
+ wl_proxy_set_user_data((struct wl_proxy *) wl_region, user_data);
+}
+
+/** @ingroup iface_wl_region */
+static inline void *
+wl_region_get_user_data(struct wl_region *wl_region)
+{
+ return wl_proxy_get_user_data((struct wl_proxy *) wl_region);
+}
+
+static inline uint32_t
+wl_region_get_version(struct wl_region *wl_region)
+{
+ return wl_proxy_get_version((struct wl_proxy *) wl_region);
+}
+
+/**
+ * @ingroup iface_wl_region
+ *
+ * Destroy the region. This will invalidate the object ID.
+ */
+static inline void
+wl_region_destroy(struct wl_region *wl_region)
+{
+ wl_proxy_marshal((struct wl_proxy *) wl_region,
+ WL_REGION_DESTROY);
+
+ wl_proxy_destroy((struct wl_proxy *) wl_region);
+}
+
+/**
+ * @ingroup iface_wl_region
+ *
+ * Add the specified rectangle to the region.
+ */
+static inline void
+wl_region_add(struct wl_region *wl_region, int32_t x, int32_t y, int32_t width, int32_t height)
+{
+ wl_proxy_marshal((struct wl_proxy *) wl_region,
+ WL_REGION_ADD, x, y, width, height);
+}
+
+/**
+ * @ingroup iface_wl_region
+ *
+ * Subtract the specified rectangle from the region.
+ */
+static inline void
+wl_region_subtract(struct wl_region *wl_region, int32_t x, int32_t y, int32_t width, int32_t height)
+{
+ wl_proxy_marshal((struct wl_proxy *) wl_region,
+ WL_REGION_SUBTRACT, x, y, width, height);
+}
+
+#ifndef WL_SUBCOMPOSITOR_ERROR_ENUM
+#define WL_SUBCOMPOSITOR_ERROR_ENUM
+enum wl_subcompositor_error {
+ /**
+ * the to-be sub-surface is invalid
+ */
+ WL_SUBCOMPOSITOR_ERROR_BAD_SURFACE = 0,
+};
+#endif /* WL_SUBCOMPOSITOR_ERROR_ENUM */
+
+#define WL_SUBCOMPOSITOR_DESTROY 0
+#define WL_SUBCOMPOSITOR_GET_SUBSURFACE 1
+
+
+/**
+ * @ingroup iface_wl_subcompositor
+ */
+#define WL_SUBCOMPOSITOR_DESTROY_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_subcompositor
+ */
+#define WL_SUBCOMPOSITOR_GET_SUBSURFACE_SINCE_VERSION 1
+
+/** @ingroup iface_wl_subcompositor */
+static inline void
+wl_subcompositor_set_user_data(struct wl_subcompositor *wl_subcompositor, void *user_data)
+{
+ wl_proxy_set_user_data((struct wl_proxy *) wl_subcompositor, user_data);
+}
+
+/** @ingroup iface_wl_subcompositor */
+static inline void *
+wl_subcompositor_get_user_data(struct wl_subcompositor *wl_subcompositor)
+{
+ return wl_proxy_get_user_data((struct wl_proxy *) wl_subcompositor);
+}
+
+static inline uint32_t
+wl_subcompositor_get_version(struct wl_subcompositor *wl_subcompositor)
+{
+ return wl_proxy_get_version((struct wl_proxy *) wl_subcompositor);
+}
+
+/**
+ * @ingroup iface_wl_subcompositor
+ *
+ * Informs the server that the client will not be using this
+ * protocol object anymore. This does not affect any other
+ * objects, wl_subsurface objects included.
+ */
+static inline void
+wl_subcompositor_destroy(struct wl_subcompositor *wl_subcompositor)
+{
+ wl_proxy_marshal((struct wl_proxy *) wl_subcompositor,
+ WL_SUBCOMPOSITOR_DESTROY);
+
+ wl_proxy_destroy((struct wl_proxy *) wl_subcompositor);
+}
+
+/**
+ * @ingroup iface_wl_subcompositor
+ *
+ * Create a sub-surface interface for the given surface, and
+ * associate it with the given parent surface. This turns a
+ * plain wl_surface into a sub-surface.
+ *
+ * The to-be sub-surface must not already have another role, and it
+ * must not have an existing wl_subsurface object. Otherwise a protocol
+ * error is raised.
+ */
+static inline struct wl_subsurface *
+wl_subcompositor_get_subsurface(struct wl_subcompositor *wl_subcompositor, struct wl_surface *surface, struct wl_surface *parent)
+{
+ struct wl_proxy *id;
+
+ id = wl_proxy_marshal_constructor((struct wl_proxy *) wl_subcompositor,
+ WL_SUBCOMPOSITOR_GET_SUBSURFACE, &wl_subsurface_interface, NULL, surface, parent);
+
+ return (struct wl_subsurface *) id;
+}
+
+#ifndef WL_SUBSURFACE_ERROR_ENUM
+#define WL_SUBSURFACE_ERROR_ENUM
+enum wl_subsurface_error {
+ /**
+ * wl_surface is not a sibling or the parent
+ */
+ WL_SUBSURFACE_ERROR_BAD_SURFACE = 0,
+};
+#endif /* WL_SUBSURFACE_ERROR_ENUM */
+
+#define WL_SUBSURFACE_DESTROY 0
+#define WL_SUBSURFACE_SET_POSITION 1
+#define WL_SUBSURFACE_PLACE_ABOVE 2
+#define WL_SUBSURFACE_PLACE_BELOW 3
+#define WL_SUBSURFACE_SET_SYNC 4
+#define WL_SUBSURFACE_SET_DESYNC 5
+
+
+/**
+ * @ingroup iface_wl_subsurface
+ */
+#define WL_SUBSURFACE_DESTROY_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_subsurface
+ */
+#define WL_SUBSURFACE_SET_POSITION_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_subsurface
+ */
+#define WL_SUBSURFACE_PLACE_ABOVE_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_subsurface
+ */
+#define WL_SUBSURFACE_PLACE_BELOW_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_subsurface
+ */
+#define WL_SUBSURFACE_SET_SYNC_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_subsurface
+ */
+#define WL_SUBSURFACE_SET_DESYNC_SINCE_VERSION 1
+
+/** @ingroup iface_wl_subsurface */
+static inline void
+wl_subsurface_set_user_data(struct wl_subsurface *wl_subsurface, void *user_data)
+{
+ wl_proxy_set_user_data((struct wl_proxy *) wl_subsurface, user_data);
+}
+
+/** @ingroup iface_wl_subsurface */
+static inline void *
+wl_subsurface_get_user_data(struct wl_subsurface *wl_subsurface)
+{
+ return wl_proxy_get_user_data((struct wl_proxy *) wl_subsurface);
+}
+
+static inline uint32_t
+wl_subsurface_get_version(struct wl_subsurface *wl_subsurface)
+{
+ return wl_proxy_get_version((struct wl_proxy *) wl_subsurface);
+}
+
+/**
+ * @ingroup iface_wl_subsurface
+ *
+ * The sub-surface interface is removed from the wl_surface object
+ * that was turned into a sub-surface with a
+ * wl_subcompositor.get_subsurface request. The wl_surface's association
+ * to the parent is deleted, and the wl_surface loses its role as
+ * a sub-surface. The wl_surface is unmapped.
+ */
+static inline void
+wl_subsurface_destroy(struct wl_subsurface *wl_subsurface)
+{
+ wl_proxy_marshal((struct wl_proxy *) wl_subsurface,
+ WL_SUBSURFACE_DESTROY);
+
+ wl_proxy_destroy((struct wl_proxy *) wl_subsurface);
+}
+
+/**
+ * @ingroup iface_wl_subsurface
+ *
+ * This schedules a sub-surface position change.
+ * The sub-surface will be moved so that its origin (top left
+ * corner pixel) will be at the location x, y of the parent surface
+ * coordinate system. The coordinates are not restricted to the parent
+ * surface area. Negative values are allowed.
+ *
+ * The scheduled coordinates will take effect whenever the state of the
+ * parent surface is applied. When this happens depends on whether the
+ * parent surface is in synchronized mode or not. See
+ * wl_subsurface.set_sync and wl_subsurface.set_desync for details.
+ *
+ * If more than one set_position request is invoked by the client before
+ * the commit of the parent surface, the position of a new request always
+ * replaces the scheduled position from any previous request.
+ *
+ * The initial position is 0, 0.
+ */
+static inline void
+wl_subsurface_set_position(struct wl_subsurface *wl_subsurface, int32_t x, int32_t y)
+{
+ wl_proxy_marshal((struct wl_proxy *) wl_subsurface,
+ WL_SUBSURFACE_SET_POSITION, x, y);
+}
+
+/**
+ * @ingroup iface_wl_subsurface
+ *
+ * This sub-surface is taken from the stack, and put back just
+ * above the reference surface, changing the z-order of the sub-surfaces.
+ * The reference surface must be one of the sibling surfaces, or the
+ * parent surface. Using any other surface, including this sub-surface,
+ * will cause a protocol error.
+ *
+ * The z-order is double-buffered. Requests are handled in order and
+ * applied immediately to a pending state. The final pending state is
+ * copied to the active state the next time the state of the parent
+ * surface is applied. When this happens depends on whether the parent
+ * surface is in synchronized mode or not. See wl_subsurface.set_sync and
+ * wl_subsurface.set_desync for details.
+ *
+ * A new sub-surface is initially added as the top-most in the stack
+ * of its siblings and parent.
+ */
+static inline void
+wl_subsurface_place_above(struct wl_subsurface *wl_subsurface, struct wl_surface *sibling)
+{
+ wl_proxy_marshal((struct wl_proxy *) wl_subsurface,
+ WL_SUBSURFACE_PLACE_ABOVE, sibling);
+}
+
+/**
+ * @ingroup iface_wl_subsurface
+ *
+ * The sub-surface is placed just below the reference surface.
+ * See wl_subsurface.place_above.
+ */
+static inline void
+wl_subsurface_place_below(struct wl_subsurface *wl_subsurface, struct wl_surface *sibling)
+{
+ wl_proxy_marshal((struct wl_proxy *) wl_subsurface,
+ WL_SUBSURFACE_PLACE_BELOW, sibling);
+}
+
+/**
+ * @ingroup iface_wl_subsurface
+ *
+ * Change the commit behaviour of the sub-surface to synchronized
+ * mode, also described as the parent dependent mode.
+ *
+ * In synchronized mode, wl_surface.commit on a sub-surface will
+ * accumulate the committed state in a cache, but the state will
+ * not be applied and hence will not change the compositor output.
+ * The cached state is applied to the sub-surface immediately after
+ * the parent surface's state is applied. This ensures atomic
+ * updates of the parent and all its synchronized sub-surfaces.
+ * Applying the cached state will invalidate the cache, so further
+ * parent surface commits do not (re-)apply old state.
+ *
+ * See wl_subsurface for the recursive effect of this mode.
+ */
+static inline void
+wl_subsurface_set_sync(struct wl_subsurface *wl_subsurface)
+{
+ wl_proxy_marshal((struct wl_proxy *) wl_subsurface,
+ WL_SUBSURFACE_SET_SYNC);
+}
+
+/**
+ * @ingroup iface_wl_subsurface
+ *
+ * Change the commit behaviour of the sub-surface to desynchronized
+ * mode, also described as independent or freely running mode.
+ *
+ * In desynchronized mode, wl_surface.commit on a sub-surface will
+ * apply the pending state directly, without caching, as happens
+ * normally with a wl_surface. Calling wl_surface.commit on the
+ * parent surface has no effect on the sub-surface's wl_surface
+ * state. This mode allows a sub-surface to be updated on its own.
+ *
+ * If cached state exists when wl_surface.commit is called in
+ * desynchronized mode, the pending state is added to the cached
+ * state, and applied as a whole. This invalidates the cache.
+ *
+ * Note: even if a sub-surface is set to desynchronized, a parent
+ * sub-surface may override it to behave as synchronized. For details,
+ * see wl_subsurface.
+ *
+ * If a surface's parent surface behaves as desynchronized, then
+ * the cached state is applied on set_desync.
+ */
+static inline void
+wl_subsurface_set_desync(struct wl_subsurface *wl_subsurface)
+{
+ wl_proxy_marshal((struct wl_proxy *) wl_subsurface,
+ WL_SUBSURFACE_SET_DESYNC);
+}
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/chromium/third_party/wayland/include/protocol/wayland-server-protocol-core.h b/chromium/third_party/wayland/include/protocol/wayland-server-protocol-core.h
new file mode 100644
index 00000000000..df439c944e0
--- /dev/null
+++ b/chromium/third_party/wayland/include/protocol/wayland-server-protocol-core.h
@@ -0,0 +1,4335 @@
+/* Generated by wayland-scanner 1.13.0 */
+
+#ifndef WAYLAND_SERVER_PROTOCOL_H
+#define WAYLAND_SERVER_PROTOCOL_H
+
+#include <stdint.h>
+#include <stddef.h>
+#include "wayland-server-core.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct wl_client;
+struct wl_resource;
+
+/**
+ * @page page_wayland The wayland protocol
+ * @section page_ifaces_wayland Interfaces
+ * - @subpage page_iface_wl_display - core global object
+ * - @subpage page_iface_wl_registry - global registry object
+ * - @subpage page_iface_wl_callback - callback object
+ * - @subpage page_iface_wl_compositor - the compositor singleton
+ * - @subpage page_iface_wl_shm_pool - a shared memory pool
+ * - @subpage page_iface_wl_shm - shared memory support
+ * - @subpage page_iface_wl_buffer - content for a wl_surface
+ * - @subpage page_iface_wl_data_offer - offer to transfer data
+ * - @subpage page_iface_wl_data_source - offer to transfer data
+ * - @subpage page_iface_wl_data_device - data transfer device
+ * - @subpage page_iface_wl_data_device_manager - data transfer interface
+ * - @subpage page_iface_wl_shell - create desktop-style surfaces
+ * - @subpage page_iface_wl_shell_surface - desktop-style metadata interface
+ * - @subpage page_iface_wl_surface - an onscreen surface
+ * - @subpage page_iface_wl_seat - group of input devices
+ * - @subpage page_iface_wl_pointer - pointer input device
+ * - @subpage page_iface_wl_keyboard - keyboard input device
+ * - @subpage page_iface_wl_touch - touchscreen input device
+ * - @subpage page_iface_wl_output - compositor output region
+ * - @subpage page_iface_wl_region - region interface
+ * - @subpage page_iface_wl_subcompositor - sub-surface compositing
+ * - @subpage page_iface_wl_subsurface - sub-surface interface to a wl_surface
+ * @section page_copyright_wayland Copyright
+ * <pre>
+ *
+ * Copyright © 2008-2011 Kristian Høgsberg
+ * Copyright © 2010-2011 Intel Corporation
+ * Copyright © 2012-2013 Collabora, Ltd.
+ *
+ * Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation files
+ * (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial
+ * portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ * </pre>
+ */
+struct wl_buffer;
+struct wl_callback;
+struct wl_compositor;
+struct wl_data_device;
+struct wl_data_device_manager;
+struct wl_data_offer;
+struct wl_data_source;
+struct wl_display;
+struct wl_keyboard;
+struct wl_output;
+struct wl_pointer;
+struct wl_region;
+struct wl_registry;
+struct wl_seat;
+struct wl_shell;
+struct wl_shell_surface;
+struct wl_shm;
+struct wl_shm_pool;
+struct wl_subcompositor;
+struct wl_subsurface;
+struct wl_surface;
+struct wl_touch;
+
+/**
+ * @page page_iface_wl_display wl_display
+ * @section page_iface_wl_display_desc Description
+ *
+ * The core global object. This is a special singleton object. It
+ * is used for internal Wayland protocol features.
+ * @section page_iface_wl_display_api API
+ * See @ref iface_wl_display.
+ */
+/**
+ * @defgroup iface_wl_display The wl_display interface
+ *
+ * The core global object. This is a special singleton object. It
+ * is used for internal Wayland protocol features.
+ */
+extern const struct wl_interface wl_display_interface;
+/**
+ * @page page_iface_wl_registry wl_registry
+ * @section page_iface_wl_registry_desc Description
+ *
+ * The singleton global registry object. The server has a number of
+ * global objects that are available to all clients. These objects
+ * typically represent an actual object in the server (for example,
+ * an input device) or they are singleton objects that provide
+ * extension functionality.
+ *
+ * When a client creates a registry object, the registry object
+ * will emit a global event for each global currently in the
+ * registry. Globals come and go as a result of device or
+ * monitor hotplugs, reconfiguration or other events, and the
+ * registry will send out global and global_remove events to
+ * keep the client up to date with the changes. To mark the end
+ * of the initial burst of events, the client can use the
+ * wl_display.sync request immediately after calling
+ * wl_display.get_registry.
+ *
+ * A client can bind to a global object by using the bind
+ * request. This creates a client-side handle that lets the object
+ * emit events to the client and lets the client invoke requests on
+ * the object.
+ * @section page_iface_wl_registry_api API
+ * See @ref iface_wl_registry.
+ */
+/**
+ * @defgroup iface_wl_registry The wl_registry interface
+ *
+ * The singleton global registry object. The server has a number of
+ * global objects that are available to all clients. These objects
+ * typically represent an actual object in the server (for example,
+ * an input device) or they are singleton objects that provide
+ * extension functionality.
+ *
+ * When a client creates a registry object, the registry object
+ * will emit a global event for each global currently in the
+ * registry. Globals come and go as a result of device or
+ * monitor hotplugs, reconfiguration or other events, and the
+ * registry will send out global and global_remove events to
+ * keep the client up to date with the changes. To mark the end
+ * of the initial burst of events, the client can use the
+ * wl_display.sync request immediately after calling
+ * wl_display.get_registry.
+ *
+ * A client can bind to a global object by using the bind
+ * request. This creates a client-side handle that lets the object
+ * emit events to the client and lets the client invoke requests on
+ * the object.
+ */
+extern const struct wl_interface wl_registry_interface;
+/**
+ * @page page_iface_wl_callback wl_callback
+ * @section page_iface_wl_callback_desc Description
+ *
+ * Clients can handle the 'done' event to get notified when
+ * the related request is done.
+ * @section page_iface_wl_callback_api API
+ * See @ref iface_wl_callback.
+ */
+/**
+ * @defgroup iface_wl_callback The wl_callback interface
+ *
+ * Clients can handle the 'done' event to get notified when
+ * the related request is done.
+ */
+extern const struct wl_interface wl_callback_interface;
+/**
+ * @page page_iface_wl_compositor wl_compositor
+ * @section page_iface_wl_compositor_desc Description
+ *
+ * A compositor. This object is a singleton global. The
+ * compositor is in charge of combining the contents of multiple
+ * surfaces into one displayable output.
+ * @section page_iface_wl_compositor_api API
+ * See @ref iface_wl_compositor.
+ */
+/**
+ * @defgroup iface_wl_compositor The wl_compositor interface
+ *
+ * A compositor. This object is a singleton global. The
+ * compositor is in charge of combining the contents of multiple
+ * surfaces into one displayable output.
+ */
+extern const struct wl_interface wl_compositor_interface;
+/**
+ * @page page_iface_wl_shm_pool wl_shm_pool
+ * @section page_iface_wl_shm_pool_desc Description
+ *
+ * The wl_shm_pool object encapsulates a piece of memory shared
+ * between the compositor and client. Through the wl_shm_pool
+ * object, the client can allocate shared memory wl_buffer objects.
+ * All objects created through the same pool share the same
+ * underlying mapped memory. Reusing the mapped memory avoids the
+ * setup/teardown overhead and is useful when interactively resizing
+ * a surface or for many small buffers.
+ * @section page_iface_wl_shm_pool_api API
+ * See @ref iface_wl_shm_pool.
+ */
+/**
+ * @defgroup iface_wl_shm_pool The wl_shm_pool interface
+ *
+ * The wl_shm_pool object encapsulates a piece of memory shared
+ * between the compositor and client. Through the wl_shm_pool
+ * object, the client can allocate shared memory wl_buffer objects.
+ * All objects created through the same pool share the same
+ * underlying mapped memory. Reusing the mapped memory avoids the
+ * setup/teardown overhead and is useful when interactively resizing
+ * a surface or for many small buffers.
+ */
+extern const struct wl_interface wl_shm_pool_interface;
+/**
+ * @page page_iface_wl_shm wl_shm
+ * @section page_iface_wl_shm_desc Description
+ *
+ * A singleton global object that provides support for shared
+ * memory.
+ *
+ * Clients can create wl_shm_pool objects using the create_pool
+ * request.
+ *
+ * At connection setup time, the wl_shm object emits one or more
+ * format events to inform clients about the valid pixel formats
+ * that can be used for buffers.
+ * @section page_iface_wl_shm_api API
+ * See @ref iface_wl_shm.
+ */
+/**
+ * @defgroup iface_wl_shm The wl_shm interface
+ *
+ * A singleton global object that provides support for shared
+ * memory.
+ *
+ * Clients can create wl_shm_pool objects using the create_pool
+ * request.
+ *
+ * At connection setup time, the wl_shm object emits one or more
+ * format events to inform clients about the valid pixel formats
+ * that can be used for buffers.
+ */
+extern const struct wl_interface wl_shm_interface;
+/**
+ * @page page_iface_wl_buffer wl_buffer
+ * @section page_iface_wl_buffer_desc Description
+ *
+ * A buffer provides the content for a wl_surface. Buffers are
+ * created through factory interfaces such as wl_drm, wl_shm or
+ * similar. It has a width and a height and can be attached to a
+ * wl_surface, but the mechanism by which a client provides and
+ * updates the contents is defined by the buffer factory interface.
+ * @section page_iface_wl_buffer_api API
+ * See @ref iface_wl_buffer.
+ */
+/**
+ * @defgroup iface_wl_buffer The wl_buffer interface
+ *
+ * A buffer provides the content for a wl_surface. Buffers are
+ * created through factory interfaces such as wl_drm, wl_shm or
+ * similar. It has a width and a height and can be attached to a
+ * wl_surface, but the mechanism by which a client provides and
+ * updates the contents is defined by the buffer factory interface.
+ */
+extern const struct wl_interface wl_buffer_interface;
+/**
+ * @page page_iface_wl_data_offer wl_data_offer
+ * @section page_iface_wl_data_offer_desc Description
+ *
+ * A wl_data_offer represents a piece of data offered for transfer
+ * by another client (the source client). It is used by the
+ * copy-and-paste and drag-and-drop mechanisms. The offer
+ * describes the different mime types that the data can be
+ * converted to and provides the mechanism for transferring the
+ * data directly from the source client.
+ * @section page_iface_wl_data_offer_api API
+ * See @ref iface_wl_data_offer.
+ */
+/**
+ * @defgroup iface_wl_data_offer The wl_data_offer interface
+ *
+ * A wl_data_offer represents a piece of data offered for transfer
+ * by another client (the source client). It is used by the
+ * copy-and-paste and drag-and-drop mechanisms. The offer
+ * describes the different mime types that the data can be
+ * converted to and provides the mechanism for transferring the
+ * data directly from the source client.
+ */
+extern const struct wl_interface wl_data_offer_interface;
+/**
+ * @page page_iface_wl_data_source wl_data_source
+ * @section page_iface_wl_data_source_desc Description
+ *
+ * The wl_data_source object is the source side of a wl_data_offer.
+ * It is created by the source client in a data transfer and
+ * provides a way to describe the offered data and a way to respond
+ * to requests to transfer the data.
+ * @section page_iface_wl_data_source_api API
+ * See @ref iface_wl_data_source.
+ */
+/**
+ * @defgroup iface_wl_data_source The wl_data_source interface
+ *
+ * The wl_data_source object is the source side of a wl_data_offer.
+ * It is created by the source client in a data transfer and
+ * provides a way to describe the offered data and a way to respond
+ * to requests to transfer the data.
+ */
+extern const struct wl_interface wl_data_source_interface;
+/**
+ * @page page_iface_wl_data_device wl_data_device
+ * @section page_iface_wl_data_device_desc Description
+ *
+ * There is one wl_data_device per seat which can be obtained
+ * from the global wl_data_device_manager singleton.
+ *
+ * A wl_data_device provides access to inter-client data transfer
+ * mechanisms such as copy-and-paste and drag-and-drop.
+ * @section page_iface_wl_data_device_api API
+ * See @ref iface_wl_data_device.
+ */
+/**
+ * @defgroup iface_wl_data_device The wl_data_device interface
+ *
+ * There is one wl_data_device per seat which can be obtained
+ * from the global wl_data_device_manager singleton.
+ *
+ * A wl_data_device provides access to inter-client data transfer
+ * mechanisms such as copy-and-paste and drag-and-drop.
+ */
+extern const struct wl_interface wl_data_device_interface;
+/**
+ * @page page_iface_wl_data_device_manager wl_data_device_manager
+ * @section page_iface_wl_data_device_manager_desc Description
+ *
+ * The wl_data_device_manager is a singleton global object that
+ * provides access to inter-client data transfer mechanisms such as
+ * copy-and-paste and drag-and-drop. These mechanisms are tied to
+ * a wl_seat and this interface lets a client get a wl_data_device
+ * corresponding to a wl_seat.
+ *
+ * Depending on the version bound, the objects created from the bound
+ * wl_data_device_manager object will have different requirements for
+ * functioning properly. See wl_data_source.set_actions,
+ * wl_data_offer.accept and wl_data_offer.finish for details.
+ * @section page_iface_wl_data_device_manager_api API
+ * See @ref iface_wl_data_device_manager.
+ */
+/**
+ * @defgroup iface_wl_data_device_manager The wl_data_device_manager interface
+ *
+ * The wl_data_device_manager is a singleton global object that
+ * provides access to inter-client data transfer mechanisms such as
+ * copy-and-paste and drag-and-drop. These mechanisms are tied to
+ * a wl_seat and this interface lets a client get a wl_data_device
+ * corresponding to a wl_seat.
+ *
+ * Depending on the version bound, the objects created from the bound
+ * wl_data_device_manager object will have different requirements for
+ * functioning properly. See wl_data_source.set_actions,
+ * wl_data_offer.accept and wl_data_offer.finish for details.
+ */
+extern const struct wl_interface wl_data_device_manager_interface;
+/**
+ * @page page_iface_wl_shell wl_shell
+ * @section page_iface_wl_shell_desc Description
+ *
+ * This interface is implemented by servers that provide
+ * desktop-style user interfaces.
+ *
+ * It allows clients to associate a wl_shell_surface with
+ * a basic surface.
+ * @section page_iface_wl_shell_api API
+ * See @ref iface_wl_shell.
+ */
+/**
+ * @defgroup iface_wl_shell The wl_shell interface
+ *
+ * This interface is implemented by servers that provide
+ * desktop-style user interfaces.
+ *
+ * It allows clients to associate a wl_shell_surface with
+ * a basic surface.
+ */
+extern const struct wl_interface wl_shell_interface;
+/**
+ * @page page_iface_wl_shell_surface wl_shell_surface
+ * @section page_iface_wl_shell_surface_desc Description
+ *
+ * An interface that may be implemented by a wl_surface, for
+ * implementations that provide a desktop-style user interface.
+ *
+ * It provides requests to treat surfaces like toplevel, fullscreen
+ * or popup windows, move, resize or maximize them, associate
+ * metadata like title and class, etc.
+ *
+ * On the server side the object is automatically destroyed when
+ * the related wl_surface is destroyed. On the client side,
+ * wl_shell_surface_destroy() must be called before destroying
+ * the wl_surface object.
+ * @section page_iface_wl_shell_surface_api API
+ * See @ref iface_wl_shell_surface.
+ */
+/**
+ * @defgroup iface_wl_shell_surface The wl_shell_surface interface
+ *
+ * An interface that may be implemented by a wl_surface, for
+ * implementations that provide a desktop-style user interface.
+ *
+ * It provides requests to treat surfaces like toplevel, fullscreen
+ * or popup windows, move, resize or maximize them, associate
+ * metadata like title and class, etc.
+ *
+ * On the server side the object is automatically destroyed when
+ * the related wl_surface is destroyed. On the client side,
+ * wl_shell_surface_destroy() must be called before destroying
+ * the wl_surface object.
+ */
+extern const struct wl_interface wl_shell_surface_interface;
+/**
+ * @page page_iface_wl_surface wl_surface
+ * @section page_iface_wl_surface_desc Description
+ *
+ * A surface is a rectangular area that is displayed on the screen.
+ * It has a location, size and pixel contents.
+ *
+ * The size of a surface (and relative positions on it) is described
+ * in surface-local coordinates, which may differ from the buffer
+ * coordinates of the pixel content, in case a buffer_transform
+ * or a buffer_scale is used.
+ *
+ * A surface without a "role" is fairly useless: a compositor does
+ * not know where, when or how to present it. The role is the
+ * purpose of a wl_surface. Examples of roles are a cursor for a
+ * pointer (as set by wl_pointer.set_cursor), a drag icon
+ * (wl_data_device.start_drag), a sub-surface
+ * (wl_subcompositor.get_subsurface), and a window as defined by a
+ * shell protocol (e.g. wl_shell.get_shell_surface).
+ *
+ * A surface can have only one role at a time. Initially a
+ * wl_surface does not have a role. Once a wl_surface is given a
+ * role, it is set permanently for the whole lifetime of the
+ * wl_surface object. Giving the current role again is allowed,
+ * unless explicitly forbidden by the relevant interface
+ * specification.
+ *
+ * Surface roles are given by requests in other interfaces such as
+ * wl_pointer.set_cursor. The request should explicitly mention
+ * that this request gives a role to a wl_surface. Often, this
+ * request also creates a new protocol object that represents the
+ * role and adds additional functionality to wl_surface. When a
+ * client wants to destroy a wl_surface, they must destroy this 'role
+ * object' before the wl_surface.
+ *
+ * Destroying the role object does not remove the role from the
+ * wl_surface, but it may stop the wl_surface from "playing the role".
+ * For instance, if a wl_subsurface object is destroyed, the wl_surface
+ * it was created for will be unmapped and forget its position and
+ * z-order. It is allowed to create a wl_subsurface for the same
+ * wl_surface again, but it is not allowed to use the wl_surface as
+ * a cursor (cursor is a different role than sub-surface, and role
+ * switching is not allowed).
+ * @section page_iface_wl_surface_api API
+ * See @ref iface_wl_surface.
+ */
+/**
+ * @defgroup iface_wl_surface The wl_surface interface
+ *
+ * A surface is a rectangular area that is displayed on the screen.
+ * It has a location, size and pixel contents.
+ *
+ * The size of a surface (and relative positions on it) is described
+ * in surface-local coordinates, which may differ from the buffer
+ * coordinates of the pixel content, in case a buffer_transform
+ * or a buffer_scale is used.
+ *
+ * A surface without a "role" is fairly useless: a compositor does
+ * not know where, when or how to present it. The role is the
+ * purpose of a wl_surface. Examples of roles are a cursor for a
+ * pointer (as set by wl_pointer.set_cursor), a drag icon
+ * (wl_data_device.start_drag), a sub-surface
+ * (wl_subcompositor.get_subsurface), and a window as defined by a
+ * shell protocol (e.g. wl_shell.get_shell_surface).
+ *
+ * A surface can have only one role at a time. Initially a
+ * wl_surface does not have a role. Once a wl_surface is given a
+ * role, it is set permanently for the whole lifetime of the
+ * wl_surface object. Giving the current role again is allowed,
+ * unless explicitly forbidden by the relevant interface
+ * specification.
+ *
+ * Surface roles are given by requests in other interfaces such as
+ * wl_pointer.set_cursor. The request should explicitly mention
+ * that this request gives a role to a wl_surface. Often, this
+ * request also creates a new protocol object that represents the
+ * role and adds additional functionality to wl_surface. When a
+ * client wants to destroy a wl_surface, they must destroy this 'role
+ * object' before the wl_surface.
+ *
+ * Destroying the role object does not remove the role from the
+ * wl_surface, but it may stop the wl_surface from "playing the role".
+ * For instance, if a wl_subsurface object is destroyed, the wl_surface
+ * it was created for will be unmapped and forget its position and
+ * z-order. It is allowed to create a wl_subsurface for the same
+ * wl_surface again, but it is not allowed to use the wl_surface as
+ * a cursor (cursor is a different role than sub-surface, and role
+ * switching is not allowed).
+ */
+extern const struct wl_interface wl_surface_interface;
+/**
+ * @page page_iface_wl_seat wl_seat
+ * @section page_iface_wl_seat_desc Description
+ *
+ * A seat is a group of keyboards, pointer and touch devices. This
+ * object is published as a global during start up, or when such a
+ * device is hot plugged. A seat typically has a pointer and
+ * maintains a keyboard focus and a pointer focus.
+ * @section page_iface_wl_seat_api API
+ * See @ref iface_wl_seat.
+ */
+/**
+ * @defgroup iface_wl_seat The wl_seat interface
+ *
+ * A seat is a group of keyboards, pointer and touch devices. This
+ * object is published as a global during start up, or when such a
+ * device is hot plugged. A seat typically has a pointer and
+ * maintains a keyboard focus and a pointer focus.
+ */
+extern const struct wl_interface wl_seat_interface;
+/**
+ * @page page_iface_wl_pointer wl_pointer
+ * @section page_iface_wl_pointer_desc Description
+ *
+ * The wl_pointer interface represents one or more input devices,
+ * such as mice, which control the pointer location and pointer_focus
+ * of a seat.
+ *
+ * The wl_pointer interface generates motion, enter and leave
+ * events for the surfaces that the pointer is located over,
+ * and button and axis events for button presses, button releases
+ * and scrolling.
+ * @section page_iface_wl_pointer_api API
+ * See @ref iface_wl_pointer.
+ */
+/**
+ * @defgroup iface_wl_pointer The wl_pointer interface
+ *
+ * The wl_pointer interface represents one or more input devices,
+ * such as mice, which control the pointer location and pointer_focus
+ * of a seat.
+ *
+ * The wl_pointer interface generates motion, enter and leave
+ * events for the surfaces that the pointer is located over,
+ * and button and axis events for button presses, button releases
+ * and scrolling.
+ */
+extern const struct wl_interface wl_pointer_interface;
+/**
+ * @page page_iface_wl_keyboard wl_keyboard
+ * @section page_iface_wl_keyboard_desc Description
+ *
+ * The wl_keyboard interface represents one or more keyboards
+ * associated with a seat.
+ * @section page_iface_wl_keyboard_api API
+ * See @ref iface_wl_keyboard.
+ */
+/**
+ * @defgroup iface_wl_keyboard The wl_keyboard interface
+ *
+ * The wl_keyboard interface represents one or more keyboards
+ * associated with a seat.
+ */
+extern const struct wl_interface wl_keyboard_interface;
+/**
+ * @page page_iface_wl_touch wl_touch
+ * @section page_iface_wl_touch_desc Description
+ *
+ * The wl_touch interface represents a touchscreen
+ * associated with a seat.
+ *
+ * Touch interactions can consist of one or more contacts.
+ * For each contact, a series of events is generated, starting
+ * with a down event, followed by zero or more motion events,
+ * and ending with an up event. Events relating to the same
+ * contact point can be identified by the ID of the sequence.
+ * @section page_iface_wl_touch_api API
+ * See @ref iface_wl_touch.
+ */
+/**
+ * @defgroup iface_wl_touch The wl_touch interface
+ *
+ * The wl_touch interface represents a touchscreen
+ * associated with a seat.
+ *
+ * Touch interactions can consist of one or more contacts.
+ * For each contact, a series of events is generated, starting
+ * with a down event, followed by zero or more motion events,
+ * and ending with an up event. Events relating to the same
+ * contact point can be identified by the ID of the sequence.
+ */
+extern const struct wl_interface wl_touch_interface;
+/**
+ * @page page_iface_wl_output wl_output
+ * @section page_iface_wl_output_desc Description
+ *
+ * An output describes part of the compositor geometry. The
+ * compositor works in the 'compositor coordinate system' and an
+ * output corresponds to a rectangular area in that space that is
+ * actually visible. This typically corresponds to a monitor that
+ * displays part of the compositor space. This object is published
+ * as global during start up, or when a monitor is hotplugged.
+ * @section page_iface_wl_output_api API
+ * See @ref iface_wl_output.
+ */
+/**
+ * @defgroup iface_wl_output The wl_output interface
+ *
+ * An output describes part of the compositor geometry. The
+ * compositor works in the 'compositor coordinate system' and an
+ * output corresponds to a rectangular area in that space that is
+ * actually visible. This typically corresponds to a monitor that
+ * displays part of the compositor space. This object is published
+ * as global during start up, or when a monitor is hotplugged.
+ */
+extern const struct wl_interface wl_output_interface;
+/**
+ * @page page_iface_wl_region wl_region
+ * @section page_iface_wl_region_desc Description
+ *
+ * A region object describes an area.
+ *
+ * Region objects are used to describe the opaque and input
+ * regions of a surface.
+ * @section page_iface_wl_region_api API
+ * See @ref iface_wl_region.
+ */
+/**
+ * @defgroup iface_wl_region The wl_region interface
+ *
+ * A region object describes an area.
+ *
+ * Region objects are used to describe the opaque and input
+ * regions of a surface.
+ */
+extern const struct wl_interface wl_region_interface;
+/**
+ * @page page_iface_wl_subcompositor wl_subcompositor
+ * @section page_iface_wl_subcompositor_desc Description
+ *
+ * The global interface exposing sub-surface compositing capabilities.
+ * A wl_surface, that has sub-surfaces associated, is called the
+ * parent surface. Sub-surfaces can be arbitrarily nested and create
+ * a tree of sub-surfaces.
+ *
+ * The root surface in a tree of sub-surfaces is the main
+ * surface. The main surface cannot be a sub-surface, because
+ * sub-surfaces must always have a parent.
+ *
+ * A main surface with its sub-surfaces forms a (compound) window.
+ * For window management purposes, this set of wl_surface objects is
+ * to be considered as a single window, and it should also behave as
+ * such.
+ *
+ * The aim of sub-surfaces is to offload some of the compositing work
+ * within a window from clients to the compositor. A prime example is
+ * a video player with decorations and video in separate wl_surface
+ * objects. This should allow the compositor to pass YUV video buffer
+ * processing to dedicated overlay hardware when possible.
+ * @section page_iface_wl_subcompositor_api API
+ * See @ref iface_wl_subcompositor.
+ */
+/**
+ * @defgroup iface_wl_subcompositor The wl_subcompositor interface
+ *
+ * The global interface exposing sub-surface compositing capabilities.
+ * A wl_surface, that has sub-surfaces associated, is called the
+ * parent surface. Sub-surfaces can be arbitrarily nested and create
+ * a tree of sub-surfaces.
+ *
+ * The root surface in a tree of sub-surfaces is the main
+ * surface. The main surface cannot be a sub-surface, because
+ * sub-surfaces must always have a parent.
+ *
+ * A main surface with its sub-surfaces forms a (compound) window.
+ * For window management purposes, this set of wl_surface objects is
+ * to be considered as a single window, and it should also behave as
+ * such.
+ *
+ * The aim of sub-surfaces is to offload some of the compositing work
+ * within a window from clients to the compositor. A prime example is
+ * a video player with decorations and video in separate wl_surface
+ * objects. This should allow the compositor to pass YUV video buffer
+ * processing to dedicated overlay hardware when possible.
+ */
+extern const struct wl_interface wl_subcompositor_interface;
+/**
+ * @page page_iface_wl_subsurface wl_subsurface
+ * @section page_iface_wl_subsurface_desc Description
+ *
+ * An additional interface to a wl_surface object, which has been
+ * made a sub-surface. A sub-surface has one parent surface. A
+ * sub-surface's size and position are not limited to that of the parent.
+ * Particularly, a sub-surface is not automatically clipped to its
+ * parent's area.
+ *
+ * A sub-surface becomes mapped, when a non-NULL wl_buffer is applied
+ * and the parent surface is mapped. The order of which one happens
+ * first is irrelevant. A sub-surface is hidden if the parent becomes
+ * hidden, or if a NULL wl_buffer is applied. These rules apply
+ * recursively through the tree of surfaces.
+ *
+ * The behaviour of a wl_surface.commit request on a sub-surface
+ * depends on the sub-surface's mode. The possible modes are
+ * synchronized and desynchronized, see methods
+ * wl_subsurface.set_sync and wl_subsurface.set_desync. Synchronized
+ * mode caches the wl_surface state to be applied when the parent's
+ * state gets applied, and desynchronized mode applies the pending
+ * wl_surface state directly. A sub-surface is initially in the
+ * synchronized mode.
+ *
+ * Sub-surfaces have also other kind of state, which is managed by
+ * wl_subsurface requests, as opposed to wl_surface requests. This
+ * state includes the sub-surface position relative to the parent
+ * surface (wl_subsurface.set_position), and the stacking order of
+ * the parent and its sub-surfaces (wl_subsurface.place_above and
+ * .place_below). This state is applied when the parent surface's
+ * wl_surface state is applied, regardless of the sub-surface's mode.
+ * As the exception, set_sync and set_desync are effective immediately.
+ *
+ * The main surface can be thought to be always in desynchronized mode,
+ * since it does not have a parent in the sub-surfaces sense.
+ *
+ * Even if a sub-surface is in desynchronized mode, it will behave as
+ * in synchronized mode, if its parent surface behaves as in
+ * synchronized mode. This rule is applied recursively throughout the
+ * tree of surfaces. This means, that one can set a sub-surface into
+ * synchronized mode, and then assume that all its child and grand-child
+ * sub-surfaces are synchronized, too, without explicitly setting them.
+ *
+ * If the wl_surface associated with the wl_subsurface is destroyed, the
+ * wl_subsurface object becomes inert. Note, that destroying either object
+ * takes effect immediately. If you need to synchronize the removal
+ * of a sub-surface to the parent surface update, unmap the sub-surface
+ * first by attaching a NULL wl_buffer, update parent, and then destroy
+ * the sub-surface.
+ *
+ * If the parent wl_surface object is destroyed, the sub-surface is
+ * unmapped.
+ * @section page_iface_wl_subsurface_api API
+ * See @ref iface_wl_subsurface.
+ */
+/**
+ * @defgroup iface_wl_subsurface The wl_subsurface interface
+ *
+ * An additional interface to a wl_surface object, which has been
+ * made a sub-surface. A sub-surface has one parent surface. A
+ * sub-surface's size and position are not limited to that of the parent.
+ * Particularly, a sub-surface is not automatically clipped to its
+ * parent's area.
+ *
+ * A sub-surface becomes mapped, when a non-NULL wl_buffer is applied
+ * and the parent surface is mapped. The order of which one happens
+ * first is irrelevant. A sub-surface is hidden if the parent becomes
+ * hidden, or if a NULL wl_buffer is applied. These rules apply
+ * recursively through the tree of surfaces.
+ *
+ * The behaviour of a wl_surface.commit request on a sub-surface
+ * depends on the sub-surface's mode. The possible modes are
+ * synchronized and desynchronized, see methods
+ * wl_subsurface.set_sync and wl_subsurface.set_desync. Synchronized
+ * mode caches the wl_surface state to be applied when the parent's
+ * state gets applied, and desynchronized mode applies the pending
+ * wl_surface state directly. A sub-surface is initially in the
+ * synchronized mode.
+ *
+ * Sub-surfaces have also other kind of state, which is managed by
+ * wl_subsurface requests, as opposed to wl_surface requests. This
+ * state includes the sub-surface position relative to the parent
+ * surface (wl_subsurface.set_position), and the stacking order of
+ * the parent and its sub-surfaces (wl_subsurface.place_above and
+ * .place_below). This state is applied when the parent surface's
+ * wl_surface state is applied, regardless of the sub-surface's mode.
+ * As the exception, set_sync and set_desync are effective immediately.
+ *
+ * The main surface can be thought to be always in desynchronized mode,
+ * since it does not have a parent in the sub-surfaces sense.
+ *
+ * Even if a sub-surface is in desynchronized mode, it will behave as
+ * in synchronized mode, if its parent surface behaves as in
+ * synchronized mode. This rule is applied recursively throughout the
+ * tree of surfaces. This means, that one can set a sub-surface into
+ * synchronized mode, and then assume that all its child and grand-child
+ * sub-surfaces are synchronized, too, without explicitly setting them.
+ *
+ * If the wl_surface associated with the wl_subsurface is destroyed, the
+ * wl_subsurface object becomes inert. Note, that destroying either object
+ * takes effect immediately. If you need to synchronize the removal
+ * of a sub-surface to the parent surface update, unmap the sub-surface
+ * first by attaching a NULL wl_buffer, update parent, and then destroy
+ * the sub-surface.
+ *
+ * If the parent wl_surface object is destroyed, the sub-surface is
+ * unmapped.
+ */
+extern const struct wl_interface wl_subsurface_interface;
+
+#ifndef WL_DISPLAY_ERROR_ENUM
+#define WL_DISPLAY_ERROR_ENUM
+/**
+ * @ingroup iface_wl_display
+ * global error values
+ *
+ * These errors are global and can be emitted in response to any
+ * server request.
+ */
+enum wl_display_error {
+ /**
+ * server couldn't find object
+ */
+ WL_DISPLAY_ERROR_INVALID_OBJECT = 0,
+ /**
+ * method doesn't exist on the specified interface
+ */
+ WL_DISPLAY_ERROR_INVALID_METHOD = 1,
+ /**
+ * server is out of memory
+ */
+ WL_DISPLAY_ERROR_NO_MEMORY = 2,
+};
+#endif /* WL_DISPLAY_ERROR_ENUM */
+
+/**
+ * @ingroup iface_wl_display
+ * @struct wl_display_interface
+ */
+struct wl_display_interface {
+ /**
+ * asynchronous roundtrip
+ *
+ * The sync request asks the server to emit the 'done' event on
+ * the returned wl_callback object. Since requests are handled
+ * in-order and events are delivered in-order, this can be used as
+ * a barrier to ensure all previous requests and the resulting
+ * events have been handled.
+ *
+ * The object returned by this request will be destroyed by the
+ * compositor after the callback is fired and as such the client
+ * must not attempt to use it after that point.
+ *
+ * The callback_data passed in the callback is the event serial.
+ * @param callback callback object for the sync request
+ */
+ void (*sync)(struct wl_client *client,
+ struct wl_resource *resource,
+ uint32_t callback);
+ /**
+ * get global registry object
+ *
+ * This request creates a registry object that allows the client
+ * to list and bind the global objects available from the
+ * compositor.
+ * @param registry global registry object
+ */
+ void (*get_registry)(struct wl_client *client,
+ struct wl_resource *resource,
+ uint32_t registry);
+};
+
+#define WL_DISPLAY_ERROR 0
+#define WL_DISPLAY_DELETE_ID 1
+
+/**
+ * @ingroup iface_wl_display
+ */
+#define WL_DISPLAY_ERROR_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_display
+ */
+#define WL_DISPLAY_DELETE_ID_SINCE_VERSION 1
+
+/**
+ * @ingroup iface_wl_display
+ */
+#define WL_DISPLAY_SYNC_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_display
+ */
+#define WL_DISPLAY_GET_REGISTRY_SINCE_VERSION 1
+
+/**
+ * @ingroup iface_wl_registry
+ * @struct wl_registry_interface
+ */
+struct wl_registry_interface {
+ /**
+ * bind an object to the display
+ *
+ * Binds a new, client-created object to the server using the
+ * specified name as the identifier.
+ * @param name unique numeric name of the object
+ * @param interface name of the objects interface
+ * @param version version of the objects interface
+ * @param id bounded object
+ */
+ void (*bind)(struct wl_client *client,
+ struct wl_resource *resource,
+ uint32_t name,
+ const char *interface, uint32_t version, uint32_t id);
+};
+
+#define WL_REGISTRY_GLOBAL 0
+#define WL_REGISTRY_GLOBAL_REMOVE 1
+
+/**
+ * @ingroup iface_wl_registry
+ */
+#define WL_REGISTRY_GLOBAL_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_registry
+ */
+#define WL_REGISTRY_GLOBAL_REMOVE_SINCE_VERSION 1
+
+/**
+ * @ingroup iface_wl_registry
+ */
+#define WL_REGISTRY_BIND_SINCE_VERSION 1
+
+/**
+ * @ingroup iface_wl_registry
+ * Sends an global event to the client owning the resource.
+ * @param resource_ The client's resource
+ * @param name numeric name of the global object
+ * @param interface interface implemented by the object
+ * @param version interface version
+ */
+static inline void
+wl_registry_send_global(struct wl_resource *resource_, uint32_t name, const char *interface, uint32_t version)
+{
+ wl_resource_post_event(resource_, WL_REGISTRY_GLOBAL, name, interface, version);
+}
+
+/**
+ * @ingroup iface_wl_registry
+ * Sends an global_remove event to the client owning the resource.
+ * @param resource_ The client's resource
+ * @param name numeric name of the global object
+ */
+static inline void
+wl_registry_send_global_remove(struct wl_resource *resource_, uint32_t name)
+{
+ wl_resource_post_event(resource_, WL_REGISTRY_GLOBAL_REMOVE, name);
+}
+
+#define WL_CALLBACK_DONE 0
+
+/**
+ * @ingroup iface_wl_callback
+ */
+#define WL_CALLBACK_DONE_SINCE_VERSION 1
+
+
+/**
+ * @ingroup iface_wl_callback
+ * Sends an done event to the client owning the resource.
+ * @param resource_ The client's resource
+ * @param callback_data request-specific data for the callback
+ */
+static inline void
+wl_callback_send_done(struct wl_resource *resource_, uint32_t callback_data)
+{
+ wl_resource_post_event(resource_, WL_CALLBACK_DONE, callback_data);
+}
+
+/**
+ * @ingroup iface_wl_compositor
+ * @struct wl_compositor_interface
+ */
+struct wl_compositor_interface {
+ /**
+ * create new surface
+ *
+ * Ask the compositor to create a new surface.
+ * @param id the new surface
+ */
+ void (*create_surface)(struct wl_client *client,
+ struct wl_resource *resource,
+ uint32_t id);
+ /**
+ * create new region
+ *
+ * Ask the compositor to create a new region.
+ * @param id the new region
+ */
+ void (*create_region)(struct wl_client *client,
+ struct wl_resource *resource,
+ uint32_t id);
+};
+
+
+/**
+ * @ingroup iface_wl_compositor
+ */
+#define WL_COMPOSITOR_CREATE_SURFACE_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_compositor
+ */
+#define WL_COMPOSITOR_CREATE_REGION_SINCE_VERSION 1
+
+/**
+ * @ingroup iface_wl_shm_pool
+ * @struct wl_shm_pool_interface
+ */
+struct wl_shm_pool_interface {
+ /**
+ * create a buffer from the pool
+ *
+ * Create a wl_buffer object from the pool.
+ *
+ * The buffer is created offset bytes into the pool and has width
+ * and height as specified. The stride argument specifies the
+ * number of bytes from the beginning of one row to the beginning
+ * of the next. The format is the pixel format of the buffer and
+ * must be one of those advertised through the wl_shm.format event.
+ *
+ * A buffer will keep a reference to the pool it was created from
+ * so it is valid to destroy the pool immediately after creating a
+ * buffer from it.
+ * @param id buffer to create
+ * @param offset buffer byte offset within the pool
+ * @param width buffer width, in pixels
+ * @param height buffer height, in pixels
+ * @param stride number of bytes from the beginning of one row to the beginning of the next row
+ * @param format buffer pixel format
+ */
+ void (*create_buffer)(struct wl_client *client,
+ struct wl_resource *resource,
+ uint32_t id,
+ int32_t offset,
+ int32_t width,
+ int32_t height,
+ int32_t stride,
+ uint32_t format);
+ /**
+ * destroy the pool
+ *
+ * Destroy the shared memory pool.
+ *
+ * The mmapped memory will be released when all buffers that have
+ * been created from this pool are gone.
+ */
+ void (*destroy)(struct wl_client *client,
+ struct wl_resource *resource);
+ /**
+ * change the size of the pool mapping
+ *
+ * This request will cause the server to remap the backing memory
+ * for the pool from the file descriptor passed when the pool was
+ * created, but using the new size. This request can only be used
+ * to make the pool bigger.
+ * @param size new size of the pool, in bytes
+ */
+ void (*resize)(struct wl_client *client,
+ struct wl_resource *resource,
+ int32_t size);
+};
+
+
+/**
+ * @ingroup iface_wl_shm_pool
+ */
+#define WL_SHM_POOL_CREATE_BUFFER_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_shm_pool
+ */
+#define WL_SHM_POOL_DESTROY_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_shm_pool
+ */
+#define WL_SHM_POOL_RESIZE_SINCE_VERSION 1
+
+#ifndef WL_SHM_ERROR_ENUM
+#define WL_SHM_ERROR_ENUM
+/**
+ * @ingroup iface_wl_shm
+ * wl_shm error values
+ *
+ * These errors can be emitted in response to wl_shm requests.
+ */
+enum wl_shm_error {
+ /**
+ * buffer format is not known
+ */
+ WL_SHM_ERROR_INVALID_FORMAT = 0,
+ /**
+ * invalid size or stride during pool or buffer creation
+ */
+ WL_SHM_ERROR_INVALID_STRIDE = 1,
+ /**
+ * mmapping the file descriptor failed
+ */
+ WL_SHM_ERROR_INVALID_FD = 2,
+};
+#endif /* WL_SHM_ERROR_ENUM */
+
+#ifndef WL_SHM_FORMAT_ENUM
+#define WL_SHM_FORMAT_ENUM
+/**
+ * @ingroup iface_wl_shm
+ * pixel formats
+ *
+ * This describes the memory layout of an individual pixel.
+ *
+ * All renderers should support argb8888 and xrgb8888 but any other
+ * formats are optional and may not be supported by the particular
+ * renderer in use.
+ *
+ * The drm format codes match the macros defined in drm_fourcc.h.
+ * The formats actually supported by the compositor will be
+ * reported by the format event.
+ */
+enum wl_shm_format {
+ /**
+ * 32-bit ARGB format, [31:0] A:R:G:B 8:8:8:8 little endian
+ */
+ WL_SHM_FORMAT_ARGB8888 = 0,
+ /**
+ * 32-bit RGB format, [31:0] x:R:G:B 8:8:8:8 little endian
+ */
+ WL_SHM_FORMAT_XRGB8888 = 1,
+ /**
+ * 8-bit color index format, [7:0] C
+ */
+ WL_SHM_FORMAT_C8 = 0x20203843,
+ /**
+ * 8-bit RGB format, [7:0] R:G:B 3:3:2
+ */
+ WL_SHM_FORMAT_RGB332 = 0x38424752,
+ /**
+ * 8-bit BGR format, [7:0] B:G:R 2:3:3
+ */
+ WL_SHM_FORMAT_BGR233 = 0x38524742,
+ /**
+ * 16-bit xRGB format, [15:0] x:R:G:B 4:4:4:4 little endian
+ */
+ WL_SHM_FORMAT_XRGB4444 = 0x32315258,
+ /**
+ * 16-bit xBGR format, [15:0] x:B:G:R 4:4:4:4 little endian
+ */
+ WL_SHM_FORMAT_XBGR4444 = 0x32314258,
+ /**
+ * 16-bit RGBx format, [15:0] R:G:B:x 4:4:4:4 little endian
+ */
+ WL_SHM_FORMAT_RGBX4444 = 0x32315852,
+ /**
+ * 16-bit BGRx format, [15:0] B:G:R:x 4:4:4:4 little endian
+ */
+ WL_SHM_FORMAT_BGRX4444 = 0x32315842,
+ /**
+ * 16-bit ARGB format, [15:0] A:R:G:B 4:4:4:4 little endian
+ */
+ WL_SHM_FORMAT_ARGB4444 = 0x32315241,
+ /**
+ * 16-bit ABGR format, [15:0] A:B:G:R 4:4:4:4 little endian
+ */
+ WL_SHM_FORMAT_ABGR4444 = 0x32314241,
+ /**
+ * 16-bit RBGA format, [15:0] R:G:B:A 4:4:4:4 little endian
+ */
+ WL_SHM_FORMAT_RGBA4444 = 0x32314152,
+ /**
+ * 16-bit BGRA format, [15:0] B:G:R:A 4:4:4:4 little endian
+ */
+ WL_SHM_FORMAT_BGRA4444 = 0x32314142,
+ /**
+ * 16-bit xRGB format, [15:0] x:R:G:B 1:5:5:5 little endian
+ */
+ WL_SHM_FORMAT_XRGB1555 = 0x35315258,
+ /**
+ * 16-bit xBGR 1555 format, [15:0] x:B:G:R 1:5:5:5 little endian
+ */
+ WL_SHM_FORMAT_XBGR1555 = 0x35314258,
+ /**
+ * 16-bit RGBx 5551 format, [15:0] R:G:B:x 5:5:5:1 little endian
+ */
+ WL_SHM_FORMAT_RGBX5551 = 0x35315852,
+ /**
+ * 16-bit BGRx 5551 format, [15:0] B:G:R:x 5:5:5:1 little endian
+ */
+ WL_SHM_FORMAT_BGRX5551 = 0x35315842,
+ /**
+ * 16-bit ARGB 1555 format, [15:0] A:R:G:B 1:5:5:5 little endian
+ */
+ WL_SHM_FORMAT_ARGB1555 = 0x35315241,
+ /**
+ * 16-bit ABGR 1555 format, [15:0] A:B:G:R 1:5:5:5 little endian
+ */
+ WL_SHM_FORMAT_ABGR1555 = 0x35314241,
+ /**
+ * 16-bit RGBA 5551 format, [15:0] R:G:B:A 5:5:5:1 little endian
+ */
+ WL_SHM_FORMAT_RGBA5551 = 0x35314152,
+ /**
+ * 16-bit BGRA 5551 format, [15:0] B:G:R:A 5:5:5:1 little endian
+ */
+ WL_SHM_FORMAT_BGRA5551 = 0x35314142,
+ /**
+ * 16-bit RGB 565 format, [15:0] R:G:B 5:6:5 little endian
+ */
+ WL_SHM_FORMAT_RGB565 = 0x36314752,
+ /**
+ * 16-bit BGR 565 format, [15:0] B:G:R 5:6:5 little endian
+ */
+ WL_SHM_FORMAT_BGR565 = 0x36314742,
+ /**
+ * 24-bit RGB format, [23:0] R:G:B little endian
+ */
+ WL_SHM_FORMAT_RGB888 = 0x34324752,
+ /**
+ * 24-bit BGR format, [23:0] B:G:R little endian
+ */
+ WL_SHM_FORMAT_BGR888 = 0x34324742,
+ /**
+ * 32-bit xBGR format, [31:0] x:B:G:R 8:8:8:8 little endian
+ */
+ WL_SHM_FORMAT_XBGR8888 = 0x34324258,
+ /**
+ * 32-bit RGBx format, [31:0] R:G:B:x 8:8:8:8 little endian
+ */
+ WL_SHM_FORMAT_RGBX8888 = 0x34325852,
+ /**
+ * 32-bit BGRx format, [31:0] B:G:R:x 8:8:8:8 little endian
+ */
+ WL_SHM_FORMAT_BGRX8888 = 0x34325842,
+ /**
+ * 32-bit ABGR format, [31:0] A:B:G:R 8:8:8:8 little endian
+ */
+ WL_SHM_FORMAT_ABGR8888 = 0x34324241,
+ /**
+ * 32-bit RGBA format, [31:0] R:G:B:A 8:8:8:8 little endian
+ */
+ WL_SHM_FORMAT_RGBA8888 = 0x34324152,
+ /**
+ * 32-bit BGRA format, [31:0] B:G:R:A 8:8:8:8 little endian
+ */
+ WL_SHM_FORMAT_BGRA8888 = 0x34324142,
+ /**
+ * 32-bit xRGB format, [31:0] x:R:G:B 2:10:10:10 little endian
+ */
+ WL_SHM_FORMAT_XRGB2101010 = 0x30335258,
+ /**
+ * 32-bit xBGR format, [31:0] x:B:G:R 2:10:10:10 little endian
+ */
+ WL_SHM_FORMAT_XBGR2101010 = 0x30334258,
+ /**
+ * 32-bit RGBx format, [31:0] R:G:B:x 10:10:10:2 little endian
+ */
+ WL_SHM_FORMAT_RGBX1010102 = 0x30335852,
+ /**
+ * 32-bit BGRx format, [31:0] B:G:R:x 10:10:10:2 little endian
+ */
+ WL_SHM_FORMAT_BGRX1010102 = 0x30335842,
+ /**
+ * 32-bit ARGB format, [31:0] A:R:G:B 2:10:10:10 little endian
+ */
+ WL_SHM_FORMAT_ARGB2101010 = 0x30335241,
+ /**
+ * 32-bit ABGR format, [31:0] A:B:G:R 2:10:10:10 little endian
+ */
+ WL_SHM_FORMAT_ABGR2101010 = 0x30334241,
+ /**
+ * 32-bit RGBA format, [31:0] R:G:B:A 10:10:10:2 little endian
+ */
+ WL_SHM_FORMAT_RGBA1010102 = 0x30334152,
+ /**
+ * 32-bit BGRA format, [31:0] B:G:R:A 10:10:10:2 little endian
+ */
+ WL_SHM_FORMAT_BGRA1010102 = 0x30334142,
+ /**
+ * packed YCbCr format, [31:0] Cr0:Y1:Cb0:Y0 8:8:8:8 little endian
+ */
+ WL_SHM_FORMAT_YUYV = 0x56595559,
+ /**
+ * packed YCbCr format, [31:0] Cb0:Y1:Cr0:Y0 8:8:8:8 little endian
+ */
+ WL_SHM_FORMAT_YVYU = 0x55595659,
+ /**
+ * packed YCbCr format, [31:0] Y1:Cr0:Y0:Cb0 8:8:8:8 little endian
+ */
+ WL_SHM_FORMAT_UYVY = 0x59565955,
+ /**
+ * packed YCbCr format, [31:0] Y1:Cb0:Y0:Cr0 8:8:8:8 little endian
+ */
+ WL_SHM_FORMAT_VYUY = 0x59555956,
+ /**
+ * packed AYCbCr format, [31:0] A:Y:Cb:Cr 8:8:8:8 little endian
+ */
+ WL_SHM_FORMAT_AYUV = 0x56555941,
+ /**
+ * 2 plane YCbCr Cr:Cb format, 2x2 subsampled Cr:Cb plane
+ */
+ WL_SHM_FORMAT_NV12 = 0x3231564e,
+ /**
+ * 2 plane YCbCr Cb:Cr format, 2x2 subsampled Cb:Cr plane
+ */
+ WL_SHM_FORMAT_NV21 = 0x3132564e,
+ /**
+ * 2 plane YCbCr Cr:Cb format, 2x1 subsampled Cr:Cb plane
+ */
+ WL_SHM_FORMAT_NV16 = 0x3631564e,
+ /**
+ * 2 plane YCbCr Cb:Cr format, 2x1 subsampled Cb:Cr plane
+ */
+ WL_SHM_FORMAT_NV61 = 0x3136564e,
+ /**
+ * 3 plane YCbCr format, 4x4 subsampled Cb (1) and Cr (2) planes
+ */
+ WL_SHM_FORMAT_YUV410 = 0x39565559,
+ /**
+ * 3 plane YCbCr format, 4x4 subsampled Cr (1) and Cb (2) planes
+ */
+ WL_SHM_FORMAT_YVU410 = 0x39555659,
+ /**
+ * 3 plane YCbCr format, 4x1 subsampled Cb (1) and Cr (2) planes
+ */
+ WL_SHM_FORMAT_YUV411 = 0x31315559,
+ /**
+ * 3 plane YCbCr format, 4x1 subsampled Cr (1) and Cb (2) planes
+ */
+ WL_SHM_FORMAT_YVU411 = 0x31315659,
+ /**
+ * 3 plane YCbCr format, 2x2 subsampled Cb (1) and Cr (2) planes
+ */
+ WL_SHM_FORMAT_YUV420 = 0x32315559,
+ /**
+ * 3 plane YCbCr format, 2x2 subsampled Cr (1) and Cb (2) planes
+ */
+ WL_SHM_FORMAT_YVU420 = 0x32315659,
+ /**
+ * 3 plane YCbCr format, 2x1 subsampled Cb (1) and Cr (2) planes
+ */
+ WL_SHM_FORMAT_YUV422 = 0x36315559,
+ /**
+ * 3 plane YCbCr format, 2x1 subsampled Cr (1) and Cb (2) planes
+ */
+ WL_SHM_FORMAT_YVU422 = 0x36315659,
+ /**
+ * 3 plane YCbCr format, non-subsampled Cb (1) and Cr (2) planes
+ */
+ WL_SHM_FORMAT_YUV444 = 0x34325559,
+ /**
+ * 3 plane YCbCr format, non-subsampled Cr (1) and Cb (2) planes
+ */
+ WL_SHM_FORMAT_YVU444 = 0x34325659,
+};
+#endif /* WL_SHM_FORMAT_ENUM */
+
+/**
+ * @ingroup iface_wl_shm
+ * @struct wl_shm_interface
+ */
+struct wl_shm_interface {
+ /**
+ * create a shm pool
+ *
+ * Create a new wl_shm_pool object.
+ *
+ * The pool can be used to create shared memory based buffer
+ * objects. The server will mmap size bytes of the passed file
+ * descriptor, to use as backing memory for the pool.
+ * @param id pool to create
+ * @param fd file descriptor for the pool
+ * @param size pool size, in bytes
+ */
+ void (*create_pool)(struct wl_client *client,
+ struct wl_resource *resource,
+ uint32_t id,
+ int32_t fd,
+ int32_t size);
+};
+
+#define WL_SHM_FORMAT 0
+
+/**
+ * @ingroup iface_wl_shm
+ */
+#define WL_SHM_FORMAT_SINCE_VERSION 1
+
+/**
+ * @ingroup iface_wl_shm
+ */
+#define WL_SHM_CREATE_POOL_SINCE_VERSION 1
+
+/**
+ * @ingroup iface_wl_shm
+ * Sends an format event to the client owning the resource.
+ * @param resource_ The client's resource
+ * @param format buffer pixel format
+ */
+static inline void
+wl_shm_send_format(struct wl_resource *resource_, uint32_t format)
+{
+ wl_resource_post_event(resource_, WL_SHM_FORMAT, format);
+}
+
+/**
+ * @ingroup iface_wl_buffer
+ * @struct wl_buffer_interface
+ */
+struct wl_buffer_interface {
+ /**
+ * destroy a buffer
+ *
+ * Destroy a buffer. If and how you need to release the backing
+ * storage is defined by the buffer factory interface.
+ *
+ * For possible side-effects to a surface, see wl_surface.attach.
+ */
+ void (*destroy)(struct wl_client *client,
+ struct wl_resource *resource);
+};
+
+#define WL_BUFFER_RELEASE 0
+
+/**
+ * @ingroup iface_wl_buffer
+ */
+#define WL_BUFFER_RELEASE_SINCE_VERSION 1
+
+/**
+ * @ingroup iface_wl_buffer
+ */
+#define WL_BUFFER_DESTROY_SINCE_VERSION 1
+
+/**
+ * @ingroup iface_wl_buffer
+ * Sends an release event to the client owning the resource.
+ * @param resource_ The client's resource
+ */
+static inline void
+wl_buffer_send_release(struct wl_resource *resource_)
+{
+ wl_resource_post_event(resource_, WL_BUFFER_RELEASE);
+}
+
+#ifndef WL_DATA_OFFER_ERROR_ENUM
+#define WL_DATA_OFFER_ERROR_ENUM
+enum wl_data_offer_error {
+ /**
+ * finish request was called untimely
+ */
+ WL_DATA_OFFER_ERROR_INVALID_FINISH = 0,
+ /**
+ * action mask contains invalid values
+ */
+ WL_DATA_OFFER_ERROR_INVALID_ACTION_MASK = 1,
+ /**
+ * action argument has an invalid value
+ */
+ WL_DATA_OFFER_ERROR_INVALID_ACTION = 2,
+ /**
+ * offer doesn't accept this request
+ */
+ WL_DATA_OFFER_ERROR_INVALID_OFFER = 3,
+};
+#endif /* WL_DATA_OFFER_ERROR_ENUM */
+
+/**
+ * @ingroup iface_wl_data_offer
+ * @struct wl_data_offer_interface
+ */
+struct wl_data_offer_interface {
+ /**
+ * accept one of the offered mime types
+ *
+ * Indicate that the client can accept the given mime type, or
+ * NULL for not accepted.
+ *
+ * For objects of version 2 or older, this request is used by the
+ * client to give feedback whether the client can receive the given
+ * mime type, or NULL if none is accepted; the feedback does not
+ * determine whether the drag-and-drop operation succeeds or not.
+ *
+ * For objects of version 3 or newer, this request determines the
+ * final result of the drag-and-drop operation. If the end result
+ * is that no mime types were accepted, the drag-and-drop operation
+ * will be cancelled and the corresponding drag source will receive
+ * wl_data_source.cancelled. Clients may still use this event in
+ * conjunction with wl_data_source.action for feedback.
+ * @param serial serial number of the accept request
+ * @param mime_type mime type accepted by the client
+ */
+ void (*accept)(struct wl_client *client,
+ struct wl_resource *resource,
+ uint32_t serial,
+ const char *mime_type);
+ /**
+ * request that the data is transferred
+ *
+ * To transfer the offered data, the client issues this request
+ * and indicates the mime type it wants to receive. The transfer
+ * happens through the passed file descriptor (typically created
+ * with the pipe system call). The source client writes the data in
+ * the mime type representation requested and then closes the file
+ * descriptor.
+ *
+ * The receiving client reads from the read end of the pipe until
+ * EOF and then closes its end, at which point the transfer is
+ * complete.
+ *
+ * This request may happen multiple times for different mime types,
+ * both before and after wl_data_device.drop. Drag-and-drop
+ * destination clients may preemptively fetch data or examine it
+ * more closely to determine acceptance.
+ * @param mime_type mime type desired by receiver
+ * @param fd file descriptor for data transfer
+ */
+ void (*receive)(struct wl_client *client,
+ struct wl_resource *resource,
+ const char *mime_type,
+ int32_t fd);
+ /**
+ * destroy data offer
+ *
+ * Destroy the data offer.
+ */
+ void (*destroy)(struct wl_client *client,
+ struct wl_resource *resource);
+ /**
+ * the offer will no longer be used
+ *
+ * Notifies the compositor that the drag destination successfully
+ * finished the drag-and-drop operation.
+ *
+ * Upon receiving this request, the compositor will emit
+ * wl_data_source.dnd_finished on the drag source client.
+ *
+ * It is a client error to perform other requests than
+ * wl_data_offer.destroy after this one. It is also an error to
+ * perform this request after a NULL mime type has been set in
+ * wl_data_offer.accept or no action was received through
+ * wl_data_offer.action.
+ * @since 3
+ */
+ void (*finish)(struct wl_client *client,
+ struct wl_resource *resource);
+ /**
+ * set the available/preferred drag-and-drop actions
+ *
+ * Sets the actions that the destination side client supports for
+ * this operation. This request may trigger the emission of
+ * wl_data_source.action and wl_data_offer.action events if the
+ * compositor needs to change the selected action.
+ *
+ * This request can be called multiple times throughout the
+ * drag-and-drop operation, typically in response to
+ * wl_data_device.enter or wl_data_device.motion events.
+ *
+ * This request determines the final result of the drag-and-drop
+ * operation. If the end result is that no action is accepted, the
+ * drag source will receive wl_drag_source.cancelled.
+ *
+ * The dnd_actions argument must contain only values expressed in
+ * the wl_data_device_manager.dnd_actions enum, and the
+ * preferred_action argument must only contain one of those values
+ * set, otherwise it will result in a protocol error.
+ *
+ * While managing an "ask" action, the destination drag-and-drop
+ * client may perform further wl_data_offer.receive requests, and
+ * is expected to perform one last wl_data_offer.set_actions
+ * request with a preferred action other than "ask" (and optionally
+ * wl_data_offer.accept) before requesting wl_data_offer.finish, in
+ * order to convey the action selected by the user. If the
+ * preferred action is not in the wl_data_offer.source_actions
+ * mask, an error will be raised.
+ *
+ * If the "ask" action is dismissed (e.g. user cancellation), the
+ * client is expected to perform wl_data_offer.destroy right away.
+ *
+ * This request can only be made on drag-and-drop offers, a
+ * protocol error will be raised otherwise.
+ * @param dnd_actions actions supported by the destination client
+ * @param preferred_action action preferred by the destination client
+ * @since 3
+ */
+ void (*set_actions)(struct wl_client *client,
+ struct wl_resource *resource,
+ uint32_t dnd_actions,
+ uint32_t preferred_action);
+};
+
+#define WL_DATA_OFFER_OFFER 0
+#define WL_DATA_OFFER_SOURCE_ACTIONS 1
+#define WL_DATA_OFFER_ACTION 2
+
+/**
+ * @ingroup iface_wl_data_offer
+ */
+#define WL_DATA_OFFER_OFFER_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_data_offer
+ */
+#define WL_DATA_OFFER_SOURCE_ACTIONS_SINCE_VERSION 3
+/**
+ * @ingroup iface_wl_data_offer
+ */
+#define WL_DATA_OFFER_ACTION_SINCE_VERSION 3
+
+/**
+ * @ingroup iface_wl_data_offer
+ */
+#define WL_DATA_OFFER_ACCEPT_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_data_offer
+ */
+#define WL_DATA_OFFER_RECEIVE_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_data_offer
+ */
+#define WL_DATA_OFFER_DESTROY_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_data_offer
+ */
+#define WL_DATA_OFFER_FINISH_SINCE_VERSION 3
+/**
+ * @ingroup iface_wl_data_offer
+ */
+#define WL_DATA_OFFER_SET_ACTIONS_SINCE_VERSION 3
+
+/**
+ * @ingroup iface_wl_data_offer
+ * Sends an offer event to the client owning the resource.
+ * @param resource_ The client's resource
+ * @param mime_type offered mime type
+ */
+static inline void
+wl_data_offer_send_offer(struct wl_resource *resource_, const char *mime_type)
+{
+ wl_resource_post_event(resource_, WL_DATA_OFFER_OFFER, mime_type);
+}
+
+/**
+ * @ingroup iface_wl_data_offer
+ * Sends an source_actions event to the client owning the resource.
+ * @param resource_ The client's resource
+ * @param source_actions actions offered by the data source
+ */
+static inline void
+wl_data_offer_send_source_actions(struct wl_resource *resource_, uint32_t source_actions)
+{
+ wl_resource_post_event(resource_, WL_DATA_OFFER_SOURCE_ACTIONS, source_actions);
+}
+
+/**
+ * @ingroup iface_wl_data_offer
+ * Sends an action event to the client owning the resource.
+ * @param resource_ The client's resource
+ * @param dnd_action action selected by the compositor
+ */
+static inline void
+wl_data_offer_send_action(struct wl_resource *resource_, uint32_t dnd_action)
+{
+ wl_resource_post_event(resource_, WL_DATA_OFFER_ACTION, dnd_action);
+}
+
+#ifndef WL_DATA_SOURCE_ERROR_ENUM
+#define WL_DATA_SOURCE_ERROR_ENUM
+enum wl_data_source_error {
+ /**
+ * action mask contains invalid values
+ */
+ WL_DATA_SOURCE_ERROR_INVALID_ACTION_MASK = 0,
+ /**
+ * source doesn't accept this request
+ */
+ WL_DATA_SOURCE_ERROR_INVALID_SOURCE = 1,
+};
+#endif /* WL_DATA_SOURCE_ERROR_ENUM */
+
+/**
+ * @ingroup iface_wl_data_source
+ * @struct wl_data_source_interface
+ */
+struct wl_data_source_interface {
+ /**
+ * add an offered mime type
+ *
+ * This request adds a mime type to the set of mime types
+ * advertised to targets. Can be called several times to offer
+ * multiple types.
+ * @param mime_type mime type offered by the data source
+ */
+ void (*offer)(struct wl_client *client,
+ struct wl_resource *resource,
+ const char *mime_type);
+ /**
+ * destroy the data source
+ *
+ * Destroy the data source.
+ */
+ void (*destroy)(struct wl_client *client,
+ struct wl_resource *resource);
+ /**
+ * set the available drag-and-drop actions
+ *
+ * Sets the actions that the source side client supports for this
+ * operation. This request may trigger wl_data_source.action and
+ * wl_data_offer.action events if the compositor needs to change
+ * the selected action.
+ *
+ * The dnd_actions argument must contain only values expressed in
+ * the wl_data_device_manager.dnd_actions enum, otherwise it will
+ * result in a protocol error.
+ *
+ * This request must be made once only, and can only be made on
+ * sources used in drag-and-drop, so it must be performed before
+ * wl_data_device.start_drag. Attempting to use the source other
+ * than for drag-and-drop will raise a protocol error.
+ * @param dnd_actions actions supported by the data source
+ * @since 3
+ */
+ void (*set_actions)(struct wl_client *client,
+ struct wl_resource *resource,
+ uint32_t dnd_actions);
+};
+
+#define WL_DATA_SOURCE_TARGET 0
+#define WL_DATA_SOURCE_SEND 1
+#define WL_DATA_SOURCE_CANCELLED 2
+#define WL_DATA_SOURCE_DND_DROP_PERFORMED 3
+#define WL_DATA_SOURCE_DND_FINISHED 4
+#define WL_DATA_SOURCE_ACTION 5
+
+/**
+ * @ingroup iface_wl_data_source
+ */
+#define WL_DATA_SOURCE_TARGET_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_data_source
+ */
+#define WL_DATA_SOURCE_SEND_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_data_source
+ */
+#define WL_DATA_SOURCE_CANCELLED_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_data_source
+ */
+#define WL_DATA_SOURCE_DND_DROP_PERFORMED_SINCE_VERSION 3
+/**
+ * @ingroup iface_wl_data_source
+ */
+#define WL_DATA_SOURCE_DND_FINISHED_SINCE_VERSION 3
+/**
+ * @ingroup iface_wl_data_source
+ */
+#define WL_DATA_SOURCE_ACTION_SINCE_VERSION 3
+
+/**
+ * @ingroup iface_wl_data_source
+ */
+#define WL_DATA_SOURCE_OFFER_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_data_source
+ */
+#define WL_DATA_SOURCE_DESTROY_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_data_source
+ */
+#define WL_DATA_SOURCE_SET_ACTIONS_SINCE_VERSION 3
+
+/**
+ * @ingroup iface_wl_data_source
+ * Sends an target event to the client owning the resource.
+ * @param resource_ The client's resource
+ * @param mime_type mime type accepted by the target
+ */
+static inline void
+wl_data_source_send_target(struct wl_resource *resource_, const char *mime_type)
+{
+ wl_resource_post_event(resource_, WL_DATA_SOURCE_TARGET, mime_type);
+}
+
+/**
+ * @ingroup iface_wl_data_source
+ * Sends an send event to the client owning the resource.
+ * @param resource_ The client's resource
+ * @param mime_type mime type for the data
+ * @param fd file descriptor for the data
+ */
+static inline void
+wl_data_source_send_send(struct wl_resource *resource_, const char *mime_type, int32_t fd)
+{
+ wl_resource_post_event(resource_, WL_DATA_SOURCE_SEND, mime_type, fd);
+}
+
+/**
+ * @ingroup iface_wl_data_source
+ * Sends an cancelled event to the client owning the resource.
+ * @param resource_ The client's resource
+ */
+static inline void
+wl_data_source_send_cancelled(struct wl_resource *resource_)
+{
+ wl_resource_post_event(resource_, WL_DATA_SOURCE_CANCELLED);
+}
+
+/**
+ * @ingroup iface_wl_data_source
+ * Sends an dnd_drop_performed event to the client owning the resource.
+ * @param resource_ The client's resource
+ */
+static inline void
+wl_data_source_send_dnd_drop_performed(struct wl_resource *resource_)
+{
+ wl_resource_post_event(resource_, WL_DATA_SOURCE_DND_DROP_PERFORMED);
+}
+
+/**
+ * @ingroup iface_wl_data_source
+ * Sends an dnd_finished event to the client owning the resource.
+ * @param resource_ The client's resource
+ */
+static inline void
+wl_data_source_send_dnd_finished(struct wl_resource *resource_)
+{
+ wl_resource_post_event(resource_, WL_DATA_SOURCE_DND_FINISHED);
+}
+
+/**
+ * @ingroup iface_wl_data_source
+ * Sends an action event to the client owning the resource.
+ * @param resource_ The client's resource
+ * @param dnd_action action selected by the compositor
+ */
+static inline void
+wl_data_source_send_action(struct wl_resource *resource_, uint32_t dnd_action)
+{
+ wl_resource_post_event(resource_, WL_DATA_SOURCE_ACTION, dnd_action);
+}
+
+#ifndef WL_DATA_DEVICE_ERROR_ENUM
+#define WL_DATA_DEVICE_ERROR_ENUM
+enum wl_data_device_error {
+ /**
+ * given wl_surface has another role
+ */
+ WL_DATA_DEVICE_ERROR_ROLE = 0,
+};
+#endif /* WL_DATA_DEVICE_ERROR_ENUM */
+
+/**
+ * @ingroup iface_wl_data_device
+ * @struct wl_data_device_interface
+ */
+struct wl_data_device_interface {
+ /**
+ * start drag-and-drop operation
+ *
+ * This request asks the compositor to start a drag-and-drop
+ * operation on behalf of the client.
+ *
+ * The source argument is the data source that provides the data
+ * for the eventual data transfer. If source is NULL, enter, leave
+ * and motion events are sent only to the client that initiated the
+ * drag and the client is expected to handle the data passing
+ * internally.
+ *
+ * The origin surface is the surface where the drag originates and
+ * the client must have an active implicit grab that matches the
+ * serial.
+ *
+ * The icon surface is an optional (can be NULL) surface that
+ * provides an icon to be moved around with the cursor. Initially,
+ * the top-left corner of the icon surface is placed at the cursor
+ * hotspot, but subsequent wl_surface.attach request can move the
+ * relative position. Attach requests must be confirmed with
+ * wl_surface.commit as usual. The icon surface is given the role
+ * of a drag-and-drop icon. If the icon surface already has another
+ * role, it raises a protocol error.
+ *
+ * The current and pending input regions of the icon wl_surface are
+ * cleared, and wl_surface.set_input_region is ignored until the
+ * wl_surface is no longer used as the icon surface. When the use
+ * as an icon ends, the current and pending input regions become
+ * undefined, and the wl_surface is unmapped.
+ * @param source data source for the eventual transfer
+ * @param origin surface where the drag originates
+ * @param icon drag-and-drop icon surface
+ * @param serial serial number of the implicit grab on the origin
+ */
+ void (*start_drag)(struct wl_client *client,
+ struct wl_resource *resource,
+ struct wl_resource *source,
+ struct wl_resource *origin,
+ struct wl_resource *icon,
+ uint32_t serial);
+ /**
+ * copy data to the selection
+ *
+ * This request asks the compositor to set the selection to the
+ * data from the source on behalf of the client.
+ *
+ * To unset the selection, set the source to NULL.
+ * @param source data source for the selection
+ * @param serial serial number of the event that triggered this request
+ */
+ void (*set_selection)(struct wl_client *client,
+ struct wl_resource *resource,
+ struct wl_resource *source,
+ uint32_t serial);
+ /**
+ * destroy data device
+ *
+ * This request destroys the data device.
+ * @since 2
+ */
+ void (*release)(struct wl_client *client,
+ struct wl_resource *resource);
+};
+
+#define WL_DATA_DEVICE_DATA_OFFER 0
+#define WL_DATA_DEVICE_ENTER 1
+#define WL_DATA_DEVICE_LEAVE 2
+#define WL_DATA_DEVICE_MOTION 3
+#define WL_DATA_DEVICE_DROP 4
+#define WL_DATA_DEVICE_SELECTION 5
+
+/**
+ * @ingroup iface_wl_data_device
+ */
+#define WL_DATA_DEVICE_DATA_OFFER_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_data_device
+ */
+#define WL_DATA_DEVICE_ENTER_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_data_device
+ */
+#define WL_DATA_DEVICE_LEAVE_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_data_device
+ */
+#define WL_DATA_DEVICE_MOTION_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_data_device
+ */
+#define WL_DATA_DEVICE_DROP_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_data_device
+ */
+#define WL_DATA_DEVICE_SELECTION_SINCE_VERSION 1
+
+/**
+ * @ingroup iface_wl_data_device
+ */
+#define WL_DATA_DEVICE_START_DRAG_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_data_device
+ */
+#define WL_DATA_DEVICE_SET_SELECTION_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_data_device
+ */
+#define WL_DATA_DEVICE_RELEASE_SINCE_VERSION 2
+
+/**
+ * @ingroup iface_wl_data_device
+ * Sends an data_offer event to the client owning the resource.
+ * @param resource_ The client's resource
+ * @param id the new data_offer object
+ */
+static inline void
+wl_data_device_send_data_offer(struct wl_resource *resource_, struct wl_resource *id)
+{
+ wl_resource_post_event(resource_, WL_DATA_DEVICE_DATA_OFFER, id);
+}
+
+/**
+ * @ingroup iface_wl_data_device
+ * Sends an enter event to the client owning the resource.
+ * @param resource_ The client's resource
+ * @param serial serial number of the enter event
+ * @param surface client surface entered
+ * @param x surface-local x coordinate
+ * @param y surface-local y coordinate
+ * @param id source data_offer object
+ */
+static inline void
+wl_data_device_send_enter(struct wl_resource *resource_, uint32_t serial, struct wl_resource *surface, wl_fixed_t x, wl_fixed_t y, struct wl_resource *id)
+{
+ wl_resource_post_event(resource_, WL_DATA_DEVICE_ENTER, serial, surface, x, y, id);
+}
+
+/**
+ * @ingroup iface_wl_data_device
+ * Sends an leave event to the client owning the resource.
+ * @param resource_ The client's resource
+ */
+static inline void
+wl_data_device_send_leave(struct wl_resource *resource_)
+{
+ wl_resource_post_event(resource_, WL_DATA_DEVICE_LEAVE);
+}
+
+/**
+ * @ingroup iface_wl_data_device
+ * Sends an motion event to the client owning the resource.
+ * @param resource_ The client's resource
+ * @param time timestamp with millisecond granularity
+ * @param x surface-local x coordinate
+ * @param y surface-local y coordinate
+ */
+static inline void
+wl_data_device_send_motion(struct wl_resource *resource_, uint32_t time, wl_fixed_t x, wl_fixed_t y)
+{
+ wl_resource_post_event(resource_, WL_DATA_DEVICE_MOTION, time, x, y);
+}
+
+/**
+ * @ingroup iface_wl_data_device
+ * Sends an drop event to the client owning the resource.
+ * @param resource_ The client's resource
+ */
+static inline void
+wl_data_device_send_drop(struct wl_resource *resource_)
+{
+ wl_resource_post_event(resource_, WL_DATA_DEVICE_DROP);
+}
+
+/**
+ * @ingroup iface_wl_data_device
+ * Sends an selection event to the client owning the resource.
+ * @param resource_ The client's resource
+ * @param id selection data_offer object
+ */
+static inline void
+wl_data_device_send_selection(struct wl_resource *resource_, struct wl_resource *id)
+{
+ wl_resource_post_event(resource_, WL_DATA_DEVICE_SELECTION, id);
+}
+
+#ifndef WL_DATA_DEVICE_MANAGER_DND_ACTION_ENUM
+#define WL_DATA_DEVICE_MANAGER_DND_ACTION_ENUM
+/**
+ * @ingroup iface_wl_data_device_manager
+ * drag and drop actions
+ *
+ * This is a bitmask of the available/preferred actions in a
+ * drag-and-drop operation.
+ *
+ * In the compositor, the selected action is a result of matching the
+ * actions offered by the source and destination sides. "action" events
+ * with a "none" action will be sent to both source and destination if
+ * there is no match. All further checks will effectively happen on
+ * (source actions ∩ destination actions).
+ *
+ * In addition, compositors may also pick different actions in
+ * reaction to key modifiers being pressed. One common design that
+ * is used in major toolkits (and the behavior recommended for
+ * compositors) is:
+ *
+ * - If no modifiers are pressed, the first match (in bit order)
+ * will be used.
+ * - Pressing Shift selects "move", if enabled in the mask.
+ * - Pressing Control selects "copy", if enabled in the mask.
+ *
+ * Behavior beyond that is considered implementation-dependent.
+ * Compositors may for example bind other modifiers (like Alt/Meta)
+ * or drags initiated with other buttons than BTN_LEFT to specific
+ * actions (e.g. "ask").
+ */
+enum wl_data_device_manager_dnd_action {
+ /**
+ * no action
+ */
+ WL_DATA_DEVICE_MANAGER_DND_ACTION_NONE = 0,
+ /**
+ * copy action
+ */
+ WL_DATA_DEVICE_MANAGER_DND_ACTION_COPY = 1,
+ /**
+ * move action
+ */
+ WL_DATA_DEVICE_MANAGER_DND_ACTION_MOVE = 2,
+ /**
+ * ask action
+ */
+ WL_DATA_DEVICE_MANAGER_DND_ACTION_ASK = 4,
+};
+#endif /* WL_DATA_DEVICE_MANAGER_DND_ACTION_ENUM */
+
+/**
+ * @ingroup iface_wl_data_device_manager
+ * @struct wl_data_device_manager_interface
+ */
+struct wl_data_device_manager_interface {
+ /**
+ * create a new data source
+ *
+ * Create a new data source.
+ * @param id data source to create
+ */
+ void (*create_data_source)(struct wl_client *client,
+ struct wl_resource *resource,
+ uint32_t id);
+ /**
+ * create a new data device
+ *
+ * Create a new data device for a given seat.
+ * @param id data device to create
+ * @param seat seat associated with the data device
+ */
+ void (*get_data_device)(struct wl_client *client,
+ struct wl_resource *resource,
+ uint32_t id,
+ struct wl_resource *seat);
+};
+
+
+/**
+ * @ingroup iface_wl_data_device_manager
+ */
+#define WL_DATA_DEVICE_MANAGER_CREATE_DATA_SOURCE_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_data_device_manager
+ */
+#define WL_DATA_DEVICE_MANAGER_GET_DATA_DEVICE_SINCE_VERSION 1
+
+#ifndef WL_SHELL_ERROR_ENUM
+#define WL_SHELL_ERROR_ENUM
+enum wl_shell_error {
+ /**
+ * given wl_surface has another role
+ */
+ WL_SHELL_ERROR_ROLE = 0,
+};
+#endif /* WL_SHELL_ERROR_ENUM */
+
+/**
+ * @ingroup iface_wl_shell
+ * @struct wl_shell_interface
+ */
+struct wl_shell_interface {
+ /**
+ * create a shell surface from a surface
+ *
+ * Create a shell surface for an existing surface. This gives the
+ * wl_surface the role of a shell surface. If the wl_surface
+ * already has another role, it raises a protocol error.
+ *
+ * Only one shell surface can be associated with a given surface.
+ * @param id shell surface to create
+ * @param surface surface to be given the shell surface role
+ */
+ void (*get_shell_surface)(struct wl_client *client,
+ struct wl_resource *resource,
+ uint32_t id,
+ struct wl_resource *surface);
+};
+
+
+/**
+ * @ingroup iface_wl_shell
+ */
+#define WL_SHELL_GET_SHELL_SURFACE_SINCE_VERSION 1
+
+#ifndef WL_SHELL_SURFACE_RESIZE_ENUM
+#define WL_SHELL_SURFACE_RESIZE_ENUM
+/**
+ * @ingroup iface_wl_shell_surface
+ * edge values for resizing
+ *
+ * These values are used to indicate which edge of a surface
+ * is being dragged in a resize operation. The server may
+ * use this information to adapt its behavior, e.g. choose
+ * an appropriate cursor image.
+ */
+enum wl_shell_surface_resize {
+ /**
+ * no edge
+ */
+ WL_SHELL_SURFACE_RESIZE_NONE = 0,
+ /**
+ * top edge
+ */
+ WL_SHELL_SURFACE_RESIZE_TOP = 1,
+ /**
+ * bottom edge
+ */
+ WL_SHELL_SURFACE_RESIZE_BOTTOM = 2,
+ /**
+ * left edge
+ */
+ WL_SHELL_SURFACE_RESIZE_LEFT = 4,
+ /**
+ * top and left edges
+ */
+ WL_SHELL_SURFACE_RESIZE_TOP_LEFT = 5,
+ /**
+ * bottom and left edges
+ */
+ WL_SHELL_SURFACE_RESIZE_BOTTOM_LEFT = 6,
+ /**
+ * right edge
+ */
+ WL_SHELL_SURFACE_RESIZE_RIGHT = 8,
+ /**
+ * top and right edges
+ */
+ WL_SHELL_SURFACE_RESIZE_TOP_RIGHT = 9,
+ /**
+ * bottom and right edges
+ */
+ WL_SHELL_SURFACE_RESIZE_BOTTOM_RIGHT = 10,
+};
+#endif /* WL_SHELL_SURFACE_RESIZE_ENUM */
+
+#ifndef WL_SHELL_SURFACE_TRANSIENT_ENUM
+#define WL_SHELL_SURFACE_TRANSIENT_ENUM
+/**
+ * @ingroup iface_wl_shell_surface
+ * details of transient behaviour
+ *
+ * These flags specify details of the expected behaviour
+ * of transient surfaces. Used in the set_transient request.
+ */
+enum wl_shell_surface_transient {
+ /**
+ * do not set keyboard focus
+ */
+ WL_SHELL_SURFACE_TRANSIENT_INACTIVE = 0x1,
+};
+#endif /* WL_SHELL_SURFACE_TRANSIENT_ENUM */
+
+#ifndef WL_SHELL_SURFACE_FULLSCREEN_METHOD_ENUM
+#define WL_SHELL_SURFACE_FULLSCREEN_METHOD_ENUM
+/**
+ * @ingroup iface_wl_shell_surface
+ * different method to set the surface fullscreen
+ *
+ * Hints to indicate to the compositor how to deal with a conflict
+ * between the dimensions of the surface and the dimensions of the
+ * output. The compositor is free to ignore this parameter.
+ */
+enum wl_shell_surface_fullscreen_method {
+ /**
+ * no preference, apply default policy
+ */
+ WL_SHELL_SURFACE_FULLSCREEN_METHOD_DEFAULT = 0,
+ /**
+ * scale, preserve the surface's aspect ratio and center on output
+ */
+ WL_SHELL_SURFACE_FULLSCREEN_METHOD_SCALE = 1,
+ /**
+ * switch output mode to the smallest mode that can fit the surface, add black borders to compensate size mismatch
+ */
+ WL_SHELL_SURFACE_FULLSCREEN_METHOD_DRIVER = 2,
+ /**
+ * no upscaling, center on output and add black borders to compensate size mismatch
+ */
+ WL_SHELL_SURFACE_FULLSCREEN_METHOD_FILL = 3,
+};
+#endif /* WL_SHELL_SURFACE_FULLSCREEN_METHOD_ENUM */
+
+/**
+ * @ingroup iface_wl_shell_surface
+ * @struct wl_shell_surface_interface
+ */
+struct wl_shell_surface_interface {
+ /**
+ * respond to a ping event
+ *
+ * A client must respond to a ping event with a pong request or
+ * the client may be deemed unresponsive.
+ * @param serial serial number of the ping event
+ */
+ void (*pong)(struct wl_client *client,
+ struct wl_resource *resource,
+ uint32_t serial);
+ /**
+ * start an interactive move
+ *
+ * Start a pointer-driven move of the surface.
+ *
+ * This request must be used in response to a button press event.
+ * The server may ignore move requests depending on the state of
+ * the surface (e.g. fullscreen or maximized).
+ * @param seat seat whose pointer is used
+ * @param serial serial number of the implicit grab on the pointer
+ */
+ void (*move)(struct wl_client *client,
+ struct wl_resource *resource,
+ struct wl_resource *seat,
+ uint32_t serial);
+ /**
+ * start an interactive resize
+ *
+ * Start a pointer-driven resizing of the surface.
+ *
+ * This request must be used in response to a button press event.
+ * The server may ignore resize requests depending on the state of
+ * the surface (e.g. fullscreen or maximized).
+ * @param seat seat whose pointer is used
+ * @param serial serial number of the implicit grab on the pointer
+ * @param edges which edge or corner is being dragged
+ */
+ void (*resize)(struct wl_client *client,
+ struct wl_resource *resource,
+ struct wl_resource *seat,
+ uint32_t serial,
+ uint32_t edges);
+ /**
+ * make the surface a toplevel surface
+ *
+ * Map the surface as a toplevel surface.
+ *
+ * A toplevel surface is not fullscreen, maximized or transient.
+ */
+ void (*set_toplevel)(struct wl_client *client,
+ struct wl_resource *resource);
+ /**
+ * make the surface a transient surface
+ *
+ * Map the surface relative to an existing surface.
+ *
+ * The x and y arguments specify the location of the upper left
+ * corner of the surface relative to the upper left corner of the
+ * parent surface, in surface-local coordinates.
+ *
+ * The flags argument controls details of the transient behaviour.
+ * @param parent parent surface
+ * @param x surface-local x coordinate
+ * @param y surface-local y coordinate
+ * @param flags transient surface behavior
+ */
+ void (*set_transient)(struct wl_client *client,
+ struct wl_resource *resource,
+ struct wl_resource *parent,
+ int32_t x,
+ int32_t y,
+ uint32_t flags);
+ /**
+ * make the surface a fullscreen surface
+ *
+ * Map the surface as a fullscreen surface.
+ *
+ * If an output parameter is given then the surface will be made
+ * fullscreen on that output. If the client does not specify the
+ * output then the compositor will apply its policy - usually
+ * choosing the output on which the surface has the biggest surface
+ * area.
+ *
+ * The client may specify a method to resolve a size conflict
+ * between the output size and the surface size - this is provided
+ * through the method parameter.
+ *
+ * The framerate parameter is used only when the method is set to
+ * "driver", to indicate the preferred framerate. A value of 0
+ * indicates that the client does not care about framerate. The
+ * framerate is specified in mHz, that is framerate of 60000 is
+ * 60Hz.
+ *
+ * A method of "scale" or "driver" implies a scaling operation of
+ * the surface, either via a direct scaling operation or a change
+ * of the output mode. This will override any kind of output
+ * scaling, so that mapping a surface with a buffer size equal to
+ * the mode can fill the screen independent of buffer_scale.
+ *
+ * A method of "fill" means we don't scale up the buffer, however
+ * any output scale is applied. This means that you may run into an
+ * edge case where the application maps a buffer with the same size
+ * of the output mode but buffer_scale 1 (thus making a surface
+ * larger than the output). In this case it is allowed to downscale
+ * the results to fit the screen.
+ *
+ * The compositor must reply to this request with a configure event
+ * with the dimensions for the output on which the surface will be
+ * made fullscreen.
+ * @param method method for resolving size conflict
+ * @param framerate framerate in mHz
+ * @param output output on which the surface is to be fullscreen
+ */
+ void (*set_fullscreen)(struct wl_client *client,
+ struct wl_resource *resource,
+ uint32_t method,
+ uint32_t framerate,
+ struct wl_resource *output);
+ /**
+ * make the surface a popup surface
+ *
+ * Map the surface as a popup.
+ *
+ * A popup surface is a transient surface with an added pointer
+ * grab.
+ *
+ * An existing implicit grab will be changed to owner-events mode,
+ * and the popup grab will continue after the implicit grab ends
+ * (i.e. releasing the mouse button does not cause the popup to be
+ * unmapped).
+ *
+ * The popup grab continues until the window is destroyed or a
+ * mouse button is pressed in any other client's window. A click in
+ * any of the client's surfaces is reported as normal, however,
+ * clicks in other clients' surfaces will be discarded and trigger
+ * the callback.
+ *
+ * The x and y arguments specify the location of the upper left
+ * corner of the surface relative to the upper left corner of the
+ * parent surface, in surface-local coordinates.
+ * @param seat seat whose pointer is used
+ * @param serial serial number of the implicit grab on the pointer
+ * @param parent parent surface
+ * @param x surface-local x coordinate
+ * @param y surface-local y coordinate
+ * @param flags transient surface behavior
+ */
+ void (*set_popup)(struct wl_client *client,
+ struct wl_resource *resource,
+ struct wl_resource *seat,
+ uint32_t serial,
+ struct wl_resource *parent,
+ int32_t x,
+ int32_t y,
+ uint32_t flags);
+ /**
+ * make the surface a maximized surface
+ *
+ * Map the surface as a maximized surface.
+ *
+ * If an output parameter is given then the surface will be
+ * maximized on that output. If the client does not specify the
+ * output then the compositor will apply its policy - usually
+ * choosing the output on which the surface has the biggest surface
+ * area.
+ *
+ * The compositor will reply with a configure event telling the
+ * expected new surface size. The operation is completed on the
+ * next buffer attach to this surface.
+ *
+ * A maximized surface typically fills the entire output it is
+ * bound to, except for desktop elements such as panels. This is
+ * the main difference between a maximized shell surface and a
+ * fullscreen shell surface.
+ *
+ * The details depend on the compositor implementation.
+ * @param output output on which the surface is to be maximized
+ */
+ void (*set_maximized)(struct wl_client *client,
+ struct wl_resource *resource,
+ struct wl_resource *output);
+ /**
+ * set surface title
+ *
+ * Set a short title for the surface.
+ *
+ * This string may be used to identify the surface in a task bar,
+ * window list, or other user interface elements provided by the
+ * compositor.
+ *
+ * The string must be encoded in UTF-8.
+ * @param title surface title
+ */
+ void (*set_title)(struct wl_client *client,
+ struct wl_resource *resource,
+ const char *title);
+ /**
+ * set surface class
+ *
+ * Set a class for the surface.
+ *
+ * The surface class identifies the general class of applications
+ * to which the surface belongs. A common convention is to use the
+ * file name (or the full path if it is a non-standard location) of
+ * the application's .desktop file as the class.
+ * @param class_ surface class
+ */
+ void (*set_class)(struct wl_client *client,
+ struct wl_resource *resource,
+ const char *class_);
+};
+
+#define WL_SHELL_SURFACE_PING 0
+#define WL_SHELL_SURFACE_CONFIGURE 1
+#define WL_SHELL_SURFACE_POPUP_DONE 2
+
+/**
+ * @ingroup iface_wl_shell_surface
+ */
+#define WL_SHELL_SURFACE_PING_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_shell_surface
+ */
+#define WL_SHELL_SURFACE_CONFIGURE_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_shell_surface
+ */
+#define WL_SHELL_SURFACE_POPUP_DONE_SINCE_VERSION 1
+
+/**
+ * @ingroup iface_wl_shell_surface
+ */
+#define WL_SHELL_SURFACE_PONG_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_shell_surface
+ */
+#define WL_SHELL_SURFACE_MOVE_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_shell_surface
+ */
+#define WL_SHELL_SURFACE_RESIZE_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_shell_surface
+ */
+#define WL_SHELL_SURFACE_SET_TOPLEVEL_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_shell_surface
+ */
+#define WL_SHELL_SURFACE_SET_TRANSIENT_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_shell_surface
+ */
+#define WL_SHELL_SURFACE_SET_FULLSCREEN_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_shell_surface
+ */
+#define WL_SHELL_SURFACE_SET_POPUP_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_shell_surface
+ */
+#define WL_SHELL_SURFACE_SET_MAXIMIZED_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_shell_surface
+ */
+#define WL_SHELL_SURFACE_SET_TITLE_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_shell_surface
+ */
+#define WL_SHELL_SURFACE_SET_CLASS_SINCE_VERSION 1
+
+/**
+ * @ingroup iface_wl_shell_surface
+ * Sends an ping event to the client owning the resource.
+ * @param resource_ The client's resource
+ * @param serial serial number of the ping
+ */
+static inline void
+wl_shell_surface_send_ping(struct wl_resource *resource_, uint32_t serial)
+{
+ wl_resource_post_event(resource_, WL_SHELL_SURFACE_PING, serial);
+}
+
+/**
+ * @ingroup iface_wl_shell_surface
+ * Sends an configure event to the client owning the resource.
+ * @param resource_ The client's resource
+ * @param edges how the surface was resized
+ * @param width new width of the surface
+ * @param height new height of the surface
+ */
+static inline void
+wl_shell_surface_send_configure(struct wl_resource *resource_, uint32_t edges, int32_t width, int32_t height)
+{
+ wl_resource_post_event(resource_, WL_SHELL_SURFACE_CONFIGURE, edges, width, height);
+}
+
+/**
+ * @ingroup iface_wl_shell_surface
+ * Sends an popup_done event to the client owning the resource.
+ * @param resource_ The client's resource
+ */
+static inline void
+wl_shell_surface_send_popup_done(struct wl_resource *resource_)
+{
+ wl_resource_post_event(resource_, WL_SHELL_SURFACE_POPUP_DONE);
+}
+
+#ifndef WL_SURFACE_ERROR_ENUM
+#define WL_SURFACE_ERROR_ENUM
+/**
+ * @ingroup iface_wl_surface
+ * wl_surface error values
+ *
+ * These errors can be emitted in response to wl_surface requests.
+ */
+enum wl_surface_error {
+ /**
+ * buffer scale value is invalid
+ */
+ WL_SURFACE_ERROR_INVALID_SCALE = 0,
+ /**
+ * buffer transform value is invalid
+ */
+ WL_SURFACE_ERROR_INVALID_TRANSFORM = 1,
+};
+#endif /* WL_SURFACE_ERROR_ENUM */
+
+/**
+ * @ingroup iface_wl_surface
+ * @struct wl_surface_interface
+ */
+struct wl_surface_interface {
+ /**
+ * delete surface
+ *
+ * Deletes the surface and invalidates its object ID.
+ */
+ void (*destroy)(struct wl_client *client,
+ struct wl_resource *resource);
+ /**
+ * set the surface contents
+ *
+ * Set a buffer as the content of this surface.
+ *
+ * The new size of the surface is calculated based on the buffer
+ * size transformed by the inverse buffer_transform and the inverse
+ * buffer_scale. This means that the supplied buffer must be an
+ * integer multiple of the buffer_scale.
+ *
+ * The x and y arguments specify the location of the new pending
+ * buffer's upper left corner, relative to the current buffer's
+ * upper left corner, in surface-local coordinates. In other words,
+ * the x and y, combined with the new surface size define in which
+ * directions the surface's size changes.
+ *
+ * Surface contents are double-buffered state, see
+ * wl_surface.commit.
+ *
+ * The initial surface contents are void; there is no content.
+ * wl_surface.attach assigns the given wl_buffer as the pending
+ * wl_buffer. wl_surface.commit makes the pending wl_buffer the new
+ * surface contents, and the size of the surface becomes the size
+ * calculated from the wl_buffer, as described above. After commit,
+ * there is no pending buffer until the next attach.
+ *
+ * Committing a pending wl_buffer allows the compositor to read the
+ * pixels in the wl_buffer. The compositor may access the pixels at
+ * any time after the wl_surface.commit request. When the
+ * compositor will not access the pixels anymore, it will send the
+ * wl_buffer.release event. Only after receiving wl_buffer.release,
+ * the client may reuse the wl_buffer. A wl_buffer that has been
+ * attached and then replaced by another attach instead of
+ * committed will not receive a release event, and is not used by
+ * the compositor.
+ *
+ * Destroying the wl_buffer after wl_buffer.release does not change
+ * the surface contents. However, if the client destroys the
+ * wl_buffer before receiving the wl_buffer.release event, the
+ * surface contents become undefined immediately.
+ *
+ * If wl_surface.attach is sent with a NULL wl_buffer, the
+ * following wl_surface.commit will remove the surface content.
+ * @param buffer buffer of surface contents
+ * @param x surface-local x coordinate
+ * @param y surface-local y coordinate
+ */
+ void (*attach)(struct wl_client *client,
+ struct wl_resource *resource,
+ struct wl_resource *buffer,
+ int32_t x,
+ int32_t y);
+ /**
+ * mark part of the surface damaged
+ *
+ * This request is used to describe the regions where the pending
+ * buffer is different from the current surface contents, and where
+ * the surface therefore needs to be repainted. The compositor
+ * ignores the parts of the damage that fall outside of the
+ * surface.
+ *
+ * Damage is double-buffered state, see wl_surface.commit.
+ *
+ * The damage rectangle is specified in surface-local coordinates,
+ * where x and y specify the upper left corner of the damage
+ * rectangle.
+ *
+ * The initial value for pending damage is empty: no damage.
+ * wl_surface.damage adds pending damage: the new pending damage is
+ * the union of old pending damage and the given rectangle.
+ *
+ * wl_surface.commit assigns pending damage as the current damage,
+ * and clears pending damage. The server will clear the current
+ * damage as it repaints the surface.
+ *
+ * Alternatively, damage can be posted with
+ * wl_surface.damage_buffer which uses buffer coordinates instead
+ * of surface coordinates, and is probably the preferred and
+ * intuitive way of doing this.
+ * @param x surface-local x coordinate
+ * @param y surface-local y coordinate
+ * @param width width of damage rectangle
+ * @param height height of damage rectangle
+ */
+ void (*damage)(struct wl_client *client,
+ struct wl_resource *resource,
+ int32_t x,
+ int32_t y,
+ int32_t width,
+ int32_t height);
+ /**
+ * request a frame throttling hint
+ *
+ * Request a notification when it is a good time to start drawing
+ * a new frame, by creating a frame callback. This is useful for
+ * throttling redrawing operations, and driving animations.
+ *
+ * When a client is animating on a wl_surface, it can use the
+ * 'frame' request to get notified when it is a good time to draw
+ * and commit the next frame of animation. If the client commits an
+ * update earlier than that, it is likely that some updates will
+ * not make it to the display, and the client is wasting resources
+ * by drawing too often.
+ *
+ * The frame request will take effect on the next
+ * wl_surface.commit. The notification will only be posted for one
+ * frame unless requested again. For a wl_surface, the
+ * notifications are posted in the order the frame requests were
+ * committed.
+ *
+ * The server must send the notifications so that a client will not
+ * send excessive updates, while still allowing the highest
+ * possible update rate for clients that wait for the reply before
+ * drawing again. The server should give some time for the client
+ * to draw and commit after sending the frame callback events to
+ * let it hit the next output refresh.
+ *
+ * A server should avoid signaling the frame callbacks if the
+ * surface is not visible in any way, e.g. the surface is
+ * off-screen, or completely obscured by other opaque surfaces.
+ *
+ * The object returned by this request will be destroyed by the
+ * compositor after the callback is fired and as such the client
+ * must not attempt to use it after that point.
+ *
+ * The callback_data passed in the callback is the current time, in
+ * milliseconds, with an undefined base.
+ * @param callback callback object for the frame request
+ */
+ void (*frame)(struct wl_client *client,
+ struct wl_resource *resource,
+ uint32_t callback);
+ /**
+ * set opaque region
+ *
+ * This request sets the region of the surface that contains
+ * opaque content.
+ *
+ * The opaque region is an optimization hint for the compositor
+ * that lets it optimize the redrawing of content behind opaque
+ * regions. Setting an opaque region is not required for correct
+ * behaviour, but marking transparent content as opaque will result
+ * in repaint artifacts.
+ *
+ * The opaque region is specified in surface-local coordinates.
+ *
+ * The compositor ignores the parts of the opaque region that fall
+ * outside of the surface.
+ *
+ * Opaque region is double-buffered state, see wl_surface.commit.
+ *
+ * wl_surface.set_opaque_region changes the pending opaque region.
+ * wl_surface.commit copies the pending region to the current
+ * region. Otherwise, the pending and current regions are never
+ * changed.
+ *
+ * The initial value for an opaque region is empty. Setting the
+ * pending opaque region has copy semantics, and the wl_region
+ * object can be destroyed immediately. A NULL wl_region causes the
+ * pending opaque region to be set to empty.
+ * @param region opaque region of the surface
+ */
+ void (*set_opaque_region)(struct wl_client *client,
+ struct wl_resource *resource,
+ struct wl_resource *region);
+ /**
+ * set input region
+ *
+ * This request sets the region of the surface that can receive
+ * pointer and touch events.
+ *
+ * Input events happening outside of this region will try the next
+ * surface in the server surface stack. The compositor ignores the
+ * parts of the input region that fall outside of the surface.
+ *
+ * The input region is specified in surface-local coordinates.
+ *
+ * Input region is double-buffered state, see wl_surface.commit.
+ *
+ * wl_surface.set_input_region changes the pending input region.
+ * wl_surface.commit copies the pending region to the current
+ * region. Otherwise the pending and current regions are never
+ * changed, except cursor and icon surfaces are special cases, see
+ * wl_pointer.set_cursor and wl_data_device.start_drag.
+ *
+ * The initial value for an input region is infinite. That means
+ * the whole surface will accept input. Setting the pending input
+ * region has copy semantics, and the wl_region object can be
+ * destroyed immediately. A NULL wl_region causes the input region
+ * to be set to infinite.
+ * @param region input region of the surface
+ */
+ void (*set_input_region)(struct wl_client *client,
+ struct wl_resource *resource,
+ struct wl_resource *region);
+ /**
+ * commit pending surface state
+ *
+ * Surface state (input, opaque, and damage regions, attached
+ * buffers, etc.) is double-buffered. Protocol requests modify the
+ * pending state, as opposed to the current state in use by the
+ * compositor. A commit request atomically applies all pending
+ * state, replacing the current state. After commit, the new
+ * pending state is as documented for each related request.
+ *
+ * On commit, a pending wl_buffer is applied first, and all other
+ * state second. This means that all coordinates in double-buffered
+ * state are relative to the new wl_buffer coming into use, except
+ * for wl_surface.attach itself. If there is no pending wl_buffer,
+ * the coordinates are relative to the current surface contents.
+ *
+ * All requests that need a commit to become effective are
+ * documented to affect double-buffered state.
+ *
+ * Other interfaces may add further double-buffered surface state.
+ */
+ void (*commit)(struct wl_client *client,
+ struct wl_resource *resource);
+ /**
+ * sets the buffer transformation
+ *
+ * This request sets an optional transformation on how the
+ * compositor interprets the contents of the buffer attached to the
+ * surface. The accepted values for the transform parameter are the
+ * values for wl_output.transform.
+ *
+ * Buffer transform is double-buffered state, see
+ * wl_surface.commit.
+ *
+ * A newly created surface has its buffer transformation set to
+ * normal.
+ *
+ * wl_surface.set_buffer_transform changes the pending buffer
+ * transformation. wl_surface.commit copies the pending buffer
+ * transformation to the current one. Otherwise, the pending and
+ * current values are never changed.
+ *
+ * The purpose of this request is to allow clients to render
+ * content according to the output transform, thus permitting the
+ * compositor to use certain optimizations even if the display is
+ * rotated. Using hardware overlays and scanning out a client
+ * buffer for fullscreen surfaces are examples of such
+ * optimizations. Those optimizations are highly dependent on the
+ * compositor implementation, so the use of this request should be
+ * considered on a case-by-case basis.
+ *
+ * Note that if the transform value includes 90 or 270 degree
+ * rotation, the width of the buffer will become the surface height
+ * and the height of the buffer will become the surface width.
+ *
+ * If transform is not one of the values from the
+ * wl_output.transform enum the invalid_transform protocol error is
+ * raised.
+ * @param transform transform for interpreting buffer contents
+ * @since 2
+ */
+ void (*set_buffer_transform)(struct wl_client *client,
+ struct wl_resource *resource,
+ int32_t transform);
+ /**
+ * sets the buffer scaling factor
+ *
+ * This request sets an optional scaling factor on how the
+ * compositor interprets the contents of the buffer attached to the
+ * window.
+ *
+ * Buffer scale is double-buffered state, see wl_surface.commit.
+ *
+ * A newly created surface has its buffer scale set to 1.
+ *
+ * wl_surface.set_buffer_scale changes the pending buffer scale.
+ * wl_surface.commit copies the pending buffer scale to the current
+ * one. Otherwise, the pending and current values are never
+ * changed.
+ *
+ * The purpose of this request is to allow clients to supply higher
+ * resolution buffer data for use on high resolution outputs. It is
+ * intended that you pick the same buffer scale as the scale of the
+ * output that the surface is displayed on. This means the
+ * compositor can avoid scaling when rendering the surface on that
+ * output.
+ *
+ * Note that if the scale is larger than 1, then you have to attach
+ * a buffer that is larger (by a factor of scale in each dimension)
+ * than the desired surface size.
+ *
+ * If scale is not positive the invalid_scale protocol error is
+ * raised.
+ * @param scale positive scale for interpreting buffer contents
+ * @since 3
+ */
+ void (*set_buffer_scale)(struct wl_client *client,
+ struct wl_resource *resource,
+ int32_t scale);
+ /**
+ * mark part of the surface damaged using buffer coordinates
+ *
+ * This request is used to describe the regions where the pending
+ * buffer is different from the current surface contents, and where
+ * the surface therefore needs to be repainted. The compositor
+ * ignores the parts of the damage that fall outside of the
+ * surface.
+ *
+ * Damage is double-buffered state, see wl_surface.commit.
+ *
+ * The damage rectangle is specified in buffer coordinates, where x
+ * and y specify the upper left corner of the damage rectangle.
+ *
+ * The initial value for pending damage is empty: no damage.
+ * wl_surface.damage_buffer adds pending damage: the new pending
+ * damage is the union of old pending damage and the given
+ * rectangle.
+ *
+ * wl_surface.commit assigns pending damage as the current damage,
+ * and clears pending damage. The server will clear the current
+ * damage as it repaints the surface.
+ *
+ * This request differs from wl_surface.damage in only one way - it
+ * takes damage in buffer coordinates instead of surface-local
+ * coordinates. While this generally is more intuitive than surface
+ * coordinates, it is especially desirable when using wp_viewport
+ * or when a drawing library (like EGL) is unaware of buffer scale
+ * and buffer transform.
+ *
+ * Note: Because buffer transformation changes and damage requests
+ * may be interleaved in the protocol stream, it is impossible to
+ * determine the actual mapping between surface and buffer damage
+ * until wl_surface.commit time. Therefore, compositors wishing to
+ * take both kinds of damage into account will have to accumulate
+ * damage from the two requests separately and only transform from
+ * one to the other after receiving the wl_surface.commit.
+ * @param x buffer-local x coordinate
+ * @param y buffer-local y coordinate
+ * @param width width of damage rectangle
+ * @param height height of damage rectangle
+ * @since 4
+ */
+ void (*damage_buffer)(struct wl_client *client,
+ struct wl_resource *resource,
+ int32_t x,
+ int32_t y,
+ int32_t width,
+ int32_t height);
+};
+
+#define WL_SURFACE_ENTER 0
+#define WL_SURFACE_LEAVE 1
+
+/**
+ * @ingroup iface_wl_surface
+ */
+#define WL_SURFACE_ENTER_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_surface
+ */
+#define WL_SURFACE_LEAVE_SINCE_VERSION 1
+
+/**
+ * @ingroup iface_wl_surface
+ */
+#define WL_SURFACE_DESTROY_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_surface
+ */
+#define WL_SURFACE_ATTACH_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_surface
+ */
+#define WL_SURFACE_DAMAGE_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_surface
+ */
+#define WL_SURFACE_FRAME_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_surface
+ */
+#define WL_SURFACE_SET_OPAQUE_REGION_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_surface
+ */
+#define WL_SURFACE_SET_INPUT_REGION_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_surface
+ */
+#define WL_SURFACE_COMMIT_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_surface
+ */
+#define WL_SURFACE_SET_BUFFER_TRANSFORM_SINCE_VERSION 2
+/**
+ * @ingroup iface_wl_surface
+ */
+#define WL_SURFACE_SET_BUFFER_SCALE_SINCE_VERSION 3
+/**
+ * @ingroup iface_wl_surface
+ */
+#define WL_SURFACE_DAMAGE_BUFFER_SINCE_VERSION 4
+
+/**
+ * @ingroup iface_wl_surface
+ * Sends an enter event to the client owning the resource.
+ * @param resource_ The client's resource
+ * @param output output entered by the surface
+ */
+static inline void
+wl_surface_send_enter(struct wl_resource *resource_, struct wl_resource *output)
+{
+ wl_resource_post_event(resource_, WL_SURFACE_ENTER, output);
+}
+
+/**
+ * @ingroup iface_wl_surface
+ * Sends an leave event to the client owning the resource.
+ * @param resource_ The client's resource
+ * @param output output left by the surface
+ */
+static inline void
+wl_surface_send_leave(struct wl_resource *resource_, struct wl_resource *output)
+{
+ wl_resource_post_event(resource_, WL_SURFACE_LEAVE, output);
+}
+
+#ifndef WL_SEAT_CAPABILITY_ENUM
+#define WL_SEAT_CAPABILITY_ENUM
+/**
+ * @ingroup iface_wl_seat
+ * seat capability bitmask
+ *
+ * This is a bitmask of capabilities this seat has; if a member is
+ * set, then it is present on the seat.
+ */
+enum wl_seat_capability {
+ /**
+ * the seat has pointer devices
+ */
+ WL_SEAT_CAPABILITY_POINTER = 1,
+ /**
+ * the seat has one or more keyboards
+ */
+ WL_SEAT_CAPABILITY_KEYBOARD = 2,
+ /**
+ * the seat has touch devices
+ */
+ WL_SEAT_CAPABILITY_TOUCH = 4,
+};
+#endif /* WL_SEAT_CAPABILITY_ENUM */
+
+/**
+ * @ingroup iface_wl_seat
+ * @struct wl_seat_interface
+ */
+struct wl_seat_interface {
+ /**
+ * return pointer object
+ *
+ * The ID provided will be initialized to the wl_pointer
+ * interface for this seat.
+ *
+ * This request only takes effect if the seat has the pointer
+ * capability, or has had the pointer capability in the past. It is
+ * a protocol violation to issue this request on a seat that has
+ * never had the pointer capability.
+ * @param id seat pointer
+ */
+ void (*get_pointer)(struct wl_client *client,
+ struct wl_resource *resource,
+ uint32_t id);
+ /**
+ * return keyboard object
+ *
+ * The ID provided will be initialized to the wl_keyboard
+ * interface for this seat.
+ *
+ * This request only takes effect if the seat has the keyboard
+ * capability, or has had the keyboard capability in the past. It
+ * is a protocol violation to issue this request on a seat that has
+ * never had the keyboard capability.
+ * @param id seat keyboard
+ */
+ void (*get_keyboard)(struct wl_client *client,
+ struct wl_resource *resource,
+ uint32_t id);
+ /**
+ * return touch object
+ *
+ * The ID provided will be initialized to the wl_touch interface
+ * for this seat.
+ *
+ * This request only takes effect if the seat has the touch
+ * capability, or has had the touch capability in the past. It is a
+ * protocol violation to issue this request on a seat that has
+ * never had the touch capability.
+ * @param id seat touch interface
+ */
+ void (*get_touch)(struct wl_client *client,
+ struct wl_resource *resource,
+ uint32_t id);
+ /**
+ * release the seat object
+ *
+ * Using this request a client can tell the server that it is not
+ * going to use the seat object anymore.
+ * @since 5
+ */
+ void (*release)(struct wl_client *client,
+ struct wl_resource *resource);
+};
+
+#define WL_SEAT_CAPABILITIES 0
+#define WL_SEAT_NAME 1
+
+/**
+ * @ingroup iface_wl_seat
+ */
+#define WL_SEAT_CAPABILITIES_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_seat
+ */
+#define WL_SEAT_NAME_SINCE_VERSION 2
+
+/**
+ * @ingroup iface_wl_seat
+ */
+#define WL_SEAT_GET_POINTER_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_seat
+ */
+#define WL_SEAT_GET_KEYBOARD_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_seat
+ */
+#define WL_SEAT_GET_TOUCH_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_seat
+ */
+#define WL_SEAT_RELEASE_SINCE_VERSION 5
+
+/**
+ * @ingroup iface_wl_seat
+ * Sends an capabilities event to the client owning the resource.
+ * @param resource_ The client's resource
+ * @param capabilities capabilities of the seat
+ */
+static inline void
+wl_seat_send_capabilities(struct wl_resource *resource_, uint32_t capabilities)
+{
+ wl_resource_post_event(resource_, WL_SEAT_CAPABILITIES, capabilities);
+}
+
+/**
+ * @ingroup iface_wl_seat
+ * Sends an name event to the client owning the resource.
+ * @param resource_ The client's resource
+ * @param name seat identifier
+ */
+static inline void
+wl_seat_send_name(struct wl_resource *resource_, const char *name)
+{
+ wl_resource_post_event(resource_, WL_SEAT_NAME, name);
+}
+
+#ifndef WL_POINTER_ERROR_ENUM
+#define WL_POINTER_ERROR_ENUM
+enum wl_pointer_error {
+ /**
+ * given wl_surface has another role
+ */
+ WL_POINTER_ERROR_ROLE = 0,
+};
+#endif /* WL_POINTER_ERROR_ENUM */
+
+#ifndef WL_POINTER_BUTTON_STATE_ENUM
+#define WL_POINTER_BUTTON_STATE_ENUM
+/**
+ * @ingroup iface_wl_pointer
+ * physical button state
+ *
+ * Describes the physical state of a button that produced the button
+ * event.
+ */
+enum wl_pointer_button_state {
+ /**
+ * the button is not pressed
+ */
+ WL_POINTER_BUTTON_STATE_RELEASED = 0,
+ /**
+ * the button is pressed
+ */
+ WL_POINTER_BUTTON_STATE_PRESSED = 1,
+};
+#endif /* WL_POINTER_BUTTON_STATE_ENUM */
+
+#ifndef WL_POINTER_AXIS_ENUM
+#define WL_POINTER_AXIS_ENUM
+/**
+ * @ingroup iface_wl_pointer
+ * axis types
+ *
+ * Describes the axis types of scroll events.
+ */
+enum wl_pointer_axis {
+ /**
+ * vertical axis
+ */
+ WL_POINTER_AXIS_VERTICAL_SCROLL = 0,
+ /**
+ * horizontal axis
+ */
+ WL_POINTER_AXIS_HORIZONTAL_SCROLL = 1,
+};
+#endif /* WL_POINTER_AXIS_ENUM */
+
+#ifndef WL_POINTER_AXIS_SOURCE_ENUM
+#define WL_POINTER_AXIS_SOURCE_ENUM
+/**
+ * @ingroup iface_wl_pointer
+ * axis source types
+ *
+ * Describes the source types for axis events. This indicates to the
+ * client how an axis event was physically generated; a client may
+ * adjust the user interface accordingly. For example, scroll events
+ * from a "finger" source may be in a smooth coordinate space with
+ * kinetic scrolling whereas a "wheel" source may be in discrete steps
+ * of a number of lines.
+ *
+ * The "continuous" axis source is a device generating events in a
+ * continuous coordinate space, but using something other than a
+ * finger. One example for this source is button-based scrolling where
+ * the vertical motion of a device is converted to scroll events while
+ * a button is held down.
+ *
+ * The "wheel tilt" axis source indicates that the actual device is a
+ * wheel but the scroll event is not caused by a rotation but a
+ * (usually sideways) tilt of the wheel.
+ */
+enum wl_pointer_axis_source {
+ /**
+ * a physical wheel rotation
+ */
+ WL_POINTER_AXIS_SOURCE_WHEEL = 0,
+ /**
+ * finger on a touch surface
+ */
+ WL_POINTER_AXIS_SOURCE_FINGER = 1,
+ /**
+ * continuous coordinate space
+ */
+ WL_POINTER_AXIS_SOURCE_CONTINUOUS = 2,
+ /**
+ * a physical wheel tilt
+ * @since 6
+ */
+ WL_POINTER_AXIS_SOURCE_WHEEL_TILT = 3,
+};
+/**
+ * @ingroup iface_wl_pointer
+ */
+#define WL_POINTER_AXIS_SOURCE_WHEEL_TILT_SINCE_VERSION 6
+#endif /* WL_POINTER_AXIS_SOURCE_ENUM */
+
+/**
+ * @ingroup iface_wl_pointer
+ * @struct wl_pointer_interface
+ */
+struct wl_pointer_interface {
+ /**
+ * set the pointer surface
+ *
+ * Set the pointer surface, i.e., the surface that contains the
+ * pointer image (cursor). This request gives the surface the role
+ * of a cursor. If the surface already has another role, it raises
+ * a protocol error.
+ *
+ * The cursor actually changes only if the pointer focus for this
+ * device is one of the requesting client's surfaces or the surface
+ * parameter is the current pointer surface. If there was a
+ * previous surface set with this request it is replaced. If
+ * surface is NULL, the pointer image is hidden.
+ *
+ * The parameters hotspot_x and hotspot_y define the position of
+ * the pointer surface relative to the pointer location. Its
+ * top-left corner is always at (x, y) - (hotspot_x, hotspot_y),
+ * where (x, y) are the coordinates of the pointer location, in
+ * surface-local coordinates.
+ *
+ * On surface.attach requests to the pointer surface, hotspot_x and
+ * hotspot_y are decremented by the x and y parameters passed to
+ * the request. Attach must be confirmed by wl_surface.commit as
+ * usual.
+ *
+ * The hotspot can also be updated by passing the currently set
+ * pointer surface to this request with new values for hotspot_x
+ * and hotspot_y.
+ *
+ * The current and pending input regions of the wl_surface are
+ * cleared, and wl_surface.set_input_region is ignored until the
+ * wl_surface is no longer used as the cursor. When the use as a
+ * cursor ends, the current and pending input regions become
+ * undefined, and the wl_surface is unmapped.
+ * @param serial serial number of the enter event
+ * @param surface pointer surface
+ * @param hotspot_x surface-local x coordinate
+ * @param hotspot_y surface-local y coordinate
+ */
+ void (*set_cursor)(struct wl_client *client,
+ struct wl_resource *resource,
+ uint32_t serial,
+ struct wl_resource *surface,
+ int32_t hotspot_x,
+ int32_t hotspot_y);
+ /**
+ * release the pointer object
+ *
+ * Using this request a client can tell the server that it is not
+ * going to use the pointer object anymore.
+ *
+ * This request destroys the pointer proxy object, so clients must
+ * not call wl_pointer_destroy() after using this request.
+ * @since 3
+ */
+ void (*release)(struct wl_client *client,
+ struct wl_resource *resource);
+};
+
+#define WL_POINTER_ENTER 0
+#define WL_POINTER_LEAVE 1
+#define WL_POINTER_MOTION 2
+#define WL_POINTER_BUTTON 3
+#define WL_POINTER_AXIS 4
+#define WL_POINTER_FRAME 5
+#define WL_POINTER_AXIS_SOURCE 6
+#define WL_POINTER_AXIS_STOP 7
+#define WL_POINTER_AXIS_DISCRETE 8
+
+/**
+ * @ingroup iface_wl_pointer
+ */
+#define WL_POINTER_ENTER_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_pointer
+ */
+#define WL_POINTER_LEAVE_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_pointer
+ */
+#define WL_POINTER_MOTION_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_pointer
+ */
+#define WL_POINTER_BUTTON_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_pointer
+ */
+#define WL_POINTER_AXIS_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_pointer
+ */
+#define WL_POINTER_FRAME_SINCE_VERSION 5
+/**
+ * @ingroup iface_wl_pointer
+ */
+#define WL_POINTER_AXIS_SOURCE_SINCE_VERSION 5
+/**
+ * @ingroup iface_wl_pointer
+ */
+#define WL_POINTER_AXIS_STOP_SINCE_VERSION 5
+/**
+ * @ingroup iface_wl_pointer
+ */
+#define WL_POINTER_AXIS_DISCRETE_SINCE_VERSION 5
+
+/**
+ * @ingroup iface_wl_pointer
+ */
+#define WL_POINTER_SET_CURSOR_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_pointer
+ */
+#define WL_POINTER_RELEASE_SINCE_VERSION 3
+
+/**
+ * @ingroup iface_wl_pointer
+ * Sends an enter event to the client owning the resource.
+ * @param resource_ The client's resource
+ * @param serial serial number of the enter event
+ * @param surface surface entered by the pointer
+ * @param surface_x surface-local x coordinate
+ * @param surface_y surface-local y coordinate
+ */
+static inline void
+wl_pointer_send_enter(struct wl_resource *resource_, uint32_t serial, struct wl_resource *surface, wl_fixed_t surface_x, wl_fixed_t surface_y)
+{
+ wl_resource_post_event(resource_, WL_POINTER_ENTER, serial, surface, surface_x, surface_y);
+}
+
+/**
+ * @ingroup iface_wl_pointer
+ * Sends an leave event to the client owning the resource.
+ * @param resource_ The client's resource
+ * @param serial serial number of the leave event
+ * @param surface surface left by the pointer
+ */
+static inline void
+wl_pointer_send_leave(struct wl_resource *resource_, uint32_t serial, struct wl_resource *surface)
+{
+ wl_resource_post_event(resource_, WL_POINTER_LEAVE, serial, surface);
+}
+
+/**
+ * @ingroup iface_wl_pointer
+ * Sends an motion event to the client owning the resource.
+ * @param resource_ The client's resource
+ * @param time timestamp with millisecond granularity
+ * @param surface_x surface-local x coordinate
+ * @param surface_y surface-local y coordinate
+ */
+static inline void
+wl_pointer_send_motion(struct wl_resource *resource_, uint32_t time, wl_fixed_t surface_x, wl_fixed_t surface_y)
+{
+ wl_resource_post_event(resource_, WL_POINTER_MOTION, time, surface_x, surface_y);
+}
+
+/**
+ * @ingroup iface_wl_pointer
+ * Sends an button event to the client owning the resource.
+ * @param resource_ The client's resource
+ * @param serial serial number of the button event
+ * @param time timestamp with millisecond granularity
+ * @param button button that produced the event
+ * @param state physical state of the button
+ */
+static inline void
+wl_pointer_send_button(struct wl_resource *resource_, uint32_t serial, uint32_t time, uint32_t button, uint32_t state)
+{
+ wl_resource_post_event(resource_, WL_POINTER_BUTTON, serial, time, button, state);
+}
+
+/**
+ * @ingroup iface_wl_pointer
+ * Sends an axis event to the client owning the resource.
+ * @param resource_ The client's resource
+ * @param time timestamp with millisecond granularity
+ * @param axis axis type
+ * @param value length of vector in surface-local coordinate space
+ */
+static inline void
+wl_pointer_send_axis(struct wl_resource *resource_, uint32_t time, uint32_t axis, wl_fixed_t value)
+{
+ wl_resource_post_event(resource_, WL_POINTER_AXIS, time, axis, value);
+}
+
+/**
+ * @ingroup iface_wl_pointer
+ * Sends an frame event to the client owning the resource.
+ * @param resource_ The client's resource
+ */
+static inline void
+wl_pointer_send_frame(struct wl_resource *resource_)
+{
+ wl_resource_post_event(resource_, WL_POINTER_FRAME);
+}
+
+/**
+ * @ingroup iface_wl_pointer
+ * Sends an axis_source event to the client owning the resource.
+ * @param resource_ The client's resource
+ * @param axis_source source of the axis event
+ */
+static inline void
+wl_pointer_send_axis_source(struct wl_resource *resource_, uint32_t axis_source)
+{
+ wl_resource_post_event(resource_, WL_POINTER_AXIS_SOURCE, axis_source);
+}
+
+/**
+ * @ingroup iface_wl_pointer
+ * Sends an axis_stop event to the client owning the resource.
+ * @param resource_ The client's resource
+ * @param time timestamp with millisecond granularity
+ * @param axis the axis stopped with this event
+ */
+static inline void
+wl_pointer_send_axis_stop(struct wl_resource *resource_, uint32_t time, uint32_t axis)
+{
+ wl_resource_post_event(resource_, WL_POINTER_AXIS_STOP, time, axis);
+}
+
+/**
+ * @ingroup iface_wl_pointer
+ * Sends an axis_discrete event to the client owning the resource.
+ * @param resource_ The client's resource
+ * @param axis axis type
+ * @param discrete number of steps
+ */
+static inline void
+wl_pointer_send_axis_discrete(struct wl_resource *resource_, uint32_t axis, int32_t discrete)
+{
+ wl_resource_post_event(resource_, WL_POINTER_AXIS_DISCRETE, axis, discrete);
+}
+
+#ifndef WL_KEYBOARD_KEYMAP_FORMAT_ENUM
+#define WL_KEYBOARD_KEYMAP_FORMAT_ENUM
+/**
+ * @ingroup iface_wl_keyboard
+ * keyboard mapping format
+ *
+ * This specifies the format of the keymap provided to the
+ * client with the wl_keyboard.keymap event.
+ */
+enum wl_keyboard_keymap_format {
+ /**
+ * no keymap; client must understand how to interpret the raw keycode
+ */
+ WL_KEYBOARD_KEYMAP_FORMAT_NO_KEYMAP = 0,
+ /**
+ * libxkbcommon compatible; to determine the xkb keycode, clients must add 8 to the key event keycode
+ */
+ WL_KEYBOARD_KEYMAP_FORMAT_XKB_V1 = 1,
+};
+#endif /* WL_KEYBOARD_KEYMAP_FORMAT_ENUM */
+
+#ifndef WL_KEYBOARD_KEY_STATE_ENUM
+#define WL_KEYBOARD_KEY_STATE_ENUM
+/**
+ * @ingroup iface_wl_keyboard
+ * physical key state
+ *
+ * Describes the physical state of a key that produced the key event.
+ */
+enum wl_keyboard_key_state {
+ /**
+ * key is not pressed
+ */
+ WL_KEYBOARD_KEY_STATE_RELEASED = 0,
+ /**
+ * key is pressed
+ */
+ WL_KEYBOARD_KEY_STATE_PRESSED = 1,
+};
+#endif /* WL_KEYBOARD_KEY_STATE_ENUM */
+
+/**
+ * @ingroup iface_wl_keyboard
+ * @struct wl_keyboard_interface
+ */
+struct wl_keyboard_interface {
+ /**
+ * release the keyboard object
+ *
+ *
+ * @since 3
+ */
+ void (*release)(struct wl_client *client,
+ struct wl_resource *resource);
+};
+
+#define WL_KEYBOARD_KEYMAP 0
+#define WL_KEYBOARD_ENTER 1
+#define WL_KEYBOARD_LEAVE 2
+#define WL_KEYBOARD_KEY 3
+#define WL_KEYBOARD_MODIFIERS 4
+#define WL_KEYBOARD_REPEAT_INFO 5
+
+/**
+ * @ingroup iface_wl_keyboard
+ */
+#define WL_KEYBOARD_KEYMAP_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_keyboard
+ */
+#define WL_KEYBOARD_ENTER_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_keyboard
+ */
+#define WL_KEYBOARD_LEAVE_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_keyboard
+ */
+#define WL_KEYBOARD_KEY_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_keyboard
+ */
+#define WL_KEYBOARD_MODIFIERS_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_keyboard
+ */
+#define WL_KEYBOARD_REPEAT_INFO_SINCE_VERSION 4
+
+/**
+ * @ingroup iface_wl_keyboard
+ */
+#define WL_KEYBOARD_RELEASE_SINCE_VERSION 3
+
+/**
+ * @ingroup iface_wl_keyboard
+ * Sends an keymap event to the client owning the resource.
+ * @param resource_ The client's resource
+ * @param format keymap format
+ * @param fd keymap file descriptor
+ * @param size keymap size, in bytes
+ */
+static inline void
+wl_keyboard_send_keymap(struct wl_resource *resource_, uint32_t format, int32_t fd, uint32_t size)
+{
+ wl_resource_post_event(resource_, WL_KEYBOARD_KEYMAP, format, fd, size);
+}
+
+/**
+ * @ingroup iface_wl_keyboard
+ * Sends an enter event to the client owning the resource.
+ * @param resource_ The client's resource
+ * @param serial serial number of the enter event
+ * @param surface surface gaining keyboard focus
+ * @param keys the currently pressed keys
+ */
+static inline void
+wl_keyboard_send_enter(struct wl_resource *resource_, uint32_t serial, struct wl_resource *surface, struct wl_array *keys)
+{
+ wl_resource_post_event(resource_, WL_KEYBOARD_ENTER, serial, surface, keys);
+}
+
+/**
+ * @ingroup iface_wl_keyboard
+ * Sends an leave event to the client owning the resource.
+ * @param resource_ The client's resource
+ * @param serial serial number of the leave event
+ * @param surface surface that lost keyboard focus
+ */
+static inline void
+wl_keyboard_send_leave(struct wl_resource *resource_, uint32_t serial, struct wl_resource *surface)
+{
+ wl_resource_post_event(resource_, WL_KEYBOARD_LEAVE, serial, surface);
+}
+
+/**
+ * @ingroup iface_wl_keyboard
+ * Sends an key event to the client owning the resource.
+ * @param resource_ The client's resource
+ * @param serial serial number of the key event
+ * @param time timestamp with millisecond granularity
+ * @param key key that produced the event
+ * @param state physical state of the key
+ */
+static inline void
+wl_keyboard_send_key(struct wl_resource *resource_, uint32_t serial, uint32_t time, uint32_t key, uint32_t state)
+{
+ wl_resource_post_event(resource_, WL_KEYBOARD_KEY, serial, time, key, state);
+}
+
+/**
+ * @ingroup iface_wl_keyboard
+ * Sends an modifiers event to the client owning the resource.
+ * @param resource_ The client's resource
+ * @param serial serial number of the modifiers event
+ * @param mods_depressed depressed modifiers
+ * @param mods_latched latched modifiers
+ * @param mods_locked locked modifiers
+ * @param group keyboard layout
+ */
+static inline void
+wl_keyboard_send_modifiers(struct wl_resource *resource_, uint32_t serial, uint32_t mods_depressed, uint32_t mods_latched, uint32_t mods_locked, uint32_t group)
+{
+ wl_resource_post_event(resource_, WL_KEYBOARD_MODIFIERS, serial, mods_depressed, mods_latched, mods_locked, group);
+}
+
+/**
+ * @ingroup iface_wl_keyboard
+ * Sends an repeat_info event to the client owning the resource.
+ * @param resource_ The client's resource
+ * @param rate the rate of repeating keys in characters per second
+ * @param delay delay in milliseconds since key down until repeating starts
+ */
+static inline void
+wl_keyboard_send_repeat_info(struct wl_resource *resource_, int32_t rate, int32_t delay)
+{
+ wl_resource_post_event(resource_, WL_KEYBOARD_REPEAT_INFO, rate, delay);
+}
+
+/**
+ * @ingroup iface_wl_touch
+ * @struct wl_touch_interface
+ */
+struct wl_touch_interface {
+ /**
+ * release the touch object
+ *
+ *
+ * @since 3
+ */
+ void (*release)(struct wl_client *client,
+ struct wl_resource *resource);
+};
+
+#define WL_TOUCH_DOWN 0
+#define WL_TOUCH_UP 1
+#define WL_TOUCH_MOTION 2
+#define WL_TOUCH_FRAME 3
+#define WL_TOUCH_CANCEL 4
+#define WL_TOUCH_SHAPE 5
+#define WL_TOUCH_ORIENTATION 6
+
+/**
+ * @ingroup iface_wl_touch
+ */
+#define WL_TOUCH_DOWN_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_touch
+ */
+#define WL_TOUCH_UP_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_touch
+ */
+#define WL_TOUCH_MOTION_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_touch
+ */
+#define WL_TOUCH_FRAME_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_touch
+ */
+#define WL_TOUCH_CANCEL_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_touch
+ */
+#define WL_TOUCH_SHAPE_SINCE_VERSION 6
+/**
+ * @ingroup iface_wl_touch
+ */
+#define WL_TOUCH_ORIENTATION_SINCE_VERSION 6
+
+/**
+ * @ingroup iface_wl_touch
+ */
+#define WL_TOUCH_RELEASE_SINCE_VERSION 3
+
+/**
+ * @ingroup iface_wl_touch
+ * Sends an down event to the client owning the resource.
+ * @param resource_ The client's resource
+ * @param serial serial number of the touch down event
+ * @param time timestamp with millisecond granularity
+ * @param surface surface touched
+ * @param id the unique ID of this touch point
+ * @param x surface-local x coordinate
+ * @param y surface-local y coordinate
+ */
+static inline void
+wl_touch_send_down(struct wl_resource *resource_, uint32_t serial, uint32_t time, struct wl_resource *surface, int32_t id, wl_fixed_t x, wl_fixed_t y)
+{
+ wl_resource_post_event(resource_, WL_TOUCH_DOWN, serial, time, surface, id, x, y);
+}
+
+/**
+ * @ingroup iface_wl_touch
+ * Sends an up event to the client owning the resource.
+ * @param resource_ The client's resource
+ * @param serial serial number of the touch up event
+ * @param time timestamp with millisecond granularity
+ * @param id the unique ID of this touch point
+ */
+static inline void
+wl_touch_send_up(struct wl_resource *resource_, uint32_t serial, uint32_t time, int32_t id)
+{
+ wl_resource_post_event(resource_, WL_TOUCH_UP, serial, time, id);
+}
+
+/**
+ * @ingroup iface_wl_touch
+ * Sends an motion event to the client owning the resource.
+ * @param resource_ The client's resource
+ * @param time timestamp with millisecond granularity
+ * @param id the unique ID of this touch point
+ * @param x surface-local x coordinate
+ * @param y surface-local y coordinate
+ */
+static inline void
+wl_touch_send_motion(struct wl_resource *resource_, uint32_t time, int32_t id, wl_fixed_t x, wl_fixed_t y)
+{
+ wl_resource_post_event(resource_, WL_TOUCH_MOTION, time, id, x, y);
+}
+
+/**
+ * @ingroup iface_wl_touch
+ * Sends an frame event to the client owning the resource.
+ * @param resource_ The client's resource
+ */
+static inline void
+wl_touch_send_frame(struct wl_resource *resource_)
+{
+ wl_resource_post_event(resource_, WL_TOUCH_FRAME);
+}
+
+/**
+ * @ingroup iface_wl_touch
+ * Sends an cancel event to the client owning the resource.
+ * @param resource_ The client's resource
+ */
+static inline void
+wl_touch_send_cancel(struct wl_resource *resource_)
+{
+ wl_resource_post_event(resource_, WL_TOUCH_CANCEL);
+}
+
+/**
+ * @ingroup iface_wl_touch
+ * Sends an shape event to the client owning the resource.
+ * @param resource_ The client's resource
+ * @param id the unique ID of this touch point
+ * @param major length of the major axis in surface-local coordinates
+ * @param minor length of the minor axis in surface-local coordinates
+ */
+static inline void
+wl_touch_send_shape(struct wl_resource *resource_, int32_t id, wl_fixed_t major, wl_fixed_t minor)
+{
+ wl_resource_post_event(resource_, WL_TOUCH_SHAPE, id, major, minor);
+}
+
+/**
+ * @ingroup iface_wl_touch
+ * Sends an orientation event to the client owning the resource.
+ * @param resource_ The client's resource
+ * @param id the unique ID of this touch point
+ * @param orientation angle between major axis and positive surface y-axis in degrees
+ */
+static inline void
+wl_touch_send_orientation(struct wl_resource *resource_, int32_t id, wl_fixed_t orientation)
+{
+ wl_resource_post_event(resource_, WL_TOUCH_ORIENTATION, id, orientation);
+}
+
+#ifndef WL_OUTPUT_SUBPIXEL_ENUM
+#define WL_OUTPUT_SUBPIXEL_ENUM
+/**
+ * @ingroup iface_wl_output
+ * subpixel geometry information
+ *
+ * This enumeration describes how the physical
+ * pixels on an output are laid out.
+ */
+enum wl_output_subpixel {
+ /**
+ * unknown geometry
+ */
+ WL_OUTPUT_SUBPIXEL_UNKNOWN = 0,
+ /**
+ * no geometry
+ */
+ WL_OUTPUT_SUBPIXEL_NONE = 1,
+ /**
+ * horizontal RGB
+ */
+ WL_OUTPUT_SUBPIXEL_HORIZONTAL_RGB = 2,
+ /**
+ * horizontal BGR
+ */
+ WL_OUTPUT_SUBPIXEL_HORIZONTAL_BGR = 3,
+ /**
+ * vertical RGB
+ */
+ WL_OUTPUT_SUBPIXEL_VERTICAL_RGB = 4,
+ /**
+ * vertical BGR
+ */
+ WL_OUTPUT_SUBPIXEL_VERTICAL_BGR = 5,
+};
+#endif /* WL_OUTPUT_SUBPIXEL_ENUM */
+
+#ifndef WL_OUTPUT_TRANSFORM_ENUM
+#define WL_OUTPUT_TRANSFORM_ENUM
+/**
+ * @ingroup iface_wl_output
+ * transform from framebuffer to output
+ *
+ * This describes the transform that a compositor will apply to a
+ * surface to compensate for the rotation or mirroring of an
+ * output device.
+ *
+ * The flipped values correspond to an initial flip around a
+ * vertical axis followed by rotation.
+ *
+ * The purpose is mainly to allow clients to render accordingly and
+ * tell the compositor, so that for fullscreen surfaces, the
+ * compositor will still be able to scan out directly from client
+ * surfaces.
+ */
+enum wl_output_transform {
+ /**
+ * no transform
+ */
+ WL_OUTPUT_TRANSFORM_NORMAL = 0,
+ /**
+ * 90 degrees counter-clockwise
+ */
+ WL_OUTPUT_TRANSFORM_90 = 1,
+ /**
+ * 180 degrees counter-clockwise
+ */
+ WL_OUTPUT_TRANSFORM_180 = 2,
+ /**
+ * 270 degrees counter-clockwise
+ */
+ WL_OUTPUT_TRANSFORM_270 = 3,
+ /**
+ * 180 degree flip around a vertical axis
+ */
+ WL_OUTPUT_TRANSFORM_FLIPPED = 4,
+ /**
+ * flip and rotate 90 degrees counter-clockwise
+ */
+ WL_OUTPUT_TRANSFORM_FLIPPED_90 = 5,
+ /**
+ * flip and rotate 180 degrees counter-clockwise
+ */
+ WL_OUTPUT_TRANSFORM_FLIPPED_180 = 6,
+ /**
+ * flip and rotate 270 degrees counter-clockwise
+ */
+ WL_OUTPUT_TRANSFORM_FLIPPED_270 = 7,
+};
+#endif /* WL_OUTPUT_TRANSFORM_ENUM */
+
+#ifndef WL_OUTPUT_MODE_ENUM
+#define WL_OUTPUT_MODE_ENUM
+/**
+ * @ingroup iface_wl_output
+ * mode information
+ *
+ * These flags describe properties of an output mode.
+ * They are used in the flags bitfield of the mode event.
+ */
+enum wl_output_mode {
+ /**
+ * indicates this is the current mode
+ */
+ WL_OUTPUT_MODE_CURRENT = 0x1,
+ /**
+ * indicates this is the preferred mode
+ */
+ WL_OUTPUT_MODE_PREFERRED = 0x2,
+};
+#endif /* WL_OUTPUT_MODE_ENUM */
+
+/**
+ * @ingroup iface_wl_output
+ * @struct wl_output_interface
+ */
+struct wl_output_interface {
+ /**
+ * release the output object
+ *
+ * Using this request a client can tell the server that it is not
+ * going to use the output object anymore.
+ * @since 3
+ */
+ void (*release)(struct wl_client *client,
+ struct wl_resource *resource);
+};
+
+#define WL_OUTPUT_GEOMETRY 0
+#define WL_OUTPUT_MODE 1
+#define WL_OUTPUT_DONE 2
+#define WL_OUTPUT_SCALE 3
+
+/**
+ * @ingroup iface_wl_output
+ */
+#define WL_OUTPUT_GEOMETRY_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_output
+ */
+#define WL_OUTPUT_MODE_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_output
+ */
+#define WL_OUTPUT_DONE_SINCE_VERSION 2
+/**
+ * @ingroup iface_wl_output
+ */
+#define WL_OUTPUT_SCALE_SINCE_VERSION 2
+
+/**
+ * @ingroup iface_wl_output
+ */
+#define WL_OUTPUT_RELEASE_SINCE_VERSION 3
+
+/**
+ * @ingroup iface_wl_output
+ * Sends an geometry event to the client owning the resource.
+ * @param resource_ The client's resource
+ * @param x x position within the global compositor space
+ * @param y y position within the global compositor space
+ * @param physical_width width in millimeters of the output
+ * @param physical_height height in millimeters of the output
+ * @param subpixel subpixel orientation of the output
+ * @param make textual description of the manufacturer
+ * @param model textual description of the model
+ * @param transform transform that maps framebuffer to output
+ */
+static inline void
+wl_output_send_geometry(struct wl_resource *resource_, int32_t x, int32_t y, int32_t physical_width, int32_t physical_height, int32_t subpixel, const char *make, const char *model, int32_t transform)
+{
+ wl_resource_post_event(resource_, WL_OUTPUT_GEOMETRY, x, y, physical_width, physical_height, subpixel, make, model, transform);
+}
+
+/**
+ * @ingroup iface_wl_output
+ * Sends an mode event to the client owning the resource.
+ * @param resource_ The client's resource
+ * @param flags bitfield of mode flags
+ * @param width width of the mode in hardware units
+ * @param height height of the mode in hardware units
+ * @param refresh vertical refresh rate in mHz
+ */
+static inline void
+wl_output_send_mode(struct wl_resource *resource_, uint32_t flags, int32_t width, int32_t height, int32_t refresh)
+{
+ wl_resource_post_event(resource_, WL_OUTPUT_MODE, flags, width, height, refresh);
+}
+
+/**
+ * @ingroup iface_wl_output
+ * Sends an done event to the client owning the resource.
+ * @param resource_ The client's resource
+ */
+static inline void
+wl_output_send_done(struct wl_resource *resource_)
+{
+ wl_resource_post_event(resource_, WL_OUTPUT_DONE);
+}
+
+/**
+ * @ingroup iface_wl_output
+ * Sends an scale event to the client owning the resource.
+ * @param resource_ The client's resource
+ * @param factor scaling factor of output
+ */
+static inline void
+wl_output_send_scale(struct wl_resource *resource_, int32_t factor)
+{
+ wl_resource_post_event(resource_, WL_OUTPUT_SCALE, factor);
+}
+
+/**
+ * @ingroup iface_wl_region
+ * @struct wl_region_interface
+ */
+struct wl_region_interface {
+ /**
+ * destroy region
+ *
+ * Destroy the region. This will invalidate the object ID.
+ */
+ void (*destroy)(struct wl_client *client,
+ struct wl_resource *resource);
+ /**
+ * add rectangle to region
+ *
+ * Add the specified rectangle to the region.
+ * @param x region-local x coordinate
+ * @param y region-local y coordinate
+ * @param width rectangle width
+ * @param height rectangle height
+ */
+ void (*add)(struct wl_client *client,
+ struct wl_resource *resource,
+ int32_t x,
+ int32_t y,
+ int32_t width,
+ int32_t height);
+ /**
+ * subtract rectangle from region
+ *
+ * Subtract the specified rectangle from the region.
+ * @param x region-local x coordinate
+ * @param y region-local y coordinate
+ * @param width rectangle width
+ * @param height rectangle height
+ */
+ void (*subtract)(struct wl_client *client,
+ struct wl_resource *resource,
+ int32_t x,
+ int32_t y,
+ int32_t width,
+ int32_t height);
+};
+
+
+/**
+ * @ingroup iface_wl_region
+ */
+#define WL_REGION_DESTROY_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_region
+ */
+#define WL_REGION_ADD_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_region
+ */
+#define WL_REGION_SUBTRACT_SINCE_VERSION 1
+
+#ifndef WL_SUBCOMPOSITOR_ERROR_ENUM
+#define WL_SUBCOMPOSITOR_ERROR_ENUM
+enum wl_subcompositor_error {
+ /**
+ * the to-be sub-surface is invalid
+ */
+ WL_SUBCOMPOSITOR_ERROR_BAD_SURFACE = 0,
+};
+#endif /* WL_SUBCOMPOSITOR_ERROR_ENUM */
+
+/**
+ * @ingroup iface_wl_subcompositor
+ * @struct wl_subcompositor_interface
+ */
+struct wl_subcompositor_interface {
+ /**
+ * unbind from the subcompositor interface
+ *
+ * Informs the server that the client will not be using this
+ * protocol object anymore. This does not affect any other objects,
+ * wl_subsurface objects included.
+ */
+ void (*destroy)(struct wl_client *client,
+ struct wl_resource *resource);
+ /**
+ * give a surface the role sub-surface
+ *
+ * Create a sub-surface interface for the given surface, and
+ * associate it with the given parent surface. This turns a plain
+ * wl_surface into a sub-surface.
+ *
+ * The to-be sub-surface must not already have another role, and it
+ * must not have an existing wl_subsurface object. Otherwise a
+ * protocol error is raised.
+ * @param id the new sub-surface object ID
+ * @param surface the surface to be turned into a sub-surface
+ * @param parent the parent surface
+ */
+ void (*get_subsurface)(struct wl_client *client,
+ struct wl_resource *resource,
+ uint32_t id,
+ struct wl_resource *surface,
+ struct wl_resource *parent);
+};
+
+
+/**
+ * @ingroup iface_wl_subcompositor
+ */
+#define WL_SUBCOMPOSITOR_DESTROY_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_subcompositor
+ */
+#define WL_SUBCOMPOSITOR_GET_SUBSURFACE_SINCE_VERSION 1
+
+#ifndef WL_SUBSURFACE_ERROR_ENUM
+#define WL_SUBSURFACE_ERROR_ENUM
+enum wl_subsurface_error {
+ /**
+ * wl_surface is not a sibling or the parent
+ */
+ WL_SUBSURFACE_ERROR_BAD_SURFACE = 0,
+};
+#endif /* WL_SUBSURFACE_ERROR_ENUM */
+
+/**
+ * @ingroup iface_wl_subsurface
+ * @struct wl_subsurface_interface
+ */
+struct wl_subsurface_interface {
+ /**
+ * remove sub-surface interface
+ *
+ * The sub-surface interface is removed from the wl_surface
+ * object that was turned into a sub-surface with a
+ * wl_subcompositor.get_subsurface request. The wl_surface's
+ * association to the parent is deleted, and the wl_surface loses
+ * its role as a sub-surface. The wl_surface is unmapped.
+ */
+ void (*destroy)(struct wl_client *client,
+ struct wl_resource *resource);
+ /**
+ * reposition the sub-surface
+ *
+ * This schedules a sub-surface position change. The sub-surface
+ * will be moved so that its origin (top left corner pixel) will be
+ * at the location x, y of the parent surface coordinate system.
+ * The coordinates are not restricted to the parent surface area.
+ * Negative values are allowed.
+ *
+ * The scheduled coordinates will take effect whenever the state of
+ * the parent surface is applied. When this happens depends on
+ * whether the parent surface is in synchronized mode or not. See
+ * wl_subsurface.set_sync and wl_subsurface.set_desync for details.
+ *
+ * If more than one set_position request is invoked by the client
+ * before the commit of the parent surface, the position of a new
+ * request always replaces the scheduled position from any previous
+ * request.
+ *
+ * The initial position is 0, 0.
+ * @param x x coordinate in the parent surface
+ * @param y y coordinate in the parent surface
+ */
+ void (*set_position)(struct wl_client *client,
+ struct wl_resource *resource,
+ int32_t x,
+ int32_t y);
+ /**
+ * restack the sub-surface
+ *
+ * This sub-surface is taken from the stack, and put back just
+ * above the reference surface, changing the z-order of the
+ * sub-surfaces. The reference surface must be one of the sibling
+ * surfaces, or the parent surface. Using any other surface,
+ * including this sub-surface, will cause a protocol error.
+ *
+ * The z-order is double-buffered. Requests are handled in order
+ * and applied immediately to a pending state. The final pending
+ * state is copied to the active state the next time the state of
+ * the parent surface is applied. When this happens depends on
+ * whether the parent surface is in synchronized mode or not. See
+ * wl_subsurface.set_sync and wl_subsurface.set_desync for details.
+ *
+ * A new sub-surface is initially added as the top-most in the
+ * stack of its siblings and parent.
+ * @param sibling the reference surface
+ */
+ void (*place_above)(struct wl_client *client,
+ struct wl_resource *resource,
+ struct wl_resource *sibling);
+ /**
+ * restack the sub-surface
+ *
+ * The sub-surface is placed just below the reference surface.
+ * See wl_subsurface.place_above.
+ * @param sibling the reference surface
+ */
+ void (*place_below)(struct wl_client *client,
+ struct wl_resource *resource,
+ struct wl_resource *sibling);
+ /**
+ * set sub-surface to synchronized mode
+ *
+ * Change the commit behaviour of the sub-surface to synchronized
+ * mode, also described as the parent dependent mode.
+ *
+ * In synchronized mode, wl_surface.commit on a sub-surface will
+ * accumulate the committed state in a cache, but the state will
+ * not be applied and hence will not change the compositor output.
+ * The cached state is applied to the sub-surface immediately after
+ * the parent surface's state is applied. This ensures atomic
+ * updates of the parent and all its synchronized sub-surfaces.
+ * Applying the cached state will invalidate the cache, so further
+ * parent surface commits do not (re-)apply old state.
+ *
+ * See wl_subsurface for the recursive effect of this mode.
+ */
+ void (*set_sync)(struct wl_client *client,
+ struct wl_resource *resource);
+ /**
+ * set sub-surface to desynchronized mode
+ *
+ * Change the commit behaviour of the sub-surface to
+ * desynchronized mode, also described as independent or freely
+ * running mode.
+ *
+ * In desynchronized mode, wl_surface.commit on a sub-surface will
+ * apply the pending state directly, without caching, as happens
+ * normally with a wl_surface. Calling wl_surface.commit on the
+ * parent surface has no effect on the sub-surface's wl_surface
+ * state. This mode allows a sub-surface to be updated on its own.
+ *
+ * If cached state exists when wl_surface.commit is called in
+ * desynchronized mode, the pending state is added to the cached
+ * state, and applied as a whole. This invalidates the cache.
+ *
+ * Note: even if a sub-surface is set to desynchronized, a parent
+ * sub-surface may override it to behave as synchronized. For
+ * details, see wl_subsurface.
+ *
+ * If a surface's parent surface behaves as desynchronized, then
+ * the cached state is applied on set_desync.
+ */
+ void (*set_desync)(struct wl_client *client,
+ struct wl_resource *resource);
+};
+
+
+/**
+ * @ingroup iface_wl_subsurface
+ */
+#define WL_SUBSURFACE_DESTROY_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_subsurface
+ */
+#define WL_SUBSURFACE_SET_POSITION_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_subsurface
+ */
+#define WL_SUBSURFACE_PLACE_ABOVE_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_subsurface
+ */
+#define WL_SUBSURFACE_PLACE_BELOW_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_subsurface
+ */
+#define WL_SUBSURFACE_SET_SYNC_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_subsurface
+ */
+#define WL_SUBSURFACE_SET_DESYNC_SINCE_VERSION 1
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/chromium/third_party/wayland/include/protocol/wayland-server-protocol.h b/chromium/third_party/wayland/include/protocol/wayland-server-protocol.h
new file mode 100644
index 00000000000..9c6b1e08e96
--- /dev/null
+++ b/chromium/third_party/wayland/include/protocol/wayland-server-protocol.h
@@ -0,0 +1,4335 @@
+/* Generated by wayland-scanner 1.13.0 */
+
+#ifndef WAYLAND_SERVER_PROTOCOL_H
+#define WAYLAND_SERVER_PROTOCOL_H
+
+#include <stdint.h>
+#include <stddef.h>
+#include "wayland-server.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+struct wl_client;
+struct wl_resource;
+
+/**
+ * @page page_wayland The wayland protocol
+ * @section page_ifaces_wayland Interfaces
+ * - @subpage page_iface_wl_display - core global object
+ * - @subpage page_iface_wl_registry - global registry object
+ * - @subpage page_iface_wl_callback - callback object
+ * - @subpage page_iface_wl_compositor - the compositor singleton
+ * - @subpage page_iface_wl_shm_pool - a shared memory pool
+ * - @subpage page_iface_wl_shm - shared memory support
+ * - @subpage page_iface_wl_buffer - content for a wl_surface
+ * - @subpage page_iface_wl_data_offer - offer to transfer data
+ * - @subpage page_iface_wl_data_source - offer to transfer data
+ * - @subpage page_iface_wl_data_device - data transfer device
+ * - @subpage page_iface_wl_data_device_manager - data transfer interface
+ * - @subpage page_iface_wl_shell - create desktop-style surfaces
+ * - @subpage page_iface_wl_shell_surface - desktop-style metadata interface
+ * - @subpage page_iface_wl_surface - an onscreen surface
+ * - @subpage page_iface_wl_seat - group of input devices
+ * - @subpage page_iface_wl_pointer - pointer input device
+ * - @subpage page_iface_wl_keyboard - keyboard input device
+ * - @subpage page_iface_wl_touch - touchscreen input device
+ * - @subpage page_iface_wl_output - compositor output region
+ * - @subpage page_iface_wl_region - region interface
+ * - @subpage page_iface_wl_subcompositor - sub-surface compositing
+ * - @subpage page_iface_wl_subsurface - sub-surface interface to a wl_surface
+ * @section page_copyright_wayland Copyright
+ * <pre>
+ *
+ * Copyright © 2008-2011 Kristian Høgsberg
+ * Copyright © 2010-2011 Intel Corporation
+ * Copyright © 2012-2013 Collabora, Ltd.
+ *
+ * Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation files
+ * (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial
+ * portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ * </pre>
+ */
+struct wl_buffer;
+struct wl_callback;
+struct wl_compositor;
+struct wl_data_device;
+struct wl_data_device_manager;
+struct wl_data_offer;
+struct wl_data_source;
+struct wl_display;
+struct wl_keyboard;
+struct wl_output;
+struct wl_pointer;
+struct wl_region;
+struct wl_registry;
+struct wl_seat;
+struct wl_shell;
+struct wl_shell_surface;
+struct wl_shm;
+struct wl_shm_pool;
+struct wl_subcompositor;
+struct wl_subsurface;
+struct wl_surface;
+struct wl_touch;
+
+/**
+ * @page page_iface_wl_display wl_display
+ * @section page_iface_wl_display_desc Description
+ *
+ * The core global object. This is a special singleton object. It
+ * is used for internal Wayland protocol features.
+ * @section page_iface_wl_display_api API
+ * See @ref iface_wl_display.
+ */
+/**
+ * @defgroup iface_wl_display The wl_display interface
+ *
+ * The core global object. This is a special singleton object. It
+ * is used for internal Wayland protocol features.
+ */
+extern const struct wl_interface wl_display_interface;
+/**
+ * @page page_iface_wl_registry wl_registry
+ * @section page_iface_wl_registry_desc Description
+ *
+ * The singleton global registry object. The server has a number of
+ * global objects that are available to all clients. These objects
+ * typically represent an actual object in the server (for example,
+ * an input device) or they are singleton objects that provide
+ * extension functionality.
+ *
+ * When a client creates a registry object, the registry object
+ * will emit a global event for each global currently in the
+ * registry. Globals come and go as a result of device or
+ * monitor hotplugs, reconfiguration or other events, and the
+ * registry will send out global and global_remove events to
+ * keep the client up to date with the changes. To mark the end
+ * of the initial burst of events, the client can use the
+ * wl_display.sync request immediately after calling
+ * wl_display.get_registry.
+ *
+ * A client can bind to a global object by using the bind
+ * request. This creates a client-side handle that lets the object
+ * emit events to the client and lets the client invoke requests on
+ * the object.
+ * @section page_iface_wl_registry_api API
+ * See @ref iface_wl_registry.
+ */
+/**
+ * @defgroup iface_wl_registry The wl_registry interface
+ *
+ * The singleton global registry object. The server has a number of
+ * global objects that are available to all clients. These objects
+ * typically represent an actual object in the server (for example,
+ * an input device) or they are singleton objects that provide
+ * extension functionality.
+ *
+ * When a client creates a registry object, the registry object
+ * will emit a global event for each global currently in the
+ * registry. Globals come and go as a result of device or
+ * monitor hotplugs, reconfiguration or other events, and the
+ * registry will send out global and global_remove events to
+ * keep the client up to date with the changes. To mark the end
+ * of the initial burst of events, the client can use the
+ * wl_display.sync request immediately after calling
+ * wl_display.get_registry.
+ *
+ * A client can bind to a global object by using the bind
+ * request. This creates a client-side handle that lets the object
+ * emit events to the client and lets the client invoke requests on
+ * the object.
+ */
+extern const struct wl_interface wl_registry_interface;
+/**
+ * @page page_iface_wl_callback wl_callback
+ * @section page_iface_wl_callback_desc Description
+ *
+ * Clients can handle the 'done' event to get notified when
+ * the related request is done.
+ * @section page_iface_wl_callback_api API
+ * See @ref iface_wl_callback.
+ */
+/**
+ * @defgroup iface_wl_callback The wl_callback interface
+ *
+ * Clients can handle the 'done' event to get notified when
+ * the related request is done.
+ */
+extern const struct wl_interface wl_callback_interface;
+/**
+ * @page page_iface_wl_compositor wl_compositor
+ * @section page_iface_wl_compositor_desc Description
+ *
+ * A compositor. This object is a singleton global. The
+ * compositor is in charge of combining the contents of multiple
+ * surfaces into one displayable output.
+ * @section page_iface_wl_compositor_api API
+ * See @ref iface_wl_compositor.
+ */
+/**
+ * @defgroup iface_wl_compositor The wl_compositor interface
+ *
+ * A compositor. This object is a singleton global. The
+ * compositor is in charge of combining the contents of multiple
+ * surfaces into one displayable output.
+ */
+extern const struct wl_interface wl_compositor_interface;
+/**
+ * @page page_iface_wl_shm_pool wl_shm_pool
+ * @section page_iface_wl_shm_pool_desc Description
+ *
+ * The wl_shm_pool object encapsulates a piece of memory shared
+ * between the compositor and client. Through the wl_shm_pool
+ * object, the client can allocate shared memory wl_buffer objects.
+ * All objects created through the same pool share the same
+ * underlying mapped memory. Reusing the mapped memory avoids the
+ * setup/teardown overhead and is useful when interactively resizing
+ * a surface or for many small buffers.
+ * @section page_iface_wl_shm_pool_api API
+ * See @ref iface_wl_shm_pool.
+ */
+/**
+ * @defgroup iface_wl_shm_pool The wl_shm_pool interface
+ *
+ * The wl_shm_pool object encapsulates a piece of memory shared
+ * between the compositor and client. Through the wl_shm_pool
+ * object, the client can allocate shared memory wl_buffer objects.
+ * All objects created through the same pool share the same
+ * underlying mapped memory. Reusing the mapped memory avoids the
+ * setup/teardown overhead and is useful when interactively resizing
+ * a surface or for many small buffers.
+ */
+extern const struct wl_interface wl_shm_pool_interface;
+/**
+ * @page page_iface_wl_shm wl_shm
+ * @section page_iface_wl_shm_desc Description
+ *
+ * A singleton global object that provides support for shared
+ * memory.
+ *
+ * Clients can create wl_shm_pool objects using the create_pool
+ * request.
+ *
+ * At connection setup time, the wl_shm object emits one or more
+ * format events to inform clients about the valid pixel formats
+ * that can be used for buffers.
+ * @section page_iface_wl_shm_api API
+ * See @ref iface_wl_shm.
+ */
+/**
+ * @defgroup iface_wl_shm The wl_shm interface
+ *
+ * A singleton global object that provides support for shared
+ * memory.
+ *
+ * Clients can create wl_shm_pool objects using the create_pool
+ * request.
+ *
+ * At connection setup time, the wl_shm object emits one or more
+ * format events to inform clients about the valid pixel formats
+ * that can be used for buffers.
+ */
+extern const struct wl_interface wl_shm_interface;
+/**
+ * @page page_iface_wl_buffer wl_buffer
+ * @section page_iface_wl_buffer_desc Description
+ *
+ * A buffer provides the content for a wl_surface. Buffers are
+ * created through factory interfaces such as wl_drm, wl_shm or
+ * similar. It has a width and a height and can be attached to a
+ * wl_surface, but the mechanism by which a client provides and
+ * updates the contents is defined by the buffer factory interface.
+ * @section page_iface_wl_buffer_api API
+ * See @ref iface_wl_buffer.
+ */
+/**
+ * @defgroup iface_wl_buffer The wl_buffer interface
+ *
+ * A buffer provides the content for a wl_surface. Buffers are
+ * created through factory interfaces such as wl_drm, wl_shm or
+ * similar. It has a width and a height and can be attached to a
+ * wl_surface, but the mechanism by which a client provides and
+ * updates the contents is defined by the buffer factory interface.
+ */
+extern const struct wl_interface wl_buffer_interface;
+/**
+ * @page page_iface_wl_data_offer wl_data_offer
+ * @section page_iface_wl_data_offer_desc Description
+ *
+ * A wl_data_offer represents a piece of data offered for transfer
+ * by another client (the source client). It is used by the
+ * copy-and-paste and drag-and-drop mechanisms. The offer
+ * describes the different mime types that the data can be
+ * converted to and provides the mechanism for transferring the
+ * data directly from the source client.
+ * @section page_iface_wl_data_offer_api API
+ * See @ref iface_wl_data_offer.
+ */
+/**
+ * @defgroup iface_wl_data_offer The wl_data_offer interface
+ *
+ * A wl_data_offer represents a piece of data offered for transfer
+ * by another client (the source client). It is used by the
+ * copy-and-paste and drag-and-drop mechanisms. The offer
+ * describes the different mime types that the data can be
+ * converted to and provides the mechanism for transferring the
+ * data directly from the source client.
+ */
+extern const struct wl_interface wl_data_offer_interface;
+/**
+ * @page page_iface_wl_data_source wl_data_source
+ * @section page_iface_wl_data_source_desc Description
+ *
+ * The wl_data_source object is the source side of a wl_data_offer.
+ * It is created by the source client in a data transfer and
+ * provides a way to describe the offered data and a way to respond
+ * to requests to transfer the data.
+ * @section page_iface_wl_data_source_api API
+ * See @ref iface_wl_data_source.
+ */
+/**
+ * @defgroup iface_wl_data_source The wl_data_source interface
+ *
+ * The wl_data_source object is the source side of a wl_data_offer.
+ * It is created by the source client in a data transfer and
+ * provides a way to describe the offered data and a way to respond
+ * to requests to transfer the data.
+ */
+extern const struct wl_interface wl_data_source_interface;
+/**
+ * @page page_iface_wl_data_device wl_data_device
+ * @section page_iface_wl_data_device_desc Description
+ *
+ * There is one wl_data_device per seat which can be obtained
+ * from the global wl_data_device_manager singleton.
+ *
+ * A wl_data_device provides access to inter-client data transfer
+ * mechanisms such as copy-and-paste and drag-and-drop.
+ * @section page_iface_wl_data_device_api API
+ * See @ref iface_wl_data_device.
+ */
+/**
+ * @defgroup iface_wl_data_device The wl_data_device interface
+ *
+ * There is one wl_data_device per seat which can be obtained
+ * from the global wl_data_device_manager singleton.
+ *
+ * A wl_data_device provides access to inter-client data transfer
+ * mechanisms such as copy-and-paste and drag-and-drop.
+ */
+extern const struct wl_interface wl_data_device_interface;
+/**
+ * @page page_iface_wl_data_device_manager wl_data_device_manager
+ * @section page_iface_wl_data_device_manager_desc Description
+ *
+ * The wl_data_device_manager is a singleton global object that
+ * provides access to inter-client data transfer mechanisms such as
+ * copy-and-paste and drag-and-drop. These mechanisms are tied to
+ * a wl_seat and this interface lets a client get a wl_data_device
+ * corresponding to a wl_seat.
+ *
+ * Depending on the version bound, the objects created from the bound
+ * wl_data_device_manager object will have different requirements for
+ * functioning properly. See wl_data_source.set_actions,
+ * wl_data_offer.accept and wl_data_offer.finish for details.
+ * @section page_iface_wl_data_device_manager_api API
+ * See @ref iface_wl_data_device_manager.
+ */
+/**
+ * @defgroup iface_wl_data_device_manager The wl_data_device_manager interface
+ *
+ * The wl_data_device_manager is a singleton global object that
+ * provides access to inter-client data transfer mechanisms such as
+ * copy-and-paste and drag-and-drop. These mechanisms are tied to
+ * a wl_seat and this interface lets a client get a wl_data_device
+ * corresponding to a wl_seat.
+ *
+ * Depending on the version bound, the objects created from the bound
+ * wl_data_device_manager object will have different requirements for
+ * functioning properly. See wl_data_source.set_actions,
+ * wl_data_offer.accept and wl_data_offer.finish for details.
+ */
+extern const struct wl_interface wl_data_device_manager_interface;
+/**
+ * @page page_iface_wl_shell wl_shell
+ * @section page_iface_wl_shell_desc Description
+ *
+ * This interface is implemented by servers that provide
+ * desktop-style user interfaces.
+ *
+ * It allows clients to associate a wl_shell_surface with
+ * a basic surface.
+ * @section page_iface_wl_shell_api API
+ * See @ref iface_wl_shell.
+ */
+/**
+ * @defgroup iface_wl_shell The wl_shell interface
+ *
+ * This interface is implemented by servers that provide
+ * desktop-style user interfaces.
+ *
+ * It allows clients to associate a wl_shell_surface with
+ * a basic surface.
+ */
+extern const struct wl_interface wl_shell_interface;
+/**
+ * @page page_iface_wl_shell_surface wl_shell_surface
+ * @section page_iface_wl_shell_surface_desc Description
+ *
+ * An interface that may be implemented by a wl_surface, for
+ * implementations that provide a desktop-style user interface.
+ *
+ * It provides requests to treat surfaces like toplevel, fullscreen
+ * or popup windows, move, resize or maximize them, associate
+ * metadata like title and class, etc.
+ *
+ * On the server side the object is automatically destroyed when
+ * the related wl_surface is destroyed. On the client side,
+ * wl_shell_surface_destroy() must be called before destroying
+ * the wl_surface object.
+ * @section page_iface_wl_shell_surface_api API
+ * See @ref iface_wl_shell_surface.
+ */
+/**
+ * @defgroup iface_wl_shell_surface The wl_shell_surface interface
+ *
+ * An interface that may be implemented by a wl_surface, for
+ * implementations that provide a desktop-style user interface.
+ *
+ * It provides requests to treat surfaces like toplevel, fullscreen
+ * or popup windows, move, resize or maximize them, associate
+ * metadata like title and class, etc.
+ *
+ * On the server side the object is automatically destroyed when
+ * the related wl_surface is destroyed. On the client side,
+ * wl_shell_surface_destroy() must be called before destroying
+ * the wl_surface object.
+ */
+extern const struct wl_interface wl_shell_surface_interface;
+/**
+ * @page page_iface_wl_surface wl_surface
+ * @section page_iface_wl_surface_desc Description
+ *
+ * A surface is a rectangular area that is displayed on the screen.
+ * It has a location, size and pixel contents.
+ *
+ * The size of a surface (and relative positions on it) is described
+ * in surface-local coordinates, which may differ from the buffer
+ * coordinates of the pixel content, in case a buffer_transform
+ * or a buffer_scale is used.
+ *
+ * A surface without a "role" is fairly useless: a compositor does
+ * not know where, when or how to present it. The role is the
+ * purpose of a wl_surface. Examples of roles are a cursor for a
+ * pointer (as set by wl_pointer.set_cursor), a drag icon
+ * (wl_data_device.start_drag), a sub-surface
+ * (wl_subcompositor.get_subsurface), and a window as defined by a
+ * shell protocol (e.g. wl_shell.get_shell_surface).
+ *
+ * A surface can have only one role at a time. Initially a
+ * wl_surface does not have a role. Once a wl_surface is given a
+ * role, it is set permanently for the whole lifetime of the
+ * wl_surface object. Giving the current role again is allowed,
+ * unless explicitly forbidden by the relevant interface
+ * specification.
+ *
+ * Surface roles are given by requests in other interfaces such as
+ * wl_pointer.set_cursor. The request should explicitly mention
+ * that this request gives a role to a wl_surface. Often, this
+ * request also creates a new protocol object that represents the
+ * role and adds additional functionality to wl_surface. When a
+ * client wants to destroy a wl_surface, they must destroy this 'role
+ * object' before the wl_surface.
+ *
+ * Destroying the role object does not remove the role from the
+ * wl_surface, but it may stop the wl_surface from "playing the role".
+ * For instance, if a wl_subsurface object is destroyed, the wl_surface
+ * it was created for will be unmapped and forget its position and
+ * z-order. It is allowed to create a wl_subsurface for the same
+ * wl_surface again, but it is not allowed to use the wl_surface as
+ * a cursor (cursor is a different role than sub-surface, and role
+ * switching is not allowed).
+ * @section page_iface_wl_surface_api API
+ * See @ref iface_wl_surface.
+ */
+/**
+ * @defgroup iface_wl_surface The wl_surface interface
+ *
+ * A surface is a rectangular area that is displayed on the screen.
+ * It has a location, size and pixel contents.
+ *
+ * The size of a surface (and relative positions on it) is described
+ * in surface-local coordinates, which may differ from the buffer
+ * coordinates of the pixel content, in case a buffer_transform
+ * or a buffer_scale is used.
+ *
+ * A surface without a "role" is fairly useless: a compositor does
+ * not know where, when or how to present it. The role is the
+ * purpose of a wl_surface. Examples of roles are a cursor for a
+ * pointer (as set by wl_pointer.set_cursor), a drag icon
+ * (wl_data_device.start_drag), a sub-surface
+ * (wl_subcompositor.get_subsurface), and a window as defined by a
+ * shell protocol (e.g. wl_shell.get_shell_surface).
+ *
+ * A surface can have only one role at a time. Initially a
+ * wl_surface does not have a role. Once a wl_surface is given a
+ * role, it is set permanently for the whole lifetime of the
+ * wl_surface object. Giving the current role again is allowed,
+ * unless explicitly forbidden by the relevant interface
+ * specification.
+ *
+ * Surface roles are given by requests in other interfaces such as
+ * wl_pointer.set_cursor. The request should explicitly mention
+ * that this request gives a role to a wl_surface. Often, this
+ * request also creates a new protocol object that represents the
+ * role and adds additional functionality to wl_surface. When a
+ * client wants to destroy a wl_surface, they must destroy this 'role
+ * object' before the wl_surface.
+ *
+ * Destroying the role object does not remove the role from the
+ * wl_surface, but it may stop the wl_surface from "playing the role".
+ * For instance, if a wl_subsurface object is destroyed, the wl_surface
+ * it was created for will be unmapped and forget its position and
+ * z-order. It is allowed to create a wl_subsurface for the same
+ * wl_surface again, but it is not allowed to use the wl_surface as
+ * a cursor (cursor is a different role than sub-surface, and role
+ * switching is not allowed).
+ */
+extern const struct wl_interface wl_surface_interface;
+/**
+ * @page page_iface_wl_seat wl_seat
+ * @section page_iface_wl_seat_desc Description
+ *
+ * A seat is a group of keyboards, pointer and touch devices. This
+ * object is published as a global during start up, or when such a
+ * device is hot plugged. A seat typically has a pointer and
+ * maintains a keyboard focus and a pointer focus.
+ * @section page_iface_wl_seat_api API
+ * See @ref iface_wl_seat.
+ */
+/**
+ * @defgroup iface_wl_seat The wl_seat interface
+ *
+ * A seat is a group of keyboards, pointer and touch devices. This
+ * object is published as a global during start up, or when such a
+ * device is hot plugged. A seat typically has a pointer and
+ * maintains a keyboard focus and a pointer focus.
+ */
+extern const struct wl_interface wl_seat_interface;
+/**
+ * @page page_iface_wl_pointer wl_pointer
+ * @section page_iface_wl_pointer_desc Description
+ *
+ * The wl_pointer interface represents one or more input devices,
+ * such as mice, which control the pointer location and pointer_focus
+ * of a seat.
+ *
+ * The wl_pointer interface generates motion, enter and leave
+ * events for the surfaces that the pointer is located over,
+ * and button and axis events for button presses, button releases
+ * and scrolling.
+ * @section page_iface_wl_pointer_api API
+ * See @ref iface_wl_pointer.
+ */
+/**
+ * @defgroup iface_wl_pointer The wl_pointer interface
+ *
+ * The wl_pointer interface represents one or more input devices,
+ * such as mice, which control the pointer location and pointer_focus
+ * of a seat.
+ *
+ * The wl_pointer interface generates motion, enter and leave
+ * events for the surfaces that the pointer is located over,
+ * and button and axis events for button presses, button releases
+ * and scrolling.
+ */
+extern const struct wl_interface wl_pointer_interface;
+/**
+ * @page page_iface_wl_keyboard wl_keyboard
+ * @section page_iface_wl_keyboard_desc Description
+ *
+ * The wl_keyboard interface represents one or more keyboards
+ * associated with a seat.
+ * @section page_iface_wl_keyboard_api API
+ * See @ref iface_wl_keyboard.
+ */
+/**
+ * @defgroup iface_wl_keyboard The wl_keyboard interface
+ *
+ * The wl_keyboard interface represents one or more keyboards
+ * associated with a seat.
+ */
+extern const struct wl_interface wl_keyboard_interface;
+/**
+ * @page page_iface_wl_touch wl_touch
+ * @section page_iface_wl_touch_desc Description
+ *
+ * The wl_touch interface represents a touchscreen
+ * associated with a seat.
+ *
+ * Touch interactions can consist of one or more contacts.
+ * For each contact, a series of events is generated, starting
+ * with a down event, followed by zero or more motion events,
+ * and ending with an up event. Events relating to the same
+ * contact point can be identified by the ID of the sequence.
+ * @section page_iface_wl_touch_api API
+ * See @ref iface_wl_touch.
+ */
+/**
+ * @defgroup iface_wl_touch The wl_touch interface
+ *
+ * The wl_touch interface represents a touchscreen
+ * associated with a seat.
+ *
+ * Touch interactions can consist of one or more contacts.
+ * For each contact, a series of events is generated, starting
+ * with a down event, followed by zero or more motion events,
+ * and ending with an up event. Events relating to the same
+ * contact point can be identified by the ID of the sequence.
+ */
+extern const struct wl_interface wl_touch_interface;
+/**
+ * @page page_iface_wl_output wl_output
+ * @section page_iface_wl_output_desc Description
+ *
+ * An output describes part of the compositor geometry. The
+ * compositor works in the 'compositor coordinate system' and an
+ * output corresponds to a rectangular area in that space that is
+ * actually visible. This typically corresponds to a monitor that
+ * displays part of the compositor space. This object is published
+ * as global during start up, or when a monitor is hotplugged.
+ * @section page_iface_wl_output_api API
+ * See @ref iface_wl_output.
+ */
+/**
+ * @defgroup iface_wl_output The wl_output interface
+ *
+ * An output describes part of the compositor geometry. The
+ * compositor works in the 'compositor coordinate system' and an
+ * output corresponds to a rectangular area in that space that is
+ * actually visible. This typically corresponds to a monitor that
+ * displays part of the compositor space. This object is published
+ * as global during start up, or when a monitor is hotplugged.
+ */
+extern const struct wl_interface wl_output_interface;
+/**
+ * @page page_iface_wl_region wl_region
+ * @section page_iface_wl_region_desc Description
+ *
+ * A region object describes an area.
+ *
+ * Region objects are used to describe the opaque and input
+ * regions of a surface.
+ * @section page_iface_wl_region_api API
+ * See @ref iface_wl_region.
+ */
+/**
+ * @defgroup iface_wl_region The wl_region interface
+ *
+ * A region object describes an area.
+ *
+ * Region objects are used to describe the opaque and input
+ * regions of a surface.
+ */
+extern const struct wl_interface wl_region_interface;
+/**
+ * @page page_iface_wl_subcompositor wl_subcompositor
+ * @section page_iface_wl_subcompositor_desc Description
+ *
+ * The global interface exposing sub-surface compositing capabilities.
+ * A wl_surface, that has sub-surfaces associated, is called the
+ * parent surface. Sub-surfaces can be arbitrarily nested and create
+ * a tree of sub-surfaces.
+ *
+ * The root surface in a tree of sub-surfaces is the main
+ * surface. The main surface cannot be a sub-surface, because
+ * sub-surfaces must always have a parent.
+ *
+ * A main surface with its sub-surfaces forms a (compound) window.
+ * For window management purposes, this set of wl_surface objects is
+ * to be considered as a single window, and it should also behave as
+ * such.
+ *
+ * The aim of sub-surfaces is to offload some of the compositing work
+ * within a window from clients to the compositor. A prime example is
+ * a video player with decorations and video in separate wl_surface
+ * objects. This should allow the compositor to pass YUV video buffer
+ * processing to dedicated overlay hardware when possible.
+ * @section page_iface_wl_subcompositor_api API
+ * See @ref iface_wl_subcompositor.
+ */
+/**
+ * @defgroup iface_wl_subcompositor The wl_subcompositor interface
+ *
+ * The global interface exposing sub-surface compositing capabilities.
+ * A wl_surface, that has sub-surfaces associated, is called the
+ * parent surface. Sub-surfaces can be arbitrarily nested and create
+ * a tree of sub-surfaces.
+ *
+ * The root surface in a tree of sub-surfaces is the main
+ * surface. The main surface cannot be a sub-surface, because
+ * sub-surfaces must always have a parent.
+ *
+ * A main surface with its sub-surfaces forms a (compound) window.
+ * For window management purposes, this set of wl_surface objects is
+ * to be considered as a single window, and it should also behave as
+ * such.
+ *
+ * The aim of sub-surfaces is to offload some of the compositing work
+ * within a window from clients to the compositor. A prime example is
+ * a video player with decorations and video in separate wl_surface
+ * objects. This should allow the compositor to pass YUV video buffer
+ * processing to dedicated overlay hardware when possible.
+ */
+extern const struct wl_interface wl_subcompositor_interface;
+/**
+ * @page page_iface_wl_subsurface wl_subsurface
+ * @section page_iface_wl_subsurface_desc Description
+ *
+ * An additional interface to a wl_surface object, which has been
+ * made a sub-surface. A sub-surface has one parent surface. A
+ * sub-surface's size and position are not limited to that of the parent.
+ * Particularly, a sub-surface is not automatically clipped to its
+ * parent's area.
+ *
+ * A sub-surface becomes mapped, when a non-NULL wl_buffer is applied
+ * and the parent surface is mapped. The order of which one happens
+ * first is irrelevant. A sub-surface is hidden if the parent becomes
+ * hidden, or if a NULL wl_buffer is applied. These rules apply
+ * recursively through the tree of surfaces.
+ *
+ * The behaviour of a wl_surface.commit request on a sub-surface
+ * depends on the sub-surface's mode. The possible modes are
+ * synchronized and desynchronized, see methods
+ * wl_subsurface.set_sync and wl_subsurface.set_desync. Synchronized
+ * mode caches the wl_surface state to be applied when the parent's
+ * state gets applied, and desynchronized mode applies the pending
+ * wl_surface state directly. A sub-surface is initially in the
+ * synchronized mode.
+ *
+ * Sub-surfaces have also other kind of state, which is managed by
+ * wl_subsurface requests, as opposed to wl_surface requests. This
+ * state includes the sub-surface position relative to the parent
+ * surface (wl_subsurface.set_position), and the stacking order of
+ * the parent and its sub-surfaces (wl_subsurface.place_above and
+ * .place_below). This state is applied when the parent surface's
+ * wl_surface state is applied, regardless of the sub-surface's mode.
+ * As the exception, set_sync and set_desync are effective immediately.
+ *
+ * The main surface can be thought to be always in desynchronized mode,
+ * since it does not have a parent in the sub-surfaces sense.
+ *
+ * Even if a sub-surface is in desynchronized mode, it will behave as
+ * in synchronized mode, if its parent surface behaves as in
+ * synchronized mode. This rule is applied recursively throughout the
+ * tree of surfaces. This means, that one can set a sub-surface into
+ * synchronized mode, and then assume that all its child and grand-child
+ * sub-surfaces are synchronized, too, without explicitly setting them.
+ *
+ * If the wl_surface associated with the wl_subsurface is destroyed, the
+ * wl_subsurface object becomes inert. Note, that destroying either object
+ * takes effect immediately. If you need to synchronize the removal
+ * of a sub-surface to the parent surface update, unmap the sub-surface
+ * first by attaching a NULL wl_buffer, update parent, and then destroy
+ * the sub-surface.
+ *
+ * If the parent wl_surface object is destroyed, the sub-surface is
+ * unmapped.
+ * @section page_iface_wl_subsurface_api API
+ * See @ref iface_wl_subsurface.
+ */
+/**
+ * @defgroup iface_wl_subsurface The wl_subsurface interface
+ *
+ * An additional interface to a wl_surface object, which has been
+ * made a sub-surface. A sub-surface has one parent surface. A
+ * sub-surface's size and position are not limited to that of the parent.
+ * Particularly, a sub-surface is not automatically clipped to its
+ * parent's area.
+ *
+ * A sub-surface becomes mapped, when a non-NULL wl_buffer is applied
+ * and the parent surface is mapped. The order of which one happens
+ * first is irrelevant. A sub-surface is hidden if the parent becomes
+ * hidden, or if a NULL wl_buffer is applied. These rules apply
+ * recursively through the tree of surfaces.
+ *
+ * The behaviour of a wl_surface.commit request on a sub-surface
+ * depends on the sub-surface's mode. The possible modes are
+ * synchronized and desynchronized, see methods
+ * wl_subsurface.set_sync and wl_subsurface.set_desync. Synchronized
+ * mode caches the wl_surface state to be applied when the parent's
+ * state gets applied, and desynchronized mode applies the pending
+ * wl_surface state directly. A sub-surface is initially in the
+ * synchronized mode.
+ *
+ * Sub-surfaces have also other kind of state, which is managed by
+ * wl_subsurface requests, as opposed to wl_surface requests. This
+ * state includes the sub-surface position relative to the parent
+ * surface (wl_subsurface.set_position), and the stacking order of
+ * the parent and its sub-surfaces (wl_subsurface.place_above and
+ * .place_below). This state is applied when the parent surface's
+ * wl_surface state is applied, regardless of the sub-surface's mode.
+ * As the exception, set_sync and set_desync are effective immediately.
+ *
+ * The main surface can be thought to be always in desynchronized mode,
+ * since it does not have a parent in the sub-surfaces sense.
+ *
+ * Even if a sub-surface is in desynchronized mode, it will behave as
+ * in synchronized mode, if its parent surface behaves as in
+ * synchronized mode. This rule is applied recursively throughout the
+ * tree of surfaces. This means, that one can set a sub-surface into
+ * synchronized mode, and then assume that all its child and grand-child
+ * sub-surfaces are synchronized, too, without explicitly setting them.
+ *
+ * If the wl_surface associated with the wl_subsurface is destroyed, the
+ * wl_subsurface object becomes inert. Note, that destroying either object
+ * takes effect immediately. If you need to synchronize the removal
+ * of a sub-surface to the parent surface update, unmap the sub-surface
+ * first by attaching a NULL wl_buffer, update parent, and then destroy
+ * the sub-surface.
+ *
+ * If the parent wl_surface object is destroyed, the sub-surface is
+ * unmapped.
+ */
+extern const struct wl_interface wl_subsurface_interface;
+
+#ifndef WL_DISPLAY_ERROR_ENUM
+#define WL_DISPLAY_ERROR_ENUM
+/**
+ * @ingroup iface_wl_display
+ * global error values
+ *
+ * These errors are global and can be emitted in response to any
+ * server request.
+ */
+enum wl_display_error {
+ /**
+ * server couldn't find object
+ */
+ WL_DISPLAY_ERROR_INVALID_OBJECT = 0,
+ /**
+ * method doesn't exist on the specified interface
+ */
+ WL_DISPLAY_ERROR_INVALID_METHOD = 1,
+ /**
+ * server is out of memory
+ */
+ WL_DISPLAY_ERROR_NO_MEMORY = 2,
+};
+#endif /* WL_DISPLAY_ERROR_ENUM */
+
+/**
+ * @ingroup iface_wl_display
+ * @struct wl_display_interface
+ */
+struct wl_display_interface {
+ /**
+ * asynchronous roundtrip
+ *
+ * The sync request asks the server to emit the 'done' event on
+ * the returned wl_callback object. Since requests are handled
+ * in-order and events are delivered in-order, this can be used as
+ * a barrier to ensure all previous requests and the resulting
+ * events have been handled.
+ *
+ * The object returned by this request will be destroyed by the
+ * compositor after the callback is fired and as such the client
+ * must not attempt to use it after that point.
+ *
+ * The callback_data passed in the callback is the event serial.
+ * @param callback callback object for the sync request
+ */
+ void (*sync)(struct wl_client *client,
+ struct wl_resource *resource,
+ uint32_t callback);
+ /**
+ * get global registry object
+ *
+ * This request creates a registry object that allows the client
+ * to list and bind the global objects available from the
+ * compositor.
+ * @param registry global registry object
+ */
+ void (*get_registry)(struct wl_client *client,
+ struct wl_resource *resource,
+ uint32_t registry);
+};
+
+#define WL_DISPLAY_ERROR 0
+#define WL_DISPLAY_DELETE_ID 1
+
+/**
+ * @ingroup iface_wl_display
+ */
+#define WL_DISPLAY_ERROR_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_display
+ */
+#define WL_DISPLAY_DELETE_ID_SINCE_VERSION 1
+
+/**
+ * @ingroup iface_wl_display
+ */
+#define WL_DISPLAY_SYNC_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_display
+ */
+#define WL_DISPLAY_GET_REGISTRY_SINCE_VERSION 1
+
+/**
+ * @ingroup iface_wl_registry
+ * @struct wl_registry_interface
+ */
+struct wl_registry_interface {
+ /**
+ * bind an object to the display
+ *
+ * Binds a new, client-created object to the server using the
+ * specified name as the identifier.
+ * @param name unique numeric name of the object
+ * @param interface name of the objects interface
+ * @param version version of the objects interface
+ * @param id bounded object
+ */
+ void (*bind)(struct wl_client *client,
+ struct wl_resource *resource,
+ uint32_t name,
+ const char *interface, uint32_t version, uint32_t id);
+};
+
+#define WL_REGISTRY_GLOBAL 0
+#define WL_REGISTRY_GLOBAL_REMOVE 1
+
+/**
+ * @ingroup iface_wl_registry
+ */
+#define WL_REGISTRY_GLOBAL_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_registry
+ */
+#define WL_REGISTRY_GLOBAL_REMOVE_SINCE_VERSION 1
+
+/**
+ * @ingroup iface_wl_registry
+ */
+#define WL_REGISTRY_BIND_SINCE_VERSION 1
+
+/**
+ * @ingroup iface_wl_registry
+ * Sends an global event to the client owning the resource.
+ * @param resource_ The client's resource
+ * @param name numeric name of the global object
+ * @param interface interface implemented by the object
+ * @param version interface version
+ */
+static inline void
+wl_registry_send_global(struct wl_resource *resource_, uint32_t name, const char *interface, uint32_t version)
+{
+ wl_resource_post_event(resource_, WL_REGISTRY_GLOBAL, name, interface, version);
+}
+
+/**
+ * @ingroup iface_wl_registry
+ * Sends an global_remove event to the client owning the resource.
+ * @param resource_ The client's resource
+ * @param name numeric name of the global object
+ */
+static inline void
+wl_registry_send_global_remove(struct wl_resource *resource_, uint32_t name)
+{
+ wl_resource_post_event(resource_, WL_REGISTRY_GLOBAL_REMOVE, name);
+}
+
+#define WL_CALLBACK_DONE 0
+
+/**
+ * @ingroup iface_wl_callback
+ */
+#define WL_CALLBACK_DONE_SINCE_VERSION 1
+
+
+/**
+ * @ingroup iface_wl_callback
+ * Sends an done event to the client owning the resource.
+ * @param resource_ The client's resource
+ * @param callback_data request-specific data for the callback
+ */
+static inline void
+wl_callback_send_done(struct wl_resource *resource_, uint32_t callback_data)
+{
+ wl_resource_post_event(resource_, WL_CALLBACK_DONE, callback_data);
+}
+
+/**
+ * @ingroup iface_wl_compositor
+ * @struct wl_compositor_interface
+ */
+struct wl_compositor_interface {
+ /**
+ * create new surface
+ *
+ * Ask the compositor to create a new surface.
+ * @param id the new surface
+ */
+ void (*create_surface)(struct wl_client *client,
+ struct wl_resource *resource,
+ uint32_t id);
+ /**
+ * create new region
+ *
+ * Ask the compositor to create a new region.
+ * @param id the new region
+ */
+ void (*create_region)(struct wl_client *client,
+ struct wl_resource *resource,
+ uint32_t id);
+};
+
+
+/**
+ * @ingroup iface_wl_compositor
+ */
+#define WL_COMPOSITOR_CREATE_SURFACE_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_compositor
+ */
+#define WL_COMPOSITOR_CREATE_REGION_SINCE_VERSION 1
+
+/**
+ * @ingroup iface_wl_shm_pool
+ * @struct wl_shm_pool_interface
+ */
+struct wl_shm_pool_interface {
+ /**
+ * create a buffer from the pool
+ *
+ * Create a wl_buffer object from the pool.
+ *
+ * The buffer is created offset bytes into the pool and has width
+ * and height as specified. The stride argument specifies the
+ * number of bytes from the beginning of one row to the beginning
+ * of the next. The format is the pixel format of the buffer and
+ * must be one of those advertised through the wl_shm.format event.
+ *
+ * A buffer will keep a reference to the pool it was created from
+ * so it is valid to destroy the pool immediately after creating a
+ * buffer from it.
+ * @param id buffer to create
+ * @param offset buffer byte offset within the pool
+ * @param width buffer width, in pixels
+ * @param height buffer height, in pixels
+ * @param stride number of bytes from the beginning of one row to the beginning of the next row
+ * @param format buffer pixel format
+ */
+ void (*create_buffer)(struct wl_client *client,
+ struct wl_resource *resource,
+ uint32_t id,
+ int32_t offset,
+ int32_t width,
+ int32_t height,
+ int32_t stride,
+ uint32_t format);
+ /**
+ * destroy the pool
+ *
+ * Destroy the shared memory pool.
+ *
+ * The mmapped memory will be released when all buffers that have
+ * been created from this pool are gone.
+ */
+ void (*destroy)(struct wl_client *client,
+ struct wl_resource *resource);
+ /**
+ * change the size of the pool mapping
+ *
+ * This request will cause the server to remap the backing memory
+ * for the pool from the file descriptor passed when the pool was
+ * created, but using the new size. This request can only be used
+ * to make the pool bigger.
+ * @param size new size of the pool, in bytes
+ */
+ void (*resize)(struct wl_client *client,
+ struct wl_resource *resource,
+ int32_t size);
+};
+
+
+/**
+ * @ingroup iface_wl_shm_pool
+ */
+#define WL_SHM_POOL_CREATE_BUFFER_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_shm_pool
+ */
+#define WL_SHM_POOL_DESTROY_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_shm_pool
+ */
+#define WL_SHM_POOL_RESIZE_SINCE_VERSION 1
+
+#ifndef WL_SHM_ERROR_ENUM
+#define WL_SHM_ERROR_ENUM
+/**
+ * @ingroup iface_wl_shm
+ * wl_shm error values
+ *
+ * These errors can be emitted in response to wl_shm requests.
+ */
+enum wl_shm_error {
+ /**
+ * buffer format is not known
+ */
+ WL_SHM_ERROR_INVALID_FORMAT = 0,
+ /**
+ * invalid size or stride during pool or buffer creation
+ */
+ WL_SHM_ERROR_INVALID_STRIDE = 1,
+ /**
+ * mmapping the file descriptor failed
+ */
+ WL_SHM_ERROR_INVALID_FD = 2,
+};
+#endif /* WL_SHM_ERROR_ENUM */
+
+#ifndef WL_SHM_FORMAT_ENUM
+#define WL_SHM_FORMAT_ENUM
+/**
+ * @ingroup iface_wl_shm
+ * pixel formats
+ *
+ * This describes the memory layout of an individual pixel.
+ *
+ * All renderers should support argb8888 and xrgb8888 but any other
+ * formats are optional and may not be supported by the particular
+ * renderer in use.
+ *
+ * The drm format codes match the macros defined in drm_fourcc.h.
+ * The formats actually supported by the compositor will be
+ * reported by the format event.
+ */
+enum wl_shm_format {
+ /**
+ * 32-bit ARGB format, [31:0] A:R:G:B 8:8:8:8 little endian
+ */
+ WL_SHM_FORMAT_ARGB8888 = 0,
+ /**
+ * 32-bit RGB format, [31:0] x:R:G:B 8:8:8:8 little endian
+ */
+ WL_SHM_FORMAT_XRGB8888 = 1,
+ /**
+ * 8-bit color index format, [7:0] C
+ */
+ WL_SHM_FORMAT_C8 = 0x20203843,
+ /**
+ * 8-bit RGB format, [7:0] R:G:B 3:3:2
+ */
+ WL_SHM_FORMAT_RGB332 = 0x38424752,
+ /**
+ * 8-bit BGR format, [7:0] B:G:R 2:3:3
+ */
+ WL_SHM_FORMAT_BGR233 = 0x38524742,
+ /**
+ * 16-bit xRGB format, [15:0] x:R:G:B 4:4:4:4 little endian
+ */
+ WL_SHM_FORMAT_XRGB4444 = 0x32315258,
+ /**
+ * 16-bit xBGR format, [15:0] x:B:G:R 4:4:4:4 little endian
+ */
+ WL_SHM_FORMAT_XBGR4444 = 0x32314258,
+ /**
+ * 16-bit RGBx format, [15:0] R:G:B:x 4:4:4:4 little endian
+ */
+ WL_SHM_FORMAT_RGBX4444 = 0x32315852,
+ /**
+ * 16-bit BGRx format, [15:0] B:G:R:x 4:4:4:4 little endian
+ */
+ WL_SHM_FORMAT_BGRX4444 = 0x32315842,
+ /**
+ * 16-bit ARGB format, [15:0] A:R:G:B 4:4:4:4 little endian
+ */
+ WL_SHM_FORMAT_ARGB4444 = 0x32315241,
+ /**
+ * 16-bit ABGR format, [15:0] A:B:G:R 4:4:4:4 little endian
+ */
+ WL_SHM_FORMAT_ABGR4444 = 0x32314241,
+ /**
+ * 16-bit RBGA format, [15:0] R:G:B:A 4:4:4:4 little endian
+ */
+ WL_SHM_FORMAT_RGBA4444 = 0x32314152,
+ /**
+ * 16-bit BGRA format, [15:0] B:G:R:A 4:4:4:4 little endian
+ */
+ WL_SHM_FORMAT_BGRA4444 = 0x32314142,
+ /**
+ * 16-bit xRGB format, [15:0] x:R:G:B 1:5:5:5 little endian
+ */
+ WL_SHM_FORMAT_XRGB1555 = 0x35315258,
+ /**
+ * 16-bit xBGR 1555 format, [15:0] x:B:G:R 1:5:5:5 little endian
+ */
+ WL_SHM_FORMAT_XBGR1555 = 0x35314258,
+ /**
+ * 16-bit RGBx 5551 format, [15:0] R:G:B:x 5:5:5:1 little endian
+ */
+ WL_SHM_FORMAT_RGBX5551 = 0x35315852,
+ /**
+ * 16-bit BGRx 5551 format, [15:0] B:G:R:x 5:5:5:1 little endian
+ */
+ WL_SHM_FORMAT_BGRX5551 = 0x35315842,
+ /**
+ * 16-bit ARGB 1555 format, [15:0] A:R:G:B 1:5:5:5 little endian
+ */
+ WL_SHM_FORMAT_ARGB1555 = 0x35315241,
+ /**
+ * 16-bit ABGR 1555 format, [15:0] A:B:G:R 1:5:5:5 little endian
+ */
+ WL_SHM_FORMAT_ABGR1555 = 0x35314241,
+ /**
+ * 16-bit RGBA 5551 format, [15:0] R:G:B:A 5:5:5:1 little endian
+ */
+ WL_SHM_FORMAT_RGBA5551 = 0x35314152,
+ /**
+ * 16-bit BGRA 5551 format, [15:0] B:G:R:A 5:5:5:1 little endian
+ */
+ WL_SHM_FORMAT_BGRA5551 = 0x35314142,
+ /**
+ * 16-bit RGB 565 format, [15:0] R:G:B 5:6:5 little endian
+ */
+ WL_SHM_FORMAT_RGB565 = 0x36314752,
+ /**
+ * 16-bit BGR 565 format, [15:0] B:G:R 5:6:5 little endian
+ */
+ WL_SHM_FORMAT_BGR565 = 0x36314742,
+ /**
+ * 24-bit RGB format, [23:0] R:G:B little endian
+ */
+ WL_SHM_FORMAT_RGB888 = 0x34324752,
+ /**
+ * 24-bit BGR format, [23:0] B:G:R little endian
+ */
+ WL_SHM_FORMAT_BGR888 = 0x34324742,
+ /**
+ * 32-bit xBGR format, [31:0] x:B:G:R 8:8:8:8 little endian
+ */
+ WL_SHM_FORMAT_XBGR8888 = 0x34324258,
+ /**
+ * 32-bit RGBx format, [31:0] R:G:B:x 8:8:8:8 little endian
+ */
+ WL_SHM_FORMAT_RGBX8888 = 0x34325852,
+ /**
+ * 32-bit BGRx format, [31:0] B:G:R:x 8:8:8:8 little endian
+ */
+ WL_SHM_FORMAT_BGRX8888 = 0x34325842,
+ /**
+ * 32-bit ABGR format, [31:0] A:B:G:R 8:8:8:8 little endian
+ */
+ WL_SHM_FORMAT_ABGR8888 = 0x34324241,
+ /**
+ * 32-bit RGBA format, [31:0] R:G:B:A 8:8:8:8 little endian
+ */
+ WL_SHM_FORMAT_RGBA8888 = 0x34324152,
+ /**
+ * 32-bit BGRA format, [31:0] B:G:R:A 8:8:8:8 little endian
+ */
+ WL_SHM_FORMAT_BGRA8888 = 0x34324142,
+ /**
+ * 32-bit xRGB format, [31:0] x:R:G:B 2:10:10:10 little endian
+ */
+ WL_SHM_FORMAT_XRGB2101010 = 0x30335258,
+ /**
+ * 32-bit xBGR format, [31:0] x:B:G:R 2:10:10:10 little endian
+ */
+ WL_SHM_FORMAT_XBGR2101010 = 0x30334258,
+ /**
+ * 32-bit RGBx format, [31:0] R:G:B:x 10:10:10:2 little endian
+ */
+ WL_SHM_FORMAT_RGBX1010102 = 0x30335852,
+ /**
+ * 32-bit BGRx format, [31:0] B:G:R:x 10:10:10:2 little endian
+ */
+ WL_SHM_FORMAT_BGRX1010102 = 0x30335842,
+ /**
+ * 32-bit ARGB format, [31:0] A:R:G:B 2:10:10:10 little endian
+ */
+ WL_SHM_FORMAT_ARGB2101010 = 0x30335241,
+ /**
+ * 32-bit ABGR format, [31:0] A:B:G:R 2:10:10:10 little endian
+ */
+ WL_SHM_FORMAT_ABGR2101010 = 0x30334241,
+ /**
+ * 32-bit RGBA format, [31:0] R:G:B:A 10:10:10:2 little endian
+ */
+ WL_SHM_FORMAT_RGBA1010102 = 0x30334152,
+ /**
+ * 32-bit BGRA format, [31:0] B:G:R:A 10:10:10:2 little endian
+ */
+ WL_SHM_FORMAT_BGRA1010102 = 0x30334142,
+ /**
+ * packed YCbCr format, [31:0] Cr0:Y1:Cb0:Y0 8:8:8:8 little endian
+ */
+ WL_SHM_FORMAT_YUYV = 0x56595559,
+ /**
+ * packed YCbCr format, [31:0] Cb0:Y1:Cr0:Y0 8:8:8:8 little endian
+ */
+ WL_SHM_FORMAT_YVYU = 0x55595659,
+ /**
+ * packed YCbCr format, [31:0] Y1:Cr0:Y0:Cb0 8:8:8:8 little endian
+ */
+ WL_SHM_FORMAT_UYVY = 0x59565955,
+ /**
+ * packed YCbCr format, [31:0] Y1:Cb0:Y0:Cr0 8:8:8:8 little endian
+ */
+ WL_SHM_FORMAT_VYUY = 0x59555956,
+ /**
+ * packed AYCbCr format, [31:0] A:Y:Cb:Cr 8:8:8:8 little endian
+ */
+ WL_SHM_FORMAT_AYUV = 0x56555941,
+ /**
+ * 2 plane YCbCr Cr:Cb format, 2x2 subsampled Cr:Cb plane
+ */
+ WL_SHM_FORMAT_NV12 = 0x3231564e,
+ /**
+ * 2 plane YCbCr Cb:Cr format, 2x2 subsampled Cb:Cr plane
+ */
+ WL_SHM_FORMAT_NV21 = 0x3132564e,
+ /**
+ * 2 plane YCbCr Cr:Cb format, 2x1 subsampled Cr:Cb plane
+ */
+ WL_SHM_FORMAT_NV16 = 0x3631564e,
+ /**
+ * 2 plane YCbCr Cb:Cr format, 2x1 subsampled Cb:Cr plane
+ */
+ WL_SHM_FORMAT_NV61 = 0x3136564e,
+ /**
+ * 3 plane YCbCr format, 4x4 subsampled Cb (1) and Cr (2) planes
+ */
+ WL_SHM_FORMAT_YUV410 = 0x39565559,
+ /**
+ * 3 plane YCbCr format, 4x4 subsampled Cr (1) and Cb (2) planes
+ */
+ WL_SHM_FORMAT_YVU410 = 0x39555659,
+ /**
+ * 3 plane YCbCr format, 4x1 subsampled Cb (1) and Cr (2) planes
+ */
+ WL_SHM_FORMAT_YUV411 = 0x31315559,
+ /**
+ * 3 plane YCbCr format, 4x1 subsampled Cr (1) and Cb (2) planes
+ */
+ WL_SHM_FORMAT_YVU411 = 0x31315659,
+ /**
+ * 3 plane YCbCr format, 2x2 subsampled Cb (1) and Cr (2) planes
+ */
+ WL_SHM_FORMAT_YUV420 = 0x32315559,
+ /**
+ * 3 plane YCbCr format, 2x2 subsampled Cr (1) and Cb (2) planes
+ */
+ WL_SHM_FORMAT_YVU420 = 0x32315659,
+ /**
+ * 3 plane YCbCr format, 2x1 subsampled Cb (1) and Cr (2) planes
+ */
+ WL_SHM_FORMAT_YUV422 = 0x36315559,
+ /**
+ * 3 plane YCbCr format, 2x1 subsampled Cr (1) and Cb (2) planes
+ */
+ WL_SHM_FORMAT_YVU422 = 0x36315659,
+ /**
+ * 3 plane YCbCr format, non-subsampled Cb (1) and Cr (2) planes
+ */
+ WL_SHM_FORMAT_YUV444 = 0x34325559,
+ /**
+ * 3 plane YCbCr format, non-subsampled Cr (1) and Cb (2) planes
+ */
+ WL_SHM_FORMAT_YVU444 = 0x34325659,
+};
+#endif /* WL_SHM_FORMAT_ENUM */
+
+/**
+ * @ingroup iface_wl_shm
+ * @struct wl_shm_interface
+ */
+struct wl_shm_interface {
+ /**
+ * create a shm pool
+ *
+ * Create a new wl_shm_pool object.
+ *
+ * The pool can be used to create shared memory based buffer
+ * objects. The server will mmap size bytes of the passed file
+ * descriptor, to use as backing memory for the pool.
+ * @param id pool to create
+ * @param fd file descriptor for the pool
+ * @param size pool size, in bytes
+ */
+ void (*create_pool)(struct wl_client *client,
+ struct wl_resource *resource,
+ uint32_t id,
+ int32_t fd,
+ int32_t size);
+};
+
+#define WL_SHM_FORMAT 0
+
+/**
+ * @ingroup iface_wl_shm
+ */
+#define WL_SHM_FORMAT_SINCE_VERSION 1
+
+/**
+ * @ingroup iface_wl_shm
+ */
+#define WL_SHM_CREATE_POOL_SINCE_VERSION 1
+
+/**
+ * @ingroup iface_wl_shm
+ * Sends an format event to the client owning the resource.
+ * @param resource_ The client's resource
+ * @param format buffer pixel format
+ */
+static inline void
+wl_shm_send_format(struct wl_resource *resource_, uint32_t format)
+{
+ wl_resource_post_event(resource_, WL_SHM_FORMAT, format);
+}
+
+/**
+ * @ingroup iface_wl_buffer
+ * @struct wl_buffer_interface
+ */
+struct wl_buffer_interface {
+ /**
+ * destroy a buffer
+ *
+ * Destroy a buffer. If and how you need to release the backing
+ * storage is defined by the buffer factory interface.
+ *
+ * For possible side-effects to a surface, see wl_surface.attach.
+ */
+ void (*destroy)(struct wl_client *client,
+ struct wl_resource *resource);
+};
+
+#define WL_BUFFER_RELEASE 0
+
+/**
+ * @ingroup iface_wl_buffer
+ */
+#define WL_BUFFER_RELEASE_SINCE_VERSION 1
+
+/**
+ * @ingroup iface_wl_buffer
+ */
+#define WL_BUFFER_DESTROY_SINCE_VERSION 1
+
+/**
+ * @ingroup iface_wl_buffer
+ * Sends an release event to the client owning the resource.
+ * @param resource_ The client's resource
+ */
+static inline void
+wl_buffer_send_release(struct wl_resource *resource_)
+{
+ wl_resource_post_event(resource_, WL_BUFFER_RELEASE);
+}
+
+#ifndef WL_DATA_OFFER_ERROR_ENUM
+#define WL_DATA_OFFER_ERROR_ENUM
+enum wl_data_offer_error {
+ /**
+ * finish request was called untimely
+ */
+ WL_DATA_OFFER_ERROR_INVALID_FINISH = 0,
+ /**
+ * action mask contains invalid values
+ */
+ WL_DATA_OFFER_ERROR_INVALID_ACTION_MASK = 1,
+ /**
+ * action argument has an invalid value
+ */
+ WL_DATA_OFFER_ERROR_INVALID_ACTION = 2,
+ /**
+ * offer doesn't accept this request
+ */
+ WL_DATA_OFFER_ERROR_INVALID_OFFER = 3,
+};
+#endif /* WL_DATA_OFFER_ERROR_ENUM */
+
+/**
+ * @ingroup iface_wl_data_offer
+ * @struct wl_data_offer_interface
+ */
+struct wl_data_offer_interface {
+ /**
+ * accept one of the offered mime types
+ *
+ * Indicate that the client can accept the given mime type, or
+ * NULL for not accepted.
+ *
+ * For objects of version 2 or older, this request is used by the
+ * client to give feedback whether the client can receive the given
+ * mime type, or NULL if none is accepted; the feedback does not
+ * determine whether the drag-and-drop operation succeeds or not.
+ *
+ * For objects of version 3 or newer, this request determines the
+ * final result of the drag-and-drop operation. If the end result
+ * is that no mime types were accepted, the drag-and-drop operation
+ * will be cancelled and the corresponding drag source will receive
+ * wl_data_source.cancelled. Clients may still use this event in
+ * conjunction with wl_data_source.action for feedback.
+ * @param serial serial number of the accept request
+ * @param mime_type mime type accepted by the client
+ */
+ void (*accept)(struct wl_client *client,
+ struct wl_resource *resource,
+ uint32_t serial,
+ const char *mime_type);
+ /**
+ * request that the data is transferred
+ *
+ * To transfer the offered data, the client issues this request
+ * and indicates the mime type it wants to receive. The transfer
+ * happens through the passed file descriptor (typically created
+ * with the pipe system call). The source client writes the data in
+ * the mime type representation requested and then closes the file
+ * descriptor.
+ *
+ * The receiving client reads from the read end of the pipe until
+ * EOF and then closes its end, at which point the transfer is
+ * complete.
+ *
+ * This request may happen multiple times for different mime types,
+ * both before and after wl_data_device.drop. Drag-and-drop
+ * destination clients may preemptively fetch data or examine it
+ * more closely to determine acceptance.
+ * @param mime_type mime type desired by receiver
+ * @param fd file descriptor for data transfer
+ */
+ void (*receive)(struct wl_client *client,
+ struct wl_resource *resource,
+ const char *mime_type,
+ int32_t fd);
+ /**
+ * destroy data offer
+ *
+ * Destroy the data offer.
+ */
+ void (*destroy)(struct wl_client *client,
+ struct wl_resource *resource);
+ /**
+ * the offer will no longer be used
+ *
+ * Notifies the compositor that the drag destination successfully
+ * finished the drag-and-drop operation.
+ *
+ * Upon receiving this request, the compositor will emit
+ * wl_data_source.dnd_finished on the drag source client.
+ *
+ * It is a client error to perform other requests than
+ * wl_data_offer.destroy after this one. It is also an error to
+ * perform this request after a NULL mime type has been set in
+ * wl_data_offer.accept or no action was received through
+ * wl_data_offer.action.
+ * @since 3
+ */
+ void (*finish)(struct wl_client *client,
+ struct wl_resource *resource);
+ /**
+ * set the available/preferred drag-and-drop actions
+ *
+ * Sets the actions that the destination side client supports for
+ * this operation. This request may trigger the emission of
+ * wl_data_source.action and wl_data_offer.action events if the
+ * compositor needs to change the selected action.
+ *
+ * This request can be called multiple times throughout the
+ * drag-and-drop operation, typically in response to
+ * wl_data_device.enter or wl_data_device.motion events.
+ *
+ * This request determines the final result of the drag-and-drop
+ * operation. If the end result is that no action is accepted, the
+ * drag source will receive wl_drag_source.cancelled.
+ *
+ * The dnd_actions argument must contain only values expressed in
+ * the wl_data_device_manager.dnd_actions enum, and the
+ * preferred_action argument must only contain one of those values
+ * set, otherwise it will result in a protocol error.
+ *
+ * While managing an "ask" action, the destination drag-and-drop
+ * client may perform further wl_data_offer.receive requests, and
+ * is expected to perform one last wl_data_offer.set_actions
+ * request with a preferred action other than "ask" (and optionally
+ * wl_data_offer.accept) before requesting wl_data_offer.finish, in
+ * order to convey the action selected by the user. If the
+ * preferred action is not in the wl_data_offer.source_actions
+ * mask, an error will be raised.
+ *
+ * If the "ask" action is dismissed (e.g. user cancellation), the
+ * client is expected to perform wl_data_offer.destroy right away.
+ *
+ * This request can only be made on drag-and-drop offers, a
+ * protocol error will be raised otherwise.
+ * @param dnd_actions actions supported by the destination client
+ * @param preferred_action action preferred by the destination client
+ * @since 3
+ */
+ void (*set_actions)(struct wl_client *client,
+ struct wl_resource *resource,
+ uint32_t dnd_actions,
+ uint32_t preferred_action);
+};
+
+#define WL_DATA_OFFER_OFFER 0
+#define WL_DATA_OFFER_SOURCE_ACTIONS 1
+#define WL_DATA_OFFER_ACTION 2
+
+/**
+ * @ingroup iface_wl_data_offer
+ */
+#define WL_DATA_OFFER_OFFER_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_data_offer
+ */
+#define WL_DATA_OFFER_SOURCE_ACTIONS_SINCE_VERSION 3
+/**
+ * @ingroup iface_wl_data_offer
+ */
+#define WL_DATA_OFFER_ACTION_SINCE_VERSION 3
+
+/**
+ * @ingroup iface_wl_data_offer
+ */
+#define WL_DATA_OFFER_ACCEPT_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_data_offer
+ */
+#define WL_DATA_OFFER_RECEIVE_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_data_offer
+ */
+#define WL_DATA_OFFER_DESTROY_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_data_offer
+ */
+#define WL_DATA_OFFER_FINISH_SINCE_VERSION 3
+/**
+ * @ingroup iface_wl_data_offer
+ */
+#define WL_DATA_OFFER_SET_ACTIONS_SINCE_VERSION 3
+
+/**
+ * @ingroup iface_wl_data_offer
+ * Sends an offer event to the client owning the resource.
+ * @param resource_ The client's resource
+ * @param mime_type offered mime type
+ */
+static inline void
+wl_data_offer_send_offer(struct wl_resource *resource_, const char *mime_type)
+{
+ wl_resource_post_event(resource_, WL_DATA_OFFER_OFFER, mime_type);
+}
+
+/**
+ * @ingroup iface_wl_data_offer
+ * Sends an source_actions event to the client owning the resource.
+ * @param resource_ The client's resource
+ * @param source_actions actions offered by the data source
+ */
+static inline void
+wl_data_offer_send_source_actions(struct wl_resource *resource_, uint32_t source_actions)
+{
+ wl_resource_post_event(resource_, WL_DATA_OFFER_SOURCE_ACTIONS, source_actions);
+}
+
+/**
+ * @ingroup iface_wl_data_offer
+ * Sends an action event to the client owning the resource.
+ * @param resource_ The client's resource
+ * @param dnd_action action selected by the compositor
+ */
+static inline void
+wl_data_offer_send_action(struct wl_resource *resource_, uint32_t dnd_action)
+{
+ wl_resource_post_event(resource_, WL_DATA_OFFER_ACTION, dnd_action);
+}
+
+#ifndef WL_DATA_SOURCE_ERROR_ENUM
+#define WL_DATA_SOURCE_ERROR_ENUM
+enum wl_data_source_error {
+ /**
+ * action mask contains invalid values
+ */
+ WL_DATA_SOURCE_ERROR_INVALID_ACTION_MASK = 0,
+ /**
+ * source doesn't accept this request
+ */
+ WL_DATA_SOURCE_ERROR_INVALID_SOURCE = 1,
+};
+#endif /* WL_DATA_SOURCE_ERROR_ENUM */
+
+/**
+ * @ingroup iface_wl_data_source
+ * @struct wl_data_source_interface
+ */
+struct wl_data_source_interface {
+ /**
+ * add an offered mime type
+ *
+ * This request adds a mime type to the set of mime types
+ * advertised to targets. Can be called several times to offer
+ * multiple types.
+ * @param mime_type mime type offered by the data source
+ */
+ void (*offer)(struct wl_client *client,
+ struct wl_resource *resource,
+ const char *mime_type);
+ /**
+ * destroy the data source
+ *
+ * Destroy the data source.
+ */
+ void (*destroy)(struct wl_client *client,
+ struct wl_resource *resource);
+ /**
+ * set the available drag-and-drop actions
+ *
+ * Sets the actions that the source side client supports for this
+ * operation. This request may trigger wl_data_source.action and
+ * wl_data_offer.action events if the compositor needs to change
+ * the selected action.
+ *
+ * The dnd_actions argument must contain only values expressed in
+ * the wl_data_device_manager.dnd_actions enum, otherwise it will
+ * result in a protocol error.
+ *
+ * This request must be made once only, and can only be made on
+ * sources used in drag-and-drop, so it must be performed before
+ * wl_data_device.start_drag. Attempting to use the source other
+ * than for drag-and-drop will raise a protocol error.
+ * @param dnd_actions actions supported by the data source
+ * @since 3
+ */
+ void (*set_actions)(struct wl_client *client,
+ struct wl_resource *resource,
+ uint32_t dnd_actions);
+};
+
+#define WL_DATA_SOURCE_TARGET 0
+#define WL_DATA_SOURCE_SEND 1
+#define WL_DATA_SOURCE_CANCELLED 2
+#define WL_DATA_SOURCE_DND_DROP_PERFORMED 3
+#define WL_DATA_SOURCE_DND_FINISHED 4
+#define WL_DATA_SOURCE_ACTION 5
+
+/**
+ * @ingroup iface_wl_data_source
+ */
+#define WL_DATA_SOURCE_TARGET_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_data_source
+ */
+#define WL_DATA_SOURCE_SEND_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_data_source
+ */
+#define WL_DATA_SOURCE_CANCELLED_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_data_source
+ */
+#define WL_DATA_SOURCE_DND_DROP_PERFORMED_SINCE_VERSION 3
+/**
+ * @ingroup iface_wl_data_source
+ */
+#define WL_DATA_SOURCE_DND_FINISHED_SINCE_VERSION 3
+/**
+ * @ingroup iface_wl_data_source
+ */
+#define WL_DATA_SOURCE_ACTION_SINCE_VERSION 3
+
+/**
+ * @ingroup iface_wl_data_source
+ */
+#define WL_DATA_SOURCE_OFFER_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_data_source
+ */
+#define WL_DATA_SOURCE_DESTROY_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_data_source
+ */
+#define WL_DATA_SOURCE_SET_ACTIONS_SINCE_VERSION 3
+
+/**
+ * @ingroup iface_wl_data_source
+ * Sends an target event to the client owning the resource.
+ * @param resource_ The client's resource
+ * @param mime_type mime type accepted by the target
+ */
+static inline void
+wl_data_source_send_target(struct wl_resource *resource_, const char *mime_type)
+{
+ wl_resource_post_event(resource_, WL_DATA_SOURCE_TARGET, mime_type);
+}
+
+/**
+ * @ingroup iface_wl_data_source
+ * Sends an send event to the client owning the resource.
+ * @param resource_ The client's resource
+ * @param mime_type mime type for the data
+ * @param fd file descriptor for the data
+ */
+static inline void
+wl_data_source_send_send(struct wl_resource *resource_, const char *mime_type, int32_t fd)
+{
+ wl_resource_post_event(resource_, WL_DATA_SOURCE_SEND, mime_type, fd);
+}
+
+/**
+ * @ingroup iface_wl_data_source
+ * Sends an cancelled event to the client owning the resource.
+ * @param resource_ The client's resource
+ */
+static inline void
+wl_data_source_send_cancelled(struct wl_resource *resource_)
+{
+ wl_resource_post_event(resource_, WL_DATA_SOURCE_CANCELLED);
+}
+
+/**
+ * @ingroup iface_wl_data_source
+ * Sends an dnd_drop_performed event to the client owning the resource.
+ * @param resource_ The client's resource
+ */
+static inline void
+wl_data_source_send_dnd_drop_performed(struct wl_resource *resource_)
+{
+ wl_resource_post_event(resource_, WL_DATA_SOURCE_DND_DROP_PERFORMED);
+}
+
+/**
+ * @ingroup iface_wl_data_source
+ * Sends an dnd_finished event to the client owning the resource.
+ * @param resource_ The client's resource
+ */
+static inline void
+wl_data_source_send_dnd_finished(struct wl_resource *resource_)
+{
+ wl_resource_post_event(resource_, WL_DATA_SOURCE_DND_FINISHED);
+}
+
+/**
+ * @ingroup iface_wl_data_source
+ * Sends an action event to the client owning the resource.
+ * @param resource_ The client's resource
+ * @param dnd_action action selected by the compositor
+ */
+static inline void
+wl_data_source_send_action(struct wl_resource *resource_, uint32_t dnd_action)
+{
+ wl_resource_post_event(resource_, WL_DATA_SOURCE_ACTION, dnd_action);
+}
+
+#ifndef WL_DATA_DEVICE_ERROR_ENUM
+#define WL_DATA_DEVICE_ERROR_ENUM
+enum wl_data_device_error {
+ /**
+ * given wl_surface has another role
+ */
+ WL_DATA_DEVICE_ERROR_ROLE = 0,
+};
+#endif /* WL_DATA_DEVICE_ERROR_ENUM */
+
+/**
+ * @ingroup iface_wl_data_device
+ * @struct wl_data_device_interface
+ */
+struct wl_data_device_interface {
+ /**
+ * start drag-and-drop operation
+ *
+ * This request asks the compositor to start a drag-and-drop
+ * operation on behalf of the client.
+ *
+ * The source argument is the data source that provides the data
+ * for the eventual data transfer. If source is NULL, enter, leave
+ * and motion events are sent only to the client that initiated the
+ * drag and the client is expected to handle the data passing
+ * internally.
+ *
+ * The origin surface is the surface where the drag originates and
+ * the client must have an active implicit grab that matches the
+ * serial.
+ *
+ * The icon surface is an optional (can be NULL) surface that
+ * provides an icon to be moved around with the cursor. Initially,
+ * the top-left corner of the icon surface is placed at the cursor
+ * hotspot, but subsequent wl_surface.attach request can move the
+ * relative position. Attach requests must be confirmed with
+ * wl_surface.commit as usual. The icon surface is given the role
+ * of a drag-and-drop icon. If the icon surface already has another
+ * role, it raises a protocol error.
+ *
+ * The current and pending input regions of the icon wl_surface are
+ * cleared, and wl_surface.set_input_region is ignored until the
+ * wl_surface is no longer used as the icon surface. When the use
+ * as an icon ends, the current and pending input regions become
+ * undefined, and the wl_surface is unmapped.
+ * @param source data source for the eventual transfer
+ * @param origin surface where the drag originates
+ * @param icon drag-and-drop icon surface
+ * @param serial serial number of the implicit grab on the origin
+ */
+ void (*start_drag)(struct wl_client *client,
+ struct wl_resource *resource,
+ struct wl_resource *source,
+ struct wl_resource *origin,
+ struct wl_resource *icon,
+ uint32_t serial);
+ /**
+ * copy data to the selection
+ *
+ * This request asks the compositor to set the selection to the
+ * data from the source on behalf of the client.
+ *
+ * To unset the selection, set the source to NULL.
+ * @param source data source for the selection
+ * @param serial serial number of the event that triggered this request
+ */
+ void (*set_selection)(struct wl_client *client,
+ struct wl_resource *resource,
+ struct wl_resource *source,
+ uint32_t serial);
+ /**
+ * destroy data device
+ *
+ * This request destroys the data device.
+ * @since 2
+ */
+ void (*release)(struct wl_client *client,
+ struct wl_resource *resource);
+};
+
+#define WL_DATA_DEVICE_DATA_OFFER 0
+#define WL_DATA_DEVICE_ENTER 1
+#define WL_DATA_DEVICE_LEAVE 2
+#define WL_DATA_DEVICE_MOTION 3
+#define WL_DATA_DEVICE_DROP 4
+#define WL_DATA_DEVICE_SELECTION 5
+
+/**
+ * @ingroup iface_wl_data_device
+ */
+#define WL_DATA_DEVICE_DATA_OFFER_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_data_device
+ */
+#define WL_DATA_DEVICE_ENTER_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_data_device
+ */
+#define WL_DATA_DEVICE_LEAVE_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_data_device
+ */
+#define WL_DATA_DEVICE_MOTION_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_data_device
+ */
+#define WL_DATA_DEVICE_DROP_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_data_device
+ */
+#define WL_DATA_DEVICE_SELECTION_SINCE_VERSION 1
+
+/**
+ * @ingroup iface_wl_data_device
+ */
+#define WL_DATA_DEVICE_START_DRAG_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_data_device
+ */
+#define WL_DATA_DEVICE_SET_SELECTION_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_data_device
+ */
+#define WL_DATA_DEVICE_RELEASE_SINCE_VERSION 2
+
+/**
+ * @ingroup iface_wl_data_device
+ * Sends an data_offer event to the client owning the resource.
+ * @param resource_ The client's resource
+ * @param id the new data_offer object
+ */
+static inline void
+wl_data_device_send_data_offer(struct wl_resource *resource_, struct wl_resource *id)
+{
+ wl_resource_post_event(resource_, WL_DATA_DEVICE_DATA_OFFER, id);
+}
+
+/**
+ * @ingroup iface_wl_data_device
+ * Sends an enter event to the client owning the resource.
+ * @param resource_ The client's resource
+ * @param serial serial number of the enter event
+ * @param surface client surface entered
+ * @param x surface-local x coordinate
+ * @param y surface-local y coordinate
+ * @param id source data_offer object
+ */
+static inline void
+wl_data_device_send_enter(struct wl_resource *resource_, uint32_t serial, struct wl_resource *surface, wl_fixed_t x, wl_fixed_t y, struct wl_resource *id)
+{
+ wl_resource_post_event(resource_, WL_DATA_DEVICE_ENTER, serial, surface, x, y, id);
+}
+
+/**
+ * @ingroup iface_wl_data_device
+ * Sends an leave event to the client owning the resource.
+ * @param resource_ The client's resource
+ */
+static inline void
+wl_data_device_send_leave(struct wl_resource *resource_)
+{
+ wl_resource_post_event(resource_, WL_DATA_DEVICE_LEAVE);
+}
+
+/**
+ * @ingroup iface_wl_data_device
+ * Sends an motion event to the client owning the resource.
+ * @param resource_ The client's resource
+ * @param time timestamp with millisecond granularity
+ * @param x surface-local x coordinate
+ * @param y surface-local y coordinate
+ */
+static inline void
+wl_data_device_send_motion(struct wl_resource *resource_, uint32_t time, wl_fixed_t x, wl_fixed_t y)
+{
+ wl_resource_post_event(resource_, WL_DATA_DEVICE_MOTION, time, x, y);
+}
+
+/**
+ * @ingroup iface_wl_data_device
+ * Sends an drop event to the client owning the resource.
+ * @param resource_ The client's resource
+ */
+static inline void
+wl_data_device_send_drop(struct wl_resource *resource_)
+{
+ wl_resource_post_event(resource_, WL_DATA_DEVICE_DROP);
+}
+
+/**
+ * @ingroup iface_wl_data_device
+ * Sends an selection event to the client owning the resource.
+ * @param resource_ The client's resource
+ * @param id selection data_offer object
+ */
+static inline void
+wl_data_device_send_selection(struct wl_resource *resource_, struct wl_resource *id)
+{
+ wl_resource_post_event(resource_, WL_DATA_DEVICE_SELECTION, id);
+}
+
+#ifndef WL_DATA_DEVICE_MANAGER_DND_ACTION_ENUM
+#define WL_DATA_DEVICE_MANAGER_DND_ACTION_ENUM
+/**
+ * @ingroup iface_wl_data_device_manager
+ * drag and drop actions
+ *
+ * This is a bitmask of the available/preferred actions in a
+ * drag-and-drop operation.
+ *
+ * In the compositor, the selected action is a result of matching the
+ * actions offered by the source and destination sides. "action" events
+ * with a "none" action will be sent to both source and destination if
+ * there is no match. All further checks will effectively happen on
+ * (source actions ∩ destination actions).
+ *
+ * In addition, compositors may also pick different actions in
+ * reaction to key modifiers being pressed. One common design that
+ * is used in major toolkits (and the behavior recommended for
+ * compositors) is:
+ *
+ * - If no modifiers are pressed, the first match (in bit order)
+ * will be used.
+ * - Pressing Shift selects "move", if enabled in the mask.
+ * - Pressing Control selects "copy", if enabled in the mask.
+ *
+ * Behavior beyond that is considered implementation-dependent.
+ * Compositors may for example bind other modifiers (like Alt/Meta)
+ * or drags initiated with other buttons than BTN_LEFT to specific
+ * actions (e.g. "ask").
+ */
+enum wl_data_device_manager_dnd_action {
+ /**
+ * no action
+ */
+ WL_DATA_DEVICE_MANAGER_DND_ACTION_NONE = 0,
+ /**
+ * copy action
+ */
+ WL_DATA_DEVICE_MANAGER_DND_ACTION_COPY = 1,
+ /**
+ * move action
+ */
+ WL_DATA_DEVICE_MANAGER_DND_ACTION_MOVE = 2,
+ /**
+ * ask action
+ */
+ WL_DATA_DEVICE_MANAGER_DND_ACTION_ASK = 4,
+};
+#endif /* WL_DATA_DEVICE_MANAGER_DND_ACTION_ENUM */
+
+/**
+ * @ingroup iface_wl_data_device_manager
+ * @struct wl_data_device_manager_interface
+ */
+struct wl_data_device_manager_interface {
+ /**
+ * create a new data source
+ *
+ * Create a new data source.
+ * @param id data source to create
+ */
+ void (*create_data_source)(struct wl_client *client,
+ struct wl_resource *resource,
+ uint32_t id);
+ /**
+ * create a new data device
+ *
+ * Create a new data device for a given seat.
+ * @param id data device to create
+ * @param seat seat associated with the data device
+ */
+ void (*get_data_device)(struct wl_client *client,
+ struct wl_resource *resource,
+ uint32_t id,
+ struct wl_resource *seat);
+};
+
+
+/**
+ * @ingroup iface_wl_data_device_manager
+ */
+#define WL_DATA_DEVICE_MANAGER_CREATE_DATA_SOURCE_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_data_device_manager
+ */
+#define WL_DATA_DEVICE_MANAGER_GET_DATA_DEVICE_SINCE_VERSION 1
+
+#ifndef WL_SHELL_ERROR_ENUM
+#define WL_SHELL_ERROR_ENUM
+enum wl_shell_error {
+ /**
+ * given wl_surface has another role
+ */
+ WL_SHELL_ERROR_ROLE = 0,
+};
+#endif /* WL_SHELL_ERROR_ENUM */
+
+/**
+ * @ingroup iface_wl_shell
+ * @struct wl_shell_interface
+ */
+struct wl_shell_interface {
+ /**
+ * create a shell surface from a surface
+ *
+ * Create a shell surface for an existing surface. This gives the
+ * wl_surface the role of a shell surface. If the wl_surface
+ * already has another role, it raises a protocol error.
+ *
+ * Only one shell surface can be associated with a given surface.
+ * @param id shell surface to create
+ * @param surface surface to be given the shell surface role
+ */
+ void (*get_shell_surface)(struct wl_client *client,
+ struct wl_resource *resource,
+ uint32_t id,
+ struct wl_resource *surface);
+};
+
+
+/**
+ * @ingroup iface_wl_shell
+ */
+#define WL_SHELL_GET_SHELL_SURFACE_SINCE_VERSION 1
+
+#ifndef WL_SHELL_SURFACE_RESIZE_ENUM
+#define WL_SHELL_SURFACE_RESIZE_ENUM
+/**
+ * @ingroup iface_wl_shell_surface
+ * edge values for resizing
+ *
+ * These values are used to indicate which edge of a surface
+ * is being dragged in a resize operation. The server may
+ * use this information to adapt its behavior, e.g. choose
+ * an appropriate cursor image.
+ */
+enum wl_shell_surface_resize {
+ /**
+ * no edge
+ */
+ WL_SHELL_SURFACE_RESIZE_NONE = 0,
+ /**
+ * top edge
+ */
+ WL_SHELL_SURFACE_RESIZE_TOP = 1,
+ /**
+ * bottom edge
+ */
+ WL_SHELL_SURFACE_RESIZE_BOTTOM = 2,
+ /**
+ * left edge
+ */
+ WL_SHELL_SURFACE_RESIZE_LEFT = 4,
+ /**
+ * top and left edges
+ */
+ WL_SHELL_SURFACE_RESIZE_TOP_LEFT = 5,
+ /**
+ * bottom and left edges
+ */
+ WL_SHELL_SURFACE_RESIZE_BOTTOM_LEFT = 6,
+ /**
+ * right edge
+ */
+ WL_SHELL_SURFACE_RESIZE_RIGHT = 8,
+ /**
+ * top and right edges
+ */
+ WL_SHELL_SURFACE_RESIZE_TOP_RIGHT = 9,
+ /**
+ * bottom and right edges
+ */
+ WL_SHELL_SURFACE_RESIZE_BOTTOM_RIGHT = 10,
+};
+#endif /* WL_SHELL_SURFACE_RESIZE_ENUM */
+
+#ifndef WL_SHELL_SURFACE_TRANSIENT_ENUM
+#define WL_SHELL_SURFACE_TRANSIENT_ENUM
+/**
+ * @ingroup iface_wl_shell_surface
+ * details of transient behaviour
+ *
+ * These flags specify details of the expected behaviour
+ * of transient surfaces. Used in the set_transient request.
+ */
+enum wl_shell_surface_transient {
+ /**
+ * do not set keyboard focus
+ */
+ WL_SHELL_SURFACE_TRANSIENT_INACTIVE = 0x1,
+};
+#endif /* WL_SHELL_SURFACE_TRANSIENT_ENUM */
+
+#ifndef WL_SHELL_SURFACE_FULLSCREEN_METHOD_ENUM
+#define WL_SHELL_SURFACE_FULLSCREEN_METHOD_ENUM
+/**
+ * @ingroup iface_wl_shell_surface
+ * different method to set the surface fullscreen
+ *
+ * Hints to indicate to the compositor how to deal with a conflict
+ * between the dimensions of the surface and the dimensions of the
+ * output. The compositor is free to ignore this parameter.
+ */
+enum wl_shell_surface_fullscreen_method {
+ /**
+ * no preference, apply default policy
+ */
+ WL_SHELL_SURFACE_FULLSCREEN_METHOD_DEFAULT = 0,
+ /**
+ * scale, preserve the surface's aspect ratio and center on output
+ */
+ WL_SHELL_SURFACE_FULLSCREEN_METHOD_SCALE = 1,
+ /**
+ * switch output mode to the smallest mode that can fit the surface, add black borders to compensate size mismatch
+ */
+ WL_SHELL_SURFACE_FULLSCREEN_METHOD_DRIVER = 2,
+ /**
+ * no upscaling, center on output and add black borders to compensate size mismatch
+ */
+ WL_SHELL_SURFACE_FULLSCREEN_METHOD_FILL = 3,
+};
+#endif /* WL_SHELL_SURFACE_FULLSCREEN_METHOD_ENUM */
+
+/**
+ * @ingroup iface_wl_shell_surface
+ * @struct wl_shell_surface_interface
+ */
+struct wl_shell_surface_interface {
+ /**
+ * respond to a ping event
+ *
+ * A client must respond to a ping event with a pong request or
+ * the client may be deemed unresponsive.
+ * @param serial serial number of the ping event
+ */
+ void (*pong)(struct wl_client *client,
+ struct wl_resource *resource,
+ uint32_t serial);
+ /**
+ * start an interactive move
+ *
+ * Start a pointer-driven move of the surface.
+ *
+ * This request must be used in response to a button press event.
+ * The server may ignore move requests depending on the state of
+ * the surface (e.g. fullscreen or maximized).
+ * @param seat seat whose pointer is used
+ * @param serial serial number of the implicit grab on the pointer
+ */
+ void (*move)(struct wl_client *client,
+ struct wl_resource *resource,
+ struct wl_resource *seat,
+ uint32_t serial);
+ /**
+ * start an interactive resize
+ *
+ * Start a pointer-driven resizing of the surface.
+ *
+ * This request must be used in response to a button press event.
+ * The server may ignore resize requests depending on the state of
+ * the surface (e.g. fullscreen or maximized).
+ * @param seat seat whose pointer is used
+ * @param serial serial number of the implicit grab on the pointer
+ * @param edges which edge or corner is being dragged
+ */
+ void (*resize)(struct wl_client *client,
+ struct wl_resource *resource,
+ struct wl_resource *seat,
+ uint32_t serial,
+ uint32_t edges);
+ /**
+ * make the surface a toplevel surface
+ *
+ * Map the surface as a toplevel surface.
+ *
+ * A toplevel surface is not fullscreen, maximized or transient.
+ */
+ void (*set_toplevel)(struct wl_client *client,
+ struct wl_resource *resource);
+ /**
+ * make the surface a transient surface
+ *
+ * Map the surface relative to an existing surface.
+ *
+ * The x and y arguments specify the location of the upper left
+ * corner of the surface relative to the upper left corner of the
+ * parent surface, in surface-local coordinates.
+ *
+ * The flags argument controls details of the transient behaviour.
+ * @param parent parent surface
+ * @param x surface-local x coordinate
+ * @param y surface-local y coordinate
+ * @param flags transient surface behavior
+ */
+ void (*set_transient)(struct wl_client *client,
+ struct wl_resource *resource,
+ struct wl_resource *parent,
+ int32_t x,
+ int32_t y,
+ uint32_t flags);
+ /**
+ * make the surface a fullscreen surface
+ *
+ * Map the surface as a fullscreen surface.
+ *
+ * If an output parameter is given then the surface will be made
+ * fullscreen on that output. If the client does not specify the
+ * output then the compositor will apply its policy - usually
+ * choosing the output on which the surface has the biggest surface
+ * area.
+ *
+ * The client may specify a method to resolve a size conflict
+ * between the output size and the surface size - this is provided
+ * through the method parameter.
+ *
+ * The framerate parameter is used only when the method is set to
+ * "driver", to indicate the preferred framerate. A value of 0
+ * indicates that the client does not care about framerate. The
+ * framerate is specified in mHz, that is framerate of 60000 is
+ * 60Hz.
+ *
+ * A method of "scale" or "driver" implies a scaling operation of
+ * the surface, either via a direct scaling operation or a change
+ * of the output mode. This will override any kind of output
+ * scaling, so that mapping a surface with a buffer size equal to
+ * the mode can fill the screen independent of buffer_scale.
+ *
+ * A method of "fill" means we don't scale up the buffer, however
+ * any output scale is applied. This means that you may run into an
+ * edge case where the application maps a buffer with the same size
+ * of the output mode but buffer_scale 1 (thus making a surface
+ * larger than the output). In this case it is allowed to downscale
+ * the results to fit the screen.
+ *
+ * The compositor must reply to this request with a configure event
+ * with the dimensions for the output on which the surface will be
+ * made fullscreen.
+ * @param method method for resolving size conflict
+ * @param framerate framerate in mHz
+ * @param output output on which the surface is to be fullscreen
+ */
+ void (*set_fullscreen)(struct wl_client *client,
+ struct wl_resource *resource,
+ uint32_t method,
+ uint32_t framerate,
+ struct wl_resource *output);
+ /**
+ * make the surface a popup surface
+ *
+ * Map the surface as a popup.
+ *
+ * A popup surface is a transient surface with an added pointer
+ * grab.
+ *
+ * An existing implicit grab will be changed to owner-events mode,
+ * and the popup grab will continue after the implicit grab ends
+ * (i.e. releasing the mouse button does not cause the popup to be
+ * unmapped).
+ *
+ * The popup grab continues until the window is destroyed or a
+ * mouse button is pressed in any other client's window. A click in
+ * any of the client's surfaces is reported as normal, however,
+ * clicks in other clients' surfaces will be discarded and trigger
+ * the callback.
+ *
+ * The x and y arguments specify the location of the upper left
+ * corner of the surface relative to the upper left corner of the
+ * parent surface, in surface-local coordinates.
+ * @param seat seat whose pointer is used
+ * @param serial serial number of the implicit grab on the pointer
+ * @param parent parent surface
+ * @param x surface-local x coordinate
+ * @param y surface-local y coordinate
+ * @param flags transient surface behavior
+ */
+ void (*set_popup)(struct wl_client *client,
+ struct wl_resource *resource,
+ struct wl_resource *seat,
+ uint32_t serial,
+ struct wl_resource *parent,
+ int32_t x,
+ int32_t y,
+ uint32_t flags);
+ /**
+ * make the surface a maximized surface
+ *
+ * Map the surface as a maximized surface.
+ *
+ * If an output parameter is given then the surface will be
+ * maximized on that output. If the client does not specify the
+ * output then the compositor will apply its policy - usually
+ * choosing the output on which the surface has the biggest surface
+ * area.
+ *
+ * The compositor will reply with a configure event telling the
+ * expected new surface size. The operation is completed on the
+ * next buffer attach to this surface.
+ *
+ * A maximized surface typically fills the entire output it is
+ * bound to, except for desktop elements such as panels. This is
+ * the main difference between a maximized shell surface and a
+ * fullscreen shell surface.
+ *
+ * The details depend on the compositor implementation.
+ * @param output output on which the surface is to be maximized
+ */
+ void (*set_maximized)(struct wl_client *client,
+ struct wl_resource *resource,
+ struct wl_resource *output);
+ /**
+ * set surface title
+ *
+ * Set a short title for the surface.
+ *
+ * This string may be used to identify the surface in a task bar,
+ * window list, or other user interface elements provided by the
+ * compositor.
+ *
+ * The string must be encoded in UTF-8.
+ * @param title surface title
+ */
+ void (*set_title)(struct wl_client *client,
+ struct wl_resource *resource,
+ const char *title);
+ /**
+ * set surface class
+ *
+ * Set a class for the surface.
+ *
+ * The surface class identifies the general class of applications
+ * to which the surface belongs. A common convention is to use the
+ * file name (or the full path if it is a non-standard location) of
+ * the application's .desktop file as the class.
+ * @param class_ surface class
+ */
+ void (*set_class)(struct wl_client *client,
+ struct wl_resource *resource,
+ const char *class_);
+};
+
+#define WL_SHELL_SURFACE_PING 0
+#define WL_SHELL_SURFACE_CONFIGURE 1
+#define WL_SHELL_SURFACE_POPUP_DONE 2
+
+/**
+ * @ingroup iface_wl_shell_surface
+ */
+#define WL_SHELL_SURFACE_PING_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_shell_surface
+ */
+#define WL_SHELL_SURFACE_CONFIGURE_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_shell_surface
+ */
+#define WL_SHELL_SURFACE_POPUP_DONE_SINCE_VERSION 1
+
+/**
+ * @ingroup iface_wl_shell_surface
+ */
+#define WL_SHELL_SURFACE_PONG_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_shell_surface
+ */
+#define WL_SHELL_SURFACE_MOVE_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_shell_surface
+ */
+#define WL_SHELL_SURFACE_RESIZE_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_shell_surface
+ */
+#define WL_SHELL_SURFACE_SET_TOPLEVEL_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_shell_surface
+ */
+#define WL_SHELL_SURFACE_SET_TRANSIENT_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_shell_surface
+ */
+#define WL_SHELL_SURFACE_SET_FULLSCREEN_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_shell_surface
+ */
+#define WL_SHELL_SURFACE_SET_POPUP_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_shell_surface
+ */
+#define WL_SHELL_SURFACE_SET_MAXIMIZED_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_shell_surface
+ */
+#define WL_SHELL_SURFACE_SET_TITLE_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_shell_surface
+ */
+#define WL_SHELL_SURFACE_SET_CLASS_SINCE_VERSION 1
+
+/**
+ * @ingroup iface_wl_shell_surface
+ * Sends an ping event to the client owning the resource.
+ * @param resource_ The client's resource
+ * @param serial serial number of the ping
+ */
+static inline void
+wl_shell_surface_send_ping(struct wl_resource *resource_, uint32_t serial)
+{
+ wl_resource_post_event(resource_, WL_SHELL_SURFACE_PING, serial);
+}
+
+/**
+ * @ingroup iface_wl_shell_surface
+ * Sends an configure event to the client owning the resource.
+ * @param resource_ The client's resource
+ * @param edges how the surface was resized
+ * @param width new width of the surface
+ * @param height new height of the surface
+ */
+static inline void
+wl_shell_surface_send_configure(struct wl_resource *resource_, uint32_t edges, int32_t width, int32_t height)
+{
+ wl_resource_post_event(resource_, WL_SHELL_SURFACE_CONFIGURE, edges, width, height);
+}
+
+/**
+ * @ingroup iface_wl_shell_surface
+ * Sends an popup_done event to the client owning the resource.
+ * @param resource_ The client's resource
+ */
+static inline void
+wl_shell_surface_send_popup_done(struct wl_resource *resource_)
+{
+ wl_resource_post_event(resource_, WL_SHELL_SURFACE_POPUP_DONE);
+}
+
+#ifndef WL_SURFACE_ERROR_ENUM
+#define WL_SURFACE_ERROR_ENUM
+/**
+ * @ingroup iface_wl_surface
+ * wl_surface error values
+ *
+ * These errors can be emitted in response to wl_surface requests.
+ */
+enum wl_surface_error {
+ /**
+ * buffer scale value is invalid
+ */
+ WL_SURFACE_ERROR_INVALID_SCALE = 0,
+ /**
+ * buffer transform value is invalid
+ */
+ WL_SURFACE_ERROR_INVALID_TRANSFORM = 1,
+};
+#endif /* WL_SURFACE_ERROR_ENUM */
+
+/**
+ * @ingroup iface_wl_surface
+ * @struct wl_surface_interface
+ */
+struct wl_surface_interface {
+ /**
+ * delete surface
+ *
+ * Deletes the surface and invalidates its object ID.
+ */
+ void (*destroy)(struct wl_client *client,
+ struct wl_resource *resource);
+ /**
+ * set the surface contents
+ *
+ * Set a buffer as the content of this surface.
+ *
+ * The new size of the surface is calculated based on the buffer
+ * size transformed by the inverse buffer_transform and the inverse
+ * buffer_scale. This means that the supplied buffer must be an
+ * integer multiple of the buffer_scale.
+ *
+ * The x and y arguments specify the location of the new pending
+ * buffer's upper left corner, relative to the current buffer's
+ * upper left corner, in surface-local coordinates. In other words,
+ * the x and y, combined with the new surface size define in which
+ * directions the surface's size changes.
+ *
+ * Surface contents are double-buffered state, see
+ * wl_surface.commit.
+ *
+ * The initial surface contents are void; there is no content.
+ * wl_surface.attach assigns the given wl_buffer as the pending
+ * wl_buffer. wl_surface.commit makes the pending wl_buffer the new
+ * surface contents, and the size of the surface becomes the size
+ * calculated from the wl_buffer, as described above. After commit,
+ * there is no pending buffer until the next attach.
+ *
+ * Committing a pending wl_buffer allows the compositor to read the
+ * pixels in the wl_buffer. The compositor may access the pixels at
+ * any time after the wl_surface.commit request. When the
+ * compositor will not access the pixels anymore, it will send the
+ * wl_buffer.release event. Only after receiving wl_buffer.release,
+ * the client may reuse the wl_buffer. A wl_buffer that has been
+ * attached and then replaced by another attach instead of
+ * committed will not receive a release event, and is not used by
+ * the compositor.
+ *
+ * Destroying the wl_buffer after wl_buffer.release does not change
+ * the surface contents. However, if the client destroys the
+ * wl_buffer before receiving the wl_buffer.release event, the
+ * surface contents become undefined immediately.
+ *
+ * If wl_surface.attach is sent with a NULL wl_buffer, the
+ * following wl_surface.commit will remove the surface content.
+ * @param buffer buffer of surface contents
+ * @param x surface-local x coordinate
+ * @param y surface-local y coordinate
+ */
+ void (*attach)(struct wl_client *client,
+ struct wl_resource *resource,
+ struct wl_resource *buffer,
+ int32_t x,
+ int32_t y);
+ /**
+ * mark part of the surface damaged
+ *
+ * This request is used to describe the regions where the pending
+ * buffer is different from the current surface contents, and where
+ * the surface therefore needs to be repainted. The compositor
+ * ignores the parts of the damage that fall outside of the
+ * surface.
+ *
+ * Damage is double-buffered state, see wl_surface.commit.
+ *
+ * The damage rectangle is specified in surface-local coordinates,
+ * where x and y specify the upper left corner of the damage
+ * rectangle.
+ *
+ * The initial value for pending damage is empty: no damage.
+ * wl_surface.damage adds pending damage: the new pending damage is
+ * the union of old pending damage and the given rectangle.
+ *
+ * wl_surface.commit assigns pending damage as the current damage,
+ * and clears pending damage. The server will clear the current
+ * damage as it repaints the surface.
+ *
+ * Alternatively, damage can be posted with
+ * wl_surface.damage_buffer which uses buffer coordinates instead
+ * of surface coordinates, and is probably the preferred and
+ * intuitive way of doing this.
+ * @param x surface-local x coordinate
+ * @param y surface-local y coordinate
+ * @param width width of damage rectangle
+ * @param height height of damage rectangle
+ */
+ void (*damage)(struct wl_client *client,
+ struct wl_resource *resource,
+ int32_t x,
+ int32_t y,
+ int32_t width,
+ int32_t height);
+ /**
+ * request a frame throttling hint
+ *
+ * Request a notification when it is a good time to start drawing
+ * a new frame, by creating a frame callback. This is useful for
+ * throttling redrawing operations, and driving animations.
+ *
+ * When a client is animating on a wl_surface, it can use the
+ * 'frame' request to get notified when it is a good time to draw
+ * and commit the next frame of animation. If the client commits an
+ * update earlier than that, it is likely that some updates will
+ * not make it to the display, and the client is wasting resources
+ * by drawing too often.
+ *
+ * The frame request will take effect on the next
+ * wl_surface.commit. The notification will only be posted for one
+ * frame unless requested again. For a wl_surface, the
+ * notifications are posted in the order the frame requests were
+ * committed.
+ *
+ * The server must send the notifications so that a client will not
+ * send excessive updates, while still allowing the highest
+ * possible update rate for clients that wait for the reply before
+ * drawing again. The server should give some time for the client
+ * to draw and commit after sending the frame callback events to
+ * let it hit the next output refresh.
+ *
+ * A server should avoid signaling the frame callbacks if the
+ * surface is not visible in any way, e.g. the surface is
+ * off-screen, or completely obscured by other opaque surfaces.
+ *
+ * The object returned by this request will be destroyed by the
+ * compositor after the callback is fired and as such the client
+ * must not attempt to use it after that point.
+ *
+ * The callback_data passed in the callback is the current time, in
+ * milliseconds, with an undefined base.
+ * @param callback callback object for the frame request
+ */
+ void (*frame)(struct wl_client *client,
+ struct wl_resource *resource,
+ uint32_t callback);
+ /**
+ * set opaque region
+ *
+ * This request sets the region of the surface that contains
+ * opaque content.
+ *
+ * The opaque region is an optimization hint for the compositor
+ * that lets it optimize the redrawing of content behind opaque
+ * regions. Setting an opaque region is not required for correct
+ * behaviour, but marking transparent content as opaque will result
+ * in repaint artifacts.
+ *
+ * The opaque region is specified in surface-local coordinates.
+ *
+ * The compositor ignores the parts of the opaque region that fall
+ * outside of the surface.
+ *
+ * Opaque region is double-buffered state, see wl_surface.commit.
+ *
+ * wl_surface.set_opaque_region changes the pending opaque region.
+ * wl_surface.commit copies the pending region to the current
+ * region. Otherwise, the pending and current regions are never
+ * changed.
+ *
+ * The initial value for an opaque region is empty. Setting the
+ * pending opaque region has copy semantics, and the wl_region
+ * object can be destroyed immediately. A NULL wl_region causes the
+ * pending opaque region to be set to empty.
+ * @param region opaque region of the surface
+ */
+ void (*set_opaque_region)(struct wl_client *client,
+ struct wl_resource *resource,
+ struct wl_resource *region);
+ /**
+ * set input region
+ *
+ * This request sets the region of the surface that can receive
+ * pointer and touch events.
+ *
+ * Input events happening outside of this region will try the next
+ * surface in the server surface stack. The compositor ignores the
+ * parts of the input region that fall outside of the surface.
+ *
+ * The input region is specified in surface-local coordinates.
+ *
+ * Input region is double-buffered state, see wl_surface.commit.
+ *
+ * wl_surface.set_input_region changes the pending input region.
+ * wl_surface.commit copies the pending region to the current
+ * region. Otherwise the pending and current regions are never
+ * changed, except cursor and icon surfaces are special cases, see
+ * wl_pointer.set_cursor and wl_data_device.start_drag.
+ *
+ * The initial value for an input region is infinite. That means
+ * the whole surface will accept input. Setting the pending input
+ * region has copy semantics, and the wl_region object can be
+ * destroyed immediately. A NULL wl_region causes the input region
+ * to be set to infinite.
+ * @param region input region of the surface
+ */
+ void (*set_input_region)(struct wl_client *client,
+ struct wl_resource *resource,
+ struct wl_resource *region);
+ /**
+ * commit pending surface state
+ *
+ * Surface state (input, opaque, and damage regions, attached
+ * buffers, etc.) is double-buffered. Protocol requests modify the
+ * pending state, as opposed to the current state in use by the
+ * compositor. A commit request atomically applies all pending
+ * state, replacing the current state. After commit, the new
+ * pending state is as documented for each related request.
+ *
+ * On commit, a pending wl_buffer is applied first, and all other
+ * state second. This means that all coordinates in double-buffered
+ * state are relative to the new wl_buffer coming into use, except
+ * for wl_surface.attach itself. If there is no pending wl_buffer,
+ * the coordinates are relative to the current surface contents.
+ *
+ * All requests that need a commit to become effective are
+ * documented to affect double-buffered state.
+ *
+ * Other interfaces may add further double-buffered surface state.
+ */
+ void (*commit)(struct wl_client *client,
+ struct wl_resource *resource);
+ /**
+ * sets the buffer transformation
+ *
+ * This request sets an optional transformation on how the
+ * compositor interprets the contents of the buffer attached to the
+ * surface. The accepted values for the transform parameter are the
+ * values for wl_output.transform.
+ *
+ * Buffer transform is double-buffered state, see
+ * wl_surface.commit.
+ *
+ * A newly created surface has its buffer transformation set to
+ * normal.
+ *
+ * wl_surface.set_buffer_transform changes the pending buffer
+ * transformation. wl_surface.commit copies the pending buffer
+ * transformation to the current one. Otherwise, the pending and
+ * current values are never changed.
+ *
+ * The purpose of this request is to allow clients to render
+ * content according to the output transform, thus permitting the
+ * compositor to use certain optimizations even if the display is
+ * rotated. Using hardware overlays and scanning out a client
+ * buffer for fullscreen surfaces are examples of such
+ * optimizations. Those optimizations are highly dependent on the
+ * compositor implementation, so the use of this request should be
+ * considered on a case-by-case basis.
+ *
+ * Note that if the transform value includes 90 or 270 degree
+ * rotation, the width of the buffer will become the surface height
+ * and the height of the buffer will become the surface width.
+ *
+ * If transform is not one of the values from the
+ * wl_output.transform enum the invalid_transform protocol error is
+ * raised.
+ * @param transform transform for interpreting buffer contents
+ * @since 2
+ */
+ void (*set_buffer_transform)(struct wl_client *client,
+ struct wl_resource *resource,
+ int32_t transform);
+ /**
+ * sets the buffer scaling factor
+ *
+ * This request sets an optional scaling factor on how the
+ * compositor interprets the contents of the buffer attached to the
+ * window.
+ *
+ * Buffer scale is double-buffered state, see wl_surface.commit.
+ *
+ * A newly created surface has its buffer scale set to 1.
+ *
+ * wl_surface.set_buffer_scale changes the pending buffer scale.
+ * wl_surface.commit copies the pending buffer scale to the current
+ * one. Otherwise, the pending and current values are never
+ * changed.
+ *
+ * The purpose of this request is to allow clients to supply higher
+ * resolution buffer data for use on high resolution outputs. It is
+ * intended that you pick the same buffer scale as the scale of the
+ * output that the surface is displayed on. This means the
+ * compositor can avoid scaling when rendering the surface on that
+ * output.
+ *
+ * Note that if the scale is larger than 1, then you have to attach
+ * a buffer that is larger (by a factor of scale in each dimension)
+ * than the desired surface size.
+ *
+ * If scale is not positive the invalid_scale protocol error is
+ * raised.
+ * @param scale positive scale for interpreting buffer contents
+ * @since 3
+ */
+ void (*set_buffer_scale)(struct wl_client *client,
+ struct wl_resource *resource,
+ int32_t scale);
+ /**
+ * mark part of the surface damaged using buffer coordinates
+ *
+ * This request is used to describe the regions where the pending
+ * buffer is different from the current surface contents, and where
+ * the surface therefore needs to be repainted. The compositor
+ * ignores the parts of the damage that fall outside of the
+ * surface.
+ *
+ * Damage is double-buffered state, see wl_surface.commit.
+ *
+ * The damage rectangle is specified in buffer coordinates, where x
+ * and y specify the upper left corner of the damage rectangle.
+ *
+ * The initial value for pending damage is empty: no damage.
+ * wl_surface.damage_buffer adds pending damage: the new pending
+ * damage is the union of old pending damage and the given
+ * rectangle.
+ *
+ * wl_surface.commit assigns pending damage as the current damage,
+ * and clears pending damage. The server will clear the current
+ * damage as it repaints the surface.
+ *
+ * This request differs from wl_surface.damage in only one way - it
+ * takes damage in buffer coordinates instead of surface-local
+ * coordinates. While this generally is more intuitive than surface
+ * coordinates, it is especially desirable when using wp_viewport
+ * or when a drawing library (like EGL) is unaware of buffer scale
+ * and buffer transform.
+ *
+ * Note: Because buffer transformation changes and damage requests
+ * may be interleaved in the protocol stream, it is impossible to
+ * determine the actual mapping between surface and buffer damage
+ * until wl_surface.commit time. Therefore, compositors wishing to
+ * take both kinds of damage into account will have to accumulate
+ * damage from the two requests separately and only transform from
+ * one to the other after receiving the wl_surface.commit.
+ * @param x buffer-local x coordinate
+ * @param y buffer-local y coordinate
+ * @param width width of damage rectangle
+ * @param height height of damage rectangle
+ * @since 4
+ */
+ void (*damage_buffer)(struct wl_client *client,
+ struct wl_resource *resource,
+ int32_t x,
+ int32_t y,
+ int32_t width,
+ int32_t height);
+};
+
+#define WL_SURFACE_ENTER 0
+#define WL_SURFACE_LEAVE 1
+
+/**
+ * @ingroup iface_wl_surface
+ */
+#define WL_SURFACE_ENTER_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_surface
+ */
+#define WL_SURFACE_LEAVE_SINCE_VERSION 1
+
+/**
+ * @ingroup iface_wl_surface
+ */
+#define WL_SURFACE_DESTROY_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_surface
+ */
+#define WL_SURFACE_ATTACH_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_surface
+ */
+#define WL_SURFACE_DAMAGE_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_surface
+ */
+#define WL_SURFACE_FRAME_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_surface
+ */
+#define WL_SURFACE_SET_OPAQUE_REGION_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_surface
+ */
+#define WL_SURFACE_SET_INPUT_REGION_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_surface
+ */
+#define WL_SURFACE_COMMIT_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_surface
+ */
+#define WL_SURFACE_SET_BUFFER_TRANSFORM_SINCE_VERSION 2
+/**
+ * @ingroup iface_wl_surface
+ */
+#define WL_SURFACE_SET_BUFFER_SCALE_SINCE_VERSION 3
+/**
+ * @ingroup iface_wl_surface
+ */
+#define WL_SURFACE_DAMAGE_BUFFER_SINCE_VERSION 4
+
+/**
+ * @ingroup iface_wl_surface
+ * Sends an enter event to the client owning the resource.
+ * @param resource_ The client's resource
+ * @param output output entered by the surface
+ */
+static inline void
+wl_surface_send_enter(struct wl_resource *resource_, struct wl_resource *output)
+{
+ wl_resource_post_event(resource_, WL_SURFACE_ENTER, output);
+}
+
+/**
+ * @ingroup iface_wl_surface
+ * Sends an leave event to the client owning the resource.
+ * @param resource_ The client's resource
+ * @param output output left by the surface
+ */
+static inline void
+wl_surface_send_leave(struct wl_resource *resource_, struct wl_resource *output)
+{
+ wl_resource_post_event(resource_, WL_SURFACE_LEAVE, output);
+}
+
+#ifndef WL_SEAT_CAPABILITY_ENUM
+#define WL_SEAT_CAPABILITY_ENUM
+/**
+ * @ingroup iface_wl_seat
+ * seat capability bitmask
+ *
+ * This is a bitmask of capabilities this seat has; if a member is
+ * set, then it is present on the seat.
+ */
+enum wl_seat_capability {
+ /**
+ * the seat has pointer devices
+ */
+ WL_SEAT_CAPABILITY_POINTER = 1,
+ /**
+ * the seat has one or more keyboards
+ */
+ WL_SEAT_CAPABILITY_KEYBOARD = 2,
+ /**
+ * the seat has touch devices
+ */
+ WL_SEAT_CAPABILITY_TOUCH = 4,
+};
+#endif /* WL_SEAT_CAPABILITY_ENUM */
+
+/**
+ * @ingroup iface_wl_seat
+ * @struct wl_seat_interface
+ */
+struct wl_seat_interface {
+ /**
+ * return pointer object
+ *
+ * The ID provided will be initialized to the wl_pointer
+ * interface for this seat.
+ *
+ * This request only takes effect if the seat has the pointer
+ * capability, or has had the pointer capability in the past. It is
+ * a protocol violation to issue this request on a seat that has
+ * never had the pointer capability.
+ * @param id seat pointer
+ */
+ void (*get_pointer)(struct wl_client *client,
+ struct wl_resource *resource,
+ uint32_t id);
+ /**
+ * return keyboard object
+ *
+ * The ID provided will be initialized to the wl_keyboard
+ * interface for this seat.
+ *
+ * This request only takes effect if the seat has the keyboard
+ * capability, or has had the keyboard capability in the past. It
+ * is a protocol violation to issue this request on a seat that has
+ * never had the keyboard capability.
+ * @param id seat keyboard
+ */
+ void (*get_keyboard)(struct wl_client *client,
+ struct wl_resource *resource,
+ uint32_t id);
+ /**
+ * return touch object
+ *
+ * The ID provided will be initialized to the wl_touch interface
+ * for this seat.
+ *
+ * This request only takes effect if the seat has the touch
+ * capability, or has had the touch capability in the past. It is a
+ * protocol violation to issue this request on a seat that has
+ * never had the touch capability.
+ * @param id seat touch interface
+ */
+ void (*get_touch)(struct wl_client *client,
+ struct wl_resource *resource,
+ uint32_t id);
+ /**
+ * release the seat object
+ *
+ * Using this request a client can tell the server that it is not
+ * going to use the seat object anymore.
+ * @since 5
+ */
+ void (*release)(struct wl_client *client,
+ struct wl_resource *resource);
+};
+
+#define WL_SEAT_CAPABILITIES 0
+#define WL_SEAT_NAME 1
+
+/**
+ * @ingroup iface_wl_seat
+ */
+#define WL_SEAT_CAPABILITIES_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_seat
+ */
+#define WL_SEAT_NAME_SINCE_VERSION 2
+
+/**
+ * @ingroup iface_wl_seat
+ */
+#define WL_SEAT_GET_POINTER_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_seat
+ */
+#define WL_SEAT_GET_KEYBOARD_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_seat
+ */
+#define WL_SEAT_GET_TOUCH_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_seat
+ */
+#define WL_SEAT_RELEASE_SINCE_VERSION 5
+
+/**
+ * @ingroup iface_wl_seat
+ * Sends an capabilities event to the client owning the resource.
+ * @param resource_ The client's resource
+ * @param capabilities capabilities of the seat
+ */
+static inline void
+wl_seat_send_capabilities(struct wl_resource *resource_, uint32_t capabilities)
+{
+ wl_resource_post_event(resource_, WL_SEAT_CAPABILITIES, capabilities);
+}
+
+/**
+ * @ingroup iface_wl_seat
+ * Sends an name event to the client owning the resource.
+ * @param resource_ The client's resource
+ * @param name seat identifier
+ */
+static inline void
+wl_seat_send_name(struct wl_resource *resource_, const char *name)
+{
+ wl_resource_post_event(resource_, WL_SEAT_NAME, name);
+}
+
+#ifndef WL_POINTER_ERROR_ENUM
+#define WL_POINTER_ERROR_ENUM
+enum wl_pointer_error {
+ /**
+ * given wl_surface has another role
+ */
+ WL_POINTER_ERROR_ROLE = 0,
+};
+#endif /* WL_POINTER_ERROR_ENUM */
+
+#ifndef WL_POINTER_BUTTON_STATE_ENUM
+#define WL_POINTER_BUTTON_STATE_ENUM
+/**
+ * @ingroup iface_wl_pointer
+ * physical button state
+ *
+ * Describes the physical state of a button that produced the button
+ * event.
+ */
+enum wl_pointer_button_state {
+ /**
+ * the button is not pressed
+ */
+ WL_POINTER_BUTTON_STATE_RELEASED = 0,
+ /**
+ * the button is pressed
+ */
+ WL_POINTER_BUTTON_STATE_PRESSED = 1,
+};
+#endif /* WL_POINTER_BUTTON_STATE_ENUM */
+
+#ifndef WL_POINTER_AXIS_ENUM
+#define WL_POINTER_AXIS_ENUM
+/**
+ * @ingroup iface_wl_pointer
+ * axis types
+ *
+ * Describes the axis types of scroll events.
+ */
+enum wl_pointer_axis {
+ /**
+ * vertical axis
+ */
+ WL_POINTER_AXIS_VERTICAL_SCROLL = 0,
+ /**
+ * horizontal axis
+ */
+ WL_POINTER_AXIS_HORIZONTAL_SCROLL = 1,
+};
+#endif /* WL_POINTER_AXIS_ENUM */
+
+#ifndef WL_POINTER_AXIS_SOURCE_ENUM
+#define WL_POINTER_AXIS_SOURCE_ENUM
+/**
+ * @ingroup iface_wl_pointer
+ * axis source types
+ *
+ * Describes the source types for axis events. This indicates to the
+ * client how an axis event was physically generated; a client may
+ * adjust the user interface accordingly. For example, scroll events
+ * from a "finger" source may be in a smooth coordinate space with
+ * kinetic scrolling whereas a "wheel" source may be in discrete steps
+ * of a number of lines.
+ *
+ * The "continuous" axis source is a device generating events in a
+ * continuous coordinate space, but using something other than a
+ * finger. One example for this source is button-based scrolling where
+ * the vertical motion of a device is converted to scroll events while
+ * a button is held down.
+ *
+ * The "wheel tilt" axis source indicates that the actual device is a
+ * wheel but the scroll event is not caused by a rotation but a
+ * (usually sideways) tilt of the wheel.
+ */
+enum wl_pointer_axis_source {
+ /**
+ * a physical wheel rotation
+ */
+ WL_POINTER_AXIS_SOURCE_WHEEL = 0,
+ /**
+ * finger on a touch surface
+ */
+ WL_POINTER_AXIS_SOURCE_FINGER = 1,
+ /**
+ * continuous coordinate space
+ */
+ WL_POINTER_AXIS_SOURCE_CONTINUOUS = 2,
+ /**
+ * a physical wheel tilt
+ * @since 6
+ */
+ WL_POINTER_AXIS_SOURCE_WHEEL_TILT = 3,
+};
+/**
+ * @ingroup iface_wl_pointer
+ */
+#define WL_POINTER_AXIS_SOURCE_WHEEL_TILT_SINCE_VERSION 6
+#endif /* WL_POINTER_AXIS_SOURCE_ENUM */
+
+/**
+ * @ingroup iface_wl_pointer
+ * @struct wl_pointer_interface
+ */
+struct wl_pointer_interface {
+ /**
+ * set the pointer surface
+ *
+ * Set the pointer surface, i.e., the surface that contains the
+ * pointer image (cursor). This request gives the surface the role
+ * of a cursor. If the surface already has another role, it raises
+ * a protocol error.
+ *
+ * The cursor actually changes only if the pointer focus for this
+ * device is one of the requesting client's surfaces or the surface
+ * parameter is the current pointer surface. If there was a
+ * previous surface set with this request it is replaced. If
+ * surface is NULL, the pointer image is hidden.
+ *
+ * The parameters hotspot_x and hotspot_y define the position of
+ * the pointer surface relative to the pointer location. Its
+ * top-left corner is always at (x, y) - (hotspot_x, hotspot_y),
+ * where (x, y) are the coordinates of the pointer location, in
+ * surface-local coordinates.
+ *
+ * On surface.attach requests to the pointer surface, hotspot_x and
+ * hotspot_y are decremented by the x and y parameters passed to
+ * the request. Attach must be confirmed by wl_surface.commit as
+ * usual.
+ *
+ * The hotspot can also be updated by passing the currently set
+ * pointer surface to this request with new values for hotspot_x
+ * and hotspot_y.
+ *
+ * The current and pending input regions of the wl_surface are
+ * cleared, and wl_surface.set_input_region is ignored until the
+ * wl_surface is no longer used as the cursor. When the use as a
+ * cursor ends, the current and pending input regions become
+ * undefined, and the wl_surface is unmapped.
+ * @param serial serial number of the enter event
+ * @param surface pointer surface
+ * @param hotspot_x surface-local x coordinate
+ * @param hotspot_y surface-local y coordinate
+ */
+ void (*set_cursor)(struct wl_client *client,
+ struct wl_resource *resource,
+ uint32_t serial,
+ struct wl_resource *surface,
+ int32_t hotspot_x,
+ int32_t hotspot_y);
+ /**
+ * release the pointer object
+ *
+ * Using this request a client can tell the server that it is not
+ * going to use the pointer object anymore.
+ *
+ * This request destroys the pointer proxy object, so clients must
+ * not call wl_pointer_destroy() after using this request.
+ * @since 3
+ */
+ void (*release)(struct wl_client *client,
+ struct wl_resource *resource);
+};
+
+#define WL_POINTER_ENTER 0
+#define WL_POINTER_LEAVE 1
+#define WL_POINTER_MOTION 2
+#define WL_POINTER_BUTTON 3
+#define WL_POINTER_AXIS 4
+#define WL_POINTER_FRAME 5
+#define WL_POINTER_AXIS_SOURCE 6
+#define WL_POINTER_AXIS_STOP 7
+#define WL_POINTER_AXIS_DISCRETE 8
+
+/**
+ * @ingroup iface_wl_pointer
+ */
+#define WL_POINTER_ENTER_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_pointer
+ */
+#define WL_POINTER_LEAVE_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_pointer
+ */
+#define WL_POINTER_MOTION_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_pointer
+ */
+#define WL_POINTER_BUTTON_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_pointer
+ */
+#define WL_POINTER_AXIS_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_pointer
+ */
+#define WL_POINTER_FRAME_SINCE_VERSION 5
+/**
+ * @ingroup iface_wl_pointer
+ */
+#define WL_POINTER_AXIS_SOURCE_SINCE_VERSION 5
+/**
+ * @ingroup iface_wl_pointer
+ */
+#define WL_POINTER_AXIS_STOP_SINCE_VERSION 5
+/**
+ * @ingroup iface_wl_pointer
+ */
+#define WL_POINTER_AXIS_DISCRETE_SINCE_VERSION 5
+
+/**
+ * @ingroup iface_wl_pointer
+ */
+#define WL_POINTER_SET_CURSOR_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_pointer
+ */
+#define WL_POINTER_RELEASE_SINCE_VERSION 3
+
+/**
+ * @ingroup iface_wl_pointer
+ * Sends an enter event to the client owning the resource.
+ * @param resource_ The client's resource
+ * @param serial serial number of the enter event
+ * @param surface surface entered by the pointer
+ * @param surface_x surface-local x coordinate
+ * @param surface_y surface-local y coordinate
+ */
+static inline void
+wl_pointer_send_enter(struct wl_resource *resource_, uint32_t serial, struct wl_resource *surface, wl_fixed_t surface_x, wl_fixed_t surface_y)
+{
+ wl_resource_post_event(resource_, WL_POINTER_ENTER, serial, surface, surface_x, surface_y);
+}
+
+/**
+ * @ingroup iface_wl_pointer
+ * Sends an leave event to the client owning the resource.
+ * @param resource_ The client's resource
+ * @param serial serial number of the leave event
+ * @param surface surface left by the pointer
+ */
+static inline void
+wl_pointer_send_leave(struct wl_resource *resource_, uint32_t serial, struct wl_resource *surface)
+{
+ wl_resource_post_event(resource_, WL_POINTER_LEAVE, serial, surface);
+}
+
+/**
+ * @ingroup iface_wl_pointer
+ * Sends an motion event to the client owning the resource.
+ * @param resource_ The client's resource
+ * @param time timestamp with millisecond granularity
+ * @param surface_x surface-local x coordinate
+ * @param surface_y surface-local y coordinate
+ */
+static inline void
+wl_pointer_send_motion(struct wl_resource *resource_, uint32_t time, wl_fixed_t surface_x, wl_fixed_t surface_y)
+{
+ wl_resource_post_event(resource_, WL_POINTER_MOTION, time, surface_x, surface_y);
+}
+
+/**
+ * @ingroup iface_wl_pointer
+ * Sends an button event to the client owning the resource.
+ * @param resource_ The client's resource
+ * @param serial serial number of the button event
+ * @param time timestamp with millisecond granularity
+ * @param button button that produced the event
+ * @param state physical state of the button
+ */
+static inline void
+wl_pointer_send_button(struct wl_resource *resource_, uint32_t serial, uint32_t time, uint32_t button, uint32_t state)
+{
+ wl_resource_post_event(resource_, WL_POINTER_BUTTON, serial, time, button, state);
+}
+
+/**
+ * @ingroup iface_wl_pointer
+ * Sends an axis event to the client owning the resource.
+ * @param resource_ The client's resource
+ * @param time timestamp with millisecond granularity
+ * @param axis axis type
+ * @param value length of vector in surface-local coordinate space
+ */
+static inline void
+wl_pointer_send_axis(struct wl_resource *resource_, uint32_t time, uint32_t axis, wl_fixed_t value)
+{
+ wl_resource_post_event(resource_, WL_POINTER_AXIS, time, axis, value);
+}
+
+/**
+ * @ingroup iface_wl_pointer
+ * Sends an frame event to the client owning the resource.
+ * @param resource_ The client's resource
+ */
+static inline void
+wl_pointer_send_frame(struct wl_resource *resource_)
+{
+ wl_resource_post_event(resource_, WL_POINTER_FRAME);
+}
+
+/**
+ * @ingroup iface_wl_pointer
+ * Sends an axis_source event to the client owning the resource.
+ * @param resource_ The client's resource
+ * @param axis_source source of the axis event
+ */
+static inline void
+wl_pointer_send_axis_source(struct wl_resource *resource_, uint32_t axis_source)
+{
+ wl_resource_post_event(resource_, WL_POINTER_AXIS_SOURCE, axis_source);
+}
+
+/**
+ * @ingroup iface_wl_pointer
+ * Sends an axis_stop event to the client owning the resource.
+ * @param resource_ The client's resource
+ * @param time timestamp with millisecond granularity
+ * @param axis the axis stopped with this event
+ */
+static inline void
+wl_pointer_send_axis_stop(struct wl_resource *resource_, uint32_t time, uint32_t axis)
+{
+ wl_resource_post_event(resource_, WL_POINTER_AXIS_STOP, time, axis);
+}
+
+/**
+ * @ingroup iface_wl_pointer
+ * Sends an axis_discrete event to the client owning the resource.
+ * @param resource_ The client's resource
+ * @param axis axis type
+ * @param discrete number of steps
+ */
+static inline void
+wl_pointer_send_axis_discrete(struct wl_resource *resource_, uint32_t axis, int32_t discrete)
+{
+ wl_resource_post_event(resource_, WL_POINTER_AXIS_DISCRETE, axis, discrete);
+}
+
+#ifndef WL_KEYBOARD_KEYMAP_FORMAT_ENUM
+#define WL_KEYBOARD_KEYMAP_FORMAT_ENUM
+/**
+ * @ingroup iface_wl_keyboard
+ * keyboard mapping format
+ *
+ * This specifies the format of the keymap provided to the
+ * client with the wl_keyboard.keymap event.
+ */
+enum wl_keyboard_keymap_format {
+ /**
+ * no keymap; client must understand how to interpret the raw keycode
+ */
+ WL_KEYBOARD_KEYMAP_FORMAT_NO_KEYMAP = 0,
+ /**
+ * libxkbcommon compatible; to determine the xkb keycode, clients must add 8 to the key event keycode
+ */
+ WL_KEYBOARD_KEYMAP_FORMAT_XKB_V1 = 1,
+};
+#endif /* WL_KEYBOARD_KEYMAP_FORMAT_ENUM */
+
+#ifndef WL_KEYBOARD_KEY_STATE_ENUM
+#define WL_KEYBOARD_KEY_STATE_ENUM
+/**
+ * @ingroup iface_wl_keyboard
+ * physical key state
+ *
+ * Describes the physical state of a key that produced the key event.
+ */
+enum wl_keyboard_key_state {
+ /**
+ * key is not pressed
+ */
+ WL_KEYBOARD_KEY_STATE_RELEASED = 0,
+ /**
+ * key is pressed
+ */
+ WL_KEYBOARD_KEY_STATE_PRESSED = 1,
+};
+#endif /* WL_KEYBOARD_KEY_STATE_ENUM */
+
+/**
+ * @ingroup iface_wl_keyboard
+ * @struct wl_keyboard_interface
+ */
+struct wl_keyboard_interface {
+ /**
+ * release the keyboard object
+ *
+ *
+ * @since 3
+ */
+ void (*release)(struct wl_client *client,
+ struct wl_resource *resource);
+};
+
+#define WL_KEYBOARD_KEYMAP 0
+#define WL_KEYBOARD_ENTER 1
+#define WL_KEYBOARD_LEAVE 2
+#define WL_KEYBOARD_KEY 3
+#define WL_KEYBOARD_MODIFIERS 4
+#define WL_KEYBOARD_REPEAT_INFO 5
+
+/**
+ * @ingroup iface_wl_keyboard
+ */
+#define WL_KEYBOARD_KEYMAP_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_keyboard
+ */
+#define WL_KEYBOARD_ENTER_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_keyboard
+ */
+#define WL_KEYBOARD_LEAVE_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_keyboard
+ */
+#define WL_KEYBOARD_KEY_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_keyboard
+ */
+#define WL_KEYBOARD_MODIFIERS_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_keyboard
+ */
+#define WL_KEYBOARD_REPEAT_INFO_SINCE_VERSION 4
+
+/**
+ * @ingroup iface_wl_keyboard
+ */
+#define WL_KEYBOARD_RELEASE_SINCE_VERSION 3
+
+/**
+ * @ingroup iface_wl_keyboard
+ * Sends an keymap event to the client owning the resource.
+ * @param resource_ The client's resource
+ * @param format keymap format
+ * @param fd keymap file descriptor
+ * @param size keymap size, in bytes
+ */
+static inline void
+wl_keyboard_send_keymap(struct wl_resource *resource_, uint32_t format, int32_t fd, uint32_t size)
+{
+ wl_resource_post_event(resource_, WL_KEYBOARD_KEYMAP, format, fd, size);
+}
+
+/**
+ * @ingroup iface_wl_keyboard
+ * Sends an enter event to the client owning the resource.
+ * @param resource_ The client's resource
+ * @param serial serial number of the enter event
+ * @param surface surface gaining keyboard focus
+ * @param keys the currently pressed keys
+ */
+static inline void
+wl_keyboard_send_enter(struct wl_resource *resource_, uint32_t serial, struct wl_resource *surface, struct wl_array *keys)
+{
+ wl_resource_post_event(resource_, WL_KEYBOARD_ENTER, serial, surface, keys);
+}
+
+/**
+ * @ingroup iface_wl_keyboard
+ * Sends an leave event to the client owning the resource.
+ * @param resource_ The client's resource
+ * @param serial serial number of the leave event
+ * @param surface surface that lost keyboard focus
+ */
+static inline void
+wl_keyboard_send_leave(struct wl_resource *resource_, uint32_t serial, struct wl_resource *surface)
+{
+ wl_resource_post_event(resource_, WL_KEYBOARD_LEAVE, serial, surface);
+}
+
+/**
+ * @ingroup iface_wl_keyboard
+ * Sends an key event to the client owning the resource.
+ * @param resource_ The client's resource
+ * @param serial serial number of the key event
+ * @param time timestamp with millisecond granularity
+ * @param key key that produced the event
+ * @param state physical state of the key
+ */
+static inline void
+wl_keyboard_send_key(struct wl_resource *resource_, uint32_t serial, uint32_t time, uint32_t key, uint32_t state)
+{
+ wl_resource_post_event(resource_, WL_KEYBOARD_KEY, serial, time, key, state);
+}
+
+/**
+ * @ingroup iface_wl_keyboard
+ * Sends an modifiers event to the client owning the resource.
+ * @param resource_ The client's resource
+ * @param serial serial number of the modifiers event
+ * @param mods_depressed depressed modifiers
+ * @param mods_latched latched modifiers
+ * @param mods_locked locked modifiers
+ * @param group keyboard layout
+ */
+static inline void
+wl_keyboard_send_modifiers(struct wl_resource *resource_, uint32_t serial, uint32_t mods_depressed, uint32_t mods_latched, uint32_t mods_locked, uint32_t group)
+{
+ wl_resource_post_event(resource_, WL_KEYBOARD_MODIFIERS, serial, mods_depressed, mods_latched, mods_locked, group);
+}
+
+/**
+ * @ingroup iface_wl_keyboard
+ * Sends an repeat_info event to the client owning the resource.
+ * @param resource_ The client's resource
+ * @param rate the rate of repeating keys in characters per second
+ * @param delay delay in milliseconds since key down until repeating starts
+ */
+static inline void
+wl_keyboard_send_repeat_info(struct wl_resource *resource_, int32_t rate, int32_t delay)
+{
+ wl_resource_post_event(resource_, WL_KEYBOARD_REPEAT_INFO, rate, delay);
+}
+
+/**
+ * @ingroup iface_wl_touch
+ * @struct wl_touch_interface
+ */
+struct wl_touch_interface {
+ /**
+ * release the touch object
+ *
+ *
+ * @since 3
+ */
+ void (*release)(struct wl_client *client,
+ struct wl_resource *resource);
+};
+
+#define WL_TOUCH_DOWN 0
+#define WL_TOUCH_UP 1
+#define WL_TOUCH_MOTION 2
+#define WL_TOUCH_FRAME 3
+#define WL_TOUCH_CANCEL 4
+#define WL_TOUCH_SHAPE 5
+#define WL_TOUCH_ORIENTATION 6
+
+/**
+ * @ingroup iface_wl_touch
+ */
+#define WL_TOUCH_DOWN_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_touch
+ */
+#define WL_TOUCH_UP_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_touch
+ */
+#define WL_TOUCH_MOTION_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_touch
+ */
+#define WL_TOUCH_FRAME_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_touch
+ */
+#define WL_TOUCH_CANCEL_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_touch
+ */
+#define WL_TOUCH_SHAPE_SINCE_VERSION 6
+/**
+ * @ingroup iface_wl_touch
+ */
+#define WL_TOUCH_ORIENTATION_SINCE_VERSION 6
+
+/**
+ * @ingroup iface_wl_touch
+ */
+#define WL_TOUCH_RELEASE_SINCE_VERSION 3
+
+/**
+ * @ingroup iface_wl_touch
+ * Sends an down event to the client owning the resource.
+ * @param resource_ The client's resource
+ * @param serial serial number of the touch down event
+ * @param time timestamp with millisecond granularity
+ * @param surface surface touched
+ * @param id the unique ID of this touch point
+ * @param x surface-local x coordinate
+ * @param y surface-local y coordinate
+ */
+static inline void
+wl_touch_send_down(struct wl_resource *resource_, uint32_t serial, uint32_t time, struct wl_resource *surface, int32_t id, wl_fixed_t x, wl_fixed_t y)
+{
+ wl_resource_post_event(resource_, WL_TOUCH_DOWN, serial, time, surface, id, x, y);
+}
+
+/**
+ * @ingroup iface_wl_touch
+ * Sends an up event to the client owning the resource.
+ * @param resource_ The client's resource
+ * @param serial serial number of the touch up event
+ * @param time timestamp with millisecond granularity
+ * @param id the unique ID of this touch point
+ */
+static inline void
+wl_touch_send_up(struct wl_resource *resource_, uint32_t serial, uint32_t time, int32_t id)
+{
+ wl_resource_post_event(resource_, WL_TOUCH_UP, serial, time, id);
+}
+
+/**
+ * @ingroup iface_wl_touch
+ * Sends an motion event to the client owning the resource.
+ * @param resource_ The client's resource
+ * @param time timestamp with millisecond granularity
+ * @param id the unique ID of this touch point
+ * @param x surface-local x coordinate
+ * @param y surface-local y coordinate
+ */
+static inline void
+wl_touch_send_motion(struct wl_resource *resource_, uint32_t time, int32_t id, wl_fixed_t x, wl_fixed_t y)
+{
+ wl_resource_post_event(resource_, WL_TOUCH_MOTION, time, id, x, y);
+}
+
+/**
+ * @ingroup iface_wl_touch
+ * Sends an frame event to the client owning the resource.
+ * @param resource_ The client's resource
+ */
+static inline void
+wl_touch_send_frame(struct wl_resource *resource_)
+{
+ wl_resource_post_event(resource_, WL_TOUCH_FRAME);
+}
+
+/**
+ * @ingroup iface_wl_touch
+ * Sends an cancel event to the client owning the resource.
+ * @param resource_ The client's resource
+ */
+static inline void
+wl_touch_send_cancel(struct wl_resource *resource_)
+{
+ wl_resource_post_event(resource_, WL_TOUCH_CANCEL);
+}
+
+/**
+ * @ingroup iface_wl_touch
+ * Sends an shape event to the client owning the resource.
+ * @param resource_ The client's resource
+ * @param id the unique ID of this touch point
+ * @param major length of the major axis in surface-local coordinates
+ * @param minor length of the minor axis in surface-local coordinates
+ */
+static inline void
+wl_touch_send_shape(struct wl_resource *resource_, int32_t id, wl_fixed_t major, wl_fixed_t minor)
+{
+ wl_resource_post_event(resource_, WL_TOUCH_SHAPE, id, major, minor);
+}
+
+/**
+ * @ingroup iface_wl_touch
+ * Sends an orientation event to the client owning the resource.
+ * @param resource_ The client's resource
+ * @param id the unique ID of this touch point
+ * @param orientation angle between major axis and positive surface y-axis in degrees
+ */
+static inline void
+wl_touch_send_orientation(struct wl_resource *resource_, int32_t id, wl_fixed_t orientation)
+{
+ wl_resource_post_event(resource_, WL_TOUCH_ORIENTATION, id, orientation);
+}
+
+#ifndef WL_OUTPUT_SUBPIXEL_ENUM
+#define WL_OUTPUT_SUBPIXEL_ENUM
+/**
+ * @ingroup iface_wl_output
+ * subpixel geometry information
+ *
+ * This enumeration describes how the physical
+ * pixels on an output are laid out.
+ */
+enum wl_output_subpixel {
+ /**
+ * unknown geometry
+ */
+ WL_OUTPUT_SUBPIXEL_UNKNOWN = 0,
+ /**
+ * no geometry
+ */
+ WL_OUTPUT_SUBPIXEL_NONE = 1,
+ /**
+ * horizontal RGB
+ */
+ WL_OUTPUT_SUBPIXEL_HORIZONTAL_RGB = 2,
+ /**
+ * horizontal BGR
+ */
+ WL_OUTPUT_SUBPIXEL_HORIZONTAL_BGR = 3,
+ /**
+ * vertical RGB
+ */
+ WL_OUTPUT_SUBPIXEL_VERTICAL_RGB = 4,
+ /**
+ * vertical BGR
+ */
+ WL_OUTPUT_SUBPIXEL_VERTICAL_BGR = 5,
+};
+#endif /* WL_OUTPUT_SUBPIXEL_ENUM */
+
+#ifndef WL_OUTPUT_TRANSFORM_ENUM
+#define WL_OUTPUT_TRANSFORM_ENUM
+/**
+ * @ingroup iface_wl_output
+ * transform from framebuffer to output
+ *
+ * This describes the transform that a compositor will apply to a
+ * surface to compensate for the rotation or mirroring of an
+ * output device.
+ *
+ * The flipped values correspond to an initial flip around a
+ * vertical axis followed by rotation.
+ *
+ * The purpose is mainly to allow clients to render accordingly and
+ * tell the compositor, so that for fullscreen surfaces, the
+ * compositor will still be able to scan out directly from client
+ * surfaces.
+ */
+enum wl_output_transform {
+ /**
+ * no transform
+ */
+ WL_OUTPUT_TRANSFORM_NORMAL = 0,
+ /**
+ * 90 degrees counter-clockwise
+ */
+ WL_OUTPUT_TRANSFORM_90 = 1,
+ /**
+ * 180 degrees counter-clockwise
+ */
+ WL_OUTPUT_TRANSFORM_180 = 2,
+ /**
+ * 270 degrees counter-clockwise
+ */
+ WL_OUTPUT_TRANSFORM_270 = 3,
+ /**
+ * 180 degree flip around a vertical axis
+ */
+ WL_OUTPUT_TRANSFORM_FLIPPED = 4,
+ /**
+ * flip and rotate 90 degrees counter-clockwise
+ */
+ WL_OUTPUT_TRANSFORM_FLIPPED_90 = 5,
+ /**
+ * flip and rotate 180 degrees counter-clockwise
+ */
+ WL_OUTPUT_TRANSFORM_FLIPPED_180 = 6,
+ /**
+ * flip and rotate 270 degrees counter-clockwise
+ */
+ WL_OUTPUT_TRANSFORM_FLIPPED_270 = 7,
+};
+#endif /* WL_OUTPUT_TRANSFORM_ENUM */
+
+#ifndef WL_OUTPUT_MODE_ENUM
+#define WL_OUTPUT_MODE_ENUM
+/**
+ * @ingroup iface_wl_output
+ * mode information
+ *
+ * These flags describe properties of an output mode.
+ * They are used in the flags bitfield of the mode event.
+ */
+enum wl_output_mode {
+ /**
+ * indicates this is the current mode
+ */
+ WL_OUTPUT_MODE_CURRENT = 0x1,
+ /**
+ * indicates this is the preferred mode
+ */
+ WL_OUTPUT_MODE_PREFERRED = 0x2,
+};
+#endif /* WL_OUTPUT_MODE_ENUM */
+
+/**
+ * @ingroup iface_wl_output
+ * @struct wl_output_interface
+ */
+struct wl_output_interface {
+ /**
+ * release the output object
+ *
+ * Using this request a client can tell the server that it is not
+ * going to use the output object anymore.
+ * @since 3
+ */
+ void (*release)(struct wl_client *client,
+ struct wl_resource *resource);
+};
+
+#define WL_OUTPUT_GEOMETRY 0
+#define WL_OUTPUT_MODE 1
+#define WL_OUTPUT_DONE 2
+#define WL_OUTPUT_SCALE 3
+
+/**
+ * @ingroup iface_wl_output
+ */
+#define WL_OUTPUT_GEOMETRY_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_output
+ */
+#define WL_OUTPUT_MODE_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_output
+ */
+#define WL_OUTPUT_DONE_SINCE_VERSION 2
+/**
+ * @ingroup iface_wl_output
+ */
+#define WL_OUTPUT_SCALE_SINCE_VERSION 2
+
+/**
+ * @ingroup iface_wl_output
+ */
+#define WL_OUTPUT_RELEASE_SINCE_VERSION 3
+
+/**
+ * @ingroup iface_wl_output
+ * Sends an geometry event to the client owning the resource.
+ * @param resource_ The client's resource
+ * @param x x position within the global compositor space
+ * @param y y position within the global compositor space
+ * @param physical_width width in millimeters of the output
+ * @param physical_height height in millimeters of the output
+ * @param subpixel subpixel orientation of the output
+ * @param make textual description of the manufacturer
+ * @param model textual description of the model
+ * @param transform transform that maps framebuffer to output
+ */
+static inline void
+wl_output_send_geometry(struct wl_resource *resource_, int32_t x, int32_t y, int32_t physical_width, int32_t physical_height, int32_t subpixel, const char *make, const char *model, int32_t transform)
+{
+ wl_resource_post_event(resource_, WL_OUTPUT_GEOMETRY, x, y, physical_width, physical_height, subpixel, make, model, transform);
+}
+
+/**
+ * @ingroup iface_wl_output
+ * Sends an mode event to the client owning the resource.
+ * @param resource_ The client's resource
+ * @param flags bitfield of mode flags
+ * @param width width of the mode in hardware units
+ * @param height height of the mode in hardware units
+ * @param refresh vertical refresh rate in mHz
+ */
+static inline void
+wl_output_send_mode(struct wl_resource *resource_, uint32_t flags, int32_t width, int32_t height, int32_t refresh)
+{
+ wl_resource_post_event(resource_, WL_OUTPUT_MODE, flags, width, height, refresh);
+}
+
+/**
+ * @ingroup iface_wl_output
+ * Sends an done event to the client owning the resource.
+ * @param resource_ The client's resource
+ */
+static inline void
+wl_output_send_done(struct wl_resource *resource_)
+{
+ wl_resource_post_event(resource_, WL_OUTPUT_DONE);
+}
+
+/**
+ * @ingroup iface_wl_output
+ * Sends an scale event to the client owning the resource.
+ * @param resource_ The client's resource
+ * @param factor scaling factor of output
+ */
+static inline void
+wl_output_send_scale(struct wl_resource *resource_, int32_t factor)
+{
+ wl_resource_post_event(resource_, WL_OUTPUT_SCALE, factor);
+}
+
+/**
+ * @ingroup iface_wl_region
+ * @struct wl_region_interface
+ */
+struct wl_region_interface {
+ /**
+ * destroy region
+ *
+ * Destroy the region. This will invalidate the object ID.
+ */
+ void (*destroy)(struct wl_client *client,
+ struct wl_resource *resource);
+ /**
+ * add rectangle to region
+ *
+ * Add the specified rectangle to the region.
+ * @param x region-local x coordinate
+ * @param y region-local y coordinate
+ * @param width rectangle width
+ * @param height rectangle height
+ */
+ void (*add)(struct wl_client *client,
+ struct wl_resource *resource,
+ int32_t x,
+ int32_t y,
+ int32_t width,
+ int32_t height);
+ /**
+ * subtract rectangle from region
+ *
+ * Subtract the specified rectangle from the region.
+ * @param x region-local x coordinate
+ * @param y region-local y coordinate
+ * @param width rectangle width
+ * @param height rectangle height
+ */
+ void (*subtract)(struct wl_client *client,
+ struct wl_resource *resource,
+ int32_t x,
+ int32_t y,
+ int32_t width,
+ int32_t height);
+};
+
+
+/**
+ * @ingroup iface_wl_region
+ */
+#define WL_REGION_DESTROY_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_region
+ */
+#define WL_REGION_ADD_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_region
+ */
+#define WL_REGION_SUBTRACT_SINCE_VERSION 1
+
+#ifndef WL_SUBCOMPOSITOR_ERROR_ENUM
+#define WL_SUBCOMPOSITOR_ERROR_ENUM
+enum wl_subcompositor_error {
+ /**
+ * the to-be sub-surface is invalid
+ */
+ WL_SUBCOMPOSITOR_ERROR_BAD_SURFACE = 0,
+};
+#endif /* WL_SUBCOMPOSITOR_ERROR_ENUM */
+
+/**
+ * @ingroup iface_wl_subcompositor
+ * @struct wl_subcompositor_interface
+ */
+struct wl_subcompositor_interface {
+ /**
+ * unbind from the subcompositor interface
+ *
+ * Informs the server that the client will not be using this
+ * protocol object anymore. This does not affect any other objects,
+ * wl_subsurface objects included.
+ */
+ void (*destroy)(struct wl_client *client,
+ struct wl_resource *resource);
+ /**
+ * give a surface the role sub-surface
+ *
+ * Create a sub-surface interface for the given surface, and
+ * associate it with the given parent surface. This turns a plain
+ * wl_surface into a sub-surface.
+ *
+ * The to-be sub-surface must not already have another role, and it
+ * must not have an existing wl_subsurface object. Otherwise a
+ * protocol error is raised.
+ * @param id the new sub-surface object ID
+ * @param surface the surface to be turned into a sub-surface
+ * @param parent the parent surface
+ */
+ void (*get_subsurface)(struct wl_client *client,
+ struct wl_resource *resource,
+ uint32_t id,
+ struct wl_resource *surface,
+ struct wl_resource *parent);
+};
+
+
+/**
+ * @ingroup iface_wl_subcompositor
+ */
+#define WL_SUBCOMPOSITOR_DESTROY_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_subcompositor
+ */
+#define WL_SUBCOMPOSITOR_GET_SUBSURFACE_SINCE_VERSION 1
+
+#ifndef WL_SUBSURFACE_ERROR_ENUM
+#define WL_SUBSURFACE_ERROR_ENUM
+enum wl_subsurface_error {
+ /**
+ * wl_surface is not a sibling or the parent
+ */
+ WL_SUBSURFACE_ERROR_BAD_SURFACE = 0,
+};
+#endif /* WL_SUBSURFACE_ERROR_ENUM */
+
+/**
+ * @ingroup iface_wl_subsurface
+ * @struct wl_subsurface_interface
+ */
+struct wl_subsurface_interface {
+ /**
+ * remove sub-surface interface
+ *
+ * The sub-surface interface is removed from the wl_surface
+ * object that was turned into a sub-surface with a
+ * wl_subcompositor.get_subsurface request. The wl_surface's
+ * association to the parent is deleted, and the wl_surface loses
+ * its role as a sub-surface. The wl_surface is unmapped.
+ */
+ void (*destroy)(struct wl_client *client,
+ struct wl_resource *resource);
+ /**
+ * reposition the sub-surface
+ *
+ * This schedules a sub-surface position change. The sub-surface
+ * will be moved so that its origin (top left corner pixel) will be
+ * at the location x, y of the parent surface coordinate system.
+ * The coordinates are not restricted to the parent surface area.
+ * Negative values are allowed.
+ *
+ * The scheduled coordinates will take effect whenever the state of
+ * the parent surface is applied. When this happens depends on
+ * whether the parent surface is in synchronized mode or not. See
+ * wl_subsurface.set_sync and wl_subsurface.set_desync for details.
+ *
+ * If more than one set_position request is invoked by the client
+ * before the commit of the parent surface, the position of a new
+ * request always replaces the scheduled position from any previous
+ * request.
+ *
+ * The initial position is 0, 0.
+ * @param x x coordinate in the parent surface
+ * @param y y coordinate in the parent surface
+ */
+ void (*set_position)(struct wl_client *client,
+ struct wl_resource *resource,
+ int32_t x,
+ int32_t y);
+ /**
+ * restack the sub-surface
+ *
+ * This sub-surface is taken from the stack, and put back just
+ * above the reference surface, changing the z-order of the
+ * sub-surfaces. The reference surface must be one of the sibling
+ * surfaces, or the parent surface. Using any other surface,
+ * including this sub-surface, will cause a protocol error.
+ *
+ * The z-order is double-buffered. Requests are handled in order
+ * and applied immediately to a pending state. The final pending
+ * state is copied to the active state the next time the state of
+ * the parent surface is applied. When this happens depends on
+ * whether the parent surface is in synchronized mode or not. See
+ * wl_subsurface.set_sync and wl_subsurface.set_desync for details.
+ *
+ * A new sub-surface is initially added as the top-most in the
+ * stack of its siblings and parent.
+ * @param sibling the reference surface
+ */
+ void (*place_above)(struct wl_client *client,
+ struct wl_resource *resource,
+ struct wl_resource *sibling);
+ /**
+ * restack the sub-surface
+ *
+ * The sub-surface is placed just below the reference surface.
+ * See wl_subsurface.place_above.
+ * @param sibling the reference surface
+ */
+ void (*place_below)(struct wl_client *client,
+ struct wl_resource *resource,
+ struct wl_resource *sibling);
+ /**
+ * set sub-surface to synchronized mode
+ *
+ * Change the commit behaviour of the sub-surface to synchronized
+ * mode, also described as the parent dependent mode.
+ *
+ * In synchronized mode, wl_surface.commit on a sub-surface will
+ * accumulate the committed state in a cache, but the state will
+ * not be applied and hence will not change the compositor output.
+ * The cached state is applied to the sub-surface immediately after
+ * the parent surface's state is applied. This ensures atomic
+ * updates of the parent and all its synchronized sub-surfaces.
+ * Applying the cached state will invalidate the cache, so further
+ * parent surface commits do not (re-)apply old state.
+ *
+ * See wl_subsurface for the recursive effect of this mode.
+ */
+ void (*set_sync)(struct wl_client *client,
+ struct wl_resource *resource);
+ /**
+ * set sub-surface to desynchronized mode
+ *
+ * Change the commit behaviour of the sub-surface to
+ * desynchronized mode, also described as independent or freely
+ * running mode.
+ *
+ * In desynchronized mode, wl_surface.commit on a sub-surface will
+ * apply the pending state directly, without caching, as happens
+ * normally with a wl_surface. Calling wl_surface.commit on the
+ * parent surface has no effect on the sub-surface's wl_surface
+ * state. This mode allows a sub-surface to be updated on its own.
+ *
+ * If cached state exists when wl_surface.commit is called in
+ * desynchronized mode, the pending state is added to the cached
+ * state, and applied as a whole. This invalidates the cache.
+ *
+ * Note: even if a sub-surface is set to desynchronized, a parent
+ * sub-surface may override it to behave as synchronized. For
+ * details, see wl_subsurface.
+ *
+ * If a surface's parent surface behaves as desynchronized, then
+ * the cached state is applied on set_desync.
+ */
+ void (*set_desync)(struct wl_client *client,
+ struct wl_resource *resource);
+};
+
+
+/**
+ * @ingroup iface_wl_subsurface
+ */
+#define WL_SUBSURFACE_DESTROY_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_subsurface
+ */
+#define WL_SUBSURFACE_SET_POSITION_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_subsurface
+ */
+#define WL_SUBSURFACE_PLACE_ABOVE_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_subsurface
+ */
+#define WL_SUBSURFACE_PLACE_BELOW_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_subsurface
+ */
+#define WL_SUBSURFACE_SET_SYNC_SINCE_VERSION 1
+/**
+ * @ingroup iface_wl_subsurface
+ */
+#define WL_SUBSURFACE_SET_DESYNC_SINCE_VERSION 1
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif
diff --git a/chromium/third_party/wayland/include/src/wayland-version.h b/chromium/third_party/wayland/include/src/wayland-version.h
new file mode 100644
index 00000000000..4ab635eb81c
--- /dev/null
+++ b/chromium/third_party/wayland/include/src/wayland-version.h
@@ -0,0 +1,34 @@
+/*
+ * Copyright © 2012 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining
+ * a copy of this software and associated documentation files (the
+ * "Software"), to deal in the Software without restriction, including
+ * without limitation the rights to use, copy, modify, merge, publish,
+ * distribute, sublicense, and/or sell copies of the Software, and to
+ * permit persons to whom the Software is furnished to do so, subject to
+ * the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial
+ * portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#ifndef WAYLAND_VERSION_H
+#define WAYLAND_VERSION_H
+
+#define WAYLAND_VERSION_MAJOR 1
+#define WAYLAND_VERSION_MINOR 13
+#define WAYLAND_VERSION_MICRO 0
+#define WAYLAND_VERSION "1.13.0"
+
+#endif
diff --git a/chromium/third_party/wayland/protocol/wayland-protocol.c b/chromium/third_party/wayland/protocol/wayland-protocol.c
new file mode 100644
index 00000000000..f5f49088876
--- /dev/null
+++ b/chromium/third_party/wayland/protocol/wayland-protocol.c
@@ -0,0 +1,507 @@
+/* Generated by wayland-scanner 1.13.0 */
+
+/*
+ * Copyright © 2008-2011 Kristian Høgsberg
+ * Copyright © 2010-2011 Intel Corporation
+ * Copyright © 2012-2013 Collabora, Ltd.
+ *
+ * Permission is hereby granted, free of charge, to any person
+ * obtaining a copy of this software and associated documentation files
+ * (the "Software"), to deal in the Software without restriction,
+ * including without limitation the rights to use, copy, modify, merge,
+ * publish, distribute, sublicense, and/or sell copies of the Software,
+ * and to permit persons to whom the Software is furnished to do so,
+ * subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the
+ * next paragraph) shall be included in all copies or substantial
+ * portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+ * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+ * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
+ * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
+ * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+ * SOFTWARE.
+ */
+
+#include <stdlib.h>
+#include <stdint.h>
+#include "wayland-util.h"
+
+extern const struct wl_interface wl_buffer_interface;
+extern const struct wl_interface wl_callback_interface;
+extern const struct wl_interface wl_data_device_interface;
+extern const struct wl_interface wl_data_offer_interface;
+extern const struct wl_interface wl_data_source_interface;
+extern const struct wl_interface wl_keyboard_interface;
+extern const struct wl_interface wl_output_interface;
+extern const struct wl_interface wl_pointer_interface;
+extern const struct wl_interface wl_region_interface;
+extern const struct wl_interface wl_registry_interface;
+extern const struct wl_interface wl_seat_interface;
+extern const struct wl_interface wl_shell_surface_interface;
+extern const struct wl_interface wl_shm_pool_interface;
+extern const struct wl_interface wl_subsurface_interface;
+extern const struct wl_interface wl_surface_interface;
+extern const struct wl_interface wl_touch_interface;
+
+static const struct wl_interface *types[] = {
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ &wl_callback_interface,
+ &wl_registry_interface,
+ &wl_surface_interface,
+ &wl_region_interface,
+ &wl_buffer_interface,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ &wl_shm_pool_interface,
+ NULL,
+ NULL,
+ &wl_data_source_interface,
+ &wl_surface_interface,
+ &wl_surface_interface,
+ NULL,
+ &wl_data_source_interface,
+ NULL,
+ &wl_data_offer_interface,
+ NULL,
+ &wl_surface_interface,
+ NULL,
+ NULL,
+ &wl_data_offer_interface,
+ &wl_data_offer_interface,
+ &wl_data_source_interface,
+ &wl_data_device_interface,
+ &wl_seat_interface,
+ &wl_shell_surface_interface,
+ &wl_surface_interface,
+ &wl_seat_interface,
+ NULL,
+ &wl_seat_interface,
+ NULL,
+ NULL,
+ &wl_surface_interface,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ NULL,
+ &wl_output_interface,
+ &wl_seat_interface,
+ NULL,
+ &wl_surface_interface,
+ NULL,
+ NULL,
+ NULL,
+ &wl_output_interface,
+ &wl_buffer_interface,
+ NULL,
+ NULL,
+ &wl_callback_interface,
+ &wl_region_interface,
+ &wl_region_interface,
+ &wl_output_interface,
+ &wl_output_interface,
+ &wl_pointer_interface,
+ &wl_keyboard_interface,
+ &wl_touch_interface,
+ NULL,
+ &wl_surface_interface,
+ NULL,
+ NULL,
+ NULL,
+ &wl_surface_interface,
+ NULL,
+ NULL,
+ NULL,
+ &wl_surface_interface,
+ NULL,
+ &wl_surface_interface,
+ NULL,
+ NULL,
+ &wl_surface_interface,
+ NULL,
+ NULL,
+ &wl_surface_interface,
+ NULL,
+ NULL,
+ NULL,
+ &wl_subsurface_interface,
+ &wl_surface_interface,
+ &wl_surface_interface,
+ &wl_surface_interface,
+ &wl_surface_interface,
+};
+
+static const struct wl_message wl_display_requests[] = {
+ { "sync", "n", types + 8 },
+ { "get_registry", "n", types + 9 },
+};
+
+static const struct wl_message wl_display_events[] = {
+ { "error", "ous", types + 0 },
+ { "delete_id", "u", types + 0 },
+};
+
+WL_EXPORT const struct wl_interface wl_display_interface = {
+ "wl_display", 1,
+ 2, wl_display_requests,
+ 2, wl_display_events,
+};
+
+static const struct wl_message wl_registry_requests[] = {
+ { "bind", "usun", types + 0 },
+};
+
+static const struct wl_message wl_registry_events[] = {
+ { "global", "usu", types + 0 },
+ { "global_remove", "u", types + 0 },
+};
+
+WL_EXPORT const struct wl_interface wl_registry_interface = {
+ "wl_registry", 1,
+ 1, wl_registry_requests,
+ 2, wl_registry_events,
+};
+
+static const struct wl_message wl_callback_events[] = {
+ { "done", "u", types + 0 },
+};
+
+WL_EXPORT const struct wl_interface wl_callback_interface = {
+ "wl_callback", 1,
+ 0, NULL,
+ 1, wl_callback_events,
+};
+
+static const struct wl_message wl_compositor_requests[] = {
+ { "create_surface", "n", types + 10 },
+ { "create_region", "n", types + 11 },
+};
+
+WL_EXPORT const struct wl_interface wl_compositor_interface = {
+ "wl_compositor", 4,
+ 2, wl_compositor_requests,
+ 0, NULL,
+};
+
+static const struct wl_message wl_shm_pool_requests[] = {
+ { "create_buffer", "niiiiu", types + 12 },
+ { "destroy", "", types + 0 },
+ { "resize", "i", types + 0 },
+};
+
+WL_EXPORT const struct wl_interface wl_shm_pool_interface = {
+ "wl_shm_pool", 1,
+ 3, wl_shm_pool_requests,
+ 0, NULL,
+};
+
+static const struct wl_message wl_shm_requests[] = {
+ { "create_pool", "nhi", types + 18 },
+};
+
+static const struct wl_message wl_shm_events[] = {
+ { "format", "u", types + 0 },
+};
+
+WL_EXPORT const struct wl_interface wl_shm_interface = {
+ "wl_shm", 1,
+ 1, wl_shm_requests,
+ 1, wl_shm_events,
+};
+
+static const struct wl_message wl_buffer_requests[] = {
+ { "destroy", "", types + 0 },
+};
+
+static const struct wl_message wl_buffer_events[] = {
+ { "release", "", types + 0 },
+};
+
+WL_EXPORT const struct wl_interface wl_buffer_interface = {
+ "wl_buffer", 1,
+ 1, wl_buffer_requests,
+ 1, wl_buffer_events,
+};
+
+static const struct wl_message wl_data_offer_requests[] = {
+ { "accept", "u?s", types + 0 },
+ { "receive", "sh", types + 0 },
+ { "destroy", "", types + 0 },
+ { "finish", "3", types + 0 },
+ { "set_actions", "3uu", types + 0 },
+};
+
+static const struct wl_message wl_data_offer_events[] = {
+ { "offer", "s", types + 0 },
+ { "source_actions", "3u", types + 0 },
+ { "action", "3u", types + 0 },
+};
+
+WL_EXPORT const struct wl_interface wl_data_offer_interface = {
+ "wl_data_offer", 3,
+ 5, wl_data_offer_requests,
+ 3, wl_data_offer_events,
+};
+
+static const struct wl_message wl_data_source_requests[] = {
+ { "offer", "s", types + 0 },
+ { "destroy", "", types + 0 },
+ { "set_actions", "3u", types + 0 },
+};
+
+static const struct wl_message wl_data_source_events[] = {
+ { "target", "?s", types + 0 },
+ { "send", "sh", types + 0 },
+ { "cancelled", "", types + 0 },
+ { "dnd_drop_performed", "3", types + 0 },
+ { "dnd_finished", "3", types + 0 },
+ { "action", "3u", types + 0 },
+};
+
+WL_EXPORT const struct wl_interface wl_data_source_interface = {
+ "wl_data_source", 3,
+ 3, wl_data_source_requests,
+ 6, wl_data_source_events,
+};
+
+static const struct wl_message wl_data_device_requests[] = {
+ { "start_drag", "?oo?ou", types + 21 },
+ { "set_selection", "?ou", types + 25 },
+ { "release", "2", types + 0 },
+};
+
+static const struct wl_message wl_data_device_events[] = {
+ { "data_offer", "n", types + 27 },
+ { "enter", "uoff?o", types + 28 },
+ { "leave", "", types + 0 },
+ { "motion", "uff", types + 0 },
+ { "drop", "", types + 0 },
+ { "selection", "?o", types + 33 },
+};
+
+WL_EXPORT const struct wl_interface wl_data_device_interface = {
+ "wl_data_device", 3,
+ 3, wl_data_device_requests,
+ 6, wl_data_device_events,
+};
+
+static const struct wl_message wl_data_device_manager_requests[] = {
+ { "create_data_source", "n", types + 34 },
+ { "get_data_device", "no", types + 35 },
+};
+
+WL_EXPORT const struct wl_interface wl_data_device_manager_interface = {
+ "wl_data_device_manager", 3,
+ 2, wl_data_device_manager_requests,
+ 0, NULL,
+};
+
+static const struct wl_message wl_shell_requests[] = {
+ { "get_shell_surface", "no", types + 37 },
+};
+
+WL_EXPORT const struct wl_interface wl_shell_interface = {
+ "wl_shell", 1,
+ 1, wl_shell_requests,
+ 0, NULL,
+};
+
+static const struct wl_message wl_shell_surface_requests[] = {
+ { "pong", "u", types + 0 },
+ { "move", "ou", types + 39 },
+ { "resize", "ouu", types + 41 },
+ { "set_toplevel", "", types + 0 },
+ { "set_transient", "oiiu", types + 44 },
+ { "set_fullscreen", "uu?o", types + 48 },
+ { "set_popup", "ouoiiu", types + 51 },
+ { "set_maximized", "?o", types + 57 },
+ { "set_title", "s", types + 0 },
+ { "set_class", "s", types + 0 },
+};
+
+static const struct wl_message wl_shell_surface_events[] = {
+ { "ping", "u", types + 0 },
+ { "configure", "uii", types + 0 },
+ { "popup_done", "", types + 0 },
+};
+
+WL_EXPORT const struct wl_interface wl_shell_surface_interface = {
+ "wl_shell_surface", 1,
+ 10, wl_shell_surface_requests,
+ 3, wl_shell_surface_events,
+};
+
+static const struct wl_message wl_surface_requests[] = {
+ { "destroy", "", types + 0 },
+ { "attach", "?oii", types + 58 },
+ { "damage", "iiii", types + 0 },
+ { "frame", "n", types + 61 },
+ { "set_opaque_region", "?o", types + 62 },
+ { "set_input_region", "?o", types + 63 },
+ { "commit", "", types + 0 },
+ { "set_buffer_transform", "2i", types + 0 },
+ { "set_buffer_scale", "3i", types + 0 },
+ { "damage_buffer", "4iiii", types + 0 },
+};
+
+static const struct wl_message wl_surface_events[] = {
+ { "enter", "o", types + 64 },
+ { "leave", "o", types + 65 },
+};
+
+WL_EXPORT const struct wl_interface wl_surface_interface = {
+ "wl_surface", 4,
+ 10, wl_surface_requests,
+ 2, wl_surface_events,
+};
+
+static const struct wl_message wl_seat_requests[] = {
+ { "get_pointer", "n", types + 66 },
+ { "get_keyboard", "n", types + 67 },
+ { "get_touch", "n", types + 68 },
+ { "release", "5", types + 0 },
+};
+
+static const struct wl_message wl_seat_events[] = {
+ { "capabilities", "u", types + 0 },
+ { "name", "2s", types + 0 },
+};
+
+WL_EXPORT const struct wl_interface wl_seat_interface = {
+ "wl_seat", 6,
+ 4, wl_seat_requests,
+ 2, wl_seat_events,
+};
+
+static const struct wl_message wl_pointer_requests[] = {
+ { "set_cursor", "u?oii", types + 69 },
+ { "release", "3", types + 0 },
+};
+
+static const struct wl_message wl_pointer_events[] = {
+ { "enter", "uoff", types + 73 },
+ { "leave", "uo", types + 77 },
+ { "motion", "uff", types + 0 },
+ { "button", "uuuu", types + 0 },
+ { "axis", "uuf", types + 0 },
+ { "frame", "5", types + 0 },
+ { "axis_source", "5u", types + 0 },
+ { "axis_stop", "5uu", types + 0 },
+ { "axis_discrete", "5ui", types + 0 },
+};
+
+WL_EXPORT const struct wl_interface wl_pointer_interface = {
+ "wl_pointer", 6,
+ 2, wl_pointer_requests,
+ 9, wl_pointer_events,
+};
+
+static const struct wl_message wl_keyboard_requests[] = {
+ { "release", "3", types + 0 },
+};
+
+static const struct wl_message wl_keyboard_events[] = {
+ { "keymap", "uhu", types + 0 },
+ { "enter", "uoa", types + 79 },
+ { "leave", "uo", types + 82 },
+ { "key", "uuuu", types + 0 },
+ { "modifiers", "uuuuu", types + 0 },
+ { "repeat_info", "4ii", types + 0 },
+};
+
+WL_EXPORT const struct wl_interface wl_keyboard_interface = {
+ "wl_keyboard", 6,
+ 1, wl_keyboard_requests,
+ 6, wl_keyboard_events,
+};
+
+static const struct wl_message wl_touch_requests[] = {
+ { "release", "3", types + 0 },
+};
+
+static const struct wl_message wl_touch_events[] = {
+ { "down", "uuoiff", types + 84 },
+ { "up", "uui", types + 0 },
+ { "motion", "uiff", types + 0 },
+ { "frame", "", types + 0 },
+ { "cancel", "", types + 0 },
+ { "shape", "6iff", types + 0 },
+ { "orientation", "6if", types + 0 },
+};
+
+WL_EXPORT const struct wl_interface wl_touch_interface = {
+ "wl_touch", 6,
+ 1, wl_touch_requests,
+ 7, wl_touch_events,
+};
+
+static const struct wl_message wl_output_requests[] = {
+ { "release", "3", types + 0 },
+};
+
+static const struct wl_message wl_output_events[] = {
+ { "geometry", "iiiiissi", types + 0 },
+ { "mode", "uiii", types + 0 },
+ { "done", "2", types + 0 },
+ { "scale", "2i", types + 0 },
+};
+
+WL_EXPORT const struct wl_interface wl_output_interface = {
+ "wl_output", 3,
+ 1, wl_output_requests,
+ 4, wl_output_events,
+};
+
+static const struct wl_message wl_region_requests[] = {
+ { "destroy", "", types + 0 },
+ { "add", "iiii", types + 0 },
+ { "subtract", "iiii", types + 0 },
+};
+
+WL_EXPORT const struct wl_interface wl_region_interface = {
+ "wl_region", 1,
+ 3, wl_region_requests,
+ 0, NULL,
+};
+
+static const struct wl_message wl_subcompositor_requests[] = {
+ { "destroy", "", types + 0 },
+ { "get_subsurface", "noo", types + 90 },
+};
+
+WL_EXPORT const struct wl_interface wl_subcompositor_interface = {
+ "wl_subcompositor", 1,
+ 2, wl_subcompositor_requests,
+ 0, NULL,
+};
+
+static const struct wl_message wl_subsurface_requests[] = {
+ { "destroy", "", types + 0 },
+ { "set_position", "ii", types + 0 },
+ { "place_above", "o", types + 93 },
+ { "place_below", "o", types + 94 },
+ { "set_sync", "", types + 0 },
+ { "set_desync", "", types + 0 },
+};
+
+WL_EXPORT const struct wl_interface wl_subsurface_interface = {
+ "wl_subsurface", 1,
+ 6, wl_subsurface_requests,
+ 0, NULL,
+};
+
diff --git a/chromium/third_party/wds/DEPS b/chromium/third_party/wds/DEPS
new file mode 100644
index 00000000000..b97810bca8c
--- /dev/null
+++ b/chromium/third_party/wds/DEPS
@@ -0,0 +1,3 @@
+include_rules = [
+ "+libwds",
+]
diff --git a/chromium/third_party/wds/LICENSE b/chromium/third_party/wds/LICENSE
new file mode 100644
index 00000000000..e8c3f50515a
--- /dev/null
+++ b/chromium/third_party/wds/LICENSE
@@ -0,0 +1,503 @@
+ GNU LESSER GENERAL PUBLIC LICENSE
+ Version 2.1, February 1999
+
+ Copyright (C) 1991, 1999 Free Software Foundation, Inc.
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the Lesser GPL. It also counts
+ as the successor of the GNU Library Public License, version 2, hence
+ the version number 2.1.]
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+ This license, the Lesser General Public License, applies to some
+specially designated software packages--typically libraries--of the
+Free Software Foundation and other authors who decide to use it. You
+can use it too, but we suggest you first think carefully about whether
+this license or the ordinary General Public License is the better
+strategy to use in any particular case, based on the explanations below.
+
+ When we speak of free software, we are referring to freedom of use,
+not price. Our General Public Licenses are designed to make sure that
+you have the freedom to distribute copies of free software (and charge
+for this service if you wish); that you receive source code or can get
+it if you want it; that you can change the software and use pieces of
+it in new free programs; and that you are informed that you can do
+these things.
+
+ To protect your rights, we need to make restrictions that forbid
+distributors to deny you these rights or to ask you to surrender these
+rights. These restrictions translate to certain responsibilities for
+you if you distribute copies of the library or if you modify it.
+
+ For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you. You must make sure that they, too, receive or can get the source
+code. If you link other code with the library, you must provide
+complete object files to the recipients, so that they can relink them
+with the library after making changes to the library and recompiling
+it. And you must show them these terms so they know their rights.
+
+ We protect your rights with a two-step method: (1) we copyright the
+library, and (2) we offer you this license, which gives you legal
+permission to copy, distribute and/or modify the library.
+
+ To protect each distributor, we want to make it very clear that
+there is no warranty for the free library. Also, if the library is
+modified by someone else and passed on, the recipients should know
+that what they have is not the original version, so that the original
+author's reputation will not be affected by problems that might be
+introduced by others.
+
+ Finally, software patents pose a constant threat to the existence of
+any free program. We wish to make sure that a company cannot
+effectively restrict the users of a free program by obtaining a
+restrictive license from a patent holder. Therefore, we insist that
+any patent license obtained for a version of the library must be
+consistent with the full freedom of use specified in this license.
+
+ Most GNU software, including some libraries, is covered by the
+ordinary GNU General Public License. This license, the GNU Lesser
+General Public License, applies to certain designated libraries, and
+is quite different from the ordinary General Public License. We use
+this license for certain libraries in order to permit linking those
+libraries into non-free programs.
+
+ When a program is linked with a library, whether statically or using
+a shared library, the combination of the two is legally speaking a
+combined work, a derivative of the original library. The ordinary
+General Public License therefore permits such linking only if the
+entire combination fits its criteria of freedom. The Lesser General
+Public License permits more lax criteria for linking other code with
+the library.
+
+ We call this license the "Lesser" General Public License because it
+does Less to protect the user's freedom than the ordinary General
+Public License. It also provides other free software developers Less
+of an advantage over competing non-free programs. These disadvantages
+are the reason we use the ordinary General Public License for many
+libraries. However, the Lesser license provides advantages in certain
+special circumstances.
+
+ For example, on rare occasions, there may be a special need to
+encourage the widest possible use of a certain library, so that it becomes
+a de-facto standard. To achieve this, non-free programs must be
+allowed to use the library. A more frequent case is that a free
+library does the same job as widely used non-free libraries. In this
+case, there is little to gain by limiting the free library to free
+software only, so we use the Lesser General Public License.
+
+ In other cases, permission to use a particular library in non-free
+programs enables a greater number of people to use a large body of
+free software. For example, permission to use the GNU C Library in
+non-free programs enables many more people to use the whole GNU
+operating system, as well as its variant, the GNU/Linux operating
+system.
+
+ Although the Lesser General Public License is Less protective of the
+users' freedom, it does ensure that the user of a program that is
+linked with the Library has the freedom and the wherewithal to run
+that program using a modified version of the Library.
+
+ The precise terms and conditions for copying, distribution and
+modification follow. Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library". The
+former contains code derived from the library, whereas the latter must
+be combined with the library in order to run.
+
+ GNU LESSER GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License Agreement applies to any software library or other
+program which contains a notice placed by the copyright holder or
+other authorized party saying it may be distributed under the terms of
+this Lesser General Public License (also called "this License").
+Each licensee is addressed as "you".
+
+ A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+ The "Library", below, refers to any such software library or work
+which has been distributed under these terms. A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language. (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+ "Source code" for a work means the preferred form of the work for
+making modifications to it. For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation
+and installation of the library.
+
+ Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it). Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+
+ 1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+ You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+
+ 2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) The modified work must itself be a software library.
+
+ b) You must cause the files modified to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ c) You must cause the whole of the work to be licensed at no
+ charge to all third parties under the terms of this License.
+
+ d) If a facility in the modified Library refers to a function or a
+ table of data to be supplied by an application program that uses
+ the facility, other than as an argument passed when the facility
+ is invoked, then you must make a good faith effort to ensure that,
+ in the event an application does not supply such function or
+ table, the facility still operates, and performs whatever part of
+ its purpose remains meaningful.
+
+ (For example, a function in a library to compute square roots has
+ a purpose that is entirely well-defined independent of the
+ application. Therefore, Subsection 2d requires that any
+ application-supplied function or table used by this function must
+ be optional: if the application does not supply it, the square
+ root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library. To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License. (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.) Do not make any other change in
+these notices.
+
+ Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+ This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+ 4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+ If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library". Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+ However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library". The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+ When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library. The
+threshold for this to be true is not precisely defined by law.
+
+ If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work. (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+ Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+
+ 6. As an exception to the Sections above, you may also combine or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+ You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License. You must supply a copy of this License. If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License. Also, you must do one
+of these things:
+
+ a) Accompany the work with the complete corresponding
+ machine-readable source code for the Library including whatever
+ changes were used in the work (which must be distributed under
+ Sections 1 and 2 above); and, if the work is an executable linked
+ with the Library, with the complete machine-readable "work that
+ uses the Library", as object code and/or source code, so that the
+ user can modify the Library and then relink to produce a modified
+ executable containing the modified Library. (It is understood
+ that the user who changes the contents of definitions files in the
+ Library will not necessarily be able to recompile the application
+ to use the modified definitions.)
+
+ b) Use a suitable shared library mechanism for linking with the
+ Library. A suitable mechanism is one that (1) uses at run time a
+ copy of the library already present on the user's computer system,
+ rather than copying library functions into the executable, and (2)
+ will operate properly with a modified version of the library, if
+ the user installs one, as long as the modified version is
+ interface-compatible with the version that the work was made with.
+
+ c) Accompany the work with a written offer, valid for at
+ least three years, to give the same user the materials
+ specified in Subsection 6a, above, for a charge no more
+ than the cost of performing this distribution.
+
+ d) If distribution of the work is made by offering access to copy
+ from a designated place, offer equivalent access to copy the above
+ specified materials from the same place.
+
+ e) Verify that the user has already received a copy of these
+ materials or that you have already sent this user a copy.
+
+ For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it. However, as a special exception,
+the materials to be distributed need not include anything that is
+normally distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+ It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system. Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+
+ 7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+ a) Accompany the combined library with a copy of the same work
+ based on the Library, uncombined with any other library
+ facilities. This must be distributed under the terms of the
+ Sections above.
+
+ b) Give prominent notice with the combined library of the fact
+ that part of it is a work based on the Library, and explaining
+ where to find the accompanying uncombined form of the same work.
+
+ 8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License. Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License. However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+ 9. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Library or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+ 10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties with
+this License.
+
+ 11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all. For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply,
+and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License may add
+an explicit geographical distribution limitation excluding those countries,
+so that distribution is permitted only in or among countries not thus
+excluded. In such case, this License incorporates the limitation as if
+written in the body of this License.
+
+ 13. The Free Software Foundation may publish revised and/or new
+versions of the Lesser General Public License from time to time.
+Such new versions will be similar in spirit to the present version,
+but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Library
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation. If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+
+ 14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission. For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this. Our
+decision will be guided by the two goals of preserving the free status
+of all derivatives of our free software and of promoting the sharing
+and reuse of software generally.
+
+ NO WARRANTY
+
+ 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Libraries
+
+ If you develop a new library, and you want it to be of the greatest
+possible use to the public, we recommend making it free software that
+everyone can redistribute and change. You can do so by permitting
+redistribution under these terms (or, alternatively, under the terms of the
+ordinary General Public License).
+
+ To apply these terms, attach the following notices to the library. It is
+safest to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least the
+"copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the library's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+Also add information on how to contact you by electronic and paper mail.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the library, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the
+ library `Frob' (a library for tweaking knobs) written by James Random Hacker.
+
+ <signature of Ty Coon>, 1 April 1990
+ Ty Coon, President of Vice
+
+That's all there is to it!
+
diff --git a/chromium/third_party/wds/OWNERS b/chromium/third_party/wds/OWNERS
new file mode 100644
index 00000000000..f7e4f6f8751
--- /dev/null
+++ b/chromium/third_party/wds/OWNERS
@@ -0,0 +1,2 @@
+alexander.shalamov@intel.com
+mikhail.pozdnyakov@intel.com
diff --git a/chromium/third_party/wds/README.chromium b/chromium/third_party/wds/README.chromium
new file mode 100644
index 00000000000..6afcce75f85
--- /dev/null
+++ b/chromium/third_party/wds/README.chromium
@@ -0,0 +1,21 @@
+Name: WDS
+URL: https://github.com/01org/wds
+Version: 1.0.0
+License: LGPL 2.1
+License File: src/COPYING
+Security Critical: yes
+
+Description:
+WDS is a set of libraries for developers who want to build Wi-Fi Display
+applications on linux.
+
+Modifications:
+- None
+
+To import a new snapshot of WDS:
+- Checkout the latest release tag: 'git checkout v1.1.0'.
+- Change the DEPS entry to the newly checked out commit.
+- Update generated files:
+ 'cmake . && make wds && mv libwds/rtsp/gen/* ../gen/'
+- Update 'wds.gyp' and 'BUILD.gn' files in 'wds' folder if needed.
+- Update this README to reflect the new version number.
diff --git a/chromium/third_party/wds/gen/errorscanner.cpp b/chromium/third_party/wds/gen/errorscanner.cpp
new file mode 100644
index 00000000000..09e1f6f425d
--- /dev/null
+++ b/chromium/third_party/wds/gen/errorscanner.cpp
@@ -0,0 +1,2298 @@
+#line 10 "errorlexer.l"
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2015 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+#include <stdint.h>
+
+#define YY_NO_UNISTD_H 1
+
+
+
+#line 30 "gen/errorscanner.cpp"
+
+#define YY_INT_ALIGNED short int
+
+/* A lexical scanner generated by flex */
+
+#define FLEX_SCANNER
+#define YY_FLEX_MAJOR_VERSION 2
+#define YY_FLEX_MINOR_VERSION 5
+#define YY_FLEX_SUBMINOR_VERSION 35
+#if YY_FLEX_SUBMINOR_VERSION > 0
+#define FLEX_BETA
+#endif
+
+/* First, we deal with platform-specific or compiler-specific issues. */
+
+/* begin standard C headers. */
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+#include <stdlib.h>
+
+/* end standard C headers. */
+
+/* flex integer type definitions */
+
+#ifndef FLEXINT_H
+#define FLEXINT_H
+
+/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
+
+#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+
+/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
+ * if you want the limit (max/min) macros for int types.
+ */
+#ifndef __STDC_LIMIT_MACROS
+#define __STDC_LIMIT_MACROS 1
+#endif
+
+#include <inttypes.h>
+typedef int8_t flex_int8_t;
+typedef uint8_t flex_uint8_t;
+typedef int16_t flex_int16_t;
+typedef uint16_t flex_uint16_t;
+typedef int32_t flex_int32_t;
+typedef uint32_t flex_uint32_t;
+#else
+typedef signed char flex_int8_t;
+typedef short int flex_int16_t;
+typedef int flex_int32_t;
+typedef unsigned char flex_uint8_t;
+typedef unsigned short int flex_uint16_t;
+typedef unsigned int flex_uint32_t;
+
+/* Limits of integral types. */
+#ifndef INT8_MIN
+#define INT8_MIN (-128)
+#endif
+#ifndef INT16_MIN
+#define INT16_MIN (-32767-1)
+#endif
+#ifndef INT32_MIN
+#define INT32_MIN (-2147483647-1)
+#endif
+#ifndef INT8_MAX
+#define INT8_MAX (127)
+#endif
+#ifndef INT16_MAX
+#define INT16_MAX (32767)
+#endif
+#ifndef INT32_MAX
+#define INT32_MAX (2147483647)
+#endif
+#ifndef UINT8_MAX
+#define UINT8_MAX (255U)
+#endif
+#ifndef UINT16_MAX
+#define UINT16_MAX (65535U)
+#endif
+#ifndef UINT32_MAX
+#define UINT32_MAX (4294967295U)
+#endif
+
+#endif /* ! C99 */
+
+#endif /* ! FLEXINT_H */
+
+#ifdef __cplusplus
+
+/* The "const" storage-class-modifier is valid. */
+#define YY_USE_CONST
+
+#else /* ! __cplusplus */
+
+/* C99 requires __STDC__ to be defined as 1. */
+#if defined (__STDC__)
+
+#define YY_USE_CONST
+
+#endif /* defined (__STDC__) */
+#endif /* ! __cplusplus */
+
+#ifdef YY_USE_CONST
+#define yyconst const
+#else
+#define yyconst
+#endif
+
+/* Returned upon end-of-file. */
+#define YY_NULL 0
+
+/* Promotes a possibly negative, possibly signed char to an unsigned
+ * integer for use as an array index. If the signed char is negative,
+ * we want to instead treat it as an 8-bit unsigned char, hence the
+ * double cast.
+ */
+#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
+
+/* An opaque pointer. */
+#ifndef YY_TYPEDEF_YY_SCANNER_T
+#define YY_TYPEDEF_YY_SCANNER_T
+typedef void* yyscan_t;
+#endif
+
+/* For convenience, these vars (plus the bison vars far below)
+ are macros in the reentrant scanner. */
+#define yyin yyg->yyin_r
+#define yyout yyg->yyout_r
+#define yyextra yyg->yyextra_r
+#define yyleng yyg->yyleng_r
+#define yytext yyg->yytext_r
+#define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno)
+#define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column)
+#define yy_flex_debug yyg->yy_flex_debug_r
+
+/* Enter a start condition. This macro really ought to take a parameter,
+ * but we do it the disgusting crufty way forced on us by the ()-less
+ * definition of BEGIN.
+ */
+#define BEGIN yyg->yy_start = 1 + 2 *
+
+/* Translate the current start state into a value that can be later handed
+ * to BEGIN to return to the state. The YYSTATE alias is for lex
+ * compatibility.
+ */
+#define YY_START ((yyg->yy_start - 1) / 2)
+#define YYSTATE YY_START
+
+/* Action number for EOF rule of a given start state. */
+#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
+
+/* Special action meaning "start processing a new file". */
+#define YY_NEW_FILE error_restart(yyin ,yyscanner )
+
+#define YY_END_OF_BUFFER_CHAR 0
+
+/* Size of default input buffer. */
+#ifndef YY_BUF_SIZE
+#ifdef __ia64__
+/* On IA-64, the buffer size is 16k, not 8k.
+ * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
+ * Ditto for the __ia64__ case accordingly.
+ */
+#define YY_BUF_SIZE 32768
+#else
+#define YY_BUF_SIZE 16384
+#endif /* __ia64__ */
+#endif
+
+/* The state buf must be large enough to hold one state per character in the main buffer.
+ */
+#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
+
+#ifndef YY_TYPEDEF_YY_BUFFER_STATE
+#define YY_TYPEDEF_YY_BUFFER_STATE
+typedef struct yy_buffer_state *YY_BUFFER_STATE;
+#endif
+
+#define EOB_ACT_CONTINUE_SCAN 0
+#define EOB_ACT_END_OF_FILE 1
+#define EOB_ACT_LAST_MATCH 2
+
+ #define YY_LESS_LINENO(n)
+
+/* Return all but the first "n" matched characters back to the input stream. */
+#define yyless(n) \
+ do \
+ { \
+ /* Undo effects of setting up yytext. */ \
+ int yyless_macro_arg = (n); \
+ YY_LESS_LINENO(yyless_macro_arg);\
+ *yy_cp = yyg->yy_hold_char; \
+ YY_RESTORE_YY_MORE_OFFSET \
+ yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
+ YY_DO_BEFORE_ACTION; /* set up yytext again */ \
+ } \
+ while ( 0 )
+
+#define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner )
+
+#ifndef YY_TYPEDEF_YY_SIZE_T
+#define YY_TYPEDEF_YY_SIZE_T
+typedef size_t yy_size_t;
+#endif
+
+#ifndef YY_STRUCT_YY_BUFFER_STATE
+#define YY_STRUCT_YY_BUFFER_STATE
+struct yy_buffer_state
+ {
+ FILE *yy_input_file;
+
+ char *yy_ch_buf; /* input buffer */
+ char *yy_buf_pos; /* current position in input buffer */
+
+ /* Size of input buffer in bytes, not including room for EOB
+ * characters.
+ */
+ yy_size_t yy_buf_size;
+
+ /* Number of characters read into yy_ch_buf, not including EOB
+ * characters.
+ */
+ int yy_n_chars;
+
+ /* Whether we "own" the buffer - i.e., we know we created it,
+ * and can realloc() it to grow it, and should free() it to
+ * delete it.
+ */
+ int yy_is_our_buffer;
+
+ /* Whether this is an "interactive" input source; if so, and
+ * if we're using stdio for input, then we want to use getc()
+ * instead of fread(), to make sure we stop fetching input after
+ * each newline.
+ */
+ int yy_is_interactive;
+
+ /* Whether we're considered to be at the beginning of a line.
+ * If so, '^' rules will be active on the next match, otherwise
+ * not.
+ */
+ int yy_at_bol;
+
+ int yy_bs_lineno; /**< The line count. */
+ int yy_bs_column; /**< The column count. */
+
+ /* Whether to try to fill the input buffer when we reach the
+ * end of it.
+ */
+ int yy_fill_buffer;
+
+ int yy_buffer_status;
+
+#define YY_BUFFER_NEW 0
+#define YY_BUFFER_NORMAL 1
+ /* When an EOF's been seen but there's still some text to process
+ * then we mark the buffer as YY_EOF_PENDING, to indicate that we
+ * shouldn't try reading from the input source any more. We might
+ * still have a bunch of tokens to match, though, because of
+ * possible backing-up.
+ *
+ * When we actually see the EOF, we change the status to "new"
+ * (via error_restart()), so that the user can continue scanning by
+ * just pointing yyin at a new input file.
+ */
+#define YY_BUFFER_EOF_PENDING 2
+
+ };
+#endif /* !YY_STRUCT_YY_BUFFER_STATE */
+
+/* We provide macros for accessing buffer states in case in the
+ * future we want to put the buffer states in a more general
+ * "scanner state".
+ *
+ * Returns the top of the stack, or NULL.
+ */
+#define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \
+ ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \
+ : NULL)
+
+/* Same as previous macro, but useful when we know that the buffer stack is not
+ * NULL or when we need an lvalue. For internal use only.
+ */
+#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]
+
+void error_restart (FILE *input_file ,yyscan_t yyscanner );
+void error__switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
+YY_BUFFER_STATE error__create_buffer (FILE *file,int size ,yyscan_t yyscanner );
+void error__delete_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
+void error__flush_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
+void error_push_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
+void error_pop_buffer_state (yyscan_t yyscanner );
+
+static void error_ensure_buffer_stack (yyscan_t yyscanner );
+static void error__load_buffer_state (yyscan_t yyscanner );
+static void error__init_buffer (YY_BUFFER_STATE b,FILE *file ,yyscan_t yyscanner );
+
+#define YY_FLUSH_BUFFER error__flush_buffer(YY_CURRENT_BUFFER ,yyscanner)
+
+YY_BUFFER_STATE error__scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner );
+YY_BUFFER_STATE error__scan_string (yyconst char *yy_str ,yyscan_t yyscanner );
+YY_BUFFER_STATE error__scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner );
+
+void *error_alloc (yy_size_t ,yyscan_t yyscanner );
+void *error_realloc (void *,yy_size_t ,yyscan_t yyscanner );
+void error_free (void * ,yyscan_t yyscanner );
+
+#define yy_new_buffer error__create_buffer
+
+#define yy_set_interactive(is_interactive) \
+ { \
+ if ( ! YY_CURRENT_BUFFER ){ \
+ error_ensure_buffer_stack (yyscanner); \
+ YY_CURRENT_BUFFER_LVALUE = \
+ error__create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
+ } \
+ YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
+ }
+
+#define yy_set_bol(at_bol) \
+ { \
+ if ( ! YY_CURRENT_BUFFER ){\
+ error_ensure_buffer_stack (yyscanner); \
+ YY_CURRENT_BUFFER_LVALUE = \
+ error__create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
+ } \
+ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
+ }
+
+#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
+
+/* Begin user sect3 */
+
+#define error_wrap(n) 1
+#define YY_SKIP_YYWRAP
+
+typedef unsigned char YY_CHAR;
+
+typedef int yy_state_type;
+
+#define yytext_ptr yytext_r
+
+static yy_state_type yy_get_previous_state (yyscan_t yyscanner );
+static yy_state_type yy_try_NUL_trans (yy_state_type current_state ,yyscan_t yyscanner);
+static int yy_get_next_buffer (yyscan_t yyscanner );
+static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner );
+
+/* Done after the current pattern has been matched and before the
+ * corresponding action - sets up yytext.
+ */
+#define YY_DO_BEFORE_ACTION \
+ yyg->yytext_ptr = yy_bp; \
+ yyleng = (size_t) (yy_cp - yy_bp); \
+ yyg->yy_hold_char = *yy_cp; \
+ *yy_cp = '\0'; \
+ yyg->yy_c_buf_p = yy_cp;
+
+#define YY_NUM_RULES 29
+#define YY_END_OF_BUFFER 30
+/* This struct is not used in this scanner,
+ but its presence is necessary. */
+struct yy_trans_info
+ {
+ flex_int32_t yy_verify;
+ flex_int32_t yy_nxt;
+ };
+static yyconst flex_int16_t yy_accept[264] =
+ { 0,
+ 0, 0, 30, 28, 6, 2, 3, 4, 27, 5,
+ 26, 26, 6, 1, 27, 26, 26, 26, 26, 26,
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
+ 26, 17, 26, 26, 26, 26, 26, 26, 26, 26,
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
+ 26, 26, 26, 26, 26, 26, 16, 26, 26, 26,
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
+
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
+ 26, 26, 26, 26, 26, 26, 26, 26, 23, 26,
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 26,
+ 26, 26, 26, 26, 26, 26, 26, 26, 26, 25,
+ 26, 26, 26, 26, 26, 26, 26, 26, 7, 26,
+ 26, 26, 26, 12, 11, 26, 26, 26, 26, 26,
+
+ 21, 26, 26, 26, 26, 26, 26, 26, 26, 26,
+ 26, 26, 8, 26, 26, 26, 24, 26, 26, 26,
+ 26, 13, 26, 26, 26, 26, 26, 26, 26, 26,
+ 20, 9, 26, 15, 26, 26, 14, 26, 26, 26,
+ 26, 26, 26, 10, 26, 26, 26, 26, 26, 26,
+ 26, 26, 26, 26, 26, 26, 19, 26, 18, 26,
+ 26, 22, 0
+ } ;
+
+static yyconst flex_int32_t yy_ec[256] =
+ { 0,
+ 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
+ 1, 1, 4, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 2, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 5, 6, 1, 1, 7, 7, 8,
+ 9, 7, 7, 7, 7, 7, 7, 10, 1, 1,
+ 1, 1, 1, 1, 11, 12, 13, 14, 15, 16,
+ 17, 18, 19, 20, 21, 22, 23, 24, 25, 26,
+ 27, 28, 29, 30, 31, 32, 33, 20, 34, 20,
+ 1, 1, 1, 1, 35, 1, 36, 37, 38, 39,
+
+ 40, 41, 42, 43, 44, 20, 45, 46, 47, 48,
+ 49, 50, 51, 52, 53, 54, 55, 56, 57, 20,
+ 58, 20, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1
+ } ;
+
+static yyconst flex_int32_t yy_meta[59] =
+ { 0,
+ 1, 1, 1, 1, 1, 2, 2, 2, 2, 1,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2
+ } ;
+
+static yyconst flex_int16_t yy_base[267] =
+ { 0,
+ 0, 10, 497, 513, 494, 513, 489, 513, 14, 513,
+ 0, 8, 489, 513, 18, 0, 14, 452, 59, 15,
+ 0, 11, 15, 27, 9, 13, 9, 12, 25, 27,
+ 450, 36, 423, 32, 53, 29, 61, 52, 66, 52,
+ 81, 74, 82, 82, 54, 81, 86, 90, 92, 94,
+ 97, 0, 401, 108, 96, 104, 112, 118, 117, 114,
+ 110, 111, 114, 124, 126, 121, 123, 120, 136, 138,
+ 140, 149, 148, 379, 143, 156, 358, 145, 144, 158,
+ 151, 162, 168, 166, 155, 160, 0, 173, 171, 174,
+ 352, 174, 178, 170, 330, 164, 170, 187, 171, 182,
+
+ 185, 185, 185, 192, 210, 207, 207, 200, 203, 219,
+ 204, 209, 297, 255, 248, 204, 221, 227, 233, 196,
+ 214, 211, 217, 147, 231, 220, 221, 225, 228, 228,
+ 245, 247, 253, 239, 243, 249, 262, 246, 251, 264,
+ 267, 107, 258, 99, 258, 269, 275, 262, 44, 275,
+ 282, 284, 289, 283, 281, 281, 296, 298, 30, 286,
+ 292, 294, 293, 290, 307, 298, 296, 299, 312, 309,
+ 324, 310, 310, 325, 319, 314, 320, 330, 338, 0,
+ 335, 334, 328, 337, 339, 347, 336, 344, 0, 359,
+ 348, 350, 356, 0, 0, 349, 17, 358, 359, 367,
+
+ 0, 359, 381, 370, 370, 384, 388, 377, 373, 391,
+ 393, 379, 0, 380, 396, 385, 0, 386, 397, 392,
+ 13, 0, 387, 394, 410, 400, 411, 424, 415, 428,
+ 0, 0, 12, 0, 421, 414, 0, 431, 419, 427,
+ 7, 426, 435, 0, 433, 446, 436, 437, 451, 445,
+ 451, 449, 447, 454, 452, 460, 0, 459, 0, 451,
+ 450, 0, 513, 508, 510, 4
+ } ;
+
+static yyconst flex_int16_t yy_def[267] =
+ { 0,
+ 264, 265, 263, 263, 263, 263, 263, 263, 263, 263,
+ 266, 266, 263, 263, 263, 266, 266, 266, 266, 266,
+ 266, 266, 266, 266, 266, 266, 266, 266, 266, 266,
+ 266, 266, 266, 266, 266, 266, 266, 266, 266, 266,
+ 266, 266, 266, 266, 266, 266, 266, 266, 266, 266,
+ 266, 266, 266, 266, 266, 266, 266, 266, 266, 266,
+ 266, 266, 266, 266, 266, 266, 266, 266, 266, 266,
+ 266, 266, 266, 266, 266, 266, 266, 266, 266, 266,
+ 266, 266, 266, 266, 266, 266, 266, 266, 266, 266,
+ 266, 266, 266, 266, 266, 266, 266, 266, 266, 266,
+
+ 266, 266, 266, 266, 266, 266, 266, 266, 266, 266,
+ 266, 266, 266, 266, 266, 266, 266, 266, 266, 266,
+ 266, 266, 266, 266, 266, 266, 266, 266, 266, 266,
+ 266, 266, 266, 266, 266, 266, 266, 266, 266, 266,
+ 266, 266, 266, 266, 266, 266, 266, 266, 266, 266,
+ 266, 266, 266, 266, 266, 266, 266, 266, 266, 266,
+ 266, 266, 266, 266, 266, 266, 266, 266, 266, 266,
+ 266, 266, 266, 266, 266, 266, 266, 266, 266, 266,
+ 266, 266, 266, 266, 266, 266, 266, 266, 266, 266,
+ 266, 266, 266, 266, 266, 266, 266, 266, 266, 266,
+
+ 266, 266, 266, 266, 266, 266, 266, 266, 266, 266,
+ 266, 266, 266, 266, 266, 266, 266, 266, 266, 266,
+ 266, 266, 266, 266, 266, 266, 266, 266, 266, 266,
+ 266, 266, 266, 266, 266, 266, 266, 266, 266, 266,
+ 266, 266, 266, 266, 266, 266, 266, 266, 266, 266,
+ 266, 266, 266, 266, 266, 266, 266, 266, 266, 266,
+ 266, 266, 0, 263, 263, 263
+ } ;
+
+static yyconst flex_int16_t yy_nxt[572] =
+ { 0,
+ 263, 5, 6, 7, 8, 16, 9, 9, 9, 10,
+ 4, 5, 6, 7, 8, 4, 9, 9, 9, 10,
+ 15, 15, 15, 17, 15, 15, 15, 18, 31, 263,
+ 32, 33, 34, 36, 37, 35, 39, 40, 41, 42,
+ 38, 245, 12, 43, 4, 44, 239, 230, 17, 46,
+ 48, 209, 18, 31, 32, 33, 34, 51, 36, 35,
+ 39, 40, 41, 42, 175, 38, 12, 20, 43, 21,
+ 44, 22, 23, 52, 46, 48, 49, 24, 165, 53,
+ 54, 51, 55, 50, 25, 60, 26, 27, 28, 29,
+ 30, 56, 57, 58, 21, 59, 22, 23, 52, 61,
+
+ 49, 62, 24, 53, 63, 54, 55, 50, 25, 60,
+ 26, 27, 28, 29, 30, 64, 56, 57, 58, 66,
+ 59, 65, 67, 69, 61, 71, 62, 72, 73, 63,
+ 74, 75, 76, 160, 77, 78, 70, 79, 80, 64,
+ 81, 158, 82, 66, 83, 65, 67, 84, 69, 71,
+ 85, 72, 86, 73, 87, 74, 75, 76, 77, 78,
+ 70, 79, 88, 80, 89, 81, 82, 91, 83, 92,
+ 96, 84, 94, 95, 97, 85, 98, 86, 99, 87,
+ 100, 140, 101, 102, 103, 104, 105, 88, 108, 89,
+ 109, 91, 110, 112, 92, 96, 94, 95, 97, 113,
+
+ 114, 98, 106, 99, 115, 100, 101, 102, 116, 103,
+ 104, 105, 117, 108, 118, 109, 110, 112, 119, 120,
+ 121, 122, 123, 113, 124, 114, 106, 125, 115, 126,
+ 136, 127, 116, 128, 132, 133, 117, 134, 118, 137,
+ 138, 139, 119, 120, 141, 121, 122, 123, 124, 142,
+ 143, 125, 144, 145, 126, 127, 146, 128, 132, 147,
+ 133, 148, 134, 137, 138, 139, 149, 135, 150, 141,
+ 151, 152, 153, 142, 143, 154, 144, 145, 155, 156,
+ 146, 157, 131, 159, 147, 161, 148, 162, 163, 130,
+ 164, 149, 150, 166, 151, 152, 167, 153, 168, 154,
+
+ 169, 170, 155, 171, 156, 172, 157, 159, 173, 161,
+ 174, 179, 162, 163, 164, 176, 177, 178, 166, 180,
+ 181, 167, 182, 168, 183, 169, 170, 171, 184, 172,
+ 185, 129, 186, 173, 187, 174, 179, 188, 189, 176,
+ 177, 178, 190, 180, 191, 181, 182, 192, 183, 193,
+ 194, 195, 184, 196, 199, 185, 186, 197, 198, 187,
+ 200, 188, 189, 201, 111, 202, 203, 190, 191, 204,
+ 207, 192, 205, 193, 194, 206, 195, 208, 196, 199,
+ 210, 197, 198, 211, 200, 212, 107, 213, 201, 202,
+ 203, 214, 93, 215, 204, 207, 205, 216, 217, 206,
+
+ 218, 208, 219, 220, 210, 221, 222, 211, 223, 224,
+ 212, 213, 225, 90, 226, 227, 214, 215, 228, 229,
+ 231, 216, 232, 217, 233, 218, 219, 220, 234, 235,
+ 221, 222, 223, 224, 236, 68, 237, 225, 226, 227,
+ 238, 242, 228, 229, 231, 240, 232, 241, 243, 233,
+ 244, 246, 234, 247, 235, 248, 249, 47, 250, 236,
+ 237, 251, 252, 253, 254, 238, 242, 255, 257, 240,
+ 256, 241, 243, 258, 244, 246, 259, 260, 247, 248,
+ 261, 249, 250, 262, 45, 251, 19, 252, 253, 254,
+ 13, 14, 255, 257, 256, 13, 263, 258, 263, 263,
+
+ 263, 259, 260, 263, 261, 263, 263, 262, 4, 4,
+ 11, 11, 3, 263, 263, 263, 263, 263, 263, 263,
+ 263, 263, 263, 263, 263, 263, 263, 263, 263, 263,
+ 263, 263, 263, 263, 263, 263, 263, 263, 263, 263,
+ 263, 263, 263, 263, 263, 263, 263, 263, 263, 263,
+ 263, 263, 263, 263, 263, 263, 263, 263, 263, 263,
+ 263, 263, 263, 263, 263, 263, 263, 263, 263, 263,
+ 263
+ } ;
+
+static yyconst flex_int16_t yy_chk[572] =
+ { 0,
+ 0, 1, 1, 1, 1, 266, 1, 1, 1, 1,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 9, 9, 9, 12, 15, 15, 15, 17, 20, 0,
+ 21, 21, 22, 23, 24, 22, 25, 26, 27, 28,
+ 24, 241, 2, 29, 2, 30, 233, 221, 12, 32,
+ 34, 197, 17, 20, 21, 21, 22, 36, 23, 22,
+ 25, 26, 27, 28, 159, 24, 2, 19, 29, 19,
+ 30, 19, 19, 37, 32, 34, 35, 19, 149, 38,
+ 39, 36, 40, 35, 19, 45, 19, 19, 19, 19,
+ 19, 41, 42, 43, 19, 44, 19, 19, 37, 46,
+
+ 35, 47, 19, 38, 48, 39, 40, 35, 19, 45,
+ 19, 19, 19, 19, 19, 49, 41, 42, 43, 50,
+ 44, 49, 51, 54, 46, 55, 47, 56, 57, 48,
+ 58, 59, 60, 144, 61, 62, 54, 63, 64, 49,
+ 65, 142, 66, 50, 67, 49, 51, 68, 54, 55,
+ 69, 56, 70, 57, 71, 58, 59, 60, 61, 62,
+ 54, 63, 72, 64, 73, 65, 66, 75, 67, 76,
+ 80, 68, 78, 79, 81, 69, 82, 70, 83, 71,
+ 84, 124, 85, 86, 88, 89, 90, 72, 92, 73,
+ 93, 75, 94, 96, 76, 80, 78, 79, 81, 97,
+
+ 98, 82, 90, 83, 99, 84, 85, 86, 100, 88,
+ 89, 90, 101, 92, 102, 93, 94, 96, 103, 104,
+ 105, 106, 107, 97, 108, 98, 90, 109, 99, 110,
+ 120, 111, 100, 112, 116, 117, 101, 118, 102, 121,
+ 122, 123, 103, 104, 125, 105, 106, 107, 108, 126,
+ 127, 109, 128, 129, 110, 111, 130, 112, 116, 131,
+ 117, 132, 118, 121, 122, 123, 133, 119, 134, 125,
+ 135, 136, 137, 126, 127, 138, 128, 129, 139, 140,
+ 130, 141, 115, 143, 131, 145, 132, 146, 147, 114,
+ 148, 133, 134, 150, 135, 136, 151, 137, 152, 138,
+
+ 153, 154, 139, 155, 140, 156, 141, 143, 157, 145,
+ 158, 163, 146, 147, 148, 160, 161, 162, 150, 164,
+ 165, 151, 166, 152, 167, 153, 154, 155, 168, 156,
+ 169, 113, 170, 157, 171, 158, 163, 172, 173, 160,
+ 161, 162, 174, 164, 175, 165, 166, 176, 167, 177,
+ 178, 179, 168, 181, 184, 169, 170, 182, 183, 171,
+ 185, 172, 173, 186, 95, 187, 188, 174, 175, 190,
+ 193, 176, 191, 177, 178, 192, 179, 196, 181, 184,
+ 198, 182, 183, 199, 185, 200, 91, 202, 186, 187,
+ 188, 203, 77, 204, 190, 193, 191, 205, 206, 192,
+
+ 207, 196, 208, 209, 198, 210, 211, 199, 212, 214,
+ 200, 202, 215, 74, 216, 218, 203, 204, 219, 220,
+ 223, 205, 224, 206, 225, 207, 208, 209, 226, 227,
+ 210, 211, 212, 214, 228, 53, 229, 215, 216, 218,
+ 230, 238, 219, 220, 223, 235, 224, 236, 239, 225,
+ 240, 242, 226, 243, 227, 245, 246, 33, 247, 228,
+ 229, 248, 249, 250, 251, 230, 238, 252, 254, 235,
+ 253, 236, 239, 255, 240, 242, 256, 258, 243, 245,
+ 260, 246, 247, 261, 31, 248, 18, 249, 250, 251,
+ 13, 7, 252, 254, 253, 5, 3, 255, 0, 0,
+
+ 0, 256, 258, 0, 260, 0, 0, 261, 264, 264,
+ 265, 265, 263, 263, 263, 263, 263, 263, 263, 263,
+ 263, 263, 263, 263, 263, 263, 263, 263, 263, 263,
+ 263, 263, 263, 263, 263, 263, 263, 263, 263, 263,
+ 263, 263, 263, 263, 263, 263, 263, 263, 263, 263,
+ 263, 263, 263, 263, 263, 263, 263, 263, 263, 263,
+ 263, 263, 263, 263, 263, 263, 263, 263, 263, 263,
+ 263
+ } ;
+
+/* The intent behind this definition is that it'll catch
+ * any uses of REJECT which flex missed.
+ */
+#define REJECT reject_used_but_not_detected
+#define yymore() yymore_used_but_not_detected
+#define YY_MORE_ADJ 0
+#define YY_RESTORE_YY_MORE_OFFSET
+
+#include <string>
+
+#include "parser.h"
+
+#define yyterminate() return(END)
+
+#define INITIAL 0
+
+#ifndef YY_NO_UNISTD_H
+/* Special case for "unistd.h", since it is non-ANSI. We include it way
+ * down here because we want the user's section 1 to have been scanned first.
+ * The user has a chance to override it with an option.
+ */
+#include <unistd.h>
+#endif
+
+#define YY_EXTRA_TYPE bool
+
+/* Holds the entire state of the reentrant scanner. */
+struct yyguts_t
+ {
+
+ /* User-defined. Not touched by flex. */
+ YY_EXTRA_TYPE yyextra_r;
+
+ /* The rest are the same as the globals declared in the non-reentrant scanner. */
+ FILE *yyin_r, *yyout_r;
+ size_t yy_buffer_stack_top; /**< index of top of stack. */
+ size_t yy_buffer_stack_max; /**< capacity of stack. */
+ YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */
+ char yy_hold_char;
+ int yy_n_chars;
+ int yyleng_r;
+ char *yy_c_buf_p;
+ int yy_init;
+ int yy_start;
+ int yy_did_buffer_switch_on_eof;
+ int yy_start_stack_ptr;
+ int yy_start_stack_depth;
+ int *yy_start_stack;
+ yy_state_type yy_last_accepting_state;
+ char* yy_last_accepting_cpos;
+
+ int yylineno_r;
+ int yy_flex_debug_r;
+
+ char *yytext_r;
+ int yy_more_flag;
+ int yy_more_len;
+
+ YYSTYPE * yylval_r;
+
+ }; /* end struct yyguts_t */
+
+static int yy_init_globals (yyscan_t yyscanner );
+
+ /* This must go here because YYSTYPE and YYLTYPE are included
+ * from bison output in section 1.*/
+ # define yylval yyg->yylval_r
+
+int error_lex_init (yyscan_t* scanner);
+
+int error_lex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner);
+
+/* Accessor methods to globals.
+ These are made visible to non-reentrant scanners for convenience. */
+
+int error_lex_destroy (yyscan_t yyscanner );
+
+int error_get_debug (yyscan_t yyscanner );
+
+void error_set_debug (int debug_flag ,yyscan_t yyscanner );
+
+YY_EXTRA_TYPE error_get_extra (yyscan_t yyscanner );
+
+void error_set_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner );
+
+FILE *error_get_in (yyscan_t yyscanner );
+
+void error_set_in (FILE * in_str ,yyscan_t yyscanner );
+
+FILE *error_get_out (yyscan_t yyscanner );
+
+void error_set_out (FILE * out_str ,yyscan_t yyscanner );
+
+int error_get_leng (yyscan_t yyscanner );
+
+char *error_get_text (yyscan_t yyscanner );
+
+int error_get_lineno (yyscan_t yyscanner );
+
+void error_set_lineno (int line_number ,yyscan_t yyscanner );
+
+YYSTYPE * error_get_lval (yyscan_t yyscanner );
+
+void error_set_lval (YYSTYPE * yylval_param ,yyscan_t yyscanner );
+
+/* Macros after this point can all be overridden by user definitions in
+ * section 1.
+ */
+
+#ifndef YY_SKIP_YYWRAP
+#ifdef __cplusplus
+extern "C" int error_wrap (yyscan_t yyscanner );
+#else
+extern int error_wrap (yyscan_t yyscanner );
+#endif
+#endif
+
+#ifndef yytext_ptr
+static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner);
+#endif
+
+#ifdef YY_NEED_STRLEN
+static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner);
+#endif
+
+#ifndef YY_NO_INPUT
+
+#ifdef __cplusplus
+static int yyinput (yyscan_t yyscanner );
+#else
+static int input (yyscan_t yyscanner );
+#endif
+
+#endif
+
+/* Amount of stuff to slurp up with each read. */
+#ifndef YY_READ_BUF_SIZE
+#ifdef __ia64__
+/* On IA-64, the buffer size is 16k, not 8k */
+#define YY_READ_BUF_SIZE 16384
+#else
+#define YY_READ_BUF_SIZE 8192
+#endif /* __ia64__ */
+#endif
+
+/* Copy whatever the last rule matched to the standard output. */
+#ifndef ECHO
+/* This used to be an fputs(), but since the string might contain NUL's,
+ * we now use fwrite().
+ */
+#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
+#endif
+
+/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
+ * is returned in "result".
+ */
+#ifndef YY_INPUT
+#define YY_INPUT(buf,result,max_size) \
+ if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
+ { \
+ int c = '*'; \
+ size_t n; \
+ for ( n = 0; n < max_size && \
+ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
+ buf[n] = (char) c; \
+ if ( c == '\n' ) \
+ buf[n++] = (char) c; \
+ if ( c == EOF && ferror( yyin ) ) \
+ YY_FATAL_ERROR( "input in flex scanner failed" ); \
+ result = n; \
+ } \
+ else \
+ { \
+ errno=0; \
+ while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
+ { \
+ if( errno != EINTR) \
+ { \
+ YY_FATAL_ERROR( "input in flex scanner failed" ); \
+ break; \
+ } \
+ errno=0; \
+ clearerr(yyin); \
+ } \
+ }\
+\
+
+#endif
+
+/* No semi-colon after return; correct usage is to write "yyterminate();" -
+ * we don't want an extra ';' after the "return" because that will cause
+ * some compilers to complain about unreachable statements.
+ */
+#ifndef yyterminate
+#define yyterminate() return YY_NULL
+#endif
+
+/* Number of entries by which start-condition stack grows. */
+#ifndef YY_START_STACK_INCR
+#define YY_START_STACK_INCR 25
+#endif
+
+/* Report a fatal error. */
+#ifndef YY_FATAL_ERROR
+#define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner)
+#endif
+
+/* end tables serialization structures and prototypes */
+
+/* Default declaration of generated scanner - a define so the user can
+ * easily add parameters.
+ */
+#ifndef YY_DECL
+#define YY_DECL_IS_OURS 1
+
+extern int error_lex \
+ (YYSTYPE * yylval_param ,yyscan_t yyscanner);
+
+#define YY_DECL int error_lex \
+ (YYSTYPE * yylval_param , yyscan_t yyscanner)
+#endif /* !YY_DECL */
+
+/* Code executed at the beginning of each rule, after yytext and yyleng
+ * have been set up.
+ */
+#ifndef YY_USER_ACTION
+#define YY_USER_ACTION
+#endif
+
+/* Code executed at the end of each rule. */
+#ifndef YY_BREAK
+#define YY_BREAK break;
+#endif
+
+#define YY_RULE_SETUP \
+ if ( yyleng > 0 ) \
+ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \
+ (yytext[yyleng - 1] == '\n'); \
+ YY_USER_ACTION
+
+/** The main scanner function which does all the work.
+ */
+YY_DECL
+{
+ register yy_state_type yy_current_state;
+ register char *yy_cp, *yy_bp;
+ register int yy_act;
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+
+ /* skip these */
+
+ yylval = yylval_param;
+
+ if ( !yyg->yy_init )
+ {
+ yyg->yy_init = 1;
+
+#ifdef YY_USER_INIT
+ YY_USER_INIT;
+#endif
+
+ if ( ! yyg->yy_start )
+ yyg->yy_start = 1; /* first start state */
+
+ if ( ! yyin )
+ yyin = stdin;
+
+ if ( ! yyout )
+ yyout = stdout;
+
+ if ( ! YY_CURRENT_BUFFER ) {
+ error_ensure_buffer_stack (yyscanner);
+ YY_CURRENT_BUFFER_LVALUE =
+ error__create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
+ }
+
+ error__load_buffer_state(yyscanner );
+ }
+
+ while ( 1 ) /* loops until end-of-file is reached */
+ {
+ yy_cp = yyg->yy_c_buf_p;
+
+ /* Support of yytext. */
+ *yy_cp = yyg->yy_hold_char;
+
+ /* yy_bp points to the position in yy_ch_buf of the start of
+ * the current run.
+ */
+ yy_bp = yy_cp;
+
+ yy_current_state = yyg->yy_start;
+ yy_current_state += YY_AT_BOL();
+yy_match:
+ do
+ {
+ register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
+ if ( yy_accept[yy_current_state] )
+ {
+ yyg->yy_last_accepting_state = yy_current_state;
+ yyg->yy_last_accepting_cpos = yy_cp;
+ }
+ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+ {
+ yy_current_state = (int) yy_def[yy_current_state];
+ if ( yy_current_state >= 264 )
+ yy_c = yy_meta[(unsigned int) yy_c];
+ }
+ yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+ ++yy_cp;
+ }
+ while ( yy_current_state != 263 );
+ yy_cp = yyg->yy_last_accepting_cpos;
+ yy_current_state = yyg->yy_last_accepting_state;
+
+yy_find_action:
+ yy_act = yy_accept[yy_current_state];
+
+ YY_DO_BEFORE_ACTION;
+
+do_action: /* This label is used only to access EOF actions. */
+
+ switch ( yy_act )
+ { /* beginning of action switch */
+ case 0: /* must back up */
+ /* undo the effects of YY_DO_BEFORE_ACTION */
+ *yy_cp = yyg->yy_hold_char;
+ yy_cp = yyg->yy_last_accepting_cpos;
+ yy_current_state = yyg->yy_last_accepting_state;
+ goto yy_find_action;
+
+case 1:
+/* rule 1 can match eol */
+YY_RULE_SETUP
+{ }
+ YY_BREAK
+case 2:
+/* rule 2 can match eol */
+YY_RULE_SETUP
+{ }
+ YY_BREAK
+case 3:
+YY_RULE_SETUP
+{ }
+ YY_BREAK
+/* Convert these */
+case 4:
+YY_RULE_SETUP
+{ return ','; }
+ YY_BREAK
+case 5:
+YY_RULE_SETUP
+{ return ':'; }
+ YY_BREAK
+case 6:
+YY_RULE_SETUP
+return WFD_SP;
+ YY_BREAK
+case 7:
+YY_RULE_SETUP
+{
+ return WFD_AUDIO_CODECS_ERROR;
+ }
+ YY_BREAK
+case 8:
+YY_RULE_SETUP
+{
+ return WFD_VIDEO_FORMATS_ERROR;
+ }
+ YY_BREAK
+case 9:
+YY_RULE_SETUP
+{
+ return WFD_3D_FORMATS_ERROR;
+ }
+ YY_BREAK
+case 10:
+YY_RULE_SETUP
+{
+ return WFD_CONTENT_PROTECTION_ERROR;
+ }
+ YY_BREAK
+case 11:
+YY_RULE_SETUP
+{
+ return WFD_DISPLAY_EDID_ERROR;
+ }
+ YY_BREAK
+case 12:
+YY_RULE_SETUP
+{
+ return WFD_COUPLED_SINK_ERROR;
+ }
+ YY_BREAK
+case 13:
+YY_RULE_SETUP
+{
+ return WFD_TRIGGER_METHOD_ERROR;
+ }
+ YY_BREAK
+case 14:
+YY_RULE_SETUP
+{
+ return WFD_PRESENTATION_URL_ERROR;
+ }
+ YY_BREAK
+case 15:
+YY_RULE_SETUP
+{
+ return WFD_CLIENT_RTP_PORTS_ERROR;
+ }
+ YY_BREAK
+case 16:
+YY_RULE_SETUP
+{
+ return WFD_ROUTE_ERROR;
+ }
+ YY_BREAK
+case 17:
+YY_RULE_SETUP
+{
+ return WFD_I2C_ERROR;
+ }
+ YY_BREAK
+case 18:
+YY_RULE_SETUP
+{
+ return WFD_AV_FORMAT_CHANGE_TIMING_ERROR;
+ }
+ YY_BREAK
+case 19:
+YY_RULE_SETUP
+{
+ return WFD_PREFERRED_DISPLAY_MODE_ERROR;
+ }
+ YY_BREAK
+case 20:
+YY_RULE_SETUP
+{
+ return WFD_UIBC_CAPABILITY_ERROR;
+ }
+ YY_BREAK
+case 21:
+YY_RULE_SETUP
+{
+ return WFD_UIBC_SETTING_ERROR;
+ }
+ YY_BREAK
+case 22:
+YY_RULE_SETUP
+{
+ return WFD_STANDBY_RESUME_CAPABILITY_ERROR;
+ }
+ YY_BREAK
+case 23:
+YY_RULE_SETUP
+{
+ return WFD_STANDBY_ERROR;
+ }
+ YY_BREAK
+case 24:
+YY_RULE_SETUP
+{
+ return WFD_CONNECTOR_TYPE_ERROR;
+ }
+ YY_BREAK
+case 25:
+YY_RULE_SETUP
+{
+ return WFD_IDR_REQUEST_ERROR;
+ }
+ YY_BREAK
+case 26:
+YY_RULE_SETUP
+{
+ yylval->sval = new std::string(yytext, yyleng);
+ return WFD_GENERIC_PROPERTY_ERROR;
+ }
+ YY_BREAK
+case 27:
+YY_RULE_SETUP
+{
+ std::string str(yytext, yyleng);
+ str += '\0';
+ errno = 0;
+ yylval->nval = strtoull(str.c_str(), NULL, 10);
+ if (errno)
+ yyterminate();
+ return WFD_NUM;
+ }
+ YY_BREAK
+/* all unmatched */
+case 28:
+YY_RULE_SETUP
+{}
+ YY_BREAK
+case 29:
+YY_RULE_SETUP
+YY_FATAL_ERROR( "flex scanner jammed" );
+ YY_BREAK
+case YY_STATE_EOF(INITIAL):
+ yyterminate();
+
+ case YY_END_OF_BUFFER:
+ {
+ /* Amount of text matched not including the EOB char. */
+ int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1;
+
+ /* Undo the effects of YY_DO_BEFORE_ACTION. */
+ *yy_cp = yyg->yy_hold_char;
+ YY_RESTORE_YY_MORE_OFFSET
+
+ if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
+ {
+ /* We're scanning a new file or input source. It's
+ * possible that this happened because the user
+ * just pointed yyin at a new source and called
+ * error_lex(). If so, then we have to assure
+ * consistency between YY_CURRENT_BUFFER and our
+ * globals. Here is the right place to do so, because
+ * this is the first action (other than possibly a
+ * back-up) that will match for the new input source.
+ */
+ yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
+ YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
+ YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
+ }
+
+ /* Note that here we test for yy_c_buf_p "<=" to the position
+ * of the first EOB in the buffer, since yy_c_buf_p will
+ * already have been incremented past the NUL character
+ * (since all states make transitions on EOB to the
+ * end-of-buffer state). Contrast this with the test
+ * in input().
+ */
+ if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
+ { /* This was really a NUL. */
+ yy_state_type yy_next_state;
+
+ yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text;
+
+ yy_current_state = yy_get_previous_state( yyscanner );
+
+ /* Okay, we're now positioned to make the NUL
+ * transition. We couldn't have
+ * yy_get_previous_state() go ahead and do it
+ * for us because it doesn't know how to deal
+ * with the possibility of jamming (and we don't
+ * want to build jamming into it because then it
+ * will run more slowly).
+ */
+
+ yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner);
+
+ yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
+
+ if ( yy_next_state )
+ {
+ /* Consume the NUL. */
+ yy_cp = ++yyg->yy_c_buf_p;
+ yy_current_state = yy_next_state;
+ goto yy_match;
+ }
+
+ else
+ {
+ yy_cp = yyg->yy_last_accepting_cpos;
+ yy_current_state = yyg->yy_last_accepting_state;
+ goto yy_find_action;
+ }
+ }
+
+ else switch ( yy_get_next_buffer( yyscanner ) )
+ {
+ case EOB_ACT_END_OF_FILE:
+ {
+ yyg->yy_did_buffer_switch_on_eof = 0;
+
+ if ( error_wrap(yyscanner ) )
+ {
+ /* Note: because we've taken care in
+ * yy_get_next_buffer() to have set up
+ * yytext, we can now set up
+ * yy_c_buf_p so that if some total
+ * hoser (like flex itself) wants to
+ * call the scanner after we return the
+ * YY_NULL, it'll still work - another
+ * YY_NULL will get returned.
+ */
+ yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ;
+
+ yy_act = YY_STATE_EOF(YY_START);
+ goto do_action;
+ }
+
+ else
+ {
+ if ( ! yyg->yy_did_buffer_switch_on_eof )
+ YY_NEW_FILE;
+ }
+ break;
+ }
+
+ case EOB_ACT_CONTINUE_SCAN:
+ yyg->yy_c_buf_p =
+ yyg->yytext_ptr + yy_amount_of_matched_text;
+
+ yy_current_state = yy_get_previous_state( yyscanner );
+
+ yy_cp = yyg->yy_c_buf_p;
+ yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
+ goto yy_match;
+
+ case EOB_ACT_LAST_MATCH:
+ yyg->yy_c_buf_p =
+ &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars];
+
+ yy_current_state = yy_get_previous_state( yyscanner );
+
+ yy_cp = yyg->yy_c_buf_p;
+ yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
+ goto yy_find_action;
+ }
+ break;
+ }
+
+ default:
+ YY_FATAL_ERROR(
+ "fatal flex scanner internal error--no action found" );
+ } /* end of action switch */
+ } /* end of scanning one token */
+} /* end of error_lex */
+
+/* yy_get_next_buffer - try to read in a new buffer
+ *
+ * Returns a code representing an action:
+ * EOB_ACT_LAST_MATCH -
+ * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
+ * EOB_ACT_END_OF_FILE - end of file
+ */
+static int yy_get_next_buffer (yyscan_t yyscanner)
+{
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+ register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
+ register char *source = yyg->yytext_ptr;
+ register int number_to_move, i;
+ int ret_val;
+
+ if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] )
+ YY_FATAL_ERROR(
+ "fatal flex scanner internal error--end of buffer missed" );
+
+ if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
+ { /* Don't try to fill the buffer, so this is an EOF. */
+ if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 )
+ {
+ /* We matched a single character, the EOB, so
+ * treat this as a final EOF.
+ */
+ return EOB_ACT_END_OF_FILE;
+ }
+
+ else
+ {
+ /* We matched some text prior to the EOB, first
+ * process it.
+ */
+ return EOB_ACT_LAST_MATCH;
+ }
+ }
+
+ /* Try to read more data. */
+
+ /* First move last chars to start of buffer. */
+ number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr) - 1;
+
+ for ( i = 0; i < number_to_move; ++i )
+ *(dest++) = *(source++);
+
+ if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
+ /* don't do the read, it's not guaranteed to return an EOF,
+ * just force an EOF
+ */
+ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0;
+
+ else
+ {
+ int num_to_read =
+ YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
+
+ while ( num_to_read <= 0 )
+ { /* Not enough room in the buffer - grow it. */
+
+ /* just a shorter name for the current buffer */
+ YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
+
+ int yy_c_buf_p_offset =
+ (int) (yyg->yy_c_buf_p - b->yy_ch_buf);
+
+ if ( b->yy_is_our_buffer )
+ {
+ int new_size = b->yy_buf_size * 2;
+
+ if ( new_size <= 0 )
+ b->yy_buf_size += b->yy_buf_size / 8;
+ else
+ b->yy_buf_size *= 2;
+
+ b->yy_ch_buf = (char *)
+ /* Include room in for 2 EOB chars. */
+ error_realloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ,yyscanner );
+ }
+ else
+ /* Can't grow it, we don't own it. */
+ b->yy_ch_buf = 0;
+
+ if ( ! b->yy_ch_buf )
+ YY_FATAL_ERROR(
+ "fatal error - scanner input buffer overflow" );
+
+ yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
+
+ num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
+ number_to_move - 1;
+
+ }
+
+ if ( num_to_read > YY_READ_BUF_SIZE )
+ num_to_read = YY_READ_BUF_SIZE;
+
+ /* Read in more data. */
+ YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
+ yyg->yy_n_chars, (size_t) num_to_read );
+
+ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
+ }
+
+ if ( yyg->yy_n_chars == 0 )
+ {
+ if ( number_to_move == YY_MORE_ADJ )
+ {
+ ret_val = EOB_ACT_END_OF_FILE;
+ error_restart(yyin ,yyscanner);
+ }
+
+ else
+ {
+ ret_val = EOB_ACT_LAST_MATCH;
+ YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
+ YY_BUFFER_EOF_PENDING;
+ }
+ }
+
+ else
+ ret_val = EOB_ACT_CONTINUE_SCAN;
+
+ if ((yy_size_t) (yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
+ /* Extend the array by 50%, plus the number we really need. */
+ yy_size_t new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1);
+ YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) error_realloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ,yyscanner );
+ if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
+ YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
+ }
+
+ yyg->yy_n_chars += number_to_move;
+ YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR;
+ YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
+
+ yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
+
+ return ret_val;
+}
+
+/* yy_get_previous_state - get the state just before the EOB char was reached */
+
+ static yy_state_type yy_get_previous_state (yyscan_t yyscanner)
+{
+ register yy_state_type yy_current_state;
+ register char *yy_cp;
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+
+ yy_current_state = yyg->yy_start;
+ yy_current_state += YY_AT_BOL();
+
+ for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp )
+ {
+ register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
+ if ( yy_accept[yy_current_state] )
+ {
+ yyg->yy_last_accepting_state = yy_current_state;
+ yyg->yy_last_accepting_cpos = yy_cp;
+ }
+ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+ {
+ yy_current_state = (int) yy_def[yy_current_state];
+ if ( yy_current_state >= 264 )
+ yy_c = yy_meta[(unsigned int) yy_c];
+ }
+ yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+ }
+
+ return yy_current_state;
+}
+
+/* yy_try_NUL_trans - try to make a transition on the NUL character
+ *
+ * synopsis
+ * next_state = yy_try_NUL_trans( current_state );
+ */
+ static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner)
+{
+ register int yy_is_jam;
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */
+ register char *yy_cp = yyg->yy_c_buf_p;
+
+ register YY_CHAR yy_c = 1;
+ if ( yy_accept[yy_current_state] )
+ {
+ yyg->yy_last_accepting_state = yy_current_state;
+ yyg->yy_last_accepting_cpos = yy_cp;
+ }
+ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+ {
+ yy_current_state = (int) yy_def[yy_current_state];
+ if ( yy_current_state >= 264 )
+ yy_c = yy_meta[(unsigned int) yy_c];
+ }
+ yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+ yy_is_jam = (yy_current_state == 263);
+
+ return yy_is_jam ? 0 : yy_current_state;
+}
+
+#ifndef YY_NO_INPUT
+#ifdef __cplusplus
+ static int yyinput (yyscan_t yyscanner)
+#else
+ static int input (yyscan_t yyscanner)
+#endif
+
+{
+ int c;
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+
+ *yyg->yy_c_buf_p = yyg->yy_hold_char;
+
+ if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
+ {
+ /* yy_c_buf_p now points to the character we want to return.
+ * If this occurs *before* the EOB characters, then it's a
+ * valid NUL; if not, then we've hit the end of the buffer.
+ */
+ if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
+ /* This was really a NUL. */
+ *yyg->yy_c_buf_p = '\0';
+
+ else
+ { /* need more input */
+ int offset = yyg->yy_c_buf_p - yyg->yytext_ptr;
+ ++yyg->yy_c_buf_p;
+
+ switch ( yy_get_next_buffer( yyscanner ) )
+ {
+ case EOB_ACT_LAST_MATCH:
+ /* This happens because yy_g_n_b()
+ * sees that we've accumulated a
+ * token and flags that we need to
+ * try matching the token before
+ * proceeding. But for input(),
+ * there's no matching to consider.
+ * So convert the EOB_ACT_LAST_MATCH
+ * to EOB_ACT_END_OF_FILE.
+ */
+
+ /* Reset buffer status. */
+ error_restart(yyin ,yyscanner);
+
+ /*FALLTHROUGH*/
+
+ case EOB_ACT_END_OF_FILE:
+ {
+ if ( error_wrap(yyscanner ) )
+ return EOF;
+
+ if ( ! yyg->yy_did_buffer_switch_on_eof )
+ YY_NEW_FILE;
+#ifdef __cplusplus
+ return yyinput(yyscanner);
+#else
+ return input(yyscanner);
+#endif
+ }
+
+ case EOB_ACT_CONTINUE_SCAN:
+ yyg->yy_c_buf_p = yyg->yytext_ptr + offset;
+ break;
+ }
+ }
+ }
+
+ c = *(unsigned char *) yyg->yy_c_buf_p; /* cast for 8-bit char's */
+ *yyg->yy_c_buf_p = '\0'; /* preserve yytext */
+ yyg->yy_hold_char = *++yyg->yy_c_buf_p;
+
+ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n');
+
+ return c;
+}
+#endif /* ifndef YY_NO_INPUT */
+
+/** Immediately switch to a different input stream.
+ * @param input_file A readable stream.
+ * @param yyscanner The scanner object.
+ * @note This function does not reset the start condition to @c INITIAL .
+ */
+ void error_restart (FILE * input_file , yyscan_t yyscanner)
+{
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+
+ if ( ! YY_CURRENT_BUFFER ){
+ error_ensure_buffer_stack (yyscanner);
+ YY_CURRENT_BUFFER_LVALUE =
+ error__create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
+ }
+
+ error__init_buffer(YY_CURRENT_BUFFER,input_file ,yyscanner);
+ error__load_buffer_state(yyscanner );
+}
+
+/** Switch to a different input buffer.
+ * @param new_buffer The new input buffer.
+ * @param yyscanner The scanner object.
+ */
+ void error__switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
+{
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+
+ /* TODO. We should be able to replace this entire function body
+ * with
+ * error_pop_buffer_state();
+ * error_push_buffer_state(new_buffer);
+ */
+ error_ensure_buffer_stack (yyscanner);
+ if ( YY_CURRENT_BUFFER == new_buffer )
+ return;
+
+ if ( YY_CURRENT_BUFFER )
+ {
+ /* Flush out information for old buffer. */
+ *yyg->yy_c_buf_p = yyg->yy_hold_char;
+ YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
+ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
+ }
+
+ YY_CURRENT_BUFFER_LVALUE = new_buffer;
+ error__load_buffer_state(yyscanner );
+
+ /* We don't actually know whether we did this switch during
+ * EOF (error_wrap()) processing, but the only time this flag
+ * is looked at is after error_wrap() is called, so it's safe
+ * to go ahead and always set it.
+ */
+ yyg->yy_did_buffer_switch_on_eof = 1;
+}
+
+static void error__load_buffer_state (yyscan_t yyscanner)
+{
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+ yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
+ yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
+ yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
+ yyg->yy_hold_char = *yyg->yy_c_buf_p;
+}
+
+/** Allocate and initialize an input buffer state.
+ * @param file A readable stream.
+ * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
+ * @param yyscanner The scanner object.
+ * @return the allocated buffer state.
+ */
+ YY_BUFFER_STATE error__create_buffer (FILE * file, int size , yyscan_t yyscanner)
+{
+ YY_BUFFER_STATE b;
+
+ b = (YY_BUFFER_STATE) error_alloc(sizeof( struct yy_buffer_state ) ,yyscanner );
+ if ( ! b )
+ YY_FATAL_ERROR( "out of dynamic memory in error__create_buffer()" );
+
+ b->yy_buf_size = size;
+
+ /* yy_ch_buf has to be 2 characters longer than the size given because
+ * we need to put in 2 end-of-buffer characters.
+ */
+ b->yy_ch_buf = (char *) error_alloc(b->yy_buf_size + 2 ,yyscanner );
+ if ( ! b->yy_ch_buf )
+ YY_FATAL_ERROR( "out of dynamic memory in error__create_buffer()" );
+
+ b->yy_is_our_buffer = 1;
+
+ error__init_buffer(b,file ,yyscanner);
+
+ return b;
+}
+
+/** Destroy the buffer.
+ * @param b a buffer created with error__create_buffer()
+ * @param yyscanner The scanner object.
+ */
+ void error__delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
+{
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+
+ if ( ! b )
+ return;
+
+ if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
+ YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
+
+ if ( b->yy_is_our_buffer )
+ error_free((void *) b->yy_ch_buf ,yyscanner );
+
+ error_free((void *) b ,yyscanner );
+}
+
+/* Initializes or reinitializes a buffer.
+ * This function is sometimes called more than once on the same buffer,
+ * such as during a error_restart() or at EOF.
+ */
+ static void error__init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner)
+
+{
+ int oerrno = errno;
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+
+ error__flush_buffer(b ,yyscanner);
+
+ b->yy_input_file = file;
+ b->yy_fill_buffer = 1;
+
+ /* If b is the current buffer, then error__init_buffer was _probably_
+ * called from error_restart() or through yy_get_next_buffer.
+ * In that case, we don't want to reset the lineno or column.
+ */
+ if (b != YY_CURRENT_BUFFER){
+ b->yy_bs_lineno = 1;
+ b->yy_bs_column = 0;
+ }
+
+ b->yy_is_interactive = 0;
+
+ errno = oerrno;
+}
+
+/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
+ * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
+ * @param yyscanner The scanner object.
+ */
+ void error__flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
+{
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+ if ( ! b )
+ return;
+
+ b->yy_n_chars = 0;
+
+ /* We always need two end-of-buffer characters. The first causes
+ * a transition to the end-of-buffer state. The second causes
+ * a jam in that state.
+ */
+ b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
+ b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
+
+ b->yy_buf_pos = &b->yy_ch_buf[0];
+
+ b->yy_at_bol = 1;
+ b->yy_buffer_status = YY_BUFFER_NEW;
+
+ if ( b == YY_CURRENT_BUFFER )
+ error__load_buffer_state(yyscanner );
+}
+
+/** Pushes the new state onto the stack. The new state becomes
+ * the current state. This function will allocate the stack
+ * if necessary.
+ * @param new_buffer The new state.
+ * @param yyscanner The scanner object.
+ */
+void error_push_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
+{
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+ if (new_buffer == NULL)
+ return;
+
+ error_ensure_buffer_stack(yyscanner);
+
+ /* This block is copied from error__switch_to_buffer. */
+ if ( YY_CURRENT_BUFFER )
+ {
+ /* Flush out information for old buffer. */
+ *yyg->yy_c_buf_p = yyg->yy_hold_char;
+ YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
+ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
+ }
+
+ /* Only push if top exists. Otherwise, replace top. */
+ if (YY_CURRENT_BUFFER)
+ yyg->yy_buffer_stack_top++;
+ YY_CURRENT_BUFFER_LVALUE = new_buffer;
+
+ /* copied from error__switch_to_buffer. */
+ error__load_buffer_state(yyscanner );
+ yyg->yy_did_buffer_switch_on_eof = 1;
+}
+
+/** Removes and deletes the top of the stack, if present.
+ * The next element becomes the new top.
+ * @param yyscanner The scanner object.
+ */
+void error_pop_buffer_state (yyscan_t yyscanner)
+{
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+ if (!YY_CURRENT_BUFFER)
+ return;
+
+ error__delete_buffer(YY_CURRENT_BUFFER ,yyscanner);
+ YY_CURRENT_BUFFER_LVALUE = NULL;
+ if (yyg->yy_buffer_stack_top > 0)
+ --yyg->yy_buffer_stack_top;
+
+ if (YY_CURRENT_BUFFER) {
+ error__load_buffer_state(yyscanner );
+ yyg->yy_did_buffer_switch_on_eof = 1;
+ }
+}
+
+/* Allocates the stack if it does not exist.
+ * Guarantees space for at least one push.
+ */
+static void error_ensure_buffer_stack (yyscan_t yyscanner)
+{
+ int num_to_alloc;
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+
+ if (!yyg->yy_buffer_stack) {
+
+ /* First allocation is just for 2 elements, since we don't know if this
+ * scanner will even need a stack. We use 2 instead of 1 to avoid an
+ * immediate realloc on the next call.
+ */
+ num_to_alloc = 1;
+ yyg->yy_buffer_stack = (struct yy_buffer_state**)error_alloc
+ (num_to_alloc * sizeof(struct yy_buffer_state*)
+ , yyscanner);
+ if ( ! yyg->yy_buffer_stack )
+ YY_FATAL_ERROR( "out of dynamic memory in error_ensure_buffer_stack()" );
+
+ memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*));
+
+ yyg->yy_buffer_stack_max = num_to_alloc;
+ yyg->yy_buffer_stack_top = 0;
+ return;
+ }
+
+ if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){
+
+ /* Increase the buffer to prepare for a possible push. */
+ int grow_size = 8 /* arbitrary grow size */;
+
+ num_to_alloc = yyg->yy_buffer_stack_max + grow_size;
+ yyg->yy_buffer_stack = (struct yy_buffer_state**)error_realloc
+ (yyg->yy_buffer_stack,
+ num_to_alloc * sizeof(struct yy_buffer_state*)
+ , yyscanner);
+ if ( ! yyg->yy_buffer_stack )
+ YY_FATAL_ERROR( "out of dynamic memory in error_ensure_buffer_stack()" );
+
+ /* zero only the new slots.*/
+ memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*));
+ yyg->yy_buffer_stack_max = num_to_alloc;
+ }
+}
+
+/** Setup the input buffer state to scan directly from a user-specified character buffer.
+ * @param base the character buffer
+ * @param size the size in bytes of the character buffer
+ * @param yyscanner The scanner object.
+ * @return the newly allocated buffer state object.
+ */
+YY_BUFFER_STATE error__scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner)
+{
+ YY_BUFFER_STATE b;
+
+ if ( size < 2 ||
+ base[size-2] != YY_END_OF_BUFFER_CHAR ||
+ base[size-1] != YY_END_OF_BUFFER_CHAR )
+ /* They forgot to leave room for the EOB's. */
+ return 0;
+
+ b = (YY_BUFFER_STATE) error_alloc(sizeof( struct yy_buffer_state ) ,yyscanner );
+ if ( ! b )
+ YY_FATAL_ERROR( "out of dynamic memory in error__scan_buffer()" );
+
+ b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
+ b->yy_buf_pos = b->yy_ch_buf = base;
+ b->yy_is_our_buffer = 0;
+ b->yy_input_file = 0;
+ b->yy_n_chars = b->yy_buf_size;
+ b->yy_is_interactive = 0;
+ b->yy_at_bol = 1;
+ b->yy_fill_buffer = 0;
+ b->yy_buffer_status = YY_BUFFER_NEW;
+
+ error__switch_to_buffer(b ,yyscanner );
+
+ return b;
+}
+
+/** Setup the input buffer state to scan a string. The next call to error_lex() will
+ * scan from a @e copy of @a str.
+ * @param yystr a NUL-terminated string to scan
+ * @param yyscanner The scanner object.
+ * @return the newly allocated buffer state object.
+ * @note If you want to scan bytes that may contain NUL values, then use
+ * error__scan_bytes() instead.
+ */
+YY_BUFFER_STATE error__scan_string (yyconst char * yystr , yyscan_t yyscanner)
+{
+
+ return error__scan_bytes(yystr,strlen(yystr) ,yyscanner);
+}
+
+/** Setup the input buffer state to scan the given bytes. The next call to error_lex() will
+ * scan from a @e copy of @a bytes.
+ * @param yybytes the byte buffer to scan
+ * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
+ * @param yyscanner The scanner object.
+ * @return the newly allocated buffer state object.
+ */
+YY_BUFFER_STATE error__scan_bytes (yyconst char * yybytes, int _yybytes_len , yyscan_t yyscanner)
+{
+ YY_BUFFER_STATE b;
+ char *buf;
+ yy_size_t n;
+ int i;
+
+ /* Get memory for full buffer, including space for trailing EOB's. */
+ n = _yybytes_len + 2;
+ buf = (char *) error_alloc(n ,yyscanner );
+ if ( ! buf )
+ YY_FATAL_ERROR( "out of dynamic memory in error__scan_bytes()" );
+
+ for ( i = 0; i < _yybytes_len; ++i )
+ buf[i] = yybytes[i];
+
+ buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
+
+ b = error__scan_buffer(buf,n ,yyscanner);
+ if ( ! b )
+ YY_FATAL_ERROR( "bad buffer in error__scan_bytes()" );
+
+ /* It's okay to grow etc. this buffer, and we should throw it
+ * away when we're done.
+ */
+ b->yy_is_our_buffer = 1;
+
+ return b;
+}
+
+#ifndef YY_EXIT_FAILURE
+#define YY_EXIT_FAILURE 2
+#endif
+
+static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner)
+{
+ (void) fprintf( stderr, "%s\n", msg );
+ exit( YY_EXIT_FAILURE );
+}
+
+/* Redefine yyless() so it works in section 3 code. */
+
+#undef yyless
+#define yyless(n) \
+ do \
+ { \
+ /* Undo effects of setting up yytext. */ \
+ int yyless_macro_arg = (n); \
+ YY_LESS_LINENO(yyless_macro_arg);\
+ yytext[yyleng] = yyg->yy_hold_char; \
+ yyg->yy_c_buf_p = yytext + yyless_macro_arg; \
+ yyg->yy_hold_char = *yyg->yy_c_buf_p; \
+ *yyg->yy_c_buf_p = '\0'; \
+ yyleng = yyless_macro_arg; \
+ } \
+ while ( 0 )
+
+/* Accessor methods (get/set functions) to struct members. */
+
+/** Get the user-defined data for this scanner.
+ * @param yyscanner The scanner object.
+ */
+YY_EXTRA_TYPE error_get_extra (yyscan_t yyscanner)
+{
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+ return yyextra;
+}
+
+/** Get the current line number.
+ * @param yyscanner The scanner object.
+ */
+int error_get_lineno (yyscan_t yyscanner)
+{
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+
+ if (! YY_CURRENT_BUFFER)
+ return 0;
+
+ return yylineno;
+}
+
+/** Get the current column number.
+ * @param yyscanner The scanner object.
+ */
+int error_get_column (yyscan_t yyscanner)
+{
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+
+ if (! YY_CURRENT_BUFFER)
+ return 0;
+
+ return yycolumn;
+}
+
+/** Get the input stream.
+ * @param yyscanner The scanner object.
+ */
+FILE *error_get_in (yyscan_t yyscanner)
+{
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+ return yyin;
+}
+
+/** Get the output stream.
+ * @param yyscanner The scanner object.
+ */
+FILE *error_get_out (yyscan_t yyscanner)
+{
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+ return yyout;
+}
+
+/** Get the length of the current token.
+ * @param yyscanner The scanner object.
+ */
+int error_get_leng (yyscan_t yyscanner)
+{
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+ return yyleng;
+}
+
+/** Get the current token.
+ * @param yyscanner The scanner object.
+ */
+
+char *error_get_text (yyscan_t yyscanner)
+{
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+ return yytext;
+}
+
+/** Set the user-defined data. This data is never touched by the scanner.
+ * @param user_defined The data to be associated with this scanner.
+ * @param yyscanner The scanner object.
+ */
+void error_set_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner)
+{
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+ yyextra = user_defined ;
+}
+
+/** Set the current line number.
+ * @param line_number
+ * @param yyscanner The scanner object.
+ */
+void error_set_lineno (int line_number , yyscan_t yyscanner)
+{
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+
+ /* lineno is only valid if an input buffer exists. */
+ if (! YY_CURRENT_BUFFER )
+ yy_fatal_error( "error_set_lineno called with no buffer" , yyscanner);
+
+ yylineno = line_number;
+}
+
+/** Set the current column.
+ * @param line_number
+ * @param yyscanner The scanner object.
+ */
+void error_set_column (int column_no , yyscan_t yyscanner)
+{
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+
+ /* column is only valid if an input buffer exists. */
+ if (! YY_CURRENT_BUFFER )
+ yy_fatal_error( "error_set_column called with no buffer" , yyscanner);
+
+ yycolumn = column_no;
+}
+
+/** Set the input stream. This does not discard the current
+ * input buffer.
+ * @param in_str A readable stream.
+ * @param yyscanner The scanner object.
+ * @see error__switch_to_buffer
+ */
+void error_set_in (FILE * in_str , yyscan_t yyscanner)
+{
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+ yyin = in_str ;
+}
+
+void error_set_out (FILE * out_str , yyscan_t yyscanner)
+{
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+ yyout = out_str ;
+}
+
+int error_get_debug (yyscan_t yyscanner)
+{
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+ return yy_flex_debug;
+}
+
+void error_set_debug (int bdebug , yyscan_t yyscanner)
+{
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+ yy_flex_debug = bdebug ;
+}
+
+/* Accessor methods for yylval and yylloc */
+
+YYSTYPE * error_get_lval (yyscan_t yyscanner)
+{
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+ return yylval;
+}
+
+void error_set_lval (YYSTYPE * yylval_param , yyscan_t yyscanner)
+{
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+ yylval = yylval_param;
+}
+
+/* User-visible API */
+
+/* error_lex_init is special because it creates the scanner itself, so it is
+ * the ONLY reentrant function that doesn't take the scanner as the last argument.
+ * That's why we explicitly handle the declaration, instead of using our macros.
+ */
+
+int error_lex_init(yyscan_t* ptr_yy_globals)
+
+{
+ if (ptr_yy_globals == NULL){
+ errno = EINVAL;
+ return 1;
+ }
+
+ *ptr_yy_globals = (yyscan_t) error_alloc ( sizeof( struct yyguts_t ), NULL );
+
+ if (*ptr_yy_globals == NULL){
+ errno = ENOMEM;
+ return 1;
+ }
+
+ /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */
+ memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
+
+ return yy_init_globals ( *ptr_yy_globals );
+}
+
+/* error_lex_init_extra has the same functionality as error_lex_init, but follows the
+ * convention of taking the scanner as the last argument. Note however, that
+ * this is a *pointer* to a scanner, as it will be allocated by this call (and
+ * is the reason, too, why this function also must handle its own declaration).
+ * The user defined value in the first argument will be available to error_alloc in
+ * the yyextra field.
+ */
+
+int error_lex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t* ptr_yy_globals )
+
+{
+ struct yyguts_t dummy_yyguts;
+
+ error_set_extra (yy_user_defined, &dummy_yyguts);
+
+ if (ptr_yy_globals == NULL){
+ errno = EINVAL;
+ return 1;
+ }
+
+ *ptr_yy_globals = (yyscan_t) error_alloc ( sizeof( struct yyguts_t ), &dummy_yyguts );
+
+ if (*ptr_yy_globals == NULL){
+ errno = ENOMEM;
+ return 1;
+ }
+
+ /* By setting to 0xAA, we expose bugs in
+ yy_init_globals. Leave at 0x00 for releases. */
+ memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
+
+ error_set_extra (yy_user_defined, *ptr_yy_globals);
+
+ return yy_init_globals ( *ptr_yy_globals );
+}
+
+static int yy_init_globals (yyscan_t yyscanner)
+{
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+ /* Initialization is the same as for the non-reentrant scanner.
+ * This function is called from error_lex_destroy(), so don't allocate here.
+ */
+
+ yyg->yy_buffer_stack = 0;
+ yyg->yy_buffer_stack_top = 0;
+ yyg->yy_buffer_stack_max = 0;
+ yyg->yy_c_buf_p = (char *) 0;
+ yyg->yy_init = 0;
+ yyg->yy_start = 0;
+
+ yyg->yy_start_stack_ptr = 0;
+ yyg->yy_start_stack_depth = 0;
+ yyg->yy_start_stack = NULL;
+
+/* Defined in main.c */
+#ifdef YY_STDINIT
+ yyin = stdin;
+ yyout = stdout;
+#else
+ yyin = (FILE *) 0;
+ yyout = (FILE *) 0;
+#endif
+
+ /* For future reference: Set errno on error, since we are called by
+ * error_lex_init()
+ */
+ return 0;
+}
+
+/* error_lex_destroy is for both reentrant and non-reentrant scanners. */
+int error_lex_destroy (yyscan_t yyscanner)
+{
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+
+ /* Pop the buffer stack, destroying each element. */
+ while(YY_CURRENT_BUFFER){
+ error__delete_buffer(YY_CURRENT_BUFFER ,yyscanner );
+ YY_CURRENT_BUFFER_LVALUE = NULL;
+ error_pop_buffer_state(yyscanner);
+ }
+
+ /* Destroy the stack itself. */
+ error_free(yyg->yy_buffer_stack ,yyscanner);
+ yyg->yy_buffer_stack = NULL;
+
+ /* Destroy the start condition stack. */
+ error_free(yyg->yy_start_stack ,yyscanner );
+ yyg->yy_start_stack = NULL;
+
+ /* Reset the globals. This is important in a non-reentrant scanner so the next time
+ * error_lex() is called, initialization will occur. */
+ yy_init_globals( yyscanner);
+
+ /* Destroy the main struct (reentrant only). */
+ error_free ( yyscanner , yyscanner );
+ yyscanner = NULL;
+ return 0;
+}
+
+/*
+ * Internal utility routines.
+ */
+
+#ifndef yytext_ptr
+static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner)
+{
+ register int i;
+ for ( i = 0; i < n; ++i )
+ s1[i] = s2[i];
+}
+#endif
+
+#ifdef YY_NEED_STRLEN
+static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner)
+{
+ register int n;
+ for ( n = 0; s[n]; ++n )
+ ;
+
+ return n;
+}
+#endif
+
+void *error_alloc (yy_size_t size , yyscan_t yyscanner)
+{
+ return (void *) malloc( size );
+}
+
+void *error_realloc (void * ptr, yy_size_t size , yyscan_t yyscanner)
+{
+ /* The cast to (char *) in the following accommodates both
+ * implementations that use char* generic pointers, and those
+ * that use void* generic pointers. It works with the latter
+ * because both ANSI C and C++ allow castless assignment from
+ * any pointer type to void*, and deal with argument conversions
+ * as though doing an assignment.
+ */
+ return (void *) realloc( (char *) ptr, size );
+}
+
+void error_free (void * ptr , yyscan_t yyscanner)
+{
+ free( (char *) ptr ); /* see error_realloc() for (char *) cast */
+}
+
+#define YYTABLES_NAME "yytables"
+
diff --git a/chromium/third_party/wds/gen/errorscanner.h b/chromium/third_party/wds/gen/errorscanner.h
new file mode 100644
index 00000000000..c733948b01b
--- /dev/null
+++ b/chromium/third_party/wds/gen/errorscanner.h
@@ -0,0 +1,376 @@
+#ifndef error_HEADER_H
+#define error_HEADER_H 1
+#define error_IN_HEADER 1
+
+#line 10 "errorlexer.l"
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2015 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+#include <stdint.h>
+
+#define YY_NO_UNISTD_H 1
+
+
+
+#line 34 "gen/errorscanner.h"
+
+#define YY_INT_ALIGNED short int
+
+/* A lexical scanner generated by flex */
+
+#define FLEX_SCANNER
+#define YY_FLEX_MAJOR_VERSION 2
+#define YY_FLEX_MINOR_VERSION 5
+#define YY_FLEX_SUBMINOR_VERSION 35
+#if YY_FLEX_SUBMINOR_VERSION > 0
+#define FLEX_BETA
+#endif
+
+/* First, we deal with platform-specific or compiler-specific issues. */
+
+/* begin standard C headers. */
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+#include <stdlib.h>
+
+/* end standard C headers. */
+
+/* flex integer type definitions */
+
+#ifndef FLEXINT_H
+#define FLEXINT_H
+
+/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
+
+#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+
+/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
+ * if you want the limit (max/min) macros for int types.
+ */
+#ifndef __STDC_LIMIT_MACROS
+#define __STDC_LIMIT_MACROS 1
+#endif
+
+#include <inttypes.h>
+typedef int8_t flex_int8_t;
+typedef uint8_t flex_uint8_t;
+typedef int16_t flex_int16_t;
+typedef uint16_t flex_uint16_t;
+typedef int32_t flex_int32_t;
+typedef uint32_t flex_uint32_t;
+#else
+typedef signed char flex_int8_t;
+typedef short int flex_int16_t;
+typedef int flex_int32_t;
+typedef unsigned char flex_uint8_t;
+typedef unsigned short int flex_uint16_t;
+typedef unsigned int flex_uint32_t;
+
+/* Limits of integral types. */
+#ifndef INT8_MIN
+#define INT8_MIN (-128)
+#endif
+#ifndef INT16_MIN
+#define INT16_MIN (-32767-1)
+#endif
+#ifndef INT32_MIN
+#define INT32_MIN (-2147483647-1)
+#endif
+#ifndef INT8_MAX
+#define INT8_MAX (127)
+#endif
+#ifndef INT16_MAX
+#define INT16_MAX (32767)
+#endif
+#ifndef INT32_MAX
+#define INT32_MAX (2147483647)
+#endif
+#ifndef UINT8_MAX
+#define UINT8_MAX (255U)
+#endif
+#ifndef UINT16_MAX
+#define UINT16_MAX (65535U)
+#endif
+#ifndef UINT32_MAX
+#define UINT32_MAX (4294967295U)
+#endif
+
+#endif /* ! C99 */
+
+#endif /* ! FLEXINT_H */
+
+#ifdef __cplusplus
+
+/* The "const" storage-class-modifier is valid. */
+#define YY_USE_CONST
+
+#else /* ! __cplusplus */
+
+/* C99 requires __STDC__ to be defined as 1. */
+#if defined (__STDC__)
+
+#define YY_USE_CONST
+
+#endif /* defined (__STDC__) */
+#endif /* ! __cplusplus */
+
+#ifdef YY_USE_CONST
+#define yyconst const
+#else
+#define yyconst
+#endif
+
+/* An opaque pointer. */
+#ifndef YY_TYPEDEF_YY_SCANNER_T
+#define YY_TYPEDEF_YY_SCANNER_T
+typedef void* yyscan_t;
+#endif
+
+/* For convenience, these vars (plus the bison vars far below)
+ are macros in the reentrant scanner. */
+#define yyin yyg->yyin_r
+#define yyout yyg->yyout_r
+#define yyextra yyg->yyextra_r
+#define yyleng yyg->yyleng_r
+#define yytext yyg->yytext_r
+#define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno)
+#define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column)
+#define yy_flex_debug yyg->yy_flex_debug_r
+
+/* Size of default input buffer. */
+#ifndef YY_BUF_SIZE
+#ifdef __ia64__
+/* On IA-64, the buffer size is 16k, not 8k.
+ * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
+ * Ditto for the __ia64__ case accordingly.
+ */
+#define YY_BUF_SIZE 32768
+#else
+#define YY_BUF_SIZE 16384
+#endif /* __ia64__ */
+#endif
+
+#ifndef YY_TYPEDEF_YY_BUFFER_STATE
+#define YY_TYPEDEF_YY_BUFFER_STATE
+typedef struct yy_buffer_state *YY_BUFFER_STATE;
+#endif
+
+#ifndef YY_TYPEDEF_YY_SIZE_T
+#define YY_TYPEDEF_YY_SIZE_T
+typedef size_t yy_size_t;
+#endif
+
+#ifndef YY_STRUCT_YY_BUFFER_STATE
+#define YY_STRUCT_YY_BUFFER_STATE
+struct yy_buffer_state
+ {
+ FILE *yy_input_file;
+
+ char *yy_ch_buf; /* input buffer */
+ char *yy_buf_pos; /* current position in input buffer */
+
+ /* Size of input buffer in bytes, not including room for EOB
+ * characters.
+ */
+ yy_size_t yy_buf_size;
+
+ /* Number of characters read into yy_ch_buf, not including EOB
+ * characters.
+ */
+ int yy_n_chars;
+
+ /* Whether we "own" the buffer - i.e., we know we created it,
+ * and can realloc() it to grow it, and should free() it to
+ * delete it.
+ */
+ int yy_is_our_buffer;
+
+ /* Whether this is an "interactive" input source; if so, and
+ * if we're using stdio for input, then we want to use getc()
+ * instead of fread(), to make sure we stop fetching input after
+ * each newline.
+ */
+ int yy_is_interactive;
+
+ /* Whether we're considered to be at the beginning of a line.
+ * If so, '^' rules will be active on the next match, otherwise
+ * not.
+ */
+ int yy_at_bol;
+
+ int yy_bs_lineno; /**< The line count. */
+ int yy_bs_column; /**< The column count. */
+
+ /* Whether to try to fill the input buffer when we reach the
+ * end of it.
+ */
+ int yy_fill_buffer;
+
+ int yy_buffer_status;
+
+ };
+#endif /* !YY_STRUCT_YY_BUFFER_STATE */
+
+void error_restart (FILE *input_file ,yyscan_t yyscanner );
+void error__switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
+YY_BUFFER_STATE error__create_buffer (FILE *file,int size ,yyscan_t yyscanner );
+void error__delete_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
+void error__flush_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
+void error_push_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
+void error_pop_buffer_state (yyscan_t yyscanner );
+
+YY_BUFFER_STATE error__scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner );
+YY_BUFFER_STATE error__scan_string (yyconst char *yy_str ,yyscan_t yyscanner );
+YY_BUFFER_STATE error__scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner );
+
+void *error_alloc (yy_size_t ,yyscan_t yyscanner );
+void *error_realloc (void *,yy_size_t ,yyscan_t yyscanner );
+void error_free (void * ,yyscan_t yyscanner );
+
+/* Begin user sect3 */
+
+#define error_wrap(n) 1
+#define YY_SKIP_YYWRAP
+
+#define yytext_ptr yytext_r
+
+#ifdef YY_HEADER_EXPORT_START_CONDITIONS
+#define INITIAL 0
+
+#endif
+
+#ifndef YY_NO_UNISTD_H
+/* Special case for "unistd.h", since it is non-ANSI. We include it way
+ * down here because we want the user's section 1 to have been scanned first.
+ * The user has a chance to override it with an option.
+ */
+#include <unistd.h>
+#endif
+
+#define YY_EXTRA_TYPE bool
+
+int error_lex_init (yyscan_t* scanner);
+
+int error_lex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner);
+
+/* Accessor methods to globals.
+ These are made visible to non-reentrant scanners for convenience. */
+
+int error_lex_destroy (yyscan_t yyscanner );
+
+int error_get_debug (yyscan_t yyscanner );
+
+void error_set_debug (int debug_flag ,yyscan_t yyscanner );
+
+YY_EXTRA_TYPE error_get_extra (yyscan_t yyscanner );
+
+void error_set_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner );
+
+FILE *error_get_in (yyscan_t yyscanner );
+
+void error_set_in (FILE * in_str ,yyscan_t yyscanner );
+
+FILE *error_get_out (yyscan_t yyscanner );
+
+void error_set_out (FILE * out_str ,yyscan_t yyscanner );
+
+int error_get_leng (yyscan_t yyscanner );
+
+char *error_get_text (yyscan_t yyscanner );
+
+int error_get_lineno (yyscan_t yyscanner );
+
+void error_set_lineno (int line_number ,yyscan_t yyscanner );
+
+YYSTYPE * error_get_lval (yyscan_t yyscanner );
+
+void error_set_lval (YYSTYPE * yylval_param ,yyscan_t yyscanner );
+
+/* Macros after this point can all be overridden by user definitions in
+ * section 1.
+ */
+
+#ifndef YY_SKIP_YYWRAP
+#ifdef __cplusplus
+extern "C" int error_wrap (yyscan_t yyscanner );
+#else
+extern int error_wrap (yyscan_t yyscanner );
+#endif
+#endif
+
+#ifndef yytext_ptr
+static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner);
+#endif
+
+#ifdef YY_NEED_STRLEN
+static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner);
+#endif
+
+#ifndef YY_NO_INPUT
+
+#endif
+
+/* Amount of stuff to slurp up with each read. */
+#ifndef YY_READ_BUF_SIZE
+#ifdef __ia64__
+/* On IA-64, the buffer size is 16k, not 8k */
+#define YY_READ_BUF_SIZE 16384
+#else
+#define YY_READ_BUF_SIZE 8192
+#endif /* __ia64__ */
+#endif
+
+/* Number of entries by which start-condition stack grows. */
+#ifndef YY_START_STACK_INCR
+#define YY_START_STACK_INCR 25
+#endif
+
+/* Default declaration of generated scanner - a define so the user can
+ * easily add parameters.
+ */
+#ifndef YY_DECL
+#define YY_DECL_IS_OURS 1
+
+extern int error_lex \
+ (YYSTYPE * yylval_param ,yyscan_t yyscanner);
+
+#define YY_DECL int error_lex \
+ (YYSTYPE * yylval_param , yyscan_t yyscanner)
+#endif /* !YY_DECL */
+
+/* yy_get_previous_state - get the state just before the EOB char was reached */
+
+#undef YY_NEW_FILE
+#undef YY_FLUSH_BUFFER
+#undef yy_set_bol
+#undef yy_new_buffer
+#undef yy_set_interactive
+#undef YY_DO_BEFORE_ACTION
+
+#ifdef YY_DECL_IS_OURS
+#undef YY_DECL_IS_OURS
+#undef YY_DECL
+#endif
+
+#line 375 "gen/errorscanner.h"
+#undef error_IN_HEADER
+#endif /* error_HEADER_H */
diff --git a/chromium/third_party/wds/gen/headerscanner.cpp b/chromium/third_party/wds/gen/headerscanner.cpp
new file mode 100644
index 00000000000..1b9a3d174d0
--- /dev/null
+++ b/chromium/third_party/wds/gen/headerscanner.cpp
@@ -0,0 +1,3023 @@
+#line 10 "headerlexer.l"
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2015 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+#include <stdint.h>
+
+#define YY_NO_UNISTD_H 1
+
+
+
+#line 30 "gen/headerscanner.cpp"
+
+#define YY_INT_ALIGNED short int
+
+/* A lexical scanner generated by flex */
+
+#define FLEX_SCANNER
+#define YY_FLEX_MAJOR_VERSION 2
+#define YY_FLEX_MINOR_VERSION 5
+#define YY_FLEX_SUBMINOR_VERSION 35
+#if YY_FLEX_SUBMINOR_VERSION > 0
+#define FLEX_BETA
+#endif
+
+/* First, we deal with platform-specific or compiler-specific issues. */
+
+/* begin standard C headers. */
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+#include <stdlib.h>
+
+/* end standard C headers. */
+
+/* flex integer type definitions */
+
+#ifndef FLEXINT_H
+#define FLEXINT_H
+
+/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
+
+#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+
+/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
+ * if you want the limit (max/min) macros for int types.
+ */
+#ifndef __STDC_LIMIT_MACROS
+#define __STDC_LIMIT_MACROS 1
+#endif
+
+#include <inttypes.h>
+typedef int8_t flex_int8_t;
+typedef uint8_t flex_uint8_t;
+typedef int16_t flex_int16_t;
+typedef uint16_t flex_uint16_t;
+typedef int32_t flex_int32_t;
+typedef uint32_t flex_uint32_t;
+#else
+typedef signed char flex_int8_t;
+typedef short int flex_int16_t;
+typedef int flex_int32_t;
+typedef unsigned char flex_uint8_t;
+typedef unsigned short int flex_uint16_t;
+typedef unsigned int flex_uint32_t;
+
+/* Limits of integral types. */
+#ifndef INT8_MIN
+#define INT8_MIN (-128)
+#endif
+#ifndef INT16_MIN
+#define INT16_MIN (-32767-1)
+#endif
+#ifndef INT32_MIN
+#define INT32_MIN (-2147483647-1)
+#endif
+#ifndef INT8_MAX
+#define INT8_MAX (127)
+#endif
+#ifndef INT16_MAX
+#define INT16_MAX (32767)
+#endif
+#ifndef INT32_MAX
+#define INT32_MAX (2147483647)
+#endif
+#ifndef UINT8_MAX
+#define UINT8_MAX (255U)
+#endif
+#ifndef UINT16_MAX
+#define UINT16_MAX (65535U)
+#endif
+#ifndef UINT32_MAX
+#define UINT32_MAX (4294967295U)
+#endif
+
+#endif /* ! C99 */
+
+#endif /* ! FLEXINT_H */
+
+#ifdef __cplusplus
+
+/* The "const" storage-class-modifier is valid. */
+#define YY_USE_CONST
+
+#else /* ! __cplusplus */
+
+/* C99 requires __STDC__ to be defined as 1. */
+#if defined (__STDC__)
+
+#define YY_USE_CONST
+
+#endif /* defined (__STDC__) */
+#endif /* ! __cplusplus */
+
+#ifdef YY_USE_CONST
+#define yyconst const
+#else
+#define yyconst
+#endif
+
+/* Returned upon end-of-file. */
+#define YY_NULL 0
+
+/* Promotes a possibly negative, possibly signed char to an unsigned
+ * integer for use as an array index. If the signed char is negative,
+ * we want to instead treat it as an 8-bit unsigned char, hence the
+ * double cast.
+ */
+#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
+
+/* An opaque pointer. */
+#ifndef YY_TYPEDEF_YY_SCANNER_T
+#define YY_TYPEDEF_YY_SCANNER_T
+typedef void* yyscan_t;
+#endif
+
+/* For convenience, these vars (plus the bison vars far below)
+ are macros in the reentrant scanner. */
+#define yyin yyg->yyin_r
+#define yyout yyg->yyout_r
+#define yyextra yyg->yyextra_r
+#define yyleng yyg->yyleng_r
+#define yytext yyg->yytext_r
+#define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno)
+#define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column)
+#define yy_flex_debug yyg->yy_flex_debug_r
+
+/* Enter a start condition. This macro really ought to take a parameter,
+ * but we do it the disgusting crufty way forced on us by the ()-less
+ * definition of BEGIN.
+ */
+#define BEGIN yyg->yy_start = 1 + 2 *
+
+/* Translate the current start state into a value that can be later handed
+ * to BEGIN to return to the state. The YYSTATE alias is for lex
+ * compatibility.
+ */
+#define YY_START ((yyg->yy_start - 1) / 2)
+#define YYSTATE YY_START
+
+/* Action number for EOF rule of a given start state. */
+#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
+
+/* Special action meaning "start processing a new file". */
+#define YY_NEW_FILE header_restart(yyin ,yyscanner )
+
+#define YY_END_OF_BUFFER_CHAR 0
+
+/* Size of default input buffer. */
+#ifndef YY_BUF_SIZE
+#ifdef __ia64__
+/* On IA-64, the buffer size is 16k, not 8k.
+ * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
+ * Ditto for the __ia64__ case accordingly.
+ */
+#define YY_BUF_SIZE 32768
+#else
+#define YY_BUF_SIZE 16384
+#endif /* __ia64__ */
+#endif
+
+/* The state buf must be large enough to hold one state per character in the main buffer.
+ */
+#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
+
+#ifndef YY_TYPEDEF_YY_BUFFER_STATE
+#define YY_TYPEDEF_YY_BUFFER_STATE
+typedef struct yy_buffer_state *YY_BUFFER_STATE;
+#endif
+
+#define EOB_ACT_CONTINUE_SCAN 0
+#define EOB_ACT_END_OF_FILE 1
+#define EOB_ACT_LAST_MATCH 2
+
+ #define YY_LESS_LINENO(n)
+
+/* Return all but the first "n" matched characters back to the input stream. */
+#define yyless(n) \
+ do \
+ { \
+ /* Undo effects of setting up yytext. */ \
+ int yyless_macro_arg = (n); \
+ YY_LESS_LINENO(yyless_macro_arg);\
+ *yy_cp = yyg->yy_hold_char; \
+ YY_RESTORE_YY_MORE_OFFSET \
+ yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
+ YY_DO_BEFORE_ACTION; /* set up yytext again */ \
+ } \
+ while ( 0 )
+
+#define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner )
+
+#ifndef YY_TYPEDEF_YY_SIZE_T
+#define YY_TYPEDEF_YY_SIZE_T
+typedef size_t yy_size_t;
+#endif
+
+#ifndef YY_STRUCT_YY_BUFFER_STATE
+#define YY_STRUCT_YY_BUFFER_STATE
+struct yy_buffer_state
+ {
+ FILE *yy_input_file;
+
+ char *yy_ch_buf; /* input buffer */
+ char *yy_buf_pos; /* current position in input buffer */
+
+ /* Size of input buffer in bytes, not including room for EOB
+ * characters.
+ */
+ yy_size_t yy_buf_size;
+
+ /* Number of characters read into yy_ch_buf, not including EOB
+ * characters.
+ */
+ int yy_n_chars;
+
+ /* Whether we "own" the buffer - i.e., we know we created it,
+ * and can realloc() it to grow it, and should free() it to
+ * delete it.
+ */
+ int yy_is_our_buffer;
+
+ /* Whether this is an "interactive" input source; if so, and
+ * if we're using stdio for input, then we want to use getc()
+ * instead of fread(), to make sure we stop fetching input after
+ * each newline.
+ */
+ int yy_is_interactive;
+
+ /* Whether we're considered to be at the beginning of a line.
+ * If so, '^' rules will be active on the next match, otherwise
+ * not.
+ */
+ int yy_at_bol;
+
+ int yy_bs_lineno; /**< The line count. */
+ int yy_bs_column; /**< The column count. */
+
+ /* Whether to try to fill the input buffer when we reach the
+ * end of it.
+ */
+ int yy_fill_buffer;
+
+ int yy_buffer_status;
+
+#define YY_BUFFER_NEW 0
+#define YY_BUFFER_NORMAL 1
+ /* When an EOF's been seen but there's still some text to process
+ * then we mark the buffer as YY_EOF_PENDING, to indicate that we
+ * shouldn't try reading from the input source any more. We might
+ * still have a bunch of tokens to match, though, because of
+ * possible backing-up.
+ *
+ * When we actually see the EOF, we change the status to "new"
+ * (via header_restart()), so that the user can continue scanning by
+ * just pointing yyin at a new input file.
+ */
+#define YY_BUFFER_EOF_PENDING 2
+
+ };
+#endif /* !YY_STRUCT_YY_BUFFER_STATE */
+
+/* We provide macros for accessing buffer states in case in the
+ * future we want to put the buffer states in a more general
+ * "scanner state".
+ *
+ * Returns the top of the stack, or NULL.
+ */
+#define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \
+ ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \
+ : NULL)
+
+/* Same as previous macro, but useful when we know that the buffer stack is not
+ * NULL or when we need an lvalue. For internal use only.
+ */
+#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]
+
+void header_restart (FILE *input_file ,yyscan_t yyscanner );
+void header__switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
+YY_BUFFER_STATE header__create_buffer (FILE *file,int size ,yyscan_t yyscanner );
+void header__delete_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
+void header__flush_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
+void header_push_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
+void header_pop_buffer_state (yyscan_t yyscanner );
+
+static void header_ensure_buffer_stack (yyscan_t yyscanner );
+static void header__load_buffer_state (yyscan_t yyscanner );
+static void header__init_buffer (YY_BUFFER_STATE b,FILE *file ,yyscan_t yyscanner );
+
+#define YY_FLUSH_BUFFER header__flush_buffer(YY_CURRENT_BUFFER ,yyscanner)
+
+YY_BUFFER_STATE header__scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner );
+YY_BUFFER_STATE header__scan_string (yyconst char *yy_str ,yyscan_t yyscanner );
+YY_BUFFER_STATE header__scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner );
+
+void *header_alloc (yy_size_t ,yyscan_t yyscanner );
+void *header_realloc (void *,yy_size_t ,yyscan_t yyscanner );
+void header_free (void * ,yyscan_t yyscanner );
+
+#define yy_new_buffer header__create_buffer
+
+#define yy_set_interactive(is_interactive) \
+ { \
+ if ( ! YY_CURRENT_BUFFER ){ \
+ header_ensure_buffer_stack (yyscanner); \
+ YY_CURRENT_BUFFER_LVALUE = \
+ header__create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
+ } \
+ YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
+ }
+
+#define yy_set_bol(at_bol) \
+ { \
+ if ( ! YY_CURRENT_BUFFER ){\
+ header_ensure_buffer_stack (yyscanner); \
+ YY_CURRENT_BUFFER_LVALUE = \
+ header__create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
+ } \
+ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
+ }
+
+#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
+
+/* Begin user sect3 */
+
+#define header_wrap(n) 1
+#define YY_SKIP_YYWRAP
+
+typedef unsigned char YY_CHAR;
+
+typedef int yy_state_type;
+
+#define yytext_ptr yytext_r
+
+static yy_state_type yy_get_previous_state (yyscan_t yyscanner );
+static yy_state_type yy_try_NUL_trans (yy_state_type current_state ,yyscan_t yyscanner);
+static int yy_get_next_buffer (yyscan_t yyscanner );
+static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner );
+
+/* Done after the current pattern has been matched and before the
+ * corresponding action - sets up yytext.
+ */
+#define YY_DO_BEFORE_ACTION \
+ yyg->yytext_ptr = yy_bp; \
+ yyleng = (size_t) (yy_cp - yy_bp); \
+ yyg->yy_hold_char = *yy_cp; \
+ *yy_cp = '\0'; \
+ yyg->yy_c_buf_p = yy_cp;
+
+#define YY_NUM_RULES 46
+#define YY_END_OF_BUFFER 47
+/* This struct is not used in this scanner,
+ but its presence is necessary. */
+struct yy_trans_info
+ {
+ flex_int32_t yy_verify;
+ flex_int32_t yy_nxt;
+ };
+static yyconst flex_int16_t yy_accept[646] =
+ { 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 47, 45, 11, 2, 3, 7, 6, 5,
+ 10, 42, 9, 8, 4, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 31, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 45,
+ 45, 45, 45, 45, 5, 42, 45, 45, 45, 45,
+ 45, 45, 45, 45, 45, 45, 45, 45, 45, 30,
+ 7, 6, 5, 10, 30, 9, 4, 30, 30, 30,
+ 30, 30, 30, 30, 30, 30, 30, 30, 30, 11,
+ 1, 42, 0, 0, 0, 0, 29, 0, 0, 0,
+
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 31, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 42, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 30, 30, 30, 30, 29, 30, 30, 30, 30, 30,
+ 30, 30, 30, 30, 30, 30, 30, 30, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+
+ 0, 0, 0, 0, 0, 41, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 30, 30, 30, 30, 30, 30, 30, 30, 30, 30,
+ 30, 30, 30, 30, 0, 0, 0, 0, 0, 0,
+ 0, 0, 18, 0, 0, 0, 0, 0, 0, 0,
+ 0, 32, 0, 0, 0, 0, 37, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 18, 37, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 18,
+ 0, 0, 0, 0, 0, 0, 0, 30, 30, 30,
+ 30, 30, 30, 18, 30, 30, 30, 30, 30, 30,
+
+ 30, 30, 0, 0, 0, 0, 0, 22, 0, 0,
+ 20, 0, 0, 0, 29, 0, 17, 0, 0, 0,
+ 0, 0, 0, 39, 36, 0, 0, 0, 0, 0,
+ 0, 20, 39, 17, 36, 0, 0, 0, 0, 0,
+ 0, 0, 20, 0, 0, 0, 0, 17, 0, 0,
+ 30, 30, 30, 22, 30, 30, 20, 30, 30, 30,
+ 29, 30, 17, 30, 30, 30, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 41, 0, 0, 0, 0, 41, 0,
+
+ 0, 0, 30, 30, 30, 30, 30, 30, 30, 30,
+ 30, 30, 30, 30, 0, 0, 0, 0, 0, 0,
+ 14, 23, 0, 0, 0, 0, 0, 0, 0, 33,
+ 0, 0, 0, 0, 0, 14, 33, 0, 0, 0,
+ 0, 0, 14, 0, 0, 0, 0, 30, 30, 30,
+ 30, 14, 23, 30, 30, 30, 30, 30, 30, 0,
+ 0, 43, 44, 0, 0, 29, 43, 27, 0, 19,
+ 0, 0, 0, 0, 38, 0, 0, 0, 0, 19,
+ 38, 0, 19, 0, 30, 30, 30, 30, 29, 30,
+ 27, 30, 19, 30, 0, 12, 0, 0, 0, 0,
+
+ 21, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 30, 30, 30, 30, 30, 0, 0,
+ 0, 0, 0, 0, 29, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 30, 30, 30, 30, 29, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 30, 30, 30, 30, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 30, 30, 30, 30, 13,
+ 0, 25, 16, 0, 15, 0, 35, 0, 34, 16,
+ 35, 15, 34, 0, 30, 25, 16, 15, 0, 0,
+
+ 0, 40, 0, 30, 26, 0, 0, 26, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 24, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 28, 0
+ } ;
+
+static yyconst flex_int32_t yy_ec[256] =
+ { 0,
+ 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
+ 1, 1, 4, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 5, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 6, 1, 7, 8, 9, 10, 11, 12, 13,
+ 13, 13, 13, 13, 13, 13, 13, 14, 15, 1,
+ 16, 1, 1, 1, 17, 18, 19, 20, 21, 22,
+ 23, 24, 25, 26, 26, 27, 28, 29, 30, 31,
+ 32, 33, 34, 35, 36, 37, 38, 26, 39, 26,
+ 1, 1, 1, 1, 40, 1, 41, 42, 43, 44,
+
+ 45, 46, 47, 48, 49, 26, 26, 50, 51, 52,
+ 53, 54, 55, 56, 57, 58, 59, 60, 61, 26,
+ 62, 26, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1
+ } ;
+
+static yyconst flex_int32_t yy_meta[63] =
+ { 0,
+ 1, 2, 3, 4, 2, 1, 1, 5, 1, 6,
+ 5, 5, 5, 7, 8, 1, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 7,
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5
+ } ;
+
+static yyconst flex_int16_t yy_base[659] =
+ { 0,
+ 0, 56, 14, 17, 23, 26, 117, 153, 211, 267,
+ 328, 384, 1713, 2645, 23, 2645, 1704, 2645, 2645, 2645,
+ 2645, 29, 2645, 100, 2645, 91, 1660, 125, 10, 18,
+ 127, 132, 124, 147, 194, 151, 123, 0, 32, 2,
+ 198, 215, 115, 121, 183, 323, 433, 188, 434, 331,
+ 435, 437, 336, 449, 1654, 40, 1647, 442, 224, 474,
+ 226, 462, 489, 497, 499, 505, 507, 514, 520, 0,
+ 0, 0, 0, 0, 180, 0, 0, 127, 357, 576,
+ 587, 564, 633, 692, 606, 750, 652, 664, 709, 193,
+ 2645, 237, 160, 210, 203, 1635, 2645, 481, 536, 227,
+
+ 333, 225, 229, 341, 443, 522, 584, 575, 241, 334,
+ 1635, 551, 311, 314, 433, 422, 444, 488, 445, 570,
+ 586, 588, 544, 590, 616, 558, 631, 597, 686, 712,
+ 640, 662, 1627, 0, 684, 673, 672, 738, 718, 739,
+ 758, 763, 721, 770, 775, 777, 786, 791, 799, 818,
+ 0, 624, 630, 835, 0, 846, 860, 876, 887, 903,
+ 914, 926, 940, 951, 1008, 968, 980, 1020, 658, 689,
+ 691, 788, 772, 457, 487, 346, 339, 768, 778, 819,
+ 850, 851, 508, 843, 1625, 1587, 606, 1611, 806, 840,
+ 878, 873, 649, 715, 934, 939, 180, 959, 966, 937,
+
+ 989, 999, 1005, 977, 998, 0, 1001, 1034, 1036, 952,
+ 1042, 1039, 1049, 1056, 1061, 1067, 1070, 1076, 1085, 1095,
+ 1031, 1122, 1136, 1153, 1165, 1188, 1199, 1210, 1226, 1238,
+ 1249, 1265, 1281, 1293, 1057, 833, 360, 1094, 1574, 351,
+ 538, 34, 1573, 1116, 1139, 924, 1182, 710, 885, 243,
+ 1099, 2645, 1072, 1081, 1117, 934, 2645, 1130, 1145, 1058,
+ 1156, 1187, 1198, 1200, 1137, 1259, 1563, 1552, 1262, 1282,
+ 1284, 1294, 1297, 1298, 991, 1309, 1163, 1310, 1318, 1317,
+ 1319, 1337, 1342, 1350, 1353, 1351, 1360, 1130, 1395, 1412,
+ 1423, 1435, 1446, 1462, 1473, 1485, 1499, 1510, 1522, 1536,
+
+ 1548, 1564, 1204, 1193, 1367, 1551, 1358, 2645, 719, 1043,
+ 1546, 1369, 1320, 1395, 1537, 1367, 1530, 780, 642, 1312,
+ 1226, 1205, 1264, 2645, 2645, 1386, 1231, 1417, 1429, 1409,
+ 1421, 1525, 1519, 1516, 1511, 1471, 1534, 1488, 1526, 1570,
+ 1562, 1467, 1375, 1575, 1576, 1584, 1589, 1590, 1596, 1591,
+ 1600, 1504, 1634, 0, 1645, 1659, 1671, 1683, 1694, 1612,
+ 1493, 1705, 1722, 1738, 1750, 1761, 1313, 1389, 1484, 1474,
+ 1549, 748, 535, 1461, 1445, 1455, 1624, 805, 1483, 1603,
+ 1471, 1535, 1617, 1614, 1633, 1684, 1716, 1708, 1719, 1749,
+ 1755, 1682, 1723, 1448, 1764, 1769, 1669, 1776, 1405, 1777,
+
+ 1786, 1788, 1389, 1363, 1824, 1836, 1847, 1861, 1877, 1346,
+ 1894, 1905, 1919, 1933, 1297, 1647, 1782, 0, 445, 854,
+ 1321, 2645, 1307, 1801, 1264, 990, 1579, 1818, 1650, 2645,
+ 1268, 1803, 1689, 1875, 1910, 1254, 1250, 1927, 1931, 1844,
+ 1850, 1922, 1809, 1825, 1940, 1942, 1945, 1953, 536, 1982,
+ 1993, 2005, 0, 2016, 1962, 2027, 2038, 2050, 2061, 1754,
+ 1213, 2645, 0, 2015, 794, 1216, 1117, 2645, 992, 1178,
+ 1841, 1862, 1856, 1909, 2645, 1953, 1965, 2010, 2021, 1171,
+ 1135, 2064, 2066, 2072, 0, 885, 2130, 2119, 1143, 1181,
+ 0, 2142, 2086, 2162, 1923, 2645, 1963, 1956, 603, 1967,
+
+ 1390, 663, 1086, 1815, 1863, 1886, 2076, 2087, 2089, 2097,
+ 2145, 2163, 2075, 2185, 2203, 2217, 2234, 2250, 2007, 2017,
+ 2110, 740, 2025, 1079, 1082, 2092, 2118, 2125, 2140, 2147,
+ 2179, 2194, 2218, 2253, 2267, 2281, 2299, 2315, 1055, 2149,
+ 2222, 2201, 949, 2164, 1026, 2183, 2233, 1026, 2240, 2258,
+ 2278, 2296, 2297, 2316, 2322, 2345, 2363, 2379, 2395, 982,
+ 2313, 957, 912, 934, 1256, 2236, 2242, 916, 2281, 2343,
+ 2361, 2364, 2373, 2393, 2400, 2425, 2436, 2447, 2458, 2645,
+ 2367, 2645, 894, 2322, 866, 2359, 2645, 818, 2645, 810,
+ 762, 720, 691, 2452, 2472, 0, 2488, 2500, 690, 2240,
+
+ 616, 2645, 2409, 2512, 2645, 2263, 2303, 0, 578, 2361,
+ 2386, 2439, 2336, 455, 2392, 2449, 350, 2455, 236, 2480,
+ 190, 184, 2645, 2476, 2486, 2478, 2486, 2500, 2489, 2489,
+ 128, 2506, 2503, 2506, 2511, 2507, 2502, 14, 2508, 2510,
+ 2509, 2508, 30, 2645, 2645, 2566, 2574, 2582, 2590, 2594,
+ 2601, 2605, 2607, 2614, 2621, 4, 2628, 2636
+ } ;
+
+static yyconst flex_int16_t yy_def[659] =
+ { 0,
+ 646, 645, 647, 647, 646, 646, 646, 2, 648, 645,
+ 649, 645, 645, 645, 645, 645, 645, 645, 645, 645,
+ 645, 645, 645, 645, 645, 645, 650, 650, 650, 650,
+ 650, 650, 650, 650, 650, 650, 650, 651, 645, 645,
+ 645, 645, 645, 645, 650, 650, 650, 650, 650, 650,
+ 650, 650, 650, 650, 652, 652, 652, 652, 653, 653,
+ 653, 653, 653, 653, 653, 653, 653, 653, 653, 654,
+ 654, 654, 654, 654, 654, 654, 654, 654, 655, 655,
+ 655, 655, 655, 655, 655, 655, 655, 655, 655, 645,
+ 645, 645, 645, 645, 645, 650, 645, 650, 650, 650,
+
+ 650, 650, 650, 650, 650, 650, 650, 650, 650, 650,
+ 651, 645, 645, 645, 645, 645, 645, 645, 645, 650,
+ 650, 650, 650, 650, 650, 650, 650, 650, 650, 650,
+ 650, 650, 652, 656, 652, 652, 653, 653, 653, 653,
+ 653, 653, 653, 653, 653, 653, 653, 653, 653, 653,
+ 654, 654, 654, 655, 654, 655, 655, 655, 655, 655,
+ 655, 655, 655, 655, 655, 655, 655, 655, 645, 645,
+ 645, 650, 650, 650, 650, 650, 650, 650, 650, 650,
+ 650, 650, 650, 650, 645, 645, 645, 645, 645, 645,
+ 645, 645, 650, 650, 650, 650, 650, 650, 650, 650,
+
+ 650, 650, 650, 650, 650, 656, 652, 653, 653, 653,
+ 653, 653, 653, 653, 653, 653, 653, 653, 653, 653,
+ 654, 655, 655, 655, 655, 655, 655, 655, 655, 655,
+ 655, 655, 655, 655, 645, 645, 645, 650, 650, 650,
+ 650, 650, 650, 650, 650, 650, 650, 650, 650, 650,
+ 650, 645, 645, 645, 645, 645, 645, 645, 645, 645,
+ 650, 650, 650, 650, 650, 650, 650, 650, 650, 650,
+ 650, 650, 650, 650, 652, 653, 653, 653, 653, 653,
+ 653, 653, 653, 653, 653, 653, 653, 654, 655, 655,
+ 655, 655, 655, 655, 655, 655, 655, 655, 655, 655,
+
+ 655, 655, 645, 645, 645, 645, 650, 645, 650, 650,
+ 650, 650, 650, 645, 645, 650, 650, 650, 650, 650,
+ 645, 645, 645, 645, 645, 645, 645, 650, 650, 650,
+ 650, 650, 650, 650, 650, 650, 650, 650, 650, 656,
+ 653, 653, 653, 653, 653, 656, 653, 653, 653, 653,
+ 654, 654, 655, 654, 655, 655, 655, 655, 655, 654,
+ 654, 655, 655, 655, 655, 655, 645, 645, 645, 645,
+ 650, 650, 650, 650, 650, 645, 650, 650, 650, 650,
+ 645, 645, 645, 645, 645, 650, 650, 650, 650, 650,
+ 650, 650, 650, 656, 653, 653, 653, 653, 656, 653,
+
+ 653, 653, 654, 654, 655, 655, 655, 655, 655, 654,
+ 655, 655, 655, 655, 645, 645, 645, 657, 650, 650,
+ 650, 645, 650, 645, 650, 650, 650, 650, 645, 645,
+ 645, 645, 645, 650, 650, 650, 650, 650, 650, 650,
+ 650, 653, 653, 653, 653, 653, 653, 654, 658, 655,
+ 655, 655, 654, 655, 654, 655, 655, 655, 655, 645,
+ 645, 645, 657, 650, 650, 645, 645, 645, 650, 650,
+ 650, 645, 645, 645, 645, 650, 650, 650, 650, 650,
+ 650, 653, 653, 653, 654, 658, 655, 655, 654, 654,
+ 654, 655, 655, 655, 645, 645, 650, 650, 650, 645,
+
+ 645, 650, 650, 645, 645, 645, 650, 650, 650, 650,
+ 653, 653, 653, 655, 655, 655, 655, 655, 645, 650,
+ 650, 650, 645, 650, 645, 645, 645, 645, 650, 650,
+ 650, 650, 653, 653, 655, 655, 655, 655, 654, 645,
+ 650, 650, 650, 645, 650, 645, 645, 645, 645, 650,
+ 650, 650, 650, 653, 653, 655, 655, 655, 655, 645,
+ 650, 650, 650, 645, 650, 645, 645, 645, 645, 650,
+ 650, 650, 650, 653, 653, 655, 655, 655, 655, 645,
+ 650, 645, 650, 645, 650, 645, 645, 645, 645, 650,
+ 650, 650, 650, 653, 655, 654, 655, 655, 650, 645,
+
+ 645, 645, 653, 655, 645, 645, 645, 654, 645, 645,
+ 645, 645, 645, 645, 645, 645, 645, 645, 645, 645,
+ 645, 645, 645, 645, 645, 645, 645, 645, 645, 645,
+ 645, 645, 645, 645, 645, 645, 645, 645, 645, 645,
+ 645, 645, 645, 645, 0, 645, 645, 645, 645, 645,
+ 645, 645, 645, 645, 645, 645, 645, 645
+ } ;
+
+static yyconst flex_int16_t yy_nxt[2708] =
+ { 0,
+ 645, 15, 16, 17, 15, 18, 19, 20, 206, 21,
+ 22, 22, 22, 23, 24, 25, 16, 17, 14, 16,
+ 17, 14, 113, 97, 90, 16, 17, 90, 16, 17,
+ 100, 97, 26, 39, 39, 39, 39, 39, 39, 92,
+ 92, 92, 112, 112, 112, 644, 113, 97, 101, 134,
+ 135, 135, 135, 639, 311, 26, 14, 15, 16, 17,
+ 15, 18, 19, 20, 14, 21, 22, 22, 22, 23,
+ 24, 25, 27, 27, 28, 27, 27, 27, 29, 27,
+ 27, 27, 27, 27, 27, 30, 31, 27, 32, 33,
+ 34, 27, 27, 27, 27, 14, 27, 27, 28, 27,
+
+ 27, 27, 27, 27, 27, 27, 27, 27, 27, 35,
+ 27, 32, 36, 37, 27, 27, 27, 27, 15, 16,
+ 17, 15, 18, 19, 20, 95, 21, 22, 22, 22,
+ 23, 24, 25, 93, 94, 118, 97, 97, 97, 40,
+ 97, 119, 632, 102, 107, 97, 41, 42, 95, 26,
+ 43, 44, 105, 103, 98, 110, 93, 94, 99, 118,
+ 97, 153, 104, 40, 97, 119, 106, 109, 108, 41,
+ 42, 108, 26, 43, 44, 45, 105, 98, 110, 110,
+ 169, 99, 46, 47, 153, 104, 48, 49, 255, 106,
+ 152, 152, 152, 97, 90, 108, 97, 90, 624, 50,
+
+ 623, 97, 110, 120, 169, 51, 52, 97, 129, 53,
+ 54, 14, 15, 16, 17, 15, 18, 19, 55, 14,
+ 21, 56, 56, 56, 23, 24, 25, 121, 114, 104,
+ 115, 116, 130, 134, 170, 134, 171, 97, 97, 97,
+ 97, 117, 97, 58, 621, 177, 140, 92, 92, 92,
+ 14, 114, 104, 115, 97, 116, 97, 183, 170, 171,
+ 176, 174, 319, 96, 117, 96, 58, 14, 15, 16,
+ 17, 15, 18, 19, 55, 14, 21, 56, 56, 56,
+ 23, 24, 25, 59, 59, 60, 59, 59, 59, 61,
+ 59, 59, 59, 59, 59, 59, 62, 63, 59, 64,
+
+ 65, 66, 59, 59, 59, 59, 14, 59, 59, 60,
+ 59, 59, 59, 59, 59, 59, 59, 59, 59, 59,
+ 67, 59, 64, 68, 69, 59, 59, 59, 59, 15,
+ 16, 17, 15, 71, 72, 73, 97, 74, 75, 75,
+ 75, 76, 24, 77, 97, 186, 97, 97, 187, 97,
+ 184, 121, 97, 122, 97, 123, 130, 151, 178, 97,
+ 78, 619, 151, 151, 97, 151, 151, 175, 186, 305,
+ 155, 187, 151, 306, 184, 121, 124, 243, 123, 242,
+ 130, 309, 178, 78, 70, 15, 16, 17, 15, 71,
+ 72, 73, 70, 74, 75, 75, 75, 76, 24, 77,
+
+ 79, 79, 80, 79, 79, 79, 81, 79, 79, 79,
+ 79, 79, 79, 82, 83, 79, 84, 85, 86, 79,
+ 79, 79, 79, 70, 79, 79, 80, 79, 79, 79,
+ 79, 79, 79, 79, 79, 79, 79, 87, 79, 84,
+ 88, 89, 79, 79, 79, 79, 97, 97, 97, 125,
+ 97, 134, 464, 127, 131, 188, 97, 189, 97, 126,
+ 190, 192, 97, 128, 616, 124, 110, 123, 104, 132,
+ 97, 134, 104, 127, 179, 97, 136, 127, 132, 188,
+ 189, 110, 128, 134, 190, 192, 128, 97, 124, 110,
+ 123, 104, 141, 132, 97, 104, 240, 179, 134, 136,
+
+ 97, 96, 97, 138, 110, 142, 134, 139, 134, 172,
+ 97, 241, 97, 96, 134, 143, 134, 145, 97, 147,
+ 97, 97, 191, 134, 144, 149, 138, 97, 96, 134,
+ 139, 146, 172, 97, 148, 97, 96, 150, 96, 463,
+ 250, 145, 144, 148, 96, 191, 96, 144, 97, 97,
+ 463, 97, 150, 96, 146, 180, 173, 97, 148, 96,
+ 150, 112, 112, 112, 151, 144, 197, 310, 421, 151,
+ 151, 97, 151, 151, 200, 150, 151, 155, 180, 151,
+ 173, 151, 151, 97, 151, 151, 611, 151, 97, 155,
+ 197, 151, 151, 151, 159, 151, 151, 97, 201, 97,
+
+ 155, 97, 151, 97, 193, 156, 151, 158, 181, 157,
+ 97, 151, 151, 201, 151, 151, 97, 181, 182, 155,
+ 194, 151, 195, 522, 196, 607, 165, 194, 156, 97,
+ 254, 181, 157, 151, 152, 152, 152, 201, 151, 151,
+ 181, 151, 151, 194, 97, 196, 155, 196, 151, 160,
+ 166, 198, 151, 97, 254, 97, 204, 151, 151, 161,
+ 151, 151, 97, 221, 151, 155, 199, 151, 162, 151,
+ 151, 379, 151, 151, 199, 97, 97, 155, 205, 151,
+ 205, 134, 134, 524, 166, 97, 221, 162, 261, 199,
+ 235, 162, 151, 134, 135, 135, 135, 151, 151, 97,
+
+ 151, 151, 205, 605, 97, 155, 207, 151, 166, 151,
+ 162, 96, 163, 235, 151, 151, 236, 151, 151, 181,
+ 202, 237, 155, 97, 151, 97, 164, 134, 97, 207,
+ 134, 97, 97, 97, 97, 372, 163, 213, 209, 236,
+ 317, 168, 181, 203, 237, 181, 203, 134, 134, 164,
+ 151, 97, 97, 97, 262, 151, 151, 96, 151, 151,
+ 96, 97, 209, 155, 168, 151, 208, 134, 181, 203,
+ 167, 97, 134, 210, 543, 97, 97, 96, 96, 134,
+ 420, 97, 168, 97, 134, 97, 134, 214, 97, 208,
+ 97, 97, 211, 97, 244, 134, 378, 96, 212, 97,
+
+ 134, 97, 96, 239, 97, 168, 215, 97, 134, 96,
+ 216, 214, 97, 245, 96, 219, 96, 244, 97, 217,
+ 218, 499, 238, 97, 217, 96, 239, 134, 602, 215,
+ 96, 97, 97, 216, 220, 151, 245, 426, 96, 256,
+ 151, 151, 217, 151, 151, 238, 151, 217, 155, 246,
+ 151, 151, 151, 304, 151, 151, 97, 96, 220, 155,
+ 151, 151, 256, 97, 97, 151, 151, 97, 151, 151,
+ 465, 251, 246, 155, 222, 151, 151, 304, 257, 97,
+ 223, 151, 151, 247, 151, 151, 248, 151, 463, 155,
+ 249, 151, 151, 151, 251, 151, 151, 222, 97, 463,
+
+ 155, 257, 151, 151, 223, 260, 247, 97, 151, 151,
+ 224, 151, 151, 258, 151, 318, 155, 259, 151, 151,
+ 151, 225, 151, 151, 588, 97, 151, 155, 260, 151,
+ 227, 151, 151, 314, 151, 151, 258, 315, 226, 155,
+ 151, 151, 584, 228, 583, 151, 151, 97, 151, 151,
+ 97, 151, 97, 155, 324, 151, 151, 151, 263, 151,
+ 151, 134, 97, 264, 155, 97, 151, 228, 151, 563,
+ 582, 229, 97, 151, 151, 267, 151, 151, 324, 97,
+ 151, 155, 264, 151, 230, 151, 151, 264, 151, 151,
+ 97, 240, 265, 155, 229, 151, 233, 580, 268, 266,
+
+ 340, 231, 97, 97, 306, 97, 469, 230, 151, 273,
+ 134, 97, 97, 151, 151, 266, 151, 151, 97, 502,
+ 151, 155, 266, 151, 231, 151, 151, 268, 151, 151,
+ 274, 275, 274, 155, 269, 151, 234, 568, 270, 97,
+ 271, 231, 232, 134, 272, 134, 565, 97, 134, 97,
+ 268, 134, 97, 274, 275, 97, 97, 271, 134, 546,
+ 234, 288, 97, 271, 231, 134, 278, 277, 276, 97,
+ 134, 373, 279, 96, 97, 96, 134, 327, 96, 134,
+ 97, 96, 281, 97, 288, 134, 546, 280, 96, 97,
+ 277, 276, 97, 303, 134, 96, 282, 283, 97, 525,
+
+ 96, 327, 321, 284, 134, 281, 96, 97, 97, 96,
+ 322, 285, 97, 545, 307, 249, 303, 286, 501, 282,
+ 283, 501, 151, 287, 96, 321, 284, 151, 151, 97,
+ 151, 151, 320, 322, 96, 155, 151, 151, 307, 351,
+ 312, 151, 151, 352, 151, 151, 287, 500, 97, 155,
+ 97, 151, 97, 151, 323, 320, 289, 332, 151, 151,
+ 325, 151, 151, 313, 312, 151, 155, 290, 151, 97,
+ 151, 151, 134, 151, 151, 326, 308, 323, 155, 289,
+ 151, 333, 501, 325, 97, 501, 328, 313, 151, 292,
+ 290, 97, 291, 151, 151, 97, 151, 151, 326, 151,
+
+ 97, 155, 96, 151, 151, 151, 316, 151, 151, 329,
+ 151, 97, 155, 97, 151, 151, 151, 329, 151, 151,
+ 500, 293, 368, 155, 367, 151, 151, 330, 496, 331,
+ 316, 151, 151, 382, 151, 151, 295, 294, 151, 155,
+ 329, 151, 381, 151, 151, 368, 151, 151, 367, 151,
+ 331, 155, 331, 151, 151, 151, 382, 151, 151, 295,
+ 385, 296, 155, 97, 151, 151, 381, 97, 297, 97,
+ 151, 151, 97, 151, 151, 97, 473, 468, 155, 333,
+ 151, 151, 298, 385, 296, 383, 151, 151, 585, 151,
+ 151, 297, 334, 151, 155, 97, 151, 97, 151, 151,
+
+ 299, 151, 151, 333, 300, 298, 155, 97, 151, 383,
+ 97, 97, 336, 301, 335, 335, 338, 339, 134, 134,
+ 466, 302, 97, 97, 337, 97, 134, 134, 134, 341,
+ 97, 97, 97, 97, 97, 337, 460, 335, 343, 342,
+ 339, 339, 380, 344, 302, 415, 134, 337, 96, 96,
+ 97, 346, 375, 341, 455, 315, 96, 96, 96, 134,
+ 134, 345, 134, 97, 97, 380, 97, 344, 415, 134,
+ 349, 97, 449, 97, 347, 375, 96, 369, 369, 369,
+ 97, 96, 97, 348, 134, 345, 371, 374, 97, 96,
+ 96, 501, 96, 350, 501, 151, 377, 448, 347, 96,
+
+ 151, 151, 384, 151, 151, 376, 376, 376, 155, 371,
+ 151, 374, 151, 424, 96, 353, 350, 151, 151, 377,
+ 151, 151, 97, 151, 416, 354, 384, 151, 151, 151,
+ 97, 151, 151, 386, 97, 151, 155, 388, 151, 353,
+ 151, 151, 97, 151, 151, 387, 151, 416, 155, 389,
+ 151, 151, 151, 355, 151, 151, 417, 387, 97, 155,
+ 389, 151, 151, 424, 356, 423, 357, 151, 151, 387,
+ 151, 151, 389, 151, 422, 155, 134, 151, 151, 151,
+ 97, 151, 151, 418, 97, 151, 155, 390, 151, 423,
+ 151, 151, 417, 151, 151, 396, 97, 358, 155, 151,
+
+ 151, 97, 404, 429, 151, 151, 96, 151, 360, 359,
+ 151, 391, 361, 404, 151, 151, 151, 392, 151, 151,
+ 427, 358, 151, 155, 97, 151, 429, 151, 151, 97,
+ 151, 151, 97, 359, 362, 155, 151, 151, 97, 97,
+ 393, 151, 151, 97, 151, 151, 370, 97, 151, 155,
+ 391, 151, 363, 151, 151, 393, 151, 151, 362, 97,
+ 370, 155, 97, 151, 151, 97, 364, 365, 430, 151,
+ 151, 134, 151, 151, 391, 97, 97, 155, 393, 151,
+ 394, 394, 394, 419, 134, 134, 97, 308, 97, 97,
+ 395, 430, 97, 397, 399, 399, 399, 366, 134, 134,
+
+ 134, 96, 97, 97, 97, 134, 419, 470, 398, 97,
+ 403, 403, 403, 395, 96, 96, 97, 397, 400, 255,
+ 366, 402, 410, 410, 410, 401, 253, 252, 96, 96,
+ 96, 398, 428, 431, 151, 96, 134, 97, 185, 151,
+ 151, 400, 151, 151, 402, 151, 432, 155, 97, 151,
+ 151, 151, 425, 151, 151, 428, 134, 431, 155, 151,
+ 151, 406, 405, 134, 151, 151, 472, 151, 151, 432,
+ 433, 151, 155, 97, 151, 425, 151, 151, 134, 151,
+ 151, 461, 422, 151, 155, 405, 151, 407, 151, 151,
+ 472, 151, 151, 433, 151, 97, 155, 97, 151, 151,
+
+ 151, 408, 151, 151, 461, 151, 91, 155, 96, 151,
+ 151, 151, 645, 151, 151, 645, 434, 475, 155, 440,
+ 151, 97, 151, 645, 645, 408, 409, 151, 151, 97,
+ 151, 151, 97, 645, 411, 155, 97, 151, 151, 435,
+ 475, 436, 441, 151, 151, 645, 151, 151, 435, 409,
+ 151, 155, 437, 151, 412, 151, 151, 411, 151, 151,
+ 441, 151, 97, 155, 437, 151, 151, 151, 97, 151,
+ 151, 435, 645, 134, 155, 437, 151, 97, 134, 413,
+ 645, 438, 97, 441, 495, 134, 134, 439, 645, 97,
+ 97, 414, 462, 462, 462, 134, 444, 134, 442, 97,
+
+ 645, 97, 443, 96, 439, 445, 645, 495, 96, 645,
+ 439, 467, 467, 467, 414, 96, 96, 447, 134, 474,
+ 444, 442, 97, 446, 151, 96, 645, 96, 445, 151,
+ 151, 97, 151, 151, 134, 526, 151, 155, 466, 151,
+ 447, 151, 151, 474, 151, 151, 645, 151, 96, 155,
+ 471, 151, 151, 151, 97, 151, 151, 97, 450, 526,
+ 155, 151, 151, 97, 96, 645, 151, 151, 451, 151,
+ 151, 645, 480, 471, 453, 503, 151, 151, 481, 645,
+ 452, 450, 151, 151, 527, 151, 151, 645, 97, 504,
+ 155, 476, 151, 505, 151, 481, 645, 454, 503, 151,
+
+ 151, 481, 151, 151, 645, 151, 528, 155, 527, 151,
+ 151, 151, 504, 151, 151, 477, 505, 645, 155, 151,
+ 151, 454, 456, 97, 151, 151, 477, 151, 151, 482,
+ 528, 134, 155, 151, 151, 97, 506, 457, 151, 151,
+ 97, 151, 151, 478, 97, 456, 155, 479, 151, 134,
+ 477, 134, 519, 468, 134, 97, 458, 645, 97, 506,
+ 645, 96, 459, 485, 485, 485, 97, 479, 645, 97,
+ 483, 479, 490, 490, 490, 519, 97, 484, 97, 96,
+ 507, 96, 151, 520, 96, 459, 645, 151, 151, 487,
+ 151, 151, 508, 151, 521, 155, 523, 151, 151, 151,
+
+ 484, 151, 151, 508, 645, 151, 155, 520, 151, 488,
+ 151, 151, 645, 151, 151, 508, 151, 521, 155, 523,
+ 151, 151, 151, 97, 151, 151, 645, 151, 97, 489,
+ 97, 151, 151, 151, 97, 151, 151, 509, 151, 540,
+ 491, 497, 151, 151, 151, 541, 151, 151, 510, 498,
+ 151, 155, 645, 151, 492, 151, 151, 544, 151, 151,
+ 510, 151, 540, 155, 497, 151, 151, 151, 541, 151,
+ 151, 510, 498, 134, 155, 134, 151, 97, 493, 97,
+ 544, 134, 645, 645, 134, 97, 151, 645, 525, 97,
+ 511, 151, 151, 494, 151, 151, 529, 645, 512, 155,
+
+ 97, 151, 97, 96, 645, 96, 513, 530, 645, 531,
+ 97, 96, 645, 511, 96, 645, 494, 532, 645, 151,
+ 530, 512, 645, 97, 151, 151, 547, 151, 151, 513,
+ 151, 530, 155, 532, 151, 151, 151, 548, 151, 151,
+ 542, 532, 151, 155, 645, 151, 516, 151, 151, 547,
+ 151, 151, 645, 97, 134, 155, 514, 151, 97, 549,
+ 97, 548, 151, 542, 515, 533, 645, 151, 151, 517,
+ 151, 151, 134, 645, 550, 155, 97, 151, 645, 514,
+ 645, 551, 549, 560, 96, 151, 564, 515, 645, 533,
+ 151, 151, 97, 151, 151, 645, 518, 551, 155, 645,
+
+ 151, 534, 96, 151, 551, 535, 560, 97, 151, 151,
+ 564, 151, 151, 552, 97, 566, 155, 151, 151, 518,
+ 645, 562, 151, 151, 534, 151, 151, 134, 553, 535,
+ 155, 97, 151, 645, 151, 97, 553, 537, 566, 151,
+ 151, 536, 151, 151, 561, 562, 554, 155, 645, 151,
+ 151, 553, 645, 567, 538, 151, 151, 96, 151, 151,
+ 569, 606, 134, 539, 536, 151, 97, 151, 561, 554,
+ 586, 97, 151, 151, 587, 151, 151, 567, 570, 609,
+ 155, 151, 151, 555, 569, 606, 151, 151, 645, 151,
+ 151, 97, 96, 586, 155, 556, 151, 587, 571, 151,
+
+ 645, 645, 571, 609, 151, 151, 555, 151, 151, 97,
+ 97, 557, 155, 589, 151, 151, 572, 573, 556, 610,
+ 151, 151, 571, 151, 151, 134, 97, 645, 155, 97,
+ 151, 134, 645, 558, 557, 97, 589, 645, 574, 645,
+ 573, 573, 575, 610, 645, 151, 645, 581, 645, 559,
+ 151, 151, 645, 151, 151, 96, 97, 615, 155, 600,
+ 151, 96, 574, 151, 645, 645, 575, 576, 151, 151,
+ 581, 151, 151, 645, 97, 590, 155, 97, 151, 151,
+ 97, 615, 600, 577, 151, 151, 97, 151, 151, 601,
+ 599, 576, 155, 591, 151, 151, 592, 612, 591, 578,
+
+ 151, 151, 134, 151, 151, 593, 97, 577, 155, 134,
+ 151, 617, 601, 582, 599, 579, 591, 645, 134, 593,
+ 612, 645, 605, 613, 645, 151, 645, 594, 593, 645,
+ 151, 151, 96, 151, 151, 617, 151, 645, 155, 96,
+ 151, 151, 151, 645, 151, 151, 613, 151, 96, 596,
+ 594, 151, 151, 151, 645, 151, 151, 645, 151, 595,
+ 155, 134, 151, 151, 151, 97, 151, 151, 645, 614,
+ 645, 155, 151, 151, 620, 603, 645, 151, 151, 597,
+ 151, 151, 595, 645, 618, 155, 645, 151, 151, 645,
+ 598, 96, 614, 151, 151, 604, 151, 151, 620, 603,
+
+ 151, 155, 627, 151, 628, 151, 151, 618, 151, 151,
+ 622, 625, 151, 155, 626, 151, 629, 151, 151, 604,
+ 151, 151, 630, 631, 633, 608, 627, 151, 628, 634,
+ 635, 636, 645, 622, 625, 637, 638, 626, 640, 641,
+ 629, 642, 643, 645, 645, 630, 631, 645, 633, 645,
+ 645, 645, 634, 645, 635, 636, 645, 645, 637, 638,
+ 645, 640, 641, 645, 642, 643, 14, 14, 14, 14,
+ 14, 14, 14, 14, 38, 38, 38, 38, 38, 38,
+ 38, 38, 57, 57, 57, 57, 57, 57, 57, 57,
+ 70, 70, 70, 70, 70, 70, 70, 70, 96, 645,
+
+ 96, 111, 111, 645, 645, 111, 111, 111, 111, 133,
+ 133, 137, 137, 137, 151, 645, 645, 645, 151, 151,
+ 151, 154, 645, 645, 645, 154, 154, 154, 463, 645,
+ 645, 463, 463, 463, 463, 463, 486, 645, 645, 486,
+ 486, 486, 486, 486, 13, 645, 645, 645, 645, 645,
+ 645, 645, 645, 645, 645, 645, 645, 645, 645, 645,
+ 645, 645, 645, 645, 645, 645, 645, 645, 645, 645,
+ 645, 645, 645, 645, 645, 645, 645, 645, 645, 645,
+ 645, 645, 645, 645, 645, 645, 645, 645, 645, 645,
+ 645, 645, 645, 645, 645, 645, 645, 645, 645, 645,
+
+ 645, 645, 645, 645, 645, 645, 645
+ } ;
+
+static yyconst flex_int16_t yy_chk[2708] =
+ { 0,
+ 0, 1, 1, 1, 1, 1, 1, 1, 656, 1,
+ 1, 1, 1, 1, 1, 1, 3, 3, 3, 4,
+ 4, 4, 40, 29, 15, 5, 5, 15, 6, 6,
+ 29, 30, 1, 5, 5, 5, 6, 6, 6, 22,
+ 22, 22, 39, 39, 39, 643, 40, 242, 30, 56,
+ 56, 56, 56, 638, 242, 1, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 7, 7,
+ 7, 7, 7, 7, 7, 26, 7, 7, 7, 7,
+ 7, 7, 7, 24, 24, 43, 37, 33, 28, 7,
+ 31, 44, 631, 31, 33, 32, 7, 7, 26, 7,
+ 7, 7, 32, 31, 28, 37, 24, 24, 28, 43,
+ 34, 78, 31, 7, 36, 44, 32, 34, 33, 7,
+ 7, 36, 7, 7, 7, 8, 32, 28, 37, 34,
+ 93, 28, 8, 8, 78, 31, 8, 8, 197, 32,
+ 75, 75, 75, 197, 90, 36, 45, 90, 622, 8,
+
+ 621, 48, 34, 45, 93, 8, 8, 35, 48, 8,
+ 8, 9, 9, 9, 9, 9, 9, 9, 9, 9,
+ 9, 9, 9, 9, 9, 9, 9, 45, 41, 35,
+ 41, 42, 48, 59, 94, 61, 95, 59, 102, 61,
+ 100, 42, 103, 9, 619, 103, 61, 92, 92, 92,
+ 9, 41, 35, 41, 109, 42, 250, 109, 94, 95,
+ 102, 100, 250, 59, 42, 61, 9, 10, 10, 10,
+ 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
+ 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
+ 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
+
+ 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
+ 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,
+ 10, 10, 10, 10, 10, 10, 10, 10, 10, 11,
+ 11, 11, 11, 11, 11, 11, 46, 11, 11, 11,
+ 11, 11, 11, 11, 50, 113, 101, 110, 114, 53,
+ 110, 50, 177, 46, 104, 46, 53, 79, 104, 176,
+ 11, 617, 79, 79, 240, 79, 79, 101, 113, 237,
+ 79, 114, 79, 237, 110, 50, 46, 177, 46, 176,
+ 53, 240, 104, 11, 12, 12, 12, 12, 12, 12,
+ 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
+
+ 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
+ 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
+ 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
+ 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
+ 12, 12, 12, 12, 12, 12, 47, 49, 51, 47,
+ 52, 58, 419, 52, 49, 115, 105, 116, 419, 47,
+ 117, 119, 54, 52, 614, 51, 49, 51, 47, 54,
+ 174, 62, 52, 47, 105, 62, 58, 52, 49, 115,
+ 116, 54, 47, 60, 117, 119, 52, 60, 51, 49,
+ 51, 47, 62, 54, 98, 52, 174, 105, 63, 58,
+
+ 175, 62, 63, 60, 54, 63, 64, 60, 65, 98,
+ 64, 175, 65, 60, 66, 63, 67, 64, 66, 65,
+ 67, 183, 118, 68, 63, 66, 60, 68, 63, 69,
+ 60, 64, 98, 69, 68, 106, 64, 66, 65, 449,
+ 183, 64, 67, 65, 66, 118, 67, 63, 373, 99,
+ 449, 241, 69, 68, 64, 106, 99, 123, 68, 69,
+ 66, 112, 112, 112, 82, 67, 123, 241, 373, 82,
+ 82, 126, 82, 82, 126, 69, 80, 82, 106, 82,
+ 99, 80, 80, 120, 80, 80, 609, 81, 108, 80,
+ 123, 80, 81, 81, 82, 81, 81, 107, 126, 121,
+
+ 81, 122, 81, 124, 120, 80, 85, 81, 108, 80,
+ 128, 85, 85, 128, 85, 85, 499, 107, 107, 85,
+ 121, 85, 122, 499, 124, 601, 85, 120, 80, 125,
+ 187, 108, 80, 83, 152, 152, 152, 128, 83, 83,
+ 107, 83, 83, 121, 127, 122, 83, 124, 83, 83,
+ 85, 125, 87, 131, 187, 319, 131, 87, 87, 83,
+ 87, 87, 193, 153, 88, 87, 127, 87, 83, 88,
+ 88, 319, 88, 88, 125, 132, 502, 88, 132, 88,
+ 131, 137, 136, 502, 88, 137, 153, 87, 193, 127,
+ 169, 83, 84, 135, 135, 135, 135, 84, 84, 129,
+
+ 84, 84, 132, 599, 593, 84, 136, 84, 88, 89,
+ 87, 137, 84, 169, 89, 89, 170, 89, 89, 129,
+ 129, 171, 89, 248, 89, 130, 84, 139, 194, 136,
+ 143, 139, 309, 592, 143, 309, 84, 143, 139, 170,
+ 248, 89, 129, 129, 171, 130, 130, 138, 140, 84,
+ 86, 138, 140, 522, 194, 86, 86, 139, 86, 86,
+ 143, 372, 139, 86, 89, 86, 138, 141, 130, 130,
+ 86, 141, 142, 140, 522, 591, 142, 138, 140, 144,
+ 372, 178, 86, 144, 145, 173, 146, 144, 145, 138,
+ 146, 179, 141, 318, 178, 147, 318, 141, 142, 147,
+
+ 148, 172, 142, 173, 148, 86, 145, 465, 149, 144,
+ 146, 144, 149, 179, 145, 149, 146, 178, 378, 147,
+ 147, 465, 172, 590, 148, 147, 173, 150, 588, 145,
+ 148, 150, 180, 146, 150, 154, 179, 378, 149, 189,
+ 154, 154, 147, 154, 154, 172, 156, 148, 154, 180,
+ 154, 156, 156, 236, 156, 156, 184, 150, 150, 156,
+ 157, 156, 189, 181, 182, 157, 157, 420, 157, 157,
+ 420, 184, 180, 157, 156, 157, 158, 236, 190, 585,
+ 157, 158, 158, 181, 158, 158, 182, 159, 486, 158,
+ 182, 158, 159, 159, 184, 159, 159, 156, 249, 486,
+
+ 159, 190, 159, 160, 157, 192, 181, 583, 160, 160,
+ 158, 160, 160, 191, 161, 249, 160, 191, 160, 161,
+ 161, 159, 161, 161, 568, 563, 162, 161, 192, 161,
+ 161, 162, 162, 246, 162, 162, 191, 246, 160, 162,
+ 163, 162, 564, 162, 563, 163, 163, 195, 163, 163,
+ 200, 164, 196, 163, 256, 163, 164, 164, 195, 164,
+ 164, 210, 543, 196, 164, 210, 164, 162, 166, 543,
+ 562, 163, 198, 166, 166, 200, 166, 166, 256, 199,
+ 167, 166, 195, 166, 164, 167, 167, 196, 167, 167,
+ 204, 210, 198, 167, 163, 167, 167, 560, 200, 199,
+
+ 275, 166, 201, 426, 275, 469, 426, 164, 165, 204,
+ 207, 205, 202, 165, 165, 198, 165, 165, 203, 469,
+ 168, 165, 199, 165, 166, 168, 168, 201, 168, 168,
+ 205, 207, 204, 168, 202, 168, 168, 548, 202, 545,
+ 203, 165, 165, 208, 203, 209, 545, 208, 212, 209,
+ 201, 211, 212, 205, 207, 211, 310, 202, 213, 539,
+ 168, 221, 213, 203, 165, 214, 211, 209, 208, 214,
+ 215, 310, 212, 208, 215, 209, 216, 260, 212, 217,
+ 216, 211, 214, 217, 221, 218, 525, 213, 213, 218,
+ 209, 208, 524, 235, 219, 214, 215, 216, 219, 503,
+
+ 215, 260, 253, 217, 220, 214, 216, 238, 220, 217,
+ 254, 218, 251, 524, 238, 218, 235, 219, 467, 215,
+ 216, 467, 222, 220, 219, 253, 217, 222, 222, 244,
+ 222, 222, 251, 254, 220, 222, 223, 222, 238, 288,
+ 244, 223, 223, 288, 223, 223, 220, 489, 481, 223,
+ 265, 223, 245, 224, 255, 251, 222, 265, 224, 224,
+ 258, 224, 224, 245, 244, 225, 224, 223, 224, 261,
+ 225, 225, 277, 225, 225, 259, 277, 255, 225, 222,
+ 225, 265, 490, 258, 480, 490, 261, 245, 226, 225,
+ 223, 470, 224, 226, 226, 247, 226, 226, 259, 227,
+
+ 262, 226, 277, 226, 227, 227, 247, 227, 227, 261,
+ 228, 263, 227, 264, 227, 228, 228, 262, 228, 228,
+ 466, 226, 304, 228, 303, 228, 229, 263, 461, 264,
+ 247, 229, 229, 322, 229, 229, 228, 227, 230, 229,
+ 262, 229, 321, 230, 230, 304, 230, 230, 303, 231,
+ 263, 230, 264, 230, 231, 231, 322, 231, 231, 228,
+ 327, 229, 231, 437, 231, 232, 321, 436, 230, 565,
+ 232, 232, 266, 232, 232, 269, 431, 425, 232, 266,
+ 232, 233, 231, 327, 229, 323, 233, 233, 565, 233,
+ 233, 230, 269, 234, 233, 270, 233, 271, 234, 234,
+
+ 232, 234, 234, 266, 232, 231, 234, 272, 234, 323,
+ 273, 274, 270, 233, 271, 269, 273, 274, 276, 278,
+ 423, 234, 276, 278, 272, 320, 280, 279, 281, 276,
+ 280, 279, 281, 313, 421, 270, 415, 271, 279, 278,
+ 273, 274, 320, 281, 234, 367, 282, 272, 276, 278,
+ 282, 283, 313, 276, 410, 283, 280, 279, 281, 284,
+ 286, 282, 285, 284, 286, 320, 285, 281, 367, 287,
+ 286, 307, 404, 287, 284, 313, 282, 305, 305, 305,
+ 316, 283, 312, 285, 343, 282, 307, 312, 343, 284,
+ 286, 501, 285, 287, 501, 289, 316, 403, 284, 287,
+
+ 289, 289, 326, 289, 289, 314, 314, 314, 289, 307,
+ 289, 312, 290, 399, 343, 289, 287, 290, 290, 316,
+ 290, 290, 330, 291, 368, 290, 326, 290, 291, 291,
+ 328, 291, 291, 328, 331, 292, 291, 330, 291, 289,
+ 292, 292, 329, 292, 292, 329, 293, 368, 292, 331,
+ 292, 293, 293, 291, 293, 293, 394, 328, 375, 293,
+ 330, 293, 294, 376, 292, 375, 293, 294, 294, 329,
+ 294, 294, 331, 295, 374, 294, 342, 294, 295, 295,
+ 342, 295, 295, 370, 336, 296, 295, 336, 295, 375,
+ 296, 296, 369, 296, 296, 342, 379, 295, 296, 297,
+
+ 296, 338, 361, 381, 297, 297, 342, 297, 297, 296,
+ 298, 336, 297, 352, 297, 298, 298, 338, 298, 298,
+ 379, 295, 299, 298, 335, 298, 381, 299, 299, 334,
+ 299, 299, 333, 296, 298, 299, 300, 299, 332, 339,
+ 338, 300, 300, 317, 300, 300, 315, 337, 301, 300,
+ 337, 300, 299, 301, 301, 339, 301, 301, 298, 311,
+ 306, 301, 371, 301, 302, 268, 300, 301, 382, 302,
+ 302, 341, 302, 302, 337, 341, 267, 302, 339, 302,
+ 340, 340, 340, 371, 344, 345, 243, 239, 344, 345,
+ 341, 382, 427, 344, 346, 346, 346, 302, 347, 348,
+
+ 350, 341, 347, 348, 350, 349, 371, 427, 345, 349,
+ 351, 351, 351, 341, 344, 345, 380, 344, 347, 188,
+ 302, 350, 360, 360, 360, 349, 186, 185, 347, 348,
+ 350, 345, 380, 383, 353, 349, 133, 377, 111, 353,
+ 353, 347, 353, 353, 350, 355, 384, 353, 96, 353,
+ 355, 355, 377, 355, 355, 380, 57, 383, 355, 356,
+ 355, 355, 353, 55, 356, 356, 429, 356, 356, 384,
+ 385, 357, 356, 27, 356, 377, 357, 357, 397, 357,
+ 357, 416, 397, 358, 357, 353, 357, 356, 358, 358,
+ 429, 358, 358, 385, 359, 392, 358, 386, 358, 359,
+
+ 359, 358, 359, 359, 416, 362, 17, 359, 397, 359,
+ 362, 362, 13, 362, 362, 0, 386, 433, 362, 392,
+ 362, 388, 363, 0, 0, 358, 359, 363, 363, 387,
+ 363, 363, 389, 0, 362, 363, 393, 363, 364, 386,
+ 433, 388, 392, 364, 364, 0, 364, 364, 387, 359,
+ 365, 364, 389, 364, 364, 365, 365, 362, 365, 365,
+ 393, 366, 390, 365, 388, 365, 366, 366, 391, 366,
+ 366, 387, 0, 395, 366, 389, 366, 395, 396, 365,
+ 0, 390, 396, 393, 460, 398, 400, 391, 0, 398,
+ 400, 366, 417, 417, 417, 401, 398, 402, 395, 401,
+
+ 0, 402, 396, 395, 390, 400, 0, 460, 396, 0,
+ 391, 424, 424, 424, 366, 398, 400, 402, 443, 432,
+ 398, 395, 443, 401, 405, 401, 0, 402, 400, 405,
+ 405, 428, 405, 405, 444, 504, 406, 405, 444, 405,
+ 402, 406, 406, 432, 406, 406, 0, 407, 443, 406,
+ 428, 406, 407, 407, 471, 407, 407, 440, 405, 504,
+ 407, 408, 407, 441, 444, 0, 408, 408, 406, 408,
+ 408, 0, 440, 428, 408, 471, 408, 409, 441, 0,
+ 407, 405, 409, 409, 505, 409, 409, 0, 434, 472,
+ 409, 434, 409, 473, 411, 440, 0, 409, 471, 411,
+
+ 411, 441, 411, 411, 0, 412, 506, 411, 505, 411,
+ 412, 412, 472, 412, 412, 434, 473, 0, 412, 413,
+ 412, 409, 411, 435, 413, 413, 435, 413, 413, 442,
+ 506, 442, 413, 414, 413, 442, 474, 412, 414, 414,
+ 438, 414, 414, 438, 439, 411, 414, 439, 414, 445,
+ 435, 446, 495, 445, 447, 446, 413, 0, 447, 474,
+ 0, 442, 414, 448, 448, 448, 476, 438, 0, 498,
+ 446, 439, 455, 455, 455, 495, 497, 447, 477, 445,
+ 476, 446, 450, 497, 447, 414, 0, 450, 450, 450,
+ 450, 450, 477, 451, 498, 450, 500, 450, 451, 451,
+
+ 447, 451, 451, 476, 0, 452, 451, 497, 451, 451,
+ 452, 452, 0, 452, 452, 477, 454, 498, 452, 500,
+ 452, 454, 454, 478, 454, 454, 0, 456, 464, 454,
+ 520, 454, 456, 456, 479, 456, 456, 478, 457, 519,
+ 456, 464, 456, 457, 457, 520, 457, 457, 479, 464,
+ 458, 457, 0, 457, 457, 458, 458, 523, 458, 458,
+ 478, 459, 519, 458, 464, 458, 459, 459, 520, 459,
+ 459, 479, 464, 482, 459, 483, 459, 482, 458, 483,
+ 523, 484, 0, 0, 513, 484, 493, 0, 513, 507,
+ 482, 493, 493, 459, 493, 493, 507, 0, 482, 493,
+
+ 508, 493, 509, 482, 0, 483, 484, 508, 0, 509,
+ 510, 484, 0, 482, 513, 0, 459, 510, 0, 488,
+ 507, 482, 0, 521, 488, 488, 526, 488, 488, 484,
+ 487, 508, 488, 509, 488, 487, 487, 527, 487, 487,
+ 521, 510, 492, 487, 0, 487, 488, 492, 492, 526,
+ 492, 492, 0, 529, 511, 492, 487, 492, 511, 528,
+ 530, 527, 494, 521, 487, 511, 0, 494, 494, 492,
+ 494, 494, 512, 0, 529, 494, 512, 494, 0, 487,
+ 0, 530, 528, 540, 511, 514, 544, 487, 0, 511,
+ 514, 514, 531, 514, 514, 0, 494, 529, 514, 0,
+
+ 514, 512, 512, 515, 530, 514, 540, 532, 515, 515,
+ 544, 515, 515, 531, 542, 546, 515, 516, 515, 494,
+ 0, 542, 516, 516, 512, 516, 516, 533, 532, 514,
+ 516, 533, 516, 0, 517, 541, 531, 516, 546, 517,
+ 517, 515, 517, 517, 541, 542, 533, 517, 0, 517,
+ 518, 532, 0, 547, 517, 518, 518, 533, 518, 518,
+ 549, 600, 534, 518, 515, 518, 534, 535, 541, 533,
+ 566, 550, 535, 535, 567, 535, 535, 547, 550, 606,
+ 535, 536, 535, 534, 549, 600, 536, 536, 0, 536,
+ 536, 551, 534, 566, 536, 535, 536, 567, 551, 537,
+
+ 0, 0, 550, 606, 537, 537, 534, 537, 537, 552,
+ 553, 536, 537, 569, 537, 538, 552, 553, 535, 607,
+ 538, 538, 551, 538, 538, 554, 561, 0, 538, 554,
+ 538, 555, 0, 537, 536, 555, 569, 0, 554, 0,
+ 552, 553, 555, 607, 0, 556, 0, 561, 0, 538,
+ 556, 556, 0, 556, 556, 554, 570, 613, 556, 584,
+ 556, 555, 554, 557, 0, 0, 555, 556, 557, 557,
+ 561, 557, 557, 0, 571, 570, 557, 572, 557, 558,
+ 581, 613, 584, 557, 558, 558, 573, 558, 558, 586,
+ 581, 556, 558, 571, 558, 559, 572, 610, 570, 558,
+
+ 559, 559, 574, 559, 559, 573, 574, 557, 559, 575,
+ 559, 615, 586, 575, 581, 559, 571, 0, 603, 572,
+ 610, 0, 603, 611, 0, 576, 0, 574, 573, 0,
+ 576, 576, 574, 576, 576, 615, 577, 0, 576, 575,
+ 576, 577, 577, 0, 577, 577, 611, 578, 603, 577,
+ 574, 577, 578, 578, 0, 578, 578, 0, 579, 576,
+ 578, 594, 578, 579, 579, 594, 579, 579, 0, 612,
+ 0, 579, 595, 579, 618, 594, 0, 595, 595, 578,
+ 595, 595, 576, 0, 616, 595, 0, 595, 597, 0,
+ 579, 594, 612, 597, 597, 595, 597, 597, 618, 594,
+
+ 598, 597, 626, 597, 627, 598, 598, 616, 598, 598,
+ 620, 624, 604, 598, 625, 598, 628, 604, 604, 595,
+ 604, 604, 629, 630, 632, 604, 626, 604, 627, 633,
+ 634, 635, 0, 620, 624, 636, 637, 625, 639, 640,
+ 628, 641, 642, 0, 0, 629, 630, 0, 632, 0,
+ 0, 0, 633, 0, 634, 635, 0, 0, 636, 637,
+ 0, 639, 640, 0, 641, 642, 646, 646, 646, 646,
+ 646, 646, 646, 646, 647, 647, 647, 647, 647, 647,
+ 647, 647, 648, 648, 648, 648, 648, 648, 648, 648,
+ 649, 649, 649, 649, 649, 649, 649, 649, 650, 0,
+
+ 650, 651, 651, 0, 0, 651, 651, 651, 651, 652,
+ 652, 653, 653, 653, 654, 0, 0, 0, 654, 654,
+ 654, 655, 0, 0, 0, 655, 655, 655, 657, 0,
+ 0, 657, 657, 657, 657, 657, 658, 0, 0, 658,
+ 658, 658, 658, 658, 645, 645, 645, 645, 645, 645,
+ 645, 645, 645, 645, 645, 645, 645, 645, 645, 645,
+ 645, 645, 645, 645, 645, 645, 645, 645, 645, 645,
+ 645, 645, 645, 645, 645, 645, 645, 645, 645, 645,
+ 645, 645, 645, 645, 645, 645, 645, 645, 645, 645,
+ 645, 645, 645, 645, 645, 645, 645, 645, 645, 645,
+
+ 645, 645, 645, 645, 645, 645, 645
+ } ;
+
+/* The intent behind this definition is that it'll catch
+ * any uses of REJECT which flex missed.
+ */
+#define REJECT reject_used_but_not_detected
+#define yymore() yymore_used_but_not_detected
+#define YY_MORE_ADJ 0
+#define YY_RESTORE_YY_MORE_OFFSET
+
+#include <string>
+
+#include "parser.h"
+#define yyterminate() return(END)
+
+#define INITIAL 0
+#define MATCH_STRING_STATE 1
+#define MATCH_RESPONSE_CODE_STATE 2
+#define SUPPORTED_METHODS_STATE 3
+#define CONTENT_TYPE_STATE 4
+#define SESSION_STATE 5
+
+#ifndef YY_NO_UNISTD_H
+/* Special case for "unistd.h", since it is non-ANSI. We include it way
+ * down here because we want the user's section 1 to have been scanned first.
+ * The user has a chance to override it with an option.
+ */
+#include <unistd.h>
+#endif
+
+#define YY_EXTRA_TYPE bool
+
+/* Holds the entire state of the reentrant scanner. */
+struct yyguts_t
+ {
+
+ /* User-defined. Not touched by flex. */
+ YY_EXTRA_TYPE yyextra_r;
+
+ /* The rest are the same as the globals declared in the non-reentrant scanner. */
+ FILE *yyin_r, *yyout_r;
+ size_t yy_buffer_stack_top; /**< index of top of stack. */
+ size_t yy_buffer_stack_max; /**< capacity of stack. */
+ YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */
+ char yy_hold_char;
+ int yy_n_chars;
+ int yyleng_r;
+ char *yy_c_buf_p;
+ int yy_init;
+ int yy_start;
+ int yy_did_buffer_switch_on_eof;
+ int yy_start_stack_ptr;
+ int yy_start_stack_depth;
+ int *yy_start_stack;
+ yy_state_type yy_last_accepting_state;
+ char* yy_last_accepting_cpos;
+
+ int yylineno_r;
+ int yy_flex_debug_r;
+
+ char *yytext_r;
+ int yy_more_flag;
+ int yy_more_len;
+
+ YYSTYPE * yylval_r;
+
+ }; /* end struct yyguts_t */
+
+static int yy_init_globals (yyscan_t yyscanner );
+
+ /* This must go here because YYSTYPE and YYLTYPE are included
+ * from bison output in section 1.*/
+ # define yylval yyg->yylval_r
+
+int header_lex_init (yyscan_t* scanner);
+
+int header_lex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner);
+
+/* Accessor methods to globals.
+ These are made visible to non-reentrant scanners for convenience. */
+
+int header_lex_destroy (yyscan_t yyscanner );
+
+int header_get_debug (yyscan_t yyscanner );
+
+void header_set_debug (int debug_flag ,yyscan_t yyscanner );
+
+YY_EXTRA_TYPE header_get_extra (yyscan_t yyscanner );
+
+void header_set_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner );
+
+FILE *header_get_in (yyscan_t yyscanner );
+
+void header_set_in (FILE * in_str ,yyscan_t yyscanner );
+
+FILE *header_get_out (yyscan_t yyscanner );
+
+void header_set_out (FILE * out_str ,yyscan_t yyscanner );
+
+int header_get_leng (yyscan_t yyscanner );
+
+char *header_get_text (yyscan_t yyscanner );
+
+int header_get_lineno (yyscan_t yyscanner );
+
+void header_set_lineno (int line_number ,yyscan_t yyscanner );
+
+YYSTYPE * header_get_lval (yyscan_t yyscanner );
+
+void header_set_lval (YYSTYPE * yylval_param ,yyscan_t yyscanner );
+
+/* Macros after this point can all be overridden by user definitions in
+ * section 1.
+ */
+
+#ifndef YY_SKIP_YYWRAP
+#ifdef __cplusplus
+extern "C" int header_wrap (yyscan_t yyscanner );
+#else
+extern int header_wrap (yyscan_t yyscanner );
+#endif
+#endif
+
+#ifndef yytext_ptr
+static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner);
+#endif
+
+#ifdef YY_NEED_STRLEN
+static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner);
+#endif
+
+#ifndef YY_NO_INPUT
+
+#ifdef __cplusplus
+static int yyinput (yyscan_t yyscanner );
+#else
+static int input (yyscan_t yyscanner );
+#endif
+
+#endif
+
+/* Amount of stuff to slurp up with each read. */
+#ifndef YY_READ_BUF_SIZE
+#ifdef __ia64__
+/* On IA-64, the buffer size is 16k, not 8k */
+#define YY_READ_BUF_SIZE 16384
+#else
+#define YY_READ_BUF_SIZE 8192
+#endif /* __ia64__ */
+#endif
+
+/* Copy whatever the last rule matched to the standard output. */
+#ifndef ECHO
+/* This used to be an fputs(), but since the string might contain NUL's,
+ * we now use fwrite().
+ */
+#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
+#endif
+
+/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
+ * is returned in "result".
+ */
+#ifndef YY_INPUT
+#define YY_INPUT(buf,result,max_size) \
+ if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
+ { \
+ int c = '*'; \
+ size_t n; \
+ for ( n = 0; n < max_size && \
+ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
+ buf[n] = (char) c; \
+ if ( c == '\n' ) \
+ buf[n++] = (char) c; \
+ if ( c == EOF && ferror( yyin ) ) \
+ YY_FATAL_ERROR( "input in flex scanner failed" ); \
+ result = n; \
+ } \
+ else \
+ { \
+ errno=0; \
+ while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
+ { \
+ if( errno != EINTR) \
+ { \
+ YY_FATAL_ERROR( "input in flex scanner failed" ); \
+ break; \
+ } \
+ errno=0; \
+ clearerr(yyin); \
+ } \
+ }\
+\
+
+#endif
+
+/* No semi-colon after return; correct usage is to write "yyterminate();" -
+ * we don't want an extra ';' after the "return" because that will cause
+ * some compilers to complain about unreachable statements.
+ */
+#ifndef yyterminate
+#define yyterminate() return YY_NULL
+#endif
+
+/* Number of entries by which start-condition stack grows. */
+#ifndef YY_START_STACK_INCR
+#define YY_START_STACK_INCR 25
+#endif
+
+/* Report a fatal error. */
+#ifndef YY_FATAL_ERROR
+#define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner)
+#endif
+
+/* end tables serialization structures and prototypes */
+
+/* Default declaration of generated scanner - a define so the user can
+ * easily add parameters.
+ */
+#ifndef YY_DECL
+#define YY_DECL_IS_OURS 1
+
+extern int header_lex \
+ (YYSTYPE * yylval_param ,yyscan_t yyscanner);
+
+#define YY_DECL int header_lex \
+ (YYSTYPE * yylval_param , yyscan_t yyscanner)
+#endif /* !YY_DECL */
+
+/* Code executed at the beginning of each rule, after yytext and yyleng
+ * have been set up.
+ */
+#ifndef YY_USER_ACTION
+#define YY_USER_ACTION
+#endif
+
+/* Code executed at the end of each rule. */
+#ifndef YY_BREAK
+#define YY_BREAK break;
+#endif
+
+#define YY_RULE_SETUP \
+ if ( yyleng > 0 ) \
+ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \
+ (yytext[yyleng - 1] == '\n'); \
+ YY_USER_ACTION
+
+/** The main scanner function which does all the work.
+ */
+YY_DECL
+{
+ register yy_state_type yy_current_state;
+ register char *yy_cp, *yy_bp;
+ register int yy_act;
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+
+ yylval = yylval_param;
+
+ if ( !yyg->yy_init )
+ {
+ yyg->yy_init = 1;
+
+#ifdef YY_USER_INIT
+ YY_USER_INIT;
+#endif
+
+ if ( ! yyg->yy_start )
+ yyg->yy_start = 1; /* first start state */
+
+ if ( ! yyin )
+ yyin = stdin;
+
+ if ( ! yyout )
+ yyout = stdout;
+
+ if ( ! YY_CURRENT_BUFFER ) {
+ header_ensure_buffer_stack (yyscanner);
+ YY_CURRENT_BUFFER_LVALUE =
+ header__create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
+ }
+
+ header__load_buffer_state(yyscanner );
+ }
+
+ while ( 1 ) /* loops until end-of-file is reached */
+ {
+ yy_cp = yyg->yy_c_buf_p;
+
+ /* Support of yytext. */
+ *yy_cp = yyg->yy_hold_char;
+
+ /* yy_bp points to the position in yy_ch_buf of the start of
+ * the current run.
+ */
+ yy_bp = yy_cp;
+
+ yy_current_state = yyg->yy_start;
+ yy_current_state += YY_AT_BOL();
+yy_match:
+ do
+ {
+ register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
+ if ( yy_accept[yy_current_state] )
+ {
+ yyg->yy_last_accepting_state = yy_current_state;
+ yyg->yy_last_accepting_cpos = yy_cp;
+ }
+ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+ {
+ yy_current_state = (int) yy_def[yy_current_state];
+ if ( yy_current_state >= 646 )
+ yy_c = yy_meta[(unsigned int) yy_c];
+ }
+ yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+ ++yy_cp;
+ }
+ while ( yy_current_state != 645 );
+ yy_cp = yyg->yy_last_accepting_cpos;
+ yy_current_state = yyg->yy_last_accepting_state;
+
+yy_find_action:
+ yy_act = yy_accept[yy_current_state];
+
+ YY_DO_BEFORE_ACTION;
+
+do_action: /* This label is used only to access EOF actions. */
+
+ switch ( yy_act )
+ { /* beginning of action switch */
+ case 0: /* must back up */
+ /* undo the effects of YY_DO_BEFORE_ACTION */
+ *yy_cp = yyg->yy_hold_char;
+ yy_cp = yyg->yy_last_accepting_cpos;
+ yy_current_state = yyg->yy_last_accepting_state;
+ goto yy_find_action;
+
+case 1:
+/* rule 1 can match eol */
+YY_RULE_SETUP
+{ BEGIN(INITIAL); }
+ YY_BREAK
+case 2:
+/* rule 2 can match eol */
+YY_RULE_SETUP
+{ BEGIN(INITIAL); }
+ YY_BREAK
+case 3:
+YY_RULE_SETUP
+{ BEGIN(INITIAL); }
+ YY_BREAK
+/* Convert these */
+case 4:
+YY_RULE_SETUP
+{ return '='; }
+ YY_BREAK
+case 5:
+YY_RULE_SETUP
+{ return '-'; }
+ YY_BREAK
+case 6:
+YY_RULE_SETUP
+{ return ','; }
+ YY_BREAK
+case 7:
+YY_RULE_SETUP
+{ return '*'; }
+ YY_BREAK
+case 8:
+YY_RULE_SETUP
+{ return ';'; }
+ YY_BREAK
+case 9:
+YY_RULE_SETUP
+{ return ':'; }
+ YY_BREAK
+case 10:
+YY_RULE_SETUP
+{ return '/'; }
+ YY_BREAK
+case 11:
+YY_RULE_SETUP
+return WFD_SP;
+ YY_BREAK
+case 12:
+YY_RULE_SETUP
+return WFD_TIMEOUT;
+ YY_BREAK
+case 13:
+YY_RULE_SETUP
+return WFD_SERVER_PORT;
+ YY_BREAK
+case 14:
+YY_RULE_SETUP
+{
+ BEGIN(INITIAL);
+ return WFD_OPTIONS;
+ }
+ YY_BREAK
+case 15:
+YY_RULE_SETUP
+{
+ BEGIN(INITIAL);
+ return WFD_SET_PARAMETER;
+ }
+ YY_BREAK
+case 16:
+YY_RULE_SETUP
+{
+ BEGIN(INITIAL);
+ return WFD_GET_PARAMETER;
+ }
+ YY_BREAK
+case 17:
+YY_RULE_SETUP
+{
+ BEGIN(INITIAL);
+ return WFD_SETUP;
+ }
+ YY_BREAK
+case 18:
+YY_RULE_SETUP
+{
+ BEGIN(INITIAL);
+ return WFD_PLAY;
+ }
+ YY_BREAK
+case 19:
+YY_RULE_SETUP
+{
+ BEGIN(INITIAL);
+ return WFD_TEARDOWN;
+ }
+ YY_BREAK
+case 20:
+YY_RULE_SETUP
+{
+ BEGIN(INITIAL);
+ return WFD_PAUSE;
+ }
+ YY_BREAK
+/* RTSP response, get reply code, RTSP/1.0 200 OK */
+case 21:
+YY_RULE_SETUP
+{
+ BEGIN(MATCH_RESPONSE_CODE_STATE);
+ return WFD_RESPONSE;
+ }
+ YY_BREAK
+/* CSeq: i */
+case 22:
+YY_RULE_SETUP
+{
+ BEGIN(INITIAL);
+ return WFD_CSEQ;
+ }
+ YY_BREAK
+case 23:
+YY_RULE_SETUP
+{
+ BEGIN(SUPPORTED_METHODS_STATE);
+ return WFD_RESPONSE_METHODS;
+ }
+ YY_BREAK
+case 24:
+YY_RULE_SETUP
+{
+ return WFD_SUPPORT_CHECK;
+ }
+ YY_BREAK
+case 25:
+YY_RULE_SETUP
+{
+ BEGIN(CONTENT_TYPE_STATE);
+ return WFD_CONTENT_TYPE;
+ }
+ YY_BREAK
+case 26:
+YY_RULE_SETUP
+{
+ BEGIN(INITIAL);
+ return WFD_CONTENT_LENGTH;
+ }
+ YY_BREAK
+case 27:
+YY_RULE_SETUP
+{
+ BEGIN(SESSION_STATE);
+ return WFD_SESSION;
+ }
+ YY_BREAK
+case 28:
+YY_RULE_SETUP
+{
+ return WFD_TRANSPORT;
+ }
+ YY_BREAK
+case 29:
+YY_RULE_SETUP
+{
+ BEGIN(MATCH_STRING_STATE);
+ yylval->sval = new std::string(yytext, yyleng - 1);
+ return WFD_HEADER;
+ }
+ YY_BREAK
+case 30:
+YY_RULE_SETUP
+{
+ BEGIN(INITIAL);
+ yylval->sval = new std::string(yytext, yyleng);
+ return WFD_SESSION_ID;
+ }
+ YY_BREAK
+case 31:
+YY_RULE_SETUP
+{
+ BEGIN(MATCH_STRING_STATE);
+ yylval->nval = atoi(yytext);
+ return WFD_RESPONSE_CODE;
+ }
+ YY_BREAK
+case 32:
+/* rule 32 can match eol */
+*yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */
+yyg->yy_c_buf_p = yy_cp -= 2;
+YY_DO_BEFORE_ACTION; /* set up yytext again */
+YY_RULE_SETUP
+{
+ BEGIN(INITIAL);
+ yylval->sval = new std::string(yytext);
+ return WFD_STRING;
+ }
+ YY_BREAK
+case 33:
+YY_RULE_SETUP
+{
+ return WFD_OPTIONS;
+ }
+ YY_BREAK
+case 34:
+YY_RULE_SETUP
+{
+ return WFD_SET_PARAMETER;
+ }
+ YY_BREAK
+case 35:
+YY_RULE_SETUP
+{
+ return WFD_GET_PARAMETER;
+ }
+ YY_BREAK
+case 36:
+YY_RULE_SETUP
+{
+ return WFD_SETUP;
+ }
+ YY_BREAK
+case 37:
+YY_RULE_SETUP
+{
+ return WFD_PLAY;
+ }
+ YY_BREAK
+case 38:
+YY_RULE_SETUP
+{
+ return WFD_TEARDOWN;
+ }
+ YY_BREAK
+case 39:
+YY_RULE_SETUP
+{
+ return WFD_PAUSE;
+ }
+ YY_BREAK
+case 40:
+YY_RULE_SETUP
+{
+ return WFD_TAG;
+ }
+ YY_BREAK
+case 41:
+YY_RULE_SETUP
+{
+ BEGIN(INITIAL);
+ yylval->sval = new std::string(yytext);
+ return WFD_MIME;
+ }
+ YY_BREAK
+case 42:
+YY_RULE_SETUP
+{
+ std::string str(yytext, yyleng);
+ str += '\0';
+ errno = 0;
+ yylval->nval = strtoull(str.c_str(), NULL, 10);
+ if (errno)
+ yyterminate();
+ return WFD_NUM;
+ }
+ YY_BREAK
+/* RTSP request rule, e.g., OPTIONS * RTSP/1.0 */
+case 43:
+YY_RULE_SETUP
+{
+ return WFD_END;
+ }
+ YY_BREAK
+/* GET_PARAMETER rtsp://localhost/wfd1.0 RTSP/1.0 */
+case 44:
+YY_RULE_SETUP
+{
+ yylval->sval = new std::string(yytext);
+ return WFD_REQUEST_URI;
+ }
+ YY_BREAK
+/* all unmatched */
+case 45:
+YY_RULE_SETUP
+{}
+ YY_BREAK
+case 46:
+YY_RULE_SETUP
+YY_FATAL_ERROR( "flex scanner jammed" );
+ YY_BREAK
+case YY_STATE_EOF(INITIAL):
+case YY_STATE_EOF(MATCH_STRING_STATE):
+case YY_STATE_EOF(MATCH_RESPONSE_CODE_STATE):
+case YY_STATE_EOF(SUPPORTED_METHODS_STATE):
+case YY_STATE_EOF(CONTENT_TYPE_STATE):
+case YY_STATE_EOF(SESSION_STATE):
+ yyterminate();
+
+ case YY_END_OF_BUFFER:
+ {
+ /* Amount of text matched not including the EOB char. */
+ int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1;
+
+ /* Undo the effects of YY_DO_BEFORE_ACTION. */
+ *yy_cp = yyg->yy_hold_char;
+ YY_RESTORE_YY_MORE_OFFSET
+
+ if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
+ {
+ /* We're scanning a new file or input source. It's
+ * possible that this happened because the user
+ * just pointed yyin at a new source and called
+ * header_lex(). If so, then we have to assure
+ * consistency between YY_CURRENT_BUFFER and our
+ * globals. Here is the right place to do so, because
+ * this is the first action (other than possibly a
+ * back-up) that will match for the new input source.
+ */
+ yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
+ YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
+ YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
+ }
+
+ /* Note that here we test for yy_c_buf_p "<=" to the position
+ * of the first EOB in the buffer, since yy_c_buf_p will
+ * already have been incremented past the NUL character
+ * (since all states make transitions on EOB to the
+ * end-of-buffer state). Contrast this with the test
+ * in input().
+ */
+ if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
+ { /* This was really a NUL. */
+ yy_state_type yy_next_state;
+
+ yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text;
+
+ yy_current_state = yy_get_previous_state( yyscanner );
+
+ /* Okay, we're now positioned to make the NUL
+ * transition. We couldn't have
+ * yy_get_previous_state() go ahead and do it
+ * for us because it doesn't know how to deal
+ * with the possibility of jamming (and we don't
+ * want to build jamming into it because then it
+ * will run more slowly).
+ */
+
+ yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner);
+
+ yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
+
+ if ( yy_next_state )
+ {
+ /* Consume the NUL. */
+ yy_cp = ++yyg->yy_c_buf_p;
+ yy_current_state = yy_next_state;
+ goto yy_match;
+ }
+
+ else
+ {
+ yy_cp = yyg->yy_last_accepting_cpos;
+ yy_current_state = yyg->yy_last_accepting_state;
+ goto yy_find_action;
+ }
+ }
+
+ else switch ( yy_get_next_buffer( yyscanner ) )
+ {
+ case EOB_ACT_END_OF_FILE:
+ {
+ yyg->yy_did_buffer_switch_on_eof = 0;
+
+ if ( header_wrap(yyscanner ) )
+ {
+ /* Note: because we've taken care in
+ * yy_get_next_buffer() to have set up
+ * yytext, we can now set up
+ * yy_c_buf_p so that if some total
+ * hoser (like flex itself) wants to
+ * call the scanner after we return the
+ * YY_NULL, it'll still work - another
+ * YY_NULL will get returned.
+ */
+ yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ;
+
+ yy_act = YY_STATE_EOF(YY_START);
+ goto do_action;
+ }
+
+ else
+ {
+ if ( ! yyg->yy_did_buffer_switch_on_eof )
+ YY_NEW_FILE;
+ }
+ break;
+ }
+
+ case EOB_ACT_CONTINUE_SCAN:
+ yyg->yy_c_buf_p =
+ yyg->yytext_ptr + yy_amount_of_matched_text;
+
+ yy_current_state = yy_get_previous_state( yyscanner );
+
+ yy_cp = yyg->yy_c_buf_p;
+ yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
+ goto yy_match;
+
+ case EOB_ACT_LAST_MATCH:
+ yyg->yy_c_buf_p =
+ &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars];
+
+ yy_current_state = yy_get_previous_state( yyscanner );
+
+ yy_cp = yyg->yy_c_buf_p;
+ yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
+ goto yy_find_action;
+ }
+ break;
+ }
+
+ default:
+ YY_FATAL_ERROR(
+ "fatal flex scanner internal error--no action found" );
+ } /* end of action switch */
+ } /* end of scanning one token */
+} /* end of header_lex */
+
+/* yy_get_next_buffer - try to read in a new buffer
+ *
+ * Returns a code representing an action:
+ * EOB_ACT_LAST_MATCH -
+ * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
+ * EOB_ACT_END_OF_FILE - end of file
+ */
+static int yy_get_next_buffer (yyscan_t yyscanner)
+{
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+ register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
+ register char *source = yyg->yytext_ptr;
+ register int number_to_move, i;
+ int ret_val;
+
+ if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] )
+ YY_FATAL_ERROR(
+ "fatal flex scanner internal error--end of buffer missed" );
+
+ if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
+ { /* Don't try to fill the buffer, so this is an EOF. */
+ if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 )
+ {
+ /* We matched a single character, the EOB, so
+ * treat this as a final EOF.
+ */
+ return EOB_ACT_END_OF_FILE;
+ }
+
+ else
+ {
+ /* We matched some text prior to the EOB, first
+ * process it.
+ */
+ return EOB_ACT_LAST_MATCH;
+ }
+ }
+
+ /* Try to read more data. */
+
+ /* First move last chars to start of buffer. */
+ number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr) - 1;
+
+ for ( i = 0; i < number_to_move; ++i )
+ *(dest++) = *(source++);
+
+ if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
+ /* don't do the read, it's not guaranteed to return an EOF,
+ * just force an EOF
+ */
+ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0;
+
+ else
+ {
+ int num_to_read =
+ YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
+
+ while ( num_to_read <= 0 )
+ { /* Not enough room in the buffer - grow it. */
+
+ /* just a shorter name for the current buffer */
+ YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
+
+ int yy_c_buf_p_offset =
+ (int) (yyg->yy_c_buf_p - b->yy_ch_buf);
+
+ if ( b->yy_is_our_buffer )
+ {
+ int new_size = b->yy_buf_size * 2;
+
+ if ( new_size <= 0 )
+ b->yy_buf_size += b->yy_buf_size / 8;
+ else
+ b->yy_buf_size *= 2;
+
+ b->yy_ch_buf = (char *)
+ /* Include room in for 2 EOB chars. */
+ header_realloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ,yyscanner );
+ }
+ else
+ /* Can't grow it, we don't own it. */
+ b->yy_ch_buf = 0;
+
+ if ( ! b->yy_ch_buf )
+ YY_FATAL_ERROR(
+ "fatal error - scanner input buffer overflow" );
+
+ yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
+
+ num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
+ number_to_move - 1;
+
+ }
+
+ if ( num_to_read > YY_READ_BUF_SIZE )
+ num_to_read = YY_READ_BUF_SIZE;
+
+ /* Read in more data. */
+ YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
+ yyg->yy_n_chars, (size_t) num_to_read );
+
+ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
+ }
+
+ if ( yyg->yy_n_chars == 0 )
+ {
+ if ( number_to_move == YY_MORE_ADJ )
+ {
+ ret_val = EOB_ACT_END_OF_FILE;
+ header_restart(yyin ,yyscanner);
+ }
+
+ else
+ {
+ ret_val = EOB_ACT_LAST_MATCH;
+ YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
+ YY_BUFFER_EOF_PENDING;
+ }
+ }
+
+ else
+ ret_val = EOB_ACT_CONTINUE_SCAN;
+
+ if ((yy_size_t) (yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
+ /* Extend the array by 50%, plus the number we really need. */
+ yy_size_t new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1);
+ YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) header_realloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ,yyscanner );
+ if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
+ YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
+ }
+
+ yyg->yy_n_chars += number_to_move;
+ YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR;
+ YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
+
+ yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
+
+ return ret_val;
+}
+
+/* yy_get_previous_state - get the state just before the EOB char was reached */
+
+ static yy_state_type yy_get_previous_state (yyscan_t yyscanner)
+{
+ register yy_state_type yy_current_state;
+ register char *yy_cp;
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+
+ yy_current_state = yyg->yy_start;
+ yy_current_state += YY_AT_BOL();
+
+ for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp )
+ {
+ register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
+ if ( yy_accept[yy_current_state] )
+ {
+ yyg->yy_last_accepting_state = yy_current_state;
+ yyg->yy_last_accepting_cpos = yy_cp;
+ }
+ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+ {
+ yy_current_state = (int) yy_def[yy_current_state];
+ if ( yy_current_state >= 646 )
+ yy_c = yy_meta[(unsigned int) yy_c];
+ }
+ yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+ }
+
+ return yy_current_state;
+}
+
+/* yy_try_NUL_trans - try to make a transition on the NUL character
+ *
+ * synopsis
+ * next_state = yy_try_NUL_trans( current_state );
+ */
+ static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner)
+{
+ register int yy_is_jam;
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */
+ register char *yy_cp = yyg->yy_c_buf_p;
+
+ register YY_CHAR yy_c = 1;
+ if ( yy_accept[yy_current_state] )
+ {
+ yyg->yy_last_accepting_state = yy_current_state;
+ yyg->yy_last_accepting_cpos = yy_cp;
+ }
+ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+ {
+ yy_current_state = (int) yy_def[yy_current_state];
+ if ( yy_current_state >= 646 )
+ yy_c = yy_meta[(unsigned int) yy_c];
+ }
+ yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+ yy_is_jam = (yy_current_state == 645);
+
+ return yy_is_jam ? 0 : yy_current_state;
+}
+
+#ifndef YY_NO_INPUT
+#ifdef __cplusplus
+ static int yyinput (yyscan_t yyscanner)
+#else
+ static int input (yyscan_t yyscanner)
+#endif
+
+{
+ int c;
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+
+ *yyg->yy_c_buf_p = yyg->yy_hold_char;
+
+ if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
+ {
+ /* yy_c_buf_p now points to the character we want to return.
+ * If this occurs *before* the EOB characters, then it's a
+ * valid NUL; if not, then we've hit the end of the buffer.
+ */
+ if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
+ /* This was really a NUL. */
+ *yyg->yy_c_buf_p = '\0';
+
+ else
+ { /* need more input */
+ int offset = yyg->yy_c_buf_p - yyg->yytext_ptr;
+ ++yyg->yy_c_buf_p;
+
+ switch ( yy_get_next_buffer( yyscanner ) )
+ {
+ case EOB_ACT_LAST_MATCH:
+ /* This happens because yy_g_n_b()
+ * sees that we've accumulated a
+ * token and flags that we need to
+ * try matching the token before
+ * proceeding. But for input(),
+ * there's no matching to consider.
+ * So convert the EOB_ACT_LAST_MATCH
+ * to EOB_ACT_END_OF_FILE.
+ */
+
+ /* Reset buffer status. */
+ header_restart(yyin ,yyscanner);
+
+ /*FALLTHROUGH*/
+
+ case EOB_ACT_END_OF_FILE:
+ {
+ if ( header_wrap(yyscanner ) )
+ return EOF;
+
+ if ( ! yyg->yy_did_buffer_switch_on_eof )
+ YY_NEW_FILE;
+#ifdef __cplusplus
+ return yyinput(yyscanner);
+#else
+ return input(yyscanner);
+#endif
+ }
+
+ case EOB_ACT_CONTINUE_SCAN:
+ yyg->yy_c_buf_p = yyg->yytext_ptr + offset;
+ break;
+ }
+ }
+ }
+
+ c = *(unsigned char *) yyg->yy_c_buf_p; /* cast for 8-bit char's */
+ *yyg->yy_c_buf_p = '\0'; /* preserve yytext */
+ yyg->yy_hold_char = *++yyg->yy_c_buf_p;
+
+ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n');
+
+ return c;
+}
+#endif /* ifndef YY_NO_INPUT */
+
+/** Immediately switch to a different input stream.
+ * @param input_file A readable stream.
+ * @param yyscanner The scanner object.
+ * @note This function does not reset the start condition to @c INITIAL .
+ */
+ void header_restart (FILE * input_file , yyscan_t yyscanner)
+{
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+
+ if ( ! YY_CURRENT_BUFFER ){
+ header_ensure_buffer_stack (yyscanner);
+ YY_CURRENT_BUFFER_LVALUE =
+ header__create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
+ }
+
+ header__init_buffer(YY_CURRENT_BUFFER,input_file ,yyscanner);
+ header__load_buffer_state(yyscanner );
+}
+
+/** Switch to a different input buffer.
+ * @param new_buffer The new input buffer.
+ * @param yyscanner The scanner object.
+ */
+ void header__switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
+{
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+
+ /* TODO. We should be able to replace this entire function body
+ * with
+ * header_pop_buffer_state();
+ * header_push_buffer_state(new_buffer);
+ */
+ header_ensure_buffer_stack (yyscanner);
+ if ( YY_CURRENT_BUFFER == new_buffer )
+ return;
+
+ if ( YY_CURRENT_BUFFER )
+ {
+ /* Flush out information for old buffer. */
+ *yyg->yy_c_buf_p = yyg->yy_hold_char;
+ YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
+ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
+ }
+
+ YY_CURRENT_BUFFER_LVALUE = new_buffer;
+ header__load_buffer_state(yyscanner );
+
+ /* We don't actually know whether we did this switch during
+ * EOF (header_wrap()) processing, but the only time this flag
+ * is looked at is after header_wrap() is called, so it's safe
+ * to go ahead and always set it.
+ */
+ yyg->yy_did_buffer_switch_on_eof = 1;
+}
+
+static void header__load_buffer_state (yyscan_t yyscanner)
+{
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+ yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
+ yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
+ yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
+ yyg->yy_hold_char = *yyg->yy_c_buf_p;
+}
+
+/** Allocate and initialize an input buffer state.
+ * @param file A readable stream.
+ * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
+ * @param yyscanner The scanner object.
+ * @return the allocated buffer state.
+ */
+ YY_BUFFER_STATE header__create_buffer (FILE * file, int size , yyscan_t yyscanner)
+{
+ YY_BUFFER_STATE b;
+
+ b = (YY_BUFFER_STATE) header_alloc(sizeof( struct yy_buffer_state ) ,yyscanner );
+ if ( ! b )
+ YY_FATAL_ERROR( "out of dynamic memory in header__create_buffer()" );
+
+ b->yy_buf_size = size;
+
+ /* yy_ch_buf has to be 2 characters longer than the size given because
+ * we need to put in 2 end-of-buffer characters.
+ */
+ b->yy_ch_buf = (char *) header_alloc(b->yy_buf_size + 2 ,yyscanner );
+ if ( ! b->yy_ch_buf )
+ YY_FATAL_ERROR( "out of dynamic memory in header__create_buffer()" );
+
+ b->yy_is_our_buffer = 1;
+
+ header__init_buffer(b,file ,yyscanner);
+
+ return b;
+}
+
+/** Destroy the buffer.
+ * @param b a buffer created with header__create_buffer()
+ * @param yyscanner The scanner object.
+ */
+ void header__delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
+{
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+
+ if ( ! b )
+ return;
+
+ if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
+ YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
+
+ if ( b->yy_is_our_buffer )
+ header_free((void *) b->yy_ch_buf ,yyscanner );
+
+ header_free((void *) b ,yyscanner );
+}
+
+/* Initializes or reinitializes a buffer.
+ * This function is sometimes called more than once on the same buffer,
+ * such as during a header_restart() or at EOF.
+ */
+ static void header__init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner)
+
+{
+ int oerrno = errno;
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+
+ header__flush_buffer(b ,yyscanner);
+
+ b->yy_input_file = file;
+ b->yy_fill_buffer = 1;
+
+ /* If b is the current buffer, then header__init_buffer was _probably_
+ * called from header_restart() or through yy_get_next_buffer.
+ * In that case, we don't want to reset the lineno or column.
+ */
+ if (b != YY_CURRENT_BUFFER){
+ b->yy_bs_lineno = 1;
+ b->yy_bs_column = 0;
+ }
+
+ b->yy_is_interactive = 0;
+
+ errno = oerrno;
+}
+
+/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
+ * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
+ * @param yyscanner The scanner object.
+ */
+ void header__flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
+{
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+ if ( ! b )
+ return;
+
+ b->yy_n_chars = 0;
+
+ /* We always need two end-of-buffer characters. The first causes
+ * a transition to the end-of-buffer state. The second causes
+ * a jam in that state.
+ */
+ b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
+ b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
+
+ b->yy_buf_pos = &b->yy_ch_buf[0];
+
+ b->yy_at_bol = 1;
+ b->yy_buffer_status = YY_BUFFER_NEW;
+
+ if ( b == YY_CURRENT_BUFFER )
+ header__load_buffer_state(yyscanner );
+}
+
+/** Pushes the new state onto the stack. The new state becomes
+ * the current state. This function will allocate the stack
+ * if necessary.
+ * @param new_buffer The new state.
+ * @param yyscanner The scanner object.
+ */
+void header_push_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
+{
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+ if (new_buffer == NULL)
+ return;
+
+ header_ensure_buffer_stack(yyscanner);
+
+ /* This block is copied from header__switch_to_buffer. */
+ if ( YY_CURRENT_BUFFER )
+ {
+ /* Flush out information for old buffer. */
+ *yyg->yy_c_buf_p = yyg->yy_hold_char;
+ YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
+ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
+ }
+
+ /* Only push if top exists. Otherwise, replace top. */
+ if (YY_CURRENT_BUFFER)
+ yyg->yy_buffer_stack_top++;
+ YY_CURRENT_BUFFER_LVALUE = new_buffer;
+
+ /* copied from header__switch_to_buffer. */
+ header__load_buffer_state(yyscanner );
+ yyg->yy_did_buffer_switch_on_eof = 1;
+}
+
+/** Removes and deletes the top of the stack, if present.
+ * The next element becomes the new top.
+ * @param yyscanner The scanner object.
+ */
+void header_pop_buffer_state (yyscan_t yyscanner)
+{
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+ if (!YY_CURRENT_BUFFER)
+ return;
+
+ header__delete_buffer(YY_CURRENT_BUFFER ,yyscanner);
+ YY_CURRENT_BUFFER_LVALUE = NULL;
+ if (yyg->yy_buffer_stack_top > 0)
+ --yyg->yy_buffer_stack_top;
+
+ if (YY_CURRENT_BUFFER) {
+ header__load_buffer_state(yyscanner );
+ yyg->yy_did_buffer_switch_on_eof = 1;
+ }
+}
+
+/* Allocates the stack if it does not exist.
+ * Guarantees space for at least one push.
+ */
+static void header_ensure_buffer_stack (yyscan_t yyscanner)
+{
+ int num_to_alloc;
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+
+ if (!yyg->yy_buffer_stack) {
+
+ /* First allocation is just for 2 elements, since we don't know if this
+ * scanner will even need a stack. We use 2 instead of 1 to avoid an
+ * immediate realloc on the next call.
+ */
+ num_to_alloc = 1;
+ yyg->yy_buffer_stack = (struct yy_buffer_state**)header_alloc
+ (num_to_alloc * sizeof(struct yy_buffer_state*)
+ , yyscanner);
+ if ( ! yyg->yy_buffer_stack )
+ YY_FATAL_ERROR( "out of dynamic memory in header_ensure_buffer_stack()" );
+
+ memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*));
+
+ yyg->yy_buffer_stack_max = num_to_alloc;
+ yyg->yy_buffer_stack_top = 0;
+ return;
+ }
+
+ if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){
+
+ /* Increase the buffer to prepare for a possible push. */
+ int grow_size = 8 /* arbitrary grow size */;
+
+ num_to_alloc = yyg->yy_buffer_stack_max + grow_size;
+ yyg->yy_buffer_stack = (struct yy_buffer_state**)header_realloc
+ (yyg->yy_buffer_stack,
+ num_to_alloc * sizeof(struct yy_buffer_state*)
+ , yyscanner);
+ if ( ! yyg->yy_buffer_stack )
+ YY_FATAL_ERROR( "out of dynamic memory in header_ensure_buffer_stack()" );
+
+ /* zero only the new slots.*/
+ memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*));
+ yyg->yy_buffer_stack_max = num_to_alloc;
+ }
+}
+
+/** Setup the input buffer state to scan directly from a user-specified character buffer.
+ * @param base the character buffer
+ * @param size the size in bytes of the character buffer
+ * @param yyscanner The scanner object.
+ * @return the newly allocated buffer state object.
+ */
+YY_BUFFER_STATE header__scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner)
+{
+ YY_BUFFER_STATE b;
+
+ if ( size < 2 ||
+ base[size-2] != YY_END_OF_BUFFER_CHAR ||
+ base[size-1] != YY_END_OF_BUFFER_CHAR )
+ /* They forgot to leave room for the EOB's. */
+ return 0;
+
+ b = (YY_BUFFER_STATE) header_alloc(sizeof( struct yy_buffer_state ) ,yyscanner );
+ if ( ! b )
+ YY_FATAL_ERROR( "out of dynamic memory in header__scan_buffer()" );
+
+ b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
+ b->yy_buf_pos = b->yy_ch_buf = base;
+ b->yy_is_our_buffer = 0;
+ b->yy_input_file = 0;
+ b->yy_n_chars = b->yy_buf_size;
+ b->yy_is_interactive = 0;
+ b->yy_at_bol = 1;
+ b->yy_fill_buffer = 0;
+ b->yy_buffer_status = YY_BUFFER_NEW;
+
+ header__switch_to_buffer(b ,yyscanner );
+
+ return b;
+}
+
+/** Setup the input buffer state to scan a string. The next call to header_lex() will
+ * scan from a @e copy of @a str.
+ * @param yystr a NUL-terminated string to scan
+ * @param yyscanner The scanner object.
+ * @return the newly allocated buffer state object.
+ * @note If you want to scan bytes that may contain NUL values, then use
+ * header__scan_bytes() instead.
+ */
+YY_BUFFER_STATE header__scan_string (yyconst char * yystr , yyscan_t yyscanner)
+{
+
+ return header__scan_bytes(yystr,strlen(yystr) ,yyscanner);
+}
+
+/** Setup the input buffer state to scan the given bytes. The next call to header_lex() will
+ * scan from a @e copy of @a bytes.
+ * @param yybytes the byte buffer to scan
+ * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
+ * @param yyscanner The scanner object.
+ * @return the newly allocated buffer state object.
+ */
+YY_BUFFER_STATE header__scan_bytes (yyconst char * yybytes, int _yybytes_len , yyscan_t yyscanner)
+{
+ YY_BUFFER_STATE b;
+ char *buf;
+ yy_size_t n;
+ int i;
+
+ /* Get memory for full buffer, including space for trailing EOB's. */
+ n = _yybytes_len + 2;
+ buf = (char *) header_alloc(n ,yyscanner );
+ if ( ! buf )
+ YY_FATAL_ERROR( "out of dynamic memory in header__scan_bytes()" );
+
+ for ( i = 0; i < _yybytes_len; ++i )
+ buf[i] = yybytes[i];
+
+ buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
+
+ b = header__scan_buffer(buf,n ,yyscanner);
+ if ( ! b )
+ YY_FATAL_ERROR( "bad buffer in header__scan_bytes()" );
+
+ /* It's okay to grow etc. this buffer, and we should throw it
+ * away when we're done.
+ */
+ b->yy_is_our_buffer = 1;
+
+ return b;
+}
+
+#ifndef YY_EXIT_FAILURE
+#define YY_EXIT_FAILURE 2
+#endif
+
+static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner)
+{
+ (void) fprintf( stderr, "%s\n", msg );
+ exit( YY_EXIT_FAILURE );
+}
+
+/* Redefine yyless() so it works in section 3 code. */
+
+#undef yyless
+#define yyless(n) \
+ do \
+ { \
+ /* Undo effects of setting up yytext. */ \
+ int yyless_macro_arg = (n); \
+ YY_LESS_LINENO(yyless_macro_arg);\
+ yytext[yyleng] = yyg->yy_hold_char; \
+ yyg->yy_c_buf_p = yytext + yyless_macro_arg; \
+ yyg->yy_hold_char = *yyg->yy_c_buf_p; \
+ *yyg->yy_c_buf_p = '\0'; \
+ yyleng = yyless_macro_arg; \
+ } \
+ while ( 0 )
+
+/* Accessor methods (get/set functions) to struct members. */
+
+/** Get the user-defined data for this scanner.
+ * @param yyscanner The scanner object.
+ */
+YY_EXTRA_TYPE header_get_extra (yyscan_t yyscanner)
+{
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+ return yyextra;
+}
+
+/** Get the current line number.
+ * @param yyscanner The scanner object.
+ */
+int header_get_lineno (yyscan_t yyscanner)
+{
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+
+ if (! YY_CURRENT_BUFFER)
+ return 0;
+
+ return yylineno;
+}
+
+/** Get the current column number.
+ * @param yyscanner The scanner object.
+ */
+int header_get_column (yyscan_t yyscanner)
+{
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+
+ if (! YY_CURRENT_BUFFER)
+ return 0;
+
+ return yycolumn;
+}
+
+/** Get the input stream.
+ * @param yyscanner The scanner object.
+ */
+FILE *header_get_in (yyscan_t yyscanner)
+{
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+ return yyin;
+}
+
+/** Get the output stream.
+ * @param yyscanner The scanner object.
+ */
+FILE *header_get_out (yyscan_t yyscanner)
+{
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+ return yyout;
+}
+
+/** Get the length of the current token.
+ * @param yyscanner The scanner object.
+ */
+int header_get_leng (yyscan_t yyscanner)
+{
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+ return yyleng;
+}
+
+/** Get the current token.
+ * @param yyscanner The scanner object.
+ */
+
+char *header_get_text (yyscan_t yyscanner)
+{
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+ return yytext;
+}
+
+/** Set the user-defined data. This data is never touched by the scanner.
+ * @param user_defined The data to be associated with this scanner.
+ * @param yyscanner The scanner object.
+ */
+void header_set_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner)
+{
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+ yyextra = user_defined ;
+}
+
+/** Set the current line number.
+ * @param line_number
+ * @param yyscanner The scanner object.
+ */
+void header_set_lineno (int line_number , yyscan_t yyscanner)
+{
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+
+ /* lineno is only valid if an input buffer exists. */
+ if (! YY_CURRENT_BUFFER )
+ yy_fatal_error( "header_set_lineno called with no buffer" , yyscanner);
+
+ yylineno = line_number;
+}
+
+/** Set the current column.
+ * @param line_number
+ * @param yyscanner The scanner object.
+ */
+void header_set_column (int column_no , yyscan_t yyscanner)
+{
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+
+ /* column is only valid if an input buffer exists. */
+ if (! YY_CURRENT_BUFFER )
+ yy_fatal_error( "header_set_column called with no buffer" , yyscanner);
+
+ yycolumn = column_no;
+}
+
+/** Set the input stream. This does not discard the current
+ * input buffer.
+ * @param in_str A readable stream.
+ * @param yyscanner The scanner object.
+ * @see header__switch_to_buffer
+ */
+void header_set_in (FILE * in_str , yyscan_t yyscanner)
+{
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+ yyin = in_str ;
+}
+
+void header_set_out (FILE * out_str , yyscan_t yyscanner)
+{
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+ yyout = out_str ;
+}
+
+int header_get_debug (yyscan_t yyscanner)
+{
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+ return yy_flex_debug;
+}
+
+void header_set_debug (int bdebug , yyscan_t yyscanner)
+{
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+ yy_flex_debug = bdebug ;
+}
+
+/* Accessor methods for yylval and yylloc */
+
+YYSTYPE * header_get_lval (yyscan_t yyscanner)
+{
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+ return yylval;
+}
+
+void header_set_lval (YYSTYPE * yylval_param , yyscan_t yyscanner)
+{
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+ yylval = yylval_param;
+}
+
+/* User-visible API */
+
+/* header_lex_init is special because it creates the scanner itself, so it is
+ * the ONLY reentrant function that doesn't take the scanner as the last argument.
+ * That's why we explicitly handle the declaration, instead of using our macros.
+ */
+
+int header_lex_init(yyscan_t* ptr_yy_globals)
+
+{
+ if (ptr_yy_globals == NULL){
+ errno = EINVAL;
+ return 1;
+ }
+
+ *ptr_yy_globals = (yyscan_t) header_alloc ( sizeof( struct yyguts_t ), NULL );
+
+ if (*ptr_yy_globals == NULL){
+ errno = ENOMEM;
+ return 1;
+ }
+
+ /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */
+ memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
+
+ return yy_init_globals ( *ptr_yy_globals );
+}
+
+/* header_lex_init_extra has the same functionality as header_lex_init, but follows the
+ * convention of taking the scanner as the last argument. Note however, that
+ * this is a *pointer* to a scanner, as it will be allocated by this call (and
+ * is the reason, too, why this function also must handle its own declaration).
+ * The user defined value in the first argument will be available to header_alloc in
+ * the yyextra field.
+ */
+
+int header_lex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t* ptr_yy_globals )
+
+{
+ struct yyguts_t dummy_yyguts;
+
+ header_set_extra (yy_user_defined, &dummy_yyguts);
+
+ if (ptr_yy_globals == NULL){
+ errno = EINVAL;
+ return 1;
+ }
+
+ *ptr_yy_globals = (yyscan_t) header_alloc ( sizeof( struct yyguts_t ), &dummy_yyguts );
+
+ if (*ptr_yy_globals == NULL){
+ errno = ENOMEM;
+ return 1;
+ }
+
+ /* By setting to 0xAA, we expose bugs in
+ yy_init_globals. Leave at 0x00 for releases. */
+ memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
+
+ header_set_extra (yy_user_defined, *ptr_yy_globals);
+
+ return yy_init_globals ( *ptr_yy_globals );
+}
+
+static int yy_init_globals (yyscan_t yyscanner)
+{
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+ /* Initialization is the same as for the non-reentrant scanner.
+ * This function is called from header_lex_destroy(), so don't allocate here.
+ */
+
+ yyg->yy_buffer_stack = 0;
+ yyg->yy_buffer_stack_top = 0;
+ yyg->yy_buffer_stack_max = 0;
+ yyg->yy_c_buf_p = (char *) 0;
+ yyg->yy_init = 0;
+ yyg->yy_start = 0;
+
+ yyg->yy_start_stack_ptr = 0;
+ yyg->yy_start_stack_depth = 0;
+ yyg->yy_start_stack = NULL;
+
+/* Defined in main.c */
+#ifdef YY_STDINIT
+ yyin = stdin;
+ yyout = stdout;
+#else
+ yyin = (FILE *) 0;
+ yyout = (FILE *) 0;
+#endif
+
+ /* For future reference: Set errno on error, since we are called by
+ * header_lex_init()
+ */
+ return 0;
+}
+
+/* header_lex_destroy is for both reentrant and non-reentrant scanners. */
+int header_lex_destroy (yyscan_t yyscanner)
+{
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+
+ /* Pop the buffer stack, destroying each element. */
+ while(YY_CURRENT_BUFFER){
+ header__delete_buffer(YY_CURRENT_BUFFER ,yyscanner );
+ YY_CURRENT_BUFFER_LVALUE = NULL;
+ header_pop_buffer_state(yyscanner);
+ }
+
+ /* Destroy the stack itself. */
+ header_free(yyg->yy_buffer_stack ,yyscanner);
+ yyg->yy_buffer_stack = NULL;
+
+ /* Destroy the start condition stack. */
+ header_free(yyg->yy_start_stack ,yyscanner );
+ yyg->yy_start_stack = NULL;
+
+ /* Reset the globals. This is important in a non-reentrant scanner so the next time
+ * header_lex() is called, initialization will occur. */
+ yy_init_globals( yyscanner);
+
+ /* Destroy the main struct (reentrant only). */
+ header_free ( yyscanner , yyscanner );
+ yyscanner = NULL;
+ return 0;
+}
+
+/*
+ * Internal utility routines.
+ */
+
+#ifndef yytext_ptr
+static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner)
+{
+ register int i;
+ for ( i = 0; i < n; ++i )
+ s1[i] = s2[i];
+}
+#endif
+
+#ifdef YY_NEED_STRLEN
+static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner)
+{
+ register int n;
+ for ( n = 0; s[n]; ++n )
+ ;
+
+ return n;
+}
+#endif
+
+void *header_alloc (yy_size_t size , yyscan_t yyscanner)
+{
+ return (void *) malloc( size );
+}
+
+void *header_realloc (void * ptr, yy_size_t size , yyscan_t yyscanner)
+{
+ /* The cast to (char *) in the following accommodates both
+ * implementations that use char* generic pointers, and those
+ * that use void* generic pointers. It works with the latter
+ * because both ANSI C and C++ allow castless assignment from
+ * any pointer type to void*, and deal with argument conversions
+ * as though doing an assignment.
+ */
+ return (void *) realloc( (char *) ptr, size );
+}
+
+void header_free (void * ptr , yyscan_t yyscanner)
+{
+ free( (char *) ptr ); /* see header_realloc() for (char *) cast */
+}
+
+#define YYTABLES_NAME "yytables"
+
diff --git a/chromium/third_party/wds/gen/headerscanner.h b/chromium/third_party/wds/gen/headerscanner.h
new file mode 100644
index 00000000000..f82aefbbf9e
--- /dev/null
+++ b/chromium/third_party/wds/gen/headerscanner.h
@@ -0,0 +1,381 @@
+#ifndef header_HEADER_H
+#define header_HEADER_H 1
+#define header_IN_HEADER 1
+
+#line 10 "headerlexer.l"
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2015 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+#include <stdint.h>
+
+#define YY_NO_UNISTD_H 1
+
+
+
+#line 34 "gen/headerscanner.h"
+
+#define YY_INT_ALIGNED short int
+
+/* A lexical scanner generated by flex */
+
+#define FLEX_SCANNER
+#define YY_FLEX_MAJOR_VERSION 2
+#define YY_FLEX_MINOR_VERSION 5
+#define YY_FLEX_SUBMINOR_VERSION 35
+#if YY_FLEX_SUBMINOR_VERSION > 0
+#define FLEX_BETA
+#endif
+
+/* First, we deal with platform-specific or compiler-specific issues. */
+
+/* begin standard C headers. */
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+#include <stdlib.h>
+
+/* end standard C headers. */
+
+/* flex integer type definitions */
+
+#ifndef FLEXINT_H
+#define FLEXINT_H
+
+/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
+
+#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+
+/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
+ * if you want the limit (max/min) macros for int types.
+ */
+#ifndef __STDC_LIMIT_MACROS
+#define __STDC_LIMIT_MACROS 1
+#endif
+
+#include <inttypes.h>
+typedef int8_t flex_int8_t;
+typedef uint8_t flex_uint8_t;
+typedef int16_t flex_int16_t;
+typedef uint16_t flex_uint16_t;
+typedef int32_t flex_int32_t;
+typedef uint32_t flex_uint32_t;
+#else
+typedef signed char flex_int8_t;
+typedef short int flex_int16_t;
+typedef int flex_int32_t;
+typedef unsigned char flex_uint8_t;
+typedef unsigned short int flex_uint16_t;
+typedef unsigned int flex_uint32_t;
+
+/* Limits of integral types. */
+#ifndef INT8_MIN
+#define INT8_MIN (-128)
+#endif
+#ifndef INT16_MIN
+#define INT16_MIN (-32767-1)
+#endif
+#ifndef INT32_MIN
+#define INT32_MIN (-2147483647-1)
+#endif
+#ifndef INT8_MAX
+#define INT8_MAX (127)
+#endif
+#ifndef INT16_MAX
+#define INT16_MAX (32767)
+#endif
+#ifndef INT32_MAX
+#define INT32_MAX (2147483647)
+#endif
+#ifndef UINT8_MAX
+#define UINT8_MAX (255U)
+#endif
+#ifndef UINT16_MAX
+#define UINT16_MAX (65535U)
+#endif
+#ifndef UINT32_MAX
+#define UINT32_MAX (4294967295U)
+#endif
+
+#endif /* ! C99 */
+
+#endif /* ! FLEXINT_H */
+
+#ifdef __cplusplus
+
+/* The "const" storage-class-modifier is valid. */
+#define YY_USE_CONST
+
+#else /* ! __cplusplus */
+
+/* C99 requires __STDC__ to be defined as 1. */
+#if defined (__STDC__)
+
+#define YY_USE_CONST
+
+#endif /* defined (__STDC__) */
+#endif /* ! __cplusplus */
+
+#ifdef YY_USE_CONST
+#define yyconst const
+#else
+#define yyconst
+#endif
+
+/* An opaque pointer. */
+#ifndef YY_TYPEDEF_YY_SCANNER_T
+#define YY_TYPEDEF_YY_SCANNER_T
+typedef void* yyscan_t;
+#endif
+
+/* For convenience, these vars (plus the bison vars far below)
+ are macros in the reentrant scanner. */
+#define yyin yyg->yyin_r
+#define yyout yyg->yyout_r
+#define yyextra yyg->yyextra_r
+#define yyleng yyg->yyleng_r
+#define yytext yyg->yytext_r
+#define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno)
+#define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column)
+#define yy_flex_debug yyg->yy_flex_debug_r
+
+/* Size of default input buffer. */
+#ifndef YY_BUF_SIZE
+#ifdef __ia64__
+/* On IA-64, the buffer size is 16k, not 8k.
+ * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
+ * Ditto for the __ia64__ case accordingly.
+ */
+#define YY_BUF_SIZE 32768
+#else
+#define YY_BUF_SIZE 16384
+#endif /* __ia64__ */
+#endif
+
+#ifndef YY_TYPEDEF_YY_BUFFER_STATE
+#define YY_TYPEDEF_YY_BUFFER_STATE
+typedef struct yy_buffer_state *YY_BUFFER_STATE;
+#endif
+
+#ifndef YY_TYPEDEF_YY_SIZE_T
+#define YY_TYPEDEF_YY_SIZE_T
+typedef size_t yy_size_t;
+#endif
+
+#ifndef YY_STRUCT_YY_BUFFER_STATE
+#define YY_STRUCT_YY_BUFFER_STATE
+struct yy_buffer_state
+ {
+ FILE *yy_input_file;
+
+ char *yy_ch_buf; /* input buffer */
+ char *yy_buf_pos; /* current position in input buffer */
+
+ /* Size of input buffer in bytes, not including room for EOB
+ * characters.
+ */
+ yy_size_t yy_buf_size;
+
+ /* Number of characters read into yy_ch_buf, not including EOB
+ * characters.
+ */
+ int yy_n_chars;
+
+ /* Whether we "own" the buffer - i.e., we know we created it,
+ * and can realloc() it to grow it, and should free() it to
+ * delete it.
+ */
+ int yy_is_our_buffer;
+
+ /* Whether this is an "interactive" input source; if so, and
+ * if we're using stdio for input, then we want to use getc()
+ * instead of fread(), to make sure we stop fetching input after
+ * each newline.
+ */
+ int yy_is_interactive;
+
+ /* Whether we're considered to be at the beginning of a line.
+ * If so, '^' rules will be active on the next match, otherwise
+ * not.
+ */
+ int yy_at_bol;
+
+ int yy_bs_lineno; /**< The line count. */
+ int yy_bs_column; /**< The column count. */
+
+ /* Whether to try to fill the input buffer when we reach the
+ * end of it.
+ */
+ int yy_fill_buffer;
+
+ int yy_buffer_status;
+
+ };
+#endif /* !YY_STRUCT_YY_BUFFER_STATE */
+
+void header_restart (FILE *input_file ,yyscan_t yyscanner );
+void header__switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
+YY_BUFFER_STATE header__create_buffer (FILE *file,int size ,yyscan_t yyscanner );
+void header__delete_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
+void header__flush_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
+void header_push_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
+void header_pop_buffer_state (yyscan_t yyscanner );
+
+YY_BUFFER_STATE header__scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner );
+YY_BUFFER_STATE header__scan_string (yyconst char *yy_str ,yyscan_t yyscanner );
+YY_BUFFER_STATE header__scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner );
+
+void *header_alloc (yy_size_t ,yyscan_t yyscanner );
+void *header_realloc (void *,yy_size_t ,yyscan_t yyscanner );
+void header_free (void * ,yyscan_t yyscanner );
+
+/* Begin user sect3 */
+
+#define header_wrap(n) 1
+#define YY_SKIP_YYWRAP
+
+#define yytext_ptr yytext_r
+
+#ifdef YY_HEADER_EXPORT_START_CONDITIONS
+#define INITIAL 0
+#define MATCH_STRING_STATE 1
+#define MATCH_RESPONSE_CODE_STATE 2
+#define SUPPORTED_METHODS_STATE 3
+#define CONTENT_TYPE_STATE 4
+#define SESSION_STATE 5
+
+#endif
+
+#ifndef YY_NO_UNISTD_H
+/* Special case for "unistd.h", since it is non-ANSI. We include it way
+ * down here because we want the user's section 1 to have been scanned first.
+ * The user has a chance to override it with an option.
+ */
+#include <unistd.h>
+#endif
+
+#define YY_EXTRA_TYPE bool
+
+int header_lex_init (yyscan_t* scanner);
+
+int header_lex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner);
+
+/* Accessor methods to globals.
+ These are made visible to non-reentrant scanners for convenience. */
+
+int header_lex_destroy (yyscan_t yyscanner );
+
+int header_get_debug (yyscan_t yyscanner );
+
+void header_set_debug (int debug_flag ,yyscan_t yyscanner );
+
+YY_EXTRA_TYPE header_get_extra (yyscan_t yyscanner );
+
+void header_set_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner );
+
+FILE *header_get_in (yyscan_t yyscanner );
+
+void header_set_in (FILE * in_str ,yyscan_t yyscanner );
+
+FILE *header_get_out (yyscan_t yyscanner );
+
+void header_set_out (FILE * out_str ,yyscan_t yyscanner );
+
+int header_get_leng (yyscan_t yyscanner );
+
+char *header_get_text (yyscan_t yyscanner );
+
+int header_get_lineno (yyscan_t yyscanner );
+
+void header_set_lineno (int line_number ,yyscan_t yyscanner );
+
+YYSTYPE * header_get_lval (yyscan_t yyscanner );
+
+void header_set_lval (YYSTYPE * yylval_param ,yyscan_t yyscanner );
+
+/* Macros after this point can all be overridden by user definitions in
+ * section 1.
+ */
+
+#ifndef YY_SKIP_YYWRAP
+#ifdef __cplusplus
+extern "C" int header_wrap (yyscan_t yyscanner );
+#else
+extern int header_wrap (yyscan_t yyscanner );
+#endif
+#endif
+
+#ifndef yytext_ptr
+static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner);
+#endif
+
+#ifdef YY_NEED_STRLEN
+static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner);
+#endif
+
+#ifndef YY_NO_INPUT
+
+#endif
+
+/* Amount of stuff to slurp up with each read. */
+#ifndef YY_READ_BUF_SIZE
+#ifdef __ia64__
+/* On IA-64, the buffer size is 16k, not 8k */
+#define YY_READ_BUF_SIZE 16384
+#else
+#define YY_READ_BUF_SIZE 8192
+#endif /* __ia64__ */
+#endif
+
+/* Number of entries by which start-condition stack grows. */
+#ifndef YY_START_STACK_INCR
+#define YY_START_STACK_INCR 25
+#endif
+
+/* Default declaration of generated scanner - a define so the user can
+ * easily add parameters.
+ */
+#ifndef YY_DECL
+#define YY_DECL_IS_OURS 1
+
+extern int header_lex \
+ (YYSTYPE * yylval_param ,yyscan_t yyscanner);
+
+#define YY_DECL int header_lex \
+ (YYSTYPE * yylval_param , yyscan_t yyscanner)
+#endif /* !YY_DECL */
+
+/* yy_get_previous_state - get the state just before the EOB char was reached */
+
+#undef YY_NEW_FILE
+#undef YY_FLUSH_BUFFER
+#undef yy_set_bol
+#undef yy_new_buffer
+#undef yy_set_interactive
+#undef YY_DO_BEFORE_ACTION
+
+#ifdef YY_DECL_IS_OURS
+#undef YY_DECL_IS_OURS
+#undef YY_DECL
+#endif
+
+#line 380 "gen/headerscanner.h"
+#undef header_IN_HEADER
+#endif /* header_HEADER_H */
diff --git a/chromium/third_party/wds/gen/messagescanner.cpp b/chromium/third_party/wds/gen/messagescanner.cpp
new file mode 100644
index 00000000000..45b09fb3e7d
--- /dev/null
+++ b/chromium/third_party/wds/gen/messagescanner.cpp
@@ -0,0 +1,3725 @@
+#line 10 "messagelexer.l"
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2015 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+#include <stdint.h>
+
+#define YY_NO_UNISTD_H 1
+
+
+
+#line 30 "gen/messagescanner.cpp"
+
+#define YY_INT_ALIGNED short int
+
+/* A lexical scanner generated by flex */
+
+#define FLEX_SCANNER
+#define YY_FLEX_MAJOR_VERSION 2
+#define YY_FLEX_MINOR_VERSION 5
+#define YY_FLEX_SUBMINOR_VERSION 35
+#if YY_FLEX_SUBMINOR_VERSION > 0
+#define FLEX_BETA
+#endif
+
+/* First, we deal with platform-specific or compiler-specific issues. */
+
+/* begin standard C headers. */
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+#include <stdlib.h>
+
+/* end standard C headers. */
+
+/* flex integer type definitions */
+
+#ifndef FLEXINT_H
+#define FLEXINT_H
+
+/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
+
+#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+
+/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
+ * if you want the limit (max/min) macros for int types.
+ */
+#ifndef __STDC_LIMIT_MACROS
+#define __STDC_LIMIT_MACROS 1
+#endif
+
+#include <inttypes.h>
+typedef int8_t flex_int8_t;
+typedef uint8_t flex_uint8_t;
+typedef int16_t flex_int16_t;
+typedef uint16_t flex_uint16_t;
+typedef int32_t flex_int32_t;
+typedef uint32_t flex_uint32_t;
+#else
+typedef signed char flex_int8_t;
+typedef short int flex_int16_t;
+typedef int flex_int32_t;
+typedef unsigned char flex_uint8_t;
+typedef unsigned short int flex_uint16_t;
+typedef unsigned int flex_uint32_t;
+
+/* Limits of integral types. */
+#ifndef INT8_MIN
+#define INT8_MIN (-128)
+#endif
+#ifndef INT16_MIN
+#define INT16_MIN (-32767-1)
+#endif
+#ifndef INT32_MIN
+#define INT32_MIN (-2147483647-1)
+#endif
+#ifndef INT8_MAX
+#define INT8_MAX (127)
+#endif
+#ifndef INT16_MAX
+#define INT16_MAX (32767)
+#endif
+#ifndef INT32_MAX
+#define INT32_MAX (2147483647)
+#endif
+#ifndef UINT8_MAX
+#define UINT8_MAX (255U)
+#endif
+#ifndef UINT16_MAX
+#define UINT16_MAX (65535U)
+#endif
+#ifndef UINT32_MAX
+#define UINT32_MAX (4294967295U)
+#endif
+
+#endif /* ! C99 */
+
+#endif /* ! FLEXINT_H */
+
+#ifdef __cplusplus
+
+/* The "const" storage-class-modifier is valid. */
+#define YY_USE_CONST
+
+#else /* ! __cplusplus */
+
+/* C99 requires __STDC__ to be defined as 1. */
+#if defined (__STDC__)
+
+#define YY_USE_CONST
+
+#endif /* defined (__STDC__) */
+#endif /* ! __cplusplus */
+
+#ifdef YY_USE_CONST
+#define yyconst const
+#else
+#define yyconst
+#endif
+
+/* Returned upon end-of-file. */
+#define YY_NULL 0
+
+/* Promotes a possibly negative, possibly signed char to an unsigned
+ * integer for use as an array index. If the signed char is negative,
+ * we want to instead treat it as an 8-bit unsigned char, hence the
+ * double cast.
+ */
+#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
+
+/* An opaque pointer. */
+#ifndef YY_TYPEDEF_YY_SCANNER_T
+#define YY_TYPEDEF_YY_SCANNER_T
+typedef void* yyscan_t;
+#endif
+
+/* For convenience, these vars (plus the bison vars far below)
+ are macros in the reentrant scanner. */
+#define yyin yyg->yyin_r
+#define yyout yyg->yyout_r
+#define yyextra yyg->yyextra_r
+#define yyleng yyg->yyleng_r
+#define yytext yyg->yytext_r
+#define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno)
+#define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column)
+#define yy_flex_debug yyg->yy_flex_debug_r
+
+/* Enter a start condition. This macro really ought to take a parameter,
+ * but we do it the disgusting crufty way forced on us by the ()-less
+ * definition of BEGIN.
+ */
+#define BEGIN yyg->yy_start = 1 + 2 *
+
+/* Translate the current start state into a value that can be later handed
+ * to BEGIN to return to the state. The YYSTATE alias is for lex
+ * compatibility.
+ */
+#define YY_START ((yyg->yy_start - 1) / 2)
+#define YYSTATE YY_START
+
+/* Action number for EOF rule of a given start state. */
+#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
+
+/* Special action meaning "start processing a new file". */
+#define YY_NEW_FILE message_restart(yyin ,yyscanner )
+
+#define YY_END_OF_BUFFER_CHAR 0
+
+/* Size of default input buffer. */
+#ifndef YY_BUF_SIZE
+#ifdef __ia64__
+/* On IA-64, the buffer size is 16k, not 8k.
+ * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
+ * Ditto for the __ia64__ case accordingly.
+ */
+#define YY_BUF_SIZE 32768
+#else
+#define YY_BUF_SIZE 16384
+#endif /* __ia64__ */
+#endif
+
+/* The state buf must be large enough to hold one state per character in the main buffer.
+ */
+#define YY_STATE_BUF_SIZE ((YY_BUF_SIZE + 2) * sizeof(yy_state_type))
+
+#ifndef YY_TYPEDEF_YY_BUFFER_STATE
+#define YY_TYPEDEF_YY_BUFFER_STATE
+typedef struct yy_buffer_state *YY_BUFFER_STATE;
+#endif
+
+#define EOB_ACT_CONTINUE_SCAN 0
+#define EOB_ACT_END_OF_FILE 1
+#define EOB_ACT_LAST_MATCH 2
+
+ #define YY_LESS_LINENO(n)
+
+/* Return all but the first "n" matched characters back to the input stream. */
+#define yyless(n) \
+ do \
+ { \
+ /* Undo effects of setting up yytext. */ \
+ int yyless_macro_arg = (n); \
+ YY_LESS_LINENO(yyless_macro_arg);\
+ *yy_cp = yyg->yy_hold_char; \
+ YY_RESTORE_YY_MORE_OFFSET \
+ yyg->yy_c_buf_p = yy_cp = yy_bp + yyless_macro_arg - YY_MORE_ADJ; \
+ YY_DO_BEFORE_ACTION; /* set up yytext again */ \
+ } \
+ while ( 0 )
+
+#define unput(c) yyunput( c, yyg->yytext_ptr , yyscanner )
+
+#ifndef YY_TYPEDEF_YY_SIZE_T
+#define YY_TYPEDEF_YY_SIZE_T
+typedef size_t yy_size_t;
+#endif
+
+#ifndef YY_STRUCT_YY_BUFFER_STATE
+#define YY_STRUCT_YY_BUFFER_STATE
+struct yy_buffer_state
+ {
+ FILE *yy_input_file;
+
+ char *yy_ch_buf; /* input buffer */
+ char *yy_buf_pos; /* current position in input buffer */
+
+ /* Size of input buffer in bytes, not including room for EOB
+ * characters.
+ */
+ yy_size_t yy_buf_size;
+
+ /* Number of characters read into yy_ch_buf, not including EOB
+ * characters.
+ */
+ int yy_n_chars;
+
+ /* Whether we "own" the buffer - i.e., we know we created it,
+ * and can realloc() it to grow it, and should free() it to
+ * delete it.
+ */
+ int yy_is_our_buffer;
+
+ /* Whether this is an "interactive" input source; if so, and
+ * if we're using stdio for input, then we want to use getc()
+ * instead of fread(), to make sure we stop fetching input after
+ * each newline.
+ */
+ int yy_is_interactive;
+
+ /* Whether we're considered to be at the beginning of a line.
+ * If so, '^' rules will be active on the next match, otherwise
+ * not.
+ */
+ int yy_at_bol;
+
+ int yy_bs_lineno; /**< The line count. */
+ int yy_bs_column; /**< The column count. */
+
+ /* Whether to try to fill the input buffer when we reach the
+ * end of it.
+ */
+ int yy_fill_buffer;
+
+ int yy_buffer_status;
+
+#define YY_BUFFER_NEW 0
+#define YY_BUFFER_NORMAL 1
+ /* When an EOF's been seen but there's still some text to process
+ * then we mark the buffer as YY_EOF_PENDING, to indicate that we
+ * shouldn't try reading from the input source any more. We might
+ * still have a bunch of tokens to match, though, because of
+ * possible backing-up.
+ *
+ * When we actually see the EOF, we change the status to "new"
+ * (via message_restart()), so that the user can continue scanning by
+ * just pointing yyin at a new input file.
+ */
+#define YY_BUFFER_EOF_PENDING 2
+
+ };
+#endif /* !YY_STRUCT_YY_BUFFER_STATE */
+
+/* We provide macros for accessing buffer states in case in the
+ * future we want to put the buffer states in a more general
+ * "scanner state".
+ *
+ * Returns the top of the stack, or NULL.
+ */
+#define YY_CURRENT_BUFFER ( yyg->yy_buffer_stack \
+ ? yyg->yy_buffer_stack[yyg->yy_buffer_stack_top] \
+ : NULL)
+
+/* Same as previous macro, but useful when we know that the buffer stack is not
+ * NULL or when we need an lvalue. For internal use only.
+ */
+#define YY_CURRENT_BUFFER_LVALUE yyg->yy_buffer_stack[yyg->yy_buffer_stack_top]
+
+void message_restart (FILE *input_file ,yyscan_t yyscanner );
+void message__switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
+YY_BUFFER_STATE message__create_buffer (FILE *file,int size ,yyscan_t yyscanner );
+void message__delete_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
+void message__flush_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
+void message_push_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
+void message_pop_buffer_state (yyscan_t yyscanner );
+
+static void message_ensure_buffer_stack (yyscan_t yyscanner );
+static void message__load_buffer_state (yyscan_t yyscanner );
+static void message__init_buffer (YY_BUFFER_STATE b,FILE *file ,yyscan_t yyscanner );
+
+#define YY_FLUSH_BUFFER message__flush_buffer(YY_CURRENT_BUFFER ,yyscanner)
+
+YY_BUFFER_STATE message__scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner );
+YY_BUFFER_STATE message__scan_string (yyconst char *yy_str ,yyscan_t yyscanner );
+YY_BUFFER_STATE message__scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner );
+
+void *message_alloc (yy_size_t ,yyscan_t yyscanner );
+void *message_realloc (void *,yy_size_t ,yyscan_t yyscanner );
+void message_free (void * ,yyscan_t yyscanner );
+
+#define yy_new_buffer message__create_buffer
+
+#define yy_set_interactive(is_interactive) \
+ { \
+ if ( ! YY_CURRENT_BUFFER ){ \
+ message_ensure_buffer_stack (yyscanner); \
+ YY_CURRENT_BUFFER_LVALUE = \
+ message__create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
+ } \
+ YY_CURRENT_BUFFER_LVALUE->yy_is_interactive = is_interactive; \
+ }
+
+#define yy_set_bol(at_bol) \
+ { \
+ if ( ! YY_CURRENT_BUFFER ){\
+ message_ensure_buffer_stack (yyscanner); \
+ YY_CURRENT_BUFFER_LVALUE = \
+ message__create_buffer(yyin,YY_BUF_SIZE ,yyscanner); \
+ } \
+ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = at_bol; \
+ }
+
+#define YY_AT_BOL() (YY_CURRENT_BUFFER_LVALUE->yy_at_bol)
+
+/* Begin user sect3 */
+
+#define message_wrap(n) 1
+#define YY_SKIP_YYWRAP
+
+typedef unsigned char YY_CHAR;
+
+typedef int yy_state_type;
+
+#define yytext_ptr yytext_r
+
+static yy_state_type yy_get_previous_state (yyscan_t yyscanner );
+static yy_state_type yy_try_NUL_trans (yy_state_type current_state ,yyscan_t yyscanner);
+static int yy_get_next_buffer (yyscan_t yyscanner );
+static void yy_fatal_error (yyconst char msg[] ,yyscan_t yyscanner );
+
+/* Done after the current pattern has been matched and before the
+ * corresponding action - sets up yytext.
+ */
+#define YY_DO_BEFORE_ACTION \
+ yyg->yytext_ptr = yy_bp; \
+ yyleng = (size_t) (yy_cp - yy_bp); \
+ yyg->yy_hold_char = *yy_cp; \
+ *yy_cp = '\0'; \
+ yyg->yy_c_buf_p = yy_cp;
+
+#define YY_NUM_RULES 82
+#define YY_END_OF_BUFFER 83
+/* This struct is not used in this scanner,
+ but its presence is necessary. */
+struct yy_trans_info
+ {
+ flex_int32_t yy_verify;
+ flex_int32_t yy_nxt;
+ };
+static yyconst flex_int16_t yy_accept[1147] =
+ { 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 83, 81,
+ 11, 2, 3, 7, 6, 5, 10, 69, 9, 8,
+ 4, 81, 81, 81, 81, 81, 81, 81, 81, 81,
+ 81, 81, 81, 81, 81, 81, 81, 81, 81, 81,
+ 68, 68, 68, 68, 68, 68, 68, 68, 68, 68,
+ 68, 68, 68, 68, 68, 68, 68, 68, 68, 68,
+ 81, 81, 81, 81, 81, 81, 68, 68, 68, 68,
+ 68, 81, 68, 45, 46, 46, 46, 46, 46, 46,
+ 46, 46, 46, 46, 46, 46, 47, 48, 48, 48,
+
+ 48, 48, 48, 48, 48, 48, 48, 48, 48, 11,
+ 1, 69, 0, 0, 38, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 68, 68,
+ 68, 38, 68, 68, 68, 68, 68, 68, 68, 68,
+ 68, 68, 68, 68, 68, 68, 68, 68, 68, 68,
+ 68, 68, 68, 68, 68, 68, 0, 0, 0, 0,
+ 0, 0, 0, 0, 68, 68, 68, 68, 68, 68,
+ 68, 0, 68, 45, 46, 46, 46, 46, 46, 46,
+ 46, 46, 47, 48, 48, 48, 48, 48, 48, 48,
+
+ 48, 14, 15, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 37, 0, 0,
+ 14, 15, 68, 68, 68, 68, 68, 68, 68, 68,
+ 68, 68, 68, 68, 68, 68, 68, 68, 68, 68,
+ 68, 68, 68, 68, 68, 68, 37, 68, 68, 68,
+ 0, 0, 0, 0, 0, 0, 0, 0, 68, 68,
+ 68, 68, 68, 68, 68, 0, 68, 14, 15, 14,
+ 15, 14, 15, 14, 15, 0, 0, 0, 0, 0,
+ 0, 25, 0, 0, 0, 0, 13, 0, 0, 0,
+
+ 0, 12, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 68, 68, 68, 68, 68, 68, 25, 68, 68,
+ 68, 68, 13, 68, 68, 68, 68, 12, 68, 68,
+ 68, 68, 68, 68, 68, 68, 68, 70, 0, 0,
+ 0, 0, 75, 0, 0, 0, 68, 68, 68, 68,
+ 68, 68, 68, 0, 68, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 28, 0, 41,
+ 18, 0, 0, 0, 0, 0, 0, 39, 0, 68,
+ 68, 68, 68, 68, 68, 68, 68, 68, 68, 68,
+ 28, 68, 41, 68, 68, 68, 68, 68, 68, 68,
+
+ 68, 68, 68, 68, 68, 68, 68, 68, 68, 39,
+ 68, 0, 0, 0, 77, 74, 0, 0, 68, 68,
+ 68, 68, 68, 68, 0, 32, 0, 43, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 40, 32, 68, 43, 68, 68,
+ 68, 68, 68, 68, 68, 68, 68, 68, 68, 68,
+ 68, 68, 68, 68, 68, 68, 68, 68, 68, 68,
+ 68, 68, 68, 68, 68, 40, 0, 0, 0, 0,
+ 0, 68, 68, 68, 68, 0, 42, 24, 33, 16,
+ 17, 0, 0, 0, 0, 0, 0, 0, 21, 0,
+
+ 0, 0, 0, 0, 42, 24, 33, 68, 68, 68,
+ 68, 68, 68, 21, 68, 68, 68, 68, 68, 68,
+ 68, 68, 68, 68, 68, 59, 68, 68, 68, 68,
+ 68, 68, 68, 0, 71, 0, 0, 0, 68, 68,
+ 68, 68, 0, 0, 0, 36, 0, 31, 27, 0,
+ 0, 0, 0, 0, 0, 0, 68, 68, 36, 68,
+ 31, 27, 68, 68, 68, 68, 68, 68, 68, 68,
+ 68, 68, 68, 68, 68, 68, 68, 68, 68, 68,
+ 68, 68, 68, 0, 0, 0, 76, 68, 68, 68,
+ 0, 0, 0, 0, 20, 0, 0, 0, 22, 0,
+
+ 44, 68, 68, 68, 68, 68, 22, 68, 44, 68,
+ 68, 68, 68, 68, 68, 68, 68, 68, 68, 68,
+ 58, 68, 68, 68, 68, 0, 0, 0, 68, 68,
+ 0, 0, 0, 0, 0, 0, 0, 30, 0, 0,
+ 0, 68, 68, 68, 30, 68, 68, 68, 68, 68,
+ 68, 68, 68, 68, 68, 68, 68, 68, 68, 68,
+ 68, 68, 68, 0, 0, 0, 68, 68, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 29, 68, 68,
+ 68, 68, 29, 68, 68, 68, 68, 68, 68, 68,
+
+ 68, 68, 68, 68, 65, 68, 68, 68, 68, 0,
+ 0, 0, 68, 68, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 68, 68, 68, 68,
+ 68, 68, 68, 68, 68, 68, 68, 68, 68, 68,
+ 68, 68, 68, 68, 68, 68, 0, 0, 0, 68,
+ 68, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 34, 0,
+ 68, 68, 68, 34, 68, 68, 68, 68, 68, 68,
+ 68, 68, 68, 68, 68, 68, 68, 68, 68, 68,
+
+ 73, 0, 72, 68, 68, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 35, 0, 0, 68, 68, 68, 68,
+ 68, 68, 68, 68, 68, 68, 68, 68, 68, 68,
+ 68, 68, 68, 68, 78, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 68, 68, 68, 68, 68, 68, 68, 68,
+ 68, 68, 67, 68, 68, 68, 68, 68, 68, 68,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+
+ 68, 68, 68, 49, 68, 68, 68, 68, 54, 53,
+ 68, 68, 68, 68, 68, 63, 68, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 26, 0, 0, 68, 68, 68, 68, 68,
+ 68, 68, 68, 68, 68, 68, 50, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 68, 68, 68,
+ 68, 66, 68, 68, 68, 68, 55, 68, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 19, 68, 68,
+
+ 68, 68, 68, 68, 68, 68, 62, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 23, 51,
+ 68, 57, 68, 68, 56, 68, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 68, 68, 68,
+ 68, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 68, 52, 68, 68, 0, 68, 68, 68,
+ 0, 68, 68, 68, 0, 68, 68, 68, 0, 68,
+ 61, 68, 0, 60, 68, 0, 68, 0, 64, 0,
+ 0, 0, 0, 79, 80, 0
+ } ;
+
+static yyconst flex_int32_t yy_ec[256] =
+ { 0,
+ 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
+ 1, 1, 4, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 5, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 6, 1, 7, 8, 9, 10, 11, 12, 13,
+ 14, 15, 16, 17, 17, 17, 17, 18, 19, 1,
+ 20, 1, 1, 1, 21, 22, 23, 24, 25, 26,
+ 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
+ 37, 38, 39, 40, 41, 42, 43, 44, 45, 46,
+ 1, 1, 1, 1, 47, 1, 48, 49, 50, 51,
+
+ 52, 53, 54, 55, 56, 57, 58, 59, 60, 61,
+ 62, 63, 64, 65, 66, 67, 68, 69, 70, 44,
+ 71, 72, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1
+ } ;
+
+static yyconst flex_int32_t yy_meta[73] =
+ { 0,
+ 1, 2, 3, 4, 2, 1, 1, 5, 1, 1,
+ 6, 6, 6, 6, 6, 6, 6, 1, 1, 1,
+ 6, 6, 6, 6, 6, 6, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 5, 5, 6, 6, 6,
+ 6, 6, 6, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5, 5, 5, 5, 5, 5, 5, 5, 5,
+ 5, 5
+ } ;
+
+static yyconst flex_int16_t yy_base[1154] =
+ { 0,
+ 0, 72, 142, 145, 148, 150, 129, 131, 0, 0,
+ 0, 0, 117, 119, 188, 231, 274, 317, 1671, 4324,
+ 157, 4324, 1667, 4324, 4324, 4324, 4324, 161, 4324, 4324,
+ 4324, 158, 121, 159, 160, 156, 197, 320, 189, 189,
+ 206, 196, 310, 198, 239, 253, 321, 195, 206, 236,
+ 287, 227, 254, 247, 275, 0, 296, 323, 319, 319,
+ 330, 320, 322, 323, 326, 335, 367, 320, 368, 364,
+ 0, 370, 362, 378, 376, 378, 379, 371, 417, 404,
+ 387, 417, 421, 300, 427, 374, 426, 422, 419, 0,
+ 478, 475, 460, 484, 488, 464, 539, 495, 419, 449,
+
+ 477, 483, 0, 546, 525, 516, 553, 556, 557, 213,
+ 4324, 572, 497, 1655, 4324, 548, 552, 572, 576, 577,
+ 578, 585, 568, 569, 593, 595, 590, 616, 587, 597,
+ 595, 594, 608, 598, 597, 612, 1660, 608, 0, 618,
+ 1646, 0, 611, 606, 626, 617, 631, 640, 639, 622,
+ 624, 647, 649, 644, 671, 642, 653, 651, 649, 663,
+ 653, 652, 667, 670, 1610, 669, 1555, 685, 659, 674,
+ 663, 685, 687, 687, 700, 678, 693, 681, 708, 713,
+ 709, 702, 719, 758, 0, 727, 1544, 726, 739, 755,
+ 767, 771, 784, 0, 741, 1540, 746, 786, 787, 797,
+
+ 791, 4324, 4324, 777, 792, 794, 797, 783, 789, 803,
+ 789, 787, 791, 810, 800, 813, 803, 804, 807, 823,
+ 816, 825, 826, 1543, 827, 836, 828, 4324, 840, 845,
+ 0, 0, 843, 849, 850, 849, 836, 841, 855, 841,
+ 839, 842, 860, 851, 861, 848, 852, 857, 873, 860,
+ 869, 875, 1542, 877, 888, 880, 0, 1494, 891, 896,
+ 1462, 1417, 891, 1454, 882, 879, 881, 888, 1415, 901,
+ 1390, 892, 888, 893, 897, 900, 902, 0, 0, 931,
+ 943, 0, 0, 946, 947, 908, 929, 923, 918, 919,
+ 1351, 1012, 950, 932, 934, 940, 4324, 1026, 951, 948,
+
+ 944, 4324, 1020, 963, 945, 965, 954, 957, 955, 963,
+ 975, 967, 984, 976, 971, 969, 1025, 984, 993, 978,
+ 980, 986, 0, 921, 997, 994, 988, 0, 912, 1004,
+ 986, 994, 997, 995, 1044, 1005, 1014, 4324, 1006, 1008,
+ 1001, 1029, 4324, 1024, 1026, 1039, 1028, 1037, 1049, 0,
+ 1039, 1040, 1053, 775, 766, 1057, 1047, 1063, 1064, 1058,
+ 774, 1074, 1060, 701, 1079, 1093, 1080, 4324, 1077, 4324,
+ 4324, 1080, 1094, 1079, 1098, 1101, 1089, 4324, 1103, 1108,
+ 1098, 1106, 1103, 1095, 735, 1111, 1098, 696, 1108, 1117,
+ 0, 1099, 0, 1102, 1117, 1123, 1125, 1113, 1128, 1129,
+
+ 1140, 1133, 1160, 1130, 1141, 1140, 1143, 1153, 1154, 0,
+ 1160, 1165, 1153, 1162, 4324, 4324, 1169, 1156, 1171, 1159,
+ 0, 0, 1173, 1161, 732, 4324, 1175, 4324, 1178, 1179,
+ 175, 1184, 1181, 1193, 1199, 1186, 1193, 1191, 1184, 1207,
+ 1198, 1214, 1196, 1197, 4324, 0, 1213, 0, 1216, 1215,
+ 1220, 1217, 1221, 1222, 1208, 1212, 1205, 1225, 1233, 1216,
+ 1218, 651, 1235, 619, 1231, 1236, 1239, 1256, 1242, 1257,
+ 1243, 1267, 1260, 1268, 1267, 0, 1254, 1254, 1273, 1257,
+ 1253, 1260, 1260, 1262, 1258, 613, 4324, 565, 4324, 4324,
+ 4324, 1266, 1279, 1287, 1279, 1288, 1292, 1273, 4324, 1289,
+
+ 531, 1293, 1297, 1308, 0, 488, 0, 1298, 1312, 1317,
+ 1311, 1319, 1303, 0, 1310, 1308, 1312, 1323, 1307, 1321,
+ 1326, 1328, 1322, 1318, 1319, 0, 477, 1352, 1317, 1332,
+ 1340, 1345, 1360, 1365, 4324, 512, 1366, 1354, 1369, 0,
+ 1371, 1362, 0, 1374, 472, 4324, 1358, 4324, 4324, 1355,
+ 1378, 1368, 1362, 1361, 1363, 1383, 1385, 424, 0, 1369,
+ 0, 0, 1387, 1377, 1371, 1379, 1397, 1393, 1392, 1398,
+ 1405, 1415, 1416, 1411, 1412, 1407, 1421, 1425, 1426, 1428,
+ 1426, 421, 1420, 1423, 1414, 1425, 4324, 1426, 1428, 0,
+ 1478, 1448, 1442, 1450, 4324, 1448, 1441, 1463, 4324, 1474,
+
+ 4324, 1477, 1467, 1475, 1476, 1465, 0, 1483, 0, 1483,
+ 420, 1471, 1470, 1488, 1478, 1488, 1494, 1491, 1479, 1484,
+ 0, 1497, 1495, 1512, 419, 1496, 1496, 1498, 1503, 1504,
+ 1552, 1568, 1577, 1586, 1494, 1531, 1569, 4324, 1566, 1569,
+ 1578, 1571, 1579, 1582, 0, 1572, 1583, 1587, 1590, 1581,
+ 417, 1575, 1576, 1593, 1574, 1583, 1583, 1582, 1579, 1587,
+ 1605, 1602, 1602, 1589, 1606, 1606, 1611, 1618, 1559, 1650,
+ 1675, 1684, 1693, 1702, 1711, 1720, 1729, 1738, 1747, 1756,
+ 1765, 1774, 416, 1637, 1659, 1677, 443, 4324, 411, 1691,
+ 1713, 1731, 0, 1749, 1757, 1773, 1757, 1761, 407, 371,
+
+ 368, 1756, 1773, 1778, 364, 359, 1764, 1761, 1767, 1778,
+ 307, 1779, 1780, 1781, 1801, 1825, 1834, 1843, 1852, 1861,
+ 1870, 1879, 1888, 1897, 1906, 1915, 1924, 1933, 1942, 1951,
+ 1960, 1776, 1804, 1815, 1830, 1857, 1875, 1876, 1914, 1929,
+ 271, 1946, 1938, 1940, 1943, 1946, 1944, 1959, 1960, 1962,
+ 1947, 1951, 1957, 1970, 1952, 1955, 1956, 298, 1957, 1958,
+ 1960, 2015, 2024, 2033, 2042, 2051, 2060, 2069, 2078, 2087,
+ 2096, 2105, 2114, 2123, 2132, 2005, 286, 2079, 4324, 2009,
+ 2023, 253, 2088, 0, 2062, 2117, 225, 2115, 224, 2114,
+ 2124, 2130, 2116, 223, 2127, 2132, 2133, 2138, 2132, 2129,
+
+ 4324, 258, 4324, 0, 0, 2159, 2181, 2190, 2199, 2208,
+ 2217, 2226, 2235, 2244, 2253, 2262, 2271, 2280, 2289, 2298,
+ 2307, 2316, 2125, 4324, 221, 2171, 2170, 219, 2183, 2231,
+ 2240, 217, 2232, 2273, 2283, 2297, 2294, 2312, 2302, 2299,
+ 2299, 2311, 2307, 2321, 4324, 2334, 2343, 2361, 2370, 2379,
+ 2388, 2397, 2406, 2415, 2424, 2433, 2442, 2451, 2460, 2322,
+ 2339, 2357, 2376, 2393, 2396, 2431, 2450, 2443, 2436, 2442,
+ 2452, 2460, 0, 2456, 2452, 2446, 2460, 2457, 2463, 2451,
+ 2510, 2520, 2530, 2540, 2487, 2550, 2559, 2568, 2577, 2586,
+ 2595, 2604, 2613, 2622, 2631, 2640, 2649, 243, 2531, 2548,
+
+ 210, 2549, 2581, 0, 2602, 2597, 2631, 2643, 0, 0,
+ 2630, 182, 2637, 2636, 2643, 0, 2634, 2663, 2670, 2698,
+ 2708, 2725, 2735, 2745, 2755, 2765, 2775, 2785, 2795, 2805,
+ 2815, 2825, 4324, 2662, 2663, 2664, 2683, 2671, 2806, 2820,
+ 2823, 2811, 2807, 2824, 2826, 2811, 0, 2841, 2870, 2886,
+ 2895, 2904, 2913, 2923, 2933, 2943, 2953, 2963, 2973, 2983,
+ 2993, 3003, 3013, 3023, 3033, 2821, 2822, 2823, 2824, 2838,
+ 2826, 0, 3012, 3021, 3016, 181, 0, 3011, 3046, 3074,
+ 3089, 3098, 3107, 3116, 3125, 3134, 3143, 3152, 3161, 3170,
+ 3179, 3188, 3197, 3206, 3215, 3224, 207, 4324, 206, 3026,
+
+ 3041, 3028, 3039, 3048, 3210, 3220, 0, 3060, 3235, 3244,
+ 3262, 3271, 3280, 3289, 3298, 3307, 3316, 3325, 3334, 3343,
+ 3352, 3361, 3370, 3379, 3388, 3397, 3406, 3415, 3424, 3433,
+ 3442, 3451, 3460, 3469, 3478, 3487, 3496, 3505, 4324, 0,
+ 178, 0, 3488, 3480, 0, 3505, 3518, 3527, 3545, 3554,
+ 3563, 3572, 3581, 3590, 3599, 3608, 3617, 3626, 3635, 3644,
+ 3653, 3662, 3671, 3680, 3689, 3698, 3707, 3716, 3725, 3734,
+ 3743, 3752, 3761, 3770, 3779, 3788, 3797, 3775, 3782, 174,
+ 3781, 3251, 3809, 3818, 3836, 3845, 3854, 3863, 3872, 3881,
+ 3890, 3899, 3908, 3917, 3926, 3935, 3944, 3953, 3962, 3971,
+
+ 3980, 3989, 3998, 4007, 4016, 4025, 4034, 4043, 4052, 4061,
+ 4070, 4079, 4068, 0, 4065, 4078, 4091, 4076, 4075, 4089,
+ 4101, 4090, 4096, 4092, 4116, 4088, 4098, 4102, 4157, 4108,
+ 0, 4110, 4164, 0, 4115, 4185, 4113, 4196, 0, 4223,
+ 4230, 4246, 4256, 4271, 4280, 4324, 4297, 4303, 4305, 4311,
+ 214, 213, 4317
+ } ;
+
+static yyconst flex_int16_t yy_def[1154] =
+ { 0,
+ 1146, 1146, 1147, 1147, 1148, 1148, 1, 2, 1, 2,
+ 1, 2, 1, 2, 1, 2, 1, 2, 1146, 1146,
+ 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146,
+ 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146,
+ 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146,
+ 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149,
+ 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149,
+ 1150, 1146, 1146, 1146, 1146, 1146, 1149, 1149, 1149, 1149,
+ 1149, 1146, 1149, 1151, 1151, 1151, 1151, 1151, 1151, 1151,
+ 1149, 91, 91, 91, 91, 91, 1152, 1152, 1152, 1152,
+
+ 1152, 1152, 1152, 91, 104, 104, 104, 104, 104, 1146,
+ 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146,
+ 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146,
+ 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1149, 1149,
+ 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149,
+ 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149,
+ 1149, 1149, 1149, 1149, 1149, 1149, 1150, 1146, 1146, 1146,
+ 1146, 1146, 1146, 1146, 1149, 1149, 1149, 1149, 1149, 1149,
+ 1149, 1146, 1149, 1151, 1151, 1151, 1151, 1151, 91, 91,
+ 91, 91, 1152, 1152, 1152, 1152, 1152, 104, 104, 104,
+
+ 104, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146,
+ 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146,
+ 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146,
+ 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149,
+ 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149,
+ 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149,
+ 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1149, 1149,
+ 1149, 1149, 1149, 1149, 1149, 1146, 1149, 1151, 1151, 91,
+ 91, 1152, 1152, 104, 104, 1146, 1146, 1146, 1146, 1146,
+ 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146,
+
+ 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146,
+ 1146, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149,
+ 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149,
+ 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1146, 1146, 1146,
+ 1146, 1146, 1146, 1146, 1146, 1146, 1149, 1149, 1149, 1149,
+ 1149, 1149, 1149, 1146, 1149, 1146, 1146, 1146, 1146, 1146,
+ 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146,
+ 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1149,
+ 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149,
+ 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149,
+
+ 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149,
+ 1149, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1149, 1149,
+ 1149, 1149, 1149, 1149, 1146, 1146, 1146, 1146, 1146, 1146,
+ 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146,
+ 1146, 1146, 1146, 1146, 1146, 1149, 1149, 1149, 1149, 1149,
+ 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149,
+ 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149,
+ 1149, 1149, 1149, 1149, 1149, 1149, 1146, 1146, 1146, 1146,
+ 1146, 1149, 1149, 1149, 1149, 1146, 1146, 1146, 1146, 1146,
+ 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146,
+
+ 1146, 1146, 1146, 1146, 1149, 1149, 1149, 1149, 1149, 1149,
+ 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149,
+ 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149,
+ 1149, 1149, 1149, 1146, 1146, 1146, 1146, 1146, 1149, 1149,
+ 1149, 1149, 1153, 1146, 1146, 1146, 1146, 1146, 1146, 1146,
+ 1146, 1146, 1146, 1146, 1146, 1146, 1149, 1149, 1149, 1149,
+ 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149,
+ 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149,
+ 1149, 1149, 1149, 1146, 1146, 1146, 1146, 1149, 1149, 1149,
+ 1153, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146,
+
+ 1146, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149,
+ 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149,
+ 1149, 1149, 1149, 1149, 1149, 1146, 1146, 1146, 1149, 1149,
+ 1153, 1153, 1153, 1153, 1146, 1146, 1146, 1146, 1146, 1146,
+ 1146, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149,
+ 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149,
+ 1149, 1149, 1149, 1146, 1146, 1146, 1149, 1149, 1153, 1153,
+ 1153, 1153, 1153, 1153, 1153, 1153, 1153, 1153, 1153, 1153,
+ 1153, 1153, 1146, 1146, 1146, 1146, 1146, 1146, 1149, 1149,
+ 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149,
+
+ 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1146,
+ 1146, 1146, 1149, 1149, 1153, 1153, 1153, 1153, 1153, 1153,
+ 1153, 1153, 1153, 1153, 1153, 1153, 1153, 1153, 1153, 1153,
+ 1153, 1146, 1146, 1146, 1146, 1146, 1149, 1149, 1149, 1149,
+ 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149,
+ 1149, 1149, 1149, 1149, 1149, 1149, 1146, 1146, 1146, 1149,
+ 1149, 1153, 1153, 1153, 1153, 1153, 1153, 1153, 1153, 1153,
+ 1153, 1153, 1153, 1153, 1153, 1146, 1146, 1146, 1146, 1146,
+ 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149,
+ 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149,
+
+ 1146, 1146, 1146, 1149, 1149, 1153, 1153, 1153, 1153, 1153,
+ 1153, 1153, 1153, 1153, 1153, 1153, 1153, 1153, 1153, 1153,
+ 1153, 1153, 1146, 1146, 1146, 1146, 1149, 1149, 1149, 1149,
+ 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149,
+ 1149, 1149, 1149, 1149, 1146, 1153, 1153, 1153, 1153, 1153,
+ 1153, 1153, 1153, 1153, 1153, 1153, 1153, 1153, 1153, 1146,
+ 1146, 1146, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149,
+ 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149,
+ 1153, 1153, 1153, 1153, 1153, 1153, 1153, 1153, 1153, 1153,
+ 1153, 1153, 1153, 1153, 1153, 1153, 1153, 1146, 1146, 1146,
+
+ 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149,
+ 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1153, 1153, 1153,
+ 1153, 1153, 1153, 1153, 1153, 1153, 1153, 1153, 1153, 1153,
+ 1153, 1153, 1146, 1146, 1146, 1149, 1149, 1149, 1149, 1149,
+ 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1153, 1153, 1153,
+ 1153, 1153, 1153, 1153, 1153, 1153, 1153, 1153, 1153, 1153,
+ 1153, 1153, 1153, 1153, 1153, 1146, 1146, 1149, 1149, 1149,
+ 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1153, 1153,
+ 1153, 1153, 1153, 1153, 1153, 1153, 1153, 1153, 1153, 1153,
+ 1153, 1153, 1153, 1153, 1153, 1153, 1146, 1146, 1149, 1149,
+
+ 1149, 1149, 1149, 1149, 1149, 1149, 1149, 1153, 1153, 1153,
+ 1153, 1153, 1153, 1153, 1153, 1153, 1153, 1153, 1153, 1153,
+ 1153, 1153, 1153, 1153, 1153, 1153, 1153, 1153, 1153, 1153,
+ 1153, 1153, 1153, 1153, 1153, 1153, 1153, 1153, 1146, 1149,
+ 1149, 1149, 1149, 1149, 1149, 1149, 1153, 1153, 1153, 1153,
+ 1153, 1153, 1153, 1153, 1153, 1153, 1153, 1153, 1153, 1153,
+ 1153, 1153, 1153, 1153, 1153, 1153, 1153, 1153, 1153, 1153,
+ 1153, 1153, 1153, 1153, 1153, 1153, 1153, 1149, 1149, 1149,
+ 1149, 1153, 1153, 1153, 1153, 1153, 1153, 1153, 1153, 1153,
+ 1153, 1153, 1153, 1153, 1153, 1153, 1153, 1153, 1153, 1153,
+
+ 1153, 1153, 1153, 1153, 1153, 1153, 1153, 1153, 1153, 1153,
+ 1153, 1153, 1149, 1149, 1149, 1149, 1153, 1149, 1149, 1149,
+ 1153, 1149, 1149, 1149, 1153, 1149, 1149, 1149, 1153, 1149,
+ 1149, 1149, 1153, 1149, 1149, 1153, 1149, 1153, 1149, 1153,
+ 1153, 1153, 1153, 1153, 1153, 0, 1146, 1146, 1146, 1146,
+ 1146, 1146, 1146
+ } ;
+
+static yyconst flex_int16_t yy_nxt[4397] =
+ { 0,
+ 20, 21, 22, 23, 21, 24, 25, 26, 20, 27,
+ 28, 28, 28, 28, 28, 28, 28, 29, 30, 31,
+ 32, 33, 34, 35, 36, 20, 37, 38, 39, 40,
+ 41, 42, 43, 44, 20, 45, 20, 46, 47, 20,
+ 48, 20, 49, 20, 20, 50, 20, 32, 33, 34,
+ 35, 36, 20, 37, 38, 39, 40, 41, 42, 43,
+ 44, 20, 45, 20, 46, 47, 20, 48, 20, 49,
+ 20, 50, 20, 21, 22, 23, 21, 24, 25, 26,
+ 20, 27, 28, 28, 28, 28, 28, 28, 28, 29,
+ 30, 31, 51, 52, 53, 54, 55, 56, 57, 58,
+
+ 59, 60, 61, 62, 63, 64, 56, 65, 56, 66,
+ 67, 56, 68, 56, 69, 56, 56, 70, 20, 51,
+ 52, 53, 54, 55, 56, 57, 58, 59, 60, 61,
+ 62, 63, 64, 56, 65, 56, 66, 67, 56, 68,
+ 56, 69, 56, 70, 22, 23, 20, 22, 23, 20,
+ 22, 23, 22, 23, 82, 72, 83, 77, 110, 20,
+ 115, 110, 20, 73, 74, 78, 79, 75, 76, 80,
+ 81, 112, 112, 112, 112, 112, 112, 112, 113, 116,
+ 114, 82, 72, 83, 77, 490, 491, 115, 117, 118,
+ 73, 74, 78, 79, 75, 76, 80, 81, 84, 84,
+
+ 84, 84, 84, 84, 84, 113, 116, 114, 85, 86,
+ 87, 88, 89, 90, 110, 117, 118, 110, 194, 185,
+ 1115, 119, 122, 123, 1078, 1039, 1039, 1006, 943, 933,
+ 124, 125, 128, 136, 137, 85, 86, 87, 88, 89,
+ 90, 84, 84, 84, 84, 84, 84, 84, 119, 122,
+ 123, 91, 92, 93, 94, 95, 96, 124, 125, 128,
+ 136, 137, 933, 868, 138, 864, 142, 861, 845, 838,
+ 833, 831, 824, 129, 143, 144, 130, 131, 91, 92,
+ 93, 94, 95, 96, 97, 97, 97, 97, 97, 97,
+ 97, 138, 132, 142, 98, 99, 100, 101, 102, 103,
+
+ 129, 143, 144, 130, 131, 824, 802, 140, 145, 141,
+ 184, 184, 184, 184, 184, 184, 184, 785, 758, 132,
+ 146, 98, 99, 100, 101, 102, 103, 97, 97, 97,
+ 97, 97, 97, 97, 140, 145, 141, 104, 105, 106,
+ 107, 108, 109, 120, 126, 133, 147, 146, 121, 134,
+ 127, 148, 149, 150, 151, 152, 153, 155, 163, 158,
+ 156, 135, 154, 157, 104, 105, 106, 107, 108, 109,
+ 120, 126, 133, 147, 159, 121, 134, 127, 148, 149,
+ 150, 151, 152, 153, 155, 163, 158, 156, 135, 154,
+ 157, 160, 166, 164, 168, 161, 165, 169, 171, 170,
+
+ 173, 159, 174, 175, 134, 753, 176, 162, 177, 172,
+ 752, 181, 129, 115, 748, 130, 135, 747, 160, 166,
+ 164, 168, 161, 165, 169, 171, 170, 173, 180, 174,
+ 175, 134, 161, 176, 162, 177, 172, 178, 181, 129,
+ 115, 131, 130, 135, 162, 158, 188, 186, 179, 187,
+ 117, 156, 118, 746, 157, 180, 182, 737, 115, 161,
+ 183, 736, 732, 697, 178, 663, 649, 624, 131, 197,
+ 603, 162, 158, 188, 186, 179, 187, 117, 156, 118,
+ 192, 157, 189, 182, 189, 115, 189, 183, 189, 189,
+ 189, 189, 189, 189, 189, 189, 197, 189, 190, 189,
+
+ 191, 189, 189, 189, 189, 117, 189, 192, 189, 189,
+ 189, 189, 144, 189, 142, 195, 118, 196, 593, 202,
+ 585, 145, 189, 576, 189, 190, 189, 191, 189, 189,
+ 189, 189, 117, 189, 557, 189, 201, 189, 198, 144,
+ 553, 142, 195, 118, 196, 198, 202, 198, 145, 193,
+ 193, 193, 193, 193, 193, 193, 198, 198, 198, 198,
+ 198, 198, 198, 201, 142, 198, 199, 198, 200, 198,
+ 198, 198, 198, 198, 198, 198, 198, 198, 198, 198,
+ 204, 144, 112, 112, 112, 112, 112, 112, 112, 145,
+ 205, 142, 206, 199, 198, 200, 198, 198, 198, 209,
+
+ 198, 210, 198, 198, 198, 198, 198, 204, 144, 207,
+ 211, 544, 213, 214, 208, 215, 145, 205, 216, 206,
+ 212, 218, 543, 219, 221, 222, 209, 223, 210, 224,
+ 225, 226, 227, 228, 230, 217, 207, 211, 213, 214,
+ 231, 208, 215, 233, 234, 216, 235, 212, 218, 220,
+ 236, 221, 222, 238, 223, 237, 224, 225, 226, 227,
+ 228, 230, 217, 239, 240, 521, 242, 231, 243, 244,
+ 233, 234, 245, 235, 241, 247, 220, 236, 248, 250,
+ 238, 251, 237, 252, 253, 254, 255, 256, 257, 246,
+ 239, 240, 242, 258, 243, 260, 244, 519, 263, 245,
+
+ 264, 241, 247, 265, 249, 266, 250, 268, 251, 225,
+ 252, 253, 254, 255, 256, 257, 246, 270, 207, 271,
+ 258, 272, 260, 208, 262, 263, 267, 264, 273, 275,
+ 265, 249, 266, 236, 268, 254, 225, 224, 237, 269,
+ 276, 486, 453, 431, 270, 207, 271, 434, 272, 278,
+ 208, 262, 274, 267, 253, 273, 275, 277, 204, 189,
+ 236, 189, 254, 282, 224, 237, 269, 276, 184, 184,
+ 184, 184, 184, 184, 184, 189, 278, 280, 204, 274,
+ 281, 253, 431, 425, 277, 204, 189, 189, 189, 189,
+ 282, 189, 425, 189, 193, 193, 193, 193, 193, 193,
+
+ 193, 286, 189, 233, 280, 204, 198, 198, 198, 284,
+ 285, 198, 287, 198, 189, 288, 189, 198, 189, 198,
+ 189, 289, 290, 233, 291, 292, 293, 294, 286, 295,
+ 233, 296, 297, 198, 198, 198, 284, 298, 198, 287,
+ 198, 299, 288, 300, 198, 301, 198, 302, 289, 290,
+ 233, 291, 292, 293, 294, 303, 295, 304, 296, 297,
+ 305, 307, 308, 309, 298, 310, 311, 312, 299, 313,
+ 300, 314, 301, 315, 302, 316, 317, 318, 319, 320,
+ 321, 322, 303, 323, 304, 324, 325, 305, 307, 308,
+ 309, 326, 310, 311, 312, 327, 313, 328, 314, 329,
+
+ 315, 330, 316, 317, 318, 319, 320, 321, 322, 331,
+ 323, 332, 324, 325, 333, 334, 336, 337, 326, 340,
+ 342, 344, 327, 343, 328, 346, 329, 345, 330, 348,
+ 349, 371, 350, 351, 353, 354, 331, 355, 332, 352,
+ 367, 333, 334, 336, 337, 356, 340, 342, 344, 343,
+ 357, 189, 346, 189, 358, 359, 348, 349, 350, 360,
+ 351, 353, 354, 189, 355, 189, 198, 198, 198, 198,
+ 363, 364, 356, 365, 366, 368, 369, 357, 189, 370,
+ 189, 358, 359, 372, 373, 374, 360, 375, 376, 377,
+ 189, 378, 189, 198, 198, 198, 198, 363, 364, 379,
+
+ 365, 366, 368, 369, 380, 381, 370, 382, 383, 384,
+ 372, 373, 374, 387, 375, 376, 377, 388, 378, 389,
+ 390, 391, 392, 393, 394, 395, 379, 396, 397, 398,
+ 386, 380, 381, 410, 382, 383, 384, 385, 411, 371,
+ 387, 412, 413, 414, 388, 367, 389, 390, 391, 392,
+ 393, 394, 395, 415, 396, 397, 398, 399, 362, 416,
+ 410, 417, 418, 419, 400, 411, 401, 402, 412, 413,
+ 414, 420, 403, 421, 422, 423, 424, 426, 427, 404,
+ 415, 405, 406, 407, 408, 409, 416, 428, 417, 418,
+ 419, 400, 429, 401, 402, 430, 432, 433, 420, 403,
+
+ 421, 422, 423, 424, 426, 427, 404, 435, 405, 406,
+ 407, 408, 409, 436, 428, 437, 438, 439, 440, 429,
+ 441, 442, 430, 432, 433, 443, 444, 445, 446, 447,
+ 448, 449, 450, 451, 435, 452, 454, 455, 456, 457,
+ 436, 458, 437, 438, 439, 440, 459, 441, 442, 460,
+ 461, 462, 443, 444, 445, 446, 447, 448, 449, 450,
+ 451, 467, 452, 454, 455, 456, 457, 470, 458, 463,
+ 464, 465, 468, 459, 466, 471, 460, 461, 462, 472,
+ 473, 474, 475, 469, 476, 477, 478, 479, 467, 480,
+ 481, 482, 483, 484, 470, 485, 463, 464, 465, 487,
+
+ 488, 466, 471, 489, 492, 493, 472, 473, 474, 475,
+ 469, 476, 477, 478, 479, 494, 480, 481, 482, 483,
+ 484, 495, 485, 496, 497, 498, 487, 488, 499, 500,
+ 489, 492, 493, 501, 502, 503, 504, 505, 506, 507,
+ 508, 509, 494, 510, 511, 512, 513, 515, 495, 514,
+ 496, 497, 498, 516, 499, 517, 500, 518, 520, 522,
+ 501, 502, 503, 504, 505, 506, 507, 508, 509, 523,
+ 510, 511, 512, 513, 515, 514, 524, 525, 526, 527,
+ 516, 528, 517, 529, 518, 520, 522, 530, 531, 532,
+ 533, 534, 535, 536, 537, 538, 523, 539, 540, 541,
+
+ 542, 545, 546, 524, 525, 526, 527, 547, 528, 548,
+ 529, 549, 550, 551, 530, 531, 532, 533, 534, 535,
+ 536, 537, 538, 552, 539, 540, 541, 542, 545, 546,
+ 554, 555, 556, 558, 547, 559, 548, 560, 549, 550,
+ 551, 561, 562, 563, 564, 565, 566, 567, 568, 569,
+ 552, 570, 571, 574, 575, 572, 579, 554, 555, 556,
+ 558, 573, 559, 361, 560, 580, 581, 582, 561, 562,
+ 563, 564, 565, 566, 567, 568, 569, 577, 570, 571,
+ 574, 575, 572, 579, 583, 584, 586, 587, 573, 588,
+ 578, 589, 580, 581, 582, 590, 592, 594, 341, 595,
+
+ 596, 597, 598, 600, 577, 599, 601, 602, 604, 605,
+ 606, 583, 584, 586, 587, 607, 588, 578, 589, 608,
+ 609, 610, 590, 592, 594, 595, 611, 596, 597, 598,
+ 600, 599, 612, 601, 602, 604, 605, 606, 613, 614,
+ 615, 607, 616, 617, 618, 619, 608, 609, 610, 620,
+ 621, 622, 623, 611, 625, 626, 627, 628, 629, 612,
+ 630, 347, 341, 339, 338, 613, 614, 615, 635, 616,
+ 617, 618, 619, 636, 637, 638, 620, 621, 622, 623,
+ 639, 625, 626, 627, 628, 629, 640, 630, 631, 632,
+ 633, 634, 634, 634, 634, 635, 641, 642, 643, 644,
+
+ 636, 637, 638, 645, 646, 647, 648, 639, 650, 651,
+ 652, 653, 654, 640, 655, 656, 657, 658, 659, 660,
+ 664, 665, 666, 641, 642, 643, 644, 667, 668, 683,
+ 645, 646, 647, 648, 661, 650, 651, 652, 653, 654,
+ 335, 655, 656, 657, 658, 659, 660, 664, 665, 666,
+ 662, 306, 306, 283, 667, 668, 683, 279, 261, 684,
+ 669, 661, 631, 632, 633, 634, 634, 634, 634, 715,
+ 716, 717, 718, 718, 718, 718, 669, 662, 670, 671,
+ 672, 673, 673, 673, 673, 669, 684, 674, 675, 676,
+ 677, 677, 678, 679, 669, 685, 680, 681, 682, 679,
+
+ 679, 679, 679, 686, 687, 688, 689, 690, 691, 692,
+ 693, 694, 695, 696, 698, 699, 700, 259, 701, 702,
+ 703, 704, 685, 705, 706, 707, 708, 709, 710, 711,
+ 686, 687, 688, 689, 690, 691, 692, 693, 694, 695,
+ 696, 698, 699, 700, 701, 712, 702, 703, 704, 705,
+ 713, 706, 707, 708, 709, 710, 711, 714, 669, 232,
+ 680, 681, 682, 679, 679, 679, 679, 229, 203, 111,
+ 1146, 1146, 712, 1146, 1146, 733, 1146, 713, 1146, 1146,
+ 1146, 1146, 1146, 669, 714, 719, 720, 721, 722, 722,
+ 722, 722, 669, 734, 723, 724, 725, 726, 726, 727,
+
+ 728, 669, 733, 729, 730, 731, 728, 728, 728, 728,
+ 669, 735, 680, 681, 682, 679, 679, 679, 679, 669,
+ 734, 719, 720, 721, 722, 722, 722, 722, 669, 738,
+ 723, 724, 725, 726, 726, 727, 728, 669, 735, 729,
+ 730, 731, 728, 728, 728, 728, 669, 739, 729, 730,
+ 731, 728, 728, 728, 679, 669, 738, 680, 681, 682,
+ 679, 679, 679, 679, 669, 740, 631, 632, 633, 634,
+ 634, 634, 634, 669, 739, 670, 671, 672, 673, 673,
+ 673, 673, 669, 741, 674, 675, 676, 677, 677, 678,
+ 679, 742, 740, 743, 744, 745, 749, 750, 751, 754,
+
+ 755, 756, 757, 759, 760, 761, 1146, 776, 1146, 762,
+ 741, 631, 632, 633, 634, 634, 634, 634, 742, 1146,
+ 743, 744, 745, 749, 750, 751, 754, 755, 756, 757,
+ 759, 760, 761, 762, 776, 763, 764, 765, 766, 766,
+ 766, 766, 762, 777, 767, 768, 769, 770, 770, 771,
+ 772, 762, 778, 773, 774, 775, 772, 772, 772, 772,
+ 669, 779, 680, 681, 682, 679, 679, 679, 679, 669,
+ 777, 719, 720, 721, 722, 722, 722, 722, 669, 778,
+ 723, 724, 725, 726, 726, 727, 728, 669, 779, 729,
+ 730, 731, 728, 728, 728, 728, 669, 780, 680, 681,
+
+ 682, 679, 679, 679, 679, 669, 781, 719, 720, 721,
+ 722, 722, 722, 722, 669, 782, 723, 724, 725, 726,
+ 726, 727, 728, 669, 780, 729, 730, 731, 728, 728,
+ 728, 728, 669, 781, 729, 730, 731, 728, 728, 728,
+ 679, 669, 782, 680, 681, 682, 679, 679, 679, 679,
+ 669, 783, 631, 632, 633, 634, 634, 634, 634, 669,
+ 784, 670, 671, 672, 673, 673, 673, 673, 669, 786,
+ 674, 675, 676, 677, 677, 678, 679, 787, 783, 788,
+ 789, 790, 791, 792, 793, 794, 795, 784, 796, 797,
+ 798, 799, 800, 801, 803, 804, 786, 805, 1146, 1146,
+
+ 1146, 1146, 1146, 1146, 787, 1146, 788, 789, 790, 791,
+ 792, 793, 794, 795, 1146, 796, 797, 798, 799, 800,
+ 801, 803, 804, 1146, 805, 806, 807, 808, 809, 809,
+ 809, 809, 762, 823, 773, 774, 775, 772, 772, 772,
+ 772, 762, 826, 810, 811, 812, 813, 813, 813, 813,
+ 762, 827, 814, 815, 816, 817, 817, 818, 819, 762,
+ 823, 820, 821, 822, 819, 819, 819, 819, 762, 826,
+ 773, 774, 775, 772, 772, 772, 772, 762, 827, 810,
+ 811, 812, 813, 813, 813, 813, 762, 829, 814, 815,
+ 816, 817, 817, 818, 819, 762, 1146, 820, 821, 822,
+
+ 819, 819, 819, 819, 762, 1146, 820, 821, 822, 819,
+ 819, 819, 679, 762, 829, 680, 681, 682, 679, 679,
+ 679, 679, 762, 825, 631, 632, 633, 634, 634, 634,
+ 634, 762, 828, 670, 671, 672, 673, 673, 673, 673,
+ 762, 830, 674, 675, 676, 677, 677, 678, 679, 825,
+ 832, 834, 835, 836, 837, 839, 840, 841, 828, 842,
+ 843, 844, 1146, 860, 1146, 1146, 1146, 846, 830, 631,
+ 632, 633, 634, 634, 634, 634, 1146, 832, 834, 835,
+ 836, 837, 839, 840, 841, 1146, 842, 843, 844, 846,
+ 860, 847, 848, 849, 850, 850, 850, 850, 846, 862,
+
+ 851, 852, 853, 854, 854, 855, 856, 846, 863, 857,
+ 858, 859, 856, 856, 856, 856, 762, 865, 680, 681,
+ 682, 679, 679, 679, 679, 762, 862, 719, 720, 721,
+ 722, 722, 722, 722, 762, 863, 723, 724, 725, 726,
+ 726, 727, 728, 762, 865, 729, 730, 731, 728, 728,
+ 728, 728, 762, 866, 680, 681, 682, 679, 679, 679,
+ 679, 762, 867, 719, 720, 721, 722, 722, 722, 722,
+ 762, 869, 723, 724, 725, 726, 726, 727, 728, 762,
+ 866, 729, 730, 731, 728, 728, 728, 728, 762, 867,
+ 729, 730, 731, 728, 728, 728, 679, 762, 869, 680,
+
+ 681, 682, 679, 679, 679, 679, 762, 870, 631, 632,
+ 633, 634, 634, 634, 634, 762, 871, 670, 671, 672,
+ 673, 673, 673, 673, 762, 872, 674, 675, 676, 677,
+ 677, 678, 679, 873, 870, 874, 875, 876, 877, 878,
+ 879, 880, 1146, 871, 881, 882, 883, 884, 884, 884,
+ 884, 846, 872, 857, 858, 859, 856, 856, 856, 856,
+ 873, 898, 874, 875, 876, 877, 878, 879, 880, 846,
+ 899, 885, 886, 887, 888, 888, 888, 888, 846, 900,
+ 889, 890, 891, 892, 892, 893, 894, 846, 898, 895,
+ 896, 897, 894, 894, 894, 894, 846, 899, 857, 858,
+
+ 859, 856, 856, 856, 856, 846, 900, 885, 886, 887,
+ 888, 888, 888, 888, 846, 901, 889, 890, 891, 892,
+ 892, 893, 894, 846, 902, 895, 896, 897, 894, 894,
+ 894, 894, 846, 903, 895, 896, 897, 894, 894, 894,
+ 679, 846, 901, 680, 681, 682, 679, 679, 679, 679,
+ 846, 902, 631, 632, 633, 634, 634, 634, 634, 846,
+ 903, 670, 671, 672, 673, 673, 673, 673, 846, 904,
+ 674, 675, 676, 677, 677, 678, 679, 905, 906, 1146,
+ 907, 908, 909, 910, 911, 912, 913, 914, 915, 916,
+ 917, 1146, 1146, 1146, 1146, 846, 904, 680, 681, 682,
+
+ 679, 679, 679, 679, 905, 906, 907, 1146, 908, 909,
+ 910, 911, 912, 913, 914, 915, 916, 917, 846, 918,
+ 631, 632, 633, 634, 634, 634, 634, 919, 846, 918,
+ 920, 921, 922, 923, 923, 923, 923, 919, 846, 918,
+ 924, 925, 926, 927, 927, 928, 929, 919, 846, 918,
+ 930, 931, 932, 929, 929, 929, 929, 919, 846, 934,
+ 719, 720, 721, 722, 722, 722, 722, 846, 935, 723,
+ 724, 725, 726, 726, 727, 728, 846, 936, 729, 730,
+ 731, 728, 728, 728, 728, 846, 934, 680, 681, 682,
+ 679, 679, 679, 679, 846, 935, 719, 720, 721, 722,
+
+ 722, 722, 722, 846, 936, 723, 724, 725, 726, 726,
+ 727, 728, 846, 937, 729, 730, 731, 728, 728, 728,
+ 728, 846, 938, 729, 730, 731, 728, 728, 728, 679,
+ 846, 939, 680, 681, 682, 679, 679, 679, 679, 846,
+ 937, 631, 632, 633, 634, 634, 634, 634, 846, 938,
+ 670, 671, 672, 673, 673, 673, 673, 846, 939, 674,
+ 675, 676, 677, 677, 678, 679, 940, 941, 942, 944,
+ 945, 946, 947, 631, 632, 633, 634, 634, 634, 634,
+ 949, 950, 951, 952, 952, 952, 952, 1146, 1146, 1146,
+ 1146, 1146, 1146, 940, 941, 942, 944, 945, 946, 947,
+
+ 966, 967, 968, 969, 970, 948, 846, 918, 930, 931,
+ 932, 929, 929, 929, 929, 919, 846, 918, 953, 954,
+ 955, 956, 956, 956, 956, 919, 1146, 966, 967, 968,
+ 969, 970, 948, 846, 918, 957, 958, 959, 960, 960,
+ 961, 962, 919, 846, 918, 963, 964, 965, 962, 962,
+ 962, 962, 919, 846, 918, 930, 931, 932, 929, 929,
+ 929, 929, 919, 846, 918, 953, 954, 955, 956, 956,
+ 956, 956, 919, 846, 918, 957, 958, 959, 960, 960,
+ 961, 962, 919, 846, 918, 963, 964, 965, 962, 962,
+ 962, 962, 919, 846, 918, 963, 964, 965, 962, 962,
+
+ 962, 679, 919, 846, 918, 680, 681, 682, 679, 679,
+ 679, 679, 919, 846, 918, 631, 632, 633, 634, 634,
+ 634, 634, 919, 846, 918, 670, 671, 672, 673, 673,
+ 673, 673, 919, 846, 918, 674, 675, 676, 677, 677,
+ 678, 679, 919, 971, 972, 973, 974, 975, 976, 977,
+ 978, 631, 632, 633, 634, 634, 634, 634, 1146, 1146,
+ 997, 998, 999, 1000, 1001, 1002, 979, 1146, 1146, 1146,
+ 971, 972, 973, 974, 975, 976, 977, 978, 669, 918,
+ 980, 981, 982, 983, 983, 983, 983, 997, 998, 999,
+ 1000, 1001, 1002, 979, 669, 918, 984, 985, 986, 987,
+
+ 987, 987, 987, 669, 918, 988, 989, 990, 991, 991,
+ 992, 993, 669, 918, 994, 995, 996, 993, 993, 993,
+ 993, 846, 918, 680, 681, 682, 679, 679, 679, 679,
+ 919, 846, 918, 719, 720, 721, 722, 722, 722, 722,
+ 919, 846, 918, 723, 724, 725, 726, 726, 727, 728,
+ 919, 846, 918, 729, 730, 731, 728, 728, 728, 728,
+ 919, 846, 918, 680, 681, 682, 679, 679, 679, 679,
+ 919, 846, 918, 719, 720, 721, 722, 722, 722, 722,
+ 919, 846, 918, 723, 724, 725, 726, 726, 727, 728,
+ 919, 846, 918, 729, 730, 731, 728, 728, 728, 728,
+
+ 919, 846, 918, 729, 730, 731, 728, 728, 728, 679,
+ 919, 846, 918, 680, 681, 682, 679, 679, 679, 679,
+ 919, 846, 918, 631, 632, 633, 634, 634, 634, 634,
+ 919, 846, 918, 670, 671, 672, 673, 673, 673, 673,
+ 919, 846, 918, 674, 675, 676, 677, 677, 678, 679,
+ 919, 1003, 1004, 1005, 1146, 1007, 631, 632, 633, 634,
+ 634, 634, 634, 1146, 1040, 1041, 1042, 1043, 1044, 1008,
+ 631, 1047, 633, 634, 634, 634, 634, 1146, 1003, 1004,
+ 1005, 1007, 669, 918, 1009, 1010, 1011, 1012, 1012, 1012,
+ 1012, 1040, 1041, 1042, 1043, 1044, 1008, 669, 918, 1013,
+
+ 1014, 1015, 1016, 1016, 1016, 1016, 669, 918, 1017, 1018,
+ 1019, 1020, 1020, 1021, 1022, 669, 918, 1023, 1024, 1025,
+ 1022, 1022, 1022, 1022, 669, 918, 1023, 1024, 1025, 1022,
+ 1022, 1022, 1022, 669, 918, 1026, 1027, 1028, 1029, 1029,
+ 1029, 1029, 669, 918, 1030, 1031, 1032, 1033, 1033, 1034,
+ 1035, 669, 918, 1036, 1037, 1038, 1035, 1035, 1035, 1035,
+ 669, 918, 1023, 1024, 1025, 1022, 1022, 1022, 1022, 669,
+ 918, 1026, 1027, 1028, 1029, 1029, 1029, 1029, 669, 918,
+ 1030, 1031, 1032, 1033, 1033, 1034, 1035, 669, 918, 1036,
+ 1037, 1038, 1035, 1035, 1035, 1035, 669, 918, 1036, 1037,
+
+ 1038, 1035, 1035, 1035, 1022, 669, 918, 1023, 1024, 1025,
+ 1022, 1022, 1022, 1022, 669, 918, 1009, 1010, 1011, 1012,
+ 1012, 1012, 1012, 669, 918, 1013, 1014, 1015, 1016, 1016,
+ 1016, 1016, 669, 918, 1017, 1018, 1019, 1020, 1020, 1021,
+ 1022, 1045, 1046, 669, 918, 1048, 1049, 1050, 1051, 1051,
+ 1051, 1051, 669, 918, 1052, 1053, 1054, 1055, 1055, 1055,
+ 1055, 1117, 716, 717, 718, 718, 718, 718, 1045, 1046,
+ 669, 918, 1056, 1057, 1058, 1059, 1059, 1060, 1061, 669,
+ 918, 1062, 1063, 1064, 1061, 1061, 1061, 1061, 669, 918,
+ 1062, 1063, 1064, 1061, 1061, 1061, 1061, 669, 918, 1065,
+
+ 1066, 1067, 1068, 1068, 1068, 1068, 669, 918, 1069, 1070,
+ 1071, 1072, 1072, 1073, 1074, 669, 918, 1075, 1076, 1077,
+ 1074, 1074, 1074, 1074, 669, 918, 1062, 1063, 1064, 1061,
+ 1061, 1061, 1061, 669, 918, 1065, 1066, 1067, 1068, 1068,
+ 1068, 1068, 669, 918, 1069, 1070, 1071, 1072, 1072, 1073,
+ 1074, 669, 918, 1075, 1076, 1077, 1074, 1074, 1074, 1074,
+ 669, 918, 1075, 1076, 1077, 1074, 1074, 1074, 1061, 669,
+ 918, 1062, 1063, 1064, 1061, 1061, 1061, 1061, 669, 918,
+ 1048, 1049, 1050, 1051, 1051, 1051, 1051, 669, 918, 1052,
+ 1053, 1054, 1055, 1055, 1055, 1055, 669, 918, 1056, 1057,
+
+ 1058, 1059, 1059, 1060, 1061, 669, 918, 1062, 1063, 1064,
+ 1061, 1061, 1061, 1061, 669, 918, 1065, 1066, 1067, 1068,
+ 1068, 1068, 1068, 669, 918, 1069, 1070, 1071, 1072, 1072,
+ 1073, 1074, 669, 918, 1075, 1076, 1077, 1074, 1074, 1074,
+ 1074, 669, 918, 1062, 1063, 1064, 1061, 1061, 1061, 1061,
+ 669, 918, 1065, 1066, 1067, 1068, 1068, 1068, 1068, 669,
+ 918, 1069, 1070, 1071, 1072, 1072, 1073, 1074, 669, 918,
+ 1075, 1076, 1077, 1074, 1074, 1074, 1074, 669, 918, 1075,
+ 1076, 1077, 1074, 1074, 1074, 1061, 669, 918, 1062, 1063,
+ 1064, 1061, 1061, 1061, 1061, 669, 918, 1048, 1049, 1050,
+
+ 1051, 1051, 1051, 1051, 669, 918, 1052, 1053, 1054, 1055,
+ 1055, 1055, 1055, 669, 918, 1056, 1057, 1058, 1059, 1059,
+ 1060, 1061, 1079, 1146, 1080, 1081, 1082, 1146, 670, 671,
+ 672, 673, 673, 673, 673, 669, 918, 1083, 1084, 1085,
+ 1086, 1086, 1086, 1086, 1146, 1146, 1146, 1146, 1146, 1079,
+ 1080, 1146, 1081, 669, 918, 1087, 1088, 1089, 1090, 1090,
+ 1090, 1090, 669, 918, 1091, 1092, 1093, 1094, 1094, 1095,
+ 1096, 669, 918, 1097, 1098, 1099, 1096, 1096, 1096, 1096,
+ 669, 918, 1097, 1098, 1099, 1096, 1096, 1096, 1096, 669,
+ 918, 1100, 1101, 1102, 1103, 1103, 1103, 1103, 669, 918,
+
+ 1104, 1105, 1106, 1107, 1107, 1108, 1109, 669, 918, 1110,
+ 1111, 1112, 1109, 1109, 1109, 1109, 669, 918, 1097, 1098,
+ 1099, 1096, 1096, 1096, 1096, 669, 918, 1100, 1101, 1102,
+ 1103, 1103, 1103, 1103, 669, 918, 1104, 1105, 1106, 1107,
+ 1107, 1108, 1109, 669, 918, 1110, 1111, 1112, 1109, 1109,
+ 1109, 1109, 669, 918, 1110, 1111, 1112, 1109, 1109, 1109,
+ 1096, 669, 918, 1097, 1098, 1099, 1096, 1096, 1096, 1096,
+ 669, 918, 1083, 1084, 1085, 1086, 1086, 1086, 1086, 669,
+ 918, 1087, 1088, 1089, 1090, 1090, 1090, 1090, 669, 918,
+ 1091, 1092, 1093, 1094, 1094, 1095, 1096, 669, 918, 1097,
+
+ 1098, 1099, 1096, 1096, 1096, 1096, 669, 918, 1100, 1101,
+ 1102, 1103, 1103, 1103, 1103, 669, 918, 1104, 1105, 1106,
+ 1107, 1107, 1108, 1109, 669, 918, 1110, 1111, 1112, 1109,
+ 1109, 1109, 1109, 669, 918, 1097, 1098, 1099, 1096, 1096,
+ 1096, 1096, 669, 918, 1100, 1101, 1102, 1103, 1103, 1103,
+ 1103, 669, 918, 1104, 1105, 1106, 1107, 1107, 1108, 1109,
+ 669, 918, 1110, 1111, 1112, 1109, 1109, 1109, 1109, 669,
+ 918, 1110, 1111, 1112, 1109, 1109, 1109, 1096, 669, 918,
+ 1097, 1098, 1099, 1096, 1096, 1096, 1096, 669, 918, 1083,
+ 1084, 1085, 1086, 1086, 1086, 1086, 669, 918, 1087, 1088,
+
+ 1089, 1090, 1090, 1090, 1090, 669, 918, 1091, 1092, 1093,
+ 1094, 1094, 1095, 1096, 1113, 1114, 1116, 669, 918, 631,
+ 632, 633, 634, 634, 634, 634, 669, 918, 670, 671,
+ 672, 673, 673, 673, 673, 1146, 1146, 1146, 1146, 1146,
+ 1146, 1113, 1114, 1116, 669, 918, 674, 675, 676, 677,
+ 677, 678, 679, 669, 918, 680, 681, 682, 679, 679,
+ 679, 679, 669, 918, 680, 681, 682, 679, 679, 679,
+ 679, 669, 918, 719, 720, 721, 722, 722, 722, 722,
+ 669, 918, 723, 724, 725, 726, 726, 727, 728, 669,
+ 918, 729, 730, 731, 728, 728, 728, 728, 669, 918,
+
+ 680, 681, 682, 679, 679, 679, 679, 669, 918, 719,
+ 720, 721, 722, 722, 722, 722, 669, 918, 723, 724,
+ 725, 726, 726, 727, 728, 669, 918, 729, 730, 731,
+ 728, 728, 728, 728, 669, 918, 729, 730, 731, 728,
+ 728, 728, 679, 669, 918, 680, 681, 682, 679, 679,
+ 679, 679, 669, 918, 631, 632, 633, 634, 634, 634,
+ 634, 669, 918, 670, 671, 672, 673, 673, 673, 673,
+ 669, 918, 674, 675, 676, 677, 677, 678, 679, 669,
+ 918, 680, 681, 682, 679, 679, 679, 679, 669, 918,
+ 719, 720, 721, 722, 722, 722, 722, 669, 918, 723,
+
+ 724, 725, 726, 726, 727, 728, 669, 918, 729, 730,
+ 731, 728, 728, 728, 728, 669, 918, 680, 681, 682,
+ 679, 679, 679, 679, 669, 918, 719, 720, 721, 722,
+ 722, 722, 722, 669, 918, 723, 724, 725, 726, 726,
+ 727, 728, 669, 918, 729, 730, 731, 728, 728, 728,
+ 728, 669, 918, 729, 730, 731, 728, 728, 728, 679,
+ 669, 918, 680, 681, 682, 679, 679, 679, 679, 669,
+ 918, 631, 632, 633, 634, 634, 634, 634, 669, 918,
+ 670, 671, 672, 673, 673, 673, 673, 669, 918, 674,
+ 675, 676, 677, 677, 678, 679, 1118, 1119, 1120, 762,
+
+ 1121, 631, 632, 633, 634, 634, 634, 634, 1122, 1123,
+ 1124, 631, 632, 633, 634, 634, 634, 634, 1126, 1127,
+ 1128, 1130, 1131, 1118, 1119, 1120, 631, 632, 633, 634,
+ 634, 634, 634, 1132, 1134, 1122, 1123, 1124, 1135, 1125,
+ 1146, 1146, 1146, 1146, 1146, 1126, 1127, 1128, 1130, 1131,
+ 1146, 1146, 1146, 1146, 1137, 1129, 1146, 1139, 1146, 1146,
+ 1132, 1134, 1146, 1146, 1146, 1135, 1125, 631, 632, 633,
+ 634, 634, 634, 634, 631, 632, 633, 634, 634, 634,
+ 634, 1137, 1129, 1139, 1146, 1146, 1146, 1146, 1136, 1146,
+ 1146, 1146, 1146, 1146, 1133, 631, 632, 633, 634, 634,
+
+ 634, 634, 1146, 1146, 1146, 1138, 631, 632, 633, 634,
+ 634, 634, 634, 1146, 1146, 1136, 1146, 1146, 1146, 1146,
+ 1146, 1133, 1146, 1146, 1146, 1146, 1146, 1146, 1140, 1146,
+ 1146, 1146, 1138, 631, 632, 633, 634, 634, 634, 634,
+ 631, 632, 633, 634, 634, 634, 634, 1146, 1146, 1146,
+ 1146, 1141, 1146, 1142, 1146, 1140, 631, 632, 633, 634,
+ 634, 634, 634, 1146, 1146, 1143, 1144, 1145, 633, 634,
+ 634, 634, 634, 1146, 1146, 1146, 1146, 1146, 1141, 669,
+ 1142, 631, 632, 633, 634, 634, 634, 634, 669, 1146,
+ 670, 671, 672, 673, 673, 673, 673, 71, 71, 71,
+
+ 71, 71, 71, 20, 20, 20, 20, 20, 20, 139,
+ 139, 167, 167, 1146, 1146, 167, 167, 591, 1146, 1146,
+ 591, 591, 591, 19, 1146, 1146, 1146, 1146, 1146, 1146,
+ 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146,
+ 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146,
+ 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146,
+ 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146,
+ 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146,
+ 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146,
+ 1146, 1146, 1146, 1146, 1146, 1146
+
+ } ;
+
+static yyconst flex_int16_t yy_chk[4397] =
+ { 0,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 3, 3, 3, 4, 4, 4,
+ 5, 5, 6, 6, 13, 7, 14, 8, 21, 3,
+ 33, 21, 4, 7, 7, 8, 8, 7, 7, 8,
+ 8, 28, 28, 28, 28, 28, 28, 28, 32, 34,
+ 32, 13, 7, 14, 8, 431, 431, 33, 35, 36,
+ 7, 7, 8, 8, 7, 7, 8, 8, 15, 15,
+
+ 15, 15, 15, 15, 15, 32, 34, 32, 15, 15,
+ 15, 15, 15, 15, 110, 35, 36, 110, 1152, 1151,
+ 1080, 37, 39, 40, 1041, 999, 997, 976, 912, 901,
+ 41, 42, 44, 48, 49, 15, 15, 15, 15, 15,
+ 15, 16, 16, 16, 16, 16, 16, 16, 37, 39,
+ 40, 16, 16, 16, 16, 16, 16, 41, 42, 44,
+ 48, 49, 898, 832, 50, 828, 52, 825, 802, 794,
+ 789, 787, 782, 45, 53, 54, 45, 46, 16, 16,
+ 16, 16, 16, 16, 17, 17, 17, 17, 17, 17,
+ 17, 50, 46, 52, 17, 17, 17, 17, 17, 17,
+
+ 45, 53, 54, 45, 46, 777, 758, 51, 55, 51,
+ 84, 84, 84, 84, 84, 84, 84, 741, 711, 46,
+ 57, 17, 17, 17, 17, 17, 17, 18, 18, 18,
+ 18, 18, 18, 18, 51, 55, 51, 18, 18, 18,
+ 18, 18, 18, 38, 43, 47, 58, 57, 38, 47,
+ 43, 58, 59, 60, 61, 62, 63, 64, 68, 66,
+ 65, 47, 63, 65, 18, 18, 18, 18, 18, 18,
+ 38, 43, 47, 58, 66, 38, 47, 43, 58, 59,
+ 60, 61, 62, 63, 64, 68, 66, 65, 47, 63,
+ 65, 67, 70, 69, 72, 67, 69, 73, 74, 73,
+
+ 75, 66, 76, 77, 75, 706, 78, 67, 78, 74,
+ 705, 81, 74, 86, 701, 74, 75, 700, 67, 70,
+ 69, 72, 67, 69, 73, 74, 73, 75, 80, 76,
+ 77, 75, 80, 78, 67, 78, 74, 79, 81, 74,
+ 86, 82, 74, 75, 80, 83, 87, 85, 79, 85,
+ 88, 79, 89, 699, 79, 80, 82, 689, 99, 80,
+ 83, 687, 683, 651, 79, 625, 611, 582, 82, 100,
+ 558, 80, 83, 87, 85, 79, 85, 88, 79, 89,
+ 93, 79, 93, 82, 96, 99, 96, 83, 91, 91,
+ 91, 91, 91, 91, 91, 92, 100, 92, 91, 91,
+
+ 91, 91, 91, 91, 94, 101, 94, 93, 95, 93,
+ 95, 96, 94, 96, 92, 98, 102, 98, 545, 113,
+ 536, 95, 92, 527, 92, 91, 91, 91, 91, 91,
+ 91, 94, 101, 94, 506, 95, 106, 95, 106, 94,
+ 501, 92, 98, 102, 98, 105, 113, 105, 95, 97,
+ 97, 97, 97, 97, 97, 97, 104, 104, 104, 104,
+ 104, 104, 104, 106, 105, 106, 104, 104, 104, 104,
+ 104, 104, 105, 107, 105, 107, 108, 109, 108, 109,
+ 116, 107, 112, 112, 112, 112, 112, 112, 112, 108,
+ 117, 105, 118, 104, 104, 104, 104, 104, 104, 120,
+
+ 107, 121, 107, 108, 109, 108, 109, 116, 107, 119,
+ 122, 488, 123, 124, 119, 125, 108, 117, 126, 118,
+ 122, 127, 486, 128, 129, 130, 120, 131, 121, 132,
+ 133, 134, 135, 136, 138, 126, 119, 122, 123, 124,
+ 140, 119, 125, 143, 144, 126, 145, 122, 127, 128,
+ 146, 129, 130, 147, 131, 146, 132, 133, 134, 135,
+ 136, 138, 126, 148, 149, 464, 150, 140, 151, 152,
+ 143, 144, 153, 145, 149, 154, 128, 146, 155, 156,
+ 147, 157, 146, 158, 159, 160, 161, 162, 163, 153,
+ 148, 149, 150, 164, 151, 166, 152, 462, 169, 153,
+
+ 170, 149, 154, 171, 155, 172, 156, 174, 157, 173,
+ 158, 159, 160, 161, 162, 163, 153, 176, 168, 177,
+ 164, 178, 166, 168, 168, 169, 173, 170, 179, 181,
+ 171, 155, 172, 175, 174, 180, 173, 182, 175, 175,
+ 182, 425, 388, 385, 176, 168, 177, 364, 178, 186,
+ 168, 168, 180, 173, 183, 179, 181, 183, 188, 189,
+ 175, 189, 180, 195, 182, 175, 175, 182, 184, 184,
+ 184, 184, 184, 184, 184, 190, 186, 190, 197, 180,
+ 191, 183, 361, 355, 183, 188, 189, 191, 189, 191,
+ 195, 192, 354, 192, 193, 193, 193, 193, 193, 193,
+
+ 193, 204, 190, 192, 190, 197, 198, 199, 198, 199,
+ 200, 201, 205, 201, 191, 206, 191, 200, 192, 200,
+ 192, 207, 208, 201, 209, 210, 211, 212, 204, 213,
+ 192, 214, 215, 198, 199, 198, 199, 216, 201, 205,
+ 201, 217, 206, 218, 200, 219, 200, 220, 207, 208,
+ 201, 209, 210, 211, 212, 221, 213, 222, 214, 215,
+ 223, 225, 226, 227, 216, 229, 230, 233, 217, 234,
+ 218, 235, 219, 236, 220, 237, 238, 239, 240, 241,
+ 242, 243, 221, 244, 222, 245, 246, 223, 225, 226,
+ 227, 247, 229, 230, 233, 248, 234, 249, 235, 250,
+
+ 236, 251, 237, 238, 239, 240, 241, 242, 243, 252,
+ 244, 254, 245, 246, 255, 256, 259, 260, 247, 263,
+ 265, 267, 248, 266, 249, 268, 250, 267, 251, 270,
+ 272, 329, 273, 274, 275, 276, 252, 277, 254, 274,
+ 324, 255, 256, 259, 260, 286, 263, 265, 267, 266,
+ 287, 280, 268, 280, 288, 289, 270, 272, 273, 290,
+ 274, 275, 276, 281, 277, 281, 284, 285, 284, 285,
+ 293, 294, 286, 295, 296, 299, 300, 287, 280, 301,
+ 280, 288, 289, 304, 305, 306, 290, 307, 308, 309,
+ 281, 310, 281, 284, 285, 284, 285, 293, 294, 311,
+
+ 295, 296, 299, 300, 312, 313, 301, 314, 315, 316,
+ 304, 305, 306, 319, 307, 308, 309, 320, 310, 321,
+ 322, 325, 326, 327, 330, 331, 311, 332, 333, 334,
+ 318, 312, 313, 336, 314, 315, 316, 317, 337, 303,
+ 319, 339, 340, 341, 320, 298, 321, 322, 325, 326,
+ 327, 330, 331, 342, 332, 333, 334, 335, 292, 344,
+ 336, 345, 346, 347, 335, 337, 335, 335, 339, 340,
+ 341, 348, 335, 349, 351, 352, 353, 356, 357, 335,
+ 342, 335, 335, 335, 335, 335, 344, 358, 345, 346,
+ 347, 335, 359, 335, 335, 360, 362, 363, 348, 335,
+
+ 349, 351, 352, 353, 356, 357, 335, 365, 335, 335,
+ 335, 335, 335, 366, 358, 367, 369, 372, 373, 359,
+ 374, 375, 360, 362, 363, 376, 377, 379, 380, 381,
+ 382, 383, 384, 386, 365, 387, 389, 390, 392, 394,
+ 366, 395, 367, 369, 372, 373, 396, 374, 375, 397,
+ 398, 399, 376, 377, 379, 380, 381, 382, 383, 384,
+ 386, 402, 387, 389, 390, 392, 394, 404, 395, 400,
+ 400, 401, 403, 396, 401, 405, 397, 398, 399, 406,
+ 407, 408, 409, 403, 411, 412, 413, 414, 402, 417,
+ 418, 419, 420, 423, 404, 424, 400, 400, 401, 427,
+
+ 429, 401, 405, 430, 432, 433, 406, 407, 408, 409,
+ 403, 411, 412, 413, 414, 434, 417, 418, 419, 420,
+ 423, 435, 424, 436, 437, 438, 427, 429, 439, 440,
+ 430, 432, 433, 441, 442, 443, 444, 447, 449, 450,
+ 451, 452, 434, 453, 454, 455, 456, 458, 435, 457,
+ 436, 437, 438, 459, 439, 460, 440, 461, 463, 465,
+ 441, 442, 443, 444, 447, 449, 450, 451, 452, 466,
+ 453, 454, 455, 456, 458, 457, 466, 467, 468, 469,
+ 459, 470, 460, 471, 461, 463, 465, 472, 473, 474,
+ 475, 477, 478, 479, 480, 481, 466, 482, 483, 484,
+
+ 485, 492, 493, 466, 467, 468, 469, 494, 470, 495,
+ 471, 496, 497, 498, 472, 473, 474, 475, 477, 478,
+ 479, 480, 481, 500, 482, 483, 484, 485, 492, 493,
+ 502, 503, 504, 508, 494, 509, 495, 510, 496, 497,
+ 498, 511, 512, 513, 515, 516, 517, 518, 519, 520,
+ 500, 521, 522, 524, 525, 523, 529, 502, 503, 504,
+ 508, 523, 509, 291, 510, 530, 531, 532, 511, 512,
+ 513, 515, 516, 517, 518, 519, 520, 528, 521, 522,
+ 524, 525, 523, 529, 533, 534, 537, 538, 523, 539,
+ 528, 541, 530, 531, 532, 542, 544, 547, 271, 550,
+
+ 551, 552, 553, 555, 528, 554, 556, 557, 560, 563,
+ 564, 533, 534, 537, 538, 565, 539, 528, 541, 566,
+ 567, 568, 542, 544, 547, 550, 569, 551, 552, 553,
+ 555, 554, 570, 556, 557, 560, 563, 564, 571, 572,
+ 573, 565, 574, 575, 576, 577, 566, 567, 568, 578,
+ 579, 580, 581, 569, 583, 584, 585, 586, 588, 570,
+ 589, 269, 264, 262, 261, 571, 572, 573, 592, 574,
+ 575, 576, 577, 593, 594, 596, 578, 579, 580, 581,
+ 597, 583, 584, 585, 586, 588, 598, 589, 591, 591,
+ 591, 591, 591, 591, 591, 592, 600, 602, 603, 604,
+
+ 593, 594, 596, 605, 606, 608, 610, 597, 612, 613,
+ 614, 615, 616, 598, 617, 618, 619, 620, 622, 623,
+ 626, 627, 628, 600, 602, 603, 604, 629, 630, 635,
+ 605, 606, 608, 610, 624, 612, 613, 614, 615, 616,
+ 258, 617, 618, 619, 620, 622, 623, 626, 627, 628,
+ 624, 253, 224, 196, 629, 630, 635, 187, 167, 636,
+ 631, 624, 631, 631, 631, 631, 631, 631, 631, 669,
+ 669, 669, 669, 669, 669, 669, 632, 624, 632, 632,
+ 632, 632, 632, 632, 632, 633, 636, 633, 633, 633,
+ 633, 633, 633, 633, 634, 637, 634, 634, 634, 634,
+
+ 634, 634, 634, 639, 640, 641, 642, 643, 644, 646,
+ 647, 648, 649, 650, 652, 653, 654, 165, 655, 656,
+ 657, 658, 637, 659, 660, 661, 662, 663, 664, 665,
+ 639, 640, 641, 642, 643, 644, 646, 647, 648, 649,
+ 650, 652, 653, 654, 655, 666, 656, 657, 658, 659,
+ 667, 660, 661, 662, 663, 664, 665, 668, 670, 141,
+ 670, 670, 670, 670, 670, 670, 670, 137, 114, 23,
+ 19, 0, 666, 0, 0, 684, 0, 667, 0, 0,
+ 0, 0, 0, 671, 668, 671, 671, 671, 671, 671,
+ 671, 671, 672, 685, 672, 672, 672, 672, 672, 672,
+
+ 672, 673, 684, 673, 673, 673, 673, 673, 673, 673,
+ 674, 686, 674, 674, 674, 674, 674, 674, 674, 675,
+ 685, 675, 675, 675, 675, 675, 675, 675, 676, 690,
+ 676, 676, 676, 676, 676, 676, 676, 677, 686, 677,
+ 677, 677, 677, 677, 677, 677, 678, 691, 678, 678,
+ 678, 678, 678, 678, 678, 679, 690, 679, 679, 679,
+ 679, 679, 679, 679, 680, 692, 680, 680, 680, 680,
+ 680, 680, 680, 681, 691, 681, 681, 681, 681, 681,
+ 681, 681, 682, 694, 682, 682, 682, 682, 682, 682,
+ 682, 695, 692, 696, 697, 698, 702, 703, 704, 707,
+
+ 708, 709, 710, 712, 713, 714, 0, 732, 0, 715,
+ 694, 715, 715, 715, 715, 715, 715, 715, 695, 0,
+ 696, 697, 698, 702, 703, 704, 707, 708, 709, 710,
+ 712, 713, 714, 716, 732, 716, 716, 716, 716, 716,
+ 716, 716, 717, 733, 717, 717, 717, 717, 717, 717,
+ 717, 718, 734, 718, 718, 718, 718, 718, 718, 718,
+ 719, 735, 719, 719, 719, 719, 719, 719, 719, 720,
+ 733, 720, 720, 720, 720, 720, 720, 720, 721, 734,
+ 721, 721, 721, 721, 721, 721, 721, 722, 735, 722,
+ 722, 722, 722, 722, 722, 722, 723, 736, 723, 723,
+
+ 723, 723, 723, 723, 723, 724, 737, 724, 724, 724,
+ 724, 724, 724, 724, 725, 738, 725, 725, 725, 725,
+ 725, 725, 725, 726, 736, 726, 726, 726, 726, 726,
+ 726, 726, 727, 737, 727, 727, 727, 727, 727, 727,
+ 727, 728, 738, 728, 728, 728, 728, 728, 728, 728,
+ 729, 739, 729, 729, 729, 729, 729, 729, 729, 730,
+ 740, 730, 730, 730, 730, 730, 730, 730, 731, 742,
+ 731, 731, 731, 731, 731, 731, 731, 743, 739, 744,
+ 745, 746, 747, 748, 749, 750, 751, 740, 752, 753,
+ 754, 755, 756, 757, 759, 760, 742, 761, 0, 0,
+
+ 0, 0, 0, 0, 743, 0, 744, 745, 746, 747,
+ 748, 749, 750, 751, 0, 752, 753, 754, 755, 756,
+ 757, 759, 760, 0, 761, 762, 762, 762, 762, 762,
+ 762, 762, 763, 776, 763, 763, 763, 763, 763, 763,
+ 763, 764, 780, 764, 764, 764, 764, 764, 764, 764,
+ 765, 781, 765, 765, 765, 765, 765, 765, 765, 766,
+ 776, 766, 766, 766, 766, 766, 766, 766, 767, 780,
+ 767, 767, 767, 767, 767, 767, 767, 768, 781, 768,
+ 768, 768, 768, 768, 768, 768, 769, 785, 769, 769,
+ 769, 769, 769, 769, 769, 770, 0, 770, 770, 770,
+
+ 770, 770, 770, 770, 771, 0, 771, 771, 771, 771,
+ 771, 771, 771, 772, 785, 772, 772, 772, 772, 772,
+ 772, 772, 773, 778, 773, 773, 773, 773, 773, 773,
+ 773, 774, 783, 774, 774, 774, 774, 774, 774, 774,
+ 775, 786, 775, 775, 775, 775, 775, 775, 775, 778,
+ 788, 790, 791, 792, 793, 795, 796, 797, 783, 798,
+ 799, 800, 0, 823, 0, 0, 0, 806, 786, 806,
+ 806, 806, 806, 806, 806, 806, 0, 788, 790, 791,
+ 792, 793, 795, 796, 797, 0, 798, 799, 800, 807,
+ 823, 807, 807, 807, 807, 807, 807, 807, 808, 826,
+
+ 808, 808, 808, 808, 808, 808, 808, 809, 827, 809,
+ 809, 809, 809, 809, 809, 809, 810, 829, 810, 810,
+ 810, 810, 810, 810, 810, 811, 826, 811, 811, 811,
+ 811, 811, 811, 811, 812, 827, 812, 812, 812, 812,
+ 812, 812, 812, 813, 829, 813, 813, 813, 813, 813,
+ 813, 813, 814, 830, 814, 814, 814, 814, 814, 814,
+ 814, 815, 831, 815, 815, 815, 815, 815, 815, 815,
+ 816, 833, 816, 816, 816, 816, 816, 816, 816, 817,
+ 830, 817, 817, 817, 817, 817, 817, 817, 818, 831,
+ 818, 818, 818, 818, 818, 818, 818, 819, 833, 819,
+
+ 819, 819, 819, 819, 819, 819, 820, 834, 820, 820,
+ 820, 820, 820, 820, 820, 821, 835, 821, 821, 821,
+ 821, 821, 821, 821, 822, 836, 822, 822, 822, 822,
+ 822, 822, 822, 837, 834, 838, 839, 840, 841, 842,
+ 843, 844, 0, 835, 846, 846, 846, 846, 846, 846,
+ 846, 847, 836, 847, 847, 847, 847, 847, 847, 847,
+ 837, 860, 838, 839, 840, 841, 842, 843, 844, 848,
+ 861, 848, 848, 848, 848, 848, 848, 848, 849, 862,
+ 849, 849, 849, 849, 849, 849, 849, 850, 860, 850,
+ 850, 850, 850, 850, 850, 850, 851, 861, 851, 851,
+
+ 851, 851, 851, 851, 851, 852, 862, 852, 852, 852,
+ 852, 852, 852, 852, 853, 863, 853, 853, 853, 853,
+ 853, 853, 853, 854, 864, 854, 854, 854, 854, 854,
+ 854, 854, 855, 865, 855, 855, 855, 855, 855, 855,
+ 855, 856, 863, 856, 856, 856, 856, 856, 856, 856,
+ 857, 864, 857, 857, 857, 857, 857, 857, 857, 858,
+ 865, 858, 858, 858, 858, 858, 858, 858, 859, 866,
+ 859, 859, 859, 859, 859, 859, 859, 867, 868, 0,
+ 869, 870, 871, 872, 874, 875, 876, 877, 878, 879,
+ 880, 0, 0, 0, 0, 885, 866, 885, 885, 885,
+
+ 885, 885, 885, 885, 867, 868, 869, 0, 870, 871,
+ 872, 874, 875, 876, 877, 878, 879, 880, 881, 881,
+ 881, 881, 881, 881, 881, 881, 881, 881, 882, 882,
+ 882, 882, 882, 882, 882, 882, 882, 882, 883, 883,
+ 883, 883, 883, 883, 883, 883, 883, 883, 884, 884,
+ 884, 884, 884, 884, 884, 884, 884, 884, 886, 899,
+ 886, 886, 886, 886, 886, 886, 886, 887, 900, 887,
+ 887, 887, 887, 887, 887, 887, 888, 902, 888, 888,
+ 888, 888, 888, 888, 888, 889, 899, 889, 889, 889,
+ 889, 889, 889, 889, 890, 900, 890, 890, 890, 890,
+
+ 890, 890, 890, 891, 902, 891, 891, 891, 891, 891,
+ 891, 891, 892, 903, 892, 892, 892, 892, 892, 892,
+ 892, 893, 905, 893, 893, 893, 893, 893, 893, 893,
+ 894, 906, 894, 894, 894, 894, 894, 894, 894, 895,
+ 903, 895, 895, 895, 895, 895, 895, 895, 896, 905,
+ 896, 896, 896, 896, 896, 896, 896, 897, 906, 897,
+ 897, 897, 897, 897, 897, 897, 907, 908, 911, 913,
+ 914, 915, 917, 918, 918, 918, 918, 918, 918, 918,
+ 919, 919, 919, 919, 919, 919, 919, 0, 0, 0,
+ 0, 0, 0, 907, 908, 911, 913, 914, 915, 917,
+
+ 934, 935, 936, 937, 938, 918, 920, 920, 920, 920,
+ 920, 920, 920, 920, 920, 920, 921, 921, 921, 921,
+ 921, 921, 921, 921, 921, 921, 0, 934, 935, 936,
+ 937, 938, 918, 922, 922, 922, 922, 922, 922, 922,
+ 922, 922, 922, 923, 923, 923, 923, 923, 923, 923,
+ 923, 923, 923, 924, 924, 924, 924, 924, 924, 924,
+ 924, 924, 924, 925, 925, 925, 925, 925, 925, 925,
+ 925, 925, 925, 926, 926, 926, 926, 926, 926, 926,
+ 926, 926, 926, 927, 927, 927, 927, 927, 927, 927,
+ 927, 927, 927, 928, 928, 928, 928, 928, 928, 928,
+
+ 928, 928, 928, 929, 929, 929, 929, 929, 929, 929,
+ 929, 929, 929, 930, 930, 930, 930, 930, 930, 930,
+ 930, 930, 930, 931, 931, 931, 931, 931, 931, 931,
+ 931, 931, 931, 932, 932, 932, 932, 932, 932, 932,
+ 932, 932, 932, 939, 940, 941, 942, 943, 944, 945,
+ 946, 948, 948, 948, 948, 948, 948, 948, 0, 0,
+ 966, 967, 968, 969, 970, 971, 948, 0, 0, 0,
+ 939, 940, 941, 942, 943, 944, 945, 946, 949, 949,
+ 949, 949, 949, 949, 949, 949, 949, 966, 967, 968,
+ 969, 970, 971, 948, 950, 950, 950, 950, 950, 950,
+
+ 950, 950, 950, 951, 951, 951, 951, 951, 951, 951,
+ 951, 951, 952, 952, 952, 952, 952, 952, 952, 952,
+ 952, 953, 953, 953, 953, 953, 953, 953, 953, 953,
+ 953, 954, 954, 954, 954, 954, 954, 954, 954, 954,
+ 954, 955, 955, 955, 955, 955, 955, 955, 955, 955,
+ 955, 956, 956, 956, 956, 956, 956, 956, 956, 956,
+ 956, 957, 957, 957, 957, 957, 957, 957, 957, 957,
+ 957, 958, 958, 958, 958, 958, 958, 958, 958, 958,
+ 958, 959, 959, 959, 959, 959, 959, 959, 959, 959,
+ 959, 960, 960, 960, 960, 960, 960, 960, 960, 960,
+
+ 960, 961, 961, 961, 961, 961, 961, 961, 961, 961,
+ 961, 962, 962, 962, 962, 962, 962, 962, 962, 962,
+ 962, 963, 963, 963, 963, 963, 963, 963, 963, 963,
+ 963, 964, 964, 964, 964, 964, 964, 964, 964, 964,
+ 964, 965, 965, 965, 965, 965, 965, 965, 965, 965,
+ 965, 973, 974, 975, 0, 978, 979, 979, 979, 979,
+ 979, 979, 979, 0, 1000, 1001, 1002, 1003, 1004, 979,
+ 1008, 1008, 1008, 1008, 1008, 1008, 1008, 0, 973, 974,
+ 975, 978, 980, 980, 980, 980, 980, 980, 980, 980,
+ 980, 1000, 1001, 1002, 1003, 1004, 979, 981, 981, 981,
+
+ 981, 981, 981, 981, 981, 981, 982, 982, 982, 982,
+ 982, 982, 982, 982, 982, 983, 983, 983, 983, 983,
+ 983, 983, 983, 983, 984, 984, 984, 984, 984, 984,
+ 984, 984, 984, 985, 985, 985, 985, 985, 985, 985,
+ 985, 985, 986, 986, 986, 986, 986, 986, 986, 986,
+ 986, 987, 987, 987, 987, 987, 987, 987, 987, 987,
+ 988, 988, 988, 988, 988, 988, 988, 988, 988, 989,
+ 989, 989, 989, 989, 989, 989, 989, 989, 990, 990,
+ 990, 990, 990, 990, 990, 990, 990, 991, 991, 991,
+ 991, 991, 991, 991, 991, 991, 992, 992, 992, 992,
+
+ 992, 992, 992, 992, 992, 993, 993, 993, 993, 993,
+ 993, 993, 993, 993, 994, 994, 994, 994, 994, 994,
+ 994, 994, 994, 995, 995, 995, 995, 995, 995, 995,
+ 995, 995, 996, 996, 996, 996, 996, 996, 996, 996,
+ 996, 1005, 1006, 1009, 1009, 1009, 1009, 1009, 1009, 1009,
+ 1009, 1009, 1010, 1010, 1010, 1010, 1010, 1010, 1010, 1010,
+ 1010, 1082, 1082, 1082, 1082, 1082, 1082, 1082, 1005, 1006,
+ 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1011, 1012,
+ 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1012, 1013, 1013,
+ 1013, 1013, 1013, 1013, 1013, 1013, 1013, 1014, 1014, 1014,
+
+ 1014, 1014, 1014, 1014, 1014, 1014, 1015, 1015, 1015, 1015,
+ 1015, 1015, 1015, 1015, 1015, 1016, 1016, 1016, 1016, 1016,
+ 1016, 1016, 1016, 1016, 1017, 1017, 1017, 1017, 1017, 1017,
+ 1017, 1017, 1017, 1018, 1018, 1018, 1018, 1018, 1018, 1018,
+ 1018, 1018, 1019, 1019, 1019, 1019, 1019, 1019, 1019, 1019,
+ 1019, 1020, 1020, 1020, 1020, 1020, 1020, 1020, 1020, 1020,
+ 1021, 1021, 1021, 1021, 1021, 1021, 1021, 1021, 1021, 1022,
+ 1022, 1022, 1022, 1022, 1022, 1022, 1022, 1022, 1023, 1023,
+ 1023, 1023, 1023, 1023, 1023, 1023, 1023, 1024, 1024, 1024,
+ 1024, 1024, 1024, 1024, 1024, 1024, 1025, 1025, 1025, 1025,
+
+ 1025, 1025, 1025, 1025, 1025, 1026, 1026, 1026, 1026, 1026,
+ 1026, 1026, 1026, 1026, 1027, 1027, 1027, 1027, 1027, 1027,
+ 1027, 1027, 1027, 1028, 1028, 1028, 1028, 1028, 1028, 1028,
+ 1028, 1028, 1029, 1029, 1029, 1029, 1029, 1029, 1029, 1029,
+ 1029, 1030, 1030, 1030, 1030, 1030, 1030, 1030, 1030, 1030,
+ 1031, 1031, 1031, 1031, 1031, 1031, 1031, 1031, 1031, 1032,
+ 1032, 1032, 1032, 1032, 1032, 1032, 1032, 1032, 1033, 1033,
+ 1033, 1033, 1033, 1033, 1033, 1033, 1033, 1034, 1034, 1034,
+ 1034, 1034, 1034, 1034, 1034, 1034, 1035, 1035, 1035, 1035,
+ 1035, 1035, 1035, 1035, 1035, 1036, 1036, 1036, 1036, 1036,
+
+ 1036, 1036, 1036, 1036, 1037, 1037, 1037, 1037, 1037, 1037,
+ 1037, 1037, 1037, 1038, 1038, 1038, 1038, 1038, 1038, 1038,
+ 1038, 1038, 1043, 0, 1044, 1046, 1047, 0, 1047, 1047,
+ 1047, 1047, 1047, 1047, 1047, 1048, 1048, 1048, 1048, 1048,
+ 1048, 1048, 1048, 1048, 0, 0, 0, 0, 0, 1043,
+ 1044, 0, 1046, 1049, 1049, 1049, 1049, 1049, 1049, 1049,
+ 1049, 1049, 1050, 1050, 1050, 1050, 1050, 1050, 1050, 1050,
+ 1050, 1051, 1051, 1051, 1051, 1051, 1051, 1051, 1051, 1051,
+ 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1052, 1053,
+ 1053, 1053, 1053, 1053, 1053, 1053, 1053, 1053, 1054, 1054,
+
+ 1054, 1054, 1054, 1054, 1054, 1054, 1054, 1055, 1055, 1055,
+ 1055, 1055, 1055, 1055, 1055, 1055, 1056, 1056, 1056, 1056,
+ 1056, 1056, 1056, 1056, 1056, 1057, 1057, 1057, 1057, 1057,
+ 1057, 1057, 1057, 1057, 1058, 1058, 1058, 1058, 1058, 1058,
+ 1058, 1058, 1058, 1059, 1059, 1059, 1059, 1059, 1059, 1059,
+ 1059, 1059, 1060, 1060, 1060, 1060, 1060, 1060, 1060, 1060,
+ 1060, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061, 1061,
+ 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1062, 1063,
+ 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1063, 1064, 1064,
+ 1064, 1064, 1064, 1064, 1064, 1064, 1064, 1065, 1065, 1065,
+
+ 1065, 1065, 1065, 1065, 1065, 1065, 1066, 1066, 1066, 1066,
+ 1066, 1066, 1066, 1066, 1066, 1067, 1067, 1067, 1067, 1067,
+ 1067, 1067, 1067, 1067, 1068, 1068, 1068, 1068, 1068, 1068,
+ 1068, 1068, 1068, 1069, 1069, 1069, 1069, 1069, 1069, 1069,
+ 1069, 1069, 1070, 1070, 1070, 1070, 1070, 1070, 1070, 1070,
+ 1070, 1071, 1071, 1071, 1071, 1071, 1071, 1071, 1071, 1071,
+ 1072, 1072, 1072, 1072, 1072, 1072, 1072, 1072, 1072, 1073,
+ 1073, 1073, 1073, 1073, 1073, 1073, 1073, 1073, 1074, 1074,
+ 1074, 1074, 1074, 1074, 1074, 1074, 1074, 1075, 1075, 1075,
+ 1075, 1075, 1075, 1075, 1075, 1075, 1076, 1076, 1076, 1076,
+
+ 1076, 1076, 1076, 1076, 1076, 1077, 1077, 1077, 1077, 1077,
+ 1077, 1077, 1077, 1077, 1078, 1079, 1081, 1083, 1083, 1083,
+ 1083, 1083, 1083, 1083, 1083, 1083, 1084, 1084, 1084, 1084,
+ 1084, 1084, 1084, 1084, 1084, 0, 0, 0, 0, 0,
+ 0, 1078, 1079, 1081, 1085, 1085, 1085, 1085, 1085, 1085,
+ 1085, 1085, 1085, 1086, 1086, 1086, 1086, 1086, 1086, 1086,
+ 1086, 1086, 1087, 1087, 1087, 1087, 1087, 1087, 1087, 1087,
+ 1087, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088, 1088,
+ 1089, 1089, 1089, 1089, 1089, 1089, 1089, 1089, 1089, 1090,
+ 1090, 1090, 1090, 1090, 1090, 1090, 1090, 1090, 1091, 1091,
+
+ 1091, 1091, 1091, 1091, 1091, 1091, 1091, 1092, 1092, 1092,
+ 1092, 1092, 1092, 1092, 1092, 1092, 1093, 1093, 1093, 1093,
+ 1093, 1093, 1093, 1093, 1093, 1094, 1094, 1094, 1094, 1094,
+ 1094, 1094, 1094, 1094, 1095, 1095, 1095, 1095, 1095, 1095,
+ 1095, 1095, 1095, 1096, 1096, 1096, 1096, 1096, 1096, 1096,
+ 1096, 1096, 1097, 1097, 1097, 1097, 1097, 1097, 1097, 1097,
+ 1097, 1098, 1098, 1098, 1098, 1098, 1098, 1098, 1098, 1098,
+ 1099, 1099, 1099, 1099, 1099, 1099, 1099, 1099, 1099, 1100,
+ 1100, 1100, 1100, 1100, 1100, 1100, 1100, 1100, 1101, 1101,
+ 1101, 1101, 1101, 1101, 1101, 1101, 1101, 1102, 1102, 1102,
+
+ 1102, 1102, 1102, 1102, 1102, 1102, 1103, 1103, 1103, 1103,
+ 1103, 1103, 1103, 1103, 1103, 1104, 1104, 1104, 1104, 1104,
+ 1104, 1104, 1104, 1104, 1105, 1105, 1105, 1105, 1105, 1105,
+ 1105, 1105, 1105, 1106, 1106, 1106, 1106, 1106, 1106, 1106,
+ 1106, 1106, 1107, 1107, 1107, 1107, 1107, 1107, 1107, 1107,
+ 1107, 1108, 1108, 1108, 1108, 1108, 1108, 1108, 1108, 1108,
+ 1109, 1109, 1109, 1109, 1109, 1109, 1109, 1109, 1109, 1110,
+ 1110, 1110, 1110, 1110, 1110, 1110, 1110, 1110, 1111, 1111,
+ 1111, 1111, 1111, 1111, 1111, 1111, 1111, 1112, 1112, 1112,
+ 1112, 1112, 1112, 1112, 1112, 1112, 1113, 1115, 1116, 1117,
+
+ 1117, 1117, 1117, 1117, 1117, 1117, 1117, 1117, 1118, 1119,
+ 1120, 1121, 1121, 1121, 1121, 1121, 1121, 1121, 1122, 1123,
+ 1124, 1126, 1127, 1113, 1115, 1116, 1125, 1125, 1125, 1125,
+ 1125, 1125, 1125, 1128, 1130, 1118, 1119, 1120, 1132, 1121,
+ 0, 0, 0, 0, 0, 1122, 1123, 1124, 1126, 1127,
+ 0, 0, 0, 0, 1135, 1125, 0, 1137, 0, 0,
+ 1128, 1130, 0, 0, 0, 1132, 1121, 1129, 1129, 1129,
+ 1129, 1129, 1129, 1129, 1133, 1133, 1133, 1133, 1133, 1133,
+ 1133, 1135, 1125, 1137, 0, 0, 0, 0, 1133, 0,
+ 0, 0, 0, 0, 1129, 1136, 1136, 1136, 1136, 1136,
+
+ 1136, 1136, 0, 0, 0, 1136, 1138, 1138, 1138, 1138,
+ 1138, 1138, 1138, 0, 0, 1133, 0, 0, 0, 0,
+ 0, 1129, 0, 0, 0, 0, 0, 0, 1138, 0,
+ 0, 0, 1136, 1140, 1140, 1140, 1140, 1140, 1140, 1140,
+ 1141, 1141, 1141, 1141, 1141, 1141, 1141, 0, 0, 0,
+ 0, 1140, 0, 1141, 0, 1138, 1142, 1142, 1142, 1142,
+ 1142, 1142, 1142, 0, 0, 1142, 1143, 1143, 1143, 1143,
+ 1143, 1143, 1143, 0, 0, 0, 0, 0, 1140, 1144,
+ 1141, 1144, 1144, 1144, 1144, 1144, 1144, 1144, 1145, 0,
+ 1145, 1145, 1145, 1145, 1145, 1145, 1145, 1147, 1147, 1147,
+
+ 1147, 1147, 1147, 1148, 1148, 1148, 1148, 1148, 1148, 1149,
+ 1149, 1150, 1150, 0, 0, 1150, 1150, 1153, 0, 0,
+ 1153, 1153, 1153, 1146, 1146, 1146, 1146, 1146, 1146, 1146,
+ 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146,
+ 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146,
+ 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146,
+ 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146,
+ 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146,
+ 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146, 1146,
+ 1146, 1146, 1146, 1146, 1146, 1146
+
+ } ;
+
+/* The intent behind this definition is that it'll catch
+ * any uses of REJECT which flex missed.
+ */
+#define REJECT reject_used_but_not_detected
+#define yymore() yymore_used_but_not_detected
+#define YY_MORE_ADJ 0
+#define YY_RESTORE_YY_MORE_OFFSET
+
+#include <string>
+
+#include "parser.h"
+#define yyterminate() return(END)
+
+#define INITIAL 0
+#define MATCH_STRING_STATE 1
+#define MATCH_RESPONSE_CODE_STATE 2
+#define SUPPORTED_METHODS_STATE 3
+#define CONTENT_TYPE_STATE 4
+#define SESSION_STATE 5
+#define MATCH_PRESENTATION_URL 6
+#define NUM_AS_HEX_MODE 7
+#define MATCH_EDID_STATE 8
+
+#ifndef YY_NO_UNISTD_H
+/* Special case for "unistd.h", since it is non-ANSI. We include it way
+ * down here because we want the user's section 1 to have been scanned first.
+ * The user has a chance to override it with an option.
+ */
+#include <unistd.h>
+#endif
+
+#define YY_EXTRA_TYPE bool
+
+/* Holds the entire state of the reentrant scanner. */
+struct yyguts_t
+ {
+
+ /* User-defined. Not touched by flex. */
+ YY_EXTRA_TYPE yyextra_r;
+
+ /* The rest are the same as the globals declared in the non-reentrant scanner. */
+ FILE *yyin_r, *yyout_r;
+ size_t yy_buffer_stack_top; /**< index of top of stack. */
+ size_t yy_buffer_stack_max; /**< capacity of stack. */
+ YY_BUFFER_STATE * yy_buffer_stack; /**< Stack as an array. */
+ char yy_hold_char;
+ int yy_n_chars;
+ int yyleng_r;
+ char *yy_c_buf_p;
+ int yy_init;
+ int yy_start;
+ int yy_did_buffer_switch_on_eof;
+ int yy_start_stack_ptr;
+ int yy_start_stack_depth;
+ int *yy_start_stack;
+ yy_state_type yy_last_accepting_state;
+ char* yy_last_accepting_cpos;
+
+ int yylineno_r;
+ int yy_flex_debug_r;
+
+ char *yytext_r;
+ int yy_more_flag;
+ int yy_more_len;
+
+ YYSTYPE * yylval_r;
+
+ }; /* end struct yyguts_t */
+
+static int yy_init_globals (yyscan_t yyscanner );
+
+ /* This must go here because YYSTYPE and YYLTYPE are included
+ * from bison output in section 1.*/
+ # define yylval yyg->yylval_r
+
+int message_lex_init (yyscan_t* scanner);
+
+int message_lex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner);
+
+/* Accessor methods to globals.
+ These are made visible to non-reentrant scanners for convenience. */
+
+int message_lex_destroy (yyscan_t yyscanner );
+
+int message_get_debug (yyscan_t yyscanner );
+
+void message_set_debug (int debug_flag ,yyscan_t yyscanner );
+
+YY_EXTRA_TYPE message_get_extra (yyscan_t yyscanner );
+
+void message_set_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner );
+
+FILE *message_get_in (yyscan_t yyscanner );
+
+void message_set_in (FILE * in_str ,yyscan_t yyscanner );
+
+FILE *message_get_out (yyscan_t yyscanner );
+
+void message_set_out (FILE * out_str ,yyscan_t yyscanner );
+
+int message_get_leng (yyscan_t yyscanner );
+
+char *message_get_text (yyscan_t yyscanner );
+
+int message_get_lineno (yyscan_t yyscanner );
+
+void message_set_lineno (int line_number ,yyscan_t yyscanner );
+
+YYSTYPE * message_get_lval (yyscan_t yyscanner );
+
+void message_set_lval (YYSTYPE * yylval_param ,yyscan_t yyscanner );
+
+/* Macros after this point can all be overridden by user definitions in
+ * section 1.
+ */
+
+#ifndef YY_SKIP_YYWRAP
+#ifdef __cplusplus
+extern "C" int message_wrap (yyscan_t yyscanner );
+#else
+extern int message_wrap (yyscan_t yyscanner );
+#endif
+#endif
+
+#ifndef yytext_ptr
+static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner);
+#endif
+
+#ifdef YY_NEED_STRLEN
+static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner);
+#endif
+
+#ifndef YY_NO_INPUT
+
+#ifdef __cplusplus
+static int yyinput (yyscan_t yyscanner );
+#else
+static int input (yyscan_t yyscanner );
+#endif
+
+#endif
+
+/* Amount of stuff to slurp up with each read. */
+#ifndef YY_READ_BUF_SIZE
+#ifdef __ia64__
+/* On IA-64, the buffer size is 16k, not 8k */
+#define YY_READ_BUF_SIZE 16384
+#else
+#define YY_READ_BUF_SIZE 8192
+#endif /* __ia64__ */
+#endif
+
+/* Copy whatever the last rule matched to the standard output. */
+#ifndef ECHO
+/* This used to be an fputs(), but since the string might contain NUL's,
+ * we now use fwrite().
+ */
+#define ECHO do { if (fwrite( yytext, yyleng, 1, yyout )) {} } while (0)
+#endif
+
+/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
+ * is returned in "result".
+ */
+#ifndef YY_INPUT
+#define YY_INPUT(buf,result,max_size) \
+ if ( YY_CURRENT_BUFFER_LVALUE->yy_is_interactive ) \
+ { \
+ int c = '*'; \
+ size_t n; \
+ for ( n = 0; n < max_size && \
+ (c = getc( yyin )) != EOF && c != '\n'; ++n ) \
+ buf[n] = (char) c; \
+ if ( c == '\n' ) \
+ buf[n++] = (char) c; \
+ if ( c == EOF && ferror( yyin ) ) \
+ YY_FATAL_ERROR( "input in flex scanner failed" ); \
+ result = n; \
+ } \
+ else \
+ { \
+ errno=0; \
+ while ( (result = fread(buf, 1, max_size, yyin))==0 && ferror(yyin)) \
+ { \
+ if( errno != EINTR) \
+ { \
+ YY_FATAL_ERROR( "input in flex scanner failed" ); \
+ break; \
+ } \
+ errno=0; \
+ clearerr(yyin); \
+ } \
+ }\
+\
+
+#endif
+
+/* No semi-colon after return; correct usage is to write "yyterminate();" -
+ * we don't want an extra ';' after the "return" because that will cause
+ * some compilers to complain about unreachable statements.
+ */
+#ifndef yyterminate
+#define yyterminate() return YY_NULL
+#endif
+
+/* Number of entries by which start-condition stack grows. */
+#ifndef YY_START_STACK_INCR
+#define YY_START_STACK_INCR 25
+#endif
+
+/* Report a fatal error. */
+#ifndef YY_FATAL_ERROR
+#define YY_FATAL_ERROR(msg) yy_fatal_error( msg , yyscanner)
+#endif
+
+/* end tables serialization structures and prototypes */
+
+/* Default declaration of generated scanner - a define so the user can
+ * easily add parameters.
+ */
+#ifndef YY_DECL
+#define YY_DECL_IS_OURS 1
+
+extern int message_lex \
+ (YYSTYPE * yylval_param ,yyscan_t yyscanner);
+
+#define YY_DECL int message_lex \
+ (YYSTYPE * yylval_param , yyscan_t yyscanner)
+#endif /* !YY_DECL */
+
+/* Code executed at the beginning of each rule, after yytext and yyleng
+ * have been set up.
+ */
+#ifndef YY_USER_ACTION
+#define YY_USER_ACTION
+#endif
+
+/* Code executed at the end of each rule. */
+#ifndef YY_BREAK
+#define YY_BREAK break;
+#endif
+
+#define YY_RULE_SETUP \
+ if ( yyleng > 0 ) \
+ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = \
+ (yytext[yyleng - 1] == '\n'); \
+ YY_USER_ACTION
+
+/** The main scanner function which does all the work.
+ */
+YY_DECL
+{
+ register yy_state_type yy_current_state;
+ register char *yy_cp, *yy_bp;
+ register int yy_act;
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+
+ yylval = yylval_param;
+
+ if ( !yyg->yy_init )
+ {
+ yyg->yy_init = 1;
+
+#ifdef YY_USER_INIT
+ YY_USER_INIT;
+#endif
+
+ if ( ! yyg->yy_start )
+ yyg->yy_start = 1; /* first start state */
+
+ if ( ! yyin )
+ yyin = stdin;
+
+ if ( ! yyout )
+ yyout = stdout;
+
+ if ( ! YY_CURRENT_BUFFER ) {
+ message_ensure_buffer_stack (yyscanner);
+ YY_CURRENT_BUFFER_LVALUE =
+ message__create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
+ }
+
+ message__load_buffer_state(yyscanner );
+ }
+
+ while ( 1 ) /* loops until end-of-file is reached */
+ {
+ yy_cp = yyg->yy_c_buf_p;
+
+ /* Support of yytext. */
+ *yy_cp = yyg->yy_hold_char;
+
+ /* yy_bp points to the position in yy_ch_buf of the start of
+ * the current run.
+ */
+ yy_bp = yy_cp;
+
+ yy_current_state = yyg->yy_start;
+ yy_current_state += YY_AT_BOL();
+yy_match:
+ do
+ {
+ register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
+ if ( yy_accept[yy_current_state] )
+ {
+ yyg->yy_last_accepting_state = yy_current_state;
+ yyg->yy_last_accepting_cpos = yy_cp;
+ }
+ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+ {
+ yy_current_state = (int) yy_def[yy_current_state];
+ if ( yy_current_state >= 1147 )
+ yy_c = yy_meta[(unsigned int) yy_c];
+ }
+ yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+ ++yy_cp;
+ }
+ while ( yy_current_state != 1146 );
+ yy_cp = yyg->yy_last_accepting_cpos;
+ yy_current_state = yyg->yy_last_accepting_state;
+
+yy_find_action:
+ yy_act = yy_accept[yy_current_state];
+
+ YY_DO_BEFORE_ACTION;
+
+do_action: /* This label is used only to access EOF actions. */
+
+ switch ( yy_act )
+ { /* beginning of action switch */
+ case 0: /* must back up */
+ /* undo the effects of YY_DO_BEFORE_ACTION */
+ *yy_cp = yyg->yy_hold_char;
+ yy_cp = yyg->yy_last_accepting_cpos;
+ yy_current_state = yyg->yy_last_accepting_state;
+ goto yy_find_action;
+
+case 1:
+/* rule 1 can match eol */
+YY_RULE_SETUP
+{ BEGIN(INITIAL); }
+ YY_BREAK
+case 2:
+/* rule 2 can match eol */
+YY_RULE_SETUP
+{ BEGIN(INITIAL); }
+ YY_BREAK
+case 3:
+YY_RULE_SETUP
+{ BEGIN(INITIAL); }
+ YY_BREAK
+/* Convert these */
+case 4:
+YY_RULE_SETUP
+{ return '='; }
+ YY_BREAK
+case 5:
+YY_RULE_SETUP
+{ return '-'; }
+ YY_BREAK
+case 6:
+YY_RULE_SETUP
+{ return ','; }
+ YY_BREAK
+case 7:
+YY_RULE_SETUP
+{ return '*'; }
+ YY_BREAK
+case 8:
+YY_RULE_SETUP
+{ return ';'; }
+ YY_BREAK
+case 9:
+YY_RULE_SETUP
+{ return ':'; }
+ YY_BREAK
+case 10:
+YY_RULE_SETUP
+{ return '/'; }
+ YY_BREAK
+case 11:
+YY_RULE_SETUP
+return WFD_SP;
+ YY_BREAK
+case 12:
+YY_RULE_SETUP
+return WFD_NONE;
+ YY_BREAK
+case 13:
+YY_RULE_SETUP
+return WFD_AUDIO_CODEC_LPCM;
+ YY_BREAK
+case 14:
+YY_RULE_SETUP
+return WFD_AUDIO_CODEC_AAC;
+ YY_BREAK
+case 15:
+YY_RULE_SETUP
+return WFD_AUDIO_CODEC_AC3;
+ YY_BREAK
+case 16:
+YY_RULE_SETUP
+return WFD_HDCP_SPEC_2_0;
+ YY_BREAK
+case 17:
+YY_RULE_SETUP
+return WFD_HDCP_SPEC_2_1;
+ YY_BREAK
+case 18:
+YY_RULE_SETUP
+return WFD_IP_PORT;
+ YY_BREAK
+case 19:
+YY_RULE_SETUP
+return WFD_STREAM_PROFILE;
+ YY_BREAK
+case 20:
+YY_RULE_SETUP
+return WFD_MODE_PLAY;
+ YY_BREAK
+case 21:
+YY_RULE_SETUP
+return WFD_ROUTE_PRIMARY;
+ YY_BREAK
+case 22:
+YY_RULE_SETUP
+return WFD_ROUTE_SECONDARY;
+ YY_BREAK
+case 23:
+YY_RULE_SETUP
+return WFD_INPUT_CATEGORY_LIST;
+ YY_BREAK
+case 24:
+YY_RULE_SETUP
+return WFD_INPUT_CATEGORY_GENERIC;
+ YY_BREAK
+case 25:
+YY_RULE_SETUP
+return WFD_INPUT_CATEGORY_HIDC;
+ YY_BREAK
+case 26:
+YY_RULE_SETUP
+return WFD_GENERIC_CAP_LIST;
+ YY_BREAK
+case 27:
+YY_RULE_SETUP
+return WFD_INPUT_TYPE_KEYBOARD;
+ YY_BREAK
+case 28:
+YY_RULE_SETUP
+return WFD_INPUT_TYPE_MOUSE;
+ YY_BREAK
+case 29:
+YY_RULE_SETUP
+return WFD_INPUT_TYPE_SINGLE_TOUCH;
+ YY_BREAK
+case 30:
+YY_RULE_SETUP
+return WFD_INPUT_TYPE_MULTI_TOUCH;
+ YY_BREAK
+case 31:
+YY_RULE_SETUP
+return WFD_INPUT_TYPE_JOYSTICK;
+ YY_BREAK
+case 32:
+YY_RULE_SETUP
+return WFD_INPUT_TYPE_CAMERA;
+ YY_BREAK
+case 33:
+YY_RULE_SETUP
+return WFD_INPUT_TYPE_GESTURE;
+ YY_BREAK
+case 34:
+YY_RULE_SETUP
+return WFD_INPUT_TYPE_REMOTE_CONTROL;
+ YY_BREAK
+case 35:
+YY_RULE_SETUP
+return WFD_HIDC_CAP_LIST;
+ YY_BREAK
+case 36:
+YY_RULE_SETUP
+return WFD_INPUT_PATH_INFRARED;
+ YY_BREAK
+case 37:
+YY_RULE_SETUP
+return WFD_INPUT_PATH_USB;
+ YY_BREAK
+case 38:
+YY_RULE_SETUP
+return WFD_INPUT_PATH_BT;
+ YY_BREAK
+case 39:
+YY_RULE_SETUP
+return WFD_INPUT_PATH_WIFI;
+ YY_BREAK
+case 40:
+YY_RULE_SETUP
+return WFD_INPUT_PATH_ZIGBEE;
+ YY_BREAK
+case 41:
+YY_RULE_SETUP
+return WFD_INPUT_PATH_NOSP;
+ YY_BREAK
+case 42:
+YY_RULE_SETUP
+return WFD_UIBC_SETTING_DISABLE;
+ YY_BREAK
+case 43:
+YY_RULE_SETUP
+return WFD_UIBC_SETTING_ENABLE;
+ YY_BREAK
+case 44:
+YY_RULE_SETUP
+return WFD_SUPPORTED;
+ YY_BREAK
+case 45:
+YY_RULE_SETUP
+{
+ std::string str(yytext, yyleng);
+ str += '\0';
+ errno = 0;
+ yylval->nval = strtoull(str.c_str(), NULL, 16);
+ if (errno)
+ yyterminate();
+ return WFD_NUM;
+ }
+ YY_BREAK
+case 46:
+YY_RULE_SETUP
+{
+ std::string str(yytext, yyleng);
+ str += '\0';
+ errno = 0;
+ yylval->nval = strtoull(str.c_str(), NULL, 16);
+ if (errno)
+ yyterminate();
+ return WFD_NUM;
+ }
+ YY_BREAK
+case 47:
+YY_RULE_SETUP
+{
+ yylval->sval = new std::string(yytext);
+ return WFD_STRING;
+ }
+ YY_BREAK
+case 48:
+YY_RULE_SETUP
+{
+ yylval->sval = new std::string(yytext);
+ return WFD_STRING;
+ }
+ YY_BREAK
+case 49:
+YY_RULE_SETUP
+{
+ BEGIN(NUM_AS_HEX_MODE);
+ return WFD_AUDIO_CODECS;
+ }
+ YY_BREAK
+case 50:
+YY_RULE_SETUP
+{
+ BEGIN(NUM_AS_HEX_MODE);
+ return WFD_VIDEO_FORMATS;
+ }
+ YY_BREAK
+case 51:
+YY_RULE_SETUP
+{
+ BEGIN(NUM_AS_HEX_MODE);
+ return WFD_3D_FORMATS;
+ }
+ YY_BREAK
+case 52:
+YY_RULE_SETUP
+{
+ return WFD_CONTENT_PROTECTION;
+ }
+ YY_BREAK
+case 53:
+YY_RULE_SETUP
+{
+ BEGIN(MATCH_EDID_STATE);
+ return WFD_DISPLAY_EDID;
+ }
+ YY_BREAK
+case 54:
+YY_RULE_SETUP
+{
+ BEGIN(NUM_AS_HEX_MODE);
+ return WFD_COUPLED_SINK;
+ }
+ YY_BREAK
+case 55:
+YY_RULE_SETUP
+{
+ BEGIN(SUPPORTED_METHODS_STATE);
+ return WFD_TRIGGER_METHOD;
+ }
+ YY_BREAK
+case 56:
+YY_RULE_SETUP
+{
+ BEGIN(MATCH_PRESENTATION_URL);
+ return WFD_PRESENTATION_URL;
+ }
+ YY_BREAK
+case 57:
+YY_RULE_SETUP
+{
+ return WFD_CLIENT_RTP_PORTS;
+ }
+ YY_BREAK
+case 58:
+YY_RULE_SETUP
+{
+ return WFD_ROUTE;
+ }
+ YY_BREAK
+case 59:
+YY_RULE_SETUP
+{
+ return WFD_I2C;
+ }
+ YY_BREAK
+case 60:
+YY_RULE_SETUP
+{
+ BEGIN(NUM_AS_HEX_MODE);
+ return WFD_AV_FORMAT_CHANGE_TIMING;
+ }
+ YY_BREAK
+case 61:
+YY_RULE_SETUP
+{
+ BEGIN(NUM_AS_HEX_MODE);
+ return WFD_PREFERRED_DISPLAY_MODE;
+ }
+ YY_BREAK
+case 62:
+YY_RULE_SETUP
+{
+ return WFD_UIBC_CAPABILITY;
+ }
+ YY_BREAK
+case 63:
+YY_RULE_SETUP
+{
+ return WFD_UIBC_SETTING;
+ }
+ YY_BREAK
+case 64:
+YY_RULE_SETUP
+{
+ return WFD_STANDBY_RESUME_CAPABILITY;
+ }
+ YY_BREAK
+case 65:
+YY_RULE_SETUP
+{
+ if (yyextra) // Is reply.
+ return WFD_STANDBY_IN_RESPONSE;
+ return WFD_STANDBY_IN_REQUEST;
+ }
+ YY_BREAK
+case 66:
+YY_RULE_SETUP
+{
+ BEGIN(NUM_AS_HEX_MODE);
+ return WFD_CONNECTOR_TYPE;
+ }
+ YY_BREAK
+case 67:
+YY_RULE_SETUP
+{
+ return WFD_IDR_REQUEST;
+ }
+ YY_BREAK
+case 68:
+YY_RULE_SETUP
+{
+ BEGIN(MATCH_STRING_STATE);
+ yylval->sval = new std::string(yytext, yyleng);
+ return WFD_GENERIC_PROPERTY;
+ }
+ YY_BREAK
+case 69:
+YY_RULE_SETUP
+{
+ std::string str(yytext, yyleng);
+ str += '\0';
+ errno = 0;
+ yylval->nval = strtoull(str.c_str(), NULL, 10);
+ if (errno)
+ yyterminate();
+ return WFD_NUM;
+ }
+ YY_BREAK
+case 70:
+/* rule 70 can match eol */
+*yy_cp = yyg->yy_hold_char; /* undo effects of setting up yytext */
+yyg->yy_c_buf_p = yy_cp -= 2;
+YY_DO_BEFORE_ACTION; /* set up yytext again */
+YY_RULE_SETUP
+{
+ BEGIN(INITIAL);
+ yylval->sval = new std::string(yytext);
+ return WFD_STRING;
+ }
+ YY_BREAK
+case 71:
+YY_RULE_SETUP
+{
+ return WFD_OPTIONS;
+ }
+ YY_BREAK
+case 72:
+YY_RULE_SETUP
+{
+ return WFD_SET_PARAMETER;
+ }
+ YY_BREAK
+case 73:
+YY_RULE_SETUP
+{
+ return WFD_GET_PARAMETER;
+ }
+ YY_BREAK
+case 74:
+YY_RULE_SETUP
+{
+ return WFD_SETUP;
+ }
+ YY_BREAK
+case 75:
+YY_RULE_SETUP
+{
+ return WFD_PLAY;
+ }
+ YY_BREAK
+case 76:
+YY_RULE_SETUP
+{
+ return WFD_TEARDOWN;
+ }
+ YY_BREAK
+case 77:
+YY_RULE_SETUP
+{
+ return WFD_PAUSE;
+ }
+ YY_BREAK
+case 78:
+YY_RULE_SETUP
+{
+ return WFD_TAG;
+ }
+ YY_BREAK
+case 79:
+YY_RULE_SETUP
+{
+ yylval->sval = new std::string(yytext);
+ return WFD_PRESENTATION_URL_0;
+ }
+ YY_BREAK
+case 80:
+YY_RULE_SETUP
+{
+ yylval->sval = new std::string(yytext);
+ return WFD_PRESENTATION_URL_1;
+ }
+ YY_BREAK
+/* all unmatched */
+case 81:
+YY_RULE_SETUP
+{}
+ YY_BREAK
+case 82:
+YY_RULE_SETUP
+YY_FATAL_ERROR( "flex scanner jammed" );
+ YY_BREAK
+case YY_STATE_EOF(INITIAL):
+case YY_STATE_EOF(MATCH_STRING_STATE):
+case YY_STATE_EOF(MATCH_RESPONSE_CODE_STATE):
+case YY_STATE_EOF(SUPPORTED_METHODS_STATE):
+case YY_STATE_EOF(CONTENT_TYPE_STATE):
+case YY_STATE_EOF(SESSION_STATE):
+case YY_STATE_EOF(MATCH_PRESENTATION_URL):
+case YY_STATE_EOF(NUM_AS_HEX_MODE):
+case YY_STATE_EOF(MATCH_EDID_STATE):
+ yyterminate();
+
+ case YY_END_OF_BUFFER:
+ {
+ /* Amount of text matched not including the EOB char. */
+ int yy_amount_of_matched_text = (int) (yy_cp - yyg->yytext_ptr) - 1;
+
+ /* Undo the effects of YY_DO_BEFORE_ACTION. */
+ *yy_cp = yyg->yy_hold_char;
+ YY_RESTORE_YY_MORE_OFFSET
+
+ if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_NEW )
+ {
+ /* We're scanning a new file or input source. It's
+ * possible that this happened because the user
+ * just pointed yyin at a new source and called
+ * message_lex(). If so, then we have to assure
+ * consistency between YY_CURRENT_BUFFER and our
+ * globals. Here is the right place to do so, because
+ * this is the first action (other than possibly a
+ * back-up) that will match for the new input source.
+ */
+ yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
+ YY_CURRENT_BUFFER_LVALUE->yy_input_file = yyin;
+ YY_CURRENT_BUFFER_LVALUE->yy_buffer_status = YY_BUFFER_NORMAL;
+ }
+
+ /* Note that here we test for yy_c_buf_p "<=" to the position
+ * of the first EOB in the buffer, since yy_c_buf_p will
+ * already have been incremented past the NUL character
+ * (since all states make transitions on EOB to the
+ * end-of-buffer state). Contrast this with the test
+ * in input().
+ */
+ if ( yyg->yy_c_buf_p <= &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
+ { /* This was really a NUL. */
+ yy_state_type yy_next_state;
+
+ yyg->yy_c_buf_p = yyg->yytext_ptr + yy_amount_of_matched_text;
+
+ yy_current_state = yy_get_previous_state( yyscanner );
+
+ /* Okay, we're now positioned to make the NUL
+ * transition. We couldn't have
+ * yy_get_previous_state() go ahead and do it
+ * for us because it doesn't know how to deal
+ * with the possibility of jamming (and we don't
+ * want to build jamming into it because then it
+ * will run more slowly).
+ */
+
+ yy_next_state = yy_try_NUL_trans( yy_current_state , yyscanner);
+
+ yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
+
+ if ( yy_next_state )
+ {
+ /* Consume the NUL. */
+ yy_cp = ++yyg->yy_c_buf_p;
+ yy_current_state = yy_next_state;
+ goto yy_match;
+ }
+
+ else
+ {
+ yy_cp = yyg->yy_last_accepting_cpos;
+ yy_current_state = yyg->yy_last_accepting_state;
+ goto yy_find_action;
+ }
+ }
+
+ else switch ( yy_get_next_buffer( yyscanner ) )
+ {
+ case EOB_ACT_END_OF_FILE:
+ {
+ yyg->yy_did_buffer_switch_on_eof = 0;
+
+ if ( message_wrap(yyscanner ) )
+ {
+ /* Note: because we've taken care in
+ * yy_get_next_buffer() to have set up
+ * yytext, we can now set up
+ * yy_c_buf_p so that if some total
+ * hoser (like flex itself) wants to
+ * call the scanner after we return the
+ * YY_NULL, it'll still work - another
+ * YY_NULL will get returned.
+ */
+ yyg->yy_c_buf_p = yyg->yytext_ptr + YY_MORE_ADJ;
+
+ yy_act = YY_STATE_EOF(YY_START);
+ goto do_action;
+ }
+
+ else
+ {
+ if ( ! yyg->yy_did_buffer_switch_on_eof )
+ YY_NEW_FILE;
+ }
+ break;
+ }
+
+ case EOB_ACT_CONTINUE_SCAN:
+ yyg->yy_c_buf_p =
+ yyg->yytext_ptr + yy_amount_of_matched_text;
+
+ yy_current_state = yy_get_previous_state( yyscanner );
+
+ yy_cp = yyg->yy_c_buf_p;
+ yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
+ goto yy_match;
+
+ case EOB_ACT_LAST_MATCH:
+ yyg->yy_c_buf_p =
+ &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars];
+
+ yy_current_state = yy_get_previous_state( yyscanner );
+
+ yy_cp = yyg->yy_c_buf_p;
+ yy_bp = yyg->yytext_ptr + YY_MORE_ADJ;
+ goto yy_find_action;
+ }
+ break;
+ }
+
+ default:
+ YY_FATAL_ERROR(
+ "fatal flex scanner internal error--no action found" );
+ } /* end of action switch */
+ } /* end of scanning one token */
+} /* end of message_lex */
+
+/* yy_get_next_buffer - try to read in a new buffer
+ *
+ * Returns a code representing an action:
+ * EOB_ACT_LAST_MATCH -
+ * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
+ * EOB_ACT_END_OF_FILE - end of file
+ */
+static int yy_get_next_buffer (yyscan_t yyscanner)
+{
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+ register char *dest = YY_CURRENT_BUFFER_LVALUE->yy_ch_buf;
+ register char *source = yyg->yytext_ptr;
+ register int number_to_move, i;
+ int ret_val;
+
+ if ( yyg->yy_c_buf_p > &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] )
+ YY_FATAL_ERROR(
+ "fatal flex scanner internal error--end of buffer missed" );
+
+ if ( YY_CURRENT_BUFFER_LVALUE->yy_fill_buffer == 0 )
+ { /* Don't try to fill the buffer, so this is an EOF. */
+ if ( yyg->yy_c_buf_p - yyg->yytext_ptr - YY_MORE_ADJ == 1 )
+ {
+ /* We matched a single character, the EOB, so
+ * treat this as a final EOF.
+ */
+ return EOB_ACT_END_OF_FILE;
+ }
+
+ else
+ {
+ /* We matched some text prior to the EOB, first
+ * process it.
+ */
+ return EOB_ACT_LAST_MATCH;
+ }
+ }
+
+ /* Try to read more data. */
+
+ /* First move last chars to start of buffer. */
+ number_to_move = (int) (yyg->yy_c_buf_p - yyg->yytext_ptr) - 1;
+
+ for ( i = 0; i < number_to_move; ++i )
+ *(dest++) = *(source++);
+
+ if ( YY_CURRENT_BUFFER_LVALUE->yy_buffer_status == YY_BUFFER_EOF_PENDING )
+ /* don't do the read, it's not guaranteed to return an EOF,
+ * just force an EOF
+ */
+ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars = 0;
+
+ else
+ {
+ int num_to_read =
+ YY_CURRENT_BUFFER_LVALUE->yy_buf_size - number_to_move - 1;
+
+ while ( num_to_read <= 0 )
+ { /* Not enough room in the buffer - grow it. */
+
+ /* just a shorter name for the current buffer */
+ YY_BUFFER_STATE b = YY_CURRENT_BUFFER;
+
+ int yy_c_buf_p_offset =
+ (int) (yyg->yy_c_buf_p - b->yy_ch_buf);
+
+ if ( b->yy_is_our_buffer )
+ {
+ int new_size = b->yy_buf_size * 2;
+
+ if ( new_size <= 0 )
+ b->yy_buf_size += b->yy_buf_size / 8;
+ else
+ b->yy_buf_size *= 2;
+
+ b->yy_ch_buf = (char *)
+ /* Include room in for 2 EOB chars. */
+ message_realloc((void *) b->yy_ch_buf,b->yy_buf_size + 2 ,yyscanner );
+ }
+ else
+ /* Can't grow it, we don't own it. */
+ b->yy_ch_buf = 0;
+
+ if ( ! b->yy_ch_buf )
+ YY_FATAL_ERROR(
+ "fatal error - scanner input buffer overflow" );
+
+ yyg->yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
+
+ num_to_read = YY_CURRENT_BUFFER_LVALUE->yy_buf_size -
+ number_to_move - 1;
+
+ }
+
+ if ( num_to_read > YY_READ_BUF_SIZE )
+ num_to_read = YY_READ_BUF_SIZE;
+
+ /* Read in more data. */
+ YY_INPUT( (&YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[number_to_move]),
+ yyg->yy_n_chars, (size_t) num_to_read );
+
+ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
+ }
+
+ if ( yyg->yy_n_chars == 0 )
+ {
+ if ( number_to_move == YY_MORE_ADJ )
+ {
+ ret_val = EOB_ACT_END_OF_FILE;
+ message_restart(yyin ,yyscanner);
+ }
+
+ else
+ {
+ ret_val = EOB_ACT_LAST_MATCH;
+ YY_CURRENT_BUFFER_LVALUE->yy_buffer_status =
+ YY_BUFFER_EOF_PENDING;
+ }
+ }
+
+ else
+ ret_val = EOB_ACT_CONTINUE_SCAN;
+
+ if ((yy_size_t) (yyg->yy_n_chars + number_to_move) > YY_CURRENT_BUFFER_LVALUE->yy_buf_size) {
+ /* Extend the array by 50%, plus the number we really need. */
+ yy_size_t new_size = yyg->yy_n_chars + number_to_move + (yyg->yy_n_chars >> 1);
+ YY_CURRENT_BUFFER_LVALUE->yy_ch_buf = (char *) message_realloc((void *) YY_CURRENT_BUFFER_LVALUE->yy_ch_buf,new_size ,yyscanner );
+ if ( ! YY_CURRENT_BUFFER_LVALUE->yy_ch_buf )
+ YY_FATAL_ERROR( "out of dynamic memory in yy_get_next_buffer()" );
+ }
+
+ yyg->yy_n_chars += number_to_move;
+ YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] = YY_END_OF_BUFFER_CHAR;
+ YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
+
+ yyg->yytext_ptr = &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[0];
+
+ return ret_val;
+}
+
+/* yy_get_previous_state - get the state just before the EOB char was reached */
+
+ static yy_state_type yy_get_previous_state (yyscan_t yyscanner)
+{
+ register yy_state_type yy_current_state;
+ register char *yy_cp;
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+
+ yy_current_state = yyg->yy_start;
+ yy_current_state += YY_AT_BOL();
+
+ for ( yy_cp = yyg->yytext_ptr + YY_MORE_ADJ; yy_cp < yyg->yy_c_buf_p; ++yy_cp )
+ {
+ register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
+ if ( yy_accept[yy_current_state] )
+ {
+ yyg->yy_last_accepting_state = yy_current_state;
+ yyg->yy_last_accepting_cpos = yy_cp;
+ }
+ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+ {
+ yy_current_state = (int) yy_def[yy_current_state];
+ if ( yy_current_state >= 1147 )
+ yy_c = yy_meta[(unsigned int) yy_c];
+ }
+ yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+ }
+
+ return yy_current_state;
+}
+
+/* yy_try_NUL_trans - try to make a transition on the NUL character
+ *
+ * synopsis
+ * next_state = yy_try_NUL_trans( current_state );
+ */
+ static yy_state_type yy_try_NUL_trans (yy_state_type yy_current_state , yyscan_t yyscanner)
+{
+ register int yy_is_jam;
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner; /* This var may be unused depending upon options. */
+ register char *yy_cp = yyg->yy_c_buf_p;
+
+ register YY_CHAR yy_c = 1;
+ if ( yy_accept[yy_current_state] )
+ {
+ yyg->yy_last_accepting_state = yy_current_state;
+ yyg->yy_last_accepting_cpos = yy_cp;
+ }
+ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+ {
+ yy_current_state = (int) yy_def[yy_current_state];
+ if ( yy_current_state >= 1147 )
+ yy_c = yy_meta[(unsigned int) yy_c];
+ }
+ yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+ yy_is_jam = (yy_current_state == 1146);
+
+ return yy_is_jam ? 0 : yy_current_state;
+}
+
+#ifndef YY_NO_INPUT
+#ifdef __cplusplus
+ static int yyinput (yyscan_t yyscanner)
+#else
+ static int input (yyscan_t yyscanner)
+#endif
+
+{
+ int c;
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+
+ *yyg->yy_c_buf_p = yyg->yy_hold_char;
+
+ if ( *yyg->yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
+ {
+ /* yy_c_buf_p now points to the character we want to return.
+ * If this occurs *before* the EOB characters, then it's a
+ * valid NUL; if not, then we've hit the end of the buffer.
+ */
+ if ( yyg->yy_c_buf_p < &YY_CURRENT_BUFFER_LVALUE->yy_ch_buf[yyg->yy_n_chars] )
+ /* This was really a NUL. */
+ *yyg->yy_c_buf_p = '\0';
+
+ else
+ { /* need more input */
+ int offset = yyg->yy_c_buf_p - yyg->yytext_ptr;
+ ++yyg->yy_c_buf_p;
+
+ switch ( yy_get_next_buffer( yyscanner ) )
+ {
+ case EOB_ACT_LAST_MATCH:
+ /* This happens because yy_g_n_b()
+ * sees that we've accumulated a
+ * token and flags that we need to
+ * try matching the token before
+ * proceeding. But for input(),
+ * there's no matching to consider.
+ * So convert the EOB_ACT_LAST_MATCH
+ * to EOB_ACT_END_OF_FILE.
+ */
+
+ /* Reset buffer status. */
+ message_restart(yyin ,yyscanner);
+
+ /*FALLTHROUGH*/
+
+ case EOB_ACT_END_OF_FILE:
+ {
+ if ( message_wrap(yyscanner ) )
+ return EOF;
+
+ if ( ! yyg->yy_did_buffer_switch_on_eof )
+ YY_NEW_FILE;
+#ifdef __cplusplus
+ return yyinput(yyscanner);
+#else
+ return input(yyscanner);
+#endif
+ }
+
+ case EOB_ACT_CONTINUE_SCAN:
+ yyg->yy_c_buf_p = yyg->yytext_ptr + offset;
+ break;
+ }
+ }
+ }
+
+ c = *(unsigned char *) yyg->yy_c_buf_p; /* cast for 8-bit char's */
+ *yyg->yy_c_buf_p = '\0'; /* preserve yytext */
+ yyg->yy_hold_char = *++yyg->yy_c_buf_p;
+
+ YY_CURRENT_BUFFER_LVALUE->yy_at_bol = (c == '\n');
+
+ return c;
+}
+#endif /* ifndef YY_NO_INPUT */
+
+/** Immediately switch to a different input stream.
+ * @param input_file A readable stream.
+ * @param yyscanner The scanner object.
+ * @note This function does not reset the start condition to @c INITIAL .
+ */
+ void message_restart (FILE * input_file , yyscan_t yyscanner)
+{
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+
+ if ( ! YY_CURRENT_BUFFER ){
+ message_ensure_buffer_stack (yyscanner);
+ YY_CURRENT_BUFFER_LVALUE =
+ message__create_buffer(yyin,YY_BUF_SIZE ,yyscanner);
+ }
+
+ message__init_buffer(YY_CURRENT_BUFFER,input_file ,yyscanner);
+ message__load_buffer_state(yyscanner );
+}
+
+/** Switch to a different input buffer.
+ * @param new_buffer The new input buffer.
+ * @param yyscanner The scanner object.
+ */
+ void message__switch_to_buffer (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
+{
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+
+ /* TODO. We should be able to replace this entire function body
+ * with
+ * message_pop_buffer_state();
+ * message_push_buffer_state(new_buffer);
+ */
+ message_ensure_buffer_stack (yyscanner);
+ if ( YY_CURRENT_BUFFER == new_buffer )
+ return;
+
+ if ( YY_CURRENT_BUFFER )
+ {
+ /* Flush out information for old buffer. */
+ *yyg->yy_c_buf_p = yyg->yy_hold_char;
+ YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
+ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
+ }
+
+ YY_CURRENT_BUFFER_LVALUE = new_buffer;
+ message__load_buffer_state(yyscanner );
+
+ /* We don't actually know whether we did this switch during
+ * EOF (message_wrap()) processing, but the only time this flag
+ * is looked at is after message_wrap() is called, so it's safe
+ * to go ahead and always set it.
+ */
+ yyg->yy_did_buffer_switch_on_eof = 1;
+}
+
+static void message__load_buffer_state (yyscan_t yyscanner)
+{
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+ yyg->yy_n_chars = YY_CURRENT_BUFFER_LVALUE->yy_n_chars;
+ yyg->yytext_ptr = yyg->yy_c_buf_p = YY_CURRENT_BUFFER_LVALUE->yy_buf_pos;
+ yyin = YY_CURRENT_BUFFER_LVALUE->yy_input_file;
+ yyg->yy_hold_char = *yyg->yy_c_buf_p;
+}
+
+/** Allocate and initialize an input buffer state.
+ * @param file A readable stream.
+ * @param size The character buffer size in bytes. When in doubt, use @c YY_BUF_SIZE.
+ * @param yyscanner The scanner object.
+ * @return the allocated buffer state.
+ */
+ YY_BUFFER_STATE message__create_buffer (FILE * file, int size , yyscan_t yyscanner)
+{
+ YY_BUFFER_STATE b;
+
+ b = (YY_BUFFER_STATE) message_alloc(sizeof( struct yy_buffer_state ) ,yyscanner );
+ if ( ! b )
+ YY_FATAL_ERROR( "out of dynamic memory in message__create_buffer()" );
+
+ b->yy_buf_size = size;
+
+ /* yy_ch_buf has to be 2 characters longer than the size given because
+ * we need to put in 2 end-of-buffer characters.
+ */
+ b->yy_ch_buf = (char *) message_alloc(b->yy_buf_size + 2 ,yyscanner );
+ if ( ! b->yy_ch_buf )
+ YY_FATAL_ERROR( "out of dynamic memory in message__create_buffer()" );
+
+ b->yy_is_our_buffer = 1;
+
+ message__init_buffer(b,file ,yyscanner);
+
+ return b;
+}
+
+/** Destroy the buffer.
+ * @param b a buffer created with message__create_buffer()
+ * @param yyscanner The scanner object.
+ */
+ void message__delete_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
+{
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+
+ if ( ! b )
+ return;
+
+ if ( b == YY_CURRENT_BUFFER ) /* Not sure if we should pop here. */
+ YY_CURRENT_BUFFER_LVALUE = (YY_BUFFER_STATE) 0;
+
+ if ( b->yy_is_our_buffer )
+ message_free((void *) b->yy_ch_buf ,yyscanner );
+
+ message_free((void *) b ,yyscanner );
+}
+
+/* Initializes or reinitializes a buffer.
+ * This function is sometimes called more than once on the same buffer,
+ * such as during a message_restart() or at EOF.
+ */
+ static void message__init_buffer (YY_BUFFER_STATE b, FILE * file , yyscan_t yyscanner)
+
+{
+ int oerrno = errno;
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+
+ message__flush_buffer(b ,yyscanner);
+
+ b->yy_input_file = file;
+ b->yy_fill_buffer = 1;
+
+ /* If b is the current buffer, then message__init_buffer was _probably_
+ * called from message_restart() or through yy_get_next_buffer.
+ * In that case, we don't want to reset the lineno or column.
+ */
+ if (b != YY_CURRENT_BUFFER){
+ b->yy_bs_lineno = 1;
+ b->yy_bs_column = 0;
+ }
+
+ b->yy_is_interactive = 0;
+
+ errno = oerrno;
+}
+
+/** Discard all buffered characters. On the next scan, YY_INPUT will be called.
+ * @param b the buffer state to be flushed, usually @c YY_CURRENT_BUFFER.
+ * @param yyscanner The scanner object.
+ */
+ void message__flush_buffer (YY_BUFFER_STATE b , yyscan_t yyscanner)
+{
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+ if ( ! b )
+ return;
+
+ b->yy_n_chars = 0;
+
+ /* We always need two end-of-buffer characters. The first causes
+ * a transition to the end-of-buffer state. The second causes
+ * a jam in that state.
+ */
+ b->yy_ch_buf[0] = YY_END_OF_BUFFER_CHAR;
+ b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
+
+ b->yy_buf_pos = &b->yy_ch_buf[0];
+
+ b->yy_at_bol = 1;
+ b->yy_buffer_status = YY_BUFFER_NEW;
+
+ if ( b == YY_CURRENT_BUFFER )
+ message__load_buffer_state(yyscanner );
+}
+
+/** Pushes the new state onto the stack. The new state becomes
+ * the current state. This function will allocate the stack
+ * if necessary.
+ * @param new_buffer The new state.
+ * @param yyscanner The scanner object.
+ */
+void message_push_buffer_state (YY_BUFFER_STATE new_buffer , yyscan_t yyscanner)
+{
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+ if (new_buffer == NULL)
+ return;
+
+ message_ensure_buffer_stack(yyscanner);
+
+ /* This block is copied from message__switch_to_buffer. */
+ if ( YY_CURRENT_BUFFER )
+ {
+ /* Flush out information for old buffer. */
+ *yyg->yy_c_buf_p = yyg->yy_hold_char;
+ YY_CURRENT_BUFFER_LVALUE->yy_buf_pos = yyg->yy_c_buf_p;
+ YY_CURRENT_BUFFER_LVALUE->yy_n_chars = yyg->yy_n_chars;
+ }
+
+ /* Only push if top exists. Otherwise, replace top. */
+ if (YY_CURRENT_BUFFER)
+ yyg->yy_buffer_stack_top++;
+ YY_CURRENT_BUFFER_LVALUE = new_buffer;
+
+ /* copied from message__switch_to_buffer. */
+ message__load_buffer_state(yyscanner );
+ yyg->yy_did_buffer_switch_on_eof = 1;
+}
+
+/** Removes and deletes the top of the stack, if present.
+ * The next element becomes the new top.
+ * @param yyscanner The scanner object.
+ */
+void message_pop_buffer_state (yyscan_t yyscanner)
+{
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+ if (!YY_CURRENT_BUFFER)
+ return;
+
+ message__delete_buffer(YY_CURRENT_BUFFER ,yyscanner);
+ YY_CURRENT_BUFFER_LVALUE = NULL;
+ if (yyg->yy_buffer_stack_top > 0)
+ --yyg->yy_buffer_stack_top;
+
+ if (YY_CURRENT_BUFFER) {
+ message__load_buffer_state(yyscanner );
+ yyg->yy_did_buffer_switch_on_eof = 1;
+ }
+}
+
+/* Allocates the stack if it does not exist.
+ * Guarantees space for at least one push.
+ */
+static void message_ensure_buffer_stack (yyscan_t yyscanner)
+{
+ int num_to_alloc;
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+
+ if (!yyg->yy_buffer_stack) {
+
+ /* First allocation is just for 2 elements, since we don't know if this
+ * scanner will even need a stack. We use 2 instead of 1 to avoid an
+ * immediate realloc on the next call.
+ */
+ num_to_alloc = 1;
+ yyg->yy_buffer_stack = (struct yy_buffer_state**)message_alloc
+ (num_to_alloc * sizeof(struct yy_buffer_state*)
+ , yyscanner);
+ if ( ! yyg->yy_buffer_stack )
+ YY_FATAL_ERROR( "out of dynamic memory in message_ensure_buffer_stack()" );
+
+ memset(yyg->yy_buffer_stack, 0, num_to_alloc * sizeof(struct yy_buffer_state*));
+
+ yyg->yy_buffer_stack_max = num_to_alloc;
+ yyg->yy_buffer_stack_top = 0;
+ return;
+ }
+
+ if (yyg->yy_buffer_stack_top >= (yyg->yy_buffer_stack_max) - 1){
+
+ /* Increase the buffer to prepare for a possible push. */
+ int grow_size = 8 /* arbitrary grow size */;
+
+ num_to_alloc = yyg->yy_buffer_stack_max + grow_size;
+ yyg->yy_buffer_stack = (struct yy_buffer_state**)message_realloc
+ (yyg->yy_buffer_stack,
+ num_to_alloc * sizeof(struct yy_buffer_state*)
+ , yyscanner);
+ if ( ! yyg->yy_buffer_stack )
+ YY_FATAL_ERROR( "out of dynamic memory in message_ensure_buffer_stack()" );
+
+ /* zero only the new slots.*/
+ memset(yyg->yy_buffer_stack + yyg->yy_buffer_stack_max, 0, grow_size * sizeof(struct yy_buffer_state*));
+ yyg->yy_buffer_stack_max = num_to_alloc;
+ }
+}
+
+/** Setup the input buffer state to scan directly from a user-specified character buffer.
+ * @param base the character buffer
+ * @param size the size in bytes of the character buffer
+ * @param yyscanner The scanner object.
+ * @return the newly allocated buffer state object.
+ */
+YY_BUFFER_STATE message__scan_buffer (char * base, yy_size_t size , yyscan_t yyscanner)
+{
+ YY_BUFFER_STATE b;
+
+ if ( size < 2 ||
+ base[size-2] != YY_END_OF_BUFFER_CHAR ||
+ base[size-1] != YY_END_OF_BUFFER_CHAR )
+ /* They forgot to leave room for the EOB's. */
+ return 0;
+
+ b = (YY_BUFFER_STATE) message_alloc(sizeof( struct yy_buffer_state ) ,yyscanner );
+ if ( ! b )
+ YY_FATAL_ERROR( "out of dynamic memory in message__scan_buffer()" );
+
+ b->yy_buf_size = size - 2; /* "- 2" to take care of EOB's */
+ b->yy_buf_pos = b->yy_ch_buf = base;
+ b->yy_is_our_buffer = 0;
+ b->yy_input_file = 0;
+ b->yy_n_chars = b->yy_buf_size;
+ b->yy_is_interactive = 0;
+ b->yy_at_bol = 1;
+ b->yy_fill_buffer = 0;
+ b->yy_buffer_status = YY_BUFFER_NEW;
+
+ message__switch_to_buffer(b ,yyscanner );
+
+ return b;
+}
+
+/** Setup the input buffer state to scan a string. The next call to message_lex() will
+ * scan from a @e copy of @a str.
+ * @param yystr a NUL-terminated string to scan
+ * @param yyscanner The scanner object.
+ * @return the newly allocated buffer state object.
+ * @note If you want to scan bytes that may contain NUL values, then use
+ * message__scan_bytes() instead.
+ */
+YY_BUFFER_STATE message__scan_string (yyconst char * yystr , yyscan_t yyscanner)
+{
+
+ return message__scan_bytes(yystr,strlen(yystr) ,yyscanner);
+}
+
+/** Setup the input buffer state to scan the given bytes. The next call to message_lex() will
+ * scan from a @e copy of @a bytes.
+ * @param yybytes the byte buffer to scan
+ * @param _yybytes_len the number of bytes in the buffer pointed to by @a bytes.
+ * @param yyscanner The scanner object.
+ * @return the newly allocated buffer state object.
+ */
+YY_BUFFER_STATE message__scan_bytes (yyconst char * yybytes, int _yybytes_len , yyscan_t yyscanner)
+{
+ YY_BUFFER_STATE b;
+ char *buf;
+ yy_size_t n;
+ int i;
+
+ /* Get memory for full buffer, including space for trailing EOB's. */
+ n = _yybytes_len + 2;
+ buf = (char *) message_alloc(n ,yyscanner );
+ if ( ! buf )
+ YY_FATAL_ERROR( "out of dynamic memory in message__scan_bytes()" );
+
+ for ( i = 0; i < _yybytes_len; ++i )
+ buf[i] = yybytes[i];
+
+ buf[_yybytes_len] = buf[_yybytes_len+1] = YY_END_OF_BUFFER_CHAR;
+
+ b = message__scan_buffer(buf,n ,yyscanner);
+ if ( ! b )
+ YY_FATAL_ERROR( "bad buffer in message__scan_bytes()" );
+
+ /* It's okay to grow etc. this buffer, and we should throw it
+ * away when we're done.
+ */
+ b->yy_is_our_buffer = 1;
+
+ return b;
+}
+
+#ifndef YY_EXIT_FAILURE
+#define YY_EXIT_FAILURE 2
+#endif
+
+static void yy_fatal_error (yyconst char* msg , yyscan_t yyscanner)
+{
+ (void) fprintf( stderr, "%s\n", msg );
+ exit( YY_EXIT_FAILURE );
+}
+
+/* Redefine yyless() so it works in section 3 code. */
+
+#undef yyless
+#define yyless(n) \
+ do \
+ { \
+ /* Undo effects of setting up yytext. */ \
+ int yyless_macro_arg = (n); \
+ YY_LESS_LINENO(yyless_macro_arg);\
+ yytext[yyleng] = yyg->yy_hold_char; \
+ yyg->yy_c_buf_p = yytext + yyless_macro_arg; \
+ yyg->yy_hold_char = *yyg->yy_c_buf_p; \
+ *yyg->yy_c_buf_p = '\0'; \
+ yyleng = yyless_macro_arg; \
+ } \
+ while ( 0 )
+
+/* Accessor methods (get/set functions) to struct members. */
+
+/** Get the user-defined data for this scanner.
+ * @param yyscanner The scanner object.
+ */
+YY_EXTRA_TYPE message_get_extra (yyscan_t yyscanner)
+{
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+ return yyextra;
+}
+
+/** Get the current line number.
+ * @param yyscanner The scanner object.
+ */
+int message_get_lineno (yyscan_t yyscanner)
+{
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+
+ if (! YY_CURRENT_BUFFER)
+ return 0;
+
+ return yylineno;
+}
+
+/** Get the current column number.
+ * @param yyscanner The scanner object.
+ */
+int message_get_column (yyscan_t yyscanner)
+{
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+
+ if (! YY_CURRENT_BUFFER)
+ return 0;
+
+ return yycolumn;
+}
+
+/** Get the input stream.
+ * @param yyscanner The scanner object.
+ */
+FILE *message_get_in (yyscan_t yyscanner)
+{
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+ return yyin;
+}
+
+/** Get the output stream.
+ * @param yyscanner The scanner object.
+ */
+FILE *message_get_out (yyscan_t yyscanner)
+{
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+ return yyout;
+}
+
+/** Get the length of the current token.
+ * @param yyscanner The scanner object.
+ */
+int message_get_leng (yyscan_t yyscanner)
+{
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+ return yyleng;
+}
+
+/** Get the current token.
+ * @param yyscanner The scanner object.
+ */
+
+char *message_get_text (yyscan_t yyscanner)
+{
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+ return yytext;
+}
+
+/** Set the user-defined data. This data is never touched by the scanner.
+ * @param user_defined The data to be associated with this scanner.
+ * @param yyscanner The scanner object.
+ */
+void message_set_extra (YY_EXTRA_TYPE user_defined , yyscan_t yyscanner)
+{
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+ yyextra = user_defined ;
+}
+
+/** Set the current line number.
+ * @param line_number
+ * @param yyscanner The scanner object.
+ */
+void message_set_lineno (int line_number , yyscan_t yyscanner)
+{
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+
+ /* lineno is only valid if an input buffer exists. */
+ if (! YY_CURRENT_BUFFER )
+ yy_fatal_error( "message_set_lineno called with no buffer" , yyscanner);
+
+ yylineno = line_number;
+}
+
+/** Set the current column.
+ * @param line_number
+ * @param yyscanner The scanner object.
+ */
+void message_set_column (int column_no , yyscan_t yyscanner)
+{
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+
+ /* column is only valid if an input buffer exists. */
+ if (! YY_CURRENT_BUFFER )
+ yy_fatal_error( "message_set_column called with no buffer" , yyscanner);
+
+ yycolumn = column_no;
+}
+
+/** Set the input stream. This does not discard the current
+ * input buffer.
+ * @param in_str A readable stream.
+ * @param yyscanner The scanner object.
+ * @see message__switch_to_buffer
+ */
+void message_set_in (FILE * in_str , yyscan_t yyscanner)
+{
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+ yyin = in_str ;
+}
+
+void message_set_out (FILE * out_str , yyscan_t yyscanner)
+{
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+ yyout = out_str ;
+}
+
+int message_get_debug (yyscan_t yyscanner)
+{
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+ return yy_flex_debug;
+}
+
+void message_set_debug (int bdebug , yyscan_t yyscanner)
+{
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+ yy_flex_debug = bdebug ;
+}
+
+/* Accessor methods for yylval and yylloc */
+
+YYSTYPE * message_get_lval (yyscan_t yyscanner)
+{
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+ return yylval;
+}
+
+void message_set_lval (YYSTYPE * yylval_param , yyscan_t yyscanner)
+{
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+ yylval = yylval_param;
+}
+
+/* User-visible API */
+
+/* message_lex_init is special because it creates the scanner itself, so it is
+ * the ONLY reentrant function that doesn't take the scanner as the last argument.
+ * That's why we explicitly handle the declaration, instead of using our macros.
+ */
+
+int message_lex_init(yyscan_t* ptr_yy_globals)
+
+{
+ if (ptr_yy_globals == NULL){
+ errno = EINVAL;
+ return 1;
+ }
+
+ *ptr_yy_globals = (yyscan_t) message_alloc ( sizeof( struct yyguts_t ), NULL );
+
+ if (*ptr_yy_globals == NULL){
+ errno = ENOMEM;
+ return 1;
+ }
+
+ /* By setting to 0xAA, we expose bugs in yy_init_globals. Leave at 0x00 for releases. */
+ memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
+
+ return yy_init_globals ( *ptr_yy_globals );
+}
+
+/* message_lex_init_extra has the same functionality as message_lex_init, but follows the
+ * convention of taking the scanner as the last argument. Note however, that
+ * this is a *pointer* to a scanner, as it will be allocated by this call (and
+ * is the reason, too, why this function also must handle its own declaration).
+ * The user defined value in the first argument will be available to message_alloc in
+ * the yyextra field.
+ */
+
+int message_lex_init_extra(YY_EXTRA_TYPE yy_user_defined,yyscan_t* ptr_yy_globals )
+
+{
+ struct yyguts_t dummy_yyguts;
+
+ message_set_extra (yy_user_defined, &dummy_yyguts);
+
+ if (ptr_yy_globals == NULL){
+ errno = EINVAL;
+ return 1;
+ }
+
+ *ptr_yy_globals = (yyscan_t) message_alloc ( sizeof( struct yyguts_t ), &dummy_yyguts );
+
+ if (*ptr_yy_globals == NULL){
+ errno = ENOMEM;
+ return 1;
+ }
+
+ /* By setting to 0xAA, we expose bugs in
+ yy_init_globals. Leave at 0x00 for releases. */
+ memset(*ptr_yy_globals,0x00,sizeof(struct yyguts_t));
+
+ message_set_extra (yy_user_defined, *ptr_yy_globals);
+
+ return yy_init_globals ( *ptr_yy_globals );
+}
+
+static int yy_init_globals (yyscan_t yyscanner)
+{
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+ /* Initialization is the same as for the non-reentrant scanner.
+ * This function is called from message_lex_destroy(), so don't allocate here.
+ */
+
+ yyg->yy_buffer_stack = 0;
+ yyg->yy_buffer_stack_top = 0;
+ yyg->yy_buffer_stack_max = 0;
+ yyg->yy_c_buf_p = (char *) 0;
+ yyg->yy_init = 0;
+ yyg->yy_start = 0;
+
+ yyg->yy_start_stack_ptr = 0;
+ yyg->yy_start_stack_depth = 0;
+ yyg->yy_start_stack = NULL;
+
+/* Defined in main.c */
+#ifdef YY_STDINIT
+ yyin = stdin;
+ yyout = stdout;
+#else
+ yyin = (FILE *) 0;
+ yyout = (FILE *) 0;
+#endif
+
+ /* For future reference: Set errno on error, since we are called by
+ * message_lex_init()
+ */
+ return 0;
+}
+
+/* message_lex_destroy is for both reentrant and non-reentrant scanners. */
+int message_lex_destroy (yyscan_t yyscanner)
+{
+ struct yyguts_t * yyg = (struct yyguts_t*)yyscanner;
+
+ /* Pop the buffer stack, destroying each element. */
+ while(YY_CURRENT_BUFFER){
+ message__delete_buffer(YY_CURRENT_BUFFER ,yyscanner );
+ YY_CURRENT_BUFFER_LVALUE = NULL;
+ message_pop_buffer_state(yyscanner);
+ }
+
+ /* Destroy the stack itself. */
+ message_free(yyg->yy_buffer_stack ,yyscanner);
+ yyg->yy_buffer_stack = NULL;
+
+ /* Destroy the start condition stack. */
+ message_free(yyg->yy_start_stack ,yyscanner );
+ yyg->yy_start_stack = NULL;
+
+ /* Reset the globals. This is important in a non-reentrant scanner so the next time
+ * message_lex() is called, initialization will occur. */
+ yy_init_globals( yyscanner);
+
+ /* Destroy the main struct (reentrant only). */
+ message_free ( yyscanner , yyscanner );
+ yyscanner = NULL;
+ return 0;
+}
+
+/*
+ * Internal utility routines.
+ */
+
+#ifndef yytext_ptr
+static void yy_flex_strncpy (char* s1, yyconst char * s2, int n , yyscan_t yyscanner)
+{
+ register int i;
+ for ( i = 0; i < n; ++i )
+ s1[i] = s2[i];
+}
+#endif
+
+#ifdef YY_NEED_STRLEN
+static int yy_flex_strlen (yyconst char * s , yyscan_t yyscanner)
+{
+ register int n;
+ for ( n = 0; s[n]; ++n )
+ ;
+
+ return n;
+}
+#endif
+
+void *message_alloc (yy_size_t size , yyscan_t yyscanner)
+{
+ return (void *) malloc( size );
+}
+
+void *message_realloc (void * ptr, yy_size_t size , yyscan_t yyscanner)
+{
+ /* The cast to (char *) in the following accommodates both
+ * implementations that use char* generic pointers, and those
+ * that use void* generic pointers. It works with the latter
+ * because both ANSI C and C++ allow castless assignment from
+ * any pointer type to void*, and deal with argument conversions
+ * as though doing an assignment.
+ */
+ return (void *) realloc( (char *) ptr, size );
+}
+
+void message_free (void * ptr , yyscan_t yyscanner)
+{
+ free( (char *) ptr ); /* see message_realloc() for (char *) cast */
+}
+
+#define YYTABLES_NAME "yytables"
+
diff --git a/chromium/third_party/wds/gen/messagescanner.h b/chromium/third_party/wds/gen/messagescanner.h
new file mode 100644
index 00000000000..100b94528bf
--- /dev/null
+++ b/chromium/third_party/wds/gen/messagescanner.h
@@ -0,0 +1,384 @@
+#ifndef message_HEADER_H
+#define message_HEADER_H 1
+#define message_IN_HEADER 1
+
+#line 10 "messagelexer.l"
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2015 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+#include <stdint.h>
+
+#define YY_NO_UNISTD_H 1
+
+
+
+#line 34 "gen/messagescanner.h"
+
+#define YY_INT_ALIGNED short int
+
+/* A lexical scanner generated by flex */
+
+#define FLEX_SCANNER
+#define YY_FLEX_MAJOR_VERSION 2
+#define YY_FLEX_MINOR_VERSION 5
+#define YY_FLEX_SUBMINOR_VERSION 35
+#if YY_FLEX_SUBMINOR_VERSION > 0
+#define FLEX_BETA
+#endif
+
+/* First, we deal with platform-specific or compiler-specific issues. */
+
+/* begin standard C headers. */
+#include <stdio.h>
+#include <string.h>
+#include <errno.h>
+#include <stdlib.h>
+
+/* end standard C headers. */
+
+/* flex integer type definitions */
+
+#ifndef FLEXINT_H
+#define FLEXINT_H
+
+/* C99 systems have <inttypes.h>. Non-C99 systems may or may not. */
+
+#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+
+/* C99 says to define __STDC_LIMIT_MACROS before including stdint.h,
+ * if you want the limit (max/min) macros for int types.
+ */
+#ifndef __STDC_LIMIT_MACROS
+#define __STDC_LIMIT_MACROS 1
+#endif
+
+#include <inttypes.h>
+typedef int8_t flex_int8_t;
+typedef uint8_t flex_uint8_t;
+typedef int16_t flex_int16_t;
+typedef uint16_t flex_uint16_t;
+typedef int32_t flex_int32_t;
+typedef uint32_t flex_uint32_t;
+#else
+typedef signed char flex_int8_t;
+typedef short int flex_int16_t;
+typedef int flex_int32_t;
+typedef unsigned char flex_uint8_t;
+typedef unsigned short int flex_uint16_t;
+typedef unsigned int flex_uint32_t;
+
+/* Limits of integral types. */
+#ifndef INT8_MIN
+#define INT8_MIN (-128)
+#endif
+#ifndef INT16_MIN
+#define INT16_MIN (-32767-1)
+#endif
+#ifndef INT32_MIN
+#define INT32_MIN (-2147483647-1)
+#endif
+#ifndef INT8_MAX
+#define INT8_MAX (127)
+#endif
+#ifndef INT16_MAX
+#define INT16_MAX (32767)
+#endif
+#ifndef INT32_MAX
+#define INT32_MAX (2147483647)
+#endif
+#ifndef UINT8_MAX
+#define UINT8_MAX (255U)
+#endif
+#ifndef UINT16_MAX
+#define UINT16_MAX (65535U)
+#endif
+#ifndef UINT32_MAX
+#define UINT32_MAX (4294967295U)
+#endif
+
+#endif /* ! C99 */
+
+#endif /* ! FLEXINT_H */
+
+#ifdef __cplusplus
+
+/* The "const" storage-class-modifier is valid. */
+#define YY_USE_CONST
+
+#else /* ! __cplusplus */
+
+/* C99 requires __STDC__ to be defined as 1. */
+#if defined (__STDC__)
+
+#define YY_USE_CONST
+
+#endif /* defined (__STDC__) */
+#endif /* ! __cplusplus */
+
+#ifdef YY_USE_CONST
+#define yyconst const
+#else
+#define yyconst
+#endif
+
+/* An opaque pointer. */
+#ifndef YY_TYPEDEF_YY_SCANNER_T
+#define YY_TYPEDEF_YY_SCANNER_T
+typedef void* yyscan_t;
+#endif
+
+/* For convenience, these vars (plus the bison vars far below)
+ are macros in the reentrant scanner. */
+#define yyin yyg->yyin_r
+#define yyout yyg->yyout_r
+#define yyextra yyg->yyextra_r
+#define yyleng yyg->yyleng_r
+#define yytext yyg->yytext_r
+#define yylineno (YY_CURRENT_BUFFER_LVALUE->yy_bs_lineno)
+#define yycolumn (YY_CURRENT_BUFFER_LVALUE->yy_bs_column)
+#define yy_flex_debug yyg->yy_flex_debug_r
+
+/* Size of default input buffer. */
+#ifndef YY_BUF_SIZE
+#ifdef __ia64__
+/* On IA-64, the buffer size is 16k, not 8k.
+ * Moreover, YY_BUF_SIZE is 2*YY_READ_BUF_SIZE in the general case.
+ * Ditto for the __ia64__ case accordingly.
+ */
+#define YY_BUF_SIZE 32768
+#else
+#define YY_BUF_SIZE 16384
+#endif /* __ia64__ */
+#endif
+
+#ifndef YY_TYPEDEF_YY_BUFFER_STATE
+#define YY_TYPEDEF_YY_BUFFER_STATE
+typedef struct yy_buffer_state *YY_BUFFER_STATE;
+#endif
+
+#ifndef YY_TYPEDEF_YY_SIZE_T
+#define YY_TYPEDEF_YY_SIZE_T
+typedef size_t yy_size_t;
+#endif
+
+#ifndef YY_STRUCT_YY_BUFFER_STATE
+#define YY_STRUCT_YY_BUFFER_STATE
+struct yy_buffer_state
+ {
+ FILE *yy_input_file;
+
+ char *yy_ch_buf; /* input buffer */
+ char *yy_buf_pos; /* current position in input buffer */
+
+ /* Size of input buffer in bytes, not including room for EOB
+ * characters.
+ */
+ yy_size_t yy_buf_size;
+
+ /* Number of characters read into yy_ch_buf, not including EOB
+ * characters.
+ */
+ int yy_n_chars;
+
+ /* Whether we "own" the buffer - i.e., we know we created it,
+ * and can realloc() it to grow it, and should free() it to
+ * delete it.
+ */
+ int yy_is_our_buffer;
+
+ /* Whether this is an "interactive" input source; if so, and
+ * if we're using stdio for input, then we want to use getc()
+ * instead of fread(), to make sure we stop fetching input after
+ * each newline.
+ */
+ int yy_is_interactive;
+
+ /* Whether we're considered to be at the beginning of a line.
+ * If so, '^' rules will be active on the next match, otherwise
+ * not.
+ */
+ int yy_at_bol;
+
+ int yy_bs_lineno; /**< The line count. */
+ int yy_bs_column; /**< The column count. */
+
+ /* Whether to try to fill the input buffer when we reach the
+ * end of it.
+ */
+ int yy_fill_buffer;
+
+ int yy_buffer_status;
+
+ };
+#endif /* !YY_STRUCT_YY_BUFFER_STATE */
+
+void message_restart (FILE *input_file ,yyscan_t yyscanner );
+void message__switch_to_buffer (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
+YY_BUFFER_STATE message__create_buffer (FILE *file,int size ,yyscan_t yyscanner );
+void message__delete_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
+void message__flush_buffer (YY_BUFFER_STATE b ,yyscan_t yyscanner );
+void message_push_buffer_state (YY_BUFFER_STATE new_buffer ,yyscan_t yyscanner );
+void message_pop_buffer_state (yyscan_t yyscanner );
+
+YY_BUFFER_STATE message__scan_buffer (char *base,yy_size_t size ,yyscan_t yyscanner );
+YY_BUFFER_STATE message__scan_string (yyconst char *yy_str ,yyscan_t yyscanner );
+YY_BUFFER_STATE message__scan_bytes (yyconst char *bytes,int len ,yyscan_t yyscanner );
+
+void *message_alloc (yy_size_t ,yyscan_t yyscanner );
+void *message_realloc (void *,yy_size_t ,yyscan_t yyscanner );
+void message_free (void * ,yyscan_t yyscanner );
+
+/* Begin user sect3 */
+
+#define message_wrap(n) 1
+#define YY_SKIP_YYWRAP
+
+#define yytext_ptr yytext_r
+
+#ifdef YY_HEADER_EXPORT_START_CONDITIONS
+#define INITIAL 0
+#define MATCH_STRING_STATE 1
+#define MATCH_RESPONSE_CODE_STATE 2
+#define SUPPORTED_METHODS_STATE 3
+#define CONTENT_TYPE_STATE 4
+#define SESSION_STATE 5
+#define MATCH_PRESENTATION_URL 6
+#define NUM_AS_HEX_MODE 7
+#define MATCH_EDID_STATE 8
+
+#endif
+
+#ifndef YY_NO_UNISTD_H
+/* Special case for "unistd.h", since it is non-ANSI. We include it way
+ * down here because we want the user's section 1 to have been scanned first.
+ * The user has a chance to override it with an option.
+ */
+#include <unistd.h>
+#endif
+
+#define YY_EXTRA_TYPE bool
+
+int message_lex_init (yyscan_t* scanner);
+
+int message_lex_init_extra (YY_EXTRA_TYPE user_defined,yyscan_t* scanner);
+
+/* Accessor methods to globals.
+ These are made visible to non-reentrant scanners for convenience. */
+
+int message_lex_destroy (yyscan_t yyscanner );
+
+int message_get_debug (yyscan_t yyscanner );
+
+void message_set_debug (int debug_flag ,yyscan_t yyscanner );
+
+YY_EXTRA_TYPE message_get_extra (yyscan_t yyscanner );
+
+void message_set_extra (YY_EXTRA_TYPE user_defined ,yyscan_t yyscanner );
+
+FILE *message_get_in (yyscan_t yyscanner );
+
+void message_set_in (FILE * in_str ,yyscan_t yyscanner );
+
+FILE *message_get_out (yyscan_t yyscanner );
+
+void message_set_out (FILE * out_str ,yyscan_t yyscanner );
+
+int message_get_leng (yyscan_t yyscanner );
+
+char *message_get_text (yyscan_t yyscanner );
+
+int message_get_lineno (yyscan_t yyscanner );
+
+void message_set_lineno (int line_number ,yyscan_t yyscanner );
+
+YYSTYPE * message_get_lval (yyscan_t yyscanner );
+
+void message_set_lval (YYSTYPE * yylval_param ,yyscan_t yyscanner );
+
+/* Macros after this point can all be overridden by user definitions in
+ * section 1.
+ */
+
+#ifndef YY_SKIP_YYWRAP
+#ifdef __cplusplus
+extern "C" int message_wrap (yyscan_t yyscanner );
+#else
+extern int message_wrap (yyscan_t yyscanner );
+#endif
+#endif
+
+#ifndef yytext_ptr
+static void yy_flex_strncpy (char *,yyconst char *,int ,yyscan_t yyscanner);
+#endif
+
+#ifdef YY_NEED_STRLEN
+static int yy_flex_strlen (yyconst char * ,yyscan_t yyscanner);
+#endif
+
+#ifndef YY_NO_INPUT
+
+#endif
+
+/* Amount of stuff to slurp up with each read. */
+#ifndef YY_READ_BUF_SIZE
+#ifdef __ia64__
+/* On IA-64, the buffer size is 16k, not 8k */
+#define YY_READ_BUF_SIZE 16384
+#else
+#define YY_READ_BUF_SIZE 8192
+#endif /* __ia64__ */
+#endif
+
+/* Number of entries by which start-condition stack grows. */
+#ifndef YY_START_STACK_INCR
+#define YY_START_STACK_INCR 25
+#endif
+
+/* Default declaration of generated scanner - a define so the user can
+ * easily add parameters.
+ */
+#ifndef YY_DECL
+#define YY_DECL_IS_OURS 1
+
+extern int message_lex \
+ (YYSTYPE * yylval_param ,yyscan_t yyscanner);
+
+#define YY_DECL int message_lex \
+ (YYSTYPE * yylval_param , yyscan_t yyscanner)
+#endif /* !YY_DECL */
+
+/* yy_get_previous_state - get the state just before the EOB char was reached */
+
+#undef YY_NEW_FILE
+#undef YY_FLUSH_BUFFER
+#undef yy_set_bol
+#undef yy_new_buffer
+#undef yy_set_interactive
+#undef YY_DO_BEFORE_ACTION
+
+#ifdef YY_DECL_IS_OURS
+#undef YY_DECL_IS_OURS
+#undef YY_DECL
+#endif
+
+#line 383 "gen/messagescanner.h"
+#undef message_IN_HEADER
+#endif /* message_HEADER_H */
diff --git a/chromium/third_party/wds/gen/parser.cpp b/chromium/third_party/wds/gen/parser.cpp
new file mode 100644
index 00000000000..ed1cd1e5930
--- /dev/null
+++ b/chromium/third_party/wds/gen/parser.cpp
@@ -0,0 +1,3651 @@
+/* A Bison parser, made by GNU Bison 3.0.2. */
+
+/* Bison implementation for Yacc-like parsers in C
+
+ Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* As a special exception, you may create a larger work that contains
+ part or all of the Bison parser skeleton and distribute that work
+ under terms of your choice, so long as that work isn't itself a
+ parser generator using the skeleton or a modified version thereof
+ as a parser skeleton. Alternatively, if you modify or redistribute
+ the parser skeleton itself, you may (at your option) remove this
+ special exception, which will cause the skeleton and the resulting
+ Bison output files to be licensed under the GNU General Public
+ License without this special exception.
+
+ This special exception was added by the Free Software Foundation in
+ version 2.2 of Bison. */
+
+/* C LALR(1) parser skeleton written by Richard Stallman, by
+ simplifying the original so-called "semantic" parser. */
+
+/* All symbols defined below should begin with yy or YY, to avoid
+ infringing on user name space. This should be done even for local
+ variables, as they might otherwise be expanded by user macros.
+ There are some unavoidable exceptions within include files to
+ define necessary library symbols; they are noted "INFRINGES ON
+ USER NAME SPACE" below. */
+
+/* Identify Bison output. */
+#define YYBISON 1
+
+/* Bison version. */
+#define YYBISON_VERSION "3.0.2"
+
+/* Skeleton name. */
+#define YYSKELETON_NAME "yacc.c"
+
+/* Pure parsers. */
+#define YYPURE 1
+
+/* Push parsers. */
+#define YYPUSH 0
+
+/* Pull parsers. */
+#define YYPULL 1
+
+
+/* Substitute the variable and function names. */
+#define yyparse wds_parse
+#define yylex wds_lex
+#define yyerror wds_error
+#define yydebug wds_debug
+#define yynerrs wds_nerrs
+
+
+/* Copy the first part of user declarations. */
+
+
+
+# ifndef YY_NULLPTR
+# if defined __cplusplus && 201103L <= __cplusplus
+# define YY_NULLPTR nullptr
+# else
+# define YY_NULLPTR 0
+# endif
+# endif
+
+/* Enabling verbose error messages. */
+#ifdef YYERROR_VERBOSE
+# undef YYERROR_VERBOSE
+# define YYERROR_VERBOSE 1
+#else
+# define YYERROR_VERBOSE 0
+#endif
+
+/* In a future release of Bison, this section will be replaced
+ by #include "parser.h". */
+#ifndef YY_WDS_GEN_PARSER_H_INCLUDED
+# define YY_WDS_GEN_PARSER_H_INCLUDED
+/* Debug traces. */
+#ifndef YYDEBUG
+# define YYDEBUG 0
+#endif
+#if YYDEBUG
+extern int wds_debug;
+#endif
+/* "%code requires" blocks. */
+
+
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2015 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+ #include <map>
+ #include <memory>
+ #include "libwds/rtsp/audiocodecs.h"
+ #include "libwds/rtsp/contentprotection.h"
+ #include "libwds/rtsp/triggermethod.h"
+ #include "libwds/rtsp/route.h"
+ #include "libwds/rtsp/uibcsetting.h"
+ #include "libwds/rtsp/uibccapability.h"
+
+ #define YYLEX_PARAM scanner
+
+ namespace wds {
+ struct AudioCodec;
+ namespace rtsp {
+ class Driver;
+ class Scanner;
+ class Message;
+ class Header;
+ class TransportHeader;
+ class Property;
+ class PropertyErrors;
+ class Payload;
+ class VideoFormats;
+ struct H264Codec;
+ struct H264Codec3d;
+ }
+ }
+
+
+
+/* Token type. */
+#ifndef YYTOKENTYPE
+# define YYTOKENTYPE
+ enum yytokentype
+ {
+ END = 0,
+ WFD_SP = 258,
+ WFD_NUM = 259,
+ WFD_OPTIONS = 260,
+ WFD_SET_PARAMETER = 261,
+ WFD_GET_PARAMETER = 262,
+ WFD_SETUP = 263,
+ WFD_PLAY = 264,
+ WFD_TEARDOWN = 265,
+ WFD_PAUSE = 266,
+ WFD_END = 267,
+ WFD_RESPONSE = 268,
+ WFD_RESPONSE_CODE = 269,
+ WFD_STRING = 270,
+ WFD_GENERIC_PROPERTY = 271,
+ WFD_HEADER = 272,
+ WFD_CSEQ = 273,
+ WFD_RESPONSE_METHODS = 274,
+ WFD_TAG = 275,
+ WFD_SUPPORT_CHECK = 276,
+ WFD_REQUEST_URI = 277,
+ WFD_CONTENT_TYPE = 278,
+ WFD_MIME = 279,
+ WFD_CONTENT_LENGTH = 280,
+ WFD_AUDIO_CODECS = 281,
+ WFD_VIDEO_FORMATS = 282,
+ WFD_3D_FORMATS = 283,
+ WFD_CONTENT_PROTECTION = 284,
+ WFD_DISPLAY_EDID = 285,
+ WFD_COUPLED_SINK = 286,
+ WFD_TRIGGER_METHOD = 287,
+ WFD_PRESENTATION_URL = 288,
+ WFD_CLIENT_RTP_PORTS = 289,
+ WFD_ROUTE = 290,
+ WFD_I2C = 291,
+ WFD_AV_FORMAT_CHANGE_TIMING = 292,
+ WFD_PREFERRED_DISPLAY_MODE = 293,
+ WFD_UIBC_CAPABILITY = 294,
+ WFD_UIBC_SETTING = 295,
+ WFD_STANDBY_RESUME_CAPABILITY = 296,
+ WFD_STANDBY_IN_REQUEST = 297,
+ WFD_STANDBY_IN_RESPONSE = 298,
+ WFD_CONNECTOR_TYPE = 299,
+ WFD_IDR_REQUEST = 300,
+ WFD_AUDIO_CODECS_ERROR = 301,
+ WFD_VIDEO_FORMATS_ERROR = 302,
+ WFD_3D_FORMATS_ERROR = 303,
+ WFD_CONTENT_PROTECTION_ERROR = 304,
+ WFD_DISPLAY_EDID_ERROR = 305,
+ WFD_COUPLED_SINK_ERROR = 306,
+ WFD_TRIGGER_METHOD_ERROR = 307,
+ WFD_PRESENTATION_URL_ERROR = 308,
+ WFD_CLIENT_RTP_PORTS_ERROR = 309,
+ WFD_ROUTE_ERROR = 310,
+ WFD_I2C_ERROR = 311,
+ WFD_AV_FORMAT_CHANGE_TIMING_ERROR = 312,
+ WFD_PREFERRED_DISPLAY_MODE_ERROR = 313,
+ WFD_UIBC_CAPABILITY_ERROR = 314,
+ WFD_UIBC_SETTING_ERROR = 315,
+ WFD_STANDBY_RESUME_CAPABILITY_ERROR = 316,
+ WFD_STANDBY_ERROR = 317,
+ WFD_CONNECTOR_TYPE_ERROR = 318,
+ WFD_IDR_REQUEST_ERROR = 319,
+ WFD_GENERIC_PROPERTY_ERROR = 320,
+ WFD_NONE = 321,
+ WFD_AUDIO_CODEC_LPCM = 322,
+ WFD_AUDIO_CODEC_AAC = 323,
+ WFD_AUDIO_CODEC_AC3 = 324,
+ WFD_HDCP_SPEC_2_0 = 325,
+ WFD_HDCP_SPEC_2_1 = 326,
+ WFD_IP_PORT = 327,
+ WFD_PRESENTATION_URL_0 = 328,
+ WFD_PRESENTATION_URL_1 = 329,
+ WFD_STREAM_PROFILE = 330,
+ WFD_MODE_PLAY = 331,
+ WFD_ROUTE_PRIMARY = 332,
+ WFD_ROUTE_SECONDARY = 333,
+ WFD_INPUT_CATEGORY_LIST = 334,
+ WFD_INPUT_CATEGORY_GENERIC = 335,
+ WFD_INPUT_CATEGORY_HIDC = 336,
+ WFD_GENERIC_CAP_LIST = 337,
+ WFD_INPUT_TYPE_KEYBOARD = 338,
+ WFD_INPUT_TYPE_MOUSE = 339,
+ WFD_INPUT_TYPE_SINGLE_TOUCH = 340,
+ WFD_INPUT_TYPE_MULTI_TOUCH = 341,
+ WFD_INPUT_TYPE_JOYSTICK = 342,
+ WFD_INPUT_TYPE_CAMERA = 343,
+ WFD_INPUT_TYPE_GESTURE = 344,
+ WFD_INPUT_TYPE_REMOTE_CONTROL = 345,
+ WFD_HIDC_CAP_LIST = 346,
+ WFD_INPUT_PATH_INFRARED = 347,
+ WFD_INPUT_PATH_USB = 348,
+ WFD_INPUT_PATH_BT = 349,
+ WFD_INPUT_PATH_WIFI = 350,
+ WFD_INPUT_PATH_ZIGBEE = 351,
+ WFD_INPUT_PATH_NOSP = 352,
+ WFD_UIBC_SETTING_ENABLE = 353,
+ WFD_UIBC_SETTING_DISABLE = 354,
+ WFD_SUPPORTED = 355,
+ WFD_SESSION = 356,
+ WFD_SESSION_ID = 357,
+ WFD_TIMEOUT = 358,
+ WFD_TRANSPORT = 359,
+ WFD_SERVER_PORT = 360
+ };
+#endif
+
+/* Value type. */
+#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
+typedef union YYSTYPE YYSTYPE;
+union YYSTYPE
+{
+
+
+ std::string* sval;
+ unsigned long long int nval;
+ bool bool_val;
+ std::vector<std::string>* vsval;
+ wds::rtsp::Message* message;
+ wds::rtsp::Header* header;
+ wds::rtsp::Payload* mpayload;
+ wds::AudioFormats audio_format;
+ wds::rtsp::Property* property;
+ std::vector<unsigned short>* error_list;
+ wds::rtsp::PropertyErrors* property_errors;
+ std::map<wds::rtsp::PropertyType, std::shared_ptr<wds::rtsp::PropertyErrors>>* property_error_map;
+ std::vector<wds::rtsp::H264Codec>* codecs;
+ wds::rtsp::H264Codec* codec;
+ std::vector<wds::rtsp::H264Codec3d>* codecs_3d;
+ wds::rtsp::H264Codec3d* codec_3d;
+ wds::rtsp::ContentProtection::HDCPSpec hdcp_spec;
+ wds::rtsp::TriggerMethod::Method trigger_method;
+ wds::rtsp::Route::Destination route_destination;
+ bool uibc_setting;
+ std::vector<wds::rtsp::UIBCCapability::InputCategory>* input_category_list;
+ std::vector<wds::rtsp::UIBCCapability::InputType>* generic_cap_list;
+ std::vector<wds::rtsp::UIBCCapability::DetailedCapability>* hidc_cap_list;
+ wds::rtsp::UIBCCapability::InputCategory input_category_list_value;
+ wds::rtsp::UIBCCapability::InputType generic_cap_list_value;
+ wds::rtsp::UIBCCapability::DetailedCapability* hidc_cap_list_value;
+ wds::rtsp::UIBCCapability::InputPath input_path;
+ wds::rtsp::Method method;
+ std::vector<wds::rtsp::Method>* methods;
+ wds::rtsp::PropertyType parameter;
+ std::vector<wds::rtsp::PropertyType>* parameters;
+ std::vector<wds::AudioCodec>* audio_codecs;
+ wds::AudioCodec* audio_codec;
+ std::pair<std::string, unsigned int>* session_info;
+ wds::rtsp::TransportHeader* transport;
+
+
+};
+# define YYSTYPE_IS_TRIVIAL 1
+# define YYSTYPE_IS_DECLARED 1
+#endif
+
+
+
+int wds_parse (void* scanner, std::unique_ptr<wds::rtsp::Message>& message);
+
+#endif /* !YY_WDS_GEN_PARSER_H_INCLUDED */
+
+/* Copy the second part of user declarations. */
+
+
+/* Unqualified %code blocks. */
+
+
+#include <iostream>
+#include <cstdlib>
+#include <string>
+#include <vector>
+#include <map>
+
+#include "libwds/rtsp/driver.h"
+#include "libwds/rtsp/message.h"
+#include "libwds/rtsp/header.h"
+#include "libwds/rtsp/transportheader.h"
+#include "libwds/rtsp/payload.h"
+#include "libwds/rtsp/reply.h"
+#include "libwds/rtsp/options.h"
+#include "libwds/rtsp/getparameter.h"
+#include "libwds/rtsp/setparameter.h"
+#include "libwds/rtsp/play.h"
+#include "libwds/rtsp/teardown.h"
+#include "libwds/rtsp/pause.h"
+#include "libwds/rtsp/setup.h"
+#include "libwds/rtsp/audiocodecs.h"
+#include "libwds/rtsp/videoformats.h"
+#include "libwds/rtsp/formats3d.h"
+#include "libwds/rtsp/contentprotection.h"
+#include "libwds/rtsp/displayedid.h"
+#include "libwds/rtsp/coupledsink.h"
+#include "libwds/rtsp/triggermethod.h"
+#include "libwds/rtsp/clientrtpports.h"
+#include "libwds/rtsp/i2c.h"
+#include "libwds/rtsp/avformatchangetiming.h"
+#include "libwds/rtsp/standbyresumecapability.h"
+#include "libwds/rtsp/standby.h"
+#include "libwds/rtsp/idrrequest.h"
+#include "libwds/rtsp/connectortype.h"
+#include "libwds/rtsp/preferreddisplaymode.h"
+#include "libwds/rtsp/presentationurl.h"
+#include "libwds/rtsp/uibccapability.h"
+
+#define UNUSED_TOKEN(T) (void)T
+#define DELETE_TOKEN(T) \
+ delete T; \
+ T = nullptr
+
+
+
+#ifdef short
+# undef short
+#endif
+
+#ifdef YYTYPE_UINT8
+typedef YYTYPE_UINT8 yytype_uint8;
+#else
+typedef unsigned char yytype_uint8;
+#endif
+
+#ifdef YYTYPE_INT8
+typedef YYTYPE_INT8 yytype_int8;
+#else
+typedef signed char yytype_int8;
+#endif
+
+#ifdef YYTYPE_UINT16
+typedef YYTYPE_UINT16 yytype_uint16;
+#else
+typedef unsigned short int yytype_uint16;
+#endif
+
+#ifdef YYTYPE_INT16
+typedef YYTYPE_INT16 yytype_int16;
+#else
+typedef short int yytype_int16;
+#endif
+
+#ifndef YYSIZE_T
+# ifdef __SIZE_TYPE__
+# define YYSIZE_T __SIZE_TYPE__
+# elif defined size_t
+# define YYSIZE_T size_t
+# elif ! defined YYSIZE_T
+# include <stddef.h> /* INFRINGES ON USER NAME SPACE */
+# define YYSIZE_T size_t
+# else
+# define YYSIZE_T unsigned int
+# endif
+#endif
+
+#define YYSIZE_MAXIMUM ((YYSIZE_T) -1)
+
+#ifndef YY_
+# if defined YYENABLE_NLS && YYENABLE_NLS
+# if ENABLE_NLS
+# include <libintl.h> /* INFRINGES ON USER NAME SPACE */
+# define YY_(Msgid) dgettext ("bison-runtime", Msgid)
+# endif
+# endif
+# ifndef YY_
+# define YY_(Msgid) Msgid
+# endif
+#endif
+
+#ifndef YY_ATTRIBUTE
+# if (defined __GNUC__ \
+ && (2 < __GNUC__ || (__GNUC__ == 2 && 96 <= __GNUC_MINOR__))) \
+ || defined __SUNPRO_C && 0x5110 <= __SUNPRO_C
+# define YY_ATTRIBUTE(Spec) __attribute__(Spec)
+# else
+# define YY_ATTRIBUTE(Spec) /* empty */
+# endif
+#endif
+
+#ifndef YY_ATTRIBUTE_PURE
+# define YY_ATTRIBUTE_PURE YY_ATTRIBUTE ((__pure__))
+#endif
+
+#ifndef YY_ATTRIBUTE_UNUSED
+# define YY_ATTRIBUTE_UNUSED YY_ATTRIBUTE ((__unused__))
+#endif
+
+#if !defined _Noreturn \
+ && (!defined __STDC_VERSION__ || __STDC_VERSION__ < 201112)
+# if defined _MSC_VER && 1200 <= _MSC_VER
+# define _Noreturn __declspec (noreturn)
+# else
+# define _Noreturn YY_ATTRIBUTE ((__noreturn__))
+# endif
+#endif
+
+/* Suppress unused-variable warnings by "using" E. */
+#if ! defined lint || defined __GNUC__
+# define YYUSE(E) ((void) (E))
+#else
+# define YYUSE(E) /* empty */
+#endif
+
+#if defined __GNUC__ && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
+/* Suppress an incorrect diagnostic about yylval being uninitialized. */
+# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN \
+ _Pragma ("GCC diagnostic push") \
+ _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")\
+ _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
+# define YY_IGNORE_MAYBE_UNINITIALIZED_END \
+ _Pragma ("GCC diagnostic pop")
+#else
+# define YY_INITIAL_VALUE(Value) Value
+#endif
+#ifndef YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
+# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
+# define YY_IGNORE_MAYBE_UNINITIALIZED_END
+#endif
+#ifndef YY_INITIAL_VALUE
+# define YY_INITIAL_VALUE(Value) /* Nothing. */
+#endif
+
+
+#if ! defined yyoverflow || YYERROR_VERBOSE
+
+/* The parser invokes alloca or malloc; define the necessary symbols. */
+
+# ifdef YYSTACK_USE_ALLOCA
+# if YYSTACK_USE_ALLOCA
+# ifdef __GNUC__
+# define YYSTACK_ALLOC __builtin_alloca
+# elif defined __BUILTIN_VA_ARG_INCR
+# include <alloca.h> /* INFRINGES ON USER NAME SPACE */
+# elif defined _AIX
+# define YYSTACK_ALLOC __alloca
+# elif defined _MSC_VER
+# include <malloc.h> /* INFRINGES ON USER NAME SPACE */
+# define alloca _alloca
+# else
+# define YYSTACK_ALLOC alloca
+# if ! defined _ALLOCA_H && ! defined EXIT_SUCCESS
+# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
+ /* Use EXIT_SUCCESS as a witness for stdlib.h. */
+# ifndef EXIT_SUCCESS
+# define EXIT_SUCCESS 0
+# endif
+# endif
+# endif
+# endif
+# endif
+
+# ifdef YYSTACK_ALLOC
+ /* Pacify GCC's 'empty if-body' warning. */
+# define YYSTACK_FREE(Ptr) do { /* empty */; } while (0)
+# ifndef YYSTACK_ALLOC_MAXIMUM
+ /* The OS might guarantee only one guard page at the bottom of the stack,
+ and a page size can be as small as 4096 bytes. So we cannot safely
+ invoke alloca (N) if N exceeds 4096. Use a slightly smaller number
+ to allow for a few compiler-allocated temporary stack slots. */
+# define YYSTACK_ALLOC_MAXIMUM 4032 /* reasonable circa 2006 */
+# endif
+# else
+# define YYSTACK_ALLOC YYMALLOC
+# define YYSTACK_FREE YYFREE
+# ifndef YYSTACK_ALLOC_MAXIMUM
+# define YYSTACK_ALLOC_MAXIMUM YYSIZE_MAXIMUM
+# endif
+# if (defined __cplusplus && ! defined EXIT_SUCCESS \
+ && ! ((defined YYMALLOC || defined malloc) \
+ && (defined YYFREE || defined free)))
+# include <stdlib.h> /* INFRINGES ON USER NAME SPACE */
+# ifndef EXIT_SUCCESS
+# define EXIT_SUCCESS 0
+# endif
+# endif
+# ifndef YYMALLOC
+# define YYMALLOC malloc
+# if ! defined malloc && ! defined EXIT_SUCCESS
+void *malloc (YYSIZE_T); /* INFRINGES ON USER NAME SPACE */
+# endif
+# endif
+# ifndef YYFREE
+# define YYFREE free
+# if ! defined free && ! defined EXIT_SUCCESS
+void free (void *); /* INFRINGES ON USER NAME SPACE */
+# endif
+# endif
+# endif
+#endif /* ! defined yyoverflow || YYERROR_VERBOSE */
+
+
+#if (! defined yyoverflow \
+ && (! defined __cplusplus \
+ || (defined YYSTYPE_IS_TRIVIAL && YYSTYPE_IS_TRIVIAL)))
+
+/* A type that is properly aligned for any stack member. */
+union yyalloc
+{
+ yytype_int16 yyss_alloc;
+ YYSTYPE yyvs_alloc;
+};
+
+/* The size of the maximum gap between one aligned stack and the next. */
+# define YYSTACK_GAP_MAXIMUM (sizeof (union yyalloc) - 1)
+
+/* The size of an array large to enough to hold all stacks, each with
+ N elements. */
+# define YYSTACK_BYTES(N) \
+ ((N) * (sizeof (yytype_int16) + sizeof (YYSTYPE)) \
+ + YYSTACK_GAP_MAXIMUM)
+
+# define YYCOPY_NEEDED 1
+
+/* Relocate STACK from its old location to the new one. The
+ local variables YYSIZE and YYSTACKSIZE give the old and new number of
+ elements in the stack, and YYPTR gives the new location of the
+ stack. Advance YYPTR to a properly aligned location for the next
+ stack. */
+# define YYSTACK_RELOCATE(Stack_alloc, Stack) \
+ do \
+ { \
+ YYSIZE_T yynewbytes; \
+ YYCOPY (&yyptr->Stack_alloc, Stack, yysize); \
+ Stack = &yyptr->Stack_alloc; \
+ yynewbytes = yystacksize * sizeof (*Stack) + YYSTACK_GAP_MAXIMUM; \
+ yyptr += yynewbytes / sizeof (*yyptr); \
+ } \
+ while (0)
+
+#endif
+
+#if defined YYCOPY_NEEDED && YYCOPY_NEEDED
+/* Copy COUNT objects from SRC to DST. The source and destination do
+ not overlap. */
+# ifndef YYCOPY
+# if defined __GNUC__ && 1 < __GNUC__
+# define YYCOPY(Dst, Src, Count) \
+ __builtin_memcpy (Dst, Src, (Count) * sizeof (*(Src)))
+# else
+# define YYCOPY(Dst, Src, Count) \
+ do \
+ { \
+ YYSIZE_T yyi; \
+ for (yyi = 0; yyi < (Count); yyi++) \
+ (Dst)[yyi] = (Src)[yyi]; \
+ } \
+ while (0)
+# endif
+# endif
+#endif /* !YYCOPY_NEEDED */
+
+/* YYFINAL -- State number of the termination state. */
+#define YYFINAL 130
+/* YYLAST -- Last index in YYTABLE. */
+#define YYLAST 498
+
+/* YYNTOKENS -- Number of terminals. */
+#define YYNTOKENS 112
+/* YYNNTS -- Number of nonterminals. */
+#define YYNNTS 76
+/* YYNRULES -- Number of rules. */
+#define YYNRULES 218
+/* YYNSTATES -- Number of states. */
+#define YYNSTATES 515
+
+/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
+ by yylex, with out-of-bounds checking. */
+#define YYUNDEFTOK 2
+#define YYMAXUTOK 360
+
+#define YYTRANSLATE(YYX) \
+ ((unsigned int) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
+
+/* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
+ as returned by yylex, without out-of-bounds checking. */
+static const yytype_uint8 yytranslate[] =
+{
+ 0, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 106, 2, 108, 107, 2, 111, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 109, 110,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 1, 2, 3, 4,
+ 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
+ 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
+ 25, 26, 27, 28, 29, 30, 31, 32, 33, 34,
+ 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
+ 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
+ 55, 56, 57, 58, 59, 60, 61, 62, 63, 64,
+ 65, 66, 67, 68, 69, 70, 71, 72, 73, 74,
+ 75, 76, 77, 78, 79, 80, 81, 82, 83, 84,
+ 85, 86, 87, 88, 89, 90, 91, 92, 93, 94,
+ 95, 96, 97, 98, 99, 100, 101, 102, 103, 104,
+ 105
+};
+
+#if YYDEBUG
+ /* YYRLINE[YYN] -- Source line where rule number YYN was defined. */
+static const yytype_uint16 yyrline[] =
+{
+ 0, 319, 319, 323, 327, 333, 341, 342, 343, 344,
+ 345, 346, 347, 348, 352, 355, 362, 369, 376, 383,
+ 390, 397, 404, 411, 414, 415, 416, 420, 421, 425,
+ 430, 431, 439, 445, 451, 457, 461, 468, 472, 477,
+ 482, 488, 494, 504, 510, 514, 521, 522, 523, 524,
+ 525, 526, 527, 528, 531, 533, 536, 539, 540, 541,
+ 546, 553, 557, 565, 573, 574, 575, 576, 577, 578,
+ 579, 580, 581, 582, 583, 584, 585, 586, 587, 588,
+ 589, 590, 594, 598, 603, 607, 611, 615, 619, 623,
+ 627, 631, 635, 639, 643, 647, 651, 655, 659, 663,
+ 667, 671, 675, 683, 687, 696, 700, 709, 710, 711,
+ 712, 713, 714, 715, 716, 717, 718, 719, 720, 721,
+ 722, 723, 724, 725, 726, 729, 732, 740, 744, 750,
+ 755, 763, 769, 770, 771, 775, 779, 786, 791, 800,
+ 806, 811, 819, 825, 828, 832, 835, 840, 844, 850,
+ 853, 859, 862, 868, 871, 878, 881, 885, 888, 894,
+ 897, 901, 907, 910, 913, 916, 922, 930, 933, 937,
+ 940, 944, 949, 955, 958, 964, 970, 973, 977, 984,
+ 991, 994, 1003, 1009, 1012, 1016, 1022, 1025, 1031, 1037,
+ 1040, 1044, 1050, 1053, 1056, 1059, 1062, 1065, 1068, 1071,
+ 1077, 1083, 1086, 1091, 1098, 1105, 1108, 1111, 1114, 1117,
+ 1120, 1126, 1132, 1135, 1141, 1147, 1150, 1156, 1159
+};
+#endif
+
+#if YYDEBUG || YYERROR_VERBOSE || 0
+/* YYTNAME[SYMBOL-NUM] -- String name of the symbol SYMBOL-NUM.
+ First, the terminals, then, starting at YYNTOKENS, nonterminals. */
+static const char *const yytname[] =
+{
+ "END", "error", "$undefined", "WFD_SP", "WFD_NUM", "WFD_OPTIONS",
+ "WFD_SET_PARAMETER", "WFD_GET_PARAMETER", "WFD_SETUP", "WFD_PLAY",
+ "WFD_TEARDOWN", "WFD_PAUSE", "WFD_END", "WFD_RESPONSE",
+ "WFD_RESPONSE_CODE", "WFD_STRING", "WFD_GENERIC_PROPERTY", "WFD_HEADER",
+ "WFD_CSEQ", "WFD_RESPONSE_METHODS", "WFD_TAG", "WFD_SUPPORT_CHECK",
+ "WFD_REQUEST_URI", "WFD_CONTENT_TYPE", "WFD_MIME", "WFD_CONTENT_LENGTH",
+ "WFD_AUDIO_CODECS", "WFD_VIDEO_FORMATS", "WFD_3D_FORMATS",
+ "WFD_CONTENT_PROTECTION", "WFD_DISPLAY_EDID", "WFD_COUPLED_SINK",
+ "WFD_TRIGGER_METHOD", "WFD_PRESENTATION_URL", "WFD_CLIENT_RTP_PORTS",
+ "WFD_ROUTE", "WFD_I2C", "WFD_AV_FORMAT_CHANGE_TIMING",
+ "WFD_PREFERRED_DISPLAY_MODE", "WFD_UIBC_CAPABILITY", "WFD_UIBC_SETTING",
+ "WFD_STANDBY_RESUME_CAPABILITY", "WFD_STANDBY_IN_REQUEST",
+ "WFD_STANDBY_IN_RESPONSE", "WFD_CONNECTOR_TYPE", "WFD_IDR_REQUEST",
+ "WFD_AUDIO_CODECS_ERROR", "WFD_VIDEO_FORMATS_ERROR",
+ "WFD_3D_FORMATS_ERROR", "WFD_CONTENT_PROTECTION_ERROR",
+ "WFD_DISPLAY_EDID_ERROR", "WFD_COUPLED_SINK_ERROR",
+ "WFD_TRIGGER_METHOD_ERROR", "WFD_PRESENTATION_URL_ERROR",
+ "WFD_CLIENT_RTP_PORTS_ERROR", "WFD_ROUTE_ERROR", "WFD_I2C_ERROR",
+ "WFD_AV_FORMAT_CHANGE_TIMING_ERROR", "WFD_PREFERRED_DISPLAY_MODE_ERROR",
+ "WFD_UIBC_CAPABILITY_ERROR", "WFD_UIBC_SETTING_ERROR",
+ "WFD_STANDBY_RESUME_CAPABILITY_ERROR", "WFD_STANDBY_ERROR",
+ "WFD_CONNECTOR_TYPE_ERROR", "WFD_IDR_REQUEST_ERROR",
+ "WFD_GENERIC_PROPERTY_ERROR", "WFD_NONE", "WFD_AUDIO_CODEC_LPCM",
+ "WFD_AUDIO_CODEC_AAC", "WFD_AUDIO_CODEC_AC3", "WFD_HDCP_SPEC_2_0",
+ "WFD_HDCP_SPEC_2_1", "WFD_IP_PORT", "WFD_PRESENTATION_URL_0",
+ "WFD_PRESENTATION_URL_1", "WFD_STREAM_PROFILE", "WFD_MODE_PLAY",
+ "WFD_ROUTE_PRIMARY", "WFD_ROUTE_SECONDARY", "WFD_INPUT_CATEGORY_LIST",
+ "WFD_INPUT_CATEGORY_GENERIC", "WFD_INPUT_CATEGORY_HIDC",
+ "WFD_GENERIC_CAP_LIST", "WFD_INPUT_TYPE_KEYBOARD",
+ "WFD_INPUT_TYPE_MOUSE", "WFD_INPUT_TYPE_SINGLE_TOUCH",
+ "WFD_INPUT_TYPE_MULTI_TOUCH", "WFD_INPUT_TYPE_JOYSTICK",
+ "WFD_INPUT_TYPE_CAMERA", "WFD_INPUT_TYPE_GESTURE",
+ "WFD_INPUT_TYPE_REMOTE_CONTROL", "WFD_HIDC_CAP_LIST",
+ "WFD_INPUT_PATH_INFRARED", "WFD_INPUT_PATH_USB", "WFD_INPUT_PATH_BT",
+ "WFD_INPUT_PATH_WIFI", "WFD_INPUT_PATH_ZIGBEE", "WFD_INPUT_PATH_NOSP",
+ "WFD_UIBC_SETTING_ENABLE", "WFD_UIBC_SETTING_DISABLE", "WFD_SUPPORTED",
+ "WFD_SESSION", "WFD_SESSION_ID", "WFD_TIMEOUT", "WFD_TRANSPORT",
+ "WFD_SERVER_PORT", "'*'", "'-'", "','", "':'", "';'", "'/'", "$accept",
+ "start", "message", "command", "options", "set_parameter",
+ "get_parameter", "setup", "play", "teardown", "pause", "wfd_reply",
+ "headers", "wfd_cseq", "wfd_content_type", "wfd_content_length",
+ "wfd_session", "wfd_transport", "wfd_supported_methods", "wfd_methods",
+ "wfd_method", "wfd_ows", "payload", "wfd_parameter_list",
+ "wfd_parameter", "wfd_error_list", "wfd_property_errors",
+ "wfd_property_error_map", "wdf_property_map", "wfd_property",
+ "wfd_property_audio_codecs", "wfd_audio_codec_list", "wfd_audio_codec",
+ "wfd_audio_codec_type", "wfd_property_video_formats", "wfd_h264_codecs",
+ "wfd_h264_codec", "wfd_h264_codecs_3d", "wfd_h264_codec_3d",
+ "wfd_max_hres", "wfd_max_vres", "wfd_property_3d_formats",
+ "wfd_content_protection", "hdcp2_spec", "wfd_display_edid",
+ "wfd_edid_payload", "wfd_coupled_sink", "wfd_sink_address",
+ "wfd_trigger_method", "wfd_supported_trigger_methods",
+ "wfd_presentation_url", "wfd_presentation_url0", "wfd_presentation_url1",
+ "wfd_client_rtp_ports", "wfd_route", "wfd_route_destination", "wfd_I2C",
+ "wfd_port", "wfd_av_format_change_timing", "wfd_preferred_display_mode",
+ "wfd_uibc_capability", "wfd_input_category_list",
+ "wfd_input_category_list_values", "wfd_input_category_list_value",
+ "wfd_generic_cap_list", "wfd_generic_cap_list_values",
+ "wfd_generic_cap_list_value", "wfd_hidc_cap_list",
+ "wfd_hidc_cap_list_values", "wfd_hidc_cap_list_value", "wfd_input_path",
+ "wfd_uibc_setting", "wfd_uibc_setting_value",
+ "wfd_standby_resume_capability", "wfd_standby_resume_capability_value",
+ "wfd_connector_type", YY_NULLPTR
+};
+#endif
+
+# ifdef YYPRINT
+/* YYTOKNUM[NUM] -- (External) token number corresponding to the
+ (internal) symbol number NUM (which must be that of a token). */
+static const yytype_uint16 yytoknum[] =
+{
+ 0, 256, 257, 258, 259, 260, 261, 262, 263, 264,
+ 265, 266, 267, 268, 269, 270, 271, 272, 273, 274,
+ 275, 276, 277, 278, 279, 280, 281, 282, 283, 284,
+ 285, 286, 287, 288, 289, 290, 291, 292, 293, 294,
+ 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
+ 305, 306, 307, 308, 309, 310, 311, 312, 313, 314,
+ 315, 316, 317, 318, 319, 320, 321, 322, 323, 324,
+ 325, 326, 327, 328, 329, 330, 331, 332, 333, 334,
+ 335, 336, 337, 338, 339, 340, 341, 342, 343, 344,
+ 345, 346, 347, 348, 349, 350, 351, 352, 353, 354,
+ 355, 356, 357, 358, 359, 360, 42, 45, 44, 58,
+ 59, 47
+};
+# endif
+
+#define YYPACT_NINF -432
+
+#define yypact_value_is_default(Yystate) \
+ (!!((Yystate) == (-432)))
+
+#define YYTABLE_NINF -57
+
+#define yytable_value_is_error(Yytable_value) \
+ 0
+
+ /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
+ STATE-NUM. */
+static const yytype_int16 yypact[] =
+{
+ 15, -432, 6, 81, 85, 100, 118, 125, 126, 4,
+ 92, 67, 74, 75, 83, 84, 110, 130, 155, 156,
+ 157, 158, 159, 160, 161, 162, 163, -432, -432, 164,
+ -432, 165, 166, 167, 168, 169, 170, 171, 172, 173,
+ 174, 175, 176, 178, 180, 181, 182, 183, 184, 185,
+ 221, -432, -432, -432, -432, -432, -432, -432, -432, -432,
+ -432, -432, 133, -432, -432, 177, 107, -432, -432, -432,
+ -432, -432, -432, -432, -432, -432, -432, -432, -432, -432,
+ -432, -432, -432, -432, -432, -9, 108, 264, 266, 273,
+ 274, 275, 283, -432, 296, 297, 298, 299, 300, 301,
+ 302, 303, 304, 305, 306, 307, 308, 309, 310, 311,
+ 312, 313, 314, 315, 316, 317, 318, 319, 320, 321,
+ 322, 323, 324, 325, 326, 327, 328, 329, 330, 331,
+ -432, -11, -432, -432, -432, -432, -432, -432, -432, -432,
+ -432, -432, -432, -432, -432, -432, -432, -432, -432, -432,
+ -432, -432, 92, 67, 74, 75, 83, 84, 110, 130,
+ 155, 156, 157, 158, 159, 160, 161, 162, 163, 164,
+ -432, 332, 333, 334, 335, 336, 337, 338, 339, -432,
+ 113, -432, 23, 25, 56, 26, 28, 179, 52, 268,
+ -38, 29, 340, 341, 38, 7, 16, 30, 342, 342,
+ 342, 342, 342, 342, 342, 342, 342, 342, 342, 342,
+ 342, 342, 342, 342, 342, 342, 342, 297, 297, 297,
+ -432, 297, 297, 344, 345, -432, -432, -432, -432, -432,
+ -432, 343, 346, 347, 348, 349, 350, 351, 352, -432,
+ -432, -432, -432, 240, -432, 353, 354, -432, 362, -432,
+ -432, -432, -432, 363, 364, -432, 365, -432, -432, -432,
+ -432, -432, -432, -432, -432, 366, 367, -432, -432, -432,
+ -432, -432, -432, 368, 369, -432, 21, 241, -432, -432,
+ -432, -432, -432, -432, -432, -432, -432, 242, 242, 242,
+ 242, 242, 242, 242, 242, 242, 242, 242, 242, 242,
+ 242, 242, 242, 242, 242, 242, 358, 370, 104, 355,
+ 371, 250, -22, -432, -432, -432, -432, -432, -432, -432,
+ -432, 373, 374, 376, 377, 281, 20, 32, -55, 378,
+ 379, 380, -432, -432, -432, 246, -432, 295, 382, -432,
+ -432, -432, -432, -432, -432, -432, -432, -432, -432, 0,
+ -432, -432, -432, 284, 384, 385, 194, 383, 387, 388,
+ 389, -432, -432, -432, -432, -432, -432, -432, -432, -432,
+ 391, -432, 392, 393, 112, 282, 394, 289, 395, 293,
+ 356, -432, 397, 398, 399, -432, 400, 401, 39, -432,
+ -432, -432, -432, -432, -432, -432, -432, -432, 357, -432,
+ 359, -432, 297, -432, 402, 403, -432, 405, 0, -432,
+ 406, 0, -432, 407, 408, -432, 409, 120, 360, 104,
+ -432, 361, 410, 372, 411, 375, 381, 412, 128, -432,
+ 386, 390, -432, 404, -432, 413, 415, 297, 416, 297,
+ -432, 417, -432, 61, 418, 29, -432, 419, 398, 420,
+ 399, 421, -432, -432, -432, -432, -432, -432, -432, 128,
+ -432, 423, -432, 424, -432, 425, -432, 426, 427, 428,
+ 430, 431, 432, 433, 434, 435, 437, 438, 439, 440,
+ 441, 442, 444, 445, 446, 447, 448, 449, 451, 452,
+ 453, 454, 33, 455, 457, -432, -432, 459, 460, 462,
+ 34, 463, 461, -432, -432, -432, 466, 33, 467, 469,
+ 470, 34, 398, -432, -432
+};
+
+ /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
+ Performed when YYTABLE does not specify something else to do. Zero
+ means the default is an error. */
+static const yytype_uint8 yydefact[] =
+{
+ 0, 5, 0, 0, 0, 0, 0, 0, 0, 0,
+ 63, 64, 65, 66, 67, 68, 69, 70, 71, 72,
+ 73, 74, 75, 76, 77, 78, 79, 80, 124, 81,
+ 125, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 2, 23, 6, 7, 8, 9, 10, 11, 12,
+ 13, 4, 57, 61, 103, 59, 58, 105, 107, 108,
+ 109, 110, 111, 112, 113, 114, 115, 116, 117, 118,
+ 119, 120, 121, 122, 123, 0, 0, 0, 0, 0,
+ 0, 0, 0, 126, 0, 54, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 1, 3, 62, 64, 65, 66, 67, 68, 69, 70,
+ 71, 72, 73, 74, 75, 76, 77, 78, 79, 81,
+ 60, 104, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 106, 0, 0, 0, 0, 0, 0, 0, 0, 22,
+ 0, 55, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 54, 54, 54,
+ 25, 54, 54, 0, 0, 24, 26, 27, 29, 30,
+ 28, 0, 0, 0, 0, 0, 0, 0, 0, 128,
+ 132, 133, 134, 127, 129, 0, 0, 135, 0, 148,
+ 149, 151, 152, 0, 0, 153, 0, 157, 162, 165,
+ 164, 163, 161, 167, 168, 0, 0, 173, 174, 172,
+ 177, 176, 175, 0, 0, 180, 0, 0, 212, 213,
+ 211, 215, 216, 214, 217, 218, 82, 84, 85, 86,
+ 87, 88, 89, 90, 91, 92, 93, 94, 95, 96,
+ 97, 98, 99, 100, 101, 102, 0, 0, 0, 0,
+ 0, 0, 37, 15, 14, 16, 17, 18, 19, 20,
+ 21, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 183, 186, 187, 182, 184, 0, 0, 31,
+ 32, 46, 47, 48, 49, 50, 51, 52, 53, 43,
+ 44, 33, 34, 35, 0, 0, 0, 0, 0, 0,
+ 0, 156, 155, 154, 160, 159, 158, 169, 170, 166,
+ 0, 178, 0, 0, 0, 0, 0, 0, 0, 39,
+ 38, 130, 0, 0, 0, 150, 0, 0, 0, 189,
+ 192, 193, 194, 195, 196, 197, 198, 199, 188, 190,
+ 0, 83, 54, 36, 0, 0, 131, 0, 136, 137,
+ 0, 147, 140, 0, 0, 185, 0, 0, 0, 0,
+ 41, 40, 0, 0, 0, 0, 0, 0, 0, 201,
+ 0, 200, 202, 0, 45, 0, 0, 54, 0, 54,
+ 171, 0, 191, 0, 0, 0, 42, 0, 0, 0,
+ 0, 0, 205, 206, 207, 209, 208, 210, 204, 0,
+ 181, 0, 138, 0, 141, 0, 203, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 144, 143, 0, 0, 0,
+ 0, 0, 0, 146, 145, 142, 0, 0, 0, 0,
+ 0, 0, 0, 139, 179
+};
+
+ /* YYPGOTO[NTERM-NUM]. */
+static const yytype_int16 yypgoto[] =
+{
+ -432, -432, -432, -432, -432, -432, -432, -432, -432, -432,
+ -432, -432, -432, -432, -432, -432, -432, -432, -432, -432,
+ -6, -217, -432, -432, 422, 44, 414, -432, -432, 429,
+ -432, -432, 66, -432, -432, -432, -431, -432, -21, -71,
+ -68, -432, -432, -432, -432, -432, -432, -432, -432, -432,
+ -432, -432, -432, -432, -432, -432, -432, 36, -432, -432,
+ -432, -432, -432, 86, -432, -432, -297, -432, -432, 18,
+ -432, -432, -432, -432, -432, -432
+};
+
+ /* YYDEFGOTO[NTERM-NUM]. */
+static const yytype_int16 yydefgoto[] =
+{
+ -1, 50, 51, 52, 53, 54, 55, 56, 57, 58,
+ 59, 60, 131, 225, 226, 227, 228, 229, 230, 349,
+ 350, 182, 61, 62, 63, 287, 64, 65, 66, 67,
+ 68, 243, 244, 245, 69, 408, 409, 411, 412, 497,
+ 505, 70, 71, 253, 72, 363, 73, 366, 74, 262,
+ 75, 265, 369, 76, 77, 269, 78, 272, 79, 80,
+ 81, 277, 335, 336, 375, 398, 430, 418, 431, 432,
+ 458, 82, 280, 83, 283, 84
+};
+
+ /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM. If
+ positive, shift that token. If negative, reduce the rule whose
+ number is the opposite. If YYTABLE_NINF, syntax error. */
+static const yytype_int16 yytable[] =
+{
+ 306, 307, 308, 181, 309, 310, 217, 218, 219, 85,
+ 220, 367, 221, 171, 222, -56, 1, 462, 92, 368,
+ 2, 3, 4, 5, 6, 7, 8, 246, 9, 248,
+ 254, 10, 256, 270, 284, 361, 364, 495, 503, 267,
+ 268, 11, 12, 13, 14, 15, 16, 17, 18, 19,
+ 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
+ 30, 31, 32, 33, 34, 35, 36, 37, 38, 39,
+ 40, 41, 42, 43, 44, 45, 46, 399, 47, 48,
+ 49, 514, 281, 354, 86, 355, 362, 332, 87, 247,
+ 223, 249, 255, 224, 257, 271, 285, 172, 365, 496,
+ 504, 333, 334, 88, 275, 278, 279, 93, -54, 341,
+ 342, 343, 344, 345, 346, 347, 282, 276, 263, 333,
+ 334, 89, 250, 152, 348, 264, 251, 252, 90, 91,
+ 173, 442, 377, 153, 154, 155, 156, 157, 158, 159,
+ 160, 161, 162, 163, 164, 165, 166, 167, 168, 132,
+ 28, 169, 30, 452, 453, 454, 455, 456, 457, 133,
+ 134, 135, 136, 137, 138, 139, 140, 141, 142, 143,
+ 144, 145, 146, 147, 148, 27, 94, 149, 389, 239,
+ 240, 241, 242, 95, 96, 419, 429, 258, 259, 260,
+ 261, 423, 97, 98, 425, 390, 391, 392, 393, 394,
+ 395, 396, 397, 390, 391, 392, 393, 394, 395, 396,
+ 397, 390, 391, 392, 393, 394, 395, 396, 397, 99,
+ 448, 130, 450, 31, 32, 33, 34, 35, 36, 37,
+ 38, 39, 40, 41, 42, 43, 44, 45, 46, 100,
+ 47, 48, 49, 288, 289, 290, 291, 292, 293, 294,
+ 295, 296, 297, 298, 299, 300, 301, 302, 303, 304,
+ 305, 240, 241, 242, 101, 102, 103, 104, 105, 106,
+ 107, 108, 109, 110, 111, 112, 113, 114, 115, 116,
+ 117, 118, 119, 120, 121, 122, 174, 123, 175, 124,
+ 125, 126, 127, 128, 129, 176, 177, 178, 179, 180,
+ 181, 183, 184, 185, 186, 187, 188, 189, 190, 191,
+ 192, 193, 194, 195, 196, 197, 198, 199, 200, 201,
+ 202, 203, 204, 205, 206, 207, 208, 209, 210, 211,
+ 212, 213, 214, 215, 216, 231, 232, 233, 234, 235,
+ 236, 237, 238, 266, 273, 274, 286, 311, 321, 312,
+ 338, 337, 353, 360, 373, 313, 322, 323, 314, 315,
+ 316, 317, 318, 319, 320, 324, 325, 326, 327, 328,
+ 329, 330, 331, 339, 340, 352, 356, 374, 357, 351,
+ 358, 359, 370, 371, 372, 376, 382, 378, 379, 380,
+ 383, 384, 400, 385, 386, 387, 388, 402, 401, 403,
+ 404, 406, 407, 410, 413, 414, 420, 421, 422, 424,
+ 426, 427, 428, 434, 436, 438, 441, 446, 447, 449,
+ 451, 459, 381, 461, 463, 465, 467, 468, 469, 464,
+ 470, 471, 472, 473, 474, 475, 509, 476, 477, 478,
+ 479, 480, 481, 513, 482, 483, 484, 485, 486, 487,
+ 417, 488, 489, 490, 491, 492, 493, 440, 494, 498,
+ 499, 405, 500, 501, 507, 416, 502, 506, 435, 508,
+ 433, 510, 511, 512, 415, 0, 445, 466, 0, 151,
+ 437, 460, 0, 439, 150, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 170, 0, 443, 444
+};
+
+static const yytype_int16 yycheck[] =
+{
+ 217, 218, 219, 3, 221, 222, 17, 18, 19, 3,
+ 21, 66, 23, 22, 25, 0, 1, 448, 14, 74,
+ 5, 6, 7, 8, 9, 10, 11, 4, 13, 4,
+ 4, 16, 4, 4, 4, 15, 4, 4, 4, 77,
+ 78, 26, 27, 28, 29, 30, 31, 32, 33, 34,
+ 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
+ 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
+ 55, 56, 57, 58, 59, 60, 61, 374, 63, 64,
+ 65, 512, 66, 105, 3, 107, 66, 66, 3, 66,
+ 101, 66, 66, 104, 66, 66, 66, 106, 66, 66,
+ 66, 80, 81, 3, 66, 98, 99, 15, 108, 5,
+ 6, 7, 8, 9, 10, 11, 100, 79, 66, 80,
+ 81, 3, 66, 16, 20, 73, 70, 71, 3, 3,
+ 22, 428, 349, 26, 27, 28, 29, 30, 31, 32,
+ 33, 34, 35, 36, 37, 38, 39, 40, 41, 16,
+ 43, 44, 45, 92, 93, 94, 95, 96, 97, 26,
+ 27, 28, 29, 30, 31, 32, 33, 34, 35, 36,
+ 37, 38, 39, 40, 41, 42, 109, 44, 66, 66,
+ 67, 68, 69, 109, 109, 402, 66, 8, 9, 10,
+ 11, 408, 109, 109, 411, 83, 84, 85, 86, 87,
+ 88, 89, 90, 83, 84, 85, 86, 87, 88, 89,
+ 90, 83, 84, 85, 86, 87, 88, 89, 90, 109,
+ 437, 0, 439, 46, 47, 48, 49, 50, 51, 52,
+ 53, 54, 55, 56, 57, 58, 59, 60, 61, 109,
+ 63, 64, 65, 199, 200, 201, 202, 203, 204, 205,
+ 206, 207, 208, 209, 210, 211, 212, 213, 214, 215,
+ 216, 67, 68, 69, 109, 109, 109, 109, 109, 109,
+ 109, 109, 109, 109, 109, 109, 109, 109, 109, 109,
+ 109, 109, 109, 109, 109, 109, 22, 109, 22, 109,
+ 109, 109, 109, 109, 109, 22, 22, 22, 15, 3,
+ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
+ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
+ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
+ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
+ 3, 3, 3, 75, 4, 4, 4, 3, 108, 4,
+ 108, 110, 102, 72, 108, 12, 3, 3, 12, 12,
+ 12, 12, 12, 12, 12, 3, 3, 3, 3, 3,
+ 3, 3, 3, 15, 4, 4, 3, 82, 4, 24,
+ 4, 4, 4, 4, 4, 3, 3, 103, 4, 4,
+ 3, 3, 110, 4, 3, 3, 3, 108, 4, 4,
+ 107, 4, 4, 4, 4, 4, 4, 4, 3, 3,
+ 3, 3, 3, 419, 4, 4, 4, 4, 3, 3,
+ 3, 3, 356, 4, 4, 4, 3, 3, 3, 450,
+ 4, 4, 4, 3, 3, 3, 507, 4, 4, 4,
+ 3, 3, 3, 511, 4, 4, 4, 3, 3, 3,
+ 91, 4, 4, 4, 3, 3, 3, 76, 4, 4,
+ 3, 105, 3, 3, 3, 108, 4, 4, 107, 3,
+ 110, 4, 3, 3, 388, -1, 72, 459, -1, 65,
+ 108, 445, -1, 108, 62, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, 66, -1, 111, 108
+};
+
+ /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
+ symbol of state STATE-NUM. */
+static const yytype_uint8 yystos[] =
+{
+ 0, 1, 5, 6, 7, 8, 9, 10, 11, 13,
+ 16, 26, 27, 28, 29, 30, 31, 32, 33, 34,
+ 35, 36, 37, 38, 39, 40, 41, 42, 43, 44,
+ 45, 46, 47, 48, 49, 50, 51, 52, 53, 54,
+ 55, 56, 57, 58, 59, 60, 61, 63, 64, 65,
+ 113, 114, 115, 116, 117, 118, 119, 120, 121, 122,
+ 123, 134, 135, 136, 138, 139, 140, 141, 142, 146,
+ 153, 154, 156, 158, 160, 162, 165, 166, 168, 170,
+ 171, 172, 183, 185, 187, 3, 3, 3, 3, 3,
+ 3, 3, 14, 15, 109, 109, 109, 109, 109, 109,
+ 109, 109, 109, 109, 109, 109, 109, 109, 109, 109,
+ 109, 109, 109, 109, 109, 109, 109, 109, 109, 109,
+ 109, 109, 109, 109, 109, 109, 109, 109, 109, 109,
+ 0, 124, 16, 26, 27, 28, 29, 30, 31, 32,
+ 33, 34, 35, 36, 37, 38, 39, 40, 41, 44,
+ 136, 138, 16, 26, 27, 28, 29, 30, 31, 32,
+ 33, 34, 35, 36, 37, 38, 39, 40, 41, 44,
+ 141, 22, 106, 22, 22, 22, 22, 22, 22, 15,
+ 3, 3, 133, 3, 3, 3, 3, 3, 3, 3,
+ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
+ 3, 3, 3, 3, 3, 3, 3, 3, 3, 3,
+ 3, 3, 3, 3, 3, 3, 3, 17, 18, 19,
+ 21, 23, 25, 101, 104, 125, 126, 127, 128, 129,
+ 130, 3, 3, 3, 3, 3, 3, 3, 3, 66,
+ 67, 68, 69, 143, 144, 145, 4, 66, 4, 66,
+ 66, 70, 71, 155, 4, 66, 4, 66, 8, 9,
+ 10, 11, 161, 66, 73, 163, 75, 77, 78, 167,
+ 4, 66, 169, 4, 4, 66, 79, 173, 98, 99,
+ 184, 66, 100, 186, 4, 66, 4, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 137, 137, 137, 137,
+ 137, 137, 137, 137, 137, 137, 133, 133, 133, 133,
+ 133, 3, 4, 12, 12, 12, 12, 12, 12, 12,
+ 12, 108, 3, 3, 3, 3, 3, 3, 3, 3,
+ 3, 3, 66, 80, 81, 174, 175, 110, 108, 15,
+ 4, 5, 6, 7, 8, 9, 10, 11, 20, 131,
+ 132, 24, 4, 102, 105, 107, 3, 4, 4, 4,
+ 72, 15, 66, 157, 4, 66, 159, 66, 74, 164,
+ 4, 4, 4, 108, 82, 176, 3, 133, 103, 4,
+ 4, 144, 3, 3, 3, 4, 3, 3, 3, 66,
+ 83, 84, 85, 86, 87, 88, 89, 90, 177, 178,
+ 110, 4, 108, 4, 107, 105, 4, 4, 147, 148,
+ 4, 149, 150, 4, 4, 175, 108, 91, 179, 133,
+ 4, 4, 3, 133, 3, 133, 3, 3, 3, 66,
+ 178, 180, 181, 110, 132, 107, 4, 108, 4, 108,
+ 76, 4, 178, 111, 108, 72, 4, 3, 133, 3,
+ 133, 3, 92, 93, 94, 95, 96, 97, 182, 3,
+ 169, 4, 148, 4, 150, 4, 181, 3, 3, 3,
+ 4, 4, 4, 3, 3, 3, 4, 4, 4, 3,
+ 3, 3, 4, 4, 4, 3, 3, 3, 4, 4,
+ 4, 3, 3, 3, 4, 4, 66, 151, 4, 3,
+ 3, 3, 4, 4, 66, 152, 4, 3, 3, 151,
+ 4, 3, 3, 152, 148
+};
+
+ /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives. */
+static const yytype_uint8 yyr1[] =
+{
+ 0, 112, 113, 114, 114, 114, 115, 115, 115, 115,
+ 115, 115, 115, 115, 116, 116, 117, 118, 119, 120,
+ 121, 122, 123, 124, 124, 124, 124, 124, 124, 124,
+ 124, 124, 125, 126, 127, 128, 128, 129, 129, 129,
+ 129, 129, 129, 130, 131, 131, 132, 132, 132, 132,
+ 132, 132, 132, 132, 133, 133, 134, 134, 134, 134,
+ 135, 135, 135, 135, 136, 136, 136, 136, 136, 136,
+ 136, 136, 136, 136, 136, 136, 136, 136, 136, 136,
+ 136, 136, 137, 137, 138, 138, 138, 138, 138, 138,
+ 138, 138, 138, 138, 138, 138, 138, 138, 138, 138,
+ 138, 138, 138, 139, 139, 140, 140, 141, 141, 141,
+ 141, 141, 141, 141, 141, 141, 141, 141, 141, 141,
+ 141, 141, 141, 141, 141, 141, 141, 142, 142, 143,
+ 143, 144, 145, 145, 145, 146, 146, 147, 147, 148,
+ 149, 149, 150, 151, 151, 152, 152, 153, 153, 154,
+ 154, 155, 155, 156, 156, 157, 157, 158, 158, 159,
+ 159, 160, 161, 161, 161, 161, 162, 163, 163, 164,
+ 164, 165, 166, 167, 167, 168, 169, 169, 170, 171,
+ 172, 172, 173, 174, 174, 174, 175, 175, 176, 177,
+ 177, 177, 178, 178, 178, 178, 178, 178, 178, 178,
+ 179, 180, 180, 180, 181, 182, 182, 182, 182, 182,
+ 182, 183, 184, 184, 185, 186, 186, 187, 187
+};
+
+ /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN. */
+static const yytype_uint8 yyr2[] =
+{
+ 0, 2, 1, 2, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 5, 5, 5, 5, 5, 5,
+ 5, 5, 3, 0, 2, 2, 2, 2, 2, 2,
+ 2, 4, 3, 3, 3, 3, 5, 2, 4, 4,
+ 6, 6, 8, 3, 1, 5, 1, 1, 1, 1,
+ 1, 1, 1, 1, 0, 1, 0, 1, 1, 1,
+ 2, 1, 2, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 4, 4, 4, 4, 4, 4, 4,
+ 4, 4, 4, 4, 4, 4, 4, 4, 4, 4,
+ 4, 4, 4, 1, 2, 1, 2, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 2, 4, 4, 1,
+ 4, 5, 1, 1, 1, 4, 8, 1, 5, 21,
+ 1, 5, 17, 1, 1, 1, 1, 8, 4, 4,
+ 7, 1, 1, 4, 6, 1, 1, 4, 6, 1,
+ 1, 4, 1, 1, 1, 1, 6, 1, 1, 1,
+ 1, 10, 4, 1, 1, 4, 1, 1, 6, 28,
+ 4, 11, 2, 1, 1, 4, 1, 1, 2, 1,
+ 1, 4, 1, 1, 1, 1, 1, 1, 1, 1,
+ 2, 1, 1, 4, 3, 1, 1, 1, 1, 1,
+ 1, 4, 1, 1, 4, 1, 1, 4, 4
+};
+
+
+#define yyerrok (yyerrstatus = 0)
+#define yyclearin (yychar = YYEMPTY)
+#define YYEMPTY (-2)
+#define YYEOF 0
+
+#define YYACCEPT goto yyacceptlab
+#define YYABORT goto yyabortlab
+#define YYERROR goto yyerrorlab
+
+
+#define YYRECOVERING() (!!yyerrstatus)
+
+#define YYBACKUP(Token, Value) \
+do \
+ if (yychar == YYEMPTY) \
+ { \
+ yychar = (Token); \
+ yylval = (Value); \
+ YYPOPSTACK (yylen); \
+ yystate = *yyssp; \
+ goto yybackup; \
+ } \
+ else \
+ { \
+ yyerror (scanner, message, YY_("syntax error: cannot back up")); \
+ YYERROR; \
+ } \
+while (0)
+
+/* Error token number */
+#define YYTERROR 1
+#define YYERRCODE 256
+
+
+
+/* Enable debugging if requested. */
+#if YYDEBUG
+
+# ifndef YYFPRINTF
+# include <stdio.h> /* INFRINGES ON USER NAME SPACE */
+# define YYFPRINTF fprintf
+# endif
+
+# define YYDPRINTF(Args) \
+do { \
+ if (yydebug) \
+ YYFPRINTF Args; \
+} while (0)
+
+/* This macro is provided for backward compatibility. */
+#ifndef YY_LOCATION_PRINT
+# define YY_LOCATION_PRINT(File, Loc) ((void) 0)
+#endif
+
+
+# define YY_SYMBOL_PRINT(Title, Type, Value, Location) \
+do { \
+ if (yydebug) \
+ { \
+ YYFPRINTF (stderr, "%s ", Title); \
+ yy_symbol_print (stderr, \
+ Type, Value, scanner, message); \
+ YYFPRINTF (stderr, "\n"); \
+ } \
+} while (0)
+
+
+/*----------------------------------------.
+| Print this symbol's value on YYOUTPUT. |
+`----------------------------------------*/
+
+static void
+yy_symbol_value_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, void* scanner, std::unique_ptr<wds::rtsp::Message>& message)
+{
+ FILE *yyo = yyoutput;
+ YYUSE (yyo);
+ YYUSE (scanner);
+ YYUSE (message);
+ if (!yyvaluep)
+ return;
+# ifdef YYPRINT
+ if (yytype < YYNTOKENS)
+ YYPRINT (yyoutput, yytoknum[yytype], *yyvaluep);
+# endif
+ YYUSE (yytype);
+}
+
+
+/*--------------------------------.
+| Print this symbol on YYOUTPUT. |
+`--------------------------------*/
+
+static void
+yy_symbol_print (FILE *yyoutput, int yytype, YYSTYPE const * const yyvaluep, void* scanner, std::unique_ptr<wds::rtsp::Message>& message)
+{
+ YYFPRINTF (yyoutput, "%s %s (",
+ yytype < YYNTOKENS ? "token" : "nterm", yytname[yytype]);
+
+ yy_symbol_value_print (yyoutput, yytype, yyvaluep, scanner, message);
+ YYFPRINTF (yyoutput, ")");
+}
+
+/*------------------------------------------------------------------.
+| yy_stack_print -- Print the state stack from its BOTTOM up to its |
+| TOP (included). |
+`------------------------------------------------------------------*/
+
+static void
+yy_stack_print (yytype_int16 *yybottom, yytype_int16 *yytop)
+{
+ YYFPRINTF (stderr, "Stack now");
+ for (; yybottom <= yytop; yybottom++)
+ {
+ int yybot = *yybottom;
+ YYFPRINTF (stderr, " %d", yybot);
+ }
+ YYFPRINTF (stderr, "\n");
+}
+
+# define YY_STACK_PRINT(Bottom, Top) \
+do { \
+ if (yydebug) \
+ yy_stack_print ((Bottom), (Top)); \
+} while (0)
+
+
+/*------------------------------------------------.
+| Report that the YYRULE is going to be reduced. |
+`------------------------------------------------*/
+
+static void
+yy_reduce_print (yytype_int16 *yyssp, YYSTYPE *yyvsp, int yyrule, void* scanner, std::unique_ptr<wds::rtsp::Message>& message)
+{
+ unsigned long int yylno = yyrline[yyrule];
+ int yynrhs = yyr2[yyrule];
+ int yyi;
+ YYFPRINTF (stderr, "Reducing stack by rule %d (line %lu):\n",
+ yyrule - 1, yylno);
+ /* The symbols being reduced. */
+ for (yyi = 0; yyi < yynrhs; yyi++)
+ {
+ YYFPRINTF (stderr, " $%d = ", yyi + 1);
+ yy_symbol_print (stderr,
+ yystos[yyssp[yyi + 1 - yynrhs]],
+ &(yyvsp[(yyi + 1) - (yynrhs)])
+ , scanner, message);
+ YYFPRINTF (stderr, "\n");
+ }
+}
+
+# define YY_REDUCE_PRINT(Rule) \
+do { \
+ if (yydebug) \
+ yy_reduce_print (yyssp, yyvsp, Rule, scanner, message); \
+} while (0)
+
+/* Nonzero means print parse trace. It is left uninitialized so that
+ multiple parsers can coexist. */
+int yydebug;
+#else /* !YYDEBUG */
+# define YYDPRINTF(Args)
+# define YY_SYMBOL_PRINT(Title, Type, Value, Location)
+# define YY_STACK_PRINT(Bottom, Top)
+# define YY_REDUCE_PRINT(Rule)
+#endif /* !YYDEBUG */
+
+
+/* YYINITDEPTH -- initial size of the parser's stacks. */
+#ifndef YYINITDEPTH
+# define YYINITDEPTH 200
+#endif
+
+/* YYMAXDEPTH -- maximum size the stacks can grow to (effective only
+ if the built-in stack extension method is used).
+
+ Do not make this value too large; the results are undefined if
+ YYSTACK_ALLOC_MAXIMUM < YYSTACK_BYTES (YYMAXDEPTH)
+ evaluated with infinite-precision integer arithmetic. */
+
+#ifndef YYMAXDEPTH
+# define YYMAXDEPTH 10000
+#endif
+
+
+#if YYERROR_VERBOSE
+
+# ifndef yystrlen
+# if defined __GLIBC__ && defined _STRING_H
+# define yystrlen strlen
+# else
+/* Return the length of YYSTR. */
+static YYSIZE_T
+yystrlen (const char *yystr)
+{
+ YYSIZE_T yylen;
+ for (yylen = 0; yystr[yylen]; yylen++)
+ continue;
+ return yylen;
+}
+# endif
+# endif
+
+# ifndef yystpcpy
+# if defined __GLIBC__ && defined _STRING_H && defined _GNU_SOURCE
+# define yystpcpy stpcpy
+# else
+/* Copy YYSRC to YYDEST, returning the address of the terminating '\0' in
+ YYDEST. */
+static char *
+yystpcpy (char *yydest, const char *yysrc)
+{
+ char *yyd = yydest;
+ const char *yys = yysrc;
+
+ while ((*yyd++ = *yys++) != '\0')
+ continue;
+
+ return yyd - 1;
+}
+# endif
+# endif
+
+# ifndef yytnamerr
+/* Copy to YYRES the contents of YYSTR after stripping away unnecessary
+ quotes and backslashes, so that it's suitable for yyerror. The
+ heuristic is that double-quoting is unnecessary unless the string
+ contains an apostrophe, a comma, or backslash (other than
+ backslash-backslash). YYSTR is taken from yytname. If YYRES is
+ null, do not copy; instead, return the length of what the result
+ would have been. */
+static YYSIZE_T
+yytnamerr (char *yyres, const char *yystr)
+{
+ if (*yystr == '"')
+ {
+ YYSIZE_T yyn = 0;
+ char const *yyp = yystr;
+
+ for (;;)
+ switch (*++yyp)
+ {
+ case '\'':
+ case ',':
+ goto do_not_strip_quotes;
+
+ case '\\':
+ if (*++yyp != '\\')
+ goto do_not_strip_quotes;
+ /* Fall through. */
+ default:
+ if (yyres)
+ yyres[yyn] = *yyp;
+ yyn++;
+ break;
+
+ case '"':
+ if (yyres)
+ yyres[yyn] = '\0';
+ return yyn;
+ }
+ do_not_strip_quotes: ;
+ }
+
+ if (! yyres)
+ return yystrlen (yystr);
+
+ return yystpcpy (yyres, yystr) - yyres;
+}
+# endif
+
+/* Copy into *YYMSG, which is of size *YYMSG_ALLOC, an error message
+ about the unexpected token YYTOKEN for the state stack whose top is
+ YYSSP.
+
+ Return 0 if *YYMSG was successfully written. Return 1 if *YYMSG is
+ not large enough to hold the message. In that case, also set
+ *YYMSG_ALLOC to the required number of bytes. Return 2 if the
+ required number of bytes is too large to store. */
+static int
+yysyntax_error (YYSIZE_T *yymsg_alloc, char **yymsg,
+ yytype_int16 *yyssp, int yytoken)
+{
+ YYSIZE_T yysize0 = yytnamerr (YY_NULLPTR, yytname[yytoken]);
+ YYSIZE_T yysize = yysize0;
+ enum { YYERROR_VERBOSE_ARGS_MAXIMUM = 5 };
+ /* Internationalized format string. */
+ const char *yyformat = YY_NULLPTR;
+ /* Arguments of yyformat. */
+ char const *yyarg[YYERROR_VERBOSE_ARGS_MAXIMUM];
+ /* Number of reported tokens (one for the "unexpected", one per
+ "expected"). */
+ int yycount = 0;
+
+ /* There are many possibilities here to consider:
+ - If this state is a consistent state with a default action, then
+ the only way this function was invoked is if the default action
+ is an error action. In that case, don't check for expected
+ tokens because there are none.
+ - The only way there can be no lookahead present (in yychar) is if
+ this state is a consistent state with a default action. Thus,
+ detecting the absence of a lookahead is sufficient to determine
+ that there is no unexpected or expected token to report. In that
+ case, just report a simple "syntax error".
+ - Don't assume there isn't a lookahead just because this state is a
+ consistent state with a default action. There might have been a
+ previous inconsistent state, consistent state with a non-default
+ action, or user semantic action that manipulated yychar.
+ - Of course, the expected token list depends on states to have
+ correct lookahead information, and it depends on the parser not
+ to perform extra reductions after fetching a lookahead from the
+ scanner and before detecting a syntax error. Thus, state merging
+ (from LALR or IELR) and default reductions corrupt the expected
+ token list. However, the list is correct for canonical LR with
+ one exception: it will still contain any token that will not be
+ accepted due to an error action in a later state.
+ */
+ if (yytoken != YYEMPTY)
+ {
+ int yyn = yypact[*yyssp];
+ yyarg[yycount++] = yytname[yytoken];
+ if (!yypact_value_is_default (yyn))
+ {
+ /* Start YYX at -YYN if negative to avoid negative indexes in
+ YYCHECK. In other words, skip the first -YYN actions for
+ this state because they are default actions. */
+ int yyxbegin = yyn < 0 ? -yyn : 0;
+ /* Stay within bounds of both yycheck and yytname. */
+ int yychecklim = YYLAST - yyn + 1;
+ int yyxend = yychecklim < YYNTOKENS ? yychecklim : YYNTOKENS;
+ int yyx;
+
+ for (yyx = yyxbegin; yyx < yyxend; ++yyx)
+ if (yycheck[yyx + yyn] == yyx && yyx != YYTERROR
+ && !yytable_value_is_error (yytable[yyx + yyn]))
+ {
+ if (yycount == YYERROR_VERBOSE_ARGS_MAXIMUM)
+ {
+ yycount = 1;
+ yysize = yysize0;
+ break;
+ }
+ yyarg[yycount++] = yytname[yyx];
+ {
+ YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
+ if (! (yysize <= yysize1
+ && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
+ return 2;
+ yysize = yysize1;
+ }
+ }
+ }
+ }
+
+ switch (yycount)
+ {
+# define YYCASE_(N, S) \
+ case N: \
+ yyformat = S; \
+ break
+ YYCASE_(0, YY_("syntax error"));
+ YYCASE_(1, YY_("syntax error, unexpected %s"));
+ YYCASE_(2, YY_("syntax error, unexpected %s, expecting %s"));
+ YYCASE_(3, YY_("syntax error, unexpected %s, expecting %s or %s"));
+ YYCASE_(4, YY_("syntax error, unexpected %s, expecting %s or %s or %s"));
+ YYCASE_(5, YY_("syntax error, unexpected %s, expecting %s or %s or %s or %s"));
+# undef YYCASE_
+ }
+
+ {
+ YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
+ if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
+ return 2;
+ yysize = yysize1;
+ }
+
+ if (*yymsg_alloc < yysize)
+ {
+ *yymsg_alloc = 2 * yysize;
+ if (! (yysize <= *yymsg_alloc
+ && *yymsg_alloc <= YYSTACK_ALLOC_MAXIMUM))
+ *yymsg_alloc = YYSTACK_ALLOC_MAXIMUM;
+ return 1;
+ }
+
+ /* Avoid sprintf, as that infringes on the user's name space.
+ Don't have undefined behavior even if the translation
+ produced a string with the wrong number of "%s"s. */
+ {
+ char *yyp = *yymsg;
+ int yyi = 0;
+ while ((*yyp = *yyformat) != '\0')
+ if (*yyp == '%' && yyformat[1] == 's' && yyi < yycount)
+ {
+ yyp += yytnamerr (yyp, yyarg[yyi++]);
+ yyformat += 2;
+ }
+ else
+ {
+ yyp++;
+ yyformat++;
+ }
+ }
+ return 0;
+}
+#endif /* YYERROR_VERBOSE */
+
+/*-----------------------------------------------.
+| Release the memory associated to this symbol. |
+`-----------------------------------------------*/
+
+static void
+yydestruct (const char *yymsg, int yytype, YYSTYPE *yyvaluep, void* scanner, std::unique_ptr<wds::rtsp::Message>& message)
+{
+ YYUSE (yyvaluep);
+ YYUSE (scanner);
+ YYUSE (message);
+ if (!yymsg)
+ yymsg = "Deleting";
+ YY_SYMBOL_PRINT (yymsg, yytype, yyvaluep, yylocationp);
+
+ YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
+ switch (yytype)
+ {
+ case 15: /* WFD_STRING */
+
+ { DELETE_TOKEN(((*yyvaluep).sval)); }
+
+ break;
+
+ case 16: /* WFD_GENERIC_PROPERTY */
+
+ { DELETE_TOKEN(((*yyvaluep).sval)); }
+
+ break;
+
+ case 22: /* WFD_REQUEST_URI */
+
+ { DELETE_TOKEN(((*yyvaluep).sval)); }
+
+ break;
+
+ case 24: /* WFD_MIME */
+
+ { DELETE_TOKEN(((*yyvaluep).sval)); }
+
+ break;
+
+ case 130: /* wfd_supported_methods */
+
+ { DELETE_TOKEN(((*yyvaluep).methods)); }
+
+ break;
+
+ case 131: /* wfd_methods */
+
+ { DELETE_TOKEN(((*yyvaluep).methods)); }
+
+ break;
+
+ case 135: /* wfd_parameter_list */
+
+ { DELETE_TOKEN(((*yyvaluep).mpayload)); }
+
+ break;
+
+ case 143: /* wfd_audio_codec_list */
+
+ { DELETE_TOKEN(((*yyvaluep).audio_codecs)); }
+
+ break;
+
+ case 144: /* wfd_audio_codec */
+
+ { DELETE_TOKEN(((*yyvaluep).audio_codec)); }
+
+ break;
+
+ case 147: /* wfd_h264_codecs */
+
+ { DELETE_TOKEN(((*yyvaluep).codecs)); }
+
+ break;
+
+ case 148: /* wfd_h264_codec */
+
+ { DELETE_TOKEN(((*yyvaluep).codec)); }
+
+ break;
+
+ case 149: /* wfd_h264_codecs_3d */
+
+ { DELETE_TOKEN(((*yyvaluep).codecs_3d)); }
+
+ break;
+
+ case 150: /* wfd_h264_codec_3d */
+
+ { DELETE_TOKEN(((*yyvaluep).codec_3d)); }
+
+ break;
+
+ case 157: /* wfd_edid_payload */
+
+ { DELETE_TOKEN(((*yyvaluep).sval)); }
+
+ break;
+
+ case 181: /* wfd_hidc_cap_list_value */
+
+ { DELETE_TOKEN(((*yyvaluep).hidc_cap_list_value)); }
+
+ break;
+
+
+ default:
+ break;
+ }
+ YY_IGNORE_MAYBE_UNINITIALIZED_END
+}
+
+
+
+
+/*----------.
+| yyparse. |
+`----------*/
+
+int
+yyparse (void* scanner, std::unique_ptr<wds::rtsp::Message>& message)
+{
+/* The lookahead symbol. */
+int yychar;
+
+
+/* The semantic value of the lookahead symbol. */
+/* Default value used for initialization, for pacifying older GCCs
+ or non-GCC compilers. */
+YY_INITIAL_VALUE (static YYSTYPE yyval_default;)
+YYSTYPE yylval YY_INITIAL_VALUE (= yyval_default);
+
+ /* Number of syntax errors so far. */
+ int yynerrs;
+
+ int yystate;
+ /* Number of tokens to shift before error messages enabled. */
+ int yyerrstatus;
+
+ /* The stacks and their tools:
+ 'yyss': related to states.
+ 'yyvs': related to semantic values.
+
+ Refer to the stacks through separate pointers, to allow yyoverflow
+ to reallocate them elsewhere. */
+
+ /* The state stack. */
+ yytype_int16 yyssa[YYINITDEPTH];
+ yytype_int16 *yyss;
+ yytype_int16 *yyssp;
+
+ /* The semantic value stack. */
+ YYSTYPE yyvsa[YYINITDEPTH];
+ YYSTYPE *yyvs;
+ YYSTYPE *yyvsp;
+
+ YYSIZE_T yystacksize;
+
+ int yyn;
+ int yyresult;
+ /* Lookahead token as an internal (translated) token number. */
+ int yytoken = 0;
+ /* The variables used to return semantic value and location from the
+ action routines. */
+ YYSTYPE yyval;
+
+#if YYERROR_VERBOSE
+ /* Buffer for error messages, and its allocated size. */
+ char yymsgbuf[128];
+ char *yymsg = yymsgbuf;
+ YYSIZE_T yymsg_alloc = sizeof yymsgbuf;
+#endif
+
+#define YYPOPSTACK(N) (yyvsp -= (N), yyssp -= (N))
+
+ /* The number of symbols on the RHS of the reduced rule.
+ Keep to zero when no symbol should be popped. */
+ int yylen = 0;
+
+ yyssp = yyss = yyssa;
+ yyvsp = yyvs = yyvsa;
+ yystacksize = YYINITDEPTH;
+
+ YYDPRINTF ((stderr, "Starting parse\n"));
+
+ yystate = 0;
+ yyerrstatus = 0;
+ yynerrs = 0;
+ yychar = YYEMPTY; /* Cause a token to be read. */
+ goto yysetstate;
+
+/*------------------------------------------------------------.
+| yynewstate -- Push a new state, which is found in yystate. |
+`------------------------------------------------------------*/
+ yynewstate:
+ /* In all cases, when you get here, the value and location stacks
+ have just been pushed. So pushing a state here evens the stacks. */
+ yyssp++;
+
+ yysetstate:
+ *yyssp = yystate;
+
+ if (yyss + yystacksize - 1 <= yyssp)
+ {
+ /* Get the current used size of the three stacks, in elements. */
+ YYSIZE_T yysize = yyssp - yyss + 1;
+
+#ifdef yyoverflow
+ {
+ /* Give user a chance to reallocate the stack. Use copies of
+ these so that the &'s don't force the real ones into
+ memory. */
+ YYSTYPE *yyvs1 = yyvs;
+ yytype_int16 *yyss1 = yyss;
+
+ /* Each stack pointer address is followed by the size of the
+ data in use in that stack, in bytes. This used to be a
+ conditional around just the two extra args, but that might
+ be undefined if yyoverflow is a macro. */
+ yyoverflow (YY_("memory exhausted"),
+ &yyss1, yysize * sizeof (*yyssp),
+ &yyvs1, yysize * sizeof (*yyvsp),
+ &yystacksize);
+
+ yyss = yyss1;
+ yyvs = yyvs1;
+ }
+#else /* no yyoverflow */
+# ifndef YYSTACK_RELOCATE
+ goto yyexhaustedlab;
+# else
+ /* Extend the stack our own way. */
+ if (YYMAXDEPTH <= yystacksize)
+ goto yyexhaustedlab;
+ yystacksize *= 2;
+ if (YYMAXDEPTH < yystacksize)
+ yystacksize = YYMAXDEPTH;
+
+ {
+ yytype_int16 *yyss1 = yyss;
+ union yyalloc *yyptr =
+ (union yyalloc *) YYSTACK_ALLOC (YYSTACK_BYTES (yystacksize));
+ if (! yyptr)
+ goto yyexhaustedlab;
+ YYSTACK_RELOCATE (yyss_alloc, yyss);
+ YYSTACK_RELOCATE (yyvs_alloc, yyvs);
+# undef YYSTACK_RELOCATE
+ if (yyss1 != yyssa)
+ YYSTACK_FREE (yyss1);
+ }
+# endif
+#endif /* no yyoverflow */
+
+ yyssp = yyss + yysize - 1;
+ yyvsp = yyvs + yysize - 1;
+
+ YYDPRINTF ((stderr, "Stack size increased to %lu\n",
+ (unsigned long int) yystacksize));
+
+ if (yyss + yystacksize - 1 <= yyssp)
+ YYABORT;
+ }
+
+ YYDPRINTF ((stderr, "Entering state %d\n", yystate));
+
+ if (yystate == YYFINAL)
+ YYACCEPT;
+
+ goto yybackup;
+
+/*-----------.
+| yybackup. |
+`-----------*/
+yybackup:
+
+ /* Do appropriate processing given the current state. Read a
+ lookahead token if we need one and don't already have one. */
+
+ /* First try to decide what to do without reference to lookahead token. */
+ yyn = yypact[yystate];
+ if (yypact_value_is_default (yyn))
+ goto yydefault;
+
+ /* Not known => get a lookahead token if don't already have one. */
+
+ /* YYCHAR is either YYEMPTY or YYEOF or a valid lookahead symbol. */
+ if (yychar == YYEMPTY)
+ {
+ YYDPRINTF ((stderr, "Reading a token: "));
+ yychar = yylex (&yylval, scanner, message);
+ }
+
+ if (yychar <= YYEOF)
+ {
+ yychar = yytoken = YYEOF;
+ YYDPRINTF ((stderr, "Now at end of input.\n"));
+ }
+ else
+ {
+ yytoken = YYTRANSLATE (yychar);
+ YY_SYMBOL_PRINT ("Next token is", yytoken, &yylval, &yylloc);
+ }
+
+ /* If the proper action on seeing token YYTOKEN is to reduce or to
+ detect an error, take that action. */
+ yyn += yytoken;
+ if (yyn < 0 || YYLAST < yyn || yycheck[yyn] != yytoken)
+ goto yydefault;
+ yyn = yytable[yyn];
+ if (yyn <= 0)
+ {
+ if (yytable_value_is_error (yyn))
+ goto yyerrlab;
+ yyn = -yyn;
+ goto yyreduce;
+ }
+
+ /* Count tokens shifted since error; after three, turn off error
+ status. */
+ if (yyerrstatus)
+ yyerrstatus--;
+
+ /* Shift the lookahead token. */
+ YY_SYMBOL_PRINT ("Shifting", yytoken, &yylval, &yylloc);
+
+ /* Discard the shifted token. */
+ yychar = YYEMPTY;
+
+ yystate = yyn;
+ YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
+ *++yyvsp = yylval;
+ YY_IGNORE_MAYBE_UNINITIALIZED_END
+
+ goto yynewstate;
+
+
+/*-----------------------------------------------------------.
+| yydefault -- do the default action for the current state. |
+`-----------------------------------------------------------*/
+yydefault:
+ yyn = yydefact[yystate];
+ if (yyn == 0)
+ goto yyerrlab;
+ goto yyreduce;
+
+
+/*-----------------------------.
+| yyreduce -- Do a reduction. |
+`-----------------------------*/
+yyreduce:
+ /* yyn is the number of a rule to reduce with. */
+ yylen = yyr2[yyn];
+
+ /* If YYLEN is nonzero, implement the default value of the action:
+ '$$ = $1'.
+
+ Otherwise, the following line sets YYVAL to garbage.
+ This behavior is undocumented and Bison
+ users should not rely upon it. Assigning to YYVAL
+ unconditionally makes the parser a bit smaller, and it avoids a
+ GCC warning that YYVAL may be used uninitialized. */
+ yyval = yyvsp[1-yylen];
+
+
+ YY_REDUCE_PRINT (yyn);
+ switch (yyn)
+ {
+ case 3:
+
+ {
+ message.reset((yyvsp[-1].message));
+ (yyvsp[-1].message)->set_header(std::unique_ptr<wds::rtsp::Header>((yyvsp[0].header)));
+ }
+
+ break;
+
+ case 4:
+
+ {
+ if (message && (yyvsp[0].mpayload))
+ message->set_payload(std::unique_ptr<wds::rtsp::Payload>((yyvsp[0].mpayload)));
+ else
+ YYERROR;
+ }
+
+ break;
+
+ case 5:
+
+ {
+ message.reset();
+ std::cerr << "Unknown message" << std::endl;
+ YYABORT;
+ }
+
+ break;
+
+ case 14:
+
+ {
+ (yyval.message) = new wds::rtsp::Options("*");
+ }
+
+ break;
+
+ case 15:
+
+ {
+ (yyval.message) = new wds::rtsp::Options(*(yyvsp[-2].sval));
+ DELETE_TOKEN((yyvsp[-2].sval));
+ }
+
+ break;
+
+ case 16:
+
+ {
+ (yyval.message) = new wds::rtsp::SetParameter(*(yyvsp[-2].sval));
+ DELETE_TOKEN((yyvsp[-2].sval));
+ }
+
+ break;
+
+ case 17:
+
+ {
+ (yyval.message) = new wds::rtsp::GetParameter(*(yyvsp[-2].sval));
+ DELETE_TOKEN((yyvsp[-2].sval));
+ }
+
+ break;
+
+ case 18:
+
+ {
+ (yyval.message) = new wds::rtsp::Setup(*(yyvsp[-2].sval));
+ DELETE_TOKEN((yyvsp[-2].sval));
+ }
+
+ break;
+
+ case 19:
+
+ {
+ (yyval.message) = new wds::rtsp::Play(*(yyvsp[-2].sval));
+ DELETE_TOKEN((yyvsp[-2].sval));
+ }
+
+ break;
+
+ case 20:
+
+ {
+ (yyval.message) = new wds::rtsp::Teardown(*(yyvsp[-2].sval));
+ DELETE_TOKEN((yyvsp[-2].sval));
+ }
+
+ break;
+
+ case 21:
+
+ {
+ (yyval.message) = new wds::rtsp::Pause(*(yyvsp[-2].sval));
+ DELETE_TOKEN((yyvsp[-2].sval));
+ }
+
+ break;
+
+ case 22:
+
+ {
+ DELETE_TOKEN((yyvsp[0].sval));
+ (yyval.message) = new wds::rtsp::Reply((yyvsp[-1].nval));
+ }
+
+ break;
+
+ case 23:
+
+ {
+ (yyval.header) = new wds::rtsp::Header();
+ }
+
+ break;
+
+ case 24:
+
+ { (yyvsp[-1].header)->set_cseq((yyvsp[0].nval)); }
+
+ break;
+
+ case 25:
+
+ { (yyvsp[-1].header)->set_require_wfd_support(true); }
+
+ break;
+
+ case 26:
+
+ {
+ (yyvsp[-1].header)->set_content_type(*(yyvsp[0].sval));
+ DELETE_TOKEN((yyvsp[0].sval));
+ }
+
+ break;
+
+ case 27:
+
+ { (yyvsp[-1].header)->set_content_length((yyvsp[0].nval)); }
+
+ break;
+
+ case 28:
+
+ {
+ (yyvsp[-1].header)->set_supported_methods(*(yyvsp[0].methods));
+ DELETE_TOKEN((yyvsp[0].methods));
+ }
+
+ break;
+
+ case 29:
+
+ {
+ (yyvsp[-1].header)->set_session((*(yyvsp[0].session_info)).first);
+ (yyvsp[-1].header)->set_timeout((*(yyvsp[0].session_info)).second);
+ DELETE_TOKEN((yyvsp[0].session_info));
+ }
+
+ break;
+
+ case 30:
+
+ { (yyvsp[-1].header)->set_transport ((yyvsp[0].transport)); }
+
+ break;
+
+ case 31:
+
+ {
+ (yyvsp[-3].header)->add_generic_header(*(yyvsp[-2].sval), *(yyvsp[0].sval));
+ DELETE_TOKEN((yyvsp[-2].sval));
+ DELETE_TOKEN((yyvsp[0].sval));
+ }
+
+ break;
+
+ case 32:
+
+ {
+ (yyval.nval) = (yyvsp[0].nval);
+ }
+
+ break;
+
+ case 33:
+
+ {
+ (yyval.sval) = (yyvsp[0].sval);
+ }
+
+ break;
+
+ case 34:
+
+ {
+ (yyval.nval) = (yyvsp[0].nval);
+ }
+
+ break;
+
+ case 35:
+
+ {
+ (yyval.session_info) = new std::pair<std::string, unsigned int>(*(yyvsp[0].sval), 0);
+ DELETE_TOKEN((yyvsp[0].sval));
+ }
+
+ break;
+
+ case 36:
+
+ {
+ (yyval.session_info) = new std::pair<std::string, unsigned int>(*(yyvsp[-2].sval), (yyvsp[0].nval));
+ DELETE_TOKEN((yyvsp[-2].sval));
+ }
+
+ break;
+
+ case 37:
+
+ {
+ (yyval.transport) = new wds::rtsp::TransportHeader();
+ (yyval.transport)->set_client_port ((yyvsp[0].nval));
+ }
+
+ break;
+
+ case 38:
+
+ {
+ (yyval.transport) = new wds::rtsp::TransportHeader();
+ (yyval.transport)->set_client_port ((yyvsp[-2].nval));
+ (yyval.transport)->set_client_supports_rtcp (true);
+ }
+
+ break;
+
+ case 39:
+
+ {
+ (yyval.transport) = new wds::rtsp::TransportHeader();
+ (yyval.transport)->set_client_port ((yyvsp[-2].nval));
+ (yyval.transport)->set_server_port ((yyvsp[0].nval));
+ }
+
+ break;
+
+ case 40:
+
+ {
+ (yyval.transport) = new wds::rtsp::TransportHeader();
+ (yyval.transport)->set_client_port ((yyvsp[-4].nval));
+ (yyval.transport)->set_client_supports_rtcp (true);
+ (yyval.transport)->set_server_port ((yyvsp[0].nval));
+ }
+
+ break;
+
+ case 41:
+
+ {
+ (yyval.transport) = new wds::rtsp::TransportHeader();
+ (yyval.transport)->set_client_port ((yyvsp[-4].nval));
+ (yyval.transport)->set_server_port ((yyvsp[-2].nval));
+ (yyval.transport)->set_server_supports_rtcp (true);
+ }
+
+ break;
+
+ case 42:
+
+ {
+ (yyval.transport) = new wds::rtsp::TransportHeader();
+ (yyval.transport)->set_client_port ((yyvsp[-6].nval));
+ (yyval.transport)->set_client_supports_rtcp (true);
+ (yyval.transport)->set_server_port ((yyvsp[-2].nval));
+ (yyval.transport)->set_server_supports_rtcp (true);
+ }
+
+ break;
+
+ case 43:
+
+ {
+ (yyval.methods) = (yyvsp[0].methods);
+ }
+
+ break;
+
+ case 44:
+
+ {
+ (yyval.methods) = new std::vector<wds::rtsp::Method>();
+ (yyval.methods)->push_back((yyvsp[0].method));
+ }
+
+ break;
+
+ case 45:
+
+ {
+ UNUSED_TOKEN((yyval.methods));
+ (yyvsp[-4].methods)->push_back((yyvsp[0].method));
+ }
+
+ break;
+
+ case 46:
+
+ { (yyval.method) = wds::rtsp::OPTIONS; }
+
+ break;
+
+ case 47:
+
+ { (yyval.method) = wds::rtsp::SET_PARAMETER; }
+
+ break;
+
+ case 48:
+
+ { (yyval.method) = wds::rtsp::GET_PARAMETER; }
+
+ break;
+
+ case 49:
+
+ { (yyval.method) = wds::rtsp::SETUP; }
+
+ break;
+
+ case 50:
+
+ { (yyval.method) = wds::rtsp::PLAY; }
+
+ break;
+
+ case 51:
+
+ { (yyval.method) = wds::rtsp::TEARDOWN; }
+
+ break;
+
+ case 52:
+
+ { (yyval.method) = wds::rtsp::PAUSE; }
+
+ break;
+
+ case 53:
+
+ { (yyval.method) = wds::rtsp::ORG_WFA_WFD_1_0; }
+
+ break;
+
+ case 56:
+
+ {
+ (yyval.mpayload) = 0;
+ }
+
+ break;
+
+ case 60:
+
+ {
+ UNUSED_TOKEN((yyval.mpayload));
+ if (auto payload = ToGetParameterPayload((yyvsp[-1].mpayload)))
+ payload->AddRequestProperty((yyvsp[0].parameter));
+ else
+ YYERROR;
+ }
+
+ break;
+
+ case 61:
+
+ {
+ (yyval.mpayload) = new wds::rtsp::GetParameterPayload();
+ wds::rtsp::ToGetParameterPayload((yyval.mpayload))->AddRequestProperty((yyvsp[0].parameter));
+ }
+
+ break;
+
+ case 62:
+
+ {
+ UNUSED_TOKEN((yyval.mpayload));
+ if (auto payload = ToGetParameterPayload((yyvsp[-1].mpayload)))
+ payload->AddRequestProperty(*(yyvsp[0].sval));
+ else
+ YYERROR;
+ DELETE_TOKEN((yyvsp[0].sval));
+ }
+
+ break;
+
+ case 63:
+
+ {
+ (yyval.mpayload) = new wds::rtsp::GetParameterPayload();
+ wds::rtsp::ToGetParameterPayload((yyval.mpayload))->AddRequestProperty(*(yyvsp[0].sval));
+ DELETE_TOKEN((yyvsp[0].sval));
+ }
+
+ break;
+
+ case 64:
+
+ { (yyval.parameter) = wds::rtsp::AudioCodecsPropertyType; }
+
+ break;
+
+ case 65:
+
+ { (yyval.parameter) = wds::rtsp::VideoFormatsPropertyType; }
+
+ break;
+
+ case 66:
+
+ { (yyval.parameter) = wds::rtsp::Video3DFormatsPropertyType; }
+
+ break;
+
+ case 67:
+
+ { (yyval.parameter) = wds::rtsp::ContentProtectionPropertyType; }
+
+ break;
+
+ case 68:
+
+ { (yyval.parameter) = wds::rtsp::DisplayEdidPropertyType; }
+
+ break;
+
+ case 69:
+
+ { (yyval.parameter) = wds::rtsp::CoupledSinkPropertyType; }
+
+ break;
+
+ case 70:
+
+ { (yyval.parameter) = wds::rtsp::TriggerMethodPropertyType; }
+
+ break;
+
+ case 71:
+
+ { (yyval.parameter) = wds::rtsp::PresentationURLPropertyType; }
+
+ break;
+
+ case 72:
+
+ { (yyval.parameter) = wds::rtsp::ClientRTPPortsPropertyType; }
+
+ break;
+
+ case 73:
+
+ { (yyval.parameter) = wds::rtsp::RoutePropertyType; }
+
+ break;
+
+ case 74:
+
+ { (yyval.parameter) = wds::rtsp::I2CPropertyType; }
+
+ break;
+
+ case 75:
+
+ { (yyval.parameter) = wds::rtsp::AVFormatChangeTimingPropertyType; }
+
+ break;
+
+ case 76:
+
+ { (yyval.parameter) = wds::rtsp::PreferredDisplayModePropertyType; }
+
+ break;
+
+ case 77:
+
+ { (yyval.parameter) = wds::rtsp::UIBCCapabilityPropertyType; }
+
+ break;
+
+ case 78:
+
+ { (yyval.parameter) = wds::rtsp::UIBCSettingPropertyType; }
+
+ break;
+
+ case 79:
+
+ { (yyval.parameter) = wds::rtsp::StandbyResumeCapabilityPropertyType; }
+
+ break;
+
+ case 80:
+
+ { (yyval.parameter) = wds::rtsp::StandbyPropertyType; }
+
+ break;
+
+ case 81:
+
+ { (yyval.parameter) = wds::rtsp::ConnectorTypePropertyType; }
+
+ break;
+
+ case 82:
+
+ {
+ (yyval.error_list) = new std::vector<unsigned short>();
+ (yyval.error_list)->push_back((yyvsp[0].nval));
+ }
+
+ break;
+
+ case 83:
+
+ {
+ (yyvsp[-3].error_list)->push_back((yyvsp[0].nval));
+ }
+
+ break;
+
+ case 84:
+
+ {
+ (yyval.property_errors) = new wds::rtsp::PropertyErrors(wds::rtsp::AudioCodecsPropertyType, *(yyvsp[0].error_list));
+ DELETE_TOKEN((yyvsp[0].error_list));
+ }
+
+ break;
+
+ case 85:
+
+ {
+ (yyval.property_errors) = new wds::rtsp::PropertyErrors(wds::rtsp::VideoFormatsPropertyType, *(yyvsp[0].error_list));
+ DELETE_TOKEN((yyvsp[0].error_list));
+ }
+
+ break;
+
+ case 86:
+
+ {
+ (yyval.property_errors) = new wds::rtsp::PropertyErrors(wds::rtsp::Video3DFormatsPropertyType, *(yyvsp[0].error_list));
+ DELETE_TOKEN((yyvsp[0].error_list));
+ }
+
+ break;
+
+ case 87:
+
+ {
+ (yyval.property_errors) = new wds::rtsp::PropertyErrors(wds::rtsp::ContentProtectionPropertyType, *(yyvsp[0].error_list));
+ DELETE_TOKEN((yyvsp[0].error_list));
+ }
+
+ break;
+
+ case 88:
+
+ {
+ (yyval.property_errors) = new wds::rtsp::PropertyErrors(wds::rtsp::DisplayEdidPropertyType, *(yyvsp[0].error_list));
+ DELETE_TOKEN((yyvsp[0].error_list));
+ }
+
+ break;
+
+ case 89:
+
+ {
+ (yyval.property_errors) = new wds::rtsp::PropertyErrors(wds::rtsp::CoupledSinkPropertyType, *(yyvsp[0].error_list));
+ DELETE_TOKEN((yyvsp[0].error_list));
+ }
+
+ break;
+
+ case 90:
+
+ {
+ (yyval.property_errors) = new wds::rtsp::PropertyErrors(wds::rtsp::TriggerMethodPropertyType, *(yyvsp[0].error_list));
+ DELETE_TOKEN((yyvsp[0].error_list));
+ }
+
+ break;
+
+ case 91:
+
+ {
+ (yyval.property_errors) = new wds::rtsp::PropertyErrors(wds::rtsp::PresentationURLPropertyType, *(yyvsp[0].error_list));
+ DELETE_TOKEN((yyvsp[0].error_list));
+ }
+
+ break;
+
+ case 92:
+
+ {
+ (yyval.property_errors) = new wds::rtsp::PropertyErrors(wds::rtsp::ClientRTPPortsPropertyType, *(yyvsp[0].error_list));
+ DELETE_TOKEN((yyvsp[0].error_list));
+ }
+
+ break;
+
+ case 93:
+
+ {
+ (yyval.property_errors) = new wds::rtsp::PropertyErrors(wds::rtsp::RoutePropertyType, *(yyvsp[0].error_list));
+ DELETE_TOKEN((yyvsp[0].error_list));
+ }
+
+ break;
+
+ case 94:
+
+ {
+ (yyval.property_errors) = new wds::rtsp::PropertyErrors(wds::rtsp::I2CPropertyType, *(yyvsp[0].error_list));
+ DELETE_TOKEN((yyvsp[0].error_list));
+ }
+
+ break;
+
+ case 95:
+
+ {
+ (yyval.property_errors) = new wds::rtsp::PropertyErrors(wds::rtsp::AVFormatChangeTimingPropertyType, *(yyvsp[0].error_list));
+ DELETE_TOKEN((yyvsp[0].error_list));
+ }
+
+ break;
+
+ case 96:
+
+ {
+ (yyval.property_errors) = new wds::rtsp::PropertyErrors(wds::rtsp::PreferredDisplayModePropertyType, *(yyvsp[0].error_list));
+ DELETE_TOKEN((yyvsp[0].error_list));
+ }
+
+ break;
+
+ case 97:
+
+ {
+ (yyval.property_errors) = new wds::rtsp::PropertyErrors(wds::rtsp::UIBCCapabilityPropertyType, *(yyvsp[0].error_list));
+ DELETE_TOKEN((yyvsp[0].error_list));
+ }
+
+ break;
+
+ case 98:
+
+ {
+ (yyval.property_errors) = new wds::rtsp::PropertyErrors(wds::rtsp::UIBCSettingPropertyType, *(yyvsp[0].error_list));
+ DELETE_TOKEN((yyvsp[0].error_list));
+ }
+
+ break;
+
+ case 99:
+
+ {
+ (yyval.property_errors) = new wds::rtsp::PropertyErrors(wds::rtsp::StandbyResumeCapabilityPropertyType, *(yyvsp[0].error_list));
+ DELETE_TOKEN((yyvsp[0].error_list));
+ }
+
+ break;
+
+ case 100:
+
+ {
+ (yyval.property_errors) = new wds::rtsp::PropertyErrors(wds::rtsp::ConnectorTypePropertyType, *(yyvsp[0].error_list));
+ DELETE_TOKEN((yyvsp[0].error_list));
+ }
+
+ break;
+
+ case 101:
+
+ {
+ (yyval.property_errors) = new wds::rtsp::PropertyErrors(wds::rtsp::IDRRequestPropertyType, *(yyvsp[0].error_list));
+ DELETE_TOKEN((yyvsp[0].error_list));
+ }
+
+ break;
+
+ case 102:
+
+ {
+ (yyval.property_errors) = new wds::rtsp::PropertyErrors(*(yyvsp[-3].sval), *(yyvsp[0].error_list));
+ DELETE_TOKEN((yyvsp[-3].sval));
+ DELETE_TOKEN((yyvsp[0].error_list));
+ }
+
+ break;
+
+ case 103:
+
+ {
+ (yyval.mpayload) = new wds::rtsp::PropertyErrorPayload();
+ ToPropertyErrorPayload((yyval.mpayload))->AddPropertyError(std::shared_ptr<wds::rtsp::PropertyErrors>((yyvsp[0].property_errors)));
+ }
+
+ break;
+
+ case 104:
+
+ {
+ if (auto payload = ToPropertyErrorPayload((yyvsp[-1].mpayload)))
+ payload->AddPropertyError(std::shared_ptr<wds::rtsp::PropertyErrors>((yyvsp[0].property_errors)));
+ else
+ YYERROR;
+ }
+
+ break;
+
+ case 105:
+
+ {
+ (yyval.mpayload) = new wds::rtsp::PropertyMapPayload();
+ ToPropertyMapPayload((yyval.mpayload))->AddProperty(std::shared_ptr<wds::rtsp::Property>((yyvsp[0].property)));
+ }
+
+ break;
+
+ case 106:
+
+ {
+ if (auto payload = ToPropertyMapPayload((yyvsp[-1].mpayload)))
+ payload->AddProperty(std::shared_ptr<wds::rtsp::Property>((yyvsp[0].property)));
+ else
+ YYERROR;
+ }
+
+ break;
+
+ case 124:
+
+ {
+ (yyval.property) = new wds::rtsp::Standby();
+ }
+
+ break;
+
+ case 125:
+
+ {
+ (yyval.property) = new wds::rtsp::IDRRequest();
+ }
+
+ break;
+
+ case 126:
+
+ {
+ (yyval.property) = new wds::rtsp::GenericProperty(*(yyvsp[-1].sval), *(yyvsp[0].sval));
+ DELETE_TOKEN((yyvsp[-1].sval));
+ DELETE_TOKEN((yyvsp[0].sval));
+ }
+
+ break;
+
+ case 127:
+
+ {
+ (yyval.property) = new wds::rtsp::AudioCodecs(*(yyvsp[0].audio_codecs));
+ DELETE_TOKEN((yyvsp[0].audio_codecs));
+ }
+
+ break;
+
+ case 128:
+
+ {
+ (yyval.property) = new wds::rtsp::AudioCodecs();
+ }
+
+ break;
+
+ case 129:
+
+ {
+ (yyval.audio_codecs) = new std::vector<wds::AudioCodec>();
+ (yyval.audio_codecs)->push_back(*(yyvsp[0].audio_codec));
+ DELETE_TOKEN((yyvsp[0].audio_codec));
+ }
+
+ break;
+
+ case 130:
+
+ {
+ UNUSED_TOKEN((yyval.audio_codecs));
+ (yyvsp[-3].audio_codecs)->push_back(*(yyvsp[0].audio_codec));
+ DELETE_TOKEN((yyvsp[0].audio_codec));
+ }
+
+ break;
+
+ case 131:
+
+ {
+ (yyval.audio_codec) = new wds::AudioCodec((yyvsp[-4].audio_format), (yyvsp[-2].nval), (yyvsp[0].nval));
+ }
+
+ break;
+
+ case 132:
+
+ { (yyval.audio_format) = wds::LPCM; }
+
+ break;
+
+ case 133:
+
+ { (yyval.audio_format) = wds::AAC; }
+
+ break;
+
+ case 134:
+
+ { (yyval.audio_format) = wds::AC3; }
+
+ break;
+
+ case 135:
+
+ {
+ (yyval.property) = new wds::rtsp::VideoFormats();
+ }
+
+ break;
+
+ case 136:
+
+ {
+ (yyval.property) = new wds::rtsp::VideoFormats((yyvsp[-4].nval), (yyvsp[-2].nval), *(yyvsp[0].codecs));
+ DELETE_TOKEN((yyvsp[0].codecs));
+ }
+
+ break;
+
+ case 137:
+
+ {
+ (yyval.codecs) = new wds::rtsp::H264Codecs();
+ (yyval.codecs)->push_back(*(yyvsp[0].codec));
+ DELETE_TOKEN((yyvsp[0].codec));
+ }
+
+ break;
+
+ case 138:
+
+ {
+ UNUSED_TOKEN((yyval.codecs));
+ (yyvsp[-4].codecs)->push_back(*(yyvsp[0].codec));
+ DELETE_TOKEN((yyvsp[0].codec));
+ }
+
+ break;
+
+ case 139:
+
+ {
+ (yyval.codec) = new wds::rtsp::H264Codec((yyvsp[-20].nval), (yyvsp[-18].nval), (yyvsp[-16].nval), (yyvsp[-14].nval), (yyvsp[-12].nval), (yyvsp[-10].nval), (yyvsp[-8].nval), (yyvsp[-6].nval), (yyvsp[-4].nval), (yyvsp[-2].nval), (yyvsp[0].nval));
+ }
+
+ break;
+
+ case 140:
+
+ {
+ (yyval.codecs_3d) = new wds::rtsp::H264Codecs3d();
+ (yyval.codecs_3d)->push_back(*(yyvsp[0].codec_3d));
+ DELETE_TOKEN((yyvsp[0].codec_3d));
+ }
+
+ break;
+
+ case 141:
+
+ {
+ UNUSED_TOKEN((yyval.codecs_3d));
+ (yyvsp[-4].codecs_3d)->push_back(*(yyvsp[0].codec_3d));
+ DELETE_TOKEN((yyvsp[0].codec_3d));
+ }
+
+ break;
+
+ case 142:
+
+ {
+ (yyval.codec_3d) = new wds::rtsp::H264Codec3d((yyvsp[-16].nval), (yyvsp[-14].nval), (yyvsp[-12].nval), (yyvsp[-10].nval), (yyvsp[-8].nval), (yyvsp[-6].nval), (yyvsp[-4].nval), (yyvsp[-2].nval), (yyvsp[0].nval));
+ }
+
+ break;
+
+ case 143:
+
+ {
+ (yyval.nval) = 0;
+ }
+
+ break;
+
+ case 145:
+
+ {
+ (yyval.nval) = 0;
+ }
+
+ break;
+
+ case 147:
+
+ {
+ (yyval.property) = new wds::rtsp::Formats3d((yyvsp[-4].nval), (yyvsp[-2].nval), *(yyvsp[0].codecs_3d));
+ DELETE_TOKEN((yyvsp[0].codecs_3d));
+ }
+
+ break;
+
+ case 148:
+
+ {
+ (yyval.property) = new wds::rtsp::Formats3d();
+ }
+
+ break;
+
+ case 149:
+
+ {
+ (yyval.property) = new wds::rtsp::ContentProtection();
+ }
+
+ break;
+
+ case 150:
+
+ {
+ (yyval.property) = new wds::rtsp::ContentProtection((yyvsp[-3].hdcp_spec), (yyvsp[0].nval));
+ }
+
+ break;
+
+ case 151:
+
+ {
+ (yyval.hdcp_spec) = wds::rtsp::ContentProtection::HDCP_SPEC_2_0;
+ }
+
+ break;
+
+ case 152:
+
+ {
+ (yyval.hdcp_spec) = wds::rtsp::ContentProtection::HDCP_SPEC_2_1;
+ }
+
+ break;
+
+ case 153:
+
+ {
+ (yyval.property) = new wds::rtsp::DisplayEdid();
+ }
+
+ break;
+
+ case 154:
+
+ {
+ (yyval.property) = new wds::rtsp::DisplayEdid((yyvsp[-2].nval), (yyvsp[0].sval) ? *(yyvsp[0].sval) : "");
+ DELETE_TOKEN((yyvsp[0].sval));
+ }
+
+ break;
+
+ case 155:
+
+ {
+ (yyval.sval) = 0;
+ }
+
+ break;
+
+ case 157:
+
+ {
+ (yyval.property) = new wds::rtsp::CoupledSink();
+ }
+
+ break;
+
+ case 158:
+
+ {
+ (yyval.property) = new wds::rtsp::CoupledSink((yyvsp[-2].nval), (yyvsp[0].nval));
+ }
+
+ break;
+
+ case 159:
+
+ {
+ (yyval.nval) = -1;
+ }
+
+ break;
+
+ case 161:
+
+ {
+ (yyval.property) = new wds::rtsp::TriggerMethod((yyvsp[0].trigger_method));
+ }
+
+ break;
+
+ case 162:
+
+ {
+ (yyval.trigger_method) = wds::rtsp::TriggerMethod::SETUP;
+ }
+
+ break;
+
+ case 163:
+
+ {
+ (yyval.trigger_method) = wds::rtsp::TriggerMethod::PAUSE;
+ }
+
+ break;
+
+ case 164:
+
+ {
+ (yyval.trigger_method) = wds::rtsp::TriggerMethod::TEARDOWN;
+ }
+
+ break;
+
+ case 165:
+
+ {
+ (yyval.trigger_method) = wds::rtsp::TriggerMethod::PLAY;
+ }
+
+ break;
+
+ case 166:
+
+ {
+ (yyval.property) = new wds::rtsp::PresentationUrl((yyvsp[-2].sval) ? *(yyvsp[-2].sval) : "", (yyvsp[0].sval) ? *(yyvsp[0].sval) : "");
+ DELETE_TOKEN((yyvsp[-2].sval));
+ DELETE_TOKEN((yyvsp[0].sval));
+ }
+
+ break;
+
+ case 167:
+
+ {
+ (yyval.sval) = 0;
+ }
+
+ break;
+
+ case 169:
+
+ {
+ (yyval.sval) = 0;
+ }
+
+ break;
+
+ case 171:
+
+ {
+ (yyval.property) = new wds::rtsp::ClientRtpPorts((yyvsp[-4].nval), (yyvsp[-2].nval));
+ }
+
+ break;
+
+ case 172:
+
+ {
+ (yyval.property) = new wds::rtsp::Route((yyvsp[0].route_destination));
+ }
+
+ break;
+
+ case 173:
+
+ {
+ (yyval.route_destination) = wds::rtsp::Route::PRIMARY;
+ }
+
+ break;
+
+ case 174:
+
+ {
+ (yyval.route_destination) = wds::rtsp::Route::SECONDARY;
+ }
+
+ break;
+
+ case 175:
+
+ {
+ (yyval.property) = new wds::rtsp::I2C((yyvsp[0].nval));
+ }
+
+ break;
+
+ case 176:
+
+ {
+ (yyval.nval) = -1;
+ }
+
+ break;
+
+ case 178:
+
+ {
+ (yyval.property) = new wds::rtsp::AVFormatChangeTiming((yyvsp[-2].nval), (yyvsp[0].nval));
+ }
+
+ break;
+
+ case 179:
+
+ {
+ (yyval.property) = new wds::rtsp::PreferredDisplayMode((yyvsp[-24].nval), (yyvsp[-22].nval), (yyvsp[-20].nval), (yyvsp[-18].nval), (yyvsp[-16].nval), (yyvsp[-14].nval), (yyvsp[-12].nval), (yyvsp[-10].nval), (yyvsp[-8].nval), (yyvsp[-6].nval), (yyvsp[-4].nval), (yyvsp[-2].nval), *(yyvsp[0].codec));
+ DELETE_TOKEN((yyvsp[0].codec));
+ }
+
+ break;
+
+ case 180:
+
+ {
+ (yyval.property) = new wds::rtsp::UIBCCapability();
+ }
+
+ break;
+
+ case 181:
+
+ {
+ (yyval.property) = new wds::rtsp::UIBCCapability(*(yyvsp[-7].input_category_list), *(yyvsp[-5].generic_cap_list), *(yyvsp[-3].hidc_cap_list), (yyvsp[0].nval));
+ DELETE_TOKEN((yyvsp[-7].input_category_list));
+ DELETE_TOKEN((yyvsp[-5].generic_cap_list));
+ DELETE_TOKEN((yyvsp[-3].hidc_cap_list));
+ }
+
+ break;
+
+ case 182:
+
+ {
+ (yyval.input_category_list) = (yyvsp[0].input_category_list);
+ }
+
+ break;
+
+ case 183:
+
+ {
+ (yyval.input_category_list) = new std::vector<wds::rtsp::UIBCCapability::InputCategory>();
+ }
+
+ break;
+
+ case 184:
+
+ {
+ (yyval.input_category_list) = new std::vector<wds::rtsp::UIBCCapability::InputCategory>();
+ (yyval.input_category_list)->push_back((yyvsp[0].input_category_list_value));
+ }
+
+ break;
+
+ case 185:
+
+ {
+ (yyvsp[-3].input_category_list)->push_back((yyvsp[0].input_category_list_value));
+ }
+
+ break;
+
+ case 186:
+
+ {
+ (yyval.input_category_list_value) = wds::rtsp::UIBCCapability::GENERIC;
+ }
+
+ break;
+
+ case 187:
+
+ {
+ (yyval.input_category_list_value) = wds::rtsp::UIBCCapability::HIDC;
+ }
+
+ break;
+
+ case 188:
+
+ {
+ (yyval.generic_cap_list) = (yyvsp[0].generic_cap_list);
+ }
+
+ break;
+
+ case 189:
+
+ {
+ (yyval.generic_cap_list) = new std::vector<wds::rtsp::UIBCCapability::InputType>();
+ }
+
+ break;
+
+ case 190:
+
+ {
+ (yyval.generic_cap_list) = new std::vector<wds::rtsp::UIBCCapability::InputType>();
+ (yyval.generic_cap_list)->push_back((yyvsp[0].generic_cap_list_value));
+ }
+
+ break;
+
+ case 191:
+
+ {
+ (yyvsp[-3].generic_cap_list)->push_back((yyvsp[0].generic_cap_list_value));
+ }
+
+ break;
+
+ case 192:
+
+ {
+ (yyval.generic_cap_list_value) = wds::rtsp::UIBCCapability::KEYBOARD;
+ }
+
+ break;
+
+ case 193:
+
+ {
+ (yyval.generic_cap_list_value) = wds::rtsp::UIBCCapability::MOUSE;
+ }
+
+ break;
+
+ case 194:
+
+ {
+ (yyval.generic_cap_list_value) = wds::rtsp::UIBCCapability::SINGLE_TOUCH;
+ }
+
+ break;
+
+ case 195:
+
+ {
+ (yyval.generic_cap_list_value) = wds::rtsp::UIBCCapability::MULTI_TOUCH;
+ }
+
+ break;
+
+ case 196:
+
+ {
+ (yyval.generic_cap_list_value) = wds::rtsp::UIBCCapability::JOYSTICK;
+ }
+
+ break;
+
+ case 197:
+
+ {
+ (yyval.generic_cap_list_value) = wds::rtsp::UIBCCapability::CAMERA;
+ }
+
+ break;
+
+ case 198:
+
+ {
+ (yyval.generic_cap_list_value) = wds::rtsp::UIBCCapability::GESTURE;
+ }
+
+ break;
+
+ case 199:
+
+ {
+ (yyval.generic_cap_list_value) = wds::rtsp::UIBCCapability::REMOTE_CONTROL;
+ }
+
+ break;
+
+ case 200:
+
+ {
+ (yyval.hidc_cap_list) = (yyvsp[0].hidc_cap_list);
+ }
+
+ break;
+
+ case 201:
+
+ {
+ (yyval.hidc_cap_list) = new std::vector<wds::rtsp::UIBCCapability::DetailedCapability>();
+ }
+
+ break;
+
+ case 202:
+
+ {
+ (yyval.hidc_cap_list) = new std::vector<wds::rtsp::UIBCCapability::DetailedCapability>();
+ (yyval.hidc_cap_list)->push_back(*(yyvsp[0].hidc_cap_list_value));
+ DELETE_TOKEN((yyvsp[0].hidc_cap_list_value));
+ }
+
+ break;
+
+ case 203:
+
+ {
+ (yyvsp[-3].hidc_cap_list)->push_back(*(yyvsp[0].hidc_cap_list_value));
+ DELETE_TOKEN((yyvsp[0].hidc_cap_list_value));
+ }
+
+ break;
+
+ case 204:
+
+ {
+ (yyval.hidc_cap_list_value) = new wds::rtsp::UIBCCapability::DetailedCapability((yyvsp[-2].generic_cap_list_value), (yyvsp[0].input_path));
+ }
+
+ break;
+
+ case 205:
+
+ {
+ (yyval.input_path) = wds::rtsp::UIBCCapability::INFRARED;
+ }
+
+ break;
+
+ case 206:
+
+ {
+ (yyval.input_path) = wds::rtsp::UIBCCapability::USB;
+ }
+
+ break;
+
+ case 207:
+
+ {
+ (yyval.input_path) = wds::rtsp::UIBCCapability::BT;
+ }
+
+ break;
+
+ case 208:
+
+ {
+ (yyval.input_path) = wds::rtsp::UIBCCapability::ZIGBEE;
+ }
+
+ break;
+
+ case 209:
+
+ {
+ (yyval.input_path) = wds::rtsp::UIBCCapability::WI_FI;
+ }
+
+ break;
+
+ case 210:
+
+ {
+ (yyval.input_path) = wds::rtsp::UIBCCapability::NO_SP;
+ }
+
+ break;
+
+ case 211:
+
+ {
+ (yyval.property) = new wds::rtsp::UIBCSetting((yyvsp[0].uibc_setting));
+ }
+
+ break;
+
+ case 212:
+
+ {
+ (yyval.uibc_setting) = true;
+ }
+
+ break;
+
+ case 213:
+
+ {
+ (yyval.uibc_setting) = false;
+ }
+
+ break;
+
+ case 214:
+
+ {
+ (yyval.property) = new wds::rtsp::StandbyResumeCapability((yyvsp[0].bool_val));
+ }
+
+ break;
+
+ case 215:
+
+ {
+ (yyval.bool_val) = false;
+ }
+
+ break;
+
+ case 216:
+
+ {
+ (yyval.bool_val) = true;
+ }
+
+ break;
+
+ case 217:
+
+ {
+ (yyval.property) = new wds::rtsp::ConnectorType((yyvsp[0].nval));
+ }
+
+ break;
+
+ case 218:
+
+ {
+ (yyval.property) = new wds::rtsp::ConnectorType();
+ }
+
+ break;
+
+
+
+ default: break;
+ }
+ /* User semantic actions sometimes alter yychar, and that requires
+ that yytoken be updated with the new translation. We take the
+ approach of translating immediately before every use of yytoken.
+ One alternative is translating here after every semantic action,
+ but that translation would be missed if the semantic action invokes
+ YYABORT, YYACCEPT, or YYERROR immediately after altering yychar or
+ if it invokes YYBACKUP. In the case of YYABORT or YYACCEPT, an
+ incorrect destructor might then be invoked immediately. In the
+ case of YYERROR or YYBACKUP, subsequent parser actions might lead
+ to an incorrect destructor call or verbose syntax error message
+ before the lookahead is translated. */
+ YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
+
+ YYPOPSTACK (yylen);
+ yylen = 0;
+ YY_STACK_PRINT (yyss, yyssp);
+
+ *++yyvsp = yyval;
+
+ /* Now 'shift' the result of the reduction. Determine what state
+ that goes to, based on the state we popped back to and the rule
+ number reduced by. */
+
+ yyn = yyr1[yyn];
+
+ yystate = yypgoto[yyn - YYNTOKENS] + *yyssp;
+ if (0 <= yystate && yystate <= YYLAST && yycheck[yystate] == *yyssp)
+ yystate = yytable[yystate];
+ else
+ yystate = yydefgoto[yyn - YYNTOKENS];
+
+ goto yynewstate;
+
+
+/*--------------------------------------.
+| yyerrlab -- here on detecting error. |
+`--------------------------------------*/
+yyerrlab:
+ /* Make sure we have latest lookahead translation. See comments at
+ user semantic actions for why this is necessary. */
+ yytoken = yychar == YYEMPTY ? YYEMPTY : YYTRANSLATE (yychar);
+
+ /* If not already recovering from an error, report this error. */
+ if (!yyerrstatus)
+ {
+ ++yynerrs;
+#if ! YYERROR_VERBOSE
+ yyerror (scanner, message, YY_("syntax error"));
+#else
+# define YYSYNTAX_ERROR yysyntax_error (&yymsg_alloc, &yymsg, \
+ yyssp, yytoken)
+ {
+ char const *yymsgp = YY_("syntax error");
+ int yysyntax_error_status;
+ yysyntax_error_status = YYSYNTAX_ERROR;
+ if (yysyntax_error_status == 0)
+ yymsgp = yymsg;
+ else if (yysyntax_error_status == 1)
+ {
+ if (yymsg != yymsgbuf)
+ YYSTACK_FREE (yymsg);
+ yymsg = (char *) YYSTACK_ALLOC (yymsg_alloc);
+ if (!yymsg)
+ {
+ yymsg = yymsgbuf;
+ yymsg_alloc = sizeof yymsgbuf;
+ yysyntax_error_status = 2;
+ }
+ else
+ {
+ yysyntax_error_status = YYSYNTAX_ERROR;
+ yymsgp = yymsg;
+ }
+ }
+ yyerror (scanner, message, yymsgp);
+ if (yysyntax_error_status == 2)
+ goto yyexhaustedlab;
+ }
+# undef YYSYNTAX_ERROR
+#endif
+ }
+
+
+
+ if (yyerrstatus == 3)
+ {
+ /* If just tried and failed to reuse lookahead token after an
+ error, discard it. */
+
+ if (yychar <= YYEOF)
+ {
+ /* Return failure if at end of input. */
+ if (yychar == YYEOF)
+ YYABORT;
+ }
+ else
+ {
+ yydestruct ("Error: discarding",
+ yytoken, &yylval, scanner, message);
+ yychar = YYEMPTY;
+ }
+ }
+
+ /* Else will try to reuse lookahead token after shifting the error
+ token. */
+ goto yyerrlab1;
+
+
+/*---------------------------------------------------.
+| yyerrorlab -- error raised explicitly by YYERROR. |
+`---------------------------------------------------*/
+yyerrorlab:
+
+ /* Pacify compilers like GCC when the user code never invokes
+ YYERROR and the label yyerrorlab therefore never appears in user
+ code. */
+ if (/*CONSTCOND*/ 0)
+ goto yyerrorlab;
+
+ /* Do not reclaim the symbols of the rule whose action triggered
+ this YYERROR. */
+ YYPOPSTACK (yylen);
+ yylen = 0;
+ YY_STACK_PRINT (yyss, yyssp);
+ yystate = *yyssp;
+ goto yyerrlab1;
+
+
+/*-------------------------------------------------------------.
+| yyerrlab1 -- common code for both syntax error and YYERROR. |
+`-------------------------------------------------------------*/
+yyerrlab1:
+ yyerrstatus = 3; /* Each real token shifted decrements this. */
+
+ for (;;)
+ {
+ yyn = yypact[yystate];
+ if (!yypact_value_is_default (yyn))
+ {
+ yyn += YYTERROR;
+ if (0 <= yyn && yyn <= YYLAST && yycheck[yyn] == YYTERROR)
+ {
+ yyn = yytable[yyn];
+ if (0 < yyn)
+ break;
+ }
+ }
+
+ /* Pop the current state because it cannot handle the error token. */
+ if (yyssp == yyss)
+ YYABORT;
+
+
+ yydestruct ("Error: popping",
+ yystos[yystate], yyvsp, scanner, message);
+ YYPOPSTACK (1);
+ yystate = *yyssp;
+ YY_STACK_PRINT (yyss, yyssp);
+ }
+
+ YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
+ *++yyvsp = yylval;
+ YY_IGNORE_MAYBE_UNINITIALIZED_END
+
+
+ /* Shift the error token. */
+ YY_SYMBOL_PRINT ("Shifting", yystos[yyn], yyvsp, yylsp);
+
+ yystate = yyn;
+ goto yynewstate;
+
+
+/*-------------------------------------.
+| yyacceptlab -- YYACCEPT comes here. |
+`-------------------------------------*/
+yyacceptlab:
+ yyresult = 0;
+ goto yyreturn;
+
+/*-----------------------------------.
+| yyabortlab -- YYABORT comes here. |
+`-----------------------------------*/
+yyabortlab:
+ yyresult = 1;
+ goto yyreturn;
+
+#if !defined yyoverflow || YYERROR_VERBOSE
+/*-------------------------------------------------.
+| yyexhaustedlab -- memory exhaustion comes here. |
+`-------------------------------------------------*/
+yyexhaustedlab:
+ yyerror (scanner, message, YY_("memory exhausted"));
+ yyresult = 2;
+ /* Fall through. */
+#endif
+
+yyreturn:
+ if (yychar != YYEMPTY)
+ {
+ /* Make sure we have latest lookahead translation. See comments at
+ user semantic actions for why this is necessary. */
+ yytoken = YYTRANSLATE (yychar);
+ yydestruct ("Cleanup: discarding lookahead",
+ yytoken, &yylval, scanner, message);
+ }
+ /* Do not reclaim the symbols of the rule whose action triggered
+ this YYABORT or YYACCEPT. */
+ YYPOPSTACK (yylen);
+ YY_STACK_PRINT (yyss, yyssp);
+ while (yyssp != yyss)
+ {
+ yydestruct ("Cleanup: popping",
+ yystos[*yyssp], yyvsp, scanner, message);
+ YYPOPSTACK (1);
+ }
+#ifndef yyoverflow
+ if (yyss != yyssa)
+ YYSTACK_FREE (yyss);
+#endif
+#if YYERROR_VERBOSE
+ if (yymsg != yymsgbuf)
+ YYSTACK_FREE (yymsg);
+#endif
+ return yyresult;
+}
+
+
diff --git a/chromium/third_party/wds/gen/parser.h b/chromium/third_party/wds/gen/parser.h
new file mode 100644
index 00000000000..896b1a8de3c
--- /dev/null
+++ b/chromium/third_party/wds/gen/parser.h
@@ -0,0 +1,261 @@
+/* A Bison parser, made by GNU Bison 3.0.2. */
+
+/* Bison interface for Yacc-like parsers in C
+
+ Copyright (C) 1984, 1989-1990, 2000-2013 Free Software Foundation, Inc.
+
+ This program is free software: you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation, either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+/* As a special exception, you may create a larger work that contains
+ part or all of the Bison parser skeleton and distribute that work
+ under terms of your choice, so long as that work isn't itself a
+ parser generator using the skeleton or a modified version thereof
+ as a parser skeleton. Alternatively, if you modify or redistribute
+ the parser skeleton itself, you may (at your option) remove this
+ special exception, which will cause the skeleton and the resulting
+ Bison output files to be licensed under the GNU General Public
+ License without this special exception.
+
+ This special exception was added by the Free Software Foundation in
+ version 2.2 of Bison. */
+
+#ifndef YY_WDS_GEN_PARSER_H_INCLUDED
+# define YY_WDS_GEN_PARSER_H_INCLUDED
+/* Debug traces. */
+#ifndef YYDEBUG
+# define YYDEBUG 0
+#endif
+#if YYDEBUG
+extern int wds_debug;
+#endif
+/* "%code requires" blocks. */
+
+
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2015 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+ #include <map>
+ #include <memory>
+ #include "libwds/rtsp/audiocodecs.h"
+ #include "libwds/rtsp/contentprotection.h"
+ #include "libwds/rtsp/triggermethod.h"
+ #include "libwds/rtsp/route.h"
+ #include "libwds/rtsp/uibcsetting.h"
+ #include "libwds/rtsp/uibccapability.h"
+
+ #define YYLEX_PARAM scanner
+
+ namespace wds {
+ struct AudioCodec;
+ namespace rtsp {
+ class Driver;
+ class Scanner;
+ class Message;
+ class Header;
+ class TransportHeader;
+ class Property;
+ class PropertyErrors;
+ class Payload;
+ class VideoFormats;
+ struct H264Codec;
+ struct H264Codec3d;
+ }
+ }
+
+
+
+/* Token type. */
+#ifndef YYTOKENTYPE
+# define YYTOKENTYPE
+ enum yytokentype
+ {
+ END = 0,
+ WFD_SP = 258,
+ WFD_NUM = 259,
+ WFD_OPTIONS = 260,
+ WFD_SET_PARAMETER = 261,
+ WFD_GET_PARAMETER = 262,
+ WFD_SETUP = 263,
+ WFD_PLAY = 264,
+ WFD_TEARDOWN = 265,
+ WFD_PAUSE = 266,
+ WFD_END = 267,
+ WFD_RESPONSE = 268,
+ WFD_RESPONSE_CODE = 269,
+ WFD_STRING = 270,
+ WFD_GENERIC_PROPERTY = 271,
+ WFD_HEADER = 272,
+ WFD_CSEQ = 273,
+ WFD_RESPONSE_METHODS = 274,
+ WFD_TAG = 275,
+ WFD_SUPPORT_CHECK = 276,
+ WFD_REQUEST_URI = 277,
+ WFD_CONTENT_TYPE = 278,
+ WFD_MIME = 279,
+ WFD_CONTENT_LENGTH = 280,
+ WFD_AUDIO_CODECS = 281,
+ WFD_VIDEO_FORMATS = 282,
+ WFD_3D_FORMATS = 283,
+ WFD_CONTENT_PROTECTION = 284,
+ WFD_DISPLAY_EDID = 285,
+ WFD_COUPLED_SINK = 286,
+ WFD_TRIGGER_METHOD = 287,
+ WFD_PRESENTATION_URL = 288,
+ WFD_CLIENT_RTP_PORTS = 289,
+ WFD_ROUTE = 290,
+ WFD_I2C = 291,
+ WFD_AV_FORMAT_CHANGE_TIMING = 292,
+ WFD_PREFERRED_DISPLAY_MODE = 293,
+ WFD_UIBC_CAPABILITY = 294,
+ WFD_UIBC_SETTING = 295,
+ WFD_STANDBY_RESUME_CAPABILITY = 296,
+ WFD_STANDBY_IN_REQUEST = 297,
+ WFD_STANDBY_IN_RESPONSE = 298,
+ WFD_CONNECTOR_TYPE = 299,
+ WFD_IDR_REQUEST = 300,
+ WFD_AUDIO_CODECS_ERROR = 301,
+ WFD_VIDEO_FORMATS_ERROR = 302,
+ WFD_3D_FORMATS_ERROR = 303,
+ WFD_CONTENT_PROTECTION_ERROR = 304,
+ WFD_DISPLAY_EDID_ERROR = 305,
+ WFD_COUPLED_SINK_ERROR = 306,
+ WFD_TRIGGER_METHOD_ERROR = 307,
+ WFD_PRESENTATION_URL_ERROR = 308,
+ WFD_CLIENT_RTP_PORTS_ERROR = 309,
+ WFD_ROUTE_ERROR = 310,
+ WFD_I2C_ERROR = 311,
+ WFD_AV_FORMAT_CHANGE_TIMING_ERROR = 312,
+ WFD_PREFERRED_DISPLAY_MODE_ERROR = 313,
+ WFD_UIBC_CAPABILITY_ERROR = 314,
+ WFD_UIBC_SETTING_ERROR = 315,
+ WFD_STANDBY_RESUME_CAPABILITY_ERROR = 316,
+ WFD_STANDBY_ERROR = 317,
+ WFD_CONNECTOR_TYPE_ERROR = 318,
+ WFD_IDR_REQUEST_ERROR = 319,
+ WFD_GENERIC_PROPERTY_ERROR = 320,
+ WFD_NONE = 321,
+ WFD_AUDIO_CODEC_LPCM = 322,
+ WFD_AUDIO_CODEC_AAC = 323,
+ WFD_AUDIO_CODEC_AC3 = 324,
+ WFD_HDCP_SPEC_2_0 = 325,
+ WFD_HDCP_SPEC_2_1 = 326,
+ WFD_IP_PORT = 327,
+ WFD_PRESENTATION_URL_0 = 328,
+ WFD_PRESENTATION_URL_1 = 329,
+ WFD_STREAM_PROFILE = 330,
+ WFD_MODE_PLAY = 331,
+ WFD_ROUTE_PRIMARY = 332,
+ WFD_ROUTE_SECONDARY = 333,
+ WFD_INPUT_CATEGORY_LIST = 334,
+ WFD_INPUT_CATEGORY_GENERIC = 335,
+ WFD_INPUT_CATEGORY_HIDC = 336,
+ WFD_GENERIC_CAP_LIST = 337,
+ WFD_INPUT_TYPE_KEYBOARD = 338,
+ WFD_INPUT_TYPE_MOUSE = 339,
+ WFD_INPUT_TYPE_SINGLE_TOUCH = 340,
+ WFD_INPUT_TYPE_MULTI_TOUCH = 341,
+ WFD_INPUT_TYPE_JOYSTICK = 342,
+ WFD_INPUT_TYPE_CAMERA = 343,
+ WFD_INPUT_TYPE_GESTURE = 344,
+ WFD_INPUT_TYPE_REMOTE_CONTROL = 345,
+ WFD_HIDC_CAP_LIST = 346,
+ WFD_INPUT_PATH_INFRARED = 347,
+ WFD_INPUT_PATH_USB = 348,
+ WFD_INPUT_PATH_BT = 349,
+ WFD_INPUT_PATH_WIFI = 350,
+ WFD_INPUT_PATH_ZIGBEE = 351,
+ WFD_INPUT_PATH_NOSP = 352,
+ WFD_UIBC_SETTING_ENABLE = 353,
+ WFD_UIBC_SETTING_DISABLE = 354,
+ WFD_SUPPORTED = 355,
+ WFD_SESSION = 356,
+ WFD_SESSION_ID = 357,
+ WFD_TIMEOUT = 358,
+ WFD_TRANSPORT = 359,
+ WFD_SERVER_PORT = 360
+ };
+#endif
+
+/* Value type. */
+#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
+typedef union YYSTYPE YYSTYPE;
+union YYSTYPE
+{
+
+
+ std::string* sval;
+ unsigned long long int nval;
+ bool bool_val;
+ std::vector<std::string>* vsval;
+ wds::rtsp::Message* message;
+ wds::rtsp::Header* header;
+ wds::rtsp::Payload* mpayload;
+ wds::AudioFormats audio_format;
+ wds::rtsp::Property* property;
+ std::vector<unsigned short>* error_list;
+ wds::rtsp::PropertyErrors* property_errors;
+ std::map<wds::rtsp::PropertyType, std::shared_ptr<wds::rtsp::PropertyErrors>>* property_error_map;
+ std::vector<wds::rtsp::H264Codec>* codecs;
+ wds::rtsp::H264Codec* codec;
+ std::vector<wds::rtsp::H264Codec3d>* codecs_3d;
+ wds::rtsp::H264Codec3d* codec_3d;
+ wds::rtsp::ContentProtection::HDCPSpec hdcp_spec;
+ wds::rtsp::TriggerMethod::Method trigger_method;
+ wds::rtsp::Route::Destination route_destination;
+ bool uibc_setting;
+ std::vector<wds::rtsp::UIBCCapability::InputCategory>* input_category_list;
+ std::vector<wds::rtsp::UIBCCapability::InputType>* generic_cap_list;
+ std::vector<wds::rtsp::UIBCCapability::DetailedCapability>* hidc_cap_list;
+ wds::rtsp::UIBCCapability::InputCategory input_category_list_value;
+ wds::rtsp::UIBCCapability::InputType generic_cap_list_value;
+ wds::rtsp::UIBCCapability::DetailedCapability* hidc_cap_list_value;
+ wds::rtsp::UIBCCapability::InputPath input_path;
+ wds::rtsp::Method method;
+ std::vector<wds::rtsp::Method>* methods;
+ wds::rtsp::PropertyType parameter;
+ std::vector<wds::rtsp::PropertyType>* parameters;
+ std::vector<wds::AudioCodec>* audio_codecs;
+ wds::AudioCodec* audio_codec;
+ std::pair<std::string, unsigned int>* session_info;
+ wds::rtsp::TransportHeader* transport;
+
+
+};
+# define YYSTYPE_IS_TRIVIAL 1
+# define YYSTYPE_IS_DECLARED 1
+#endif
+
+
+
+int wds_parse (void* scanner, std::unique_ptr<wds::rtsp::Message>& message);
+
+#endif /* !YY_WDS_GEN_PARSER_H_INCLUDED */
diff --git a/chromium/third_party/wds/src/CMakeLists.txt b/chromium/third_party/wds/src/CMakeLists.txt
new file mode 100644
index 00000000000..964a80561be
--- /dev/null
+++ b/chromium/third_party/wds/src/CMakeLists.txt
@@ -0,0 +1,23 @@
+cmake_minimum_required(VERSION 2.8)
+
+project(wds CXX)
+
+set(WDS_VERSION_MAJOR 1)
+set(WDS_VERSION_MINOR 1)
+set(WDS_VERSION_PATCH 0)
+
+enable_testing()
+
+include(GNUInstallDirs)
+
+add_subdirectory(data)
+add_subdirectory(libwds/rtsp)
+add_subdirectory(libwds/rtsp/tests)
+add_subdirectory(libwds/common)
+add_subdirectory(libwds/source)
+add_subdirectory(libwds/sink)
+add_subdirectory(libwds)
+add_subdirectory(p2p)
+add_subdirectory(mirac_network)
+add_subdirectory(sink)
+add_subdirectory(desktop_source)
diff --git a/chromium/third_party/wds/src/COPYING b/chromium/third_party/wds/src/COPYING
new file mode 100644
index 00000000000..e8c3f50515a
--- /dev/null
+++ b/chromium/third_party/wds/src/COPYING
@@ -0,0 +1,503 @@
+ GNU LESSER GENERAL PUBLIC LICENSE
+ Version 2.1, February 1999
+
+ Copyright (C) 1991, 1999 Free Software Foundation, Inc.
+ 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the Lesser GPL. It also counts
+ as the successor of the GNU Library Public License, version 2, hence
+ the version number 2.1.]
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+ This license, the Lesser General Public License, applies to some
+specially designated software packages--typically libraries--of the
+Free Software Foundation and other authors who decide to use it. You
+can use it too, but we suggest you first think carefully about whether
+this license or the ordinary General Public License is the better
+strategy to use in any particular case, based on the explanations below.
+
+ When we speak of free software, we are referring to freedom of use,
+not price. Our General Public Licenses are designed to make sure that
+you have the freedom to distribute copies of free software (and charge
+for this service if you wish); that you receive source code or can get
+it if you want it; that you can change the software and use pieces of
+it in new free programs; and that you are informed that you can do
+these things.
+
+ To protect your rights, we need to make restrictions that forbid
+distributors to deny you these rights or to ask you to surrender these
+rights. These restrictions translate to certain responsibilities for
+you if you distribute copies of the library or if you modify it.
+
+ For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you. You must make sure that they, too, receive or can get the source
+code. If you link other code with the library, you must provide
+complete object files to the recipients, so that they can relink them
+with the library after making changes to the library and recompiling
+it. And you must show them these terms so they know their rights.
+
+ We protect your rights with a two-step method: (1) we copyright the
+library, and (2) we offer you this license, which gives you legal
+permission to copy, distribute and/or modify the library.
+
+ To protect each distributor, we want to make it very clear that
+there is no warranty for the free library. Also, if the library is
+modified by someone else and passed on, the recipients should know
+that what they have is not the original version, so that the original
+author's reputation will not be affected by problems that might be
+introduced by others.
+
+ Finally, software patents pose a constant threat to the existence of
+any free program. We wish to make sure that a company cannot
+effectively restrict the users of a free program by obtaining a
+restrictive license from a patent holder. Therefore, we insist that
+any patent license obtained for a version of the library must be
+consistent with the full freedom of use specified in this license.
+
+ Most GNU software, including some libraries, is covered by the
+ordinary GNU General Public License. This license, the GNU Lesser
+General Public License, applies to certain designated libraries, and
+is quite different from the ordinary General Public License. We use
+this license for certain libraries in order to permit linking those
+libraries into non-free programs.
+
+ When a program is linked with a library, whether statically or using
+a shared library, the combination of the two is legally speaking a
+combined work, a derivative of the original library. The ordinary
+General Public License therefore permits such linking only if the
+entire combination fits its criteria of freedom. The Lesser General
+Public License permits more lax criteria for linking other code with
+the library.
+
+ We call this license the "Lesser" General Public License because it
+does Less to protect the user's freedom than the ordinary General
+Public License. It also provides other free software developers Less
+of an advantage over competing non-free programs. These disadvantages
+are the reason we use the ordinary General Public License for many
+libraries. However, the Lesser license provides advantages in certain
+special circumstances.
+
+ For example, on rare occasions, there may be a special need to
+encourage the widest possible use of a certain library, so that it becomes
+a de-facto standard. To achieve this, non-free programs must be
+allowed to use the library. A more frequent case is that a free
+library does the same job as widely used non-free libraries. In this
+case, there is little to gain by limiting the free library to free
+software only, so we use the Lesser General Public License.
+
+ In other cases, permission to use a particular library in non-free
+programs enables a greater number of people to use a large body of
+free software. For example, permission to use the GNU C Library in
+non-free programs enables many more people to use the whole GNU
+operating system, as well as its variant, the GNU/Linux operating
+system.
+
+ Although the Lesser General Public License is Less protective of the
+users' freedom, it does ensure that the user of a program that is
+linked with the Library has the freedom and the wherewithal to run
+that program using a modified version of the Library.
+
+ The precise terms and conditions for copying, distribution and
+modification follow. Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library". The
+former contains code derived from the library, whereas the latter must
+be combined with the library in order to run.
+
+ GNU LESSER GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License Agreement applies to any software library or other
+program which contains a notice placed by the copyright holder or
+other authorized party saying it may be distributed under the terms of
+this Lesser General Public License (also called "this License").
+Each licensee is addressed as "you".
+
+ A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+ The "Library", below, refers to any such software library or work
+which has been distributed under these terms. A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language. (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+ "Source code" for a work means the preferred form of the work for
+making modifications to it. For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation
+and installation of the library.
+
+ Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it). Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+
+ 1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+ You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+
+ 2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) The modified work must itself be a software library.
+
+ b) You must cause the files modified to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ c) You must cause the whole of the work to be licensed at no
+ charge to all third parties under the terms of this License.
+
+ d) If a facility in the modified Library refers to a function or a
+ table of data to be supplied by an application program that uses
+ the facility, other than as an argument passed when the facility
+ is invoked, then you must make a good faith effort to ensure that,
+ in the event an application does not supply such function or
+ table, the facility still operates, and performs whatever part of
+ its purpose remains meaningful.
+
+ (For example, a function in a library to compute square roots has
+ a purpose that is entirely well-defined independent of the
+ application. Therefore, Subsection 2d requires that any
+ application-supplied function or table used by this function must
+ be optional: if the application does not supply it, the square
+ root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library. To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License. (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.) Do not make any other change in
+these notices.
+
+ Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+ This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+ 4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+ If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library". Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+ However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library". The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+ When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library. The
+threshold for this to be true is not precisely defined by law.
+
+ If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work. (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+ Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+
+ 6. As an exception to the Sections above, you may also combine or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+ You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License. You must supply a copy of this License. If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License. Also, you must do one
+of these things:
+
+ a) Accompany the work with the complete corresponding
+ machine-readable source code for the Library including whatever
+ changes were used in the work (which must be distributed under
+ Sections 1 and 2 above); and, if the work is an executable linked
+ with the Library, with the complete machine-readable "work that
+ uses the Library", as object code and/or source code, so that the
+ user can modify the Library and then relink to produce a modified
+ executable containing the modified Library. (It is understood
+ that the user who changes the contents of definitions files in the
+ Library will not necessarily be able to recompile the application
+ to use the modified definitions.)
+
+ b) Use a suitable shared library mechanism for linking with the
+ Library. A suitable mechanism is one that (1) uses at run time a
+ copy of the library already present on the user's computer system,
+ rather than copying library functions into the executable, and (2)
+ will operate properly with a modified version of the library, if
+ the user installs one, as long as the modified version is
+ interface-compatible with the version that the work was made with.
+
+ c) Accompany the work with a written offer, valid for at
+ least three years, to give the same user the materials
+ specified in Subsection 6a, above, for a charge no more
+ than the cost of performing this distribution.
+
+ d) If distribution of the work is made by offering access to copy
+ from a designated place, offer equivalent access to copy the above
+ specified materials from the same place.
+
+ e) Verify that the user has already received a copy of these
+ materials or that you have already sent this user a copy.
+
+ For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it. However, as a special exception,
+the materials to be distributed need not include anything that is
+normally distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+ It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system. Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+
+ 7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+ a) Accompany the combined library with a copy of the same work
+ based on the Library, uncombined with any other library
+ facilities. This must be distributed under the terms of the
+ Sections above.
+
+ b) Give prominent notice with the combined library of the fact
+ that part of it is a work based on the Library, and explaining
+ where to find the accompanying uncombined form of the same work.
+
+ 8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License. Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License. However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+ 9. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Library or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+ 10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties with
+this License.
+
+ 11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all. For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply,
+and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License may add
+an explicit geographical distribution limitation excluding those countries,
+so that distribution is permitted only in or among countries not thus
+excluded. In such case, this License incorporates the limitation as if
+written in the body of this License.
+
+ 13. The Free Software Foundation may publish revised and/or new
+versions of the Lesser General Public License from time to time.
+Such new versions will be similar in spirit to the present version,
+but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Library
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation. If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+
+ 14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission. For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this. Our
+decision will be guided by the two goals of preserving the free status
+of all derivatives of our free software and of promoting the sharing
+and reuse of software generally.
+
+ NO WARRANTY
+
+ 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+ 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ How to Apply These Terms to Your New Libraries
+
+ If you develop a new library, and you want it to be of the greatest
+possible use to the public, we recommend making it free software that
+everyone can redistribute and change. You can do so by permitting
+redistribution under these terms (or, alternatively, under the terms of the
+ordinary General Public License).
+
+ To apply these terms, attach the following notices to the library. It is
+safest to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least the
+"copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the library's name and a brief idea of what it does.>
+ Copyright (C) <year> <name of author>
+
+ This library is free software; you can redistribute it and/or
+ modify it under the terms of the GNU Lesser General Public
+ License as published by the Free Software Foundation; either
+ version 2.1 of the License, or (at your option) any later version.
+
+ This library is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ Lesser General Public License for more details.
+
+ You should have received a copy of the GNU Lesser General Public
+ License along with this library; if not, write to the Free Software
+ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
+
+Also add information on how to contact you by electronic and paper mail.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the library, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the
+ library `Frob' (a library for tweaking knobs) written by James Random Hacker.
+
+ <signature of Ty Coon>, 1 April 1990
+ Ty Coon, President of Vice
+
+That's all there is to it!
+
diff --git a/chromium/third_party/wds/src/README.md b/chromium/third_party/wds/src/README.md
new file mode 100644
index 00000000000..a0236752825
--- /dev/null
+++ b/chromium/third_party/wds/src/README.md
@@ -0,0 +1,91 @@
+## Wireless Display Software For Linux OS (WDS)
+
+WDS is a set of libraries for developers who want to build Wi-Fi Display applications on linux.
+
+WDS consists of:
+ * libwds: Main library implements a Wi-Fi Display dialect of RTSP that includes the parser, actual negotiation logic for sink and source, and the related data structures. It is not tied to any specific connection manager, media framework or main loop. This Library is also compatible with MSVC.
+ * network: Supports integration with GLib main loop and GStreamer
+ * p2p: Supports integration with Connman Wifi P2P features
+
+
+The source code includes example implementations:
+ * _sink:_ Wi-Fi Display sink that depends on Gstreamer, Connman and GLib mainloop
+ * _desktop_source:_ Wi-Fi Display source that depends on Gstreamer, Connman and GLib mainloop
+
+More information can be found on the [mailing list](https://lists.01.org/mailman/listinfo/wysiwidi-dev) and the [wiki](https://github.com/01org/wds/wiki).
+
+### Requirements:
+
+WDS test executables have runtime dependencies on just a few things (mostly GStreamer and GLib), but for successful Wi-Fi Display sessions the following are adviced:
+ * Wifi adapter from Intel 7260-family or Atheros ath9k
+ * [wpa_supplicant](http://w1.fi/wpa_supplicant/): version 2.4 or later, built with `CONFIG_P2P=y`, `CONFIG_WIFI_DISPLAY=y` and `CONFIG_CTRL_IFACE_DBUS_NEW=y`
+ * [connman](https://01.org/connman): version 1.28 (released Feb 1st 2015) or later.
+ * gstreamer: either master branch more recent than Feb 3rd 2015 (commit d0a50be2), or 1.4 branch more recent than
+Feb 3rd 2005 (commit 1ce3260a638d or release 1.4.6 or later).
+
+Test results with other Wifi adapters are very welcome but be warned that in many cases Wifi-P2P has not had the testing it needs on linux: you may run into problems in surprising places.
+
+### Building WDS from git:
+
+```
+cmake .
+make
+```
+
+### Testing WDS
+
+#### Pre-requisites
+
+Make sure wpa_supplicant & connmand are running. Running both of them uninstalled is possible (but in that case make sure the system wpa_supplicant and system connection manager are _not_ running):
+
+```
+$ sudo hostap/wpa_supplicant/wpa_supplicant -ddt -u
+
+$ sudo connman/src/connmand -n -d
+```
+
+Use connmanctl to enable Wi-Fi and Wi-Fi P2P:
+
+```
+$ connman/client/connmanctl
+connmanctl> enable wifi
+Enabled wifi
+connmanctl> enable p2p
+Enabled p2p
+```
+
+Check that Peer-to-peer functionality is working:
+
+```
+connmanctl> scan p2p
+Scan completed for p2p
+connmanctl> peers
+Nexus 5 (jku) idle peer_0c8bfd5f12fc_8ac9d0c0da67
+Push2TV 75AEB2-PTV3000 idle peer_0c8bfd5f12fc_22e52a75aeb2
+
+```
+
+Enable agent:
+
+```
+connmanctl> agent on
+Agent registered
+```
+
+#### Testing WDS sink with an Android device (e.g. Nexus 5):
+
+* start sink: `sink/sink-test`
+* Android: select the sink from the list in "Settings > Display > Cast Screen"
+* connmanctl: when agent asks, accept the connection
+
+In a few seconds, a window should open and a audio/video stream should start playing.
+
+#### Testing WDS source with another sink:
+
+* start source: `desktop_source/desktop_source`
+* Initial scan will be automatic, but `scan` command will re-scan.
+* After getting scan results, connect with `connect N` (where N is number from scan result)
+* connmanctl: when agent asks, accept the connection
+
+In a few seconds, the sink should start showing a stream mirroring your desktop.
+
diff --git a/chromium/third_party/wds/src/TODO b/chromium/third_party/wds/src/TODO
new file mode 100644
index 00000000000..6afaa9b155f
--- /dev/null
+++ b/chromium/third_party/wds/src/TODO
@@ -0,0 +1,22 @@
+GOAL: Make a release with the proper librarization by the time all dependencies are released, namely
+ a. wpa_supplicant, past 2.3 (likely 2.4)
+ b. connman, past 1.28 (likely 1.29)
+ c. gst_plugins_bad past 1.4.5+ (likely 1.4.6)
+
+
+Big tasks (see issue tracker for the rest)
+==========================================
+
+Inspect and beautify P2P API
+
+Create an installable library from the current source tree
+
+Create C/gobject interface to the library so that language bindings can be done easliy
+
+Create API for HDCP plugin implementation
+
+Implement UIBC
+
+Use accelerated encoders/decoders for demo apps
+
+
diff --git a/chromium/third_party/wds/src/data/CMakeLists.txt b/chromium/third_party/wds/src/data/CMakeLists.txt
new file mode 100644
index 00000000000..b1d96aba9ac
--- /dev/null
+++ b/chromium/third_party/wds/src/data/CMakeLists.txt
@@ -0,0 +1,3 @@
+configure_file(wds.pc.in wds.pc @ONLY)
+install(FILES ${CMAKE_CURRENT_BINARY_DIR}/wds.pc
+ DESTINATION lib/${CMAKE_LIBRARY_ARCHITECTURE}/pkgconfig)
diff --git a/chromium/third_party/wds/src/data/wds.pc.in b/chromium/third_party/wds/src/data/wds.pc.in
new file mode 100644
index 00000000000..f84e2751744
--- /dev/null
+++ b/chromium/third_party/wds/src/data/wds.pc.in
@@ -0,0 +1,10 @@
+prefix=@CMAKE_INSTALL_PREFIX@
+exec_prefix=${prefix}
+libdir=${prefix}/@CMAKE_INSTALL_LIBDIR@
+includedir=${exec_prefix}/include
+
+Name: @CMAKE_PROJECT_NAME@
+Description: Library to build WiFi Display applications
+Version: @WDS_VERSION_MAJOR@.@WDS_VERSION_MINOR@.@WDS_VERSION_PATCH@
+Libs: -L${libdir} -lwds
+Cflags: -I${includedir}/wds
diff --git a/chromium/third_party/wds/src/datadumps/gstreamer-pipelines.txt b/chromium/third_party/wds/src/datadumps/gstreamer-pipelines.txt
new file mode 100644
index 00000000000..5d4f6f8ef38
--- /dev/null
+++ b/chromium/third_party/wds/src/datadumps/gstreamer-pipelines.txt
@@ -0,0 +1,22 @@
+WFD source:
+
+ Only video:
+ gst-launch-1.0 videotestsrc ! x264enc ! mpegtsmux ! rtpmp2tpay ! udpsink host=127.0.0.1 port=5000
+
+ Only audio:
+ gst-launch-1.0 audiotestsrc ! avenc_ac3 ! mpegtsmux ! rtpmp2tpay ! udpsink host=127.0.0.1 port=5000
+
+ Both:
+ gst-launch-1.0 videotestsrc ! x264enc ! muxer. audiotestsrc ! avenc_ac3 ! muxer. mpegtsmux name=muxer ! rtpmp2tpay ! udpsink host=127.0.0.1 port=5000
+
+WFD sink:
+
+ Only audio:
+ gst-launch-1.0 udpsrc port=5000 caps="application/x-rtp" ! rtpmp2tdepay ! decodebin ! autoaudiosink
+
+ Only video:
+ gst-launch-1.0 udpsrc port=5000 caps="application/x-rtp" ! rtpmp2tdepay ! decodebin ! autovideosink
+
+ Both:
+ gst-launch-1.0 udpsrc port=5000 caps="application/x-rtp" ! rtpmp2tdepay ! decodebin name=decoder ! autoaudiosink decoder. ! autovideosink
+
diff --git a/chromium/third_party/wds/src/datadumps/information-elements.pcapng b/chromium/third_party/wds/src/datadumps/information-elements.pcapng
new file mode 100644
index 00000000000..8f37541c0c8
--- /dev/null
+++ b/chromium/third_party/wds/src/datadumps/information-elements.pcapng
Binary files differ
diff --git a/chromium/third_party/wds/src/datadumps/rtsp-capture-win8.txt b/chromium/third_party/wds/src/datadumps/rtsp-capture-win8.txt
new file mode 100644
index 00000000000..6f48149e2be
--- /dev/null
+++ b/chromium/third_party/wds/src/datadumps/rtsp-capture-win8.txt
@@ -0,0 +1,229 @@
+OPTIONS * RTSP/1.0
+CSeq: 1
+Require: org.wfa.wfd1.0
+User-Agent: WiDiApp/4.5.35.0 RDS/1.0.0
+
+RTSP/1.0 200 OK
+CSeq: 1
+Date: Thu Jan 1 00:05:42 1970
+Public: org.wfa.wfd1.0, GET_PARAMETER, SET_PARAMETER
+
+OPTIONS * RTSP/1.0
+CSeq: 1
+Require: org.wfa.wfd1.0
+User-Agent: SEC-WDH/ME29
+
+RTSP/1.0 200 OK
+CSeq: 1
+Date: Tue, Aug 05 2014 18:56:28 GMT
+Public: org.wfa.wfd1.0, GET_PARAMETER, PAUSE, PLAY, SETUP, SET_PARAMETER, TEARDOWN
+
+GET_PARAMETER rtsp://localhost/wfd1.0 RTSP/1.0
+CSeq: 2
+Content-Type: text/parameters
+Content-Length: 325
+
+wfd_client_rtp_ports
+wfd_audio_codecs
+wfd_video_formats
+wfd_3d_video_formats
+wfd_coupled_sink
+wfd_display_edid
+wfd_connector_type
+wfd_uibc_capability
+wfd_standby_resume_capability
+wfd_content_protection
+intel_sink_version
+intel_sink_information
+intel_lower_bandwidth
+intel_interactivity_mode
+intel_fast_cursor
+RTSP/1.0 200 OK
+CSeq: 2
+Content-Type: text/parameters
+Content-Length: 1187
+
+wfd_audio_codecs: LPCM 00000003 00, AAC 00000001 00
+wfd_video_formats: 40 00 02 04 0001DEFF 053C7FFF 00000FFF 00 0000 0000 11 none none, 01 04 0001DEFF 053C7FFF 00000FFF 00 0000 0000 11 none none
+wfd_3d_video_formats: 80 00 03 0F 0000000000000005 00 0001 1401 13 none none
+wfd_content_protection: HDCP2.1 port=1189
+wfd_display_edid: 0002 00ffffffffffff004c2dde07000000002f14010380834a780aee91a3544c99260f5054bdef80714f8100814081809500950fb300a940023a801871382d40582c4500a05a0000001e662150b051001b3040703600a05a0000001e000000fd00184b1a5117000a202020202020000000fc0053414d53554e470a202020202001fd02032ef14b901f0413051403122021222309070783010000e2000f72030c004000b82d20d0080140073f405090a0023a80d072382d40102c4580a05a0000001e011d00bc52d01e20b8285540a05a0000001e011d80d0721c1620102c2580a05a0000009e00000000000000000000000000000000000000000000000000000078
+wfd_coupled_sink: none
+wfd_client_rtp_ports: RTP/AVP/UDP;unicast 19000 0 mode=play
+wfd_uibc_capability: none
+wfd_connector_type: 05
+wfd_standby_resume_capability: supported
+intel_sink_version: product_ID=widicesdk hw_version=02.00.00.0000 sw_version=02.04.46.0000
+intel_lower_bandwidth: none
+intel_interactivity_mode: HIGH
+SET_PARAMETER rtsp://localhost/wfd1.0 RTSP/1.0
+CSeq: 3
+Content-Type: text/parameters
+Content-Length: 248
+
+wfd_audio_codecs: AAC 00000001 00
+wfd_video_formats: 00 00 02 04 00000020 00000000 00000000 00 0000 0000 11 none none
+wfd_presentation_URL: rtsp://192.168.173.1/wfd1.0/streamid=0 none
+wfd_client_rtp_ports: RTP/AVP/UDP;unicast 19000 0 mode=play
+RTSP/1.0 200 OK
+CSeq: 3
+
+SET_PARAMETER rtsp://localhost/wfd1.0 RTSP/1.0
+CSeq: 4
+Content-Type: text/parameters
+Content-Length: 146
+
+intel_overscan_comp: x=0, y=0
+intel_sigma_pipeline_params: PlaybackDelay=50; PositiveMaxStcPCR=25; NegativeMaxStcPCR=50;
+intel_topology: CLONE
+RTSP/1.0 200 OK
+CSeq: 4
+
+SET_PARAMETER rtsp://localhost/wfd1.0 RTSP/1.0
+CSeq: 5
+Content-Type: text/parameters
+Content-Length: 27
+
+wfd_trigger_method: SETUP
+RTSP/1.0 200 OK
+CSeq: 5
+
+SETUP rtsp://localhost/wfd1.0 RTSP/1.0
+CSeq: 2
+User-Agent: SEC-WDH/ME29
+Transport: RTP/AVP/UDP;unicast;client_port=19000
+
+RTSP/1.0 200 OK
+CSeq: 2
+Session: VaMkltjy;timeout=60
+Transport: RTP/AVP/UDP;unicast;client_port=19000;server_port=53151-53153
+
+PLAY rtsp://localhost/wfd1.0 RTSP/1.0
+CSeq: 3
+Session: VaMkltjy
+User-Agent: SEC-WDH/ME29
+
+RTSP/1.0 200 OK
+CSeq: 3
+Session: VaMkltjy
+Date: Tue, Aug 05 2014 18:56:29 GMT
+
+SET_PARAMETER rtsp://localhost/wfd1.0 RTSP/1.0
+CSeq: 6
+Content-Type: text/parameters
+Content-Length: 31
+Session: VaMkltjy
+
+intel_enable_widi_rtcp: 53153
+RTSP/1.0 200 OK
+CSeq: 6
+
+SET_PARAMETER rtsp://localhost/wfd1.0 RTSP/1.0
+CSeq: 7
+Content-Type: text/parameters
+Content-Length: 172
+Session: VaMkltjy
+
+wfd_audio_codecs: AAC 00000001 00
+wfd_video_formats: 00 00 02 04 00000000 00001000 00000000 00 0000 0000 11 none none
+wfd_av_format_change_timing: 00000bb800 000005dc00
+RTSP/1.0 200 OK
+CSeq: 7
+
+SET_PARAMETER rtsp://localhost/wfd1.0 RTSP/1.0
+CSeq: 8
+Content-Type: text/parameters
+Content-Length: 150
+Session: VaMkltjy
+
+intel_sigma_pipeline_params: PlaybackDelay=50; PositiveMaxStcPCR=25; NegativeMaxStcPCR=50;
+intel_interactivity_mode: DEFAULT
+intel_topology: LOCAL
+RTSP/1.0 200 OK
+CSeq: 8
+
+SET_PARAMETER rtsp://192.168.173.1/wfd1.0/streamid=0 RTSP/1.0
+CSeq: 4
+Session: VaMkltjy
+User-Agent: SEC-WDH/ME29
+Content-Type: text/parameters
+Content-Length: 17
+
+wfd_idr_request
+RTSP/1.0 200 OK
+CSeq: 4
+Session: VaMkltjy
+
+SET_PARAMETER rtsp://192.168.173.1/wfd1.0/streamid=0 RTSP/1.0
+CSeq: 5
+Session: VaMkltjy
+User-Agent: SEC-WDH/ME29
+Content-Type: text/parameters
+Content-Length: 17
+
+wfd_idr_request
+RTSP/1.0 200 OK
+CSeq: 5
+Session: VaMkltjy
+
+SET_PARAMETER rtsp://192.168.173.1/wfd1.0/streamid=0 RTSP/1.0
+CSeq: 6
+Session: VaMkltjy
+User-Agent: SEC-WDH/ME29
+Content-Type: text/parameters
+Content-Length: 17
+
+wfd_idr_request
+RTSP/1.0 200 OK
+CSeq: 6
+Session: VaMkltjy
+
+SET_PARAMETER rtsp://192.168.173.1/wfd1.0/streamid=0 RTSP/1.0
+CSeq: 7
+Session: VaMkltjy
+User-Agent: SEC-WDH/ME29
+Content-Type: text/parameters
+Content-Length: 17
+
+wfd_idr_request
+RTSP/1.0 200 OK
+CSeq: 7
+Session: VaMkltjy
+
+SET_PARAMETER rtsp://192.168.173.1/wfd1.0/streamid=0 RTSP/1.0
+CSeq: 8
+Session: VaMkltjy
+User-Agent: SEC-WDH/ME29
+Content-Type: text/parameters
+Content-Length: 17
+
+wfd_idr_request
+RTSP/1.0 200 OK
+CSeq: 8
+Session: VaMkltjy
+
+SET_PARAMETER rtsp://192.168.173.1/wfd1.0/streamid=0 RTSP/1.0
+CSeq: 9
+Session: VaMkltjy
+User-Agent: SEC-WDH/ME29
+Content-Type: text/parameters
+Content-Length: 17
+
+wfd_idr_request
+RTSP/1.0 200 OK
+CSeq: 9
+Session: VaMkltjy
+
+SET_PARAMETER rtsp://192.168.173.1/wfd1.0/streamid=0 RTSP/1.0
+CSeq: 10
+Session: VaMkltjy
+User-Agent: SEC-WDH/ME29
+Content-Type: text/parameters
+Content-Length: 17
+
+wfd_idr_request
+RTSP/1.0 200 OK
+CSeq: 10
+Session: VaMkltjy
+
+
diff --git a/chromium/third_party/wds/src/desktop_source/CMakeLists.txt b/chromium/third_party/wds/src/desktop_source/CMakeLists.txt
new file mode 100644
index 00000000000..bca571e001c
--- /dev/null
+++ b/chromium/third_party/wds/src/desktop_source/CMakeLists.txt
@@ -0,0 +1,23 @@
+#FIXME in the future: with cmake 2.8.12 and up it's better
+#to use target_compile_options or add_compile_options
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -pthread -std=c++11")
+
+include_directories ("${PROJECT_SOURCE_DIR}")
+include_directories ("${PROJECT_SOURCE_DIR}/libwds/public")
+include_directories ("${PROJECT_SOURCE_DIR}/libwds/parser")
+include_directories ("${PROJECT_SOURCE_DIR}/p2p")
+include_directories ("${PROJECT_SOURCE_DIR}/mirac_network")
+
+find_package(PkgConfig REQUIRED)
+
+pkg_check_modules (GLIB2 REQUIRED glib-2.0)
+include_directories(${GLIB2_INCLUDE_DIRS})
+
+pkg_check_modules (GIO REQUIRED gio-2.0)
+include_directories(${GIO_INCLUDE_DIRS})
+
+pkg_check_modules (GST REQUIRED gstreamer-1.0)
+include_directories(${GST_INCLUDE_DIRS})
+
+add_executable(desktop-source-test main.cpp source-app.cpp mirac_broker_source.cpp desktop_media_manager.cpp)
+target_link_libraries (desktop-source-test mirac wds p2p ${GIO_LIBRARIES} ${GST_LIBRARIES})
diff --git a/chromium/third_party/wds/src/desktop_source/desktop_media_manager.cpp b/chromium/third_party/wds/src/desktop_source/desktop_media_manager.cpp
new file mode 100644
index 00000000000..6cd48520881
--- /dev/null
+++ b/chromium/third_party/wds/src/desktop_source/desktop_media_manager.cpp
@@ -0,0 +1,130 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+#include "desktop_media_manager.h"
+#include "mirac-glib-logging.hpp"
+#include <cassert>
+
+DesktopMediaManager::DesktopMediaManager(const std::string& hostname)
+ : hostname_(hostname),
+ format_() {
+}
+
+void DesktopMediaManager::Play() {
+ assert(gst_pipeline_);
+ gst_pipeline_->SetState(GST_STATE_PLAYING);
+}
+
+void DesktopMediaManager::Pause() {
+ assert(gst_pipeline_);
+ gst_pipeline_->SetState(GST_STATE_PAUSED);
+}
+
+void DesktopMediaManager::Teardown() {
+ if (gst_pipeline_)
+ gst_pipeline_->SetState(GST_STATE_READY);
+}
+
+bool DesktopMediaManager::IsPaused() const {
+ return (gst_pipeline_->GetState() != GST_STATE_PLAYING);
+}
+
+std::string DesktopMediaManager::GetSessionId() const {
+ return "abcdefg123456";
+}
+
+wds::SessionType DesktopMediaManager::GetSessionType() const {
+ return wds::VideoSession;
+}
+
+void DesktopMediaManager::SetSinkRtpPorts(int port1, int port2) {
+ sink_port1_ = port1;
+ sink_port2_ = port2;
+ gst_pipeline_.reset(new MiracGstTestSource(WFD_DESKTOP, hostname_, port1));
+ gst_pipeline_->SetState(GST_STATE_READY);
+}
+
+std::pair<int, int> DesktopMediaManager::GetSinkRtpPorts() const {
+ return std::pair<int, int>(sink_port1_, sink_port2_);
+}
+
+int DesktopMediaManager::GetLocalRtpPort() const {
+ return gst_pipeline_->UdpSourcePort();
+}
+
+namespace {
+
+std::vector<wds::H264VideoCodec> GetH264VideoCodecs() {
+ static std::vector<wds::H264VideoCodec> codecs;
+ if (codecs.empty()) {
+ wds::RateAndResolutionsBitmap cea_rr;
+ wds::RateAndResolutionsBitmap vesa_rr;
+ wds::RateAndResolutionsBitmap hh_rr;
+ wds::RateAndResolution i;
+ // declare that we support all resolutions, CHP and level 4.2
+ // gstreamer should handle all of it :)
+ for (i = wds::CEA640x480p60; i <= wds::CEA1920x1080p24; ++i)
+ cea_rr.set(i);
+ for (i = wds::VESA800x600p30; i <= wds::VESA1920x1200p30; ++i)
+ vesa_rr.set(i);
+ for (i = wds::HH800x480p30; i <= wds::HH848x480p60; ++i)
+ hh_rr.set(i);
+
+ wds::H264VideoCodec codec(wds::CHP, wds::k4_2, cea_rr, vesa_rr, hh_rr);
+ codecs.push_back(codec);
+ }
+
+ return codecs;
+}
+
+}
+
+bool DesktopMediaManager::InitOptimalVideoFormat(
+ const wds::NativeVideoFormat& sink_native_format,
+ const std::vector<wds::H264VideoCodec>& sink_supported_codecs) {
+
+ format_ = wds::FindOptimalVideoFormat(sink_native_format,
+ GetH264VideoCodecs(),
+ sink_supported_codecs);
+ return true;
+}
+
+wds::H264VideoFormat DesktopMediaManager::GetOptimalVideoFormat() const {
+ return format_;
+}
+
+bool DesktopMediaManager::InitOptimalAudioFormat(const std::vector<wds::AudioCodec>& sink_codecs) {
+ for (const auto& codec : sink_codecs) {
+ if (codec.format == wds::AAC && codec.modes.test(wds::AAC_48K_16B_2CH))
+ return true;
+ }
+ return false;
+}
+
+wds::AudioCodec DesktopMediaManager::GetOptimalAudioFormat() const {
+ wds::AudioModes audio_modes;
+ audio_modes.set(wds::AAC_48K_16B_2CH);
+
+ return wds::AudioCodec(wds::AAC, audio_modes, 0);
+}
+
+void DesktopMediaManager::SendIDRPicture() {
+ WDS_WARNING("Unimplemented IDR picture request");
+}
diff --git a/chromium/third_party/wds/src/desktop_source/desktop_media_manager.h b/chromium/third_party/wds/src/desktop_source/desktop_media_manager.h
new file mode 100644
index 00000000000..78fc70db786
--- /dev/null
+++ b/chromium/third_party/wds/src/desktop_source/desktop_media_manager.h
@@ -0,0 +1,57 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+#ifndef DESKTOP_MEDIA_MANAGER_H_
+#define DESKTOP_MEDIA_MANAGER_H_
+
+#include <memory>
+
+#include "libwds/public/media_manager.h"
+#include "mirac-gst-test-source.hpp"
+
+class DesktopMediaManager : public wds::SourceMediaManager {
+ public:
+ explicit DesktopMediaManager(const std::string& hostname);
+ void Play() override;
+ void Pause() override;
+ void Teardown() override;
+ bool IsPaused() const override;
+ std::string GetSessionId() const override;
+ void SetSinkRtpPorts(int port1, int port2) override;
+ std::pair<int,int> GetSinkRtpPorts() const override;
+ int GetLocalRtpPort() const override;
+ wds::SessionType GetSessionType() const override;
+
+ bool InitOptimalVideoFormat(const wds::NativeVideoFormat& sink_native_format,
+ const std::vector<wds::H264VideoCodec>& sink_supported_codecs) override;
+ wds::H264VideoFormat GetOptimalVideoFormat() const override;
+ bool InitOptimalAudioFormat(const std::vector<wds::AudioCodec>& sink_supported_codecs) override;
+ wds::AudioCodec GetOptimalAudioFormat() const override;
+ void SendIDRPicture() override;
+
+ private:
+ std::string hostname_;
+ std::unique_ptr<MiracGstTestSource> gst_pipeline_;
+ int sink_port1_;
+ int sink_port2_;
+ wds::H264VideoFormat format_;
+};
+
+#endif // DESKTOP_MEDIA_MANAGER_H_
diff --git a/chromium/third_party/wds/src/desktop_source/main.cpp b/chromium/third_party/wds/src/desktop_source/main.cpp
new file mode 100644
index 00000000000..ac36e17cf1d
--- /dev/null
+++ b/chromium/third_party/wds/src/desktop_source/main.cpp
@@ -0,0 +1,132 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+#include <glib.h>
+#include <glib-unix.h>
+#include <gst/gst.h>
+#include <iostream>
+
+#include "source-app.h"
+#include "mirac_broker_source.h"
+#include "mirac-glib-logging.hpp"
+
+#include "libwds/public/source.h"
+
+static gboolean _sig_handler (gpointer data_ptr)
+{
+ GMainLoop *main_loop = (GMainLoop *) data_ptr;
+
+ g_main_loop_quit(main_loop);
+
+ return G_SOURCE_CONTINUE;
+}
+
+static void parse_input_and_call_source(
+ const std::string& command, SourceApp *app) {
+
+ auto source = app->source()->wfd_source();
+ bool status = true;
+
+ if (command == "scan\n") {
+ app->scan();
+ } else if (command.find("connect ") == 0) {
+ app->connect(std::stoi(command.substr(8)));
+ } else if (command == "teardown\n") {
+ status = source && source->Teardown();
+ } else if (command == "pause\n") {
+ status = source && source->Pause();
+ } else if (command == "play\n") {
+ status = source && source->Play();
+ } else {
+ std::cout << "Received unknown command: " << command << std::endl;
+ }
+
+ if (!status)
+ std::cout << "This command cannot be executed now." << std::endl;
+}
+
+static gboolean _user_input_handler (
+ GIOChannel* channel, GIOCondition /*condition*/, gpointer data_ptr)
+{
+ GError* error = NULL;
+ char* str = NULL;
+ size_t len;
+ SourceApp* app = static_cast<SourceApp*>(data_ptr);
+
+ switch (g_io_channel_read_line(channel, &str, &len, NULL, &error)) {
+ case G_IO_STATUS_NORMAL:
+ parse_input_and_call_source(str, app);
+ g_free(str);
+ return true;
+ case G_IO_STATUS_ERROR:
+ std::cout << "User input error: " << error->message << std::endl;
+ g_error_free(error);
+ return false;
+ case G_IO_STATUS_EOF:
+ case G_IO_STATUS_AGAIN:
+ return true;
+ default:
+ return false;
+ }
+ return false;
+}
+
+int main (int argc, char *argv[])
+{
+ InitGlibLogging();
+ int port = 7236;
+
+ GOptionEntry main_entries[] =
+ {
+ { "rtsp_port", 0, 0, G_OPTION_ARG_INT, &(port), "Specify optional RTSP port number, 7236 by default", "rtsp_port"},
+ { NULL }
+ };
+
+ GOptionContext* context = g_option_context_new ("- WFD desktop source demo application\n");
+ g_option_context_add_main_entries (context, main_entries, NULL);
+ g_option_context_add_group (context, gst_init_get_option_group ());
+
+ GError* error = NULL;
+ if (!g_option_context_parse (context, &argc, &argv, &error)) {
+ WDS_ERROR ("option parsing failed: %s", error->message);
+ g_option_context_free(context);
+ exit (1);
+ }
+ g_option_context_free(context);
+
+ SourceApp app(port);
+
+ GMainLoop *main_loop = g_main_loop_new(NULL, TRUE);
+ g_unix_signal_add(SIGINT, _sig_handler, main_loop);
+ g_unix_signal_add(SIGTERM, _sig_handler, main_loop);
+
+ GIOChannel* io_channel = g_io_channel_unix_new (STDIN_FILENO);
+ g_io_add_watch(io_channel, G_IO_IN, _user_input_handler, &app);
+ g_io_channel_unref(io_channel);
+
+
+ g_main_loop_run (main_loop);
+
+ g_main_loop_unref (main_loop);
+
+ return 0;
+}
+
diff --git a/chromium/third_party/wds/src/desktop_source/mirac_broker_source.cpp b/chromium/third_party/wds/src/desktop_source/mirac_broker_source.cpp
new file mode 100644
index 00000000000..24adc7acb93
--- /dev/null
+++ b/chromium/third_party/wds/src/desktop_source/mirac_broker_source.cpp
@@ -0,0 +1,56 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+#include <iostream>
+
+#include "desktop_media_manager.h"
+#include "mirac_broker_source.h"
+
+#include "libwds/public/source.h"
+
+MiracBrokerSource::MiracBrokerSource(int rtsp_port)
+ : MiracBroker(std::to_string(rtsp_port)) {
+}
+
+MiracBrokerSource::~MiracBrokerSource() {}
+
+void MiracBrokerSource::got_message(const std::string& message) {
+ wfd_source_->RTSPDataReceived(message);
+}
+
+void MiracBrokerSource::on_connected() {
+ media_manager_.reset(new DesktopMediaManager(get_peer_address()));
+ wfd_source_.reset(wds::Source::Create(this, media_manager_.get()));
+ wfd_source_->Start();
+}
+
+void MiracBrokerSource::on_connection_failure(ConnectionFailure failure) {
+ switch (failure) {
+ case CONNECTION_LOST:
+ std::cout << "* RTSP connection lost" << std::endl;
+ case CONNECTION_TIMEOUT:
+ std::cout << "* RTSP connection failed: timeout" << std::endl;
+ }
+}
+
+wds::Peer* MiracBrokerSource::Peer() const {
+ return wfd_source_.get();
+}
diff --git a/chromium/third_party/wds/src/desktop_source/mirac_broker_source.h b/chromium/third_party/wds/src/desktop_source/mirac_broker_source.h
new file mode 100644
index 00000000000..06c4e7ea0b4
--- /dev/null
+++ b/chromium/third_party/wds/src/desktop_source/mirac_broker_source.h
@@ -0,0 +1,51 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+#ifndef MIRAC_BROKER_SOURCE_H_
+#define MIRAC_BROKER_SOURCE_H_
+
+#include <memory>
+
+#include "mirac-broker.hpp"
+
+namespace wds {
+class SourceMediaManager;
+class Source;
+}
+
+class MiracBrokerSource : public MiracBroker {
+ public:
+ explicit MiracBrokerSource(int rtsp_port);
+ ~MiracBrokerSource();
+
+ wds::Source* wfd_source() { return wfd_source_.get(); }
+
+ private:
+ virtual void got_message(const std::string& message) override;
+ virtual void on_connected() override;
+ void on_connection_failure(ConnectionFailure failure) override;
+ virtual wds::Peer* Peer() const override;
+
+ std::unique_ptr<wds::SourceMediaManager> media_manager_;
+ std::unique_ptr<wds::Source> wfd_source_;
+};
+
+#endif // MIRAC_BROKER_SOURCE_H_
diff --git a/chromium/third_party/wds/src/desktop_source/source-app.cpp b/chromium/third_party/wds/src/desktop_source/source-app.cpp
new file mode 100644
index 00000000000..95349c7e972
--- /dev/null
+++ b/chromium/third_party/wds/src/desktop_source/source-app.cpp
@@ -0,0 +1,111 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+#include <iostream>
+#include <netinet/in.h> // htons()
+
+#include "source-app.h"
+
+void SourceApp::on_availability_changed(P2P::Client *client)
+{
+ if (client->is_available())
+ scan();
+}
+
+void SourceApp::on_peer_added(P2P::Client *client, std::shared_ptr<P2P::Peer> peer)
+{
+ if (peer->device_type() == P2P::PRIMARY_SINK) {
+ peer->set_observer(this);
+ }
+}
+
+void SourceApp::on_peer_removed(P2P::Client *client, std::shared_ptr<P2P::Peer> peer)
+{
+ for (auto it = peers_.begin(); it != peers_.end();) {
+ if (it->second == peer.get()) {
+ peers_.erase (it++);
+ return;
+ } else {
+ ++it;
+ }
+ }
+}
+
+void SourceApp::on_initialized(P2P::Peer *peer)
+{
+ peers_[peer_index_] = peer;
+ std::cout << " "<< peer_index_ << " : " << peer->name() << std::endl;
+ peer_index_++;
+}
+
+void SourceApp::scan()
+{
+ std::cout << "* Now scanning for peers..." << std::endl;
+ p2p_client_->scan();
+}
+
+bool SourceApp::connect(uint peer_index)
+{
+ auto it = peers_.find (peer_index);
+ if (it == peers_.end()) {
+ std::cout << "No such peer" << std::endl;
+ return false;
+ }
+
+ it->second->connect ();
+ return true;
+}
+
+void SourceApp::on_availability_changed(P2P::Peer *peer)
+{
+ if (!peer->is_available())
+ return;
+
+ std::cout << "* Connected to " << peer->remote_host() << std::endl;
+}
+
+SourceApp::SourceApp(int port) :
+ peer_index_(0)
+{
+ // Create a information element for a simple WFD Source
+ P2P::InformationElement ie;
+ auto sub_element = P2P::new_subelement(P2P::DEVICE_INFORMATION);
+ auto dev_info = (P2P::DeviceInformationSubelement*)sub_element;
+
+ // TODO InformationElement could have constructors for this stuff...
+ dev_info->session_management_control_port = htons(port);
+ dev_info->maximum_throughput = htons(50);
+ dev_info->field1.device_type = P2P::SOURCE;
+ dev_info->field1.session_availability = true;
+ ie.add_subelement(sub_element);
+
+ std::cout << "* Registering Wi-Fi Display Source with IE " << ie.to_string() << std::endl;
+
+ // register the P2P service with connman
+ auto array = ie.serialize ();
+ p2p_client_.reset(new P2P::Client(array, this));
+
+ source_.reset(new MiracBrokerSource(port));
+}
+
+SourceApp::~SourceApp()
+{
+}
diff --git a/chromium/third_party/wds/src/desktop_source/source-app.h b/chromium/third_party/wds/src/desktop_source/source-app.h
new file mode 100644
index 00000000000..afc92d14c15
--- /dev/null
+++ b/chromium/third_party/wds/src/desktop_source/source-app.h
@@ -0,0 +1,55 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+#ifndef SOURCE_APP_H
+#define SOURCE_APP_H
+
+#include <memory>
+
+#include "source.h"
+#include "connman-client.h"
+#include "mirac_broker_source.h"
+
+class SourceApp: public P2P::Client::Observer, public P2P::Peer::Observer {
+ public:
+ SourceApp(int port);
+ ~SourceApp();
+
+ MiracBrokerSource* source() { return source_.get(); }
+
+ void on_peer_added(P2P::Client *client, std::shared_ptr<P2P::Peer> peer) override;
+ void on_peer_removed(P2P::Client *client, std::shared_ptr<P2P::Peer> peer) override;
+ void on_availability_changed(P2P::Client *client) override;
+
+ void on_availability_changed(P2P::Peer *peer) override;
+ void on_initialized(P2P::Peer *peer) override;
+
+ void scan();
+ bool connect(uint peer_index);
+
+ private:
+ std::unique_ptr<P2P::Client> p2p_client_;
+ std::unique_ptr<MiracBrokerSource> source_;
+ std::map<uint, P2P::Peer*>peers_;
+ uint peer_index_;
+};
+
+#endif // SOURCE_APP_H
diff --git a/chromium/third_party/wds/src/libwds/CMakeLists.txt b/chromium/third_party/wds/src/libwds/CMakeLists.txt
new file mode 100644
index 00000000000..2fdeb82ea7a
--- /dev/null
+++ b/chromium/third_party/wds/src/libwds/CMakeLists.txt
@@ -0,0 +1,27 @@
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -fvisibility=hidden")
+set(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} -std=c99 -Wall")
+
+
+add_library(wds
+ SHARED $<TARGET_OBJECTS:wdsrtsp>
+ $<TARGET_OBJECTS:wdscommon>
+ $<TARGET_OBJECTS:wdssink>
+ $<TARGET_OBJECTS:wdssource>)
+set_target_properties(wds PROPERTIES
+ VERSION ${WDS_VERSION_MAJOR}.${WDS_VERSION_MINOR}.${WDS_VERSION_PATCH}
+ SOVERSION ${WDS_VERSION_MAJOR})
+
+install(TARGETS wds LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR})
+
+set(PUBLIC_HEADERS
+ public/connector_type.h
+ public/peer.h
+ public/video_format.h
+ public/sink.h
+ public/wds_export.h
+ public/audio_codec.h
+ public/media_manager.h
+ public/source.h
+ public/logging.h)
+
+install(FILES ${PUBLIC_HEADERS} DESTINATION ${CMAKE_INSTALL_FULL_INCLUDEDIR}/wds)
diff --git a/chromium/third_party/wds/src/libwds/common/CMakeLists.txt b/chromium/third_party/wds/src/libwds/common/CMakeLists.txt
new file mode 100644
index 00000000000..c10b073c3cd
--- /dev/null
+++ b/chromium/third_party/wds/src/libwds/common/CMakeLists.txt
@@ -0,0 +1,8 @@
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -fvisibility=hidden -fPIC")
+set(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} -std=c99 -Wall")
+
+include_directories ("${PROJECT_SOURCE_DIR}" "${PROJECT_SOURCE_DIR}/libwds/rtsp/gen")
+
+add_library(wdscommon OBJECT
+ logging.cpp message_handler.cpp rtsp_input_handler.cpp video_format.cpp)
+add_dependencies(wdscommon wdsrtsp)
diff --git a/chromium/third_party/wds/src/libwds/common/logging.cpp b/chromium/third_party/wds/src/libwds/common/logging.cpp
new file mode 100644
index 00000000000..49eee4c1ce8
--- /dev/null
+++ b/chromium/third_party/wds/src/libwds/common/logging.cpp
@@ -0,0 +1,64 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2016 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+#include "libwds/public/logging.h"
+
+namespace wds {
+
+static void Dummy(const char*, ...) {}
+LogSystem::LogFunction LogSystem::log_func_ = &Dummy;
+LogSystem::LogFunction LogSystem::vlog_func_ = &Dummy;
+LogSystem::LogFunction LogSystem::warning_func_ = &Dummy;
+LogSystem::LogFunction LogSystem::error_func_ = &Dummy;
+
+void LogSystem::set_log_func(LogFunction func) {
+ log_func_ = func;
+}
+
+LogSystem::LogFunction LogSystem::log_func() {
+ return log_func_;
+}
+
+void LogSystem::set_vlog_func(LogFunction func) {
+ vlog_func_ = func;
+}
+
+LogSystem::LogFunction LogSystem::vlog_func() {
+ return vlog_func_;
+}
+
+void LogSystem::set_warning_func(LogFunction func) {
+ warning_func_ = func;
+}
+
+LogSystem::LogFunction LogSystem::warning_func() {
+ return warning_func_;
+}
+
+void LogSystem::set_error_func(LogFunction func) {
+ error_func_ = func;
+}
+
+LogSystem::LogFunction LogSystem::error_func() {
+ return error_func_;
+}
+
+} // namespace wds
diff --git a/chromium/third_party/wds/src/libwds/common/message_handler.cpp b/chromium/third_party/wds/src/libwds/common/message_handler.cpp
new file mode 100644
index 00000000000..4cffeb804e8
--- /dev/null
+++ b/chromium/third_party/wds/src/libwds/common/message_handler.cpp
@@ -0,0 +1,340 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+#include <algorithm>
+
+#include "libwds/common/message_handler.h"
+#include "libwds/public/media_manager.h"
+
+namespace wds {
+
+using rtsp::Message;
+using rtsp::Request;
+using rtsp::Reply;
+
+bool MessageHandler::HandleTimeoutEvent(unsigned timer_id) const {
+ return false;
+}
+
+MessageHandler::~MessageHandler() {}
+
+MessageSequenceHandler::MessageSequenceHandler(const InitParams& init_params)
+ : MessageHandler(init_params),
+ current_handler_(nullptr) {
+}
+
+MessageSequenceHandler::~MessageSequenceHandler() {
+}
+
+void MessageSequenceHandler::Start() {
+ if (current_handler_) {
+ return;
+ }
+ current_handler_ = handlers_.front();
+ current_handler_->Start();
+}
+
+void MessageSequenceHandler::Reset() {
+ if (current_handler_) {
+ current_handler_->Reset();
+ current_handler_ = nullptr;
+ }
+}
+
+bool MessageSequenceHandler::CanSend(Message* message) const {
+ return current_handler_ && current_handler_->CanSend(message);
+}
+
+void MessageSequenceHandler::Send(std::unique_ptr<Message> message) {
+ assert(current_handler_);
+ current_handler_->Send(std::move(message));
+}
+
+bool MessageSequenceHandler::CanHandle(Message* message) const {
+ return current_handler_ && current_handler_->CanHandle(message);
+}
+
+void MessageSequenceHandler::Handle(std::unique_ptr<Message> message) {
+ assert(current_handler_);
+ current_handler_->Handle(std::move(message));
+}
+
+void MessageSequenceHandler::AddSequencedHandler(MessageHandlerPtr handler) {
+ assert(!current_handler_); // We are not started
+ assert(handler);
+ assert(handlers_.end() == std::find(
+ handlers_.begin(), handlers_.end(), handler));
+ handlers_.push_back(handler);
+ handler->set_observer(this);
+}
+
+void MessageSequenceHandler::OnCompleted(MessageHandlerPtr handler) {
+ assert(handler == current_handler_);
+ current_handler_->Reset();
+
+ auto it = std::find(handlers_.begin(), handlers_.end(), handler);
+ assert(handlers_.end() != it);
+ if (++it == handlers_.end()) {
+ observer_->OnCompleted(shared_from_this());
+ return;
+ }
+
+ current_handler_ = *it;
+ current_handler_->Start();
+}
+
+void MessageSequenceHandler::OnError(MessageHandlerPtr handler) {
+ assert(handler == current_handler_);
+ handler->Reset();
+ observer_->OnError(shared_from_this());
+}
+
+bool MessageSequenceHandler::HandleTimeoutEvent(unsigned timer_id) const {
+ return current_handler_->HandleTimeoutEvent(timer_id);
+}
+
+MessageSequenceWithOptionalSetHandler::MessageSequenceWithOptionalSetHandler(
+ const InitParams& init_params)
+ : MessageSequenceHandler(init_params) {
+}
+
+MessageSequenceWithOptionalSetHandler::~MessageSequenceWithOptionalSetHandler() {
+}
+
+void MessageSequenceWithOptionalSetHandler::Start() {
+ MessageSequenceHandler::Start();
+ for (MessageHandlerPtr handler : optional_handlers_)
+ handler->Start();
+}
+
+void MessageSequenceWithOptionalSetHandler::Reset() {
+ MessageSequenceHandler::Reset();
+ for (MessageHandlerPtr handler : optional_handlers_)
+ handler->Reset();
+}
+
+bool MessageSequenceWithOptionalSetHandler::CanSend(Message* message) const {
+ for (MessageHandlerPtr handler : optional_handlers_)
+ if (handler->CanSend(message))
+ return true;
+
+ if (MessageSequenceHandler::CanSend(message))
+ return true;
+
+ return false;
+}
+
+void MessageSequenceWithOptionalSetHandler::Send(std::unique_ptr<Message> message) {
+ for (MessageHandlerPtr handler : optional_handlers_) {
+ if (handler->CanSend(message.get())) {
+ handler->Send(std::move(message));
+ return;
+ }
+ }
+
+ if (MessageSequenceHandler::CanSend(message.get())) {
+ MessageSequenceHandler::Send(std::move(message));
+ return;
+ }
+
+ observer_->OnError(shared_from_this());
+}
+
+bool MessageSequenceWithOptionalSetHandler::CanHandle(Message* message) const {
+ if (MessageSequenceHandler::CanHandle(message))
+ return true;
+
+ for (MessageHandlerPtr handler : optional_handlers_)
+ if (handler->CanHandle(message))
+ return true;
+
+ return false;
+}
+
+void MessageSequenceWithOptionalSetHandler::Handle(std::unique_ptr<Message> message) {
+ if (MessageSequenceHandler::CanHandle(message.get())) {
+ MessageSequenceHandler::Handle(std::move(message));
+ return;
+ }
+
+ for (MessageHandlerPtr handler : optional_handlers_) {
+ if (handler->CanHandle(message.get())) {
+ handler->Handle(std::move(message));
+ return;
+ }
+ }
+
+ observer_->OnError(shared_from_this());
+}
+
+void MessageSequenceWithOptionalSetHandler::AddOptionalHandler(
+ MessageHandlerPtr handler) {
+ assert(handler);
+ assert(optional_handlers_.end() == std::find(
+ optional_handlers_.begin(), optional_handlers_.end(), handler));
+ optional_handlers_.push_back(handler);
+ handler->set_observer(this);
+}
+
+void MessageSequenceWithOptionalSetHandler::OnCompleted(MessageHandlerPtr handler) {
+ auto it = std::find(
+ optional_handlers_.begin(), optional_handlers_.end(), handler);
+ if (it != optional_handlers_.end()) {
+ handler->Reset();
+ handler->Start();
+ return;
+ }
+ MessageSequenceHandler::OnCompleted(handler);
+}
+
+void MessageSequenceWithOptionalSetHandler::OnError(MessageHandlerPtr handler) {
+ handler->Reset();
+ observer_->OnError(shared_from_this());
+}
+
+bool MessageSequenceWithOptionalSetHandler::HandleTimeoutEvent(unsigned timer_id) const {
+ for (MessageHandlerPtr handler : optional_handlers_)
+ if (handler->HandleTimeoutEvent(timer_id))
+ return true;
+ return MessageSequenceHandler::HandleTimeoutEvent(timer_id);
+}
+
+// MessageReceiverBase
+MessageReceiverBase::MessageReceiverBase(const InitParams& init_params)
+ : MessageHandler(init_params),
+ wait_for_message_(false) {}
+
+MessageReceiverBase::~MessageReceiverBase() {}
+
+bool MessageReceiverBase::CanHandle(Message* message) const {
+ assert(message);
+ return wait_for_message_;
+}
+
+void MessageReceiverBase::Start() { wait_for_message_ = true; }
+void MessageReceiverBase::Reset() { wait_for_message_ = false; }
+bool MessageReceiverBase::CanSend(Message* message) const { return false; }
+void MessageReceiverBase::Send(std::unique_ptr<Message> message) {}
+void MessageReceiverBase::Handle(std::unique_ptr<Message> message) {
+ assert(message);
+ if (!CanHandle(message.get())) {
+ observer_->OnError(shared_from_this());
+ return;
+ }
+ wait_for_message_ = false;
+ std::unique_ptr<Reply> reply = HandleMessage(message.get());
+ if (!reply) {
+ observer_->OnError(shared_from_this());
+ return;
+ }
+ reply->header().set_cseq(message->cseq());
+ sender_->SendRTSPData(reply->ToString());
+ observer_->OnCompleted(shared_from_this());
+}
+
+MessageSenderBase::MessageSenderBase(const InitParams& init_params)
+ : MessageHandler(init_params) {
+}
+
+MessageSenderBase::~MessageSenderBase() {
+ for (const ParcelData& data : parcel_queue_)
+ sender_->ReleaseTimer(data.timer_id);
+}
+
+void MessageSenderBase::Reset() {
+ while (!parcel_queue_.empty()) {
+ sender_->ReleaseTimer(parcel_queue_.front().timer_id);
+ parcel_queue_.pop_front();
+ }
+}
+
+void MessageSenderBase::Send(std::unique_ptr<Message> message) {
+ assert(message);
+ if (!CanSend(message.get())) {
+ observer_->OnError(shared_from_this());
+ return;
+ }
+ parcel_queue_.push_back(
+ {message->cseq(), sender_->CreateTimer(GetResponseTimeout())});
+ sender_->SendRTSPData(message->ToString());
+}
+
+bool MessageSenderBase::CanHandle(Message* message) const {
+ assert(message);
+ return message->is_reply() && !parcel_queue_.empty() &&
+ (message->cseq() == parcel_queue_.front().cseq);
+}
+
+void MessageSenderBase::Handle(std::unique_ptr<Message> message) {
+ assert(message);
+ if (!CanHandle(message.get())) {
+ observer_->OnError(shared_from_this());
+ return;
+ }
+ sender_->ReleaseTimer(parcel_queue_.front().timer_id);
+ parcel_queue_.pop_front();
+
+ if (!HandleReply(static_cast<Reply*>(message.get()))) {
+ observer_->OnError(shared_from_this());
+ return;
+ }
+
+ if (parcel_queue_.empty()) {
+ observer_->OnCompleted(shared_from_this());
+ }
+}
+
+bool MessageSenderBase::HandleTimeoutEvent(unsigned timer_id) const {
+ for (const ParcelData& data : parcel_queue_)
+ if (data.timer_id == timer_id)
+ return true;
+
+ return false;
+}
+
+int MessageSenderBase::GetResponseTimeout() const {
+ return kDefaultTimeoutValue;
+}
+
+SequencedMessageSender::SequencedMessageSender(const InitParams& init_params)
+ : MessageSenderBase(init_params),
+ to_be_send_(nullptr) {
+}
+
+SequencedMessageSender::~SequencedMessageSender() {
+}
+
+void SequencedMessageSender::Start() {
+ auto message = CreateMessage();
+ to_be_send_ = message.get();
+ Send(std::move(message));
+}
+
+void SequencedMessageSender::Reset() {
+ to_be_send_ = nullptr;
+ MessageSenderBase::Reset();
+}
+
+bool SequencedMessageSender::CanSend(Message* message) const {
+ return message && (message == to_be_send_);
+}
+
+}
diff --git a/chromium/third_party/wds/src/libwds/common/message_handler.h b/chromium/third_party/wds/src/libwds/common/message_handler.h
new file mode 100644
index 00000000000..8ddcaf055ed
--- /dev/null
+++ b/chromium/third_party/wds/src/libwds/common/message_handler.h
@@ -0,0 +1,249 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+#ifndef LIBWDS_COMMON_MESSAGE_HANDLER_H_
+#define LIBWDS_COMMON_MESSAGE_HANDLER_H_
+
+#include <cassert>
+#include <list>
+#include <vector>
+#include <memory>
+#include <utility>
+
+#include "libwds/rtsp/message.h"
+#include "libwds/rtsp/reply.h"
+#include "libwds/public/logging.h"
+#include "libwds/public/peer.h"
+
+namespace wds {
+
+// Default keep-alive timer is 60 seconds
+const int kDefaultKeepAliveTimeout = 60;
+// Default timeout for RTSP message exchange
+const int kDefaultTimeoutValue = 5;
+
+class MediaManager;
+
+class MessageHandler;
+using MessageHandlerPtr = std::shared_ptr<MessageHandler>;
+
+inline MessageHandlerPtr make_ptr(MessageHandler* handler) {
+ return MessageHandlerPtr(handler);
+}
+
+class MessageHandler : public std::enable_shared_from_this<MessageHandler> {
+ public:
+ class Observer {
+ public:
+ virtual void OnCompleted(MessageHandlerPtr handler) {}
+ virtual void OnError(MessageHandlerPtr handler) {}
+
+ protected:
+ virtual ~Observer() {}
+ };
+
+ struct InitParams {
+ Peer::Delegate* sender;
+ MediaManager* manager;
+ Observer* observer;
+ };
+
+ virtual ~MessageHandler();
+
+ virtual void Start() = 0;
+ virtual void Reset() = 0;
+
+ virtual bool CanSend(rtsp::Message* message) const = 0;
+ virtual void Send(std::unique_ptr<rtsp::Message> message) = 0;
+
+ virtual bool CanHandle(rtsp::Message* message) const = 0;
+ virtual void Handle(std::unique_ptr<rtsp::Message> message) = 0;
+
+ // For handlers that require timeout
+ virtual bool HandleTimeoutEvent(unsigned timer_id) const;
+
+ void set_observer(Observer* observer) {
+ assert(observer);
+ observer_ = observer;
+ }
+
+protected:
+ explicit MessageHandler(const InitParams& init_params)
+ : sender_(init_params.sender),
+ manager_(init_params.manager),
+ observer_(init_params.observer) {
+ assert(sender_);
+ assert(manager_);
+ assert(observer_);
+ }
+
+ Peer::Delegate* sender_;
+ MediaManager* manager_;
+ Observer* observer_;
+};
+
+class MessageSequenceHandler : public MessageHandler,
+ public MessageHandler::Observer {
+ public:
+ explicit MessageSequenceHandler(const InitParams& init_params);
+ ~MessageSequenceHandler() override;
+ void Start() override;
+ void Reset() override;
+
+ bool CanSend(rtsp::Message* message) const override;
+ void Send(std::unique_ptr<rtsp::Message> message) override;
+
+ bool CanHandle(rtsp::Message* message) const override;
+ void Handle(std::unique_ptr<rtsp::Message> message) override;
+
+ bool HandleTimeoutEvent(unsigned timer_id) const override;
+
+ protected:
+ void AddSequencedHandler(MessageHandlerPtr handler);
+ // MessageHandler::Observer implementation.
+ void OnCompleted(MessageHandlerPtr handler) override;
+ void OnError(MessageHandlerPtr handler) override;
+
+ std::vector<MessageHandlerPtr> handlers_;
+ MessageHandlerPtr current_handler_;
+};
+
+class MessageSequenceWithOptionalSetHandler : public MessageSequenceHandler {
+ public:
+ explicit MessageSequenceWithOptionalSetHandler(const InitParams& init_params);
+ ~MessageSequenceWithOptionalSetHandler() override;
+ void Start() override;
+ void Reset() override;
+ bool CanSend(rtsp::Message* message) const override;
+ void Send(std::unique_ptr<rtsp::Message> message) override;
+ bool CanHandle(rtsp::Message* message) const override;
+ void Handle(std::unique_ptr<rtsp::Message> message) override;
+
+ bool HandleTimeoutEvent(unsigned timer_id) const override;
+
+ protected:
+ void AddOptionalHandler(MessageHandlerPtr handler);
+ // MessageHandler::Observer implementation.
+ void OnCompleted(MessageHandlerPtr handler) override;
+ void OnError(MessageHandlerPtr handler) override;
+
+ std::vector<MessageHandlerPtr> optional_handlers_;
+};
+
+// This is aux classes to handle single message.
+// There are two common scenarious:
+// 1. We send a message and wait for reply
+// class Handler : public MessageSender
+//
+// 2. We wait for the message and reply ourselves.
+// class Handler : public MessageReceiver<type of the message
+// we're waiting for>
+class MessageReceiverBase : public MessageHandler {
+ public:
+ explicit MessageReceiverBase(const InitParams& init_params);
+ ~MessageReceiverBase() override;
+
+ protected:
+ virtual std::unique_ptr<wds::rtsp::Reply> HandleMessage(rtsp::Message* message) = 0;
+ bool CanHandle(rtsp::Message* message) const override;
+ void Handle(std::unique_ptr<rtsp::Message> message) override;
+
+ private:
+ void Start() override;
+ void Reset() override;
+ bool CanSend(rtsp::Message* message) const override;
+ void Send(std::unique_ptr<rtsp::Message> message) override;
+
+ bool wait_for_message_;
+};
+
+template <rtsp::Request::ID id>
+class MessageReceiver : public MessageReceiverBase {
+ public:
+ using MessageReceiverBase::MessageReceiverBase;
+
+ protected:
+ bool CanHandle(rtsp::Message* message) const override {
+ return MessageReceiverBase::CanHandle(message) && message->is_request() &&
+ id == ToRequest(message)->id();
+ }
+};
+
+class MessageSenderBase : public MessageHandler {
+ public:
+ explicit MessageSenderBase(const InitParams& init_params);
+ ~MessageSenderBase() override;
+
+ protected:
+ virtual bool HandleReply(rtsp::Reply* reply) = 0;
+ void Send(std::unique_ptr<rtsp::Message> message) override;
+ void Reset() override;
+ bool HandleTimeoutEvent(unsigned timer_id) const override;
+
+
+ private:
+ bool CanHandle(rtsp::Message* message) const override;
+ void Handle(std::unique_ptr<rtsp::Message> message) override;
+
+ virtual int GetResponseTimeout() const;
+
+ struct ParcelData {
+ int cseq;
+ unsigned timer_id;
+ };
+ std::list<ParcelData> parcel_queue_;
+};
+
+// To be used for optional senders.
+template <rtsp::Request::ID id>
+class OptionalMessageSender : public MessageSenderBase {
+ public:
+ using MessageSenderBase::MessageSenderBase;
+
+ protected:
+ bool CanSend(rtsp::Message* message) const override {
+ assert(message);
+ return message->is_request() && ToRequest(message)->id() == id;
+ }
+
+ private:
+ void Start() override {}
+};
+
+// To be used for sequensed senders.
+class SequencedMessageSender : public MessageSenderBase {
+ public:
+ explicit SequencedMessageSender(const InitParams& init_params);
+ ~SequencedMessageSender() override;
+
+ protected:
+ virtual std::unique_ptr<rtsp::Message> CreateMessage() = 0;
+
+ private:
+ void Start() override;
+ void Reset() override;
+ bool CanSend(rtsp::Message* message) const override;
+
+ rtsp::Message* to_be_send_;
+};
+
+} // namespace wds
+#endif // LIBWDS_COMMON_MESSAGE_HANDLER_H_
diff --git a/chromium/third_party/wds/src/libwds/common/rtsp_input_handler.cpp b/chromium/third_party/wds/src/libwds/common/rtsp_input_handler.cpp
new file mode 100644
index 00000000000..489af800ab4
--- /dev/null
+++ b/chromium/third_party/wds/src/libwds/common/rtsp_input_handler.cpp
@@ -0,0 +1,89 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+#include "rtsp_input_handler.h"
+
+#include "libwds/rtsp/driver.h"
+#include "libwds/rtsp/message.h"
+
+#include <cassert>
+
+namespace wds {
+
+using rtsp::Message;
+using rtsp::Driver;
+
+RTSPInputHandler::~RTSPInputHandler() {
+}
+
+void RTSPInputHandler::AddInput(const std::string& input) {
+ rtsp_input_buffer_ += input;
+
+ // First trying to get payload for the message obtained
+ // from the previous input.
+ if (message_ && !ParsePayload())
+ return;
+
+ while (ParseHeader()) {
+ if (!ParsePayload())
+ break;
+ }
+}
+
+bool RTSPInputHandler::ParseHeader() {
+ assert(!message_);
+ static const char delimiter[] = "\r\n\r\n";
+ static const int delimiter_length = 4;
+ size_t eom = rtsp_input_buffer_.find(delimiter);
+ if (eom == std::string::npos) {
+ return false;
+ }
+
+ const std::string& header = rtsp_input_buffer_.substr(0, eom + delimiter_length);
+ rtsp_input_buffer_.erase(0, eom + delimiter_length);
+ Driver::Parse(header, message_);
+ if (!message_) {
+ ParserErrorOccurred(rtsp_input_buffer_);
+ rtsp_input_buffer_.clear();
+ return false;
+ }
+ return true;
+}
+
+bool RTSPInputHandler::ParsePayload() {
+ assert(message_);
+ unsigned content_length = message_->header().content_length();
+ if (content_length == 0) {
+ MessageParsed(std::move(message_));
+ return true;
+ }
+
+ if (rtsp_input_buffer_.size() < content_length)
+ return false;
+
+ const std::string& payload = rtsp_input_buffer_.substr(0, content_length);
+ rtsp_input_buffer_.erase(0, content_length);
+ Driver::Parse(payload, message_);
+ MessageParsed(std::move(message_));
+ return true;
+}
+
+} // namespace wds
diff --git a/chromium/third_party/wds/src/libwds/common/rtsp_input_handler.h b/chromium/third_party/wds/src/libwds/common/rtsp_input_handler.h
new file mode 100644
index 00000000000..36f39563387
--- /dev/null
+++ b/chromium/third_party/wds/src/libwds/common/rtsp_input_handler.h
@@ -0,0 +1,56 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+#ifndef LIBWDS_COMMON_RTSP_INPUT_HANDLER_H_
+#define LIBWDS_COMMON_RTSP_INPUT_HANDLER_H_
+
+#include <memory>
+#include <string>
+
+namespace wds {
+
+namespace rtsp {
+class Message;
+} // namespace rtsp
+
+// An aux class used to obtain Message object from the given raw input.
+class RTSPInputHandler {
+ protected:
+ RTSPInputHandler() = default;
+ virtual ~RTSPInputHandler();
+
+ void AddInput(const std::string& input);
+
+ // To be overridden.
+ virtual void MessageParsed(std::unique_ptr<rtsp::Message> message) = 0;
+ virtual void ParserErrorOccurred(const std::string& invalid_input) {}
+
+ private:
+ bool ParseHeader();
+ bool ParsePayload();
+
+ std::string rtsp_input_buffer_;
+ std::unique_ptr<rtsp::Message> message_;
+};
+
+}
+
+#endif // LIBWDS_COMMON_RTSP_INPUT_HANDLER_H_
diff --git a/chromium/third_party/wds/src/libwds/common/video_format.cpp b/chromium/third_party/wds/src/libwds/common/video_format.cpp
new file mode 100644
index 00000000000..1852de55115
--- /dev/null
+++ b/chromium/third_party/wds/src/libwds/common/video_format.cpp
@@ -0,0 +1,245 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2015 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+#include "libwds/public/media_manager.h"
+
+#include <assert.h>
+
+#include <algorithm>
+
+#include "libwds/public/logging.h"
+
+namespace wds {
+
+namespace {
+// Quality weight is calculated using following formula:
+// width * height * fps * 2 for progressive or 1 for interlaced frames
+struct QualityInfo {
+ unsigned width;
+ unsigned height;
+ unsigned weight;
+};
+
+const QualityInfo cea_info_table[] = {
+ {640, 480, 640*480*60*2}, // CEA640x480p60
+ {720, 480, 720*480*60*2}, // CEA720x480p60
+ {720, 480, 720*480*60}, // CEA720x480i60
+ {720, 576, 720*576*50*2}, // CEA720x576p50
+ {720, 576, 720*576*50}, // CEA720x576i50
+ {1280, 720, 1280*720*30*2}, // CEA1280x720p30
+ {1280, 720, 1280*720*60*2}, // CEA1280x720p60
+ {1920, 1080, 1920*1080*30*2}, // CEA1920x1080p30
+ {1920, 1080, 1920*1080*60*2}, // CEA1920x1080p60
+ {1920, 1080, 1920*1080*60}, // CEA1920x1080i60
+ {1280, 720, 1280*720*25*2}, // CEA1280x720p25
+ {1280, 720, 1280*720*50*2}, // CEA1280x720p50
+ {1920, 1080, 1920*1080*25*2}, // CEA1920x1080p25
+ {1920, 1080, 1920*1080*50*2}, // CEA1920x1080p50
+ {1920, 1080, 1920*1080*50}, // CEA1920x1080i50
+ {1280, 720, 1280*720*24*2}, // CEA1280x720p24
+ {1920, 1080, 1920*1080*24*2} // CEA1920x1080p24
+};
+
+#define CEA_TABLE_LENGTH sizeof(cea_info_table) / sizeof(QualityInfo)
+
+const QualityInfo vesa_info_table[] = {
+ {800, 600, 800*600*30*2}, // VESA800x600p30
+ {800, 600, 800*600*60*2}, // VESA800x600p60
+ {1024, 768, 1024*768*30*2}, // VESA1024x768p30
+ {1024, 768, 1024*768*60*2}, // VESA1024x768p60
+ {1152, 864, 1152*864*30*2}, // VESA1152x864p30
+ {1152, 864, 1152*864*60*2}, // VESA1152x864p60
+ {1280, 768, 1280*768*30*2}, // VESA1280x768p30
+ {1280, 768, 1280*768*60*2}, // VESA1280x768p60
+ {1280, 800, 1280*800*30*2}, // VESA1280x800p30
+ {1280, 800, 1280*800*60*2}, // VESA1280x800p60
+ {1360, 768, 1360*768*30*2}, // VESA1360x768p30
+ {1360, 768, 1360*768*60*2}, // VESA1360x768p60
+ {1366, 768, 1366*768*30*2}, // VESA1366x768p30
+ {1366, 768, 1366*768*60*2}, // VESA1366x768p60
+ {1280, 1024, 1280*1024*30*2}, // VESA1280x1024p30
+ {1280, 1024, 1280*1024*60*2}, // VESA1280x1024p60
+ {1400, 1050, 1400*1050*30*2}, // VESA1400x1050p30
+ {1400, 1050, 1400*1050*60*2}, // VESA1400x1050p60
+ {1440, 900, 1440*900*30*2}, // VESA1440x900p30
+ {1440, 900, 1440*900*60*2}, // VESA1440x900p60
+ {1600, 900, 1600*900*30*2}, // VESA1600x900p30
+ {1600, 900, 1600*900*60*2}, // VESA1600x900p60
+ {1600, 1200, 1600*1200*30*2}, // VESA1600x1200p30
+ {1600, 1200, 1600*1200*60*2}, // VESA1600x1200p60
+ {1680, 1024, 1680*1024*30*2}, // VESA1680x1024p30
+ {1680, 1024, 1680*1024*60*2}, // VESA1680x1024p60
+ {1680, 1050, 1680*1050*30*2}, // VESA1680x1050p30
+ {1680, 1050, 1680*1050*60*2}, // VESA1680x1050p60
+ {1920, 1200, 1920*1200*30*2} // VESA1920x1200p30
+};
+
+#define VESA_TABLE_LENGTH sizeof(vesa_info_table) / sizeof(QualityInfo)
+
+const QualityInfo hh_info_table[] = {
+ {800, 480, 800*480*30*2}, // HH800x480p30
+ {800, 480, 800*480*60*2}, // HH800x480p60
+ {854, 480, 854*480*30*2}, // HH854x480p30
+ {854, 480, 854*480*60*2}, // HH854x480p60
+ {864, 480, 864*480*30*2}, // HH864x480p30
+ {864, 480, 864*480*60*2}, // HH864x480p60
+ {640, 360, 640*360*30*2}, // HH640x360p30
+ {640, 360, 640*360*60*2}, // HH640x360p60
+ {960, 540, 960*540*30*2}, // HH960x540p30
+ {960, 540, 960*540*60*2}, // HH960x540p60
+ {848, 480, 848*480*30*2}, // HH848x480p30
+ {848, 480, 848*480*60*2} // HH848x480p60
+};
+
+#define HH_TABLE_LENGTH sizeof(hh_info_table) / sizeof(QualityInfo)
+
+QualityInfo get_cea_info(const H264VideoFormat& format) {
+ assert(format.rate_resolution < CEA_TABLE_LENGTH);
+ return cea_info_table[format.rate_resolution];
+}
+
+QualityInfo get_vesa_info(const H264VideoFormat& format) {
+ assert(format.rate_resolution < VESA_TABLE_LENGTH);
+ return vesa_info_table[format.rate_resolution];
+}
+
+QualityInfo get_hh_info(const H264VideoFormat& format) {
+ assert(format.rate_resolution < HH_TABLE_LENGTH);
+ return hh_info_table[format.rate_resolution];
+}
+
+QualityInfo get_quality_info(const H264VideoFormat& format) {
+ QualityInfo info;
+ switch (format.type) {
+ case CEA:
+ info = get_cea_info(format);
+ break;
+ case VESA:
+ info = get_vesa_info(format);
+ break;
+ case HH:
+ info = get_hh_info(format);
+ break;
+ default:
+ assert(false);
+ break;
+ }
+ return info;
+}
+
+std::pair<unsigned, unsigned> get_resolution(const H264VideoFormat& format) {
+ QualityInfo info = get_quality_info(format);
+ return std::pair<unsigned, unsigned>(info.width, info.height);
+}
+
+bool video_format_sort_func(const H264VideoFormat& a, const H264VideoFormat& b) {
+ if (get_quality_info(a).weight != get_quality_info(b).weight)
+ return get_quality_info(a).weight < get_quality_info(b).weight;
+ if (a.profile != b.profile)
+ return a.profile < b.profile;
+ return a.level < b.level;
+}
+
+template <typename RREnum>
+void PopulateVideoFormatList(
+ H264Profile profile,
+ H264Level level,
+ const RateAndResolutionsBitmap& bitmap,
+ RREnum max_value,
+ std::vector<H264VideoFormat>& formats) {
+ if (bitmap.none())
+ return;
+
+ for (RateAndResolution rr = 0; rr <= static_cast<RateAndResolution>(max_value); ++rr) {
+ if (bitmap.test(rr))
+ formats.push_back(H264VideoFormat(profile, level, static_cast<RREnum>(rr)));
+ }
+}
+
+} // namespace
+
+void PopulateVideoFormatList(
+ const H264VideoCodec& codec, std::vector<H264VideoFormat>& formats) {
+ PopulateVideoFormatList<CEARatesAndResolutions>(
+ codec.profile, codec.level, codec.cea_rr, CEA1920x1080p24, formats);
+ PopulateVideoFormatList<VESARatesAndResolutions>(
+ codec.profile, codec.level, codec.vesa_rr, VESA1920x1200p30, formats);
+ PopulateVideoFormatList<HHRatesAndResolutions>(
+ codec.profile, codec.level, codec.hh_rr, HH848x480p60, formats);
+}
+
+H264VideoFormat FindOptimalVideoFormat(
+ const NativeVideoFormat& native,
+ const std::vector<H264VideoCodec>& local_codecs,
+ const std::vector<H264VideoCodec>& remote_codecs,
+ bool* success) {
+ std::vector<H264VideoFormat> local_formats, remote_formats;
+ for (const auto& codec : local_codecs)
+ PopulateVideoFormatList(codec, local_formats);
+ for (const auto& codec : remote_codecs)
+ PopulateVideoFormatList(codec, remote_formats);
+
+ std::sort(local_formats.begin(), local_formats.end(),
+ video_format_sort_func);
+ std::sort(remote_formats.begin(), remote_formats.end(),
+ video_format_sort_func);
+
+ auto it = local_formats.begin();
+ auto end = local_formats.end();
+
+ H264VideoFormat format;
+
+ while(it != end) {
+ auto match = std::find_if(
+ remote_formats.begin(),
+ remote_formats.end(),
+ [&it] (const H264VideoFormat& format) {
+ return ((*it).type == format.type) &&
+ (get_resolution(*it) == get_resolution(format));
+ });
+
+ if (match != remote_formats.end()) {
+ format = *match;
+ break;
+ }
+ ++it;
+ }
+
+ // Should not happen, 640x480p60 should be always supported!
+ if (it == end) {
+ WDS_ERROR("Failed to find compatible video format.");
+ if (success)
+ *success = false;
+ return format;
+ }
+
+ // if remote device supports higher codec profile / level
+ // downgrade them to what we support locally.
+ if (format.profile > (*it).profile)
+ format.profile = (*it).profile;
+ if (format.level > (*it).level)
+ format.level = (*it).level;
+ if (success)
+ *success = true;
+ return format;
+}
+
+} // namespace wds
diff --git a/chromium/third_party/wds/src/libwds/public/audio_codec.h b/chromium/third_party/wds/src/libwds/public/audio_codec.h
new file mode 100644
index 00000000000..4a83c75a31a
--- /dev/null
+++ b/chromium/third_party/wds/src/libwds/public/audio_codec.h
@@ -0,0 +1,73 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2015 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+#ifndef LIBWDS_PUBLIC_AUDIO_CODEC_H_
+#define LIBWDS_PUBLIC_AUDIO_CODEC_H_
+
+#include <bitset>
+
+namespace wds {
+
+enum AudioFormats {
+ LPCM,
+ AAC,
+ AC3
+};
+
+enum LPCMModes {
+ LPCM_44_1K_16B_2CH,
+ LPCM_48K_16B_2CH
+};
+
+enum AACModes {
+ AAC_48K_16B_2CH,
+ AAC_48K_16B_4CH,
+ AAC_48K_16B_6CH,
+ AAC_48K_16B_8CH
+};
+
+enum AC3Modes {
+ AC3_48K_16B_2CH,
+ AC3_48K_16B_4CH,
+ AC3_48K_16B_6CH
+};
+
+using AudioModes = std::bitset<32>;
+
+/**
+ * @brief The AudioCodec struct
+ *
+ * Repersents a <audio-format, modes, latency> tuple used in 'wfd-audio-codecs'.
+ */
+struct AudioCodec {
+ AudioCodec()
+ : format(LPCM), modes(AudioModes().set(LPCM_48K_16B_2CH)), latency(0) {}
+ AudioCodec(AudioFormats format, const AudioModes& modes, unsigned latency)
+ : format(format), modes(modes), latency(latency) {}
+
+ AudioFormats format;
+ AudioModes modes;
+ unsigned latency;
+};
+
+} // namespace wds
+
+#endif // LIBWDS_PUBLIC_AUDIO_CODEC_H_
diff --git a/chromium/third_party/wds/src/libwds/public/connector_type.h b/chromium/third_party/wds/src/libwds/public/connector_type.h
new file mode 100644
index 00000000000..142a7a6d530
--- /dev/null
+++ b/chromium/third_party/wds/src/libwds/public/connector_type.h
@@ -0,0 +1,36 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2015 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+#ifndef LIBWDS_PUBLIC_CONNECTOR_TYPE_H_
+#define LIBWDS_PUBLIC_CONNECTOR_TYPE_H_
+
+namespace wds {
+
+enum ConnectorType {
+ ConnectorTypeVGA = 0,
+ // TODO : Add the rest of connector types.
+ ConnectorTypeUndefined = 255,
+ ConnectorTypeNone
+};
+
+} // namespace wds
+
+#endif // LIBWDS_PUBLIC_CONNECTOR_TYPE_H_
diff --git a/chromium/third_party/wds/src/libwds/public/logging.h b/chromium/third_party/wds/src/libwds/public/logging.h
new file mode 100644
index 00000000000..539a09ff77c
--- /dev/null
+++ b/chromium/third_party/wds/src/libwds/public/logging.h
@@ -0,0 +1,99 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2015 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+#ifndef LIBWDS_PUBLIC_LOGGING_H_
+#define LIBWDS_PUBLIC_LOGGING_H_
+
+#include <cstdarg>
+
+#include "wds_export.h"
+
+namespace wds {
+
+/**
+ * WFD logging subsystem.
+ */
+class WDS_EXPORT LogSystem {
+ public:
+ typedef void (*LogFunction)(const char*, ...);
+
+ /**
+ * Sets a function to log a normal message.
+ * @param function to log a normal message
+ */
+ static void set_log_func(LogFunction func);
+ /**
+ * Gets a function to log a normal message @see set_log_func
+ * @return function to log a normal message
+ */
+ static LogFunction log_func();
+
+ /**
+ * Sets a function to log a verbose message.
+ * @param function to log a verbose message
+ */
+ static void set_vlog_func(LogFunction func);
+ /**
+ * Gets a function to log a verbose message @see set_vlog_func
+ * @return function to log a verbose message
+ */
+ static LogFunction vlog_func();
+
+ /**
+ * Sets a function to log a warning message.
+ * @param function to log a warning message
+ */
+ static void set_warning_func(LogFunction func);
+ /**
+ * Gets a function to log a warning message @see set_warning_func
+ * @return function to log a warning message
+ */
+ static LogFunction warning_func();
+
+ /**
+ * Sets a function to log an error message.
+ * @param function to log an error message
+ */
+ static void set_error_func(LogFunction func);
+ /**
+ * Gets a function to log an error message @see set_error_func
+ * @return function to log an error message
+ */
+ static LogFunction error_func();
+
+ private:
+ static LogFunction log_func_;
+ static LogFunction vlog_func_;
+ static LogFunction warning_func_;
+ static LogFunction error_func_;
+
+ private:
+ LogSystem() = delete;
+};
+
+}
+
+#define WDS_LOG(...) (*wds::LogSystem::log_func())(__VA_ARGS__);
+#define WDS_VLOG(...) (*wds::LogSystem::vlog_func())(__VA_ARGS__);
+#define WDS_WARNING(...) (*wds::LogSystem::warning_func())(__VA_ARGS__);
+#define WDS_ERROR(...) (*wds::LogSystem::error_func())(__VA_ARGS__);
+
+#endif // LIBWDS_PUBLIC_LOGGING_H_
diff --git a/chromium/third_party/wds/src/libwds/public/media_manager.h b/chromium/third_party/wds/src/libwds/public/media_manager.h
new file mode 100644
index 00000000000..6f9d5a7976c
--- /dev/null
+++ b/chromium/third_party/wds/src/libwds/public/media_manager.h
@@ -0,0 +1,258 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+#ifndef LIBWDS_PUBLIC_MEDIA_MANAGER_H_
+#define LIBWDS_PUBLIC_MEDIA_MANAGER_H_
+
+#include <string>
+#include <vector>
+#include "audio_codec.h"
+#include "connector_type.h"
+#include "video_format.h"
+#include "wds_export.h"
+
+namespace wds {
+
+enum SessionType {
+ AudioSession = 1, // Audio only session
+ VideoSession = 1 << 1, // Video only session
+ AudioVideoSession = AudioSession | VideoSession // Audio/video session
+};
+
+/**
+ * MediaManager interface.
+ *
+ * MediaManager instance is used by the state machine to control media stream
+ * during WFD session.
+ *
+ * MediaManager contains the common methods for both WFD sink and WFD source.
+ * The client applications are not supposed to implement it directly, they should
+ * rather implement either @c SinkMediaManager or @c SourceMediaManager.
+ * @see SinkMediaManager, SourceMediaManager
+ */
+class MediaManager {
+ public:
+ virtual ~MediaManager() {}
+
+ /**
+ * Triggers playback of the media stream.
+ */
+ virtual void Play() = 0;
+
+ /**
+ * Pauses playback of the media stream.
+ */
+ virtual void Pause() = 0;
+
+ /**
+ * Destroys media stream.
+ */
+ virtual void Teardown() = 0;
+
+ /**
+ * Queries whether media stream is paused.
+ * @return true if media stream is paused, false otherwise.
+ */
+ virtual bool IsPaused() const = 0;
+
+ /**
+ * Returns unique WFD session id.
+ *
+ * The session Id is generated by WFD source.
+ *
+ * @return unique id for WFD session
+ */
+ virtual std::string GetSessionId() const = 0;
+};
+
+/**
+ * SinkMediaManager interface.
+ *
+ * Extends the common @c MediaManager interface with WFD sink specific methods.
+ * @see MediaManager
+ */
+class SinkMediaManager : public MediaManager {
+ public:
+ ~SinkMediaManager() override { }
+
+ /**
+ * Returns RTP listening ports that are used by WFD sink to receive media streams.
+ *
+ * In case of coupled sink configuration video and audio data could be sent
+ * to different RTP ports.
+ *
+ * @return pair of RTP ports, port0 and port1
+ */
+ virtual std::pair<int,int> GetLocalRtpPorts() const = 0;
+
+ /**
+ * Sets presentation URL for media stream.
+ * Presentation URL can be referred in order to control media stream resource
+ * within WFD session.
+ *
+ * The implementation must store the given value and return it at GetPresentationUrl.
+ *
+ * @param presentation URL that represents video / audio stream
+ */
+ virtual void SetPresentationUrl(const std::string& url) = 0;
+
+ /**
+ * Returns presentation URL for managed media resource.
+ * @see SetPresentationUrl
+ * @return presentation URL
+ */
+ virtual std::string GetPresentationUrl() const = 0;
+
+ /**
+ * Sets unique ID for WFD session.
+ *
+ * The implementation must store the given value and return it at GetSessionId.
+ *
+ * @param string that uniquely identifies WFD session
+ */
+ virtual void SetSessionId(const std::string& session) = 0;
+
+ /**
+ * Returns list of supported H264 video formats
+ * @return vector of supported H264 video formats
+ */
+ virtual std::vector<H264VideoCodec> GetSupportedH264VideoCodecs() const = 0;
+
+ /**
+ * Returns native video format of a device
+ * @return native video format
+ */
+ virtual NativeVideoFormat GetNativeVideoFormat() const = 0;
+
+ /**
+ * Sets optimal H264 format that would be used to send / receive video stream
+ *
+ * @param optimal H264 format
+ * @return true if format can be used by media manager, false otherwise
+ */
+ virtual bool SetOptimalVideoFormat(const H264VideoFormat& optimal_format) = 0;
+
+ /**
+ * Returns active connector type of a device
+ * @return connector type. @see ConnectorType
+ */
+ virtual ConnectorType GetConnectorType() const = 0;
+};
+
+/**
+ * SourceMediaManager interface.
+ *
+ * Extends the common @c MediaManager interface with WFD source specific methods.
+ * @see MediaManager
+ */
+class SourceMediaManager : public MediaManager {
+ public:
+ ~SourceMediaManager() override { }
+
+ /**
+ * Returns media type for the current session.
+ * @see MediaType
+ * @return media time.
+ */
+ virtual SessionType GetSessionType() const = 0;
+
+ /**
+ * Sets RTP ports used by WFD sink to receive media streams.
+ *
+ * In case of coupled sink configuration video and audio data could be sent
+ * to different RTP ports.
+ *
+ * WFD source must use these RTP ports for outgoing UDP connection.
+ *
+ * The implementation must store the given values and return them at GetSinkRtpPorts.
+ *
+ * @param port0 RTP port for video / audio stream
+ * @param port1 RTP port that could be used to send audio stream
+ */
+ virtual void SetSinkRtpPorts(int port1, int port2) = 0;
+
+ /**
+ * Returns RTP ports that are used by WFD sink to receive media streams.
+ * @see SetRtpPorts
+ * @return pair of RTP ports, port0 and port1
+ */
+ virtual std::pair<int,int> GetSinkRtpPorts() const = 0;
+
+ /**
+ * Returns the local WFD source RTP port transmitting the media stream.
+ * @return RTP port
+ */
+ virtual int GetLocalRtpPort() const = 0;
+
+ /**
+ * Initializes optimal video format
+ * The optimal video format will be returned by GetOptimalVideoFormat
+ *
+ * @param sink_native_format format of the sink device
+ * @param sink_supported_formats of H264 formats that are supported by the sink device
+ * @return true if optimal video format is successfully initialized, false otherwise
+ */
+ virtual bool InitOptimalVideoFormat(
+ const NativeVideoFormat& sink_native_format,
+ const std::vector<H264VideoCodec>& sink_supported_codecs) = 0;
+
+ /**
+ * Gets optimal H264 format @see InitOptimalVideoFormat
+ *
+ * @return optimal H264 format
+ */
+ virtual H264VideoFormat GetOptimalVideoFormat() const = 0;
+
+ /**
+ * Initializes optimal audio codec
+ * The optimal audio codec will be returned by GetOptimalAudioFormat
+ *
+ * @param sink_supported_codecs list of the codecs supported by sink
+ * @return true if optimal audio codec is successfully initialized, false otherwise
+ */
+ virtual bool InitOptimalAudioFormat(const std::vector<AudioCodec>& sink_supported_codecs) = 0;
+
+ /**
+ * Gets optimal audio codec @see InitOptimalAudioFormat
+ *
+ * @return optimal audio codec
+ */
+ virtual AudioCodec GetOptimalAudioFormat() const = 0;
+
+ /**
+ * Sends of H.264 instantaneous decoding refresh (IDR) picture
+ * to recover the content streaming.
+ */
+ virtual void SendIDRPicture() = 0;
+};
+
+inline SourceMediaManager* ToSourceMediaManager(MediaManager* mng) {
+ return static_cast<SourceMediaManager*>(mng);
+}
+
+inline SinkMediaManager* ToSinkMediaManager(MediaManager* mng) {
+ return static_cast<SinkMediaManager*>(mng);
+}
+
+} // namespace wds
+
+#endif // LIBWDS_PUBLIC_MEDIA_MANAGER_H_
+
diff --git a/chromium/third_party/wds/src/libwds/public/peer.h b/chromium/third_party/wds/src/libwds/public/peer.h
new file mode 100644
index 00000000000..543088537cd
--- /dev/null
+++ b/chromium/third_party/wds/src/libwds/public/peer.h
@@ -0,0 +1,175 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+#ifndef LIBWDS_PUBLIC_PEER_H_
+#define LIBWDS_PUBLIC_PEER_H_
+
+#include <string>
+
+#include "wds_export.h"
+
+namespace wds {
+
+enum ErrorType {
+ /// Arrived message cannot be handled by the state machine at the time.
+ UnexpectedMessageError,
+ /// RTSP message cannot be created form the given input.
+ MessageParseError,
+ /// The connected peer became unresponsive.
+ TimeoutError
+};
+
+
+/**
+ * Peer interface.
+ *
+ * Peer is a base class for sink and source state machines.
+ */
+class WDS_EXPORT Peer {
+ public:
+ /**
+ * Delegate interface.
+ *
+ * Implementation of Delegate interface is used by the state machine
+ * to obtain necessary context from the client.
+ */
+ class Delegate {
+ public:
+ /**
+ * The implementation should send the RTSP data over the network
+ * @param data data to be send
+ */
+ virtual void SendRTSPData(const std::string& data) = 0;
+ /**
+ * Returns the local IP address
+ * @return IP address
+ */
+ virtual std::string GetLocalIPAddress() const = 0;
+ /**
+ * The implementation should start a timer to be used by the state machine.
+ * @param seconds the time interval in seconds
+ * @return unique timer id within the session
+ */
+ virtual unsigned CreateTimer(int seconds) = 0;
+ /**
+ * The implementation should release timer by the given id.
+ * @param timer_id id of the timer to be released.
+ */
+ virtual void ReleaseTimer(unsigned timer_id) = 0;
+
+ /**
+ * Returns the sequence number for the following RTSP request-response pair
+ * @param initial_peer_cseq is provided for the WFD sink implementation at
+ * the first method's call during the WFD session and it contains the
+ * initial request sequence number obtained from the WFD source (the initial
+ * sequence numbers of connected peers may not be identical).
+ */
+ virtual int GetNextCSeq(int* initial_peer_cseq = nullptr) const = 0;
+
+ protected:
+ virtual ~Delegate() {}
+ };
+
+ /**
+ * Observer interface.
+ *
+ * This interface can be used by the client in order to get notifications
+ * from the state machine.
+ */
+ class Observer {
+ public:
+ /**
+ * This method is called by the state machine if an error has occurred.
+ * State machine is not reset.
+ *
+ * @param error type of the error
+ *
+ * @see ErrorType
+ */
+ virtual void ErrorOccurred(ErrorType error) {}
+ /**
+ * This method is called by the state machine if the session has been
+ * completed normally (with 'teardown' message).
+ * State machine is not reset.
+ */
+ virtual void SessionCompleted() {}
+
+ protected:
+ virtual ~Observer() {}
+ };
+
+ virtual ~Peer() {}
+
+ /**
+ * Starts wds state machine (source or sink)
+ */
+ virtual void Start() = 0;
+
+ /**
+ * Reset wds state machine (source or sink) to the initial state.
+ */
+ virtual void Reset() = 0;
+
+ /**
+ * Whenever RTSP data is received, this method should be called, so that
+ * the state machine could take action based on current state.
+ */
+ virtual void RTSPDataReceived(const std::string& data) = 0;
+
+ // Following methods:
+ // @see Teardown()
+ // @see Play()
+ // @see Pause()
+ // send M5 wfd_trigger_method messages for Peers that implement
+ // Source functionality or M7, M8 and M9 for Sink implementations
+
+ /**
+ * Sends RTSP teardown request.
+ * @return true if request can be sent, false otherwise.
+ */
+ virtual bool Teardown() = 0;
+
+ /**
+ * Sends RTSP play request.
+ * @return true if request can be sent, false otherwise.
+ */
+ virtual bool Play() = 0;
+
+ /**
+ * Sends RTSP pause request.
+ * @return true if request can be sent, false otherwise.
+ */
+ virtual bool Pause() = 0;
+
+ /**
+ * This method should be called by the client to notify the state
+ * machine about the timer events.
+ * @param timer_id id of the timer
+ * @return true if request can be sent, false otherwise.
+ *
+ * @see Delegate::CreateTimer()
+ */
+ virtual void OnTimerEvent(unsigned timer_id) = 0;
+};
+
+}
+
+#endif // LIBWDS_PUBLIC_PEER_H_
diff --git a/chromium/third_party/wds/src/libwds/public/sink.h b/chromium/third_party/wds/src/libwds/public/sink.h
new file mode 100644
index 00000000000..bb30e0c9295
--- /dev/null
+++ b/chromium/third_party/wds/src/libwds/public/sink.h
@@ -0,0 +1,49 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+#ifndef LIBWDS_PUBLIC_SINK_H_
+#define LIBWDS_PUBLIC_SINK_H_
+
+#include "peer.h"
+
+namespace wds {
+
+class SinkMediaManager;
+
+/**
+ * Sink state machine implementation
+ */
+class WDS_EXPORT Sink : public Peer {
+ public:
+ virtual ~Sink() {}
+
+ /**
+ * Factory method that creates Sink state machine.
+ * @param delegate that is used for networking
+ * @param media manger that is used for media stream management
+ * @return newly created Sink instance
+ */
+ static Sink* Create(Peer::Delegate* delegate, SinkMediaManager* mng);
+};
+
+}
+
+#endif // LIBWDS_PUBLIC_SINK_H_
diff --git a/chromium/third_party/wds/src/libwds/public/source.h b/chromium/third_party/wds/src/libwds/public/source.h
new file mode 100644
index 00000000000..29e4defabcb
--- /dev/null
+++ b/chromium/third_party/wds/src/libwds/public/source.h
@@ -0,0 +1,50 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+#ifndef LIBWDS_PUBLIC_SOURCE_H_
+#define LIBWDS_PUBLIC_SOURCE_H_
+
+#include "peer.h"
+
+namespace wds {
+
+class SourceMediaManager;
+
+/**
+ * Source state machine implementation
+ */
+class WDS_EXPORT Source : public Peer {
+ public:
+ /**
+ * Factory method that creates Source state machine.
+ * @param delegate that is used for networking
+ * @param media manger that is used for media stream management
+ * @param observer
+ * @return newly created Source instance
+ */
+ static Source* Create(Peer::Delegate* delegate,
+ SourceMediaManager* mng,
+ Peer::Observer* observer = nullptr);
+};
+
+}
+
+#endif // LIBWDS_PUBLIC_SOURCE_H_
diff --git a/chromium/third_party/wds/src/libwds/public/video_format.h b/chromium/third_party/wds/src/libwds/public/video_format.h
new file mode 100644
index 00000000000..b84f0da3f25
--- /dev/null
+++ b/chromium/third_party/wds/src/libwds/public/video_format.h
@@ -0,0 +1,218 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2015 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+#ifndef LIBWDS_PUBLIC_VIDEO_FORMAT_H_
+#define LIBWDS_PUBLIC_VIDEO_FORMAT_H_
+
+#include <bitset>
+#include <vector>
+
+#include "wds_export.h"
+
+namespace wds {
+
+using RateAndResolution = unsigned;
+using RateAndResolutionsBitmap = std::bitset<32>;
+
+// NOTE : Do not change the elements order in the following enums!
+
+enum ResolutionType {
+ CEA,
+ VESA,
+ HH
+};
+
+enum CEARatesAndResolutions {
+ CEA640x480p60,
+ CEA720x480p60,
+ CEA720x480i60,
+ CEA720x576p50,
+ CEA720x576i50,
+ CEA1280x720p30,
+ CEA1280x720p60,
+ CEA1920x1080p30,
+ CEA1920x1080p60,
+ CEA1920x1080i60,
+ CEA1280x720p25,
+ CEA1280x720p50,
+ CEA1920x1080p25,
+ CEA1920x1080p50,
+ CEA1920x1080i50,
+ CEA1280x720p24,
+ CEA1920x1080p24
+};
+
+enum VESARatesAndResolutions {
+ VESA800x600p30,
+ VESA800x600p60,
+ VESA1024x768p30,
+ VESA1024x768p60,
+ VESA1152x864p30,
+ VESA1152x864p60,
+ VESA1280x768p30,
+ VESA1280x768p60,
+ VESA1280x800p30,
+ VESA1280x800p60,
+ VESA1360x768p30,
+ VESA1360x768p60,
+ VESA1366x768p30,
+ VESA1366x768p60,
+ VESA1280x1024p30,
+ VESA1280x1024p60,
+ VESA1400x1050p30,
+ VESA1400x1050p60,
+ VESA1440x900p30,
+ VESA1440x900p60,
+ VESA1600x900p30,
+ VESA1600x900p60,
+ VESA1600x1200p30,
+ VESA1600x1200p60,
+ VESA1680x1024p30,
+ VESA1680x1024p60,
+ VESA1680x1050p30,
+ VESA1680x1050p60,
+ VESA1920x1200p30
+};
+
+enum HHRatesAndResolutions {
+ HH800x480p30,
+ HH800x480p60,
+ HH854x480p30,
+ HH854x480p60,
+ HH864x480p30,
+ HH864x480p60,
+ HH640x360p30,
+ HH640x360p60,
+ HH960x540p30,
+ HH960x540p60,
+ HH848x480p30,
+ HH848x480p60
+};
+
+enum H264Profile {
+ CBP,
+ CHP
+};
+
+enum H264Level {
+ k3_1,
+ k3_2,
+ k4,
+ k4_1,
+ k4_2
+};
+
+
+struct NativeVideoFormat {
+ NativeVideoFormat()
+ : type(CEA), rate_resolution(CEA640x480p60) {}
+ NativeVideoFormat(CEARatesAndResolutions rr)
+ : type(CEA), rate_resolution(rr) {}
+ NativeVideoFormat(VESARatesAndResolutions rr)
+ : type(VESA), rate_resolution(rr) {}
+ NativeVideoFormat(HHRatesAndResolutions rr)
+ : type(HH), rate_resolution(rr) {}
+
+ ResolutionType type;
+ RateAndResolution rate_resolution;
+};
+
+/**
+ * A single video format that the source selects for streaming.
+ *
+ * H264VideoFormat is a H264 profile, H264 level, and a single CEA,
+ * VESA or HH resolution. Sources are choosing the video format by matching what they
+ * support to what the sink supports, and then they communicate the chosen format back
+ * to the sink.
+ */
+struct H264VideoFormat {
+ H264VideoFormat()
+ : profile(CBP), level(k3_1), type(CEA), rate_resolution(CEA640x480p60) {}
+
+ H264VideoFormat(H264Profile profile, H264Level level, CEARatesAndResolutions rr)
+ : profile(profile), level(level), type(CEA), rate_resolution(rr) {}
+
+ H264VideoFormat(H264Profile profile, H264Level level, VESARatesAndResolutions rr)
+ : profile(profile), level(level), type(VESA), rate_resolution(rr) {}
+
+ H264VideoFormat(H264Profile profile, H264Level level, HHRatesAndResolutions rr)
+ : profile(profile), level(level), type(HH), rate_resolution(rr) {}
+
+ H264Profile profile;
+ H264Level level;
+ ResolutionType type;
+ RateAndResolution rate_resolution;
+};
+
+/**
+ * Represents <profile, level, misc-params, max-hres, max-vres> tuple used in 'wfd-video-formats'.
+ *
+ * H264VideoCodec is a H264 profile, H264 level, and three sets of
+ * CEA, VESA and HH resolutions. Sinks send one or several H264VideoCodec
+ * to sources (for example because supported resolutions might
+ * be different for CBP and CHP).
+ */
+struct H264VideoCodec {
+ H264VideoCodec()
+ : profile(CBP), level(k3_1), cea_rr(RateAndResolutionsBitmap().set(CEA640x480p60)) {}
+
+ H264VideoCodec(H264Profile profile, H264Level level,
+ const RateAndResolutionsBitmap& cea,
+ const RateAndResolutionsBitmap& vesa,
+ const RateAndResolutionsBitmap& hh)
+ : profile(profile), level(level), cea_rr(cea), vesa_rr(vesa), hh_rr(hh) {}
+
+ H264Profile profile;
+ H264Level level;
+ RateAndResolutionsBitmap cea_rr;
+ RateAndResolutionsBitmap vesa_rr;
+ RateAndResolutionsBitmap hh_rr;
+};
+
+/**
+ * An auxiliary function which populates list of @c H264VideoFormat
+ * items from the given @c H264VideoCodec instance.
+ *
+ * @param codec the given @c H264VideoCodec instance.
+ * @param formats resulting list of @c H264VideoFormat items
+ */
+WDS_EXPORT void PopulateVideoFormatList(
+ const H264VideoCodec& codec,
+ std::vector<H264VideoFormat>& formats);
+
+/**
+ * An auxiliary function to find the optimal format for streaming.
+ * The quality selection algorithm will pick codec with higher bandwidth.
+ *
+ * @param native format of a remote device
+ * @param local_codecs list of H264 codecs that are supported by local device
+ * @param remote_codecs list of H264 codecs that are supported by remote device
+ * @return optimal H264 video format
+ */
+WDS_EXPORT H264VideoFormat FindOptimalVideoFormat(
+ const NativeVideoFormat& remote_native_format,
+ const std::vector<H264VideoCodec>& local_codecs,
+ const std::vector<H264VideoCodec>& remote_codecs,
+ bool* success = nullptr);
+
+} // namespace wds
+
+#endif // LIBWDS_PUBLIC_VIDEO_FORMAT_H_
diff --git a/chromium/third_party/wds/src/libwds/public/wds_export.h b/chromium/third_party/wds/src/libwds/public/wds_export.h
new file mode 100644
index 00000000000..6efc130e384
--- /dev/null
+++ b/chromium/third_party/wds/src/libwds/public/wds_export.h
@@ -0,0 +1,32 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+#ifndef LIBWDS_PUBLIC_WDS_EXPORT_H_
+#define LIBWDS_PUBLIC_WDS_EXPORT_H_
+
+#if defined _WIN32 || defined _WIN64
+ #define WDS_EXPORT __declspec(dllexport)
+#else
+ #define WDS_EXPORT __attribute__((visibility("default")))
+#endif
+
+
+#endif // LIBWDS_PUBLIC_WDS_EXPORT_H_
diff --git a/chromium/third_party/wds/src/libwds/rtsp/CMakeLists.txt b/chromium/third_party/wds/src/libwds/rtsp/CMakeLists.txt
new file mode 100644
index 00000000000..6b4c37bb947
--- /dev/null
+++ b/chromium/third_party/wds/src/libwds/rtsp/CMakeLists.txt
@@ -0,0 +1,41 @@
+#FIXME in the future: with cmake 2.8.12 and up it's better
+#to use target_compile_options or add_compile_options
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -fvisibility=hidden -fPIC")
+set(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} -std=c99 -Wall")
+
+# Make directory for generated parser files
+set(PARSER_GEN_DIR "${CMAKE_CURRENT_SOURCE_DIR}/gen")
+file(MAKE_DIRECTORY ${PARSER_GEN_DIR})
+
+include_directories ("${PROJECT_SOURCE_DIR}" "${PARSER_GEN_DIR}" )
+
+if (CMAKE_BUILD_TYPE STREQUAL "Debug")
+ set(PARSER_DEBUG_OPTIONS "--debug -v")
+endif (CMAKE_BUILD_TYPE STREQUAL "Debug")
+
+find_package(BISON REQUIRED)
+BISON_TARGET(Parser parser.ypp ${PARSER_GEN_DIR}/parser.cpp COMPILE_FLAGS "-l -p wds_ ${PARSER_DEBUG_OPTIONS}")
+
+find_package(FLEX REQUIRED)
+FLEX_TARGET(MessageLexer messagelexer.l ${PARSER_GEN_DIR}/messagescanner.cpp COMPILE_FLAGS "-L -P message_ ${PARSER_DEBUG_OPTIONS}")
+ADD_FLEX_BISON_DEPENDENCY(MessageLexer Parser)
+FLEX_TARGET(HeaderLexer headerlexer.l ${PARSER_GEN_DIR}/headerscanner.cpp COMPILE_FLAGS "-L -P header_ ${PARSER_DEBUG_OPTIONS}")
+ADD_FLEX_BISON_DEPENDENCY(HeaderLexer Parser)
+FLEX_TARGET(ErrorLexer errorlexer.l ${PARSER_GEN_DIR}/errorscanner.cpp COMPILE_FLAGS "-L -P error_ ${PARSER_DEBUG_OPTIONS}")
+ADD_FLEX_BISON_DEPENDENCY(ErrorLexer Parser)
+
+add_library(wdsrtsp OBJECT
+ ${BISON_Parser_OUTPUT_SOURCE}
+ ${FLEX_MessageLexer_OUTPUTS}
+ ${FLEX_ErrorLexer_OUTPUTS}
+ ${FLEX_HeaderLexer_OUTPUTS}
+ driver.cpp message.cpp header.cpp transportheader.cpp payload.cpp
+ options.cpp reply.cpp getparameter.cpp setparameter.cpp play.cpp
+ pause.cpp teardown.cpp setup.cpp property.cpp genericproperty.cpp
+ formats3d.cpp audiocodecs.cpp clientrtpports.cpp
+ contentprotection.cpp coupledsink.cpp displayedid.cpp
+ presentationurl.cpp route.cpp triggermethod.cpp
+ videoformats.cpp i2c.cpp avformatchangetiming.cpp uibcsetting.cpp
+ standbyresumecapability.cpp standby.cpp idrrequest.cpp connectortype.cpp
+ preferreddisplaymode.cpp uibccapability.cpp propertyerrors.cpp
+)
diff --git a/chromium/third_party/wds/src/libwds/rtsp/audiocodecs.cpp b/chromium/third_party/wds/src/libwds/rtsp/audiocodecs.cpp
new file mode 100644
index 00000000000..d4fde5b772d
--- /dev/null
+++ b/chromium/third_party/wds/src/libwds/rtsp/audiocodecs.cpp
@@ -0,0 +1,79 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+
+#include "libwds/rtsp/audiocodecs.h"
+
+#include <assert.h>
+
+#include "libwds/rtsp/macros.h"
+
+namespace wds {
+namespace rtsp {
+
+namespace {
+
+std::string ToString(const wds::AudioCodec& codec) {
+ MAKE_HEX_STRING_8(audio_modes_str,
+ static_cast<unsigned int>(codec.modes.to_ulong()));
+ MAKE_HEX_STRING_2(latency_str, codec.latency);
+ const char* const name[] = {"LPCM", "AAC", "AC3"};
+ std::string ret = name[codec.format]
+ + std::string(SPACE) + audio_modes_str
+ + std::string(SPACE) + latency_str;
+ return ret;
+}
+
+}
+
+AudioCodecs::AudioCodecs()
+ : Property(AudioCodecsPropertyType, true) {
+}
+
+AudioCodecs::AudioCodecs(const std::vector<wds::AudioCodec>& audio_codecs)
+ : Property(AudioCodecsPropertyType),
+ audio_codecs_(audio_codecs) {
+}
+
+AudioCodecs::~AudioCodecs() {
+}
+
+std::string AudioCodecs::ToString() const {
+ std::string ret = PropertyName::wfd_audio_codecs + std::string(SEMICOLON)
+ + std::string(SPACE);
+
+ if (audio_codecs_.empty())
+ return ret + NONE;
+
+ auto it = audio_codecs_.begin();
+ auto end = audio_codecs_.end();
+ while (it != end) {
+ ret += wds::rtsp::ToString(*it);
+ ++it;
+ if (it != end)
+ ret += ", ";
+ }
+
+ return ret;
+}
+
+} // namespace rtsp
+} // namespace wds
diff --git a/chromium/third_party/wds/src/libwds/rtsp/audiocodecs.h b/chromium/third_party/wds/src/libwds/rtsp/audiocodecs.h
new file mode 100644
index 00000000000..94a727fb6fe
--- /dev/null
+++ b/chromium/third_party/wds/src/libwds/rtsp/audiocodecs.h
@@ -0,0 +1,50 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+
+#ifndef LIBWDS_RTSP_AUDIOCODECS_H_
+#define LIBWDS_RTSP_AUDIOCODECS_H_
+
+#include <vector>
+
+#include "libwds/public/audio_codec.h"
+#include "libwds/rtsp/property.h"
+
+namespace wds {
+namespace rtsp {
+
+class AudioCodecs: public Property {
+ public:
+ AudioCodecs();
+ AudioCodecs(const std::vector<wds::AudioCodec>& audio_codecs);
+ ~AudioCodecs() override;
+
+ const std::vector<wds::AudioCodec>& audio_codecs() const { return audio_codecs_; }
+ std::string ToString() const override;
+
+ private:
+ std::vector<AudioCodec> audio_codecs_;
+};
+
+} // namespace rtsp
+} // namespace wds
+
+#endif // LIBWDS_RTSP_AUDIOCODECS_H_
diff --git a/chromium/third_party/wds/src/libwds/rtsp/avformatchangetiming.cpp b/chromium/third_party/wds/src/libwds/rtsp/avformatchangetiming.cpp
new file mode 100644
index 00000000000..41d12de961e
--- /dev/null
+++ b/chromium/third_party/wds/src/libwds/rtsp/avformatchangetiming.cpp
@@ -0,0 +1,52 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+
+#include "libwds/rtsp/avformatchangetiming.h"
+
+#include "libwds/rtsp/macros.h"
+
+namespace wds {
+namespace rtsp {
+
+AVFormatChangeTiming::AVFormatChangeTiming(unsigned long long int pts,
+ unsigned long long int dts)
+ : Property(AVFormatChangeTimingPropertyType),
+ pts_(pts),
+ dts_(dts) {
+
+}
+
+AVFormatChangeTiming::~AVFormatChangeTiming() {
+}
+
+std::string AVFormatChangeTiming::ToString() const {
+ MAKE_HEX_STRING_10(pts, pts_);
+ MAKE_HEX_STRING_10(dts, dts_);
+ std::string ret =
+ PropertyName::wfd_av_format_change_timing + std::string(SEMICOLON)
+ + std::string(SPACE) + pts
+ + std::string(SPACE) + dts;
+ return ret;
+}
+
+} // namespace rtsp
+} // namespace wds
diff --git a/chromium/third_party/wds/src/libwds/rtsp/avformatchangetiming.h b/chromium/third_party/wds/src/libwds/rtsp/avformatchangetiming.h
new file mode 100644
index 00000000000..59577e81787
--- /dev/null
+++ b/chromium/third_party/wds/src/libwds/rtsp/avformatchangetiming.h
@@ -0,0 +1,49 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+
+#ifndef LIBWDS_RTSP_AVFORMATCHANGETIMING_H_
+#define LIBWDS_RTSP_AVFORMATCHANGETIMING_H_
+
+#include "libwds/rtsp/property.h"
+
+namespace wds {
+namespace rtsp {
+
+class AVFormatChangeTiming: public Property {
+public:
+ AVFormatChangeTiming(unsigned long long int pts, unsigned long long int dts);
+ ~AVFormatChangeTiming() override;
+
+ unsigned long long int pts() const { return pts_; }
+ unsigned long long int dts() const { return dts_; }
+
+ std::string ToString() const override;
+
+ private:
+ unsigned long long int pts_;
+ unsigned long long int dts_;
+};
+
+} // namespace rtsp
+} // namespace wds
+
+#endif // LIBWDS_RTSP_AVFORMATCHANGETIMING_H_
diff --git a/chromium/third_party/wds/src/libwds/rtsp/clientrtpports.cpp b/chromium/third_party/wds/src/libwds/rtsp/clientrtpports.cpp
new file mode 100644
index 00000000000..a62635804f1
--- /dev/null
+++ b/chromium/third_party/wds/src/libwds/rtsp/clientrtpports.cpp
@@ -0,0 +1,52 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+
+#include "libwds/rtsp/clientrtpports.h"
+
+namespace wds {
+namespace rtsp {
+
+namespace {
+const char profile[] = "RTP/AVP/UDP;unicast";
+const char mode[] = "mode=play";
+}
+
+ClientRtpPorts::ClientRtpPorts(unsigned short rtp_port_0,
+ unsigned short rtp_port_1)
+ : Property(ClientRTPPortsPropertyType),
+ rtp_port_0_(rtp_port_0),
+ rtp_port_1_(rtp_port_1) {
+}
+
+ClientRtpPorts::~ClientRtpPorts() {
+}
+
+std::string ClientRtpPorts::ToString() const {
+ return PropertyName::wfd_client_rtp_ports + std::string(SEMICOLON)
+ + std::string(SPACE) + profile
+ + std::string(SPACE) + std::to_string(rtp_port_0_)
+ + std::string(SPACE) + std::to_string(rtp_port_1_)
+ + std::string(SPACE) + mode;
+}
+
+} // namespace rtsp
+} // namespace wds
diff --git a/chromium/third_party/wds/src/libwds/rtsp/clientrtpports.h b/chromium/third_party/wds/src/libwds/rtsp/clientrtpports.h
new file mode 100644
index 00000000000..532a5a4720e
--- /dev/null
+++ b/chromium/third_party/wds/src/libwds/rtsp/clientrtpports.h
@@ -0,0 +1,48 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+
+#ifndef LIBWDS_RTSP_CLIENTRTPPORTS_H_
+#define LIBWDS_RTSP_CLIENTRTPPORTS_H_
+
+#include "libwds/rtsp/property.h"
+
+namespace wds {
+namespace rtsp {
+
+class ClientRtpPorts: public Property {
+ public:
+ ClientRtpPorts(unsigned short rtp_port_0, unsigned short rtp_port_1);
+ ~ClientRtpPorts() override;
+
+ unsigned short rtp_port_0() const { return rtp_port_0_; }
+ unsigned short rtp_port_1() const { return rtp_port_1_; }
+ std::string ToString() const override;
+
+ private:
+ unsigned short rtp_port_0_;
+ unsigned short rtp_port_1_;
+};
+
+} // namespace rtsp
+} // namespace wds
+
+#endif // LIBWDS_RTSP_CLIENTRTPPORTS_H_
diff --git a/chromium/third_party/wds/src/libwds/rtsp/connectortype.cpp b/chromium/third_party/wds/src/libwds/rtsp/connectortype.cpp
new file mode 100644
index 00000000000..cc29596fd89
--- /dev/null
+++ b/chromium/third_party/wds/src/libwds/rtsp/connectortype.cpp
@@ -0,0 +1,64 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+
+#include "libwds/rtsp/connectortype.h"
+
+#include "libwds/rtsp/macros.h"
+
+namespace wds {
+namespace rtsp {
+
+ConnectorType::ConnectorType()
+ : Property(ConnectorTypePropertyType, true),
+ connector_type_() {
+}
+
+ConnectorType::ConnectorType(unsigned char connector_type)
+ : Property(ConnectorTypePropertyType),
+ connector_type_(connector_type) {
+}
+
+ConnectorType::ConnectorType(wds::ConnectorType connector_type)
+ : Property(ConnectorTypePropertyType, connector_type == wds::ConnectorTypeNone) {
+ connector_type_ = is_none() ? 0 // Ignored.
+ : static_cast<unsigned char>(connector_type);
+}
+
+ConnectorType::~ConnectorType() {
+}
+
+std::string ConnectorType::ToString() const {
+ std::string ret = PropertyName::wfd_connector_type + std::string(SEMICOLON)
+ + std::string(SPACE);
+
+ if (is_none()) {
+ ret += NONE;
+ } else {
+ MAKE_HEX_STRING_2(connector_type, connector_type_);
+ ret += connector_type;
+ }
+
+ return ret;
+}
+
+} // namespace rtsp
+} // namespace wds
diff --git a/chromium/third_party/wds/src/libwds/rtsp/connectortype.h b/chromium/third_party/wds/src/libwds/rtsp/connectortype.h
new file mode 100644
index 00000000000..85636517aaf
--- /dev/null
+++ b/chromium/third_party/wds/src/libwds/rtsp/connectortype.h
@@ -0,0 +1,48 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+
+#ifndef LIBWDS_RTSP_CONNECTORTYPE_H_
+#define LIBWDS_RTSP_CONNECTORTYPE_H_
+
+#include "libwds/public/connector_type.h"
+#include "libwds/rtsp/property.h"
+
+namespace wds {
+namespace rtsp {
+
+class ConnectorType: public Property {
+ public:
+ ConnectorType();
+ explicit ConnectorType(unsigned char connector_type);
+ explicit ConnectorType(wds::ConnectorType connector_type);
+ ~ConnectorType() override;
+
+ unsigned char connector_type() const { return connector_type_; }
+ std::string ToString() const override;
+
+ private:
+ unsigned char connector_type_;
+};
+
+} // namespace rtsp
+} // namespace wds
+#endif // LIBWDS_RTSP_CONNECTORTYPE_H_
diff --git a/chromium/third_party/wds/src/libwds/rtsp/constants.h b/chromium/third_party/wds/src/libwds/rtsp/constants.h
new file mode 100644
index 00000000000..20e83b573cd
--- /dev/null
+++ b/chromium/third_party/wds/src/libwds/rtsp/constants.h
@@ -0,0 +1,122 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+
+#ifndef LIBWDS_RTSP_CONSTANTS_H_
+#define LIBWDS_RTSP_CONSTANTS_H_
+
+namespace wds {
+namespace rtsp {
+
+const char SEMICOLON[] = ":";
+const char SPACE[] = " ";
+const char NONE[] = "none";
+const char CRLF[] = "\r\n";
+const char RTSP_END[] = "RTSP/1.0";
+
+enum PropertyType {
+ AVFormatChangeTimingPropertyType,
+ AudioCodecsPropertyType,
+ ClientRTPPortsPropertyType,
+ ConnectorTypePropertyType,
+ ContentProtectionPropertyType,
+ CoupledSinkPropertyType,
+ DisplayEdidPropertyType,
+ GenericPropertyType,
+ I2CPropertyType,
+ IDRRequestPropertyType,
+ PreferredDisplayModePropertyType,
+ PresentationURLPropertyType,
+ RoutePropertyType,
+ StandbyPropertyType,
+ StandbyResumeCapabilityPropertyType,
+ TriggerMethodPropertyType,
+ UIBCCapabilityPropertyType,
+ UIBCSettingPropertyType,
+ Video3DFormatsPropertyType,
+ VideoFormatsPropertyType
+};
+
+namespace PropertyName {
+ const char wfd_audio_codecs[] = "wfd_audio_codecs";
+ const char wfd_video_formats[] = "wfd_video_formats";
+ const char wfd_3d_video_formats[] = "wfd_3d_video_formats";
+ const char wfd_content_protection[] = "wfd_content_protection";
+ const char wfd_display_edid[] = "wfd_display_edid";
+ const char wfd_coupled_sink[] = "wfd_coupled_sink";
+ const char wfd_trigger_method[] = "wfd_trigger_method";
+ const char wfd_presentation_url[] = "wfd_presentation_URL";
+ const char wfd_client_rtp_ports[] = "wfd_client_rtp_ports";
+ const char wfd_route[] = "wfd_route";
+ const char wfd_I2C[] = "wfd_I2C";
+ const char wfd_av_format_change_timing[] = "wfd_av_format_change_timing";
+ const char wfd_preferred_display_mode[] = "wfd_preferred_display_mode";
+ const char wfd_uibc_capability[] = "wfd_uibc_capability";
+ const char wfd_uibc_setting[] = "wfd_uibc_setting";
+ const char wfd_standby_resume_capability[] = "wfd_standby_resume_capability";
+ const char wfd_standby[] = "wfd_standby";
+ const char wfd_connector_type[] = "wfd_connector_type";
+ const char wfd_idr_request[] = "wfd_idr_request";
+} // namespace PropertyName
+
+enum Method {
+ OPTIONS,
+ SET_PARAMETER,
+ GET_PARAMETER,
+ SETUP,
+ PLAY,
+ TEARDOWN,
+ PAUSE,
+ ORG_WFA_WFD_1_0
+};
+
+namespace MethodName {
+ const char OPTIONS[] = "OPTIONS";
+ const char SET_PARAMETER[] = "SET_PARAMETER";
+ const char GET_PARAMETER[] = "GET_PARAMETER";
+ const char SETUP[] = "SETUP";
+ const char PLAY[] = "PLAY";
+ const char TEARDOWN[] = "TEARDOWN";
+ const char PAUSE[] = "PAUSE";
+ const char ORG_WFA_WFD1_0[] = "org.wfa.wfd1.0";
+
+ const char* const name[] = { OPTIONS,
+ SET_PARAMETER,
+ GET_PARAMETER,
+ SETUP,
+ PLAY,
+ TEARDOWN,
+ PAUSE,
+ ORG_WFA_WFD1_0 };
+}
+
+enum RTSPStatusCode {
+ STATUS_OK = 200,
+ STATUS_SeeOther = 303,
+ STATUS_NotAcceptable = 406,
+ STATUS_UnsupportedMediaType = 415,
+ STATUS_NotImplemented = 501
+};
+
+} // namespace rtsp
+} // namespace wds
+
+#endif // LIBWDS_RTSP_CONSTANTS_H_
diff --git a/chromium/third_party/wds/src/libwds/rtsp/contentprotection.cpp b/chromium/third_party/wds/src/libwds/rtsp/contentprotection.cpp
new file mode 100644
index 00000000000..e9c1ef732d7
--- /dev/null
+++ b/chromium/third_party/wds/src/libwds/rtsp/contentprotection.cpp
@@ -0,0 +1,67 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+
+#include "libwds/rtsp/contentprotection.h"
+
+#include <assert.h>
+
+namespace wds {
+namespace rtsp {
+
+namespace {
+ const char* name[] = {"HDCP2.0", "HDCP2.1"};
+ const char port_prefix[] = "port=";
+}
+
+ContentProtection::ContentProtection(HDCPSpec hdcp_spec, unsigned int port)
+ : Property (ContentProtectionPropertyType),
+ hdcp_spec_(hdcp_spec),
+ port_(port) {
+}
+
+ContentProtection::ContentProtection(): Property (ContentProtectionPropertyType, true) {
+}
+
+ContentProtection::~ContentProtection() {
+}
+
+ContentProtection::HDCPSpec ContentProtection::hdcp_spec() const {
+ assert(hdcp_spec_ != HDCP_SPEC_2_0
+ || hdcp_spec_ != HDCP_SPEC_2_1);
+ return hdcp_spec_;
+}
+
+std::string ContentProtection::ToString() const {
+ std::string ret =
+ PropertyName::wfd_content_protection
+ + std::string(SEMICOLON) + std::string(SPACE);
+
+ if (is_none())
+ ret += NONE;
+ else
+ ret += name[hdcp_spec()] + std::string(SPACE)
+ + port_prefix + std::to_string(port_);
+ return ret;
+}
+
+} // namespace rtsp
+} // namespace wds
diff --git a/chromium/third_party/wds/src/libwds/rtsp/contentprotection.h b/chromium/third_party/wds/src/libwds/rtsp/contentprotection.h
new file mode 100644
index 00000000000..e2063f925e8
--- /dev/null
+++ b/chromium/third_party/wds/src/libwds/rtsp/contentprotection.h
@@ -0,0 +1,55 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+
+#ifndef LIBWDS_RTSP_CONTENTPROTECTION_H_
+#define LIBWDS_RTSP_CONTENTPROTECTION_H_
+
+#include "libwds/rtsp/property.h"
+
+namespace wds {
+namespace rtsp {
+
+class ContentProtection: public Property {
+ public:
+ enum HDCPSpec {
+ HDCP_SPEC_2_0,
+ HDCP_SPEC_2_1
+ };
+
+ public:
+ ContentProtection();
+ ContentProtection(HDCPSpec hdcp_spec, unsigned int port);
+ ~ContentProtection() override;
+
+ HDCPSpec hdcp_spec() const;
+ unsigned int port() const { return port_; }
+ std::string ToString() const override;
+
+ private:
+ HDCPSpec hdcp_spec_;
+ unsigned int port_;
+};
+
+} // namespace rtsp
+} // namespace wds
+
+#endif // LIBWDS_RTSP_CONTENTPROTECTION_H_
diff --git a/chromium/third_party/wds/src/libwds/rtsp/coupledsink.cpp b/chromium/third_party/wds/src/libwds/rtsp/coupledsink.cpp
new file mode 100644
index 00000000000..a94bb8f299c
--- /dev/null
+++ b/chromium/third_party/wds/src/libwds/rtsp/coupledsink.cpp
@@ -0,0 +1,67 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+
+#include "libwds/rtsp/coupledsink.h"
+
+#include <climits>
+#include "libwds/rtsp/macros.h"
+
+namespace wds {
+namespace rtsp {
+
+CoupledSink::CoupledSink(unsigned char status,
+ unsigned long long int sink_address)
+ : Property(CoupledSinkPropertyType),
+ status_(status),
+ sink_address_(sink_address) {
+}
+
+CoupledSink::CoupledSink(): Property(CoupledSinkPropertyType, true){
+}
+
+CoupledSink::~CoupledSink(){
+}
+
+std::string CoupledSink::ToString() const {
+ std::string ret =
+ PropertyName::wfd_coupled_sink + std::string(SEMICOLON)
+ + std::string(SPACE);
+
+ if (is_none()) {
+ ret += NONE;
+ } else {
+ MAKE_HEX_STRING_2(status, status_);
+ ret += status + std::string(SPACE);
+
+ if (sink_address_ != ULLONG_MAX) {
+ MAKE_HEX_STRING_12(sink_address, sink_address_);
+ ret += sink_address;
+ } else {
+ ret += NONE;
+ }
+ }
+
+ return ret;
+}
+
+} // namespace rtsp
+} // namespace wds
diff --git a/chromium/third_party/wds/src/libwds/rtsp/coupledsink.h b/chromium/third_party/wds/src/libwds/rtsp/coupledsink.h
new file mode 100644
index 00000000000..33ee9c79568
--- /dev/null
+++ b/chromium/third_party/wds/src/libwds/rtsp/coupledsink.h
@@ -0,0 +1,49 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+
+#ifndef LIBWDS_RTSP_COUPLEDSINK_H_
+#define LIBWDS_RTSP_COUPLEDSINK_H_
+
+#include "libwds/rtsp/property.h"
+
+namespace wds {
+namespace rtsp {
+
+class CoupledSink: public Property {
+ public:
+ CoupledSink();
+ CoupledSink(unsigned char status, unsigned long long int sink_address);
+ ~CoupledSink() override;
+
+ unsigned char status() const { return status_; }
+ unsigned long long int sink_address() const { return sink_address_; }
+ std::string ToString() const override;
+
+ private:
+ unsigned short status_;
+ unsigned long long int sink_address_;
+};
+
+} // namespace rtsp
+} // namespace wds
+
+#endif // LIBWDS_RTSP_COUPLEDSINK_H_
diff --git a/chromium/third_party/wds/src/libwds/rtsp/displayedid.cpp b/chromium/third_party/wds/src/libwds/rtsp/displayedid.cpp
new file mode 100644
index 00000000000..48cbe67cf81
--- /dev/null
+++ b/chromium/third_party/wds/src/libwds/rtsp/displayedid.cpp
@@ -0,0 +1,60 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+
+#include "libwds/rtsp/displayedid.h"
+
+#include "libwds/rtsp/macros.h"
+
+namespace wds {
+namespace rtsp {
+
+DisplayEdid::DisplayEdid(): Property(DisplayEdidPropertyType, true) {
+}
+
+DisplayEdid::DisplayEdid(unsigned short edid_block_count,
+ const std::string& edid_payload)
+ : Property(DisplayEdidPropertyType),
+ edid_block_count_(edid_block_count),
+ edid_payload_(edid_payload.length() ? edid_payload : NONE) {
+}
+
+DisplayEdid::~DisplayEdid() {
+}
+
+std::string DisplayEdid::ToString() const {
+
+ std::string ret =
+ PropertyName::wfd_display_edid + std::string(SEMICOLON)
+ + std::string(SPACE);
+
+ if (is_none()) {
+ ret += NONE;
+ } else {
+ MAKE_HEX_STRING_2(edid_block_count, edid_block_count_);
+ ret += edid_block_count + std::string(SPACE) + edid_payload_;
+ }
+
+ return ret;
+}
+
+} // namespace rtsp
+} // namespace wds
diff --git a/chromium/third_party/wds/src/libwds/rtsp/displayedid.h b/chromium/third_party/wds/src/libwds/rtsp/displayedid.h
new file mode 100644
index 00000000000..b625d173a51
--- /dev/null
+++ b/chromium/third_party/wds/src/libwds/rtsp/displayedid.h
@@ -0,0 +1,49 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+
+#ifndef LIBWDS_RTSP_DISPLAYEDID_H_
+#define LIBWDS_RTSP_DISPLAYEDID_H_
+
+#include "libwds/rtsp/property.h"
+
+namespace wds {
+namespace rtsp {
+
+class DisplayEdid: public Property {
+ public:
+ DisplayEdid();
+ DisplayEdid(unsigned short edid_block_count, const std::string& edid_payload);
+ ~DisplayEdid() override;
+
+ unsigned short block_count() const { return edid_block_count_; }
+ const std::string& payload() const { return edid_payload_; }
+ std::string ToString() const override;
+
+ private:
+ unsigned short edid_block_count_;
+ std::string edid_payload_;
+};
+
+} // namespace rtsp
+} // namespace wds
+
+#endif // LIBWDS_RTSP_DISPLAYEDID_H_
diff --git a/chromium/third_party/wds/src/libwds/rtsp/driver.cpp b/chromium/third_party/wds/src/libwds/rtsp/driver.cpp
new file mode 100644
index 00000000000..a085912159b
--- /dev/null
+++ b/chromium/third_party/wds/src/libwds/rtsp/driver.cpp
@@ -0,0 +1,102 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+
+#include "libwds/rtsp/driver.h"
+
+#include <cctype>
+#include <sstream>
+
+#include "libwds/public/logging.h"
+#include "libwds/rtsp/message.h"
+#include "libwds/rtsp/reply.h"
+
+#include "errorscanner.h"
+#include "headerscanner.h"
+#include "messagescanner.h"
+
+int wds_lex(YYSTYPE* yylval, void* scanner,
+ std::unique_ptr<wds::rtsp::Message>& message) {
+ if (!message) {
+ return header_lex(yylval, scanner);
+ } else if (message->is_reply()) {
+ wds::rtsp::Reply* reply = static_cast<wds::rtsp::Reply*>(message.get());
+ if (reply->response_code() == wds::rtsp::STATUS_SeeOther)
+ return error_lex(yylval, scanner);
+
+ return message_lex(yylval, scanner);
+ }
+
+ return message_lex(yylval, scanner);
+}
+
+void wds_error(void* scanner, std::unique_ptr<wds::rtsp::Message>& message,
+ const char* error_message) {
+ WDS_ERROR("Parser error: %s", error_message);
+ message.reset(nullptr);
+}
+
+namespace wds {
+namespace rtsp {
+
+void Driver::Parse(const std::string& input, std::unique_ptr<Message>& message) {
+ void* scanner = nullptr;
+#if YYDEBUG
+ bool enable_debug = true;
+ wds_debug = 1;
+#else
+ bool enable_debug = false;
+#endif
+
+ if (!message) {
+ header_lex_init(&scanner);
+ header_set_debug(enable_debug, scanner);
+ header__scan_string(input.c_str(), scanner);
+ wds_parse(scanner, message);
+ header_lex_destroy(scanner);
+ } else if (message->is_reply()) {
+ Reply* reply = static_cast<Reply*>(message.get());
+ if (reply->response_code() == STATUS_SeeOther) {
+ error_lex_init(&scanner);
+ error_set_debug(enable_debug, scanner);
+ error__scan_string(input.c_str(), scanner);
+ wds_parse(scanner, message);
+ error_lex_destroy(scanner);
+ } else {
+ message_lex_init(&scanner);
+ message_set_debug(enable_debug, scanner);
+ message_set_extra(message->is_reply(), scanner);
+ message__scan_string(input.c_str(), scanner);
+ wds_parse(scanner, message);
+ message_lex_destroy(scanner);
+ }
+ } else {
+ message_lex_init(&scanner);
+ message_set_debug(enable_debug, scanner);
+ message__scan_string(input.c_str(), scanner);
+ wds_parse(scanner, message);
+ message_lex_destroy(scanner);
+ }
+}
+
+} // namespace rtsp
+} // namespace wds
+
diff --git a/chromium/third_party/wds/src/libwds/rtsp/driver.h b/chromium/third_party/wds/src/libwds/rtsp/driver.h
new file mode 100644
index 00000000000..c5b32ecb904
--- /dev/null
+++ b/chromium/third_party/wds/src/libwds/rtsp/driver.h
@@ -0,0 +1,48 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+
+#ifndef LIBWDS_RTSP_DRIVER_H_
+#define LIBWDS_RTSP_DRIVER_H_
+
+#include <string>
+#include <memory>
+
+#include "parser.h"
+
+namespace wds {
+namespace rtsp {
+
+class Message;
+
+class Driver {
+ public:
+ static void Parse(const std::string& input, std::unique_ptr<Message>& message /*out*/);
+};
+
+} // namespace rtsp
+} // namespace wds
+
+// Required by bison.
+int wds_lex(YYSTYPE* yylval, void* scanner, std::unique_ptr<wds::rtsp::Message>& message);
+void wds_error (void* scanner, std::unique_ptr<wds::rtsp::Message>& message, const char* error_message);
+
+#endif // LIBWDS_RTSP_DRIVER_H_
diff --git a/chromium/third_party/wds/src/libwds/rtsp/errorlexer.l b/chromium/third_party/wds/src/libwds/rtsp/errorlexer.l
new file mode 100644
index 00000000000..3dac7693dd5
--- /dev/null
+++ b/chromium/third_party/wds/src/libwds/rtsp/errorlexer.l
@@ -0,0 +1,155 @@
+%option nodefault nounput nomain
+%option bison-bridge reentrant noyywrap
+%option never-interactive
+%option warn stack noyy_top_state noyy_pop_state noyy_push_state
+%option case-insensitive
+%option extra-type="bool"
+%option outfile="gen/errorscanner.cpp" header-file="gen/errorscanner.h"
+
+%top{
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2015 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+#include <stdint.h>
+
+#define YY_NO_UNISTD_H 1
+}
+
+%{
+#include <string>
+
+#include "parser.h"
+
+#define yyterminate() return(END)
+%}
+
+DIGITS [0-9]+
+SP [ \t]
+CR [\r]
+LF [\n]
+CRLF {CR}{LF}
+
+%%
+ /* skip these */
+{CRLF} { }
+{LF} { }
+{CR} { }
+
+ /* Convert these */
+"," { return ','; }
+":" { return ':'; }
+
+{SP}+ return WFD_SP;
+
+^"wfd_audio_codecs" {
+ return WFD_AUDIO_CODECS_ERROR;
+ }
+
+^"wfd_video_formats" {
+ return WFD_VIDEO_FORMATS_ERROR;
+ }
+
+^"wfd_3d_video_formats" {
+ return WFD_3D_FORMATS_ERROR;
+ }
+
+^"wfd_content_protection" {
+ return WFD_CONTENT_PROTECTION_ERROR;
+ }
+
+^"wfd_display_edid" {
+ return WFD_DISPLAY_EDID_ERROR;
+ }
+
+^"wfd_coupled_sink" {
+ return WFD_COUPLED_SINK_ERROR;
+ }
+
+^"wfd_trigger_method" {
+ return WFD_TRIGGER_METHOD_ERROR;
+ }
+
+^"wfd_presentation_url" {
+ return WFD_PRESENTATION_URL_ERROR;
+ }
+
+^"wfd_client_rtp_ports" {
+ return WFD_CLIENT_RTP_PORTS_ERROR;
+ }
+
+^"wfd_route" {
+ return WFD_ROUTE_ERROR;
+ }
+
+^"wfd_I2C" {
+ return WFD_I2C_ERROR;
+ }
+
+^"wfd_av_format_change_timing" {
+ return WFD_AV_FORMAT_CHANGE_TIMING_ERROR;
+ }
+
+^"wfd_preferred_display_mode" {
+ return WFD_PREFERRED_DISPLAY_MODE_ERROR;
+ }
+
+^"wfd_uibc_capability" {
+ return WFD_UIBC_CAPABILITY_ERROR;
+ }
+
+^"wfd_uibc_setting" {
+ return WFD_UIBC_SETTING_ERROR;
+ }
+
+^"wfd_standby_resume_capability" {
+ return WFD_STANDBY_RESUME_CAPABILITY_ERROR;
+ }
+
+^"wfd_standby" {
+ return WFD_STANDBY_ERROR;
+ }
+
+^"wfd_connector_type" {
+ return WFD_CONNECTOR_TYPE_ERROR;
+ }
+
+^"wfd_idr_request" {
+ return WFD_IDR_REQUEST_ERROR;
+ }
+
+^[[:alpha:]][[:alnum:]\-\_]* {
+ yylval->sval = new std::string(yytext, yyleng);
+ return WFD_GENERIC_PROPERTY_ERROR;
+ }
+
+{DIGITS} {
+ std::string str(yytext, yyleng);
+ str += '\0';
+ errno = 0;
+ yylval->nval = strtoull(str.c_str(), NULL, 10);
+ if (errno)
+ yyterminate();
+ return WFD_NUM;
+ }
+
+ /* all unmatched */
+<*>. {}
+%%
diff --git a/chromium/third_party/wds/src/libwds/rtsp/formats3d.cpp b/chromium/third_party/wds/src/libwds/rtsp/formats3d.cpp
new file mode 100644
index 00000000000..37b390df6a9
--- /dev/null
+++ b/chromium/third_party/wds/src/libwds/rtsp/formats3d.cpp
@@ -0,0 +1,110 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+
+#include "libwds/rtsp/formats3d.h"
+
+#include "libwds/rtsp/macros.h"
+
+namespace wds {
+namespace rtsp {
+
+Formats3d::Formats3d() : Property(Video3DFormatsPropertyType, true) {
+}
+
+Formats3d::Formats3d(unsigned char native,
+ unsigned char preferred_display_mode,
+ const H264Codecs3d& h264_codecs_3d)
+ : Property(Video3DFormatsPropertyType),
+ native_(native),
+ preferred_display_mode_(preferred_display_mode),
+ h264_codecs_3d_(h264_codecs_3d) {
+}
+
+Formats3d::~Formats3d() {
+ // TODO Auto-generated destructor stub
+}
+
+std::string H264Codec3d::ToString() const {
+ std::string ret;
+ MAKE_HEX_STRING_2(profile, profile_);
+ MAKE_HEX_STRING_2(level, level_);
+ MAKE_HEX_STRING_16(video_capability_3d, video_capability_3d_);
+ MAKE_HEX_STRING_2(latency,latency_);
+ MAKE_HEX_STRING_4(min_slice_size, min_slice_size_);
+ MAKE_HEX_STRING_4(slice_enc_params, slice_enc_params_);
+ MAKE_HEX_STRING_2(frame_rate_control_support, frame_rate_control_support_);
+
+ ret = profile + std::string(SPACE)
+ + level + std::string(SPACE)
+ + video_capability_3d + std::string(SPACE)
+ + latency + std::string(SPACE)
+ + min_slice_size + std::string(SPACE)
+ + slice_enc_params + std::string(SPACE)
+ + frame_rate_control_support + std::string(SPACE);
+
+ if (max_hres_ > 0) {
+ MAKE_HEX_STRING_4(max_hres, max_hres_);
+ ret += max_hres;
+ } else {
+ ret += NONE;
+ }
+ ret += std::string(SPACE);
+
+ if (max_vres_ > 0) {
+ MAKE_HEX_STRING_4(max_vres, max_vres_);
+ ret += max_vres;
+ } else {
+ ret += NONE;
+ }
+
+ return ret;
+}
+
+std::string Formats3d::ToString() const {
+ std::string ret;
+
+ ret = PropertyName::wfd_3d_video_formats
+ + std::string(SEMICOLON)+ std::string(SPACE);
+
+ if (is_none())
+ return ret + NONE;
+
+ MAKE_HEX_STRING_2(native, native_);
+ MAKE_HEX_STRING_2(preferred_display_mode, preferred_display_mode_);
+
+ ret += native + std::string(SPACE)
+ + preferred_display_mode + std::string(SPACE);
+
+ auto it = h264_codecs_3d_.begin();
+ auto end = h264_codecs_3d_.end();
+ while(it != end) {
+ ret += (*it).ToString();
+ ++it;
+ if (it != end)
+ ret += ", ";
+ }
+
+ return ret;
+}
+
+} // namespace rtsp
+} // namespace wds
diff --git a/chromium/third_party/wds/src/libwds/rtsp/formats3d.h b/chromium/third_party/wds/src/libwds/rtsp/formats3d.h
new file mode 100644
index 00000000000..91626cad907
--- /dev/null
+++ b/chromium/third_party/wds/src/libwds/rtsp/formats3d.h
@@ -0,0 +1,90 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+
+#ifndef LIBWDS_RTSP_FORMATS3D_H_
+#define LIBWDS_RTSP_FORMATS3D_H_
+
+#include "libwds/rtsp/property.h"
+
+#include <vector>
+
+namespace wds {
+namespace rtsp {
+
+// todo(shalamov): refactor, looks almost similar to VideoFormats
+
+struct H264Codec3d {
+ public:
+ H264Codec3d(unsigned char profile, unsigned char level,
+ unsigned long long int video_capability_3d, unsigned char latency,
+ unsigned short min_slice_size, unsigned short slice_enc_params,
+ unsigned char frame_rate_control_support,
+ unsigned short max_hres, unsigned short max_vres)
+ : profile_(profile),
+ level_(level),
+ video_capability_3d_(video_capability_3d),
+ latency_(latency),
+ min_slice_size_(min_slice_size),
+ slice_enc_params_(slice_enc_params),
+ frame_rate_control_support_(frame_rate_control_support),
+ max_hres_(max_hres),
+ max_vres_(max_vres) {}
+
+ std::string ToString() const;
+
+ unsigned char profile_;
+ unsigned char level_;
+ unsigned long long int video_capability_3d_;
+ unsigned char latency_;
+ unsigned short min_slice_size_;
+ unsigned short slice_enc_params_;
+ unsigned char frame_rate_control_support_;
+ unsigned short max_hres_;
+ unsigned short max_vres_;
+};
+
+typedef std::vector<H264Codec3d> H264Codecs3d;
+
+class Formats3d: public Property {
+ public:
+ Formats3d();
+ Formats3d(unsigned char native,
+ unsigned char preferred_display_mode,
+ const H264Codecs3d& h264_codecs_3d);
+ ~Formats3d() override;
+
+ unsigned char native_resolution() const { return native_; }
+ unsigned char preferred_display_mode() const { return preferred_display_mode_;}
+ const H264Codecs3d& codecs() const { return h264_codecs_3d_; }
+
+ std::string ToString() const override;
+
+ private:
+ unsigned char native_;
+ unsigned char preferred_display_mode_;
+ H264Codecs3d h264_codecs_3d_;
+};
+
+} // namespace rtsp
+} // namespace wds
+
+#endif // LIBWDS_RTSP_FORMATS3D_H_
diff --git a/chromium/third_party/wds/src/libwds/rtsp/genericproperty.cpp b/chromium/third_party/wds/src/libwds/rtsp/genericproperty.cpp
new file mode 100644
index 00000000000..f998202729d
--- /dev/null
+++ b/chromium/third_party/wds/src/libwds/rtsp/genericproperty.cpp
@@ -0,0 +1,51 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+
+#include <string>
+
+#include "libwds/rtsp/genericproperty.h"
+
+namespace wds {
+namespace rtsp {
+
+GenericProperty::GenericProperty() : Property(GenericPropertyType) {
+}
+
+GenericProperty::GenericProperty(const std::string& key, const std::string& value)
+ : Property(GenericPropertyType),
+ key_(key),
+ value_(value) {
+}
+
+GenericProperty::~GenericProperty() {
+}
+
+std::string GenericProperty::ToString() const {
+ return key_ + ": " + value_;
+}
+
+std::string GenericProperty::GetName() const {
+ return key_;
+}
+
+} // namespace rtsp
+} // namespace wds
diff --git a/chromium/third_party/wds/src/libwds/rtsp/genericproperty.h b/chromium/third_party/wds/src/libwds/rtsp/genericproperty.h
new file mode 100644
index 00000000000..8b1466e86e7
--- /dev/null
+++ b/chromium/third_party/wds/src/libwds/rtsp/genericproperty.h
@@ -0,0 +1,52 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+
+#ifndef LIBWDS_RTSP_GENERIC_PROPERTY_H_
+#define LIBWDS_RTSP_GENERIC_PROPERTY_H_
+
+#include "libwds/rtsp/property.h"
+
+namespace wds {
+namespace rtsp {
+
+class GenericProperty: public Property {
+ public:
+ GenericProperty();
+ GenericProperty(const std::string& key, const std::string& value);
+
+ ~GenericProperty() override;
+
+ const std::string& key() const { return key_; }
+ const std::string& value() const { return value_; }
+
+ std::string ToString() const override;
+ std::string GetName() const override;
+
+ private:
+ std::string key_;
+ std::string value_;
+};
+
+} // namespace rtsp
+} // namespace wds
+
+#endif // LIBWDS_RTSP_GENERIC_PROPERTY_H_
diff --git a/chromium/third_party/wds/src/libwds/rtsp/getparameter.cpp b/chromium/third_party/wds/src/libwds/rtsp/getparameter.cpp
new file mode 100644
index 00000000000..cb6e7f763a6
--- /dev/null
+++ b/chromium/third_party/wds/src/libwds/rtsp/getparameter.cpp
@@ -0,0 +1,43 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+
+#include "libwds/rtsp/getparameter.h"
+
+namespace wds {
+namespace rtsp {
+
+GetParameter::GetParameter(const std::string& request_uri)
+ : Request(Request::MethodGetParameter, request_uri) {
+}
+
+GetParameter::~GetParameter() {
+}
+
+std::string GetParameter::ToString() const {
+ std::string ret = MethodName::GET_PARAMETER
+ + std::string(SPACE) + request_uri()
+ + std::string(SPACE) + std::string(RTSP_END) + std::string(CRLF);
+ return ret + Message::ToString();
+}
+
+} // namespace rtsp
+} // namespace wds
diff --git a/chromium/third_party/wds/src/libwds/rtsp/getparameter.h b/chromium/third_party/wds/src/libwds/rtsp/getparameter.h
new file mode 100644
index 00000000000..d99aa5d759c
--- /dev/null
+++ b/chromium/third_party/wds/src/libwds/rtsp/getparameter.h
@@ -0,0 +1,41 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+
+#ifndef LIBWDS_RTSP_GETPARAMETER_H_
+#define LIBWDS_RTSP_GETPARAMETER_H_
+
+#include "libwds/rtsp/message.h"
+
+namespace wds {
+namespace rtsp {
+
+class GetParameter : public Request {
+ public:
+ explicit GetParameter(const std::string& request_uri);
+ ~GetParameter() override;
+ std::string ToString() const override;
+};
+
+} // namespace rtsp
+} // namespace wds
+
+#endif // LIBWDS_RTSP_GETPARAMETER_H_
diff --git a/chromium/third_party/wds/src/libwds/rtsp/header.cpp b/chromium/third_party/wds/src/libwds/rtsp/header.cpp
new file mode 100644
index 00000000000..ffbd2fba626
--- /dev/null
+++ b/chromium/third_party/wds/src/libwds/rtsp/header.cpp
@@ -0,0 +1,177 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+
+#include "libwds/rtsp/header.h"
+
+#include <algorithm>
+
+namespace wds {
+namespace rtsp {
+
+namespace {
+ const char kContentLenght[] = "Content-Length: ";
+ const char kContentType[] = "Content-Type: ";
+ const char kContentLength[] = "Content-Length: ";
+ const char kCSeq[] = "CSeq: ";
+ const char kSession[] = "Session: ";
+ const char kTimeout[] = ";timeout=";
+ const char kPublic[] = "Public: ";
+ const char kRequire[] = "Require: org.wfa.wfd1.0";
+}
+
+Header::Header() :
+ cseq_(0),
+ content_length_(0),
+ timeout_(0),
+ require_wfd_support_(false) {
+}
+
+Header::~Header() {
+}
+
+int Header::cseq() const {
+ return cseq_;
+}
+
+void Header::set_cseq(int cseq) {
+ cseq_ = cseq;
+}
+
+int Header::content_length() const {
+ return content_length_;
+}
+
+void Header::set_content_length(int content_length) {
+ content_length_ = content_length;
+}
+
+const std::string& Header::content_type() const {
+ return content_type_;
+}
+
+void Header::set_content_type(const std::string& content_type) {
+ content_type_ = content_type;
+}
+
+const std::string& Header::session() const {
+ return session_;
+}
+
+void Header::set_session(const std::string& session) {
+ session_ = session;
+}
+
+unsigned int Header::timeout() const {
+ return timeout_;
+}
+
+void Header::set_timeout(int timeout) {
+ timeout_ = timeout;
+}
+
+TransportHeader& Header::transport() const {
+ if (!transport_)
+ transport_.reset(new TransportHeader());
+ return *transport_;
+}
+
+void Header::set_transport(TransportHeader* transport) {
+ transport_.reset(transport);
+}
+
+bool Header::require_wfd_support() const {
+ return require_wfd_support_;
+}
+
+void Header::set_require_wfd_support(bool require_wfd_support) {
+ require_wfd_support_ = require_wfd_support;
+}
+
+const std::vector<Method>& Header::supported_methods() const {
+ return supported_methods_;
+}
+
+void Header::add_generic_header(const std::string& key ,const std::string& value) {
+ generic_headers_[key] = value;
+}
+
+const GenericHeaderMap& Header::generic_headers() const {
+ return generic_headers_;
+}
+
+void Header::set_supported_methods(
+ const std::vector<Method>& supported_methods) {
+ supported_methods_ = supported_methods;
+}
+
+bool Header::has_method(const Method& method) const {
+ return std::find (supported_methods_.begin(),
+ supported_methods_.end(),
+ method) != supported_methods_.end();
+}
+
+std::string Header::ToString() const {
+ std::string ret;
+
+ ret += kCSeq + std::to_string(cseq_) + CRLF;
+
+ if (!session_.empty()) {
+ if (timeout_ > 0)
+ ret += kSession + session_
+ + kTimeout + std::to_string(timeout_) + CRLF;
+ else
+ ret += kSession + session_ + CRLF;
+ }
+
+ if (content_type_.length())
+ ret += kContentType + content_type_ + CRLF;
+
+ if (content_length_)
+ ret += kContentLenght + std::to_string(content_length_) + CRLF;
+
+ ret += transport().ToString();
+
+ if (supported_methods_.size()) {
+ auto i = supported_methods_.begin();
+ auto end = supported_methods_.end();
+ ret += kPublic;
+ while (i != end) {
+ ret += MethodName::name[*i];
+ if (i != --supported_methods_.end()) {
+ ret += ", ";
+ }
+ ++i;
+ }
+ ret += CRLF;
+ }
+
+ if (require_wfd_support_)
+ ret += std::string(kRequire) + CRLF;
+
+ for (auto it = generic_headers_.begin(); it != generic_headers_.end(); it++)
+ ret += (*it).first + ": " + (*it).second + CRLF;
+
+ return ret + CRLF;
+}
+
+} // namespace rtsp
+} // namespace wds
diff --git a/chromium/third_party/wds/src/libwds/rtsp/header.h b/chromium/third_party/wds/src/libwds/rtsp/header.h
new file mode 100644
index 00000000000..e8a5f4eb152
--- /dev/null
+++ b/chromium/third_party/wds/src/libwds/rtsp/header.h
@@ -0,0 +1,89 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+
+#ifndef LIBWDS_RTSP_HEADER_H_
+#define LIBWDS_RTSP_HEADER_H_
+
+#include <string>
+#include <vector>
+#include <map>
+#include <memory>
+
+#include "libwds/rtsp/constants.h"
+#include "libwds/rtsp/transportheader.h"
+
+typedef std::map<std::string, std::string> GenericHeaderMap;
+
+namespace wds {
+namespace rtsp {
+
+class Header {
+ public:
+ Header();
+ virtual ~Header();
+
+ int cseq() const;
+ void set_cseq(int cseq);
+
+ int content_length() const;
+ void set_content_length(int content_length);
+
+ const std::string& content_type() const;
+ void set_content_type(const std::string& content_type);
+
+ const std::string& session() const;
+ void set_session(const std::string& session);
+
+ unsigned int timeout() const;
+ void set_timeout(int timeout);
+
+ TransportHeader& transport() const;
+ void set_transport(TransportHeader* transport);
+
+ bool require_wfd_support() const;
+ void set_require_wfd_support(bool require_wfd_support);
+
+ const std::vector<Method>& supported_methods() const;
+ void set_supported_methods(const std::vector<Method>& supported_methods);
+ bool has_method(const Method& method) const;
+
+ void add_generic_header(const std::string& key ,const std::string& value);
+ const GenericHeaderMap& generic_headers () const;
+
+ std::string ToString() const;
+
+ private:
+ int cseq_;
+ int content_length_;
+ unsigned int timeout_;
+ std::string session_;
+ mutable std::unique_ptr<TransportHeader> transport_;
+ std::string content_type_;
+ bool require_wfd_support_;
+ std::vector<Method> supported_methods_;
+ GenericHeaderMap generic_headers_;
+};
+
+} // namespace rtsp
+} // namespace wds
+
+#endif // LIBWDS_RTSP_HEADER_H_
diff --git a/chromium/third_party/wds/src/libwds/rtsp/headerlexer.l b/chromium/third_party/wds/src/libwds/rtsp/headerlexer.l
new file mode 100644
index 00000000000..52d38fef494
--- /dev/null
+++ b/chromium/third_party/wds/src/libwds/rtsp/headerlexer.l
@@ -0,0 +1,239 @@
+%option nodefault nounput nomain
+%option bison-bridge reentrant noyywrap
+%option never-interactive
+%option warn stack noyy_top_state noyy_pop_state noyy_push_state
+%option case-insensitive
+%option extra-type="bool"
+%option outfile="gen/headerscanner.cpp" header-file="gen/headerscanner.h"
+
+%top{
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2015 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+#include <stdint.h>
+
+#define YY_NO_UNISTD_H 1
+}
+
+%{
+#include <string>
+
+#include "parser.h"
+#define yyterminate() return(END)
+%}
+
+%x MATCH_STRING_STATE
+%x MATCH_RESPONSE_CODE_STATE
+
+%s SUPPORTED_METHODS_STATE
+%s CONTENT_TYPE_STATE
+%s SESSION_STATE
+
+DIGIT [0-9]
+DIGITS [0-9]+
+HEXDIG [0-9a-fA-F]
+HEXDIGITS [0-9a-fA-F]+
+SP [ \t]
+CR [\r]
+LF [\n]
+CRLF {CR}{LF}
+
+%%
+
+<*>{CRLF} { BEGIN(INITIAL); }
+<*>{LF} { BEGIN(INITIAL); }
+<*>{CR} { BEGIN(INITIAL); }
+
+ /* Convert these */
+"=" { return '='; }
+"-" { return '-'; }
+"," { return ','; }
+"\*" { return '*'; }
+";" { return ';'; }
+":" { return ':'; }
+"/" { return '/'; }
+
+{SP}+ return WFD_SP;
+
+";timeout=" return WFD_TIMEOUT;
+";server_port=" return WFD_SERVER_PORT;
+
+^(?-i:"OPTIONS") {
+ BEGIN(INITIAL);
+ return WFD_OPTIONS;
+ }
+
+^(?-i:"SET_PARAMETER") {
+ BEGIN(INITIAL);
+ return WFD_SET_PARAMETER;
+ }
+
+^(?-i:"GET_PARAMETER") {
+ BEGIN(INITIAL);
+ return WFD_GET_PARAMETER;
+ }
+
+^(?-i:"SETUP") {
+ BEGIN(INITIAL);
+ return WFD_SETUP;
+ }
+
+^(?-i:"PLAY") {
+ BEGIN(INITIAL);
+ return WFD_PLAY;
+ }
+
+^(?-i:"TEARDOWN") {
+ BEGIN(INITIAL);
+ return WFD_TEARDOWN;
+ }
+
+^(?-i:"PAUSE") {
+ BEGIN(INITIAL);
+ return WFD_PAUSE;
+ }
+
+ /* RTSP response, get reply code, RTSP/1.0 200 OK */
+^"RTSP/"{DIGIT}"."{DIGIT}{SP}+ {
+ BEGIN(MATCH_RESPONSE_CODE_STATE);
+ return WFD_RESPONSE;
+ }
+
+ /* CSeq: i */
+^"CSeq:" {
+ BEGIN(INITIAL);
+ return WFD_CSEQ;
+ }
+
+^"Public:" {
+ BEGIN(SUPPORTED_METHODS_STATE);
+ return WFD_RESPONSE_METHODS;
+ }
+
+^"Require: org.wfa.wfd1.0" {
+ return WFD_SUPPORT_CHECK;
+ }
+
+^"Content-Type:" {
+ BEGIN(CONTENT_TYPE_STATE);
+ return WFD_CONTENT_TYPE;
+ }
+
+^"Content-Length:" {
+ BEGIN(INITIAL);
+ return WFD_CONTENT_LENGTH;
+ }
+
+^"Session:" {
+ BEGIN(SESSION_STATE);
+ return WFD_SESSION;
+ }
+
+^"Transport: RTP/AVP/UDP;unicast;client_port=" {
+ return WFD_TRANSPORT;
+ }
+
+^[[:alpha:]][[:alnum:]\-\_]*":" {
+ BEGIN(MATCH_STRING_STATE);
+ yylval->sval = new std::string(yytext, yyleng - 1);
+ return WFD_HEADER;
+ }
+
+<SESSION_STATE>[^ ;\t\r\n]+ {
+ BEGIN(INITIAL);
+ yylval->sval = new std::string(yytext, yyleng);
+ return WFD_SESSION_ID;
+ }
+
+<MATCH_RESPONSE_CODE_STATE>{DIGITS} {
+ BEGIN(MATCH_STRING_STATE);
+ yylval->nval = atoi(yytext);
+ return WFD_RESPONSE_CODE;
+ }
+
+<MATCH_STRING_STATE>[^ \r\n][^\r\n]+/"\r\n" {
+ BEGIN(INITIAL);
+ yylval->sval = new std::string(yytext);
+ return WFD_STRING;
+ }
+
+<SUPPORTED_METHODS_STATE>"OPTIONS" {
+ return WFD_OPTIONS;
+ }
+
+<SUPPORTED_METHODS_STATE>"SET_PARAMETER" {
+ return WFD_SET_PARAMETER;
+ }
+
+<SUPPORTED_METHODS_STATE>"GET_PARAMETER" {
+ return WFD_GET_PARAMETER;
+ }
+
+<SUPPORTED_METHODS_STATE>"SETUP" {
+ return WFD_SETUP;
+ }
+
+<SUPPORTED_METHODS_STATE>"PLAY" {
+ return WFD_PLAY;
+ }
+
+<SUPPORTED_METHODS_STATE>"TEARDOWN" {
+ return WFD_TEARDOWN;
+ }
+
+<SUPPORTED_METHODS_STATE>"PAUSE" {
+ return WFD_PAUSE;
+ }
+
+<SUPPORTED_METHODS_STATE>"org.wfa.wfd1.0" {
+ return WFD_TAG;
+ }
+
+<CONTENT_TYPE_STATE>[-[:alnum:]]+\/[-[:alnum:]]+ {
+ BEGIN(INITIAL);
+ yylval->sval = new std::string(yytext);
+ return WFD_MIME;
+ }
+
+{DIGITS} {
+ std::string str(yytext, yyleng);
+ str += '\0';
+ errno = 0;
+ yylval->nval = strtoull(str.c_str(), NULL, 10);
+ if (errno)
+ yyterminate();
+ return WFD_NUM;
+ }
+
+ /* RTSP request rule, e.g., OPTIONS * RTSP/1.0 */
+"RTSP/"{DIGIT}"."{DIGIT} {
+ return WFD_END;
+ }
+
+ /* GET_PARAMETER rtsp://localhost/wfd1.0 RTSP/1.0 */
+"rtsp://"[^ \t\n]+ {
+ yylval->sval = new std::string(yytext);
+ return WFD_REQUEST_URI;
+ }
+
+ /* all unmatched */
+<*>. {}
+%%
diff --git a/chromium/third_party/wds/src/libwds/rtsp/i2c.cpp b/chromium/third_party/wds/src/libwds/rtsp/i2c.cpp
new file mode 100644
index 00000000000..48ac2beb67e
--- /dev/null
+++ b/chromium/third_party/wds/src/libwds/rtsp/i2c.cpp
@@ -0,0 +1,41 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+
+#include "libwds/rtsp/i2c.h"
+
+namespace wds {
+namespace rtsp {
+
+I2C::I2C(int port) : Property(I2CPropertyType), port_(port) {
+}
+
+I2C::~I2C() {
+}
+
+std::string I2C::ToString() const {
+ std::string ret = PropertyName::wfd_I2C + std::string(SEMICOLON)
+ + std::string(SPACE) + (is_supported() ? std::to_string(port()) : NONE);
+ return ret;
+}
+
+} // namespace rtsp
+} // namespace wds
diff --git a/chromium/third_party/wds/src/libwds/rtsp/i2c.h b/chromium/third_party/wds/src/libwds/rtsp/i2c.h
new file mode 100644
index 00000000000..35e7d0a518b
--- /dev/null
+++ b/chromium/third_party/wds/src/libwds/rtsp/i2c.h
@@ -0,0 +1,47 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+
+#ifndef LIBWDS_RTSP_I2C_H_
+#define LIBWDS_RTSP_I2C_H_
+
+#include "libwds/rtsp/property.h"
+
+namespace wds {
+namespace rtsp {
+
+class I2C: public Property {
+ public:
+ explicit I2C(int port);
+ ~I2C() override;
+
+ bool is_supported() const { return port_ > 0; }
+ int port() const { return port_; }
+ std::string ToString() const override;
+
+ private:
+ int port_;
+};
+
+} // namespace rtsp
+} // namespace wds
+
+#endif // LIBWDS_RTSP_I2C_H_
diff --git a/chromium/third_party/wds/src/libwds/rtsp/idrrequest.cpp b/chromium/third_party/wds/src/libwds/rtsp/idrrequest.cpp
new file mode 100644
index 00000000000..412736b97c9
--- /dev/null
+++ b/chromium/third_party/wds/src/libwds/rtsp/idrrequest.cpp
@@ -0,0 +1,39 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+
+#include "libwds/rtsp/idrrequest.h"
+
+namespace wds {
+namespace rtsp {
+
+IDRRequest::IDRRequest() : Property(IDRRequestPropertyType) {
+}
+
+IDRRequest::~IDRRequest() {
+}
+
+std::string IDRRequest::ToString() const {
+ return std::string("wfd_idr_request");
+}
+
+} // namespace rtsp
+} // namespace wds
diff --git a/chromium/third_party/wds/src/libwds/rtsp/idrrequest.h b/chromium/third_party/wds/src/libwds/rtsp/idrrequest.h
new file mode 100644
index 00000000000..b44ee863227
--- /dev/null
+++ b/chromium/third_party/wds/src/libwds/rtsp/idrrequest.h
@@ -0,0 +1,42 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+
+#ifndef LIBWDS_RTSP_IDRREQUEST_H_
+#define LIBWDS_RTSP_IDRREQUEST_H_
+
+#include "libwds/rtsp/property.h"
+
+namespace wds {
+namespace rtsp {
+
+class IDRRequest: public Property {
+public:
+ IDRRequest();
+ ~IDRRequest() override;
+
+ std::string ToString() const override;
+};
+
+} // namespace rtsp
+} // namespace wds
+
+#endif // LIBWDS_RTSP_IDRREQUEST_H_
diff --git a/chromium/third_party/wds/src/libwds/rtsp/macros.h b/chromium/third_party/wds/src/libwds/rtsp/macros.h
new file mode 100644
index 00000000000..4ae7654bee8
--- /dev/null
+++ b/chromium/third_party/wds/src/libwds/rtsp/macros.h
@@ -0,0 +1,57 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+
+#ifndef LIBWDS_RTSP_MACROS_H_
+#define LIBWDS_RTSP_MACROS_H_
+
+#include <stdio.h>
+
+#define MAKE_HEX_STRING_2(NAME, PROPERTY) \
+ char NAME[3]; \
+ std::snprintf(NAME, sizeof(NAME), "%02X", PROPERTY) \
+
+#define MAKE_HEX_STRING_4(NAME, PROPERTY) \
+ char NAME[5]; \
+ std::snprintf(NAME, sizeof(NAME), "%04X", PROPERTY) \
+
+#define MAKE_HEX_STRING_6(NAME, PROPERTY) \
+ char NAME[7]; \
+ std::snprintf(NAME, sizeof(NAME), "%06X", PROPERTY) \
+
+#define MAKE_HEX_STRING_8(NAME, PROPERTY) \
+ char NAME[9]; \
+ std::snprintf(NAME, sizeof(NAME), "%08X", PROPERTY) \
+
+#define MAKE_HEX_STRING_10(NAME, PROPERTY) \
+ char NAME[11]; \
+ std::snprintf(NAME, sizeof(NAME), "%010llX", PROPERTY) \
+
+#define MAKE_HEX_STRING_12(NAME, PROPERTY) \
+ char NAME[13]; \
+ std::snprintf(NAME, sizeof(NAME), "%012llX", PROPERTY) \
+
+#define MAKE_HEX_STRING_16(NAME, PROPERTY) \
+ char NAME[17]; \
+ std::snprintf(NAME, sizeof(NAME), "%016llX", PROPERTY) \
+
+#endif // LIBWDS_RTSP_MACROS_H_
+
diff --git a/chromium/third_party/wds/src/libwds/rtsp/message.cpp b/chromium/third_party/wds/src/libwds/rtsp/message.cpp
new file mode 100644
index 00000000000..a1519e8aa92
--- /dev/null
+++ b/chromium/third_party/wds/src/libwds/rtsp/message.cpp
@@ -0,0 +1,78 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+
+#include "libwds/rtsp/message.h"
+
+#include <cassert>
+
+namespace wds {
+namespace rtsp {
+
+namespace {
+ const char kDefaultContentType[] = "text/parameters";
+}
+
+Message::Message(Type type)
+ : type_(type) {
+}
+
+Message::~Message() {
+}
+
+int Message::cseq() const {
+ assert(header_);
+ return header_->cseq();
+}
+
+Header& Message::header() {
+ if (!header_)
+ header_.reset(new Header());
+ return *header_;
+}
+
+std::string Message::ToString() const {
+ std::string ret;
+ if (payload_)
+ ret = payload_->ToString();
+
+ if (header_) {
+ header_->set_content_length (ret.length());
+ if(ret.length() > 0 && header_->content_type().length() == 0)
+ header_->set_content_type (kDefaultContentType);
+ ret = header_->ToString() + ret;
+ }
+
+ return ret;
+}
+
+Request::Request(RTSPMethod method, const std::string& request_uri)
+ : Message(REQUEST),
+ id_(UNKNOWN),
+ method_(method),
+ request_uri_(request_uri) {
+}
+
+Request::~Request() {
+}
+
+} // namespace rtsp
+} // namespace wds
diff --git a/chromium/third_party/wds/src/libwds/rtsp/message.h b/chromium/third_party/wds/src/libwds/rtsp/message.h
new file mode 100644
index 00000000000..bd08d30aef4
--- /dev/null
+++ b/chromium/third_party/wds/src/libwds/rtsp/message.h
@@ -0,0 +1,115 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+
+#ifndef LIBWDS_RTSP_MESSAGE_H_
+#define LIBWDS_RTSP_MESSAGE_H_
+
+#include <memory>
+
+#include "libwds/rtsp/header.h"
+#include "libwds/rtsp/payload.h"
+
+namespace wds {
+namespace rtsp {
+
+class Message {
+ public:
+ enum Type {
+ REQUEST,
+ REPLY
+ };
+
+ explicit Message(Type type);
+ virtual ~Message();
+
+ bool is_reply() const { return type_ == REPLY; }
+ bool is_request() const { return type_ == REQUEST; }
+
+ int cseq() const;
+
+ void set_header(std::unique_ptr<Header> header) {
+ header_ = std::move(header);
+ }
+
+ Header& header();
+
+ void set_payload(std::unique_ptr<Payload> payload) {
+ payload_ = std::move(payload);
+ }
+
+ Payload* payload() { return payload_.get(); }
+
+ virtual std::string ToString() const;
+
+ protected:
+ std::unique_ptr<Header> header_;
+ std::unique_ptr<Payload> payload_;
+
+ private:
+ Type type_;
+};
+
+class Request : public Message {
+ public:
+ enum ID {
+ UNKNOWN, M1, M2, M3, M4, M5, M6, M7, M8, M9, M10, M11, M12, M13, M14,
+ M15, M16
+ };
+
+ enum RTSPMethod {
+ MethodOptions = 1,
+ MethodSetParameter,
+ MethodGetParameter,
+ MethodSetup,
+ MethodPlay,
+ MethodTeardown,
+ MethodPause
+ };
+
+ Request(RTSPMethod method, const std::string& request_uri = std::string());
+ ~Request() override;
+
+ const std::string& request_uri() const { return request_uri_; }
+ void set_request_uri(const std::string& request_uri) {
+ request_uri_ = request_uri;
+ }
+
+ ID id() const { return id_; }
+ void set_id(ID id) { id_ = id; }
+
+ RTSPMethod method() const { return method_; }
+ void set_method(RTSPMethod method) { method_ = method; }
+
+ private:
+ ID id_;
+ RTSPMethod method_;
+ std::string request_uri_;
+};
+
+inline Request* ToRequest(Message* message) {
+ return static_cast<Request*>(message);
+}
+
+} // namespace rtsp
+} // namespace wds
+
+#endif // LIBWDS_RTSP_MESSAGE_H_
diff --git a/chromium/third_party/wds/src/libwds/rtsp/messagelexer.l b/chromium/third_party/wds/src/libwds/rtsp/messagelexer.l
new file mode 100644
index 00000000000..e4bdb8f3b54
--- /dev/null
+++ b/chromium/third_party/wds/src/libwds/rtsp/messagelexer.l
@@ -0,0 +1,299 @@
+%option nodefault nounput nomain
+%option bison-bridge reentrant noyywrap
+%option never-interactive
+%option warn stack noyy_top_state noyy_pop_state noyy_push_state
+%option case-insensitive
+%option extra-type="bool"
+%option outfile="gen/messagescanner.cpp" header-file="gen/messagescanner.h"
+
+%top{
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2015 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+#include <stdint.h>
+
+#define YY_NO_UNISTD_H 1
+}
+
+%{
+#include <string>
+
+#include "parser.h"
+#define yyterminate() return(END)
+%}
+
+%x MATCH_STRING_STATE
+%x MATCH_RESPONSE_CODE_STATE
+
+%s SUPPORTED_METHODS_STATE
+%s CONTENT_TYPE_STATE
+%s SESSION_STATE
+%s MATCH_PRESENTATION_URL
+%s NUM_AS_HEX_MODE
+%s MATCH_EDID_STATE
+
+DIGIT [0-9]
+DIGITS [0-9]+
+HEXDIG [0-9a-fA-F]
+HEXDIGITS [0-9a-fA-F]+
+SP [ \t]
+CR [\r]
+LF [\n]
+CRLF {CR}{LF}
+IPADDRESS (([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])
+IPPORT [:]({DIGIT}){1,5}
+
+%%
+
+<*>{CRLF} { BEGIN(INITIAL); }
+<*>{LF} { BEGIN(INITIAL); }
+<*>{CR} { BEGIN(INITIAL); }
+
+ /* Convert these */
+"=" { return '='; }
+"-" { return '-'; }
+"," { return ','; }
+"\*" { return '*'; }
+";" { return ';'; }
+":" { return ':'; }
+"/" { return '/'; }
+
+{SP}+ return WFD_SP;
+
+"none" return WFD_NONE;
+"LPCM" return WFD_AUDIO_CODEC_LPCM;
+"AAC" return WFD_AUDIO_CODEC_AAC;
+"AC3" return WFD_AUDIO_CODEC_AC3;
+"HDCP2.0" return WFD_HDCP_SPEC_2_0;
+"HDCP2.1" return WFD_HDCP_SPEC_2_1;
+"port=" return WFD_IP_PORT;
+"RTP/AVP/UDP;unicast" return WFD_STREAM_PROFILE;
+"mode=play" return WFD_MODE_PLAY;
+"primary" return WFD_ROUTE_PRIMARY;
+"secondary" return WFD_ROUTE_SECONDARY;
+"input_category_list=" return WFD_INPUT_CATEGORY_LIST;
+"GENERIC" return WFD_INPUT_CATEGORY_GENERIC;
+"HIDC" return WFD_INPUT_CATEGORY_HIDC;
+"generic_cap_list=" return WFD_GENERIC_CAP_LIST;
+"Keyboard" return WFD_INPUT_TYPE_KEYBOARD;
+"Mouse" return WFD_INPUT_TYPE_MOUSE;
+"SingleTouch" return WFD_INPUT_TYPE_SINGLE_TOUCH;
+"MultiTouch" return WFD_INPUT_TYPE_MULTI_TOUCH;
+"Joystick" return WFD_INPUT_TYPE_JOYSTICK;
+"Camera" return WFD_INPUT_TYPE_CAMERA;
+"Gesture" return WFD_INPUT_TYPE_GESTURE;
+"RemoteControl" return WFD_INPUT_TYPE_REMOTE_CONTROL;
+"hidc_cap_list=" return WFD_HIDC_CAP_LIST;
+"Infrared" return WFD_INPUT_PATH_INFRARED;
+"USB" return WFD_INPUT_PATH_USB;
+"BT" return WFD_INPUT_PATH_BT;
+"Wi-Fi" return WFD_INPUT_PATH_WIFI;
+"Zigbee" return WFD_INPUT_PATH_ZIGBEE;
+"No-SP" return WFD_INPUT_PATH_NOSP;
+"disable" return WFD_UIBC_SETTING_DISABLE;
+"enable" return WFD_UIBC_SETTING_ENABLE;
+"supported" return WFD_SUPPORTED;
+
+<NUM_AS_HEX_MODE>{DIGITS} {
+ std::string str(yytext, yyleng);
+ str += '\0';
+ errno = 0;
+ yylval->nval = strtoull(str.c_str(), NULL, 16);
+ if (errno)
+ yyterminate();
+ return WFD_NUM;
+ }
+
+<NUM_AS_HEX_MODE>{HEXDIGITS} {
+ std::string str(yytext, yyleng);
+ str += '\0';
+ errno = 0;
+ yylval->nval = strtoull(str.c_str(), NULL, 16);
+ if (errno)
+ yyterminate();
+ return WFD_NUM;
+ }
+
+<MATCH_EDID_STATE>{DIGITS} {
+ yylval->sval = new std::string(yytext);
+ return WFD_STRING;
+ }
+
+<MATCH_EDID_STATE>{HEXDIGITS} {
+ yylval->sval = new std::string(yytext);
+ return WFD_STRING;
+ }
+
+^"wfd_audio_codecs" {
+ BEGIN(NUM_AS_HEX_MODE);
+ return WFD_AUDIO_CODECS;
+ }
+
+^"wfd_video_formats" {
+ BEGIN(NUM_AS_HEX_MODE);
+ return WFD_VIDEO_FORMATS;
+ }
+
+^"wfd_3d_video_formats" {
+ BEGIN(NUM_AS_HEX_MODE);
+ return WFD_3D_FORMATS;
+ }
+
+^"wfd_content_protection" {
+ return WFD_CONTENT_PROTECTION;
+ }
+
+^"wfd_display_edid" {
+ BEGIN(MATCH_EDID_STATE);
+ return WFD_DISPLAY_EDID;
+ }
+
+^"wfd_coupled_sink" {
+ BEGIN(NUM_AS_HEX_MODE);
+ return WFD_COUPLED_SINK;
+ }
+
+^"wfd_trigger_method" {
+ BEGIN(SUPPORTED_METHODS_STATE);
+ return WFD_TRIGGER_METHOD;
+ }
+
+^"wfd_presentation_url" {
+ BEGIN(MATCH_PRESENTATION_URL);
+ return WFD_PRESENTATION_URL;
+ }
+
+^"wfd_client_rtp_ports" {
+ return WFD_CLIENT_RTP_PORTS;
+ }
+
+^"wfd_route" {
+ return WFD_ROUTE;
+ }
+
+^"wfd_I2C" {
+ return WFD_I2C;
+ }
+
+^"wfd_av_format_change_timing" {
+ BEGIN(NUM_AS_HEX_MODE);
+ return WFD_AV_FORMAT_CHANGE_TIMING;
+ }
+
+^"wfd_preferred_display_mode" {
+ BEGIN(NUM_AS_HEX_MODE);
+ return WFD_PREFERRED_DISPLAY_MODE;
+ }
+
+^"wfd_uibc_capability" {
+ return WFD_UIBC_CAPABILITY;
+ }
+
+^"wfd_uibc_setting" {
+ return WFD_UIBC_SETTING;
+ }
+
+^"wfd_standby_resume_capability" {
+ return WFD_STANDBY_RESUME_CAPABILITY;
+ }
+
+^"wfd_standby" {
+ if (yyextra) // Is reply.
+ return WFD_STANDBY_IN_RESPONSE;
+ return WFD_STANDBY_IN_REQUEST;
+ }
+
+^"wfd_connector_type" {
+ BEGIN(NUM_AS_HEX_MODE);
+ return WFD_CONNECTOR_TYPE;
+ }
+
+^"wfd_idr_request" {
+ return WFD_IDR_REQUEST;
+ }
+
+^[[:alpha:]][[:alnum:]\-\_]* {
+ BEGIN(MATCH_STRING_STATE);
+ yylval->sval = new std::string(yytext, yyleng);
+ return WFD_GENERIC_PROPERTY;
+ }
+
+{DIGITS} {
+ std::string str(yytext, yyleng);
+ str += '\0';
+ errno = 0;
+ yylval->nval = strtoull(str.c_str(), NULL, 10);
+ if (errno)
+ yyterminate();
+ return WFD_NUM;
+ }
+
+<MATCH_STRING_STATE>[^ :\r\n][^\r\n]+/"\r\n" {
+ BEGIN(INITIAL);
+ yylval->sval = new std::string(yytext);
+ return WFD_STRING;
+ }
+
+<SUPPORTED_METHODS_STATE>"OPTIONS" {
+ return WFD_OPTIONS;
+ }
+
+<SUPPORTED_METHODS_STATE>"SET_PARAMETER" {
+ return WFD_SET_PARAMETER;
+ }
+
+<SUPPORTED_METHODS_STATE>"GET_PARAMETER" {
+ return WFD_GET_PARAMETER;
+ }
+
+<SUPPORTED_METHODS_STATE>"SETUP" {
+ return WFD_SETUP;
+ }
+
+<SUPPORTED_METHODS_STATE>"PLAY" {
+ return WFD_PLAY;
+ }
+
+<SUPPORTED_METHODS_STATE>"TEARDOWN" {
+ return WFD_TEARDOWN;
+ }
+
+<SUPPORTED_METHODS_STATE>"PAUSE" {
+ return WFD_PAUSE;
+ }
+
+<SUPPORTED_METHODS_STATE>"org.wfa.wfd1.0" {
+ return WFD_TAG;
+ }
+
+<MATCH_PRESENTATION_URL>"rtsp://"[^ \t\n]+{IPADDRESS}{IPPORT}?"/wfd1.0/streamid=0" {
+ yylval->sval = new std::string(yytext);
+ return WFD_PRESENTATION_URL_0;
+ }
+
+<MATCH_PRESENTATION_URL>"rtsp://"[^ \t\n]+{IPADDRESS}{IPPORT}?"/wfd1.0/streamid=1" {
+ yylval->sval = new std::string(yytext);
+ return WFD_PRESENTATION_URL_1;
+ }
+
+ /* all unmatched */
+<*>. {}
+%%
diff --git a/chromium/third_party/wds/src/libwds/rtsp/messages_rules.txt b/chromium/third_party/wds/src/libwds/rtsp/messages_rules.txt
new file mode 100644
index 00000000000..956d85135c5
--- /dev/null
+++ b/chromium/third_party/wds/src/libwds/rtsp/messages_rules.txt
@@ -0,0 +1,286 @@
+Rules and lexer
+
+DIGIT = %x30-39
+HEXDIG = DIGIT / %x41-46
+SP = %x20
+CR = %x0D
+LF = %x0A
+CRLF = CR LF
+IPADDRESS = 1*3(DIGIT) “.†1*3(DIGIT) “.†1*3(DIGIT) “.†1*3(DIGIT)
+IPPORT = 1*5(DIGIT)
+
+RULE wfd-audio-codecs
+
+wfd-audio-codecs = “wfd_audio_codecs:†SP sink-audio-cap CRLF
+sink-audio-cap = “none†/ sink-audio-list; “none†if not supported at a
+sink-audio-list = audio-format SP modes SP latency *(“,†SP sink-audio-list)
+audio-format = “LPCM†/ “AAC†/ “AC3â€
+modes = 8*8HEXDIG; see Table 5-21, Table 5-22 and Table 5-23
+latency = 2*2HEXDIG; decoder latency in units of 5 msecs, see LPCM decoder latency field for LPCM, see AAC decoder latency field for AAC and see AC3 decoder latency field in Table 5-20 for more detail
+
+RULE wfd-video-formats
+
+wfd-video-formats = “wfd_video_formats:†SP sink-video-list CRLF
+sink-video-list = “none†/ (native SP preferred-display-mode-supported SP H.264-codec);the Secondary Sink shall return “noneâ€
+native = 2*2HEXDIG; see Table 5-13
+preferred-display-mode-supported = 2*2HEXDIG; 0-not supported, 1-supported, 2-255 reserved
+H.264-codec = profile SP level SP misc-params SP max-hres SP max-vres *(“,†SP H.264-codec)
+profile = 2*2HEXDIG; see Table 5-14, only one bit set
+level = 2*2HEXDIG; see Table 5-15, only one bit set
+max-hres = “none†/ (4*4HEXDIG); in M3 response and if preferred-display mode-supported is 0, then “noneâ€. in M3 response and if preferred-display-mode- supported is 1, specifies the maximum horizontal resolution that the H.264 decoder supports in pixels. in M4 request, it is “none†and the recipient shall ignore this subparameter
+max-vres = “none†/ (4*4HEXDIG); in M3 response and if preferred-display mode-supported is 0, then “noneâ€. in M3 response and if preferred-display-mode- supported is 1, specifies the maximum vertical resolution that the H.264 decoder supports in pixels. in M4 request, it is “none†and the recipient shall ignore this subparameter
+misc-params = SP VESA-Support SP HH-Support SP latency SP min-slice-size SP slice-enc-params SP frame-rate-control-support CEA-Support
+CEA-Support = 8*8HEXDIG; see Table 5-10. when used inside preferred display mode in M4 request, this subfield should be set to 0x00000000 and the recipient shall ignore this subfield.
+VESA-Support = 8*8HEXDIG; see Table 5-11. when used inside preferred display mode in M4 request, this subfield should be set to 0x00000000 and the recipient shall ignore this subfield.
+HH-Support = 8*8HEXDIG; see Table 5-12. when used inside preferred display mode in M4 request, this subfield should be set to 0x00000000 and the recipient shall ignore this subfield.
+latency = 2*2HEXDIG; decoder latency in units of 5 msecs, see latency field in Table 5-9 for more detail
+min-slice-size = 4*4HEXDIG; number of macroblocks
+slice-enc-params = 4*4HEXDIG; see Table 5-16
+frame-rate-control-support = 2*2HEXDIG; see Table 5-17
+
+RULE wfd-3d-formats
+
+wfd-3d-formats = “wfd_3d_video_formats:†SP 3d-cap CRLF
+3d-cap = “none†/ 3d-cap-list; if not supported then “noneâ€
+3d-cap-list = native SP preferred-display-mode-supported SP H.264-codec
+native = 2*2HEXDIG; see Table 5-13 preferred-display-mode-supported = 2*2HEXDIG; 0-not supported, 1-supported, 2-255 reserved
+H.264-codec = profile SP level SP misc-params SP max-hres SP max-vres * (“,†SP H.264-codec)
+profile = 2*2HEXDIG; see Table 5-14, only one bit set
+level = 2*2HEXDIG; see Table 5-15, only one bit set
+max-hres = “none†/ (4*4HEXDIG); in M3 response and if preferred-display mode-supported is 0, then “noneâ€. in M3 response and if preferred-display-mode-supported is 1, specifies the maximum horizontal resolution that the H.264 decoder supports in pixels. in M4 request, it is “none†and the recipient shall ignore this subparameter
+max-vres = “none†/ (4*4HEXDIG); in M3 response and if preferred-display mode-supported is 0, then “noneâ€. in M3 response and if preferred-display-mode-supported is 1, specifies the maximum vertical resolution that the H.264 decoder supports in pixels. in M4 request, it is “none†and the recipient shall ignore this subparameter
+misc-params = 3d-video-capability SP latency SP min-slice-size SP slice-enc-params SP frame-rate-control-support
+3d-video-capability= 16*16HEXDIG; see Table 5-19.
+latency = 2*2HEXDIG; decoder latency in units of 5 msecs, see latency field in Table 5-9 for more detail
+min-slice-size = 4*4HEXDIG; number of macroblocks
+slice-enc-params = 4*4HEXDIG; see Table 5-16
+frame-rate-control-support = 2*2HEXDIG; see Table 5-17
+
+RULE wfd-content-protection
+
+wfd-content-protection = “wfd_content_protection:†SP cp-spec CRLF
+cp-spec = “none†/ hdcp2-spec
+hdcp2-spec = (“HDCP2.0†/ “HDCP2.1â€) SP “port=†IPPORT ;TCP port
+
+RULE wfd-display-edid
+
+wfd-display-edid = “wfd_display_edid:†SP edid CRLF
+edid = “none†/ (edid-block-count SP edid-payload)
+edid-block-count = 4*4HEXDIG; 0: if EDID is not available at the time that the WFD Sink responses to the parameter request. 1-256: number of 128-byte EDID blocks in edid-payload Other values: reserved
+edid-payload = “none†/ 256*65536HEXDIG; “none†if edid-block-count is 0. Otherwise, edid-payload contains the entire EDID data structure available from the display device. Length of edid-payload shall be a multiple of 128 bytes. (length of edid-payload = edid-block-count * 128-byte)
+
+RULE wfd-coupled-sink
+
+wfd-coupled-sink = “wfd_coupled_sink:†SP coupled-sink-cap CRLF
+coupled-sink-cap = “none†/(status SP sink-address); “none†if Coupled Sink Operation is not supported
+status = 2*2HEXDIG; see Table 5-8
+sink-address = “none†/ (12*12HEXDIG); WFD Sink’s MAC address if status is Coupled otherwise “noneâ€.
+
+RULE wfd-trigger-method
+
+wfd-trigger-method = “wfd_trigger_method:†SP (“SETUP†/ “PAUSE†/ “TEARDOWN†/ “PLAYâ€) CRLF
+
+RULE wfd-presentation-url
+
+wfd-presentation-url = “wfd_presentation_URL:†SP wfd-url0 SP wfd-url1 CRLF
+wfd-url0 = “none†/ (“rtsp://†source-ip-address“/wfd1.0/streamid=0â€)
+wfd-url1 = “none†/ (“rtsp://†source-ip-address“/wfd1.0/streamid=1â€)
+source-ip-address = IPADDRESS
+
+RULE wfd-client-rtp-ports
+
+wfd-client-rtp-ports = “wfd_client_rtp_ports:†SP profile SP rtp-port0 SP rtp-port1 SP mode CRLF
+profile = “RTP/AVP/UDP;unicastâ€
+rtp-port0 = IPPORT ; UDP port
+rtp-port1 = IPPORT ; UDP port
+mode = “mode=playâ€
+
+RULE wfd-route
+
+wfd-route = “wfd_route:†SP destination CRLF
+destination = “primary†/ “secondaryâ€
+
+RULE wfd-I2C
+
+wfd-I2C = “wfd_I2C:†SP I2C-port CRLF
+I2C-port = “none†/ IPPORT; port where the device listens for I2C commands, “none†if not supported
+
+RULE wfd-av-format-change-timing
+
+wfd-av-format-change-timing = “wfd_av_format_change_timing:†SP PTS SP DTS CRLF
+PTS = 10*10HEXDIG; most-significant 33 bits indicating PTS value
+DTS = 10*10HEXDIG; most-significant 33 bits indicating DTS value
+
+RULE wfd-preferred-display-mode
+
+wfd-preferred-display-mode = “wfd_preferred_display_mode:†SP dinfo CRLF
+dinfo = p-clock SP H SP HB SP HSPOL-HSOFF SP HSW SP V SP VB SP VSPOL-VSOFF SP VSW SP VBS3D SP 2d-s3d-modes SP p-depth SP H.264-codec
+p-clock = 6*6HEXDIG; pixel clock in 10kHz units
+H = 4*4HEXDIG; horizontal active resolution in units of pixels
+HB = 4*4HEXDIG; horizontal blanking period in units of pixels
+HSPOL-HSOFF = 4*4HEXDIG; b15: horizontal sync polarity (0 negative, 1 positive) b14:b0 horizontal sync offset in units of pixels
+HSW = 4*4HEXDIG; horizontal sync width in units of pixels
+V = 4*4HEXDIG; vertical active resolution in units of lines
+VB = 4*4HEXDIG; vertical blanking period in units of lines
+VSPOL-VSOFF = 4*4HEXDIG; b15: vertical sync polarity (0 negative, 1 positive) b14:b0 vertical sync offset in units of lines
+VSW = 4*4HEXDIG; vertical sync width in units of lines
+VBS3D = 2*2HEXDIG; vertical blanking interval in units of lines (only used in stereoscopic 3D Frame Packing mode)
+2d-s3d-modes = 2*2HEXDIG; 2D/Stereoscopic 3D Modes (refer to Table 6-4)
+P-depth = 2*2HEXDIG; pixel depth (refer to Table 6-5). This is the pixel depth of the display output which is different from the codec pixel depth.
+H.264-codec = ; see section 6.1.3
+
+RULE wfd-uibc-capability
+
+wfd-uibc-capability = “wfd_uibc_capability:†SP (“none†/ (input-category-val “;†generic-cap-val “;†hidc-cap-val “;†tcp-port)) CRLF; “none†if not supported
+input-category-val = “input_category_list=†(“none†/ input-category-list)
+input-category-list = input-cat * (“,†SP input-category-list)
+input-cat = “GENERIC†/ “HIDCâ€
+generic-cap-val = “generic_cap_list=†(“none†/ generic-cap-list)
+generic-cap-list = inp-type *(“,†SP generic-cap-list)
+inp-type = “Keyboard†/ “Mouse†/ “SingleTouch†/ “MultiTouch†/ “Joystick†/ “Camera†/ “Gesture†/ “RemoteControlâ€
+hidc-cap-val = “hidc_cap_list=†(“none†/ hidc-cap-list)
+hidc-cap-list = detailed-cap *(“,†SP hidc-cap-list)
+detailed-cap = inp-type “/†inp-path
+inp-path = “Infrared†/ “USB†/ “BT†/ “Zigbee†/ “Wi-Fi†/ “No-SPâ€
+tcp-port = “port=†(“none†/ IPPORT)
+
+RULE wfd-uibc-setting
+
+wfd-uibc-setting = “wfd_uibc_setting:†SP uibc-setting CRLF
+uibc-setting = “disable†/ “enableâ€
+
+RULE wfd-standby-resume-capability
+
+wfd-standby-resume-capability = “wfd_standby_resume_capability:†SP standby-resume-cap CRLF
+standby-resume-cap = “none†/ “supportedâ€; “none†if not supported
+
+RULE wfd-standby
+
+wfd-standby = “wfd_standby†CRLF
+
+RULE wfd-connector-type
+wfd-connector-type = “wfd_connector_type:†SP connector-type CRLF
+connector-type = “none†/ (2*2HEXDIG); specifies the active display connector type (see Table 6-6), “none†if the WFD Sink dongle that is not acting as a WFD Sink with an integrated display is not connected to an external display
+
+RULE wfd-idr-request
+wfd-idr-request = “wfd_idr_request†CRLF
+
+RTSP Methods
+OPTIONS
+org.wfa.wfd1.0
+SET_PARAMETER
+GET_PARAMETER
+SETUP
+PLAY
+TEARDOWN
+PAUSE
+
+RULE RTSP SETUP
+
+Transport = “Transport:†SP profile port-numbers CRLF
+profile = “RTP/AVP/UDP;unicast;â€
+port-numbers = client-port [“;†server-port]; client-port only at M6 request message, (client-port “;†server- port) at M6 response message.
+client-port = “client_port=†(rtp-port0 / rtp-port1) [“-†IPPORT]; rtp-port0 from a Primary Sink, rtp-port1 from a Secondary Sink. IPPORT here is rtp-port0 (or rtp-port1) plus 1 to be used for RTCP. [“-†IPPORT] can only appear in M6 request if the WFD Sink wants to use optional RTCP. [“-†IPPORT] can only appear in M6 response if the WFD Source accepts to use optional RTCP.
+server-port = “server_port=†IPPORT [“-†IPPORT]; server’s UDP port number for RTP. Optional IPPORT is server’s UDP port number for RTP plus 1 to be used for optional RTCP. [“-†IPPORT] can only appear in M6 response if the WFD Source accepts to use optional RTCP.
+
+
+///////////////////////////////////////////////////////////////////////////////
+// Payload
+///////////////////////////////////////////////////////////////////////////////
+
+wfd-audio-codecs
+wfd-video-formats
+wfd-3d-formats
+wfd-content-protection
+wfd-display-edid
+wfd-coupled-sink
+wfd-trigger-method
+wfd-presentation-url
+wfd-client-rtp-ports
+wfd-route
+
+wfd-I2C
+wfd-av-format-change-timing
+wfd-preferred-display-mode
+wfd-uibc-capability
+wfd-uibc-setting
+wfd-standby-resume-capability
+wfd-standby
+wfd-connector-type
+wfd-idr-request
+
+///////////////////////////////////////////////////////////////////////////////
+// Messages
+///////////////////////////////////////////////////////////////////////////////
+
+M1 Request (src->snk)
+
+OPTIONS * RTSP/1.0
+CSeq: i
+Require: org.wfa.wfd1.0
+
+M1 Response (snk->src)
+
+RTSP/1.0 200 OK
+CSeq: i
+Date: Sun, Aug 21 2011 04:20:53 GMT
+Public: org.wfa.wfd1.0, GET_PARAMETER, SET_PARAMETER
+
+-------------------------------------------------------------------------------
+
+M2 Request (src->snk)
+
+OPTIONS * RTSP/1.0
+CSeq: j
+Require: org.wfa.wfd1.0
+
+M2 Response (snk->src)
+
+RTSP/1.0 200 OK
+CSeq: j
+Date: Sun, Aug 21 2011 04:20:53 GMT
+Public: org.wfa.wfd1.0, SETUP, TEARDOWN, PLAY, PAUSE, GET_PARAMETER, SET_PARAMETER
+
+-------------------------------------------------------------------------------
+
+M3 Request (src->snk)
+
+GET_PARAMETER rtsp://localhost/wfd1.0 RTSP/1.0
+CSeq: i+1
+Content-Type: text/parameters
+Content-Length: 141
+
+wfd_video_formats
+wfd_audio_codecs
+wfd_3d_video_formats
+wfd_content_protection
+wfd_display_edid
+wfd_coupled_sink
+wfd_client_rtp_ports
+
+M3 Response (snk->src)
+
+RTSP/1.0 200 OK
+CSeq: i+1
+Content-Length: 290
+Content-Type: text/parameters
+
+wfd_video_formats: 00 00 00 01 01 00000001 00000000 00000000 000000 0000 00 none none
+wfd_audio_codecs: LPCM 00000003 00
+wfd_3d_video_formats: none
+wfd_content_protection: none
+wfd_display_edid: none
+wfd_coupled_sink: none
+wfd_client_rtp_ports: RTP/AVP/UDP;unicast 1028 0 mode=play
+
+-------------------------------------------------------------------------------
+
+M4
+
+-------------------------------------------------------------------------------
+
+M5
+
+-------------------------------------------------------------------------------
+
+M6
diff --git a/chromium/third_party/wds/src/libwds/rtsp/options.cpp b/chromium/third_party/wds/src/libwds/rtsp/options.cpp
new file mode 100644
index 00000000000..1635bbe8362
--- /dev/null
+++ b/chromium/third_party/wds/src/libwds/rtsp/options.cpp
@@ -0,0 +1,43 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+
+#include "libwds/rtsp/options.h"
+
+namespace wds {
+namespace rtsp {
+
+Options::Options(const std::string& request_uri)
+ : Request(Request::MethodOptions, request_uri) {
+}
+
+Options::~Options() {
+}
+
+std::string Options::ToString() const {
+ std::string ret = MethodName::OPTIONS
+ + std::string(SPACE) + request_uri()
+ + std::string(SPACE) + std::string(RTSP_END) + std::string(CRLF);
+ return ret + Message::ToString();
+}
+
+} // namespace rtsp
+} // namespace wds
diff --git a/chromium/third_party/wds/src/libwds/rtsp/options.h b/chromium/third_party/wds/src/libwds/rtsp/options.h
new file mode 100644
index 00000000000..8c2ea3db68f
--- /dev/null
+++ b/chromium/third_party/wds/src/libwds/rtsp/options.h
@@ -0,0 +1,41 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+
+#ifndef LIBWDS_RTSP_OPTIONS_H_
+#define LIBWDS_RTSP_OPTIONS_H_
+
+#include "libwds/rtsp/message.h"
+
+namespace wds {
+namespace rtsp {
+
+class Options: public Request {
+ public:
+ explicit Options(const std::string& request_uri);
+ ~Options() override;
+ std::string ToString() const override;
+};
+
+} // namespace rtsp
+} // namespace wds
+
+#endif // LIBWDS_RTSP_OPTIONS_H_
diff --git a/chromium/third_party/wds/src/libwds/rtsp/parser.ypp b/chromium/third_party/wds/src/libwds/rtsp/parser.ypp
new file mode 100644
index 00000000000..1600d07b5f4
--- /dev/null
+++ b/chromium/third_party/wds/src/libwds/rtsp/parser.ypp
@@ -0,0 +1,1164 @@
+%pure-parser
+%no-lines
+%output "gen/parser.cpp"
+%defines "gen/parser.h"
+
+%code requires {
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2015 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+ #include <map>
+ #include <memory>
+ #include "libwds/rtsp/audiocodecs.h"
+ #include "libwds/rtsp/contentprotection.h"
+ #include "libwds/rtsp/triggermethod.h"
+ #include "libwds/rtsp/route.h"
+ #include "libwds/rtsp/uibcsetting.h"
+ #include "libwds/rtsp/uibccapability.h"
+
+ #define YYLEX_PARAM scanner
+
+ namespace wds {
+ struct AudioCodec;
+ namespace rtsp {
+ class Driver;
+ class Scanner;
+ class Message;
+ class Header;
+ class TransportHeader;
+ class Property;
+ class PropertyErrors;
+ class Payload;
+ class VideoFormats;
+ struct H264Codec;
+ struct H264Codec3d;
+ }
+ }
+}
+
+%lex-param {void* scanner} { std::unique_ptr<wds::rtsp::Message>& message }
+%parse-param {void* scanner} { std::unique_ptr<wds::rtsp::Message>& message }
+
+%code {
+#include <iostream>
+#include <cstdlib>
+#include <string>
+#include <vector>
+#include <map>
+
+#include "libwds/rtsp/driver.h"
+#include "libwds/rtsp/message.h"
+#include "libwds/rtsp/header.h"
+#include "libwds/rtsp/transportheader.h"
+#include "libwds/rtsp/payload.h"
+#include "libwds/rtsp/reply.h"
+#include "libwds/rtsp/options.h"
+#include "libwds/rtsp/getparameter.h"
+#include "libwds/rtsp/setparameter.h"
+#include "libwds/rtsp/play.h"
+#include "libwds/rtsp/teardown.h"
+#include "libwds/rtsp/pause.h"
+#include "libwds/rtsp/setup.h"
+#include "libwds/rtsp/audiocodecs.h"
+#include "libwds/rtsp/videoformats.h"
+#include "libwds/rtsp/formats3d.h"
+#include "libwds/rtsp/contentprotection.h"
+#include "libwds/rtsp/displayedid.h"
+#include "libwds/rtsp/coupledsink.h"
+#include "libwds/rtsp/triggermethod.h"
+#include "libwds/rtsp/clientrtpports.h"
+#include "libwds/rtsp/i2c.h"
+#include "libwds/rtsp/avformatchangetiming.h"
+#include "libwds/rtsp/standbyresumecapability.h"
+#include "libwds/rtsp/standby.h"
+#include "libwds/rtsp/idrrequest.h"
+#include "libwds/rtsp/connectortype.h"
+#include "libwds/rtsp/preferreddisplaymode.h"
+#include "libwds/rtsp/presentationurl.h"
+#include "libwds/rtsp/uibccapability.h"
+
+#define UNUSED_TOKEN(T) (void)T
+#define DELETE_TOKEN(T) \
+ delete T; \
+ T = nullptr
+}
+
+%union {
+ std::string* sval;
+ unsigned long long int nval;
+ bool bool_val;
+ std::vector<std::string>* vsval;
+ wds::rtsp::Message* message;
+ wds::rtsp::Header* header;
+ wds::rtsp::Payload* mpayload;
+ wds::AudioFormats audio_format;
+ wds::rtsp::Property* property;
+ std::vector<unsigned short>* error_list;
+ wds::rtsp::PropertyErrors* property_errors;
+ std::map<wds::rtsp::PropertyType, std::shared_ptr<wds::rtsp::PropertyErrors>>* property_error_map;
+ std::vector<wds::rtsp::H264Codec>* codecs;
+ wds::rtsp::H264Codec* codec;
+ std::vector<wds::rtsp::H264Codec3d>* codecs_3d;
+ wds::rtsp::H264Codec3d* codec_3d;
+ wds::rtsp::ContentProtection::HDCPSpec hdcp_spec;
+ wds::rtsp::TriggerMethod::Method trigger_method;
+ wds::rtsp::Route::Destination route_destination;
+ bool uibc_setting;
+ std::vector<wds::rtsp::UIBCCapability::InputCategory>* input_category_list;
+ std::vector<wds::rtsp::UIBCCapability::InputType>* generic_cap_list;
+ std::vector<wds::rtsp::UIBCCapability::DetailedCapability>* hidc_cap_list;
+ wds::rtsp::UIBCCapability::InputCategory input_category_list_value;
+ wds::rtsp::UIBCCapability::InputType generic_cap_list_value;
+ wds::rtsp::UIBCCapability::DetailedCapability* hidc_cap_list_value;
+ wds::rtsp::UIBCCapability::InputPath input_path;
+ wds::rtsp::Method method;
+ std::vector<wds::rtsp::Method>* methods;
+ wds::rtsp::PropertyType parameter;
+ std::vector<wds::rtsp::PropertyType>* parameters;
+ std::vector<wds::AudioCodec>* audio_codecs;
+ wds::AudioCodec* audio_codec;
+ std::pair<std::string, unsigned int>* session_info;
+ wds::rtsp::TransportHeader* transport;
+}
+
+%token END 0
+%token WFD_SP
+%token <nval> WFD_NUM
+%token WFD_OPTIONS
+%token WFD_SET_PARAMETER
+%token WFD_GET_PARAMETER
+%token WFD_SETUP
+%token WFD_PLAY
+%token WFD_TEARDOWN
+%token WFD_PAUSE
+%token WFD_END
+%token WFD_RESPONSE
+%token <nval> WFD_RESPONSE_CODE
+%token <sval> WFD_STRING
+%token <sval> WFD_GENERIC_PROPERTY
+%token <sval> WFD_HEADER
+%token WFD_CSEQ
+%token WFD_RESPONSE_METHODS
+%token WFD_TAG
+%token WFD_SUPPORT_CHECK
+%token <sval> WFD_REQUEST_URI
+%token WFD_CONTENT_TYPE
+%token <sval> WFD_MIME
+%token WFD_CONTENT_LENGTH
+%token WFD_AUDIO_CODECS
+%token WFD_VIDEO_FORMATS
+%token WFD_3D_FORMATS
+%token WFD_CONTENT_PROTECTION
+%token WFD_DISPLAY_EDID
+%token WFD_COUPLED_SINK
+%token WFD_TRIGGER_METHOD
+%token WFD_PRESENTATION_URL
+%token WFD_CLIENT_RTP_PORTS
+%token WFD_ROUTE
+%token WFD_I2C
+%token WFD_AV_FORMAT_CHANGE_TIMING
+%token WFD_PREFERRED_DISPLAY_MODE
+%token WFD_UIBC_CAPABILITY
+%token WFD_UIBC_SETTING
+%token WFD_STANDBY_RESUME_CAPABILITY
+%token WFD_STANDBY_IN_REQUEST
+%token WFD_STANDBY_IN_RESPONSE
+%token WFD_CONNECTOR_TYPE
+%token WFD_IDR_REQUEST
+%token WFD_AUDIO_CODECS_ERROR
+%token WFD_VIDEO_FORMATS_ERROR
+%token WFD_3D_FORMATS_ERROR
+%token WFD_CONTENT_PROTECTION_ERROR
+%token WFD_DISPLAY_EDID_ERROR
+%token WFD_COUPLED_SINK_ERROR
+%token WFD_TRIGGER_METHOD_ERROR
+%token WFD_PRESENTATION_URL_ERROR
+%token WFD_CLIENT_RTP_PORTS_ERROR
+%token WFD_ROUTE_ERROR
+%token WFD_I2C_ERROR
+%token WFD_AV_FORMAT_CHANGE_TIMING_ERROR
+%token WFD_PREFERRED_DISPLAY_MODE_ERROR
+%token WFD_UIBC_CAPABILITY_ERROR
+%token WFD_UIBC_SETTING_ERROR
+%token WFD_STANDBY_RESUME_CAPABILITY_ERROR
+%token WFD_STANDBY_ERROR
+%token WFD_CONNECTOR_TYPE_ERROR
+%token WFD_IDR_REQUEST_ERROR
+%token <sval> WFD_GENERIC_PROPERTY_ERROR
+%token WFD_NONE
+%token WFD_AUDIO_CODEC_LPCM
+%token WFD_AUDIO_CODEC_AAC
+%token WFD_AUDIO_CODEC_AC3
+%token WFD_HDCP_SPEC_2_0
+%token WFD_HDCP_SPEC_2_1
+%token <nval> WFD_IP_PORT
+%token <sval> WFD_PRESENTATION_URL_0
+%token <sval> WFD_PRESENTATION_URL_1
+%token WFD_STREAM_PROFILE
+%token WFD_MODE_PLAY
+%token WFD_ROUTE_PRIMARY
+%token WFD_ROUTE_SECONDARY
+%token WFD_INPUT_CATEGORY_LIST
+%token WFD_INPUT_CATEGORY_GENERIC
+%token WFD_INPUT_CATEGORY_HIDC
+%token WFD_GENERIC_CAP_LIST
+%token WFD_INPUT_TYPE_KEYBOARD
+%token WFD_INPUT_TYPE_MOUSE
+%token WFD_INPUT_TYPE_SINGLE_TOUCH
+%token WFD_INPUT_TYPE_MULTI_TOUCH
+%token WFD_INPUT_TYPE_JOYSTICK
+%token WFD_INPUT_TYPE_CAMERA
+%token WFD_INPUT_TYPE_GESTURE
+%token WFD_INPUT_TYPE_REMOTE_CONTROL
+%token WFD_HIDC_CAP_LIST
+%token WFD_INPUT_PATH_INFRARED
+%token WFD_INPUT_PATH_USB
+%token WFD_INPUT_PATH_BT
+%token WFD_INPUT_PATH_WIFI
+%token WFD_INPUT_PATH_ZIGBEE
+%token WFD_INPUT_PATH_NOSP
+%token WFD_UIBC_SETTING_ENABLE
+%token WFD_UIBC_SETTING_DISABLE
+%token WFD_SUPPORTED
+%token WFD_SESSION
+%token <sval> WFD_SESSION_ID
+%token WFD_TIMEOUT
+%token WFD_TRANSPORT
+%token WFD_SERVER_PORT
+
+%type <message> options set_parameter get_parameter setup play teardown pause
+%type <message> wfd_reply command
+%type <header> headers
+
+%type <sval> wfd_content_type
+%type <session_info> wfd_session
+%type <method> wfd_method
+%type <methods> wfd_methods wfd_supported_methods
+%type <nval> wfd_content_length
+%type <nval> wfd_cseq
+%type <audio_format> wfd_audio_codec_type
+%type <property> wfd_property wfd_property_audio_codecs
+%type <property> wfd_property_video_formats
+%type <property> wfd_property_3d_formats
+%type <property> wfd_content_protection
+%type <property> wfd_display_edid
+%type <property> wfd_coupled_sink
+%type <property> wfd_trigger_method
+%type <property> wfd_presentation_url
+%type <property> wfd_client_rtp_ports
+%type <property> wfd_route
+%type <property> wfd_I2C
+%type <property> wfd_av_format_change_timing
+%type <property> wfd_preferred_display_mode
+%type <property> wfd_uibc_capability
+%type <property> wfd_uibc_setting
+%type <property> wfd_standby_resume_capability
+%type <property> wfd_connector_type
+%type <mpayload> wdf_property_map
+%type <mpayload> wfd_property_error_map
+%type <property_errors> wfd_property_errors
+%type <error_list> wfd_error_list
+%type <mpayload> payload
+%type <codecs> wfd_h264_codecs
+%type <codec> wfd_h264_codec
+%type <nval> wfd_max_hres
+%type <nval> wfd_max_vres
+%type <codecs_3d> wfd_h264_codecs_3d
+%type <codec_3d> wfd_h264_codec_3d
+%type <hdcp_spec> hdcp2_spec
+%type <sval> wfd_edid_payload
+%type <nval> wfd_sink_address
+%type <trigger_method> wfd_supported_trigger_methods
+%type <route_destination> wfd_route_destination
+%type <nval> wfd_port
+%type <uibc_setting> wfd_uibc_setting_value
+%type <bool_val> wfd_standby_resume_capability_value
+%type <sval> wfd_presentation_url0 wfd_presentation_url1
+%type <input_category_list> wfd_input_category_list wfd_input_category_list_values
+%type <generic_cap_list> wfd_generic_cap_list wfd_generic_cap_list_values
+%type <hidc_cap_list> wfd_hidc_cap_list wfd_hidc_cap_list_values
+%type <input_category_list_value> wfd_input_category_list_value
+%type <generic_cap_list_value> wfd_generic_cap_list_value
+%type <hidc_cap_list_value> wfd_hidc_cap_list_value
+%type <input_path> wfd_input_path
+%type <parameter> wfd_parameter
+%type <mpayload> wfd_parameter_list
+%type <audio_codecs> wfd_audio_codec_list
+%type <audio_codec> wfd_audio_codec
+%type <transport> wfd_transport
+
+%destructor { DELETE_TOKEN($$); } WFD_STRING WFD_REQUEST_URI WFD_MIME WFD_GENERIC_PROPERTY
+%destructor { DELETE_TOKEN($$); } wfd_methods wfd_supported_methods
+%destructor { DELETE_TOKEN($$); } wfd_h264_codec wfd_h264_codecs
+%destructor { DELETE_TOKEN($$); } wfd_h264_codec_3d wfd_h264_codecs_3d
+%destructor { DELETE_TOKEN($$); } wfd_edid_payload
+%destructor { DELETE_TOKEN($$); } wfd_hidc_cap_list_value
+%destructor { DELETE_TOKEN($$); } wfd_parameter_list
+%destructor { DELETE_TOKEN($$); } wfd_audio_codec wfd_audio_codec_list
+
+%%
+
+start: message
+ ;
+
+message:
+ command headers {
+ message.reset($1);
+ $1->set_header(std::unique_ptr<wds::rtsp::Header>($2));
+ }
+ | payload {
+ if (message && $1)
+ message->set_payload(std::unique_ptr<wds::rtsp::Payload>($1));
+ else
+ YYERROR;
+ }
+ | error {
+ message.reset();
+ std::cerr << "Unknown message" << std::endl;
+ YYABORT;
+ }
+ ;
+
+command:
+ options
+ | set_parameter
+ | get_parameter
+ | setup
+ | play
+ | teardown
+ | pause
+ | wfd_reply
+ ;
+
+options:
+ WFD_OPTIONS WFD_SP '*' WFD_SP WFD_END {
+ $$ = new wds::rtsp::Options("*");
+ }
+ | WFD_OPTIONS WFD_SP WFD_REQUEST_URI WFD_SP WFD_END {
+ $$ = new wds::rtsp::Options(*$3);
+ DELETE_TOKEN($3);
+ }
+ ;
+
+set_parameter:
+ WFD_SET_PARAMETER WFD_SP WFD_REQUEST_URI WFD_SP WFD_END {
+ $$ = new wds::rtsp::SetParameter(*$3);
+ DELETE_TOKEN($3);
+ }
+ ;
+
+get_parameter:
+ WFD_GET_PARAMETER WFD_SP WFD_REQUEST_URI WFD_SP WFD_END {
+ $$ = new wds::rtsp::GetParameter(*$3);
+ DELETE_TOKEN($3);
+ }
+ ;
+
+setup:
+ WFD_SETUP WFD_SP WFD_REQUEST_URI WFD_SP WFD_END {
+ $$ = new wds::rtsp::Setup(*$3);
+ DELETE_TOKEN($3);
+ }
+ ;
+
+play:
+ WFD_PLAY WFD_SP WFD_REQUEST_URI WFD_SP WFD_END {
+ $$ = new wds::rtsp::Play(*$3);
+ DELETE_TOKEN($3);
+ }
+ ;
+
+teardown:
+ WFD_TEARDOWN WFD_SP WFD_REQUEST_URI WFD_SP WFD_END {
+ $$ = new wds::rtsp::Teardown(*$3);
+ DELETE_TOKEN($3);
+ }
+ ;
+
+pause:
+ WFD_PAUSE WFD_SP WFD_REQUEST_URI WFD_SP WFD_END {
+ $$ = new wds::rtsp::Pause(*$3);
+ DELETE_TOKEN($3);
+ }
+ ;
+
+wfd_reply:
+ WFD_RESPONSE WFD_RESPONSE_CODE WFD_STRING {
+ DELETE_TOKEN($3);
+ $$ = new wds::rtsp::Reply($2);
+ }
+ ;
+
+headers:
+ {
+ $$ = new wds::rtsp::Header();
+ }
+ | headers wfd_cseq { $1->set_cseq($2); }
+ | headers WFD_SUPPORT_CHECK { $1->set_require_wfd_support(true); }
+ | headers wfd_content_type {
+ $1->set_content_type(*$2);
+ DELETE_TOKEN($2);
+ }
+ | headers wfd_content_length { $1->set_content_length($2); }
+ | headers wfd_supported_methods {
+ $1->set_supported_methods(*$2);
+ DELETE_TOKEN($2);
+ }
+ | headers wfd_session {
+ $1->set_session((*$2).first);
+ $1->set_timeout((*$2).second);
+ DELETE_TOKEN($2);
+ }
+ | headers wfd_transport { $1->set_transport ($2); }
+ | headers WFD_HEADER wfd_ows WFD_STRING {
+ $1->add_generic_header(*$2, *$4);
+ DELETE_TOKEN($2);
+ DELETE_TOKEN($4);
+ }
+ ;
+
+wfd_cseq:
+ WFD_CSEQ wfd_ows WFD_NUM {
+ $$ = $3;
+ }
+ ;
+
+wfd_content_type:
+ WFD_CONTENT_TYPE wfd_ows WFD_MIME {
+ $$ = $3;
+ }
+ ;
+
+wfd_content_length:
+ WFD_CONTENT_LENGTH wfd_ows WFD_NUM {
+ $$ = $3;
+ }
+ ;
+
+wfd_session:
+ WFD_SESSION WFD_SP WFD_SESSION_ID {
+ $$ = new std::pair<std::string, unsigned int>(*$3, 0);
+ DELETE_TOKEN($3);
+ }
+ | WFD_SESSION WFD_SP WFD_SESSION_ID WFD_TIMEOUT WFD_NUM {
+ $$ = new std::pair<std::string, unsigned int>(*$3, $5);
+ DELETE_TOKEN($3);
+ }
+ ;
+
+wfd_transport:
+ WFD_TRANSPORT WFD_NUM {
+ $$ = new wds::rtsp::TransportHeader();
+ $$->set_client_port ($2);
+ }
+ | WFD_TRANSPORT WFD_NUM '-' WFD_NUM {
+ $$ = new wds::rtsp::TransportHeader();
+ $$->set_client_port ($2);
+ $$->set_client_supports_rtcp (true);
+ }
+ | WFD_TRANSPORT WFD_NUM WFD_SERVER_PORT WFD_NUM {
+ $$ = new wds::rtsp::TransportHeader();
+ $$->set_client_port ($2);
+ $$->set_server_port ($4);
+ }
+ | WFD_TRANSPORT WFD_NUM '-' WFD_NUM WFD_SERVER_PORT WFD_NUM {
+ $$ = new wds::rtsp::TransportHeader();
+ $$->set_client_port ($2);
+ $$->set_client_supports_rtcp (true);
+ $$->set_server_port ($6);
+ }
+ | WFD_TRANSPORT WFD_NUM WFD_SERVER_PORT WFD_NUM '-' WFD_NUM {
+ $$ = new wds::rtsp::TransportHeader();
+ $$->set_client_port ($2);
+ $$->set_server_port ($4);
+ $$->set_server_supports_rtcp (true);
+ }
+ | WFD_TRANSPORT WFD_NUM '-' WFD_NUM WFD_SERVER_PORT WFD_NUM '-' WFD_NUM {
+ $$ = new wds::rtsp::TransportHeader();
+ $$->set_client_port ($2);
+ $$->set_client_supports_rtcp (true);
+ $$->set_server_port ($6);
+ $$->set_server_supports_rtcp (true);
+ }
+ ;
+
+wfd_supported_methods:
+ WFD_RESPONSE_METHODS wfd_ows wfd_methods {
+ $$ = $3;
+ }
+ ;
+
+wfd_methods:
+ wfd_method {
+ $$ = new std::vector<wds::rtsp::Method>();
+ $$->push_back($1);
+ }
+ | wfd_methods wfd_ows ',' wfd_ows wfd_method {
+ UNUSED_TOKEN($$);
+ $1->push_back($5);
+ }
+ ;
+
+wfd_method:
+ WFD_OPTIONS { $$ = wds::rtsp::OPTIONS; }
+ | WFD_SET_PARAMETER { $$ = wds::rtsp::SET_PARAMETER; }
+ | WFD_GET_PARAMETER { $$ = wds::rtsp::GET_PARAMETER; }
+ | WFD_SETUP { $$ = wds::rtsp::SETUP; }
+ | WFD_PLAY { $$ = wds::rtsp::PLAY; }
+ | WFD_TEARDOWN { $$ = wds::rtsp::TEARDOWN; }
+ | WFD_PAUSE { $$ = wds::rtsp::PAUSE; }
+ | WFD_TAG { $$ = wds::rtsp::ORG_WFA_WFD_1_0; }
+ ;
+
+wfd_ows:
+ /*blank*/
+ | WFD_SP
+ ;
+
+payload: {
+ $$ = 0;
+ }
+ | wfd_parameter_list
+ | wdf_property_map
+ | wfd_property_error_map
+ ;
+
+ /* used for GET_PARAMETER method */
+wfd_parameter_list:
+ wfd_parameter_list wfd_parameter {
+ UNUSED_TOKEN($$);
+ if (auto payload = ToGetParameterPayload($1))
+ payload->AddRequestProperty($2);
+ else
+ YYERROR;
+ }
+ | wfd_parameter {
+ $$ = new wds::rtsp::GetParameterPayload();
+ wds::rtsp::ToGetParameterPayload($$)->AddRequestProperty($1);
+ }
+ | wfd_parameter_list WFD_GENERIC_PROPERTY {
+ UNUSED_TOKEN($$);
+ if (auto payload = ToGetParameterPayload($1))
+ payload->AddRequestProperty(*$2);
+ else
+ YYERROR;
+ DELETE_TOKEN($2);
+ }
+ | WFD_GENERIC_PROPERTY {
+ $$ = new wds::rtsp::GetParameterPayload();
+ wds::rtsp::ToGetParameterPayload($$)->AddRequestProperty(*$1);
+ DELETE_TOKEN($1);
+ }
+ ;
+
+wfd_parameter:
+ WFD_AUDIO_CODECS { $$ = wds::rtsp::AudioCodecsPropertyType; }
+ | WFD_VIDEO_FORMATS { $$ = wds::rtsp::VideoFormatsPropertyType; }
+ | WFD_3D_FORMATS { $$ = wds::rtsp::Video3DFormatsPropertyType; }
+ | WFD_CONTENT_PROTECTION { $$ = wds::rtsp::ContentProtectionPropertyType; }
+ | WFD_DISPLAY_EDID { $$ = wds::rtsp::DisplayEdidPropertyType; }
+ | WFD_COUPLED_SINK { $$ = wds::rtsp::CoupledSinkPropertyType; }
+ | WFD_TRIGGER_METHOD { $$ = wds::rtsp::TriggerMethodPropertyType; }
+ | WFD_PRESENTATION_URL { $$ = wds::rtsp::PresentationURLPropertyType; }
+ | WFD_CLIENT_RTP_PORTS { $$ = wds::rtsp::ClientRTPPortsPropertyType; }
+ | WFD_ROUTE { $$ = wds::rtsp::RoutePropertyType; }
+ | WFD_I2C { $$ = wds::rtsp::I2CPropertyType; }
+ | WFD_AV_FORMAT_CHANGE_TIMING { $$ = wds::rtsp::AVFormatChangeTimingPropertyType; }
+ | WFD_PREFERRED_DISPLAY_MODE { $$ = wds::rtsp::PreferredDisplayModePropertyType; }
+ | WFD_UIBC_CAPABILITY { $$ = wds::rtsp::UIBCCapabilityPropertyType; }
+ | WFD_UIBC_SETTING { $$ = wds::rtsp::UIBCSettingPropertyType; }
+ | WFD_STANDBY_RESUME_CAPABILITY { $$ = wds::rtsp::StandbyResumeCapabilityPropertyType; }
+ | WFD_STANDBY_IN_REQUEST { $$ = wds::rtsp::StandbyPropertyType; }
+ | WFD_CONNECTOR_TYPE { $$ = wds::rtsp::ConnectorTypePropertyType; }
+ ;
+
+wfd_error_list:
+ WFD_NUM {
+ $$ = new std::vector<unsigned short>();
+ $$->push_back($1);
+ }
+ | wfd_error_list ',' WFD_SP WFD_NUM {
+ $1->push_back($4);
+ }
+
+wfd_property_errors:
+ WFD_AUDIO_CODECS_ERROR ':' WFD_SP wfd_error_list {
+ $$ = new wds::rtsp::PropertyErrors(wds::rtsp::AudioCodecsPropertyType, *$4);
+ DELETE_TOKEN($4);
+ }
+ | WFD_VIDEO_FORMATS_ERROR ':' WFD_SP wfd_error_list {
+ $$ = new wds::rtsp::PropertyErrors(wds::rtsp::VideoFormatsPropertyType, *$4);
+ DELETE_TOKEN($4);
+ }
+ | WFD_3D_FORMATS_ERROR ':' WFD_SP wfd_error_list {
+ $$ = new wds::rtsp::PropertyErrors(wds::rtsp::Video3DFormatsPropertyType, *$4);
+ DELETE_TOKEN($4);
+ }
+ | WFD_CONTENT_PROTECTION_ERROR ':' WFD_SP wfd_error_list {
+ $$ = new wds::rtsp::PropertyErrors(wds::rtsp::ContentProtectionPropertyType, *$4);
+ DELETE_TOKEN($4);
+ }
+ | WFD_DISPLAY_EDID_ERROR ':' WFD_SP wfd_error_list {
+ $$ = new wds::rtsp::PropertyErrors(wds::rtsp::DisplayEdidPropertyType, *$4);
+ DELETE_TOKEN($4);
+ }
+ | WFD_COUPLED_SINK_ERROR ':' WFD_SP wfd_error_list {
+ $$ = new wds::rtsp::PropertyErrors(wds::rtsp::CoupledSinkPropertyType, *$4);
+ DELETE_TOKEN($4);
+ }
+ | WFD_TRIGGER_METHOD_ERROR ':' WFD_SP wfd_error_list {
+ $$ = new wds::rtsp::PropertyErrors(wds::rtsp::TriggerMethodPropertyType, *$4);
+ DELETE_TOKEN($4);
+ }
+ | WFD_PRESENTATION_URL_ERROR ':' WFD_SP wfd_error_list {
+ $$ = new wds::rtsp::PropertyErrors(wds::rtsp::PresentationURLPropertyType, *$4);
+ DELETE_TOKEN($4);
+ }
+ | WFD_CLIENT_RTP_PORTS_ERROR ':' WFD_SP wfd_error_list {
+ $$ = new wds::rtsp::PropertyErrors(wds::rtsp::ClientRTPPortsPropertyType, *$4);
+ DELETE_TOKEN($4);
+ }
+ | WFD_ROUTE_ERROR ':' WFD_SP wfd_error_list {
+ $$ = new wds::rtsp::PropertyErrors(wds::rtsp::RoutePropertyType, *$4);
+ DELETE_TOKEN($4);
+ }
+ | WFD_I2C_ERROR ':' WFD_SP wfd_error_list {
+ $$ = new wds::rtsp::PropertyErrors(wds::rtsp::I2CPropertyType, *$4);
+ DELETE_TOKEN($4);
+ }
+ | WFD_AV_FORMAT_CHANGE_TIMING_ERROR ':' WFD_SP wfd_error_list {
+ $$ = new wds::rtsp::PropertyErrors(wds::rtsp::AVFormatChangeTimingPropertyType, *$4);
+ DELETE_TOKEN($4);
+ }
+ | WFD_PREFERRED_DISPLAY_MODE_ERROR ':' WFD_SP wfd_error_list {
+ $$ = new wds::rtsp::PropertyErrors(wds::rtsp::PreferredDisplayModePropertyType, *$4);
+ DELETE_TOKEN($4);
+ }
+ | WFD_UIBC_CAPABILITY_ERROR ':' WFD_SP wfd_error_list {
+ $$ = new wds::rtsp::PropertyErrors(wds::rtsp::UIBCCapabilityPropertyType, *$4);
+ DELETE_TOKEN($4);
+ }
+ | WFD_UIBC_SETTING_ERROR ':' WFD_SP wfd_error_list {
+ $$ = new wds::rtsp::PropertyErrors(wds::rtsp::UIBCSettingPropertyType, *$4);
+ DELETE_TOKEN($4);
+ }
+ | WFD_STANDBY_RESUME_CAPABILITY_ERROR ':' WFD_SP wfd_error_list {
+ $$ = new wds::rtsp::PropertyErrors(wds::rtsp::StandbyResumeCapabilityPropertyType, *$4);
+ DELETE_TOKEN($4);
+ }
+ | WFD_CONNECTOR_TYPE_ERROR ':' WFD_SP wfd_error_list {
+ $$ = new wds::rtsp::PropertyErrors(wds::rtsp::ConnectorTypePropertyType, *$4);
+ DELETE_TOKEN($4);
+ }
+ | WFD_IDR_REQUEST_ERROR ':' WFD_SP wfd_error_list {
+ $$ = new wds::rtsp::PropertyErrors(wds::rtsp::IDRRequestPropertyType, *$4);
+ DELETE_TOKEN($4);
+ }
+ | WFD_GENERIC_PROPERTY_ERROR ':' WFD_SP wfd_error_list {
+ $$ = new wds::rtsp::PropertyErrors(*$1, *$4);
+ DELETE_TOKEN($1);
+ DELETE_TOKEN($4);
+ }
+ ;
+
+wfd_property_error_map:
+ wfd_property_errors {
+ $$ = new wds::rtsp::PropertyErrorPayload();
+ ToPropertyErrorPayload($$)->AddPropertyError(std::shared_ptr<wds::rtsp::PropertyErrors>($1));
+ }
+ | wfd_property_error_map wfd_property_errors {
+ if (auto payload = ToPropertyErrorPayload($1))
+ payload->AddPropertyError(std::shared_ptr<wds::rtsp::PropertyErrors>($2));
+ else
+ YYERROR;
+ }
+ ;
+
+wdf_property_map:
+ wfd_property {
+ $$ = new wds::rtsp::PropertyMapPayload();
+ ToPropertyMapPayload($$)->AddProperty(std::shared_ptr<wds::rtsp::Property>($1));
+ }
+ | wdf_property_map wfd_property {
+ if (auto payload = ToPropertyMapPayload($1))
+ payload->AddProperty(std::shared_ptr<wds::rtsp::Property>($2));
+ else
+ YYERROR;
+ }
+ ;
+
+wfd_property:
+ wfd_property_audio_codecs
+ | wfd_property_video_formats
+ | wfd_property_3d_formats
+ | wfd_content_protection
+ | wfd_display_edid
+ | wfd_coupled_sink
+ | wfd_trigger_method
+ | wfd_presentation_url
+ | wfd_client_rtp_ports
+ | wfd_route
+ | wfd_I2C
+ | wfd_av_format_change_timing
+ | wfd_preferred_display_mode
+ | wfd_uibc_capability
+ | wfd_uibc_setting
+ | wfd_standby_resume_capability
+ | wfd_connector_type
+ | WFD_STANDBY_IN_RESPONSE {
+ $$ = new wds::rtsp::Standby();
+ }
+ | WFD_IDR_REQUEST {
+ $$ = new wds::rtsp::IDRRequest();
+ }
+ | WFD_GENERIC_PROPERTY WFD_STRING {
+ $$ = new wds::rtsp::GenericProperty(*$1, *$2);
+ DELETE_TOKEN($1);
+ DELETE_TOKEN($2);
+ }
+ ;
+
+wfd_property_audio_codecs:
+ WFD_AUDIO_CODECS ':' WFD_SP wfd_audio_codec_list {
+ $$ = new wds::rtsp::AudioCodecs(*$4);
+ DELETE_TOKEN($4);
+ }
+ | WFD_AUDIO_CODECS ':' WFD_SP WFD_NONE {
+ $$ = new wds::rtsp::AudioCodecs();
+ }
+ ;
+
+wfd_audio_codec_list:
+ wfd_audio_codec {
+ $$ = new std::vector<wds::AudioCodec>();
+ $$->push_back(*$1);
+ DELETE_TOKEN($1);
+ }
+ | wfd_audio_codec_list ',' WFD_SP wfd_audio_codec {
+ UNUSED_TOKEN($$);
+ $1->push_back(*$4);
+ DELETE_TOKEN($4);
+ }
+ ;
+
+wfd_audio_codec:
+ wfd_audio_codec_type WFD_SP WFD_NUM WFD_SP WFD_NUM {
+ $$ = new wds::AudioCodec($1, $3, $5);
+ }
+ ;
+
+wfd_audio_codec_type:
+ WFD_AUDIO_CODEC_LPCM { $$ = wds::LPCM; }
+ | WFD_AUDIO_CODEC_AAC { $$ = wds::AAC; }
+ | WFD_AUDIO_CODEC_AC3 { $$ = wds::AC3; }
+ ;
+
+wfd_property_video_formats:
+ WFD_VIDEO_FORMATS ':' wfd_ows WFD_NONE {
+ $$ = new wds::rtsp::VideoFormats();
+ }
+ /* native, preferred-display-mode-supported, H.264-codecs */
+ | WFD_VIDEO_FORMATS ':' wfd_ows WFD_NUM WFD_SP WFD_NUM WFD_SP wfd_h264_codecs {
+ $$ = new wds::rtsp::VideoFormats($4, $6, *$8);
+ DELETE_TOKEN($8);
+ }
+ ;
+
+wfd_h264_codecs:
+ wfd_h264_codec {
+ $$ = new wds::rtsp::H264Codecs();
+ $$->push_back(*$1);
+ DELETE_TOKEN($1);
+ }
+ | wfd_h264_codecs wfd_ows ',' wfd_ows wfd_h264_codec {
+ UNUSED_TOKEN($$);
+ $1->push_back(*$5);
+ DELETE_TOKEN($5);
+ }
+ ;
+
+wfd_h264_codec:
+ /* profile, level, misc-params , max-hres, max-vres */
+ WFD_NUM WFD_SP WFD_NUM WFD_SP WFD_NUM WFD_SP WFD_NUM WFD_SP WFD_NUM WFD_SP WFD_NUM WFD_SP WFD_NUM WFD_SP WFD_NUM WFD_SP WFD_NUM WFD_SP wfd_max_hres WFD_SP wfd_max_vres {
+ $$ = new wds::rtsp::H264Codec($1, $3, $5, $7, $9, $11, $13, $15, $17, $19, $21);
+ }
+
+
+wfd_h264_codecs_3d:
+ wfd_h264_codec_3d {
+ $$ = new wds::rtsp::H264Codecs3d();
+ $$->push_back(*$1);
+ DELETE_TOKEN($1);
+ }
+ | wfd_h264_codecs_3d wfd_ows ',' wfd_ows wfd_h264_codec_3d {
+ UNUSED_TOKEN($$);
+ $1->push_back(*$5);
+ DELETE_TOKEN($5);
+ }
+ ;
+
+wfd_h264_codec_3d:
+ WFD_NUM WFD_SP WFD_NUM WFD_SP WFD_NUM WFD_SP WFD_NUM WFD_SP WFD_NUM WFD_SP WFD_NUM WFD_SP WFD_NUM WFD_SP wfd_max_hres WFD_SP wfd_max_vres {
+ $$ = new wds::rtsp::H264Codec3d($1, $3, $5, $7, $9, $11, $13, $15, $17);
+ }
+ ;
+
+wfd_max_hres:
+ WFD_NONE {
+ $$ = 0;
+ }
+ | WFD_NUM
+ ;
+
+wfd_max_vres:
+ WFD_NONE {
+ $$ = 0;
+ }
+ | WFD_NUM
+ ;
+
+wfd_property_3d_formats:
+ /* native, preferred-display-mode-supported, H.264-codecs */
+ WFD_3D_FORMATS ':' WFD_SP WFD_NUM WFD_SP WFD_NUM WFD_SP wfd_h264_codecs_3d {
+ $$ = new wds::rtsp::Formats3d($4, $6, *$8);
+ DELETE_TOKEN($8);
+ }
+ | WFD_3D_FORMATS ':' WFD_SP WFD_NONE {
+ $$ = new wds::rtsp::Formats3d();
+ }
+ ;
+
+wfd_content_protection:
+ WFD_CONTENT_PROTECTION ':' WFD_SP WFD_NONE {
+ $$ = new wds::rtsp::ContentProtection();
+ }
+ | WFD_CONTENT_PROTECTION ':' WFD_SP hdcp2_spec WFD_SP WFD_IP_PORT WFD_NUM {
+ $$ = new wds::rtsp::ContentProtection($4, $7);
+ }
+ ;
+
+hdcp2_spec:
+ WFD_HDCP_SPEC_2_0 {
+ $$ = wds::rtsp::ContentProtection::HDCP_SPEC_2_0;
+ }
+ | WFD_HDCP_SPEC_2_1 {
+ $$ = wds::rtsp::ContentProtection::HDCP_SPEC_2_1;
+ }
+ ;
+
+wfd_display_edid:
+ WFD_DISPLAY_EDID ':' WFD_SP WFD_NONE {
+ $$ = new wds::rtsp::DisplayEdid();
+ }
+ | WFD_DISPLAY_EDID ':' WFD_SP WFD_NUM WFD_SP wfd_edid_payload {
+ $$ = new wds::rtsp::DisplayEdid($4, $6 ? *$6 : "");
+ DELETE_TOKEN($6);
+ }
+ ;
+
+wfd_edid_payload:
+ WFD_NONE {
+ $$ = 0;
+ }
+ | WFD_STRING
+ ;
+
+wfd_coupled_sink:
+ WFD_COUPLED_SINK ':' WFD_SP WFD_NONE {
+ $$ = new wds::rtsp::CoupledSink();
+ }
+ | WFD_COUPLED_SINK ':' WFD_SP WFD_NUM WFD_SP wfd_sink_address {
+ $$ = new wds::rtsp::CoupledSink($4, $6);
+ }
+ ;
+
+wfd_sink_address:
+ WFD_NONE {
+ $$ = -1;
+ }
+ | WFD_NUM
+ ;
+
+wfd_trigger_method:
+ WFD_TRIGGER_METHOD ':' WFD_SP wfd_supported_trigger_methods {
+ $$ = new wds::rtsp::TriggerMethod($4);
+ }
+ ;
+
+wfd_supported_trigger_methods:
+ WFD_SETUP {
+ $$ = wds::rtsp::TriggerMethod::SETUP;
+ }
+ | WFD_PAUSE{
+ $$ = wds::rtsp::TriggerMethod::PAUSE;
+ }
+ | WFD_TEARDOWN {
+ $$ = wds::rtsp::TriggerMethod::TEARDOWN;
+ }
+ | WFD_PLAY {
+ $$ = wds::rtsp::TriggerMethod::PLAY;
+ }
+ ;
+
+wfd_presentation_url:
+ WFD_PRESENTATION_URL ':' WFD_SP wfd_presentation_url0 WFD_SP wfd_presentation_url1 {
+ $$ = new wds::rtsp::PresentationUrl($4 ? *$4 : "", $6 ? *$6 : "");
+ DELETE_TOKEN($4);
+ DELETE_TOKEN($6);
+ }
+ ;
+
+wfd_presentation_url0:
+ WFD_NONE {
+ $$ = 0;
+ }
+ | WFD_PRESENTATION_URL_0
+ ;
+
+wfd_presentation_url1:
+ WFD_NONE {
+ $$ = 0;
+ }
+ | WFD_PRESENTATION_URL_1
+ ;
+
+wfd_client_rtp_ports:
+ WFD_CLIENT_RTP_PORTS ':' WFD_SP WFD_STREAM_PROFILE WFD_SP WFD_NUM WFD_SP WFD_NUM WFD_SP WFD_MODE_PLAY {
+ $$ = new wds::rtsp::ClientRtpPorts($6, $8);
+ }
+
+wfd_route:
+ WFD_ROUTE ':' WFD_SP wfd_route_destination {
+ $$ = new wds::rtsp::Route($4);
+ }
+ ;
+
+wfd_route_destination:
+ WFD_ROUTE_PRIMARY {
+ $$ = wds::rtsp::Route::PRIMARY;
+ }
+ | WFD_ROUTE_SECONDARY {
+ $$ = wds::rtsp::Route::SECONDARY;
+ }
+ ;
+
+wfd_I2C:
+ WFD_I2C ':' WFD_SP wfd_port {
+ $$ = new wds::rtsp::I2C($4);
+ }
+ ;
+
+wfd_port:
+ WFD_NONE {
+ $$ = -1;
+ }
+ | WFD_NUM
+ ;
+
+wfd_av_format_change_timing:
+ WFD_AV_FORMAT_CHANGE_TIMING ':' WFD_SP WFD_NUM WFD_SP WFD_NUM {
+ $$ = new wds::rtsp::AVFormatChangeTiming($4, $6);
+ }
+ ;
+
+wfd_preferred_display_mode:
+ /* p-clock SP H SP HB SP HSPOL-HSOFF SP HSW SP V SP VB SP VSPOL-VSOFF SP VSW SP VBS3D SP 2d-s3d-modes SP p-depth SP H.264-codec */
+ WFD_PREFERRED_DISPLAY_MODE ':' WFD_SP WFD_NUM WFD_SP WFD_NUM WFD_SP WFD_NUM WFD_SP WFD_NUM WFD_SP WFD_NUM WFD_SP WFD_NUM WFD_SP WFD_NUM WFD_SP WFD_NUM WFD_SP WFD_NUM WFD_SP WFD_NUM WFD_SP WFD_NUM WFD_SP WFD_NUM WFD_SP wfd_h264_codec {
+ $$ = new wds::rtsp::PreferredDisplayMode($4, $6, $8, $10, $12, $14, $16, $18, $20, $22, $24, $26, *$28);
+ DELETE_TOKEN($28);
+ }
+ ;
+
+wfd_uibc_capability:
+ WFD_UIBC_CAPABILITY ':' WFD_SP WFD_NONE {
+ $$ = new wds::rtsp::UIBCCapability();
+ }
+ | WFD_UIBC_CAPABILITY ':' WFD_SP wfd_input_category_list ';' wfd_generic_cap_list ';' wfd_hidc_cap_list ';' WFD_IP_PORT wfd_port {
+ $$ = new wds::rtsp::UIBCCapability(*$4, *$6, *$8, $11);
+ DELETE_TOKEN($4);
+ DELETE_TOKEN($6);
+ DELETE_TOKEN($8);
+ }
+ ;
+
+wfd_input_category_list:
+ WFD_INPUT_CATEGORY_LIST wfd_input_category_list_values {
+ $$ = $2;
+ }
+ ;
+
+wfd_input_category_list_values:
+ WFD_NONE {
+ $$ = new std::vector<wds::rtsp::UIBCCapability::InputCategory>();
+ }
+ | wfd_input_category_list_value {
+ $$ = new std::vector<wds::rtsp::UIBCCapability::InputCategory>();
+ $$->push_back($1);
+ }
+ | wfd_input_category_list_values ',' WFD_SP wfd_input_category_list_value {
+ $1->push_back($4);
+ }
+ ;
+
+wfd_input_category_list_value:
+ WFD_INPUT_CATEGORY_GENERIC {
+ $$ = wds::rtsp::UIBCCapability::GENERIC;
+ }
+ | WFD_INPUT_CATEGORY_HIDC {
+ $$ = wds::rtsp::UIBCCapability::HIDC;
+ }
+ ;
+
+wfd_generic_cap_list:
+ WFD_GENERIC_CAP_LIST wfd_generic_cap_list_values {
+ $$ = $2;
+ }
+ ;
+
+wfd_generic_cap_list_values:
+ WFD_NONE {
+ $$ = new std::vector<wds::rtsp::UIBCCapability::InputType>();
+ }
+ | wfd_generic_cap_list_value {
+ $$ = new std::vector<wds::rtsp::UIBCCapability::InputType>();
+ $$->push_back($1);
+ }
+ | wfd_generic_cap_list_values ',' WFD_SP wfd_generic_cap_list_value {
+ $1->push_back($4);
+ }
+ ;
+
+wfd_generic_cap_list_value:
+ WFD_INPUT_TYPE_KEYBOARD {
+ $$ = wds::rtsp::UIBCCapability::KEYBOARD;
+ }
+ | WFD_INPUT_TYPE_MOUSE {
+ $$ = wds::rtsp::UIBCCapability::MOUSE;
+ }
+ | WFD_INPUT_TYPE_SINGLE_TOUCH {
+ $$ = wds::rtsp::UIBCCapability::SINGLE_TOUCH;
+ }
+ | WFD_INPUT_TYPE_MULTI_TOUCH {
+ $$ = wds::rtsp::UIBCCapability::MULTI_TOUCH;
+ }
+ | WFD_INPUT_TYPE_JOYSTICK {
+ $$ = wds::rtsp::UIBCCapability::JOYSTICK;
+ }
+ | WFD_INPUT_TYPE_CAMERA {
+ $$ = wds::rtsp::UIBCCapability::CAMERA;
+ }
+ | WFD_INPUT_TYPE_GESTURE {
+ $$ = wds::rtsp::UIBCCapability::GESTURE;
+ }
+ | WFD_INPUT_TYPE_REMOTE_CONTROL {
+ $$ = wds::rtsp::UIBCCapability::REMOTE_CONTROL;
+ }
+ ;
+
+wfd_hidc_cap_list:
+ WFD_HIDC_CAP_LIST wfd_hidc_cap_list_values {
+ $$ = $2;
+ }
+ ;
+
+wfd_hidc_cap_list_values:
+ WFD_NONE {
+ $$ = new std::vector<wds::rtsp::UIBCCapability::DetailedCapability>();
+ }
+ | wfd_hidc_cap_list_value {
+ $$ = new std::vector<wds::rtsp::UIBCCapability::DetailedCapability>();
+ $$->push_back(*$1);
+ DELETE_TOKEN($1);
+ }
+ | wfd_hidc_cap_list_values ',' WFD_SP wfd_hidc_cap_list_value {
+ $1->push_back(*$4);
+ DELETE_TOKEN($4);
+ }
+ ;
+
+wfd_hidc_cap_list_value:
+ wfd_generic_cap_list_value '/' wfd_input_path {
+ $$ = new wds::rtsp::UIBCCapability::DetailedCapability($1, $3);
+ }
+ ;
+
+
+wfd_input_path:
+ WFD_INPUT_PATH_INFRARED {
+ $$ = wds::rtsp::UIBCCapability::INFRARED;
+ }
+ | WFD_INPUT_PATH_USB {
+ $$ = wds::rtsp::UIBCCapability::USB;
+ }
+ | WFD_INPUT_PATH_BT {
+ $$ = wds::rtsp::UIBCCapability::BT;
+ }
+ | WFD_INPUT_PATH_ZIGBEE {
+ $$ = wds::rtsp::UIBCCapability::ZIGBEE;
+ }
+ | WFD_INPUT_PATH_WIFI {
+ $$ = wds::rtsp::UIBCCapability::WI_FI;
+ }
+ | WFD_INPUT_PATH_NOSP {
+ $$ = wds::rtsp::UIBCCapability::NO_SP;
+ }
+ ;
+
+wfd_uibc_setting:
+ WFD_UIBC_SETTING ':' WFD_SP wfd_uibc_setting_value {
+ $$ = new wds::rtsp::UIBCSetting($4);
+ }
+ ;
+
+wfd_uibc_setting_value:
+ WFD_UIBC_SETTING_ENABLE {
+ $$ = true;
+ }
+ | WFD_UIBC_SETTING_DISABLE {
+ $$ = false;
+ }
+ ;
+
+wfd_standby_resume_capability:
+ WFD_STANDBY_RESUME_CAPABILITY ':' WFD_SP wfd_standby_resume_capability_value {
+ $$ = new wds::rtsp::StandbyResumeCapability($4);
+ }
+ ;
+
+wfd_standby_resume_capability_value:
+ WFD_NONE {
+ $$ = false;
+ }
+ | WFD_SUPPORTED {
+ $$ = true;
+ }
+ ;
+
+wfd_connector_type:
+ WFD_CONNECTOR_TYPE ':' WFD_SP WFD_NUM {
+ $$ = new wds::rtsp::ConnectorType($4);
+ }
+ | WFD_CONNECTOR_TYPE ':' WFD_SP WFD_NONE {
+ $$ = new wds::rtsp::ConnectorType();
+ }
+ ;
+
+%%
diff --git a/chromium/third_party/wds/src/libwds/rtsp/pause.cpp b/chromium/third_party/wds/src/libwds/rtsp/pause.cpp
new file mode 100644
index 00000000000..9219364de0c
--- /dev/null
+++ b/chromium/third_party/wds/src/libwds/rtsp/pause.cpp
@@ -0,0 +1,43 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+
+#include "libwds/rtsp/pause.h"
+
+namespace wds {
+namespace rtsp {
+
+Pause::Pause(const std::string& request_uri)
+ : Request(Request::MethodPause, request_uri) {
+}
+
+Pause::~Pause() {
+}
+
+std::string Pause::ToString() const {
+ std::string ret = MethodName::PAUSE
+ + std::string(SPACE) + request_uri()
+ + std::string(SPACE) + std::string(RTSP_END) + std::string(CRLF);
+ return ret + Message::ToString();
+}
+
+} // namespace rtsp
+} // namespace wds
diff --git a/chromium/third_party/wds/src/libwds/rtsp/pause.h b/chromium/third_party/wds/src/libwds/rtsp/pause.h
new file mode 100644
index 00000000000..cde625d424d
--- /dev/null
+++ b/chromium/third_party/wds/src/libwds/rtsp/pause.h
@@ -0,0 +1,41 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+
+#ifndef LIBWDS_RTSP_PAUSE_H_
+#define LIBWDS_RTSP_PAUSE_H_
+
+#include "libwds/rtsp/message.h"
+
+namespace wds {
+namespace rtsp {
+
+class Pause : public Request {
+ public:
+ explicit Pause(const std::string& request_uri);
+ ~Pause() override;
+ std::string ToString() const override;
+};
+
+} // namespace rtsp
+} // namespace wds
+
+#endif // LIBWDS_RTSP_PAUSE_H_
diff --git a/chromium/third_party/wds/src/libwds/rtsp/payload.cpp b/chromium/third_party/wds/src/libwds/rtsp/payload.cpp
new file mode 100644
index 00000000000..7477e587d17
--- /dev/null
+++ b/chromium/third_party/wds/src/libwds/rtsp/payload.cpp
@@ -0,0 +1,136 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+
+#include "libwds/rtsp/payload.h"
+
+namespace wds {
+namespace rtsp {
+
+Payload::~Payload() {
+}
+
+PropertyMapPayload::~PropertyMapPayload() {
+}
+
+std::shared_ptr<Property> PropertyMapPayload::GetProperty(
+ const std::string& name) const {
+ auto property = properties_.find(name);
+ if (property != properties_.end())
+ return property->second;
+ return nullptr;
+}
+
+std::shared_ptr<Property> PropertyMapPayload::GetProperty(
+ PropertyType type) const {
+ if (type == GenericPropertyType)
+ return nullptr;
+
+ return GetProperty(GetPropertyName(type));
+}
+
+bool PropertyMapPayload::HasProperty(PropertyType type) const {
+ return properties_.find(GetPropertyName(type)) != properties_.end();
+}
+
+void PropertyMapPayload::AddProperty(
+ const std::shared_ptr<Property>& property) {
+ properties_[property->GetName()] = property;
+}
+
+std::string PropertyMapPayload::ToString() const {
+ std::string ret;
+ for (auto it : properties_) {
+ if (auto property = it.second) {
+ ret += property->ToString();
+ ret += "\r\n";
+ }
+ }
+
+ return ret;
+}
+
+GetParameterPayload::GetParameterPayload(const std::vector<std::string>& properties)
+ : Payload(Payload::Requests),
+ properties_(properties) {
+}
+
+GetParameterPayload::~GetParameterPayload() {
+}
+
+void GetParameterPayload::AddRequestProperty(const PropertyType& type) {
+ properties_.push_back(GetPropertyName(type));
+}
+
+void GetParameterPayload::AddRequestProperty(
+ const std::string& generic_property) {
+ properties_.push_back(generic_property);
+}
+
+std::string GetParameterPayload::ToString() const {
+ std::string ret;
+ for (const std::string& property : properties_) {
+ ret += property;
+ ret += "\r\n";
+ }
+
+ return ret;
+}
+
+PropertyErrorPayload::~PropertyErrorPayload() {
+}
+
+std::shared_ptr<PropertyErrors> PropertyErrorPayload::GetPropertyError(
+ const std::string& name) const {
+ auto property = property_errors_.find(name);
+ if (property != property_errors_.end())
+ return property->second;
+ return nullptr;
+}
+
+std::shared_ptr<PropertyErrors> PropertyErrorPayload::GetPropertyError(
+ PropertyType type) const {
+ if (type == GenericPropertyType)
+ return nullptr;
+ return GetPropertyError(GetPropertyName(type));
+}
+
+void PropertyErrorPayload::AddPropertyError(const std::shared_ptr<PropertyErrors>& errors) {
+ if (errors->type() == GenericPropertyType) {
+ property_errors_[errors->generic_property_name()] = errors;
+ } else {
+ property_errors_[GetPropertyName(errors->type())] = errors;
+ }
+}
+
+std::string PropertyErrorPayload::ToString() const {
+ std::string ret;
+ for (auto it = property_errors_.rbegin();
+ it != property_errors_.rend(); ++it) {
+ ret += it->second->ToString();
+ ret += "\r\n";
+ }
+
+ return ret;
+}
+
+} // namespace rtsp
+} // namespace wds
diff --git a/chromium/third_party/wds/src/libwds/rtsp/payload.h b/chromium/third_party/wds/src/libwds/rtsp/payload.h
new file mode 100644
index 00000000000..c3e753c9ccd
--- /dev/null
+++ b/chromium/third_party/wds/src/libwds/rtsp/payload.h
@@ -0,0 +1,143 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+
+#ifndef LIBWDS_RTSP_PAYLOAD_H_
+#define LIBWDS_RTSP_PAYLOAD_H_
+
+#include <map>
+#include <memory>
+#include <string>
+#include <vector>
+
+#include "libwds/public/logging.h"
+
+#include "libwds/rtsp/property.h"
+#include "libwds/rtsp/genericproperty.h"
+#include "libwds/rtsp/propertyerrors.h"
+
+namespace wds {
+namespace rtsp {
+
+using PropertyMap = std::map<std::string, std::shared_ptr<Property>>;
+using PropertyErrorMap = std::map<std::string, std::shared_ptr<PropertyErrors>>;
+
+class Payload {
+ public:
+ enum Type {
+ Properties,
+ Requests,
+ Errors
+ };
+
+ virtual ~Payload();
+ virtual std::string ToString() const = 0;
+
+ Type type() const { return type_; }
+
+ protected:
+ explicit Payload(Type type) : type_(type) {}
+ Type type_;
+};
+
+class PropertyMapPayload : public Payload {
+ public:
+ PropertyMapPayload() : Payload(Payload::Properties) {}
+
+ ~PropertyMapPayload() override;
+
+ std::shared_ptr<Property> GetProperty(const std::string& name) const;
+ std::shared_ptr<Property> GetProperty(PropertyType type) const;
+ bool HasProperty(PropertyType type) const;
+ void AddProperty(const std::shared_ptr<Property>& property);
+ const PropertyMap& properties() const { return properties_; }
+
+ std::string ToString() const override;
+
+ private:
+ PropertyMap properties_;
+};
+
+inline PropertyMapPayload* ToPropertyMapPayload(Payload* payload) {
+ if (!payload)
+ return nullptr;
+ if (payload->type() == Payload::Properties)
+ return static_cast<PropertyMapPayload*>(payload);
+ WDS_ERROR("Inappropriate payload type");
+ return nullptr;
+}
+
+class GetParameterPayload : public Payload {
+ public:
+ GetParameterPayload() : Payload(Payload::Requests) {}
+ explicit GetParameterPayload(
+ const std::vector<std::string>& properties);
+ ~GetParameterPayload() override;
+
+ void AddRequestProperty(const PropertyType& property);
+ void AddRequestProperty(const std::string& generic_property);
+ const std::vector<std::string>& properties() const {
+ return properties_;
+ }
+
+ std::string ToString() const override;
+
+ private:
+ std::vector<std::string> properties_;
+};
+
+inline GetParameterPayload* ToGetParameterPayload(Payload* payload) {
+ if (!payload)
+ return nullptr;
+ if (payload->type() == Payload::Requests)
+ return static_cast<GetParameterPayload*>(payload);
+ WDS_ERROR("Inappropriate payload type");
+ return nullptr;
+}
+
+class PropertyErrorPayload : public Payload {
+ public:
+ PropertyErrorPayload() : Payload(Payload::Errors) {}
+ ~PropertyErrorPayload() override;
+
+ std::shared_ptr<PropertyErrors> GetPropertyError(const std::string& name) const;
+ std::shared_ptr<PropertyErrors> GetPropertyError(PropertyType type) const;
+ void AddPropertyError(const std::shared_ptr<PropertyErrors>& error);
+ const PropertyErrorMap& property_errors() const { return property_errors_; }
+ std::string ToString() const override;
+
+ private:
+ PropertyErrorMap property_errors_;
+};
+
+inline PropertyErrorPayload* ToPropertyErrorPayload(Payload* payload) {
+ if (!payload)
+ return nullptr;
+ if (payload->type() == Payload::Errors)
+ return static_cast<PropertyErrorPayload*>(payload);
+ WDS_ERROR("Inappropriate payload type");
+ return nullptr;
+}
+
+} // namespace rtsp
+} // namespace wds
+
+#endif // LIBWDS_RTSP_PAYLOAD_H_
diff --git a/chromium/third_party/wds/src/libwds/rtsp/play.cpp b/chromium/third_party/wds/src/libwds/rtsp/play.cpp
new file mode 100644
index 00000000000..2f85079bd5c
--- /dev/null
+++ b/chromium/third_party/wds/src/libwds/rtsp/play.cpp
@@ -0,0 +1,40 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+
+#include "libwds/rtsp/play.h"
+
+namespace wds {
+namespace rtsp {
+
+Play::Play(const std::string& request_uri)
+ : Request(Request::MethodPlay, request_uri) {
+}
+
+std::string Play::ToString() const {
+ std::string ret = MethodName::PLAY
+ + std::string(SPACE) + request_uri()
+ + std::string(SPACE) + std::string(RTSP_END) + std::string(CRLF);
+ return ret + Message::ToString();
+}
+
+} // namespace rtsp
+} // namespace wds
diff --git a/chromium/third_party/wds/src/libwds/rtsp/play.h b/chromium/third_party/wds/src/libwds/rtsp/play.h
new file mode 100644
index 00000000000..8ec5118e328
--- /dev/null
+++ b/chromium/third_party/wds/src/libwds/rtsp/play.h
@@ -0,0 +1,40 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+
+#ifndef LIBWDS_RTSP_PLAY_H_
+#define LIBWDS_RTSP_PLAY_H_
+
+#include "libwds/rtsp/message.h"
+
+namespace wds {
+namespace rtsp {
+
+class Play : public Request {
+ public:
+ explicit Play(const std::string& request_uri);
+ std::string ToString() const override;
+};
+
+} // namespace rtsp
+} // namespace wds
+
+#endif // LIBWDS_RTSP_PLAY_H_
diff --git a/chromium/third_party/wds/src/libwds/rtsp/preferreddisplaymode.cpp b/chromium/third_party/wds/src/libwds/rtsp/preferreddisplaymode.cpp
new file mode 100644
index 00000000000..9593793ae6b
--- /dev/null
+++ b/chromium/third_party/wds/src/libwds/rtsp/preferreddisplaymode.cpp
@@ -0,0 +1,88 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+
+#include "libwds/rtsp/preferreddisplaymode.h"
+
+#include "libwds/rtsp/macros.h"
+
+namespace wds {
+namespace rtsp {
+
+PreferredDisplayMode::PreferredDisplayMode(
+ unsigned int p_clock,unsigned short h,
+ unsigned short hb, unsigned short hspol_hsoff, unsigned short hsw,
+ unsigned short v, unsigned short vb, unsigned short vspol_vsoff,
+ unsigned short vsw, unsigned char vbs3d, unsigned char modes_2d_s3d,
+ unsigned char p_depth, const H264Codec& h264_codec)
+ : Property(PreferredDisplayModePropertyType),
+ p_clock_(p_clock),
+ h_(h),
+ hb_(hb),
+ hspol_hsoff_(hspol_hsoff),
+ hsw_(hsw),
+ v_(v),
+ vb_(vb),
+ vspol_vsoff_(vspol_vsoff),
+ vsw_(vsw),
+ vbs3d_(vbs3d),
+ modes_2d_s3d_(modes_2d_s3d),
+ p_depth_(p_depth),
+ h264_codec_(h264_codec) {
+}
+
+std::string PreferredDisplayMode::ToString() const {
+ MAKE_HEX_STRING_6(p_clock, p_clock_);
+ MAKE_HEX_STRING_4(h, h_);
+ MAKE_HEX_STRING_4(hb, hb_);
+ MAKE_HEX_STRING_4(hspol_hsoff, hspol_hsoff_);
+ MAKE_HEX_STRING_4(hsw, hsw_);
+ MAKE_HEX_STRING_4(v, v_);
+ MAKE_HEX_STRING_4(vb, vb_);
+ MAKE_HEX_STRING_4(vspol_vsoff, vspol_vsoff_);
+ MAKE_HEX_STRING_4(vsw, vsw_);
+ MAKE_HEX_STRING_2(vbs3d, vbs3d_);
+ MAKE_HEX_STRING_2(modes_2d_s3d, modes_2d_s3d_);
+ MAKE_HEX_STRING_2(p_depth, p_depth_);
+
+ std::string ret =
+ PropertyName::wfd_preferred_display_mode + std::string(SEMICOLON)
+ + std::string(SPACE) + p_clock
+ + std::string(SPACE) + h
+ + std::string(SPACE) + hb
+ + std::string(SPACE) + hspol_hsoff
+ + std::string(SPACE) + hsw
+ + std::string(SPACE) + v
+ + std::string(SPACE) + vb
+ + std::string(SPACE) + vspol_vsoff
+ + std::string(SPACE) + vsw
+ + std::string(SPACE) + vbs3d
+ + std::string(SPACE) + modes_2d_s3d
+ + std::string(SPACE) + p_depth
+ + std::string(SPACE) + h264_codec_.ToString();
+ return ret;
+}
+
+PreferredDisplayMode::~PreferredDisplayMode() {
+}
+
+} // namespace rtsp
+} // namespace wds
diff --git a/chromium/third_party/wds/src/libwds/rtsp/preferreddisplaymode.h b/chromium/third_party/wds/src/libwds/rtsp/preferreddisplaymode.h
new file mode 100644
index 00000000000..8d63acd9d82
--- /dev/null
+++ b/chromium/third_party/wds/src/libwds/rtsp/preferreddisplaymode.h
@@ -0,0 +1,78 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+
+#ifndef LIBWDS_RTSP_PREFERREDDISPLAYMODE_H_
+#define LIBWDS_RTSP_PREFERREDDISPLAYMODE_H_
+
+#include "libwds/rtsp/property.h"
+
+#include "libwds/rtsp/videoformats.h"
+
+namespace wds {
+namespace rtsp {
+
+class PreferredDisplayMode: public Property {
+ public:
+ PreferredDisplayMode(unsigned int p_clock, unsigned short h,
+ unsigned short hb, unsigned short hspol_hsoff, unsigned short hsw,
+ unsigned short v, unsigned short vb, unsigned short vspol_vsoff,
+ unsigned short vsw, unsigned char vbs3d, unsigned char modes_2d_s3d,
+ unsigned char p_depth, const H264Codec& h264_codec);
+
+ ~PreferredDisplayMode() override;
+
+ unsigned int p_clock() const { return p_clock_; }
+ unsigned short h() const { return h_; }
+ unsigned short hb() const { return hb_; }
+ unsigned short hspol_hsoff() const { return hspol_hsoff_; }
+ unsigned short hsw() const { return hsw_; }
+ unsigned short v() const { return v_; }
+ unsigned short vb() const { return vb_; }
+ unsigned short vspol_vsoff() const { return vspol_vsoff_; }
+ unsigned short vsw() const { return vsw_; }
+ unsigned char vbs3d() const { return vbs3d_; }
+ unsigned char modes_2d_s3d() const { return modes_2d_s3d_; }
+ unsigned char p_depth() const { return p_depth_; }
+ const H264Codec& h264_codec() const { return h264_codec_; }
+
+ std::string ToString() const override;
+
+ private:
+ unsigned int p_clock_;
+ unsigned short h_;
+ unsigned short hb_;
+ unsigned short hspol_hsoff_;
+ unsigned short hsw_;
+ unsigned short v_;
+ unsigned short vb_;
+ unsigned short vspol_vsoff_;
+ unsigned short vsw_;
+ unsigned char vbs3d_;
+ unsigned char modes_2d_s3d_;
+ unsigned char p_depth_;
+ H264Codec h264_codec_;
+};
+
+} // namespace rtsp
+} // namespace wds
+
+#endif // LIBWDS_RTSP_PREFERREDDISPLAYMODE_H_
diff --git a/chromium/third_party/wds/src/libwds/rtsp/presentationurl.cpp b/chromium/third_party/wds/src/libwds/rtsp/presentationurl.cpp
new file mode 100644
index 00000000000..1a04863079e
--- /dev/null
+++ b/chromium/third_party/wds/src/libwds/rtsp/presentationurl.cpp
@@ -0,0 +1,49 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+
+#include "libwds/rtsp/presentationurl.h"
+
+namespace wds {
+namespace rtsp {
+
+PresentationUrl::PresentationUrl(const std::string& presentation_url_1,
+ const std::string presentation_url_2)
+ : Property(PresentationURLPropertyType),
+ presentation_url_1_(presentation_url_1),
+ presentation_url_2_(presentation_url_2) {
+}
+
+PresentationUrl::~PresentationUrl() {
+}
+
+std::string PresentationUrl::ToString() const {
+ std::string ret =
+ PropertyName::wfd_presentation_url + std::string(SEMICOLON)
+ + std::string(SPACE)
+ + (presentation_url_1_.length() ? presentation_url_1_ : NONE)
+ + std::string(SPACE)
+ + (presentation_url_2_.length() ? presentation_url_2_ : NONE);
+ return ret;
+}
+
+} // namespace rtsp
+} // namespace wds
diff --git a/chromium/third_party/wds/src/libwds/rtsp/presentationurl.h b/chromium/third_party/wds/src/libwds/rtsp/presentationurl.h
new file mode 100644
index 00000000000..18686a2fd5d
--- /dev/null
+++ b/chromium/third_party/wds/src/libwds/rtsp/presentationurl.h
@@ -0,0 +1,49 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+
+#ifndef LIBWDS_RTSP_PRESENTATIONURL_H_
+#define LIBWDS_RTSP_PRESENTATIONURL_H_
+
+#include "libwds/rtsp/property.h"
+
+namespace wds {
+namespace rtsp {
+
+class PresentationUrl: public Property {
+ public:
+ PresentationUrl(const std::string& presentation_url_1,
+ const std::string presentation_url_2);
+ ~PresentationUrl() override;
+
+ const std::string& presentation_url_1() const { return presentation_url_1_; }
+ const std::string& presentation_url_2() const { return presentation_url_2_; }
+ std::string ToString() const override;
+
+ private:
+ std::string presentation_url_1_;
+ std::string presentation_url_2_;
+};
+
+} // namespace rtsp
+} // namespace wds
+
+#endif // LIBWDS_RTSP_PRESENTATIONURL_H_
diff --git a/chromium/third_party/wds/src/libwds/rtsp/property.cpp b/chromium/third_party/wds/src/libwds/rtsp/property.cpp
new file mode 100644
index 00000000000..d1baa8ef629
--- /dev/null
+++ b/chromium/third_party/wds/src/libwds/rtsp/property.cpp
@@ -0,0 +1,102 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+#include "libwds/rtsp/property.h"
+
+#include "libwds/public/logging.h"
+
+namespace wds {
+namespace rtsp {
+
+Property::Property(PropertyType type)
+ : type_(type),
+ is_none_(false) {
+}
+
+Property::Property(PropertyType type, bool is_none)
+ : type_(type),
+ is_none_(is_none) {
+}
+
+Property::~Property() {
+}
+
+std::string Property::ToString() const {
+ return std::string();
+}
+
+std::string Property::GetName() const {
+ if (type_ == GenericPropertyType)
+ return std::string();
+ return GetPropertyName(type_);
+}
+
+std::string GetPropertyName(PropertyType type) {
+ switch(type) {
+ case AVFormatChangeTimingPropertyType:
+ return PropertyName::wfd_av_format_change_timing;
+ case AudioCodecsPropertyType:
+ return PropertyName::wfd_audio_codecs;
+ case ClientRTPPortsPropertyType:
+ return PropertyName::wfd_client_rtp_ports;
+ case ConnectorTypePropertyType:
+ return PropertyName::wfd_connector_type;
+ case ContentProtectionPropertyType:
+ return PropertyName::wfd_content_protection;
+ case CoupledSinkPropertyType:
+ return PropertyName::wfd_coupled_sink;
+ case DisplayEdidPropertyType:
+ return PropertyName::wfd_display_edid;
+ case GenericPropertyType:
+ WDS_ERROR("Generic property does not have a defined name");
+ return std::string();
+ case I2CPropertyType:
+ return PropertyName::wfd_I2C;
+ case IDRRequestPropertyType:
+ return PropertyName::wfd_idr_request;
+ case PreferredDisplayModePropertyType:
+ return PropertyName::wfd_preferred_display_mode;
+ case PresentationURLPropertyType:
+ return PropertyName::wfd_presentation_url;
+ case RoutePropertyType:
+ return PropertyName::wfd_route;
+ case StandbyPropertyType:
+ return PropertyName::wfd_standby;
+ case StandbyResumeCapabilityPropertyType:
+ return PropertyName::wfd_standby_resume_capability;
+ case TriggerMethodPropertyType:
+ return PropertyName::wfd_trigger_method;
+ case UIBCCapabilityPropertyType:
+ return PropertyName::wfd_uibc_capability;
+ case UIBCSettingPropertyType:
+ return PropertyName::wfd_uibc_setting;
+ case Video3DFormatsPropertyType:
+ return PropertyName::wfd_3d_video_formats;
+ case VideoFormatsPropertyType:
+ return PropertyName::wfd_video_formats;
+ default:
+ WDS_ERROR("Unknown property type %d", type);
+ return std::string();
+ }
+}
+
+} // namespace rtsp
+} // namespace wds
diff --git a/chromium/third_party/wds/src/libwds/rtsp/property.h b/chromium/third_party/wds/src/libwds/rtsp/property.h
new file mode 100644
index 00000000000..b083edb7db7
--- /dev/null
+++ b/chromium/third_party/wds/src/libwds/rtsp/property.h
@@ -0,0 +1,58 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+
+#ifndef LIBWDS_RTSP_PROPERTY_H_
+#define LIBWDS_RTSP_PROPERTY_H_
+
+#include <string>
+#include <map>
+
+#include "libwds/rtsp/constants.h"
+
+namespace wds {
+namespace rtsp {
+
+class Property {
+ public:
+ explicit Property(PropertyType type);
+ virtual ~Property();
+ virtual std::string ToString() const;
+
+ PropertyType type() { return type_; }
+ bool is_none() const { return is_none_; }
+
+ virtual std::string GetName() const;
+
+ protected:
+ Property(PropertyType type, bool is_none_);
+
+ private:
+ PropertyType type_;
+ bool is_none_;
+};
+
+std::string GetPropertyName(PropertyType type);
+
+} // namespace wds
+} // namespace rtsp
+
+#endif // LIBWDS_RTSP_PROPERTY_H_
diff --git a/chromium/third_party/wds/src/libwds/rtsp/propertyerrors.cpp b/chromium/third_party/wds/src/libwds/rtsp/propertyerrors.cpp
new file mode 100644
index 00000000000..fec4c6d4ac8
--- /dev/null
+++ b/chromium/third_party/wds/src/libwds/rtsp/propertyerrors.cpp
@@ -0,0 +1,69 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+
+#include "libwds/rtsp/propertyerrors.h"
+#include "libwds/rtsp/property.h"
+
+#include <assert.h>
+
+namespace wds {
+namespace rtsp {
+
+PropertyErrors::PropertyErrors(PropertyType type,
+ const std::vector<unsigned short>& error_codes)
+ : type_(type),
+ error_codes_(error_codes) {
+}
+
+PropertyErrors::PropertyErrors(const std::string& generic_property_name,
+ const std::vector<unsigned short>& error_codes)
+ : type_(GenericPropertyType),
+ generic_property_name_(generic_property_name),
+ error_codes_(error_codes) {
+}
+
+PropertyErrors::~PropertyErrors() {
+}
+
+std::string PropertyErrors::ToString() const {
+ std::string ret;
+
+ if (type_ == GenericPropertyType)
+ ret += generic_property_name_;
+ else
+ ret += GetPropertyName(type_);
+
+ ret += std::string(SEMICOLON) + std::string(SPACE);
+
+ auto it = error_codes_.begin();
+ while (it != error_codes_.end()) {
+ ret += std::to_string(*it);
+ it++;
+ if (it != error_codes_.end())
+ ret += ", ";
+ }
+
+ return ret;
+}
+
+} // namespace rtsp
+} // namespace wds
diff --git a/chromium/third_party/wds/src/libwds/rtsp/propertyerrors.h b/chromium/third_party/wds/src/libwds/rtsp/propertyerrors.h
new file mode 100644
index 00000000000..9443d8b72b3
--- /dev/null
+++ b/chromium/third_party/wds/src/libwds/rtsp/propertyerrors.h
@@ -0,0 +1,54 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+
+#ifndef LIBWDS_RTSP_PROPERTYERRORS_H_
+#define LIBWDS_RTSP_PROPERTYERRORS_H_
+
+#include <string>
+#include <vector>
+#include "libwds/rtsp/constants.h"
+
+namespace wds {
+namespace rtsp {
+
+class PropertyErrors {
+ public:
+ PropertyErrors(PropertyType type, const std::vector<unsigned short>& error_codes);
+ PropertyErrors(const std::string& generic_property_name, const std::vector<unsigned short>& error_codes);
+ ~PropertyErrors();
+
+ PropertyType type() const { return type_; }
+ const std::vector<unsigned short>& error_codes() const { return error_codes_; }
+ const std::string& generic_property_name() const { return generic_property_name_; }
+
+ std::string ToString() const;
+
+ private:
+ PropertyType type_;
+ std::string generic_property_name_;
+ std::vector<unsigned short> error_codes_;
+};
+
+} // namespace rtsp
+} // namespace wds
+
+#endif // LIBWDS_RTSP_PROPERTYERRORS_H_
diff --git a/chromium/third_party/wds/src/libwds/rtsp/reply.cpp b/chromium/third_party/wds/src/libwds/rtsp/reply.cpp
new file mode 100644
index 00000000000..90db3024629
--- /dev/null
+++ b/chromium/third_party/wds/src/libwds/rtsp/reply.cpp
@@ -0,0 +1,49 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+
+#include "libwds/rtsp/reply.h"
+
+namespace wds {
+namespace rtsp {
+
+namespace {
+ const char kRTSPHeader[] = "RTSP/1.0 ";
+ const char kOK[] = "OK";
+}
+
+Reply::Reply(int response_code)
+ : Message(Message::REPLY),
+ response_code_(response_code) {
+}
+
+Reply::~Reply() {
+}
+
+std::string Reply::ToString() const {
+ std::string ret;
+ ret += kRTSPHeader + std::to_string(response_code_)
+ + std::string(SPACE) + kOK + std::string(CRLF);
+ return ret + Message::ToString();
+}
+
+} // namespace rtsp
+} // namespace wds
diff --git a/chromium/third_party/wds/src/libwds/rtsp/reply.h b/chromium/third_party/wds/src/libwds/rtsp/reply.h
new file mode 100644
index 00000000000..aa82ad39904
--- /dev/null
+++ b/chromium/third_party/wds/src/libwds/rtsp/reply.h
@@ -0,0 +1,48 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+
+#ifndef LIBWDS_RTSP_REPLY_H_
+#define LIBWDS_RTSP_REPLY_H_
+
+#include "libwds/rtsp/message.h"
+
+namespace wds {
+namespace rtsp {
+
+class Reply: public Message {
+ public:
+ explicit Reply(int response_code = STATUS_OK);
+ ~Reply() override;
+
+ int response_code() const { return response_code_; }
+ void set_response_code(int response_code) { response_code_ = response_code; }
+
+ std::string ToString() const override;
+
+ private:
+ int response_code_;
+};
+
+} // namespace rtsp
+} // namespace wds
+
+#endif // LIBWDS_RTSP_REPLY_H_
diff --git a/chromium/third_party/wds/src/libwds/rtsp/route.cpp b/chromium/third_party/wds/src/libwds/rtsp/route.cpp
new file mode 100644
index 00000000000..500d869650a
--- /dev/null
+++ b/chromium/third_party/wds/src/libwds/rtsp/route.cpp
@@ -0,0 +1,48 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+
+#include "libwds/rtsp/route.h"
+
+namespace wds {
+namespace rtsp {
+
+namespace {
+const char primary[] = "primary";
+const char secondary[] = "secondary";
+}
+
+Route::Route(const Route::Destination& destination)
+ : Property(RoutePropertyType), destination_(destination) {
+
+}
+
+Route::~Route() {
+}
+
+std::string Route::ToString() const {
+ std::string ret = PropertyName::wfd_route+ std::string(SEMICOLON)
+ + std::string(SPACE) + (destination() == PRIMARY ? primary : secondary);
+ return ret;
+}
+
+} // namespace rtsp
+} // namespace wds
diff --git a/chromium/third_party/wds/src/libwds/rtsp/route.h b/chromium/third_party/wds/src/libwds/rtsp/route.h
new file mode 100644
index 00000000000..b81221b7263
--- /dev/null
+++ b/chromium/third_party/wds/src/libwds/rtsp/route.h
@@ -0,0 +1,52 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+
+#ifndef LIBWDS_RTSP_ROUTE_H_
+#define LIBWDS_RTSP_ROUTE_H_
+
+#include "libwds/rtsp/property.h"
+
+namespace wds {
+namespace rtsp {
+
+class Route: public Property {
+ public:
+ enum Destination {
+ PRIMARY,
+ SECONDARY
+ };
+
+ public:
+ explicit Route(const Route::Destination& destination);
+ ~Route() override;
+
+ Route::Destination destination() const { return destination_; }
+ std::string ToString() const override;
+
+ private:
+ Route::Destination destination_;
+};
+
+} // namespace rtsp
+} // namespace wds
+
+#endif // LIBWDS_RTSP_ROUTE_H_
diff --git a/chromium/third_party/wds/src/libwds/rtsp/setparameter.cpp b/chromium/third_party/wds/src/libwds/rtsp/setparameter.cpp
new file mode 100644
index 00000000000..86a5cbef13b
--- /dev/null
+++ b/chromium/third_party/wds/src/libwds/rtsp/setparameter.cpp
@@ -0,0 +1,41 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+
+#include "libwds/rtsp/setparameter.h"
+#include "libwds/rtsp/triggermethod.h"
+
+namespace wds {
+namespace rtsp {
+
+SetParameter::SetParameter(const std::string& request_uri)
+ : Request(Request::MethodSetParameter, request_uri) {
+}
+
+std::string SetParameter::ToString() const {
+ std::string ret = MethodName::SET_PARAMETER
+ + std::string(SPACE) + request_uri()
+ + std::string(SPACE) + std::string(RTSP_END) + std::string(CRLF);
+ return ret + Message::ToString();
+}
+
+} // namespace rtsp
+} // namespace wds
diff --git a/chromium/third_party/wds/src/libwds/rtsp/setparameter.h b/chromium/third_party/wds/src/libwds/rtsp/setparameter.h
new file mode 100644
index 00000000000..590bf7e03ec
--- /dev/null
+++ b/chromium/third_party/wds/src/libwds/rtsp/setparameter.h
@@ -0,0 +1,40 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+
+#ifndef LIBWDS_RTSP_SETPARAMETER_H_
+#define LIBWDS_RTSP_SETPARAMETER_H_
+
+#include "libwds/rtsp/message.h"
+
+namespace wds {
+namespace rtsp {
+
+class SetParameter : public Request {
+ public:
+ explicit SetParameter(const std::string& request_uri);
+ std::string ToString() const override;
+};
+
+} // namespace rtsp
+} // namespace wds
+
+#endif // LIBWDS_RTSP_SETPARAMETER_H_
diff --git a/chromium/third_party/wds/src/libwds/rtsp/setup.cpp b/chromium/third_party/wds/src/libwds/rtsp/setup.cpp
new file mode 100644
index 00000000000..e1d3b580ff7
--- /dev/null
+++ b/chromium/third_party/wds/src/libwds/rtsp/setup.cpp
@@ -0,0 +1,43 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+
+#include "libwds/rtsp/setup.h"
+
+namespace wds {
+namespace rtsp {
+
+Setup::Setup(const std::string& request_uri)
+ : Request(Request::MethodSetup, request_uri) {
+}
+
+Setup::~Setup() {
+}
+
+std::string Setup::ToString() const {
+ std::string ret = MethodName::SETUP
+ + std::string(SPACE) + request_uri()
+ + std::string(SPACE) + std::string(RTSP_END) + std::string(CRLF);
+ return ret + Message::ToString();
+}
+
+} // namespace rtsp
+} // namespace wds
diff --git a/chromium/third_party/wds/src/libwds/rtsp/setup.h b/chromium/third_party/wds/src/libwds/rtsp/setup.h
new file mode 100644
index 00000000000..977c2761421
--- /dev/null
+++ b/chromium/third_party/wds/src/libwds/rtsp/setup.h
@@ -0,0 +1,41 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+
+#ifndef LIBWDS_RTSP_SETUP_H_
+#define LIBWDS_RTSP_SETUP_H_
+
+#include "libwds/rtsp/message.h"
+
+namespace wds {
+namespace rtsp {
+
+class Setup : public Request {
+ public:
+ explicit Setup(const std::string& request_uri);
+ ~Setup() override;
+ std::string ToString() const override;
+};
+
+} // namespace rtsp
+} // namespace wds
+
+#endif // LIBWDS_RTSP_SETUP_H_
diff --git a/chromium/third_party/wds/src/libwds/rtsp/standby.cpp b/chromium/third_party/wds/src/libwds/rtsp/standby.cpp
new file mode 100644
index 00000000000..f21b5c98b69
--- /dev/null
+++ b/chromium/third_party/wds/src/libwds/rtsp/standby.cpp
@@ -0,0 +1,39 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+
+#include "libwds/rtsp/standby.h"
+
+namespace wds {
+namespace rtsp {
+
+Standby::Standby() : Property(StandbyPropertyType) {
+}
+
+Standby::~Standby() {
+}
+
+std::string Standby::ToString() const {
+ return std::string("wfd_standby");
+}
+
+} // namespace rtsp
+} // namespace wds
diff --git a/chromium/third_party/wds/src/libwds/rtsp/standby.h b/chromium/third_party/wds/src/libwds/rtsp/standby.h
new file mode 100644
index 00000000000..e3a1be14aef
--- /dev/null
+++ b/chromium/third_party/wds/src/libwds/rtsp/standby.h
@@ -0,0 +1,41 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+
+#ifndef LIBWDS_RTSP_STANDBY_H_
+#define LIBWDS_RTSP_STANDBY_H_
+
+#include "libwds/rtsp/property.h"
+
+namespace wds {
+namespace rtsp {
+
+class Standby: public Property {
+public:
+ Standby();
+ ~Standby() override;
+ std::string ToString() const override;
+};
+
+} // namespace rtsp
+} // namespace wds
+
+#endif // LIBWDS_RTSP_STANDBY_H_
diff --git a/chromium/third_party/wds/src/libwds/rtsp/standbyresumecapability.cpp b/chromium/third_party/wds/src/libwds/rtsp/standbyresumecapability.cpp
new file mode 100644
index 00000000000..cd293610de9
--- /dev/null
+++ b/chromium/third_party/wds/src/libwds/rtsp/standbyresumecapability.cpp
@@ -0,0 +1,47 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+
+#include "libwds/rtsp/standbyresumecapability.h"
+
+namespace wds {
+namespace rtsp {
+
+namespace {
+const char supported[] = "supported";
+}
+
+StandbyResumeCapability::StandbyResumeCapability(bool is_supported)
+ : Property(StandbyResumeCapabilityPropertyType, !is_supported) {
+}
+
+StandbyResumeCapability::~StandbyResumeCapability() {
+}
+
+std::string StandbyResumeCapability::ToString() const {
+ std::string ret =
+ PropertyName::wfd_standby_resume_capability + std::string(SEMICOLON)
+ + std::string(SPACE) + (is_none() ? NONE : supported);
+ return ret;
+}
+
+} // namespace rtsp
+} // namespace wds
diff --git a/chromium/third_party/wds/src/libwds/rtsp/standbyresumecapability.h b/chromium/third_party/wds/src/libwds/rtsp/standbyresumecapability.h
new file mode 100644
index 00000000000..01b9f7c70dd
--- /dev/null
+++ b/chromium/third_party/wds/src/libwds/rtsp/standbyresumecapability.h
@@ -0,0 +1,42 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+
+#ifndef LIBWDS_RTSP_STANDBYRESUMECAPABILITY_H_
+#define LIBWDS_RTSP_STANDBYRESUMECAPABILITY_H_
+
+#include "libwds/rtsp/property.h"
+
+namespace wds {
+namespace rtsp {
+
+class StandbyResumeCapability: public Property {
+public:
+ explicit StandbyResumeCapability(bool is_supported);
+ ~StandbyResumeCapability() override;
+
+ std::string ToString() const override;
+};
+
+} // namespace rtsp
+} // namespace wds
+
+#endif // LIBWDS_RTSP_STANDBYRESUMECAPABILITY_H_
diff --git a/chromium/third_party/wds/src/libwds/rtsp/teardown.cpp b/chromium/third_party/wds/src/libwds/rtsp/teardown.cpp
new file mode 100644
index 00000000000..79727cf567e
--- /dev/null
+++ b/chromium/third_party/wds/src/libwds/rtsp/teardown.cpp
@@ -0,0 +1,43 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+
+#include "libwds/rtsp/teardown.h"
+
+namespace wds {
+namespace rtsp {
+
+Teardown::Teardown(const std::string& request_uri)
+ : Request(Request::MethodTeardown, request_uri) {
+}
+
+Teardown::~Teardown() {
+}
+
+std::string Teardown::ToString() const {
+ std::string ret = MethodName::TEARDOWN
+ + std::string(SPACE) + request_uri()
+ + std::string(SPACE) + std::string(RTSP_END) + std::string(CRLF);
+ return ret + Message::ToString();
+}
+
+} // namespace rtsp
+} // namespace wds
diff --git a/chromium/third_party/wds/src/libwds/rtsp/teardown.h b/chromium/third_party/wds/src/libwds/rtsp/teardown.h
new file mode 100644
index 00000000000..7c39464d513
--- /dev/null
+++ b/chromium/third_party/wds/src/libwds/rtsp/teardown.h
@@ -0,0 +1,41 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+
+#ifndef LIBWDS_RTSP_TEARDOWN_H_
+#define LIBWDS_RTSP_TEARDOWN_H_
+
+#include "libwds/rtsp/message.h"
+
+namespace wds {
+namespace rtsp {
+
+class Teardown : public Request {
+ public:
+ explicit Teardown(const std::string& request_uri);
+ ~Teardown() override;
+ std::string ToString() const override;
+};
+
+} // namespace rtsp
+} // namespace wds
+
+#endif // LIBWDS_RTSP_TEARDOWN_H_
diff --git a/chromium/third_party/wds/src/libwds/rtsp/transportheader.cpp b/chromium/third_party/wds/src/libwds/rtsp/transportheader.cpp
new file mode 100644
index 00000000000..56b2d3d1c3e
--- /dev/null
+++ b/chromium/third_party/wds/src/libwds/rtsp/transportheader.cpp
@@ -0,0 +1,97 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+
+#include "libwds/rtsp/transportheader.h"
+#include "libwds/rtsp/constants.h"
+
+namespace wds {
+namespace rtsp {
+
+namespace {
+ const char kTransport[] = "Transport: RTP/AVP/UDP;unicast;client_port=";
+ const char kServerPort[] = ";server_port=";
+}
+
+TransportHeader::TransportHeader() :
+ client_port_(0),
+ server_port_(0),
+ client_supports_rtcp_(false),
+ server_supports_rtcp_(false) {
+
+}
+
+TransportHeader::~TransportHeader() {
+}
+
+unsigned int TransportHeader::client_port() const {
+ return client_port_;
+}
+
+void TransportHeader::set_client_port(unsigned int client_port) {
+ client_port_ = client_port;
+}
+
+unsigned int TransportHeader::server_port() const {
+ return server_port_;
+}
+
+void TransportHeader::set_server_port(unsigned int server_port) {
+ server_port_ = server_port;
+}
+
+bool TransportHeader::client_supports_rtcp() const {
+ return client_supports_rtcp_;
+}
+
+void TransportHeader::set_client_supports_rtcp(bool client_supports_rtcp) {
+ client_supports_rtcp_ = client_supports_rtcp;
+}
+
+bool TransportHeader::server_supports_rtcp() const {
+ return server_supports_rtcp_;
+}
+
+void TransportHeader::set_server_supports_rtcp(bool server_supports_rtcp) {
+ server_supports_rtcp_ = server_supports_rtcp;
+}
+
+std::string TransportHeader::ToString() const {
+ std::string ret;
+
+ if (client_port_ > 0) {
+ ret += kTransport + std::to_string(client_port_);
+ if (client_supports_rtcp_)
+ ret += "-" + std::to_string(client_port_ + 1);
+
+ if (server_port_ > 0) {
+ ret += kServerPort + std::to_string(server_port_);
+ if (server_supports_rtcp_)
+ ret += "-" + std::to_string(server_port_ + 1);
+ }
+
+ ret += CRLF;
+ }
+ return ret;
+}
+
+} // namespace rtsp
+} // namespace wds
diff --git a/chromium/third_party/wds/src/libwds/rtsp/transportheader.h b/chromium/third_party/wds/src/libwds/rtsp/transportheader.h
new file mode 100644
index 00000000000..d08f6c58ceb
--- /dev/null
+++ b/chromium/third_party/wds/src/libwds/rtsp/transportheader.h
@@ -0,0 +1,60 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+
+#ifndef LIBWDS_RTSP_TRANSPORT_HEADER_H_
+#define LIBWDS_RTSP_TRANSPORT_HEADER_H_
+
+#include <string>
+
+namespace wds {
+namespace rtsp {
+
+class TransportHeader {
+ public:
+ TransportHeader();
+ virtual ~TransportHeader();
+
+ unsigned int client_port() const;
+ void set_client_port(unsigned int client_port);
+
+ unsigned int server_port() const;
+ void set_server_port(unsigned int server_port);
+
+ bool client_supports_rtcp() const;
+ void set_client_supports_rtcp(bool client_supports_rtcp);
+
+ bool server_supports_rtcp() const;
+ void set_server_supports_rtcp(bool server_supports_rtcp);
+
+ std::string ToString() const;
+
+ private:
+ unsigned int client_port_;
+ unsigned int server_port_;
+ bool client_supports_rtcp_;
+ bool server_supports_rtcp_;
+};
+
+} // namespace rtsp
+} // namespace wds
+
+#endif // LIBWDS_RTSP_TRANSPORT_HEADER_H_
diff --git a/chromium/third_party/wds/src/libwds/rtsp/triggermethod.cpp b/chromium/third_party/wds/src/libwds/rtsp/triggermethod.cpp
new file mode 100644
index 00000000000..4c20d1add52
--- /dev/null
+++ b/chromium/third_party/wds/src/libwds/rtsp/triggermethod.cpp
@@ -0,0 +1,49 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+
+#include "libwds/rtsp/triggermethod.h"
+
+namespace wds {
+namespace rtsp {
+
+namespace {
+const char* name[] = {MethodName::SETUP, MethodName::PAUSE,
+ MethodName::TEARDOWN, MethodName::PLAY};
+}
+
+TriggerMethod::TriggerMethod(TriggerMethod::Method method)
+: Property(TriggerMethodPropertyType),
+ method_(method) {
+}
+
+TriggerMethod::~TriggerMethod() {
+}
+
+std::string TriggerMethod::ToString() const {
+ std::string ret =
+ PropertyName::wfd_trigger_method + std::string(SEMICOLON)
+ + std::string(SPACE) + name[method()];
+ return ret;
+}
+
+} // namespace rtsp
+} // namespace wds
diff --git a/chromium/third_party/wds/src/libwds/rtsp/triggermethod.h b/chromium/third_party/wds/src/libwds/rtsp/triggermethod.h
new file mode 100644
index 00000000000..d687b62fbe5
--- /dev/null
+++ b/chromium/third_party/wds/src/libwds/rtsp/triggermethod.h
@@ -0,0 +1,54 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+
+#ifndef LIBWDS_RTSP_TRIGGERMETHOD_H_
+#define LIBWDS_RTSP_TRIGGERMETHOD_H_
+
+#include "libwds/rtsp/property.h"
+
+namespace wds {
+namespace rtsp {
+
+class TriggerMethod : public Property {
+ public:
+ enum Method {
+ SETUP,
+ PAUSE,
+ TEARDOWN,
+ PLAY
+ };
+
+ public:
+ explicit TriggerMethod(TriggerMethod::Method method);
+ ~TriggerMethod() override;
+
+ TriggerMethod::Method method() const { return method_; }
+ std::string ToString() const override;
+
+ private:
+ TriggerMethod::Method method_;
+};
+
+} // namespace rtsp
+} // namespace wds
+
+#endif // LIBWDS_RTSP_TRIGGERMETHOD_H_
diff --git a/chromium/third_party/wds/src/libwds/rtsp/uibccapability.cpp b/chromium/third_party/wds/src/libwds/rtsp/uibccapability.cpp
new file mode 100644
index 00000000000..f0f84fa22d9
--- /dev/null
+++ b/chromium/third_party/wds/src/libwds/rtsp/uibccapability.cpp
@@ -0,0 +1,164 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+
+#include "libwds/rtsp/uibccapability.h"
+
+namespace wds {
+namespace rtsp {
+
+namespace {
+
+const char kInputCategoryGeneric[] = "GENERIC";
+const char kInputCategoryHIDC[] = "HIDC";
+const char kInputCategoryList[] = "input_category_list=";
+const char* kInputCategories[] = { kInputCategoryGeneric, kInputCategoryHIDC };
+
+const char kInputTypeKeyboard[] = "Keyboard";
+const char kInputTypeMouse[] = "Mouse";
+const char kInputTypeSingleTouch[] = "SingleTouch";
+const char kInputTypeMultiTouch[] = "MultiTouch";
+const char kInputTypeJoystick[] = "Joystick";
+const char kInputTypeCamera[] = "Camera";
+const char kInputTypeGesture[] = "Gesture";
+const char kInputTypeRemoteControl[] = "RemoteControl";
+const char kInputGenericCapabilityList[] = "generic_cap_list=";
+
+const char* kInputTypes[] =
+ { kInputTypeKeyboard,
+ kInputTypeMouse,
+ kInputTypeSingleTouch,
+ kInputTypeMultiTouch,
+ kInputTypeJoystick,
+ kInputTypeCamera,
+ kInputTypeGesture,
+ kInputTypeRemoteControl
+ };
+
+const char kInputPathInfrared[] = "Infrared";
+const char kInputPathUSB[] = "USB";
+const char kInputPathBT[] = "BT";
+const char kInputPathZigbee[] = "Zigbee";
+const char kInputPathWiFi[] = "Wi-Fi";
+const char kInputPathNoSP[] = "No-SP";
+const char kHIDCCapabilityList[] = "hidc_cap_list=";
+
+const char* kInputPaths[] =
+ { kInputPathInfrared,
+ kInputPathUSB,
+ kInputPathBT,
+ kInputPathZigbee,
+ kInputPathWiFi,
+ kInputPathNoSP
+ };
+
+}
+
+UIBCCapability::UIBCCapability()
+ : Property(UIBCCapabilityPropertyType, true) {
+}
+
+UIBCCapability::UIBCCapability(
+ const std::vector<InputCategory>& input_categories,
+ const std::vector<InputType>& generic_capabilities,
+ const std::vector<DetailedCapability> hidc_capabilities,
+ int tcp_port)
+ : Property(UIBCCapabilityPropertyType),
+ input_categories_(input_categories),
+ generic_capabilities_(generic_capabilities),
+ hidc_capabilities_(hidc_capabilities),
+ tcp_port_(tcp_port) {
+}
+
+UIBCCapability::~UIBCCapability() {
+}
+
+std::string UIBCCapability::ToString() const {
+ std::string ret;
+ ret = PropertyName::wfd_uibc_capability + std::string(SEMICOLON)
+ + std::string(SPACE);
+
+ if (is_none())
+ return ret + NONE;
+
+ ret += kInputCategoryList;
+ auto inp_cat_i = input_categories_.begin();
+ auto inp_cat_end = input_categories_.end();
+
+ if (input_categories_.empty())
+ ret += NONE;
+
+ while (inp_cat_i != inp_cat_end) {
+ ret += kInputCategories[*inp_cat_i];
+
+ if(inp_cat_i != --input_categories_.end())
+ ret += std::string(",") + std::string(SPACE);
+ else
+ ret += std::string(";");
+
+ ++inp_cat_i;
+ }
+
+ ret += kInputGenericCapabilityList;
+ auto gen_cap_i = generic_capabilities_.begin();
+ auto gen_cap_end = generic_capabilities_.end();
+
+ if (generic_capabilities_.empty())
+ ret += NONE;
+
+ while (gen_cap_i != gen_cap_end) {
+ ret += kInputTypes[*gen_cap_i];
+
+ if(gen_cap_i != --generic_capabilities_.end())
+ ret += std::string(",") + std::string(SPACE);
+ else
+ ret += std::string(";");
+
+ ++gen_cap_i;
+ }
+
+ ret += kHIDCCapabilityList;
+ auto hidc_cap_i = hidc_capabilities_.begin();
+ auto hidc_cap_end = hidc_capabilities_.end();
+
+ if (hidc_capabilities_.empty())
+ ret += NONE;
+
+ while (hidc_cap_i != hidc_cap_end) {
+ ret += kInputTypes[(*hidc_cap_i).first]
+ + std::string("/") + kInputPaths[(*hidc_cap_i).second];
+
+ if(hidc_cap_i != --hidc_capabilities_.end())
+ ret += std::string(",") + std::string(SPACE);
+ else
+ ret += std::string(";");
+
+ ++hidc_cap_i;
+ }
+
+ ret += tcp_port_ > 0 ? std::string("port=") + std::to_string(tcp_port_)
+ : NONE;
+
+ return ret;
+}
+
+} // namespace rtsp
+} // namespace wds
diff --git a/chromium/third_party/wds/src/libwds/rtsp/uibccapability.h b/chromium/third_party/wds/src/libwds/rtsp/uibccapability.h
new file mode 100644
index 00000000000..56d4ae7179b
--- /dev/null
+++ b/chromium/third_party/wds/src/libwds/rtsp/uibccapability.h
@@ -0,0 +1,84 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+
+#ifndef LIBWDS_RTSP_UIBCCAPABILITY_H_
+#define LIBWDS_RTSP_UIBCCAPABILITY_H_
+
+#include "libwds/rtsp/property.h"
+
+#include <vector>
+#include <utility>
+
+namespace wds {
+namespace rtsp {
+
+class UIBCCapability: public Property {
+ public:
+ enum InputCategory {
+ GENERIC,
+ HIDC
+ };
+
+ enum InputType {
+ KEYBOARD,
+ MOUSE,
+ SINGLE_TOUCH,
+ MULTI_TOUCH,
+ JOYSTICK,
+ CAMERA,
+ GESTURE,
+ REMOTE_CONTROL
+ };
+
+ enum InputPath {
+ INFRARED,
+ USB,
+ BT,
+ ZIGBEE,
+ WI_FI,
+ NO_SP
+ };
+
+ typedef std::pair<InputType, InputPath> DetailedCapability;
+
+ public:
+ UIBCCapability();
+ UIBCCapability(const std::vector<InputCategory>& input_categories,
+ const std::vector<InputType>& generic_capabilities,
+ const std::vector<DetailedCapability> hidc_capabilities,
+ int tcp_port);
+ ~UIBCCapability() override;
+
+ std::string ToString() const override;
+
+ private:
+
+ std::vector<InputCategory> input_categories_;
+ std::vector<InputType> generic_capabilities_;
+ std::vector<DetailedCapability> hidc_capabilities_;
+ int tcp_port_;
+};
+
+} // namespace rtsp
+} // namespace wds
+
+#endif // LIBWDS_RTSP_UIBCCAPABILITY_H_
diff --git a/chromium/third_party/wds/src/libwds/rtsp/uibcsetting.cpp b/chromium/third_party/wds/src/libwds/rtsp/uibcsetting.cpp
new file mode 100644
index 00000000000..2ab1fe37dbe
--- /dev/null
+++ b/chromium/third_party/wds/src/libwds/rtsp/uibcsetting.cpp
@@ -0,0 +1,50 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+
+#include "libwds/rtsp/uibcsetting.h"
+
+namespace wds {
+namespace rtsp {
+
+namespace {
+const char enable[] = "enable";
+const char disable[] = "disable";
+}
+
+UIBCSetting::UIBCSetting(bool is_enabled)
+ : Property(UIBCSettingPropertyType),
+ is_enabled_(is_enabled) {
+
+}
+
+UIBCSetting::~UIBCSetting() {
+}
+
+std::string UIBCSetting::ToString() const {
+ std::string ret =
+ PropertyName::wfd_uibc_setting + std::string(SEMICOLON)
+ + std::string(SPACE) + (is_enabled() ? enable : disable);
+ return ret;
+}
+
+} // namespace rtsp
+} // namespace wds
diff --git a/chromium/third_party/wds/src/libwds/rtsp/uibcsetting.h b/chromium/third_party/wds/src/libwds/rtsp/uibcsetting.h
new file mode 100644
index 00000000000..c96f1e98abc
--- /dev/null
+++ b/chromium/third_party/wds/src/libwds/rtsp/uibcsetting.h
@@ -0,0 +1,45 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+
+#ifndef LIBWDS_RTSP_UIBCSETTING_H_
+#define LIBWDS_RTSP_UIBCSETTING_H_
+
+#include "libwds/rtsp/property.h"
+
+namespace wds {
+namespace rtsp {
+
+class UIBCSetting : public Property {
+ public:
+ explicit UIBCSetting(bool is_enabled);
+ ~UIBCSetting() override;
+
+ bool is_enabled() const { return is_enabled_; }
+ std::string ToString() const override;
+
+ private:
+ bool is_enabled_;
+};
+
+} // namespace rtsp
+} // namespace wds
+#endif // LIBWDS_RTSP_UIBCSETTING_H_
diff --git a/chromium/third_party/wds/src/libwds/rtsp/videoformats.cpp b/chromium/third_party/wds/src/libwds/rtsp/videoformats.cpp
new file mode 100644
index 00000000000..1dd5f2c33bc
--- /dev/null
+++ b/chromium/third_party/wds/src/libwds/rtsp/videoformats.cpp
@@ -0,0 +1,301 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+#include "libwds/rtsp/videoformats.h"
+
+#include <cassert>
+
+#include "libwds/rtsp/macros.h"
+
+namespace wds {
+namespace rtsp {
+
+namespace {
+template <typename EnumType>
+unsigned int EnumListToMask(const std::vector<EnumType>& from) {
+ unsigned int result = 0;
+
+ for (auto item : from) {
+ result = result | (1 << item);
+ }
+
+ return result;
+}
+} //namespace
+
+using wds::H264VideoFormat;
+using wds::H264VideoCodec;
+
+H264Codec::H264Codec(unsigned char profile, unsigned char level,
+ unsigned int cea_support, unsigned int vesa_support,
+ unsigned int hh_support, unsigned char latency,
+ unsigned short min_slice_size, unsigned short slice_enc_params,
+ unsigned char frame_rate_control_support,
+ unsigned short max_hres, unsigned short max_vres)
+ : profile(profile),
+ level(level),
+ cea_support(cea_support),
+ vesa_support(vesa_support),
+ hh_support(hh_support),
+ latency(latency),
+ min_slice_size(min_slice_size),
+ slice_enc_params(slice_enc_params),
+ frame_rate_control_support(frame_rate_control_support),
+ max_hres(max_hres),
+ max_vres(max_vres) {}
+
+H264Codec::H264Codec(const H264VideoFormat& format)
+ : profile(1 << format.profile),
+ level(1 << format.level),
+ cea_support((format.type == CEA) ? 1 << format.rate_resolution : 0),
+ vesa_support((format.type == VESA) ? 1 << format.rate_resolution : 0),
+ hh_support((format.type == HH) ? 1 << format.rate_resolution : 0),
+ latency(0),
+ min_slice_size(0),
+ slice_enc_params(0),
+ frame_rate_control_support(0),
+ max_hres(0),
+ max_vres(0) {
+
+}
+
+H264Codec::H264Codec(const H264VideoCodec& format)
+ : profile(1 << format.profile),
+ level(1 << format.level),
+ cea_support(format.cea_rr.to_ulong()),
+ vesa_support(format.vesa_rr.to_ulong()),
+ hh_support(format.hh_rr.to_ulong()),
+ latency(0),
+ min_slice_size(0),
+ slice_enc_params(0),
+ frame_rate_control_support(0),
+ max_hres(0),
+ max_vres(0) {
+
+}
+
+
+std::string H264Codec::ToString() const {
+ std::string ret;
+ MAKE_HEX_STRING_2(profile_str, profile);
+ MAKE_HEX_STRING_2(level_str, level);
+ MAKE_HEX_STRING_8(cea_support_str, cea_support);
+ MAKE_HEX_STRING_8(vesa_support_str, vesa_support);
+ MAKE_HEX_STRING_8(hh_support_str, hh_support);
+ MAKE_HEX_STRING_2(latency_str, latency);
+ MAKE_HEX_STRING_4(min_slice_size_str, min_slice_size);
+ MAKE_HEX_STRING_4(slice_enc_params_str, slice_enc_params);
+ MAKE_HEX_STRING_2(frame_rate_control_support_str, frame_rate_control_support);
+
+ ret = profile_str + std::string(SPACE)
+ + level_str + std::string(SPACE)
+ + cea_support_str + std::string(SPACE)
+ + vesa_support_str + std::string(SPACE)
+ + hh_support_str + std::string(SPACE)
+ + latency_str + std::string(SPACE)
+ + min_slice_size_str + std::string(SPACE)
+ + slice_enc_params_str + std::string(SPACE)
+ + frame_rate_control_support_str + std::string(SPACE);
+
+ if (max_hres > 0) {
+ MAKE_HEX_STRING_4(max_hres_str, max_hres);
+ ret += max_hres_str;
+ } else {
+ ret += NONE;
+ }
+ ret += std::string(SPACE);
+
+ if (max_vres > 0) {
+ MAKE_HEX_STRING_4(max_vres_str, max_vres);
+ ret += max_vres_str;
+ } else {
+ ret += NONE;
+ }
+
+ return ret;
+}
+
+namespace {
+
+template <typename EnumType, typename ArgType>
+EnumType MaskToEnum(ArgType from, EnumType biggest_value) {
+ assert(from != 0);
+ ArgType copy = from;
+ unsigned result = 0;
+ while ((copy & 1) == 0 && copy != 0) {
+ copy = copy >> 1;
+ ++result;
+ }
+ if (result > static_cast<unsigned>(biggest_value)) {
+ assert(false);
+ return biggest_value;
+ }
+ return static_cast<EnumType>(result);
+}
+
+template <typename EnumType, typename ArgType>
+std::vector<EnumType> MaskToEnumList(ArgType from, EnumType biggest_value) {
+ assert(from != 0);
+ ArgType copy = from;
+ unsigned enum_value = 0;
+ std::vector<EnumType> result;
+
+ while (copy != 0) {
+ if ((copy & 1) != 0) {
+ if (enum_value > static_cast<unsigned>(biggest_value))
+ break;
+
+ result.push_back(static_cast<EnumType>(enum_value));
+ }
+ copy = copy >> 1;
+ ++enum_value;
+ }
+
+ return result;
+}
+
+inline H264Profile ToH264Profile(unsigned char profile) {
+ return MaskToEnum<H264Profile>(profile, CHP);
+}
+
+inline H264Level ToH264Level(unsigned char level) {
+ return MaskToEnum<H264Level>(level, k4_2);
+}
+
+} // namespace
+
+H264VideoCodec H264Codec::ToH264VideoCodec() const {
+ H264VideoCodec result;
+ result.profile = ToH264Profile(profile);
+ result.level = ToH264Level(level);
+ result.cea_rr = RateAndResolutionsBitmap(cea_support);
+ result.vesa_rr = RateAndResolutionsBitmap(vesa_support);
+ result.hh_rr = RateAndResolutionsBitmap(hh_support);
+ return result;
+}
+
+VideoFormats::VideoFormats() : Property(VideoFormatsPropertyType, true) {
+}
+
+VideoFormats::VideoFormats(NativeVideoFormat format,
+ bool preferred_display_mode,
+ const std::vector<H264VideoFormat>& h264_formats)
+ : Property(VideoFormatsPropertyType),
+ preferred_display_mode_(preferred_display_mode ? 1 : 0) {
+ native_ = (format.rate_resolution << 3) | format.type;
+ for(auto h264_format : h264_formats)
+ h264_codecs_.push_back(H264Codec(h264_format));
+}
+
+VideoFormats::VideoFormats(NativeVideoFormat format,
+ bool preferred_display_mode,
+ const std::vector<H264VideoCodec>& h264_formats)
+ : Property(VideoFormatsPropertyType),
+ preferred_display_mode_(preferred_display_mode ? 1 : 0) {
+ native_ = (format.rate_resolution << 3) | format.type;
+ for(auto h264_format : h264_formats)
+ h264_codecs_.push_back(H264Codec(h264_format));
+}
+
+VideoFormats::VideoFormats(unsigned char native,
+ unsigned char preferred_display_mode,
+ const H264Codecs& h264_codecs)
+ : Property(VideoFormatsPropertyType),
+ native_(native),
+ preferred_display_mode_(preferred_display_mode),
+ h264_codecs_(h264_codecs) {
+}
+
+VideoFormats::~VideoFormats() {
+}
+
+namespace {
+
+template <typename EnumType>
+NativeVideoFormat GetFormatFromIndex(unsigned index, EnumType biggest_value) {
+ if (index <= static_cast<unsigned>(biggest_value))
+ return NativeVideoFormat(static_cast<EnumType>(index));
+ assert(false);
+ return NativeVideoFormat(biggest_value);
+}
+
+}
+
+NativeVideoFormat VideoFormats::GetNativeFormat() const {
+ unsigned index = native_ >> 3;
+ unsigned selection_bits = native_ & 7;
+ switch (selection_bits) {
+ case 0: // 0b000 CEA
+ return GetFormatFromIndex<CEARatesAndResolutions>(index, CEA1920x1080p24);
+ case 1: // 0b001 VESA
+ return GetFormatFromIndex<VESARatesAndResolutions>(index, VESA1920x1200p30);
+ case 2: // 0b010 HH
+ return GetFormatFromIndex<HHRatesAndResolutions>(index, HH848x480p60);
+ default:
+ assert(false);
+ break;
+ }
+ return NativeVideoFormat(CEA640x480p60);
+}
+
+std::vector<H264VideoFormat> VideoFormats::GetH264Formats() const {
+ std::vector<H264VideoFormat> result;
+ for (const auto& codec : h264_codecs_)
+ PopulateVideoFormatList(codec.ToH264VideoCodec(), result);
+ return result;
+}
+
+std::vector<H264VideoCodec> VideoFormats::GetH264VideoCodecs() const {
+ std::vector<H264VideoCodec> result;
+ for (const auto& codec : h264_codecs_)
+ result.push_back(codec.ToH264VideoCodec());
+ return result;
+}
+
+std::string VideoFormats::ToString() const {
+ std::string ret;
+
+ ret = PropertyName::wfd_video_formats
+ + std::string(SEMICOLON)+ std::string(SPACE);
+
+ if (is_none())
+ return ret + NONE;
+
+ MAKE_HEX_STRING_2(native, native_);
+ MAKE_HEX_STRING_2(preferred_display_mode, preferred_display_mode_);
+
+ ret += native + std::string(SPACE)
+ + preferred_display_mode + std::string(SPACE);
+
+ auto it = h264_codecs_.begin();
+ auto end = h264_codecs_.end();
+ while(it != end) {
+ ret += (*it).ToString();
+ ++it;
+ if (it != end)
+ ret += ", ";
+ }
+
+ return ret;
+}
+
+} // namespace rtsp
+} // namespace wds
diff --git a/chromium/third_party/wds/src/libwds/rtsp/videoformats.h b/chromium/third_party/wds/src/libwds/rtsp/videoformats.h
new file mode 100644
index 00000000000..f1175ad41f7
--- /dev/null
+++ b/chromium/third_party/wds/src/libwds/rtsp/videoformats.h
@@ -0,0 +1,95 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+
+#ifndef LIBWDS_RTSP_VIDEOFORMATS_H_
+#define LIBWDS_RTSP_VIDEOFORMATS_H_
+
+#include "libwds/rtsp/property.h"
+#include "libwds/public/video_format.h"
+
+#include <vector>
+
+namespace wds {
+namespace rtsp {
+
+struct H264Codec {
+ public:
+ H264Codec(unsigned char profile, unsigned char level,
+ unsigned int cea_support, unsigned int vesa_support,
+ unsigned int hh_support, unsigned char latency,
+ unsigned short min_slice_size, unsigned short slice_enc_params,
+ unsigned char frame_rate_control_support,
+ unsigned short max_hres, unsigned short max_vres);
+
+ H264Codec(const H264VideoFormat& format);
+ H264Codec(const H264VideoCodec& format);
+
+ H264VideoCodec ToH264VideoCodec() const;
+
+ std::string ToString() const;
+
+ unsigned char profile;
+ unsigned char level;
+ unsigned int cea_support;
+ unsigned int vesa_support;
+ unsigned int hh_support;
+ unsigned char latency;
+ unsigned short min_slice_size;
+ unsigned short slice_enc_params;
+ unsigned char frame_rate_control_support;
+ unsigned short max_hres;
+ unsigned short max_vres;
+};
+
+using H264Codecs = std::vector<H264Codec>;
+
+class VideoFormats: public Property {
+ public:
+ VideoFormats();
+ VideoFormats(NativeVideoFormat format,
+ bool preferred_display_mode,
+ const std::vector<H264VideoFormat>& h264_formats);
+ VideoFormats(NativeVideoFormat format,
+ bool preferred_display_mode,
+ const std::vector<H264VideoCodec>& h264_formats);
+ VideoFormats(unsigned char native,
+ unsigned char preferred_display_mode,
+ const H264Codecs& h264_codecs);
+ ~VideoFormats() override;
+
+ NativeVideoFormat GetNativeFormat() const;
+
+ std::vector<H264VideoFormat> GetH264Formats() const;
+ std::vector<H264VideoCodec> GetH264VideoCodecs() const;
+
+ std::string ToString() const override;
+
+ private:
+ unsigned char native_;
+ unsigned char preferred_display_mode_;
+ H264Codecs h264_codecs_;
+};
+
+} // namespace rtsp
+} // namespace wds
+
+#endif // LIBWDS_RTSP_VIDEOFORMATS_H_
diff --git a/chromium/third_party/wds/src/libwds/sink/CMakeLists.txt b/chromium/third_party/wds/src/libwds/sink/CMakeLists.txt
new file mode 100644
index 00000000000..d4dccadb069
--- /dev/null
+++ b/chromium/third_party/wds/src/libwds/sink/CMakeLists.txt
@@ -0,0 +1,10 @@
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -fvisibility=hidden -fPIC")
+set(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} -std=c99 -Wall")
+
+include_directories ("${PROJECT_SOURCE_DIR}")
+
+add_library(wdssink OBJECT
+ sink.cpp cap_negotiation_state.cpp init_state.cpp
+ session_state.cpp streaming_state.cpp
+)
+add_dependencies(wdssink wdsrtsp)
diff --git a/chromium/third_party/wds/src/libwds/sink/cap_negotiation_state.cpp b/chromium/third_party/wds/src/libwds/sink/cap_negotiation_state.cpp
new file mode 100644
index 00000000000..08caf832297
--- /dev/null
+++ b/chromium/third_party/wds/src/libwds/sink/cap_negotiation_state.cpp
@@ -0,0 +1,206 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+#include "libwds/sink/cap_negotiation_state.h"
+
+#include <iostream>
+
+#include "libwds/public/media_manager.h"
+#include "libwds/rtsp/audiocodecs.h"
+#include "libwds/rtsp/clientrtpports.h"
+#include "libwds/rtsp/connectortype.h"
+#include "libwds/rtsp/contentprotection.h"
+#include "libwds/rtsp/coupledsink.h"
+#include "libwds/rtsp/displayedid.h"
+#include "libwds/rtsp/getparameter.h"
+#include "libwds/rtsp/formats3d.h"
+#include "libwds/rtsp/i2c.h"
+#include "libwds/rtsp/payload.h"
+#include "libwds/rtsp/presentationurl.h"
+#include "libwds/rtsp/propertyerrors.h"
+#include "libwds/rtsp/reply.h"
+#include "libwds/rtsp/setparameter.h"
+#include "libwds/rtsp/standbyresumecapability.h"
+#include "libwds/rtsp/triggermethod.h"
+#include "libwds/rtsp/uibccapability.h"
+#include "libwds/rtsp/videoformats.h"
+
+namespace wds {
+using rtsp::Message;
+using rtsp::Payload;
+using rtsp::Request;
+using rtsp::Reply;
+
+namespace sink {
+
+M3Handler::M3Handler(const InitParams& init_params)
+ : MessageReceiver<Request::M3>(init_params) {
+}
+
+std::unique_ptr<Reply> M3Handler::HandleMessage(Message* message) {
+ // FIXME : resolve clashes between wds exported and internal rtsp type names.
+ //using namespace rtsp;
+ auto received_payload = ToGetParameterPayload(message->payload());
+ if (!received_payload)
+ return nullptr;
+
+ auto reply = std::unique_ptr<Reply>(new Reply(rtsp::STATUS_OK));
+ auto reply_payload = new rtsp::PropertyMapPayload();
+ for (const std::string& property : received_payload->properties()) {
+ std::shared_ptr<rtsp::Property> new_prop;
+ if (property == GetPropertyName(rtsp::AudioCodecsPropertyType)){
+ // FIXME: declare that we support absolutely every audio codec/format,
+ // but there should be a MediaManager API for it
+ auto codec_lpcm = AudioCodec(LPCM, AudioModes(3), 0);
+ auto codec_aac = AudioCodec(AAC, AudioModes(15), 0);
+ auto codec_ac3 = AudioCodec(AC3, AudioModes(7), 0);
+ std::vector<AudioCodec> codec_list;
+ codec_list.push_back(codec_lpcm);
+ codec_list.push_back(codec_aac);
+ codec_list.push_back(codec_ac3);
+ new_prop.reset(new rtsp::AudioCodecs(codec_list));
+ reply_payload->AddProperty(new_prop);
+ } else if (property == GetPropertyName(rtsp::VideoFormatsPropertyType)){
+ new_prop.reset(new rtsp::VideoFormats(ToSinkMediaManager(manager_)->GetNativeVideoFormat(),
+ false,
+ ToSinkMediaManager(manager_)->GetSupportedH264VideoCodecs()));
+ reply_payload->AddProperty(new_prop);
+ } else if (property == GetPropertyName(rtsp::Video3DFormatsPropertyType)){
+ new_prop.reset(new rtsp::Formats3d());
+ reply_payload->AddProperty(new_prop);
+ } else if (property == GetPropertyName(rtsp::ContentProtectionPropertyType)){
+ new_prop.reset(new rtsp::ContentProtection());
+ reply_payload->AddProperty(new_prop);
+ } else if (property == GetPropertyName(rtsp::DisplayEdidPropertyType)){
+ new_prop.reset(new rtsp::DisplayEdid());
+ reply_payload->AddProperty(new_prop);
+ } else if (property == GetPropertyName(rtsp::CoupledSinkPropertyType)){
+ new_prop.reset(new rtsp::CoupledSink());
+ reply_payload->AddProperty(new_prop);
+ } else if (property == GetPropertyName(rtsp::ClientRTPPortsPropertyType)){
+ new_prop.reset(new rtsp::ClientRtpPorts(
+ ToSinkMediaManager(manager_)->GetLocalRtpPorts().first,
+ ToSinkMediaManager(manager_)->GetLocalRtpPorts().second));
+ reply_payload->AddProperty(new_prop);
+ } else if (property == GetPropertyName(rtsp::I2CPropertyType)){
+ new_prop.reset(new rtsp::I2C(0));
+ reply_payload->AddProperty(new_prop);
+ } else if (property == GetPropertyName(rtsp::UIBCCapabilityPropertyType)){
+ new_prop.reset(new rtsp::UIBCCapability());
+ reply_payload->AddProperty(new_prop);
+ } else if (property == GetPropertyName(rtsp::ConnectorTypePropertyType)){
+ new_prop.reset(new rtsp::ConnectorType(ToSinkMediaManager(manager_)->GetConnectorType()));
+ reply_payload->AddProperty(new_prop);
+ } else if (property == GetPropertyName(rtsp::StandbyResumeCapabilityPropertyType)){
+ new_prop.reset(new rtsp::StandbyResumeCapability(false));
+ reply_payload->AddProperty(new_prop);
+ } else {
+ WDS_WARNING("** GET_PARAMETER: Ignoring unsupported property '%s'.", property.c_str());
+ }
+ }
+ reply->set_payload(std::unique_ptr<Payload>(reply_payload));
+
+ return reply;
+}
+
+
+M4Handler::M4Handler(const InitParams& init_params)
+ : MessageReceiver<Request::M4>(init_params) {
+}
+
+std::unique_ptr<Reply> M4Handler::HandleMessage(Message* message) {
+ SinkMediaManager* sink_media_manager = ToSinkMediaManager(manager_);
+ auto payload = ToPropertyMapPayload(message->payload());
+ if (!payload) {
+ WDS_ERROR("Failed to obtain payload in M4 handler.");
+ return nullptr;
+ }
+
+ auto presentation_url =
+ static_cast<rtsp::PresentationUrl*>(payload->GetProperty(rtsp::PresentationURLPropertyType).get());
+ if (presentation_url) {
+ sink_media_manager->SetPresentationUrl(presentation_url->presentation_url_1());
+ }
+
+ auto video_formats =
+ static_cast<rtsp::VideoFormats*>(payload->GetProperty(rtsp::VideoFormatsPropertyType).get());
+
+ if (!video_formats) {
+ WDS_ERROR("Failed to obtain 'wfd-video-formats' in M4 handler.");
+ return nullptr;
+ }
+
+ const auto& selected_formats = video_formats->GetH264Formats();
+ if (selected_formats.size() != 1) {
+ WDS_ERROR("Failed to obtain optimal video format from 'wfd-video-formats' in M4 handler.");
+ return nullptr;
+ }
+
+ if (!sink_media_manager->SetOptimalVideoFormat(selected_formats[0])) {
+ auto reply = std::unique_ptr<Reply>(new Reply(rtsp::STATUS_SeeOther));
+ auto payload = new rtsp::PropertyErrorPayload();
+ std::vector<unsigned short> error_codes = {rtsp::STATUS_UnsupportedMediaType};
+ auto property_errors =
+ std::make_shared<rtsp::PropertyErrors>(rtsp::VideoFormatsPropertyType, error_codes);
+ payload->AddPropertyError(property_errors);
+ reply->set_payload(std::unique_ptr<rtsp::Payload>(payload));
+ return reply;
+ }
+
+ return std::unique_ptr<Reply>(new Reply(rtsp::STATUS_OK));
+}
+
+class M5Handler final : public MessageReceiver<Request::M5> {
+ public:
+ M5Handler(const InitParams& init_params)
+ : MessageReceiver<Request::M5>(init_params) {
+ }
+ std::unique_ptr<Reply> HandleMessage(Message* message) override {
+ auto payload = ToPropertyMapPayload(message->payload());
+ if (!payload) {
+ WDS_ERROR("Failed to obtain payload in M5 handler.");
+ return nullptr;
+ }
+ auto property =
+ static_cast<rtsp::TriggerMethod*>(payload->GetProperty(rtsp::TriggerMethodPropertyType).get());
+
+ auto reply = std::unique_ptr<Reply>(new Reply(rtsp::STATUS_OK));
+ reply->header().set_cseq(message->cseq());
+ if (property->method() != rtsp::TriggerMethod::SETUP) {
+ reply->set_response_code(rtsp::STATUS_SeeOther);
+ }
+
+ return reply;
+ }
+};
+
+CapNegotiationState::CapNegotiationState(const InitParams &init_params)
+ : MessageSequenceWithOptionalSetHandler(init_params) {
+ AddSequencedHandler(make_ptr(new M3Handler(init_params)));
+ AddSequencedHandler(make_ptr(new M4Handler(init_params)));
+ AddSequencedHandler(make_ptr(new M5Handler(init_params)));
+
+ AddOptionalHandler(make_ptr(new M3Handler(init_params)));
+ AddOptionalHandler(make_ptr(new M4Handler(init_params)));
+}
+
+} // sink
+} // wds
diff --git a/chromium/third_party/wds/src/libwds/sink/cap_negotiation_state.h b/chromium/third_party/wds/src/libwds/sink/cap_negotiation_state.h
new file mode 100644
index 00000000000..895c1419f36
--- /dev/null
+++ b/chromium/third_party/wds/src/libwds/sink/cap_negotiation_state.h
@@ -0,0 +1,52 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+#ifndef LIBWDS_SINK_CAP_NEGOTIATION_STATE_H_
+#define LIBWDS_SINK_CAP_NEGOTIATION_STATE_H_
+
+#include "libwds/common/message_handler.h"
+
+namespace wds {
+namespace sink {
+
+// Capability negotiation state for RTSP sink.
+// Includes M3 and M4 messages handling
+class CapNegotiationState : public MessageSequenceWithOptionalSetHandler {
+ public:
+ CapNegotiationState(const InitParams& init_params);
+};
+
+class M4Handler final : public MessageReceiver<rtsp::Request::M4> {
+ public:
+ M4Handler(const InitParams& init_params);
+ std::unique_ptr<rtsp::Reply> HandleMessage(rtsp::Message* message) override;
+};
+
+class M3Handler final : public MessageReceiver<rtsp::Request::M3> {
+ public:
+ M3Handler(const InitParams& init_params);
+ std::unique_ptr<rtsp::Reply> HandleMessage(rtsp::Message* message) override;
+};
+
+} // namespace sink
+} // namespace wds
+
+#endif // LIBWDS_SINK_CAP_NEGOTIATION_STATE_H_
diff --git a/chromium/third_party/wds/src/libwds/sink/init_state.cpp b/chromium/third_party/wds/src/libwds/sink/init_state.cpp
new file mode 100644
index 00000000000..293fc1e0445
--- /dev/null
+++ b/chromium/third_party/wds/src/libwds/sink/init_state.cpp
@@ -0,0 +1,95 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+#include "libwds/sink/init_state.h"
+
+#include "libwds/rtsp/options.h"
+#include "libwds/rtsp/reply.h"
+
+namespace wds {
+namespace sink {
+using rtsp::Message;
+using rtsp::Request;
+using rtsp::Reply;
+
+class M1Handler final : public MessageReceiver<Request::M1> {
+ public:
+ M1Handler(const InitParams& init_params, int& source_init_cseq)
+ : MessageReceiver<Request::M1>(init_params),
+ source_init_cseq_(source_init_cseq) {
+ }
+ virtual std::unique_ptr<Reply> HandleMessage(Message* message) override {
+ source_init_cseq_ = message->cseq();
+ auto reply = std::unique_ptr<Reply>(new Reply(rtsp::STATUS_OK));
+ std::vector<rtsp::Method> supported_methods;
+ supported_methods.push_back(rtsp::ORG_WFA_WFD_1_0);
+ supported_methods.push_back(rtsp::GET_PARAMETER);
+ supported_methods.push_back(rtsp::SET_PARAMETER);
+ reply->header().set_supported_methods(supported_methods);
+ return reply;
+ }
+
+ private:
+ int& source_init_cseq_;
+};
+
+class M2Handler final : public SequencedMessageSender {
+ public:
+ M2Handler(const InitParams& init_params, int& source_init_cseq)
+ : SequencedMessageSender(init_params),
+ source_init_cseq_(source_init_cseq) {
+ }
+ private:
+ virtual std::unique_ptr<Message> CreateMessage() override {
+ auto options = new rtsp::Options("*");
+ options->header().set_cseq(sender_->GetNextCSeq(&source_init_cseq_));
+ options->header().set_require_wfd_support(true);
+ return std::unique_ptr<Message>(options);
+ }
+
+ virtual bool HandleReply(Reply* reply) override {
+ const rtsp::Header& header = reply->header();
+
+ if (reply->response_code() == rtsp::STATUS_OK
+ && header.has_method(rtsp::Method::ORG_WFA_WFD_1_0)
+ && header.has_method(rtsp::Method::GET_PARAMETER)
+ && header.has_method(rtsp::Method::SET_PARAMETER)
+ && header.has_method(rtsp::Method::SETUP)
+ && header.has_method(rtsp::Method::PLAY)
+ && header.has_method(rtsp::Method::TEARDOWN)
+ && header.has_method(rtsp::Method::PAUSE)) {
+ return true;
+ }
+
+ return false;
+ }
+ int& source_init_cseq_;
+};
+
+InitState::InitState(const InitParams& init_params)
+ : MessageSequenceHandler(init_params),
+ source_init_cseq_(0) {
+ AddSequencedHandler(make_ptr(new M1Handler(init_params, source_init_cseq_)));
+ AddSequencedHandler(make_ptr(new M2Handler(init_params, source_init_cseq_)));
+}
+
+} // sink
+} // wds
diff --git a/chromium/third_party/wds/src/libwds/sink/init_state.h b/chromium/third_party/wds/src/libwds/sink/init_state.h
new file mode 100644
index 00000000000..52e4be1b647
--- /dev/null
+++ b/chromium/third_party/wds/src/libwds/sink/init_state.h
@@ -0,0 +1,43 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+#ifndef LIBWDS_SINK_INIT_STATE_H_
+#define LIBWDS_SINK_INIT_STATE_H_
+
+#include "libwds/common/message_handler.h"
+
+namespace wds {
+namespace sink {
+
+// Inital state for RTSP sink.
+// Includes M1 and M2 messages handling
+class InitState : public MessageSequenceHandler {
+ public:
+ InitState(const InitParams& init_params);
+
+ private:
+ int source_init_cseq_;
+};
+
+} // sink
+} // wds
+
+#endif // LIBWDS_SINK_INIT_STATE_H_
diff --git a/chromium/third_party/wds/src/libwds/sink/session_state.cpp b/chromium/third_party/wds/src/libwds/sink/session_state.cpp
new file mode 100644
index 00000000000..cee2898b49e
--- /dev/null
+++ b/chromium/third_party/wds/src/libwds/sink/session_state.cpp
@@ -0,0 +1,114 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+#include "libwds/sink/session_state.h"
+
+#include "libwds/public/media_manager.h"
+
+#include "libwds/rtsp/play.h"
+#include "libwds/rtsp/reply.h"
+#include "libwds/rtsp/setup.h"
+#include "libwds/rtsp/transportheader.h"
+#include "libwds/sink/cap_negotiation_state.h"
+#include "libwds/sink/streaming_state.h"
+
+namespace wds {
+using rtsp::Message;
+using rtsp::Request;
+using rtsp::Reply;
+
+namespace sink {
+
+M16Handler::M16Handler(const InitParams& init_params, unsigned& keep_alive_timer)
+ : MessageReceiver<Request::M16>(init_params),
+ keep_alive_timer_(keep_alive_timer) { }
+
+bool M16Handler::HandleTimeoutEvent(unsigned timer_id) const {
+ return timer_id == keep_alive_timer_;
+}
+
+std::unique_ptr<Reply> M16Handler::HandleMessage(Message* message) {
+ // Reset keep alive timer;
+ sender_->ReleaseTimer(keep_alive_timer_);
+ keep_alive_timer_ = sender_->CreateTimer(60);
+
+ return std::unique_ptr<Reply>(new Reply(rtsp::STATUS_OK));
+}
+
+M6Handler::M6Handler(const InitParams& init_params, unsigned& keep_alive_timer)
+ : SequencedMessageSender(init_params),
+ keep_alive_timer_(keep_alive_timer) {}
+
+std::unique_ptr<Message> M6Handler::CreateMessage() {
+ auto setup = new rtsp::Setup(ToSinkMediaManager(manager_)->GetPresentationUrl());
+ auto transport = new rtsp::TransportHeader();
+ // we assume here that there is no coupled secondary sink
+ transport->set_client_port(ToSinkMediaManager(manager_)->GetLocalRtpPorts().first);
+ setup->header().set_transport(transport);
+ setup->header().set_cseq(sender_->GetNextCSeq());
+ setup->header().set_require_wfd_support(true);
+
+ return std::unique_ptr<Message>(setup);
+}
+
+bool M6Handler::HandleReply(Reply* reply) {
+ const std::string& session_id = reply->header().session();
+ if(reply->response_code() == rtsp::STATUS_OK && !session_id.empty()) {
+ ToSinkMediaManager(manager_)->SetSessionId(session_id);
+ // FIXME : take timeout value from session.
+ keep_alive_timer_ = sender_->CreateTimer(60);
+ return true;
+ }
+
+ return false;
+}
+
+class M7Handler final : public SequencedMessageSender {
+ public:
+ using SequencedMessageSender::SequencedMessageSender;
+ private:
+ std::unique_ptr<Message> CreateMessage() override {
+ rtsp::Play* play = new rtsp::Play(ToSinkMediaManager(manager_)->GetPresentationUrl());
+ play->header().set_session(manager_->GetSessionId());
+ play->header().set_cseq(sender_->GetNextCSeq());
+ play->header().set_require_wfd_support(true);
+
+ return std::unique_ptr<Message>(play);
+ }
+
+ bool HandleReply(Reply* reply) override {
+ return (reply->response_code() == rtsp::STATUS_OK);
+ }
+};
+
+SessionState::SessionState(const InitParams& init_params, MessageHandlerPtr m6_handler, MessageHandlerPtr m16_handler)
+ : MessageSequenceWithOptionalSetHandler(init_params) {
+ AddSequencedHandler(m6_handler);
+ AddSequencedHandler(make_ptr(new M7Handler(init_params)));
+
+ AddOptionalHandler(make_ptr(new M3Handler(init_params)));
+ AddOptionalHandler(make_ptr(new M4Handler(init_params)));
+ AddOptionalHandler(make_ptr(new TeardownHandler(init_params)));
+ AddOptionalHandler(m16_handler);
+}
+
+} // namespace sink
+} // namespace wds
diff --git a/chromium/third_party/wds/src/libwds/sink/session_state.h b/chromium/third_party/wds/src/libwds/sink/session_state.h
new file mode 100644
index 00000000000..65ac4bfb650
--- /dev/null
+++ b/chromium/third_party/wds/src/libwds/sink/session_state.h
@@ -0,0 +1,62 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+#ifndef LIBWDS_SINK_SESSION_STATE_H_
+#define LIBWDS_SINK_SESSION_STATE_H_
+
+#include "libwds/common/message_handler.h"
+
+namespace wds {
+namespace sink {
+
+class M6Handler final : public SequencedMessageSender {
+ public:
+ M6Handler(const InitParams& init_params, unsigned& keep_alive_timer);
+
+ private:
+ std::unique_ptr<rtsp::Message> CreateMessage() override;
+ bool HandleReply(rtsp::Reply* reply) override;
+
+ unsigned& keep_alive_timer_;
+};
+
+class M16Handler final : public MessageReceiver<rtsp::Request::M16> {
+ public:
+ M16Handler(const InitParams& init_params, unsigned& keep_alive_timer);
+
+ private:
+ bool HandleTimeoutEvent(unsigned timer_id) const override;
+ std::unique_ptr<rtsp::Reply> HandleMessage(rtsp::Message* message) override;
+
+ unsigned& keep_alive_timer_;
+};
+
+// WFD session state for RTSP sink.
+// Includes M6, M7, M8 messages handling and optionally can handle M3, M4, M16
+class SessionState : public MessageSequenceWithOptionalSetHandler {
+ public:
+ SessionState(const InitParams& init_params, MessageHandlerPtr m6_handler, MessageHandlerPtr m16_handler);
+};
+
+} // sink
+} // wds
+
+#endif // LIBWDS_SINK_SESSION_STATE_H_
diff --git a/chromium/third_party/wds/src/libwds/sink/sink.cpp b/chromium/third_party/wds/src/libwds/sink/sink.cpp
new file mode 100644
index 00000000000..d09d9aea9e3
--- /dev/null
+++ b/chromium/third_party/wds/src/libwds/sink/sink.cpp
@@ -0,0 +1,219 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+#include "libwds/public/sink.h"
+
+#include "libwds/common/message_handler.h"
+#include "libwds/common/rtsp_input_handler.h"
+#include "libwds/public/wds_export.h"
+#include "libwds/rtsp/pause.h"
+#include "libwds/rtsp/play.h"
+#include "libwds/rtsp/teardown.h"
+#include "libwds/rtsp/triggermethod.h"
+#include "libwds/public/media_manager.h"
+#include "libwds/sink/cap_negotiation_state.h"
+#include "libwds/sink/init_state.h"
+#include "libwds/sink/session_state.h"
+#include "libwds/sink/streaming_state.h"
+
+namespace wds {
+using rtsp::Message;
+using rtsp::Request;
+using rtsp::Reply;
+
+namespace {
+
+// todo: check mandatory parameters for each message
+bool InitializeRequestId(Request* request) {
+ Request::ID id = Request::UNKNOWN;
+ switch(request->method()) {
+ case Request::MethodOptions:
+ id = Request::M1;
+ break;
+ case Request::MethodGetParameter:
+ if (auto payload = rtsp::ToGetParameterPayload(request->payload())) {
+ if (!payload->properties().empty())
+ id = Request::M3;
+ } else {
+ id = Request::M16;
+ }
+ break;
+ case Request::MethodSetParameter:
+ if (auto payload = rtsp::ToPropertyMapPayload(request->payload())) {
+ if (payload->HasProperty(rtsp::PresentationURLPropertyType))
+ id = Request::M4;
+ else if (payload->HasProperty(rtsp::AVFormatChangeTimingPropertyType))
+ id = Request::M4;
+ else if (payload->HasProperty(rtsp::TriggerMethodPropertyType))
+ id = Request::M5;
+ break;
+ }
+ default:
+ WDS_ERROR("Failed to identify the received message");
+ return false;
+ }
+
+ request->set_id(id);
+ return true;
+}
+
+}
+
+class SinkStateMachine : public MessageSequenceHandler {
+ public:
+ SinkStateMachine(const InitParams& init_params)
+ : MessageSequenceHandler(init_params),
+ keep_alive_timer_(0) {
+ auto m6_handler = make_ptr(new sink::M6Handler(init_params, keep_alive_timer_));
+ auto m16_handler = make_ptr(new sink::M16Handler(init_params, keep_alive_timer_));
+ AddSequencedHandler(make_ptr(new sink::InitState(init_params)));
+ AddSequencedHandler(make_ptr(new sink::CapNegotiationState(init_params)));
+ AddSequencedHandler(make_ptr(new sink::SessionState(init_params, m6_handler, m16_handler)));
+ AddSequencedHandler(make_ptr(new sink::StreamingState(init_params, m16_handler)));
+ }
+
+ SinkStateMachine(Peer::Delegate* sender, SinkMediaManager* mng)
+ : SinkStateMachine({sender, mng, this}) {}
+
+ private:
+ unsigned keep_alive_timer_;
+};
+
+class SinkImpl final : public Sink, public RTSPInputHandler, public MessageHandler::Observer {
+ public:
+ SinkImpl(Delegate* delegate, SinkMediaManager* mng);
+
+ private:
+ // Sink implementation.
+ void Start() override;
+ void Reset() override;
+ void RTSPDataReceived(const std::string& message) override;
+ bool Teardown() override;
+ bool Play() override;
+ bool Pause() override;
+
+ // RTSPInputHandler
+ void MessageParsed(std::unique_ptr<Message> message) override;
+
+ // public MessageHandler::Observer
+ void OnCompleted(MessageHandlerPtr handler) override;
+ void OnError(MessageHandlerPtr handler) override;
+ void OnTimerEvent(unsigned timer_id) override;
+
+ bool HandleCommand(std::unique_ptr<Message> command);
+
+ template <class WfdMessage, Request::ID id>
+ std::unique_ptr<Message> CreateCommand();
+
+ void ResetAndTeardownMedia();
+
+ std::shared_ptr<SinkStateMachine> state_machine_;
+ Delegate* delegate_;
+ SinkMediaManager* manager_;
+};
+
+SinkImpl::SinkImpl(Delegate* delegate, SinkMediaManager* mng)
+ : state_machine_(new SinkStateMachine({delegate, mng, this})),
+ delegate_(delegate),
+ manager_(mng) {
+}
+
+void SinkImpl::Start() {
+ state_machine_->Start();
+}
+
+void SinkImpl::Reset() {
+ state_machine_->Reset();
+}
+
+void SinkImpl::RTSPDataReceived(const std::string& message) {
+ AddInput(message);
+}
+
+template <class WfdMessage, Request::ID id>
+std::unique_ptr<Message> SinkImpl::CreateCommand() {
+ auto message = new WfdMessage(manager_->GetPresentationUrl());
+ message->header().set_session(manager_->GetSessionId());
+ message->header().set_cseq(delegate_->GetNextCSeq());
+ message->set_id(id);
+ return std::unique_ptr<Message>(message);
+}
+
+bool SinkImpl::HandleCommand(std::unique_ptr<Message> command) {
+ if (manager_->GetSessionId().empty() ||
+ manager_->GetPresentationUrl().empty())
+ return false;
+
+ if (!state_machine_->CanSend(command.get()))
+ return false;
+ state_machine_->Send(std::move(command));
+ return true;
+}
+
+bool SinkImpl::Teardown() {
+ return HandleCommand(CreateCommand<rtsp::Teardown, Request::M8>());
+}
+
+bool SinkImpl::Play() {
+ return HandleCommand(CreateCommand<rtsp::Play, Request::M7>());
+}
+
+bool SinkImpl::Pause() {
+ return HandleCommand(CreateCommand<rtsp::Pause, Request::M9>());
+}
+
+void SinkImpl::MessageParsed(std::unique_ptr<Message> message) {
+ if (message->is_request() && !InitializeRequestId(ToRequest(message.get()))) {
+ WDS_ERROR("Cannot identify the received message");
+ return;
+ }
+ if (!state_machine_->CanHandle(message.get())) {
+ WDS_ERROR("Cannot handle the received message with Id: %d", ToRequest(message.get())->id());
+ return;
+ }
+ state_machine_->Handle(std::move(message));
+}
+
+void SinkImpl::ResetAndTeardownMedia() {
+ manager_->Teardown();
+ state_machine_->Reset();
+}
+
+void SinkImpl::OnCompleted(MessageHandlerPtr handler) {
+ assert(handler == state_machine_);
+ ResetAndTeardownMedia();
+}
+
+void SinkImpl::OnError(MessageHandlerPtr handler) {
+ assert(handler == state_machine_);
+ ResetAndTeardownMedia();
+}
+
+void SinkImpl::OnTimerEvent(unsigned timer_id) {
+ if (state_machine_->HandleTimeoutEvent(timer_id))
+ state_machine_->Reset();
+}
+
+Sink* Sink::Create(Delegate* delegate, SinkMediaManager* mng) {
+ return new SinkImpl(delegate, mng);
+}
+
+} // namespace wds
diff --git a/chromium/third_party/wds/src/libwds/sink/streaming_state.cpp b/chromium/third_party/wds/src/libwds/sink/streaming_state.cpp
new file mode 100644
index 00000000000..9f124e092dc
--- /dev/null
+++ b/chromium/third_party/wds/src/libwds/sink/streaming_state.cpp
@@ -0,0 +1,230 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+#include "libwds/sink/streaming_state.h"
+
+#include "libwds/public/media_manager.h"
+
+#include "libwds/rtsp/pause.h"
+#include "libwds/rtsp/play.h"
+#include "libwds/rtsp/reply.h"
+#include "libwds/rtsp/teardown.h"
+#include "libwds/rtsp/triggermethod.h"
+#include "libwds/sink/cap_negotiation_state.h"
+#include "libwds/sink/session_state.h"
+
+namespace wds {
+using rtsp::Message;
+using rtsp::Request;
+using rtsp::Reply;
+using rtsp::TriggerMethod;
+
+namespace sink {
+
+template <TriggerMethod::Method method>
+class M5Handler final : public MessageReceiver<Request::M5> {
+ public:
+ explicit M5Handler(const InitParams& init_params)
+ : MessageReceiver<Request::M5>(init_params) {
+ }
+
+ bool CanHandle(Message* message) const override {
+ if (!MessageReceiver<Request::M5>::CanHandle(message))
+ return false;
+ auto payload = ToPropertyMapPayload(message->payload());
+ if (!payload) {
+ WDS_ERROR("Failed to obtain payload in M5 handler.");
+ return false;
+ }
+ auto property =
+ static_cast<TriggerMethod*>(
+ payload->GetProperty(rtsp::TriggerMethodPropertyType).get());
+ return method == property->method();
+ }
+
+ std::unique_ptr<Reply> HandleMessage(Message* message) override {
+ return std::unique_ptr<Reply>(new Reply());
+ }
+};
+
+class M7Sender final : public SequencedMessageSender {
+ public:
+ using SequencedMessageSender::SequencedMessageSender;
+ private:
+ std::unique_ptr<Message> CreateMessage() override {
+ rtsp::Play* play = new rtsp::Play(ToSinkMediaManager(manager_)->GetPresentationUrl());
+ play->header().set_session(manager_->GetSessionId());
+ play->header().set_cseq (sender_->GetNextCSeq());
+ return std::unique_ptr<Message>(play);
+ }
+
+ bool HandleReply(Reply* reply) override {
+ if (reply->response_code() == rtsp::STATUS_OK) {
+ manager_->Play();
+ return true;
+ }
+ return false;
+ }
+};
+
+class PlayHandler : public MessageSequenceHandler {
+ public:
+ explicit PlayHandler(const InitParams& init_params)
+ : MessageSequenceHandler(init_params) {
+ AddSequencedHandler(make_ptr(new M5Handler<TriggerMethod::PLAY>(init_params)));
+ AddSequencedHandler(make_ptr(new M7Sender(init_params)));
+ }
+};
+
+class M8Sender final : public SequencedMessageSender {
+ public:
+ using SequencedMessageSender::SequencedMessageSender;
+ private:
+ std::unique_ptr<Message> CreateMessage() override {
+ rtsp::Teardown* teardown = new rtsp::Teardown(ToSinkMediaManager(manager_)->GetPresentationUrl());
+ teardown->header().set_session(manager_->GetSessionId());
+ teardown->header().set_cseq(sender_->GetNextCSeq());
+ return std::unique_ptr<Message>(teardown);
+ }
+
+ bool HandleReply(Reply* reply) override {
+ if (!manager_->GetSessionId().empty() &&
+ (reply->response_code() == rtsp::STATUS_OK)) {
+ manager_->Teardown();
+ return true;
+ }
+ return false;
+ }
+};
+
+TeardownHandler::TeardownHandler(const InitParams& init_params)
+ : MessageSequenceHandler(init_params) {
+ AddSequencedHandler(make_ptr(new M5Handler<TriggerMethod::TEARDOWN>(init_params)));
+ AddSequencedHandler(make_ptr(new M8Sender(init_params)));
+}
+
+class M9Sender final : public SequencedMessageSender {
+ public:
+ using SequencedMessageSender::SequencedMessageSender;
+ private:
+ std::unique_ptr<Message> CreateMessage() override {
+ rtsp::Pause* pause = new rtsp::Pause(ToSinkMediaManager(manager_)->GetPresentationUrl());
+ pause->header().set_session(manager_->GetSessionId());
+ pause->header().set_cseq(sender_->GetNextCSeq());
+ return std::unique_ptr<Message>(pause);
+ }
+
+ bool HandleReply(Reply* reply) override {
+ if (reply->response_code() == rtsp::STATUS_OK) {
+ manager_->Pause();
+ return true;
+ }
+ return false;
+ }
+};
+
+class PauseHandler : public MessageSequenceHandler {
+ public:
+ explicit PauseHandler(const InitParams& init_params)
+ : MessageSequenceHandler(init_params) {
+ AddSequencedHandler(make_ptr(new M5Handler<TriggerMethod::PAUSE>(init_params)));
+ AddSequencedHandler(make_ptr(new M9Sender(init_params)));
+ }
+};
+
+class M7SenderOptional final : public OptionalMessageSender<Request::M7> {
+ public:
+ M7SenderOptional(const InitParams& init_params)
+ : OptionalMessageSender<Request::M7>(init_params) {
+ }
+ private:
+ bool HandleReply(Reply* reply) override {
+ if (reply->response_code() == rtsp::STATUS_OK) {
+ manager_->Play();
+ return true;
+ }
+ return false;
+ }
+
+ bool CanSend(Message* message) const override {
+ if (OptionalMessageSender<Request::M7>::CanSend(message)
+ && manager_->IsPaused())
+ return true;
+ return false;
+ }
+};
+
+class M8SenderOptional final : public OptionalMessageSender<Request::M8> {
+ public:
+ M8SenderOptional(const InitParams& init_params)
+ : OptionalMessageSender<Request::M8>(init_params) {
+ }
+ private:
+ bool HandleReply(Reply* reply) override {
+ // todo: if successfull, switch to init state
+ if (reply->response_code() == rtsp::STATUS_OK) {
+ manager_->Teardown();
+ return true;
+ }
+
+ return false;
+ }
+};
+
+class M9SenderOptional final : public OptionalMessageSender<Request::M9> {
+ public:
+ M9SenderOptional(const InitParams& init_params)
+ : OptionalMessageSender<Request::M9>(init_params) {
+ }
+ private:
+ bool HandleReply(Reply* reply) override {
+ if (reply->response_code() == rtsp::STATUS_OK) {
+ manager_->Pause();
+ return true;
+ }
+ return false;
+ }
+
+ bool CanSend(Message* message) const override {
+ if (OptionalMessageSender<Request::M9>::CanSend(message)
+ && !manager_->IsPaused())
+ return true;
+ return false;
+ }
+};
+
+StreamingState::StreamingState(const InitParams& init_params, MessageHandlerPtr m16_handler)
+ : MessageSequenceWithOptionalSetHandler(init_params) {
+ AddSequencedHandler(make_ptr(new TeardownHandler(init_params)));
+ AddOptionalHandler(make_ptr(new PlayHandler(init_params)));
+ AddOptionalHandler(make_ptr(new PauseHandler(init_params)));
+ AddOptionalHandler(make_ptr(new M3Handler(init_params)));
+ AddOptionalHandler(make_ptr(new M4Handler(init_params)));
+
+ // optional senders that handle sending play, pause and teardown
+ AddOptionalHandler(make_ptr(new M7SenderOptional(init_params)));
+ AddOptionalHandler(make_ptr(new M8SenderOptional(init_params)));
+ AddOptionalHandler(make_ptr(new M9SenderOptional(init_params)));
+ AddOptionalHandler(m16_handler);
+}
+
+} // sink
+} // wds
diff --git a/chromium/third_party/wds/src/libwds/sink/streaming_state.h b/chromium/third_party/wds/src/libwds/sink/streaming_state.h
new file mode 100644
index 00000000000..4a000374d05
--- /dev/null
+++ b/chromium/third_party/wds/src/libwds/sink/streaming_state.h
@@ -0,0 +1,45 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+#ifndef LIBWDS_SINK_STREAMING_STATE_H_
+#define LIBWDS_SINK_STREAMING_STATE_H_
+
+#include "libwds/common/message_handler.h"
+
+namespace wds {
+namespace sink {
+
+// Streaming state for RTSP sink.
+// Includes M8 message handling and optionally can handle M3, M4, M7 and M9
+class StreamingState : public MessageSequenceWithOptionalSetHandler {
+ public:
+ StreamingState(const InitParams& init_params, MessageHandlerPtr m16_handler);
+};
+
+class TeardownHandler : public MessageSequenceHandler {
+ public:
+ explicit TeardownHandler(const InitParams& init_params);
+};
+
+} // sink
+} // wds
+
+#endif // LIBWDS_SINK_STREAMING_STATE_H_
diff --git a/chromium/third_party/wds/src/libwds/source/CMakeLists.txt b/chromium/third_party/wds/src/libwds/source/CMakeLists.txt
new file mode 100644
index 00000000000..30824387e7c
--- /dev/null
+++ b/chromium/third_party/wds/src/libwds/source/CMakeLists.txt
@@ -0,0 +1,9 @@
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 -Wall -fvisibility=hidden -fPIC")
+set(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} -std=c99 -Wall")
+
+include_directories ("${PROJECT_SOURCE_DIR}")
+
+add_library(wdssource OBJECT
+ source.cpp cap_negotiation_state.cpp init_state.cpp
+ session_state.cpp streaming_state.cpp)
+add_dependencies(wdssource wdsrtsp)
diff --git a/chromium/third_party/wds/src/libwds/source/cap_negotiation_state.cpp b/chromium/third_party/wds/src/libwds/source/cap_negotiation_state.cpp
new file mode 100644
index 00000000000..cf8ac733190
--- /dev/null
+++ b/chromium/third_party/wds/src/libwds/source/cap_negotiation_state.cpp
@@ -0,0 +1,179 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+#include "libwds/source/cap_negotiation_state.h"
+
+#include "libwds/rtsp/audiocodecs.h"
+#include "libwds/rtsp/clientrtpports.h"
+#include "libwds/rtsp/getparameter.h"
+#include "libwds/rtsp/payload.h"
+#include "libwds/rtsp/presentationurl.h"
+#include "libwds/rtsp/reply.h"
+#include "libwds/rtsp/setparameter.h"
+#include "libwds/rtsp/videoformats.h"
+#include "libwds/public/media_manager.h"
+
+namespace wds {
+
+using rtsp::AudioCodecs;
+using rtsp::ClientRtpPorts;
+using rtsp::GetParameter;
+using rtsp::Message;
+using rtsp::Payload;
+using rtsp::Property;
+using rtsp::Request;
+using rtsp::Reply;
+using rtsp::SetParameter;
+using rtsp::VideoFormats;
+
+namespace source {
+
+class M3Handler final : public SequencedMessageSender {
+ public:
+ using SequencedMessageSender::SequencedMessageSender;
+
+ private:
+ std::unique_ptr<Message> CreateMessage() override;
+ bool HandleReply(Reply* reply) override;
+};
+
+class M4Handler final : public SequencedMessageSender {
+ public:
+ using SequencedMessageSender::SequencedMessageSender;
+
+ private:
+ std::unique_ptr<Message> CreateMessage() override;
+ bool HandleReply(Reply* reply) override;
+};
+
+std::unique_ptr<Message> M3Handler::CreateMessage() {
+ GetParameter* get_param = new GetParameter("rtsp://localhost/wfd1.0");
+ get_param->header().set_cseq(sender_->GetNextCSeq());
+ std::vector<std::string> props;
+
+ SessionType media_type = ToSourceMediaManager(manager_)->GetSessionType();
+ if (media_type & VideoSession)
+ props.push_back("wfd_video_formats");
+ if (media_type & AudioSession)
+ props.push_back("wfd_audio_codecs");
+
+ props.push_back("wfd_client_rtp_ports");
+ get_param->set_payload(
+ std::unique_ptr<Payload>(new rtsp::GetParameterPayload(props)));
+ return std::unique_ptr<Message>(get_param);
+}
+
+bool M3Handler::HandleReply(Reply* reply) {
+ if (reply->response_code() != rtsp::STATUS_OK)
+ return false;
+
+ SourceMediaManager* source_manager = ToSourceMediaManager(manager_);
+ auto payload = ToPropertyMapPayload(reply->payload());
+ if (!payload){
+ WDS_ERROR("Failed to obtain payload from reply.");
+ return false;
+ }
+ auto property = payload->GetProperty(rtsp::ClientRTPPortsPropertyType);
+ auto ports = static_cast<ClientRtpPorts*>(property.get());
+ if (!ports){
+ WDS_ERROR("Failed to obtain RTP ports from source.");
+ return false;
+ }
+ source_manager->SetSinkRtpPorts(ports->rtp_port_0(), ports->rtp_port_1());
+
+ auto video_formats = static_cast<VideoFormats*>(
+ payload->GetProperty(rtsp::VideoFormatsPropertyType).get());
+
+ auto audio_codecs = static_cast<AudioCodecs*>(
+ payload->GetProperty(rtsp::AudioCodecsPropertyType).get());
+
+ if (!video_formats && (source_manager->GetSessionType() & VideoSession)) {
+ WDS_ERROR("Failed to obtain WFD_VIDEO_FORMATS property");
+ return false;
+ }
+
+ if (!audio_codecs && (source_manager->GetSessionType() & AudioSession)) {
+ WDS_ERROR("Failed to obtain WFD_AUDIO_CODECS property");
+ return false;
+ }
+
+ if (video_formats && !source_manager->InitOptimalVideoFormat(
+ video_formats->GetNativeFormat(),
+ video_formats->GetH264VideoCodecs())) {
+ WDS_ERROR("Cannot initalize optimal video format from the supported by sink.");
+ return false;
+ }
+
+ if (audio_codecs && !source_manager->InitOptimalAudioFormat(
+ audio_codecs->audio_codecs())) {
+ WDS_ERROR("Cannot initalize optimal audio format from the supported by sink.");
+ return false;
+ }
+
+ return true;
+}
+
+std::unique_ptr<Message> M4Handler::CreateMessage() {
+ SetParameter* set_param = new SetParameter("rtsp://localhost/wfd1.0");
+ set_param->header().set_cseq(sender_->GetNextCSeq());
+ SourceMediaManager* source_manager = ToSourceMediaManager(manager_);
+ const auto& ports = source_manager->GetSinkRtpPorts();
+ auto payload = new rtsp::PropertyMapPayload();
+
+ payload->AddProperty(
+ std::shared_ptr<Property>(new ClientRtpPorts(ports.first, ports.second)));
+ std::string presentation_Url_1 = "rtsp://" + sender_->GetLocalIPAddress() + "/wfd1.0/streamid=0";
+ payload->AddProperty(
+ std::shared_ptr<Property>(new rtsp::PresentationUrl(presentation_Url_1, "")));
+
+ if (source_manager->GetSessionType() & VideoSession) {
+ payload->AddProperty(
+ std::shared_ptr<VideoFormats>(new VideoFormats(
+ NativeVideoFormat(), // Should be all zeros.
+ false,
+ {source_manager->GetOptimalVideoFormat()})));
+ }
+
+ if (source_manager->GetSessionType() & AudioSession) {
+ payload->AddProperty(
+ std::shared_ptr<AudioCodecs>(new AudioCodecs({source_manager->GetOptimalAudioFormat()})));
+ }
+
+ set_param->set_payload(std::unique_ptr<Payload>(payload));
+
+ return std::unique_ptr<Message>(set_param);
+}
+
+bool M4Handler::HandleReply(Reply* reply) {
+ return (reply->response_code() == rtsp::STATUS_OK);
+}
+
+CapNegotiationState::CapNegotiationState(const InitParams &init_params)
+ : MessageSequenceHandler(init_params) {
+ AddSequencedHandler(make_ptr(new M3Handler(init_params)));
+ AddSequencedHandler(make_ptr(new M4Handler(init_params)));
+}
+
+CapNegotiationState::~CapNegotiationState() {
+}
+
+} // namespace source
+} // namespace wds
diff --git a/chromium/third_party/wds/src/libwds/source/cap_negotiation_state.h b/chromium/third_party/wds/src/libwds/source/cap_negotiation_state.h
new file mode 100644
index 00000000000..cfbdd97427d
--- /dev/null
+++ b/chromium/third_party/wds/src/libwds/source/cap_negotiation_state.h
@@ -0,0 +1,41 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+#ifndef LIBWDS_SOURCE_CAP_NEGOTIATION_STATE_H_
+#define LIBWDS_SOURCE_CAP_NEGOTIATION_STATE_H_
+
+#include "libwds/common/message_handler.h"
+
+namespace wds {
+namespace source {
+
+// Capability negotiation state for RTSP source.
+// Includes M3 and M4 messages handling
+class CapNegotiationState : public MessageSequenceHandler {
+ public:
+ CapNegotiationState(const InitParams& init_params);
+ ~CapNegotiationState() override;
+};
+
+} // source
+} // wds
+
+#endif // LIBWDS_SOURCE_CAP_NEGOTIATION_STATE_H_
diff --git a/chromium/third_party/wds/src/libwds/source/init_state.cpp b/chromium/third_party/wds/src/libwds/source/init_state.cpp
new file mode 100644
index 00000000000..e030f7e4c0f
--- /dev/null
+++ b/chromium/third_party/wds/src/libwds/source/init_state.cpp
@@ -0,0 +1,83 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+#include "libwds/source/init_state.h"
+
+#include "libwds/rtsp/options.h"
+#include "libwds/rtsp/reply.h"
+
+namespace wds {
+
+using rtsp::Message;
+using rtsp::Request;
+using rtsp::Reply;
+
+namespace source {
+
+class M1Handler final : public SequencedMessageSender {
+ public:
+ using SequencedMessageSender::SequencedMessageSender;
+ private:
+ std::unique_ptr<Message> CreateMessage() override {
+ rtsp::Options* options = new rtsp::Options("*");
+ options->header().set_cseq(sender_->GetNextCSeq());
+ options->header().set_require_wfd_support(true);
+ return std::unique_ptr<Message>(options);
+ }
+
+ bool HandleReply(Reply* reply) override {
+ return (reply->response_code() == rtsp::STATUS_OK);
+ }
+
+};
+
+class M2Handler final : public MessageReceiver<Request::M2> {
+ public:
+ M2Handler(const InitParams& init_params)
+ : MessageReceiver<Request::M2>(init_params) {
+ }
+ std::unique_ptr<Reply> HandleMessage(
+ Message* message) override {
+ auto reply = std::unique_ptr<Reply>(new Reply(rtsp::STATUS_OK));
+ std::vector<rtsp::Method> supported_methods;
+ supported_methods.push_back(rtsp::ORG_WFA_WFD_1_0);
+ supported_methods.push_back(rtsp::GET_PARAMETER);
+ supported_methods.push_back(rtsp::SET_PARAMETER);
+ supported_methods.push_back(rtsp::PLAY);
+ supported_methods.push_back(rtsp::PAUSE);
+ supported_methods.push_back(rtsp::SETUP);
+ supported_methods.push_back(rtsp::TEARDOWN);
+ reply->header().set_supported_methods(supported_methods);
+ return reply;
+ }
+};
+
+InitState::InitState(const InitParams& init_params)
+ : MessageSequenceHandler(init_params) {
+ AddSequencedHandler(make_ptr(new M1Handler(init_params)));
+ AddSequencedHandler(make_ptr(new M2Handler(init_params)));
+}
+
+InitState::~InitState() {
+}
+
+} // source
+} // wds
diff --git a/chromium/third_party/wds/src/libwds/source/init_state.h b/chromium/third_party/wds/src/libwds/source/init_state.h
new file mode 100644
index 00000000000..fa8018771e9
--- /dev/null
+++ b/chromium/third_party/wds/src/libwds/source/init_state.h
@@ -0,0 +1,41 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+#ifndef LIBWDS_SOURCE_INIT_STATE_H_
+#define LIBWDS_SOURCE_INIT_STATE_H_
+
+#include "libwds/common/message_handler.h"
+
+namespace wds {
+namespace source {
+
+// Inital state for RTSP source.
+// Includes M1 and M2 messages handling
+class InitState : public MessageSequenceHandler {
+ public:
+ InitState(const InitParams& init_params);
+ ~InitState() override;
+};
+
+} // source
+} // wds
+
+#endif // LIBWDS_SOURCE_INIT_STATE_H_
diff --git a/chromium/third_party/wds/src/libwds/source/session_state.cpp b/chromium/third_party/wds/src/libwds/source/session_state.cpp
new file mode 100644
index 00000000000..fa96d98c516
--- /dev/null
+++ b/chromium/third_party/wds/src/libwds/source/session_state.cpp
@@ -0,0 +1,125 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+#include "libwds/source/session_state.h"
+
+#include "libwds/public/media_manager.h"
+#include "libwds/source/cap_negotiation_state.h"
+#include "libwds/rtsp/reply.h"
+#include "libwds/rtsp/setparameter.h"
+#include "libwds/rtsp/triggermethod.h"
+
+namespace wds {
+
+using rtsp::Message;
+using rtsp::Payload;
+using rtsp::Request;
+using rtsp::Reply;
+
+namespace source {
+
+class M5Handler final : public SequencedMessageSender {
+ public:
+ using SequencedMessageSender::SequencedMessageSender;
+
+ private:
+ std::unique_ptr<Message> CreateMessage() override {
+ rtsp::SetParameter* set_param = new rtsp::SetParameter("rtsp://localhost/wfd1.0");
+ set_param->header().set_cseq(sender_->GetNextCSeq());
+ auto payload = new rtsp::PropertyMapPayload();
+ payload->AddProperty(
+ std::shared_ptr<rtsp::Property>(new rtsp::TriggerMethod(rtsp::TriggerMethod::SETUP)));
+ set_param->set_payload(std::unique_ptr<Payload>(payload));
+ return std::unique_ptr<Message>(set_param);
+ }
+
+ bool HandleReply(Reply* reply) override {
+ return (reply->response_code() == rtsp::STATUS_OK);
+ }
+
+};
+
+class M6Handler final : public MessageReceiver<Request::M6> {
+ public:
+ M6Handler(const InitParams& init_params, unsigned& timer_id)
+ : MessageReceiver<Request::M6>(init_params),
+ keep_alive_timer_(timer_id) {
+ }
+
+ std::unique_ptr<Reply> HandleMessage(
+ Message* message) override {
+ auto reply = std::unique_ptr<Reply>(new Reply(rtsp::STATUS_OK));
+ reply->header().set_session(manager_->GetSessionId());
+ reply->header().set_timeout(kDefaultKeepAliveTimeout);
+
+ auto transport = new rtsp::TransportHeader();
+ // we assume here that there is no coupled secondary sink
+ transport->set_client_port(ToSourceMediaManager(manager_)->GetSinkRtpPorts().first);
+ transport->set_server_port(ToSourceMediaManager(manager_)->GetLocalRtpPort());
+ reply->header().set_transport(transport);
+
+ return reply;
+ }
+
+ void Handle(std::unique_ptr<Message> message) override {
+ MessageReceiver<Request::M6>::Handle(std::move(message));
+ keep_alive_timer_ =
+ sender_->CreateTimer(kDefaultTimeoutValue);
+ }
+
+ unsigned& keep_alive_timer_;
+};
+
+M7Handler::M7Handler(const InitParams& init_params)
+ : MessageReceiver<Request::M7>(init_params) {
+}
+
+std::unique_ptr<Reply> M7Handler::HandleMessage(
+ Message* message) {
+ if (!manager_->IsPaused())
+ return std::unique_ptr<Reply>(new Reply(rtsp::STATUS_NotAcceptable));
+ manager_->Play();
+ return std::unique_ptr<Reply>(new Reply(rtsp::STATUS_OK));
+}
+
+M16Sender::M16Sender(const InitParams& init_params)
+ : OptionalMessageSender<Request::M16>(init_params) {
+}
+
+bool M16Sender::HandleReply(Reply* reply) {
+ return (reply->response_code() == rtsp::STATUS_OK);
+}
+
+SessionState::SessionState(const InitParams& init_params, unsigned& timer_id,
+ MessageHandlerPtr& m16_sender)
+ : MessageSequenceWithOptionalSetHandler(init_params) {
+ AddSequencedHandler(make_ptr(new M5Handler(init_params)));
+ AddSequencedHandler(make_ptr(new M6Handler(init_params, timer_id)));
+ AddSequencedHandler(make_ptr(new M7Handler(init_params)));
+
+ AddOptionalHandler(m16_sender);
+}
+
+SessionState::~SessionState() {
+}
+
+} // source
+} // wds
diff --git a/chromium/third_party/wds/src/libwds/source/session_state.h b/chromium/third_party/wds/src/libwds/source/session_state.h
new file mode 100644
index 00000000000..23403cd2619
--- /dev/null
+++ b/chromium/third_party/wds/src/libwds/source/session_state.h
@@ -0,0 +1,59 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+#ifndef LIBWDS_SOURCE_SESSION_STATE_H_
+#define LIBWDS_SOURCE_SESSION_STATE_H_
+
+#include "libwds/common/message_handler.h"
+
+namespace wds {
+namespace source {
+
+// WFD session state for RTSP source.
+// Includes M5, M6, M7 messages handling and optionally can handle M3, M4, M8
+class SessionState : public MessageSequenceWithOptionalSetHandler {
+ public:
+ SessionState(const InitParams& init_params, unsigned& timer_id,
+ MessageHandlerPtr& m16_sender);
+ ~SessionState() override;
+};
+
+class M7Handler final : public MessageReceiver<rtsp::Request::M7> {
+ public:
+ M7Handler(const InitParams& init_params);
+
+ private:
+ std::unique_ptr<rtsp::Reply> HandleMessage(
+ rtsp::Message* message) override;
+};
+
+class M16Sender final : public OptionalMessageSender<rtsp::Request::M16> {
+ public:
+ M16Sender(const InitParams& init_params);
+
+ private:
+ bool HandleReply(rtsp::Reply* reply) override;
+};
+
+} // source
+} // wds
+
+#endif // LIBWDS_SOURCE_SESSION_STATE_H_
diff --git a/chromium/third_party/wds/src/libwds/source/source.cpp b/chromium/third_party/wds/src/libwds/source/source.cpp
new file mode 100644
index 00000000000..c8182265560
--- /dev/null
+++ b/chromium/third_party/wds/src/libwds/source/source.cpp
@@ -0,0 +1,261 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+#include "libwds/public/source.h"
+
+#include "libwds/source/cap_negotiation_state.h"
+#include "libwds/source/init_state.h"
+#include "libwds/source/streaming_state.h"
+#include "libwds/source/session_state.h"
+#include "libwds/common/message_handler.h"
+#include "libwds/common/rtsp_input_handler.h"
+#include "libwds/public/wds_export.h"
+#include "libwds/rtsp/getparameter.h"
+#include "libwds/rtsp/setparameter.h"
+#include "libwds/rtsp/triggermethod.h"
+#include "libwds/public/media_manager.h"
+
+namespace wds {
+
+using rtsp::Message;
+using rtsp::Request;
+using rtsp::Reply;
+
+namespace {
+
+bool InitializeRequestId(Request* request) {
+ Request::ID id = Request::UNKNOWN;
+ switch(request->method()) {
+ case Request::MethodOptions:
+ id = Request::M2;
+ break;
+ case Request::MethodSetup:
+ id = Request::M6;
+ break;
+ case Request::MethodPlay:
+ id = Request::M7;
+ break;
+ case Request::MethodTeardown:
+ id = Request::M8;
+ break;
+ case Request::MethodPause:
+ id = Request::M9;
+ break;
+ case Request::MethodSetParameter:
+ if (auto payload = rtsp::ToPropertyMapPayload(request->payload())) {
+ if (payload->HasProperty(rtsp::RoutePropertyType))
+ id = Request::M10;
+ else if (payload->HasProperty(rtsp::ConnectorTypePropertyType))
+ id = Request::M11;
+ else if (payload->HasProperty(rtsp::StandbyPropertyType))
+ id = Request::M12;
+ else if (payload->HasProperty(rtsp::IDRRequestPropertyType))
+ id = Request::M13;
+ else if (payload->HasProperty(rtsp::UIBCCapabilityPropertyType))
+ id = Request::M14;
+ else if (payload->HasProperty(rtsp::UIBCSettingPropertyType))
+ id = Request::M15;
+ break;
+ }
+ default:
+ WDS_ERROR("Failed to identify the received message");
+ return false;
+ }
+
+ request->set_id(id);
+ return true;
+}
+
+}
+
+class SourceStateMachine : public MessageSequenceHandler {
+ public:
+ SourceStateMachine(const InitParams& init_params, unsigned& timer_id)
+ : MessageSequenceHandler(init_params) {
+ MessageHandlerPtr m16_sender = make_ptr(new source::M16Sender(init_params));
+ AddSequencedHandler(make_ptr(new source::InitState(init_params)));
+ AddSequencedHandler(make_ptr(new source::CapNegotiationState(init_params)));
+ AddSequencedHandler(make_ptr(new source::SessionState(init_params, timer_id, m16_sender)));
+ AddSequencedHandler(make_ptr(new source::StreamingState(init_params, m16_sender)));
+ }
+};
+
+class SourceImpl final : public Source, public RTSPInputHandler, public MessageHandler::Observer {
+ public:
+ SourceImpl(Delegate* delegate, SourceMediaManager* mng, Peer::Observer* observer);
+
+ private:
+ // Source implementation.
+ void Start() override;
+ void Reset() override;
+ void RTSPDataReceived(const std::string& message) override;
+ bool Teardown() override;
+ bool Play() override;
+ bool Pause() override;
+
+ // public MessageHandler::Observer
+ void OnCompleted(MessageHandlerPtr handler) override;
+ void OnError(MessageHandlerPtr handler) override;
+
+ void OnTimerEvent(unsigned timer_id) override;
+
+ // RTSPInputHandler
+ void MessageParsed(std::unique_ptr<Message> message) override;
+ void ParserErrorOccurred(const std::string& invalid_input) override;
+
+ // Keep-alive function
+ void SendKeepAlive();
+ void ResetAndTeardownMedia();
+
+ unsigned keep_alive_timer_;
+ std::shared_ptr<SourceStateMachine> state_machine_;
+ Delegate* delegate_;
+ SourceMediaManager* media_manager_;
+ Peer::Observer* observer_;
+};
+
+SourceImpl::SourceImpl(Delegate* delegate, SourceMediaManager* mng, Peer::Observer* observer)
+ : keep_alive_timer_(0),
+ state_machine_(new SourceStateMachine({delegate, mng, this}, keep_alive_timer_)),
+ delegate_(delegate),
+ media_manager_(mng),
+ observer_(observer) {
+}
+
+void SourceImpl::Start() {
+ state_machine_->Start();
+}
+
+void SourceImpl::Reset() {
+ state_machine_->Reset();
+ delegate_->ReleaseTimer(keep_alive_timer_);
+}
+
+void SourceImpl::RTSPDataReceived(const std::string& message) {
+ AddInput(message);
+}
+
+void SourceImpl::OnTimerEvent(unsigned timer_id) {
+ if (keep_alive_timer_ == timer_id)
+ SendKeepAlive();
+ else if (state_machine_->HandleTimeoutEvent(timer_id) && observer_)
+ observer_->ErrorOccurred(TimeoutError);
+}
+
+void SourceImpl::SendKeepAlive() {
+ delegate_->ReleaseTimer(keep_alive_timer_);
+ auto get_param = std::unique_ptr<Request>(
+ new rtsp::GetParameter("rtsp://localhost/wfd1.0"));
+ get_param->header().set_cseq(delegate_->GetNextCSeq());
+ get_param->set_id(Request::M16);
+
+ assert(state_machine_->CanSend(get_param.get()));
+ state_machine_->Send(std::move(get_param));
+ keep_alive_timer_ =
+ delegate_->CreateTimer(kDefaultKeepAliveTimeout - kDefaultTimeoutValue);
+ assert(keep_alive_timer_);
+}
+
+namespace {
+
+std::unique_ptr<Message> CreateM5(int send_cseq, rtsp::TriggerMethod::Method method) {
+ auto set_param = std::unique_ptr<Request>(
+ new rtsp::SetParameter("rtsp://localhost/wfd1.0"));
+ set_param->header().set_cseq(send_cseq);
+ auto payload = new rtsp::PropertyMapPayload();
+ payload->AddProperty(
+ std::shared_ptr<rtsp::Property>(new rtsp::TriggerMethod(method)));
+ set_param->set_payload(std::unique_ptr<rtsp::Payload>(payload));
+ set_param->set_id(Request::M5);
+ return std::move(set_param);
+}
+
+}
+
+bool SourceImpl::Teardown() {
+ auto m5 = CreateM5(delegate_->GetNextCSeq(),
+ rtsp::TriggerMethod::TEARDOWN);
+
+ if (!state_machine_->CanSend(m5.get()))
+ return false;
+ state_machine_->Send(std::move(m5));
+ return true;
+}
+
+bool SourceImpl::Play() {
+ auto m5 = CreateM5(delegate_->GetNextCSeq(),
+ rtsp::TriggerMethod::PLAY);
+
+ if (!state_machine_->CanSend(m5.get()))
+ return false;
+ state_machine_->Send(std::move(m5));
+ return true;
+}
+
+bool SourceImpl::Pause() {
+ auto m5 = CreateM5(delegate_->GetNextCSeq(),
+ rtsp::TriggerMethod::PAUSE);
+
+ if (!state_machine_->CanSend(m5.get()))
+ return false;
+ state_machine_->Send(std::move(m5));
+ return true;
+}
+
+void SourceImpl::OnCompleted(MessageHandlerPtr handler) {
+ assert(handler == state_machine_);
+ if (observer_)
+ observer_->SessionCompleted();
+}
+
+void SourceImpl::OnError(MessageHandlerPtr handler) {
+ assert(handler == state_machine_);
+ if (observer_)
+ observer_->ErrorOccurred(UnexpectedMessageError);
+}
+
+void SourceImpl::MessageParsed(std::unique_ptr<Message> message) {
+ if (message->is_request() && !InitializeRequestId(ToRequest(message.get()))) {
+ WDS_ERROR("Cannot identify the received message");
+ if (observer_)
+ observer_->ErrorOccurred(UnexpectedMessageError);
+ return;
+ }
+ if (!state_machine_->CanHandle(message.get())) {
+ WDS_ERROR("Cannot handle the received message with Id: %d", ToRequest(message.get())->id());
+ if (observer_)
+ observer_->ErrorOccurred(UnexpectedMessageError);
+ return;
+ }
+ state_machine_->Handle(std::move(message));
+}
+
+void SourceImpl::ParserErrorOccurred(const std::string& invalid_input) {
+ WDS_ERROR("Failed to parse: %s", invalid_input.c_str());
+ if (observer_)
+ observer_->ErrorOccurred(MessageParseError);
+}
+
+Source* Source::Create(Delegate* delegate, SourceMediaManager* mng, Peer::Observer* observer) {
+ return new SourceImpl(delegate, mng, observer);
+}
+
+} // namespace wds
diff --git a/chromium/third_party/wds/src/libwds/source/streaming_state.cpp b/chromium/third_party/wds/src/libwds/source/streaming_state.cpp
new file mode 100644
index 00000000000..1f43b1df302
--- /dev/null
+++ b/chromium/third_party/wds/src/libwds/source/streaming_state.cpp
@@ -0,0 +1,107 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+#include "libwds/source/streaming_state.h"
+
+#include "libwds/public/media_manager.h"
+#include "libwds/source/cap_negotiation_state.h"
+#include "libwds/source/session_state.h"
+#include "libwds/rtsp/reply.h"
+
+namespace wds {
+
+using rtsp::Message;
+using rtsp::Request;
+using rtsp::Reply;
+
+namespace source {
+
+class M8Handler final : public MessageReceiver<rtsp::Request::M8> {
+ public:
+ M8Handler(const InitParams& init_params)
+ : MessageReceiver<Request::M8>(init_params) {
+ }
+
+ private:
+ std::unique_ptr<rtsp::Reply> HandleMessage(
+ rtsp::Message* message) override {
+ manager_->Teardown();
+ return std::unique_ptr<Reply>(new Reply(rtsp::STATUS_OK));
+ }
+};
+
+class M9Handler final : public MessageReceiver<Request::M9> {
+ public:
+ M9Handler(const InitParams& init_params)
+ : MessageReceiver<Request::M9>(init_params) {
+ }
+
+ std::unique_ptr<Reply> HandleMessage(
+ Message* message) override {
+ int response_code = rtsp::STATUS_NotAcceptable;
+ if (!manager_->IsPaused()) {
+ manager_->Pause();
+ response_code = rtsp::STATUS_OK;
+ }
+ return std::unique_ptr<Reply>(new Reply(response_code));
+ }
+};
+
+class M5Sender final : public OptionalMessageSender<Request::M5> {
+ public:
+ M5Sender(const InitParams& init_params)
+ : OptionalMessageSender<Request::M5>(init_params) {
+ }
+ bool HandleReply(Reply* reply) override {
+ return (reply->response_code() == rtsp::STATUS_OK);
+ }
+};
+
+class M13Handler final : public MessageReceiver<Request::M13> {
+ public:
+ M13Handler(const InitParams& init_params)
+ : MessageReceiver<Request::M13>(init_params) {
+ }
+
+ std::unique_ptr<Reply> HandleMessage(
+ Message* message) override {
+ ToSourceMediaManager(manager_)->SendIDRPicture();
+ return std::unique_ptr<Reply>(new Reply(rtsp::STATUS_OK));
+ }
+};
+
+StreamingState::StreamingState(const InitParams& init_params,
+ MessageHandlerPtr m16_sender)
+ : MessageSequenceWithOptionalSetHandler(init_params) {
+ AddSequencedHandler(make_ptr(new M8Handler(init_params)));
+
+ AddOptionalHandler(make_ptr(new M5Sender(init_params)));
+ AddOptionalHandler(make_ptr(new M7Handler(init_params)));
+ AddOptionalHandler(make_ptr(new M9Handler(init_params)));
+ AddOptionalHandler(make_ptr(new M13Handler(init_params)));
+ AddOptionalHandler(m16_sender);
+}
+
+StreamingState::~StreamingState() {
+}
+
+} // source
+} // wds
diff --git a/chromium/third_party/wds/src/libwds/source/streaming_state.h b/chromium/third_party/wds/src/libwds/source/streaming_state.h
new file mode 100644
index 00000000000..0d0995b8752
--- /dev/null
+++ b/chromium/third_party/wds/src/libwds/source/streaming_state.h
@@ -0,0 +1,41 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+#ifndef LIBWDS_SOURCE_STREAMING_STATE_H_
+#define LIBWDS_SOURCE_STREAMING_STATE_H_
+
+#include "libwds/common/message_handler.h"
+
+namespace wds {
+namespace source {
+
+// Streaming state for RTSP source.
+// Includes M8 message handling and optionally can handle M3, M4, M7, M9-M15
+class StreamingState : public MessageSequenceWithOptionalSetHandler {
+ public:
+ StreamingState(const InitParams& init_params, MessageHandlerPtr m16_sender);
+ ~StreamingState() override;
+};
+
+} // source
+} // wds
+
+#endif // LIBWDS_SOURCE_STREAMING_STATE_H_
diff --git a/chromium/third_party/wds/src/mirac_network/CMakeLists.txt b/chromium/third_party/wds/src/mirac_network/CMakeLists.txt
new file mode 100644
index 00000000000..54005e74dbe
--- /dev/null
+++ b/chromium/third_party/wds/src/mirac_network/CMakeLists.txt
@@ -0,0 +1,26 @@
+#FIXME in the future: with cmake 2.8.12 and up it's better
+#to use target_compile_options or add_compile_options
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -pthread -std=c++11")
+
+include_directories ("${PROJECT_SOURCE_DIR}" )
+include_directories ("${PROJECT_SOURCE_DIR}/include" )
+include_directories ("${PROJECT_SOURCE_DIR}/libwds/rtsp" )
+include_directories ("${PROJECT_SOURCE_DIR}/libwds/public" )
+
+find_package(PkgConfig REQUIRED)
+pkg_check_modules (GLIB2 REQUIRED glib-2.0)
+include_directories(${GLIB2_INCLUDE_DIRS})
+
+pkg_check_modules (GIO REQUIRED gio-2.0)
+include_directories(${GIO_INCLUDE_DIRS})
+
+pkg_check_modules (GST REQUIRED gstreamer-1.0)
+include_directories(${GST_INCLUDE_DIRS})
+
+add_library(mirac STATIC mirac-network.cpp mirac-gst-sink.cpp mirac-gst-test-source.cpp mirac-broker.cpp mirac-glib-logging.cpp mirac-gst-bus-handler.cpp)
+
+add_executable(network-test network-test.cpp)
+target_link_libraries (network-test ${GLIB2_LIBRARIES} mirac)
+
+add_executable(gst-test gst-test.cpp)
+target_link_libraries (gst-test mirac wds ${GLIB2_LIBRARIES} ${GIO_LIBRARIES} ${GST_LIBRARIES})
diff --git a/chromium/third_party/wds/src/mirac_network/gst-test.cpp b/chromium/third_party/wds/src/mirac_network/gst-test.cpp
new file mode 100644
index 00000000000..b1babf66a36
--- /dev/null
+++ b/chromium/third_party/wds/src/mirac_network/gst-test.cpp
@@ -0,0 +1,121 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * Contact: Alexander Kanavin <alex.kanavin@gmail.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+
+#include <glib.h>
+#include <iostream>
+#include <memory>
+
+#include <glib-unix.h>
+
+#include "mirac-gst-test-source.hpp"
+#include "mirac-gst-sink.hpp"
+#include "mirac-glib-logging.hpp"
+
+static gboolean _sig_handler (gpointer data_ptr)
+{
+ GMainLoop *ml = (GMainLoop *) data_ptr;
+
+ g_main_loop_quit(ml);
+
+ return G_SOURCE_CONTINUE;
+}
+
+
+int main (int argc, char *argv[])
+{
+ InitGlibLogging();
+
+ GError *error = NULL;
+ GOptionContext *context;
+ GMainLoop* ml = NULL;
+
+ gchar* wfd_device_option = NULL;
+ gchar* wfd_stream_option = NULL;
+ gchar* hostname_option = NULL;
+ gint port = 0;
+
+ GOptionEntry main_entries[] =
+ {
+ { "device", 0, 0, G_OPTION_ARG_STRING, &wfd_device_option, "Specify WFD device type: testsource or sink", "(testsource|sink)"},
+ { "stream", 0, 0, G_OPTION_ARG_STRING, &wfd_stream_option, "Specify WFD stream type for testsource: audio, video, both or desktop capture", "(audio|video|both|desktop)"},
+ { "hostname", 0, 0, G_OPTION_ARG_STRING, &hostname_option, "Specify optional hostname or ip address to stream to or listen on", "host"},
+ { "port", 0, 0, G_OPTION_ARG_INT, &port, "Specify optional UDP port number to stream to or listen on", "port"},
+ { NULL }
+ };
+
+ context = g_option_context_new ("- WFD source/sink demo application\n\nExample:\ngst-test --device=testsource --stream=both --hostname=127.0.0.1 --port=5000\ngst-test --device=sink --port=5000");
+ g_option_context_add_main_entries (context, main_entries, NULL);
+
+ if (!g_option_context_parse (context, &argc, &argv, &error)) {
+ WDS_ERROR ("option parsing failed: %s", error->message);
+ g_option_context_free(context);
+ exit (1);
+ }
+ g_option_context_free(context);
+
+ wfd_test_stream_t wfd_stream = WFD_UNKNOWN_STREAM;
+ if (g_strcmp0(wfd_stream_option, "audio") == 0)
+ wfd_stream = WFD_TEST_AUDIO;
+ else if (g_strcmp0(wfd_stream_option, "video") == 0)
+ wfd_stream = WFD_TEST_VIDEO;
+ else if (g_strcmp0(wfd_stream_option, "both") == 0)
+ wfd_stream = WFD_TEST_BOTH;
+ else if (g_strcmp0(wfd_stream_option, "desktop") == 0)
+ wfd_stream = WFD_DESKTOP;
+
+ std::string hostname;
+ if (hostname_option)
+ hostname = hostname_option;
+
+ g_free(wfd_stream_option);
+ g_free(hostname_option);
+
+ gst_init (&argc, &argv);
+
+ std::unique_ptr<MiracGstSink> sink_pipeline;
+ std::unique_ptr<MiracGstTestSource> source_pipeline;
+
+ if (g_strcmp0(wfd_device_option, "testsource") == 0) {
+ source_pipeline.reset(new MiracGstTestSource(wfd_stream, hostname, port));
+ source_pipeline->SetState(GST_STATE_PLAYING);
+ WDS_LOG("Source UDP port: %d", source_pipeline->UdpSourcePort());
+ } else if (g_strcmp0(wfd_device_option, "sink") == 0) {
+ sink_pipeline.reset(new MiracGstSink(hostname, port));
+ WDS_LOG("Listening on port %d", sink_pipeline->sink_udp_port());
+ }
+
+ g_free(wfd_device_option);
+
+ ml = g_main_loop_new(NULL, TRUE);
+ g_unix_signal_add(SIGINT, _sig_handler, ml);
+ g_unix_signal_add(SIGTERM, _sig_handler, ml);
+
+ g_main_loop_run(ml);
+
+ g_main_loop_unref(ml);
+
+ return 0;
+}
+
+ \ No newline at end of file
diff --git a/chromium/third_party/wds/src/mirac_network/mirac-broker.cpp b/chromium/third_party/wds/src/mirac_network/mirac-broker.cpp
new file mode 100644
index 00000000000..382494eb692
--- /dev/null
+++ b/chromium/third_party/wds/src/mirac_network/mirac-broker.cpp
@@ -0,0 +1,287 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+#include <glib-unix.h>
+#include <algorithm>
+
+#include "mirac-broker.hpp"
+#include "mirac-glib-logging.hpp"
+
+struct TimerCallbackData {
+ TimerCallbackData(MiracBroker* delegate)
+ : delegate_(delegate), timer_id_(0) {}
+ MiracBroker* delegate_;
+ uint timer_id_;
+};
+
+/* static C callback wrapper */
+gboolean MiracBroker::send_cb (gint fd, GIOCondition condition, gpointer data_ptr)
+{
+ auto broker = static_cast<MiracBroker**> (data_ptr);
+ return (*broker)->send_cb(fd, condition);
+}
+
+/* static C callback wrapper */
+gboolean MiracBroker::receive_cb (gint fd, GIOCondition condition, gpointer data_ptr)
+{
+ auto broker = static_cast<MiracBroker**> (data_ptr);
+ return (*broker)->receive_cb(fd, condition);
+}
+
+/* static C callback wrapper */
+gboolean MiracBroker::listen_cb (gint fd, GIOCondition condition, gpointer data_ptr)
+{
+ auto broker = static_cast<MiracBroker**> (data_ptr);
+ return (*broker)->listen_cb(fd, condition);
+}
+
+/* static C callback wrapper */
+gboolean MiracBroker::connect_cb (gint fd, GIOCondition condition, gpointer data_ptr)
+{
+ auto broker = static_cast<MiracBroker**> (data_ptr);
+ return (*broker)->connect_cb(fd, condition);
+}
+
+/* static C callback wrapper */
+gboolean MiracBroker::try_connect (gpointer data_ptr)
+{
+ auto broker = static_cast<MiracBroker*> (data_ptr);
+ broker->try_connect();
+ return false;
+}
+
+gboolean MiracBroker::send_cb (gint fd, GIOCondition condition)
+{
+ try {
+ if (!connection_->Send())
+ return G_SOURCE_CONTINUE;
+ } catch (const MiracConnectionLostException &exception) {
+ on_connection_failure(CONNECTION_LOST);
+ } catch (const std::exception &x) {
+ WDS_WARNING("exception: %s", x.what());
+ }
+ return G_SOURCE_REMOVE;
+}
+
+
+gboolean MiracBroker::receive_cb (gint fd, GIOCondition condition)
+{
+ std::string msg;
+ try {
+ if (connection_->Receive(msg)) {
+ WDS_VLOG("Received RTSP message:\n%s", msg.c_str());
+ got_message (msg);
+ }
+ } catch (const MiracConnectionLostException &exception) {
+ on_connection_failure(CONNECTION_LOST);
+ return G_SOURCE_REMOVE;
+ }
+ return G_SOURCE_CONTINUE;
+}
+
+gboolean MiracBroker::listen_cb (gint fd, GIOCondition condition)
+{
+ try {
+ connection(network_->Accept());
+ WDS_LOG("connection from: %s", connection_->GetPeerAddress().c_str());
+ on_connected();
+ } catch (const std::exception &x) {
+ WDS_WARNING("exception: %s", x.what());
+ }
+
+ return G_SOURCE_CONTINUE;
+}
+
+gboolean MiracBroker::connect_cb (gint fd, GIOCondition condition)
+{
+ try {
+ if (!network_->Connect(NULL, NULL))
+ return G_SOURCE_CONTINUE;
+ WDS_LOG("connection success to: %s", network_->GetPeerAddress().c_str());
+ connection(network_.release());
+
+ /* make sure any network event sources are removed */
+ network(NULL);
+
+ on_connected();
+ } catch (const std::exception &x) {
+ gdouble elapsed = 1000 * g_timer_elapsed(connect_timer_, NULL);
+ if (elapsed + connect_wait_ > connect_timeout_) {
+ on_connection_failure(CONNECTION_TIMEOUT);
+ } else {
+ connect_wait_id_ = g_timeout_add (connect_wait_, try_connect, this);
+ }
+ }
+ return G_SOURCE_REMOVE;
+}
+
+void MiracBroker::network(MiracNetwork *connection)
+{
+ while (g_source_remove_by_user_data(&network_source_ptr_))
+ ;
+ network_.reset(connection);
+}
+
+void MiracBroker::connection(MiracNetwork *connection)
+{
+ while (g_source_remove_by_user_data(&connection_source_ptr_))
+ ;
+ connection_.reset(connection);
+
+ if (connection_)
+ g_unix_fd_add(connection_->GetHandle(), G_IO_IN,
+ receive_cb, &connection_source_ptr_);
+}
+
+void MiracBroker::try_connect()
+{
+ WDS_LOG("Trying to connect...");
+
+ connect_wait_id_ = 0;
+ network(new MiracNetwork());
+
+ if (network_->Connect(peer_address_.c_str(), peer_port_.c_str())) {
+ g_unix_fd_add(network_->GetHandle(), G_IO_OUT,
+ MiracBroker::send_cb, &network_source_ptr_);
+ } else {
+ g_unix_fd_add(network_->GetHandle(), G_IO_OUT,
+ MiracBroker::connect_cb, &network_source_ptr_);
+ }
+}
+
+unsigned short MiracBroker::get_host_port() const
+{
+ return network_->GetHostPort();
+}
+
+std::string MiracBroker::get_peer_address() const
+{
+ return connection_->GetPeerAddress();
+}
+
+MiracBroker::MiracBroker (const std::string& listen_port):
+ connect_timer_(NULL)
+{
+ network_source_ptr_ = this;
+ connection_source_ptr_ = this;
+
+ network(new MiracNetwork());
+
+ network_->Bind(NULL, listen_port.c_str());
+ g_unix_fd_add(network_->GetHandle(), G_IO_IN,
+ MiracBroker::listen_cb, &network_source_ptr_);
+}
+
+MiracBroker::MiracBroker(const std::string& peer_address, const std::string& peer_port, uint timeout):
+ peer_address_(peer_address),
+ peer_port_(peer_port),
+ connect_timeout_(timeout)
+{
+ network_source_ptr_ = this;
+ connection_source_ptr_ = this;
+ connect_timer_ = g_timer_new();
+ try_connect();
+}
+
+MiracBroker::~MiracBroker ()
+{
+ network(NULL);
+ connection(NULL);
+
+ if (connect_timer_) {
+ g_timer_destroy(connect_timer_);
+ connect_timer_ = NULL;
+ }
+
+ if (connect_wait_id_ > 0) {
+ g_source_remove(connect_wait_id_);
+ connect_wait_id_ = 0;
+ }
+ while (!timers_.empty())
+ g_source_remove(timers_.front());
+}
+
+void MiracBroker::SendRTSPData(const std::string& data) {
+ WDS_VLOG("Sending RTSP message:\n%s", data.c_str());
+
+ if (connection_ && !connection_->Send(data))
+ g_unix_fd_add(connection_->GetHandle(), G_IO_OUT,
+ send_cb, &connection_source_ptr_);
+}
+
+std::string MiracBroker::GetLocalIPAddress() const {
+ return "127.0.0.1"; // FIXME : return the actual local IP address.
+}
+
+void MiracBroker::on_timeout_remove(gpointer user_data) {
+ TimerCallbackData* data = static_cast<TimerCallbackData*>(user_data);
+ auto& timers = data->delegate_->timers_;
+ auto it = std::find(timers.begin(), timers.end(), data->timer_id_);
+ if (it != timers.end())
+ timers.erase(it);
+ delete data;
+}
+
+static gboolean on_timeout(gpointer user_data) {
+ TimerCallbackData* data = static_cast<TimerCallbackData*>(user_data);
+ data->delegate_->OnTimeout(data->timer_id_);
+ return FALSE;
+}
+
+void MiracBroker::OnTimeout(uint timer_id) {
+ Peer()->OnTimerEvent(timer_id);
+}
+
+uint MiracBroker::CreateTimer(int seconds) {
+ TimerCallbackData* data = new TimerCallbackData(this);
+ uint timer_id = g_timeout_add_seconds_full(
+ G_PRIORITY_DEFAULT,
+ seconds,
+ on_timeout,
+ data,
+ on_timeout_remove);
+ if (timer_id > 0) {
+ data->timer_id_ = timer_id;
+ timers_.push_back(timer_id);
+ } else {
+ delete data;
+ }
+
+ return timer_id;
+}
+
+void MiracBroker::ReleaseTimer(uint timer_id) {
+ if (timer_id > 0) {
+ auto it = std::find(timers_.begin(), timers_.end(), timer_id);
+ if (it != timers_.end() )
+ g_source_remove(*it);
+ }
+}
+
+int MiracBroker::GetNextCSeq(int* initial_peer_cseq) const {
+ static int send_cseq_;
+ ++send_cseq_;
+ if (initial_peer_cseq && send_cseq_ == *initial_peer_cseq)
+ send_cseq_ *= 2;
+
+ return send_cseq_;
+}
+
diff --git a/chromium/third_party/wds/src/mirac_network/mirac-broker.hpp b/chromium/third_party/wds/src/mirac_network/mirac-broker.hpp
new file mode 100644
index 00000000000..b0f32948993
--- /dev/null
+++ b/chromium/third_party/wds/src/mirac_network/mirac-broker.hpp
@@ -0,0 +1,100 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+
+#ifndef MIRAC_BROKER_HPP
+#define MIRAC_BROKER_HPP
+
+#include <glib.h>
+#include <memory>
+#include <map>
+#include <vector>
+
+#include "libwds/public/peer.h"
+#include "mirac-network.hpp"
+
+class MiracBroker : public wds::Peer::Delegate
+{
+ public:
+ MiracBroker (const std::string& listen_port);
+ MiracBroker(const std::string& peer_address, const std::string& peer_port, uint timeout = 3000);
+ virtual ~MiracBroker ();
+ unsigned short get_host_port() const;
+ std::string get_peer_address() const;
+ virtual wds::Peer* Peer() const = 0;
+ void OnTimeout(uint timer_id);
+
+ protected:
+ enum ConnectionFailure {
+ CONNECTION_TIMEOUT,
+ CONNECTION_LOST,
+ };
+
+ // wds::Peer::Delegate
+ void SendRTSPData(const std::string& data) override;
+ std::string GetLocalIPAddress() const override;
+ uint CreateTimer(int seconds) override;
+ void ReleaseTimer(uint timer_id) override;
+ int GetNextCSeq(int* initial_peer_cseq = nullptr) const override;
+
+ virtual void got_message(const std::string& data) {}
+ virtual void on_connected() {};
+ virtual void on_connection_failure(ConnectionFailure failure) {};
+
+ private:
+ static gboolean send_cb (gint fd, GIOCondition condition, gpointer data_ptr);
+ static gboolean receive_cb (gint fd, GIOCondition condition, gpointer data_ptr);
+ static gboolean listen_cb (gint fd, GIOCondition condition, gpointer data_ptr);
+ static gboolean connect_cb (gint fd, GIOCondition condition, gpointer data_ptr);
+ static gboolean try_connect(gpointer data_ptr);
+ static void on_timeout_remove(gpointer user_data);
+
+ gboolean send_cb (gint fd, GIOCondition condition);
+ gboolean receive_cb (gint fd, GIOCondition condition);
+ gboolean listen_cb (gint fd, GIOCondition condition);
+ gboolean connect_cb (gint fd, GIOCondition condition);
+ void try_connect();
+
+ void handle_body(const std::string msg);
+ void handle_header(const std::string msg);
+
+ void network(MiracNetwork* connection);
+ std::unique_ptr<MiracNetwork> network_;
+ MiracBroker *network_source_ptr_;
+
+ void connection(MiracNetwork* connection);
+ std::unique_ptr<MiracNetwork> connection_;
+ MiracBroker *connection_source_ptr_;
+
+ std::vector<uint> timers_;
+
+ std::string peer_address_;
+ std::string peer_port_;
+
+ GTimer *connect_timer_;
+ uint connect_wait_id_;
+ uint connect_timeout_;
+ static const uint connect_wait_ = 200;
+};
+
+
+#endif /* MIRAC_BROKER_HPP */
+
diff --git a/chromium/third_party/wds/src/mirac_network/mirac-exception.hpp b/chromium/third_party/wds/src/mirac_network/mirac-exception.hpp
new file mode 100644
index 00000000000..d2b356c0aa5
--- /dev/null
+++ b/chromium/third_party/wds/src/mirac_network/mirac-exception.hpp
@@ -0,0 +1,76 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * Contact: Jussi Laako <jussi.laako@linux.intel.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+
+#ifndef MIRAC_EXCEPTION_HPP
+#define MIRAC_EXCEPTION_HPP
+
+#include <cstring>
+#include <exception>
+
+class MiracException : public std::exception
+{
+ public:
+ MiracException () throw ()
+ { }
+ MiracException (int error_code, const char *function = NULL) throw ()
+ {
+ ec = error_code;
+ msg = strerror(ec);
+ add_func(function);
+ }
+ MiracException (const char *error_msg, const char *function = NULL) throw ()
+ {
+ msg = error_msg;
+ add_func(function);
+ }
+ MiracException (int error_code, const char *error_msg, const char *function = NULL) throw ()
+ {
+ ec = error_code;
+ msg = std::string(error_msg) + std::string(": ") +
+ std::string(strerror(ec));
+ add_func(function);
+ }
+ virtual ~MiracException () throw ()
+ { }
+
+ virtual const char * what () const throw ()
+ { return msg.c_str(); }
+ virtual operator int () const throw ()
+ { return ec; }
+ virtual operator std::string () const throw ()
+ { return msg; }
+
+ protected:
+ int ec;
+ std::string msg;
+ void add_func (const char *function) throw ()
+ {
+ if (function)
+ msg = std::string(function) + std::string("(): ") + msg;
+ }
+};
+
+
+#endif // MIRAC_EXCEPTION_HPP
+
diff --git a/chromium/third_party/wds/src/mirac_network/mirac-glib-logging.cpp b/chromium/third_party/wds/src/mirac_network/mirac-glib-logging.cpp
new file mode 100644
index 00000000000..9ccf85929b3
--- /dev/null
+++ b/chromium/third_party/wds/src/mirac_network/mirac-glib-logging.cpp
@@ -0,0 +1,64 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2015 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+#include "mirac-glib-logging.hpp"
+
+#include <glib.h>
+
+namespace {
+
+void MiracGlibLog(const char* format, ...) {
+ va_list va;
+ va_start(va, format);
+ g_logv(G_LOG_DOMAIN, G_LOG_LEVEL_MESSAGE, format, va);
+ va_end(va);
+}
+
+void MiracGlibVLog(const char* format, ...) {
+ va_list va;
+ va_start(va, format);
+ g_logv("rtsp", G_LOG_LEVEL_DEBUG, format, va);
+ va_end(va);
+}
+
+void MiracGlibWarning(const char* format, ...) {
+ va_list va;
+ va_start(va, format);
+ g_logv(G_LOG_DOMAIN, G_LOG_LEVEL_WARNING, format, va);
+ va_end(va);
+}
+
+void MiracGlibError(const char* format, ...) {
+ va_list va;
+ va_start(va, format);
+ g_logv(G_LOG_DOMAIN, G_LOG_LEVEL_ERROR, format, va);
+ va_end(va);
+}
+
+} // namespace
+
+void InitGlibLogging() {
+ wds::LogSystem::set_log_func(&MiracGlibLog);
+ wds::LogSystem::set_vlog_func(&MiracGlibVLog);
+ wds::LogSystem::set_warning_func(&MiracGlibWarning);
+ wds::LogSystem::set_error_func(&MiracGlibError);
+}
+
diff --git a/chromium/third_party/wds/src/mirac_network/mirac-glib-logging.hpp b/chromium/third_party/wds/src/mirac_network/mirac-glib-logging.hpp
new file mode 100644
index 00000000000..20f3d4e2705
--- /dev/null
+++ b/chromium/third_party/wds/src/mirac_network/mirac-glib-logging.hpp
@@ -0,0 +1,31 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2015 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+
+#ifndef MIRAC_LOGGING_HPP
+#define MIRAC_LOGGING_HPP
+
+#include "libwds/public/logging.h"
+
+void InitGlibLogging();
+
+#endif // MIRAC_LOGGING_HPP
+
diff --git a/chromium/third_party/wds/src/mirac_network/mirac-gst-bus-handler.cpp b/chromium/third_party/wds/src/mirac_network/mirac-gst-bus-handler.cpp
new file mode 100644
index 00000000000..bac674f6a78
--- /dev/null
+++ b/chromium/third_party/wds/src/mirac_network/mirac-gst-bus-handler.cpp
@@ -0,0 +1,62 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2015 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+#include <gst/gst.h>
+#include "libwds/public/logging.h"
+
+
+gboolean
+mirac_gstbus_callback (GstBus *bus,
+ GstMessage *message,
+ gpointer data)
+{
+ GError *err = NULL;
+ gchar *debug = NULL;
+
+ switch (GST_MESSAGE_TYPE (message)) {
+ case GST_MESSAGE_ERROR:
+ gst_message_parse_error (message, &err, &debug);
+ WDS_VLOG (debug);
+ WDS_ERROR ("[%s] %s", g_quark_to_string(err->domain), err->message);
+ g_error_free (err);
+ g_free (debug);
+ break;
+ case GST_MESSAGE_WARNING:
+ gst_message_parse_warning (message, &err, &debug);
+ WDS_VLOG (debug);
+ WDS_WARNING ("[%s] %s", g_quark_to_string(err->domain), err->message);
+ g_error_free (err);
+ g_free (debug);
+ break;
+ case GST_MESSAGE_INFO:
+ gst_message_parse_info (message, &err, &debug);
+ WDS_VLOG (debug);
+ WDS_LOG ("[%s] %s", g_quark_to_string(err->domain), err->message);
+ g_error_free (err);
+ g_free (debug);
+ break;
+ default:
+ /* unhandled message */
+ break;
+ }
+
+ return TRUE;
+}
diff --git a/chromium/third_party/wds/src/mirac_network/mirac-gst-bus-handler.hpp b/chromium/third_party/wds/src/mirac_network/mirac-gst-bus-handler.hpp
new file mode 100644
index 00000000000..5306fb6c8d3
--- /dev/null
+++ b/chromium/third_party/wds/src/mirac_network/mirac-gst-bus-handler.hpp
@@ -0,0 +1,30 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2015 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+#ifndef MIRAC_GST_BUS_HANDLER_HPP
+#define MIRAC_GST_BUS_HANDLER_HPP
+
+gboolean
+mirac_gstbus_callback (GstBus *bus,
+ GstMessage *message,
+ gpointer data);
+
+#endif \ No newline at end of file
diff --git a/chromium/third_party/wds/src/mirac_network/mirac-gst-sink.cpp b/chromium/third_party/wds/src/mirac_network/mirac-gst-sink.cpp
new file mode 100644
index 00000000000..98cf5371024
--- /dev/null
+++ b/chromium/third_party/wds/src/mirac_network/mirac-gst-sink.cpp
@@ -0,0 +1,120 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+#include "mirac-gst-sink.hpp"
+#include "mirac-gst-bus-handler.hpp"
+#include "libwds/public/logging.h"
+
+#include <cassert>
+
+void _set_udp_caps(GstElement *playbin, GstElement *source, gpointer user_data)
+{
+ GstCaps* caps = gst_caps_new_simple ("application/x-rtp",
+ "media", G_TYPE_STRING, "video",
+ "clock-rate", G_TYPE_INT, 1,
+ "encoding-name", G_TYPE_STRING, "MP2T",
+ NULL);
+
+ g_object_set(source, "caps", caps, NULL);
+ gst_caps_unref(caps);
+}
+
+MiracGstSink::MiracGstSink (std::string hostname, int port) {
+ // todo (shalamov): move out pipeline initialization
+ // from constructor, otherwise we can't check error conditions
+ std::string gst_pipeline;
+
+ std::string url = "udp://" + (!hostname.empty() ? hostname : "::") + (port > 0 ? ":" + std::to_string(port) : ":");
+ gst_pipeline = "playbin uri=" + url;
+
+ GError *err = NULL;
+ gst_elem = gst_parse_launch(gst_pipeline.c_str(), &err);
+ if (err != NULL) {
+ WDS_ERROR("Cannot initialize gstreamer pipeline: [%s] %s", g_quark_to_string(err->domain), err->message);
+ }
+
+ if (gst_elem) {
+ GstBus* bus = gst_pipeline_get_bus (GST_PIPELINE (gst_elem));
+ bus_watch_id = gst_bus_add_watch (bus, mirac_gstbus_callback, this);
+ gst_object_unref (bus);
+
+ g_signal_connect(gst_elem, "source-setup", G_CALLBACK(_set_udp_caps), NULL);
+ gst_element_set_state (gst_elem, GST_STATE_PLAYING);
+ }
+}
+
+int MiracGstSink::sink_udp_port() {
+ if (gst_elem == NULL)
+ return 0;
+
+ GstElement* source = NULL;
+ g_object_get(gst_elem, "source", &source, NULL);
+
+ if (source == NULL)
+ return 0;
+
+ gint port = 0;
+ g_object_get(source, "port", &port, NULL);
+ return port;
+}
+
+void MiracGstSink::Play() {
+ assert(gst_elem);
+ if(!IsInState(GST_STATE_PLAYING)) {
+ gst_element_set_state(gst_elem, GST_STATE_PLAYING);
+ IsInState(GST_STATE_PLAYING);
+ }
+}
+
+void MiracGstSink::Pause() {
+ assert(gst_elem);
+ if(!IsPaused()) {
+ gst_element_set_state(gst_elem, GST_STATE_PAUSED);
+ IsPaused();
+ }
+}
+
+void MiracGstSink::Teardown() {
+ assert(gst_elem);
+ if(!IsInState(GST_STATE_READY)) {
+ gst_element_set_state(gst_elem, GST_STATE_READY);
+ IsInState(GST_STATE_READY);
+ }
+}
+
+bool MiracGstSink::IsPaused() const {
+ return IsInState(GST_STATE_PAUSED);
+}
+
+bool MiracGstSink::IsInState(GstState state) const {
+ assert(gst_elem);
+ GstState current_state;
+ gst_element_get_state(gst_elem, &current_state, NULL, GST_CLOCK_TIME_NONE);
+ return current_state == state;
+}
+
+MiracGstSink::~MiracGstSink () {
+ if (gst_elem) {
+ gst_element_set_state (gst_elem, GST_STATE_NULL);
+ g_source_remove (bus_watch_id);
+ gst_object_unref (GST_OBJECT (gst_elem));
+ }
+}
diff --git a/chromium/third_party/wds/src/mirac_network/mirac-gst-sink.hpp b/chromium/third_party/wds/src/mirac_network/mirac-gst-sink.hpp
new file mode 100644
index 00000000000..f6257ca8883
--- /dev/null
+++ b/chromium/third_party/wds/src/mirac_network/mirac-gst-sink.hpp
@@ -0,0 +1,47 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+#ifndef MIRAC_GST_SINK_HPP
+#define MIRAC_GST_SINK_HPP
+
+#include <gst/gst.h>
+#include <string>
+
+class MiracGstSink
+{
+public:
+ MiracGstSink(std::string hostname, int port);
+ ~MiracGstSink ();
+
+ void Play();
+ void Pause();
+ bool IsPaused() const;
+ void Teardown();
+
+ int sink_udp_port();
+
+private:
+ bool IsInState(GstState state) const;
+ GstElement* gst_elem;
+ guint bus_watch_id;
+};
+
+#endif
diff --git a/chromium/third_party/wds/src/mirac_network/mirac-gst-test-source.cpp b/chromium/third_party/wds/src/mirac_network/mirac-gst-test-source.cpp
new file mode 100644
index 00000000000..12c262337fc
--- /dev/null
+++ b/chromium/third_party/wds/src/mirac_network/mirac-gst-test-source.cpp
@@ -0,0 +1,105 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * Contact: Alexander Kanavin <alex.kanavin@gmail.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+#include <iostream>
+#include <gio/gio.h>
+
+#include "mirac-gst-test-source.hpp"
+#include "mirac-gst-bus-handler.hpp"
+#include "libwds/public/logging.h"
+
+MiracGstTestSource::MiracGstTestSource (wfd_test_stream_t wfd_stream_type, std::string hostname, int port)
+{
+ std::string gst_pipeline;
+
+ std::string hostname_port = (!hostname.empty() ? "host=" + hostname + " ": " ") + (port > 0 ? "port=" + std::to_string(port) : "");
+
+ if (wfd_stream_type == WFD_TEST_BOTH) {
+ gst_pipeline = "videotestsrc ! videoconvert ! video/x-raw,format=I420 ! x264enc ! muxer. audiotestsrc ! avenc_ac3 ! muxer. mpegtsmux name=muxer ! rtpmp2tpay ! udpsink name=sink " +
+ hostname_port;
+ } else if (wfd_stream_type == WFD_TEST_AUDIO) {
+ gst_pipeline = "audiotestsrc ! avenc_ac3 ! mpegtsmux ! rtpmp2tpay ! udpsink name=sink " + hostname_port;
+ } else if (wfd_stream_type == WFD_TEST_VIDEO) {
+ gst_pipeline = "videotestsrc ! videoconvert ! video/x-raw,format=I420 ! x264enc ! mpegtsmux ! rtpmp2tpay ! udpsink name=sink " + hostname_port;
+ } else if (wfd_stream_type == WFD_DESKTOP) {
+ gst_pipeline = "ximagesrc ! videoconvert ! video/x-raw,format=I420 ! x264enc tune=zerolatency ! mpegtsmux ! rtpmp2tpay ! udpsink name=sink " + hostname_port;
+ }
+
+ GError *err = NULL;
+ gst_elem = gst_parse_launch(gst_pipeline.c_str(), &err);
+ if (err != NULL) {
+ WDS_ERROR("Cannot initialize gstreamer pipeline: [%s] %s", g_quark_to_string(err->domain), err->message);
+ }
+
+ if (gst_elem) {
+ GstBus* bus = gst_pipeline_get_bus (GST_PIPELINE (gst_elem));
+ bus_watch_id = gst_bus_add_watch (bus, mirac_gstbus_callback, this);
+ gst_object_unref (bus);
+ }
+}
+
+void MiracGstTestSource::SetState(GstState state)
+{
+ if (gst_elem) {
+ gst_element_set_state (gst_elem, state);
+ }
+}
+
+GstState MiracGstTestSource::GetState() const
+{
+ if (!gst_elem)
+ return GST_STATE_NULL;
+ GstState result;
+ gst_element_get_state (gst_elem, &result, NULL, GST_CLOCK_TIME_NONE);
+ return result;
+}
+
+int MiracGstTestSource::UdpSourcePort()
+{
+ if (gst_elem == NULL)
+ return 0;
+
+ GstElement* sink = NULL;
+ sink = gst_bin_get_by_name(GST_BIN(gst_elem), "sink");
+
+ if (sink == NULL)
+ return 0;
+
+ GSocket* socket = NULL;
+ g_object_get(sink, "used-socket", &socket, NULL);
+ if (socket == NULL)
+ return 0;
+
+ guint16 port = g_inet_socket_address_get_port(G_INET_SOCKET_ADDRESS(g_socket_get_local_address(socket, NULL)));
+
+ return port;
+}
+
+MiracGstTestSource::~MiracGstTestSource ()
+{
+ if (gst_elem) {
+ gst_element_set_state (gst_elem, GST_STATE_NULL);
+ g_source_remove (bus_watch_id);
+ gst_object_unref (GST_OBJECT (gst_elem));
+ }
+}
diff --git a/chromium/third_party/wds/src/mirac_network/mirac-gst-test-source.hpp b/chromium/third_party/wds/src/mirac_network/mirac-gst-test-source.hpp
new file mode 100644
index 00000000000..cdc635fbf8a
--- /dev/null
+++ b/chromium/third_party/wds/src/mirac_network/mirac-gst-test-source.hpp
@@ -0,0 +1,48 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * Contact: Alexander Kanavin <alex.kanavin@gmail.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+#ifndef MIRAC_GST_TEST_SOURCE_HPP
+#define MIRAC_GST_TEST_SOURCE_HPP
+
+#include <gst/gst.h>
+
+enum wfd_test_stream_t {WFD_TEST_AUDIO, WFD_TEST_VIDEO, WFD_TEST_BOTH, WFD_DESKTOP, WFD_UNKNOWN_STREAM};
+
+
+class MiracGstTestSource
+{
+public:
+ MiracGstTestSource(wfd_test_stream_t wfd_stream, std::string hostname, int port);
+ ~MiracGstTestSource ();
+
+ void SetState(GstState state);
+ GstState GetState() const;
+
+ int UdpSourcePort();
+
+private:
+ GstElement* gst_elem;
+ guint bus_watch_id;
+};
+
+#endif
diff --git a/chromium/third_party/wds/src/mirac_network/mirac-network.cpp b/chromium/third_party/wds/src/mirac_network/mirac-network.cpp
new file mode 100644
index 00000000000..e4f25b38f28
--- /dev/null
+++ b/chromium/third_party/wds/src/mirac_network/mirac-network.cpp
@@ -0,0 +1,322 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * Contact: Jussi Laako <jussi.laako@linux.intel.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+
+#include <cstddef>
+#include <cstdio>
+#include <cstdlib>
+#include <cstring>
+#include <cerrno>
+#include <algorithm>
+#include <memory>
+
+#include <unistd.h>
+#include <netdb.h>
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <sys/ioctl.h>
+#include <netinet/in.h>
+#include <netinet/tcp.h>
+#include <arpa/inet.h>
+
+#include "mirac-network.hpp"
+
+
+#define MIRAC_MAX_NAMELEN 255
+
+
+MiracNetwork::MiracNetwork ()
+{
+ Init();
+}
+
+
+MiracNetwork::MiracNetwork (int conn_handle)
+{
+ Init();
+ handle = conn_handle;
+}
+
+
+
+MiracNetwork::~MiracNetwork ()
+{
+ Close();
+}
+
+
+void MiracNetwork::Init ()
+{
+ long ps;
+
+ handle = -1;
+
+ ps = sysconf(_SC_PAGESIZE);
+ page_size = (ps <= 0) ? 4096 : static_cast<size_t> (ps);
+
+ conn_ares = NULL;
+}
+
+
+void MiracNetwork::Close ()
+{
+ if (handle >= 0)
+ close(handle);
+ handle = -1;
+
+ if (conn_ares)
+ {
+ freeaddrinfo(reinterpret_cast<struct addrinfo *> (conn_ares));
+ conn_ares = NULL;
+ }
+}
+
+
+void MiracNetwork::Bind (const char *address, const char *service)
+{
+ int ec;
+ int reuse = 1;
+ struct addrinfo *addr_res = NULL;
+ struct addrinfo *bind_addr;
+ struct addrinfo addr_hint;
+
+ Close();
+
+ memset(&addr_hint, 0x00, sizeof(addr_hint));
+ addr_hint.ai_flags = AI_PASSIVE;
+ ec = getaddrinfo(address, service, &addr_hint, &addr_res);
+ if (ec)
+ throw MiracException(gai_strerror(ec), __FUNCTION__);
+ bind_addr = addr_res;
+ while (bind_addr)
+ {
+ /* note, the SOCK_NONBLOCK is specific to Linux 2.6.27+,
+ * on other platforms use either fcntl() or ioctl(h, FIONBIO, 1) */
+ handle = socket(addr_res->ai_family,
+ addr_res->ai_socktype | SOCK_NONBLOCK, addr_res->ai_protocol);
+ if (handle < 0)
+ throw MiracException(errno, "socket()", __FUNCTION__);
+ if (setsockopt(handle, SOL_SOCKET, SO_REUSEADDR,
+ &reuse, sizeof(reuse)))
+ throw MiracException(errno, "setsockopt()", __FUNCTION__);
+ if (bind(handle, bind_addr->ai_addr, bind_addr->ai_addrlen) == 0)
+ break;
+ else if (!bind_addr->ai_next)
+ throw MiracException(errno, "bind()", __FUNCTION__);
+ close(handle);
+ bind_addr = bind_addr->ai_next;
+ }
+ freeaddrinfo(addr_res);
+
+ if (listen(handle, 1))
+ throw MiracException(errno, "listen()", __FUNCTION__);
+}
+
+
+MiracNetwork * MiracNetwork::Accept ()
+{
+ int ch;
+ int nonblock = 1;
+
+ ch = accept(handle, NULL, NULL);
+ if (ch < 0)
+ throw MiracException(errno, "accept()", __FUNCTION__);
+ if (ioctl(ch, FIONBIO, &nonblock))
+ throw MiracException(errno, "ioctl(FIONBIO)", __FUNCTION__);
+ return new MiracNetwork(ch);
+}
+
+
+bool MiracNetwork::Connect (const char *address, const char *service)
+{
+ int ec = 0;
+
+ if (address && service)
+ {
+ Close();
+
+ struct addrinfo addr_hint;
+ memset(&addr_hint, 0x00, sizeof(addr_hint));
+ addr_hint.ai_socktype = SOCK_STREAM;
+ ec = getaddrinfo(address, service, &addr_hint,
+ reinterpret_cast<struct addrinfo **> (&conn_ares));
+ if (ec)
+ throw MiracException(gai_strerror(ec), __FUNCTION__);
+ conn_aptr = conn_ares;
+ }
+ else
+ {
+ socklen_t optlen = sizeof(ec);
+ if (getsockopt(handle, SOL_SOCKET, SO_ERROR, &ec, &optlen))
+ throw MiracException(errno, "getsockopt()", __FUNCTION__);
+ if (!ec)
+ return true;
+ conn_aptr = reinterpret_cast<struct addrinfo *> (conn_aptr)->ai_next;
+ }
+
+ struct addrinfo *addr = reinterpret_cast<struct addrinfo *> (conn_aptr);
+ if (!addr)
+ throw MiracException("peer unavailable", __FUNCTION__);
+ /* note, the SOCK_NONBLOCK is specific to Linux 2.6.27+,
+ * on other platforms use either fcntl() or ioctl(h, FIONBIO, 1) */
+ handle = socket(addr->ai_family,
+ addr->ai_socktype | SOCK_NONBLOCK, addr->ai_protocol);
+ if (handle < 0)
+ throw MiracException(errno, "socket()", __FUNCTION__);
+ if (connect(handle, addr->ai_addr, addr->ai_addrlen))
+ {
+ if (errno == EINPROGRESS)
+ return false;
+ throw MiracException(errno, "connect()", __FUNCTION__);
+ }
+ return true;
+}
+
+
+std::string MiracNetwork::GetPeerAddress ()
+{
+ int ec;
+ socklen_t addrsize = std::max(sizeof(sockaddr_in), sizeof(sockaddr_in6));
+ std::unique_ptr<uint8_t []> addrbuf(new uint8_t[addrsize]);
+ std::unique_ptr<char []> namebuf(new char [MIRAC_MAX_NAMELEN + 1]);
+ std::unique_ptr<char []> servbuf(new char [MIRAC_MAX_NAMELEN + 1]);
+
+ if (getpeername(handle,
+ reinterpret_cast<struct sockaddr *> (addrbuf.get()), &addrsize))
+ throw MiracException(errno, "getpeername()", __FUNCTION__);
+ ec = getnameinfo(
+ reinterpret_cast<struct sockaddr *> (addrbuf.get()), addrsize,
+ namebuf.get(), MIRAC_MAX_NAMELEN,
+ servbuf.get(), MIRAC_MAX_NAMELEN,
+ NI_NOFQDN|NI_NUMERICHOST|NI_NUMERICSERV);
+ if (ec)
+ throw MiracException(gai_strerror(ec), __FUNCTION__);
+ return std::string(namebuf.get());
+}
+
+
+unsigned short MiracNetwork::GetHostPort ()
+{
+ socklen_t addrsize = std::max(sizeof(sockaddr_in), sizeof(sockaddr_in6));
+ std::unique_ptr<uint8_t []> addrbuf(new uint8_t[addrsize]);
+
+ if (getsockname(handle,
+ reinterpret_cast<struct sockaddr *> (addrbuf.get()), &addrsize))
+ throw MiracException(errno, "getsockname()", __FUNCTION__);
+
+ struct sockaddr *saddr =
+ reinterpret_cast<struct sockaddr *> (addrbuf.get());
+ if (saddr->sa_family == AF_INET)
+ {
+ struct sockaddr_in *ip4addr =
+ reinterpret_cast<struct sockaddr_in *> (saddr);
+ return ntohs(ip4addr->sin_port);
+ }
+ else if (saddr->sa_family == AF_INET6)
+ {
+ struct sockaddr_in6 *ip6addr =
+ reinterpret_cast<struct sockaddr_in6 *> (saddr);
+ return ntohs(ip6addr->sin6_port);
+ }
+ return 0;
+}
+
+
+bool MiracNetwork::Receive (std::string &message)
+{
+ int ec;
+ char nb[page_size];
+
+ do {
+ ec = recv(handle, nb, page_size, 0);
+ if (ec > 0)
+ message.append(nb, ec);
+ else if (ec < 0)
+ {
+ if (errno == EAGAIN || errno == EWOULDBLOCK)
+ break;
+ if (errno == ECONNRESET)
+ throw MiracConnectionLostException( __FUNCTION__);
+ throw MiracException(errno, "recv()", __FUNCTION__);
+ }
+ else // ec == 0
+ throw MiracConnectionLostException( __FUNCTION__);
+ } while (ec > 0);
+
+ return true;
+}
+
+
+bool MiracNetwork::Receive (std::string &message, size_t length)
+{
+ int ec;
+ char nb[page_size];
+
+ do {
+ ec = recv(handle, nb, page_size, 0);
+ if (ec > 0)
+ recv_buf.append(nb, ec);
+ else if (ec < 0)
+ {
+ if (errno == EAGAIN || errno == EWOULDBLOCK)
+ break;
+ if (errno == ECONNRESET)
+ throw MiracConnectionLostException( __FUNCTION__);
+ throw MiracException(errno, "recv()", __FUNCTION__);
+ }
+ else // ec == 0
+ throw MiracConnectionLostException( __FUNCTION__);
+ } while (ec > 0);
+
+ if (recv_buf.size() < length)
+ return false;
+
+ message = recv_buf.substr(0, length);
+ recv_buf.erase(0, length);
+ return true;
+}
+
+
+bool MiracNetwork::Send (const std::string &message)
+{
+ int ec;
+
+ if (!message.empty())
+ send_buf.append(message);
+ do {
+ ec = send(handle, send_buf.c_str(), send_buf.size(), MSG_NOSIGNAL);
+ if (ec > 0)
+ send_buf.erase(0, ec);
+ else
+ {
+ if (errno == EAGAIN || errno == EWOULDBLOCK)
+ return false;
+ if (errno == EPIPE || errno == ENOTCONN)
+ throw MiracConnectionLostException(__FUNCTION__);
+ throw MiracException(errno, "send()", __FUNCTION__);
+ }
+ } while (send_buf.size() > 0);
+
+ return true;
+}
+
diff --git a/chromium/third_party/wds/src/mirac_network/mirac-network.hpp b/chromium/third_party/wds/src/mirac_network/mirac-network.hpp
new file mode 100644
index 00000000000..d925ee574f9
--- /dev/null
+++ b/chromium/third_party/wds/src/mirac_network/mirac-network.hpp
@@ -0,0 +1,81 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * Contact: Jussi Laako <jussi.laako@linux.intel.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+
+#ifndef MIRAC_NETWORK_HPP
+#define MIRAC_NETWORK_HPP
+
+#include <cstring>
+#include <string>
+
+#include "mirac-exception.hpp"
+
+
+class MiracConnectionLostException : public MiracException
+{
+ public:
+ MiracConnectionLostException (const char *function = NULL) throw ()
+ {
+ msg = std::string("Connection lost");
+ add_func(function);
+ }
+ virtual ~MiracConnectionLostException () throw ()
+ { }
+};
+
+
+
+class MiracNetwork
+{
+ public:
+ MiracNetwork ();
+ MiracNetwork (int conn_handle);
+ virtual ~MiracNetwork ();
+ void Bind (const char *address, const char *service);
+ MiracNetwork * Accept ();
+ bool Connect (const char *address, const char *service);
+ int GetHandle () const
+ { return handle; }
+ std::string GetPeerAddress ();
+ unsigned short GetHostPort ();
+ bool Receive (std::string &message);
+ bool Receive (std::string &message, size_t length);
+ bool Send (const std::string &message = std::string());
+
+ protected:
+ int handle;
+ size_t page_size;
+ std::string recv_buf;
+ std::string send_buf;
+
+ void Init ();
+ void Close ();
+
+ private:
+ void *conn_ares;
+ void *conn_aptr;
+};
+
+
+#endif /* MIRAC_NETWORK_HPP */
+
diff --git a/chromium/third_party/wds/src/mirac_network/network-test.cpp b/chromium/third_party/wds/src/mirac_network/network-test.cpp
new file mode 100644
index 00000000000..02ecf15aba3
--- /dev/null
+++ b/chromium/third_party/wds/src/mirac_network/network-test.cpp
@@ -0,0 +1,179 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * Contact: Jussi Laako <jussi.laako@linux.intel.com>
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+
+#include <glib.h>
+#include <glib-unix.h>
+
+#include <memory>
+
+#include "mirac-network.hpp"
+
+
+static gboolean _sig_handler (gpointer data_ptr)
+{
+ GMainLoop *ml = (GMainLoop *) data_ptr;
+
+ g_main_loop_quit(ml);
+
+ return G_SOURCE_CONTINUE;
+}
+
+
+static gboolean _send_cb (gint fd, GIOCondition condition,
+ gpointer data_ptr)
+{
+ MiracNetwork *ctx = reinterpret_cast<MiracNetwork *> (data_ptr);
+
+ try
+ {
+ return ctx->Send() ? G_SOURCE_REMOVE : G_SOURCE_CONTINUE;
+ }
+ catch (std::exception &x)
+ {
+ g_warning("exception: %s", x.what());
+ delete ctx;
+ }
+ return G_SOURCE_REMOVE;
+}
+
+
+static gboolean _receive_cb (gint fd, GIOCondition condition,
+ gpointer data_ptr)
+{
+ MiracNetwork *ctx = reinterpret_cast<MiracNetwork *> (data_ptr);
+
+ try
+ {
+ std::string msg;
+ if (ctx->Receive(msg))
+ {
+ g_message("message: %s", msg.c_str());
+ if (!ctx->Send(msg))
+ g_unix_fd_add(ctx->GetHandle(), G_IO_OUT, _send_cb, ctx);
+ }
+ }
+ catch (std::exception &x)
+ {
+ g_warning("exception: %s", x.what());
+ delete ctx;
+ return G_SOURCE_REMOVE;
+ }
+ return G_SOURCE_CONTINUE;
+}
+
+
+static gboolean _listen_cb (gint fd, GIOCondition condition, gpointer data_ptr)
+{
+ try
+ {
+ MiracNetwork *listener = reinterpret_cast<MiracNetwork *> (data_ptr);
+ MiracNetwork *ctx;
+
+ ctx = listener->Accept();
+ g_message("connection from: %s", ctx->GetPeerAddress().c_str());
+ g_unix_fd_add(ctx->GetHandle(), G_IO_IN, _receive_cb, ctx);
+ }
+ catch (std::exception &x)
+ {
+ g_warning("exception: %s", x.what());
+ }
+ return G_SOURCE_CONTINUE;
+}
+
+
+static gboolean _sendmsg_cb (gint fd, GIOCondition condition, gpointer data_ptr)
+{
+ try
+ {
+ MiracNetwork *ctx = reinterpret_cast<MiracNetwork *> (data_ptr);
+
+ if (!ctx->Send (std::string("Hello world!\r\n\r\n")))
+ g_unix_fd_add(ctx->GetHandle(), G_IO_OUT, _send_cb, ctx);
+
+ }
+ catch (std::exception &x)
+ {
+ g_warning("exception %s", x.what());
+ }
+ return G_SOURCE_REMOVE;
+}
+
+
+static gboolean _connect_cb (gint fd, GIOCondition condition, gpointer data_ptr)
+{
+ try
+ {
+ MiracNetwork *ctx = reinterpret_cast<MiracNetwork *> (data_ptr);
+
+ if (!ctx->Connect(NULL, NULL))
+ return G_SOURCE_CONTINUE;
+ g_message("connection success to: %s", ctx->GetPeerAddress().c_str());
+ g_unix_fd_add(ctx->GetHandle(), G_IO_OUT, _sendmsg_cb, ctx);
+ }
+ catch (std::exception &x)
+ {
+ g_warning("exception: %s", x.what());
+ }
+ return G_SOURCE_REMOVE;
+}
+
+
+int main (int argc, char *argv[])
+{
+ GMainLoop *ml = NULL;
+
+ try
+ {
+ ml = g_main_loop_new(NULL, TRUE);
+ g_unix_signal_add(SIGINT, _sig_handler, ml);
+ g_unix_signal_add(SIGTERM, _sig_handler, ml);
+
+ std::unique_ptr<MiracNetwork> net_listen(new MiracNetwork);
+ std::unique_ptr<MiracNetwork> net_conn(new MiracNetwork);
+
+ net_listen->Bind("127.0.0.1", "8080");
+ g_message("bound to port %hu", net_listen->GetHostPort());
+ g_unix_fd_add(net_listen->GetHandle(), G_IO_IN, _listen_cb,
+ net_listen.get());
+
+ if (net_conn->Connect("127.0.0.1", "8080"))
+ g_unix_fd_add(net_conn->GetHandle(), G_IO_OUT, _sendmsg_cb,
+ net_conn.get());
+ else
+ g_unix_fd_add(net_conn->GetHandle(), G_IO_OUT, _connect_cb,
+ net_conn.get());
+
+ g_main_loop_run(ml);
+ }
+ catch (std::exception &x)
+ {
+ g_error("exception: %s", x.what());
+ }
+
+ if (ml)
+ g_main_loop_unref(ml);
+
+ return 0;
+}
+
diff --git a/chromium/third_party/wds/src/p2p/CMakeLists.txt b/chromium/third_party/wds/src/p2p/CMakeLists.txt
new file mode 100644
index 00000000000..04b293f5cfa
--- /dev/null
+++ b/chromium/third_party/wds/src/p2p/CMakeLists.txt
@@ -0,0 +1,20 @@
+#FIXME in the future: with cmake 2.8.12 and up it's better
+#to use target_compile_options or add_compile_options
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -O0 -std=c++11 -ggdb3 -Wall")
+set(CMAKE_C_FLAGS "${CMAKE_CXX_FLAGS} -O0 -std=c99 -ggdb3 -Wall")
+
+find_package(PkgConfig REQUIRED)
+pkg_check_modules (GIO REQUIRED gio-2.0)
+include_directories(${GIO_INCLUDE_DIRS})
+
+add_library(p2p STATIC
+ connman-peer.cpp connman-client.cpp information-element.cpp
+)
+
+add_executable(register-peer-service main.cpp)
+target_link_libraries (register-peer-service p2p ${GIO_LIBRARIES})
+
+add_executable(test-ie test-ie.cpp)
+target_link_libraries (test-ie p2p ${GIO_LIBRARIES})
+
+add_test(InformationElementTest test-ie)
diff --git a/chromium/third_party/wds/src/p2p/connman-client.cpp b/chromium/third_party/wds/src/p2p/connman-client.cpp
new file mode 100644
index 00000000000..3db7774a984
--- /dev/null
+++ b/chromium/third_party/wds/src/p2p/connman-client.cpp
@@ -0,0 +1,380 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+#include <iostream>
+#include <gio/gio.h>
+#include <memory>
+
+#include "connman-client.h"
+
+namespace P2P {
+
+void Client::connman_appeared_cb(GDBusConnection *connection, const char *name, const char *owner, gpointer data_ptr)
+{
+ g_dbus_proxy_new_for_bus (G_BUS_TYPE_SYSTEM,
+ G_DBUS_PROXY_FLAGS_NONE,
+ NULL,
+ "net.connman",
+ "/",
+ "net.connman.Manager",
+ NULL,
+ Client::proxy_cb,
+ data_ptr);
+
+ /* TODO should get the p2p object path
+ * by watching Manager.TechnologyAdded/TechnologyRemoved */
+ g_dbus_proxy_new_for_bus (G_BUS_TYPE_SYSTEM,
+ G_DBUS_PROXY_FLAGS_NONE,
+ NULL,
+ "net.connman",
+ "/net/connman/technology/p2p",
+ "net.connman.Technology",
+ NULL,
+ Client::technology_proxy_cb,
+ data_ptr);
+}
+
+void Client::connman_disappeared_cb(GDBusConnection *connection, const char *name, gpointer data_ptr)
+{
+ auto client = static_cast<Client*> (data_ptr);
+ client->connman_disappeared ();
+}
+
+/* static C callback */
+void Client::proxy_signal_cb (GDBusProxy *proxy, const char *sender, const char *signal, GVariant *params, gpointer data_ptr)
+{
+ if (g_strcmp0(signal, "PeersChanged") != 0)
+ return;
+
+ auto client = static_cast<Client*> (data_ptr);
+ client->peers_changed (params);
+}
+
+void Client::get_technologies_cb (GObject *object, GAsyncResult *res, gpointer data_ptr)
+{
+ GError *error = NULL;
+ GDBusProxy *proxy = G_DBUS_PROXY (object);
+ char *object_path;
+ bool p2p_found = false;
+ GVariant *params;
+ GVariantIter *iter;
+
+ params = g_dbus_proxy_call_finish (proxy, res, &error);
+ if (error) {
+ std::cout << "GetTechnologies error " << error->message << std::endl;
+ g_clear_error (&error);
+ }
+
+ g_variant_get (params, "(a(oa{sv}))", &iter);
+ while (g_variant_iter_loop (iter, "(oa{sv})", &object_path, NULL)) {
+ /* TODO: warn if P2P is not enabled. Also, don't set
+ * the client available before P2P is enabled */
+ if (g_strcmp0(object_path, "/net/connman/technology/p2p") == 0) {
+ p2p_found = true;
+ break;
+ }
+ }
+ g_variant_unref(params);
+ g_variant_iter_free (iter);
+
+ if (!p2p_found)
+ std::cout << "Warning: P2P not found in Connman technologies." << std::endl;
+}
+
+void Client::register_peer_service_cb (GObject *object, GAsyncResult *res, gpointer data_ptr)
+{
+ GError *error = NULL;
+ GDBusProxy *proxy = G_DBUS_PROXY (object);
+
+ g_dbus_proxy_call_finish (proxy, res, &error);
+ if (error) {
+ std::cout << "register error " << error->message << std::endl;
+ g_clear_error (&error);
+ return;
+ }
+}
+
+void Client::get_peers_cb (GObject *object, GAsyncResult *res, gpointer data_ptr)
+{
+ GError *error = NULL;
+ GDBusProxy *proxy = G_DBUS_PROXY(object);
+ GVariantIter *peer_iter;
+ GVariant *params;
+
+ params = g_dbus_proxy_call_finish(proxy, res, &error);
+ if (error) {
+ std::cout << "GetPeers error " << error->message << std::endl;
+ g_clear_error(&error);
+ return;
+ }
+
+ g_variant_get(params, "(a(oa{sv}))", &peer_iter);
+ auto client = static_cast<Client*>(data_ptr);
+ client->handle_new_peers(peer_iter);
+
+ g_variant_unref(params);
+ g_variant_iter_free(peer_iter);
+}
+
+/* static C callback */
+void Client::scan_cb (GObject *object, GAsyncResult *res, gpointer data_ptr)
+{
+ GError *error = NULL;
+ GDBusProxy *proxy = G_DBUS_PROXY (object);
+
+ g_dbus_proxy_call_finish (proxy, res, &error);
+ if (error) {
+ std::cout << "scan error " << error->message << std::endl;
+ g_clear_error (&error);
+ return;
+ }
+
+ std::cout << "* scan complete"<< std::endl;
+}
+
+/* static C callback */
+void Client::proxy_cb (GObject *object, GAsyncResult *res, gpointer data_ptr)
+{
+ auto client = static_cast<Client*> (data_ptr);
+ client->proxy_cb (res);
+}
+
+/* static C callback */
+void Client::technology_proxy_cb (GObject *object, GAsyncResult *res, gpointer data_ptr)
+{
+ auto client = static_cast<Client*> (data_ptr);
+ client->technology_proxy_cb (res);
+}
+
+
+void Client::connman_disappeared()
+{
+ bool was_available = is_available();
+
+ if (proxy_)
+ g_clear_object (&proxy_);
+ if (technology_proxy_)
+ g_clear_object (&technology_proxy_);
+
+ if (observer_ && was_available)
+ observer_->on_availability_changed(this);
+}
+
+void Client::handle_new_peers (GVariantIter *added)
+{
+ GVariantIter *props;
+ const char *path;
+
+ while (g_variant_iter_loop(added, "(oa{sv})", &path, &props)) {
+ try {
+ peers_[path] = std::make_shared<P2P::Peer>(path, props);
+ if (observer_)
+ observer_->on_peer_added(this, peers_[path]);
+ } catch (std::invalid_argument &x) {
+ /* Not a miracast peer */
+ }
+ }
+}
+
+void Client::peers_changed (GVariant *params)
+{
+ GVariantIter *added, *removed;
+ const char *path;
+
+ g_variant_get(params, "(a(oa{sv})ao)", &added, &removed);
+
+ handle_new_peers(added);
+
+ while (g_variant_iter_loop (removed, "o", &path)) {
+ auto it = peers_.find(path);
+ if (it == peers_.end())
+ return;
+
+ if (observer_)
+ observer_->on_peer_removed(this, it->second);
+
+ peers_.erase(it);
+ }
+
+ g_variant_iter_free (added);
+ g_variant_iter_free (removed);
+}
+
+void Client::register_peer_service ()
+{
+ GVariantBuilder builder;
+
+ /* HACK: Connman should figure out the "master" boolean on its own but it does not.
+ * We need to do it here with InformationElement for now... */
+ P2P::InformationElement ie(array_);
+ bool is_master = (ie.get_device_type() != P2P::SOURCE);
+
+ g_variant_builder_init (&builder, G_VARIANT_TYPE("a{sv}"));
+ g_variant_builder_add (&builder, "{sv}",
+ "WiFiDisplayIEs",
+ g_variant_new_fixed_array (G_VARIANT_TYPE_BYTE,
+ array_->bytes,
+ array_->length,
+ 1));
+
+ g_dbus_proxy_call (proxy_,
+ "RegisterPeerService",
+ g_variant_new ("(a{sv}b)", &builder, is_master),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ NULL,
+ Client::register_peer_service_cb,
+ this);
+}
+
+void Client::unregister_peer_service ()
+{
+ GVariantBuilder builder;
+ g_variant_builder_init (&builder, G_VARIANT_TYPE("a{sv}"));
+ g_variant_builder_add (&builder, "{sv}",
+ "WiFiDisplayIEs",
+ g_variant_new_fixed_array (G_VARIANT_TYPE_BYTE,
+ array_->bytes,
+ array_->length,
+ 1));
+
+ g_dbus_proxy_call (proxy_,
+ "UnregisterPeerService",
+ g_variant_new ("(a{sv}b)", &builder, TRUE),
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ NULL,
+ Client::register_peer_service_cb,
+ this);
+}
+
+void Client::initialize_peers ()
+{
+ g_dbus_proxy_call(proxy_,
+ "GetPeers",
+ NULL,
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ NULL,
+ Client::get_peers_cb,
+ this);
+}
+
+
+void Client::proxy_cb (GAsyncResult *result)
+{
+ GError *error = NULL;
+
+ proxy_ = g_dbus_proxy_new_for_bus_finish(result, &error);
+ if (error) {
+ std::cout << "proxy error "<< std::endl;
+ g_clear_error (&error);
+ return;
+ }
+
+ g_signal_connect(proxy_, "g-signal",
+ G_CALLBACK (Client::proxy_signal_cb), this);
+
+ g_dbus_proxy_call(proxy_,
+ "GetTechnologies",
+ NULL,
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ NULL,
+ Client::get_technologies_cb,
+ this);
+
+ initialize_peers();
+ register_peer_service();
+
+ if(observer_ && is_available())
+ observer_->on_availability_changed(this);
+}
+
+void Client::technology_proxy_cb (GAsyncResult *result)
+{
+ GError *error = NULL;
+
+ technology_proxy_ = g_dbus_proxy_new_for_bus_finish(result, &error);
+ if (error) {
+ std::cout << "tech proxy error "<< std::endl;
+ g_clear_error (&error);
+ }
+
+ if(observer_ && is_available())
+ observer_->on_availability_changed(this);
+}
+
+Client::Client(std::unique_ptr<P2P::InformationElementArray> &take_array, Observer *observer):
+ proxy_(NULL),
+ technology_proxy_(NULL),
+ observer_(observer),
+ array_(std::move(take_array))
+{
+ connman_watcher_ = g_bus_watch_name (G_BUS_TYPE_SYSTEM,
+ "net.connman",
+ G_BUS_NAME_WATCHER_FLAGS_NONE,
+ Client::connman_appeared_cb,
+ Client::connman_disappeared_cb,
+ this, NULL);
+}
+
+Client::~Client()
+{
+ if (connman_watcher_ != 0) {
+ g_bus_unwatch_name (connman_watcher_);
+ connman_watcher_ = 0;
+ }
+ if (proxy_)
+ g_clear_object (&proxy_);
+ if (technology_proxy_)
+ g_clear_object (&technology_proxy_);
+}
+
+void Client::set_information_element(std::unique_ptr<P2P::InformationElementArray> &take_array)
+{
+ g_return_if_fail (is_available());
+
+ unregister_peer_service();
+ array_ = std::move (take_array);
+ register_peer_service();
+}
+
+bool Client::is_available() const
+{
+ return proxy_ && technology_proxy_;
+}
+
+void Client::scan()
+{
+ g_return_if_fail (is_available());
+
+ g_dbus_proxy_call (technology_proxy_,
+ "Scan",
+ NULL,
+ G_DBUS_CALL_FLAGS_NONE,
+ 60 * 1000,
+ NULL,
+ Client::scan_cb,
+ this);
+}
+
+}
diff --git a/chromium/third_party/wds/src/p2p/connman-client.h b/chromium/third_party/wds/src/p2p/connman-client.h
new file mode 100644
index 00000000000..6f7dc0098f5
--- /dev/null
+++ b/chromium/third_party/wds/src/p2p/connman-client.h
@@ -0,0 +1,88 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+#ifndef CONNMAN_CLIENT_H_
+#define CONNMAN_CLIENT_H_
+
+#include <memory>
+#include <gio/gio.h>
+
+#include "information-element.h"
+#include "connman-peer.h"
+
+namespace P2P {
+
+class Client {
+ public:
+ class Observer {
+ public:
+ virtual void on_peer_added(Client *client, std::shared_ptr<P2P::Peer> peer) {}
+ virtual void on_peer_removed(Client *client, std::shared_ptr<P2P::Peer> peer) {}
+ virtual void on_availability_changed(Client *client) {}
+
+ protected:
+ virtual ~Observer() {}
+ };
+
+ Client(std::unique_ptr<P2P::InformationElementArray> &take_array, Observer *observer = NULL);
+ virtual ~Client();
+
+ void set_information_element(std::unique_ptr<P2P::InformationElementArray> &take_array);
+ void set_observer(Observer* observer) {
+ observer_ = observer;
+ }
+
+ bool is_available() const;
+ /* TODO error / finished handling */
+ void scan();
+
+ private:
+ static void connman_appeared_cb(GDBusConnection *connection, const char *name, const char *owner, gpointer data_ptr);
+ static void connman_disappeared_cb(GDBusConnection *connection, const char *name, gpointer data_ptr);
+ static void proxy_signal_cb (GDBusProxy *proxy, const char *sender, const char *signal, GVariant *params, gpointer data_ptr);
+ static void proxy_cb(GObject *object, GAsyncResult *res, gpointer data_ptr);
+ static void technology_proxy_cb(GObject *object, GAsyncResult *res, gpointer data_ptr);
+ static void get_technologies_cb(GObject *object, GAsyncResult *res, gpointer data_ptr);
+ static void register_peer_service_cb(GObject *object, GAsyncResult *res, gpointer data_ptr);
+ static void scan_cb(GObject *object, GAsyncResult *res, gpointer data_ptr);
+ static void get_peers_cb(GObject *object, GAsyncResult *res, gpointer data_ptr);
+
+ void connman_disappeared();
+ void peers_changed (GVariant *params);
+ void proxy_cb(GAsyncResult *res);
+ void technology_proxy_cb(GAsyncResult *res);
+ void handle_new_peers(GVariantIter *added);
+
+ void initialize_peers();
+ void register_peer_service();
+ void unregister_peer_service();
+
+ uint connman_watcher_;
+ GDBusProxy *proxy_;
+ GDBusProxy *technology_proxy_;
+
+ Observer* observer_;
+ std::unique_ptr<P2P::InformationElementArray>array_;
+ std::map<std::string, std::shared_ptr<P2P::Peer>> peers_;
+};
+
+}
+#endif // CONNMAN_CLIENT_H_
diff --git a/chromium/third_party/wds/src/p2p/connman-peer.cpp b/chromium/third_party/wds/src/p2p/connman-peer.cpp
new file mode 100644
index 00000000000..292045fcc9e
--- /dev/null
+++ b/chromium/third_party/wds/src/p2p/connman-peer.cpp
@@ -0,0 +1,257 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+#include <iostream>
+#include <stdexcept>
+#include <gio/gio.h>
+
+#include "connman-peer.h"
+
+namespace P2P {
+
+/* static C callback */
+void Peer::proxy_cb (GObject *object, GAsyncResult *res, gpointer data_ptr)
+{
+ auto client = static_cast<Peer*> (data_ptr);
+ client->proxy_cb (res);
+}
+
+/* static C callback */
+void Peer::proxy_signal_cb (GDBusProxy *proxy, const char *sender, const char *signal, GVariant *params, gpointer data_ptr)
+{
+ GVariant *property;
+ char *name;
+ auto peer = static_cast<Peer*> (data_ptr);
+
+ if (g_strcmp0(signal, "PropertyChanged") != 0)
+ return;
+
+ g_variant_get (params, "(sv)", &name, &property);
+
+ peer->handle_property_change (name, property);
+}
+
+void Peer::handle_property_change (const char *name, GVariant *property)
+{
+ if (g_strcmp0(name, "State") == 0) {
+ state_changed (g_variant_get_string (property, NULL));
+ } else if (g_strcmp0(name, "Name") == 0) {
+ name_changed (g_variant_get_string (property, NULL));
+ } else if (g_strcmp0(name, "Services") == 0) {
+ GVariantIter *service_array, *services;
+ GVariant *spec_val;
+
+ g_variant_get (property, "a(a{sv})", &service_array);
+ while (g_variant_iter_loop (service_array, "(a{sv})", &services)) {
+ const char *service_name;
+ while (g_variant_iter_loop (services, "{sv}", &service_name, &spec_val)) {
+ if (g_strcmp0 (service_name, "WiFiDisplayIEs") == 0) {
+ uint8_t *bytes;
+ gsize length;
+
+ bytes = (uint8_t*)g_variant_get_fixed_array (spec_val, &length, 1);
+ std::unique_ptr<P2P::InformationElementArray> array
+ (new P2P::InformationElementArray(length, bytes));
+ ie_.reset(new P2P::InformationElement (array));
+ }
+ }
+ }
+ g_variant_iter_free (service_array);
+ } else if (g_strcmp0(name, "IPv4") == 0) {
+ GVariantIter *ips;
+ GVariant *spec_val;
+ char *name;
+ const char *remote = "";
+ const char *local = "";
+
+ g_variant_get (property, "a{sv}", &ips);
+ while (g_variant_iter_loop (ips, "{sv}", &name, &spec_val)) {
+ if (g_strcmp0 (name, "Remote") == 0) {
+ remote = g_variant_get_string (spec_val, NULL);
+ } else if (g_strcmp0 (name, "Local") == 0) {
+ local = g_variant_get_string (spec_val, NULL);
+ }
+ }
+ ips_changed (remote, local);
+
+ g_variant_iter_free (ips);
+ }
+}
+
+/* static C callback */
+void Peer::connect_cb (GObject *object, GAsyncResult *res, gpointer data_ptr)
+{
+ GError *error = NULL;
+ GDBusProxy *proxy = G_DBUS_PROXY (object);
+
+ g_dbus_proxy_call_finish (proxy, res, &error);
+ if (error) {
+ std::cout << "connect error " << error->message << std::endl;
+ g_clear_error (&error);
+ return;
+ }
+
+ std::cout << "* connected "<< std::endl;
+}
+
+/* static C callback */
+void Peer::disconnect_cb (GObject *object, GAsyncResult *res, gpointer data_ptr)
+{
+ GError *error = NULL;
+ GDBusProxy *proxy = G_DBUS_PROXY (object);
+
+ g_dbus_proxy_call_finish (proxy, res, &error);
+ if (error) {
+ std::cout << "disconnect error " << error->message << std::endl;
+ g_clear_error (&error);
+ return;
+ }
+
+ std::cout << "* disconnected "<< std::endl;
+}
+
+void Peer::proxy_cb (GAsyncResult *result)
+{
+ GError *error = NULL;
+
+ proxy_ = g_dbus_proxy_new_for_bus_finish(result, &error);
+ if (error) {
+ std::cout << "Peer proxy error "<< std::endl;
+ g_clear_error (&error);
+ return;
+ }
+
+ g_signal_connect (proxy_, "g-signal",
+ G_CALLBACK (Peer::proxy_signal_cb), this);
+
+ /* TODO check the ip address in case it's up to date already */
+
+ if (observer_)
+ observer_->on_initialized(this);
+}
+
+void Peer::ips_changed (const char *remote, const char *local)
+{
+ if (g_strcmp0 (remote, remote_host_.c_str()) == 0 &&
+ g_strcmp0 (local, local_host_.c_str()) == 0)
+ return;
+
+ auto was_available = is_available();
+
+ if (g_strcmp0 (remote, "0.0.0.0") == 0)
+ remote_host_.clear();
+ else
+ remote_host_ = std::string(remote);
+
+ if (g_strcmp0 (local, "0.0.0.0") == 0)
+ local_host_.clear();
+ else
+ local_host_ = std::string(local);
+
+ if (!observer_)
+ return;
+
+ if (was_available != is_available())
+ observer_->on_availability_changed(this);
+}
+
+void Peer::state_changed (const char *state)
+{
+ bool ready = (g_strcmp0 (state, "ready") == 0);
+
+ if (ready_ == ready)
+ return;
+
+ auto was_available = is_available();
+ ready_ = ready;
+
+ if (!observer_)
+ return;
+
+ if (was_available != is_available())
+ observer_->on_availability_changed(this);
+}
+
+void Peer::name_changed (const char *name)
+{
+ if (g_strcmp0 (name, name_.c_str()) == 0)
+ return;
+
+ name_ = std::string (name);
+}
+
+
+Peer::Peer(const char *object_path, GVariantIter *props):
+ observer_(NULL)
+{
+ GVariant *val;
+ const char *prop_name;
+
+ while (g_variant_iter_loop (props, "{&sv}", &prop_name, &val)) {
+ handle_property_change (prop_name, val);
+ }
+
+ if (!ie_)
+ throw std::invalid_argument("WiFiDisplayIEs is a required property");
+
+ g_dbus_proxy_new_for_bus (G_BUS_TYPE_SYSTEM,
+ G_DBUS_PROXY_FLAGS_NONE,
+ NULL,
+ "net.connman",
+ object_path,
+ "net.connman.Peer",
+ NULL,
+ Peer::proxy_cb,
+ this);
+}
+
+void Peer::connect()
+{
+ g_dbus_proxy_call (proxy_,
+ "Connect",
+ NULL,
+ G_DBUS_CALL_FLAGS_NONE,
+ 60 * 1000, // is 1 minute too long?
+ NULL,
+ Peer::connect_cb,
+ this);
+}
+
+void Peer::disconnect()
+{
+ g_dbus_proxy_call (proxy_,
+ "Disconnect",
+ NULL,
+ G_DBUS_CALL_FLAGS_NONE,
+ -1,
+ NULL,
+ Peer::disconnect_cb,
+ this);
+}
+
+
+Peer::~Peer()
+{
+ if (proxy_)
+ g_clear_object (&proxy_);
+}
+
+}
diff --git a/chromium/third_party/wds/src/p2p/connman-peer.h b/chromium/third_party/wds/src/p2p/connman-peer.h
new file mode 100644
index 00000000000..0b460760d48
--- /dev/null
+++ b/chromium/third_party/wds/src/p2p/connman-peer.h
@@ -0,0 +1,81 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+#include <gio/gio.h>
+#include "information-element.h"
+
+#ifndef CONNMAN_PEER_H_
+#define CONNMAN_PEER_H_
+
+namespace P2P {
+
+class Peer {
+ public:
+ class Observer {
+ public:
+ virtual void on_availability_changed(Peer *peer) {}
+ virtual void on_initialized(Peer *peer) {}
+
+ protected:
+ virtual ~Observer() {}
+ };
+
+ Peer(const char *object_path, GVariantIter *property_iterator);
+ virtual ~Peer();
+
+ void set_observer(Observer* observer) {
+ observer_ = observer;
+ }
+
+ /* TODO add error handling for these -- maybe through observer.on_error? */
+ void connect();
+ void disconnect();
+
+ const P2P::DeviceType device_type() const { return ie_->get_device_type(); }
+ const std::string& name() const { return name_; }
+ const std::string& remote_host() const {return remote_host_; }
+ const int remote_port() const { return ie_->get_rtsp_port(); }
+ const std::string& local_host() const {return local_host_; }
+ bool is_available() const { return ready_ && !remote_host_.empty() && !local_host_.empty(); }
+
+ private:
+ static void proxy_signal_cb (GDBusProxy *proxy, const char *sender, const char *signal, GVariant *params, gpointer data_ptr);
+ static void proxy_cb(GObject *object, GAsyncResult *res, gpointer data_ptr);
+ static void connect_cb (GObject *object, GAsyncResult *res, gpointer data_ptr);
+ static void disconnect_cb (GObject *object, GAsyncResult *res, gpointer data_ptr);
+
+ void ips_changed (const char *remote, const char *local);
+ void state_changed (const char *state);
+ void name_changed (const char *name);
+ void proxy_cb (GAsyncResult *res);
+ void handle_property_change (const char *name, GVariant *property);
+
+ Observer *observer_;
+ std::string name_;
+ std::string remote_host_;
+ std::string local_host_;
+ bool ready_;
+ GDBusProxy *proxy_;
+ std::shared_ptr<P2P::InformationElement> ie_;
+};
+
+}
+#endif // CONNMAN_PEER_H_
diff --git a/chromium/third_party/wds/src/p2p/information-element.cpp b/chromium/third_party/wds/src/p2p/information-element.cpp
new file mode 100644
index 00000000000..ea91274735b
--- /dev/null
+++ b/chromium/third_party/wds/src/p2p/information-element.cpp
@@ -0,0 +1,171 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+#include <assert.h>
+#include <iostream>
+#include <string.h>
+#include <netinet/in.h> // htons()
+
+#include "information-element.h"
+
+namespace P2P {
+
+Subelement* new_subelement (SubelementId id)
+{
+ Subelement* element;
+ switch (id) {
+ case DEVICE_INFORMATION:
+ element = (Subelement*)new DeviceInformationSubelement;
+ break;
+ case ASSOCIATED_BSSID:
+ element = (Subelement*)new AssociatedBSSIDSubelement;
+ break;
+ case COUPLED_SINK_INFORMATION:
+ element = (Subelement*)new CoupledSinkInformationSubelement;
+ break;
+ default:
+ element = NULL;
+ break;
+ }
+
+ if (element) {
+ /* Fill in the common values */
+ memset(element, 0, SubelementSize[id]);
+ element->id = id;
+ element->length = htons(SubelementSize[id] - 3);
+ }
+
+ return element;
+}
+
+void delete_subelement (Subelement *element)
+{
+ switch (element->id) {
+ case DEVICE_INFORMATION:
+ delete ((DeviceInformationSubelement*)element);
+ break;
+ case ASSOCIATED_BSSID:
+ delete ((AssociatedBSSIDSubelement*)element);
+ break;
+ case COUPLED_SINK_INFORMATION:
+ delete ((CoupledSinkInformationSubelement*)element);
+ break;
+ default:
+ assert(false);
+ }
+}
+
+InformationElement::InformationElement(): length_(0) {}
+
+InformationElement::InformationElement(const std::unique_ptr<InformationElementArray> &array)
+{
+ uint pos = 0;
+ length_ = array->length;
+
+ while (length_ >= pos + 2) {
+ SubelementId id = (SubelementId)array->bytes[pos];
+ size_t subelement_size = SubelementSize[id];
+
+ Subelement *element = new_subelement(id);
+ if (element) {
+ memcpy (element, array->bytes + pos, subelement_size);
+ subelements_[id] = element;
+ }
+ pos += subelement_size;
+ }
+}
+
+InformationElement::~InformationElement()
+{
+ for (auto it = subelements_.begin(); it != subelements_.end(); it++){
+ P2P::delete_subelement ((*it).second);
+ }
+ subelements_.clear();
+}
+
+void InformationElement::add_subelement(P2P::Subelement* subelement)
+{
+ SubelementId id = (SubelementId)subelement->id;
+ Subelement* old = subelements_[id];
+ if (old){
+ P2P::delete_subelement (old);
+ } else {
+ length_ += SubelementSize[id];
+ }
+ subelements_[id] = subelement;
+}
+
+const DeviceType InformationElement::get_device_type() const
+{
+ auto it = subelements_.find (DEVICE_INFORMATION);
+ if (it == subelements_.end()) {
+ /* FIXME : exception ? */
+ return DUAL_ROLE;
+ }
+
+ auto dev_info = (P2P::DeviceInformationSubelement*)(*it).second;
+ return (DeviceType)dev_info->field1.device_type;
+}
+
+const int InformationElement::get_rtsp_port() const
+{
+ auto it = subelements_.find (DEVICE_INFORMATION);
+ if (it == subelements_.end()) {
+ /* FIXME : exception ? */
+ return -1;
+ }
+
+ auto dev_info = (P2P::DeviceInformationSubelement*)(*it).second;
+ return dev_info->session_management_control_port;
+}
+
+std::unique_ptr<InformationElementArray> InformationElement::serialize () const
+{
+ uint8_t pos = 0;
+ std::unique_ptr<InformationElementArray> array
+ (new InformationElementArray(length_));
+
+ for (auto it = subelements_.begin(); it != subelements_.end(); it++) {
+ Subelement* element = (*it).second;
+ memcpy (array->bytes + pos, element, P2P::SubelementSize[element->id]);
+ pos += P2P::SubelementSize[element->id];
+ }
+
+ return array;
+}
+
+std::string InformationElement::to_string() const
+{
+ std::string ret;
+
+ auto array = serialize ();
+
+ for (size_t i = 0; i < array->length; i++) {
+ char hex[3];
+ sprintf(hex,"%02X", array->bytes[i]);
+ ret += hex;
+ }
+
+ return ret;
+}
+
+} // namespace P2P
+
diff --git a/chromium/third_party/wds/src/p2p/information-element.h b/chromium/third_party/wds/src/p2p/information-element.h
new file mode 100644
index 00000000000..dc07396ee04
--- /dev/null
+++ b/chromium/third_party/wds/src/p2p/information-element.h
@@ -0,0 +1,166 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+#ifndef INFORMATION_ELEMENT_H_
+#define INFORMATION_ELEMENT_H_
+
+#include <cstring>
+#include <map>
+#include <memory>
+#include <string>
+#include <stdint.h>
+
+
+namespace P2P {
+
+enum DeviceType {
+ SOURCE,
+ PRIMARY_SINK,
+ SECONDARY_SINK,
+ DUAL_ROLE
+};
+
+enum SubelementId {
+ DEVICE_INFORMATION,
+ ASSOCIATED_BSSID,
+ AUDIO_FORMATS,
+ VIDEO_FORMATS,
+ FORMATS_3D,
+ CONTENT_PROTECTION,
+ COUPLED_SINK_INFORMATION,
+ EXTENDED_CAPABILITY,
+ LOCAL_IP_ADDRESS,
+ SESSION_INFORMATION,
+ ALTERNATIVE_MAC,
+};
+
+// SubelementSize == subelement.length - 3
+const uint16_t SubelementSize[] = {
+ 9,
+ 9,
+ 18,
+ 24,
+ 20,
+ 4,
+ 10,
+ 5,
+ 11,
+ 3, // variable: 3 + N*24, where N is number of devices connected to GO
+ 9,
+};
+
+struct __attribute__ ((packed)) Subelement {
+ uint8_t id;
+ uint16_t length;
+};
+
+struct __attribute__ ((packed)) DeviceinformationBits1 {
+ unsigned device_type : 2; // DeviceType
+ unsigned coupled_sink_support_at_source : 1;
+ unsigned coupled_sink_support_at_sink : 1;
+ unsigned session_availability : 1;
+ unsigned reserved : 1;
+ unsigned service_discovery_support : 1;
+ unsigned preferred_connectivity : 1;
+};
+
+struct __attribute__ ((packed)) DeviceinformationBits2 {
+ unsigned hdcp_support : 1;
+ unsigned time_synchronization_support : 1;
+ unsigned audio_unsupport_at_primary_sink : 1;
+ unsigned audio_only_support_at_source : 1;
+ unsigned tdls_persistent_group : 1;
+ unsigned tdls_persistent_group_reinvoke : 1;
+ unsigned reserved2 : 2;
+};
+
+struct __attribute__ ((packed)) DeviceInformationSubelement {
+ uint8_t id;
+ uint16_t length;
+ DeviceinformationBits2 field2;
+ DeviceinformationBits1 field1;
+ uint16_t session_management_control_port;
+ uint16_t maximum_throughput;
+};
+
+struct __attribute__ ((packed)) AssociatedBSSIDSubelement {
+ uint8_t id;
+ uint16_t length;
+ uint8_t bssid[6];
+};
+
+struct __attribute__ ((packed)) CoupledSinkStatus {
+ unsigned status : 2;
+ unsigned reserved : 6;
+};
+
+struct __attribute__ ((packed)) CoupledSinkInformationSubelement {
+ uint8_t id;
+ uint16_t length;
+ CoupledSinkStatus status;
+ uint8_t mac_address[6];
+};
+
+struct InformationElementArray {
+ uint8_t *bytes;
+ uint length;
+
+ InformationElementArray(uint len) : length(len) {
+ bytes = new uint8_t[length];
+ }
+
+ InformationElementArray(uint len, uint8_t* in_bytes) :
+ length(len) {
+ bytes = new uint8_t[length];
+ memcpy (bytes, in_bytes, length);
+
+ }
+
+ ~InformationElementArray() {
+ delete[] bytes;
+ }
+};
+
+Subelement* new_subelement (SubelementId id);
+
+class InformationElement {
+ public:
+ InformationElement();
+ InformationElement(const std::unique_ptr<InformationElementArray> &array);
+ virtual ~InformationElement();
+
+ void add_subelement(P2P::Subelement* subelement);
+ const DeviceType get_device_type() const;
+ const int get_rtsp_port() const;
+
+ std::unique_ptr<InformationElementArray> serialize () const;
+ std::string to_string() const;
+
+ private:
+ void delete_subelement(P2P::Subelement* subelement);
+
+ uint length_;
+ std::map<SubelementId, P2P::Subelement*> subelements_;
+};
+
+} // namespace P2P
+
+#endif // INFORMATION_ELEMENT_H_
diff --git a/chromium/third_party/wds/src/p2p/main.cpp b/chromium/third_party/wds/src/p2p/main.cpp
new file mode 100644
index 00000000000..02fcab5fa9d
--- /dev/null
+++ b/chromium/third_party/wds/src/p2p/main.cpp
@@ -0,0 +1,62 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+#include <assert.h>
+#include <iostream>
+#include <string.h>
+#include <netinet/in.h> // htons()
+
+#include "connman-client.h"
+#include "information-element.h"
+
+int main (int argc, const char **argv)
+{
+ GMainLoop *main_loop = g_main_loop_new(NULL, TRUE);
+
+ // check that packing works
+ assert (sizeof(P2P::DeviceInformationSubelement) ==
+ P2P::SubelementSize[P2P::DEVICE_INFORMATION]);
+ assert (sizeof(P2P::AssociatedBSSIDSubelement) ==
+ P2P::SubelementSize[P2P::ASSOCIATED_BSSID]);
+ assert (sizeof(P2P::CoupledSinkInformationSubelement) ==
+ P2P::SubelementSize[P2P::COUPLED_SINK_INFORMATION]);
+
+ // Create a information element for a simple WFD Sink
+ P2P::InformationElement ie;
+ auto sub_element = P2P::new_subelement(P2P::DEVICE_INFORMATION);
+ auto dev_info = (P2P::DeviceInformationSubelement*)sub_element;
+ dev_info->session_management_control_port = htons(8080);
+ dev_info->maximum_throughput = htons(50);
+ dev_info->field1.device_type = P2P::PRIMARY_SINK;
+ dev_info->field1.session_availability = true;
+ ie.add_subelement (sub_element);
+
+ std::cout << "Registering " << ie.to_string() << std::endl;
+
+ // register the P2P service with connman
+ auto array = ie.serialize ();
+ P2P::Client p2p_client (array);
+
+ g_main_loop_run (main_loop);
+ g_main_loop_unref (main_loop);
+
+ return 0;
+}
diff --git a/chromium/third_party/wds/src/p2p/test-ie.cpp b/chromium/third_party/wds/src/p2p/test-ie.cpp
new file mode 100644
index 00000000000..a024ae9f1f0
--- /dev/null
+++ b/chromium/third_party/wds/src/p2p/test-ie.cpp
@@ -0,0 +1,67 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+#include <assert.h>
+#include <iostream>
+#include <string.h>
+#include <netinet/in.h> // htons()
+
+#include "connman-client.h"
+#include "information-element.h"
+
+int main (int argc, const char **argv)
+{
+ // check that packing works
+ if (sizeof(P2P::DeviceInformationSubelement) !=
+ P2P::SubelementSize[P2P::DEVICE_INFORMATION] ||
+ sizeof(P2P::AssociatedBSSIDSubelement) !=
+ P2P::SubelementSize[P2P::ASSOCIATED_BSSID] ||
+ sizeof(P2P::CoupledSinkInformationSubelement) !=
+ P2P::SubelementSize[P2P::COUPLED_SINK_INFORMATION]) {
+ std::cout << "Subelement struct size checks failed"<< std::endl;
+ return 1;
+ }
+
+ P2P::InformationElement ie;
+ auto sub_element = P2P::new_subelement(P2P::DEVICE_INFORMATION);
+ auto dev_info = (P2P::DeviceInformationSubelement*)sub_element;
+ dev_info->session_management_control_port = htons(8080);
+ dev_info->maximum_throughput = htons(50);
+ dev_info->field1.device_type = P2P::PRIMARY_SINK;
+ dev_info->field1.session_availability = true;
+
+ ie.add_subelement (sub_element);
+ ie.add_subelement (P2P::new_subelement(P2P::COUPLED_SINK_INFORMATION));
+ ie.add_subelement (P2P::new_subelement(P2P::ASSOCIATED_BSSID));
+
+ auto array = ie.serialize ();
+ P2P::InformationElement ie2(array);
+ auto array1 = ie.to_string();
+ auto array2 = ie2.to_string();
+ if (array1 != array2) {
+ std::cout << "Expected byte array '" << array1
+ << "', got '" << array2 << "'" << std::endl;
+ return 1;
+ }
+
+
+ return 0;
+}
diff --git a/chromium/third_party/wds/src/rtsp-message-exchanges.txt b/chromium/third_party/wds/src/rtsp-message-exchanges.txt
new file mode 100644
index 00000000000..da4844858f3
--- /dev/null
+++ b/chromium/third_party/wds/src/rtsp-message-exchanges.txt
@@ -0,0 +1,148 @@
+
+**************************************************
+* RTSP messages during WFD session establishment *
+**************************************************
+
+
+There are five different states:
+ 1. capability negotiation A
+ 2. capability negotiation B
+ 3. RTSP session establishment
+ 4. WFD session establishment
+ 5. WFD session
+
+I'm listing the possible exchanges below, per state (except for the
+last state: that's a lot more work and mostly not required for POC).
+ * = message
+ *** = message, valid start point for a message exchange in this state
+
+
+SOURCE SINK
+MESSAGES MESSAGES
+-------------------------------------------------------------
+
+
+STATE 1 capability negotiation A
+-------------------------------------------------------------
+*** M1 OPTIONS -------->
+ if M1 response == 200
+ send M2
+
+
+ <-------- * M2 OPTIONS
+if M2 response = 200
+send M3
+
+
+* M3 GET_PARAMETER -------->
+if M3 response == 200
+move to state 2, send M4
+
+
+STATE 2 capability negotiation B
+-------------------------------------------------------------
+
+*** M3 GET_PARAMETER -------->
+
+* M4 SET_PARAMETER -------->
+(mandatory and optional parameters below)
+if M4 response == 200
+send M5
+
+
+STATE 3 RTSP session establishment
+-------------------------------------------------------------
+
+*** M3 GET_PARAMETER -------->
+
+
+*** M4 SET_PARAMETER -------->
+
+
+* M5 SET_PARAMETER -------->
+(trigger SETUP) if M5 response == 200
+ send M6
+
+
+ <-------- * M6 SETUP
+ if M6 response == 200
+ move to state 4, send M7
+
+
+STATE 4 WFD session establishment
+-------------------------------------------------------------
+
+*** M3 GET_PARAMETER -------->
+
+
+*** M5 SET_PARAMETER -------->
+(trigger TEARDOWN) if M5 response = 200
+ send M8
+
+
+*** M5 SET_PARAMETER -------->
+(trigger PLAY) if M5 response == 200
+ send M7
+
+
+ <-------- * M7 PLAY
+if M7 response == 200
+move to state 5, start streaming
+
+
+ *** M8 TEARDOWN
+if M8 response == 200
+move to state 1
+
+
+
+
+STATE 5 WFD Session
+---------------------------------------------------------------
+TODO ...
+
+
+
+
+
+*****************************
+* GET/SET Method parameters *
+*****************************
+
+
+ M = mandatory
+ O = optional
+
+These rules apply _before_ the WFD sessions is established
+(in other words states 1-4):
+
+ request reply
+* M3 GET_PARAMETER
+-----------------------------------------------------------------
+audio-codecs M M
+video-formats M M
+3d-video-formats O M (if in request)
+content-protection O M (if in request)
+display-edid O M (if in request)
+coupled-sink O M (if in request)
+client-rtp-ports M M
+I2C O M (if in request)
+uibc-capability O M (if in request)
+connector-type O M (if in request)
+standby-resume-- O M (if in request)
+
+
+* M4 SET_PARAMETER
+audio-codecs M (if stream contains audio)
+video-formats M (if no preferred-display and stream contains video)
+3d-video-formats M (if no preferred-display and stream includes 3d)
+presentation-url M
+client-rtp-ports M
+preferred-display-- O (spec error on p 111?)
+uibc-capability O
+uibc-setting O
+
+
+* M5 SET_PARAMETER
+trigger-method M
+
diff --git a/chromium/third_party/wds/src/sink/CMakeLists.txt b/chromium/third_party/wds/src/sink/CMakeLists.txt
new file mode 100644
index 00000000000..68cf96c2bd4
--- /dev/null
+++ b/chromium/third_party/wds/src/sink/CMakeLists.txt
@@ -0,0 +1,22 @@
+#FIXME in the future: with cmake 2.8.12 and up it's better
+#to use target_compile_options or add_compile_options
+set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -pthread -std=c++11")
+
+include_directories ("${PROJECT_SOURCE_DIR}")
+include_directories ("${PROJECT_SOURCE_DIR}/include")
+include_directories ("${PROJECT_SOURCE_DIR}/p2p")
+include_directories ("${PROJECT_SOURCE_DIR}/mirac_network")
+
+find_package(PkgConfig REQUIRED)
+
+pkg_check_modules (GLIB2 REQUIRED glib-2.0)
+include_directories(${GLIB2_INCLUDE_DIRS})
+
+pkg_check_modules (GIO REQUIRED gio-2.0)
+include_directories(${GIO_INCLUDE_DIRS})
+
+pkg_check_modules (GST REQUIRED gstreamer-1.0)
+include_directories(${GST_INCLUDE_DIRS})
+
+add_executable(sink-test main.cpp sink-app.cpp sink.cpp gst_sink_media_manager.cpp)
+target_link_libraries (sink-test mirac wds p2p ${GIO_LIBRARIES} ${GST_LIBRARIES})
diff --git a/chromium/third_party/wds/src/sink/gst_sink_media_manager.cpp b/chromium/third_party/wds/src/sink/gst_sink_media_manager.cpp
new file mode 100644
index 00000000000..ecc777205ab
--- /dev/null
+++ b/chromium/third_party/wds/src/sink/gst_sink_media_manager.cpp
@@ -0,0 +1,94 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+#include "gst_sink_media_manager.h"
+
+GstSinkMediaManager::GstSinkMediaManager(const std::string& hostname)
+ : gst_pipeline_(new MiracGstSink(hostname, 0)) {
+}
+
+void GstSinkMediaManager::Play() {
+ gst_pipeline_->Play();
+}
+
+void GstSinkMediaManager::Pause() {
+ gst_pipeline_->Pause();
+}
+
+void GstSinkMediaManager::Teardown() {
+ gst_pipeline_->Teardown();
+}
+
+bool GstSinkMediaManager::IsPaused() const {
+ return gst_pipeline_->IsPaused();
+}
+
+std::pair<int,int> GstSinkMediaManager::GetLocalRtpPorts() const {
+ return std::pair<int,int>(gst_pipeline_->sink_udp_port(), 0);
+}
+
+void GstSinkMediaManager::SetPresentationUrl(const std::string& url) {
+ presentation_url_ = url;
+}
+
+std::string GstSinkMediaManager::GetPresentationUrl() const {
+ return presentation_url_;
+}
+
+void GstSinkMediaManager::SetSessionId(const std::string& session) {
+ session_ = session;
+}
+
+std::string GstSinkMediaManager::GetSessionId() const {
+ return session_;
+}
+
+std::vector<wds::H264VideoCodec>
+GstSinkMediaManager::GetSupportedH264VideoCodecs() const {
+ wds::RateAndResolutionsBitmap cea_rr;
+ wds::RateAndResolutionsBitmap vesa_rr;
+ wds::RateAndResolutionsBitmap hh_rr;
+ wds::RateAndResolution i;
+ // declare that we support all resolutions, CHP and level 4.2
+ // gstreamer should handle all of it :)
+ for (i = wds::CEA640x480p60; i <= wds::CEA1920x1080p24; ++i)
+ cea_rr.set(i);
+ for (i = wds::VESA800x600p30; i <= wds::VESA1920x1200p30; ++i)
+ vesa_rr.set(i);
+ for (i = wds::HH800x480p30; i <= wds::HH848x480p60; ++i)
+ hh_rr.set(i);
+ return {wds::H264VideoCodec(wds::CHP, wds::k4_2, cea_rr, vesa_rr, hh_rr),
+ wds::H264VideoCodec(wds::CBP, wds::k4_2, cea_rr, vesa_rr, hh_rr)};
+}
+
+wds::NativeVideoFormat GstSinkMediaManager::GetNativeVideoFormat() const {
+ // pick the maximum possible resolution, let gstreamer deal with it
+ // TODO: get the actual screen size of the system
+ return wds::NativeVideoFormat(wds::CEA1920x1080p60);
+}
+
+bool GstSinkMediaManager::SetOptimalVideoFormat(const wds::H264VideoFormat& optimal_format) {
+ return true;
+}
+
+wds::ConnectorType GstSinkMediaManager::GetConnectorType() const {
+ return wds::ConnectorTypeNone;
+}
diff --git a/chromium/third_party/wds/src/sink/gst_sink_media_manager.h b/chromium/third_party/wds/src/sink/gst_sink_media_manager.h
new file mode 100644
index 00000000000..97140478b2e
--- /dev/null
+++ b/chromium/third_party/wds/src/sink/gst_sink_media_manager.h
@@ -0,0 +1,56 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+#ifndef GST_SINK_MEDIA_MANAGER_H_
+#define GST_SINK_MEDIA_MANAGER_H_
+
+#include <memory>
+
+#include "libwds/public/media_manager.h"
+#include "mirac-gst-sink.hpp"
+
+class GstSinkMediaManager : public wds::SinkMediaManager {
+ public:
+ explicit GstSinkMediaManager(const std::string& hostname);
+
+ void Play() override;
+ void Pause() override;
+ void Teardown() override;
+ bool IsPaused() const override;
+ std::pair<int,int> GetLocalRtpPorts() const override;
+ void SetPresentationUrl(const std::string& url) override;
+ std::string GetPresentationUrl() const override;
+ void SetSessionId(const std::string& session) override;
+ std::string GetSessionId() const override;
+
+ std::vector<wds::H264VideoCodec> GetSupportedH264VideoCodecs() const override;
+ wds::NativeVideoFormat GetNativeVideoFormat() const override;
+ bool SetOptimalVideoFormat(const wds::H264VideoFormat& optimal_format) override;
+ wds::ConnectorType GetConnectorType() const override;
+
+ private:
+ std::string hostname_;
+ std::string presentation_url_;
+ std::string session_;
+ std::unique_ptr<MiracGstSink> gst_pipeline_;
+};
+
+#endif // GST_SINK_MEDIA_MANAGER_H_
diff --git a/chromium/third_party/wds/src/sink/main.cpp b/chromium/third_party/wds/src/sink/main.cpp
new file mode 100644
index 00000000000..fb1e9b2f71c
--- /dev/null
+++ b/chromium/third_party/wds/src/sink/main.cpp
@@ -0,0 +1,132 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+#include <glib.h>
+#include <glib-unix.h>
+#include <gst/gst.h>
+
+#include <iostream>
+
+#include "mirac-glib-logging.hpp"
+
+#include "sink-app.h"
+#include "sink.h"
+
+
+static gboolean _sig_handler (gpointer data_ptr)
+{
+ GMainLoop *main_loop = (GMainLoop *) data_ptr;
+
+ g_main_loop_quit(main_loop);
+
+ return G_SOURCE_CONTINUE;
+}
+
+static void parse_input_and_call_sink(
+ const std::string& command, Sink *sink) {
+ if (command == "teardown\n") {
+ sink->Teardown();
+ return;
+ }
+ if (command == "pause\n") {
+ sink->Pause();
+ return;
+ }
+ if (command == "play\n") {
+ sink->Play();
+ return;
+ }
+ std::cout << "Received unknown command: " << command << std::endl;
+}
+
+static gboolean _user_input_handler (
+ GIOChannel* channel, GIOCondition /*condition*/, gpointer data_ptr)
+{
+ GError* error = NULL;
+ char* str = NULL;
+ size_t len;
+ SinkApp* app = static_cast<SinkApp*>(data_ptr);
+
+ switch (g_io_channel_read_line(channel, &str, &len, NULL, &error)) {
+ case G_IO_STATUS_NORMAL:
+ parse_input_and_call_sink(str, &app->sink());
+ g_free(str);
+ return true;
+ case G_IO_STATUS_ERROR:
+ std::cout << "User input error: " << error->message << std::endl;
+ g_error_free(error);
+ return false;
+ case G_IO_STATUS_EOF:
+ case G_IO_STATUS_AGAIN:
+ return true;
+ default:
+ return false;
+ }
+ return false;
+}
+
+int main (int argc, char *argv[])
+{
+ InitGlibLogging();
+ char* hostname = NULL;
+ int port = 7236;
+ std::unique_ptr<SinkApp> app;
+
+ GOptionEntry main_entries[] = {
+ { "hostname", 0, 0, G_OPTION_ARG_STRING, &hostname, "Specify remote hostname (for debugging purposes)", "host"},
+ { "rtsp_port", 0, 0, G_OPTION_ARG_INT, &port, "Specify remote RTSP port number (for debugging purposes), 7236 by default", "rtsp_port"},
+ { NULL }
+ };
+
+ GOptionContext* context = g_option_context_new ("- WFD sink demo application\n");
+ g_option_context_add_main_entries (context, main_entries, NULL);
+ g_option_context_add_group (context, gst_init_get_option_group ());
+
+ GError* error = NULL;
+ if (!g_option_context_parse (context, &argc, &argv, &error)) {
+ WDS_ERROR ("option parsing failed: %s", error->message);
+ g_option_context_free(context);
+ exit (1);
+ }
+ g_option_context_free(context);
+
+ if (hostname) {
+ app.reset(new SinkApp(std::string(hostname), port));
+ g_free (hostname);
+ } else {
+ app.reset(new SinkApp());
+ }
+
+ GMainLoop *main_loop = g_main_loop_new(NULL, TRUE);
+ g_unix_signal_add(SIGINT, _sig_handler, main_loop);
+ g_unix_signal_add(SIGTERM, _sig_handler, main_loop);
+
+ GIOChannel* io_channel = g_io_channel_unix_new (STDIN_FILENO);
+ g_io_add_watch(io_channel, G_IO_IN, _user_input_handler, app.get());
+ g_io_channel_unref(io_channel);
+
+ g_main_loop_run (main_loop);
+
+ g_main_loop_unref (main_loop);
+
+ return 0;
+}
+
diff --git a/chromium/third_party/wds/src/sink/sink-app.cpp b/chromium/third_party/wds/src/sink/sink-app.cpp
new file mode 100644
index 00000000000..0815b2ed563
--- /dev/null
+++ b/chromium/third_party/wds/src/sink/sink-app.cpp
@@ -0,0 +1,90 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+#include <iostream>
+#include <netinet/in.h> // htons()
+
+#include "sink-app.h"
+#include "sink.h"
+#include "connman-client.h"
+
+void SinkApp::on_peer_added(P2P::Client *client, std::shared_ptr<P2P::Peer> peer)
+{
+ std::cout << "* New peer: " << peer->name() << std::endl;
+ peer->set_observer (this);
+}
+
+void SinkApp::on_peer_removed(P2P::Client *client, std::shared_ptr<P2P::Peer> peer)
+{
+ std::cout << "* Peer removed: " << peer->name() << std::endl;
+ if (peer.get() == peer_) {
+ sink_.reset(NULL);
+ peer_ = NULL;
+ }
+}
+
+void SinkApp::on_availability_changed(P2P::Peer *peer)
+{
+ if (!sink_ && peer->is_available() && peer->device_type() == P2P::SOURCE) {
+ std::cout << "* Connecting to source at " << peer->remote_host() << ":" << ntohs(peer->remote_port()) << std::endl;
+
+ sink_.reset(new Sink (peer->remote_host(), ntohs(peer->remote_port()), peer->local_host()));
+ peer_ = peer;
+ } else if (sink_ && !peer->is_available() && peer == peer_) {
+ std::cout << "* Source unavailable" << std::endl;
+
+ sink_.reset(NULL);
+ peer_ = NULL;
+ }
+}
+
+SinkApp::SinkApp(){
+ // Create a information element for a simple WFD Sink
+ P2P::InformationElement ie;
+ auto sub_element = P2P::new_subelement(P2P::DEVICE_INFORMATION);
+ auto dev_info = (P2P::DeviceInformationSubelement*)sub_element;
+
+ // TODO port number is a lie -- we should start the sink first, then
+ // use the port from there (and sink should probably default to 7236)
+
+ // TODO InformationElement could have constructors for this stuff...
+ dev_info->session_management_control_port = htons(7236);
+ dev_info->maximum_throughput = htons(50);
+ dev_info->field1.device_type = P2P::PRIMARY_SINK;
+ dev_info->field1.session_availability = true;
+ ie.add_subelement (sub_element);
+
+ std::cout << "* Registering Wifi Display with IE " << ie.to_string() << std::endl;
+
+ // register the P2P service with connman
+ auto array = ie.serialize ();
+ p2p_client_.reset(new P2P::Client(array, this));
+}
+
+SinkApp::SinkApp(const std::string& hostname, int port)
+{
+ std::cout << "* Connecting to peer at " << hostname << ":" << port << std::endl;
+
+ sink_.reset(new Sink (hostname, port, ""));
+}
+
+SinkApp::~SinkApp() {
+}
diff --git a/chromium/third_party/wds/src/sink/sink-app.h b/chromium/third_party/wds/src/sink/sink-app.h
new file mode 100644
index 00000000000..16a8a51edae
--- /dev/null
+++ b/chromium/third_party/wds/src/sink/sink-app.h
@@ -0,0 +1,51 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+#ifndef SINK_APP_H
+#define SINK_APP_H
+
+#include <memory>
+
+#include "sink.h"
+#include "connman-client.h"
+
+class SinkApp: public P2P::Client::Observer, public P2P::Peer::Observer {
+ public:
+ SinkApp();
+ SinkApp(const std::string& hostname, int port);
+ ~SinkApp();
+
+ Sink& sink() { return *sink_; }
+
+ void on_peer_added(P2P::Client *client, std::shared_ptr<P2P::Peer> peer) override;
+ void on_peer_removed(P2P::Client *client, std::shared_ptr<P2P::Peer> peer) override;
+ void on_availability_changed(P2P::Client *client) override {};
+
+ void on_availability_changed(P2P::Peer *peer) override;
+ void on_initialized(P2P::Peer *peer) override {};
+
+ private:
+ std::unique_ptr<P2P::Client> p2p_client_;
+ std::unique_ptr<Sink> sink_;
+ P2P::Peer *peer_;
+};
+
+#endif // SINK_APP_H
diff --git a/chromium/third_party/wds/src/sink/sink.cpp b/chromium/third_party/wds/src/sink/sink.cpp
new file mode 100644
index 00000000000..819ebba394f
--- /dev/null
+++ b/chromium/third_party/wds/src/sink/sink.cpp
@@ -0,0 +1,68 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+#include <iostream>
+
+#include "sink.h"
+#include "gst_sink_media_manager.h"
+
+Sink::Sink(const std::string& remote_host, int remote_rtsp_port, const std::string& local_host)
+ : MiracBroker(remote_host, std::to_string(remote_rtsp_port)),
+ local_host_(local_host) {
+}
+
+Sink::~Sink() {}
+
+void Sink::got_message(const std::string& message) {
+ wfd_sink_->RTSPDataReceived(message);
+}
+
+void Sink::on_connected() {
+ media_manager_.reset(new GstSinkMediaManager(local_host_));
+ wfd_sink_.reset(wds::Sink::Create(this, media_manager_.get()));
+ wfd_sink_->Start();
+}
+
+void Sink::on_connection_failure(ConnectionFailure failure) {
+ switch (failure) {
+ case CONNECTION_LOST:
+ std::cout << "* RTSP connection lost" << std::endl;
+ case CONNECTION_TIMEOUT:
+ ;
+ }
+}
+
+void Sink::Play() {
+ wfd_sink_->Play();
+}
+
+void Sink::Pause() {
+ wfd_sink_->Pause();
+}
+
+void Sink::Teardown() {
+ wfd_sink_->Teardown();
+}
+
+wds::Peer* Sink::Peer() const {
+ return wfd_sink_.get();
+}
+
diff --git a/chromium/third_party/wds/src/sink/sink.h b/chromium/third_party/wds/src/sink/sink.h
new file mode 100644
index 00000000000..8d914162384
--- /dev/null
+++ b/chromium/third_party/wds/src/sink/sink.h
@@ -0,0 +1,54 @@
+/*
+ * This file is part of Wireless Display Software for Linux OS
+ *
+ * Copyright (C) 2014 Intel Corporation.
+ *
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2.1 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA
+ */
+
+#ifndef SINK_H
+#define SINK_H
+
+#include <memory>
+
+#include "libwds/public/media_manager.h"
+#include "libwds/public/sink.h"
+
+#include "mirac-broker.hpp"
+
+class Sink : public MiracBroker {
+ public:
+ explicit Sink(const std::string& remote_host, int remote_rtsp_port, const std::string& local_host);
+ ~Sink();
+
+ void Play();
+ void Pause();
+ void Teardown();
+
+ protected:
+ virtual wds::Peer* Peer() const override;
+
+ private:
+ virtual void got_message(const std::string& message) override;
+ virtual void on_connected() override;
+ void on_connection_failure(ConnectionFailure failure) override;
+
+ std::unique_ptr<wds::SinkMediaManager> media_manager_;
+ std::unique_ptr<wds::Sink> wfd_sink_;
+ std::string local_host_;
+};
+
+#endif // SINK_H
diff --git a/chromium/third_party/webrtc/api/peerconnectioninterface.h b/chromium/third_party/webrtc/api/peerconnectioninterface.h
index 9e26df55945..86cffc51b54 100644
--- a/chromium/third_party/webrtc/api/peerconnectioninterface.h
+++ b/chromium/third_party/webrtc/api/peerconnectioninterface.h
@@ -880,10 +880,10 @@ class PeerConnectionInterface : public rtc::RefCountInterface {
return false;
}
- // Register a metric observer (used by chromium).
- //
- // There can only be one observer at a time. Before the observer is
- // destroyed, RegisterUMAOberver(nullptr) should be called.
+ // Register a metric observer (used by chromium). It's reference counted, and
+ // this method takes a reference. RegisterUMAObserver(nullptr) will release
+ // the reference.
+ // TODO(deadbeef): Take argument as scoped_refptr?
virtual void RegisterUMAObserver(UMAObserver* observer) = 0;
// 0 <= min <= current <= max should hold for set parameters.
diff --git a/chromium/third_party/webrtc/audio/audio_send_stream.cc b/chromium/third_party/webrtc/audio/audio_send_stream.cc
index d207dbd5789..053302e22b8 100644
--- a/chromium/third_party/webrtc/audio/audio_send_stream.cc
+++ b/chromium/third_party/webrtc/audio/audio_send_stream.cc
@@ -61,8 +61,7 @@ std::unique_ptr<voe::ChannelProxy> CreateChannelAndProxy(
}
} // namespace
-// TODO(saza): Move this declaration further down when we can use
-// std::make_unique.
+// Helper class to track the actively sending lifetime of this stream.
class AudioSendStream::TimedTransport : public Transport {
public:
TimedTransport(Transport* transport, TimeInterval* time_interval)
@@ -94,7 +93,8 @@ AudioSendStream::AudioSendStream(
BitrateAllocator* bitrate_allocator,
RtcEventLog* event_log,
RtcpRttStats* rtcp_rtt_stats,
- const rtc::Optional<RtpState>& suspended_rtp_state)
+ const rtc::Optional<RtpState>& suspended_rtp_state,
+ TimeInterval* overall_call_lifetime)
: AudioSendStream(config,
audio_state,
worker_queue,
@@ -103,6 +103,7 @@ AudioSendStream::AudioSendStream(
event_log,
rtcp_rtt_stats,
suspended_rtp_state,
+ overall_call_lifetime,
CreateChannelAndProxy(audio_state.get(),
worker_queue,
module_process_thread)) {}
@@ -116,6 +117,7 @@ AudioSendStream::AudioSendStream(
RtcEventLog* event_log,
RtcpRttStats* rtcp_rtt_stats,
const rtc::Optional<RtpState>& suspended_rtp_state,
+ TimeInterval* overall_call_lifetime,
std::unique_ptr<voe::ChannelProxy> channel_proxy)
: worker_queue_(worker_queue),
config_(Config(nullptr)),
@@ -128,7 +130,8 @@ AudioSendStream::AudioSendStream(
kPacketLossRateMinNumAckedPackets,
kRecoverablePacketLossRateMinNumAckedPairs),
rtp_rtcp_module_(nullptr),
- suspended_rtp_state_(suspended_rtp_state) {
+ suspended_rtp_state_(suspended_rtp_state),
+ overall_call_lifetime_(overall_call_lifetime) {
RTC_LOG(LS_INFO) << "AudioSendStream: " << config.ToString();
RTC_DCHECK(worker_queue_);
RTC_DCHECK(audio_state_);
@@ -136,6 +139,7 @@ AudioSendStream::AudioSendStream(
RTC_DCHECK(bitrate_allocator_);
RTC_DCHECK(transport);
RTC_DCHECK(transport->send_side_cc());
+ RTC_DCHECK(overall_call_lifetime_);
channel_proxy_->SetRtcEventLog(event_log_);
channel_proxy_->SetRtcpRttStats(rtcp_rtt_stats);
@@ -160,6 +164,10 @@ AudioSendStream::~AudioSendStream() {
channel_proxy_->ResetSenderCongestionControlObjects();
channel_proxy_->SetRtcEventLog(nullptr);
channel_proxy_->SetRtcpRttStats(nullptr);
+ // Lifetime can only be updated after deregistering
+ // |timed_send_transport_adapter_| in the underlying channel object to avoid
+ // data races in |active_lifetime_|.
+ overall_call_lifetime_->Extend(active_lifetime_);
}
const webrtc::AudioSendStream::Config& AudioSendStream::GetConfig() const {
@@ -455,10 +463,6 @@ RtpState AudioSendStream::GetRtpState() const {
return rtp_rtcp_module_->GetRtpState();
}
-const TimeInterval& AudioSendStream::GetActiveLifetime() const {
- return active_lifetime_;
-}
-
const voe::ChannelProxy& AudioSendStream::GetChannelProxy() const {
RTC_DCHECK(channel_proxy_.get());
return *channel_proxy_.get();
diff --git a/chromium/third_party/webrtc/audio/audio_send_stream.h b/chromium/third_party/webrtc/audio/audio_send_stream.h
index bab8f80de59..b2bcac54537 100644
--- a/chromium/third_party/webrtc/audio/audio_send_stream.h
+++ b/chromium/third_party/webrtc/audio/audio_send_stream.h
@@ -49,7 +49,8 @@ class AudioSendStream final : public webrtc::AudioSendStream,
BitrateAllocator* bitrate_allocator,
RtcEventLog* event_log,
RtcpRttStats* rtcp_rtt_stats,
- const rtc::Optional<RtpState>& suspended_rtp_state);
+ const rtc::Optional<RtpState>& suspended_rtp_state,
+ TimeInterval* overall_call_lifetime);
// For unit tests, which need to supply a mock channel proxy.
AudioSendStream(const webrtc::AudioSendStream::Config& config,
const rtc::scoped_refptr<webrtc::AudioState>& audio_state,
@@ -59,6 +60,7 @@ class AudioSendStream final : public webrtc::AudioSendStream,
RtcEventLog* event_log,
RtcpRttStats* rtcp_rtt_stats,
const rtc::Optional<RtpState>& suspended_rtp_state,
+ TimeInterval* overall_call_lifetime,
std::unique_ptr<voe::ChannelProxy> channel_proxy);
~AudioSendStream() override;
@@ -92,7 +94,6 @@ class AudioSendStream final : public webrtc::AudioSendStream,
void SetTransportOverhead(int transport_overhead_per_packet);
RtpState GetRtpState() const;
- const TimeInterval& GetActiveLifetime() const;
const voe::ChannelProxy& GetChannelProxy() const;
private:
@@ -148,6 +149,7 @@ class AudioSendStream final : public webrtc::AudioSendStream,
std::unique_ptr<TimedTransport> timed_send_transport_adapter_;
TimeInterval active_lifetime_;
+ TimeInterval* overall_call_lifetime_ = nullptr;
// RFC 5285: Each distinct extension MUST have a unique ID. The value 0 is
// reserved for padding and MUST NOT be used as a local identifier.
diff --git a/chromium/third_party/webrtc/audio/audio_send_stream_unittest.cc b/chromium/third_party/webrtc/audio/audio_send_stream_unittest.cc
index 4644bf471ec..109f15d1b2a 100644
--- a/chromium/third_party/webrtc/audio/audio_send_stream_unittest.cc
+++ b/chromium/third_party/webrtc/audio/audio_send_stream_unittest.cc
@@ -27,11 +27,14 @@
#include "modules/pacing/mock/mock_paced_sender.h"
#include "modules/rtp_rtcp/mocks/mock_rtcp_rtt_stats.h"
#include "modules/rtp_rtcp/mocks/mock_rtp_rtcp.h"
+#include "rtc_base/fakeclock.h"
#include "rtc_base/ptr_util.h"
#include "rtc_base/task_queue.h"
+#include "rtc_base/timedelta.h"
#include "test/gtest.h"
#include "test/mock_audio_encoder.h"
#include "test/mock_audio_encoder_factory.h"
+#include "test/mock_transport.h"
#include "test/mock_voe_channel_proxy.h"
namespace webrtc {
@@ -168,14 +171,9 @@ struct ConfigHelper {
std::unique_ptr<internal::AudioSendStream> CreateAudioSendStream() {
return std::unique_ptr<internal::AudioSendStream>(
new internal::AudioSendStream(
- stream_config_,
- audio_state_,
- &worker_queue_,
- &fake_transport_,
- &bitrate_allocator_,
- &event_log_,
- &rtcp_rtt_stats_,
- rtc::nullopt,
+ stream_config_, audio_state_, &worker_queue_, &fake_transport_,
+ &bitrate_allocator_, &event_log_, &rtcp_rtt_stats_, rtc::nullopt,
+ &active_lifetime_,
std::unique_ptr<voe::ChannelProxy>(channel_proxy_)));
}
@@ -186,6 +184,7 @@ struct ConfigHelper {
}
MockVoEChannelProxy* channel_proxy() { return channel_proxy_; }
RtpTransportControllerSendInterface* transport() { return &fake_transport_; }
+ TimeInterval* active_lifetime() { return &active_lifetime_; }
static void AddBweToConfig(AudioSendStream::Config* config) {
config->rtp.extensions.push_back(
@@ -223,7 +222,11 @@ struct ConfigHelper {
}
EXPECT_CALL(*channel_proxy_, ResetSenderCongestionControlObjects())
.Times(1);
- EXPECT_CALL(*channel_proxy_, RegisterTransport(nullptr)).Times(2);
+ {
+ ::testing::InSequence unregister_on_destruction;
+ EXPECT_CALL(*channel_proxy_, RegisterTransport(_)).Times(1);
+ EXPECT_CALL(*channel_proxy_, RegisterTransport(nullptr)).Times(1);
+ }
EXPECT_CALL(*channel_proxy_, SetRtcEventLog(testing::NotNull())).Times(1);
EXPECT_CALL(*channel_proxy_, SetRtcEventLog(testing::IsNull()))
.Times(1); // Destructor resets the event log
@@ -308,6 +311,7 @@ struct ConfigHelper {
rtc::scoped_refptr<MockAudioProcessing> audio_processing_;
AudioProcessingStats audio_processing_stats_;
SimulatedClock simulated_clock_;
+ TimeInterval active_lifetime_;
PacketRouter packet_router_;
testing::NiceMock<MockPacedSender> pacer_;
std::unique_ptr<SendSideCongestionController> send_side_cc_;
@@ -526,5 +530,34 @@ TEST(AudioSendStreamTest, ReconfigureTransportCcResetsFirst) {
}
send_stream->Reconfigure(new_config);
}
+
+// Checks that AudioSendStream logs the times at which RTP packets are sent
+// through its interface.
+TEST(AudioSendStreamTest, UpdateLifetime) {
+ ConfigHelper helper(false, true);
+
+ MockTransport mock_transport;
+ helper.config().send_transport = &mock_transport;
+
+ Transport* registered_transport;
+ ON_CALL(*helper.channel_proxy(), RegisterTransport(_))
+ .WillByDefault(Invoke([&registered_transport](Transport* transport) {
+ registered_transport = transport;
+ }));
+
+ rtc::ScopedFakeClock fake_clock;
+ constexpr int64_t kTimeBetweenSendRtpCallsMs = 100;
+ {
+ auto send_stream = helper.CreateAudioSendStream();
+ EXPECT_CALL(mock_transport, SendRtp(_, _, _)).Times(2);
+ const PacketOptions options;
+ registered_transport->SendRtp(nullptr, 0, options);
+ fake_clock.AdvanceTime(
+ rtc::TimeDelta::FromMilliseconds(kTimeBetweenSendRtpCallsMs));
+ registered_transport->SendRtp(nullptr, 0, options);
+ }
+ EXPECT_TRUE(!helper.active_lifetime()->Empty());
+ EXPECT_EQ(helper.active_lifetime()->Length(), kTimeBetweenSendRtpCallsMs);
+}
} // namespace test
} // namespace webrtc
diff --git a/chromium/third_party/webrtc/call/call.cc b/chromium/third_party/webrtc/call/call.cc
index fceea137684..08e1d937fa6 100644
--- a/chromium/third_party/webrtc/call/call.cc
+++ b/chromium/third_party/webrtc/call/call.cc
@@ -606,7 +606,8 @@ webrtc::AudioSendStream* Call::CreateAudioSendStream(
AudioSendStream* send_stream = new AudioSendStream(
config, config_.audio_state, &worker_queue_, module_process_thread_.get(),
transport_send_.get(), bitrate_allocator_.get(), event_log_,
- call_stats_->rtcp_rtt_stats(), suspended_rtp_state);
+ call_stats_->rtcp_rtt_stats(), suspended_rtp_state,
+ &sent_rtp_audio_timer_ms_);
{
WriteLockScoped write_lock(*send_crit_);
RTC_DCHECK(audio_send_ssrcs_.find(config.rtp.ssrc) ==
@@ -651,7 +652,6 @@ void Call::DestroyAudioSendStream(webrtc::AudioSendStream* send_stream) {
}
}
UpdateAggregateNetworkState();
- sent_rtp_audio_timer_ms_.Extend(audio_send_stream->GetActiveLifetime());
delete send_stream;
}
diff --git a/chromium/third_party/webrtc/common_video/h264/sps_parser.cc b/chromium/third_party/webrtc/common_video/h264/sps_parser.cc
index 1b9f0cd5213..2ee7391f8c4 100644
--- a/chromium/third_party/webrtc/common_video/h264/sps_parser.cc
+++ b/chromium/third_party/webrtc/common_video/h264/sps_parser.cc
@@ -17,6 +17,7 @@
#include "rtc_base/bitbuffer.h"
#include "rtc_base/logging.h"
+namespace {
typedef rtc::Optional<webrtc::SpsParser::SpsState> OptionalSps;
#define RETURN_EMPTY_ON_FAIL(x) \
@@ -24,6 +25,10 @@ typedef rtc::Optional<webrtc::SpsParser::SpsState> OptionalSps;
return OptionalSps(); \
}
+constexpr int kScalingDeltaMin = -128;
+constexpr int kScaldingDeltaMax = 127;
+} // namespace
+
namespace webrtc {
// General note: this is based off the 02/2014 version of the H.264 standard.
@@ -113,6 +118,8 @@ rtc::Optional<SpsParser::SpsState> SpsParser::ParseSpsUpToVui(
// delta_scale: se(v)
RETURN_EMPTY_ON_FAIL(
buffer->ReadSignedExponentialGolomb(&delta_scale));
+ RETURN_EMPTY_ON_FAIL(delta_scale >= kScalingDeltaMin &&
+ delta_scale <= kScaldingDeltaMax);
next_scale = (last_scale + delta_scale + 256) % 256;
}
if (next_scale != 0)
diff --git a/chromium/third_party/webrtc/common_video/h264/sps_parser_unittest.cc b/chromium/third_party/webrtc/common_video/h264/sps_parser_unittest.cc
index 39e6f2e3626..6856c1bbf2a 100644
--- a/chromium/third_party/webrtc/common_video/h264/sps_parser_unittest.cc
+++ b/chromium/third_party/webrtc/common_video/h264/sps_parser_unittest.cc
@@ -172,7 +172,7 @@ TEST_F(H264SpsParserTest, TestSyntheticSPSWeirdResolution) {
}
TEST_F(H264SpsParserTest, TestSampleSPSWithScalingLists) {
- // SPS from a 1920x1080 video. Contains scaling lists (and veritcal cropping).
+ // SPS from a 1920x1080 video. Contains scaling lists (and vertical cropping).
const uint8_t buffer[] = {0x64, 0x00, 0x2a, 0xad, 0x84, 0x01, 0x0c, 0x20,
0x08, 0x61, 0x00, 0x43, 0x08, 0x02, 0x18, 0x40,
0x10, 0xc2, 0x00, 0x84, 0x3b, 0x50, 0x3c, 0x01,
diff --git a/chromium/third_party/webrtc/modules/audio_processing/BUILD.gn b/chromium/third_party/webrtc/modules/audio_processing/BUILD.gn
index 181d797cc3b..c7d36c6472c 100644
--- a/chromium/third_party/webrtc/modules/audio_processing/BUILD.gn
+++ b/chromium/third_party/webrtc/modules/audio_processing/BUILD.gn
@@ -55,6 +55,7 @@ rtc_static_library("audio_processing") {
"aec3/comfort_noise_generator.h",
"aec3/decimator.cc",
"aec3/decimator.h",
+ "aec3/delay_estimate.h",
"aec3/downsampled_render_buffer.cc",
"aec3/downsampled_render_buffer.h",
"aec3/echo_canceller3.cc",
diff --git a/chromium/third_party/webrtc/modules/audio_processing/aec3/aec_state.cc b/chromium/third_party/webrtc/modules/audio_processing/aec3/aec_state.cc
index c1d7cc58835..e225e032347 100644
--- a/chromium/third_party/webrtc/modules/audio_processing/aec3/aec_state.cc
+++ b/chromium/third_party/webrtc/modules/audio_processing/aec3/aec_state.cc
@@ -154,7 +154,7 @@ void AecState::Update(
// TODO(peah): Move?
filter_has_had_time_to_converge_ =
- blocks_with_proper_filter_adaptation_ >= 2.5 * kNumBlocksPerSecond;
+ blocks_with_proper_filter_adaptation_ >= 1.5f * kNumBlocksPerSecond;
initial_state_ =
blocks_with_proper_filter_adaptation_ < 5 * kNumBlocksPerSecond;
@@ -163,7 +163,7 @@ void AecState::Update(
usable_linear_estimate_ =
!echo_saturation_ &&
(converged_filter && filter_has_had_time_to_converge_) &&
- capture_block_counter_ >= 2 * kNumBlocksPerSecond && !TransparentMode();
+ capture_block_counter_ >= 1.f * kNumBlocksPerSecond && !TransparentMode();
// After an amount of active render samples for which an echo should have been
// detected in the capture signal if the ERL was not infinite, flag that a
@@ -172,9 +172,6 @@ void AecState::Update(
!converged_filter &&
(blocks_with_active_render_ == 0 ||
blocks_with_proper_filter_adaptation_ >= 5 * kNumBlocksPerSecond);
-
- // Update the room reverb estimate.
- UpdateReverb(adaptive_filter_impulse_response);
}
void AecState::UpdateReverb(const std::vector<float>& impulse_response) {
diff --git a/chromium/third_party/webrtc/modules/audio_processing/aec3/block_processor.cc b/chromium/third_party/webrtc/modules/audio_processing/aec3/block_processor.cc
index 4c83a554131..24f2c9176df 100644
--- a/chromium/third_party/webrtc/modules/audio_processing/aec3/block_processor.cc
+++ b/chromium/third_party/webrtc/modules/audio_processing/aec3/block_processor.cc
@@ -56,6 +56,7 @@ class BlockProcessorImpl final : public BlockProcessor {
BlockProcessorMetrics metrics_;
RenderDelayBuffer::BufferingEvent render_event_;
size_t capture_call_counter_ = 0;
+ rtc::Optional<DelayEstimate> estimated_delay_;
RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(BlockProcessorImpl);
};
@@ -126,14 +127,17 @@ void BlockProcessorImpl::ProcessCapture(
RTC_DCHECK(RenderDelayBuffer::BufferingEvent::kRenderOverrun !=
render_event_);
if (render_event_ == RenderDelayBuffer::BufferingEvent::kRenderUnderrun) {
- echo_path_variability.delay_change =
- EchoPathVariability::DelayAdjustment::kDelayReset;
- delay_controller_->Reset();
- capture_properly_started_ = false;
- render_properly_started_ = false;
-
- RTC_LOG(LS_WARNING) << "Reset due to render buffer underrrun at block "
- << capture_call_counter_;
+ if (estimated_delay_ &&
+ estimated_delay_->quality == DelayEstimate::Quality::kRefined) {
+ echo_path_variability.delay_change =
+ EchoPathVariability::DelayAdjustment::kDelayReset;
+ delay_controller_->Reset();
+ capture_properly_started_ = false;
+ render_properly_started_ = false;
+
+ RTC_LOG(LS_WARNING) << "Reset due to render buffer underrrun at block "
+ << capture_call_counter_;
+ }
} else if (render_event_ == RenderDelayBuffer::BufferingEvent::kApiCallSkew) {
// There have been too many render calls in a row. Reset to avoid noncausal
// echo.
@@ -152,22 +156,23 @@ void BlockProcessorImpl::ProcessCapture(
// Compute and and apply the render delay required to achieve proper signal
// alignment.
- rtc::Optional<size_t> estimated_delay = delay_controller_->GetDelay(
+ estimated_delay_ = delay_controller_->GetDelay(
render_buffer_->GetDownsampledRenderBuffer(), (*capture_block)[0]);
- if (estimated_delay) {
- bool delay_change = render_buffer_->SetDelay(*estimated_delay);
-
- if (delay_change) {
- RTC_LOG(LS_WARNING) << "Delay changed to " << *estimated_delay
- << " at block " << capture_call_counter_;
- if (render_buffer_->CausalDelay()) {
+ if (estimated_delay_) {
+ if (render_buffer_->CausalDelay(estimated_delay_->delay)) {
+ bool delay_change = render_buffer_->SetDelay(estimated_delay_->delay);
+ if (delay_change) {
+ RTC_LOG(LS_WARNING) << "Delay changed to " << estimated_delay_->delay
+ << " at block " << capture_call_counter_;
echo_path_variability.delay_change =
EchoPathVariability::DelayAdjustment::kNewDetectedDelay;
- } else {
- // A noncausal delay has been detected. This can only happen if there is
- // clockdrift, an audio pipeline issue has occurred or the specified
- // minimum delay is too short. Perform a full reset.
+ }
+ } else {
+ // A noncausal delay has been detected. This can only happen if there is
+ // clockdrift, an audio pipeline issue has occurred, an unreliable delay
+ // estimate is used or the specified minimum delay is too short.
+ if (estimated_delay_->quality == DelayEstimate::Quality::kRefined) {
echo_path_variability.delay_change =
EchoPathVariability::DelayAdjustment::kDelayReset;
delay_controller_->Reset();
diff --git a/chromium/third_party/webrtc/modules/audio_processing/aec3/block_processor_unittest.cc b/chromium/third_party/webrtc/modules/audio_processing/aec3/block_processor_unittest.cc
index d23c1df41ff..29b249b3b6c 100644
--- a/chromium/third_party/webrtc/modules/audio_processing/aec3/block_processor_unittest.cc
+++ b/chromium/third_party/webrtc/modules/audio_processing/aec3/block_processor_unittest.cc
@@ -165,8 +165,7 @@ TEST(BlockProcessor, DISABLED_SubmoduleIntegration) {
.Times(kNumBlocks)
.WillRepeatedly(Return(0));
EXPECT_CALL(*render_delay_controller_mock, GetDelay(_, _))
- .Times(kNumBlocks)
- .WillRepeatedly(Return(9));
+ .Times(kNumBlocks);
EXPECT_CALL(*echo_remover_mock, ProcessCapture(_, _, _, _))
.Times(kNumBlocks);
EXPECT_CALL(*echo_remover_mock, UpdateEchoLeakageStatus(_))
diff --git a/chromium/third_party/webrtc/modules/audio_processing/aec3/delay_estimate.h b/chromium/third_party/webrtc/modules/audio_processing/aec3/delay_estimate.h
new file mode 100644
index 00000000000..c3911f7f425
--- /dev/null
+++ b/chromium/third_party/webrtc/modules/audio_processing/aec3/delay_estimate.h
@@ -0,0 +1,29 @@
+/*
+ * Copyright (c) 2018 The WebRTC project authors. All Rights Reserved.
+ *
+ * Use of this source code is governed by a BSD-style license
+ * that can be found in the LICENSE file in the root of the source
+ * tree. An additional intellectual property rights grant can be found
+ * in the file PATENTS. All contributing project authors may
+ * be found in the AUTHORS file in the root of the source tree.
+ */
+
+#ifndef MODULES_AUDIO_PROCESSING_AEC3_DELAY_ESTIMATE_H_
+#define MODULES_AUDIO_PROCESSING_AEC3_DELAY_ESTIMATE_H_
+
+namespace webrtc {
+
+// Stores delay_estimates.
+struct DelayEstimate {
+ enum class Quality { kCoarse, kRefined };
+
+ DelayEstimate(Quality quality, size_t delay)
+ : quality(quality), delay(delay) {}
+
+ Quality quality;
+ size_t delay;
+};
+
+} // namespace webrtc
+
+#endif // MODULES_AUDIO_PROCESSING_AEC3_DELAY_ESTIMATE_H_
diff --git a/chromium/third_party/webrtc/modules/audio_processing/aec3/echo_path_delay_estimator.cc b/chromium/third_party/webrtc/modules/audio_processing/aec3/echo_path_delay_estimator.cc
index 914f2d28eb0..95796d52ea6 100644
--- a/chromium/third_party/webrtc/modules/audio_processing/aec3/echo_path_delay_estimator.cc
+++ b/chromium/third_party/webrtc/modules/audio_processing/aec3/echo_path_delay_estimator.cc
@@ -48,7 +48,7 @@ void EchoPathDelayEstimator::Reset() {
matched_filter_.Reset();
}
-rtc::Optional<size_t> EchoPathDelayEstimator::EstimateDelay(
+rtc::Optional<DelayEstimate> EchoPathDelayEstimator::EstimateDelay(
const DownsampledRenderBuffer& render_buffer,
rtc::ArrayView<const float> capture) {
RTC_DCHECK_EQ(kBlockSize, capture.size());
@@ -64,24 +64,25 @@ rtc::Optional<size_t> EchoPathDelayEstimator::EstimateDelay(
16000 / down_sampling_factor_, 1);
matched_filter_.Update(render_buffer, downsampled_capture);
- rtc::Optional<size_t> aggregated_matched_filter_lag =
+ rtc::Optional<DelayEstimate> aggregated_matched_filter_lag =
matched_filter_lag_aggregator_.Aggregate(
matched_filter_.GetLagEstimates());
// TODO(peah): Move this logging outside of this class once EchoCanceller3
// development is done.
- data_dumper_->DumpRaw("aec3_echo_path_delay_estimator_delay",
- aggregated_matched_filter_lag
- ? static_cast<int>(*aggregated_matched_filter_lag *
- down_sampling_factor_)
- : -1);
+ data_dumper_->DumpRaw(
+ "aec3_echo_path_delay_estimator_delay",
+ aggregated_matched_filter_lag
+ ? static_cast<int>(aggregated_matched_filter_lag->delay *
+ down_sampling_factor_)
+ : -1);
// Return the detected delay in samples as the aggregated matched filter lag
// compensated by the down sampling factor for the signal being correlated.
- return aggregated_matched_filter_lag
- ? rtc::Optional<size_t>(*aggregated_matched_filter_lag *
- down_sampling_factor_)
- : rtc::nullopt;
+ if (aggregated_matched_filter_lag) {
+ aggregated_matched_filter_lag->delay *= down_sampling_factor_;
+ }
+ return aggregated_matched_filter_lag;
}
} // namespace webrtc
diff --git a/chromium/third_party/webrtc/modules/audio_processing/aec3/echo_path_delay_estimator.h b/chromium/third_party/webrtc/modules/audio_processing/aec3/echo_path_delay_estimator.h
index 04943ca4bac..ef0d4483e15 100644
--- a/chromium/third_party/webrtc/modules/audio_processing/aec3/echo_path_delay_estimator.h
+++ b/chromium/third_party/webrtc/modules/audio_processing/aec3/echo_path_delay_estimator.h
@@ -15,6 +15,7 @@
#include "api/optional.h"
#include "modules/audio_processing/aec3/decimator.h"
+#include "modules/audio_processing/aec3/delay_estimate.h"
#include "modules/audio_processing/aec3/downsampled_render_buffer.h"
#include "modules/audio_processing/aec3/matched_filter.h"
#include "modules/audio_processing/aec3/matched_filter_lag_aggregator.h"
@@ -36,7 +37,7 @@ class EchoPathDelayEstimator {
void Reset();
// Produce a delay estimate if such is avaliable.
- rtc::Optional<size_t> EstimateDelay(
+ rtc::Optional<DelayEstimate> EstimateDelay(
const DownsampledRenderBuffer& render_buffer,
rtc::ArrayView<const float> capture);
diff --git a/chromium/third_party/webrtc/modules/audio_processing/aec3/echo_path_delay_estimator_unittest.cc b/chromium/third_party/webrtc/modules/audio_processing/aec3/echo_path_delay_estimator_unittest.cc
index 8cc69ea17d9..dbd7c0bbb50 100644
--- a/chromium/third_party/webrtc/modules/audio_processing/aec3/echo_path_delay_estimator_unittest.cc
+++ b/chromium/third_party/webrtc/modules/audio_processing/aec3/echo_path_delay_estimator_unittest.cc
@@ -72,7 +72,7 @@ TEST(EchoPathDelayEstimator, DelayEstimation) {
delay_samples + 2 * config.delay.api_call_jitter_blocks * 64);
EchoPathDelayEstimator estimator(&data_dumper, config);
- rtc::Optional<size_t> estimated_delay_samples;
+ rtc::Optional<DelayEstimate> estimated_delay_samples;
for (size_t k = 0; k < (500 + (delay_samples) / kBlockSize); ++k) {
RandomizeSampleVector(&random_generator, render[0]);
signal_delay_buffer.Delay(render[0], capture);
@@ -92,7 +92,7 @@ TEST(EchoPathDelayEstimator, DelayEstimation) {
// Due to the internal down-sampling done inside the delay estimator
// the estimated delay cannot be expected to be exact to the true delay.
EXPECT_NEAR(delay_samples,
- *estimated_delay_samples -
+ estimated_delay_samples->delay -
(config.delay.api_call_jitter_blocks + 1) * 64,
config.delay.down_sampling_factor);
} else {
@@ -102,28 +102,6 @@ TEST(EchoPathDelayEstimator, DelayEstimation) {
}
}
-// Verifies that the delay estimator does not produce delay estimates too
-// quickly.
-TEST(EchoPathDelayEstimator, NoInitialDelayestimates) {
- Random random_generator(42U);
- EchoCanceller3Config config;
- std::vector<std::vector<float>> render(3, std::vector<float>(kBlockSize));
- std::vector<float> capture(kBlockSize);
- ApmDataDumper data_dumper(0);
- std::unique_ptr<RenderDelayBuffer> render_delay_buffer(
- RenderDelayBuffer::Create(config, 3));
-
- EchoPathDelayEstimator estimator(&data_dumper, config);
- for (size_t k = 0; k < 19; ++k) {
- RandomizeSampleVector(&random_generator, render[0]);
- std::copy(render[0].begin(), render[0].end(), capture.begin());
- render_delay_buffer->Insert(render);
- render_delay_buffer->PrepareCaptureProcessing();
- EXPECT_FALSE(estimator.EstimateDelay(
- render_delay_buffer->GetDownsampledRenderBuffer(), capture));
- }
-}
-
// Verifies that the delay estimator does not produce delay estimates for render
// signals of low level.
TEST(EchoPathDelayEstimator, NoDelayEstimatesForLowLevelRenderSignals) {
@@ -148,27 +126,6 @@ TEST(EchoPathDelayEstimator, NoDelayEstimatesForLowLevelRenderSignals) {
}
}
-// Verifies that the delay estimator does not produce delay estimates for
-// uncorrelated signals.
-TEST(EchoPathDelayEstimator, NoDelayEstimatesForUncorrelatedSignals) {
- Random random_generator(42U);
- EchoCanceller3Config config;
- std::vector<std::vector<float>> render(3, std::vector<float>(kBlockSize));
- std::vector<float> capture(kBlockSize);
- ApmDataDumper data_dumper(0);
- EchoPathDelayEstimator estimator(&data_dumper, config);
- std::unique_ptr<RenderDelayBuffer> render_delay_buffer(
- RenderDelayBuffer::Create(config, 3));
- for (size_t k = 0; k < 100; ++k) {
- RandomizeSampleVector(&random_generator, render[0]);
- RandomizeSampleVector(&random_generator, capture);
- render_delay_buffer->Insert(render);
- render_delay_buffer->PrepareCaptureProcessing();
- EXPECT_FALSE(estimator.EstimateDelay(
- render_delay_buffer->GetDownsampledRenderBuffer(), capture));
- }
-}
-
#if RTC_DCHECK_IS_ON && GTEST_HAS_DEATH_TEST && !defined(WEBRTC_ANDROID)
// Verifies the check for the render blocksize.
diff --git a/chromium/third_party/webrtc/modules/audio_processing/aec3/main_filter_update_gain_unittest.cc b/chromium/third_party/webrtc/modules/audio_processing/aec3/main_filter_update_gain_unittest.cc
index 155e74bf327..fbf444975ad 100644
--- a/chromium/third_party/webrtc/modules/audio_processing/aec3/main_filter_update_gain_unittest.cc
+++ b/chromium/third_party/webrtc/modules/audio_processing/aec3/main_filter_update_gain_unittest.cc
@@ -307,7 +307,8 @@ TEST(MainFilterUpdateGain, SaturationBehavior) {
}
// Verifies that the gain increases after an echo path change.
-TEST(MainFilterUpdateGain, EchoPathChangeBehavior) {
+// TODO(peah): Correct and reactivate this test.
+TEST(MainFilterUpdateGain, DISABLED_EchoPathChangeBehavior) {
for (size_t filter_length_blocks : {12, 20, 30}) {
SCOPED_TRACE(ProduceDebugText(filter_length_blocks));
std::vector<int> blocks_with_echo_path_changes;
diff --git a/chromium/third_party/webrtc/modules/audio_processing/aec3/matched_filter.cc b/chromium/third_party/webrtc/modules/audio_processing/aec3/matched_filter.cc
index 25001bc3bae..2b2e9d6bfab 100644
--- a/chromium/third_party/webrtc/modules/audio_processing/aec3/matched_filter.cc
+++ b/chromium/third_party/webrtc/modules/audio_processing/aec3/matched_filter.cc
@@ -89,11 +89,16 @@ void MatchedFilterCore_NEON(size_t x_start_index,
s += v[0] + v[1] + v[2] + v[3];
// Compute the matched filter error.
- const float e = std::min(32767.f, std::max(-32768.f, y[i] - s));
- *error_sum += e * e;
+ float e = y[i] - s;
+ const bool saturation = y[i] >= 32000.f || y[i] <= -32000.f ||
+ s >= 32000.f || s <= -32000.f || e >= 32000.f ||
+ e <= -32000.f;
+
+ e = std::min(32767.f, std::max(-32768.f, e));
+ (*error_sum) += e * e;
// Update the matched filter estimate in an NLMS manner.
- if (x2_sum > x2_sum_threshold) {
+ if (x2_sum > x2_sum_threshold && !saturation) {
RTC_DCHECK_LT(0.f, x2_sum);
const float alpha = 0.7f * e / x2_sum;
const float32x4_t alpha_128 = vmovq_n_f32(alpha);
@@ -199,11 +204,16 @@ void MatchedFilterCore_SSE2(size_t x_start_index,
s += v[0] + v[1] + v[2] + v[3];
// Compute the matched filter error.
- const float e = std::min(32767.f, std::max(-32768.f, y[i] - s));
- *error_sum += e * e;
+ float e = y[i] - s;
+ const bool saturation = y[i] >= 32000.f || y[i] <= -32000.f ||
+ s >= 32000.f || s <= -32000.f || e >= 32000.f ||
+ e <= -32000.f;
+
+ e = std::min(32767.f, std::max(-32768.f, e));
+ (*error_sum) += e * e;
// Update the matched filter estimate in an NLMS manner.
- if (x2_sum > x2_sum_threshold) {
+ if (x2_sum > x2_sum_threshold && !saturation) {
RTC_DCHECK_LT(0.f, x2_sum);
const float alpha = 0.7f * e / x2_sum;
const __m128 alpha_128 = _mm_set1_ps(alpha);
@@ -265,11 +275,16 @@ void MatchedFilterCore(size_t x_start_index,
}
// Compute the matched filter error.
- const float e = std::min(32767.f, std::max(-32768.f, y[i] - s));
+ float e = y[i] - s;
+ const bool saturation = y[i] >= 32000.f || y[i] <= -32000.f ||
+ s >= 32000.f || s <= -32000.f || e >= 32000.f ||
+ e <= -32000.f;
+
+ e = std::min(32767.f, std::max(-32768.f, e));
(*error_sum) += e * e;
// Update the matched filter estimate in an NLMS manner.
- if (x2_sum > x2_sum_threshold) {
+ if (x2_sum > x2_sum_threshold && !saturation) {
RTC_DCHECK_LT(0.f, x2_sum);
const float alpha = 0.7f * e / x2_sum;
diff --git a/chromium/third_party/webrtc/modules/audio_processing/aec3/matched_filter_lag_aggregator.cc b/chromium/third_party/webrtc/modules/audio_processing/aec3/matched_filter_lag_aggregator.cc
index 92cb4f7736c..9041924b34c 100644
--- a/chromium/third_party/webrtc/modules/audio_processing/aec3/matched_filter_lag_aggregator.cc
+++ b/chromium/third_party/webrtc/modules/audio_processing/aec3/matched_filter_lag_aggregator.cc
@@ -27,9 +27,10 @@ void MatchedFilterLagAggregator::Reset() {
std::fill(histogram_.begin(), histogram_.end(), 0);
histogram_data_.fill(0);
histogram_data_index_ = 0;
+ significant_candidate_found_ = false;
}
-rtc::Optional<size_t> MatchedFilterLagAggregator::Aggregate(
+rtc::Optional<DelayEstimate> MatchedFilterLagAggregator::Aggregate(
rtc::ArrayView<const MatchedFilter::LagEstimate> lag_estimates) {
// Choose the strongest lag estimate as the best one.
float best_accuracy = 0.f;
@@ -67,7 +68,10 @@ rtc::Optional<size_t> MatchedFilterLagAggregator::Aggregate(
std::max_element(histogram_.begin(), histogram_.end()));
if (histogram_[candidate] > 25) {
- return candidate;
+ significant_candidate_found_ = true;
+ return DelayEstimate(DelayEstimate::Quality::kRefined, candidate);
+ } else if (!significant_candidate_found_) {
+ return DelayEstimate(DelayEstimate::Quality::kCoarse, candidate);
}
}
return rtc::nullopt;
diff --git a/chromium/third_party/webrtc/modules/audio_processing/aec3/matched_filter_lag_aggregator.h b/chromium/third_party/webrtc/modules/audio_processing/aec3/matched_filter_lag_aggregator.h
index c5dd24700ea..86968bd24f8 100644
--- a/chromium/third_party/webrtc/modules/audio_processing/aec3/matched_filter_lag_aggregator.h
+++ b/chromium/third_party/webrtc/modules/audio_processing/aec3/matched_filter_lag_aggregator.h
@@ -14,6 +14,7 @@
#include <vector>
#include "api/optional.h"
+#include "modules/audio_processing/aec3/delay_estimate.h"
#include "modules/audio_processing/aec3/matched_filter.h"
#include "rtc_base/constructormagic.h"
@@ -32,7 +33,7 @@ class MatchedFilterLagAggregator {
void Reset();
// Aggregates the provided lag estimates.
- rtc::Optional<size_t> Aggregate(
+ rtc::Optional<DelayEstimate> Aggregate(
rtc::ArrayView<const MatchedFilter::LagEstimate> lag_estimates);
private:
@@ -40,6 +41,7 @@ class MatchedFilterLagAggregator {
std::vector<int> histogram_;
std::array<int, 250> histogram_data_;
int histogram_data_index_ = 0;
+ bool significant_candidate_found_ = false;
RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(MatchedFilterLagAggregator);
};
diff --git a/chromium/third_party/webrtc/modules/audio_processing/aec3/matched_filter_lag_aggregator_unittest.cc b/chromium/third_party/webrtc/modules/audio_processing/aec3/matched_filter_lag_aggregator_unittest.cc
index 985ed434276..ce303d4e382 100644
--- a/chromium/third_party/webrtc/modules/audio_processing/aec3/matched_filter_lag_aggregator_unittest.cc
+++ b/chromium/third_party/webrtc/modules/audio_processing/aec3/matched_filter_lag_aggregator_unittest.cc
@@ -37,12 +37,13 @@ TEST(MatchedFilterLagAggregator, MostAccurateLagChosen) {
lag_estimates[1] = MatchedFilter::LagEstimate(0.5f, true, kLag2, true);
for (size_t k = 0; k < kNumLagsBeforeDetection; ++k) {
- EXPECT_FALSE(aggregator.Aggregate(lag_estimates));
+ EXPECT_TRUE(aggregator.Aggregate(lag_estimates));
}
- rtc::Optional<size_t> aggregated_lag = aggregator.Aggregate(lag_estimates);
+ rtc::Optional<DelayEstimate> aggregated_lag =
+ aggregator.Aggregate(lag_estimates);
EXPECT_TRUE(aggregated_lag);
- EXPECT_EQ(kLag1, *aggregated_lag);
+ EXPECT_EQ(kLag1, aggregated_lag->delay);
lag_estimates[0] = MatchedFilter::LagEstimate(0.5f, true, kLag1, true);
lag_estimates[1] = MatchedFilter::LagEstimate(1.f, true, kLag2, true);
@@ -50,13 +51,13 @@ TEST(MatchedFilterLagAggregator, MostAccurateLagChosen) {
for (size_t k = 0; k < kNumLagsBeforeDetection; ++k) {
aggregated_lag = aggregator.Aggregate(lag_estimates);
EXPECT_TRUE(aggregated_lag);
- EXPECT_EQ(kLag1, *aggregated_lag);
+ EXPECT_EQ(kLag1, aggregated_lag->delay);
}
aggregated_lag = aggregator.Aggregate(lag_estimates);
aggregated_lag = aggregator.Aggregate(lag_estimates);
EXPECT_TRUE(aggregated_lag);
- EXPECT_EQ(kLag2, *aggregated_lag);
+ EXPECT_EQ(kLag2, aggregated_lag->delay);
}
// Verifies that varying lag estimates causes lag estimates to not be deemed
@@ -66,9 +67,23 @@ TEST(MatchedFilterLagAggregator,
ApmDataDumper data_dumper(0);
std::vector<MatchedFilter::LagEstimate> lag_estimates(1);
MatchedFilterLagAggregator aggregator(&data_dumper, 100);
+
+ rtc::Optional<DelayEstimate> aggregated_lag;
+ for (size_t k = 0; k < kNumLagsBeforeDetection; ++k) {
+ lag_estimates[0] = MatchedFilter::LagEstimate(1.f, true, 10, true);
+ aggregated_lag = aggregator.Aggregate(lag_estimates);
+ }
+ EXPECT_TRUE(aggregated_lag);
+
for (size_t k = 0; k < kNumLagsBeforeDetection * 100; ++k) {
lag_estimates[0] = MatchedFilter::LagEstimate(1.f, true, k % 100, true);
- rtc::Optional<size_t> aggregated_lag = aggregator.Aggregate(lag_estimates);
+ aggregated_lag = aggregator.Aggregate(lag_estimates);
+ }
+ EXPECT_FALSE(aggregated_lag);
+
+ for (size_t k = 0; k < kNumLagsBeforeDetection * 100; ++k) {
+ lag_estimates[0] = MatchedFilter::LagEstimate(1.f, true, k % 100, true);
+ aggregated_lag = aggregator.Aggregate(lag_estimates);
EXPECT_FALSE(aggregated_lag);
}
}
@@ -83,9 +98,10 @@ TEST(MatchedFilterLagAggregator,
MatchedFilterLagAggregator aggregator(&data_dumper, kLag);
for (size_t k = 0; k < kNumLagsBeforeDetection * 10; ++k) {
lag_estimates[0] = MatchedFilter::LagEstimate(1.f, true, kLag, false);
- rtc::Optional<size_t> aggregated_lag = aggregator.Aggregate(lag_estimates);
+ rtc::Optional<DelayEstimate> aggregated_lag =
+ aggregator.Aggregate(lag_estimates);
EXPECT_FALSE(aggregated_lag);
- EXPECT_EQ(kLag, *aggregated_lag);
+ EXPECT_EQ(kLag, aggregated_lag->delay);
}
}
@@ -98,19 +114,19 @@ TEST(MatchedFilterLagAggregator, DISABLED_PersistentAggregatedLag) {
ApmDataDumper data_dumper(0);
std::vector<MatchedFilter::LagEstimate> lag_estimates(1);
MatchedFilterLagAggregator aggregator(&data_dumper, std::max(kLag1, kLag2));
- rtc::Optional<size_t> aggregated_lag;
+ rtc::Optional<DelayEstimate> aggregated_lag;
for (size_t k = 0; k < kNumLagsBeforeDetection; ++k) {
lag_estimates[0] = MatchedFilter::LagEstimate(1.f, true, kLag1, true);
aggregated_lag = aggregator.Aggregate(lag_estimates);
}
EXPECT_TRUE(aggregated_lag);
- EXPECT_EQ(kLag1, *aggregated_lag);
+ EXPECT_EQ(kLag1, aggregated_lag->delay);
for (size_t k = 0; k < kNumLagsBeforeDetection * 40; ++k) {
lag_estimates[0] = MatchedFilter::LagEstimate(1.f, false, kLag2, true);
aggregated_lag = aggregator.Aggregate(lag_estimates);
EXPECT_TRUE(aggregated_lag);
- EXPECT_EQ(kLag1, *aggregated_lag);
+ EXPECT_EQ(kLag1, aggregated_lag->delay);
}
}
diff --git a/chromium/third_party/webrtc/modules/audio_processing/aec3/mock/mock_render_delay_buffer.h b/chromium/third_party/webrtc/modules/audio_processing/aec3/mock/mock_render_delay_buffer.h
index 2d3d9dcea22..1ed2b40e0c8 100644
--- a/chromium/third_party/webrtc/modules/audio_processing/aec3/mock/mock_render_delay_buffer.h
+++ b/chromium/third_party/webrtc/modules/audio_processing/aec3/mock/mock_render_delay_buffer.h
@@ -52,7 +52,7 @@ class MockRenderDelayBuffer : public RenderDelayBuffer {
MOCK_METHOD0(GetRenderBuffer, RenderBuffer*());
MOCK_CONST_METHOD0(GetDownsampledRenderBuffer,
const DownsampledRenderBuffer&());
- MOCK_CONST_METHOD0(CausalDelay, bool());
+ MOCK_CONST_METHOD1(CausalDelay, bool(size_t delay));
private:
RenderBuffer* FakeGetRenderBuffer() { return &render_buffer_; }
diff --git a/chromium/third_party/webrtc/modules/audio_processing/aec3/mock/mock_render_delay_controller.h b/chromium/third_party/webrtc/modules/audio_processing/aec3/mock/mock_render_delay_controller.h
index 13dd8c28be9..4a82ae3292b 100644
--- a/chromium/third_party/webrtc/modules/audio_processing/aec3/mock/mock_render_delay_controller.h
+++ b/chromium/third_party/webrtc/modules/audio_processing/aec3/mock/mock_render_delay_controller.h
@@ -25,11 +25,10 @@ class MockRenderDelayController : public RenderDelayController {
virtual ~MockRenderDelayController() = default;
MOCK_METHOD0(Reset, void());
- MOCK_METHOD1(SetDelay, void(size_t render_delay));
MOCK_METHOD2(
GetDelay,
- rtc::Optional<size_t>(const DownsampledRenderBuffer& render_buffer,
- rtc::ArrayView<const float> capture));
+ rtc::Optional<DelayEstimate>(const DownsampledRenderBuffer& render_buffer,
+ rtc::ArrayView<const float> capture));
};
} // namespace test
diff --git a/chromium/third_party/webrtc/modules/audio_processing/aec3/render_delay_buffer.cc b/chromium/third_party/webrtc/modules/audio_processing/aec3/render_delay_buffer.cc
index 3181bae2cbb..13737296df0 100644
--- a/chromium/third_party/webrtc/modules/audio_processing/aec3/render_delay_buffer.cc
+++ b/chromium/third_party/webrtc/modules/audio_processing/aec3/render_delay_buffer.cc
@@ -47,7 +47,7 @@ class RenderDelayBufferImpl final : public RenderDelayBuffer {
return low_rate_;
}
- bool CausalDelay() const override;
+ bool CausalDelay(size_t delay) const override;
private:
static int instance_count_;
@@ -304,10 +304,14 @@ bool RenderDelayBufferImpl::SetDelay(size_t delay) {
}
// Returns whether the specified delay is causal.
-bool RenderDelayBufferImpl::CausalDelay() const {
- return !internal_delay_ ||
- *internal_delay_ >=
- static_cast<int>(config_.delay.min_echo_path_delay_blocks);
+bool RenderDelayBufferImpl::CausalDelay(size_t delay) const {
+ // Compute the internal delay and limit the delay to the allowed range.
+ int internal_delay = MaxExternalDelayToInternalDelay(delay);
+ internal_delay =
+ std::min(MaxDelay(), static_cast<size_t>(std::max(internal_delay, 0)));
+
+ return internal_delay >=
+ static_cast<int>(config_.delay.min_echo_path_delay_blocks);
}
// Maps the externally computed delay to the delay used internally.
diff --git a/chromium/third_party/webrtc/modules/audio_processing/aec3/render_delay_buffer.h b/chromium/third_party/webrtc/modules/audio_processing/aec3/render_delay_buffer.h
index b7718aa2c3f..28ae32ba06b 100644
--- a/chromium/third_party/webrtc/modules/audio_processing/aec3/render_delay_buffer.h
+++ b/chromium/third_party/webrtc/modules/audio_processing/aec3/render_delay_buffer.h
@@ -68,7 +68,7 @@ class RenderDelayBuffer {
virtual const DownsampledRenderBuffer& GetDownsampledRenderBuffer() const = 0;
// Returns whether the current delay is noncausal.
- virtual bool CausalDelay() const = 0;
+ virtual bool CausalDelay(size_t delay) const = 0;
// Returns the maximum non calusal offset that can occur in the delay buffer.
static int DelayEstimatorOffset(const EchoCanceller3Config& config);
diff --git a/chromium/third_party/webrtc/modules/audio_processing/aec3/render_delay_controller.cc b/chromium/third_party/webrtc/modules/audio_processing/aec3/render_delay_controller.cc
index 16a447730d4..3bc7d622370 100644
--- a/chromium/third_party/webrtc/modules/audio_processing/aec3/render_delay_controller.cc
+++ b/chromium/third_party/webrtc/modules/audio_processing/aec3/render_delay_controller.cc
@@ -32,9 +32,9 @@ class RenderDelayControllerImpl final : public RenderDelayController {
int sample_rate_hz);
~RenderDelayControllerImpl() override;
void Reset() override;
- void SetDelay(size_t render_delay) override;
- rtc::Optional<size_t> GetDelay(const DownsampledRenderBuffer& render_buffer,
- rtc::ArrayView<const float> capture) override;
+ rtc::Optional<DelayEstimate> GetDelay(
+ const DownsampledRenderBuffer& render_buffer,
+ rtc::ArrayView<const float> capture) override;
private:
static int instance_count_;
@@ -42,43 +42,48 @@ class RenderDelayControllerImpl final : public RenderDelayController {
const int delay_headroom_blocks_;
const int hysteresis_limit_1_blocks_;
const int hysteresis_limit_2_blocks_;
- rtc::Optional<size_t> delay_;
+ rtc::Optional<DelayEstimate> delay_;
EchoPathDelayEstimator delay_estimator_;
- size_t align_call_counter_ = 0;
std::vector<float> delay_buf_;
int delay_buf_index_ = 0;
RenderDelayControllerMetrics metrics_;
RTC_DISALLOW_IMPLICIT_CONSTRUCTORS(RenderDelayControllerImpl);
};
-size_t ComputeNewBufferDelay(const rtc::Optional<size_t>& current_delay,
- int delay_headroom_blocks,
- int hysteresis_limit_1_blocks,
- int hysteresis_limit_2_blocks,
- size_t delay_samples) {
+DelayEstimate ComputeNewBufferDelay(
+ const rtc::Optional<DelayEstimate>& current_delay,
+ int delay_headroom_blocks,
+ int hysteresis_limit_1_blocks,
+ int hysteresis_limit_2_blocks,
+ DelayEstimate estimated_delay) {
// The below division is not exact and the truncation is intended.
- const int echo_path_delay_blocks = delay_samples >> kBlockSizeLog2;
+ const int echo_path_delay_blocks = estimated_delay.delay >> kBlockSizeLog2;
// Compute the buffer delay increase required to achieve the desired latency.
- size_t new_delay =
+ size_t new_delay_blocks =
std::max(echo_path_delay_blocks - delay_headroom_blocks, 0);
+ DelayEstimate new_delay(estimated_delay.quality, new_delay_blocks);
+
// Add hysteresis.
if (current_delay) {
- if (new_delay > *current_delay) {
- if (new_delay <= *current_delay + hysteresis_limit_1_blocks) {
- new_delay = *current_delay;
+ size_t current_delay_blocks = current_delay->delay;
+ if (new_delay_blocks > current_delay_blocks) {
+ if (new_delay_blocks <=
+ current_delay_blocks + hysteresis_limit_1_blocks) {
+ new_delay_blocks = current_delay_blocks;
}
- } else if (new_delay < *current_delay) {
+ } else if (new_delay_blocks < current_delay_blocks) {
size_t hysteresis_limit = std::max(
- static_cast<int>(*current_delay) - hysteresis_limit_2_blocks, 0);
- if (new_delay >= hysteresis_limit) {
- new_delay = *current_delay;
+ static_cast<int>(current_delay_blocks) - hysteresis_limit_2_blocks,
+ 0);
+ if (new_delay_blocks >= hysteresis_limit) {
+ new_delay_blocks = current_delay_blocks;
}
}
}
- return new_delay;
+ return DelayEstimate(estimated_delay.quality, new_delay_blocks);
}
int RenderDelayControllerImpl::instance_count_ = 0;
@@ -106,25 +111,14 @@ RenderDelayControllerImpl::~RenderDelayControllerImpl() = default;
void RenderDelayControllerImpl::Reset() {
delay_ = rtc::nullopt;
- align_call_counter_ = 0;
std::fill(delay_buf_.begin(), delay_buf_.end(), 0.f);
delay_estimator_.Reset();
}
-void RenderDelayControllerImpl::SetDelay(size_t render_delay) {
- if (delay_ != render_delay) {
- // If a the delay set does not match the actual delay, reset the delay
- // controller.
- Reset();
- delay_ = render_delay;
- }
-}
-
-rtc::Optional<size_t> RenderDelayControllerImpl::GetDelay(
+rtc::Optional<DelayEstimate> RenderDelayControllerImpl::GetDelay(
const DownsampledRenderBuffer& render_buffer,
rtc::ArrayView<const float> capture) {
RTC_DCHECK_EQ(kBlockSize, capture.size());
- ++align_call_counter_;
// Estimate the delay with a delayed capture.
RTC_DCHECK_LT(delay_buf_index_ + kBlockSize - 1, delay_buf_.size());
@@ -139,21 +133,21 @@ rtc::Optional<size_t> RenderDelayControllerImpl::GetDelay(
if (delay_samples) {
// Compute and set new render delay buffer delay.
- if (align_call_counter_ > kNumBlocksPerSecond) {
- delay_ = ComputeNewBufferDelay(
- delay_, delay_headroom_blocks_, hysteresis_limit_1_blocks_,
- hysteresis_limit_2_blocks_, static_cast<int>(*delay_samples));
- }
- metrics_.Update(static_cast<int>(*delay_samples), delay_ ? *delay_ : 0);
+ delay_ = ComputeNewBufferDelay(delay_, delay_headroom_blocks_,
+ hysteresis_limit_1_blocks_,
+ hysteresis_limit_2_blocks_, *delay_samples);
+
+ metrics_.Update(static_cast<int>(delay_samples->delay),
+ delay_ ? delay_->delay : 0);
} else {
- metrics_.Update(rtc::nullopt, delay_ ? *delay_ : 0);
+ metrics_.Update(rtc::nullopt, delay_ ? delay_->delay : 0);
}
data_dumper_->DumpRaw("aec3_render_delay_controller_delay",
- delay_samples ? *delay_samples : 0);
+ delay_samples ? delay_samples->delay : 0);
data_dumper_->DumpRaw("aec3_render_delay_controller_buffer_delay",
- delay_ ? *delay_ : 0);
+ delay_ ? delay_->delay : 0);
return delay_;
}
diff --git a/chromium/third_party/webrtc/modules/audio_processing/aec3/render_delay_controller.h b/chromium/third_party/webrtc/modules/audio_processing/aec3/render_delay_controller.h
index a90ccb024ba..5b1fc35ee97 100644
--- a/chromium/third_party/webrtc/modules/audio_processing/aec3/render_delay_controller.h
+++ b/chromium/third_party/webrtc/modules/audio_processing/aec3/render_delay_controller.h
@@ -13,6 +13,7 @@
#include "api/array_view.h"
#include "api/optional.h"
+#include "modules/audio_processing/aec3/delay_estimate.h"
#include "modules/audio_processing/aec3/downsampled_render_buffer.h"
#include "modules/audio_processing/aec3/render_delay_buffer.h"
#include "modules/audio_processing/include/audio_processing.h"
@@ -31,11 +32,8 @@ class RenderDelayController {
// Resets the delay controller.
virtual void Reset() = 0;
- // Receives the externally used delay.
- virtual void SetDelay(size_t render_delay) = 0;
-
// Aligns the render buffer content with the capture signal.
- virtual rtc::Optional<size_t> GetDelay(
+ virtual rtc::Optional<DelayEstimate> GetDelay(
const DownsampledRenderBuffer& render_buffer,
rtc::ArrayView<const float> capture) = 0;
};
diff --git a/chromium/third_party/webrtc/modules/audio_processing/aec3/render_delay_controller_unittest.cc b/chromium/third_party/webrtc/modules/audio_processing/aec3/render_delay_controller_unittest.cc
index e91f7bd1a3d..656c5e88174 100644
--- a/chromium/third_party/webrtc/modules/audio_processing/aec3/render_delay_controller_unittest.cc
+++ b/chromium/third_party/webrtc/modules/audio_processing/aec3/render_delay_controller_unittest.cc
@@ -61,9 +61,9 @@ TEST(RenderDelayController, NoRenderSignal) {
RenderDelayController::Create(
config, RenderDelayBuffer::DelayEstimatorOffset(config), rate));
for (size_t k = 0; k < 100; ++k) {
- EXPECT_EQ(config.delay.min_echo_path_delay_blocks,
- delay_controller->GetDelay(
- delay_buffer->GetDownsampledRenderBuffer(), block));
+ auto delay = delay_controller->GetDelay(
+ delay_buffer->GetDownsampledRenderBuffer(), block);
+ EXPECT_EQ(config.delay.min_echo_path_delay_blocks, delay->delay);
}
}
}
@@ -73,7 +73,7 @@ TEST(RenderDelayController, NoRenderSignal) {
// Verifies the basic API call sequence.
TEST(RenderDelayController, BasicApiCalls) {
std::vector<float> capture_block(kBlockSize, 0.f);
- rtc::Optional<size_t> delay_blocks = 0;
+ rtc::Optional<DelayEstimate> delay_blocks;
for (size_t num_matched_filters = 4; num_matched_filters == 10;
num_matched_filters++) {
for (auto down_sampling_factor : kDownSamplingFactors) {
@@ -97,7 +97,7 @@ TEST(RenderDelayController, BasicApiCalls) {
render_delay_buffer->GetDownsampledRenderBuffer(), capture_block);
}
EXPECT_TRUE(delay_blocks);
- EXPECT_EQ(config.delay.min_echo_path_delay_blocks, delay_blocks);
+ EXPECT_EQ(config.delay.min_echo_path_delay_blocks, delay_blocks->delay);
}
}
}
@@ -120,7 +120,7 @@ TEST(RenderDelayController, Alignment) {
NumBandsForRate(rate), std::vector<float>(kBlockSize, 0.f));
for (size_t delay_samples : {15, 50, 150, 200, 800, 4000}) {
- rtc::Optional<size_t> delay_blocks;
+ rtc::Optional<DelayEstimate> delay_blocks;
SCOPED_TRACE(ProduceDebugText(rate, delay_samples));
std::unique_ptr<RenderDelayBuffer> render_delay_buffer(
RenderDelayBuffer::Create(config, NumBandsForRate(rate)));
@@ -145,7 +145,7 @@ TEST(RenderDelayController, Alignment) {
std::max(0, static_cast<int>(delay_samples / kBlockSize) -
kDelayHeadroomBlocks);
- EXPECT_EQ(expected_delay_blocks, delay_blocks);
+ EXPECT_EQ(expected_delay_blocks, delay_blocks->delay);
}
}
}
@@ -169,7 +169,7 @@ TEST(RenderDelayController, NonCausalAlignment) {
NumBandsForRate(rate), std::vector<float>(kBlockSize, 0.f));
for (int delay_samples : {-15, -50, -150, -200}) {
- rtc::Optional<size_t> delay_blocks;
+ rtc::Optional<DelayEstimate> delay_blocks;
SCOPED_TRACE(ProduceDebugText(rate, -delay_samples));
std::unique_ptr<RenderDelayBuffer> render_delay_buffer(
RenderDelayBuffer::Create(config, NumBandsForRate(rate)));
@@ -211,7 +211,7 @@ TEST(RenderDelayController, AlignmentWithJitter) {
std::vector<std::vector<float>> render_block(
NumBandsForRate(rate), std::vector<float>(kBlockSize, 0.f));
for (size_t delay_samples : {15, 50, 300, 800}) {
- rtc::Optional<size_t> delay_blocks;
+ rtc::Optional<DelayEstimate> delay_blocks;
SCOPED_TRACE(ProduceDebugText(rate, delay_samples));
std::unique_ptr<RenderDelayBuffer> render_delay_buffer(
RenderDelayBuffer::Create(config, NumBandsForRate(rate)));
@@ -250,7 +250,7 @@ TEST(RenderDelayController, AlignmentWithJitter) {
}
ASSERT_TRUE(delay_blocks);
- EXPECT_EQ(expected_delay_blocks, *delay_blocks);
+ EXPECT_EQ(expected_delay_blocks, delay_blocks->delay);
}
}
}
diff --git a/chromium/third_party/webrtc/modules/audio_processing/aec3/residual_echo_estimator.cc b/chromium/third_party/webrtc/modules/audio_processing/aec3/residual_echo_estimator.cc
index 1fec4511a07..f0c971dd5ab 100644
--- a/chromium/third_party/webrtc/modules/audio_processing/aec3/residual_echo_estimator.cc
+++ b/chromium/third_party/webrtc/modules/audio_processing/aec3/residual_echo_estimator.cc
@@ -110,12 +110,8 @@ void ResidualEchoEstimator::Estimate(
std::array<float, kFftLengthBy2Plus1> X2;
// Computes the spectral power over the blocks surrounding the delay.
- constexpr int kKnownDelayRenderWindowSize = 5;
- // TODO(peah): Add lookahead since that was what was there initially.
- EchoGeneratingPower(
- render_buffer, std::max(0, aec_state.FilterDelay() - 1),
- std::min(kKnownDelayRenderWindowSize - 1, aec_state.FilterDelay() + 4),
- &X2);
+ EchoGeneratingPower(render_buffer, std::max(0, aec_state.FilterDelay() - 1),
+ aec_state.FilterDelay() + 10, &X2);
// Subtract the stationary noise power to avoid stationary noise causing
// excessive echo suppression.
diff --git a/chromium/third_party/webrtc/modules/audio_processing/include/audio_processing.h b/chromium/third_party/webrtc/modules/audio_processing/include/audio_processing.h
index 31b41e7ba35..65c050150bc 100644
--- a/chromium/third_party/webrtc/modules/audio_processing/include/audio_processing.h
+++ b/chromium/third_party/webrtc/modules/audio_processing/include/audio_processing.h
@@ -1237,10 +1237,10 @@ struct EchoCanceller3Config {
size_t down_sampling_factor = 4;
size_t num_filters = 4;
size_t api_call_jitter_blocks = 26;
- size_t min_echo_path_delay_blocks = 5;
- size_t delay_headroom_blocks = 1;
+ size_t min_echo_path_delay_blocks = 0;
+ size_t delay_headroom_blocks = 2;
size_t hysteresis_limit_1_blocks = 1;
- size_t hysteresis_limit_2_blocks = 0;
+ size_t hysteresis_limit_2_blocks = 1;
} delay;
struct Filter {
@@ -1258,11 +1258,11 @@ struct EchoCanceller3Config {
float noise_gate;
};
- MainConfiguration main = {12, 0.005f, 0.05f, 0.001f, 20075344.f};
- ShadowConfiguration shadow = {12, 0.1f, 20075344.f};
+ MainConfiguration main = {13, 0.005f, 0.1f, 0.001f, 20075344.f};
+ ShadowConfiguration shadow = {13, 0.7f, 20075344.f};
- MainConfiguration main_initial = {12, 0.01f, 0.1f, 0.001f, 20075344.f};
- ShadowConfiguration shadow_initial = {12, 0.7f, 20075344.f};
+ MainConfiguration main_initial = {12, 0.05f, 5.f, 0.001f, 20075344.f};
+ ShadowConfiguration shadow_initial = {12, 0.9f, 20075344.f};
} filter;
struct Erle {
@@ -1285,7 +1285,7 @@ struct EchoCanceller3Config {
float m2 = 0.0001f;
float m3 = 0.01f;
float m4 = 0.1f;
- float m5 = 0.3f;
+ float m5 = 0.1f;
float m6 = 0.0001f;
float m7 = 0.01f;
float m8 = 0.0001f;
@@ -1312,13 +1312,13 @@ struct EchoCanceller3Config {
float min_dec;
};
- GainChanges low_noise = {3.f, 3.f, 1.5f, 1.5f, 1.5f, 1.5f};
+ GainChanges low_noise = {2.f, 2.f, 1.4f, 1.4f, 1.1f, 1.1f};
GainChanges initial = {2.f, 2.f, 1.5f, 1.5f, 1.2f, 1.2f};
GainChanges normal = {2.f, 2.f, 1.5f, 1.5f, 1.2f, 1.2f};
GainChanges saturation = {1.2f, 1.2f, 1.5f, 1.5f, 1.f, 1.f};
GainChanges nonlinear = {1.5f, 1.5f, 1.2f, 1.2f, 1.1f, 1.1f};
- float floor_first_increase = 0.0001f;
+ float floor_first_increase = 0.00001f;
} gain_updates;
};
diff --git a/chromium/third_party/webrtc/modules/video_coding/codecs/vp8/screenshare_layers.cc b/chromium/third_party/webrtc/modules/video_coding/codecs/vp8/screenshare_layers.cc
index 444c0ccc90f..8c63cf1a080 100644
--- a/chromium/third_party/webrtc/modules/video_coding/codecs/vp8/screenshare_layers.cc
+++ b/chromium/third_party/webrtc/modules/video_coding/codecs/vp8/screenshare_layers.cc
@@ -127,15 +127,25 @@ TemporalLayers::FrameConfig ScreenshareLayers::UpdateLayerConfig(
// If input frame rate exceeds target frame rate, either over a one second
// averaging window, or if frame interval is below 90% of desired value,
// drop frame.
- // Use real-time clock rather than timestamps, in case there is a
- // discontinuity in the timestamps sequence.
if (encode_framerate_.Rate(now_ms).value_or(0) > *target_framerate_)
return TemporalLayers::FrameConfig(kNone, kNone, kNone);
- int64_t expected_frame_interval_ms = 1000 / *target_framerate_;
- if (last_frame_time_ms_ != -1 &&
- now_ms - last_frame_time_ms_ < (9 * expected_frame_interval_ms) / 10) {
- return TemporalLayers::FrameConfig(kNone, kNone, kNone);
+ // Primarily check if frame interval is too short using frame timestamps,
+ // as if they are correct they won't be affected by queuing in webrtc.
+ const int64_t expected_frame_interval_90khz =
+ kOneSecond90Khz / *target_framerate_;
+ if (last_timestamp_ != -1 && ts_diff > 0) {
+ if (ts_diff < 85 * expected_frame_interval_90khz / 100) {
+ return TemporalLayers::FrameConfig(kNone, kNone, kNone);
+ }
+ } else {
+ // Timestamps looks off, use realtime clock here instead.
+ const int64_t expected_frame_interval_ms = 1000 / *target_framerate_;
+ if (last_frame_time_ms_ != -1 &&
+ now_ms - last_frame_time_ms_ <
+ (85 * expected_frame_interval_ms) / 100) {
+ return TemporalLayers::FrameConfig(kNone, kNone, kNone);
+ }
}
}
diff --git a/chromium/third_party/webrtc/modules/video_coding/codecs/vp8/screenshare_layers_unittest.cc b/chromium/third_party/webrtc/modules/video_coding/codecs/vp8/screenshare_layers_unittest.cc
index 422905d9ff7..818308f3b01 100644
--- a/chromium/third_party/webrtc/modules/video_coding/codecs/vp8/screenshare_layers_unittest.cc
+++ b/chromium/third_party/webrtc/modules/video_coding/codecs/vp8/screenshare_layers_unittest.cc
@@ -617,7 +617,7 @@ TEST_F(ScreenshareLayerTest, DropOnTooShortFrameInterval) {
// Frame interval below 90% if desired time is not allowed, try inserting
// frame just before this limit.
- const int64_t kMinFrameInterval = (kTimestampDelta5Fps * 9) / 10;
+ const int64_t kMinFrameInterval = (kTimestampDelta5Fps * 85) / 100;
timestamp_ += kMinFrameInterval - 90;
EXPECT_TRUE(UpdateLayerConfig(timestamp_).drop_frame);
diff --git a/chromium/third_party/webrtc/pc/peerconnection.h b/chromium/third_party/webrtc/pc/peerconnection.h
index d86f2975b32..705fff50014 100644
--- a/chromium/third_party/webrtc/pc/peerconnection.h
+++ b/chromium/third_party/webrtc/pc/peerconnection.h
@@ -922,7 +922,7 @@ class PeerConnection : public PeerConnectionInterface,
// will refer to the same reference count.
rtc::scoped_refptr<PeerConnectionFactory> factory_;
PeerConnectionObserver* observer_ = nullptr;
- UMAObserver* uma_observer_ = nullptr;
+ rtc::scoped_refptr<UMAObserver> uma_observer_ = nullptr;
// The EventLog needs to outlive |call_| (and any other object that uses it).
std::unique_ptr<RtcEventLog> event_log_;
diff --git a/chromium/third_party/webrtc/pc/rtcstatscollector.cc b/chromium/third_party/webrtc/pc/rtcstatscollector.cc
index 10bb605f499..81476435ed1 100644
--- a/chromium/third_party/webrtc/pc/rtcstatscollector.cc
+++ b/chromium/third_party/webrtc/pc/rtcstatscollector.cc
@@ -519,10 +519,25 @@ void ProduceSenderMediaTrackStats(
static_cast<AudioTrackInterface*>(sender->track().get());
if (!track)
continue;
- auto voice_sender_info =
- track_media_info_map.GetVoiceSenderInfoBySsrc(sender->ssrc());
- RTC_CHECK(voice_sender_info)
- << "No voice sender info for sender with ssrc " << sender->ssrc();
+ cricket::VoiceSenderInfo null_sender_info;
+ const cricket::VoiceSenderInfo* voice_sender_info = &null_sender_info;
+ // TODO(hta): Checking on ssrc is not proper. There should be a way
+ // to see from a sender whether it's connected or not.
+ // Related to https://crbug.com/8694 (using ssrc 0 to indicate "none")
+ if (sender->ssrc()) {
+ // When pc.close is called, sender info is discarded, so
+ // we generate zeroes instead. Bug: It should be retained.
+ // https://crbug.com/807174
+ auto sender_info =
+ track_media_info_map.GetVoiceSenderInfoBySsrc(sender->ssrc());
+ if (sender_info) {
+ voice_sender_info = sender_info;
+ } else {
+ RTC_LOG(LS_INFO)
+ << "RTCStatsCollector: No voice sender info for sender with ssrc "
+ << sender->ssrc();
+ }
+ }
std::unique_ptr<RTCMediaStreamTrackStats> audio_track_stats =
ProduceMediaStreamTrackStatsFromVoiceSenderInfo(
timestamp_us, *track, *voice_sender_info, sender->AttachmentId());
@@ -532,10 +547,24 @@ void ProduceSenderMediaTrackStats(
static_cast<VideoTrackInterface*>(sender->track().get());
if (!track)
continue;
- auto video_sender_info =
- track_media_info_map.GetVideoSenderInfoBySsrc(sender->ssrc());
- RTC_CHECK(video_sender_info)
- << "No video sender info for sender with ssrc " << sender->ssrc();
+ cricket::VideoSenderInfo null_sender_info;
+ const cricket::VideoSenderInfo* video_sender_info = &null_sender_info;
+ // TODO(hta): Check on state not ssrc when state is available
+ // Related to https://bugs.webrtc.org/8694 (using ssrc 0 to indicate
+ // "none")
+ if (sender->ssrc()) {
+ // When pc.close is called, sender info is discarded, so
+ // we generate zeroes instead. Bug: It should be retained.
+ // https://crbug.com/807174
+ auto sender_info =
+ track_media_info_map.GetVideoSenderInfoBySsrc(sender->ssrc());
+ if (sender_info) {
+ video_sender_info = sender_info;
+ } else {
+ RTC_LOG(LS_INFO) << "No video sender info for sender with ssrc "
+ << sender->ssrc();
+ }
+ }
std::unique_ptr<RTCMediaStreamTrackStats> video_track_stats =
ProduceMediaStreamTrackStatsFromVideoSenderInfo(
timestamp_us, *track, *video_sender_info, sender->AttachmentId());
diff --git a/chromium/third_party/webrtc/pc/rtcstatscollector_unittest.cc b/chromium/third_party/webrtc/pc/rtcstatscollector_unittest.cc
index b77820fd215..8d4774a6145 100644
--- a/chromium/third_party/webrtc/pc/rtcstatscollector_unittest.cc
+++ b/chromium/third_party/webrtc/pc/rtcstatscollector_unittest.cc
@@ -2413,6 +2413,23 @@ TEST_F(RTCStatsCollectorTest, StatsNotReportedOnZeroSsrc) {
EXPECT_EQ(0, track_stats.size());
}
+TEST_F(RTCStatsCollectorTest, DoNotCrashOnSsrcChange) {
+ rtc::scoped_refptr<MediaStreamTrackInterface> track =
+ CreateFakeTrack(cricket::MEDIA_TYPE_AUDIO, "audioTrack",
+ MediaStreamTrackInterface::kLive);
+ rtc::scoped_refptr<MockRtpSender> sender =
+ CreateMockSender(track, 4711, 49, {});
+ EXPECT_CALL(test_->pc(), GetSenders())
+ .WillRepeatedly(
+ Return(std::vector<rtc::scoped_refptr<RtpSenderInterface>>(
+ {rtc::scoped_refptr<RtpSenderInterface>(sender.get())})));
+ // We do not generate any matching voice_sender_info stats.
+ rtc::scoped_refptr<const RTCStatsReport> report = GetStatsReport();
+ std::vector<const RTCMediaStreamTrackStats*> track_stats =
+ report->GetStatsOfType<RTCMediaStreamTrackStats>();
+ EXPECT_EQ(1, track_stats.size());
+}
+
class RTCStatsCollectorTestWithFakeCollector : public testing::Test {
public:
RTCStatsCollectorTestWithFakeCollector()
diff --git a/chromium/tools/metrics/histograms/enums.xml b/chromium/tools/metrics/histograms/enums.xml
index 483abf2be4a..85270091a38 100644
--- a/chromium/tools/metrics/histograms/enums.xml
+++ b/chromium/tools/metrics/histograms/enums.xml
@@ -5024,6 +5024,15 @@ uploading your change for review. These are checked by presubmit scripts.
<int value="5" label="View PDF button clicked in the PDF plugin placeholder"/>
</enum>
+<enum name="ChromePrimaryAccountStateInGaiaCookies">
+ <int value="0" label="No Chrome primary account."/>
+ <int value="1"
+ label="Chrome primary account is the first account in Gaia cookies."/>
+ <int value="2"
+ label="Chrome primary account is another account in Gaia cookies."/>
+ <int value="3" label="Chrome primary account is not in Gaia cookies."/>
+</enum>
+
<enum name="ChromiumAndroidLinkerBrowserState">
<int value="0" label="Normal, Random Address Load"/>
<int value="1" label="Low memory, Fixed Address Load Success"/>
@@ -12474,6 +12483,7 @@ Called by update_net_error_codes.py.-->
<int value="408" label="SpellcheckEnabled"/>
<int value="409" label="AdsSettingForIntrusiveAdsSites"/>
<int value="410" label="RestrictAccountsToPatterns"/>
+ <int value="414" label="WebDriverOverridesIncompatiblePolicies"/>
</enum>
<enum name="EnterprisePolicyInvalidations">
@@ -14599,6 +14609,7 @@ Called by update_net_error_codes.py.-->
<int value="1209" label="CRYPTOTOKENPRIVATE_ISAPPIDHASHINENTERPRISECONTEXT"/>
<int value="1210" label="CRYPTOTOKENPRIVATE_CANAPPIDGETATTESTATION"/>
<int value="1211" label="SYSTEM_DISPLAY_SETMIRRORMODE"/>
+ <int value="1216" label="ACCESSIBILITY_PRIVATE_SENDSYNTHETICKEYEVENT"/>
</enum>
<enum name="ExtensionIconState">
@@ -25774,6 +25785,7 @@ from previous Chrome versions.
<int value="-684223908" label="enable-android-wallpapers-app"/>
<int value="-680787130" label="ExperimentalVRFeatures:disabled"/>
<int value="-680589442" label="MacRTL:disabled"/>
+ <int value="-674804217" label="SoleIntegration:enabled"/>
<int value="-671992446" label="TranslateRankerEnforcement:disabled"/>
<int value="-670188266" label="enable-zip-archiver-unpacker"/>
<int value="-667517406" label="overscroll-history-navigation"/>
@@ -26253,6 +26265,7 @@ from previous Chrome versions.
<int value="636425179" label="mhtml-generator-option"/>
<int value="637396292" label="AllBookmarks:enabled"/>
<int value="637452937" label="ChromeHomeSurvey:enabled"/>
+ <int value="642037198" label="SoleIntegration:disabled"/>
<int value="643725031" label="disable-touch-feedback"/>
<int value="644189071" label="PermissionsBlacklist:enabled"/>
<int value="646252875" label="ReadItLaterInMenu:enabled"/>
@@ -28035,6 +28048,11 @@ Called by update_use_counter_css.py.-->
<int value="21" label="Gesture requirement overridden by play method."/>
</enum>
+<enum name="MediaEngagementSessionEvent">
+ <int value="0" label="Created"/>
+ <int value="1" label="Significant Playback"/>
+</enum>
+
<enum name="MediaGalleriesUsageType">
<int value="0" label="Gallery added from permission dialog"/>
<int value="1" label="Gallery permission added from permission dialog"/>
@@ -32761,6 +32779,7 @@ Called by update_net_trust_anchors.py.-->
<int value="14" label="Invalid order - first paint / first image paint"/>
<int value="15" label="Invalid order - first paint / first contentful paint"/>
<int value="16" label="Invalid order - first paint / first meaningful paint"/>
+ <int value="17" label="Invalid order - first meaningful paint / interactive"/>
</enum>
<enum name="PageScaleFactorRange">
@@ -39340,9 +39359,12 @@ Called by update_net_trust_anchors.py.-->
<enum name="SigninDiceResponseHeader">
<int value="0" label="Signin"/>
<int value="1" label="SignoutPrimary">
- Signout including the primary account.
+ Signout including the Chrome primary account.
+ </int>
+ <int value="2" label="SignoutSecondary">
+ Signout not including the Chrome primary accounts.
</int>
- <int value="2" label="SignoutSecondary">Signout only secondary accounts.</int>
+ <int value="3" label="EnableSync">Enable Sync after signin.</int>
</enum>
<enum name="SigninDiceTokenFetchResult">
diff --git a/chromium/tools/metrics/histograms/histograms.xml b/chromium/tools/metrics/histograms/histograms.xml
index 45f9449bdb5..46d88ec9434 100644
--- a/chromium/tools/metrics/histograms/histograms.xml
+++ b/chromium/tools/metrics/histograms/histograms.xml
@@ -30935,6 +30935,35 @@ http://cs/file:chrome/histograms.xml - but prefer this file for new entries.
</summary>
</histogram>
+<histogram
+ name="InstantTethering.GattConnectionAttempt.EffectiveSuccessRateWithRetries"
+ enum="BooleanSuccess">
+ <owner>hansberry@chromium.org</owner>
+ <summary>
+ Captures the effective count of successful and failed GATT connection
+ attempts, including retries. This means that if a GATT connection attempt
+ fails but then succeeds on a future retry, this is counted as a single
+ success. In the context of this metric, a failure represents a GATT failure
+ in all retry attempts.
+
+ An individual attempt is considered successful if a GATT connection was
+ created and authenticated successfully (i.e., the connection was ready for
+ Instant Tethering to exchange protocol messages).
+ </summary>
+</histogram>
+
+<histogram name="InstantTethering.GattConnectionAttempt.SuccessRate"
+ enum="BooleanSuccess">
+ <owner>hansberry@chromium.org</owner>
+ <summary>
+ Captures the count of successful and failed GATT connection attempts.
+
+ An attempt is considered successful if a GATT connection was created and
+ authenticated successfully (i.e., the connection was ready for Instant
+ Tethering to exchange protocol messages).
+ </summary>
+</histogram>
+
<histogram name="InstantTethering.HostScanBatchDuration" units="ms">
<owner>hansberry@chromium.org</owner>
<summary>
@@ -33262,6 +33291,10 @@ http://cs/file:chrome/histograms.xml - but prefer this file for new entries.
<histogram name="Media.Audio.InputDevicePropertyChangedMac"
enum="AudioDevicePropertyResult">
+ <obsolete>
+ Deprecated Feb 2018. Was put in place to debug missing callback issues that
+ have since been resolved.
+ </obsolete>
<owner>henrika@chromium.org</owner>
<summary>
Lists device properties that have been changed during an audio input stream
@@ -33273,6 +33306,10 @@ http://cs/file:chrome/histograms.xml - but prefer this file for new entries.
<histogram name="Media.Audio.InputDevicePropertyChangedStartupFailedMac"
enum="AudioDevicePropertyResult">
+ <obsolete>
+ Deprecated Feb 2018. Was put in place to debug missing callback issues that
+ have since been resolved.
+ </obsolete>
<owner>henrika@chromium.org</owner>
<summary>
Lists device properties that have been changed during an audio input stream
@@ -34635,6 +34672,28 @@ http://cs/file:chrome/histograms.xml - but prefer this file for new entries.
</summary>
</histogram>
+<histogram name="Media.Engagement.Session" enum="MediaEngagementSessionEvent">
+ <owner>mlamouri@chromium.org</owner>
+ <owner>media-dev@chromium.org</owner>
+ <summary>
+ Records creation and playback status of a Media Engagement Session. This is
+ recorded at the same time as the data is commited into the content settings
+ database.
+ </summary>
+</histogram>
+
+<histogram name="Media.Engagement.Session.Restored"
+ enum="MediaEngagementSessionEvent">
+ <owner>mlamouri@chromium.org</owner>
+ <owner>media-dev@chromium.org</owner>
+ <summary>
+ Records creation and playback status of a restored Media Engagement Session.
+ This is recorded at the same time as the data is commited into the content
+ settings database. Restored information are recorded in addition of regular
+ ones (Media.Engagement.Session).
+ </summary>
+</histogram>
+
<histogram
name="Media.Engagement.SignificantPlayers.PlayerNotAdded.AfterFirstTime"
enum="InsignificantPlaybackReason">
@@ -81727,6 +81786,17 @@ http://cs/file:chrome/histograms.xml - but prefer this file for new entries.
</summary>
</histogram>
+<histogram name="Signin.ChromePrimaryAccountStateOnWebSignout"
+ enum="ChromePrimaryAccountStateInGaiaCookies">
+ <owner>droger@chromium.org</owner>
+ <summary>
+ Logs the state of the Chrome account when the user signs out on the web.
+ This assumes that a logout of the web is always a complete logout of all the
+ web accounts (e.g. single session signout is not supported). TODO(droger):
+ make this histogram obsolete when Dice is launched.
+ </summary>
+</histogram>
+
<histogram name="Signin.CookieJar.ChromeAccountRelation" enum="AccountRelation">
<owner>skym@chromium.org</owner>
<summary>
@@ -100833,6 +100903,14 @@ http://cs/file:chrome/histograms.xml - but prefer this file for new entries.
</summary>
</histogram>
+<histogram name="Windows.HasHighResolutionTimeTicks" enum="Boolean">
+ <owner>gab@chromium.org</owner>
+ <summary>
+ The value of TimeTicks::IsHighResolution(). Reported once per browser
+ session, on startup.
+ </summary>
+</histogram>
+
<histogram name="Windows.HighResolutionTimerUsage" units="%">
<owner>stanisc@chromium.org</owner>
<summary>
@@ -101562,7 +101640,9 @@ http://cs/file:chrome/histograms.xml - but prefer this file for new entries.
</histogram_suffixes>
<histogram_suffixes name="AppUIComponent" separator=".">
+ <suffix name="Desktop" label="Desktop"/>
<suffix name="SearchResult" label="Launcher App Search Result"/>
+ <suffix name="Shelf" label="Shelf"/>
<suffix name="ShelfButton" label="ShelfButton"/>
<suffix name="SuggestedAppPeeking" label="Suggested App, Peeking Launcher"/>
<suffix name="SuggestedAppFullscreen"
diff --git a/chromium/ui/arc/notification/arc_notification_surface_impl.cc b/chromium/ui/arc/notification/arc_notification_surface_impl.cc
index 4040e59816c..2ebf0ef1904 100644
--- a/chromium/ui/arc/notification/arc_notification_surface_impl.cc
+++ b/chromium/ui/arc/notification/arc_notification_surface_impl.cc
@@ -30,7 +30,13 @@ class CustomWindowDelegate : public aura::WindowDelegate {
void OnBoundsChanged(const gfx::Rect& old_bounds,
const gfx::Rect& new_bounds) override {}
gfx::NativeCursor GetCursor(const gfx::Point& point) override {
- return notification_surface_->GetCursor(point);
+ views::Widget* widget = views::Widget::GetTopLevelWidgetForNativeView(
+ notification_surface_->host_window());
+ // Exo explicitly update the cursor on widget, so just use the one
+ // set on the cursor.
+ if (widget)
+ return widget->GetNativeWindow()->GetCursor(point /* not used */);
+ return ui::CursorType::kNull;
}
int GetNonClientComponent(const gfx::Point& point) const override {
return HTNOWHERE;
diff --git a/chromium/ui/base/ui_features.gni b/chromium/ui/base/ui_features.gni
index eedf40a7900..708a8f86fd8 100644
--- a/chromium/ui/base/ui_features.gni
+++ b/chromium/ui/base/ui_features.gni
@@ -20,6 +20,11 @@ declare_args() {
# Set to true to if mus (aka the UI service) is enabled. Use --mus (or --mash
# in chrome code) to start in mus/mash.
enable_mus = is_chromeos
+
+ # Optimize parts of Chrome's UI written with web technologies (HTML/CSS/JS)
+ # for runtime performance purposes. This does more work at compile time for
+ # speed benefits at runtime (so we skip in debug builds).
+ optimize_webui = !is_debug
}
enable_hidpi = is_mac || is_win || is_linux
diff --git a/chromium/ui/display/manager/display_manager.cc b/chromium/ui/display/manager/display_manager.cc
index cf3c645a2f2..fc1d98157ac 100644
--- a/chromium/ui/display/manager/display_manager.cc
+++ b/chromium/ui/display/manager/display_manager.cc
@@ -867,17 +867,17 @@ void DisplayManager::OnNativeDisplaysChanged(
[](const ManagedDisplayInfo& display_info) {
return display_info.id();
});
- multi_display_mode_ = (base::CommandLine::ForCurrentProcess()->HasSwitch(
- ::switches::kEnableSoftwareMirroring) ||
- ShouldSetMirrorModeOn(list))
- ? MIRRORING
- : EXTENDED;
+ bool should_enable_software_mirroring =
+ base::CommandLine::ForCurrentProcess()->HasSwitch(
+ ::switches::kEnableSoftwareMirroring) ||
+ ShouldSetMirrorModeOn(list);
+ SetSoftwareMirroring(should_enable_software_mirroring);
}
#endif
// Do not clear current mirror state before calling ShouldSetMirrorModeOn()
// as it depends on the state.
- software_mirroring_display_list_.clear();
+ ClearMirroringSourceAndDestination();
hardware_mirroring_display_id_list_ = hardware_mirroring_display_id_list;
mirroring_source_id_ = mirroring_source_id;
num_connected_displays_ = updated_displays.size();
@@ -1517,7 +1517,6 @@ void DisplayManager::SetDefaultMultiDisplayModeForCurrentDisplays(
void DisplayManager::SetMultiDisplayMode(MultiDisplayMode mode) {
multi_display_mode_ = mode;
- ClearMirroringSourceAndDestination();
}
void DisplayManager::ReconfigureDisplays() {
diff --git a/chromium/ui/gfx/native_pixmap_handle.cc b/chromium/ui/gfx/native_pixmap_handle.cc
index d13952dbce9..35b95b8e639 100644
--- a/chromium/ui/gfx/native_pixmap_handle.cc
+++ b/chromium/ui/gfx/native_pixmap_handle.cc
@@ -5,11 +5,18 @@
#include "ui/gfx/native_pixmap_handle.h"
#if defined(OS_LINUX)
+#include <drm_fourcc.h>
#include "base/posix/eintr_wrapper.h"
#endif
namespace gfx {
+#if defined(OS_LINUX)
+static_assert(NativePixmapPlane::kNoModifier == DRM_FORMAT_MOD_INVALID,
+ "gfx::NativePixmapPlane::kNoModifier should be an alias for"
+ "DRM_FORMAT_MOD_INVALID");
+#endif
+
NativePixmapPlane::NativePixmapPlane()
: stride(0), offset(0), size(0), modifier(0) {}
diff --git a/chromium/ui/gfx/native_pixmap_handle.h b/chromium/ui/gfx/native_pixmap_handle.h
index b4210dc9e39..f34d798f547 100644
--- a/chromium/ui/gfx/native_pixmap_handle.h
+++ b/chromium/ui/gfx/native_pixmap_handle.h
@@ -22,8 +22,16 @@ namespace gfx {
// NativePixmapPlane is used to carry the plane related information for GBM
// buffer. More fields can be added if they are plane specific.
struct GFX_EXPORT NativePixmapPlane {
+ // This is the same value as DRM_FORMAT_MOD_INVALID, which is not a valid
+ // modifier. We use this to indicate that layout information
+ // (tiling/compression) if any will be communicated out of band.
+ static constexpr uint64_t kNoModifier = 0x00ffffffffffffffULL;
+
NativePixmapPlane();
- NativePixmapPlane(int stride, int offset, uint64_t size, uint64_t modifier);
+ NativePixmapPlane(int stride,
+ int offset,
+ uint64_t size,
+ uint64_t modifier = kNoModifier);
NativePixmapPlane(const NativePixmapPlane& other);
~NativePixmapPlane();
diff --git a/chromium/ui/gl/gl_image_native_pixmap.cc b/chromium/ui/gl/gl_image_native_pixmap.cc
index 7e17cf32bff..2c397340386 100644
--- a/chromium/ui/gl/gl_image_native_pixmap.cc
+++ b/chromium/ui/gl/gl_image_native_pixmap.cc
@@ -217,7 +217,8 @@ bool GLImageNativePixmap::Initialize(gfx::NativePixmap* pixmap,
attrs.push_back(pixmap->GetDmaBufOffset(pixmap_plane));
attrs.push_back(EGL_DMA_BUF_PLANE0_PITCH_EXT + attrs_plane * 3);
attrs.push_back(pixmap->GetDmaBufPitch(pixmap_plane));
- if (has_dma_buf_import_modifier) {
+ if (has_dma_buf_import_modifier &&
+ pixmap->GetDmaBufModifier(0) != gfx::NativePixmapPlane::kNoModifier) {
uint64_t modifier = pixmap->GetDmaBufModifier(pixmap_plane);
DCHECK(attrs_plane < arraysize(kLinuxDrmModifiers));
attrs.push_back(kLinuxDrmModifiers[attrs_plane]);
diff --git a/chromium/ui/ozone/platform/drm/gpu/drm_device.cc b/chromium/ui/ozone/platform/drm/gpu/drm_device.cc
index 95a473a5408..9fd0bd15bc8 100644
--- a/chromium/ui/ozone/platform/drm/gpu/drm_device.cc
+++ b/chromium/ui/ozone/platform/drm/gpu/drm_device.cc
@@ -365,6 +365,10 @@ bool DrmDevice::Initialize(bool use_atomic) {
return false;
}
+ uint64_t value;
+ allow_addfb2_modifiers_ =
+ GetCapability(DRM_CAP_ADDFB2_MODIFIERS, &value) && value;
+
watcher_.reset(
new IOWatcher(file_.GetPlatformFile(), page_flip_manager_.get()));
diff --git a/chromium/ui/ozone/platform/drm/gpu/drm_device.h b/chromium/ui/ozone/platform/drm/gpu/drm_device.h
index 4e197848279..af32dfb1604 100644
--- a/chromium/ui/ozone/platform/drm/gpu/drm_device.h
+++ b/chromium/ui/ozone/platform/drm/gpu/drm_device.h
@@ -50,6 +50,8 @@ class DrmDevice : public base::RefCountedThreadSafe<DrmDevice> {
bool is_primary_device() const { return is_primary_device_; }
+ bool allow_addfb2_modifiers() const { return allow_addfb2_modifiers_; }
+
// Open device.
virtual bool Initialize(bool use_atomic);
@@ -206,6 +208,8 @@ class DrmDevice : public base::RefCountedThreadSafe<DrmDevice> {
bool is_primary_device_;
+ bool allow_addfb2_modifiers_;
+
DISALLOW_COPY_AND_ASSIGN(DrmDevice);
};
diff --git a/chromium/ui/ozone/platform/drm/gpu/gbm_buffer.cc b/chromium/ui/ozone/platform/drm/gpu/gbm_buffer.cc
index 788e5231b59..17948261354 100644
--- a/chromium/ui/ozone/platform/drm/gpu/gbm_buffer.cc
+++ b/chromium/ui/ozone/platform/drm/gpu/gbm_buffer.cc
@@ -5,6 +5,7 @@
#include "ui/ozone/platform/drm/gpu/gbm_buffer.h"
#include <drm.h>
+#include <drm_fourcc.h>
#include <fcntl.h>
#include <gbm.h>
#include <xf86drm.h>
@@ -33,7 +34,6 @@ GbmBuffer::GbmBuffer(const scoped_refptr<GbmDevice>& gbm,
uint32_t format,
uint32_t flags,
uint64_t modifier,
- uint32_t addfb_flags,
std::vector<base::ScopedFD>&& fds,
const gfx::Size& size,
@@ -61,7 +61,7 @@ GbmBuffer::GbmBuffer(const scoped_refptr<GbmDevice>& gbm,
handles[i] = gbm_bo_get_plane_handle(bo, i).u32;
strides[i] = gbm_bo_get_plane_stride(bo, i);
offsets[i] = gbm_bo_get_plane_offset(bo, i);
- if (addfb_flags & DRM_MODE_FB_MODIFIERS)
+ if (modifier != DRM_FORMAT_MOD_INVALID)
modifiers[i] = modifier;
}
@@ -69,6 +69,9 @@ GbmBuffer::GbmBuffer(const scoped_refptr<GbmDevice>& gbm,
// DRM_MODE_FB_MODIFIERS set. We only set that when we've created
// a bo with modifiers, otherwise, we rely on the "no modifiers"
// behavior doing the right thing.
+ const uint32_t addfb_flags =
+ gbm->allow_addfb2_modifiers() &&
+ modifier != DRM_FORMAT_MOD_INVALID ? DRM_MODE_FB_MODIFIERS : 0;
bool ret = drm_->AddFramebuffer2(
gbm_bo_get_width(bo), gbm_bo_get_height(bo), framebuffer_pixel_format_,
handles, strides, offsets, modifiers, &framebuffer_, addfb_flags);
@@ -187,13 +190,12 @@ scoped_refptr<GbmBuffer> GbmBuffer::CreateBufferForBO(
gbm_bo* bo,
uint32_t format,
const gfx::Size& size,
- uint32_t flags,
- uint64_t modifier,
- uint32_t addfb_flags) {
+ uint32_t flags) {
DCHECK(bo);
std::vector<base::ScopedFD> fds;
std::vector<gfx::NativePixmapPlane> planes;
+ const uint64_t modifier = gbm_bo_get_format_modifier(bo);
for (size_t i = 0; i < gbm_bo_get_num_planes(bo); ++i) {
// The fd returned by gbm_bo_get_fd is not ref-counted and need to be
// kept open for the lifetime of the buffer.
@@ -210,13 +212,13 @@ scoped_refptr<GbmBuffer> GbmBuffer::CreateBufferForBO(
fds.emplace_back(std::move(fd));
}
- planes.emplace_back(
- gbm_bo_get_plane_stride(bo, i), gbm_bo_get_plane_offset(bo, i),
- gbm_bo_get_plane_size(bo, i), gbm_bo_get_plane_format_modifier(bo, i));
+ planes.emplace_back(gbm_bo_get_plane_stride(bo, i),
+ gbm_bo_get_plane_offset(bo, i),
+ gbm_bo_get_plane_size(bo, i), modifier);
}
- scoped_refptr<GbmBuffer> buffer(
- new GbmBuffer(gbm, bo, format, flags, modifier, addfb_flags,
- std::move(fds), size, std::move(planes)));
+ scoped_refptr<GbmBuffer> buffer(new GbmBuffer(gbm, bo, format, flags,
+ modifier, std::move(fds), size,
+ std::move(planes)));
if (flags & GBM_BO_USE_SCANOUT && !buffer->GetFramebufferId())
return nullptr;
@@ -239,9 +241,7 @@ scoped_refptr<GbmBuffer> GbmBuffer::CreateBufferWithModifiers(
if (!bo)
return nullptr;
- return CreateBufferForBO(gbm, bo, format, size, flags,
- gbm_bo_get_format_modifier(bo),
- DRM_MODE_FB_MODIFIERS);
+ return CreateBufferForBO(gbm, bo, format, size, flags);
}
// static
@@ -258,8 +258,7 @@ scoped_refptr<GbmBuffer> GbmBuffer::CreateBuffer(
if (!bo)
return nullptr;
- return CreateBufferForBO(gbm, bo, format, size, flags,
- gbm_bo_get_format_modifier(bo), 0);
+ return CreateBufferForBO(gbm, bo, format, size, flags);
}
// static
@@ -304,9 +303,9 @@ scoped_refptr<GbmBuffer> GbmBuffer::CreateBufferFromFds(
}
}
- scoped_refptr<GbmBuffer> buffer(new GbmBuffer(gbm, bo, format, gbm_flags, 0,
- 0, std::move(fds), size,
- std::move(planes)));
+ scoped_refptr<GbmBuffer> buffer(
+ new GbmBuffer(gbm, bo, format, gbm_flags, planes[0].modifier,
+ std::move(fds), size, std::move(planes)));
return buffer;
}
diff --git a/chromium/ui/ozone/platform/drm/gpu/gbm_buffer.h b/chromium/ui/ozone/platform/drm/gpu/gbm_buffer.h
index 4891b8f1a4e..984e7df6afd 100644
--- a/chromium/ui/ozone/platform/drm/gpu/gbm_buffer.h
+++ b/chromium/ui/ozone/platform/drm/gpu/gbm_buffer.h
@@ -69,7 +69,6 @@ class GbmBuffer : public ScanoutBuffer {
uint32_t format,
uint32_t flags,
uint64_t modifier,
- uint32_t addfb_flags,
std::vector<base::ScopedFD>&& fds,
const gfx::Size& size,
const std::vector<gfx::NativePixmapPlane>&& planes);
@@ -80,9 +79,7 @@ class GbmBuffer : public ScanoutBuffer {
gbm_bo* bo,
uint32_t format,
const gfx::Size& size,
- uint32_t flags,
- uint64_t modifiers,
- uint32_t addfb_flags);
+ uint32_t flags);
scoped_refptr<GbmDevice> drm_;
gbm_bo* bo_;
diff --git a/chromium/ui/resources/BUILD.gn b/chromium/ui/resources/BUILD.gn
index ac466919afc..8286ba501b5 100644
--- a/chromium/ui/resources/BUILD.gn
+++ b/chromium/ui/resources/BUILD.gn
@@ -5,6 +5,7 @@
import("//build/config/jumbo.gni")
import("//tools/grit/grit_rule.gni")
import("//tools/grit/repack.gni")
+import("//ui/base/ui_features.gni")
group("resources") {
public_deps = [
@@ -35,6 +36,7 @@ grit("ui_unscaled_resources_grd") {
}
grit("webui_resources_grd") {
+ defines = [ "optimize_webui=$optimize_webui" ]
source = "../webui/resources/webui_resources.grd"
# The .grd contains references to generated files.
diff --git a/chromium/ui/webui/resources/cr_components/chromeos/network/network_config.html b/chromium/ui/webui/resources/cr_components/chromeos/network/network_config.html
index e69e3779d34..5902a64a662 100644
--- a/chromium/ui/webui/resources/cr_components/chromeos/network/network_config.html
+++ b/chromium/ui/webui/resources/cr_components/chromeos/network/network_config.html
@@ -155,7 +155,8 @@
</template>
<!-- Share (WiFi and WiMAX) -->
- <template is="dom-if" if="[[shareIsVisible_(type)]]">
+ <template is="dom-if"
+ if="[[shareIsVisible_(guid, type, networkProperties)]]">
<div class="property-box">
<div id="shareLabel" class="start">[[i18n('networkConfigShare')]]</div>
<paper-toggle-button id="share" checked="{{shareNetwork_}}"
diff --git a/chromium/ui/webui/resources/cr_components/chromeos/network/network_config.js b/chromium/ui/webui/resources/cr_components/chromeos/network/network_config.js
index 89d0f3cf998..26c479f7e0b 100644
--- a/chromium/ui/webui/resources/cr_components/chromeos/network/network_config.js
+++ b/chromium/ui/webui/resources/cr_components/chromeos/network/network_config.js
@@ -365,7 +365,7 @@ Polymer({
this.error_ = '';
var propertiesToSet = this.getPropertiesToSet_();
- if (!this.guid || this.getSource_() == CrOnc.Source.NONE) {
+ if (this.getSource_() == CrOnc.Source.NONE) {
// New non VPN network configurations default to 'AutoConnect' unless
// prohibited by policy.
var prohibitAutoConnect = this.globalPolicy &&
@@ -411,6 +411,8 @@ Polymer({
* @return {!CrOnc.Source}
*/
getSource_: function() {
+ if (!this.guid)
+ return CrOnc.Source.NONE;
var source = this.networkProperties.Source;
return source ? /** @type {!CrOnc.Source} */ (source) : CrOnc.Source.NONE;
},
@@ -543,9 +545,9 @@ Polymer({
/** @private */
setShareNetwork_: function() {
- if (this.guid) {
+ var source = this.getSource_();
+ if (source != CrOnc.Source.NONE) {
// Configured networks can not change whether they are shared.
- var source = this.getSource_();
this.shareNetwork_ =
source == CrOnc.Source.DEVICE || source == CrOnc.Source.DEVICE_POLICY;
return;
@@ -1019,7 +1021,7 @@ Polymer({
* @private
*/
shareIsVisible_: function() {
- return !this.guid &&
+ return this.getSource_() == CrOnc.Source.NONE &&
(this.type == CrOnc.Type.WI_FI || this.type == CrOnc.Type.WI_MAX);
},
@@ -1179,8 +1181,11 @@ Polymer({
setVpnIPsecProperties_: function(propertiesToSet) {
var vpn = propertiesToSet.VPN;
assert(vpn.IPsec);
- if (vpn.IPsec.AuthenticationType == CrOnc.IPsecAuthenticationType.CERT)
+ if (vpn.IPsec.AuthenticationType == CrOnc.IPsecAuthenticationType.CERT) {
+ vpn.IPsec.ClientCertType = 'PKCS11Id';
vpn.IPsec.ClientCertPKCS11Id = this.getUserCertPkcs11Id_();
+ vpn.IPsec.ServerCAPEMs = this.getServerCaPems_();
+ }
vpn.IPsec.IKEVersion = 1;
vpn.IPsec.SaveCredentials = this.vpnSaveCredentials_;
vpn.L2TP.SaveCredentials = this.vpnSaveCredentials_;
diff --git a/chromium/ui/webui/resources/cr_components/chromeos/network/network_ip_config.js b/chromium/ui/webui/resources/cr_components/chromeos/network/network_ip_config.js
index 617486c40fe..de442adbaf3 100644
--- a/chromium/ui/webui/resources/cr_components/chromeos/network/network_ip_config.js
+++ b/chromium/ui/webui/resources/cr_components/chromeos/network/network_ip_config.js
@@ -101,8 +101,11 @@ Polymer({
CrOnc.getIPConfigForType(properties, CrOnc.IPType.IPV4));
var ipv6 = this.getIPConfigUIProperties_(
CrOnc.getIPConfigForType(properties, CrOnc.IPType.IPV6));
- if (ipv4 && !ipv6)
- ipv6 = {IPAddress: this.i18n('loading')};
+ if (properties.ConnectionState == CrOnc.ConnectionState.CONNECTED &&
+ ipv4 && ipv4.IPAddress) {
+ ipv6 = ipv6 || {};
+ ipv6.IPAddress = ipv6.IPAddress || this.i18n('loading');
+ }
this.ipConfig_ = {ipv4: ipv4, ipv6: ipv6};
} else {
this.ipConfig_ = null;
diff --git a/chromium/ui/webui/resources/cr_components/chromeos/network/network_nameservers.js b/chromium/ui/webui/resources/cr_components/chromeos/network/network_nameservers.js
index 82f4e685bfe..b9e9cf47da5 100644
--- a/chromium/ui/webui/resources/cr_components/chromeos/network/network_nameservers.js
+++ b/chromium/ui/webui/resources/cr_components/chromeos/network/network_nameservers.js
@@ -99,6 +99,7 @@ Polymer({
}
} else {
type = 'automatic';
+ nameservers = this.clearEmptyNameServers_(nameservers);
}
this.setNameservers_(type, nameservers, false /* send */);
},
@@ -213,13 +214,14 @@ Polymer({
field: 'NameServers',
value: this.GOOGLE_NAMESERVERS,
});
- } else {
- // automatic
+ } else { // type == automatic
// If not connected, properties will clear. Otherwise they may or may not
// change so leave them as-is.
if (this.networkProperties.ConnectionState !=
CrOnc.ConnectionState.CONNECTED) {
this.nameservers_ = [];
+ } else {
+ this.nameservers_ = this.clearEmptyNameServers_(this.nameservers_);
}
this.fire('nameservers-change', {
field: 'NameServersConfigType',
@@ -227,4 +229,13 @@ Polymer({
});
}
},
+
+ /**
+ * @param {!Array<string>} nameservers
+ * @return {!Array<string>}
+ * @private
+ */
+ clearEmptyNameServers_: function(nameservers) {
+ return nameservers.filter((nameserver) => !!nameserver);
+ },
});
diff --git a/chromium/ui/webui/resources/cr_components/chromeos/network/network_siminfo.html b/chromium/ui/webui/resources/cr_components/chromeos/network/network_siminfo.html
index b04b3732c50..45101bfbc39 100644
--- a/chromium/ui/webui/resources/cr_components/chromeos/network/network_siminfo.html
+++ b/chromium/ui/webui/resources/cr_components/chromeos/network/network_siminfo.html
@@ -90,7 +90,7 @@
on-close="onEnterPinDialogClose_">
<div slot="title">[[i18n('networkSimEnterPinTitle')]]</div>
<div slot="body">
- <network-config-input id="enterPin" password autofocus
+ <network-config-input id="enterPin" password
label="[[i18n('networkSimEnterPin')]]">
<iron-a11y-keys keys="enter" on-keys-pressed="sendEnterPin_">
</iron-a11y-keys>
@@ -100,7 +100,7 @@
</div>
</div>
<div slot="button-container">
- <paper-button on-tap="sendEnterPin_">
+ <paper-button on-tap="sendEnterPin_" disabled="[[inProgress_]]">
[[i18n('networkSimEnter')]]
</paper-button>
</div>
@@ -111,7 +111,7 @@
on-close="onChangePinDialogClose_">
<div slot="title">[[i18n('networkSimChangePinTitle')]]</div>
<div slot="body">
- <network-config-input id="changePinOld" password autofocus
+ <network-config-input id="changePinOld" password
label="[[i18n('networkSimEnterOldPin')]]">
</network-config-input>
<network-config-input id="changePinNew1" password
@@ -127,7 +127,7 @@
</div>
</div>
<div slot="button-container">
- <paper-button on-tap="sendChangePin_">
+ <paper-button on-tap="sendChangePin_" disabled="[[inProgress_]]">
[[i18n('networkSimChange')]]
</paper-button>
</div>
@@ -138,7 +138,7 @@
on-close="onUnlockPinDialogClose_">
<div slot="title">[[i18n('networkSimLockedTitle')]]</div>
<div slot="body">
- <network-config-input id="unlockPin" password autofocus
+ <network-config-input id="unlockPin" password
label="[[i18n('networkSimEnterPin')]]">
<iron-a11y-keys keys="enter" on-keys-pressed="sendUnlockPin_">
</iron-a11y-keys>
@@ -148,7 +148,7 @@
</div>
</div>
<div slot="button-container">
- <paper-button on-tap="sendUnlockPin_">
+ <paper-button on-tap="sendUnlockPin_" disabled="[[inProgress_]]">
[[i18n('networkSimUnlock')]]
</paper-button>
</div>
@@ -162,7 +162,7 @@
<div>
Enter the 8-digit PIN Unblocking Key provided by your carrier
</div>
- <network-config-input id="unlockPuk" password autofocus
+ <network-config-input id="unlockPuk" password
label="[[i18n('networkSimEnterPuk')]]">
</network-config-input>
<network-config-input id="unlockPin1" password
@@ -181,7 +181,7 @@
</div>
</div>
<div slot="button-container">
- <paper-button on-tap="sendUnlockPuk_">
+ <paper-button on-tap="sendUnlockPuk_" disabled="[[inProgress_]]">
[[i18n('networkSimUnlock')]]
</paper-button>
</div>
diff --git a/chromium/ui/webui/resources/cr_components/chromeos/network/network_siminfo.js b/chromium/ui/webui/resources/cr_components/chromeos/network/network_siminfo.js
index ed702897da8..668656ec4c4 100644
--- a/chromium/ui/webui/resources/cr_components/chromeos/network/network_siminfo.js
+++ b/chromium/ui/webui/resources/cr_components/chromeos/network/network_siminfo.js
@@ -63,6 +63,15 @@ Polymer({
},
/**
+ * Set to true when a SIM operation is in progress. Used to disable buttons.
+ * @private
+ */
+ inProgress_: {
+ type: Boolean,
+ value: false,
+ },
+
+ /**
* Set to an ErrorType value after an incorrect PIN or PUK entry.
* @private {ErrorType}
*/
@@ -178,6 +187,9 @@ Polymer({
this.error_ = ErrorType.NONE;
this.$.enterPin.value = '';
this.$.enterPinDialog.showModal();
+ requestAnimationFrame(() => {
+ this.$.enterPin.focus();
+ });
},
/**
@@ -197,7 +209,9 @@ Polymer({
currentPin: pin,
requirePin: this.sendSimLockEnabled_,
});
+ this.inProgress_ = true;
this.networkingPrivate.setCellularSimState(guid, simState, () => {
+ this.inProgress_ = false;
if (chrome.runtime.lastError) {
this.error_ = ErrorType.INCORRECT_PIN;
this.$.enterPin.inputElement.select();
@@ -223,6 +237,9 @@ Polymer({
this.$.changePinNew1.value = '';
this.$.changePinNew2.value = '';
this.$.changePinDialog.showModal();
+ requestAnimationFrame(() => {
+ this.$.changePinOld.focus();
+ });
},
/**
@@ -242,7 +259,9 @@ Polymer({
currentPin: this.$.changePinOld.value,
newPin: newPin
});
+ this.inProgress_ = true;
this.networkingPrivate.setCellularSimState(guid, simState, () => {
+ this.inProgress_ = false;
if (chrome.runtime.lastError) {
this.error_ = ErrorType.INCORRECT_PIN;
this.$.changePinOld.inputElement.select();
@@ -280,7 +299,9 @@ Polymer({
if (!this.validatePin_(pin))
return;
+ this.inProgress_ = true;
this.networkingPrivate.unlockCellularSim(guid, pin, '', () => {
+ this.inProgress_ = false;
if (chrome.runtime.lastError) {
this.error_ = ErrorType.INCORRECT_PIN;
this.$.unlockPin.inputElement.select();
@@ -297,6 +318,9 @@ Polymer({
this.error_ = ErrorType.NONE;
this.$.unlockPin.value = '';
this.$.unlockPinDialog.showModal();
+ requestAnimationFrame(() => {
+ this.$.unlockPin.focus();
+ });
},
/** @private */
@@ -306,6 +330,9 @@ Polymer({
this.$.unlockPin1.value = '';
this.$.unlockPin2.value = '';
this.$.unlockPukDialog.showModal();
+ requestAnimationFrame(() => {
+ this.$.unlockPuk.focus();
+ });
},
/**
@@ -323,7 +350,9 @@ Polymer({
if (!this.validatePin_(pin, this.$.unlockPin2.value))
return;
+ this.inProgress_ = true;
this.networkingPrivate.unlockCellularSim(guid, pin, puk, () => {
+ this.inProgress_ = false;
if (chrome.runtime.lastError) {
this.error_ = ErrorType.INCORRECT_PUK;
this.$.unlockPuk.inputElement.select();
diff --git a/chromium/ui/webui/resources/cr_components/cr_components_resources.grdp b/chromium/ui/webui/resources/cr_components/cr_components_resources.grdp
index 3b4e57cf3d1..1e198676684 100644
--- a/chromium/ui/webui/resources/cr_components/cr_components_resources.grdp
+++ b/chromium/ui/webui/resources/cr_components/cr_components_resources.grdp
@@ -96,8 +96,9 @@
type="chrome_html"
compress="gzip" />
</if>
- <if expr="chromeos">
- <!-- Chrome OS Custom Elements -->
+ <if expr="chromeos and not optimize_webui">
+ <!-- Chrome OS Custom Elements. When optimize_webui is true these are -->
+ <!-- vulcanized and are not included individually. -->
<structure name="IDR_WEBUI_CHROMEOS_BLUETOOTH_DIALOG_HTML"
file="cr_components/chromeos/bluetooth_dialog.html"
type="chrome_html"
diff --git a/chromium/v8/gypfiles/gyp_v8 b/chromium/v8/gypfiles/gyp_v8
index e419b5e89e7..5215f513525 100755
--- a/chromium/v8/gypfiles/gyp_v8
+++ b/chromium/v8/gypfiles/gyp_v8
@@ -108,19 +108,14 @@ def run_gyp(args):
if __name__ == '__main__':
args = sys.argv[1:]
- gyp_chromium_no_action = os.environ.get('GYP_CHROMIUM_NO_ACTION')
- if gyp_chromium_no_action == '1':
- print 'Skipping gyp_v8 due to GYP_CHROMIUM_NO_ACTION env var.'
+ gyp_chromium_no_action = os.environ.get('GYP_CHROMIUM_NO_ACTION', '1')
+ if gyp_chromium_no_action != '0':
+ print 'GYP is now disabled by default.\n'
+ print 'If you really want to run this, set the environment variable '
+ print 'GYP_CHROMIUM_NO_ACTION=0.'
sys.exit(0)
running_as_hook = '--running-as-hook'
- if running_as_hook in args and gyp_chromium_no_action != '0':
- print 'GYP is now disabled by default in runhooks.\n'
- print 'If you really want to run this, either run '
- print '`python gypfiles/gyp_v8` explicitly by hand '
- print 'or set the environment variable GYP_CHROMIUM_NO_ACTION=0.'
- sys.exit(0)
-
if running_as_hook in args:
args.remove(running_as_hook)
diff --git a/chromium/v8/include/v8-version.h b/chromium/v8/include/v8-version.h
index 92a887352c4..3d7bcda96a8 100644
--- a/chromium/v8/include/v8-version.h
+++ b/chromium/v8/include/v8-version.h
@@ -11,7 +11,7 @@
#define V8_MAJOR_VERSION 6
#define V8_MINOR_VERSION 5
#define V8_BUILD_NUMBER 254
-#define V8_PATCH_LEVEL 10
+#define V8_PATCH_LEVEL 21
// Use 1 for candidates and 0 otherwise.
// (Boolean macro values are not supported by all preprocessors.)
diff --git a/chromium/v8/src/api.cc b/chromium/v8/src/api.cc
index c671591c8a8..147cc397f22 100644
--- a/chromium/v8/src/api.cc
+++ b/chromium/v8/src/api.cc
@@ -7679,6 +7679,12 @@ void WasmModuleObjectBuilderStreaming::Abort(Local<Value> exception) {
if (promise->State() != v8::Promise::kPending) return;
if (i::FLAG_wasm_stream_compilation) streaming_decoder_->Abort();
+ // If there is no exception, then we do not reject the promise. The reason is
+ // that 'no exception' indicates that we are in a ScriptForbiddenScope, which
+ // means that it is not allowed to reject the promise at the moment, or
+ // execute any other JavaScript code.
+ if (exception.IsEmpty()) return;
+
Local<Promise::Resolver> resolver = promise.As<Promise::Resolver>();
i::Isolate* i_isolate = reinterpret_cast<i::Isolate*>(isolate_);
i::HandleScope scope(i_isolate);
diff --git a/chromium/v8/src/compiler/simplified-lowering.cc b/chromium/v8/src/compiler/simplified-lowering.cc
index 36c45d41941..6e6c011fc1e 100644
--- a/chromium/v8/src/compiler/simplified-lowering.cc
+++ b/chromium/v8/src/compiler/simplified-lowering.cc
@@ -2359,19 +2359,9 @@ class RepresentationSelector {
return;
}
case IrOpcode::kStringCodePointAt: {
- Type* string_type = TypeOf(node->InputAt(0));
- if (string_type->Is(Type::SeqString())) {
- VisitBinop(node, UseInfo::AnyTagged(), UseInfo::TruncatingWord32(),
- MachineRepresentation::kWord32);
- if (lower()) {
- NodeProperties::ChangeOp(node,
- simplified()->SeqStringCodePointAt());
- }
- } else {
- // TODO(turbofan): Allow builtins to return untagged values.
- VisitBinop(node, UseInfo::AnyTagged(), UseInfo::TruncatingWord32(),
- MachineRepresentation::kTaggedSigned);
- }
+ // TODO(turbofan): Allow builtins to return untagged values.
+ VisitBinop(node, UseInfo::AnyTagged(), UseInfo::TruncatingWord32(),
+ MachineRepresentation::kTaggedSigned);
return;
}
case IrOpcode::kStringFromCharCode: {
diff --git a/chromium/v8/src/compiler/x64/instruction-selector-x64.cc b/chromium/v8/src/compiler/x64/instruction-selector-x64.cc
index 2d32cc7daad..a0f14c687c8 100644
--- a/chromium/v8/src/compiler/x64/instruction-selector-x64.cc
+++ b/chromium/v8/src/compiler/x64/instruction-selector-x64.cc
@@ -109,7 +109,7 @@ class X64OperandGenerator final : public OperandGenerator {
DCHECK(scale_exponent >= 0 && scale_exponent <= 3);
inputs[(*input_count)++] = UseRegister(index);
if (displacement != nullptr) {
- inputs[(*input_count)++] = displacement_mode
+ inputs[(*input_count)++] = displacement_mode == kNegativeDisplacement
? UseNegatedImmediate(displacement)
: UseImmediate(displacement);
static const AddressingMode kMRnI_modes[] = {kMode_MR1I, kMode_MR2I,
@@ -717,6 +717,10 @@ bool TryMatchLoadWord64AndShiftRight(InstructionSelector* selector, Node* node,
}
inputs[input_count++] = ImmediateOperand(ImmediateOperand::INLINE, 4);
} else {
+ // In the case that the base address was zero, the displacement will be
+ // in a register and replacing it with an immediate is not allowed. This
+ // usually only happens in dead code anyway.
+ if (!inputs[input_count - 1].IsImmediate()) return false;
int32_t displacement = g.GetImmediateIntegerValue(mleft.displacement());
inputs[input_count - 1] =
ImmediateOperand(ImmediateOperand::INLINE, displacement + 4);
diff --git a/chromium/v8/src/frames.cc b/chromium/v8/src/frames.cc
index 73ac8f8f2ed..d5a04ad9330 100644
--- a/chromium/v8/src/frames.cc
+++ b/chromium/v8/src/frames.cc
@@ -1023,6 +1023,15 @@ JSFunction* JavaScriptFrame::function() const {
return JSFunction::cast(function_slot_object());
}
+Object* JavaScriptFrame::unchecked_function() const {
+ // During deoptimization of an optimized function, we may have yet to
+ // materialize some closures on the stack. The arguments marker object
+ // marks this case.
+ DCHECK(function_slot_object()->IsJSFunction() ||
+ isolate()->heap()->arguments_marker() == function_slot_object());
+ return function_slot_object();
+}
+
Object* JavaScriptFrame::receiver() const { return GetParameter(-1); }
Object* JavaScriptFrame::context() const {
diff --git a/chromium/v8/src/frames.h b/chromium/v8/src/frames.h
index 62b3e7a5c0c..0c988770f6f 100644
--- a/chromium/v8/src/frames.h
+++ b/chromium/v8/src/frames.h
@@ -704,6 +704,7 @@ class JavaScriptFrame : public StandardFrame {
// Accessors.
virtual JSFunction* function() const;
+ Object* unchecked_function() const;
Object* receiver() const override;
Object* context() const override;
Script* script() const override;
diff --git a/chromium/v8/src/globals.h b/chromium/v8/src/globals.h
index 4e25cd5a161..bc28181db19 100644
--- a/chromium/v8/src/globals.h
+++ b/chromium/v8/src/globals.h
@@ -98,7 +98,7 @@ namespace internal {
#endif
// Minimum stack size in KB required by compilers.
-const int kStackSpaceRequiredForCompilation = 40;
+constexpr int kStackSpaceRequiredForCompilation = 40;
// Determine whether double field unboxing feature is enabled.
#if V8_TARGET_ARCH_64_BIT
@@ -131,106 +131,106 @@ typedef byte* Address;
// -----------------------------------------------------------------------------
// Constants
-const int KB = 1024;
-const int MB = KB * KB;
-const int GB = KB * KB * KB;
-const int kMaxInt = 0x7FFFFFFF;
-const int kMinInt = -kMaxInt - 1;
-const int kMaxInt8 = (1 << 7) - 1;
-const int kMinInt8 = -(1 << 7);
-const int kMaxUInt8 = (1 << 8) - 1;
-const int kMinUInt8 = 0;
-const int kMaxInt16 = (1 << 15) - 1;
-const int kMinInt16 = -(1 << 15);
-const int kMaxUInt16 = (1 << 16) - 1;
-const int kMinUInt16 = 0;
-
-const uint32_t kMaxUInt32 = 0xFFFFFFFFu;
-const int kMinUInt32 = 0;
-
-const int kUInt8Size = sizeof(uint8_t);
-const int kCharSize = sizeof(char);
-const int kShortSize = sizeof(short); // NOLINT
-const int kUInt16Size = sizeof(uint16_t);
-const int kIntSize = sizeof(int);
-const int kInt32Size = sizeof(int32_t);
-const int kInt64Size = sizeof(int64_t);
-const int kUInt32Size = sizeof(uint32_t);
-const int kSizetSize = sizeof(size_t);
-const int kFloatSize = sizeof(float);
-const int kDoubleSize = sizeof(double);
-const int kIntptrSize = sizeof(intptr_t);
-const int kUIntptrSize = sizeof(uintptr_t);
-const int kPointerSize = sizeof(void*);
+constexpr int KB = 1024;
+constexpr int MB = KB * KB;
+constexpr int GB = KB * KB * KB;
+constexpr int kMaxInt = 0x7FFFFFFF;
+constexpr int kMinInt = -kMaxInt - 1;
+constexpr int kMaxInt8 = (1 << 7) - 1;
+constexpr int kMinInt8 = -(1 << 7);
+constexpr int kMaxUInt8 = (1 << 8) - 1;
+constexpr int kMinUInt8 = 0;
+constexpr int kMaxInt16 = (1 << 15) - 1;
+constexpr int kMinInt16 = -(1 << 15);
+constexpr int kMaxUInt16 = (1 << 16) - 1;
+constexpr int kMinUInt16 = 0;
+
+constexpr uint32_t kMaxUInt32 = 0xFFFFFFFFu;
+constexpr int kMinUInt32 = 0;
+
+constexpr int kUInt8Size = sizeof(uint8_t);
+constexpr int kCharSize = sizeof(char);
+constexpr int kShortSize = sizeof(short); // NOLINT
+constexpr int kUInt16Size = sizeof(uint16_t);
+constexpr int kIntSize = sizeof(int);
+constexpr int kInt32Size = sizeof(int32_t);
+constexpr int kInt64Size = sizeof(int64_t);
+constexpr int kUInt32Size = sizeof(uint32_t);
+constexpr int kSizetSize = sizeof(size_t);
+constexpr int kFloatSize = sizeof(float);
+constexpr int kDoubleSize = sizeof(double);
+constexpr int kIntptrSize = sizeof(intptr_t);
+constexpr int kUIntptrSize = sizeof(uintptr_t);
+constexpr int kPointerSize = sizeof(void*);
#if V8_TARGET_ARCH_X64 && V8_TARGET_ARCH_32_BIT
-const int kRegisterSize = kPointerSize + kPointerSize;
+constexpr int kRegisterSize = kPointerSize + kPointerSize;
#else
-const int kRegisterSize = kPointerSize;
+constexpr int kRegisterSize = kPointerSize;
#endif
-const int kPCOnStackSize = kRegisterSize;
-const int kFPOnStackSize = kRegisterSize;
+constexpr int kPCOnStackSize = kRegisterSize;
+constexpr int kFPOnStackSize = kRegisterSize;
#if V8_TARGET_ARCH_X64 || V8_TARGET_ARCH_IA32
-const int kElidedFrameSlots = kPCOnStackSize / kPointerSize;
+constexpr int kElidedFrameSlots = kPCOnStackSize / kPointerSize;
#else
-const int kElidedFrameSlots = 0;
+constexpr int kElidedFrameSlots = 0;
#endif
-const int kDoubleSizeLog2 = 3;
-const size_t kMaxWasmCodeMemory = 256 * MB;
+constexpr int kDoubleSizeLog2 = 3;
+constexpr size_t kMaxWasmCodeMemory = 256 * MB;
#if V8_HOST_ARCH_64_BIT
-const int kPointerSizeLog2 = 3;
-const intptr_t kIntptrSignBit =
+constexpr int kPointerSizeLog2 = 3;
+constexpr intptr_t kIntptrSignBit =
static_cast<intptr_t>(uintptr_t{0x8000000000000000});
-const uintptr_t kUintptrAllBitsSet = uintptr_t{0xFFFFFFFFFFFFFFFF};
-const bool kRequiresCodeRange = true;
+constexpr uintptr_t kUintptrAllBitsSet = uintptr_t{0xFFFFFFFFFFFFFFFF};
+constexpr bool kRequiresCodeRange = true;
#if V8_TARGET_ARCH_MIPS64
// To use pseudo-relative jumps such as j/jal instructions which have 28-bit
// encoded immediate, the addresses have to be in range of 256MB aligned
// region. Used only for large object space.
-const size_t kMaximalCodeRangeSize = 256 * MB;
-const size_t kCodeRangeAreaAlignment = 256 * MB;
+constexpr size_t kMaximalCodeRangeSize = 256 * MB;
+constexpr size_t kCodeRangeAreaAlignment = 256 * MB;
#elif V8_HOST_ARCH_PPC && V8_TARGET_ARCH_PPC && V8_OS_LINUX
-const size_t kMaximalCodeRangeSize = 512 * MB;
-const size_t kCodeRangeAreaAlignment = 64 * KB; // OS page on PPC Linux
+constexpr size_t kMaximalCodeRangeSize = 512 * MB;
+constexpr size_t kCodeRangeAreaAlignment = 64 * KB; // OS page on PPC Linux
#else
-const size_t kMaximalCodeRangeSize = 512 * MB;
-const size_t kCodeRangeAreaAlignment = 4 * KB; // OS page.
+constexpr size_t kMaximalCodeRangeSize = 512 * MB;
+constexpr size_t kCodeRangeAreaAlignment = 4 * KB; // OS page.
#endif
#if V8_OS_WIN
-const size_t kMinimumCodeRangeSize = 4 * MB;
-const size_t kReservedCodeRangePages = 1;
+constexpr size_t kMinimumCodeRangeSize = 4 * MB;
+constexpr size_t kReservedCodeRangePages = 1;
#else
-const size_t kMinimumCodeRangeSize = 3 * MB;
-const size_t kReservedCodeRangePages = 0;
+constexpr size_t kMinimumCodeRangeSize = 3 * MB;
+constexpr size_t kReservedCodeRangePages = 0;
#endif
#else
-const int kPointerSizeLog2 = 2;
-const intptr_t kIntptrSignBit = 0x80000000;
-const uintptr_t kUintptrAllBitsSet = 0xFFFFFFFFu;
+constexpr int kPointerSizeLog2 = 2;
+constexpr intptr_t kIntptrSignBit = 0x80000000;
+constexpr uintptr_t kUintptrAllBitsSet = 0xFFFFFFFFu;
#if V8_TARGET_ARCH_X64 && V8_TARGET_ARCH_32_BIT
// x32 port also requires code range.
-const bool kRequiresCodeRange = true;
-const size_t kMaximalCodeRangeSize = 256 * MB;
-const size_t kMinimumCodeRangeSize = 3 * MB;
-const size_t kCodeRangeAreaAlignment = 4 * KB; // OS page.
+constexpr bool kRequiresCodeRange = true;
+constexpr size_t kMaximalCodeRangeSize = 256 * MB;
+constexpr size_t kMinimumCodeRangeSize = 3 * MB;
+constexpr size_t kCodeRangeAreaAlignment = 4 * KB; // OS page.
#elif V8_HOST_ARCH_PPC && V8_TARGET_ARCH_PPC && V8_OS_LINUX
-const bool kRequiresCodeRange = false;
-const size_t kMaximalCodeRangeSize = 0 * MB;
-const size_t kMinimumCodeRangeSize = 0 * MB;
-const size_t kCodeRangeAreaAlignment = 64 * KB; // OS page on PPC Linux
+constexpr bool kRequiresCodeRange = false;
+constexpr size_t kMaximalCodeRangeSize = 0 * MB;
+constexpr size_t kMinimumCodeRangeSize = 0 * MB;
+constexpr size_t kCodeRangeAreaAlignment = 64 * KB; // OS page on PPC Linux
#else
-const bool kRequiresCodeRange = false;
-const size_t kMaximalCodeRangeSize = 0 * MB;
-const size_t kMinimumCodeRangeSize = 0 * MB;
-const size_t kCodeRangeAreaAlignment = 4 * KB; // OS page.
+constexpr bool kRequiresCodeRange = false;
+constexpr size_t kMaximalCodeRangeSize = 0 * MB;
+constexpr size_t kMinimumCodeRangeSize = 0 * MB;
+constexpr size_t kCodeRangeAreaAlignment = 4 * KB; // OS page.
#endif
-const size_t kReservedCodeRangePages = 0;
+constexpr size_t kReservedCodeRangePages = 0;
#endif
// Trigger an incremental GCs once the external memory reaches this limit.
-const int kExternalAllocationSoftLimit = 64 * MB;
+constexpr int kExternalAllocationSoftLimit = 64 * MB;
// Maximum object size that gets allocated into regular pages. Objects larger
// than that size are allocated in large object space and are never moved in
@@ -239,39 +239,39 @@ const int kExternalAllocationSoftLimit = 64 * MB;
// account.
//
// Current value: Page::kAllocatableMemory (on 32-bit arch) - 512 (slack).
-const int kMaxRegularHeapObjectSize = 507136;
+constexpr int kMaxRegularHeapObjectSize = 507136;
STATIC_ASSERT(kPointerSize == (1 << kPointerSizeLog2));
-const int kBitsPerByte = 8;
-const int kBitsPerByteLog2 = 3;
-const int kBitsPerPointer = kPointerSize * kBitsPerByte;
-const int kBitsPerInt = kIntSize * kBitsPerByte;
+constexpr int kBitsPerByte = 8;
+constexpr int kBitsPerByteLog2 = 3;
+constexpr int kBitsPerPointer = kPointerSize * kBitsPerByte;
+constexpr int kBitsPerInt = kIntSize * kBitsPerByte;
// IEEE 754 single precision floating point number bit layout.
-const uint32_t kBinary32SignMask = 0x80000000u;
-const uint32_t kBinary32ExponentMask = 0x7f800000u;
-const uint32_t kBinary32MantissaMask = 0x007fffffu;
-const int kBinary32ExponentBias = 127;
-const int kBinary32MaxExponent = 0xFE;
-const int kBinary32MinExponent = 0x01;
-const int kBinary32MantissaBits = 23;
-const int kBinary32ExponentShift = 23;
+constexpr uint32_t kBinary32SignMask = 0x80000000u;
+constexpr uint32_t kBinary32ExponentMask = 0x7f800000u;
+constexpr uint32_t kBinary32MantissaMask = 0x007fffffu;
+constexpr int kBinary32ExponentBias = 127;
+constexpr int kBinary32MaxExponent = 0xFE;
+constexpr int kBinary32MinExponent = 0x01;
+constexpr int kBinary32MantissaBits = 23;
+constexpr int kBinary32ExponentShift = 23;
// Quiet NaNs have bits 51 to 62 set, possibly the sign bit, and no
// other bits set.
-const uint64_t kQuietNaNMask = static_cast<uint64_t>(0xfff) << 51;
+constexpr uint64_t kQuietNaNMask = static_cast<uint64_t>(0xfff) << 51;
// Latin1/UTF-16 constants
// Code-point values in Unicode 4.0 are 21 bits wide.
// Code units in UTF-16 are 16 bits wide.
typedef uint16_t uc16;
typedef int32_t uc32;
-const int kOneByteSize = kCharSize;
-const int kUC16Size = sizeof(uc16); // NOLINT
+constexpr int kOneByteSize = kCharSize;
+constexpr int kUC16Size = sizeof(uc16); // NOLINT
// 128 bit SIMD value size.
-const int kSimd128Size = 16;
+constexpr int kSimd128Size = 16;
// Round up n to be a multiple of sz, where sz is a power of 2.
#define ROUND_UP(n, sz) (((n) + ((sz) - 1)) & ~((sz) - 1))
@@ -355,10 +355,10 @@ inline LanguageMode stricter_language_mode(LanguageMode mode1,
enum TypeofMode : int { INSIDE_TYPEOF, NOT_INSIDE_TYPEOF };
// This constant is used as an undefined value when passing source positions.
-const int kNoSourcePosition = -1;
+constexpr int kNoSourcePosition = -1;
// This constant is used to indicate missing deoptimization information.
-const int kNoDeoptimizationId = -1;
+constexpr int kNoDeoptimizationId = -1;
// Deoptimize bailout kind.
enum class DeoptimizeKind : uint8_t { kEager, kSoft, kLazy };
@@ -393,57 +393,53 @@ inline std::ostream& operator<<(std::ostream& os,
}
// Mask for the sign bit in a smi.
-const intptr_t kSmiSignMask = kIntptrSignBit;
+constexpr intptr_t kSmiSignMask = kIntptrSignBit;
-const int kObjectAlignmentBits = kPointerSizeLog2;
-const intptr_t kObjectAlignment = 1 << kObjectAlignmentBits;
-const intptr_t kObjectAlignmentMask = kObjectAlignment - 1;
+constexpr int kObjectAlignmentBits = kPointerSizeLog2;
+constexpr intptr_t kObjectAlignment = 1 << kObjectAlignmentBits;
+constexpr intptr_t kObjectAlignmentMask = kObjectAlignment - 1;
// Desired alignment for pointers.
-const intptr_t kPointerAlignment = (1 << kPointerSizeLog2);
-const intptr_t kPointerAlignmentMask = kPointerAlignment - 1;
+constexpr intptr_t kPointerAlignment = (1 << kPointerSizeLog2);
+constexpr intptr_t kPointerAlignmentMask = kPointerAlignment - 1;
// Desired alignment for double values.
-const intptr_t kDoubleAlignment = 8;
-const intptr_t kDoubleAlignmentMask = kDoubleAlignment - 1;
+constexpr intptr_t kDoubleAlignment = 8;
+constexpr intptr_t kDoubleAlignmentMask = kDoubleAlignment - 1;
// Desired alignment for generated code is 32 bytes (to improve cache line
// utilization).
-const int kCodeAlignmentBits = 5;
-const intptr_t kCodeAlignment = 1 << kCodeAlignmentBits;
-const intptr_t kCodeAlignmentMask = kCodeAlignment - 1;
+constexpr int kCodeAlignmentBits = 5;
+constexpr intptr_t kCodeAlignment = 1 << kCodeAlignmentBits;
+constexpr intptr_t kCodeAlignmentMask = kCodeAlignment - 1;
// Weak references are tagged using the second bit in a pointer.
-const int kWeakReferenceTag = 3;
-const int kWeakReferenceTagSize = 2;
-const intptr_t kWeakReferenceTagMask = (1 << kWeakReferenceTagSize) - 1;
+constexpr int kWeakReferenceTag = 3;
+constexpr int kWeakReferenceTagSize = 2;
+constexpr intptr_t kWeakReferenceTagMask = (1 << kWeakReferenceTagSize) - 1;
// Zap-value: The value used for zapping dead objects.
// Should be a recognizable hex value tagged as a failure.
#ifdef V8_HOST_ARCH_64_BIT
-const Address kZapValue =
- reinterpret_cast<Address>(uint64_t{0xdeadbeedbeadbeef});
-const Address kHandleZapValue =
- reinterpret_cast<Address>(uint64_t{0x1baddead0baddeaf});
-const Address kGlobalHandleZapValue =
- reinterpret_cast<Address>(uint64_t{0x1baffed00baffedf});
-const Address kFromSpaceZapValue =
- reinterpret_cast<Address>(uint64_t{0x1beefdad0beefdaf});
-const uint64_t kDebugZapValue = uint64_t{0xbadbaddbbadbaddb};
-const uint64_t kSlotsZapValue = uint64_t{0xbeefdeadbeefdeef};
-const uint64_t kFreeListZapValue = 0xfeed1eaffeed1eaf;
+constexpr uint64_t kZapValue = uint64_t{0xdeadbeedbeadbeef};
+constexpr uint64_t kHandleZapValue = uint64_t{0x1baddead0baddeaf};
+constexpr uint64_t kGlobalHandleZapValue = uint64_t{0x1baffed00baffedf};
+constexpr uint64_t kFromSpaceZapValue = uint64_t{0x1beefdad0beefdaf};
+constexpr uint64_t kDebugZapValue = uint64_t{0xbadbaddbbadbaddb};
+constexpr uint64_t kSlotsZapValue = uint64_t{0xbeefdeadbeefdeef};
+constexpr uint64_t kFreeListZapValue = 0xfeed1eaffeed1eaf;
#else
-const Address kZapValue = reinterpret_cast<Address>(0xdeadbeef);
-const Address kHandleZapValue = reinterpret_cast<Address>(0xbaddeaf);
-const Address kGlobalHandleZapValue = reinterpret_cast<Address>(0xbaffedf);
-const Address kFromSpaceZapValue = reinterpret_cast<Address>(0xbeefdaf);
-const uint32_t kSlotsZapValue = 0xbeefdeef;
-const uint32_t kDebugZapValue = 0xbadbaddb;
-const uint32_t kFreeListZapValue = 0xfeed1eaf;
+constexpr uint32_t kZapValue = 0xdeadbeef;
+constexpr uint32_t kHandleZapValue = 0xbaddeaf;
+constexpr uint32_t kGlobalHandleZapValue = 0xbaffedf;
+constexpr uint32_t kFromSpaceZapValue = 0xbeefdaf;
+constexpr uint32_t kSlotsZapValue = 0xbeefdeef;
+constexpr uint32_t kDebugZapValue = 0xbadbaddb;
+constexpr uint32_t kFreeListZapValue = 0xfeed1eaf;
#endif
-const int kCodeZapValue = 0xbadc0de;
-const uint32_t kPhantomReferenceZap = 0xca11bac;
+constexpr int kCodeZapValue = 0xbadc0de;
+constexpr uint32_t kPhantomReferenceZap = 0xca11bac;
// On Intel architecture, cache line size is 64 bytes.
// On ARM it may be less (32 bytes), but as far this constant is
@@ -452,8 +448,7 @@ const uint32_t kPhantomReferenceZap = 0xca11bac;
// Constants relevant to double precision floating point numbers.
// If looking only at the top 32 bits, the QNaN mask is bits 19 to 30.
-const uint32_t kQuietNaNHighBitsMask = 0xfff << (51 - 32);
-
+constexpr uint32_t kQuietNaNHighBitsMask = 0xfff << (51 - 32);
// -----------------------------------------------------------------------------
// Forward declarations for frequently used classes
@@ -537,7 +532,7 @@ enum AllocationSpace {
FIRST_PAGED_SPACE = OLD_SPACE,
LAST_PAGED_SPACE = MAP_SPACE
};
-const int kSpaceTagSize = 3;
+constexpr int kSpaceTagSize = 3;
enum AllocationAlignment { kWordAligned, kDoubleAligned, kDoubleUnaligned };
@@ -744,12 +739,12 @@ union IeeeDoubleBigEndianArchType {
#if V8_TARGET_LITTLE_ENDIAN
typedef IeeeDoubleLittleEndianArchType IeeeDoubleArchType;
-const int kIeeeDoubleMantissaWordOffset = 0;
-const int kIeeeDoubleExponentWordOffset = 4;
+constexpr int kIeeeDoubleMantissaWordOffset = 0;
+constexpr int kIeeeDoubleExponentWordOffset = 4;
#else
typedef IeeeDoubleBigEndianArchType IeeeDoubleArchType;
-const int kIeeeDoubleMantissaWordOffset = 4;
-const int kIeeeDoubleExponentWordOffset = 0;
+constexpr int kIeeeDoubleMantissaWordOffset = 4;
+constexpr int kIeeeDoubleExponentWordOffset = 0;
#endif
// AccessorCallback
@@ -924,20 +919,18 @@ enum AllocationSiteMode {
(!defined(USE_SIMULATOR) || !defined(_MIPS_TARGET_SIMULATOR))) || \
(V8_TARGET_ARCH_MIPS64 && !defined(_MIPS_ARCH_MIPS64R6) && \
(!defined(USE_SIMULATOR) || !defined(_MIPS_TARGET_SIMULATOR)))
-const uint32_t kHoleNanUpper32 = 0xFFFF7FFF;
-const uint32_t kHoleNanLower32 = 0xFFFF7FFF;
+constexpr uint32_t kHoleNanUpper32 = 0xFFFF7FFF;
+constexpr uint32_t kHoleNanLower32 = 0xFFFF7FFF;
#else
-const uint32_t kHoleNanUpper32 = 0xFFF7FFFF;
-const uint32_t kHoleNanLower32 = 0xFFF7FFFF;
+constexpr uint32_t kHoleNanUpper32 = 0xFFF7FFFF;
+constexpr uint32_t kHoleNanLower32 = 0xFFF7FFFF;
#endif
-const uint64_t kHoleNanInt64 =
+constexpr uint64_t kHoleNanInt64 =
(static_cast<uint64_t>(kHoleNanUpper32) << 32) | kHoleNanLower32;
-
// ES6 section 20.1.2.6 Number.MAX_SAFE_INTEGER
-const double kMaxSafeInteger = 9007199254740991.0; // 2^53-1
-
+constexpr double kMaxSafeInteger = 9007199254740991.0; // 2^53-1
// The order of this enum has to be kept in sync with the predicates below.
enum VariableMode : uint8_t {
diff --git a/chromium/v8/src/handles.cc b/chromium/v8/src/handles.cc
index 7f403bcdb59..ef4d4b155ac 100644
--- a/chromium/v8/src/handles.cc
+++ b/chromium/v8/src/handles.cc
@@ -110,7 +110,7 @@ void HandleScope::DeleteExtensions(Isolate* isolate) {
void HandleScope::ZapRange(Object** start, Object** end) {
DCHECK_LE(end - start, kHandleBlockSize);
for (Object** p = start; p != end; p++) {
- *reinterpret_cast<Address*>(p) = kHandleZapValue;
+ *reinterpret_cast<Address*>(p) = reinterpret_cast<Address>(kHandleZapValue);
}
}
#endif
diff --git a/chromium/v8/src/heap/heap.cc b/chromium/v8/src/heap/heap.cc
index a9e559fc1c9..49c2eccb2df 100644
--- a/chromium/v8/src/heap/heap.cc
+++ b/chromium/v8/src/heap/heap.cc
@@ -4862,7 +4862,8 @@ void Heap::ZapFromSpace() {
PageRange(new_space_->FromSpaceStart(), new_space_->FromSpaceEnd())) {
for (Address cursor = page->area_start(), limit = page->area_end();
cursor < limit; cursor += kPointerSize) {
- Memory::Address_at(cursor) = kFromSpaceZapValue;
+ Memory::Address_at(cursor) =
+ reinterpret_cast<Address>(kFromSpaceZapValue);
}
}
}
diff --git a/chromium/v8/src/heap/spaces.cc b/chromium/v8/src/heap/spaces.cc
index dd0f3887251..750a8dc3769 100644
--- a/chromium/v8/src/heap/spaces.cc
+++ b/chromium/v8/src/heap/spaces.cc
@@ -1099,7 +1099,7 @@ bool MemoryAllocator::UncommitBlock(Address start, size_t size) {
void MemoryAllocator::ZapBlock(Address start, size_t size) {
for (size_t s = 0; s + kPointerSize <= size; s += kPointerSize) {
- Memory::Address_at(start + s) = kZapValue;
+ Memory::Address_at(start + s) = reinterpret_cast<Address>(kZapValue);
}
}
diff --git a/chromium/v8/src/icu_util.cc b/chromium/v8/src/icu_util.cc
index 291cce6fe63..d14c673b624 100644
--- a/chromium/v8/src/icu_util.cc
+++ b/chromium/v8/src/icu_util.cc
@@ -81,6 +81,8 @@ bool InitializeICU(const char* icu_data_file) {
UErrorCode err = U_ZERO_ERROR;
udata_setCommonData(reinterpret_cast<void*>(addr), &err);
+ // Never try to load ICU data from files.
+ udata_setFileAccess(UDATA_ONLY_PACKAGES, &err);
return err == U_ZERO_ERROR;
#elif ICU_UTIL_DATA_IMPL == ICU_UTIL_DATA_STATIC
// Mac/Linux bundle the ICU data in.
@@ -110,6 +112,8 @@ bool InitializeICU(const char* icu_data_file) {
UErrorCode err = U_ZERO_ERROR;
udata_setCommonData(reinterpret_cast<void*>(g_icu_data_ptr), &err);
+ // Never try to load ICU data from files.
+ udata_setFileAccess(UDATA_ONLY_PACKAGES, &err);
return err == U_ZERO_ERROR;
#endif
#endif
diff --git a/chromium/v8/src/objects.cc b/chromium/v8/src/objects.cc
index 73d118ee725..c5c563b4dbe 100644
--- a/chromium/v8/src/objects.cc
+++ b/chromium/v8/src/objects.cc
@@ -13016,14 +13016,19 @@ MaybeHandle<Map> JSFunction::GetDerivedMap(Isolate* isolate,
constructor_initial_map->UnusedPropertyFields();
int instance_size;
int in_object_properties;
- CalculateInstanceSizeForDerivedClass(function, instance_type,
- embedder_fields, &instance_size,
- &in_object_properties);
+ bool success = CalculateInstanceSizeForDerivedClass(
+ function, instance_type, embedder_fields, &instance_size,
+ &in_object_properties);
int unused_property_fields = in_object_properties - pre_allocated;
- Handle<Map> map =
- Map::CopyInitialMap(constructor_initial_map, instance_size,
- in_object_properties, unused_property_fields);
+
+ Handle<Map> map;
+ if (success) {
+ map = Map::CopyInitialMap(constructor_initial_map, instance_size,
+ in_object_properties, unused_property_fields);
+ } else {
+ map = Map::CopyInitialMap(constructor_initial_map);
+ }
map->set_new_target_is_base(false);
JSFunction::SetInitialMap(function, map, prototype);
@@ -13779,12 +13784,14 @@ void JSFunction::CalculateInstanceSizeHelper(InstanceType instance_type,
requested_embedder_fields;
}
-void JSFunction::CalculateInstanceSizeForDerivedClass(
+// static
+bool JSFunction::CalculateInstanceSizeForDerivedClass(
Handle<JSFunction> function, InstanceType instance_type,
int requested_embedder_fields, int* instance_size,
int* in_object_properties) {
Isolate* isolate = function->GetIsolate();
int expected_nof_properties = 0;
+ bool result = true;
for (PrototypeIterator iter(isolate, function, kStartAtReceiver);
!iter.IsAtEnd(); iter.Advance()) {
Handle<JSReceiver> current =
@@ -13798,6 +13805,11 @@ void JSFunction::CalculateInstanceSizeForDerivedClass(
Compiler::Compile(func, Compiler::CLEAR_EXCEPTION)) {
DCHECK(shared->is_compiled());
expected_nof_properties += shared->expected_nof_properties();
+ } else if (!shared->is_compiled()) {
+ // In case there was a compilation error for the constructor we will
+ // throw an error during instantiation. Hence we directly return 0;
+ result = false;
+ break;
}
if (!IsDerivedConstructor(shared->kind())) {
break;
@@ -13806,6 +13818,7 @@ void JSFunction::CalculateInstanceSizeForDerivedClass(
CalculateInstanceSizeHelper(instance_type, true, requested_embedder_fields,
expected_nof_properties, instance_size,
in_object_properties);
+ return result;
}
diff --git a/chromium/v8/src/objects.h b/chromium/v8/src/objects.h
index ce83ea303da..4011054c39d 100644
--- a/chromium/v8/src/objects.h
+++ b/chromium/v8/src/objects.h
@@ -3529,7 +3529,7 @@ class JSFunction: public JSObject {
DECL_CAST(JSFunction)
// Calculate the instance size and in-object properties count.
- static void CalculateInstanceSizeForDerivedClass(
+ static bool CalculateInstanceSizeForDerivedClass(
Handle<JSFunction> function, InstanceType instance_type,
int requested_embedder_fields, int* instance_size,
int* in_object_properties);
diff --git a/chromium/v8/src/objects/map-inl.h b/chromium/v8/src/objects/map-inl.h
index b6e310e9653..c78f947b3a8 100644
--- a/chromium/v8/src/objects/map-inl.h
+++ b/chromium/v8/src/objects/map-inl.h
@@ -157,7 +157,9 @@ int Map::NumberOfOwnDescriptors() const {
}
void Map::SetNumberOfOwnDescriptors(int number) {
- DCHECK(number <= instance_descriptors()->number_of_descriptors());
+ DCHECK_LE(number, instance_descriptors()->number_of_descriptors());
+ CHECK_LE(static_cast<unsigned>(number),
+ static_cast<unsigned>(kMaxNumberOfDescriptors));
set_bit_field3(NumberOfOwnDescriptorsBits::update(bit_field3(), number));
}
@@ -165,8 +167,9 @@ int Map::EnumLength() const { return EnumLengthBits::decode(bit_field3()); }
void Map::SetEnumLength(int length) {
if (length != kInvalidEnumCacheSentinel) {
- DCHECK_GE(length, 0);
- DCHECK(length <= NumberOfOwnDescriptors());
+ DCHECK_LE(length, NumberOfOwnDescriptors());
+ CHECK_LE(static_cast<unsigned>(length),
+ static_cast<unsigned>(kMaxNumberOfDescriptors));
}
set_bit_field3(EnumLengthBits::update(bit_field3(), length));
}
@@ -194,8 +197,7 @@ VisitorId Map::visitor_id() const {
}
void Map::set_visitor_id(VisitorId id) {
- DCHECK_LE(0, id);
- DCHECK_LT(id, 256);
+ CHECK_LT(static_cast<unsigned>(id), 256);
RELAXED_WRITE_BYTE_FIELD(this, kVisitorIdOffset, static_cast<byte>(id));
}
@@ -213,9 +215,9 @@ int Map::instance_size() const {
}
void Map::set_instance_size(int value) {
- DCHECK_EQ(0, value & (kPointerSize - 1));
+ CHECK_EQ(0, value & (kPointerSize - 1));
value >>= kPointerSizeLog2;
- DCHECK(0 <= value && value < 256);
+ CHECK_LT(static_cast<unsigned>(value), 256);
set_instance_size_in_words(value);
}
@@ -226,8 +228,7 @@ int Map::inobject_properties_start_or_constructor_function_index() const {
void Map::set_inobject_properties_start_or_constructor_function_index(
int value) {
- DCHECK_LE(0, value);
- DCHECK_LT(value, 256);
+ CHECK_LT(static_cast<unsigned>(value), 256);
RELAXED_WRITE_BYTE_FIELD(
this, kInObjectPropertiesStartOrConstructorFunctionIndexOffset,
static_cast<byte>(value));
@@ -239,7 +240,7 @@ int Map::GetInObjectPropertiesStartInWords() const {
}
void Map::SetInObjectPropertiesStartInWords(int value) {
- DCHECK(IsJSObjectMap());
+ CHECK(IsJSObjectMap());
set_inobject_properties_start_or_constructor_function_index(value);
}
@@ -254,7 +255,7 @@ int Map::GetConstructorFunctionIndex() const {
}
void Map::SetConstructorFunctionIndex(int value) {
- DCHECK(IsPrimitiveMap());
+ CHECK(IsPrimitiveMap());
set_inobject_properties_start_or_constructor_function_index(value);
}
@@ -296,8 +297,7 @@ int Map::used_or_unused_instance_size_in_words() const {
}
void Map::set_used_or_unused_instance_size_in_words(int value) {
- DCHECK_LE(0, value);
- DCHECK_LE(value, 255);
+ CHECK_LE(static_cast<unsigned>(value), 255);
RELAXED_WRITE_BYTE_FIELD(this, kUsedOrUnusedInstanceSizeInWordsOffset,
static_cast<byte>(value));
}
@@ -315,12 +315,12 @@ int Map::UsedInstanceSize() const {
void Map::SetInObjectUnusedPropertyFields(int value) {
STATIC_ASSERT(JSObject::kFieldsAdded == JSObject::kHeaderSize / kPointerSize);
if (!IsJSObjectMap()) {
- DCHECK_EQ(0, value);
+ CHECK_EQ(0, value);
set_used_or_unused_instance_size_in_words(0);
DCHECK_EQ(0, UnusedPropertyFields());
return;
}
- DCHECK_LE(0, value);
+ CHECK_LE(0, value);
DCHECK_LE(value, GetInObjectProperties());
int used_inobject_properties = GetInObjectProperties() - value;
set_used_or_unused_instance_size_in_words(
@@ -330,8 +330,7 @@ void Map::SetInObjectUnusedPropertyFields(int value) {
void Map::SetOutOfObjectUnusedPropertyFields(int value) {
STATIC_ASSERT(JSObject::kFieldsAdded == JSObject::kHeaderSize / kPointerSize);
- DCHECK_LE(0, value);
- DCHECK_LT(value, JSObject::kFieldsAdded);
+ CHECK_LT(static_cast<unsigned>(value), JSObject::kFieldsAdded);
// For out of object properties "used_instance_size_in_words" byte encodes
// the slack in the property array.
set_used_or_unused_instance_size_in_words(value);
@@ -370,8 +369,8 @@ void Map::AccountAddedOutOfObjectPropertyField(int unused_in_property_array) {
if (unused_in_property_array < 0) {
unused_in_property_array += JSObject::kFieldsAdded;
}
- DCHECK_GE(unused_in_property_array, 0);
- DCHECK_LT(unused_in_property_array, JSObject::kFieldsAdded);
+ CHECK_LT(static_cast<unsigned>(unused_in_property_array),
+ JSObject::kFieldsAdded);
set_used_or_unused_instance_size_in_words(unused_in_property_array);
DCHECK_EQ(unused_in_property_array, UnusedPropertyFields());
}
@@ -398,7 +397,7 @@ bool Map::should_be_fast_prototype_map() const {
}
void Map::set_elements_kind(ElementsKind elements_kind) {
- DCHECK_LT(static_cast<int>(elements_kind), kElementsKindCount);
+ CHECK_LT(static_cast<int>(elements_kind), kElementsKindCount);
set_bit_field2(Map::ElementsKindBits::update(bit_field2(), elements_kind));
}
@@ -643,18 +642,18 @@ Object* Map::prototype_info() const {
}
void Map::set_prototype_info(Object* value, WriteBarrierMode mode) {
- DCHECK(is_prototype_map());
+ CHECK(is_prototype_map());
WRITE_FIELD(this, Map::kTransitionsOrPrototypeInfoOffset, value);
CONDITIONAL_WRITE_BARRIER(
GetHeap(), this, Map::kTransitionsOrPrototypeInfoOffset, value, mode);
}
void Map::SetBackPointer(Object* value, WriteBarrierMode mode) {
- DCHECK(instance_type() >= FIRST_JS_RECEIVER_TYPE);
- DCHECK(value->IsMap());
- DCHECK(GetBackPointer()->IsUndefined(GetIsolate()));
- DCHECK(!value->IsMap() ||
- Map::cast(value)->GetConstructor() == constructor_or_backpointer());
+ CHECK_GE(instance_type(), FIRST_JS_RECEIVER_TYPE);
+ CHECK(value->IsMap());
+ CHECK(GetBackPointer()->IsUndefined(GetIsolate()));
+ CHECK_IMPLIES(value->IsMap(), Map::cast(value)->GetConstructor() ==
+ constructor_or_backpointer());
set_constructor_or_backpointer(value, mode);
}
@@ -685,7 +684,7 @@ FunctionTemplateInfo* Map::GetFunctionTemplateInfo() const {
void Map::SetConstructor(Object* constructor, WriteBarrierMode mode) {
// Never overwrite a back pointer with a constructor.
- DCHECK(!constructor_or_backpointer()->IsMap());
+ CHECK(!constructor_or_backpointer()->IsMap());
set_constructor_or_backpointer(constructor, mode);
}
diff --git a/chromium/v8/src/parsing/parser-base.h b/chromium/v8/src/parsing/parser-base.h
index b2f63c44036..faefe44011e 100644
--- a/chromium/v8/src/parsing/parser-base.h
+++ b/chromium/v8/src/parsing/parser-base.h
@@ -399,17 +399,21 @@ class ParserBase {
BailoutReason dont_optimize_reason() { return dont_optimize_reason_; }
FunctionKind kind() const { return scope()->function_kind(); }
- FunctionState* outer() const { return outer_function_state_; }
void RewindDestructuringAssignments(int pos) {
destructuring_assignments_to_rewrite_.Rewind(pos);
}
- void SetDestructuringAssignmentsScope(int pos, Scope* scope) {
- for (int i = pos; i < destructuring_assignments_to_rewrite_.length();
- ++i) {
- destructuring_assignments_to_rewrite_[i]->set_scope(scope);
+ void AdoptDestructuringAssignmentsFromParentState(int pos) {
+ const auto& outer_assignments =
+ outer_function_state_->destructuring_assignments_to_rewrite_;
+ DCHECK_GE(outer_assignments.length(), pos);
+ for (int i = pos; i < outer_assignments.length(); ++i) {
+ auto expr = outer_assignments[i];
+ expr->set_scope(scope_);
+ destructuring_assignments_to_rewrite_.Add(expr, scope_->zone());
}
+ outer_function_state_->RewindDestructuringAssignments(pos);
}
const ZoneList<RewritableExpressionT>&
@@ -2886,7 +2890,6 @@ ParserBase<Impl>::ParseAssignmentExpression(bool accept_IN, bool* ok) {
// Because the arrow's parameters were parsed in the outer scope,
// we need to fix up the scope chain appropriately.
scope_snapshot.Reparent(scope);
- function_state_->SetDestructuringAssignmentsScope(rewritable_length, scope);
FormalParametersT parameters(scope);
if (!classifier()->is_simple_parameter_list()) {
@@ -4368,6 +4371,11 @@ ParserBase<Impl>::ParseArrowFunctionLiteral(
FunctionState function_state(&function_state_, &scope_,
formal_parameters.scope);
+ // Move any queued destructuring assignments which appeared
+ // in this function's parameter list into its own function_state.
+ function_state.AdoptDestructuringAssignmentsFromParentState(
+ rewritable_length);
+
Expect(Token::ARROW, CHECK_OK);
if (peek() == Token::LBRACE) {
@@ -4391,14 +4399,10 @@ ParserBase<Impl>::ParseArrowFunctionLiteral(
USE(result);
formal_parameters.scope->ResetAfterPreparsing(ast_value_factory_,
false);
-
// Discard any queued destructuring assignments which appeared
- // in this function's parameter list.
- FunctionState* parent_state = function_state.outer();
- DCHECK_NOT_NULL(parent_state);
- DCHECK_GE(parent_state->destructuring_assignments_to_rewrite().length(),
- rewritable_length);
- parent_state->RewindDestructuringAssignments(rewritable_length);
+ // in this function's parameter list, and which were adopted
+ // into this function state, above.
+ function_state.RewindDestructuringAssignments(0);
} else {
Consume(Token::LBRACE);
body = impl()->NewStatementList(8);
diff --git a/chromium/v8/src/profiler/heap-snapshot-generator.cc b/chromium/v8/src/profiler/heap-snapshot-generator.cc
index 73263fc95af..40779d9e5f1 100644
--- a/chromium/v8/src/profiler/heap-snapshot-generator.cc
+++ b/chromium/v8/src/profiler/heap-snapshot-generator.cc
@@ -1113,8 +1113,6 @@ void V8HeapExplorer::ExtractMapReferences(int entry, Map* map) {
constructor_or_backpointer,
Map::kConstructorOrBackPointerOffset);
} else {
- DCHECK(constructor_or_backpointer->IsJSFunction() ||
- constructor_or_backpointer->IsNull(map->GetIsolate()));
SetInternalReference(map, entry, "constructor", constructor_or_backpointer,
Map::kConstructorOrBackPointerOffset);
}
diff --git a/chromium/v8/src/profiler/sampling-heap-profiler.cc b/chromium/v8/src/profiler/sampling-heap-profiler.cc
index fcd7f610c78..fef21550ec1 100644
--- a/chromium/v8/src/profiler/sampling-heap-profiler.cc
+++ b/chromium/v8/src/profiler/sampling-heap-profiler.cc
@@ -148,12 +148,21 @@ SamplingHeapProfiler::AllocationNode* SamplingHeapProfiler::AddStack() {
std::vector<SharedFunctionInfo*> stack;
JavaScriptFrameIterator it(isolate_);
int frames_captured = 0;
+ bool found_arguments_marker_frames = false;
while (!it.done() && frames_captured < stack_depth_) {
JavaScriptFrame* frame = it.frame();
- SharedFunctionInfo* shared = frame->function()->shared();
- stack.push_back(shared);
-
- frames_captured++;
+ // If we are materializing objects during deoptimization, inlined
+ // closures may not yet be materialized, and this includes the
+ // closure on the stack. Skip over any such frames (they'll be
+ // in the top frames of the stack). The allocations made in this
+ // sensitive moment belong to the formerly optimized frame anyway.
+ if (frame->unchecked_function()->IsJSFunction()) {
+ SharedFunctionInfo* shared = frame->function()->shared();
+ stack.push_back(shared);
+ frames_captured++;
+ } else {
+ found_arguments_marker_frames = true;
+ }
it.Advance();
}
@@ -200,6 +209,12 @@ SamplingHeapProfiler::AllocationNode* SamplingHeapProfiler::AddStack() {
}
node = node->FindOrAddChildNode(name, script_id, shared->start_position());
}
+
+ if (found_arguments_marker_frames) {
+ node =
+ node->FindOrAddChildNode("(deopt)", v8::UnboundScript::kNoScriptId, 0);
+ }
+
return node;
}
diff --git a/chromium/v8/src/wasm/wasm-serialization.cc b/chromium/v8/src/wasm/wasm-serialization.cc
index 6b7c68c8715..4466672f37d 100644
--- a/chromium/v8/src/wasm/wasm-serialization.cc
+++ b/chromium/v8/src/wasm/wasm-serialization.cc
@@ -738,6 +738,7 @@ MaybeHandle<WasmCompiledModule> DeserializeNativeModule(
export_wrappers, std::vector<wasm::GlobalHandleAddress>(),
trap_handler::IsTrapHandlerEnabled());
compiled_module->OnWasmModuleDecodingComplete(shared);
+ script->set_wasm_compiled_module(*compiled_module);
NativeModuleDeserializer deserializer(isolate,
compiled_module->GetNativeModule());
if (!deserializer.Read(data)) return {};
diff --git a/chromium/v8/src/x64/macro-assembler-x64.cc b/chromium/v8/src/x64/macro-assembler-x64.cc
index 9470ed8fcf8..5019be3727e 100644
--- a/chromium/v8/src/x64/macro-assembler-x64.cc
+++ b/chromium/v8/src/x64/macro-assembler-x64.cc
@@ -186,7 +186,8 @@ void MacroAssembler::PushAddress(ExternalReference source) {
int64_t address = reinterpret_cast<int64_t>(source.address());
if (is_int32(address) && !serializer_enabled()) {
if (emit_debug_code()) {
- Move(kScratchRegister, kZapValue, Assembler::RelocInfoNone());
+ Move(kScratchRegister, reinterpret_cast<Address>(kZapValue),
+ Assembler::RelocInfoNone());
}
Push(Immediate(static_cast<int32_t>(address)));
return;
@@ -255,8 +256,9 @@ void MacroAssembler::RecordWriteField(Register object, int offset,
// Clobber clobbered input registers when running with the debug-code flag
// turned on to provoke errors.
if (emit_debug_code()) {
- Move(value, kZapValue, Assembler::RelocInfoNone());
- Move(dst, kZapValue, Assembler::RelocInfoNone());
+ Move(value, reinterpret_cast<Address>(kZapValue),
+ Assembler::RelocInfoNone());
+ Move(dst, reinterpret_cast<Address>(kZapValue), Assembler::RelocInfoNone());
}
}
@@ -386,8 +388,10 @@ void MacroAssembler::RecordWrite(Register object, Register address,
// Clobber clobbered registers when running with the debug-code flag
// turned on to provoke errors.
if (emit_debug_code()) {
- Move(address, kZapValue, Assembler::RelocInfoNone());
- Move(value, kZapValue, Assembler::RelocInfoNone());
+ Move(address, reinterpret_cast<Address>(kZapValue),
+ Assembler::RelocInfoNone());
+ Move(value, reinterpret_cast<Address>(kZapValue),
+ Assembler::RelocInfoNone());
}
}