## Documentation

Table of Contents
Class Inheritance Tree
Widget Screenshots
Package groups

## Index

Package: Drawable

- Goto spec source

# Description

    package Gdk.Drawable is

This package provides 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 Gdk_Window or Gdk_Pixmap objects.

Many of the drawing operations take a Gdk_GC argument, which represents a graphics context. This Gdk_GC 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 Gdk.GC for more information.

Binding from C File version 1.3.6

# Types

### Gdk_Drawable

- Goto declaration in source

    subtype Gdk_Drawable is Gdk.Gdk_Drawable;

A screen area that can be drawn upon.

# Constants & Global variables

### Null_Drawable

- Goto declaration in source

(Gdk_Drawable)

    Null_Drawable : constant Gdk_Drawable;

# Subprograms & Entries

### Get_Type

- Goto spec in source
- Goto body in source

    function Get_Type return Glib.GType;

Return the internal value associated with a Gdk_Drawable.

### Get_Size

- Goto spec in source
- Goto body in source

    procedure Get_Size (Drawable: Gdk_Drawable;Width: out Gint;Height: out Gint);

Return the width and height of a given drawable.

### Set_Colormap

- Goto spec in source
- Goto body in source

    procedure Set_Colormap (Drawable: Gdk_Drawable;Colormap: Gdk.Gdk_Colormap);

### Get_Colormap

- Goto spec in source
- Goto body in source

    function Get_Colormap (Drawable: Gdk_Drawable) return Gdk.Gdk_Colormap;

### Get_Visual

- Goto spec in source
- Goto body in source

    function Get_Visual (Drawable: Gdk_Drawable) return Gdk.Gdk_Visual;

### Get_Depth

- Goto spec in source
- Goto body in source

    function Get_Depth (Drawable: Gdk_Drawable) return Gint;

### Ref

- Goto spec in source
- Goto body in source

    procedure Ref (Drawable: Gdk_Drawable);

### Unref

- Goto spec in source
- Goto body in source

    procedure Unref (Drawable: Gdk_Drawable);

### Draw_Point

- Goto spec in source
- Goto body in source

    procedure Draw_Point (Drawable: Gdk_Drawable;GC: Gdk.Gdk_GC;X: Gint;Y: Gint);

Draw a point, using the foreground color and other attributes of the Gc.

### Draw_Line

- Goto spec in source
- Goto body in source

    procedure Draw_Line (Drawable: Gdk_Drawable;GC: Gdk.Gdk_GC;X1: Gint;Y1: Gint;X2: Gint;Y2: Gint);

Draw a line, using the foreground color and other attributes of the Gc. (X1, Y1) is coordinate of the start point. (X2, Y2) is coordinate of the end point.

### Draw_Rectangle

- Goto spec in source

    procedure Draw_Rectangle (Drawable: Gdk_Drawable;GC: Gdk.Gdk_GC;Filled: Boolean := False;X: Gint;Y: Gint;Width: Gint;Height: Gint);

Draw a rectangular outline or filled rectangle. Note that a rectangle drawn filled is 1 pixel smaller in both dimensions than a rectangle outlined. Calling Draw_Rectangle (Window, Gc, True, 0, 0, 20, 20) results in a filled rectangle 20 pixels wide and 20 pixels high. Calling Draw_Rectangle (Window, Gc, False, 0, 0, 20, 20) results in an outlined rectangle with corners at (0, 0), (0, 20), (20, 20), and (20, 0), which makes it 21 pixels wide and 21 pixels high. (X, Y) represents the coordinate of the top-left edge of the rectangle.

### Draw_Arc

- Goto spec in source

    procedure Draw_Arc (Drawable: Gdk_Drawable;GC: Gdk.Gdk_GC;Filled: Boolean := False;X: Gint;Y: Gint;Width: Gint;Height: Gint;Angle1: Gint;Angle2: Gint);

Draws an arc or a filled 'pie slice'. The arc is defined by the bounding rectangle of the entire ellipse, and the start and end angles of the part of the ellipse to be drawn. Filled is True if the arc should be filled, producing a 'pie slice'. (X, Y) represent the coordinate of the top-left edge of the bounding rectangle. Angle1 is the start angle of the arc, relative to the 3 o'clock position, counter-clockwise, in 1/64ths of a degree. Angle2 is the end angle of the arc, relative to angle1, in 1/64ths of a degree.

### Draw_Polygon

- Goto spec in source

    procedure Draw_Polygon (Drawable: Gdk_Drawable;GC: Gdk.Gdk_GC;Filled: Boolean;Points: Gdk.Types.Gdk_Points_Array);

Draw an outlined or filled polygon. Filled is True if the polygon should be filled. The polygon is closed automatically, connecting the last point to the first point if necessary. Points is an array of Gdk_Point specifying the points making up the polygon.

### Draw_Text

- Goto spec in source

    procedure Draw_Text (Drawable: Gdk_Drawable;Font: Gdk.Gdk_Font;GC: Gdk.Gdk_GC;X: Gint;Y: Gint;Text: UTF8_String);

Draw a string in the given font or fontset. X is the x coordinate of the left edge of the text. Y is the y coordinate of the baseline of the text. You should use Gtk.Widget.Create_Pango_Layout instead to handle internationalization.

### Draw_Text

- Goto spec in source

    procedure Draw_Text (Drawable: Gdk_Drawable;Font: Gdk.Gdk_Font;GC: Gdk.Gdk_GC;X: Gint;Y: Gint;Wide_Text: Gdk.Types.Gdk_WString);

Draw a wide string in the given font of fontset. If the font is a 1-byte font, the string is converted into 1-byte characters (discarding the high bytes) before output.

### Draw_Drawable

- Goto spec in source
- Goto body in source

    procedure Draw_Drawable (Drawable: Gdk_Drawable;GC: Gdk.Gdk_GC;Src: Gdk_Drawable;Xsrc: Gint;Ysrc: Gint;Xdest: Gint;Ydest: Gint;Width: Gint := -1;Height: Gint := -1);

Draw a pixmap, or a part of a pixmap, onto another drawable. Src is the source Gdk_Drawable to draw. Xsrc is the left edge of the source rectangle within Src. Ysrc is the top of the source rectangle within Src. Xdest is the x coordinate of the destination within Src. Ydest is the y coordinate of the destination within Src. Width is the width of the area to be copied, or -1 to make the area extend to the right edge of the source pixmap. Height is the height of the area to be copied, or -1 to make the area extend to the bottom edge of the source pixmap.

### Draw_Layout

- Goto spec in source

    procedure Draw_Layout (Drawable: Gdk_Drawable;GC: Gdk.Gdk_GC;X: Gint;Y: Gint;Layout: Pango.Layout.Pango_Layout);

Display the layout and its text in Drawable. This method should be preferred over Draw_Text.

### Draw_Pixmap

- Goto spec in source

    procedure Draw_Pixmap (Drawable: Gdk_Drawable;GC: Gdk.Gdk_GC;Src: Gdk_Drawable;Xsrc: Gint;Ysrc: Gint;Xdest: Gint;Ydest: Gint;Width: Gint := -1;Height: Gint := -1) renames Draw_Drawable;

Deprecated, use Draw_Drawable instead.

### Draw_Image

- Goto spec in source
- Goto body in source

    procedure Draw_Image (Drawable: Gdk_Drawable;GC: Gdk.Gdk_GC;Image: Gdk.Gdk_Image;Xsrc: Gint;Ysrc: Gint;Xdest: Gint;Ydest: Gint;Width: Gint := -1;Height: Gint := -1);

Draw a Gdk_Image onto a Drawable. The depth of the Gdk_Image must match the depth of the Gdk_Drawable. Image is the Gdk_Image to draw. Xsrc is the left edge of the source rectangle within Image. Ysrc is the top of the source rectangle within Image. Xdest is the x coordinate of the destination within Drawable. Ydest is the y coordinate of the destination within Drawable. Width is the width of the area to be copied, or -1 to make the area extend to the right edge of image. Height is the height of the area to be copied, or -1 to make the area extend to the bottom edge of image.

### Draw_Points

- Goto spec in source

    procedure Draw_Points (Drawable: Gdk_Drawable;GC: Gdk.Gdk_GC;Points: Gdk.Types.Gdk_Points_Array);

Draw a number of points. Use the foreground color and other attributes of the Gc.

### Draw_Segments

- Goto spec in source

    procedure Draw_Segments (Drawable: in Gdk_Drawable;GC: in Gdk.Gdk_GC;Segs: in Gdk.Types.Gdk_Segments_Array);

Draw a number of unconnected lines.

### Draw_Lines

- Goto spec in source

    procedure Draw_Lines (Drawable: Gdk_Drawable;GC: Gdk.Gdk_GC;Points: Gdk.Types.Gdk_Points_Array);

Draw a series of lines connecting the given points. The way in which joins between lines are drawn is determined by the Cap_Style value in the Gdk_GC. This can be set with Gdk.Gc.Set_Line_Attributes.

### Get_Image

- Goto spec in source
- Goto body in source

    function Get_Image (Drawable: Gdk_Drawable;X: Gint;Y: Gint;Width: Gint;Height: Gint) return Gdk_Image;

### Get_Clip_Region

- Goto spec in source
- Goto body in source

    function Get_Clip_Region (Drawable: Gdk_Drawable) return Gdk.Gdk_Region;

### Get_Visible_Region

- Goto spec in source
- Goto body in source

    function Get_Visible_Region (Drawable: Gdk_Drawable) return Gdk.Gdk_Region;