Skip to content

Commit

Permalink
Cherry pick PR #2864: Move kSbEventOnScreenKeyboardInvalidTicket, str…
Browse files Browse the repository at this point in the history
…uct SbWindowRect into the on_screen_keyboard.h (#3319)

Refer to the original PR: #2864

Migrate kSbEventOnScreenKeyboardInvalidTicket, struct SbWindowRect out
of starboard/window.h and into the extension header in
starboard/extension/on_screen_keyboard.h

b/151173891

Change-Id: Ifd74bf6a2a3781ff3976239314ef0fcfe8c5b487

Co-authored-by: iuriionishchenko <[email protected]>
  • Loading branch information
1 parent 415259b commit 93eb084
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 4 deletions.
17 changes: 17 additions & 0 deletions starboard/extension/on_screen_keyboard.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,23 @@ extern "C" {
#define kCobaltExtensionOnScreenKeyboardName \
"dev.cobalt.extension.OnScreenKeyboard"

#if SB_API_VERSION >= 16

// System-triggered OnScreenKeyboard events have ticket value
// kSbEventOnScreenKeyboardInvalidTicket.
#define kSbEventOnScreenKeyboardInvalidTicket (-1)

// Defines a rectangle via a point |(x, y)| and a size |(width, height)|. This
// structure is used as output for GetBoundingRect.
typedef struct SbWindowRect {
float x;
float y;
float width;
float height;
} SbWindowRect;

#endif // #if SB_API_VERSION >= 16

typedef struct CobaltExtensionOnScreenKeyboardApi {
// Name should be the string
// |kCobaltExtensionOnScreenKeyboardName|. This helps to validate that
Expand Down
6 changes: 2 additions & 4 deletions starboard/window.h
Original file line number Diff line number Diff line change
Expand Up @@ -137,23 +137,21 @@ SB_EXPORT bool SbWindowGetSize(SbWindow window, SbWindowSize* size);
// |window|: The SbWindow to retrieve the platform handle for.
SB_EXPORT void* SbWindowGetPlatformHandle(SbWindow window);

#if SB_API_VERSION < 16

// 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;
float width;
float height;
} SbWindowRect;

#if SB_API_VERSION < 16

// Return whether the current platform supports an on screen keyboard
SB_EXPORT bool SbWindowOnScreenKeyboardIsSupported();

Expand Down

0 comments on commit 93eb084

Please sign in to comment.