[pyatspi2] Add AtspitableCell, tracking the new atk interface
- From: Mike Gorse <mgorse src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pyatspi2] Add AtspitableCell, tracking the new atk interface
- Date: Tue, 18 Feb 2014 18:39:50 +0000 (UTC)
commit 8979e7b4a96a7f5669ad5994a138900ecf11f23d
Author: Mike Gorse <mgorse suse com>
Date: Tue Feb 18 12:09:42 2014 -0600
Add AtspitableCell, tracking the new atk interface
pyatspi/Accessibility.py | 3 ++
pyatspi/Makefile.am | 1 +
pyatspi/tablecell.py | 85 ++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 89 insertions(+), 0 deletions(-)
---
diff --git a/pyatspi/Accessibility.py b/pyatspi/Accessibility.py
index 06960a5..833c258 100644
--- a/pyatspi/Accessibility.py
+++ b/pyatspi/Accessibility.py
@@ -32,6 +32,7 @@ from pyatspi.hypertext import *
from pyatspi.image import *
from pyatspi.selection import *
from pyatspi.table import *
+from pyatspi.tablecell import *
from pyatspi.value import *
from pyatspi.appevent import *
from pyatspi.interface import *
@@ -148,6 +149,7 @@ Atspi.Accessible.queryHypertext = lambda x: Hypertext(getInterface(Atspi.Accessi
Atspi.Accessible.queryImage = lambda x: Image(getInterface(Atspi.Accessible.get_image_iface, x))
Atspi.Accessible.querySelection = lambda x: Selection(getInterface(Atspi.Accessible.get_selection_iface, x))
Atspi.Accessible.queryTable = lambda x: Table(getInterface(Atspi.Accessible.get_table_iface, x))
+Atspi.Accessible.queryTableCell = lambda x: TableCell(getInterface(Atspi.Accessible.get_table_cell, x))
Atspi.Accessible.queryText = lambda x: Text(getInterface(Atspi.Accessible.get_text_iface, x))
Atspi.Accessible.queryValue = lambda x: Value(getInterface(Atspi.Accessible.get_value_iface, x))
@@ -162,6 +164,7 @@ interface.queryHypertext = lambda x: Hypertext(getInterface(Atspi.Accessible.get
interface.queryImage = lambda x: Image(getInterface(Atspi.Accessible.get_image, x.obj))
interface.querySelection = lambda x: Selection(getInterface(Atspi.Accessible.get_selection, x.obj))
interface.queryTable = lambda x: Table(getInterface(Atspi.Accessible.get_table, x.obj))
+interface.queryTableCell = lambda x: Table(getInterface(Atspi.Accessible.get_table_cell, x.obj))
interface.queryText = lambda x: Text(getInterface(Atspi.Accessible.get_text, x.obj))
interface.queryValue = lambda x: Value(getInterface(Atspi.Accessible.get_value, x.obj))
diff --git a/pyatspi/Makefile.am b/pyatspi/Makefile.am
index 736ecd3..c7605c6 100644
--- a/pyatspi/Makefile.am
+++ b/pyatspi/Makefile.am
@@ -21,6 +21,7 @@ pyatspi_PYTHON = \
selection.py \
state.py \
table.py \
+tablecell.py \
text.py \
utils.py \
value.py
diff --git a/pyatspi/tablecell.py b/pyatspi/tablecell.py
new file mode 100644
index 0000000..4ae59e9
--- /dev/null
+++ b/pyatspi/tablecell.py
@@ -0,0 +1,85 @@
+#Copyright (c) 2013 SUSE LLC.
+
+#This library is free software; you can redistribute it and/or
+#modify it under the terms of the GNU Lesser General Public
+#License version 2 as published by the Free Software Foundation.
+
+#This program is distributed in the hope that it will be useful,
+#but WITHOUT ANY WARRANTY; without even the implied warranty of
+#MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+#GNU General Public License for more details.
+#You should have received a copy of the GNU Lesser General Public License
+#along with this program; if not, write to the Free Software
+#Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+
+from gi.repository import Atspi
+from pyatspi.enum import *
+from pyatspi.utils import *
+from pyatspi.interface import *
+
+__all__ = [
+ "TableCell",
+ ]
+
+#------------------------------------------------------------------------------
+
+class TableCell(interface):
+ """
+ An interface used by cells in a table.
+ """
+
+ def get_columnSpan(self):
+ return Atspi.TableCell.get_column_span(self.obj)
+ _columnSpanDoc = \
+ """
+ Get the number of columns occupied by this cell.
+ """
+ columnSpan = property(fget=get_columnSpan, doc=_columnSpanDoc)
+
+ def get_columnHeaderCells(self):
+ return Atspi.TableCell.get_column_header_cells(self.obj)
+ _columnHeaderCellsDoc = \
+ """
+ Get the column headers as an array of cell accessibles.
+ """
+ columnHeaderCells = property(fget=get_columnHeaderCells, doc=_columnHeaderCellsDoc)
+
+ def get_rowSpan(self):
+ return Atspi.TableCell.get_row_span(self.obj)
+ _rowSpanDoc = \
+ """
+ Get the number of rows occupied by this cell.
+ """
+ rowSpan = property(fget=get_rowSpan, doc=_rowSpanDoc)
+
+ def get_rowHeaderCells(self):
+ return Atspi.TableCell.get_row_header_cells(self.obj)
+ _rowHeaderCellsDoc = \
+ """
+ Get the row headers as an array of cell accessibles.
+ """
+ rowHeaderCells = property(fget=get_rowHeaderCells, doc=_rowHeaderCellsDoc)
+
+ def get_position(self):
+ return Atspi.TableCell.get_position(self.obj)
+ _positionDoc = \
+ """
+ Returns the tabular position of this accessible.
+ """
+ position = property(fget=get_position, doc=_positionDoc)
+
+ def getRowColumnSpan(self):
+ """
+ determine the row and column indices and span of the given cell.
+ """
+ return Atspi.TableCell.get_row_column_span(self.obj)
+
+ def get_table(self):
+ return Atspi.TableCell.get_table(self.obj)
+ _tableDoc = \
+ """
+ Returns a reference to the accessible of the containing table.
+ """
+ table = property(fget=get_table, doc=_tableDoc)
+
+#END----------------------------------------------------------------------------
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]