diff options
Diffstat (limited to 'ppapi/thunk')
-rw-r--r-- | ppapi/thunk/interfaces_ppb_public_dev.h | 5 | ||||
-rw-r--r-- | ppapi/thunk/ppb_instance_api.h | 14 | ||||
-rw-r--r-- | ppapi/thunk/ppb_text_input_api.h | 36 | ||||
-rw-r--r-- | ppapi/thunk/ppb_text_input_thunk.cc | 12 |
4 files changed, 22 insertions, 45 deletions
diff --git a/ppapi/thunk/interfaces_ppb_public_dev.h b/ppapi/thunk/interfaces_ppb_public_dev.h index 73006ce..3b79fe4 100644 --- a/ppapi/thunk/interfaces_ppb_public_dev.h +++ b/ppapi/thunk/interfaces_ppb_public_dev.h @@ -14,7 +14,6 @@ PROXIED_API(PPB_FileChooser) PROXIED_API(PPB_Graphics3D) UNPROXIED_API(PPB_LayerCompositor) UNPROXIED_API(PPB_Scrollbar) -PROXIED_API(PPB_TextInput) UNPROXIED_API(PPB_Transport) PROXIED_API(PPB_VideoCapture) PROXIED_API(PPB_VideoDecoder) @@ -55,9 +54,9 @@ PROXIED_IFACE(NoAPIName, PPB_RESOURCEARRAY_DEV_INTERFACE_0_1, PPB_ResourceArray_Dev_0_1) UNPROXIED_IFACE(PPB_Scrollbar, PPB_SCROLLBAR_DEV_INTERFACE_0_5, PPB_Scrollbar_Dev_0_5) -PROXIED_IFACE(PPB_TextInput, PPB_TEXTINPUT_DEV_INTERFACE_0_1, +PROXIED_IFACE(PPB_Instance, PPB_TEXTINPUT_DEV_INTERFACE_0_1, PPB_TextInput_Dev_0_1) -PROXIED_IFACE(PPB_TextInput, PPB_TEXTINPUT_DEV_INTERFACE_0_2, +PROXIED_IFACE(PPB_Instance, PPB_TEXTINPUT_DEV_INTERFACE_0_2, PPB_TextInput_Dev_0_2) UNPROXIED_IFACE(PPB_Transport, PPB_TRANSPORT_DEV_INTERFACE_0_7, PPB_Transport_Dev_0_7) diff --git a/ppapi/thunk/ppb_instance_api.h b/ppapi/thunk/ppb_instance_api.h index 05ebe8b..6a51648 100644 --- a/ppapi/thunk/ppb_instance_api.h +++ b/ppapi/thunk/ppb_instance_api.h @@ -6,6 +6,7 @@ #define PPAPI_THUNK_INSTANCE_API_H_ #include "ppapi/c/dev/ppb_console_dev.h" +#include "ppapi/c/dev/ppb_text_input_dev.h" #include "ppapi/c/dev/ppb_url_util_dev.h" #include "ppapi/c/pp_bool.h" #include "ppapi/c/pp_completion_callback.h" @@ -110,6 +111,19 @@ class PPB_Instance_FunctionAPI { PP_CompletionCallback callback) = 0; virtual void UnlockMouse(PP_Instance instance) = 0; + // TextInput. + virtual void SetTextInputType(PP_Instance instance, + PP_TextInput_Type type) = 0; + virtual void UpdateCaretPosition(PP_Instance instance, + const PP_Rect& caret, + const PP_Rect& bounding_box) = 0; + virtual void CancelCompositionText(PP_Instance instance) = 0; + virtual void SelectionChanged(PP_Instance instance) = 0; + virtual void UpdateSurroundingText(PP_Instance instance, + const char* text, + uint32_t caret, + uint32_t anchor) = 0; + // Zoom. virtual void ZoomChanged(PP_Instance instance, double factor) = 0; virtual void ZoomLimitsChanged(PP_Instance instance, diff --git a/ppapi/thunk/ppb_text_input_api.h b/ppapi/thunk/ppb_text_input_api.h deleted file mode 100644 index 65589a0..0000000 --- a/ppapi/thunk/ppb_text_input_api.h +++ /dev/null @@ -1,36 +0,0 @@ -// 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 PPAPI_THUNK_PPB_TEXT_INPUT_API_H_ -#define PPAPI_THUNK_PPB_TEXT_INPUT_API_H_ - -#include "ppapi/c/dev/ppb_text_input_dev.h" -#include "ppapi/shared_impl/api_id.h" - -namespace ppapi { -namespace thunk { - -class PPB_TextInput_FunctionAPI { - public: - virtual ~PPB_TextInput_FunctionAPI() {} - - virtual void SetTextInputType(PP_Instance instance, - PP_TextInput_Type type) = 0; - virtual void UpdateCaretPosition(PP_Instance instance, - const PP_Rect& caret, - const PP_Rect& bounding_box) = 0; - virtual void CancelCompositionText(PP_Instance instance) = 0; - virtual void SelectionChanged(PP_Instance instance) = 0; - virtual void UpdateSurroundingText(PP_Instance instance, - const char* text, - uint32_t caret, - uint32_t anchor) = 0; - - static const ApiID kApiID = API_ID_PPB_TEXT_INPUT; -}; - -} // namespace thunk -} // namespace ppapi - -#endif // PPAPI_THUNK_PPB_TEXT_INPUT_API_H_ diff --git a/ppapi/thunk/ppb_text_input_thunk.cc b/ppapi/thunk/ppb_text_input_thunk.cc index b5b1753..7d35e2a 100644 --- a/ppapi/thunk/ppb_text_input_thunk.cc +++ b/ppapi/thunk/ppb_text_input_thunk.cc @@ -4,7 +4,7 @@ #include "ppapi/thunk/enter.h" #include "ppapi/thunk/thunk.h" -#include "ppapi/thunk/ppb_text_input_api.h" +#include "ppapi/thunk/ppb_instance_api.h" namespace ppapi { namespace thunk { @@ -12,7 +12,7 @@ namespace thunk { namespace { void SetTextInputType(PP_Instance instance, PP_TextInput_Type type) { - EnterFunction<PPB_TextInput_FunctionAPI> enter(instance, true); + EnterInstance enter(instance); if (enter.succeeded()) enter.functions()->SetTextInputType(instance, type); } @@ -20,26 +20,26 @@ void SetTextInputType(PP_Instance instance, PP_TextInput_Type type) { void UpdateCaretPosition(PP_Instance instance, const PP_Rect* caret, const PP_Rect* bounding_box) { - EnterFunction<PPB_TextInput_FunctionAPI> enter(instance, true); + EnterInstance enter(instance); if (enter.succeeded() && caret && bounding_box) enter.functions()->UpdateCaretPosition(instance, *caret, *bounding_box); } void CancelCompositionText(PP_Instance instance) { - EnterFunction<PPB_TextInput_FunctionAPI> enter(instance, true); + EnterInstance enter(instance); if (enter.succeeded()) enter.functions()->CancelCompositionText(instance); } void UpdateSurroundingText(PP_Instance instance, const char* text, uint32_t caret, uint32_t anchor) { - EnterFunction<PPB_TextInput_FunctionAPI> enter(instance, true); + EnterInstance enter(instance); if (enter.succeeded()) enter.functions()->UpdateSurroundingText(instance, text, caret, anchor); } void SelectionChanged(PP_Instance instance) { - EnterFunction<PPB_TextInput_FunctionAPI> enter(instance, true); + EnterInstance enter(instance); if (enter.succeeded()) enter.functions()->SelectionChanged(instance); } |