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

INFO-DIR-SECTION User Interface Toolkit
START-INFO-DIR-ENTRY
* GtkAda_Rm: (gtkada_rm).           Ada95 graphical tookit based on GTK+ (Reference Manual)
END-INFO-DIR-ENTRY


File: gtkada_rm.info,  Node: Gtk.Window Subprograms,  Next: Gtk.Window Example,  Prev: Gtk.Window Signals,  Up: Package_Gtk.Window

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

procedure Gtk_New
       (Window             : out    Gtk_Window;
        The_Type           :        Gtk.Enums.Gtk_Window_Type
                            := Gtk.Enums.Window_Toplevel);

Create a new window.
The_Type specifies the type of the window, and can be either a  top
level window, a dialog or a popup window. You will most often only
need to use Window_Toplevel, the other types are mostly used internally
by gtk+.   A Popup window is used to display a temporary information
window. It has  no borders nor resizing handles.
function Get_Type              return Glib.GType;


Return the internal value associated with a Gtk_Window.
procedure Set_Title
       (Window             : access Gtk_Window_Record;
        Title              :        UTF8_String);

Change the title of the window, as it appears in the title bar.
Note that on some systems you might not be able to change it.
function Get_Title
       (Window             : access Gtk_Window_Record)
        return UTF8_String;

Return the title of the window, or "" if there is none
procedure Set_Wmclass
       (Window             : access Gtk_Window_Record;
        Wmclass_Name       :        String;
        Wmclass_Class      :        String);

Don't use this function. It sets the X Window System "class" and
"name" hints for a window. According to the ICCCM, you should  always
set these to the same value for all windows in an  application, and GTK
sets them to that value by default, so calling  this function is sort
of pointless. However, you may want to call  Set_Role on each window in
your application, for the  benefit of the session manager. Setting the
role allows the window  manager to restore window positions when
loading a saved session.
procedure Set_Role
       (Window             : access Gtk_Window_Record;
        Role               :        String);

In combination with the window title, the window role allows a
window manager to identify "the same" window when an application is
restarted. So for example you might set the "toolbox" role on your
app's toolbox window, so that when the user restarts their session,
the window manager can put the toolbox back in the same place.   If a
window already has a unique title, you don't need to set the  role,
since the WM can use the title to identify the window when  restoring
the session.   Role: unique identifier for the window to be used when
restoring a  session
procedure Add_Accel_Group
       (Window             : access Gtk_Window_Record;
        Accel_Group        :        Gtk.Accel_Group.Gtk_Accel_Group);

Specify an accelerator group for the window.
procedure Remove_Accel_Group
       (Window             : access Gtk_Window_Record;
        Accel_Group        :        Gtk.Accel_Group.Gtk_Accel_Group);

Remove the specified accelerator group for the window.
procedure Set_Position
       (Window             : access Gtk_Window_Record;
        Position           :        Gtk.Enums.Gtk_Window_Position);

Specify how the position of the window should be computed.
If Position is Win_Pos_Center_Always or Win_Pos_Center, then the window
is centered on the screen. In the first case, it is also recentered
when the window is resized with Gtk.Widget.Set_Usize (ie except on
user action).   If Position is Win_Pos_Mouse, then the window is
positioned so that it  centered around the mouse.   If Position is
Win_Pos_None, no calculation is done. If  Gtk.Widget.Set_Uposition as
been called, it is respected. This is the  default case.
function Activate_Focus
       (Window             : access Gtk_Window_Record)
        return Boolean;

Call Gtk.Widget.Activate on the widget that currently has the focus in
the window, ie sends an "activate" signal to that widget. Note that this
signal does not really exists and is mapped to some widget-specific
signal.   Return True if the widget could be activated, False otherwise.
The Focus widget is set through a signal "set_focus".
function Activate_Default
       (Window             : access Gtk_Window_Record)
        return Boolean;

Activate the default widget in the window.
In other words, send an "activate" signal to that widget. Note that
this signal is a virtual one and is mapped to some widget specific
signal.   Return False is the widget could not be activated or if there
was  no default widget.   You can set the default widget with the
following calls:

   Gtk.Widget.Set_Flags (Widget, Can_Default);

   Gtk.Widget.Grab_Default (Widget);
procedure Set_Transient_For
       (Window             : access Gtk_Window_Record;
        Parent             : access Gtk_Window_Record'Class);

Specify that Window is a transient window.
A transient window is a temporary window, like a popup menu or a
dialog box). Parent is the toplevel window of the application to which
Window belongs. A window that has set this can expect less decoration
from the window manager (for instance no title bar and no borders).
(see XSetTransientForHint(3) on Unix systems)

   The main usage of this function is to force Window to be on top of
Parent on the screen at all times. Most window managers respect this
hint, even if this is not mandatory.
procedure Set_Type_Hint
       (Window             : access Gtk_Window_Record;
        Hint               :        Gdk.Window.Gdk_Window_Type_Hint);

allow the window manager to decorate and handle the window in a way
which is suitable to the function of the window in your application.
This function should be called before the window becomes visible.
procedure Set_Destroy_With_Parent
       (Window             : access Gtk_Window_Record;
        Setting            :        Boolean := True);

Set whether destroying the transient parent of Window will also destroy
Window itself.   This is useful for dialogs that shouldn't persist
beyond the lifetime  of the main window they're associated with, for
example.
procedure Set_Resizable
       (Window             : access Gtk_Window_Record;
        Resizable          :        Boolean := True);

Set whether the user can resize a window.
Windows are user resizable by default.
function Get_Resizable
       (Window             : access Gtk_Window_Record)
        return Boolean;

Whether the user can resize a window.
function Get_Resizeable
       (Window             : access Gtk_Window_Record)
        return Boolean;

This function is deprecated.
procedure Set_Gravity
       (Window             : access Gtk_Window_Record;
        Gravity            :        Gdk.Window.Gdk_Gravity);

Window gravity defines the "reference point" to be used when
positioning or resizing a window. Calls to  Gtk.Widget.Set_UPosition
will position a different point on the  window depending on the window
gravity. When the window changes size  the reference point determined
by the window's gravity will stay in  a fixed location.

   See Gdk_Gravity for full details. To briefly summarize,
Gravity_North_West means that the reference point is the  northwest
(top left) corner of the window  frame. Gravity_South_East would be the
bottom right corner of  the frame, and so on. If you want to position
the window contents,  rather than the window manager's frame,
Gravity_Static moves  the reference point to the northwest corner of
the Gtk_Window  itself.

   The default window gravity is Gravity_North_West.
function Get_Gravity
       (Window             : access Gtk_Window_Record)
        return Gdk.Window.Gdk_Gravity;

Return the value set by Set_Gravity.
procedure Set_Geometry_Hints
       (Window             : access Gtk_Window_Record;
        Geometry_Widget    :        Gtk.Widget.Gtk_Widget;
        Geometry           :        Gdk.Window.Gdk_Geometry;
        Geom_Mask          :        Gdk.Window.Gdk_Window_Hints);

Specify some geometry hints for the window.
This includes its minimal and maximal sizes, ...   These attributes are
specified in Geometry.   Geom_Mask indicates which of the fields in
Geometry are set.   Geometry_Widget can be null (and thus is not an
access parameter). It  adds some extra size to Geometry based on the
actual size of  Geometry_Widget (the extra amount is Window'Size -
Geometry_Widget'Size)

   Geometry.Base_* indicates the size that is used by the window manager
to report the size: for instance, if Base_Width = 600 and actual width
is 200, the window manager will indicate a width of -400.

   If your window manager respects the hints (and its doesn't have to),
then the user will never be able to resize the window to a size not
in Geometry.Min_* .. Geometry.Max_*.

   Geometry.*_Inc specifies by which amount the size will be multiplied.
For instance, if Width_Inc = 50 and the size reported by the Window
Manager is 2x3, then the actual width of the window is 100.   Your
window's size will always be a multiple of the *_Inc values.

   Geometry.*_Aspect specifies the aspect ratio for the window. The
window  will always be resized so that the ratio between its width and
its  height remains in the range Min_Aspect .. Max_Aspect.
procedure Set_Has_Frame
       (Window             : access Gtk_Window_Record);

If this function is called on a window before it is realized
or showed it will have a "frame" window around widget-window.   Using
the signal frame_event you can receive all events targeted at the
frame.

   This function is used by the linux-fb port to implement managed
windows, but it could concievably be used by X-programs that  want to
do their own window decorations.
procedure Set_Frame_Dimensions
       (Window             : access Gtk_Window_Record;
        Left               :        Gint;
        Top                :        Gint;
        Right              :        Gint;
        Bottom             :        Gint);

Change the size of the frame border.
This has only an effect for windows with frames (see Set_Has_Frame).
procedure Set_Decorated
       (Window             : access Gtk_Window_Record;
        Setting            :        Boolean := True);

By default, windows are decorated with a title bar, resize
controls, etc. Some window managers allow GtkAda to disable these
decorations, creating a borderless window. If you set the decorated
property to False using this function, GtkAda will do its best to
convince the window manager not to decorate the window.
procedure Set_Modal
       (Window             : access Gtk_Window_Record;
        Modal              :        Boolean := True);

Define the window as being Modal.
It will grab the input from the keyboard and the mouse while it is
displayed and will release it when it is hidden. The grab is only in
effect for the windows that belong to the same application, and will not
affect other applications running on the same screen.   In cunjunction
with Gtk.Main.Main, this is the easiest way to show a  dialog to which
the user has to answer before the application can  continue.
function List_Toplevels        return Gtk.Widget.Widget_List.Glist;


Return a list of all existing toplevel windows.
The widgets in the list are not individually referenced. If you want
to iterate through the list and perform actions involving  callbacks
that might destroy the widgets, you must "ref"erence  all the widgets
in the list first and then unref all the widgets  afterwards.   The
list itself must be freed by the caller
procedure Present
       (Window             : access Gtk_Window_Record);

Present a window to the user.
This may mean raising the window in the stacking order, deiconifying it,
moving it to the current desktop, and/or giving it the keyboard focus,
possibly dependent on the user's platform, window manager, and
preferences.

   If Window is hidden, this function calls Gtk.Widget.Show as well.

   This function should be used when the user tries to open a window
that's already open. Say for example the preferences dialog is
currently open, and the user chooses Preferences from the menu  a
second time; use Present to move the already-open dialog  where the
user can see it.
procedure Iconify
       (Window             : access Gtk_Window_Record);

Ask to iconify Window.
Note that you shouldn't assume the window is definitely iconified
afterward, because other entities (e.g. the user or window manager)
could deiconify it again, or there may not be a window manager in which
case iconification isn't possible, etc. But normally the window will
end  up iconified. Just don't write code that crashes if not.

   It's permitted to call this function before showing a window,  in
which case the window will be iconified before it ever appears
onscreen.

   You can track iconification via the "window_state_event" signal  on
Gtk_Widget.
procedure Deiconify
       (Window             : access Gtk_Window_Record);

Ask to deiconify Window.
Note that you shouldn't assume the window is definitely deiconified
afterward, because other entities (e.g. the user or window manager)
could iconify it again before your code which assumes deiconification
gets to run.

   You can track iconification via the "window_state_event" signal  on
Gtk_Widget.
procedure Stick
       (Window             : access Gtk_Window_Record);

Ask to stick Window, which means that it will appear on all user
desktops. Note that you shouldn't assume the window is definitely
stuck afterward, because other entities (e.g. the user or window
manager) could unstick it again, and some window managers do not
support sticking windows. But normally the window will end up  stuck.

   It's permitted to call this function before showing a window.

   You can track stickiness via the "window_state_event" signal  on
Gtk_Widget.
procedure Unstick
       (Window             : access Gtk_Window_Record);

Ask to unstick Window, which means that it will appear on only
one of the user's desktops. Note that you shouldn't assume the  window
is definitely unstuck afterward, because other entities  (e.g. the user
or window manager) could stick it again. But  normally the window will
end up stuck.

   You can track stickiness via the "window_state_event" signal  on
Gtk_Widget.
procedure Maximize
       (Window             : access Gtk_Window_Record);

Ask to maximize Window, so that it becomes full-screen.
Note that you shouldn't assume the window is definitely maximized
afterward, because other entities (e.g. the user or window manager)
could unmaximize it again, and not all window managers support
maximization. But normally the window will end up maximized.

   It's permitted to call this function before showing a window,  in
which case the window will be maximized when it appears onscreen
initially.

   You can track maximization via the "window_state_event" signal  on
Gtk_Widget.
procedure Unmaximize
       (Window             : access Gtk_Window_Record);

Ask to unmaximize Window.
Note that you shouldn't assume the window is definitely unmaximized
afterward, because other entities (e.g. the user or window manager)
could maximize it again, and not all window managers honor requests to
unmaximize. But normally the window will end up unmaximized.

   You can track maximization via the "window_state_event" signal  on
Gtk_Widget.
function Get_Transient_For
       (Window             : access Gtk_Window_Record)
        return Gtk_Window;

Return the window for which this one is a temporary window.
See Set_Transient_For below for more information on transient windows.
null is returned if there is no such window.
procedure Set_Default_Size
       (Window             : access Gtk_Window_Record;
        Width              :        Gint;
        Height             :        Gint);

Sets the default size of a window. If the window's "natural" size (its
size request) is larger than the default, the default will be  ignored.
More generally, if the default size does not obey the geometry  hints
for the window (Set_Geometry_Hints can be used to set these
explicitly), the default size will be clamped to the nearest permitted
size.

   Unlike Gtk.Widget.Set_Size_Request, which sets a size request for a
widget and thus would keep users from shrinking the window, this
function only sets the initial size, just as if the user had resized the
window themselves. Users can still shrink the window again as they
normally would. Setting a default size of -1 means to use the "natural"
default size (the size request of the window).

   For more control over a window's initial size and how resizing works,
investigate Set_Geometry_Hints.

   For some uses, Resize is a more appropriate function.  Resize changes
the current size of the window, rather than the size to be used on
initial display. Resize always affects the window itself, not the
geometry widget.

   The default size of a window only affects the first time a window is
shown; if a window is hidden and re-shown, it will remember the size it
had prior to hiding, rather than using the default size.

   Windows can't actually be 0x0 in size, they must be at least 1x1, but
passing 0 for Width and Height is OK, resulting in a 1x1 default size.

   This has no effect on Popup windows (set in call to Gtk_New).
procedure Resize
       (Window             : access Gtk_Window_Record;
        Width, Height      :        Gint);

Resize the window as if the user had done so, obeying geometry
constraints. The default geometry constraint is that windows may  not
be smaller than their size request; to override this  constraint, call
Gtk.Widget.Set_Size_Request to set the window's  request to a smaller
value.

   If Resize is called before showing a window for the - first time, it
overrides any default size set with - Set_Default_Size.

   Windows may not be resized smaller than 1 by 1 pixels. However, as a
special case, if both Width and Height are set to -1, the best
requested  size is recomputed for the window, and used.
procedure Add_Mnemonic
       (Window             : access Gtk_Window_Record;
        Keyval             :        Gdk.Types.Gdk_Key_Type;
        Target             : access Gtk.Widget.Gtk_Widget_Record'Class);

Add a mnemonic to this window.
Target will receive the "activate" signal when Keyval is pressed inside
the window.
Focus
-----

function Get_Focus
       (Window             : access Gtk_Window_Record)
        return Gtk.Widget.Gtk_Widget;

Return the widget that would have the keyboard focus if
Window itself has the focus. It currently has the focus  only if
Has_Focus_Is_Set returns True.
procedure Set_Focus
       (Window             : access Gtk_Window_Record;
        Focus              :        Gtk.Widget.Gtk_Widget);

Set the focus child for Window.
If Focus is not the current focus widget, and is focusable, sets  it as
the focus widget for the window. If Focus is null, unsets  the focus
widget for this window. To set the focus to a particular  widget in the
toplevel, it is usually more convenient to use  gtk_widget_grab_focus()
instead of this function.

File: gtkada_rm.info,  Node: Gtk.Window Example,  Prev: Gtk.Window Subprograms,  Up: Package_Gtk.Window

Example
=======


      --  This example shows how you can display a banner while your application is
      --  loading
     
      with Gtk.Window, Gtk.Enums, Gtk.Main, Gtk.Label;
      use Gtk.Window,  Gtk.Enums, Gtk.Main, Gtk.Label;
     
      procedure Banner is
         Win   : Gtk_Window;
         Label : Gtk_Label;
      begin
         Gtk.Main.Init;
     
         Gtk_New (Win, Window_Popup);
         Set_Policy (Win,
                     Allow_Shrink => False,
                     Allow_Grow   => False,
                     Auto_Shrink  => False);
         Set_Position (Win, Win_Pos_Center);
         Set_Size_Request (Win, 300, 300);
     
         Gtk_New (Label, "You should show a pixmap instead...");
         Add (Win, Label);
     
         Show_All (Win);
         Gtk.Main.Main;
      end Banner;


File: gtkada_rm.info,  Node: Package_Pango,  Next: Package_Pango.Attributes,  Prev: Package_Gtkada.Types,  Up: Top

Package Pango
*************

This is the top level package of the Pango hierarchy.

* Menu:


File: gtkada_rm.info,  Node: Package_Pango.Attributes,  Next: Package_Pango.Font,  Prev: Package_Pango,  Up: Top

Package Pango.Attributes
************************

This package provides a set of types and subprograms to manipulate the
attributes of text displayed in a pango_layout

* Menu:

* Pango.Attributes Types::
* Pango.Attributes Subprograms::


File: gtkada_rm.info,  Node: Pango.Attributes Types,  Next: Pango.Attributes Subprograms,  Up: Package_Pango.Attributes

Types
=====

type Pango_Attr_List is new Glib.C_Proxy;


type Pango_Attribute is new Glib.C_Proxy;



File: gtkada_rm.info,  Node: Pango.Attributes Subprograms,  Prev: Pango.Attributes Types,  Up: Package_Pango.Attributes

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

Attributes
----------

function Attr_Underline_New
       (Underline          :        Pango.Enums.Underline)
        return Pango_Attribute;

Create a new underline attribute
Attributes list
---------------

procedure Gdk_New
       (Attr_List          : out    Pango_Attr_List);

Create a new empty list of attributes
procedure Ref
       (Attr_List          :        Pango_Attr_List);

Increment the reference count of the attribute list
procedure Unref
       (Attr_List          :        Pango_Attr_List);

Decrement the reference count of the attribute list. When it reaches 0,
the list is destroyed.
procedure Insert
       (Attr_List          :        Pango_Attr_List;
        Attribute          :        Pango_Attribute);

Insert a new attribute in the list

File: gtkada_rm.info,  Node: Package_Pango.Font,  Next: Package_Pango.Layout,  Prev: Package_Pango.Attributes,  Up: Top

Package Pango.Font
******************

This package provides high-level, system-independent handling of fonts.
It  supercedes the old Gdk.Font package, which should no longer be used.

   Fonts are defined through several attributes, like their family,
weight,  size, style, ...

   The Pango_Font_Description objects created by this package can
either be  used directly to draw text through Pango.Layout.Pango_Layout
objects (and  the associated Gdk.Drawable.Draw_Layout procedure), or by
converting them  to a Gdk_Font. The first method is the preferred one,
and provides  high-level handling of multi-line texts or tabs, when you
have to handle  this yourself in the second case.

* Menu:

* Pango.Font Types::
* Pango.Font Subprograms::


File: gtkada_rm.info,  Node: Pango.Font Types,  Next: Pango.Font Subprograms,  Up: Package_Pango.Font

Types
=====

type Pango_Font_Description is new Glib.C_Proxy;


type Pango_Font_Metrics is new Glib.C_Proxy;


type Pango_Language is new Glib.C_Proxy;


type Property_Font_Description is new Desc_Properties.Property;



File: gtkada_rm.info,  Node: Pango.Font Subprograms,  Prev: Pango.Font Types,  Up: Package_Pango.Font

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

function Get_Type              return Glib.GType;


Return the internal gtk+ type associated with font descriptions.
function Copy
       (Desc               :        Pango_Font_Description)
        return Pango_Font_Description;

Return a newly allocated font description.
This Pango_Font_Description needs to be free'ed after use.
function Equal
       (Desc1              :        Pango_Font_Description;
        Desc2              :        Pango_Font_Description)
        return Boolean;

Return True if the two font descriptions are identical.
Note that two font description may result in identical fonts being
loaded, but still compare False.
procedure Free
       (Desc               : in out Pango_Font_Description);

Deallocate the given font description.
function From_String
       (Str                :        String)
        return Pango_Font_Description;

Create a new font description from the given string representation
of the given form: "[FAMILY-LIST] [STYLE-OPTIONS] [SIZE]". Any one  of
the options may be omitted.
   * FAMILY-LIST is a comma separated list (spaces are not allowed)
     of font families optionally terminated by a comma. If absent,
     the font family of the font that will be used is unspecified.

   * STYLE_OPTIONS is a whitespace separated list of words where each
       word describes either style, variant, weight, or stretch. Any
       unspecified style option is defaulted to "Normal", which
     respectively corresponds to Pango_Style_Normal,
     Pango_Weight_Normal,      Pango_Variant_Normal, and
     Pango_Stretch_Normal.

   * SIZE is a decimal number describing the size of the font in points.
         If unspecified, a size of 0 will be used.

function To_Font_Description
       (Family_Name        :        String := "";
        Style              :        Pango.Enums.Style
                            := Pango.Enums.Pango_Style_Normal;
        Variant            :        Pango.Enums.Variant
                            := Pango.Enums.Pango_Variant_Normal;
        Weight             :        Pango.Enums.Weight
                            := Pango.Enums.Pango_Weight_Normal;
        Stretch            :        Pango.Enums.Stretch
                            := Pango.Enums.Pango_Stretch_Normal;
        Size               :        Gint := 0)
        return Pango_Font_Description;

Create a new font decription from the given parameters.
function To_String
       (Desc               :        Pango_Font_Description)
        return String;

Create a string representation of a font description. The format
of the string produced follows the syntax used by From_String.   The
family-list in the string description will have a terminating  comma
only if the last word of the list is a valid style option.
function To_Filename
       (Desc               :        Pango_Font_Description)
        return String;

Create a filename representation of a font description. The filename
is identical to the result from calling To_String, but with underscores
instead of characters that are untypical in filenames, and in lower
case only.
function Get_Family
       (Desc               :        Pango_Font_Description)
        return String;

Return the Family_Name of the given Pango_Font_Description. This is
procedure Set_Family
       (Desc               :        Pango_Font_Description;
        Name               :        String);

Set the Family_Name of the given Pango_Font_Description.
function Get_Size
       (Desc               :        Pango_Font_Description)
        return Gint;

Return value: the size for the font description in pango units.
(PANGO_SCALE pango units equals one point). Returns 0 if Desc hasn't
been initialized.
procedure Set_Size
       (Desc               :        Pango_Font_Description;
        Size               :        Gint);

Set the size for the font description in pango units.  (PANGO_SCALE
pango units equals one point)
Languages
---------

The following section provides types and subprograms to identify a
specific script and language inside a font (Not all characters of a font
are used for all languages)

function Pango_Language_Get_Typereturn Glib.GType;


Return the internal value used to identify a Pango_Language
function From_String
       (Language           :        String)
        return Pango_Language;

Take a RFC-3066 format language tag as a string and convert it to a
Pango_Language pointer that can be efficiently copied (copy the pointer)
and compared with other language tags (compare the pointer). Language
is  something like "fr" (french), "ar" (arabic), "en" (english), "ru"
(russian), ...

   This function first canonicalizes the string by converting it to
lowercase, mapping '_' to '-', and stripping all characters other than
letters and '-'.

   The returned value need not be freed, it is stored internally by
gtk+ in  a hash-table.
Metrics
-------

The following subprograms can be used to retrieve the metrics associated
with the font. Note that such metrics might depend on the specific
script/language in use.

function Get_Metrics
       (Font               : access Pango_Font_Record'Class;
        Language           :        Pango_Language := null)
        return Pango_Font_Metrics;

Gets overall metric information for a font. Since the metrics may be
substantially different for different scripts, a language tag can be
provided to indicate that the metrics should be retrieved that
correspond to the script(s) used by that language.

   The returned value must be Unref'ed by the caller.

   Language determines which script to get the metrics for, or null to
indicate the metrics for the entire font.
procedure Ref
       (Metrics            :        Pango_Font_Metrics);

function Get_Ascent
       (Metrics            :        Pango_Font_Metrics)
        return Gint;

Gets the ascent from a font metrics structure. The ascent is the
distance from the baseline to the logical top of a line of text. (The
logical top may be above or below the top of the actual drawn ink. It is
necessary to lay out the text to figure where the ink will be).

   The returned value is expressed in pango units, and must be divided
by  Pango_Scale to get the value in pixels.
function Get_Descent
       (Metrics            :        Pango_Font_Metrics)
        return Gint;

Gets the descent from a font metrics structure. The descent is the
distance from the baseline to the logical bottom of a line of text. (The
logical bottom may be above or below the bottom of the actual drawn
ink. It is necessary to lay out the text to figure where the ink will
be.)

   The returned value is expressed in pango units, and must be divided
by  Pango_Scale to get the value in pixels.
function Get_Approximate_Char_Width
       (Metrics            :        Pango_Font_Metrics)
        return Gint;

Gets the approximate character width for a font metrics structure.  This
is merely a representative value useful, for example, for determining
the initial size for a window. Actual characters in text will be wider
and narrower than this.

   The returned value is expressed in pango units, and must be divided
by  Pango_Scale to get the value in pixels.
function Get_Approximate_Digit_Width
       (Metrics            :        Pango_Font_Metrics)
        return Gint;

Gets the approximate digit width for a font metrics structure.  This is
merely a representative value useful, for example, for determining the
initial size for a window. Actual digits in text can be wider and
narrower than this, though this value is generally somewhat more
accurate than the result of Get_Approximate_Char_Width.

   The returned value is expressed in pango units, and must be divided
by  Pango_Scale to get the value in pixels.
function Font_Metrics_Get_Type return Glib.GType;


Return the internal value associated with a Pango_Font_Metrics
Properties
----------

See the package Glib.Properties for more information on how to
use properties

function Internal_Copy
       (F                  :        Pango_Font_Description)
        return System.Address;


File: gtkada_rm.info,  Node: Package_Pango.Layout,  Next: Package_Pango_Layout,  Prev: Package_Pango.Font,  Up: Top

Package Pango.Layout
********************

This package provides a high-level object that is capable of arranging
text  in a visually correct manner. It supports international character
sets,  although all strings should be Utf8, supports left-to-right and
right-to-left writing systems, is capable of handling multi-line texts,
and  properly aligns tab characters in the text.

   This is the base type that is used in the standard gtk+ widget for
all the  widgets that display some text on the screen.

   Since it works directly with Pango.Font.Pango_Font_Description
fonts, it is  also much better at handling resizing of text,
wrapping,... than direct  calls to Gdk.Drawable.Draw_Text.

   The idea is that this widget is used to compute the layout of the
characters (ie their screen position). It doesn't do any rendering,
however, and should be used in conjonction with
Gdk.Drawable.Draw_Layout to  actually display something on the screen.

   This widget is independent from any specific drawing systems, and
might for  instance be used to create postscript documents, for direct
access to the  win32 API,...

   This widget represents one of the fundamental additions to gtk+ 2.0
over  what previously existed in the gtk+ 1.x series. It obsoletes the
package  Gdk.Font, which should only be used for legacy applications.

* Menu:

* Pango.Layout Types::
* Pango.Layout Subprograms::


File: gtkada_rm.info,  Node: Pango.Layout Types,  Next: Pango.Layout Subprograms,  Up: Package_Pango.Layout

Types
=====

type Pango_Alignment is
         (Pango_Align_Left,
          Pango_Align_Center,
          Pango_Align_Right);

type Pango_Layout_Line is new Glib.C_Proxy;


type Pango_Wrap_Mode is
         (Pango_Wrap_Word,
          Pango_Wrap_Char);


File: gtkada_rm.info,  Node: Pango.Layout Subprograms,  Prev: Pango.Layout Types,  Up: Package_Pango.Layout

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

Creating a layout
-----------------

A layout can be created in two ways: either from a widget
(Gtk.Widget.Create_Pango_Layout), from which it will inherit the font
and various other attributes, or directly from a Pango_Context.

procedure Gdk_New
       (Layout             : out    Pango_Layout;
        Context            : access Pango.Context.Pango_Context_Record'Class);

Create a new layout, based on context.
Contexts
--------

function Get_Context
       (Layout             : access Pango_Layout_Record)
        return Pango.Context.Pango_Context;

Return the context of the layout. The returned value is the internal
context itself, so you must Glib.Object.Ref it if you need to keep a
reference. You shouldn't Unref it.
procedure Set_Font_Description
       (Layout             : access Pango_Layout_Record;
        Font               :        Pango.Font.Pango_Font_Description);

Change the font used in the layout.
If not font description is set for the layout, the font description from
the layout's context is used.
procedure Context_Changed
       (Layout             : access Pango_Layout_Record);

Forces recomputation of any state in Layout that might depend
on the layout's context. This function should be called if you make
changes to the context subsequent to creating the layout.
Lines
-----

function Get_Line
       (Layout             : access Pango_Layout_Record;
        Line               :        Natural)
        return Pango_Layout_Line;

Retrieve a particular line from Layout.
Line must be between 0 and Get_Line_Count (Layout) - 1. null is returned
if the index is out of range.   The layout line can be Ref'ed and
retained, but will become invalid if  changes are made to Layout.
procedure Line_Ref
       (Line               :        Pango_Layout_Line);

Increase the reference count of Line by 1.
procedure Line_Unref
       (Line               :        Pango_Layout_Line);

Decrease the reference count of Line by 1. If the result is 0, the line
and all associated memory will be destroyed.
function Line_Index_To_X
       (Line               :        Pango_Layout_Line;
        Index              :        Integer;
        Trailing           :        Integer)
        return Glib.Gint;

Convert an index within a line to an X position.
Index is the byte offset of a graphem within the layout.   Trailing is
an integer indicating the edge of the grapheme to retrieve  the
position of. If 0, the trailing edge of the grapheme, otherwise, the
leading of the grapheme.   The returned value is in pango units.
Getting the size
----------------

Pango internally stores its sizes in pango units, which are a number of
pixels (device units, when not drawing on the screen) multiplied by
Pango_Scale. There are generally equivalent subprograms to get the sizes
directly in pixels.

procedure Get_Extents
       (Layout             : access Pango_Layout_Record;
        Ink_Rect           : out    Gdk.Rectangle.Gdk_Rectangle;
        Logical_Rect       : out    Gdk.Rectangle.Gdk_Rectangle);

Compute the logical and ink extents of Layout. Logical extents
are usually what you want for positioning things. The extents  are
given in pango units; layout coordinates begin at the  top left corner
of the layout.   Logical_Rect is the overall size of the layout, ie it
includes Ink_Rect  (where the text is actually drawn) and a small
border around it.
procedure Get_Size
       (Layout             : access Pango_Layout_Record;
        Width              : out    Glib.Gint;
        Height             : out    Glib.Gint);

Return the logical size, in pango units, of the layout. This is a
convenience function around Get_Extents.
procedure Get_Pixel_Extents
       (Layout             : access Pango_Layout_Record;
        Ink_Rect           : out    Gdk.Rectangle.Gdk_Rectangle;
        Logical_Rect       : out    Gdk.Rectangle.Gdk_Rectangle);

Same as Get_Extents, but the returned values are in pixels (or device
units when not drawing on the screen).
procedure Get_Pixel_Size
       (Layout             : access Pango_Layout_Record;
        Width              : out    Glib.Gint;
        Height             : out    Glib.Gint);

Same as Get_Size, but the returned values are in pixels.
procedure XY_To_Index
       (Layout             : access Pango_Layout_Record;
        X_Pango, Y_Pango   :        Glib.Gint;
        Byte_Index         : out    Integer;
        Trailing           : out    Integer;
        Exact              : out    Boolean);

Convert from X and Y positions within a layout to the byte index of the
character at that logical position.   X and Y are given in pango units,
not pixels.   If the position is not inside the layout, the closest
position is  chosen, and Exact is set to False.   Trailing is the
position in the grapheme where the user clicked. It will  either be 0
(left side) or the number of characters in the grapheme. In  some
character sets, a given character can be represented by multiple  signs
on the screen, which is what Trailing relates to.
Manipulating the text
---------------------

When initially created with Gtk.Widget.Create_Pango_Layout, the layout
contains some text. Of course, this text may also be changed later in
the life of the layout.

procedure Set_Text
       (Layout             : access Pango_Layout_Record;
        Text               :        String);

Change the text that the layout displays
Text must be a valid UTF8 string. See Glib.Convert for useful conversion
functions.
function Get_Text
       (Layout             : access Pango_Layout_Record)
        return String;

Return the text currently displayed in the layout.
It is more efficient to use the iterators on the layout than get text if
you do not need Ada-specific subprograms to act on the text.
function Get_Text
       (Layout             : access Pango_Layout_Record)
        return Gtkada.Types.Chars_Ptr;

Same a Get_Text, but return directly the C string, which is more
efficient. The returned value should not be freed or modified.
function Get_Line_Count
       (Layout             : access Pango_Layout_Record)
        return Glib.Gint;

Return the number of lines in Layout
procedure Set_Markup
       (Layout             : access Pango_Layout_Record;
        Markup             :        Glib.UTF8_String);

Change the text that layout displays.
Markup must be a valid UTF8 String, and might contain markups as
defined in the pango markup language.
Layouting the text
------------------

procedure Set_Justify
       (Layout             : access Pango_Layout_Record;
        Justify            :        Boolean);

Set whether or not each complete line should be stretched to fill the
entire width of the layout. This stretching is typically done by adding
whitespace, but for some scripts (such as Arabic), the justification is
done by extending the characters.
function Get_Justify
       (Layout             : access Pango_Layout_Record)
        return Boolean;

Return True if each complete line should be stretched to fill the entire
width of the layout.
procedure Set_Alignment
       (Layout             : access Pango_Layout_Record'Class;
        Alignment          :        Pango_Alignment);

Set the alignment for the layout (how partial lines are positioned
within the horizontal space available).
function Get_Alignment
       (Layout             : access Pango_Layout_Record)
        return Pango_Alignment;

Return the alignment for the layout.
procedure Set_Width
       (Layout             : access Pango_Layout_Record;
        Width              :        Glib.Gint);

Set the width to which the lines of Layout should be wrapped. No
wrapping will be performed if Width is -1.   Width is given in pango
units.
function Get_Width
       (Layout             : access Pango_Layout_Record)
        return Glib.Gint;

Return the wrapping width of Layout
procedure Set_Wrap
       (Layout             : access Pango_Layout_Record;
        Mode               :        Pango_Wrap_Mode);

Sets the wrap style; the wrap style only has an effect if a width is set
on the layout with pango_layout_set_width(). To turn off wrapping, set
the width to -1.
function Get_Wrap
       (Layout             : access Pango_Layout_Record)
        return Pango_Wrap_Mode;

Return the current wrap style
Attributes
----------

procedure Set_Attributes
       (Layout             : access Pango_Layout_Record;
        Attributes         :        Pango.Attributes.Pango_Attr_List);

Set the text attributes for a layout object.
Passing null removes the current list of attributes
function Get_Attributes
       (Layout             : access Pango_Layout_Record)
        return Pango.Attributes.Pango_Attr_List;

Get the text attributes from a layout object

File: gtkada_rm.info,  Node: Package_Pango_Layout,  Next: Index,  Prev: Package_Pango.Layout,  Up: Top

Package Pango_Layout
********************

