This is gtkada_rm.info, produced by makeinfo version 4.0 from
gtkada_rm.texi.


File: gtkada_rm.info,  Node: Gtkada.Types Subprograms,  Up: Package_Gtkada.Types

Subprograms
===========

function Null_Array            return Chars_Ptr_Array;

Return a null array.
Handling of arrays of Strings
-----------------------------

The following functions provide a very convenient way to create
C arrays of null terminated strings in Ada.

   You can either create such a String on the fly, or declare a
variable:

   Signals : Chars_Ptr_Array := "clicked" + "missed" + "new signal";

   which corresponds to the C declaration:

   char *signals[] = {"clicked", "missed", "new signal"};

   Note that you still need to manually call Free (Signals) if you want
to  release the memory dynamically allocated by the "+" functions.

function "+"
     (S1, S2             :        String)
        return Chars_Ptr_Array;

Create an array containing S1 and S2.
Note that this function allocates memory to store S1 and S2 as null
terminated Strings. The user is responsible for calling Free on the
resulting array.
function "+"
     (S1                 :        Chars_Ptr_Array;
        S2                 :        String)
        return Chars_Ptr_Array;

Append S2 to S1.
Note that this function allocates memory to store S2 as a null
terminated Strings. The user is responsible for calling Free on the
resulting array.
function "+"
     (S1                 :        Chars_Ptr_Array;
        S2                 :        Chars_Ptr)
        return Chars_Ptr_Array;

Append S2 to S1.
Note that this function allocates memory to store S2 as a null
terminated Strings. The user is responsible for calling Free on the
resulting array.
function "+"
     (S1                 :        Chars_Ptr;
        S2                 :        String)
        return Chars_Ptr_Array;

Create an array containing S1 and S2.
Note that this function allocates memory to store S2 as a null
terminated string. The user is responsible for calling Free on the
resulting array.
procedure Free
     (A                  : in out Chars_Ptr_Array);

Free all the strings in A.

File: gtkada_rm.info,  Node: Package_Gdk,  Next: Package_Gdk.Art,  Prev: Top,  Up: Top

Package Gdk
***********

This is the top level package of the Gdk hierarchy.   It provides the
type definitions used to access underlying C structures.

* Menu:

* Gdk Types::


File: gtkada_rm.info,  Node: Gdk Types,  Up: Package_Gdk

Types
=====

subtype C_Proxy is Glib.C_Proxy;

subtype Gdk_Bitmap is Gdk_Drawable;

subtype Gdk_Drawable is Gdk_Window;

type Gdk_GC is new C_Proxy;

subtype Gdk_Pixmap is Gdk_Drawable;

type Gdk_Window is new C_Proxy;


File: gtkada_rm.info,  Node: Package_Gdk.Art,  Next: Package_Gdk.Art.Pixbuf,  Prev: Package_Gdk,  Up: Top

Package Gdk.Art
***************

This is the top level package of the Gdk.Art hierarchy.

* Menu:


File: gtkada_rm.info,  Node: Package_Gdk.Art.Pixbuf,  Next: Package_Gdk.Bitmap,  Prev: Package_Gdk.Art,  Up: Top

Package Gdk.Art.Pixbuf
**********************

This package provides a minimal interface to the libart library.   It
gives access to the basic types used by Gdk.Pixbuf.

* Menu:

* Gdk.Art.Pixbuf Types::


File: gtkada_rm.info,  Node: Gdk.Art.Pixbuf Types,  Up: Package_Gdk.Art.Pixbuf

Types
=====

type Art_Filter_Level is
     (Filter_Nearest,
          Filter_Tiles,
          Filter_Bilinear,
          Filter_Hyper);

Filter_Nearest is nearest neighbor. It is the fastest and lowest
quality.    Filter_Tiles is an accurate simulation of the Postscript
image operator  without any interpolation enabled; each pixel is
rendered as a tiny  parallelogram of solid color, the edges of which
are implemented  with anti-aliasing. It resembles nearest neighbor for
enlargement,  and bilinear for reduction.    Filter_Bilinear is
bilinear interpolation. For enlargement, it is  equivalent to
point-sampling the ideal bilinear-interpolated  image. For reduction,
it is equivalent to laying down small tiles  and integrating over the
coverage area.    Filter_Hyper is the highest quality reconstruction
function. It is  derived from the hyperbolic filters in Wolberg's
"Digital Image  Warping," and is formally defined as the
hyperbolic-filter sampling  the ideal hyperbolic-filter interpolated
image (the filter is designed  to be idempotent for 1:1 pixel mapping).
It is the slowest and highest  quality.    Note: at this stage of
implementation, most filter modes are likely  not to be implemented.
type Art_Pix_Format is
     (Art_Pix_RGB);

type of the image.   The only possible value is currently RGB, but
extensions will  exist with CMYK, Gray, Lab, ...
type Art_Pixbuf is private;

A buffer that contains the image.   It supports alpha channels
(transparency).
subtype Art_U32 is Glib.Guint32;

32 bits unsigned integer used within libart.

File: gtkada_rm.info,  Node: Package_Gdk.Bitmap,  Next: Package_Gdk.Color,  Prev: Package_Gdk.Art.Pixbuf,  Up: Top

Package Gdk.Bitmap
******************

Pixmaps are off-screen drawables. They can be drawn upon with the
standard  drawing primitives, then copied to another drawable (such as
a Gdk_Window)  with Gdk.Pixmap.Draw. The depth of a pixmap is the
number of bits per  pixels. Bitmaps are simply pixmaps with a depth of
1. (That is, they are  monochrome bitmaps - each pixel can be either on
or off).   *note Package_Gdk.Pixmap:: for more details on pixmap
handling.

* Menu:

* Gdk.Bitmap Types::
* Gdk.Bitmap Subprograms::


File: gtkada_rm.info,  Node: Gdk.Bitmap Types,  Next: Gdk.Bitmap Subprograms,  Up: Package_Gdk.Bitmap

Types
=====

subtype Gdk_Bitmap is Gdk.Gdk_Bitmap;

A black and white image.   This type is mainly used as a mask when
drawing other colored images.   Each pixel can have two values, 0 or 1.

File: gtkada_rm.info,  Node: Gdk.Bitmap Subprograms,  Prev: Gdk.Bitmap Types,  Up: Package_Gdk.Bitmap

Subprograms
===========

procedure Gdk_New
     (Bitmap             : out    Gdk_Bitmap;
        Window             : in     Gdk.Window.Gdk_Window;
        Width              : in     Gint;
        Height             : in     Gint);

Create a new bitmap with a given size.
Window is used to determine default values for the new bitmap.   Can be
eventually null in which case the root window is used.   Width is the
width of the new bitmap in pixels.   Height is the height of the new
bitmap in pixels.
procedure Ref
     (Bitmap             : in     Gdk_Bitmap);

Add a reference to a bitmap.
procedure Unref
     (Bitmap             : in     Gdk_Bitmap);

This is the usual way to destroy a bitmap. The memory is freed when
there is no more reference
procedure Create_From_Data
     (Bitmap             : out    Gdk_Bitmap;
        Window             : in     Gdk.Window.Gdk_Window;
        Data               : in     String;
        Width              : in     Gint;
        Height             : in     Gint);

Create a bitmap from data in XBM format.
Window is used to determine default values for the new bitmap, can be
null in which case the root window is used.   Data is the XBM data.
Width is the width of the new bitmap in pixels.   Height is the height
of the new bitmap in pixels.

File: gtkada_rm.info,  Node: Package_Gdk.Color,  Next: Package_Gdk.Color_Context,  Prev: Package_Gdk.Bitmap,  Up: Top

Package Gdk.Color
*****************

This package provides an interface to the color handling facilities in
gtk+. It is able to handle any kind of visual (monochrome, greyscale,
color with different depths, ...), but provides a common and easy
interface for all of them.   Some of these functions expect a Colormap.
There are two ways you can  get such a colormap, either a system
default colormap or a per-widget  colormap. It is recommended, unless
you are writing your own new widget,  to always use the system default
Colormap. All the functions to get  these colormaps are found in
Gtk.Widget.

   Getting the Red/Green/Blue components can be done through Parse, and
is  actually recommended, since the exact color generally depends on the
visual your application is running on.

* Menu:

* Gdk.Color Types::
* Gdk.Color Subprograms::
* Gdk.Color Example::


File: gtkada_rm.info,  Node: Gdk.Color Types,  Next: Gdk.Color Subprograms,  Up: Package_Gdk.Color

Types
=====

type Gdk_Color is private;

A color to be displayed on the screen.   Currently, GtkAda only
supports the RGB standard, ie each color is  set by its red, green and
blue components.   An extra field (Pixel) is the internal
representation of the color,  which is set once the color has been
allocated.
type Gdk_Color_Array is array (Natural range <>) of Gdk_Color;

An array of colors.
type Gdk_Colormap is new C_Proxy;

The set of colors the can be displayed on the screen.   When the screen
is not a true-color screen (ie there is only a limited  number of
possible colors, like 256), the colors are in fact indexes  into a
colormap, which gives the components of the color.   This is the same
concept as a palette.

File: gtkada_rm.info,  Node: Gdk.Color Subprograms,  Next: Gdk.Color Example,  Prev: Gdk.Color Types,  Up: Package_Gdk.Color

Subprograms
===========

Creating and Destroying colors
------------------------------

function Parse
     (Spec               : in     String)
        return Gdk_Color;

Parse the string Spec, and get its Red/Green/Blue components.
The color is not allocated, and you need to call Alloc_Color.   If the
string could not be parsed to an existing color, Wrong_Color is  raised.
The string can be one of :

   * "RBG:FF/FF/FF" where the "FF" substrings are respectively the value
       of the red, green and blue components. Some other prefixes than
     RGB    are defined in the X11 definition, please see some X11
     documentation    (or the man page XParseColor on unix systems).

   * "color_name" which can be any color name defined in the file
     rgb.txt    of the user's system. You should always check that
     Wrong_Color was not    raised, in case the color was not known on
     the user's system. This    string is case insensitive.

procedure Alloc_Color
     (Colormap           : in     Gdk_Colormap;
        Color              : in out Gdk_Color;
        Writeable          : in     Boolean := False;
        Best_Match         : in     Boolean := True;
        Success            : out    Boolean);

Allocate a new color.
The fields RGB should have been set before calling this function.   If
Writeable is True, the color will be allocated read/write, that can  be
changed at any time. Not all visuals support this. On modern systems
this usage has become less useful than before, since redrawing the
screen with a new color is about as fast.   If Best_Match is True, and
the exact color can not be allocated, GtkAda  will find the closest
possible match, and modify the fields Red, Green  and Blue of Color.
Note that the allocation has more chances to succeed if Writeable is
False and Best_Match is True.   When you no longer use a color, you
should call Free.
procedure Alloc_Colors
     (Colormap           : in     Gdk_Colormap;
        Colors             : in out Gdk_Color_Array;
        Writeable          : in     Boolean := False;
        Best_Match         : in     Boolean := True;
        Success            : out    Boolean_Array;
        Result             : out    Gint);

Allocate a set of colors.
The parameters are the same as for Alloc_Color  Result is the number of
colors not successfully allocated.

   The size of the Boolean_Array is equal to the length of the
Colors_Array. Usage of an array of a different size will  probably lead
to a Constraint_Error.
procedure Alloc
     (Colormap           : in     Gdk_Colormap;
        Color              : in out Gdk_Color);

Same function as Alloc_Colors above, but for a single color.
The color is allocated non-writeable, and the best-match is taken.
Raises Wrong_Color if the color could not be allocated
function White
     (Colormap           : in     Gdk_Colormap)
        return Gdk_Color;

Return the default white color for the colormap.
If this color was not found or could not be allocated, Wrong_Color is
raised.
function Black
     (Colormap           : in     Gdk_Colormap)
        return Gdk_Color;

Return the default black colors for the colormap.
If this color is not found or could not be allocated, Wrong_Color is
raised.
function Get_System            return Gdk_Colormap;

Get the default colormap for the system.
This is the same function as Gtk.Widget.Get_Default_Colormap.
procedure Get_Visual
     (Colormap           : in     Gdk_Colormap;
        Visual             : out    Gdk.Visual.Gdk_Visual);

Get the visual associated with a colormap.
The main information you can get from there is the depth of the display.
procedure Gdk_New
     (Colormap           : out    Gdk_Colormap;
        Visual             : in     Gdk.Visual.Gdk_Visual;
        Private_Cmap       : in     Boolean);

Create a new colormap for the visual.
If Private_Cmap is true, then the  colormap won't be modifiable outside
this scope. This might result in  some strange colors on the display...
procedure Unref
     (Colormap           : in     Gdk_Colormap);

Unref is the only way to destroy a colormap once you no longer need it.
Note that because gtk+ uses reference counts, the colormap will not  be
actually destroyed while at least one object is using it.
procedure Ref
     (Colormap           : in     Gdk_Colormap);

Increment the ref-count for the color.
You should not have to use this function.
function Get_System_Size       return Gint;

Return the number of entries in the default colormap on the system.
procedure Free_Colors
     (Colormap           : in     Gdk_Colormap;
        Colors             : in     Gdk_Color_Array);

Free Colors, assuming they are allocated in Colormap.
procedure Store
     (Colormap           : in     Gdk_Colormap;
        Colors             : in     Gdk_Color_Array);

Store the Colors in the Colormap
procedure Alloc
     (Colormap           : in     Gdk_Colormap;
        Contiguous         : in     Boolean;
        Planes             : in     Gulong_Array;
        Pixels             : in     Gulong_Array;
        Succeeded          : out    Boolean);

Allocate some Read/Write color cells.
Color cells' values can be changed  dynamically. The pixels allocated
are returned in Pixels.   See XAllocColorCells(3) on Unix systems.
The Planes parameter can be used to nondestructively overlay one  set
of graphics over another. See the X11 manual for more info.   Note that
this is a low-level function which you should rarely  have to use.
procedure Free
     (Colormap           : in     Gdk_Colormap;
        Pixels             : in     Gulong_Array;
        Planes             : in     Gulong);

Free some colors in the colormap.
See XFreeColors(3) on Unix systems.
procedure Change
     (Colormap           : in     Gdk_Colormap;
        Color              : in out Gdk_Color;
        Succeeded          : out    Boolean);

Change the Read/Write colormap cell corresponding to Color.
The new value is the one contained in the Red, Green and Blue  fields
of Color.
procedure Change
     (Colormap           : in     Gdk_Colormap;
        Ncolors            : in     Gint);

Changes the first Ncolors defined in Colormap.
procedure Copy
     (Source             : in     Gdk_Color;
        Destination        : out    Gdk_Color);

Copy the Source color to Destination.
function Equal
     (Colora, Colorb     : in     Gdk_Color)
        return Boolean;

True if the Red, Green and Blue components of both colors are equal.
Setting/Getting the fields of Gdk_Color
---------------------------------------

procedure Set_Rgb
     (Color              : out    Gdk_Color;
        Red, Green, Blue   : in     Gushort);

Modify the fields of the color.
You then have to allocate the color with one of the Alloc* functions
above.
procedure Set_Pixel
     (Color              : in out Gdk_Color;
        Pixel              :        Gulong);

This function should almost never be used. Instead, use Alloc_Color
function Red
     (Color              : in     Gdk_Color)
        return Gushort;

Return the Red field of Color.
function Green
     (Color              : in     Gdk_Color)
        return Gushort;

Return the Green field of Color.
function Blue
     (Color              : in     Gdk_Color)
        return Gushort;

Return the Blue field of Color.
function Pixel
     (Color              : in     Gdk_Color)
        return Gulong;

Return the Pixel field of Color.

File: gtkada_rm.info,  Node: Gdk.Color Example,  Prev: Gdk.Color Subprograms,  Up: Package_Gdk.Color

Example
=======

      --  Here is an example how you can allocate a new color, when you know
      --  its red/green/blue components: Note that we allocate white in fact
      --  since the maximal value for color components is 65535.
         Color   : Gdk_Color;
         Success : Boolean;
         Set_Rbg (Color, 65535, 65535, 65535);
         Alloc_Color (Colormap   => Gtk.Widget.Get_Default_Colormap,
                      Color      => Color,
                      Writeable  => False,
                      Best_Match => True,
                      Success    => Success);
         if not Success then
             ...;  --  allocation failed
         end if;


File: gtkada_rm.info,  Node: Package_Gdk.Color_Context,  Next: Package_Gdk.Cursor,  Prev: Package_Gdk.Color,  Up: Top

Package Gdk.Color`_'Context
***************************

The Gdk_Color_Context type is used for allocating groups of colors.
It is now deprecated in favor of the Gdk.Color.* functions.

* Menu:


File: gtkada_rm.info,  Node: Package_Gdk.Cursor,  Next: Package_Gdk.Drawable,  Prev: Package_Gdk.Color_Context,  Up: Top

Package Gdk.Cursor
******************

This package provides the capability to create predefined mouse cursors
as well as user defined ones.

* Menu:

* Gdk.Cursor Types::
* Gdk.Cursor Subprograms::


File: gtkada_rm.info,  Node: Gdk.Cursor Types,  Next: Gdk.Cursor Subprograms,  Up: Package_Gdk.Cursor

Types
=====

type Gdk_Cursor is new Gdk.C_Proxy;


File: gtkada_rm.info,  Node: Gdk.Cursor Subprograms,  Prev: Gdk.Cursor Types,  Up: Package_Gdk.Cursor

Subprograms
===========

procedure Gdk_New
     (Widget             : out    Gdk_Cursor;
        Cursor_Type        : in     Gdk.Types.Gdk_Cursor_Type);

Create a new standard cursor.
procedure Gdk_New
     (Widget             : out    Gdk_Cursor;
        Source             : in     Gdk.Gdk_Pixmap;
        Mask               : in     Gdk.Gdk_Pixmap;
        Fg                 : in     Gdk.Color.Gdk_Color;
        Bg                 : in     Gdk.Color.Gdk_Color;
        X                  : in     Glib.Gint;
        Y                  : in     Glib.Gint);

Create a new cursor from a given pixmap and mask.
Both the pixmap and mask must have a depth of 1 (i.e. each pixel has
only 2 values - on or off). The standard cursor size is 16 by 16 pixels.
   * Source is the pixmap specifying the cursor.

   * Mask is the pixmap specifying the mask, which must be the same size
      as source.

   * Fg is the foreground color, used for the bits in the source which
     are   enabled. The color does not have to be allocated first.

   * Bg is the background color, used for the bits in the source which
     are   disabled. The color does not have to be allocated first.

   * X is the horizontal offset of the 'hotspot' of the cursor.

   * Y is the vertical offset of the 'hotspot' of the cursor.

procedure Destroy
     (Cursor             : in     Gdk_Cursor);

Destroy a cursor, freeing any resources allocated for it.

File: gtkada_rm.info,  Node: Package_Gdk.Drawable,  Next: Package_Gdk.Event,  Prev: Package_Gdk.Cursor,  Up: Top

Package Gdk.Drawable
********************

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.   *note Package_Gdk.GC:: for more information.

* Menu:

* Gdk.Drawable Types::
* Gdk.Drawable Subprograms::
* Gdk.Drawable Example::


File: gtkada_rm.info,  Node: Gdk.Drawable Types,  Next: Gdk.Drawable Subprograms,  Up: Package_Gdk.Drawable

Types
=====

subtype Gdk_Drawable is Gdk.Gdk_Drawable;

A screen area that can be drawn upon.

File: gtkada_rm.info,  Node: Gdk.Drawable Subprograms,  Next: Gdk.Drawable Example,  Prev: Gdk.Drawable Types,  Up: Package_Gdk.Drawable

Subprograms
===========

procedure Copy_Area
     (Dest               : in     Gdk_Drawable;
        GC                 : in     Gdk.GC.Gdk_GC;
        X                  : in     Gint;
        Y                  : in     Gint;
        Source             : in     Gdk.Window.Gdk_Window;
        Source_X           : in     Gint;
        Source_Y           : in     Gint;
        Width              : in     Gint := -1;
        Height             : in     Gint := -1);

Copy a drawing area.
Dest is the Gdk_Drawable to draw.   X is the x coordinate of the
destination within Dest.   X is the y coordinate of the destination
within Dest.   Source_X is the left edge of the source rectangle within
Source.   Source_Y is the top of the source rectangle within Source.
Width is the width of the area to be copied, or -1 to make the area
extend to the right edge of Source.   Height is the height of the area
to be copied, or -1 to make the area  extend to the bottom edge of
Source.
procedure Draw_Point
     (Drawable           : in     Gdk_Drawable;
        Gc                 : in     Gdk.GC.Gdk_GC;
        X                  : in     Gint;
        Y                  : in     Gint);

Draw a point, using the foreground color and other attributes of the Gc.
procedure Draw_Points
     (Drawable           : in     Gdk_Drawable;
        Gc                 : in     Gdk.GC.Gdk_GC;
        Points             : in     Gdk.Types.Gdk_Points_Array);

Draw a number of points.
Use the foreground color and other attributes of the Gc.
procedure Draw_Line
     (Drawable           : in     Gdk_Drawable;
        Gc                 : in     Gdk.GC.Gdk_GC;
        X1                 : in     Gint;
        Y1                 : in     Gint;
        X2                 : in     Gint;
        Y2                 : in     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.
procedure Draw_Lines
     (Drawable           : in     Gdk_Drawable;
        Gc                 : in     Gdk.GC.Gdk_GC;
        Points             : in     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.
procedure Draw_Segments
     (Drawable           : in     Gdk_Drawable;
        Gc                 : in     Gdk.GC.Gdk_GC;
        Segs               : in     Gdk.Types.Gdk_Segments_Array);

Draw a number of unconnected lines.
procedure Draw_Rectangle
     (Drawable           : in     Gdk_Drawable;
        Gc                 : in     Gdk.GC.Gdk_GC;
        Filled             : in     Boolean := False;
        X                  : in     Gint;
        Y                  : in     Gint;
        Width              : in     Gint;
        Height             : in     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.
procedure Draw_Arc
     (Drawable           : in     Gdk_Drawable;
        Gc                 : in     Gdk.GC.Gdk_GC;
        Filled             : in     Boolean := False;
        X                  : in     Gint;
        Y                  : in     Gint;
        Width              : in     Gint;
        Height             : in     Gint;
        Angle1             : in     Gint;
        Angle2             : in     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.
procedure Draw_Polygon
     (Drawable           : in     Gdk_Drawable;
        Gc                 : in     Gdk.GC.Gdk_GC;
        Filled             : in     Boolean;
        Points             : in     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.
procedure Draw_Text
     (Drawable           : in     Gdk_Drawable;
        Font               : in     Gdk.Font.Gdk_Font;
        Gc                 : in     Gdk.GC.Gdk_GC;
        X                  : in     Gint;
        Y                  : in     Gint;
        Text               : in     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.
procedure Draw_Text
     (Drawable           : in     Gdk_Drawable;
        Font               : in     Gdk.Font.Gdk_Font;
        Gc                 : in     Gdk.GC.Gdk_GC;
        X                  : in     Gint;
        Y                  : in     Gint;
        Wide_Text          : in     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.
procedure Draw_Pixmap
     (Drawable           : in     Gdk_Drawable;
        Gc                 : in     Gdk.GC.Gdk_GC;
        Src                : in     Gdk_Drawable;
        Xsrc               : in     Gint;
        Ysrc               : in     Gint;
        Xdest              : in     Gint;
        Ydest              : in     Gint;
        Width              : in     Gint := -1;
        Height             : in     Gint := -1);

Draw a pixmap, or a part of a pixmap, onto another drawable.
Src is the source GdkPixmap 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.
procedure Draw_Image
     (Drawable           : in     Gdk_Drawable;
        Gc                 : in     Gdk.GC.Gdk_GC;
        Image              : in     Gdk.Image.Gdk_Image;
        Xsrc               : in     Gint;
        Ysrc               : in     Gint;
        Xdest              : in     Gint;
        Ydest              : in     Gint;
        Width              : in     Gint := -1;
        Height             : in     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.

File: gtkada_rm.info,  Node: Gdk.Drawable Example,  Prev: Gdk.Drawable Subprograms,  Up: Package_Gdk.Drawable

Example
=======


      with Glib;
      with Gdk.Window;
      with Gdk.Drawable;
      with Gdk.GC;
      with Gdk.Font;
      with Gtk.Drawing_Area;
     
      procedure Draw (Drawing : in out Gtk.Drawing_Area.Gtk_Drawing_Area) is
         Gdkw : Gdk.Window.Gdk_Window;
         GC   : Gdk.GC.Gdk_GC;
         Font : Gdk.Font.Gdk_Font;
         use type Glib.Gint;
     
      begin
         -- Get the Gdk window
     
         Gdkw := Gtk.Drawing_Area.Get_Window (Drawing) ;
     
         -- Clear the window
     
         GDK.Window.Clear (Gdkw) ;
     
         -- Create a graphic context associated with this window
     
         Gdk.GC.Gdk_New (GC, Gdkw);
     
         -- Draw a line in this window
     
         Gdk.Drawable.Draw_Line
           (Drawable => Gdkw,
            GC => GC,
            X1 =>   0, Y1 =>   0,
            X2 => 100, Y2 => 100);
     
         -- Draw an arc
     
         Gdk.Drawable.Draw_Arc
           (Drawable => Gdkw,
            Gc       => gc,
            Filled   => True,
            X        => 100,
            Y        => 100,
            Width    => 200,
            Height   => 100,
            Angle1   => 0 * 64,
            Angle2   => 270 * 64);
     
         -- Ask for a given font
     
         Gdk.Font.Load (Font,
                        "-adobe-courier-medium-i-*-*-15-*-*-*-*-*-*-*");
         Gdk.Drawable.Draw_Text
           (Drawable    => Gdkw,
            Font        => Font,
            Gc          => gc,
            X           => 50,
            Y           => 50,
            Text        => "Hello World");
         Gdk.GC.Destroy (GC);
      end Draw;


File: gtkada_rm.info,  Node: Package_Gdk.Event,  Next: Package_Gdk.Font,  Prev: Package_Gdk.Drawable,  Up: Top

Package Gdk.Event
*****************

This package provides functions dealing with events from the window
system.   In GtkAda applications, the events are handled automatically
in  Gtk.Main.Do_Event, and passed on to the appropriate widgets, so
these  functions are rarely needed.

   !! Warning !! This is one of the only package that requires manual
memory management in some cases. If you use the function Allocate,  you
have to use the function Free too...

* Menu:

* Gdk.Event Types::
* Gdk.Event Subprograms::


File: gtkada_rm.info,  Node: Gdk.Event Types,  Next: Gdk.Event Subprograms,  Up: Package_Gdk.Event

Types
=====

type Event_Handler_Func is access procedure

type Gdk_Event is new Gdk.C_Proxy;

subtype Gdk_Event_Any is Gdk_Event;

Change from GtkAda1.2.3: There is no longer a tagged type  hierarchy,
only one type.   However there are now a few runtime tests for each of
the  function, to check whether a given field is available or not.
Fields common to all events: Window, Send_Event, Event_Type
subtype Gdk_Event_Button is Gdk_Event;

A button was pressed or release. Relevant fields:  Time, X, Y,
Pressure, Xtilt, Ytilt, State, Button, Source,  Device_Id, X_Root,
Y_Root, Window.   Type: Button_Press, Gdk_2Button_Press,
Gdk_3Button_Press or  Button_Release.
subtype Gdk_Event_Client is Gdk_Event;

This is an event used to send arbitrary data from one X application  to
another. This event too is almost never used, and is not documented
here. Please consult an X11 documentation for more information.
Relevant fields: Message_Type, Data  Type: Client_Event
type Gdk_Event_Client_Data_Format is
     (Char_Array, Short_Array, Long_Array);

subtype Gdk_Event_Configure is Gdk_Event;

The window configuration has changed: either it was remapped,  resized,
moved, ...   Note that you usually don't have to redraw your window
when you  receive such an event, since it is followed by an
Gdk_Event_Expose.   Relevant fields: X, Y, Width, Height  Type:
Configure
subtype Gdk_Event_Crossing is Gdk_Event;

The mouse has been moved in or out of the window  Relevant fields:
Time, SubWindow, X, Y, X_Root, Y_Root, Mode,  Detail, Focus, State
Type: Enter_Notify, Leave_Notify
subtype Gdk_Event_Expose is Gdk_Event;

The window needs to be redrawn. For efficiency, gtk gives you the
smallest area that you need to redraw  Relevant fields: Area, Count,
Graphics_Expose  Type: Expose
subtype Gdk_Event_Focus is Gdk_Event;

The focus has changed for a window.   Relevant fields: in  Type:
Focus_Change
subtype Gdk_Event_Key is Gdk_Event;

A keyboard key was pressed  Relevant fields: Time, State, Key_Val,
String  Type: Key_Press, Key_Release
subtype Gdk_Event_Motion is Gdk_Event;

The mouse has moved  Relevant fields: Time, X, Y, Pressure, Xtilt,
Ytilt, State,  Is_Hint, Source, Device_Id, X_Root, Y_Root  Type:
Motion_Notify
subtype Gdk_Event_No_Expose is Gdk_Event;

Indicate that the source region was completely available when parts of
a drawable were copied.   This is also emitted when a gc whose
"exposures" attribute is set to  False in a call to Copy_Area or
Draw_Pixmap. See the documentation for  Gdk.GC.Set_Exposures.   No
Relevent fields except the common ones  Type: No_Expose
subtype Gdk_Event_Property is Gdk_Event;

Some property of the window was modified. GtkAda provides a higher
level interface, and you almost never need to use this event.
Relevent fields: Atom, Time, Property_State  Type: Property_Notify
subtype Gdk_Event_Proximity is Gdk_Event;

from gtk+: "This event type will be used pretty rarely. It only is
important for XInput aware programs that are drawing their own
cursor". This is only used with non standard input devices, like
graphic tablets.   Relevant fields: Time, Source, Device_Id  Type:
Proximity_In, Proximity_Out
subtype Gdk_Event_Selection is Gdk_Event;

This is how X11 implements a simple cut-and-paste mechanism. However,
GtkAda provides a higher level interface to the selection mechanism,
so this event will almost never be used.   Relevant fields: Selection,
Target, Property, Requestor, Time  Type: Selection_Clear,
Selection_Request, Selection_Notify
subtype Gdk_Event_Visibility is Gdk_Event;

The visibility state of the window (partially visibly, fully visible,
hidden). This event almost never need to be used, since other events
are generated at the same time, like expose_events  Relevant fields:
Visibility_State  type: Visibility_Notify

File: gtkada_rm.info,  Node: Gdk.Event Subprograms,  Prev: Gdk.Event Types,  Up: Package_Gdk.Event

Subprograms
===========

Access to fields of the event
-----------------------------

function Get_Event_Type
     (Event              : in     Gdk_Event)
        return Types.Gdk_Event_Type;

The type of the event.
function Get_Send_Event
     (Event              : in     Gdk_Event)
        return Boolean;

Set to true if the event was generated by the application, False
if generated by the X server/Win32.
function Get_Window
     (Event              : in     Gdk_Event)
        return Gdk.Window.Gdk_Window;

The window the event occured on.
function Get_Time
     (Event              : in     Gdk_Event)
        return Guint32;

Time when the event occured.
function Get_X
     (Event              : in     Gdk_Event)
        return Gdouble;

Horizontal coordinate of the mouse when the event occured.
The coordinates are relative to the parent window.
function Get_Y
     (Event              : in     Gdk_Event)
        return Gdouble;

Vertical coordinate of the mouse when the event occured.
The coordinates are relative to the parent window.
function Get_X_Root
     (Event              : in     Gdk_Event)
        return Gdouble;

Horizontal coordinate of the mouse when the event occured.
Relative to the root window.
function Get_Y_Root
     (Event              : in     Gdk_Event)
        return Gdouble;

Vertical coordinate of the mouse when the event occured.
Relative to the root window.
function Get_Button
     (Event              : in     Gdk_Event)
        return Guint;

Number of the button that was pressed.
function Get_State
     (Event              : in     Gdk_Event)
        return Gdk.Types.Gdk_Modifier_Type;

State of the mouse buttons and keyboard keys just prior to the event.
function Get_Subwindow
     (Event              : in     Gdk_Event)
        return Gdk.Window.Gdk_Window;

Child window for the event.
For an Enter_Notify_Event, this is set to the initial window for the
pointer; for an Leave_Notify_Event this is set to the window occupied
by the pointer in its last position.
function Get_Mode
     (Event              : in     Gdk_Event)
        return Gdk.Types.Gdk_Crossing_Mode;

Return the mode of an Event.
Set to indicate whether the events are normal events, pseudo-motion
events when a grab activates or pseudo-motion events when a grab
deativates.
function Get_Detail
     (Event              : in     Gdk_Event)
        return Gdk.Types.Gdk_Notify_Type;

Set to indicate the notify details.
Most applications can ignore events with a Notify Virtual or a
Notify_Non_Linear_Virtual detail.
function Get_Focus
     (Event              : in     Gdk_Event)
        return Boolean;

Set to true if the window for the event is the focus window.
function Get_Pressure
     (Event              : in     Gdk_Event)
        return Gdouble;

This is set to a constant in the gtk+ code itself, so it
is most probably useless... Its value is 0.5.   It is only used with
some special input devices, like drawing  tablets,...
function Get_Xtilt
     (Event              : in     Gdk_Event)
        return Gdouble;

This is set to a constant in the gtk+ code itself, so it
is most probably useless... Its value is 0.0.   It is only used with
some special input devices, like drawing  tablets,...
function Get_Ytilt
     (Event              : in     Gdk_Event)
        return Gdouble;

This is set to a constant in the gtk+ code itself, so it
is most probably useless... Its value is 0.0.   It is only used with
some special input devices, like drawing  tablets,...
function Get_Width
     (Event              : in     Gdk_Event)
        return Gint16;

Get the width in a configure event.
function Get_Height
     (Event              : in     Gdk_Event)
        return Gint16;

Get the height in a configure event.
function Get_Source
     (Event              : in     Gdk_Event)
        return Gdk.Types.Gdk_Input_Source;

Set to a constant for now in the gtk+ source... Probably useless.
function Get_Device_Id
     (Event              : in     Gdk_Event)
        return Gdk.Types.Gdk_Device_Id;

Set to a constant for now in the gtk+ source... Probably useless.
Since multiple input devices can be used at the same time, like a mouse
and a graphic tablet, this indicated which one generated the event.
function Get_Area
     (Event              : in     Gdk_Event)
        return Rectangle.Gdk_Rectangle;

The minimal area on which the event applies.
For Expose_Events, this is the minimal area to redraw.
function Get_Count
     (Event              : in     Gdk_Event)
        return Gint;

Number of Expose_Events that are to follow this one.
Most applications can ignore the event if Count is not 0, which also
allows for optimizations.
function Get_In
     (Event              : in     Gdk_Event)
        return Boolean;

True if the window has gained the focus, False otherwise.
function Get_Is_Hint
     (Event              : in     Gdk_Event)
        return Boolean;

???
function Get_Key_Val
     (Event              : in     Gdk_Event)
        return Gdk.Types.Gdk_Key_Type;

Code of the key that was pressed (and that generated the event.
function Get_String
     (Event              : in     Gdk_Event)
        return String;

Symbol of the key that was pressed, as a string.
function Get_Atom
     (Event              : in     Gdk_Event)
        return Gdk.Types.Gdk_Atom;

Indicate which property has changed.
??? Atom should not be a Guint
function Get_Property_State
     (Event              : in     Gdk_Event)
        return Guint;

??? The return type should be changed.
function Get_Visibility_State
     (Event              : in     Gdk_Event)
        return Gdk.Types.Gdk_Visibility_State;

Return the new visibility state for the window.
function Get_Selection
     (Event              : in     Gdk_Event)
        return Gdk.Types.Gdk_Atom;

What was selected in the window...
function Get_Target
     (Event              : in     Gdk_Event)
        return Gdk.Types.Gdk_Atom;

???
function Get_Property
     (Event              : in     Gdk_Event)
        return Gdk.Types.Gdk_Atom;

???
function Get_Requestor
     (Event              : in     Gdk_Event)
        return Guint32;

???
function Get_Message_Type
     (Event              : in     Gdk_Event)
        return Gdk.Types.Gdk_Atom;

???
function Get_Data
     (Event              : in     Gdk_Event)
        return Gdk_Event_Client_Data;

???
Modifying the fields of an event
--------------------------------

procedure Set_Window
     (Event              : in     Gdk_Event;
        Win                :        Gdk.Window.Gdk_Window);

Set the Window field of an event.
procedure Set_X
     (Event              : in     Gdk_Event;
        X                  :        Gdouble);

Set the X field of an event.
procedure Set_Y
     (Event              : in     Gdk_Event;
        Y                  :        Gdouble);

Set the Y field of an event.
procedure Set_Xroot
     (Event              : in     Gdk_Event;
        Xroot              :        Gdouble);

Set the Xroot field of an event.
procedure Set_Yroot
     (Event              : in     Gdk_Event;
        Yroot              :        Gdouble);

Set the Yroot field of an event.
procedure Set_Width
     (Event              : in     Gdk_Event;
        Width              :        Gint16);

Set the Width field of an event.
procedure Set_Height
     (Event              : in     Gdk_Event;
        Height             :        Gint16);

Set the Height field of an event.
procedure Set_Button
     (Event              : in     Gdk_Event;
        Button             :        Guint);

Set the Button field of an event.
procedure Set_Time
     (Event              : in     Gdk_Event;
        Time               :        Guint32);

Set the time for the event.
If Time is 0, then it is set to the current time.
procedure Set_State
     (Event              : in     Gdk_Event;
        State              : in     Gdk.Types.Gdk_Modifier_Type);

Set the State field of an event.
procedure Set_Subwindow
     (Event              : in     Gdk_Event;
        Window             : in     Gdk.Window.Gdk_Window);

Set the Subwindow field of an event.
procedure Set_Mode
     (Event              : in     Gdk_Event;
        Mode               : in     Gdk.Types.Gdk_Crossing_Mode);

Set the Mode field of an event.
procedure Set_Detail
     (Event              : in     Gdk_Event;
        Detail             : in     Gdk.Types.Gdk_Notify_Type);

Set the Detail field of an event.
procedure Set_Focus
     (Event              : in     Gdk_Event;
        Has_Focus          :        Boolean);

Set the Focus field of an event.
procedure Set_Area
     (Event              : in     Gdk_Event;
        Area               :        Rectangle.Gdk_Rectangle);

Set the Area field of an event.
procedure Set_In
     (Event              : in     Gdk_Event;
        Focus_In           :        Boolean);

Set the In field of an event.
procedure Set_Is_Hint
     (Event              : in     Gdk_Event;
        Is_Hint            :        Boolean);

Set the Is_Hint field of an event.
procedure Set_Key_Val
     (Event              : in     Gdk_Event;
        Key                :        Gdk.Types.Gdk_Key_Type);

Set the Key_Val field of an event.
procedure Set_Atom
     (Event              : in     Gdk_Event;
        Atom               :        Gdk.Types.Gdk_Atom);

Set the Atom field of an event.
procedure Set_Property_State
     (Event              : in     Gdk_Event;
        State              :        Guint);

Set the Property_State field of an event.
procedure Set_Visibility_State
     (Event              : in     Gdk_Event;
        State              :        Gdk.Types.Gdk_Visibility_State);

Set the Visibility_State field of an event.
procedure Set_Selection
     (Event              : in     Gdk_Event;
        Selection          :        Gdk.Types.Gdk_Atom);

Set the Selection field of an event.
procedure Set_Target
     (Event              : in     Gdk_Event;
        Target             :        Gdk.Types.Gdk_Atom);

Set the Target field of an event.
procedure Set_Property
     (Event              : in     Gdk_Event;
        Property           :        Gdk.Types.Gdk_Atom);

Set the Property field of an event.
procedure Set_Requestor
     (Event              : in     Gdk_Event;
        Requestor          :        Guint32);

Set the Requestor field of an event.
procedure Set_Message_Type
     (Event              : in     Gdk_Event;
        Typ                :        Gdk.Types.Gdk_Atom);

Set the Message_Type field of an event.
procedure Set_String
     (Event              : in     Gdk_Event;
        Str                :        String);

Set the string associated with an event.
General functions
-----------------

procedure Deep_Copy
     (From               :        Gdk_Event;
        To                 : out    Gdk_Event);

Deep copy for an event. The C structure is itself duplicated.
You need to deallocated it yourself with a call to Free below.
procedure Get_Graphics_Expose
     (Event              : out    Gdk_Event_Expose;
        Window             : in     Gdk.Window.Gdk_Window);

Waits for a GraphicsExpose or NoExpose event
If it gets a GraphicsExpose event, it returns a pointer to it,
otherwise it returns an event for which Is_Created is False.

   This function can be used to implement scrolling: you must call
Gdk.GC.Set_Exposures with True on the GC you are using for the
drawing, so that a events are generated for obscured areas and every
time a new part of the widget is drawn. However, there is a race
condition if multiple scrolls happen before you have finished
processing the first one. A workaround is to call Get_Graphics_Expose
after every scroll until it returns a null event.
function Events_Pending        return Boolean;

Is there any event pending on the queue ?
procedure Get
     (Event              : out    Gdk_Event);

Get the next event on the queue.
procedure Peek
     (Event              : out    Gdk_Event);

Look at the next event on the queue, but leave if there.
procedure Put
     (Event              : in     Gdk_Event);

Add an event on the queue - Better to use Gtk.Signal.Emit_By_Name
procedure Set_Show_Events
     (Show_Events        : in     Boolean := True);

For debug purposes, you can choose whether you want to see the events
GtkAda receives.
function Get_Show_Events       return Boolean;

Return the current state of Show_Events.
procedure Send_Client_Message_To_All
     (Event              : in     Gdk_Event);

Low level routine to send an Event to every window.
function Send_Client_Message
     (Event              : in     Gdk_Event;
        Xid                : in     Guint32)
        return Boolean;

Low level routine to send an Event to a specified X window.
procedure Allocate
     (Event              : out    Gdk_Event;
        Event_Type         : in     Types.Gdk_Event_Type;
        Window             : in     Gdk.Window.Gdk_Window);

Create an event, whose fields are uninitialized.
You need to use the function Set_* above to modify them, before you can
send the event with Emit_By_Name.   !!Note!!: The event has to be
freed if you have called this function.   Use the function Free.
procedure Free
     (Event              : in out Gdk_Event);

Free the memory (and C structure) associated with an event.
You need to call this function only if the event was created through
Allocate, not if it was created by GtkAda itself (or you would get  a
segmentation fault).
procedure Event_Handler_Set
     (Func               :        Event_Handler_Func;
        Data               :        System.Address);

Set up a new event handler.
This handler replaces the default GtkAda event handler, and thus should
make sure that all events are correctly handled.

   Note that managing the memory for Data is your responsability, and
Data is passed as is to Func.
function From_Address
     (C                  :        System.Address)
        return Gdk_Event;

Convert a C handler to the matching Event structure.
function To_Address
     (C                  :        Gdk_Event)
        return System.Address;

Convert an event to the underlying C handler.
function Is_Created
     (E                  :        Gdk_Event)
        return Boolean;

Return True if the underlying C event has been created.
