Blame pango/pango-layout-private.h

Packit 0ec9dd
/* Pango
Packit 0ec9dd
 * pango-layout-private.h: Internal structures of PangoLayout
Packit 0ec9dd
 *
Packit 0ec9dd
 * Copyright (C) 2004 Red Hat Software
Packit 0ec9dd
 *
Packit 0ec9dd
 * This library is free software; you can redistribute it and/or
Packit 0ec9dd
 * modify it under the terms of the GNU Library General Public
Packit 0ec9dd
 * License as published by the Free Software Foundation; either
Packit 0ec9dd
 * version 2 of the License, or (at your option) any later version.
Packit 0ec9dd
 *
Packit 0ec9dd
 * This library is distributed in the hope that it will be useful,
Packit 0ec9dd
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
Packit 0ec9dd
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the GNU
Packit 0ec9dd
 * Library General Public License for more details.
Packit 0ec9dd
 *
Packit 0ec9dd
 * You should have received a copy of the GNU Library General Public
Packit 0ec9dd
 * License along with this library; if not, write to the
Packit 0ec9dd
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Packit 0ec9dd
 * Boston, MA 02111-1307, USA.
Packit 0ec9dd
 */
Packit 0ec9dd
Packit 0ec9dd
#ifndef __PANGO_LAYOUT_PRIVATE_H__
Packit 0ec9dd
#define __PANGO_LAYOUT_PRIVATE_H__
Packit 0ec9dd
Packit 0ec9dd
#include <pango/pango-layout.h>
Packit 0ec9dd
Packit 0ec9dd
G_BEGIN_DECLS
Packit 0ec9dd
Packit 0ec9dd
struct _PangoLayout
Packit 0ec9dd
{
Packit 0ec9dd
  GObject parent_instance;
Packit 0ec9dd
Packit 0ec9dd
  /* If you add fields to PangoLayout be sure to update _copy()
Packit 0ec9dd
   * unless you add a value between copy_begin and copy_end.
Packit 0ec9dd
   */
Packit 0ec9dd
Packit 0ec9dd
  /* Referenced items */
Packit 0ec9dd
  PangoContext *context;
Packit 0ec9dd
  PangoAttrList *attrs;
Packit 0ec9dd
  PangoFontDescription *font_desc;
Packit 0ec9dd
  PangoTabArray *tabs;
Packit 0ec9dd
Packit 0ec9dd
  /* Dupped */
Packit 0ec9dd
  gchar *text;
Packit 0ec9dd
Packit 0ec9dd
  /* Value fields.  These will be memcpy'd in _copy() */
Packit 0ec9dd
  int copy_begin;
Packit 0ec9dd
Packit 0ec9dd
  guint serial;
Packit 0ec9dd
  guint context_serial;
Packit 0ec9dd
Packit 0ec9dd
  int length;			/* length of text in bytes */
Packit 0ec9dd
  int n_chars;		        /* number of characters in layout */
Packit 0ec9dd
  int width;			/* wrap/ellipsize width, in device units, or -1 if not set */
Packit 0ec9dd
  int height;			/* ellipsize width, in device units if positive, number of lines if negative */
Packit 0ec9dd
  int indent;			/* amount by which first line should be shorter */
Packit 0ec9dd
  int spacing;			/* spacing between lines */
Packit 0ec9dd
Packit 0ec9dd
  guint justify : 1;
Packit 0ec9dd
  guint alignment : 2;
Packit 0ec9dd
  guint single_paragraph : 1;
Packit 0ec9dd
  guint auto_dir : 1;
Packit 0ec9dd
  guint wrap : 2;		/* PangoWrapMode */
Packit 0ec9dd
  guint is_wrapped : 1;		/* Whether the layout has any wrapped lines */
Packit 0ec9dd
  guint ellipsize : 2;		/* PangoEllipsizeMode */
Packit 0ec9dd
  guint is_ellipsized : 1;	/* Whether the layout has any ellipsized lines */
Packit 0ec9dd
  int unknown_glyphs_count;	/* number of unknown glyphs */
Packit 0ec9dd
Packit 0ec9dd
  /* some caching */
Packit 0ec9dd
  guint logical_rect_cached : 1;
Packit 0ec9dd
  guint ink_rect_cached : 1;
Packit 0ec9dd
  PangoRectangle logical_rect;
Packit 0ec9dd
  PangoRectangle ink_rect;
Packit 0ec9dd
  int tab_width;		/* Cached width of a tab. -1 == not yet calculated */
Packit 0ec9dd
Packit 0ec9dd
  int copy_end;
Packit 0ec9dd
Packit 0ec9dd
  /* Not copied during _copy() */
Packit 0ec9dd
Packit 0ec9dd
  PangoLogAttr *log_attrs;	/* Logical attributes for layout's text */
Packit 0ec9dd
  GSList *lines;
Packit 0ec9dd
  guint line_count;		/* Number of lines in @lines. 0 if lines is %NULL */
Packit 0ec9dd
};
Packit 0ec9dd
Packit 0ec9dd
typedef struct _Extents Extents;
Packit 0ec9dd
struct _Extents
Packit 0ec9dd
{
Packit 0ec9dd
  /* Vertical position of the line's baseline in layout coords */
Packit 0ec9dd
  int baseline;
Packit 0ec9dd
Packit 0ec9dd
  /* Line extents in layout coords */
Packit 0ec9dd
  PangoRectangle ink_rect;
Packit 0ec9dd
  PangoRectangle logical_rect;
Packit 0ec9dd
};
Packit 0ec9dd
Packit 0ec9dd
struct _PangoLayoutIter
Packit 0ec9dd
{
Packit 0ec9dd
  PangoLayout *layout;
Packit 0ec9dd
  GSList *line_list_link;
Packit 0ec9dd
  PangoLayoutLine *line;
Packit 0ec9dd
Packit 0ec9dd
  /* If run is NULL, it means we're on a "virtual run"
Packit 0ec9dd
   * at the end of the line with 0 width
Packit 0ec9dd
   */
Packit 0ec9dd
  GSList *run_list_link;
Packit 0ec9dd
  PangoLayoutRun *run; /* FIXME nuke this, just keep the link */
Packit 0ec9dd
  int index;
Packit 0ec9dd
Packit 0ec9dd
  /* list of Extents for each line in layout coordinates */
Packit 0ec9dd
  Extents *line_extents;
Packit 0ec9dd
  int line_index;
Packit 0ec9dd
Packit 0ec9dd
  /* X position of the current run */
Packit 0ec9dd
  int run_x;
Packit 0ec9dd
Packit 0ec9dd
  /* Width of the current run */
Packit 0ec9dd
  int run_width;
Packit 0ec9dd
Packit 0ec9dd
  /* this run is left-to-right */
Packit 0ec9dd
  gboolean ltr;
Packit 0ec9dd
Packit 0ec9dd
  /* X position of the left side of the current cluster */
Packit 0ec9dd
  int cluster_x;
Packit 0ec9dd
Packit 0ec9dd
  /* The width of the current cluster */
Packit 0ec9dd
  int cluster_width;
Packit 0ec9dd
Packit 0ec9dd
  /* glyph offset to the current cluster start */
Packit 0ec9dd
  int cluster_start;
Packit 0ec9dd
Packit 0ec9dd
  /* first glyph in the next cluster */
Packit 0ec9dd
  int next_cluster_glyph;
Packit 0ec9dd
Packit 0ec9dd
  /* number of Unicode chars in current cluster */
Packit 0ec9dd
  int cluster_num_chars;
Packit 0ec9dd
Packit 0ec9dd
  /* visual position of current character within the cluster */
Packit 0ec9dd
  int character_position;
Packit 0ec9dd
Packit 0ec9dd
  /* the real width of layout */
Packit 0ec9dd
  int layout_width;
Packit 0ec9dd
};
Packit 0ec9dd
Packit 0ec9dd
gboolean _pango_layout_line_ellipsize (PangoLayoutLine *line,
Packit 0ec9dd
				       PangoAttrList   *attrs,
Packit 0ec9dd
				       int              goal_width);
Packit 0ec9dd
Packit 0ec9dd
void     _pango_layout_get_iter (PangoLayout     *layout,
Packit 0ec9dd
                                 PangoLayoutIter *iter);
Packit 0ec9dd
Packit 0ec9dd
void     _pango_layout_iter_destroy (PangoLayoutIter *iter);
Packit 0ec9dd
Packit 0ec9dd
G_END_DECLS
Packit 0ec9dd
Packit 0ec9dd
#endif /* __PANGO_LAYOUT_PRIVATE_H__ */