diff options
author | kinaba@chromium.org <kinaba@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-27 08:22:03 +0000 |
---|---|---|
committer | kinaba@chromium.org <kinaba@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-09-27 08:22:03 +0000 |
commit | a5bd413ae6ca86fce6922fcd19c111eaeb7232f4 (patch) | |
tree | 53e953e110155169b190daff3ca8721661ae9516 /ppapi/c | |
parent | bec2695b1a4faad59f6c71d777032af5f04042bc (diff) | |
download | chromium_src-a5bd413ae6ca86fce6922fcd19c111eaeb7232f4.zip chromium_src-a5bd413ae6ca86fce6922fcd19c111eaeb7232f4.tar.gz chromium_src-a5bd413ae6ca86fce6922fcd19c111eaeb7232f4.tar.bz2 |
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
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@102897 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ppapi/c')
-rw-r--r-- | ppapi/c/dev/ppb_ime_input_event_dev.h | 30 | ||||
-rw-r--r-- | ppapi/c/dev/ppb_text_input_dev.h | 6 | ||||
-rw-r--r-- | ppapi/c/ppb_input_event.h | 8 |
3 files changed, 17 insertions, 27 deletions
diff --git a/ppapi/c/dev/ppb_ime_input_event_dev.h b/ppapi/c/dev/ppb_ime_input_event_dev.h index 0131632..519a301 100644 --- a/ppapi/c/dev/ppb_ime_input_event_dev.h +++ b/ppapi/c/dev/ppb_ime_input_event_dev.h @@ -3,7 +3,7 @@ * found in the LICENSE file. */ -/* From dev/ppb_ime_input_event_dev.idl modified Thu Sep 15 17:06:09 2011. */ +/* From dev/ppb_ime_input_event_dev.idl modified Wed Sep 21 12:31:56 2011. */ #ifndef PPAPI_C_DEV_PPB_IME_INPUT_EVENT_DEV_H_ #define PPAPI_C_DEV_PPB_IME_INPUT_EVENT_DEV_H_ @@ -58,30 +58,24 @@ struct PPB_IMEInputEvent_Dev { */ uint32_t (*GetSegmentNumber)(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 <code>PP_Resource</code> 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)(PP_Resource ime_event, - uint32_t index, - uint32_t* start, - uint32_t* end); + uint32_t (*GetSegmentOffset)(PP_Resource ime_event, uint32_t index); /** * GetTargetSegment() returns the index of the current target segment of * composition. diff --git a/ppapi/c/dev/ppb_text_input_dev.h b/ppapi/c/dev/ppb_text_input_dev.h index 51c990e..3eca1a3 100644 --- a/ppapi/c/dev/ppb_text_input_dev.h +++ b/ppapi/c/dev/ppb_text_input_dev.h @@ -3,7 +3,7 @@ * found in the LICENSE file. */ -/* From dev/ppb_text_input_dev.idl modified Wed Sep 14 12:51:46 2011. */ +/* From dev/ppb_text_input_dev.idl modified Tue Sep 27 14:34:33 2011. */ #ifndef PPAPI_C_DEV_PPB_TEXT_INPUT_DEV_H_ #define PPAPI_C_DEV_PPB_TEXT_INPUT_DEV_H_ @@ -84,10 +84,6 @@ struct PPB_TextInput_Dev { const struct PP_Rect* caret, const struct PP_Rect* bounding_box); /** - * Forces to commit the current composition text in IME. - */ - void (*ConfirmCompositionText)(PP_Instance instance); - /** * Cancels the current composition in IME. */ void (*CancelCompositionText)(PP_Instance instance); diff --git a/ppapi/c/ppb_input_event.h b/ppapi/c/ppb_input_event.h index 21b7c12..8348ffe 100644 --- a/ppapi/c/ppb_input_event.h +++ b/ppapi/c/ppb_input_event.h @@ -3,7 +3,7 @@ * found in the LICENSE file. */ -/* From ppb_input_event.idl modified Wed Sep 14 12:46:14 2011. */ +/* From ppb_input_event.idl modified Wed Sep 21 12:32:06 2011. */ #ifndef PPAPI_C_PPB_INPUT_EVENT_H_ #define PPAPI_C_PPB_INPUT_EVENT_H_ @@ -123,19 +123,19 @@ typedef enum { * * Register for this event using the PP_INPUTEVENT_CLASS_IME class. */ - PP_INPUTEVENT_TYPE_COMPOSITION_START = 11, + PP_INPUTEVENT_TYPE_IME_COMPOSITION_START = 11, /** * Notification that the input method composition string is updated. * * Register for this event using the PP_INPUTEVENT_CLASS_IME class. */ - PP_INPUTEVENT_TYPE_COMPOSITION_UPDATE = 12, + PP_INPUTEVENT_TYPE_IME_COMPOSITION_UPDATE = 12, /** * Notification that an input method composition process has completed. * * Register for this event using the PP_INPUTEVENT_CLASS_IME class. */ - PP_INPUTEVENT_TYPE_COMPOSITION_END = 13, + PP_INPUTEVENT_TYPE_IME_COMPOSITION_END = 13, /** * Notification that an input method committed a string. * |