<HTML
><HEAD
><TITLE
>gnome-icon-text</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.44"><LINK
REL="HOME"
TITLE="Gnome User Interface Library Reference Manual"
HREF="book1.html"><LINK
REL="UP"
TITLE="Gnome User Interface Library"
HREF="libgnomeui.html"><LINK
REL="PREVIOUS"
TITLE="gnome-ice"
HREF="gnomeui-gnome-ice.html"><LINK
REL="NEXT"
TITLE="gnome-init"
HREF="gnomeui-gnome-init.html"></HEAD
><BODY
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
WIDTH="100%"
BORDER="0"
BGCOLOR="#000000"
CELLPADDING="1"
CELLSPACING="0"
><TR
><TH
COLSPAN="4"
ALIGN="center"
><FONT
COLOR="#FFFFFF"
SIZE="5"
>Gnome User Interface Library Reference Manual</FONT
></TH
></TR
><TR
><TD
WIDTH="25%"
BGCOLOR="#C00000"
ALIGN="left"
><A
HREF="gnomeui-gnome-ice.html"
><FONT
COLOR="#FFFFFF"
SIZE="3"
><B
>&#60;&#60;&#60; Previous Page</B
></FONT
></A
></TD
><TD
WIDTH="25%"
BGCOLOR="#0000C0"
ALIGN="center"
><FONT
COLOR="#FFFFFF"
SIZE="3"
><B
><A
HREF="book1.html"
><FONT
COLOR="#FFFFFF"
SIZE="3"
><B
>Home</B
></FONT
></A
></B
></FONT
></TD
><TD
WIDTH="25%"
BGCOLOR="#00C000"
ALIGN="center"
><FONT
COLOR="#FFFFFF"
SIZE="3"
><B
><A
HREF="libgnomeui.html"
><FONT
COLOR="#FFFFFF"
SIZE="3"
><B
>Up</B
></FONT
></A
></B
></FONT
></TD
><TD
WIDTH="25%"
BGCOLOR="#C00000"
ALIGN="right"
><A
HREF="gnomeui-gnome-init.html"
><FONT
COLOR="#FFFFFF"
SIZE="3"
><B
>Next Page &#62;&#62;&#62;</B
></FONT
></A
></TD
></TR
></TABLE
></DIV
><H1
><A
NAME="GNOMEUI-GNOME-ICON-TEXT"
>gnome-icon-text</A
></H1
><DIV
CLASS="REFNAMEDIV"
><A
NAME="AEN4237"
></A
><H2
>Name</H2
>gnome-icon-text&nbsp;--&nbsp;Text wrapping functions for icon captions.</DIV
><DIV
CLASS="REFSYNOPSISDIV"
><A
NAME="AEN4240"
></A
><H2
>Synopsis</H2
><TABLE
BORDER="0"
BGCOLOR="#D6E8FF"
WIDTH="100%"
CELLPADDING="6"
><TR
><TD
><PRE
CLASS="SYNOPSIS"
>&#13;#include &lt;gnome.h&gt;


struct      <A
HREF="gnomeui-gnome-icon-text.html#GNOMEICONTEXTINFOROW"
>GnomeIconTextInfoRow</A
>;
struct      <A
HREF="gnomeui-gnome-icon-text.html#GNOMEICONTEXTINFO"
>GnomeIconTextInfo</A
>;
<A
HREF="gnomeui-gnome-icon-text.html#GNOMEICONTEXTINFO"
>GnomeIconTextInfo</A
>* <A
HREF="gnomeui-gnome-icon-text.html#GNOME-ICON-LAYOUT-TEXT"
>gnome_icon_layout_text</A
>   (GdkFont *font,
                                             char *text,
                                             char *separators,
                                             int max_width,
                                             int confine);
void        <A
HREF="gnomeui-gnome-icon-text.html#GNOME-ICON-PAINT-TEXT"
>gnome_icon_paint_text</A
>           (<A
HREF="gnomeui-gnome-icon-text.html#GNOMEICONTEXTINFO"
>GnomeIconTextInfo</A
> *ti,
                                             GdkDrawable *drawable,
                                             GdkGC *gc,
                                             int x,
                                             int y,
                                             GtkJustification just);
void        <A
HREF="gnomeui-gnome-icon-text.html#GNOME-ICON-TEXT-INFO-FREE"
>gnome_icon_text_info_free</A
>       (<A
HREF="gnomeui-gnome-icon-text.html#GNOMEICONTEXTINFO"
>GnomeIconTextInfo</A
> *ti);</PRE
></TD
></TR
></TABLE
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN4255"
></A
><H2
>Description</H2
><P
>    This module implements a generic and simple interface for wrapping
    text and painting it to a drawable.  It is used by the
    <SPAN
CLASS="STRUCTNAME"
>GnomeIconTextItem</SPAN
> object to perform word
    wrapping for icon text captions.
  </P
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN4259"
></A
><H2
>Details</H2
><DIV
CLASS="REFSECT2"
><A
NAME="AEN4261"
></A
><H3
><A
NAME="GNOMEICONTEXTINFOROW"
></A
>struct GnomeIconTextInfoRow</H3
><TABLE
BORDER="0"
BGCOLOR="#D6E8FF"
WIDTH="100%"
CELLPADDING="6"
><TR
><TD
><PRE
CLASS="PROGRAMLISTING"
>typedef struct {
	char *text;
	int width;
	GdkWChar *text_wc;	/* text in wide characters */
	int text_length;	/* number of characters */
} GnomeIconTextInfoRow;</PRE
></TD
></TR
></TABLE
><P
>    This structure defines a row of text in the list of wrapped text
    rows of the <SPAN
CLASS="STRUCTNAME"
>GnomeIconTextInfo</SPAN
> structure.
    The <TT
CLASS="STRUCTFIELD"
><I
>text</I
></TT
> field contains the text that
    fits in that row, and <TT
CLASS="STRUCTFIELD"
><I
>width</I
></TT
> contains
    the width in pixels of that text, calculated with respect to the
    font that was used to format the text.
  </P
></DIV
><HR><DIV
CLASS="REFSECT2"
><A
NAME="AEN4269"
></A
><H3
><A
NAME="GNOMEICONTEXTINFO"
></A
>struct GnomeIconTextInfo</H3
><TABLE
BORDER="0"
BGCOLOR="#D6E8FF"
WIDTH="100%"
CELLPADDING="6"
><TR
><TD
><PRE
CLASS="PROGRAMLISTING"
>typedef struct {
	GList *rows;
	GdkFont *font;
	int width;
	int height;
	int baseline_skip;
} GnomeIconTextInfo;</PRE
></TD
></TR
></TABLE
><P
>    This structure contains the information about a wrapped text
    string.  The <TT
CLASS="STRUCTFIELD"
><I
>rows</I
></TT
> field is a list of
    <SPAN
CLASS="STRUCTNAME"
>GnomeIconTextInfoRow</SPAN
> structures with the
    final rows of text.  The <TT
CLASS="STRUCTFIELD"
><I
>width</I
></TT
>,
    <TT
CLASS="STRUCTFIELD"
><I
>height</I
></TT
>, and
    <TT
CLASS="STRUCTFIELD"
><I
>baseline_skip</I
></TT
> fields contain the total
    width, total height, and baseline height of the text in pixels,
    respectively.
  </P
></DIV
><HR><DIV
CLASS="REFSECT2"
><A
NAME="AEN4279"
></A
><H3
><A
NAME="GNOME-ICON-LAYOUT-TEXT"
></A
>gnome_icon_layout_text ()</H3
><TABLE
BORDER="0"
BGCOLOR="#D6E8FF"
WIDTH="100%"
CELLPADDING="6"
><TR
><TD
><PRE
CLASS="PROGRAMLISTING"
><A
HREF="gnomeui-gnome-icon-text.html#GNOMEICONTEXTINFO"
>GnomeIconTextInfo</A
>* gnome_icon_layout_text   (GdkFont *font,
                                             char *text,
                                             char *separators,
                                             int max_width,
                                             int confine);</PRE
></TD
></TR
></TABLE
><P
>Creates a new &amp;GnomeIconTextInfo structure by wrapping the specified
text.  If non-NULL, the <TT
CLASS="PARAMETER"
><I
>separators</I
></TT
> argument defines a set of characters
to be used as word delimiters for performing word wrapping.  If it is
NULL, then only spaces will be used as word delimiters.</P
><P
>The <TT
CLASS="PARAMETER"
><I
>max_width</I
></TT
> argument is used to specify the width at which word
wrapping will be performed.  If there is a very long word that does not
fit in a single line, the <TT
CLASS="PARAMETER"
><I
>confine</I
></TT
> argument can be used to specify
whether the word should be unconditionally split to fit or whether
the maximum width should be increased as necessary.</P
><P
></P
><DIV
CLASS="INFORMALTABLE"
><P
></P
><TABLE
BORDER="0"
WIDTH="100%"
BGCOLOR="#FFD0D0"
CELLSPACING="0"
CELLPADDING="4"
CLASS="CALSTABLE"
><TR
><TD
WIDTH="20%"
ALIGN="RIGHT"
VALIGN="TOP"
><TT
CLASS="PARAMETER"
><I
>font</I
></TT
>&nbsp;:</TD
><TD
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
>       Name of the font that will be used to render the text.</TD
></TR
><TR
><TD
WIDTH="20%"
ALIGN="RIGHT"
VALIGN="TOP"
><TT
CLASS="PARAMETER"
><I
>text</I
></TT
>&nbsp;:</TD
><TD
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
>       Text to be formatted.</TD
></TR
><TR
><TD
WIDTH="20%"
ALIGN="RIGHT"
VALIGN="TOP"
><TT
CLASS="PARAMETER"
><I
>separators</I
></TT
>&nbsp;:</TD
><TD
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
> Separators used for word wrapping, can be NULL.</TD
></TR
><TR
><TD
WIDTH="20%"
ALIGN="RIGHT"
VALIGN="TOP"
><TT
CLASS="PARAMETER"
><I
>max_width</I
></TT
>&nbsp;:</TD
><TD
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
>  Width in pixels to be used for word wrapping.</TD
></TR
><TR
><TD
WIDTH="20%"
ALIGN="RIGHT"
VALIGN="TOP"
><TT
CLASS="PARAMETER"
><I
>confine</I
></TT
>&nbsp;:</TD
><TD
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
>    Whether it is mandatory to wrap at <TT
CLASS="PARAMETER"
><I
>max_width</I
></TT
>.</TD
></TR
><TR
><TD
WIDTH="20%"
ALIGN="RIGHT"
VALIGN="TOP"
><I
CLASS="EMPHASIS"
>Returns</I
> :</TD
><TD
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
> A newly-created &amp;GnomeIconTextInfo structure.</TD
></TR
></TABLE
><P
></P
></DIV
></DIV
><HR><DIV
CLASS="REFSECT2"
><A
NAME="AEN4321"
></A
><H3
><A
NAME="GNOME-ICON-PAINT-TEXT"
></A
>gnome_icon_paint_text ()</H3
><TABLE
BORDER="0"
BGCOLOR="#D6E8FF"
WIDTH="100%"
CELLPADDING="6"
><TR
><TD
><PRE
CLASS="PROGRAMLISTING"
>void        gnome_icon_paint_text           (<A
HREF="gnomeui-gnome-icon-text.html#GNOMEICONTEXTINFO"
>GnomeIconTextInfo</A
> *ti,
                                             GdkDrawable *drawable,
                                             GdkGC *gc,
                                             int x,
                                             int y,
                                             GtkJustification just);</PRE
></TD
></TR
></TABLE
><P
>Paints the formatted text in the icon text info structure onto a drawable.
This is just a sample implementation; applications can choose to use other
rendering functions.</P
><P
></P
><DIV
CLASS="INFORMALTABLE"
><P
></P
><TABLE
BORDER="0"
WIDTH="100%"
BGCOLOR="#FFD0D0"
CELLSPACING="0"
CELLPADDING="4"
CLASS="CALSTABLE"
><TR
><TD
WIDTH="20%"
ALIGN="RIGHT"
VALIGN="TOP"
><TT
CLASS="PARAMETER"
><I
>ti</I
></TT
>&nbsp;:</TD
><TD
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
>       An icon text info structure.</TD
></TR
><TR
><TD
WIDTH="20%"
ALIGN="RIGHT"
VALIGN="TOP"
><TT
CLASS="PARAMETER"
><I
>drawable</I
></TT
>&nbsp;:</TD
><TD
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
> Target drawable.</TD
></TR
><TR
><TD
WIDTH="20%"
ALIGN="RIGHT"
VALIGN="TOP"
><TT
CLASS="PARAMETER"
><I
>gc</I
></TT
>&nbsp;:</TD
><TD
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
>       GC used to render the string.</TD
></TR
><TR
><TD
WIDTH="20%"
ALIGN="RIGHT"
VALIGN="TOP"
><TT
CLASS="PARAMETER"
><I
>x</I
></TT
>&nbsp;:</TD
><TD
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
>        Left coordinate for text.</TD
></TR
><TR
><TD
WIDTH="20%"
ALIGN="RIGHT"
VALIGN="TOP"
><TT
CLASS="PARAMETER"
><I
>y</I
></TT
>&nbsp;:</TD
><TD
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
>        Upper coordinate for text.</TD
></TR
><TR
><TD
WIDTH="20%"
ALIGN="RIGHT"
VALIGN="TOP"
><TT
CLASS="PARAMETER"
><I
>just</I
></TT
>&nbsp;:</TD
><TD
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
>     Justification for text.</TD
></TR
></TABLE
><P
></P
></DIV
></DIV
><HR><DIV
CLASS="REFSECT2"
><A
NAME="AEN4360"
></A
><H3
><A
NAME="GNOME-ICON-TEXT-INFO-FREE"
></A
>gnome_icon_text_info_free ()</H3
><TABLE
BORDER="0"
BGCOLOR="#D6E8FF"
WIDTH="100%"
CELLPADDING="6"
><TR
><TD
><PRE
CLASS="PROGRAMLISTING"
>void        gnome_icon_text_info_free       (<A
HREF="gnomeui-gnome-icon-text.html#GNOMEICONTEXTINFO"
>GnomeIconTextInfo</A
> *ti);</PRE
></TD
></TR
></TABLE
><P
>Frees a &amp;GnomeIconTextInfo structure.  You should call this instead of
freeing the structure yourself.</P
><P
></P
><DIV
CLASS="INFORMALTABLE"
><P
></P
><TABLE
BORDER="0"
WIDTH="100%"
BGCOLOR="#FFD0D0"
CELLSPACING="0"
CELLPADDING="4"
CLASS="CALSTABLE"
><TR
><TD
WIDTH="20%"
ALIGN="RIGHT"
VALIGN="TOP"
><TT
CLASS="PARAMETER"
><I
>ti</I
></TT
>&nbsp;:</TD
><TD
WIDTH="80%"
ALIGN="LEFT"
VALIGN="TOP"
> An icon text info structure.</TD
></TR
></TABLE
><P
></P
></DIV
></DIV
></DIV
><DIV
CLASS="REFSECT1"
><A
NAME="AEN4376"
></A
><H2
>See Also</H2
><P
>    <A
HREF="gnomeicontextitem.html"
>GnomeIconTextItem</A
>
  </P
></DIV
><DIV
CLASS="NAVFOOTER"
><BR
CLEAR="all"><BR><TABLE
WIDTH="100%"
BORDER="0"
BGCOLOR="#000000"
CELLPADDING="1"
CELLSPACING="0"
><TR
><TD
WIDTH="25%"
BGCOLOR="#C00000"
ALIGN="left"
><A
HREF="gnomeui-gnome-ice.html"
><FONT
COLOR="#FFFFFF"
SIZE="3"
><B
>&#60;&#60;&#60; Previous Page</B
></FONT
></A
></TD
><TD
WIDTH="25%"
BGCOLOR="#0000C0"
ALIGN="center"
><FONT
COLOR="#FFFFFF"
SIZE="3"
><B
><A
HREF="book1.html"
><FONT
COLOR="#FFFFFF"
SIZE="3"
><B
>Home</B
></FONT
></A
></B
></FONT
></TD
><TD
WIDTH="25%"
BGCOLOR="#00C000"
ALIGN="center"
><FONT
COLOR="#FFFFFF"
SIZE="3"
><B
><A
HREF="libgnomeui.html"
><FONT
COLOR="#FFFFFF"
SIZE="3"
><B
>Up</B
></FONT
></A
></B
></FONT
></TD
><TD
WIDTH="25%"
BGCOLOR="#C00000"
ALIGN="right"
><A
HREF="gnomeui-gnome-init.html"
><FONT
COLOR="#FFFFFF"
SIZE="3"
><B
>Next Page &#62;&#62;&#62;</B
></FONT
></A
></TD
></TR
><TR
><TD
COLSPAN="2"
ALIGN="left"
><FONT
COLOR="#FFFFFF"
SIZE="3"
><B
>gnome-ice</B
></FONT
></TD
><TD
COLSPAN="2"
ALIGN="right"
><FONT
COLOR="#FFFFFF"
SIZE="3"
><B
>gnome-init</B
></FONT
></TD
></TR
></TABLE
></DIV
></BODY
></HTML
>