6#ifndef SCINTILLAGTKACCESSIBLE_H
7#define SCINTILLAGTKACCESSIBLE_H
11#ifndef ATK_CHECK_VERSION
12# define ATK_CHECK_VERSION(x, y, z) 0
36 return startByte + characterOffset;
38 if (characterOffset > 0) {
43 if (
line != lineStart) {
51 if (characterOffset > 0) {
99 gchar *
GetText(
int startChar,
int endChar);
100 gchar *
GetTextAfterOffset(
int charOffset, AtkTextBoundary boundaryType,
int *startChar,
int *endChar);
101 gchar *
GetTextBeforeOffset(
int charOffset, AtkTextBoundary boundaryType,
int *startChar,
int *endChar);
102 gchar *
GetTextAtOffset(
int charOffset, AtkTextBoundary boundaryType,
int *startChar,
int *endChar);
103#if ATK_CHECK_VERSION(2, 10, 0)
104 gchar *GetStringAtOffset(
int charOffset, AtkTextGranularity granularity,
int *startChar,
int *endChar);
111 void GetCharacterExtents(
int charOffset, gint *x, gint *y, gint *width, gint *height, AtkCoordType coords);
113 AtkAttributeSet *
GetRunAttributes(
int charOffset,
int *startChar,
int *endChar);
116 gchar *
GetSelection(gint selection_num,
int *startChar,
int *endChar);
119 gboolean
SetSelection(gint selection_num,
int startChar,
int endChar);
123 void InsertText(
const gchar *
text,
int lengthBytes,
int *charPosition);
124 void CopyText(
int startChar,
int endChar);
125 void CutText(
int startChar,
int endChar);
154 static gchar *
GetText(AtkText *
text,
int start_offset,
int end_offset);
155 static gchar *
GetTextAfterOffset(AtkText *
text,
int offset, AtkTextBoundary boundary_type,
int *start_offset,
int *end_offset);
156 static gchar *
GetTextBeforeOffset(AtkText *
text,
int offset, AtkTextBoundary boundary_type,
int *start_offset,
int *end_offset);
157 static gchar *
GetTextAtOffset(AtkText *
text, gint offset, AtkTextBoundary boundary_type, gint *start_offset, gint *end_offset);
158#if ATK_CHECK_VERSION(2, 10, 0)
159 static gchar *GetStringAtOffset(AtkText *
text, gint offset, AtkTextGranularity granularity, gint *start_offset, gint *end_offset);
166 static void GetCharacterExtents(AtkText *
text, gint offset, gint *x, gint *y, gint *width, gint *height, AtkCoordType coords);
167 static AtkAttributeSet *
GetRunAttributes(AtkText *
text, gint offset, gint *start_offset, gint *end_offset);
170 static gchar *
GetSelection(AtkText *
text, gint selection_num, gint *start_pos, gint *end_pos);
173 static gboolean
SetSelection(AtkText *
text, gint selection_num, gint start, gint end);
184 static void CopyText(AtkEditableText *
text, gint start, gint end);
185 static void CutText(AtkEditableText *
text, gint start, gint end);
186 static void DeleteText(AtkEditableText *
text, gint start, gint end);
#define SC_LINECHARACTERINDEX_UTF32
char SCI_METHOD StyleAt(Sci_Position position) const override
void EnsureStyledTo(Sci::Position pos)
Sci_Position SCI_METHOD Length() const override
Sci::Position MovePositionOutsideChar(Sci::Position pos, Sci::Position moveDir, bool checkLineEnd=true) const noexcept
Sci::Position IndexLineStart(Sci::Line line, int lineCharacterIndex) const noexcept
Sci_Position SCI_METHOD GetRelativePosition(Sci_Position positionStart, Sci_Position characterOffset) const override
int LineCharacterIndex() const noexcept
Sci_Position SCI_METHOD LineFromPosition(Sci_Position pos) const override
Sci::Line LineFromPositionIndex(Sci::Position pos, int lineCharacterIndex) const noexcept
Sci_Position SCI_METHOD LineStart(Sci_Position line) const override
Sci::Position CountCharacters(Sci::Position startPos, Sci::Position endPos) const noexcept
static void CopyText(AtkEditableText *text, gint start, gint end)
static void DeleteText(AtkEditableText *text, gint start, gint end)
static void init(::AtkEditableTextIface *iface)
static void SetTextContents(AtkEditableText *text, const gchar *contents)
static void PasteText(AtkEditableText *text, gint position)
static void CutText(AtkEditableText *text, gint start, gint end)
static void InsertText(AtkEditableText *text, const gchar *contents, gint length, gint *position)
static void init(::AtkTextIface *iface)
static gint GetCharacterCount(AtkText *text)
static AtkAttributeSet * GetRunAttributes(AtkText *text, gint offset, gint *start_offset, gint *end_offset)
static gint GetCaretOffset(AtkText *text)
static gboolean AddSelection(AtkText *text, gint start, gint end)
static gchar * GetTextAtOffset(AtkText *text, gint offset, AtkTextBoundary boundary_type, gint *start_offset, gint *end_offset)
static void GetCharacterExtents(AtkText *text, gint offset, gint *x, gint *y, gint *width, gint *height, AtkCoordType coords)
static gunichar GetCharacterAtOffset(AtkText *text, gint offset)
static gint GetOffsetAtPoint(AtkText *text, gint x, gint y, AtkCoordType coords)
static gboolean SetSelection(AtkText *text, gint selection_num, gint start, gint end)
static gboolean SetCaretOffset(AtkText *text, gint offset)
static AtkAttributeSet * GetDefaultAttributes(AtkText *text)
static gchar * GetTextBeforeOffset(AtkText *text, int offset, AtkTextBoundary boundary_type, int *start_offset, int *end_offset)
static gint GetNSelections(AtkText *text)
static gboolean RemoveSelection(AtkText *text, gint selection_num)
static gchar * GetSelection(AtkText *text, gint selection_num, gint *start_pos, gint *end_pos)
static gchar * GetTextAfterOffset(AtkText *text, int offset, AtkTextBoundary boundary_type, int *start_offset, int *end_offset)
static gchar * GetText(AtkText *text, int start_offset, int end_offset)
gchar * GetSelection(gint selection_num, int *startChar, int *endChar)
void PasteText(int charPosition)
gboolean SetCaretOffset(int charOffset)
gchar * GetTextAfterOffset(int charOffset, AtkTextBoundary boundaryType, int *startChar, int *endChar)
void ChangeDocument(Document *oldDoc, Document *newDoc)
bool InsertStringUTF8(Sci::Position bytePos, const gchar *utf8, Sci::Position lengthBytes)
gchar * GetTextBeforeOffset(int charOffset, AtkTextBoundary boundaryType, int *startChar, int *endChar)
void InsertText(const gchar *text, int lengthBytes, int *charPosition)
~ScintillaGTKAccessible()
gchar * GetTextRangeUTF8(Sci::Position startByte, Sci::Position endByte)
Sci::Position ByteOffsetFromCharacterOffset(Sci::Position startByte, int characterOffset)
AtkAttributeSet * GetRunAttributes(int charOffset, int *startChar, int *endChar)
void Notify(GtkWidget *widget, gint code, SCNotification *nt)
void SetTextContents(const gchar *contents)
static ScintillaGTKAccessible * FromAccessible(GtkAccessible *accessible)
void SetAccessibility(bool enabled)
void CutText(int startChar, int endChar)
void CharacterRangeFromByteRange(Sci::Position startByte, Sci::Position endByte, int *startChar, int *endChar)
AtkAttributeSet * GetDefaultAttributes()
gboolean AddSelection(int startChar, int endChar)
static AtkObject * WidgetGetAccessibleImpl(GtkWidget *widget, AtkObject **cache, gpointer widget_parent_class)
static void SciNotify(GtkWidget *widget, gint code, SCNotification *nt, gpointer data)
std::vector< SelectionRange > old_sels
static ScintillaGTKAccessible * FromAccessible(AtkObject *accessible)
GtkAccessible * accessible
ScintillaGTKAccessible(GtkAccessible *accessible_, GtkWidget *widget_)
gchar * GetTextAtOffset(int charOffset, AtkTextBoundary boundaryType, int *startChar, int *endChar)
gint GetOffsetAtPoint(gint x, gint y, AtkCoordType coords)
Sci::Position ByteOffsetFromCharacterOffset(Sci::Position characterOffset)
AtkAttributeSet * GetAttributesForStyle(unsigned int styleNum)
void DeleteText(int startChar, int endChar)
gboolean SetSelection(gint selection_num, int startChar, int endChar)
void CopyText(int startChar, int endChar)
Sci::Position PositionBefore(Sci::Position pos)
int StyleAt(Sci::Position position, bool ensureStyle=false)
void GetCharacterExtents(int charOffset, gint *x, gint *y, gint *width, gint *height, AtkCoordType coords)
void ByteRangeFromCharacterRange(int startChar, int endChar, Sci::Position &startByte, Sci::Position &endByte)
gboolean RemoveSelection(int selection_num)
Sci::Position CharacterOffsetFromByteOffset(Sci::Position byteOffset)
gunichar GetCharacterAtOffset(int charOffset)
Sci::Position PositionAfter(Sci::Position pos)
gchar * GetText(int startChar, int endChar)
Styling buffer using one element for each run rather than using a filled buffer.