diff --git a/cobalt/base/on_screen_keyboard_suggestions_updated_event.h b/cobalt/base/on_screen_keyboard_suggestions_updated_event.h deleted file mode 100644 index 15743ac5373f..000000000000 --- a/cobalt/base/on_screen_keyboard_suggestions_updated_event.h +++ /dev/null @@ -1,38 +0,0 @@ -// Copyright 2019 The Cobalt Authors. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef COBALT_BASE_ON_SCREEN_KEYBOARD_SUGGESTIONS_UPDATED_EVENT_H_ -#define COBALT_BASE_ON_SCREEN_KEYBOARD_SUGGESTIONS_UPDATED_EVENT_H_ - -#include "cobalt/base/event.h" -#include "starboard/event.h" - -namespace base { - -class OnScreenKeyboardSuggestionsUpdatedEvent : public Event { - public: - explicit OnScreenKeyboardSuggestionsUpdatedEvent(int ticket) - : ticket_(ticket) {} - - int ticket() const { return ticket_; } - - BASE_EVENT_SUBCLASS(OnScreenKeyboardSuggestionsUpdatedEvent); - - private: - int ticket_; -}; - -} // namespace base - -#endif // COBALT_BASE_ON_SCREEN_KEYBOARD_SUGGESTIONS_UPDATED_EVENT_H_ diff --git a/cobalt/base/wrap_main_starboard.h b/cobalt/base/wrap_main_starboard.h index e60b7fc3b494..741502adfedc 100644 --- a/cobalt/base/wrap_main_starboard.h +++ b/cobalt/base/wrap_main_starboard.h @@ -113,12 +113,16 @@ void BaseEventHandler(const SbEvent* event) { case kSbEventTypeOnScreenKeyboardHidden: case kSbEventTypeOnScreenKeyboardFocused: case kSbEventTypeOnScreenKeyboardBlurred: - case kSbEventTypeOnScreenKeyboardSuggestionsUpdated: case kSbEventTypeAccessibilityCaptionSettingsChanged: case kSbEventTypeAccessibilityTextToSpeechSettingsChanged: case kSbEventTypeOsNetworkDisconnected: case kSbEventTypeOsNetworkConnected: case kSbEventDateTimeConfigurationChanged: +#if SB_API_VERSION >= 16 + case kSbEventTypeReserved1: +#else + case kSbEventTypeOnScreenKeyboardSuggestionsUpdated: +#endif // SB_API_VERSION >= 16 event_function(event); break; } diff --git a/cobalt/bindings/shared/idl_conditional_macros.h b/cobalt/bindings/shared/idl_conditional_macros.h index a34191f5b5de..b54baf001ac4 100644 --- a/cobalt/bindings/shared/idl_conditional_macros.h +++ b/cobalt/bindings/shared/idl_conditional_macros.h @@ -17,14 +17,11 @@ #include "starboard/configuration.h" -// Define preprocessor macros that cannot be determined at GYP time for use in +// Define preprocessor macros that cannot be determined at GN time for use in // IDL files with Conditionals (e.g. conditional interface definitions, or // conditional attributes). This is necessary to make macros for IDL // Conditionals that are dependent on Starboard feature macros that get defined // in header files. -// This is used to conditionally define the On Screen Keyboard interface and -// attribute. -#define COBALT_ENABLE_ON_SCREEN_KEYBOARD #endif // COBALT_BINDINGS_SHARED_IDL_CONDITIONAL_MACROS_H_ diff --git a/cobalt/browser/BUILD.gn b/cobalt/browser/BUILD.gn index 0428431abb21..30ca9afdce42 100644 --- a/cobalt/browser/BUILD.gn +++ b/cobalt/browser/BUILD.gn @@ -120,8 +120,6 @@ static_library("browser") { "device_authentication.h", "on_screen_keyboard_extension_bridge.cc", "on_screen_keyboard_extension_bridge.h", - "on_screen_keyboard_starboard_bridge.cc", - "on_screen_keyboard_starboard_bridge.h", "render_tree_combiner.cc", "render_tree_combiner.h", "screen_shot_writer.cc", diff --git a/cobalt/browser/application.cc b/cobalt/browser/application.cc index 1dc3fc9a5175..00cbd8890003 100644 --- a/cobalt/browser/application.cc +++ b/cobalt/browser/application.cc @@ -49,7 +49,6 @@ #include "cobalt/base/on_screen_keyboard_focused_event.h" #include "cobalt/base/on_screen_keyboard_hidden_event.h" #include "cobalt/base/on_screen_keyboard_shown_event.h" -#include "cobalt/base/on_screen_keyboard_suggestions_updated_event.h" #include "cobalt/base/starboard_stats_tracker.h" #include "cobalt/base/startup_timer.h" #include "cobalt/base/version_compatibility.h" @@ -961,12 +960,6 @@ Application::Application(const base::Closure& quit_closure, bool should_preload, event_dispatcher_.AddEventCallback( base::OnScreenKeyboardBlurredEvent::TypeId(), on_screen_keyboard_blurred_event_callback_); - on_screen_keyboard_suggestions_updated_event_callback_ = - base::Bind(&Application::OnOnScreenKeyboardSuggestionsUpdatedEvent, - base::Unretained(this)); - event_dispatcher_.AddEventCallback( - base::OnScreenKeyboardSuggestionsUpdatedEvent::TypeId(), - on_screen_keyboard_suggestions_updated_event_callback_); on_caption_settings_changed_event_callback_ = base::Bind( &Application::OnCaptionSettingsChangedEvent, base::Unretained(this)); event_dispatcher_.AddEventCallback( @@ -1070,9 +1063,6 @@ Application::~Application() { event_dispatcher_.RemoveEventCallback( base::OnScreenKeyboardBlurredEvent::TypeId(), on_screen_keyboard_blurred_event_callback_); - event_dispatcher_.RemoveEventCallback( - base::OnScreenKeyboardSuggestionsUpdatedEvent::TypeId(), - on_screen_keyboard_suggestions_updated_event_callback_); event_dispatcher_.RemoveEventCallback( base::AccessibilityCaptionSettingsChangedEvent::TypeId(), on_caption_settings_changed_event_callback_); @@ -1155,10 +1145,6 @@ void Application::HandleStarboardEvent(const SbEvent* starboard_event) { DispatchEventInternal(new base::OnScreenKeyboardBlurredEvent( *static_cast(starboard_event->data))); break; - case kSbEventTypeOnScreenKeyboardSuggestionsUpdated: - DispatchEventInternal(new base::OnScreenKeyboardSuggestionsUpdatedEvent( - *static_cast(starboard_event->data))); - break; case kSbEventTypeLink: { DispatchDeepLink(static_cast(starboard_event->data), starboard_event->timestamp); @@ -1193,6 +1179,11 @@ void Application::HandleStarboardEvent(const SbEvent* starboard_event) { case kSbEventTypeStop: case kSbEventTypeUser: case kSbEventTypeVerticalSync: +#if SB_API_VERSION >= 16 + case kSbEventTypeReserved1: +#else + case kSbEventTypeOnScreenKeyboardSuggestionsUpdated: +#endif // SB_API_VERSION >= 16 DLOG(WARNING) << "Unhandled Starboard event of type: " << starboard_event->type; } @@ -1270,7 +1261,6 @@ void Application::OnApplicationEvent(SbEventType event_type, case kSbEventTypeOnScreenKeyboardFocused: case kSbEventTypeOnScreenKeyboardHidden: case kSbEventTypeOnScreenKeyboardShown: - case kSbEventTypeOnScreenKeyboardSuggestionsUpdated: case kSbEventTypeAccessibilitySettingsChanged: case kSbEventTypeInput: case kSbEventTypeLink: @@ -1280,6 +1270,11 @@ void Application::OnApplicationEvent(SbEventType event_type, case kSbEventTypeOsNetworkDisconnected: case kSbEventTypeOsNetworkConnected: case kSbEventDateTimeConfigurationChanged: +#if SB_API_VERSION >= 16 + case kSbEventTypeReserved1: +#else + case kSbEventTypeOnScreenKeyboardSuggestionsUpdated: +#endif // SB_API_VERSION >= 16 NOTREACHED() << "Unexpected event type: " << event_type; return; } @@ -1337,15 +1332,6 @@ void Application::OnOnScreenKeyboardBlurredEvent(const base::Event* event) { event)); } -void Application::OnOnScreenKeyboardSuggestionsUpdatedEvent( - const base::Event* event) { - TRACE_EVENT0("cobalt::browser", - "Application::OnOnScreenKeyboardSuggestionsUpdatedEvent()"); - browser_module_->OnOnScreenKeyboardSuggestionsUpdated( - base::polymorphic_downcast< - const base::OnScreenKeyboardSuggestionsUpdatedEvent*>(event)); -} - void Application::OnCaptionSettingsChangedEvent(const base::Event* event) { TRACE_EVENT0("cobalt::browser", "Application::OnCaptionSettingsChangedEvent()"); diff --git a/cobalt/browser/application.h b/cobalt/browser/application.h index 572e2b358693..6f2cda34d8ec 100644 --- a/cobalt/browser/application.h +++ b/cobalt/browser/application.h @@ -78,7 +78,6 @@ class Application { void OnOnScreenKeyboardHiddenEvent(const base::Event* event); void OnOnScreenKeyboardFocusedEvent(const base::Event* event); void OnOnScreenKeyboardBlurredEvent(const base::Event* event); - void OnOnScreenKeyboardSuggestionsUpdatedEvent(const base::Event* event); void OnCaptionSettingsChangedEvent(const base::Event* event); void OnWindowOnOnlineEvent(const base::Event* event); void OnWindowOnOfflineEvent(const base::Event* event); @@ -111,7 +110,6 @@ class Application { base::EventCallback on_screen_keyboard_hidden_event_callback_; base::EventCallback on_screen_keyboard_focused_event_callback_; base::EventCallback on_screen_keyboard_blurred_event_callback_; - base::EventCallback on_screen_keyboard_suggestions_updated_event_callback_; base::EventCallback on_caption_settings_changed_event_callback_; base::EventCallback on_window_on_online_event_callback_; base::EventCallback on_window_on_offline_event_callback_; diff --git a/cobalt/browser/browser_module.cc b/cobalt/browser/browser_module.cc index 885518d16cb0..4787823f5dec 100644 --- a/cobalt/browser/browser_module.cc +++ b/cobalt/browser/browser_module.cc @@ -37,7 +37,6 @@ #include "cobalt/base/source_location.h" #include "cobalt/base/tokens.h" #include "cobalt/browser/on_screen_keyboard_extension_bridge.h" -#include "cobalt/browser/on_screen_keyboard_starboard_bridge.h" #include "cobalt/browser/screen_shot_writer.h" #include "cobalt/browser/switches.h" #include "cobalt/browser/user_agent_platform_info.h" @@ -315,14 +314,6 @@ BrowserModule::BrowserModule(const GURL& url, std::make_unique( base::Bind(&BrowserModule::GetSbWindow, base::Unretained(this)), on_screen_keyboard_extension); - } else { - if (OnScreenKeyboardStarboardBridge::IsSupported()) { - on_screen_keyboard_bridge_ = - std::make_unique(base::Bind( - &BrowserModule::GetSbWindow, base::Unretained(this))); - } else { - on_screen_keyboard_bridge_ = NULL; - } } } else { on_screen_keyboard_bridge_ = NULL; @@ -1114,15 +1105,6 @@ void BrowserModule::OnOnScreenKeyboardBlurred( } } -void BrowserModule::OnOnScreenKeyboardSuggestionsUpdated( - const base::OnScreenKeyboardSuggestionsUpdatedEvent* event) { - DCHECK_EQ(base::MessageLoop::current(), self_message_loop_); - // Only inject updated suggestions events to the main WebModule. - if (web_module_) { - web_module_->InjectOnScreenKeyboardSuggestionsUpdatedEvent(event->ticket()); - } -} - void BrowserModule::OnCaptionSettingsChanged( const base::AccessibilityCaptionSettingsChangedEvent* event) { DCHECK_EQ(base::MessageLoop::current(), self_message_loop_); diff --git a/cobalt/browser/browser_module.h b/cobalt/browser/browser_module.h index 0c18ac9d1591..aa827a0f4bdd 100644 --- a/cobalt/browser/browser_module.h +++ b/cobalt/browser/browser_module.h @@ -35,7 +35,6 @@ #include "cobalt/base/on_screen_keyboard_focused_event.h" #include "cobalt/base/on_screen_keyboard_hidden_event.h" #include "cobalt/base/on_screen_keyboard_shown_event.h" -#include "cobalt/base/on_screen_keyboard_suggestions_updated_event.h" #include "cobalt/browser/lifecycle_observer.h" #include "cobalt/browser/memory_settings/auto_mem.h" #include "cobalt/browser/memory_settings/checker.h" @@ -222,8 +221,6 @@ class BrowserModule { const base::OnScreenKeyboardFocusedEvent* event); void OnOnScreenKeyboardBlurred( const base::OnScreenKeyboardBlurredEvent* event); - void OnOnScreenKeyboardSuggestionsUpdated( - const base::OnScreenKeyboardSuggestionsUpdatedEvent* event); void OnCaptionSettingsChanged( const base::AccessibilityCaptionSettingsChangedEvent* event); diff --git a/cobalt/browser/on_screen_keyboard_starboard_bridge.cc b/cobalt/browser/on_screen_keyboard_starboard_bridge.cc deleted file mode 100644 index f534caa467a4..000000000000 --- a/cobalt/browser/on_screen_keyboard_starboard_bridge.cc +++ /dev/null @@ -1,128 +0,0 @@ -// Copyright 2018 The Cobalt Authors. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#include "cobalt/browser/on_screen_keyboard_starboard_bridge.h" - -#include - -#include "base/bind.h" -#include "base/callback.h" -#include "starboard/event.h" - -namespace cobalt { -namespace browser { -// static -bool OnScreenKeyboardStarboardBridge::IsSupported() { - return SbWindowOnScreenKeyboardIsSupported(); -} - -void OnScreenKeyboardStarboardBridge::Show(const char* input_text, int ticket) { - // Delay providing the SbWindow until as late as possible. - SbWindowShowOnScreenKeyboard(sb_window_provider_.Run(), input_text, ticket); -} - -void OnScreenKeyboardStarboardBridge::Hide(int ticket) { - // Delay providing the SbWindow until as late as possible. - SbWindowHideOnScreenKeyboard(sb_window_provider_.Run(), ticket); -} - -void OnScreenKeyboardStarboardBridge::Focus(int ticket) { - // Delay providing the SbWindow until as late as possible. - SbWindowFocusOnScreenKeyboard(sb_window_provider_.Run(), ticket); -} - -void OnScreenKeyboardStarboardBridge::Blur(int ticket) { - // Delay providing the SbWindow until as late as possible. - SbWindowBlurOnScreenKeyboard(sb_window_provider_.Run(), ticket); -} - -void OnScreenKeyboardStarboardBridge::UpdateSuggestions( - const script::Sequence& suggestions, int ticket) { - std::unique_ptr suggestions_data( - new const char*[suggestions.size()]); - for (script::Sequence::size_type i = 0; i < suggestions.size(); - ++i) { - suggestions_data[i] = suggestions.at(i).c_str(); - } - // Delay providing the SbWindow until as late as possible. - SbWindowUpdateOnScreenKeyboardSuggestions( - sb_window_provider_.Run(), suggestions_data.get(), - static_cast(suggestions.size()), ticket); -} - -bool OnScreenKeyboardStarboardBridge::IsShown() const { - // Delay providing the SbWindow until as late as possible. - return SbWindowIsOnScreenKeyboardShown(sb_window_provider_.Run()); -} - -bool OnScreenKeyboardStarboardBridge::SuggestionsSupported() const { - // Delay providing the SbWindow until as late as possible. - return SbWindowOnScreenKeyboardSuggestionsSupported( - sb_window_provider_.Run()); -} - -scoped_refptr OnScreenKeyboardStarboardBridge::BoundingRect() - const { - // Delay providing the SbWindow until as late as possible. - SbWindowRect sb_window_rect = SbWindowRect(); - if (!SbWindowGetOnScreenKeyboardBoundingRect(sb_window_provider_.Run(), - &sb_window_rect)) { - return nullptr; - } - scoped_refptr bounding_rect = - new dom::DOMRect(sb_window_rect.x, sb_window_rect.y, sb_window_rect.width, - sb_window_rect.height); - return bounding_rect; -} - -bool OnScreenKeyboardStarboardBridge::IsValidTicket(int ticket) const { - return ticket != kSbEventOnScreenKeyboardInvalidTicket; -} - -void OnScreenKeyboardStarboardBridge::SetKeepFocus(bool keep_focus) { - // Delay providing the SbWindow until as late as possible. - return SbWindowSetOnScreenKeyboardKeepFocus(sb_window_provider_.Run(), - keep_focus); -} - -void OnScreenKeyboardStarboardBridge::SetBackgroundColor(uint8 r, uint8 g, - uint8 b) { - const CobaltExtensionOnScreenKeyboardApi* on_screen_keyboard_extension = - static_cast( - SbSystemGetExtension(kCobaltExtensionOnScreenKeyboardName)); - - if (on_screen_keyboard_extension && - strcmp(on_screen_keyboard_extension->name, - kCobaltExtensionOnScreenKeyboardName) == 0 && - on_screen_keyboard_extension->version >= 1) { - on_screen_keyboard_extension->SetBackgroundColor(sb_window_provider_.Run(), - r, g, b); - } -} - -void OnScreenKeyboardStarboardBridge::SetLightTheme(bool light_theme) { - const CobaltExtensionOnScreenKeyboardApi* on_screen_keyboard_extension = - static_cast( - SbSystemGetExtension(kCobaltExtensionOnScreenKeyboardName)); - - if (on_screen_keyboard_extension && - strcmp(on_screen_keyboard_extension->name, - kCobaltExtensionOnScreenKeyboardName) == 0 && - on_screen_keyboard_extension->version >= 1) { - on_screen_keyboard_extension->SetLightTheme(sb_window_provider_.Run(), - light_theme); - } -} -} // namespace browser -} // namespace cobalt diff --git a/cobalt/browser/on_screen_keyboard_starboard_bridge.h b/cobalt/browser/on_screen_keyboard_starboard_bridge.h deleted file mode 100644 index 0a68c304b2fd..000000000000 --- a/cobalt/browser/on_screen_keyboard_starboard_bridge.h +++ /dev/null @@ -1,72 +0,0 @@ -// Copyright 2018 The Cobalt Authors. All Rights Reserved. -// -// Licensed under the Apache License, Version 2.0 (the "License"); -// you may not use this file except in compliance with the License. -// You may obtain a copy of the License at -// -// http://www.apache.org/licenses/LICENSE-2.0 -// -// Unless required by applicable law or agreed to in writing, software -// distributed under the License is distributed on an "AS IS" BASIS, -// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -// See the License for the specific language governing permissions and -// limitations under the License. - -#ifndef COBALT_BROWSER_ON_SCREEN_KEYBOARD_STARBOARD_BRIDGE_H_ -#define COBALT_BROWSER_ON_SCREEN_KEYBOARD_STARBOARD_BRIDGE_H_ - -#include - -#include "base/callback.h" -#include "cobalt/dom/on_screen_keyboard_bridge.h" -#include "starboard/extension/on_screen_keyboard.h" -#include "starboard/window.h" - -namespace cobalt { -namespace browser { - -// OnScreenKeyboardStarboardBridge implements the OnScreenKeyboardBridge, -// calling Starboard methods to control the OnScreenKeyboard. The constructor -// takes in a callback provider for the SbWindow. -class OnScreenKeyboardStarboardBridge : public dom::OnScreenKeyboardBridge { - public: - explicit OnScreenKeyboardStarboardBridge( - const base::Callback& sb_window_provider) - : sb_window_provider_(sb_window_provider) { - DCHECK(!sb_window_provider_.is_null()); - } - - static bool IsSupported(); - - void Show(const char* input_text, int ticket) override; - - void Hide(int ticket) override; - - void Focus(int ticket) override; - - void Blur(int ticket) override; - - void UpdateSuggestions(const script::Sequence& suggestions, - int ticket) override; - - bool IsShown() const override; - - bool SuggestionsSupported() const override; - - scoped_refptr BoundingRect() const override; - - bool IsValidTicket(int ticket) const override; - - void SetKeepFocus(bool keep_focus) override; - - void SetBackgroundColor(uint8 r, uint8 g, uint8 b) override; - - void SetLightTheme(bool light_theme) override; - - private: - base::Callback sb_window_provider_; -}; - -} // namespace browser -} // namespace cobalt -#endif // COBALT_BROWSER_ON_SCREEN_KEYBOARD_STARBOARD_BRIDGE_H_ diff --git a/cobalt/browser/web_module.cc b/cobalt/browser/web_module.cc index cdd0f48b84ce..7413bb2c4ef7 100644 --- a/cobalt/browser/web_module.cc +++ b/cobalt/browser/web_module.cc @@ -167,9 +167,6 @@ class WebModule::Impl { // Injects an on screen keyboard blurred event into the web module. Event is // directed at the on screen keyboard element. void InjectOnScreenKeyboardBlurredEvent(int ticket); - // Injects an on screen keyboard suggestions updated event into the web - // module. Event is directed at the on screen keyboard element. - void InjectOnScreenKeyboardSuggestionsUpdatedEvent(int ticket); // Injects a keyboard event into the web module. Event is directed at a // specific element if the element is non-null. Otherwise, the currently @@ -867,17 +864,6 @@ void WebModule::Impl::InjectOnScreenKeyboardBlurredEvent(int ticket) { window_->on_screen_keyboard()->DispatchBlurEvent(ticket); } -void WebModule::Impl::InjectOnScreenKeyboardSuggestionsUpdatedEvent( - int ticket) { - DCHECK_CALLED_ON_VALID_THREAD(thread_checker_); - DCHECK(is_running_); - DCHECK(window_); - DCHECK(window_->on_screen_keyboard()); - - window_->on_screen_keyboard()->DispatchSuggestionsUpdatedEvent(ticket); -} - - void WebModule::Impl::InjectKeyboardEvent(base::Token type, const dom::KeyboardEventInit& event, scoped_refptr element) { @@ -1447,16 +1433,6 @@ void WebModule::InjectOnScreenKeyboardBlurredEvent(int ticket) { impl_->InjectOnScreenKeyboardBlurredEvent(ticket); } -void WebModule::InjectOnScreenKeyboardSuggestionsUpdatedEvent(int ticket) { - TRACE_EVENT1("cobalt::browser", - "WebModule::InjectOnScreenKeyboardSuggestionsUpdatedEvent()", - "ticket", ticket); - POST_TO_ENSURE_IMPL_ON_THREAD(InjectOnScreenKeyboardSuggestionsUpdatedEvent, - ticket); - impl_->InjectOnScreenKeyboardSuggestionsUpdatedEvent(ticket); -} - - void WebModule::InjectKeyboardEvent(base::Token type, const dom::KeyboardEventInit& event) { TRACE_EVENT1("cobalt::browser", "WebModule::InjectKeyboardEvent()", "type", diff --git a/cobalt/browser/web_module.h b/cobalt/browser/web_module.h index c38f25b3b53b..bc8781626332 100644 --- a/cobalt/browser/web_module.h +++ b/cobalt/browser/web_module.h @@ -289,9 +289,6 @@ class WebModule : public base::MessageLoop::DestructionObserver, void InjectOnScreenKeyboardFocusedEvent(int ticket); // Injects an on screen keyboard blurred event into the web module. void InjectOnScreenKeyboardBlurredEvent(int ticket); - // Injects an on screen keyboard suggestions updated event into the web - // module. - void InjectOnScreenKeyboardSuggestionsUpdatedEvent(int ticket); void InjectWindowOnOnlineEvent(const base::Event* event); void InjectWindowOnOfflineEvent(const base::Event* event); diff --git a/cobalt/dom/on_screen_keyboard.idl b/cobalt/dom/on_screen_keyboard.idl index 9487eec201d3..76f9aa43011d 100644 --- a/cobalt/dom/on_screen_keyboard.idl +++ b/cobalt/dom/on_screen_keyboard.idl @@ -15,9 +15,7 @@ // Custom API for hiding, showing, focusing, blurring, and receiving input // from an on screen keyboard. -[ - Conditional=COBALT_ENABLE_ON_SCREEN_KEYBOARD -] interface OnScreenKeyboard : EventTarget { +interface OnScreenKeyboard : EventTarget { Promise show(); Promise hide(); Promise focus(); diff --git a/cobalt/dom/on_screen_keyboard_test.cc b/cobalt/dom/on_screen_keyboard_test.cc index b567585c7d1a..d2ce2a380661 100644 --- a/cobalt/dom/on_screen_keyboard_test.cc +++ b/cobalt/dom/on_screen_keyboard_test.cc @@ -17,6 +17,7 @@ #include "cobalt/base/tokens.h" #include "cobalt/bindings/testing/utils.h" +#include "cobalt/browser/on_screen_keyboard_extension_bridge.h" #include "cobalt/dom/testing/test_with_javascript.h" #include "cobalt/dom/window.h" #include "cobalt/web/testing/gtest_workarounds.h" @@ -200,7 +201,7 @@ class OnScreenKeyboardTest : public testing::TestWithJavaScript { } // namespace bool SkipLocale() { - bool skipTests = !SbWindowOnScreenKeyboardIsSupported(); + bool skipTests = !browser::OnScreenKeyboardExtensionBridge::IsSupported(); if (skipTests) { SB_LOG(INFO) << "On screen keyboard not supported. Test skipped."; } diff --git a/cobalt/dom/window_on_screen_keyboard.idl b/cobalt/dom/window_on_screen_keyboard.idl index 037506ee561f..5ddcbe6c7245 100644 --- a/cobalt/dom/window_on_screen_keyboard.idl +++ b/cobalt/dom/window_on_screen_keyboard.idl @@ -16,5 +16,5 @@ // screen keyboard. partial interface Window { -[ Conditional=COBALT_ENABLE_ON_SCREEN_KEYBOARD ] readonly attribute OnScreenKeyboard onScreenKeyboard; +readonly attribute OnScreenKeyboard onScreenKeyboard; }; diff --git a/cobalt/site/docs/reference/starboard/configuration-public.md b/cobalt/site/docs/reference/starboard/configuration-public.md index 8e3a3394fc43..6c02fcecd6a0 100644 --- a/cobalt/site/docs/reference/starboard/configuration-public.md +++ b/cobalt/site/docs/reference/starboard/configuration-public.md @@ -14,13 +14,6 @@ Book: /youtube/cobalt/_book.yaml | **`SB_IMPORT_PLATFORM`**

The platform's annotation for marking a symbol as imported from outside of the current linking unit. | -## I/O Configuration - -| Properties | -| :--- | -| **`SB_HAS_ON_SCREEN_KEYBOARD`**

Whether the current platform implements the on screen keyboard interface.

The default value in the Stub implementation is `0` | - - ## Media Configuration | Properties | diff --git a/cobalt/site/docs/reference/starboard/modules/event.md b/cobalt/site/docs/reference/starboard/modules/event.md index fdfa85670d1e..b8005a5d6c36 100644 --- a/cobalt/site/docs/reference/starboard/modules/event.md +++ b/cobalt/site/docs/reference/starboard/modules/event.md @@ -236,16 +236,6 @@ the type of the value pointed to by that data argument, if any. triggered by the application have tickets passed in via SbWindowBlurOnScreenKeyboard. System-triggered events have ticket value kSbEventOnScreenKeyboardInvalidTicket. -* `kSbEventTypeOnScreenKeyboardSuggestionsUpdated` - - The platform has updated the on screen keyboard suggestions. This event is - triggered by the system or by the application's OnScreenKeyboard update - suggestions method. The event has int data representing a ticket. The ticket - is used by the application to mark individual calls to the update - suggestions method as successfully completed. Events triggered by the - application have tickets passed in via - SbWindowUpdateOnScreenKeyboardSuggestions. System-triggered events have - ticket value kSbEventOnScreenKeyboardInvalidTicket. * `kSbEventTypeAccessibilityCaptionSettingsChanged` One or more of the fields returned by SbAccessibilityGetCaptionSettings has diff --git a/cobalt/site/docs/reference/starboard/modules/window.md b/cobalt/site/docs/reference/starboard/modules/window.md index acea84d4c7d0..25845315aed4 100644 --- a/cobalt/site/docs/reference/starboard/modules/window.md +++ b/cobalt/site/docs/reference/starboard/modules/window.md @@ -95,20 +95,6 @@ that would be created to back that window. ## Functions -### SbWindowBlurOnScreenKeyboard - -Blur the on screen keyboard. Fire kSbEventTypeOnScreenKeyboardBlurred. -kSbEventTypeOnScreenKeyboardBlurred has data `ticket`. Calling -SbWindowBlurOnScreenKeyboard() when the keyboard is already blurred is -permitted. Calling SbWindowBlurOnScreenKeyboard while the on screen keyboard is -not showing does nothing and does not fire any event. - -#### Declaration - -``` -void SbWindowBlurOnScreenKeyboard(SbWindow window, int ticket) -``` - ### SbWindowCreate Creates and returns a new system window with the given `options`, which may be @@ -149,20 +135,6 @@ Destroys `window`, reclaiming associated resources. bool SbWindowDestroy(SbWindow window) ``` -### SbWindowFocusOnScreenKeyboard - -Focus the on screen keyboard. Fire kSbEventTypeOnScreenKeyboardFocused. -kSbEventTypeOnScreenKeyboardFocused has data `ticket`. Calling -SbWindowFocusOnScreenKeyboard() when the keyboard is already focused is -permitted. Calling SbWindowFocusOnScreenKeyboard while the on screen keyboard is -not showing does nothing and does not fire any event. - -#### Declaration - -``` -void SbWindowFocusOnScreenKeyboard(SbWindow window, int ticket) -``` - ### SbWindowGetDiagonalSizeInInches Gets the size of the diagonal between two opposing screen corners. @@ -176,18 +148,6 @@ is. float SbWindowGetDiagonalSizeInInches(SbWindow window) ``` -### SbWindowGetOnScreenKeyboardBoundingRect - -Get the rectangle of the on screen keyboard in screen pixel coordinates. Return -`true` if successful. Return `false` if the on screen keyboard is not showing. -If the function returns `false`, then `rect` will not have been modified. - -#### Declaration - -``` -bool SbWindowGetOnScreenKeyboardBoundingRect(SbWindow window, SbWindowRect *bounding_rect) -``` - ### SbWindowGetPlatformHandle Gets the platform-specific handle for `window`, which can be passed as an @@ -216,29 +176,6 @@ then `size` will not have been modified. bool SbWindowGetSize(SbWindow window, SbWindowSize *size) ``` -### SbWindowHideOnScreenKeyboard - -Hide the on screen keyboard. Fire kSbEventTypeWindowSizeChange and -kSbEventTypeOnScreenKeyboardHidden if necessary. -kSbEventTypeOnScreenKeyboardHidden has data `ticket`. Calling -SbWindowHideOnScreenKeyboard() when the keyboard is already hidden is permitted. - -#### Declaration - -``` -void SbWindowHideOnScreenKeyboard(SbWindow window, int ticket) -``` - -### SbWindowIsOnScreenKeyboardShown - -Determine if the on screen keyboard is shown. - -#### Declaration - -``` -bool SbWindowIsOnScreenKeyboardShown(SbWindow window) -``` - ### SbWindowIsValid Returns whether the given window handle is valid. @@ -249,28 +186,6 @@ Returns whether the given window handle is valid. static bool SbWindowIsValid(SbWindow window) ``` -### SbWindowOnScreenKeyboardIsSupported - -Return whether the current platform supports an on screen keyboard - -#### Declaration - -``` -bool SbWindowOnScreenKeyboardIsSupported() -``` - -### SbWindowOnScreenKeyboardSuggestionsSupported - -Determine if the on screen keyboard has suggestions implemented. If this returns -false, then calling SbWindowUpdateOnScreenKeyboardSuggestions() will be -undefined. - -#### Declaration - -``` -bool SbWindowOnScreenKeyboardSuggestionsSupported(SbWindow window) -``` - ### SbWindowSetDefaultOptions Sets the default options for system windows. @@ -283,48 +198,3 @@ Sets the default options for system windows. ``` void SbWindowSetDefaultOptions(SbWindowOptions *options) ``` - -### SbWindowSetOnScreenKeyboardKeepFocus - -Notify the system that `keepFocus` has been set for the OnScreenKeyboard. -`keepFocus` true indicates that the user may not navigate focus off of the -OnScreenKeyboard via input; focus may only be moved via events sent by the app. -`keepFocus` false indicates that the user may navigate focus off of the -OnScreenKeyboard via input. `keepFocus` is initialized to false in the -OnScreenKeyboard constructor. - -#### Declaration - -``` -void SbWindowSetOnScreenKeyboardKeepFocus(SbWindow window, bool keep_focus) -``` - -### SbWindowShowOnScreenKeyboard - -Show the on screen keyboard and populate the input with text `input_text`. Fire -kSbEventTypeWindowSizeChange and kSbEventTypeOnScreenKeyboardShown if necessary. -kSbEventTypeOnScreenKeyboardShown has data `ticket`. The passed in `input_text` -will never be NULL, but may be an empty string. Calling -SbWindowShowOnScreenKeyboard() when the keyboard is already shown is permitted, -and the input will be replaced with `input_text`. Showing the on screen keyboard -does not give it focus. - -#### Declaration - -``` -void SbWindowShowOnScreenKeyboard(SbWindow window, const char *input_text, int ticket) -``` - -### SbWindowUpdateOnScreenKeyboardSuggestions - -Update the on screen keyboard custom suggestions. Fire -kSbEventTypeOnScreenKeyboardSuggestionsUpdated. -kSbEventTypeOnScreenKeyboardSuggestionsUpdated has data `ticket`. The -suggestions should remain up-to-date when the keyboard is shown after being -hidden. - -#### Declaration - -``` -void SbWindowUpdateOnScreenKeyboardSuggestions(SbWindow window, const char *suggestions[], int num_suggestions, int ticket) -``` diff --git a/starboard/CHANGELOG.md b/starboard/CHANGELOG.md index 93494f0296f5..1d125cb1bb9f 100644 --- a/starboard/CHANGELOG.md +++ b/starboard/CHANGELOG.md @@ -9,6 +9,23 @@ since the version previous to it. ## Version 16 +## Deprecated `OnScreenKeyboard` +OnScreenKeyboard Starboard API has been deprecated, an extension in +`starboard/extension/on_screen_keyboard.h` is available instead. The removal +includes the following functions: +* `SbWindowBlurOnScreenKeyboard` +* `SbWindowFocusOnScreenKeyboard` +* `SbWindowGetOnScreenKeyboardBoundingRect` +* `SbWindowHideOnScreenKeyboard` +* `SbWindowIsOnScreenKeyboardShown` +* `SbWindowOnScreenKeyboardIsSupported` +* `SbWindowOnScreenKeyboardSuggestionsSupported` +* `SbWindowSetOnScreenKeyboardKeepFocus` +* `SbWindowShowOnScreenKeyboard` +* `SbWindowUpdateOnScreenKeyboardSuggestions` + +The config value of `SB_HAS_ON_SCREEN_KEYBOARD` is also removed. + ## Removed configs for `FILESYSTEM_ZERO_FILEINFO_TIME` and `COARSE_ACCESS_TIME` These are no longer used in Starboard and Cobalt. diff --git a/starboard/elf_loader/exported_symbols.cc b/starboard/elf_loader/exported_symbols.cc index bc133bdb8981..a537c4eea2e8 100644 --- a/starboard/elf_loader/exported_symbols.cc +++ b/starboard/elf_loader/exported_symbols.cc @@ -396,23 +396,31 @@ ExportedSymbols::ExportedSymbols() { REGISTER_SYMBOL(SbUserGetProperty); REGISTER_SYMBOL(SbUserGetPropertySize); REGISTER_SYMBOL(SbUserGetSignedIn); -#endif // SB_API_VERSION < 16 REGISTER_SYMBOL(SbWindowBlurOnScreenKeyboard); +#endif // SB_API_VERSION < 16 REGISTER_SYMBOL(SbWindowCreate); REGISTER_SYMBOL(SbWindowDestroy); +#if SB_API_VERSION < 16 REGISTER_SYMBOL(SbWindowFocusOnScreenKeyboard); +#endif // SB_API_VERSION < 16 REGISTER_SYMBOL(SbWindowGetDiagonalSizeInInches); +#if SB_API_VERSION < 16 REGISTER_SYMBOL(SbWindowGetOnScreenKeyboardBoundingRect); +#endif // SB_API_VERSION < 16 REGISTER_SYMBOL(SbWindowGetPlatformHandle); REGISTER_SYMBOL(SbWindowGetSize); +#if SB_API_VERSION < 16 REGISTER_SYMBOL(SbWindowHideOnScreenKeyboard); REGISTER_SYMBOL(SbWindowIsOnScreenKeyboardShown); REGISTER_SYMBOL(SbWindowOnScreenKeyboardIsSupported); REGISTER_SYMBOL(SbWindowOnScreenKeyboardSuggestionsSupported); +#endif // SB_API_VERSION < 16 REGISTER_SYMBOL(SbWindowSetDefaultOptions); +#if SB_API_VERSION < 16 REGISTER_SYMBOL(SbWindowSetOnScreenKeyboardKeepFocus); REGISTER_SYMBOL(SbWindowShowOnScreenKeyboard); REGISTER_SYMBOL(SbWindowUpdateOnScreenKeyboardSuggestions); +#endif // SB_API_VERSION < 16 #if SB_API_VERSION >= 16 // POSIX APIs diff --git a/starboard/event.h b/starboard/event.h index fcdd6511b2fd..b7f245559b3b 100644 --- a/starboard/event.h +++ b/starboard/event.h @@ -261,6 +261,7 @@ typedef enum SbEventType { // kSbEventOnScreenKeyboardInvalidTicket. kSbEventTypeOnScreenKeyboardBlurred, +#if SB_API_VERSION < 16 // The platform has updated the on screen keyboard suggestions. This event is // triggered by the system or by the application's OnScreenKeyboard update // suggestions method. The event has int data representing a ticket. The @@ -270,6 +271,10 @@ typedef enum SbEventType { // SbWindowUpdateOnScreenKeyboardSuggestions. System-triggered events have // ticket value kSbEventOnScreenKeyboardInvalidTicket. kSbEventTypeOnScreenKeyboardSuggestionsUpdated, +#else + // Reserved for deprecated events. + kSbEventTypeReserved1, +#endif // SB_API_VERSION < 16 // One or more of the fields returned by SbAccessibilityGetCaptionSettings // has changed. diff --git a/starboard/evergreen/arm/hardfp/configuration_public.h b/starboard/evergreen/arm/hardfp/configuration_public.h index 7a43d9edf6cf..bf27adea7f99 100644 --- a/starboard/evergreen/arm/hardfp/configuration_public.h +++ b/starboard/evergreen/arm/hardfp/configuration_public.h @@ -68,11 +68,6 @@ // the current linking unit. #define SB_IMPORT_PLATFORM -// --- I/O Configuration ----------------------------------------------------- - -// Whether the current platform implements the on screen keyboard interface. -#define SB_HAS_ON_SCREEN_KEYBOARD 0 - // --- Memory Configuration -------------------------------------------------- // Whether this platform can map executable memory. Implies SB_HAS_MMAP. This is diff --git a/starboard/evergreen/arm/softfp/configuration_public.h b/starboard/evergreen/arm/softfp/configuration_public.h index e1bdb61b802a..5d85c23440ab 100644 --- a/starboard/evergreen/arm/softfp/configuration_public.h +++ b/starboard/evergreen/arm/softfp/configuration_public.h @@ -68,11 +68,6 @@ // the current linking unit. #define SB_IMPORT_PLATFORM -// --- I/O Configuration ----------------------------------------------------- - -// Whether the current platform implements the on screen keyboard interface. -#define SB_HAS_ON_SCREEN_KEYBOARD 0 - // --- Memory Configuration -------------------------------------------------- // Whether this platform can map executable memory. Implies SB_HAS_MMAP. This is diff --git a/starboard/evergreen/arm64/configuration_public.h b/starboard/evergreen/arm64/configuration_public.h index 960d4c07a521..da64cd6466f3 100644 --- a/starboard/evergreen/arm64/configuration_public.h +++ b/starboard/evergreen/arm64/configuration_public.h @@ -68,11 +68,6 @@ // the current linking unit. #define SB_IMPORT_PLATFORM -// --- I/O Configuration ----------------------------------------------------- - -// Whether the current platform implements the on screen keyboard interface. -#define SB_HAS_ON_SCREEN_KEYBOARD 0 - // --- Memory Configuration -------------------------------------------------- // Whether this platform can map executable memory. Implies SB_HAS_MMAP. This is diff --git a/starboard/evergreen/x64/configuration_public.h b/starboard/evergreen/x64/configuration_public.h index 48109c572449..ffd5efde0a7d 100644 --- a/starboard/evergreen/x64/configuration_public.h +++ b/starboard/evergreen/x64/configuration_public.h @@ -68,11 +68,6 @@ // the current linking unit. #define SB_IMPORT_PLATFORM -// --- I/O Configuration ----------------------------------------------------- - -// Whether the current platform implements the on screen keyboard interface. -#define SB_HAS_ON_SCREEN_KEYBOARD 0 - // --- Memory Configuration -------------------------------------------------- // Whether this platform can map executable memory. Implies SB_HAS_MMAP. This is diff --git a/starboard/linux/x64x11/configuration_public.h b/starboard/linux/x64x11/configuration_public.h index d0ac0911b7b2..86fff33eb785 100644 --- a/starboard/linux/x64x11/configuration_public.h +++ b/starboard/linux/x64x11/configuration_public.h @@ -34,7 +34,4 @@ // Include the Linux configuration that's common between all Desktop Linuxes. #include "starboard/linux/shared/configuration_public.h" -// Whether the current platform implements the on screen keyboard interface. -#define SB_HAS_ON_SCREEN_KEYBOARD 0 - #endif // STARBOARD_LINUX_X64X11_CONFIGURATION_PUBLIC_H_ diff --git a/starboard/raspi/shared/configuration_public.h b/starboard/raspi/shared/configuration_public.h index cf5c07801272..c25e6c8fee27 100644 --- a/starboard/raspi/shared/configuration_public.h +++ b/starboard/raspi/shared/configuration_public.h @@ -64,11 +64,6 @@ // the current linking unit. #define SB_IMPORT_PLATFORM -// --- I/O Configuration ----------------------------------------------------- - -// Whether the current platform implements the on screen keyboard interface. -#define SB_HAS_ON_SCREEN_KEYBOARD 0 - // --- Memory Configuration -------------------------------------------------- // Whether this platform can map executable memory. Implies SB_HAS_MMAP. This is diff --git a/starboard/shared/stub/window_blur_on_screen_keyboard.cc b/starboard/shared/stub/window_blur_on_screen_keyboard.cc index d6ec34c755ac..389485ea8dd1 100644 --- a/starboard/shared/stub/window_blur_on_screen_keyboard.cc +++ b/starboard/shared/stub/window_blur_on_screen_keyboard.cc @@ -14,4 +14,8 @@ #include "starboard/window.h" +#if SB_API_VERSION < 16 + void SbWindowBlurOnScreenKeyboard(SbWindow window, int ticket) {} + +#endif // SB_API_VERSION < 16 diff --git a/starboard/shared/stub/window_focus_on_screen_keyboard.cc b/starboard/shared/stub/window_focus_on_screen_keyboard.cc index 95768e5810df..90d8e30e5a57 100644 --- a/starboard/shared/stub/window_focus_on_screen_keyboard.cc +++ b/starboard/shared/stub/window_focus_on_screen_keyboard.cc @@ -14,4 +14,8 @@ #include "starboard/window.h" +#if SB_API_VERSION < 16 + void SbWindowFocusOnScreenKeyboard(SbWindow window, int ticket) {} + +#endif // SB_API_VERSION < 16 diff --git a/starboard/shared/stub/window_get_on_screen_keyboard_bounding_rect.cc b/starboard/shared/stub/window_get_on_screen_keyboard_bounding_rect.cc index f79cdc17a4ad..4f34c6b4eaef 100644 --- a/starboard/shared/stub/window_get_on_screen_keyboard_bounding_rect.cc +++ b/starboard/shared/stub/window_get_on_screen_keyboard_bounding_rect.cc @@ -14,7 +14,11 @@ #include "starboard/window.h" +#if SB_API_VERSION < 16 + bool SbWindowGetOnScreenKeyboardBoundingRect(SbWindow window, SbWindowRect* bounding_rect) { return false; } + +#endif // SB_API_VERSION < 16 diff --git a/starboard/shared/stub/window_hide_on_screen_keyboard.cc b/starboard/shared/stub/window_hide_on_screen_keyboard.cc index 403fc7876bff..22d982c454ac 100644 --- a/starboard/shared/stub/window_hide_on_screen_keyboard.cc +++ b/starboard/shared/stub/window_hide_on_screen_keyboard.cc @@ -14,4 +14,8 @@ #include "starboard/window.h" +#if SB_API_VERSION < 16 + void SbWindowHideOnScreenKeyboard(SbWindow window, int ticket) {} + +#endif // SB_API_VERSION < 16 diff --git a/starboard/shared/stub/window_is_on_screen_keyboard_shown.cc b/starboard/shared/stub/window_is_on_screen_keyboard_shown.cc index c9900aea9926..1578d07fff2d 100644 --- a/starboard/shared/stub/window_is_on_screen_keyboard_shown.cc +++ b/starboard/shared/stub/window_is_on_screen_keyboard_shown.cc @@ -14,6 +14,10 @@ #include "starboard/window.h" +#if SB_API_VERSION < 16 + bool SbWindowIsOnScreenKeyboardShown(SbWindow window) { return false; } + +#endif // SB_API_VERSION < 16 diff --git a/starboard/shared/stub/window_on_screen_keyboard_is_supported.cc b/starboard/shared/stub/window_on_screen_keyboard_is_supported.cc index 5388180cfd88..007245bd06ab 100644 --- a/starboard/shared/stub/window_on_screen_keyboard_is_supported.cc +++ b/starboard/shared/stub/window_on_screen_keyboard_is_supported.cc @@ -14,6 +14,10 @@ #include "starboard/window.h" +#if SB_API_VERSION < 16 + bool SbWindowOnScreenKeyboardIsSupported() { return false; } + +#endif // SB_API_VERSION < 16 diff --git a/starboard/shared/stub/window_on_screen_keyboard_suggestions_supported.cc b/starboard/shared/stub/window_on_screen_keyboard_suggestions_supported.cc index e18a7c8126f7..6b4fefd5d4a0 100644 --- a/starboard/shared/stub/window_on_screen_keyboard_suggestions_supported.cc +++ b/starboard/shared/stub/window_on_screen_keyboard_suggestions_supported.cc @@ -14,6 +14,10 @@ #include "starboard/window.h" +#if SB_API_VERSION < 16 + bool SbWindowOnScreenKeyboardSuggestionsSupported(SbWindow window) { return false; } + +#endif // SB_API_VERSION < 16 diff --git a/starboard/shared/stub/window_set_on_screen_keyboard_keep_focus.cc b/starboard/shared/stub/window_set_on_screen_keyboard_keep_focus.cc index 78be96e94670..3a61e02db64c 100644 --- a/starboard/shared/stub/window_set_on_screen_keyboard_keep_focus.cc +++ b/starboard/shared/stub/window_set_on_screen_keyboard_keep_focus.cc @@ -14,4 +14,8 @@ #include "starboard/window.h" +#if SB_API_VERSION < 16 + void SbWindowSetOnScreenKeyboardKeepFocus(SbWindow window, bool keep_focus) {} + +#endif // SB_API_VERSION < 16 diff --git a/starboard/shared/stub/window_show_on_screen_keyboard.cc b/starboard/shared/stub/window_show_on_screen_keyboard.cc index 579972fb1619..7ffca5fa6e91 100644 --- a/starboard/shared/stub/window_show_on_screen_keyboard.cc +++ b/starboard/shared/stub/window_show_on_screen_keyboard.cc @@ -14,6 +14,10 @@ #include "starboard/window.h" +#if SB_API_VERSION < 16 + void SbWindowShowOnScreenKeyboard(SbWindow window, const char* input_text, int ticket) {} + +#endif // SB_API_VERSION < 16 diff --git a/starboard/shared/stub/window_update_on_screen_keyboard_suggestions.cc b/starboard/shared/stub/window_update_on_screen_keyboard_suggestions.cc index 96f3ea2d0342..3ad65ba87da7 100644 --- a/starboard/shared/stub/window_update_on_screen_keyboard_suggestions.cc +++ b/starboard/shared/stub/window_update_on_screen_keyboard_suggestions.cc @@ -14,7 +14,11 @@ #include "starboard/window.h" +#if SB_API_VERSION < 16 + void SbWindowUpdateOnScreenKeyboardSuggestions(SbWindow window, const char* suggestions[], int num_suggestions, int ticket) {} + +#endif // SB_API_VERSION < 16 diff --git a/starboard/stub/configuration_public.h b/starboard/stub/configuration_public.h index ec0330cbfe68..8c6204941691 100644 --- a/starboard/stub/configuration_public.h +++ b/starboard/stub/configuration_public.h @@ -69,11 +69,6 @@ // the current linking unit. #define SB_IMPORT_PLATFORM -// --- I/O Configuration ----------------------------------------------------- - -// Whether the current platform implements the on screen keyboard interface. -#define SB_HAS_ON_SCREEN_KEYBOARD 0 - // --- Media Configuration --------------------------------------------------- // The implementation is allowed to support kSbMediaAudioSampleTypeInt16 only diff --git a/starboard/win/shared/configuration_public.h b/starboard/win/shared/configuration_public.h index 3cf78a3efbd7..e55dde3687e5 100644 --- a/starboard/win/shared/configuration_public.h +++ b/starboard/win/shared/configuration_public.h @@ -71,11 +71,6 @@ // the current linking unit. #define SB_IMPORT_PLATFORM -// --- I/O Configuration ----------------------------------------------------- - -// Whether the current platform supports on screen keyboard. -#define SB_HAS_ON_SCREEN_KEYBOARD 0 - // --- Memory Configuration -------------------------------------------------- // Whether this platform can map executable memory. Implies SB_HAS_MMAP. This is diff --git a/starboard/window.h b/starboard/window.h index bbd7bc2114ce..4576cafa507e 100644 --- a/starboard/window.h +++ b/starboard/window.h @@ -139,10 +139,12 @@ SB_EXPORT void* SbWindowGetPlatformHandle(SbWindow window); // System-triggered OnScreenKeyboard events have ticket value // kSbEventOnScreenKeyboardInvalidTicket. +// TODO(b/151173891): This should be moved to the extension header #define kSbEventOnScreenKeyboardInvalidTicket (-1) // Defines a rectangle via a point |(x, y)| and a size |(width, height)|. This // structure is used as output for SbWindowGetOnScreenKeyboardBoundingRect. +// TODO(b/151173891): This should be moved to the extension header typedef struct SbWindowRect { float x; float y; @@ -150,6 +152,8 @@ typedef struct SbWindowRect { float height; } SbWindowRect; +#if SB_API_VERSION < 16 + // Return whether the current platform supports an on screen keyboard SB_EXPORT bool SbWindowOnScreenKeyboardIsSupported(); @@ -221,6 +225,8 @@ SB_EXPORT void SbWindowUpdateOnScreenKeyboardSuggestions( // be undefined. SB_EXPORT bool SbWindowOnScreenKeyboardSuggestionsSupported(SbWindow window); +#endif // SB_API_VERSION < 16 + #ifdef __cplusplus } // extern "C" #endif