summaryrefslogtreecommitdiff
path: root/doc
diff options
context:
space:
mode:
Diffstat (limited to 'doc')
-rw-r--r--doc/pycairo_c_api.rst10
-rw-r--r--doc/reference/index.rst1
-rw-r--r--doc/reference/region.rst52
3 files changed, 63 insertions, 0 deletions
diff --git a/doc/pycairo_c_api.rst b/doc/pycairo_c_api.rst
index 5f2becd..acce2eb 100644
--- a/doc/pycairo_c_api.rst
+++ b/doc/pycairo_c_api.rst
@@ -51,6 +51,8 @@ Objects::
PycairoGradient
PycairoLinearGradient
PycairoRadialGradient
+ PycairoRectangleInt
+ PycairoRegion
PycairoScaledFont
PycairoSurface
PycairoImageSurface
@@ -79,6 +81,8 @@ Types::
PyTypeObject *Gradient_Type;
PyTypeObject *LinearGradient_Type;
PyTypeObject *RadialGradient_Type;
+ PyTypeObject *RectangleInt_Type;
+ PyTypeObject *Region_Type;
PyTypeObject *ScaledFont_Type;
PyTypeObject *Surface_Type;
PyTypeObject *ImageSurface_Type;
@@ -117,6 +121,12 @@ Functions
.. c:function:: PyObject * PycairoPattern_FromPattern(cairo_pattern_t *pattern, PyObject *base)
+.. c:function:: PyObject * PycairoRectangleInt_FromRectangleInt(const cairo_rectangle_int_t *rectangle_int)
+
+
+.. c:function:: PyObject * PycairoRegion_FromRegion(const cairo_region_t *region)
+
+
.. c:function:: PyObject * PycairoScaledFont_FromScaledFont(cairo_scaled_font_t *scaled_font)
diff --git a/doc/reference/index.rst b/doc/reference/index.rst
index 2b1b9ac..81787cc 100644
--- a/doc/reference/index.rst
+++ b/doc/reference/index.rst
@@ -15,5 +15,6 @@ Reference
matrix
paths
patterns
+ region
surfaces
text
diff --git a/doc/reference/region.rst b/doc/reference/region.rst
new file mode 100644
index 0000000..06124a3
--- /dev/null
+++ b/doc/reference/region.rst
@@ -0,0 +1,52 @@
+.. _region:
+
+******
+Region
+******
+Region — Representing a pixel-aligned area
+
+.. currentmodule:: cairo
+
+
+class Region()
+==============
+*Region* is a simple graphical data type representing an area of
+integer-aligned rectangles. They are often used on raster surfaces to track
+areas of interest, such as change or clip areas.
+
+
+.. class:: Region([rectangle_int|rectangle_ints])
+
+ :param rectangle_int: a rectangle or a list of rectangle
+ :type rectangle_int: :class:`RectangleInt` or [:class:`RectangleInt`]
+
+ Allocates a new empty region object or a region object with the containing
+ rectangle(s).
+
+
+ .. method:: copy()
+
+ :returns: A newly allocated :class:`Region`.
+ :raises: :exc:`NoMemory` if memory cannot be allocated.
+
+ Allocates a new *Region* object copying the area from original.
+
+
+class RectangleInt()
+====================
+*RectangleInt* is a data structure for holding a rectangle with integer
+coordinates.
+
+
+.. class:: RectangleInt(x=0, y=0, width=0, height=0)
+
+ :param x: X coordinate of the left side of the rectangle
+ :type x: int
+ :param y: Y coordinate of the the top side of the rectangle
+ :type y: int
+ :param width: width of the rectangle
+ :type width: int
+ :param height: height of the rectangle
+ :type height: int
+
+ Allocates a new *RectangleInt* object.