зеркало из https://github.com/mozilla/gecko-dev.git
Added TEXTRANGE_CARETPOSITION support for Input Methods to nsIDOMTextRange and nsGUIEvents
This commit is contained in:
Родитель
49742dd548
Коммит
0b7a782118
|
@ -33,10 +33,11 @@ class nsIDOMTextRange : public nsISupports {
|
|||
public:
|
||||
static const nsIID& GetIID() { static nsIID iid = NS_IDOMTEXTRANGE_IID; return iid; }
|
||||
enum {
|
||||
TEXTRANGE_RAWINPUT = 1,
|
||||
TEXTRANGE_SELECTEDRAWTEXT = 2,
|
||||
TEXTRANGE_CONVERTEDTEXT = 3,
|
||||
TEXTRANGE_SELECTEDCONVERTEDTEXT = 4
|
||||
TEXTRANGE_CARETPOSITION = 1,
|
||||
TEXTRANGE_RAWINPUT = 2,
|
||||
TEXTRANGE_SELECTEDRAWTEXT = 3,
|
||||
TEXTRANGE_CONVERTEDTEXT = 4,
|
||||
TEXTRANGE_SELECTEDCONVERTEDTEXT = 5
|
||||
};
|
||||
|
||||
NS_IMETHOD GetRangeStart(PRUint16* aRangeStart)=0;
|
||||
|
|
|
@ -1,10 +1,11 @@
|
|||
interface TextRange {
|
||||
/* IID: {0xb471ab41, 0x2a79, 0x11d3, \
|
||||
{ 0x9e, 0xa4, 0x0, 0x60, 0x8, 0x9f, 0xe5, 0x9b } } */
|
||||
const int TEXTRANGE_RAWINPUT = 1;
|
||||
const int TEXTRANGE_SELECTEDRAWTEXT = 2;
|
||||
const int TEXTRANGE_CONVERTEDTEXT = 3;
|
||||
const int TEXTRANGE_SELECTEDCONVERTEDTEXT = 4;
|
||||
const int TEXTRANGE_CARETPOSITION = 1;
|
||||
const int TEXTRANGE_RAWINPUT = 2;
|
||||
const int TEXTRANGE_SELECTEDRAWTEXT = 3;
|
||||
const int TEXTRANGE_CONVERTEDTEXT = 4;
|
||||
const int TEXTRANGE_SELECTEDCONVERTEDTEXT = 5;
|
||||
|
||||
attribute unsigned short rangeStart;
|
||||
attribute unsigned short rangeEnd;
|
||||
|
|
|
@ -298,6 +298,7 @@ TextRangeListItem(JSContext *cx, JSObject *obj, uintN argc, jsval *argv, jsval *
|
|||
return JS_FALSE;
|
||||
}
|
||||
|
||||
JSBool rBool = JS_FALSE;
|
||||
nsIDOMTextRange* nativeRet;
|
||||
PRUint32 b0;
|
||||
|
||||
|
@ -431,6 +432,9 @@ extern "C" NS_DOM nsresult NS_InitTextRangeClass(nsIScriptContext *aContext, voi
|
|||
if ((PR_TRUE == JS_LookupProperty(jscontext, global, "TextRange", &vp)) &&
|
||||
JSVAL_IS_OBJECT(vp) &&
|
||||
((constructor = JSVAL_TO_OBJECT(vp)) != nsnull)) {
|
||||
vp = INT_TO_JSVAL(nsIDOMTextRange::TEXTRANGE_CARETPOSITION);
|
||||
JS_SetProperty(jscontext, constructor, "TEXTRANGE_CARETPOSITION", &vp);
|
||||
|
||||
vp = INT_TO_JSVAL(nsIDOMTextRange::TEXTRANGE_RAWINPUT);
|
||||
JS_SetProperty(jscontext, constructor, "TEXTRANGE_RAWINPUT", &vp);
|
||||
|
||||
|
|
|
@ -466,10 +466,11 @@ enum nsDragDropEventStatus {
|
|||
#define NS_EVENT_FLAG_POST_PROCESS 0x0008
|
||||
|
||||
// IME Constants -- keep in synch with nsIDOMTextRange.h
|
||||
#define NS_TEXTRANGE_RAWINPUT 0X01
|
||||
#define NS_TEXTRANGE_SELECTEDRAWTEXT 0x02
|
||||
#define NS_TEXTRANGE_CONVERTEDTEXT 0x03
|
||||
#define NS_TEXTRANGE_SELECTEDCONVERTEDTEXT 0x04
|
||||
#define NS_TEXTRANGE_CARETPOSITION 0x01
|
||||
#define NS_TEXTRANGE_RAWINPUT 0X02
|
||||
#define NS_TEXTRANGE_SELECTEDRAWTEXT 0x03
|
||||
#define NS_TEXTRANGE_CONVERTEDTEXT 0x04
|
||||
#define NS_TEXTRANGE_SELECTEDCONVERTEDTEXT 0x05
|
||||
|
||||
#endif // nsGUIEvent_h__
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче