Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1038)

Unified Diff: ppapi/cpp/dev/ime_input_event_dev.h

Issue 8059006: Additional update on Pepper IME API and boilerplate thunk/proxy implementation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Make win_shared happy. Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ppapi/c/ppb_input_event.h ('k') | ppapi/cpp/dev/ime_input_event_dev.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/cpp/dev/ime_input_event_dev.h
diff --git a/ppapi/cpp/dev/ime_input_event_dev.h b/ppapi/cpp/dev/ime_input_event_dev.h
index 3c9b4a301e11eff9771556031ae7d5b386795f2b..17216a86cc727ea86e4219271b132b9247488e21 100644
--- a/ppapi/cpp/dev/ime_input_event_dev.h
+++ b/ppapi/cpp/dev/ime_input_event_dev.h
@@ -41,17 +41,23 @@ class IMEInputEvent_Dev : public InputEvent {
/// returns 0.
uint32_t GetSegmentNumber() const;
- /// Returns the start and the end position of the index-th segment in the
- /// composition text. The positions are given by byte-indices of the string
- /// GetText(). They always satisfy 0 <= .first < .second <= (Length of
- /// GetText()) and GetSegmentAt(index).first < GetSegmentAt(index+1).first.
- /// When the event is not COMPOSITION_UPDATE or index >= GetSegmentNumber(),
- /// returns (0, 0).
+ /// 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.
///
- /// @return A pair of integers representing the index-th segment.
- std::pair<uint32_t, uint32_t> GetSegmentAt(uint32_t index) const;
+ /// @return The byte-offset of the segmentation point. If the event is not
+ /// COMPOSITION_UPDATE or index is out of range, returns 0.
+ uint32_t GetSegmentOffset(uint32_t index) const;
/// Returns the index of the current target segment of composition.
///
« no previous file with comments | « ppapi/c/ppb_input_event.h ('k') | ppapi/cpp/dev/ime_input_event_dev.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698