зеркало из https://github.com/mozilla/gecko-dev.git
Merge inbound to mozilla-central. a=merge
This commit is contained in:
Коммит
5e84c40d52
|
@ -590,6 +590,55 @@ static gboolean setCaretOffsetCB(AtkText* aText, gint aOffset) {
|
|||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static gboolean scrollSubstringToCB(AtkText* aText,
|
||||
gint aStartOffset, gint aEndOffset,
|
||||
AtkScrollType aType) {
|
||||
AtkObject* atkObject = ATK_OBJECT(aText);
|
||||
AccessibleWrap* accWrap = GetAccessibleWrap(atkObject);
|
||||
if (accWrap) {
|
||||
HyperTextAccessible* text = accWrap->AsHyperText();
|
||||
if (!text || !text->IsTextRole() ||
|
||||
!text->IsValidRange(aStartOffset, aEndOffset)) {
|
||||
return FALSE;
|
||||
}
|
||||
text->ScrollSubstringTo(aStartOffset, aEndOffset, aType);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
ProxyAccessible* proxy = GetProxy(atkObject);
|
||||
if (proxy) {
|
||||
proxy->ScrollSubstringTo(aStartOffset, aEndOffset, aType);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static gboolean scrollSubstringToPointCB(AtkText* aText,
|
||||
gint aStartOffset, gint aEndOffset,
|
||||
AtkCoordType aCoords,
|
||||
gint aX, gint aY) {
|
||||
AtkObject* atkObject = ATK_OBJECT(aText);
|
||||
AccessibleWrap* accWrap = GetAccessibleWrap(atkObject);
|
||||
if (accWrap) {
|
||||
HyperTextAccessible* text = accWrap->AsHyperText();
|
||||
if (!text || !text->IsTextRole() ||
|
||||
!text->IsValidRange(aStartOffset, aEndOffset)) {
|
||||
return FALSE;
|
||||
}
|
||||
text->ScrollSubstringToPoint(aStartOffset, aEndOffset, aCoords, aX, aY);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
ProxyAccessible* proxy = GetProxy(atkObject);
|
||||
if (proxy) {
|
||||
proxy->ScrollSubstringToPoint(aStartOffset, aEndOffset, aCoords, aX, aY);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
}
|
||||
|
||||
void textInterfaceInitCB(AtkTextIface* aIface) {
|
||||
|
@ -617,6 +666,11 @@ void textInterfaceInitCB(AtkTextIface* aIface) {
|
|||
aIface->set_selection = setTextSelectionCB;
|
||||
aIface->set_caret_offset = setCaretOffsetCB;
|
||||
|
||||
if (IsAtkVersionAtLeast(2, 32)) {
|
||||
aIface->scroll_substring_to = scrollSubstringToCB;
|
||||
aIface->scroll_substring_to_point = scrollSubstringToPointCB;
|
||||
}
|
||||
|
||||
// Cache the string values of the atk text attribute names.
|
||||
for (uint32_t i = 0; i < ArrayLength(sAtkTextAttrNames); i++)
|
||||
sAtkTextAttrNames[i] =
|
||||
|
|
|
@ -136,6 +136,34 @@ typedef enum {
|
|||
ATK_TEXT_BOUNDARY_LINE_END
|
||||
} AtkTextBoundary;
|
||||
|
||||
/**
|
||||
*AtkTextGranularity:
|
||||
*@ATK_TEXT_GRANULARITY_CHAR: Granularity is defined by the boundaries between characters
|
||||
* (including non-printing characters)
|
||||
*@ATK_TEXT_GRANULARITY_WORD: Granularity is defined by the boundaries of a word,
|
||||
* starting at the beginning of the current word and finishing at the beginning of
|
||||
* the following one, if present.
|
||||
*@ATK_TEXT_GRANULARITY_SENTENCE: Granularity is defined by the boundaries of a sentence,
|
||||
* starting at the beginning of the current sentence and finishing at the beginning of
|
||||
* the following one, if present.
|
||||
*@ATK_TEXT_GRANULARITY_LINE: Granularity is defined by the boundaries of a line,
|
||||
* starting at the beginning of the current line and finishing at the beginning of
|
||||
* the following one, if present.
|
||||
*@ATK_TEXT_GRANULARITY_PARAGRAPH: Granularity is defined by the boundaries of a paragraph,
|
||||
* starting at the beginning of the current paragraph and finishing at the beginning of
|
||||
* the following one, if present.
|
||||
*
|
||||
* Text granularity types used for specifying the granularity of the region of
|
||||
* text we are interested in.
|
||||
**/
|
||||
typedef enum {
|
||||
ATK_TEXT_GRANULARITY_CHAR,
|
||||
ATK_TEXT_GRANULARITY_WORD,
|
||||
ATK_TEXT_GRANULARITY_SENTENCE,
|
||||
ATK_TEXT_GRANULARITY_LINE,
|
||||
ATK_TEXT_GRANULARITY_PARAGRAPH
|
||||
} AtkTextGranularity;
|
||||
|
||||
/**
|
||||
* AtkTextRectangle:
|
||||
* @x: The horizontal coordinate of a rectangle
|
||||
|
@ -272,9 +300,33 @@ struct _AtkTextIface
|
|||
AtkCoordType coord_type,
|
||||
AtkTextClipType x_clip_type,
|
||||
AtkTextClipType y_clip_type);
|
||||
|
||||
|
||||
AtkFunction pad4;
|
||||
gchar* (* get_string_at_offset) (AtkText *text,
|
||||
gint offset,
|
||||
AtkTextGranularity granularity,
|
||||
gint *start_offset,
|
||||
gint *end_offset);
|
||||
/*
|
||||
* Scrolls this text range so it becomes visible on the screen.
|
||||
*
|
||||
* scroll_substring_to lets the implementation compute an appropriate target
|
||||
* position on the screen, with type used as a positioning hint.
|
||||
*
|
||||
* scroll_substring_to_point lets the client specify a precise target position
|
||||
* on the screen.
|
||||
*
|
||||
* Since ATK 2.32
|
||||
*/
|
||||
gboolean (* scroll_substring_to) (AtkText *text,
|
||||
gint start_offset,
|
||||
gint end_offset,
|
||||
AtkScrollType type);
|
||||
gboolean (* scroll_substring_to_point) (AtkText *text,
|
||||
gint start_offset,
|
||||
gint end_offset,
|
||||
AtkCoordType coords,
|
||||
gint x,
|
||||
gint y);
|
||||
};
|
||||
|
||||
GType atk_text_get_type (void);
|
||||
|
@ -307,6 +359,11 @@ gchar* atk_text_get_text_before_offset (AtkText *tex
|
|||
AtkTextBoundary boundary_type,
|
||||
gint *start_offset,
|
||||
gint *end_offset);
|
||||
gchar* atk_text_get_string_at_offset (AtkText *text,
|
||||
gint offset,
|
||||
AtkTextGranularity granularity,
|
||||
gint *start_offset,
|
||||
gint *end_offset);
|
||||
gint atk_text_get_caret_offset (AtkText *text);
|
||||
void atk_text_get_character_extents (AtkText *text,
|
||||
gint offset,
|
||||
|
@ -359,6 +416,18 @@ AtkTextAttribute atk_text_attribute_for_name (const gchar *nam
|
|||
G_CONST_RETURN gchar* atk_text_attribute_get_value (AtkTextAttribute attr,
|
||||
gint index_);
|
||||
|
||||
gboolean atk_text_scroll_substring_to (AtkText *text,
|
||||
gint start_offset,
|
||||
gint end_offset,
|
||||
AtkScrollType type);
|
||||
|
||||
gboolean atk_text_scroll_substring_to_point (AtkText *text,
|
||||
gint start_offset,
|
||||
gint end_offset,
|
||||
AtkCoordType coords,
|
||||
gint x,
|
||||
gint y);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif /* __cplusplus */
|
||||
|
|
Загрузка…
Ссылка в новой задаче