From 2daba2f3623744b78f1880d8ebb0a673d03f52d3 Mon Sep 17 00:00:00 2001 From: "kinaba@chromium.org" Date: Thu, 29 Sep 2011 04:23:09 +0000 Subject: Additional update on Pepper IME API and boilerplate thunk/proxy implementation. BUG=59425 TEST=Check that ppapi_tests compile (with GYP_DEFINES=shared_library, too). 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/8059006 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@103234 0039d316-1c4b-4281-b951-d872f2087c98 --- ppapi/api/dev/ppb_ime_input_event_dev.idl | 29 ++++++++++++----------------- 1 file changed, 12 insertions(+), 17 deletions(-) (limited to 'ppapi/api/dev/ppb_ime_input_event_dev.idl') diff --git a/ppapi/api/dev/ppb_ime_input_event_dev.idl b/ppapi/api/dev/ppb_ime_input_event_dev.idl index 6899008..6f484e2 100644 --- a/ppapi/api/dev/ppb_ime_input_event_dev.idl +++ b/ppapi/api/dev/ppb_ime_input_event_dev.idl @@ -46,30 +46,25 @@ interface PPB_IMEInputEvent_Dev { uint32_t GetSegmentNumber([in] PP_Resource ime_event); /** - * GetSegmentAt() returns the start and the end position of the index-th - * segment in the composition text. The positions are given by byte-offsets - * (not character-offsets) of the string returned by GetText(). The range of - * the segment extends from start (inclusive) to end (exclusive). They satisfy - * 0 <= start < end <= (byte-length of GetText()). When the event is not - * COMPOSITION_UPDATE or index >= GetSegmentNumber(), the function returns - * PP_FALSE and nothing else happens. + * GetSegmentOffset() returns the position of the index-th segmentation point + * in the composition text. The position is given by a byte-offset (not a + * character-offset) of the string returned by GetText(). It always satisfies + * 0=GetSegmentOffset(0) < ... < GetSegmentOffset(i) < GetSegmentOffset(i+1) + * < ... < GetSegmentOffset(GetSegmentNumber())=(byte-length of GetText()). + * Note that [GetSegmentOffset(i), GetSegmentOffset(i+1)) represents the range + * of the i-th segment, and hence GetSegmentNumber() can be a valid argument + * to this function instead of an off-by-1 error. * * @param[in] ime_event A PP_Resource corresponding to an IME * event. * * @param[in] index An integer indicating a segment. * - * @param[out] start The start position of the index-th segment. - * - * @param[out] end The end position of the index-th segment. - * - * @return PP_TRUE when the start and the end position is successfully - * obtained, and PP_FALSE otherwise. + * @return The byte-offset of the segmentation point. If the event is not + * COMPOSITION_UPDATE or index is out of range, returns 0. */ - PP_Bool GetSegmentAt([in] PP_Resource ime_event, - [in] uint32_t index, - [out] uint32_t start, - [out] uint32_t end); + uint32_t GetSegmentOffset([in] PP_Resource ime_event, + [in] uint32_t index); /** * GetTargetSegment() returns the index of the current target segment of -- cgit v1.1