summaryrefslogtreecommitdiff
path: root/pango/pango-layout.h
blob: b9c1ea6f560ca682872661603d1279705e42f17a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
/* Pango
 * pango-layout.h: Highlevel layout driver
 *
 * Copyright (C) 2000 Red Hat Software
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Library General Public
 * License as published by the Free Software Foundation; either
 * version 2 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	 See the GNU
 * Library General Public License for more details.
 *
 * You should have received a copy of the GNU Library General Public
 * License along with this library; if not, write to the
 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
 * Boston, MA 02111-1307, USA.
 */

#ifndef __PANGO_LAYOUT_H__
#define __PANGO_LAYOUT_H__

#ifdef __cplusplus
extern "C" {
#endif /* __cplusplus */

typedef struct _PangoLayout     PangoLayout;
typedef struct _PangoLayoutLine PangoLayoutLine;
typedef struct _PangoLayoutRun  PangoLayoutRun; 

struct _PangoLayoutLine
{
  PangoLayout *layout;
  gint         n_chars;		/* length of line in characters */
  gint         length;		/* length of line in bytes*/
  GSList      *runs;
};

struct _PangoLayoutRun
{
  PangoItem        *item;
  PangoGlyphString *glyphs;
};

PangoLayout *    pango_layout_new                  (void);
void             pango_layout_ref                  (PangoLayout   *layout);
void             pango_layout_unref                (PangoLayout   *layout);
void             pango_layout_set_width            (PangoLayout   *layout,
						    int            width);
void             pango_layout_set_justify          (PangoLayout   *layout,
						    gboolean       justify);
void             pango_layout_set_first_line_width (PangoLayout   *layout,
						    int            width);
void             pango_layout_set_attributes       (PangoLayout   *layout,
						    PangoAttrList *attrs);
void             pango_layout_set_text             (char          *text,
						    int            length);
int              pango_layout_get_line_count       (PangoLayout   *layout);
PangoLayoutLine *pango_layout_get_line             (PangoLayout   *layout,
						    int            line);
void             pango_layout_cp_to_line_x         (PangoLayout   *layout,
						    gint           char_pos,
						    gboolean       trailing,
						    gint          *line,
						    gint          *x_pos);

void pango_layout_line_ref         (PangoLayoutLine *line);
void pango_layout_line_unref       (PangoLayoutLine *line);
void pango_layout_line_x_to_cp     (PangoLayoutLine *line,
				    gint             x_pos,
				    gint            *char_pos,
				    gint            *trailing);
void pango_layout_line_get_extents (PangoLayoutLine *line,
				    PangoRectangle  *ink_rect,
				    PangoRectangle  *logical_rect);

#ifdef __cplusplus
}
#endif /* __cplusplus */

#endif __PANGO_LAYOUT_H__