diff options
author | kinaba@chromium.org <kinaba@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-27 08:35:55 +0000 |
---|---|---|
committer | kinaba@chromium.org <kinaba@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-27 08:35:55 +0000 |
commit | 40fbffa6a1d8cc0aa6adb8e71725fea954d0eb17 (patch) | |
tree | 5e37fa314f54e15dd72c9a28cb1bad463800a00e /ppapi/thunk | |
parent | a5bd413ae6ca86fce6922fcd19c111eaeb7232f4 (diff) | |
download | chromium_src-40fbffa6a1d8cc0aa6adb8e71725fea954d0eb17.zip chromium_src-40fbffa6a1d8cc0aa6adb8e71725fea954d0eb17.tar.gz chromium_src-40fbffa6a1d8cc0aa6adb8e71725fea954d0eb17.tar.bz2 |
Revert 102897 - Additional update on Pepper IME API and boilerplate thunk/proxy implementation.
BUG=59425
TEST=Check that ppapi_tests compile.
This CL is the second (out of three) part for adding IME support for PPAPI.
It reflects comments from James Su to the previous CL:
http://codereview.chromium.org/7882004.
- Renamed ..._COMPOSTION_START to _IME_COMPOSITON_START.
- Changed to assure GetSegment to return a strictly increasing sequence of
segmentation points from 0 to the length.
and,
- Added the mostly boilerplate code for interfacing with
in-process & out-of-process plugins.
The actual implementation of the IME support will come as
the next and the last part of this series of patches.
Review URL: http://codereview.chromium.org/7978019
TBR=kinaba@chromium.org
Review URL: http://codereview.chromium.org/8060005
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@102900 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/thunk')
-rw-r--r-- | ppapi/thunk/interfaces_ppb_public_dev.h | 5 | ||||
-rw-r--r-- | ppapi/thunk/ppb_input_event_api.h | 5 | ||||
-rw-r--r-- | ppapi/thunk/ppb_input_event_thunk.cc | 62 | ||||
-rw-r--r-- | ppapi/thunk/ppb_text_input_api.h | 32 | ||||
-rw-r--r-- | ppapi/thunk/ppb_text_input_thunk.cc | 46 | ||||
-rw-r--r-- | ppapi/thunk/thunk.h | 2 |
6 files changed, 0 insertions, 152 deletions
diff --git a/ppapi/thunk/interfaces_ppb_public_dev.h b/ppapi/thunk/interfaces_ppb_public_dev.h index 8231027..9e18cda 100644 --- a/ppapi/thunk/interfaces_ppb_public_dev.h +++ b/ppapi/thunk/interfaces_ppb_public_dev.h @@ -18,14 +18,11 @@ PROXIED_API(PPB_Graphics3D) UNPROXIED_API(PPB_LayerCompositor) UNPROXIED_API(PPB_Scrollbar) PROXIED_API(PPB_Surface3D) -PROXIED_API(PPB_TextInput) UNPROXIED_API(PPB_Transport) PROXIED_API(PPB_VideoCapture) PROXIED_API(PPB_VideoDecoder) UNPROXIED_API(PPB_Widget) -PROXIED_IFACE(NoAPIName, PPB_IME_INPUT_EVENT_DEV_INTERFACE_0_1, - PPB_IMEInputEvent_Dev) PROXIED_IFACE(PPB_Buffer, PPB_BUFFER_DEV_INTERFACE_0_4, PPB_Buffer_Dev) PROXIED_IFACE(PPB_CharSet, PPB_CHAR_SET_DEV_INTERFACE_0_4, PPB_CharSet_Dev) PROXIED_IFACE(PPB_Context3D, PPB_CONTEXT_3D_DEV_INTERFACE_0_1, @@ -53,8 +50,6 @@ UNPROXIED_IFACE(PPB_Scrollbar, PPB_SCROLLBAR_DEV_INTERFACE_0_5, PPB_Scrollbar_0_5_Dev) PROXIED_IFACE(PPB_Surface3D, PPB_SURFACE_3D_DEV_INTERFACE_0_2, PPB_Surface3D_Dev) -PROXIED_IFACE(PPB_TextInput, PPB_TEXTINPUT_DEV_INTERFACE_0_1, - PPB_TextInput_Dev) UNPROXIED_IFACE(PPB_Transport, PPB_TRANSPORT_DEV_INTERFACE_0_7, PPB_Transport_Dev) PROXIED_IFACE(PPB_VideoCapture, PPB_VIDEO_CAPTURE_DEV_INTERFACE_0_1, diff --git a/ppapi/thunk/ppb_input_event_api.h b/ppapi/thunk/ppb_input_event_api.h index f23c795..28b6c58 100644 --- a/ppapi/thunk/ppb_input_event_api.h +++ b/ppapi/thunk/ppb_input_event_api.h @@ -5,7 +5,6 @@ #ifndef PPAPI_THUNK_PPB_INPUT_EVENT_API_H_ #define PPAPI_THUNK_PPB_INPUT_EVENT_API_H_ -#include "ppapi/c/dev/ppb_ime_input_event_dev.h" #include "ppapi/c/ppb_input_event.h" #include "ppapi/thunk/ppapi_thunk_export.h" @@ -35,10 +34,6 @@ class PPAPI_THUNK_EXPORT PPB_InputEvent_API { virtual PP_Bool GetWheelScrollByPage() = 0; virtual uint32_t GetKeyCode() = 0; virtual PP_Var GetCharacterText() = 0; - virtual uint32_t GetIMESegmentNumber() = 0; - virtual uint32_t GetIMESegmentOffset(uint32_t index) = 0; - virtual int32_t GetIMETargetSegment() = 0; - virtual void GetIMESelection(uint32_t* start, uint32_t* end) = 0; }; } // namespace thunk diff --git a/ppapi/thunk/ppb_input_event_thunk.cc b/ppapi/thunk/ppb_input_event_thunk.cc index 7c8820a..6028c6e 100644 --- a/ppapi/thunk/ppb_input_event_thunk.cc +++ b/ppapi/thunk/ppb_input_event_thunk.cc @@ -271,64 +271,6 @@ const PPB_KeyboardInputEvent g_ppb_keyboard_input_event_thunk = { &GetCharacterText }; -// Composition ----------------------------------------------------------------- - -PP_Bool IsIMEInputEvent(PP_Resource resource) { - if (!IsInputEvent(resource)) - return PP_FALSE; // Prevent warning log in GetType. - PP_InputEvent_Type type = GetType(resource); - return PP_FromBool(type == PP_INPUTEVENT_TYPE_IME_COMPOSITION_START || - type == PP_INPUTEVENT_TYPE_IME_COMPOSITION_UPDATE || - type == PP_INPUTEVENT_TYPE_IME_COMPOSITION_END || - type == PP_INPUTEVENT_TYPE_IME_TEXT); -} - -PP_Var GetIMEText(PP_Resource ime_event) { - return GetCharacterText(ime_event); -} - -uint32_t GetIMESegmentNumber(PP_Resource ime_event) { - EnterInputEvent enter(ime_event, true); - if (enter.failed()) - return 0; - return enter.object()->GetIMESegmentNumber(); -} - -uint32_t GetIMESegmentOffset(PP_Resource ime_event, uint32_t index) { - EnterInputEvent enter(ime_event, true); - if (enter.failed()) - return 0; - return enter.object()->GetIMESegmentOffset(index); -} - -int32_t GetIMETargetSegment(PP_Resource ime_event) { - EnterInputEvent enter(ime_event, true); - if (enter.failed()) - return -1; - return enter.object()->GetIMETargetSegment(); -} - -void GetIMESelection(PP_Resource ime_event, uint32_t* start, uint32_t* end) { - EnterInputEvent enter(ime_event, true); - if (enter.failed()) { - if (start) - *start = 0; - if (end) - *end = 0; - return; - } - enter.object()->GetIMESelection(start, end); -} - -const PPB_IMEInputEvent_Dev g_ppb_ime_input_event_thunk = { - &IsIMEInputEvent, - &GetIMEText, - &GetIMESegmentNumber, - &GetIMESegmentOffset, - &GetIMETargetSegment, - &GetIMESelection -}; - } // namespace const PPB_InputEvent* GetPPB_InputEvent_Thunk() { @@ -351,9 +293,5 @@ const PPB_WheelInputEvent* GetPPB_WheelInputEvent_Thunk() { return &g_ppb_wheel_input_event_thunk; } -const PPB_IMEInputEvent_Dev* GetPPB_IMEInputEvent_Dev_Thunk() { - return &g_ppb_ime_input_event_thunk; -} - } // namespace thunk } // namespace ppapi diff --git a/ppapi/thunk/ppb_text_input_api.h b/ppapi/thunk/ppb_text_input_api.h deleted file mode 100644 index 9d91833..0000000 --- a/ppapi/thunk/ppb_text_input_api.h +++ /dev/null @@ -1,32 +0,0 @@ -// Copyright (c) 2011 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/proxy/interface_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; - - static const proxy::InterfaceID interface_id = - proxy::INTERFACE_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 deleted file mode 100644 index b0bdd15..0000000 --- a/ppapi/thunk/ppb_text_input_thunk.cc +++ /dev/null @@ -1,46 +0,0 @@ -// Copyright (c) 2011 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 "ppapi/thunk/enter.h" -#include "ppapi/thunk/ppb_text_input_api.h" - -namespace ppapi { -namespace thunk { - -namespace { - -void SetTextInputType(PP_Instance instance, PP_TextInput_Type type) { - EnterFunction<PPB_TextInput_FunctionAPI> enter(instance, true); - if (enter.succeeded()) - enter.functions()->SetTextInputType(instance, type); -} - -void UpdateCaretPosition(PP_Instance instance, - const PP_Rect* caret, - const PP_Rect* bounding_box) { - EnterFunction<PPB_TextInput_FunctionAPI> enter(instance, true); - 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); - if (enter.succeeded()) - enter.functions()->CancelCompositionText(instance); -} - -const PPB_TextInput_Dev g_ppb_textinput_thunk = { - &SetTextInputType, - &UpdateCaretPosition, - &CancelCompositionText, -}; - -} // namespace - -const PPB_TextInput_Dev* GetPPB_TextInput_Dev_Thunk() { - return &g_ppb_textinput_thunk; -} - -} // namespace thunk -} // namespace ppapi diff --git a/ppapi/thunk/thunk.h b/ppapi/thunk/thunk.h index 1130a0c..fe90eff 100644 --- a/ppapi/thunk/thunk.h +++ b/ppapi/thunk/thunk.h @@ -41,7 +41,6 @@ struct PPB_Graphics3DTrusted; struct PPB_ImageDataTrusted; struct PPB_Instance_Private; struct PPB_QueryPolicy_Dev; -struct PPB_TextInput_Dev; struct PPB_URLLoaderTrusted; typedef PPB_Instance PPB_Instance_1_0; @@ -68,7 +67,6 @@ PPAPI_THUNK_EXPORT const PPB_Graphics3DTrusted* PPAPI_THUNK_EXPORT const PPB_ImageDataTrusted* GetPPB_ImageDataTrusted_Thunk(); PPAPI_THUNK_EXPORT const PPB_Instance_Private* GetPPB_Instance_Private_Thunk(); PPAPI_THUNK_EXPORT const PPB_QueryPolicy_Dev* GetPPB_QueryPolicy_Thunk(); -PPAPI_THUNK_EXPORT const PPB_TextInput_Dev* GetPPB_TextInput_Thunk(); PPAPI_THUNK_EXPORT const PPB_URLLoaderTrusted* GetPPB_URLLoaderTrusted_Thunk(); } // namespace thunk |