summaryrefslogtreecommitdiff
path: root/pango/pango-layout.h
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@redhat.com>2000-03-07 02:02:15 +0000
committerOwen Taylor <otaylor@src.gnome.org>2000-03-07 02:02:15 +0000
commitdd0b4a5064c6f60adcfd2ea02e2d61fb60254d20 (patch)
tree39a121f4bd40300bcd67521104db86c12bd33165 /pango/pango-layout.h
parent6278d373c1a564ae4233a2e4b6d428a9f6202728 (diff)
downloadpango-dd0b4a5064c6f60adcfd2ea02e2d61fb60254d20.tar.gz
Convert log_clusters[] use from char offsets to byte offset - should make
Mon Mar 6 20:55:32 2000 Owen Taylor <otaylor@redhat.com> * libpango/mapping.c example/viewer.c: * modules/hangul/hangul.c modules/basic/basic.c modules/tamil/tamil.c: Convert log_clusters[] use from char offsets to byte offset - should make it easier to have all interface deal with stuff in byte offsets. * libpango/mapping.c libpango/pango-glyph.h: Rename x_to_cp and cp_to_x to make them "member functions" of glyph_string. * libpango/pango-types.h: Add a rectangle type for use in storing glyph/glyph-string extents, plus macros for extracting ascent/descent. * libpango/fonts.c libpango/pango-font.h libpango/pangox.c: Virtualize glyph extents function into the font. * libpango/pangox.c modules/*/*.c examples/viewer.c: Convert over to new rationalized unit system - everything in 1000ths of a point or 1000ths of a glyph unit. * libpango/pango-glyph.h libpango/glyphstring.c: Add function to get extents of a glyph string. (We may want to fastpath the width in the future, since getting the width seems to be a very common and time-critical operation)
Diffstat (limited to 'pango/pango-layout.h')
-rw-r--r--pango/pango-layout.h58
1 files changed, 49 insertions, 9 deletions
diff --git a/pango/pango-layout.h b/pango/pango-layout.h
index cdbde021..b9c1ea6f 100644
--- a/pango/pango-layout.h
+++ b/pango/pango-layout.h
@@ -26,15 +26,55 @@
extern "C" {
#endif /* __cplusplus */
-typedef struct _PangoLayout PangoLayout;
-
- /*
- pango_layout_new (char *text, int length);
- pango_layout_get_glyph_strings ();
- pango_layout_cp_to_xy ();
- pango_layout_xy_to_cp ();
- pango_layout_justify ();
- */
+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
}