## Drawing Primitives Drawing Primitives — Functions for drawing points, lines, arcs, and text |

## Synopsis

    #include <gdk/gdk.h>

                        GdkDrawable;
    cairo_region_t *    gdk_drawable_get_clip_region        (GdkDrawable *drawable);
    cairo_region_t *    gdk_drawable_get_visible_region     (GdkDrawable *drawable);

## Object Hierarchy

      GObject
       +----GdkDrawable
             +----GdkWindow

## Description

These functions provide support for drawing points, lines, arcs and text onto what are called 'drawables'. Drawables, as the name suggests, are things which support drawing onto them, and are either GdkWindow or GdkPixmap objects.

Many of the drawing operations take a GdkGC argument, which represents a graphics context. This GdkGC contains a number of drawing attributes such as foreground color, background color and line width, and is used to reduce the number of arguments needed for each drawing operation. See the Graphics Contexts section for more information.

Some of the drawing operations take Pango data structures like PangoContext, PangoLayout or PangoLayoutLine as arguments. If you're using GTK+, the ususal way to obtain these structures is via `gtk_widget_create_pango_context()` or `gtk_widget_create_pango_layout()`.

## Details

### GdkDrawable

    typedef struct _GdkDrawable GdkDrawable;

An opaque structure representing an object that can be drawn onto. This can be a GdkPixmap, a GdkBitmap, or a GdkWindow.

### gdk_drawable_get_clip_region ()

    cairo_region_t *    gdk_drawable_get_clip_region        (GdkDrawable *drawable);

Computes the region of a drawable that potentially can be written to by drawing primitives. This region will not take into account the clip region for the GC, and may also not take into account other factors such as if the window is obscured by other windows, but no area outside of this region will be affected by drawing primitives.

`drawable` : | a GdkDrawable
Returns : | a cairo_region_t. This must be freed with `cairo_region_destroy()` when you are done.

### gdk_drawable_get_visible_region ()

    cairo_region_t *    gdk_drawable_get_visible_region     (GdkDrawable *drawable);

Computes the region of a drawable that is potentially visible. This does not necessarily take into account if the window is obscured by other windows, but no area outside of this region is visible.

`drawable` : | a GdkDrawable
Returns : | a cairo_region_t. This must be freed with `cairo_region_destroy()` when you are done.