[gtk/pango2: 84/91] Port to pango2, again
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk/pango2: 84/91] Port to pango2, again
- Date: Mon, 4 Jul 2022 14:13:32 +0000 (UTC)
commit 956935168146cf2d3c90936363c9fa6f05e3ff93
Author: Matthias Clasen <mclasen redhat com>
Date: Sat Jun 25 18:55:02 2022 -0400
Port to pango2, again
This adapts to the Pango -> Pango2 change.
demos/gtk-demo/combobox.c | 10 +-
demos/gtk-demo/css_basics.c | 4 +-
demos/gtk-demo/css_multiplebgs.c | 4 +-
demos/gtk-demo/css_pixbufs.c | 4 +-
demos/gtk-demo/css_shadows.c | 4 +-
demos/gtk-demo/dropdown.c | 18 +-
demos/gtk-demo/font_features.c | 33 +-
demos/gtk-demo/fontify.c | 116 ++---
demos/gtk-demo/fontrendering.c | 84 +--
demos/gtk-demo/hypertext.c | 6 +-
demos/gtk-demo/language-names.c | 18 +-
demos/gtk-demo/language-names.h | 4 +-
demos/gtk-demo/links.c | 2 +-
demos/gtk-demo/listview_colors.c | 16 +-
demos/gtk-demo/listview_ucd.c | 2 +-
demos/gtk-demo/main.c | 4 +-
demos/gtk-demo/pickers.c | 6 +-
demos/gtk-demo/printing.c | 50 +-
demos/gtk-demo/rotated_text.c | 76 +--
demos/gtk-demo/tabs.c | 14 +-
demos/gtk-demo/textmask.c | 14 +-
demos/gtk-demo/textview.c | 28 +-
demos/icon-browser/iconbrowserapp.c | 4 +-
demos/node-editor/node-editor-application.c | 4 +-
demos/node-editor/node-editor-window.c | 6 +-
demos/print-editor/print-editor.c | 56 +-
demos/widget-factory/widget-factory.c | 4 +-
gdk/broadway/gdkkeys-broadway.c | 4 +-
gdk/gdk-private.h | 4 +-
gdk/gdk.c | 16 +-
gdk/gdkdevice.c | 8 +-
gdk/gdkkeys.c | 8 +-
gdk/gdkkeysprivate.h | 4 +-
gdk/gdkpango.c | 60 +--
gdk/gdkrgba.c | 6 +-
gdk/macos/gdkmacoskeymap.c | 2 +-
gdk/wayland/gdkdevice-wayland.c | 4 +-
gdk/wayland/gdkkeys-wayland.c | 24 +-
gdk/win32/gdkkeys-win32.c | 4 +-
gdk/win32/gdkproperty-win32.c | 2 +-
gdk/x11/gdkkeys-x11.c | 34 +-
gdk/x11/gdkxftdefaults.c | 2 +-
gsk/gl/gskglglyphlibrary.c | 12 +-
gsk/gl/gskglglyphlibraryprivate.h | 8 +-
gsk/gl/gskgliconlibraryprivate.h | 2 +-
gsk/gl/gskglrenderjob.c | 12 +-
gsk/gskprivate.c | 8 +-
gsk/gskprivate.h | 4 +-
gsk/gskrendernode.h | 8 +-
gsk/gskrendernodeimpl.c | 36 +-
gsk/gskrendernodeparser.c | 146 +++---
gsk/vulkan/gskvulkanglyphcacheprivate.h | 2 +-
gtk/a11y/gtkatspipango.c | 386 +++++++-------
gtk/a11y/gtkatspipangoprivate.h | 26 +-
gtk/a11y/gtkatspitext.c | 48 +-
gtk/a11y/gtkatspitextbuffer.c | 12 +-
gtk/gskpango.c | 163 +++---
gtk/gskpango.h | 6 +-
gtk/gtkaboutdialog.c | 4 +-
gtk/gtkappchooserdialog.c | 4 +-
gtk/gtkcellrendererprogress.c | 16 +-
gtk/gtkcellrenderertext.c | 432 ++++++++--------
gtk/gtkcolorbutton.c | 8 +-
gtk/gtkcssenumvalue.c | 58 +--
gtk/gtkcssenumvalueprivate.h | 10 +-
gtk/gtkcssshadowvalueprivate.h | 2 +-
gtk/gtkcssstyle.c | 94 ++--
gtk/gtkcssstyleprivate.h | 6 +-
gtk/gtkcssstylepropertyimpl.c | 6 +-
gtk/gtkemojichooser.c | 34 +-
gtk/gtkemojicompletion.c | 16 +-
gtk/gtkentry.c | 38 +-
gtk/gtkentry.h | 8 +-
gtk/gtkfilechooserdialog.c | 4 +-
gtk/gtkfilechooserwidget.c | 4 +-
gtk/gtkfontbutton.c | 216 ++++----
gtk/gtkfontchooser.c | 58 +--
gtk/gtkfontchooser.h | 28 +-
gtk/gtkfontchooserdialog.c | 4 +-
gtk/gtkfontchooserutils.c | 8 +-
gtk/gtkfontchooserwidget.c | 430 ++++++++--------
gtk/gtkglarea.c | 12 +-
gtk/gtkheaderbar.c | 2 +-
gtk/gtkiconview.c | 8 +-
gtk/gtkimage.c | 14 +-
gtk/gtkimcontext.c | 10 +-
gtk/gtkimcontext.h | 4 +-
gtk/gtkimcontextime.c | 38 +-
gtk/gtkimcontextquartz.c | 18 +-
gtk/gtkimcontextsimple.c | 20 +-
gtk/gtkimcontextwayland.c | 24 +-
gtk/gtkimmulticontext.c | 6 +-
gtk/gtkinscription.c | 154 +++---
gtk/gtkinscription.h | 8 +-
gtk/gtkinscriptionprivate.h | 2 +-
gtk/gtklabel.c | 416 +++++++--------
gtk/gtklabel.h | 14 +-
gtk/gtkmain.c | 10 +-
gtk/gtkmain.h | 2 +-
gtk/gtkmountoperation.c | 2 +-
gtk/gtkpango.c | 235 ++++-----
gtk/gtkpango.h | 8 +-
gtk/gtkplacesview.c | 4 +-
gtk/gtkprintcontext.c | 46 +-
gtk/gtkprintcontext.h | 8 +-
gtk/gtkprintunixdialog.c | 80 +--
gtk/gtkprogressbar.c | 26 +-
gtk/gtkprogressbar.h | 4 +-
gtk/gtkrender.c | 6 +-
gtk/gtkrender.h | 4 +-
gtk/gtkscale.c | 10 +-
gtk/gtkscale.h | 2 +-
gtk/gtksettings.c | 30 +-
gtk/gtkshortcutsgroup.c | 8 +-
gtk/gtkshortcutswindow.c | 10 +-
gtk/gtksidebarrow.c | 4 +-
gtk/gtksnapshot.c | 10 +-
gtk/gtksnapshot.h | 10 +-
gtk/gtksnapshotprivate.h | 4 +-
gtk/gtkstylecontext.c | 56 +-
gtk/gtktext.c | 334 ++++++------
gtk/gtktext.h | 8 +-
gtk/gtktextattributes.c | 22 +-
gtk/gtktextattributes.h | 26 +-
gtk/gtktextbtree.c | 34 +-
gtk/gtktextbuffer.c | 138 ++---
gtk/gtktextbufferprivate.h | 2 +-
gtk/gtktextiter.c | 42 +-
gtk/gtktextiter.h | 2 +-
gtk/gtktextlayout.c | 758 ++++++++++++++--------------
gtk/gtktextlayoutprivate.h | 22 +-
gtk/gtktextprivate.h | 2 +-
gtk/gtktexttag.c | 236 ++++-----
gtk/gtktextutil.c | 116 ++---
gtk/gtktextutil.h | 4 +-
gtk/gtktextview.c | 84 +--
gtk/gtktextview.h | 8 +-
gtk/gtkwidget.c | 104 ++--
gtk/gtkwidget.h | 10 +-
gtk/gtkwidgetprivate.h | 2 +-
gtk/inspector/fpsoverlay.c | 18 +-
gtk/inspector/general.c | 20 +-
gtk/inspector/gtkdataviewer.c | 4 +-
gtk/inspector/prop-editor.c | 30 +-
gtk/inspector/recorder.c | 10 +-
gtk/language-names.c | 18 +-
gtk/language-names.h | 4 +-
gtk/meson.build | 2 +-
gtk/ui/gtkfontchooserwidget.ui | 4 +-
tests/input.c | 18 +-
tests/rendernode-create-tests.c | 56 +-
tests/testblur.c | 8 +-
tests/testcellarea.c | 4 +-
tests/testcellrenderertext.c | 34 +-
tests/testcenterbox.c | 6 +-
tests/testcombo.c | 2 +-
tests/testdropdown.c | 4 +-
tests/testellipsise.c | 8 +-
tests/testflowbox.c | 2 +-
tests/testfontchooserdialog.c | 22 +-
tests/testgrid.c | 6 +-
tests/testgtk.c | 44 +-
tests/testiconview.c | 2 +-
tests/testlistview.c | 2 +-
tests/testnouiprint.c | 14 +-
tests/testprint.c | 16 +-
tests/testprintfileoperation.c | 42 +-
tests/testtextview.c | 6 +-
tests/testtooltips.c | 2 +-
tests/testtreeview.c | 2 +-
tests/testverticalcells.c | 6 +-
tests/testwidgetfocus.c | 4 +-
testsuite/gtk/builder.c | 30 +-
testsuite/gtk/label.c | 72 +--
testsuite/gtk/textiter.c | 2 +-
testsuite/reftests/letter-spacing.c | 8 +-
176 files changed, 3497 insertions(+), 3458 deletions(-)
---
diff --git a/demos/gtk-demo/combobox.c b/demos/gtk-demo/combobox.c
index dd852ebcb5..17671538c1 100644
--- a/demos/gtk-demo/combobox.c
+++ b/demos/gtk-demo/combobox.c
@@ -260,13 +260,13 @@ mask_entry_set_background (MaskEntry *entry)
{
if (!g_regex_match_simple (entry->mask, gtk_editable_get_text (GTK_EDITABLE (entry)), 0, 0))
{
- PangoAttrList *attrs;
- PangoColor color = { 65535, 32767, 32767, 65535 };
+ Pango2AttrList *attrs;
+ Pango2Color color = { 65535, 32767, 32767, 65535 };
- attrs = pango_attr_list_new ();
- pango_attr_list_insert (attrs, pango_attr_foreground_new (&color));
+ attrs = pango2_attr_list_new ();
+ pango2_attr_list_insert (attrs, pango2_attr_foreground_new (&color));
gtk_entry_set_attributes (GTK_ENTRY (entry), attrs);
- pango_attr_list_unref (attrs);
+ pango2_attr_list_unref (attrs);
return;
}
}
diff --git a/demos/gtk-demo/css_basics.c b/demos/gtk-demo/css_basics.c
index 6c6081d774..17b94f56d3 100644
--- a/demos/gtk-demo/css_basics.c
+++ b/demos/gtk-demo/css_basics.c
@@ -84,11 +84,11 @@ do_css_basics (GtkWidget *do_widget)
text = gtk_text_buffer_new (NULL);
gtk_text_buffer_create_tag (text,
"warning",
- "underline", PANGO_LINE_STYLE_SOLID,
+ "underline", PANGO2_LINE_STYLE_SOLID,
NULL);
gtk_text_buffer_create_tag (text,
"error",
- "underline", PANGO_LINE_STYLE_DOTTED,
+ "underline", PANGO2_LINE_STYLE_DOTTED,
NULL);
provider = GTK_STYLE_PROVIDER (gtk_css_provider_new ());
diff --git a/demos/gtk-demo/css_multiplebgs.c b/demos/gtk-demo/css_multiplebgs.c
index bc024ac1dc..9299d303f8 100644
--- a/demos/gtk-demo/css_multiplebgs.c
+++ b/demos/gtk-demo/css_multiplebgs.c
@@ -122,11 +122,11 @@ do_css_multiplebgs (GtkWidget *do_widget)
text = gtk_text_buffer_new (NULL);
gtk_text_buffer_create_tag (text,
"warning",
- "underline", PANGO_LINE_STYLE_SOLID,
+ "underline", PANGO2_LINE_STYLE_SOLID,
NULL);
gtk_text_buffer_create_tag (text,
"error",
- "underline", PANGO_LINE_STYLE_DOTTED,
+ "underline", PANGO2_LINE_STYLE_DOTTED,
NULL);
provider = GTK_STYLE_PROVIDER (gtk_css_provider_new ());
diff --git a/demos/gtk-demo/css_pixbufs.c b/demos/gtk-demo/css_pixbufs.c
index 4dbb201daf..23c5d01a91 100644
--- a/demos/gtk-demo/css_pixbufs.c
+++ b/demos/gtk-demo/css_pixbufs.c
@@ -93,11 +93,11 @@ do_css_pixbufs (GtkWidget *do_widget)
text = gtk_text_buffer_new (NULL);
gtk_text_buffer_create_tag (text,
"warning",
- "underline", PANGO_LINE_STYLE_SOLID,
+ "underline", PANGO2_LINE_STYLE_SOLID,
NULL);
gtk_text_buffer_create_tag (text,
"error",
- "underline", PANGO_LINE_STYLE_DOTTED,
+ "underline", PANGO2_LINE_STYLE_DOTTED,
NULL);
provider = GTK_STYLE_PROVIDER (gtk_css_provider_new ());
diff --git a/demos/gtk-demo/css_shadows.c b/demos/gtk-demo/css_shadows.c
index e9e9346218..3da633dba0 100644
--- a/demos/gtk-demo/css_shadows.c
+++ b/demos/gtk-demo/css_shadows.c
@@ -111,11 +111,11 @@ do_css_shadows (GtkWidget *do_widget)
text = gtk_text_buffer_new (NULL);
gtk_text_buffer_create_tag (text,
"warning",
- "underline", PANGO_LINE_STYLE_SOLID,
+ "underline", PANGO2_LINE_STYLE_SOLID,
NULL);
gtk_text_buffer_create_tag (text,
"error",
- "underline", PANGO_LINE_STYLE_DOTTED,
+ "underline", PANGO2_LINE_STYLE_DOTTED,
NULL);
provider = GTK_STYLE_PROVIDER (gtk_css_provider_new ());
diff --git a/demos/gtk-demo/dropdown.c b/demos/gtk-demo/dropdown.c
index 1924b4bce8..fbb80c272a 100644
--- a/demos/gtk-demo/dropdown.c
+++ b/demos/gtk-demo/dropdown.c
@@ -263,7 +263,7 @@ drop_down_new_from_strings (const char *const *titles,
static char *
get_family_name (gpointer item)
{
- return g_strdup (pango_font_family_get_name (PANGO_FONT_FAMILY (item)));
+ return g_strdup (pango2_font_family_get_name (PANGO2_FONT_FAMILY (item)));
}
static char *
@@ -326,8 +326,8 @@ bind_highlight_item (GtkSignalListItemFactory *factory,
{
MatchObject *obj;
GtkWidget *label;
- PangoAttrList *attrs;
- PangoAttribute *attr;
+ Pango2AttrList *attrs;
+ Pango2Attribute *attr;
const char *str;
obj = MATCH_OBJECT (gtk_list_item_get_item (item));
@@ -336,14 +336,14 @@ bind_highlight_item (GtkSignalListItemFactory *factory,
str = match_object_get_string (obj);
gtk_label_set_label (GTK_LABEL (label), str);
- attrs = pango_attr_list_new ();
- attr = pango_attr_weight_new (PANGO_WEIGHT_BOLD);
- pango_attribute_set_range (attr,
+ attrs = pango2_attr_list_new ();
+ attr = pango2_attr_weight_new (PANGO2_WEIGHT_BOLD);
+ pango2_attribute_set_range (attr,
match_object_get_match_start (obj),
match_object_get_match_end (obj));
- pango_attr_list_insert (attrs, attr);
+ pango2_attr_list_insert (attrs, attr);
gtk_label_set_attributes (GTK_LABEL (label), attrs);
- pango_attr_list_unref (attrs);
+ pango2_attr_list_unref (attrs);
}
static void
@@ -435,7 +435,7 @@ do_dropdown (GtkWidget *do_widget)
button = gtk_drop_down_new (NULL, NULL);
- model = G_LIST_MODEL (pango_font_map_get_default ());
+ model = G_LIST_MODEL (pango2_font_map_get_default ());
gtk_drop_down_set_model (GTK_DROP_DOWN (button), model);
gtk_drop_down_set_selected (GTK_DROP_DOWN (button), 0);
diff --git a/demos/gtk-demo/font_features.c b/demos/gtk-demo/font_features.c
index 3c535e58e2..08f1c9156f 100644
--- a/demos/gtk-demo/font_features.c
+++ b/demos/gtk-demo/font_features.c
@@ -513,8 +513,8 @@ update_display (void)
}
else
{
- start = PANGO_ATTR_INDEX_FROM_TEXT_BEGINNING;
- end = PANGO_ATTR_INDEX_TO_TEXT_END;
+ start = PANGO2_ATTR_INDEX_FROM_TEXT_BEGINNING;
+ end = PANGO2_ATTR_INDEX_TO_TEXT_END;
}
desc = gtk_font_chooser_get_font_desc (GTK_FONT_CHOOSER (demo->font));
@@ -694,7 +694,7 @@ update_display (void)
}
static Pango2Font *
-get_pango2_font (void)
+get_pango_font (void)
{
Pango2FontDescription *desc;
Pango2Context *context;
@@ -755,7 +755,7 @@ update_script_combo (void)
GtkListStore *store;
hb_font_t *hb_font;
int i, j, k;
- Pango2Font *pango2_font;
+ Pango2Font *pango_font;
GHashTable *tags;
GHashTableIter iter;
TagPair *pair;
@@ -774,7 +774,7 @@ update_script_combo (void)
store = gtk_list_store_new (4, G_TYPE_STRING, G_TYPE_UINT, G_TYPE_UINT, G_TYPE_UINT);
- pango2_font = get_pango_font ();
+ pango_font = get_pango_font ();
hb_font = pango2_font_get_hb_font (pango_font);
tags = g_hash_table_new_full (tag_pair_hash, tag_pair_equal, g_free, NULL);
@@ -898,7 +898,7 @@ update_features (void)
GtkTreeIter iter;
guint script_index, lang_index;
hb_tag_t lang_tag;
- Pango2Font *pango2_font;
+ Pango2Font *pango_font;
hb_font_t *hb_font;
GList *l;
@@ -937,7 +937,18 @@ update_features (void)
gtk_check_button_set_active (GTK_CHECK_BUTTON (item->feat), TRUE);
}
- pango2_font = get_pango_font ();
+ /* set feature presence checks from the font features */
+
+ if (!gtk_combo_box_get_active_iter (GTK_COMBO_BOX (script_lang), &iter))
+ return;
+
+ model = gtk_combo_box_get_model (GTK_COMBO_BOX (script_lang));
+ gtk_tree_model_get (model, &iter,
+ 1, &script_index,
+ 2, &lang_index,
+ -1);
+
+ pango_font = get_pango_font ();
hb_font = pango2_font_get_hb_font (pango_font);
if (hb_font)
@@ -1351,7 +1362,7 @@ instance_changed (GtkComboBox *combo)
float *coords = NULL;
hb_ot_var_axis_info_t *ai = NULL;
unsigned int n_axes;
- Pango2Font *pango2_font = NULL;
+ Pango2Font *pango_font = NULL;
hb_font_t *hb_font;
hb_face_t *hb_face;
@@ -1367,7 +1378,7 @@ instance_changed (GtkComboBox *combo)
goto out;
}
- pango2_font = get_pango_font ();
+ pango_font = get_pango_font ();
hb_font = pango2_font_get_hb_font (pango_font);
hb_face = hb_font_get_face (hb_font);
@@ -1472,7 +1483,7 @@ static void
update_font_variations (void)
{
GtkWidget *child;
- Pango2Font *pango2_font = NULL;
+ Pango2Font *pango_font = NULL;
hb_font_t *hb_font;
hb_face_t *hb_face;
unsigned int n_axes;
@@ -1490,7 +1501,7 @@ update_font_variations (void)
g_hash_table_remove_all (demo->axes);
g_hash_table_remove_all (demo->instances);
- pango2_font = get_pango_font ();
+ pango_font = get_pango_font ();
hb_font = pango2_font_get_hb_font (pango_font);
hb_face = hb_font_get_face (hb_font);
diff --git a/demos/gtk-demo/fontify.c b/demos/gtk-demo/fontify.c
index a451ba6652..e9b299b956 100644
--- a/demos/gtk-demo/fontify.c
+++ b/demos/gtk-demo/fontify.c
@@ -19,7 +19,7 @@
*/
static void
insert_tags_for_attributes (GtkTextBuffer *buffer,
- PangoAttrIterator *iter,
+ Pango2AttrIterator *iter,
GtkTextIter *start,
GtkTextIter *end)
{
@@ -32,7 +32,7 @@ insert_tags_for_attributes (GtkTextBuffer *buffer,
#define LANGUAGE_ATTR(attr_name) \
{ \
- const char *language = pango_language_to_string (pango_attribute_get_language (attr)); \
+ const char *language = pango2_language_to_string (pango2_attribute_get_language (attr)); \
g_snprintf (name, 256, "language=%s", language); \
tag = gtk_text_tag_table_lookup (table, name); \
if (!tag) \
@@ -47,7 +47,7 @@ insert_tags_for_attributes (GtkTextBuffer *buffer,
#define STRING_ATTR(attr_name) \
{ \
- const char *string = pango_attribute_get_string (attr); \
+ const char *string = pango2_attribute_get_string (attr); \
g_snprintf (name, 256, #attr_name "=%s", string); \
tag = gtk_text_tag_table_lookup (table, name); \
if (!tag) \
@@ -62,7 +62,7 @@ insert_tags_for_attributes (GtkTextBuffer *buffer,
#define INT_ATTR(attr_name) \
{ \
- int value = pango_attribute_get_int (attr); \
+ int value = pango2_attribute_get_int (attr); \
g_snprintf (name, 256, #attr_name "=%d", value); \
tag = gtk_text_tag_table_lookup (table, name); \
if (!tag) \
@@ -77,8 +77,8 @@ insert_tags_for_attributes (GtkTextBuffer *buffer,
#define FONT_ATTR(attr_name) \
{ \
- PangoFontDescription *desc = pango_attribute_get_font_desc (attr); \
- char *str = pango_font_description_to_string (desc); \
+ Pango2FontDescription *desc = pango2_attribute_get_font_desc (attr); \
+ char *str = pango2_font_description_to_string (desc); \
g_snprintf (name, 256, "font-desc=%s", str); \
g_free (str); \
tag = gtk_text_tag_table_lookup (table, name); \
@@ -94,7 +94,7 @@ insert_tags_for_attributes (GtkTextBuffer *buffer,
#define FLOAT_ATTR(attr_name) \
{ \
- float value = pango_attribute_get_float (attr); \
+ float value = pango2_attribute_get_float (attr); \
g_snprintf (name, 256, #attr_name "=%g", value); \
tag = gtk_text_tag_table_lookup (table, name); \
if (!tag) \
@@ -109,7 +109,7 @@ insert_tags_for_attributes (GtkTextBuffer *buffer,
#define RGBA_ATTR(attr_name) \
{ \
- PangoColor *color = pango_attribute_get_color (attr); \
+ Pango2Color *color = pango2_attribute_get_color (attr); \
GdkRGBA rgba; \
rgba.red = color->red / 65535.; \
rgba.green = color->green / 65535.; \
@@ -142,157 +142,157 @@ insert_tags_for_attributes (GtkTextBuffer *buffer,
gtk_text_buffer_apply_tag (buffer, tag, start, end); \
}
- attrs = pango_attr_iterator_get_attrs (iter);
+ attrs = pango2_attr_iterator_get_attrs (iter);
for (l = attrs; l; l = l->next)
{
- PangoAttribute *attr = l->data;
+ Pango2Attribute *attr = l->data;
- switch (pango_attribute_type (attr))
+ switch (pango2_attribute_type (attr))
{
- case PANGO_ATTR_LANGUAGE:
+ case PANGO2_ATTR_LANGUAGE:
LANGUAGE_ATTR (language);
break;
- case PANGO_ATTR_FAMILY:
+ case PANGO2_ATTR_FAMILY:
STRING_ATTR (family);
break;
- case PANGO_ATTR_STYLE:
+ case PANGO2_ATTR_STYLE:
INT_ATTR (style);
break;
- case PANGO_ATTR_WEIGHT:
+ case PANGO2_ATTR_WEIGHT:
INT_ATTR (weight);
break;
- case PANGO_ATTR_VARIANT:
+ case PANGO2_ATTR_VARIANT:
INT_ATTR (variant);
break;
- case PANGO_ATTR_STRETCH:
+ case PANGO2_ATTR_STRETCH:
INT_ATTR (stretch);
break;
- case PANGO_ATTR_SIZE:
+ case PANGO2_ATTR_SIZE:
INT_ATTR (size);
break;
- case PANGO_ATTR_FONT_DESC:
+ case PANGO2_ATTR_FONT_DESC:
FONT_ATTR (font-desc);
break;
- case PANGO_ATTR_FOREGROUND:
+ case PANGO2_ATTR_FOREGROUND:
RGBA_ATTR (foreground_rgba);
break;
- case PANGO_ATTR_BACKGROUND:
+ case PANGO2_ATTR_BACKGROUND:
RGBA_ATTR (background_rgba);
break;
- case PANGO_ATTR_UNDERLINE:
+ case PANGO2_ATTR_UNDERLINE:
INT_ATTR (underline);
break;
- case PANGO_ATTR_UNDERLINE_COLOR:
+ case PANGO2_ATTR_UNDERLINE_COLOR:
RGBA_ATTR (underline_rgba);
break;
- case PANGO_ATTR_OVERLINE:
+ case PANGO2_ATTR_OVERLINE:
INT_ATTR (overline);
break;
- case PANGO_ATTR_OVERLINE_COLOR:
+ case PANGO2_ATTR_OVERLINE_COLOR:
RGBA_ATTR (overline_rgba);
break;
- case PANGO_ATTR_STRIKETHROUGH:
+ case PANGO2_ATTR_STRIKETHROUGH:
INT_ATTR (strikethrough);
break;
- case PANGO_ATTR_STRIKETHROUGH_COLOR:
+ case PANGO2_ATTR_STRIKETHROUGH_COLOR:
RGBA_ATTR (strikethrough_rgba);
break;
- case PANGO_ATTR_RISE:
+ case PANGO2_ATTR_RISE:
INT_ATTR (rise);
break;
- case PANGO_ATTR_SCALE:
+ case PANGO2_ATTR_SCALE:
FLOAT_ATTR (scale);
break;
- case PANGO_ATTR_FALLBACK:
+ case PANGO2_ATTR_FALLBACK:
INT_ATTR (fallback);
break;
- case PANGO_ATTR_LETTER_SPACING:
+ case PANGO2_ATTR_LETTER_SPACING:
INT_ATTR (letter_spacing);
break;
- case PANGO_ATTR_FONT_FEATURES:
+ case PANGO2_ATTR_FONT_FEATURES:
STRING_ATTR (font_features);
break;
- case PANGO_ATTR_ALLOW_BREAKS:
+ case PANGO2_ATTR_ALLOW_BREAKS:
INT_ATTR (allow_breaks);
break;
- case PANGO_ATTR_SHOW:
+ case PANGO2_ATTR_SHOW:
INT_ATTR (show_spaces);
break;
- case PANGO_ATTR_INSERT_HYPHENS:
+ case PANGO2_ATTR_INSERT_HYPHENS:
INT_ATTR (insert_hyphens);
break;
- case PANGO_ATTR_LINE_HEIGHT:
+ case PANGO2_ATTR_LINE_HEIGHT:
FLOAT_ATTR (line_height);
break;
- case PANGO_ATTR_ABSOLUTE_LINE_HEIGHT:
+ case PANGO2_ATTR_ABSOLUTE_LINE_HEIGHT:
break;
- case PANGO_ATTR_LINE_SPACING:
+ case PANGO2_ATTR_LINE_SPACING:
INT_ATTR (pixels_inside_wrap);
break;
- case PANGO_ATTR_WORD:
+ case PANGO2_ATTR_WORD:
VOID_ATTR (word);
break;
- case PANGO_ATTR_SENTENCE:
+ case PANGO2_ATTR_SENTENCE:
VOID_ATTR (sentence);
break;
- case PANGO_ATTR_PARAGRAPH:
+ case PANGO2_ATTR_PARAGRAPH:
VOID_ATTR (paragraph);
break;
- case PANGO_ATTR_BASELINE_SHIFT:
+ case PANGO2_ATTR_BASELINE_SHIFT:
INT_ATTR (baseline_shift);
break;
- case PANGO_ATTR_FONT_SCALE:
+ case PANGO2_ATTR_FONT_SCALE:
INT_ATTR (font_scale);
break;
- case PANGO_ATTR_ABSOLUTE_SIZE:
- case PANGO_ATTR_GRAVITY:
- case PANGO_ATTR_GRAVITY_HINT:
+ case PANGO2_ATTR_ABSOLUTE_SIZE:
+ case PANGO2_ATTR_GRAVITY:
+ case PANGO2_ATTR_GRAVITY_HINT:
break;
- case PANGO_ATTR_TEXT_TRANSFORM:
+ case PANGO2_ATTR_TEXT_TRANSFORM:
INT_ATTR (text_transform);
break;
- case PANGO_ATTR_INVALID:
+ case PANGO2_ATTR_INVALID:
default:
g_assert_not_reached ();
break;
}
}
- g_slist_free_full (attrs, (GDestroyNotify)pango_attribute_destroy);
+ g_slist_free_full (attrs, (GDestroyNotify)pango2_attribute_destroy);
#undef LANGUAGE_ATTR
#undef STRING_ATTR
@@ -311,9 +311,9 @@ typedef struct
GtkTextBuffer *buffer;
GtkTextIter iter;
GtkTextMark *mark;
- PangoAttrList *attributes;
+ Pango2AttrList *attributes;
char *text;
- PangoAttrIterator *attr;
+ Pango2AttrIterator *attr;
} MarkupData;
static void
@@ -322,8 +322,8 @@ free_markup_data (MarkupData *mdata)
g_free (mdata->markup);
g_clear_pointer (&mdata->parser, g_markup_parse_context_free);
gtk_text_buffer_delete_mark (mdata->buffer, mdata->mark);
- g_clear_pointer (&mdata->attr, pango_attr_iterator_destroy);
- g_clear_pointer (&mdata->attributes, pango_attr_list_unref);
+ g_clear_pointer (&mdata->attr, pango2_attr_iterator_destroy);
+ g_clear_pointer (&mdata->attributes, pango2_attr_list_unref);
g_free (mdata->text);
g_object_unref (mdata->buffer);
g_free (mdata);
@@ -349,7 +349,7 @@ insert_markup_idle (gpointer data)
return G_SOURCE_REMOVE;
}
- pango_attr_iterator_range (mdata->attr, &start, &end);
+ pango2_attr_iterator_range (mdata->attr, &start, &end);
if (end == G_MAXINT) /* last chunk */
end = start - 1; /* resulting in -1 to be passed to _insert */
@@ -362,7 +362,7 @@ insert_markup_idle (gpointer data)
gtk_text_buffer_get_iter_at_mark (mdata->buffer, &mdata->iter, mdata->mark);
}
- while (pango_attr_iterator_next (mdata->attr));
+ while (pango2_attr_iterator_next (mdata->attr));
free_markup_data (mdata);
return G_SOURCE_REMOVE;
@@ -398,7 +398,7 @@ parse_markup_idle (gpointer data)
mdata->pos += 4096;
} while (mdata->pos < mdata->len);
- if (!pango_markup_parser_finish (mdata->parser,
+ if (!pango2_markup_parser_finish (mdata->parser,
&mdata->attributes,
&mdata->text,
NULL,
@@ -417,7 +417,7 @@ parse_markup_idle (gpointer data)
return G_SOURCE_REMOVE;
}
- mdata->attr = pango_attr_list_get_iterator (mdata->attributes);
+ mdata->attr = pango2_attr_list_get_iterator (mdata->attributes);
insert_markup_idle (data);
return G_SOURCE_REMOVE;
@@ -443,7 +443,7 @@ insert_markup (GtkTextBuffer *buffer,
data->markup = markup;
data->len = len;
- data->parser = pango_markup_parser_new (0);
+ data->parser = pango2_markup_parser_new (0);
data->pos = 0;
/* create mark with right gravity */
diff --git a/demos/gtk-demo/fontrendering.c b/demos/gtk-demo/fontrendering.c
index 3815b2f844..7c5f001d12 100644
--- a/demos/gtk-demo/fontrendering.c
+++ b/demos/gtk-demo/fontrendering.c
@@ -25,7 +25,7 @@ static GtkWidget *show_extents = NULL;
static GtkWidget *show_pixels = NULL;
static GtkWidget *show_outlines = NULL;
-static PangoContext *context;
+static Pango2Context *context;
static int scale = 7;
static double pixel_alpha = 1.0;
@@ -35,9 +35,9 @@ static void
update_image (void)
{
const char *text;
- PangoFontDescription *desc;
- PangoLayout *layout;
- PangoRectangle ink, logical;
+ Pango2FontDescription *desc;
+ Pango2Layout *layout;
+ Pango2Rectangle ink, logical;
int baseline;
cairo_surface_t *surface;
cairo_t *cr;
@@ -56,7 +56,7 @@ update_image (void)
text = gtk_editable_get_text (GTK_EDITABLE (entry));
desc = gtk_font_chooser_get_font_desc (GTK_FONT_CHOOSER (font_button));
- fopt = cairo_font_options_copy (pango_cairo_context_get_font_options (context));
+ fopt = cairo_font_options_copy (pango2_cairo_context_get_font_options (context));
hint = gtk_combo_box_get_active_id (GTK_COMBO_BOX (hinting));
hintstyle = CAIRO_HINT_STYLE_DEFAULT;
@@ -85,20 +85,20 @@ update_image (void)
antialias = CAIRO_ANTIALIAS_NONE;
cairo_font_options_set_antialias (fopt, antialias);
- pango_context_set_round_glyph_positions (context, hintmetrics == CAIRO_HINT_METRICS_ON);
- pango_cairo_context_set_font_options (context, fopt);
+ pango2_context_set_round_glyph_positions (context, hintmetrics == CAIRO_HINT_METRICS_ON);
+ pango2_cairo_context_set_font_options (context, fopt);
cairo_font_options_destroy (fopt);
- pango_context_changed (context);
+ pango2_context_changed (context);
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (text_radio)))
{
- layout = pango_layout_new (context);
- pango_layout_set_font_description (layout, desc);
- pango_layout_set_text (layout, text, -1);
- pango_lines_get_extents (pango_layout_get_lines (layout), &ink, &logical);
- baseline = pango_lines_get_baseline (pango_layout_get_lines (layout));
+ layout = pango2_layout_new (context);
+ pango2_layout_set_font_description (layout, desc);
+ pango2_layout_set_text (layout, text, -1);
+ pango2_lines_get_extents (pango2_layout_get_lines (layout), &ink, &logical);
+ baseline = pango2_lines_get_baseline (pango2_layout_get_lines (layout));
- pango_extents_to_pixels (&ink, NULL);
+ pango2_extents_to_pixels (&ink, NULL);
surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, ink.width + 20, ink.height + 20);
cr = cairo_create (surface);
@@ -108,9 +108,9 @@ update_image (void)
cairo_set_source_rgba (cr, 0, 0, 0, pixel_alpha);
cairo_move_to (cr, 10, 10);
- pango_cairo_show_layout (cr, layout);
+ pango2_cairo_show_layout (cr, layout);
- pango_cairo_layout_path (cr, layout);
+ pango2_cairo_layout_path (cr, layout);
path = cairo_copy_path (cr);
cairo_destroy (cr);
@@ -154,15 +154,15 @@ update_image (void)
cairo_set_source_rgb (cr, 0, 0, 1);
cairo_rectangle (cr,
- scale * (10 + pango_units_to_double (logical.x)) - 0.5,
- scale * (10 + pango_units_to_double (logical.y)) - 0.5,
- scale * pango_units_to_double (logical.width) + 1,
- scale * pango_units_to_double (logical.height) + 1);
+ scale * (10 + pango2_units_to_double (logical.x)) - 0.5,
+ scale * (10 + pango2_units_to_double (logical.y)) - 0.5,
+ scale * pango2_units_to_double (logical.width) + 1,
+ scale * pango2_units_to_double (logical.height) + 1);
cairo_stroke (cr);
- cairo_move_to (cr, scale * (10 + pango_units_to_double (logical.x)) - 0.5,
- scale * (10 + pango_units_to_double (baseline)) - 0.5);
- cairo_line_to (cr, scale * (10 + pango_units_to_double (logical.x + logical.width)) + 1,
- scale * (10 + pango_units_to_double (baseline)) - 0.5);
+ cairo_move_to (cr, scale * (10 + pango2_units_to_double (logical.x)) - 0.5,
+ scale * (10 + pango2_units_to_double (baseline)) - 0.5);
+ cairo_line_to (cr, scale * (10 + pango2_units_to_double (logical.x + logical.width)) + 1,
+ scale * (10 + pango2_units_to_double (baseline)) - 0.5);
cairo_stroke (cr);
cairo_set_source_rgb (cr, 1, 0, 0);
cairo_rectangle (cr,
@@ -206,10 +206,10 @@ update_image (void)
}
else
{
- PangoLineIter *iter;
- PangoRun *run;
- PangoGlyphString *glyphs;
- PangoGlyphInfo *g;
+ Pango2LineIter *iter;
+ Pango2Run *run;
+ Pango2GlyphString *glyphs;
+ Pango2GlyphInfo *g;
int i, j;
GString *str;
gunichar ch;
@@ -227,27 +227,27 @@ update_image (void)
g_string_append_unichar (str, 0x200c);
}
- layout = pango_layout_new (context);
- pango_layout_set_font_description (layout, desc);
- pango_layout_set_text (layout, str->str, -1);
+ layout = pango2_layout_new (context);
+ pango2_layout_set_font_description (layout, desc);
+ pango2_layout_set_text (layout, str->str, -1);
g_string_free (str, TRUE);
- pango_lines_get_extents (pango_layout_get_lines (layout), &ink, &logical);
- pango_extents_to_pixels (&logical, NULL);
+ pango2_lines_get_extents (pango2_layout_get_lines (layout), &ink, &logical);
+ pango2_extents_to_pixels (&logical, NULL);
surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, logical.width * 3 / 2, 4*logical.height);
cr = cairo_create (surface);
cairo_set_source_rgb (cr, 1, 1, 1);
cairo_paint (cr);
- iter = pango_layout_get_iter (layout);
- run = pango_line_iter_get_run (iter);
- glyphs = pango_run_get_glyphs (run);
+ iter = pango2_layout_get_iter (layout);
+ run = pango2_line_iter_get_run (iter);
+ glyphs = pango2_run_get_glyphs (run);
cairo_set_source_rgb (cr, 0, 0, 0);
for (i = 0; i < 4; i++)
{
g = &(glyphs->glyphs[2*i]);
- g->geometry.width = PANGO_UNITS_ROUND (g->geometry.width * 3 / 2);
+ g->geometry.width = PANGO2_UNITS_ROUND (g->geometry.width * 3 / 2);
}
for (j = 0; j < 4; j++)
@@ -255,16 +255,16 @@ update_image (void)
for (i = 0; i < 4; i++)
{
g = &(glyphs->glyphs[2*i]);
- g->geometry.x_offset = i * (PANGO_SCALE / 4);
- g->geometry.y_offset = j * (PANGO_SCALE / 4);
+ g->geometry.x_offset = i * (PANGO2_SCALE / 4);
+ g->geometry.y_offset = j * (PANGO2_SCALE / 4);
}
cairo_move_to (cr, 0, j * logical.height);
- pango_cairo_show_layout (cr, layout);
+ pango2_cairo_show_layout (cr, layout);
}
cairo_destroy (cr);
- pango_line_iter_free (iter);
+ pango2_line_iter_free (iter);
g_object_unref (layout);
pixbuf = gdk_pixbuf_get_from_surface (surface, 0, 0, cairo_image_surface_get_width (surface),
cairo_image_surface_get_height (surface));
@@ -277,7 +277,7 @@ update_image (void)
g_object_unref (pixbuf2);
- pango_font_description_free (desc);
+ pango2_font_description_free (desc);
}
static gboolean fading = FALSE;
diff --git a/demos/gtk-demo/hypertext.c b/demos/gtk-demo/hypertext.c
index 27c8fa1e70..a7e836be2c 100644
--- a/demos/gtk-demo/hypertext.c
+++ b/demos/gtk-demo/hypertext.c
@@ -29,7 +29,7 @@ insert_link (GtkTextBuffer *buffer,
tag = gtk_text_buffer_create_tag (buffer, NULL,
"foreground", "blue",
- "underline", PANGO_LINE_STYLE_SOLID,
+ "underline", PANGO2_LINE_STYLE_SOLID,
NULL);
g_object_set_data (G_OBJECT (tag), "page", GINT_TO_POINTER (page));
gtk_text_buffer_insert_with_tags (buffer, iter, text, -1, tag, NULL);
@@ -72,8 +72,8 @@ show_page (GtkTextView *text_view,
buffer = gtk_text_view_get_buffer (text_view);
bold = gtk_text_buffer_create_tag (buffer, NULL,
- "weight", PANGO_WEIGHT_BOLD,
- "scale", PANGO_SCALE_X_LARGE,
+ "weight", PANGO2_WEIGHT_BOLD,
+ "scale", PANGO2_SCALE_X_LARGE,
NULL);
mono = gtk_text_buffer_create_tag (buffer, NULL,
"family", "monospace",
diff --git a/demos/gtk-demo/language-names.c b/demos/gtk-demo/language-names.c
index 7e0cbf20df..151c9a0965 100644
--- a/demos/gtk-demo/language-names.c
+++ b/demos/gtk-demo/language-names.c
@@ -44,7 +44,7 @@ get_win32_all_locales_scripts (LPWSTR locale_w, DWORD flags, LPARAM param)
gint i;
const LCTYPE iso639_lctypes[] = { LOCALE_SISO639LANGNAME, LOCALE_SISO639LANGNAME2 };
GHashTable *ht_scripts_langs = (GHashTable *) param;
- PangoLanguage *lang;
+ Pango2Language *lang;
gint langname_size, locale_abbrev_size;
langname_size = GetLocaleInfoEx (locale_w, LOCALE_SLOCALIZEDDISPLAYNAME, langname_w, 0);
@@ -60,7 +60,7 @@ get_win32_all_locales_scripts (LPWSTR locale_w, DWORD flags, LPARAM param)
langname = g_utf16_to_utf8 (langname_w, -1, NULL, NULL, NULL);
locale = g_utf16_to_utf8 (locale_w, -1, NULL, NULL, NULL);
p = strchr (locale, '-');
- lang = pango_language_from_string (locale);
+ lang = pango2_language_from_string (locale);
if (g_hash_table_lookup (ht_scripts_langs, lang) == NULL)
g_hash_table_insert (ht_scripts_langs, lang, langname);
@@ -77,7 +77,7 @@ get_win32_all_locales_scripts (LPWSTR locale_w, DWORD flags, LPARAM param)
GetLocaleInfoEx (locale_w, iso639_lctypes[i], locale_abbrev_w, locale_abbrev_size);
locale_abbrev = g_utf16_to_utf8 (locale_abbrev_w, -1, NULL, NULL, NULL);
- lang = pango_language_from_string (locale_abbrev);
+ lang = pango2_language_from_string (locale_abbrev);
if (g_hash_table_lookup (ht_scripts_langs, lang) == NULL)
g_hash_table_insert (ht_scripts_langs, lang, langname);
@@ -218,22 +218,22 @@ languages_parse_start_tag (GMarkupParseContext *ctx,
if (ccode != NULL)
g_hash_table_insert (language_map,
- pango_language_from_string (ccode),
+ pango2_language_from_string (ccode),
g_strdup (display_name));
if (ccode_longB != NULL)
g_hash_table_insert (language_map,
- pango_language_from_string (ccode_longB),
+ pango2_language_from_string (ccode_longB),
g_strdup (display_name));
if (ccode_longT != NULL)
g_hash_table_insert (language_map,
- pango_language_from_string (ccode_longT),
+ pango2_language_from_string (ccode_longT),
g_strdup (display_name));
if (ccode_id != NULL)
g_hash_table_insert (language_map,
- pango_language_from_string (ccode_id),
+ pango2_language_from_string (ccode_id),
g_strdup (display_name));
g_free (display_name);
@@ -295,7 +295,7 @@ languages_init (void)
}
const char *
-get_language_name (PangoLanguage *language)
+get_language_name (Pango2Language *language)
{
languages_init ();
@@ -311,5 +311,5 @@ get_language_name_for_tag (guint32 tag)
lang = hb_ot_tag_to_language (tag);
s = hb_language_to_string (lang);
- return get_language_name (pango_language_from_string (s));
+ return get_language_name (pango2_language_from_string (s));
}
diff --git a/demos/gtk-demo/language-names.h b/demos/gtk-demo/language-names.h
index 562f7ae2f8..4f27985dfa 100644
--- a/demos/gtk-demo/language-names.h
+++ b/demos/gtk-demo/language-names.h
@@ -1,11 +1,11 @@
#ifndef LANGUAGE_NAMES_H
#define LANGUAGE_NAMES_H
-#include <pango/pango.h>
+#include <pango2/pango.h>
G_BEGIN_DECLS
-const char * get_language_name (PangoLanguage *language);
+const char * get_language_name (Pango2Language *language);
const char * get_language_name_for_tag (guint32 tag);
G_END_DECLS
diff --git a/demos/gtk-demo/links.c b/demos/gtk-demo/links.c
index 63ac1d0c7f..a27f9b60f0 100644
--- a/demos/gtk-demo/links.c
+++ b/demos/gtk-demo/links.c
@@ -72,7 +72,7 @@ do_links (GtkWidget *do_widget)
gtk_label_set_use_markup (GTK_LABEL (label), TRUE);
gtk_label_set_max_width_chars (GTK_LABEL (label), 40);
gtk_label_set_wrap (GTK_LABEL (label), TRUE);
- gtk_label_set_wrap_mode (GTK_LABEL (label), PANGO_WRAP_WORD);
+ gtk_label_set_wrap_mode (GTK_LABEL (label), PANGO2_WRAP_WORD);
g_signal_connect (label, "activate-link", G_CALLBACK (activate_link), NULL);
gtk_widget_set_margin_start (label, 20);
gtk_widget_set_margin_end (label, 20);
diff --git a/demos/gtk-demo/listview_colors.c b/demos/gtk-demo/listview_colors.c
index c05807a1c1..c608da6854 100644
--- a/demos/gtk-demo/listview_colors.c
+++ b/demos/gtk-demo/listview_colors.c
@@ -758,15 +758,15 @@ setup_number_item (GtkSignalListItemFactory *factory,
GtkListItem *item)
{
GtkWidget *label;
- PangoAttrList *attrs;
+ Pango2AttrList *attrs;
label = gtk_label_new ("");
gtk_label_set_xalign (GTK_LABEL (label), 1);
- attrs = pango_attr_list_new ();
- pango_attr_list_insert (attrs, pango_attr_font_features_new ("tnum"));
+ attrs = pango2_attr_list_new ();
+ pango2_attr_list_insert (attrs, pango2_attr_font_features_new ("tnum"));
gtk_label_set_attributes (GTK_LABEL (label), attrs);
- pango_attr_list_unref (attrs);
+ pango2_attr_list_unref (attrs);
gtk_list_item_set_child (item, label);
}
@@ -862,7 +862,7 @@ do_listview_colors (GtkWidget *do_widget)
GtkExpression *expression;
GtkWidget *button;
GtkWidget *label;
- PangoAttrList *attrs;
+ Pango2AttrList *attrs;
char *string;
guint len;
GtkWidget *selection_view;
@@ -990,10 +990,10 @@ do_listview_colors (GtkWidget *do_widget)
gtk_header_bar_pack_start (GTK_HEADER_BAR (header), button);
label = gtk_label_new ("0 /");
- attrs = pango_attr_list_new ();
- pango_attr_list_insert (attrs, pango_attr_font_features_new ("tnum"));
+ attrs = pango2_attr_list_new ();
+ pango2_attr_list_insert (attrs, pango2_attr_font_features_new ("tnum"));
gtk_label_set_attributes (GTK_LABEL (label), attrs);
- pango_attr_list_unref (attrs);
+ pango2_attr_list_unref (attrs);
string = g_strdup_printf ("%'u", 4096);
len = g_utf8_strlen (string, -1);
g_free (string);
diff --git a/demos/gtk-demo/listview_ucd.c b/demos/gtk-demo/listview_ucd.c
index 418e7ca418..b9e2f6d19a 100644
--- a/demos/gtk-demo/listview_ucd.c
+++ b/demos/gtk-demo/listview_ucd.c
@@ -123,7 +123,7 @@ setup_ellipsizing_label (GtkSignalListItemFactory *factory,
GtkWidget *label;
label = gtk_label_new ("");
gtk_label_set_xalign (GTK_LABEL (label), 0);
- gtk_label_set_ellipsize (GTK_LABEL (label), PANGO_ELLIPSIZE_END);
+ gtk_label_set_ellipsize (GTK_LABEL (label), PANGO2_ELLIPSIZE_END);
gtk_label_set_width_chars (GTK_LABEL (label), 20);
gtk_list_item_set_child (GTK_LIST_ITEM (listitem), label);
}
diff --git a/demos/gtk-demo/main.c b/demos/gtk-demo/main.c
index a7ea646244..85a1ae5acd 100644
--- a/demos/gtk-demo/main.c
+++ b/demos/gtk-demo/main.c
@@ -190,8 +190,8 @@ activate_about (GSimpleAction *action,
glib_major_version,
glib_minor_version,
glib_micro_version);
- g_string_append_printf (s, "\tPango\t%s\n",
- pango_version_string ());
+ g_string_append_printf (s, "\tPango2\t%s\n",
+ pango2_version_string ());
g_string_append_printf (s, "\tGTK \t%d.%d.%d\n",
gtk_get_major_version (),
gtk_get_minor_version (),
diff --git a/demos/gtk-demo/pickers.c b/demos/gtk-demo/pickers.c
index 07763ba46d..4be4a4729e 100644
--- a/demos/gtk-demo/pickers.c
+++ b/demos/gtk-demo/pickers.c
@@ -11,8 +11,8 @@
#include <gtk/gtk.h>
static gboolean
-filter_font_cb (const PangoFontFamily *family,
- const PangoFontFace *face,
+filter_font_cb (const Pango2FontFamily *family,
+ const Pango2FontFace *face,
gpointer data)
{
const char *alias_families[] = {
@@ -26,7 +26,7 @@ filter_font_cb (const PangoFontFamily *family,
};
const char *family_name;
- family_name = pango_font_family_get_name ((PangoFontFamily *)family);
+ family_name = pango2_font_family_get_name ((Pango2FontFamily *)family);
for (int i = 0; alias_families[i]; i++)
{
diff --git a/demos/gtk-demo/printing.c b/demos/gtk-demo/printing.c
index 2633f8a3aa..e91cf50ca8 100644
--- a/demos/gtk-demo/printing.c
+++ b/demos/gtk-demo/printing.c
@@ -59,11 +59,11 @@ draw_page (GtkPrintOperation *operation,
{
PrintData *data = (PrintData *)user_data;
cairo_t *cr;
- PangoLayout *layout;
- PangoRectangle ext;
+ Pango2Layout *layout;
+ Pango2Rectangle ext;
double width;
int line, i;
- PangoFontDescription *desc;
+ Pango2FontDescription *desc;
char *page_str;
cr = gtk_print_context_get_cairo_context (context);
@@ -80,50 +80,50 @@ draw_page (GtkPrintOperation *operation,
layout = gtk_print_context_create_pango_layout (context);
- desc = pango_font_description_from_string ("sans 14");
- pango_layout_set_font_description (layout, desc);
- pango_font_description_free (desc);
+ desc = pango2_font_description_from_string ("sans 14");
+ pango2_layout_set_font_description (layout, desc);
+ pango2_font_description_free (desc);
- pango_layout_set_text (layout, data->resourcename, -1);
- pango_lines_get_extents (pango_layout_get_lines (layout), NULL, &ext);
- pango_extents_to_pixels (&ext, NULL);
+ pango2_layout_set_text (layout, data->resourcename, -1);
+ pango2_lines_get_extents (pango2_layout_get_lines (layout), NULL, &ext);
+ pango2_extents_to_pixels (&ext, NULL);
if (ext.width > width)
{
- pango_layout_set_width (layout, width);
- pango_layout_set_ellipsize (layout, PANGO_ELLIPSIZE_START);
- pango_lines_get_extents (pango_layout_get_lines (layout), NULL, &ext);
- pango_extents_to_pixels (&ext, NULL);
+ pango2_layout_set_width (layout, width);
+ pango2_layout_set_ellipsize (layout, PANGO2_ELLIPSIZE_START);
+ pango2_lines_get_extents (pango2_layout_get_lines (layout), NULL, &ext);
+ pango2_extents_to_pixels (&ext, NULL);
}
cairo_move_to (cr, (width - ext.width) / 2, (HEADER_HEIGHT - ext.height) / 2);
- pango_cairo_show_layout (cr, layout);
+ pango2_cairo_show_layout (cr, layout);
page_str = g_strdup_printf ("%d/%d", page_nr + 1, data->num_pages);
- pango_layout_set_text (layout, page_str, -1);
+ pango2_layout_set_text (layout, page_str, -1);
g_free (page_str);
- pango_layout_set_width (layout, -1);
- pango_lines_get_extents (pango_layout_get_lines (layout), NULL, &ext);
- pango_extents_to_pixels (&ext, NULL);
+ pango2_layout_set_width (layout, -1);
+ pango2_lines_get_extents (pango2_layout_get_lines (layout), NULL, &ext);
+ pango2_extents_to_pixels (&ext, NULL);
cairo_move_to (cr, width - ext.width - 4, (HEADER_HEIGHT - ext.height) / 2);
- pango_cairo_show_layout (cr, layout);
+ pango2_cairo_show_layout (cr, layout);
g_object_unref (layout);
layout = gtk_print_context_create_pango_layout (context);
- desc = pango_font_description_from_string ("monospace");
- pango_font_description_set_size (desc, data->font_size * PANGO_SCALE);
- pango_layout_set_font_description (layout, desc);
- pango_font_description_free (desc);
+ desc = pango2_font_description_from_string ("monospace");
+ pango2_font_description_set_size (desc, data->font_size * PANGO2_SCALE);
+ pango2_layout_set_font_description (layout, desc);
+ pango2_font_description_free (desc);
cairo_move_to (cr, 0, HEADER_HEIGHT + HEADER_GAP);
line = page_nr * data->lines_per_page;
for (i = 0; i < data->lines_per_page && line < data->num_lines; i++)
{
- pango_layout_set_text (layout, data->lines[line], -1);
- pango_cairo_show_layout (cr, layout);
+ pango2_layout_set_text (layout, data->lines[line], -1);
+ pango2_cairo_show_layout (cr, layout);
cairo_rel_move_to (cr, 0, data->font_size);
line++;
}
diff --git a/demos/gtk-demo/rotated_text.c b/demos/gtk-demo/rotated_text.c
index cedf6a6209..e22d61c846 100644
--- a/demos/gtk-demo/rotated_text.c
+++ b/demos/gtk-demo/rotated_text.c
@@ -1,9 +1,9 @@
-/* Pango/Rotated Text
+/* Pango2/Rotated Text
*
- * This demo shows how to use PangoCairo to draw rotated and transformed
+ * This demo shows how to use Pango2Cairo to draw rotated and transformed
* text. The right pane shows a rotated GtkLabel widget.
*
- * In both cases, a custom PangoCairo shape renderer is installed to draw
+ * In both cases, a custom Pango2Cairo shape renderer is installed to draw
* a red heart using cairo drawing operations instead of the Unicode heart
* character.
*/
@@ -15,7 +15,7 @@
const char text[] = "I ♥ GTK";
static gboolean
-glyph_cb (PangoUserFace *face,
+glyph_cb (Pango2UserFace *face,
hb_codepoint_t unicode,
hb_codepoint_t *glyph,
gpointer data)
@@ -30,7 +30,7 @@ glyph_cb (PangoUserFace *face,
}
static gboolean
-glyph_info_cb (PangoUserFace *face,
+glyph_info_cb (Pango2UserFace *face,
int size,
hb_codepoint_t glyph,
hb_glyph_extents_t *extents,
@@ -57,7 +57,7 @@ glyph_info_cb (PangoUserFace *face,
}
static gboolean
-font_info_cb (PangoUserFace *face,
+font_info_cb (Pango2UserFace *face,
int size,
hb_font_extents_t *extents,
gpointer user_data)
@@ -70,7 +70,7 @@ font_info_cb (PangoUserFace *face,
}
static gboolean
-render_cb (PangoUserFace *face,
+render_cb (Pango2UserFace *face,
int size,
hb_codepoint_t glyph,
gpointer user_data,
@@ -81,7 +81,7 @@ render_cb (PangoUserFace *face,
if (strcmp (backend_id, "cairo") != 0)
{
- g_warning ("Unsupported PangoRenderer backend %s", backend_id);
+ g_warning ("Unsupported Pango2Renderer backend %s", backend_id);
return FALSE;
}
@@ -107,15 +107,15 @@ render_cb (PangoUserFace *face,
static void
setup_fontmap (void)
{
- PangoFontMap *fontmap = pango_font_map_get_default ();
- PangoFontDescription *desc;
- PangoUserFace *face;
+ Pango2FontMap *fontmap = pango2_font_map_get_default ();
+ Pango2FontDescription *desc;
+ Pango2UserFace *face;
- desc = pango_font_description_new ();
- pango_font_description_set_family (desc, "Bullets");
+ desc = pango2_font_description_new ();
+ pango2_font_description_set_family (desc, "Bullets");
/* Create our fancy user font, "Bullets Black" */
- face = pango_user_face_new (font_info_cb,
+ face = pango2_user_face_new (font_info_cb,
glyph_cb,
glyph_info_cb,
NULL,
@@ -123,9 +123,9 @@ setup_fontmap (void)
NULL, NULL, "Black", desc);
/* And add it to the default fontmap */
- pango_font_map_add_face (fontmap, PANGO_FONT_FACE (face));
+ pango2_font_map_add_face (fontmap, PANGO2_FONT_FACE (face));
- pango_font_description_free (desc);
+ pango2_font_description_free (desc);
}
static void
@@ -139,9 +139,9 @@ rotated_text_draw (GtkDrawingArea *da,
#define N_WORDS 5
#define FONT "Bullets 18"
- PangoContext *context;
- PangoLayout *layout;
- PangoFontDescription *desc;
+ Pango2Context *context;
+ Pango2Layout *layout;
+ Pango2FontDescription *desc;
cairo_pattern_t *pattern;
double device_radius;
int i;
@@ -162,34 +162,34 @@ rotated_text_draw (GtkDrawingArea *da,
cairo_pattern_add_color_stop_rgb (pattern, 1., .0, .0, .5);
cairo_set_source (cr, pattern);
- /* Create a PangoContext and set up our shape renderer */
+ /* Create a Pango2Context and set up our shape renderer */
context = gtk_widget_create_pango_context (GTK_WIDGET (da));
- /* Create a PangoLayout, set the text, font, and attributes */
- layout = pango_layout_new (context);
- pango_layout_set_text (layout, text, -1);
- desc = pango_font_description_from_string (FONT);
- pango_layout_set_font_description (layout, desc);
+ /* Create a Pango2Layout, set the text, font, and attributes */
+ layout = pango2_layout_new (context);
+ pango2_layout_set_text (layout, text, -1);
+ desc = pango2_font_description_from_string (FONT);
+ pango2_layout_set_font_description (layout, desc);
/* Draw the layout N_WORDS times in a circle */
for (i = 0; i < N_WORDS; i++)
{
- PangoRectangle ext;
+ Pango2Rectangle ext;
- /* Inform Pango to re-layout the text with the new transformation matrix */
- pango_cairo_update_layout (cr, layout);
+ /* Inform Pango2 to re-layout the text with the new transformation matrix */
+ pango2_cairo_update_layout (cr, layout);
- pango_lines_get_extents (pango_layout_get_lines (layout), NULL, &ext);
- pango_extents_to_pixels (&ext, NULL);
+ pango2_lines_get_extents (pango2_layout_get_lines (layout), NULL, &ext);
+ pango2_extents_to_pixels (&ext, NULL);
cairo_move_to (cr, - ext.width / 2, - RADIUS * .9);
- pango_cairo_show_layout (cr, layout);
+ pango2_cairo_show_layout (cr, layout);
/* Rotate for the next turn */
cairo_rotate (cr, G_PI*2 / N_WORDS);
}
/* free the objects we created */
- pango_font_description_free (desc);
+ pango2_font_description_free (desc);
g_object_unref (layout);
g_object_unref (context);
cairo_pattern_destroy (pattern);
@@ -205,8 +205,8 @@ do_rotated_text (GtkWidget *do_widget)
GtkWidget *box;
GtkWidget *drawing_area;
GtkWidget *label;
- PangoAttribute *attr;
- PangoAttrList *attrs;
+ Pango2Attribute *attr;
+ Pango2AttrList *attrs;
setup_fontmap ();
@@ -232,11 +232,11 @@ do_rotated_text (GtkWidget *do_widget)
/* And a label */
label = gtk_label_new (text);
- attrs = pango_attr_list_new ();
- attr = pango_attr_font_desc_new (pango_font_description_from_string (FONT));
- pango_attr_list_insert (attrs, attr);
+ attrs = pango2_attr_list_new ();
+ attr = pango2_attr_font_desc_new (pango2_font_description_from_string (FONT));
+ pango2_attr_list_insert (attrs, attr);
gtk_label_set_attributes (GTK_LABEL (label), attrs);
- pango_attr_list_unref (attrs);
+ pango2_attr_list_unref (attrs);
gtk_box_append (GTK_BOX (box), label);
}
diff --git a/demos/gtk-demo/tabs.c b/demos/gtk-demo/tabs.c
index b9db82f333..fa6bfb5c79 100644
--- a/demos/gtk-demo/tabs.c
+++ b/demos/gtk-demo/tabs.c
@@ -21,7 +21,7 @@ do_tabs (GtkWidget *do_widget)
GtkWidget *view;
GtkWidget *sw;
GtkTextBuffer *buffer;
- PangoTabArray *tabs;
+ Pango2TabArray *tabs;
window = gtk_window_new ();
gtk_window_set_title (GTK_WINDOW (window), "Tabs");
@@ -38,13 +38,13 @@ do_tabs (GtkWidget *do_widget)
gtk_text_view_set_left_margin (GTK_TEXT_VIEW (view), 20);
gtk_text_view_set_right_margin (GTK_TEXT_VIEW (view), 20);
- tabs = pango_tab_array_new (3, TRUE);
- pango_tab_array_set_tab (tabs, 0, PANGO_TAB_LEFT, 0);
- pango_tab_array_set_tab (tabs, 1, PANGO_TAB_DECIMAL, 150);
- pango_tab_array_set_decimal_point (tabs, 1, '.');
- pango_tab_array_set_tab (tabs, 2, PANGO_TAB_RIGHT, 290);
+ tabs = pango2_tab_array_new (3, TRUE);
+ pango2_tab_array_set_tab (tabs, 0, PANGO2_TAB_LEFT, 0);
+ pango2_tab_array_set_tab (tabs, 1, PANGO2_TAB_DECIMAL, 150);
+ pango2_tab_array_set_decimal_point (tabs, 1, '.');
+ pango2_tab_array_set_tab (tabs, 2, PANGO2_TAB_RIGHT, 290);
gtk_text_view_set_tabs (GTK_TEXT_VIEW (view), tabs);
- pango_tab_array_free (tabs);
+ pango2_tab_array_free (tabs);
buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (view));
gtk_text_buffer_set_text (buffer, "one\t2.0\tthree\nfour\t5.555\tsix\nseven\t88.88\tnine", -1);
diff --git a/demos/gtk-demo/textmask.c b/demos/gtk-demo/textmask.c
index 60a81dc270..1bb088a0b6 100644
--- a/demos/gtk-demo/textmask.c
+++ b/demos/gtk-demo/textmask.c
@@ -1,6 +1,6 @@
/* Pango/Text Mask
*
- * This demo shows how to use PangoCairo to draw text with more than
+ * This demo shows how to use Pango to draw text with more than
* just a single color.
*/
@@ -15,18 +15,18 @@ draw_text (GtkDrawingArea *da,
gpointer data)
{
cairo_pattern_t *pattern;
- PangoLayout *layout;
- PangoFontDescription *desc;
+ Pango2Layout *layout;
+ Pango2FontDescription *desc;
cairo_save (cr);
layout = gtk_widget_create_pango_layout (GTK_WIDGET (da), "Pango power!\nPango power!\nPango power!");
- desc = pango_font_description_from_string ("sans bold 34");
- pango_layout_set_font_description (layout, desc);
- pango_font_description_free (desc);
+ desc = pango2_font_description_from_string ("sans bold 34");
+ pango2_layout_set_font_description (layout, desc);
+ pango2_font_description_free (desc);
cairo_move_to (cr, 30, 20);
- pango_cairo_layout_path (cr, layout);
+ pango2_cairo_layout_path (cr, layout);
g_object_unref (layout);
pattern = cairo_pattern_create_linear (0.0, 0.0, width, height);
diff --git a/demos/gtk-demo/textview.c b/demos/gtk-demo/textview.c
index 973183d8c4..9f00554751 100644
--- a/demos/gtk-demo/textview.c
+++ b/demos/gtk-demo/textview.c
@@ -36,25 +36,25 @@ create_tags (GtkTextBuffer *buffer)
*/
gtk_text_buffer_create_tag (buffer, "heading",
- "weight", PANGO_WEIGHT_BOLD,
- "size", 15 * PANGO_SCALE,
+ "weight", PANGO2_WEIGHT_BOLD,
+ "size", 15 * PANGO2_SCALE,
NULL);
gtk_text_buffer_create_tag (buffer, "italic",
- "style", PANGO_STYLE_ITALIC, NULL);
+ "style", PANGO2_STYLE_ITALIC, NULL);
gtk_text_buffer_create_tag (buffer, "bold",
- "weight", PANGO_WEIGHT_BOLD, NULL);
+ "weight", PANGO2_WEIGHT_BOLD, NULL);
gtk_text_buffer_create_tag (buffer, "big",
- /* points times the PANGO_SCALE factor */
- "size", 20 * PANGO_SCALE, NULL);
+ /* points times the PANGO2_SCALE factor */
+ "size", 20 * PANGO2_SCALE, NULL);
gtk_text_buffer_create_tag (buffer, "xx-small",
- "scale", PANGO_SCALE_XX_SMALL, NULL);
+ "scale", PANGO2_SCALE_XX_SMALL, NULL);
gtk_text_buffer_create_tag (buffer, "x-large",
- "scale", PANGO_SCALE_X_LARGE, NULL);
+ "scale", PANGO2_SCALE_X_LARGE, NULL);
gtk_text_buffer_create_tag (buffer, "monospace",
"family", "monospace", NULL);
@@ -100,19 +100,19 @@ create_tags (GtkTextBuffer *buffer)
"strikethrough", TRUE, NULL);
gtk_text_buffer_create_tag (buffer, "underline",
- "underline", PANGO_LINE_STYLE_SOLID, NULL);
+ "underline", PANGO2_LINE_STYLE_SOLID, NULL);
gtk_text_buffer_create_tag (buffer, "double_underline",
- "underline", PANGO_LINE_STYLE_DOUBLE, NULL);
+ "underline", PANGO2_LINE_STYLE_DOUBLE, NULL);
gtk_text_buffer_create_tag (buffer, "superscript",
- "rise", 10 * PANGO_SCALE, /* 10 pixels */
- "size", 8 * PANGO_SCALE, /* 8 points */
+ "rise", 10 * PANGO2_SCALE, /* 10 pixels */
+ "size", 8 * PANGO2_SCALE, /* 8 points */
NULL);
gtk_text_buffer_create_tag (buffer, "subscript",
- "rise", -10 * PANGO_SCALE, /* 10 pixels */
- "size", 8 * PANGO_SCALE, /* 8 points */
+ "rise", -10 * PANGO2_SCALE, /* 10 pixels */
+ "size", 8 * PANGO2_SCALE, /* 8 points */
NULL);
gtk_text_buffer_create_tag (buffer, "rtl_quote",
diff --git a/demos/icon-browser/iconbrowserapp.c b/demos/icon-browser/iconbrowserapp.c
index 7bfd84ff3e..c20f155195 100644
--- a/demos/icon-browser/iconbrowserapp.c
+++ b/demos/icon-browser/iconbrowserapp.c
@@ -70,8 +70,8 @@ about_activated (GSimpleAction *action,
glib_major_version,
glib_minor_version,
glib_micro_version);
- g_string_append_printf (s, "\tPango\t%s\n",
- pango_version_string ());
+ g_string_append_printf (s, "\tPango2\t%s\n",
+ pango2_version_string ());
g_string_append_printf (s, "\tGTK \t%d.%d.%d\n",
gtk_get_major_version (),
gtk_get_minor_version (),
diff --git a/demos/node-editor/node-editor-application.c b/demos/node-editor/node-editor-application.c
index 42a83e911a..80328ddb35 100644
--- a/demos/node-editor/node-editor-application.c
+++ b/demos/node-editor/node-editor-application.c
@@ -77,8 +77,8 @@ activate_about (GSimpleAction *action,
glib_major_version,
glib_minor_version,
glib_micro_version);
- g_string_append_printf (s, "\tPango\t%s\n",
- pango_version_string ());
+ g_string_append_printf (s, "\tPango2\t%s\n",
+ pango2_version_string ());
g_string_append_printf (s, "\tGTK \t%d.%d.%d\n",
gtk_get_major_version (),
gtk_get_minor_version (),
diff --git a/demos/node-editor/node-editor-window.c b/demos/node-editor/node-editor-window.c
index c792b45d0d..0ef2ceee40 100644
--- a/demos/node-editor/node-editor-window.c
+++ b/demos/node-editor/node-editor-window.c
@@ -365,13 +365,13 @@ static void
load_error (NodeEditorWindow *self,
const char *error_message)
{
- PangoLayout *layout;
+ Pango2Layout *layout;
GtkSnapshot *snapshot;
GskRenderNode *node;
GBytes *bytes;
layout = gtk_widget_create_pango_layout (GTK_WIDGET (self), error_message);
- pango_layout_set_width (layout, 300 * PANGO_SCALE);
+ pango2_layout_set_width (layout, 300 * PANGO2_SCALE);
snapshot = gtk_snapshot_new ();
gtk_snapshot_append_layout (snapshot, layout, &(GdkRGBA) { 0.7, 0.13, 0.13, 1.0 });
node = gtk_snapshot_free_to_node (snapshot);
@@ -1060,7 +1060,7 @@ node_editor_window_init (NodeEditorWindow *self)
gtk_text_tag_table_add (self->tag_table,
g_object_new (GTK_TYPE_TEXT_TAG,
"name", "error",
- "underline", PANGO_LINE_STYLE_DOTTED,
+ "underline", PANGO2_LINE_STYLE_DOTTED,
NULL));
gtk_text_tag_table_add (self->tag_table,
g_object_new (GTK_TYPE_TEXT_TAG,
diff --git a/demos/print-editor/print-editor.c b/demos/print-editor/print-editor.c
index 344c06b018..d2101babed 100644
--- a/demos/print-editor/print-editor.c
+++ b/demos/print-editor/print-editor.c
@@ -1,6 +1,6 @@
#include <config.h>
#include <math.h>
-#include <pango/pangocairo.h>
+#include <pango2/pangocairo.h>
#include <glib/gi18n.h>
#include <gtk/gtk.h>
@@ -200,7 +200,7 @@ save_file (GFile *save_filename)
typedef struct {
char *text;
- PangoLayout *layout;
+ Pango2Layout *layout;
GList *page_breaks;
GtkWidget *font_button;
char *font;
@@ -211,9 +211,9 @@ begin_print (GtkPrintOperation *operation,
GtkPrintContext *context,
PrintData *print_data)
{
- PangoFontDescription *desc;
- PangoLines *lines;
- PangoLine *line;
+ Pango2FontDescription *desc;
+ Pango2Lines *lines;
+ Pango2Line *line;
double width, height;
double page_height;
GList *page_breaks;
@@ -225,27 +225,27 @@ begin_print (GtkPrintOperation *operation,
print_data->layout = gtk_print_context_create_pango_layout (context);
- desc = pango_font_description_from_string (print_data->font);
- pango_layout_set_font_description (print_data->layout, desc);
- pango_font_description_free (desc);
+ desc = pango2_font_description_from_string (print_data->font);
+ pango2_layout_set_font_description (print_data->layout, desc);
+ pango2_font_description_free (desc);
- pango_layout_set_width (print_data->layout, width * PANGO_SCALE);
+ pango2_layout_set_width (print_data->layout, width * PANGO2_SCALE);
- pango_layout_set_text (print_data->layout, print_data->text, -1);
+ pango2_layout_set_text (print_data->layout, print_data->text, -1);
- lines = pango_layout_get_lines (print_data->layout);
- num_lines = pango_lines_get_line_count (lines);
+ lines = pango2_layout_get_lines (print_data->layout);
+ num_lines = pango2_lines_get_line_count (lines);
page_breaks = NULL;
page_height = 0;
for (i = 0; i < num_lines; i++)
{
- PangoRectangle logical_rect;
+ Pango2Rectangle logical_rect;
double line_height;
- line = pango_lines_get_lines (lines)[i];
- pango_line_get_extents (line, NULL, &logical_rect);
+ line = pango2_lines_get_lines (lines)[i];
+ pango2_line_get_extents (line, NULL, &logical_rect);
line_height = logical_rect.height / 1024.0;
@@ -273,7 +273,7 @@ draw_page (GtkPrintOperation *operation,
cairo_t *cr;
GList *pagebreak;
int start, end, i;
- PangoLineIter *iter;
+ Pango2LineIter *iter;
double start_pos;
if (page_nr == 0)
@@ -286,7 +286,7 @@ draw_page (GtkPrintOperation *operation,
pagebreak = g_list_nth (print_data->page_breaks, page_nr);
if (pagebreak == NULL)
- end = pango_lines_get_line_count (pango_layout_get_lines (print_data->layout));
+ end = pango2_lines_get_line_count (pango2_layout_get_lines (print_data->layout));
else
end = GPOINTER_TO_INT (pagebreak->data);
@@ -296,33 +296,33 @@ draw_page (GtkPrintOperation *operation,
i = 0;
start_pos = 0;
- iter = pango_layout_get_iter (print_data->layout);
+ iter = pango2_layout_get_iter (print_data->layout);
do
{
- PangoRectangle logical_rect;
- PangoLine *line;
+ Pango2Rectangle logical_rect;
+ Pango2Line *line;
int baseline;
if (i >= start)
{
- line = pango_line_iter_get_line (iter);
+ line = pango2_line_iter_get_line (iter);
- pango_line_iter_get_line_extents (iter, NULL, &logical_rect);
- baseline = pango_line_iter_get_line_baseline (iter);
+ pango2_line_iter_get_line_extents (iter, NULL, &logical_rect);
+ baseline = pango2_line_iter_get_line_baseline (iter);
if (i == start)
start_pos = logical_rect.y / 1024.0;
cairo_move_to (cr, logical_rect.x / 1024.0, baseline / 1024.0 - start_pos);
- pango_cairo_show_line (cr, line);
+ pango2_cairo_show_line (cr, line);
}
i++;
}
while (i < end &&
- pango_line_iter_next_line (iter));
+ pango2_line_iter_next_line (iter));
- pango_line_iter_free (iter);
+ pango2_line_iter_free (iter);
}
static void
@@ -628,8 +628,8 @@ activate_about (GSimpleAction *action,
glib_major_version,
glib_minor_version,
glib_micro_version);
- g_string_append_printf (sysinfo, "\tPango\t%s\n",
- pango_version_string ());
+ g_string_append_printf (sysinfo, "\tPango2\t%s\n",
+ pango2_version_string ());
g_string_append_printf (sysinfo, "\tGTK \t%d.%d.%d\n",
gtk_get_major_version (),
gtk_get_minor_version (),
diff --git a/demos/widget-factory/widget-factory.c b/demos/widget-factory/widget-factory.c
index b2adc2b1b7..45c5e355fa 100644
--- a/demos/widget-factory/widget-factory.c
+++ b/demos/widget-factory/widget-factory.c
@@ -296,8 +296,8 @@ activate_about (GSimpleAction *action,
glib_major_version,
glib_minor_version,
glib_micro_version);
- g_string_append_printf (s, "\tPango\t%s\n",
- pango_version_string ());
+ g_string_append_printf (s, "\tPango2\t%s\n",
+ pango2_version_string ());
g_string_append_printf (s, "\tGTK \t%d.%d.%d\n",
gtk_get_major_version (),
gtk_get_minor_version (),
diff --git a/gdk/broadway/gdkkeys-broadway.c b/gdk/broadway/gdkkeys-broadway.c
index 5ed9d2b352..2d955c9fca 100644
--- a/gdk/broadway/gdkkeys-broadway.c
+++ b/gdk/broadway/gdkkeys-broadway.c
@@ -90,10 +90,10 @@ _gdk_broadway_display_get_keymap (GdkDisplay *display)
return broadway_display->keymap;
}
-static PangoDirection
+static Pango2Direction
gdk_broadway_keymap_get_direction (GdkKeymap *keymap)
{
- return PANGO_DIRECTION_NEUTRAL;
+ return PANGO2_DIRECTION_NEUTRAL;
}
static gboolean
diff --git a/gdk/gdk-private.h b/gdk/gdk-private.h
index 1100087775..c6c0548fa1 100644
--- a/gdk/gdk-private.h
+++ b/gdk/gdk-private.h
@@ -28,8 +28,8 @@ gboolean gdk_should_use_portal (void);
const char * gdk_get_startup_notification_id (void);
-PangoDirection gdk_unichar_direction (gunichar ch) G_GNUC_CONST;
-PangoDirection gdk_find_base_dir (const char *text,
+Pango2Direction gdk_unichar_direction (gunichar ch) G_GNUC_CONST;
+Pango2Direction gdk_find_base_dir (const char *text,
int len);
typedef struct
diff --git a/gdk/gdk.c b/gdk/gdk.c
index 4d3e4eb5b6..a7de167622 100644
--- a/gdk/gdk.c
+++ b/gdk/gdk.c
@@ -370,7 +370,7 @@ gdk_should_use_portal (void)
return FALSE;
}
-PangoDirection
+Pango2Direction
gdk_unichar_direction (gunichar ch)
{
FriBidiCharType fribidi_ch_type;
@@ -380,21 +380,21 @@ gdk_unichar_direction (gunichar ch)
fribidi_ch_type = fribidi_get_bidi_type (ch);
if (!FRIBIDI_IS_STRONG (fribidi_ch_type))
- return PANGO_DIRECTION_NEUTRAL;
+ return PANGO2_DIRECTION_NEUTRAL;
else if (FRIBIDI_IS_RTL (fribidi_ch_type))
- return PANGO_DIRECTION_RTL;
+ return PANGO2_DIRECTION_RTL;
else
- return PANGO_DIRECTION_LTR;
+ return PANGO2_DIRECTION_LTR;
}
-PangoDirection
+Pango2Direction
gdk_find_base_dir (const char *text,
int length)
{
- PangoDirection dir = PANGO_DIRECTION_NEUTRAL;
+ Pango2Direction dir = PANGO2_DIRECTION_NEUTRAL;
const char *p;
- g_return_val_if_fail (text != NULL || length == 0, PANGO_DIRECTION_NEUTRAL);
+ g_return_val_if_fail (text != NULL || length == 0, PANGO2_DIRECTION_NEUTRAL);
p = text;
while ((length < 0 || p < text + length) && *p)
@@ -403,7 +403,7 @@ gdk_find_base_dir (const char *text,
dir = gdk_unichar_direction (wc);
- if (dir != PANGO_DIRECTION_NEUTRAL)
+ if (dir != PANGO2_DIRECTION_NEUTRAL)
break;
p = g_utf8_next_char (p);
diff --git a/gdk/gdkdevice.c b/gdk/gdkdevice.c
index c4473852c4..e893b0d37d 100644
--- a/gdk/gdkdevice.c
+++ b/gdk/gdkdevice.c
@@ -229,7 +229,7 @@ gdk_device_class_init (GdkDeviceClass *klass)
*/
device_props[PROP_DIRECTION] =
g_param_spec_enum ("direction", NULL, NULL,
- PANGO_TYPE_DIRECTION, PANGO_DIRECTION_NEUTRAL,
+ PANGO2_TYPE_DIRECTION, PANGO2_DIRECTION_NEUTRAL,
G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
/**
@@ -1309,13 +1309,13 @@ gdk_device_get_modifier_state (GdkDevice *device)
* This is only relevant for keyboard devices.
*
* The direction of a layout is the direction of the majority
- * of its symbols. See [func@Pango.unichar_direction].
+ * of its symbols. See [func@Pango2.unichar_direction].
*
* Returns: %PANGO_DIRECTION_LTR or %PANGO_DIRECTION_RTL
* if it can determine the direction. %PANGO_DIRECTION_NEUTRAL
* otherwise
*/
-PangoDirection
+Pango2Direction
gdk_device_get_direction (GdkDevice *device)
{
GdkKeymap *keymap = gdk_display_get_keymap (device->display);
@@ -1323,7 +1323,7 @@ gdk_device_get_direction (GdkDevice *device)
if (device->source == GDK_SOURCE_KEYBOARD)
return gdk_keymap_get_direction (keymap);
- return PANGO_DIRECTION_NEUTRAL;
+ return PANGO2_DIRECTION_NEUTRAL;
}
/**
diff --git a/gdk/gdkkeys.c b/gdk/gdkkeys.c
index b06fec2dc6..50bc8df28b 100644
--- a/gdk/gdkkeys.c
+++ b/gdk/gdkkeys.c
@@ -309,14 +309,14 @@ gdk_keyval_is_lower (guint keyval)
* The direction of a layout is the direction of the majority of its
* symbols. See pango_unichar_direction().
*
- * Returns: %PANGO_DIRECTION_LTR or %PANGO_DIRECTION_RTL
- * if it can determine the direction. %PANGO_DIRECTION_NEUTRAL
+ * Returns: %PANGO2_DIRECTION_LTR or %PANGO2_DIRECTION_RTL
+ * if it can determine the direction. %PANGO2_DIRECTION_NEUTRAL
* otherwise.
*/
-PangoDirection
+Pango2Direction
gdk_keymap_get_direction (GdkKeymap *keymap)
{
- g_return_val_if_fail (GDK_IS_KEYMAP (keymap), PANGO_DIRECTION_LTR);
+ g_return_val_if_fail (GDK_IS_KEYMAP (keymap), PANGO2_DIRECTION_LTR);
return GDK_KEYMAP_GET_CLASS (keymap)->get_direction (keymap);
}
diff --git a/gdk/gdkkeysprivate.h b/gdk/gdkkeysprivate.h
index cc9b17aa9a..9b7b972770 100644
--- a/gdk/gdkkeysprivate.h
+++ b/gdk/gdkkeysprivate.h
@@ -38,7 +38,7 @@ struct _GdkKeymapClass
{
GObjectClass parent_class;
- PangoDirection (* get_direction) (GdkKeymap *keymap);
+ Pango2Direction (* get_direction) (GdkKeymap *keymap);
gboolean (* have_bidi_layouts) (GdkKeymap *keymap);
gboolean (* get_caps_lock_state) (GdkKeymap *keymap);
gboolean (* get_num_lock_state) (GdkKeymap *keymap);
@@ -111,7 +111,7 @@ gboolean gdk_keymap_get_entries_for_keycode (GdkKeymap *keymap,
guint **keyvals,
int *n_entries);
-PangoDirection gdk_keymap_get_direction (GdkKeymap *keymap);
+Pango2Direction gdk_keymap_get_direction (GdkKeymap *keymap);
gboolean gdk_keymap_have_bidi_layouts (GdkKeymap *keymap);
gboolean gdk_keymap_get_caps_lock_state (GdkKeymap *keymap);
gboolean gdk_keymap_get_num_lock_state (GdkKeymap *keymap);
diff --git a/gdk/gdkpango.c b/gdk/gdkpango.c
index e6836e9aa0..3991e2b25f 100644
--- a/gdk/gdkpango.c
+++ b/gdk/gdkpango.c
@@ -22,7 +22,7 @@
#include "gdkintl.h"
#include <math.h>
-#include <pango/pangocairo.h>
+#include <pango2/pangocairo.h>
/* Get a clip region to draw only part of a layout. index_ranges
@@ -31,28 +31,28 @@
* region as clip, only the given ranges are drawn.
*/
static cairo_region_t *
-layout_iter_get_line_clip_region (PangoLineIter *iter,
+layout_iter_get_line_clip_region (Pango2LineIter *iter,
int x_origin,
int y_origin,
const int *index_ranges,
int n_ranges)
{
- PangoLines *lines;
- PangoLine *line;
+ Pango2Lines *lines;
+ Pango2Line *line;
cairo_region_t *clip_region;
- PangoRectangle logical_rect;
+ Pango2Rectangle logical_rect;
int baseline;
int i;
int start_index, length;
- lines = pango_line_iter_get_lines (iter);
- line = pango_line_iter_get_line (iter);
- pango_line_get_text (line, &start_index, &length);
+ lines = pango2_line_iter_get_lines (iter);
+ line = pango2_line_iter_get_line (iter);
+ pango2_line_get_text (line, &start_index, &length);
clip_region = cairo_region_create ();
- pango_line_iter_get_line_extents (iter, NULL, &logical_rect);
- baseline = pango_line_iter_get_line_baseline (iter);
+ pango2_line_iter_get_line_extents (iter, NULL, &logical_rect);
+ baseline = pango2_line_iter_get_line_baseline (iter);
i = 0;
while (i < n_ranges)
@@ -62,9 +62,9 @@ layout_iter_get_line_clip_region (PangoLineIter *iter,
int j;
/* Note that get_x_ranges returns layout coordinates */
- if (index_ranges[i*2+1] >= pango_line_get_start_index (line) &&
- index_ranges[i*2] < pango_line_get_start_index (line) + pango_line_get_length (line))
- pango_lines_get_x_ranges (lines,
+ if (index_ranges[i*2+1] >= pango2_line_get_start_index (line) &&
+ index_ranges[i*2] < pango2_line_get_start_index (line) + pango2_line_get_length (line))
+ pango2_lines_get_x_ranges (lines,
line,
NULL, index_ranges[i*2],
NULL, index_ranges[i*2+1],
@@ -75,13 +75,13 @@ layout_iter_get_line_clip_region (PangoLineIter *iter,
GdkRectangle rect;
int x_off, y_off;
- x_off = PANGO_PIXELS (pixel_ranges[2*j] - logical_rect.x);
- y_off = PANGO_PIXELS (baseline - logical_rect.y);
+ x_off = PANGO2_PIXELS (pixel_ranges[2*j] - logical_rect.x);
+ y_off = PANGO2_PIXELS (baseline - logical_rect.y);
rect.x = x_origin + x_off;
rect.y = y_origin - y_off;
- rect.width = PANGO_PIXELS (pixel_ranges[2*j + 1] - logical_rect.x) - x_off;
- rect.height = PANGO_PIXELS (baseline - logical_rect.y + logical_rect.height) - y_off;
+ rect.width = PANGO2_PIXELS (pixel_ranges[2*j + 1] - logical_rect.x) - x_off;
+ rect.height = PANGO2_PIXELS (baseline - logical_rect.y + logical_rect.height) - y_off;
cairo_region_union_rectangle (clip_region, &rect);
}
@@ -93,8 +93,8 @@ layout_iter_get_line_clip_region (PangoLineIter *iter,
}
/**
- * gdk_pango_layout_get_clip_region: (skip)
- * @layout: a `PangoLayout`
+ * gdk_pango2_layout_get_clip_region: (skip)
+ * @layout: a `Pango2Layout`
* @x_origin: X pixel where you intend to draw the layout with this clip
* @y_origin: Y pixel where you intend to draw the layout with this clip
* @index_ranges: array of byte indexes into the layout, where even members of array are start indexes and
odd elements are end indexes
@@ -114,43 +114,43 @@ layout_iter_get_line_clip_region (PangoLineIter *iter,
* Returns: a clip region containing the given ranges
*/
cairo_region_t *
-gdk_pango_layout_get_clip_region (PangoLayout *layout,
+gdk_pango_layout_get_clip_region (Pango2Layout *layout,
int x_origin,
int y_origin,
const int *index_ranges,
int n_ranges)
{
- PangoLineIter *iter;
+ Pango2LineIter *iter;
cairo_region_t *clip_region;
- g_return_val_if_fail (PANGO_IS_LAYOUT (layout), NULL);
+ g_return_val_if_fail (PANGO2_IS_LAYOUT (layout), NULL);
g_return_val_if_fail (index_ranges != NULL, NULL);
clip_region = cairo_region_create ();
- iter = pango_layout_get_iter (layout);
+ iter = pango2_layout_get_iter (layout);
do
{
- PangoRectangle logical_rect;
+ Pango2Rectangle logical_rect;
cairo_region_t *line_region;
int baseline;
- pango_line_iter_get_line_extents (iter, NULL, &logical_rect);
- baseline = pango_line_iter_get_line_baseline (iter);
+ pango2_line_iter_get_line_extents (iter, NULL, &logical_rect);
+ baseline = pango2_line_iter_get_line_baseline (iter);
line_region = layout_iter_get_line_clip_region (iter,
- x_origin + PANGO_PIXELS (logical_rect.x),
- y_origin + PANGO_PIXELS (baseline),
+ x_origin + PANGO2_PIXELS (logical_rect.x),
+ y_origin + PANGO2_PIXELS (baseline),
index_ranges,
n_ranges);
cairo_region_union (clip_region, line_region);
cairo_region_destroy (line_region);
}
- while (pango_line_iter_next_line (iter));
+ while (pango2_line_iter_next_line (iter));
- pango_line_iter_free (iter);
+ pango2_line_iter_free (iter);
return clip_region;
}
diff --git a/gdk/gdkrgba.c b/gdk/gdkrgba.c
index 118e04bdcc..9b26ac8659 100644
--- a/gdk/gdkrgba.c
+++ b/gdk/gdkrgba.c
@@ -223,12 +223,12 @@ gdk_rgba_parse (GdkRGBA *rgba,
}
else
{
- PangoColor pango_color;
+ Pango2Color pango_color;
- /* Resort on PangoColor for rgb.txt color
+ /* Resort on Pango2Color for rgb.txt color
* map and '#' prefixed colors
*/
- if (pango_color_parse (&pango_color, str))
+ if (pango2_color_parse (&pango_color, str))
{
if (rgba)
{
diff --git a/gdk/macos/gdkmacoskeymap.c b/gdk/macos/gdkmacoskeymap.c
index 5cf34d3ed3..639a03608c 100644
--- a/gdk/macos/gdkmacoskeymap.c
+++ b/gdk/macos/gdkmacoskeymap.c
@@ -380,7 +380,7 @@ gdk_macos_keymap_update (GdkMacosKeymap *self)
g_signal_emit_by_name (self, "keys-changed");
}
-static PangoDirection
+static Pango2Direction
gdk_macos_keymap_get_direction (GdkKeymap *keymap)
{
return PANGO_DIRECTION_NEUTRAL;
diff --git a/gdk/wayland/gdkdevice-wayland.c b/gdk/wayland/gdkdevice-wayland.c
index 2d192f8550..896df7cb02 100644
--- a/gdk/wayland/gdkdevice-wayland.c
+++ b/gdk/wayland/gdkdevice-wayland.c
@@ -1925,7 +1925,7 @@ keyboard_handle_keymap (void *data,
uint32_t size)
{
GdkWaylandSeat *seat = data;
- PangoDirection direction;
+ Pango2Direction direction;
gboolean bidi;
gboolean caps_lock;
gboolean num_lock;
@@ -2297,7 +2297,7 @@ keyboard_handle_modifiers (void *data,
GdkWaylandSeat *seat = data;
GdkKeymap *keymap;
struct xkb_state *xkb_state;
- PangoDirection direction;
+ Pango2Direction direction;
gboolean bidi;
gboolean caps_lock;
gboolean num_lock;
diff --git a/gdk/wayland/gdkkeys-wayland.c b/gdk/wayland/gdkkeys-wayland.c
index fdd534dbd3..1895dfdf6e 100644
--- a/gdk/wayland/gdkkeys-wayland.c
+++ b/gdk/wayland/gdkkeys-wayland.c
@@ -51,7 +51,7 @@ struct _GdkWaylandKeymap
struct xkb_keymap *xkb_keymap;
struct xkb_state *xkb_state;
- PangoDirection *direction;
+ Pango2Direction *direction;
gboolean bidi;
};
@@ -80,7 +80,7 @@ gdk_wayland_keymap_finalize (GObject *object)
G_OBJECT_CLASS (_gdk_wayland_keymap_parent_class)->finalize (object);
}
-static PangoDirection
+static Pango2Direction
gdk_wayland_keymap_get_direction (GdkKeymap *keymap)
{
GdkWaylandKeymap *keymap_wayland = GDK_WAYLAND_KEYMAP (keymap);
@@ -92,7 +92,7 @@ gdk_wayland_keymap_get_direction (GdkKeymap *keymap)
return keymap_wayland->direction[i];
}
- return PANGO_DIRECTION_NEUTRAL;
+ return PANGO2_DIRECTION_NEUTRAL;
}
static gboolean
@@ -399,7 +399,7 @@ update_direction (GdkWaylandKeymap *keymap)
num_layouts = xkb_keymap_num_layouts (keymap->xkb_keymap);
- keymap->direction = g_renew (PangoDirection, keymap->direction, num_layouts);
+ keymap->direction = g_renew (Pango2Direction, keymap->direction, num_layouts);
rtl = g_newa (int, num_layouts);
for (i = 0; i < num_layouts; i++)
rtl[i] = 0;
@@ -421,20 +421,20 @@ update_direction (GdkWaylandKeymap *keymap)
num_syms = xkb_keymap_key_get_syms_by_level (keymap->xkb_keymap, key, layout, 0, &syms);
for (sym = 0; sym < num_syms; sym++)
{
- PangoDirection dir;
+ Pango2Direction dir;
dir = gdk_unichar_direction (xkb_keysym_to_utf32 (syms[sym]));
switch (dir)
{
- case PANGO_DIRECTION_RTL:
+ case PANGO2_DIRECTION_RTL:
rtl[layout]++;
break;
- case PANGO_DIRECTION_LTR:
+ case PANGO2_DIRECTION_LTR:
rtl[layout]--;
break;
- case PANGO_DIRECTION_WEAK_LTR:
- case PANGO_DIRECTION_WEAK_RTL:
- case PANGO_DIRECTION_NEUTRAL:
+ case PANGO2_DIRECTION_WEAK_LTR:
+ case PANGO2_DIRECTION_WEAK_RTL:
+ case PANGO2_DIRECTION_NEUTRAL:
default:
break;
}
@@ -447,12 +447,12 @@ update_direction (GdkWaylandKeymap *keymap)
{
if (rtl[i] > 0)
{
- keymap->direction[i] = PANGO_DIRECTION_RTL;
+ keymap->direction[i] = PANGO2_DIRECTION_RTL;
have_rtl = TRUE;
}
else
{
- keymap->direction[i] = PANGO_DIRECTION_LTR;
+ keymap->direction[i] = PANGO2_DIRECTION_LTR;
have_ltr = TRUE;
}
}
diff --git a/gdk/win32/gdkkeys-win32.c b/gdk/win32/gdkkeys-win32.c
index eed0d8fd23..9c70eee483 100644
--- a/gdk/win32/gdkkeys-win32.c
+++ b/gdk/win32/gdkkeys-win32.c
@@ -720,7 +720,7 @@ _gdk_win32_keymap_get_mod_mask (GdkWin32Keymap *keymap)
return mod_bits_to_gdk_mod_mask (mod_bits);
}
-static PangoDirection
+static Pango2Direction
get_hkl_direction (HKL hkl)
{
switch (PRIMARYLANGID (LOWORD ((DWORD) (gintptr) hkl)))
@@ -739,7 +739,7 @@ get_hkl_direction (HKL hkl)
}
}
-static PangoDirection
+static Pango2Direction
gdk_win32_keymap_get_direction (GdkKeymap *gdk_keymap)
{
GdkWin32Keymap *keymap;
diff --git a/gdk/win32/gdkproperty-win32.c b/gdk/win32/gdkproperty-win32.c
index f919e53e9c..0debd4dacb 100644
--- a/gdk/win32/gdkproperty-win32.c
+++ b/gdk/win32/gdkproperty-win32.c
@@ -37,7 +37,7 @@ static char *
_get_system_font_name (HDC hdc)
{
NONCLIENTMETRICSW ncm;
- PangoFontDescription *font_desc;
+ Pango2FontDescription *font_desc;
char *result, *font_desc_string;
int logpixelsy;
int font_size;
diff --git a/gdk/x11/gdkkeys-x11.c b/gdk/x11/gdkkeys-x11.c
index d513fccb89..dafd18251d 100644
--- a/gdk/x11/gdkkeys-x11.c
+++ b/gdk/x11/gdkkeys-x11.c
@@ -55,7 +55,7 @@ typedef struct _DirectionCacheEntry DirectionCacheEntry;
struct _DirectionCacheEntry
{
guint serial;
- PangoDirection direction;
+ Pango2Direction direction;
Atom group_atom;
};
@@ -73,7 +73,7 @@ struct _GdkX11Keymap
GdkModifierType num_lock_mask;
GdkModifierType scroll_lock_mask;
GdkModifierType modmap[8];
- PangoDirection current_direction;
+ Pango2Direction current_direction;
guint have_direction : 1;
guint have_lock_state : 1;
guint caps_lock_state : 1;
@@ -470,7 +470,7 @@ get_keymap (GdkX11Keymap *keymap_x11)
}
#ifdef HAVE_XKB
-static PangoDirection
+static Pango2Direction
get_direction (XkbDescRec *xkb,
int group)
{
@@ -482,31 +482,31 @@ get_direction (XkbDescRec *xkb,
{
int level = 0;
KeySym sym = XkbKeySymEntry (xkb, code, level, group);
- PangoDirection dir = gdk_unichar_direction (gdk_keyval_to_unicode (sym));
+ Pango2Direction dir = gdk_unichar_direction (gdk_keyval_to_unicode (sym));
switch (dir)
{
- case PANGO_DIRECTION_RTL:
+ case PANGO2_DIRECTION_RTL:
rtl_minus_ltr++;
break;
- case PANGO_DIRECTION_LTR:
+ case PANGO2_DIRECTION_LTR:
rtl_minus_ltr--;
break;
- case PANGO_DIRECTION_WEAK_LTR:
- case PANGO_DIRECTION_WEAK_RTL:
- case PANGO_DIRECTION_NEUTRAL:
+ case PANGO2_DIRECTION_WEAK_LTR:
+ case PANGO2_DIRECTION_WEAK_RTL:
+ case PANGO2_DIRECTION_NEUTRAL:
default:
break;
}
}
if (rtl_minus_ltr > 0)
- return PANGO_DIRECTION_RTL;
+ return PANGO2_DIRECTION_RTL;
else
- return PANGO_DIRECTION_LTR;
+ return PANGO2_DIRECTION_LTR;
}
-static PangoDirection
+static Pango2Direction
get_direction_from_cache (GdkX11Keymap *keymap_x11,
XkbDescPtr xkb,
int group)
@@ -516,7 +516,7 @@ get_direction_from_cache (GdkX11Keymap *keymap_x11,
gboolean cache_hit = FALSE;
DirectionCacheEntry *cache = keymap_x11->group_direction_cache;
- PangoDirection direction = PANGO_DIRECTION_NEUTRAL;
+ Pango2Direction direction = PANGO2_DIRECTION_NEUTRAL;
int i;
if (keymap_x11->have_direction)
@@ -586,7 +586,7 @@ update_direction (GdkX11Keymap *keymap_x11,
XkbDescPtr xkb = get_xkb (keymap_x11);
Atom group_atom;
gboolean had_direction;
- PangoDirection old_direction;
+ Pango2Direction old_direction;
had_direction = keymap_x11->have_direction;
old_direction = keymap_x11->current_direction;
@@ -719,7 +719,7 @@ _gdk_x11_keymap_keys_changed (GdkDisplay *display)
g_signal_emit_by_name (display_x11->keymap, "keys_changed", 0);
}
-static PangoDirection
+static Pango2Direction
gdk_x11_keymap_get_direction (GdkKeymap *keymap)
{
#ifdef HAVE_XKB
@@ -744,7 +744,7 @@ gdk_x11_keymap_get_direction (GdkKeymap *keymap)
}
else
#endif /* HAVE_XKB */
- return PANGO_DIRECTION_NEUTRAL;
+ return PANGO2_DIRECTION_NEUTRAL;
}
static gboolean
@@ -763,7 +763,7 @@ gdk_x11_keymap_have_bidi_layouts (GdkKeymap *keymap)
for (i = 0; i < num_groups; i++)
{
- if (get_direction_from_cache (keymap_x11, xkb, i) == PANGO_DIRECTION_RTL)
+ if (get_direction_from_cache (keymap_x11, xkb, i) == PANGO2_DIRECTION_RTL)
have_rtl_keyboard = TRUE;
else
have_ltr_keyboard = TRUE;
diff --git a/gdk/x11/gdkxftdefaults.c b/gdk/x11/gdkxftdefaults.c
index 2e745627ff..53bf766855 100644
--- a/gdk/x11/gdkxftdefaults.c
+++ b/gdk/x11/gdkxftdefaults.c
@@ -188,7 +188,7 @@ init_xft_settings (GdkX11Screen *x11_screen)
if (!get_double_default (x11_screen, "dpi", &dpi_double))
dpi_double = 96.0;
- x11_screen->xft_dpi = (int)(0.5 + PANGO_SCALE * dpi_double);
+ x11_screen->xft_dpi = (int)(0.5 + PANGO2_SCALE * dpi_double);
}
gboolean
diff --git a/gsk/gl/gskglglyphlibrary.c b/gsk/gl/gskglglyphlibrary.c
index 58e34bc938..298f36497c 100644
--- a/gsk/gl/gskglglyphlibrary.c
+++ b/gsk/gl/gskglglyphlibrary.c
@@ -215,8 +215,8 @@ render_glyph (cairo_surface_t *surface,
const GskGLGlyphValue *value)
{
cairo_t *cr;
- PangoGlyphString glyph_string;
- PangoGlyphInfo glyph_info;
+ Pango2GlyphString glyph_string;
+ Pango2GlyphInfo glyph_info;
g_assert (surface != NULL);
@@ -231,7 +231,7 @@ render_glyph (cairo_surface_t *surface,
glyph_string.num_glyphs = 1;
glyph_string.glyphs = &glyph_info;
- pango_cairo_show_glyph_string (cr, key->font, &glyph_string);
+ pango2_cairo_show_glyph_string (cr, key->font, &glyph_string);
cairo_destroy (cr);
cairo_surface_flush (surface);
@@ -323,7 +323,7 @@ gsk_gl_glyph_library_add (GskGLGlyphLibrary *self,
const GskGLGlyphValue **out_value)
{
GskGLTextureLibrary *tl = (GskGLTextureLibrary *)self;
- PangoRectangle ink_rect;
+ Pango2Rectangle ink_rect;
GskGLGlyphValue *value;
int width;
int height;
@@ -334,8 +334,8 @@ gsk_gl_glyph_library_add (GskGLGlyphLibrary *self,
g_assert (key != NULL);
g_assert (out_value != NULL);
- pango_font_get_glyph_extents (key->font, key->glyph, &ink_rect, NULL);
- pango_extents_to_pixels (&ink_rect, NULL);
+ pango2_font_get_glyph_extents (key->font, key->glyph, &ink_rect, NULL);
+ pango2_extents_to_pixels (&ink_rect, NULL);
ink_rect.x -= 1;
ink_rect.width += 2;
diff --git a/gsk/gl/gskglglyphlibraryprivate.h b/gsk/gl/gskglglyphlibraryprivate.h
index 2ed051358e..433b9ab298 100644
--- a/gsk/gl/gskglglyphlibraryprivate.h
+++ b/gsk/gl/gskglglyphlibraryprivate.h
@@ -21,7 +21,7 @@
#ifndef __GSK_GL_GLYPH_LIBRARY_PRIVATE_H__
#define __GSK_GL_GLYPH_LIBRARY_PRIVATE_H__
-#include <pango/pango.h>
+#include <pango2/pango.h>
#include "gskgltexturelibraryprivate.h"
@@ -31,8 +31,8 @@ G_BEGIN_DECLS
typedef struct _GskGLGlyphKey
{
- PangoFont *font;
- PangoGlyph glyph;
+ Pango2Font *font;
+ Pango2Glyph glyph;
guint xshift : 2;
guint yshift : 2;
guint scale : 28; /* times 1024 */
@@ -41,7 +41,7 @@ typedef struct _GskGLGlyphKey
typedef struct _GskGLGlyphValue
{
GskGLTextureAtlasEntry entry;
- PangoRectangle ink_rect;
+ Pango2Rectangle ink_rect;
} GskGLGlyphValue;
#if GLIB_SIZEOF_VOID_P == 8
diff --git a/gsk/gl/gskgliconlibraryprivate.h b/gsk/gl/gskgliconlibraryprivate.h
index 8c34aec2f1..1ab819fd64 100644
--- a/gsk/gl/gskgliconlibraryprivate.h
+++ b/gsk/gl/gskgliconlibraryprivate.h
@@ -21,7 +21,7 @@
#ifndef __GSK_GL_ICON_LIBRARY_PRIVATE_H__
#define __GSK_GL_ICON_LIBRARY_PRIVATE_H__
-#include <pango/pango.h>
+#include <pango2/pango.h>
#include "gskgltexturelibraryprivate.h"
diff --git a/gsk/gl/gskglrenderjob.c b/gsk/gl/gskglrenderjob.c
index 97b3d9d4c9..7db1168bc3 100644
--- a/gsk/gl/gskglrenderjob.c
+++ b/gsk/gl/gskglrenderjob.c
@@ -2935,8 +2935,8 @@ gsk_gl_render_job_visit_text_node (GskGLRenderJob *job,
const GdkRGBA *color,
gboolean force_color)
{
- const PangoFont *font = gsk_text_node_get_font (node);
- const PangoGlyphInfo *glyphs = gsk_text_node_get_glyphs (node, NULL);
+ const Pango2Font *font = gsk_text_node_get_font (node);
+ const Pango2GlyphInfo *glyphs = gsk_text_node_get_glyphs (node, NULL);
const graphene_point_t *offset = gsk_text_node_get_offset (node);
float text_scale = MAX (job->scale_x, job->scale_y); /* TODO: Fix for uneven scales? */
guint num_glyphs = gsk_text_node_get_num_glyphs (node);
@@ -2952,7 +2952,7 @@ gsk_gl_render_job_visit_text_node (GskGLRenderJob *job,
guint16 nc[4] = { FP16_MINUS_ONE, FP16_MINUS_ONE, FP16_MINUS_ONE, FP16_MINUS_ONE };
guint16 cc[4];
const guint16 *c;
- const PangoGlyphInfo *gi;
+ const Pango2GlyphInfo *gi;
guint i;
int yshift;
float ypos;
@@ -2966,7 +2966,7 @@ gsk_gl_render_job_visit_text_node (GskGLRenderJob *job,
rgba_to_half (color, cc);
- lookup.font = (PangoFont *)font;
+ lookup.font = (Pango2Font *)font;
lookup.scale = (guint) (text_scale * 1024);
yshift = compute_phase_and_pos (y, &ypos);
@@ -2996,12 +2996,12 @@ gsk_gl_render_job_visit_text_node (GskGLRenderJob *job,
else
c = cc;
- cx = (float)(x_position + gi->geometry.x_offset) / PANGO_SCALE;
+ cx = (float)(x_position + gi->geometry.x_offset) / PANGO2_SCALE;
lookup.xshift = compute_phase_and_pos (x + cx, &cx);
if G_UNLIKELY (gi->geometry.y_offset != 0)
{
- cy = (float)(gi->geometry.y_offset) / PANGO_SCALE;
+ cy = (float)(gi->geometry.y_offset) / PANGO2_SCALE;
lookup.yshift = compute_phase_and_pos (y + cy, &cy);
}
else
diff --git a/gsk/gskprivate.c b/gsk/gskprivate.c
index d9e1c3e30f..4ba4889dca 100644
--- a/gsk/gskprivate.c
+++ b/gsk/gskprivate.c
@@ -17,17 +17,17 @@ gsk_ensure_resources (void)
}
int
-pango_glyph_string_num_glyphs (PangoGlyphString *glyphs)
+pango_glyph_string_num_glyphs (Pango2GlyphString *glyphs)
{
int i, count;
count = 0;
for (i = 0; i < glyphs->num_glyphs; i++)
{
- PangoGlyphInfo *gi = &glyphs->glyphs[i];
- if (gi->glyph != PANGO_GLYPH_EMPTY)
+ Pango2GlyphInfo *gi = &glyphs->glyphs[i];
+ if (gi->glyph != PANGO2_GLYPH_EMPTY)
{
- if (!(gi->glyph & PANGO_GLYPH_UNKNOWN_FLAG))
+ if (!(gi->glyph & PANGO2_GLYPH_UNKNOWN_FLAG))
count++;
}
}
diff --git a/gsk/gskprivate.h b/gsk/gskprivate.h
index 77c0fe2bf6..dcfb825126 100644
--- a/gsk/gskprivate.h
+++ b/gsk/gskprivate.h
@@ -2,13 +2,13 @@
#define __GSK_PRIVATE_H__
#include <glib.h>
-#include <pango/pango.h>
+#include <pango2/pango.h>
G_BEGIN_DECLS
void gsk_ensure_resources (void);
-int pango_glyph_string_num_glyphs (PangoGlyphString *glyphs) G_GNUC_PURE;
+int pango_glyph_string_num_glyphs (Pango2GlyphString *glyphs) G_GNUC_PURE;
typedef struct _GskVulkanRender GskVulkanRender;
typedef struct _GskVulkanRenderPass GskVulkanRenderPass;
diff --git a/gsk/gskrendernode.h b/gsk/gskrendernode.h
index ba05d606f9..23da2cf8a6 100644
--- a/gsk/gskrendernode.h
+++ b/gsk/gskrendernode.h
@@ -488,18 +488,18 @@ float gsk_cross_fade_node_get_progress (const GskRender
GDK_AVAILABLE_IN_ALL
GType gsk_text_node_get_type (void) G_GNUC_CONST;
GDK_AVAILABLE_IN_ALL
-GskRenderNode * gsk_text_node_new (PangoFont *font,
- PangoGlyphString *glyphs,
+GskRenderNode * gsk_text_node_new (Pango2Font *font,
+ Pango2GlyphString *glyphs,
const GdkRGBA *color,
const graphene_point_t *offset);
GDK_AVAILABLE_IN_ALL
-PangoFont * gsk_text_node_get_font (const GskRenderNode *node) G_GNUC_PURE;
+Pango2Font * gsk_text_node_get_font (const GskRenderNode *node)
G_GNUC_PURE;
GDK_AVAILABLE_IN_4_2
gboolean gsk_text_node_has_color_glyphs (const GskRenderNode *node) G_GNUC_PURE;
GDK_AVAILABLE_IN_ALL
guint gsk_text_node_get_num_glyphs (const GskRenderNode *node) G_GNUC_PURE;
GDK_AVAILABLE_IN_ALL
-const PangoGlyphInfo *gsk_text_node_get_glyphs (const GskRenderNode *node,
+const Pango2GlyphInfo *gsk_text_node_get_glyphs (const GskRenderNode *node,
guint *n_glyphs)
G_GNUC_PURE;
GDK_AVAILABLE_IN_ALL
const GdkRGBA * gsk_text_node_get_color (const GskRenderNode *node) G_GNUC_PURE;
diff --git a/gsk/gskrendernodeimpl.c b/gsk/gskrendernodeimpl.c
index 175c458848..ddab76efeb 100644
--- a/gsk/gskrendernodeimpl.c
+++ b/gsk/gskrendernodeimpl.c
@@ -4406,14 +4406,14 @@ struct _GskTextNode
{
GskRenderNode render_node;
- PangoFont *font;
+ Pango2Font *font;
gboolean has_color_glyphs;
GdkRGBA color;
graphene_point_t offset;
guint num_glyphs;
- PangoGlyphInfo *glyphs;
+ Pango2GlyphInfo *glyphs;
};
static void
@@ -4433,7 +4433,7 @@ gsk_text_node_draw (GskRenderNode *node,
cairo_t *cr)
{
GskTextNode *self = (GskTextNode *) node;
- PangoGlyphString glyphs;
+ Pango2GlyphString glyphs;
glyphs.num_glyphs = self->num_glyphs;
glyphs.glyphs = self->glyphs;
@@ -4443,7 +4443,7 @@ gsk_text_node_draw (GskRenderNode *node,
gdk_cairo_set_source_rgba (cr, &self->color);
cairo_translate (cr, self->offset.x, self->offset.y);
- pango_cairo_show_glyph_string (cr, self->font, &glyphs);
+ pango2_cairo_show_glyph_string (cr, self->font, &glyphs);
cairo_restore (cr);
}
@@ -4465,8 +4465,8 @@ gsk_text_node_diff (GskRenderNode *node1,
for (i = 0; i < self1->num_glyphs; i++)
{
- PangoGlyphInfo *info1 = &self1->glyphs[i];
- PangoGlyphInfo *info2 = &self2->glyphs[i];
+ Pango2GlyphInfo *info1 = &self1->glyphs[i];
+ Pango2GlyphInfo *info2 = &self2->glyphs[i];
if (info1->glyph == info2->glyph &&
info1->geometry.width == info2->geometry.width &&
@@ -4488,8 +4488,8 @@ gsk_text_node_diff (GskRenderNode *node1,
/**
* gsk_text_node_new:
- * @font: the `PangoFont` containing the glyphs
- * @glyphs: the `PangoGlyphString` to render
+ * @font: the `Pango2Font` containing the glyphs
+ * @glyphs: the `Pango2GlyphString` to render
* @color: the foreground color to render with
* @offset: offset of the baseline
*
@@ -4501,19 +4501,19 @@ gsk_text_node_diff (GskRenderNode *node1,
* Returns: (nullable) (transfer full) (type GskTextNode): a new `GskRenderNode`
*/
GskRenderNode *
-gsk_text_node_new (PangoFont *font,
- PangoGlyphString *glyphs,
+gsk_text_node_new (Pango2Font *font,
+ Pango2GlyphString *glyphs,
const GdkRGBA *color,
const graphene_point_t *offset)
{
GskTextNode *self;
GskRenderNode *node;
- PangoRectangle ink_rect;
- PangoGlyphInfo *glyph_infos;
+ Pango2Rectangle ink_rect;
+ Pango2GlyphInfo *glyph_infos;
int n;
- pango_glyph_string_extents (glyphs, font, &ink_rect, NULL);
- pango_extents_to_pixels (&ink_rect, NULL);
+ pango2_glyph_string_extents (glyphs, font, &ink_rect, NULL);
+ pango2_extents_to_pixels (&ink_rect, NULL);
/* Don't create nodes with empty bounds */
if (ink_rect.width == 0 || ink_rect.height == 0)
@@ -4528,13 +4528,13 @@ gsk_text_node_new (PangoFont *font,
self->offset = *offset;
self->has_color_glyphs = FALSE;
- glyph_infos = g_malloc_n (glyphs->num_glyphs, sizeof (PangoGlyphInfo));
+ glyph_infos = g_malloc_n (glyphs->num_glyphs, sizeof (Pango2GlyphInfo));
n = 0;
for (int i = 0; i < glyphs->num_glyphs; i++)
{
/* skip empty glyphs */
- if (glyphs->glyphs[i].glyph == PANGO_GLYPH_EMPTY)
+ if (glyphs->glyphs[i].glyph == PANGO2_GLYPH_EMPTY)
continue;
glyph_infos[n] = glyphs->glyphs[i];
@@ -4581,7 +4581,7 @@ gsk_text_node_get_color (const GskRenderNode *node)
*
* Returns: (transfer none): the font
*/
-PangoFont *
+Pango2Font *
gsk_text_node_get_font (const GskRenderNode *node)
{
const GskTextNode *self = (const GskTextNode *) node;
@@ -4632,7 +4632,7 @@ gsk_text_node_get_num_glyphs (const GskRenderNode *node)
*
* Returns: (transfer none) (array length=n_glyphs): the glyph information
*/
-const PangoGlyphInfo *
+const Pango2GlyphInfo *
gsk_text_node_get_glyphs (const GskRenderNode *node,
guint *n_glyphs)
{
diff --git a/gsk/gskrendernodeparser.c b/gsk/gskrendernodeparser.c
index 340a4c3c7f..48cc9d7522 100644
--- a/gsk/gskrendernodeparser.c
+++ b/gsk/gskrendernodeparser.c
@@ -641,17 +641,17 @@ parse_blend_mode (GtkCssParser *parser,
return FALSE;
}
-static PangoFont *
+static Pango2Font *
font_from_string (const char *string)
{
- PangoFontDescription *desc;
- PangoContext *context;
- PangoFont *font;
+ Pango2FontDescription *desc;
+ Pango2Context *context;
+ Pango2Font *font;
- desc = pango_font_description_from_string (string);
- context = pango_context_new ();
- font = pango_context_load_font (context, desc);
- pango_font_description_free (desc);
+ desc = pango2_font_description_from_string (string);
+ context = pango2_context_new ();
+ font = pango2_context_load_font (context, desc);
+ pango2_font_description_free (desc);
g_object_unref (context);
return font;
@@ -661,51 +661,51 @@ font_from_string (const char *string)
#define MAX_ASCII_GLYPH 127 /* exclusive */
#define N_ASCII_GLYPHS (MAX_ASCII_GLYPH - MIN_ASCII_GLYPH)
-static PangoGlyphString *
-create_ascii_glyphs (PangoFont *font)
+static Pango2GlyphString *
+create_ascii_glyphs (Pango2Font *font)
{
- PangoContext *context;
- PangoFontDescription *desc;
- PangoGlyphString *result, *glyph_string;
+ Pango2Context *context;
+ Pango2FontDescription *desc;
+ Pango2GlyphString *result, *glyph_string;
guint i;
for (i = MIN_ASCII_GLYPH; i < MAX_ASCII_GLYPH; i++)
{
- if (!pango_font_face_has_char (pango_font_get_face (font), i))
+ if (!pango2_font_face_has_char (pango2_font_get_face (font), i))
break;
}
if (i < MAX_ASCII_GLYPH)
return NULL;
- desc = pango_font_describe (font);
- context = pango_context_new ();
- pango_context_set_font_description (context, desc);
- pango_font_description_free (desc);
+ desc = pango2_font_describe (font);
+ context = pango2_context_new ();
+ pango2_context_set_font_description (context, desc);
+ pango2_font_description_free (desc);
- result = pango_glyph_string_new ();
- pango_glyph_string_set_size (result, N_ASCII_GLYPHS);
- glyph_string = pango_glyph_string_new ();
+ result = pango2_glyph_string_new ();
+ pango2_glyph_string_set_size (result, N_ASCII_GLYPHS);
+ glyph_string = pango2_glyph_string_new ();
for (i = MIN_ASCII_GLYPH; i < MAX_ASCII_GLYPH; i++)
{
const char text[2] = { i, 0 };
GList *items;
- PangoItem *item;
- PangoShapeFlags flags;
+ Pango2Item *item;
+ Pango2ShapeFlags flags;
- items = pango_itemize (context, PANGO_DIRECTION_LTR, text, 0, 1, NULL);
+ items = pango2_itemize (context, PANGO2_DIRECTION_LTR, text, 0, 1, NULL);
item = items->data;
if (cairo_version () < CAIRO_VERSION_ENCODE (1, 17, 4))
- flags = PANGO_SHAPE_ROUND_POSITIONS;
+ flags = PANGO2_SHAPE_ROUND_POSITIONS;
- pango_shape_item (item, text, 1, NULL, glyph_string, flags);
+ pango2_shape_item (item, text, 1, NULL, glyph_string, flags);
- g_list_free_full (items, (GDestroyNotify) pango_item_free);
+ g_list_free_full (items, (GDestroyNotify) pango2_item_free);
if (glyph_string->num_glyphs != 1)
{
- pango_glyph_string_free (glyph_string);
- pango_glyph_string_free (result);
+ pango2_glyph_string_free (glyph_string);
+ pango2_glyph_string_free (result);
g_object_unref (context);
return NULL;
}
@@ -713,7 +713,7 @@ create_ascii_glyphs (PangoFont *font)
result->glyphs[i - MIN_ASCII_GLYPH] = glyph_string->glyphs[0];
}
- pango_glyph_string_free (glyph_string);
+ pango2_glyph_string_free (glyph_string);
g_object_unref (context);
@@ -724,7 +724,7 @@ static gboolean
parse_font (GtkCssParser *parser,
gpointer out_font)
{
- PangoFont *font;
+ Pango2Font *font;
char *s;
s = gtk_css_parser_consume_string (parser);
@@ -738,7 +738,7 @@ parse_font (GtkCssParser *parser,
return FALSE;
}
- *((PangoFont**)out_font) = font;
+ *((Pango2Font**)out_font) = font;
g_free (s);
@@ -748,20 +748,20 @@ parse_font (GtkCssParser *parser,
static void
clear_font (gpointer inout_font)
{
- g_clear_object ((PangoFont **) inout_font);
+ g_clear_object ((Pango2Font **) inout_font);
}
static gboolean
parse_glyphs (GtkCssParser *parser,
gpointer out_glyphs)
{
- PangoGlyphString *glyph_string;
+ Pango2GlyphString *glyph_string;
- glyph_string = pango_glyph_string_new ();
+ glyph_string = pango2_glyph_string_new ();
do
{
- PangoGlyphInfo gi = { 0, { 0, 0, 0}, { 1 } };
+ Pango2GlyphInfo gi = { 0, { 0, 0, 0}, { 1 } };
double d, d2;
int i;
@@ -775,8 +775,8 @@ parse_glyphs (GtkCssParser *parser,
{
gtk_css_parser_error_value (parser, "Unsupported character %d in string", i);
}
- gi.glyph = PANGO_GLYPH_INVALID_INPUT - MAX_ASCII_GLYPH + s[i];
- pango_glyph_string_set_size (glyph_string, glyph_string->num_glyphs + 1);
+ gi.glyph = PANGO2_GLYPH_INVALID_INPUT - MAX_ASCII_GLYPH + s[i];
+ pango2_glyph_string_set_size (glyph_string, glyph_string->num_glyphs + 1);
glyph_string->glyphs[glyph_string->num_glyphs - 1] = gi;
}
@@ -787,22 +787,22 @@ parse_glyphs (GtkCssParser *parser,
if (!gtk_css_parser_consume_integer (parser, &i) ||
!gtk_css_parser_consume_number (parser, &d))
{
- pango_glyph_string_free (glyph_string);
+ pango2_glyph_string_free (glyph_string);
return FALSE;
}
gi.glyph = i;
- gi.geometry.width = (int) (d * PANGO_SCALE);
+ gi.geometry.width = (int) (d * PANGO2_SCALE);
if (gtk_css_parser_has_number (parser))
{
if (!gtk_css_parser_consume_number (parser, &d) ||
!gtk_css_parser_consume_number (parser, &d2))
{
- pango_glyph_string_free (glyph_string);
+ pango2_glyph_string_free (glyph_string);
return FALSE;
}
- gi.geometry.x_offset = (int) (d * PANGO_SCALE);
- gi.geometry.y_offset = (int) (d2 * PANGO_SCALE);
+ gi.geometry.x_offset = (int) (d * PANGO2_SCALE);
+ gi.geometry.y_offset = (int) (d2 * PANGO2_SCALE);
if (gtk_css_parser_try_ident (parser, "same-cluster"))
gi.attr.is_cluster_start = 0;
@@ -815,13 +815,13 @@ parse_glyphs (GtkCssParser *parser,
gi.attr.is_color = 0;
}
- pango_glyph_string_set_size (glyph_string, glyph_string->num_glyphs + 1);
+ pango2_glyph_string_set_size (glyph_string, glyph_string->num_glyphs + 1);
glyph_string->glyphs[glyph_string->num_glyphs - 1] = gi;
}
}
while (gtk_css_parser_try_token (parser, GTK_CSS_TOKEN_COMMA));
- *((PangoGlyphString **)out_glyphs) = glyph_string;
+ *((Pango2GlyphString **)out_glyphs) = glyph_string;
return TRUE;
}
@@ -829,7 +829,7 @@ parse_glyphs (GtkCssParser *parser,
static void
clear_glyphs (gpointer inout_glyphs)
{
- g_clear_pointer ((PangoGlyphString **) inout_glyphs, pango_glyph_string_free);
+ g_clear_pointer ((Pango2GlyphString **) inout_glyphs, pango2_glyph_string_free);
}
static gboolean
@@ -1612,21 +1612,21 @@ parse_repeat_node (GtkCssParser *parser)
}
static gboolean
-unpack_glyphs (PangoFont *font,
- PangoGlyphString *glyphs)
+unpack_glyphs (Pango2Font *font,
+ Pango2GlyphString *glyphs)
{
- PangoGlyphString *ascii = NULL;
+ Pango2GlyphString *ascii = NULL;
guint i;
for (i = 0; i < glyphs->num_glyphs; i++)
{
- PangoGlyph glyph = glyphs->glyphs[i].glyph;
+ Pango2Glyph glyph = glyphs->glyphs[i].glyph;
- if (glyph < PANGO_GLYPH_INVALID_INPUT - MAX_ASCII_GLYPH ||
- glyph >= PANGO_GLYPH_INVALID_INPUT)
+ if (glyph < PANGO2_GLYPH_INVALID_INPUT - MAX_ASCII_GLYPH ||
+ glyph >= PANGO2_GLYPH_INVALID_INPUT)
continue;
- glyph = glyph - (PANGO_GLYPH_INVALID_INPUT - MAX_ASCII_GLYPH) - MIN_ASCII_GLYPH;
+ glyph = glyph - (PANGO2_GLYPH_INVALID_INPUT - MAX_ASCII_GLYPH) - MIN_ASCII_GLYPH;
if (ascii == NULL)
{
@@ -1639,7 +1639,7 @@ unpack_glyphs (PangoFont *font,
glyphs->glyphs[i].geometry.width = ascii->glyphs[glyph].geometry.width;
}
- g_clear_pointer (&ascii, pango_glyph_string_free);
+ g_clear_pointer (&ascii, pango2_glyph_string_free);
return TRUE;
}
@@ -1647,10 +1647,10 @@ unpack_glyphs (PangoFont *font,
static GskRenderNode *
parse_text_node (GtkCssParser *parser)
{
- PangoFont *font = NULL;
+ Pango2Font *font = NULL;
graphene_point_t offset = GRAPHENE_POINT_INIT (0, 0);
GdkRGBA color = GDK_RGBA("000000");
- PangoGlyphString *glyphs = NULL;
+ Pango2GlyphString *glyphs = NULL;
const Declaration declarations[] = {
{ "font", parse_font, clear_font, &font },
{ "offset", parse_point, NULL, &offset },
@@ -1670,14 +1670,14 @@ parse_text_node (GtkCssParser *parser)
if (!glyphs)
{
const char *text = "Hello";
- PangoGlyphInfo gi = { 0, { 0, 0, 0}, { 1 } };
+ Pango2GlyphInfo gi = { 0, { 0, 0, 0}, { 1 } };
guint i;
- glyphs = pango_glyph_string_new ();
- pango_glyph_string_set_size (glyphs, strlen (text));
+ glyphs = pango2_glyph_string_new ();
+ pango2_glyph_string_set_size (glyphs, strlen (text));
for (i = 0; i < strlen (text); i++)
{
- gi.glyph = PANGO_GLYPH_INVALID_INPUT - MAX_ASCII_GLYPH + text[i];
+ gi.glyph = PANGO2_GLYPH_INVALID_INPUT - MAX_ASCII_GLYPH + text[i];
glyphs->glyphs[i] = gi;
}
}
@@ -1697,7 +1697,7 @@ parse_text_node (GtkCssParser *parser)
}
g_object_unref (font);
- pango_glyph_string_free (glyphs);
+ pango2_glyph_string_free (glyphs);
/* return anything, whatever, just not NULL */
if (result == NULL)
@@ -2325,11 +2325,11 @@ gsk_text_node_serialize_glyphs (GskRenderNode *node,
GString *p)
{
const guint n_glyphs = gsk_text_node_get_num_glyphs (node);
- const PangoGlyphInfo *glyphs = gsk_text_node_get_glyphs (node, NULL);
- PangoFont *font = gsk_text_node_get_font (node);
+ const Pango2GlyphInfo *glyphs = gsk_text_node_get_glyphs (node, NULL);
+ Pango2Font *font = gsk_text_node_get_font (node);
GString *str;
guint i, j;
- PangoGlyphString *ascii;
+ Pango2GlyphString *ascii;
ascii = create_ascii_glyphs (font);
str = g_string_new ("");
@@ -2373,16 +2373,16 @@ gsk_text_node_serialize_glyphs (GskRenderNode *node,
}
g_string_append_printf (p, "%u ", glyphs[i].glyph);
- string_append_double (p, (double) glyphs[i].geometry.width / PANGO_SCALE);
+ string_append_double (p, (double) glyphs[i].geometry.width / PANGO2_SCALE);
if (!glyphs[i].attr.is_cluster_start ||
glyphs[i].attr.is_color ||
glyphs[i].geometry.x_offset != 0 ||
glyphs[i].geometry.y_offset != 0)
{
g_string_append (p, " ");
- string_append_double (p, (double) glyphs[i].geometry.x_offset / PANGO_SCALE);
+ string_append_double (p, (double) glyphs[i].geometry.x_offset / PANGO2_SCALE);
g_string_append (p, " ");
- string_append_double (p, (double) glyphs[i].geometry.y_offset / PANGO_SCALE);
+ string_append_double (p, (double) glyphs[i].geometry.y_offset / PANGO2_SCALE);
if (!glyphs[i].attr.is_cluster_start)
g_string_append (p, " same-cluster");
if (!glyphs[i].attr.is_color)
@@ -2398,7 +2398,7 @@ gsk_text_node_serialize_glyphs (GskRenderNode *node,
g_string_free (str, TRUE);
if (ascii)
- pango_glyph_string_free (ascii);
+ pango2_glyph_string_free (ascii);
}
static void
@@ -2757,8 +2757,8 @@ render_node_print (Printer *p,
{
const graphene_point_t *offset = gsk_text_node_get_offset (node);
const GdkRGBA *color = gsk_text_node_get_color (node);
- PangoFont *font = gsk_text_node_get_font (node);
- PangoFontDescription *desc;
+ Pango2Font *font = gsk_text_node_get_font (node);
+ Pango2FontDescription *desc;
char *font_name;
start_node (p, "text");
@@ -2767,11 +2767,11 @@ render_node_print (Printer *p,
append_rgba_param (p, "color", color);
_indent (p);
- desc = pango_font_describe (font);
- font_name = pango_font_description_to_string (desc);
+ desc = pango2_font_describe (font);
+ font_name = pango2_font_description_to_string (desc);
g_string_append_printf (p->str, "font: \"%s\";\n", font_name);
g_free (font_name);
- pango_font_description_free (desc);
+ pango2_font_description_free (desc);
_indent (p);
g_string_append (p->str, "glyphs: ");
diff --git a/gsk/vulkan/gskvulkanglyphcacheprivate.h b/gsk/vulkan/gskvulkanglyphcacheprivate.h
index b31711fe6d..c6274cbbf1 100644
--- a/gsk/vulkan/gskvulkanglyphcacheprivate.h
+++ b/gsk/vulkan/gskvulkanglyphcacheprivate.h
@@ -1,7 +1,7 @@
#ifndef __GSK_VULKAN_GLYPH_CACHE_PRIVATE_H__
#define __GSK_VULKAN_GLYPH_CACHE_PRIVATE_H__
-#include <pango/pango.h>
+#include <pango2/pango.h>
#include "gskvulkanrendererprivate.h"
#include "gskvulkanimageprivate.h"
diff --git a/gtk/a11y/gtkatspipango.c b/gtk/a11y/gtkatspipango.c
index 46ea57f2ef..94ee63f08e 100644
--- a/gtk/a11y/gtkatspipango.c
+++ b/gtk/a11y/gtkatspipango.c
@@ -20,15 +20,15 @@
#include "gtkatspipangoprivate.h"
const char *
-pango_style_to_string (PangoStyle style)
+pango_style_to_string (Pango2Style style)
{
switch (style)
{
- case PANGO_STYLE_NORMAL:
+ case PANGO2_STYLE_NORMAL:
return "normal";
- case PANGO_STYLE_OBLIQUE:
+ case PANGO2_STYLE_OBLIQUE:
return "oblique";
- case PANGO_STYLE_ITALIC:
+ case PANGO2_STYLE_ITALIC:
return "italic";
default:
g_assert_not_reached ();
@@ -36,23 +36,23 @@ pango_style_to_string (PangoStyle style)
}
const char *
-pango_variant_to_string (PangoVariant variant)
+pango_variant_to_string (Pango2Variant variant)
{
switch (variant)
{
- case PANGO_VARIANT_NORMAL:
+ case PANGO2_VARIANT_NORMAL:
return "normal";
- case PANGO_VARIANT_SMALL_CAPS:
+ case PANGO2_VARIANT_SMALL_CAPS:
return "small_caps";
- case PANGO_VARIANT_ALL_SMALL_CAPS:
+ case PANGO2_VARIANT_ALL_SMALL_CAPS:
return "all_small_caps";
- case PANGO_VARIANT_PETITE_CAPS:
+ case PANGO2_VARIANT_PETITE_CAPS:
return "petite_caps";
- case PANGO_VARIANT_ALL_PETITE_CAPS:
+ case PANGO2_VARIANT_ALL_PETITE_CAPS:
return "all_petite_caps";
- case PANGO_VARIANT_UNICASE:
+ case PANGO2_VARIANT_UNICASE:
return "unicase";
- case PANGO_VARIANT_TITLE_CAPS:
+ case PANGO2_VARIANT_TITLE_CAPS:
return "title_caps";
default:
g_assert_not_reached ();
@@ -60,27 +60,27 @@ pango_variant_to_string (PangoVariant variant)
}
const char *
-pango_stretch_to_string (PangoStretch stretch)
+pango_stretch_to_string (Pango2Stretch stretch)
{
switch (stretch)
{
- case PANGO_STRETCH_ULTRA_CONDENSED:
+ case PANGO2_STRETCH_ULTRA_CONDENSED:
return "ultra_condensed";
- case PANGO_STRETCH_EXTRA_CONDENSED:
+ case PANGO2_STRETCH_EXTRA_CONDENSED:
return "extra_condensed";
- case PANGO_STRETCH_CONDENSED:
+ case PANGO2_STRETCH_CONDENSED:
return "condensed";
- case PANGO_STRETCH_SEMI_CONDENSED:
+ case PANGO2_STRETCH_SEMI_CONDENSED:
return "semi_condensed";
- case PANGO_STRETCH_NORMAL:
+ case PANGO2_STRETCH_NORMAL:
return "normal";
- case PANGO_STRETCH_SEMI_EXPANDED:
+ case PANGO2_STRETCH_SEMI_EXPANDED:
return "semi_expanded";
- case PANGO_STRETCH_EXPANDED:
+ case PANGO2_STRETCH_EXPANDED:
return "expanded";
- case PANGO_STRETCH_EXTRA_EXPANDED:
+ case PANGO2_STRETCH_EXTRA_EXPANDED:
return "extra_expanded";
- case PANGO_STRETCH_ULTRA_EXPANDED:
+ case PANGO2_STRETCH_ULTRA_EXPANDED:
return "ultra_expanded";
default:
g_assert_not_reached ();
@@ -88,21 +88,21 @@ pango_stretch_to_string (PangoStretch stretch)
}
const char *
-pango_line_style_to_string (PangoLineStyle value)
+pango_line_style_to_string (Pango2LineStyle value)
{
switch (value)
{
- case PANGO_LINE_STYLE_NONE:
+ case PANGO2_LINE_STYLE_NONE:
return "none";
- case PANGO_LINE_STYLE_SOLID:
+ case PANGO2_LINE_STYLE_SOLID:
return "single";
- case PANGO_LINE_STYLE_DOUBLE:
+ case PANGO2_LINE_STYLE_DOUBLE:
return "double";
- case PANGO_LINE_STYLE_DASHED:
+ case PANGO2_LINE_STYLE_DASHED:
return "dashed";
- case PANGO_LINE_STYLE_DOTTED:
+ case PANGO2_LINE_STYLE_DOTTED:
return "dotted";
- case PANGO_LINE_STYLE_WAVY:
+ case PANGO2_LINE_STYLE_WAVY:
return "wavy";
default:
g_assert_not_reached ();
@@ -110,16 +110,16 @@ pango_line_style_to_string (PangoLineStyle value)
}
const char *
-pango_wrap_mode_to_string (PangoWrapMode mode)
+pango_wrap_mode_to_string (Pango2WrapMode mode)
{
/* Keep these in sync with gtk_wrap_mode_to_string() */
switch (mode)
{
- case PANGO_WRAP_WORD:
+ case PANGO2_WRAP_WORD:
return "word";
- case PANGO_WRAP_CHAR:
+ case PANGO2_WRAP_CHAR:
return "char";
- case PANGO_WRAP_WORD_CHAR:
+ case PANGO2_WRAP_WORD_CHAR:
return "word-char";
default:
g_assert_not_reached ();
@@ -127,19 +127,19 @@ pango_wrap_mode_to_string (PangoWrapMode mode)
}
static const char *
-pango_align_to_string (PangoAlignment align)
+pango_align_to_string (Pango2Alignment align)
{
switch (align)
{
- case PANGO_ALIGN_LEFT:
+ case PANGO2_ALIGN_LEFT:
return "left";
- case PANGO_ALIGN_CENTER:
+ case PANGO2_ALIGN_CENTER:
return "center";
- case PANGO_ALIGN_RIGHT:
+ case PANGO2_ALIGN_RIGHT:
return "right";
- case PANGO_ALIGN_NATURAL:
+ case PANGO2_ALIGN_NATURAL:
return "natural";
- case PANGO_ALIGN_JUSTIFY:
+ case PANGO2_ALIGN_JUSTIFY:
return "fill";
default:
g_assert_not_reached ();
@@ -147,68 +147,68 @@ pango_align_to_string (PangoAlignment align)
}
void
-gtk_pango_get_font_attributes (PangoFontDescription *font,
+gtk_pango_get_font_attributes (Pango2FontDescription *font,
GVariantBuilder *builder)
{
char buf[60];
g_variant_builder_add (builder, "{ss}", "style",
- pango_style_to_string (pango_font_description_get_style (font)));
+ pango_style_to_string (pango2_font_description_get_style (font)));
g_variant_builder_add (builder, "{ss}", "variant",
- pango_variant_to_string (pango_font_description_get_variant (font)));
+ pango_variant_to_string (pango2_font_description_get_variant (font)));
g_variant_builder_add (builder, "{ss}", "stretch",
- pango_stretch_to_string (pango_font_description_get_stretch (font)));
+ pango_stretch_to_string (pango2_font_description_get_stretch (font)));
g_variant_builder_add (builder, "{ss}", "family-name",
- pango_font_description_get_family (font));
+ pango2_font_description_get_family (font));
- g_snprintf (buf, 60, "%d", pango_font_description_get_weight (font));
+ g_snprintf (buf, 60, "%d", pango2_font_description_get_weight (font));
g_variant_builder_add (builder, "{ss}", "weight", buf);
- g_snprintf (buf, 60, "%i", pango_font_description_get_size (font) / PANGO_SCALE);
+ g_snprintf (buf, 60, "%i", pango2_font_description_get_size (font) / PANGO2_SCALE);
g_variant_builder_add (builder, "{ss}", "size", buf);
}
/*
* gtk_pango_get_default_attributes:
- * @layout: the `PangoLayout` from which to get attributes
+ * @layout: the `Pango2Layout` from which to get attributes
* @builder: a `GVariantBuilder` to add to
*
* Adds the default text attributes from @layout to @builder,
- * after translating them from Pango attributes to atspi
+ * after translating them from Pango2 attributes to atspi
* attributes.
*
* This is a convenience function that can be used to implement
- * support for the `AtkText` interface in widgets using Pango
+ * support for the `AtkText` interface in widgets using Pango2
* layouts.
*
* Returns: the modified @attributes
*/
void
-gtk_pango_get_default_attributes (PangoLayout *layout,
+gtk_pango_get_default_attributes (Pango2Layout *layout,
GVariantBuilder *builder)
{
- PangoContext *context;
+ Pango2Context *context;
- context = pango_layout_get_context (layout);
+ context = pango2_layout_get_context (layout);
if (context)
{
- PangoLanguage *language;
- PangoFontDescription *font;
+ Pango2Language *language;
+ Pango2FontDescription *font;
- language = pango_context_get_language (context);
+ language = pango2_context_get_language (context);
if (language)
g_variant_builder_add (builder, "{ss}", "language",
- pango_language_to_string (language));
+ pango2_language_to_string (language));
- font = pango_context_get_font_description (context);
+ font = pango2_context_get_font_description (context);
if (font)
gtk_pango_get_font_attributes (font, builder);
}
g_variant_builder_add (builder, "{ss}", "justification",
- pango_align_to_string (pango_layout_get_alignment (layout)));
+ pango_align_to_string (pango2_layout_get_alignment (layout)));
g_variant_builder_add (builder, "{ss}", "wrap-mode",
- pango_wrap_mode_to_string (pango_layout_get_wrap (layout)));
+ pango_wrap_mode_to_string (pango2_layout_get_wrap (layout)));
g_variant_builder_add (builder, "{ss}", "strikethrough", "false");
g_variant_builder_add (builder, "{ss}", "underline", "false");
g_variant_builder_add (builder, "{ss}", "rise", "0");
@@ -226,7 +226,7 @@ gtk_pango_get_default_attributes (PangoLayout *layout,
/*
* gtk_pango_get_run_attributes:
- * @layout: the `PangoLayout` to get the attributes from
+ * @layout: the `Pango2Layout` to get the attributes from
* @builder: `GVariantBuilder` to add to
* @offset: the offset at which the attributes are wanted
* @start_offset: return location for the starting offset
@@ -239,22 +239,22 @@ gtk_pango_get_default_attributes (PangoLayout *layout,
* returns the starting and ending offsets for it.
*
* The attributes for the run are added to @attributes, after
- * translating them from Pango attributes to atspi attributes.
+ * translating them from Pango2 attributes to atspi attributes.
*
* This is a convenience function that can be used to implement
- * support for the #AtkText interface in widgets using Pango
+ * support for the #AtkText interface in widgets using Pango2
* layouts.
*/
void
-gtk_pango_get_run_attributes (PangoLayout *layout,
+gtk_pango_get_run_attributes (Pango2Layout *layout,
GVariantBuilder *builder,
int offset,
int *start_offset,
int *end_offset)
{
- PangoAttrIterator *iter;
- PangoAttrList *attr_list;
- PangoAttribute *attr;
+ Pango2AttrIterator *iter;
+ Pango2AttrList *attr_list;
+ Pango2Attribute *attr;
int index, start_index, end_index;
gboolean is_next;
glong len;
@@ -262,11 +262,11 @@ gtk_pango_get_run_attributes (PangoLayout *layout,
char *value;
const char *val;
- text = pango_layout_get_text (layout);
+ text = pango2_layout_get_text (layout);
len = g_utf8_strlen (text, -1);
- /* Grab the attributes of the PangoLayout, if any */
- attr_list = pango_layout_get_attributes (layout);
+ /* Grab the attributes of the Pango2Layout, if any */
+ attr_list = pango2_layout_get_attributes (layout);
if (attr_list == NULL)
{
@@ -275,7 +275,7 @@ gtk_pango_get_run_attributes (PangoLayout *layout,
return;
}
- iter = pango_attr_list_get_iterator (attr_list);
+ iter = pango2_attr_list_get_iterator (attr_list);
/* Get invariant range offsets */
/* If offset out of range, set offset in range */
if (offset > len)
@@ -284,7 +284,7 @@ gtk_pango_get_run_attributes (PangoLayout *layout,
offset = 0;
index = g_utf8_offset_to_pointer (text, offset) - text;
- pango_attr_iterator_range (iter, &start_index, &end_index);
+ pango2_attr_iterator_range (iter, &start_index, &end_index);
is_next = TRUE;
while (is_next)
{
@@ -297,87 +297,87 @@ gtk_pango_get_run_attributes (PangoLayout *layout,
*end_offset = g_utf8_pointer_to_offset (text, text + end_index);
break;
}
- is_next = pango_attr_iterator_next (iter);
- pango_attr_iterator_range (iter, &start_index, &end_index);
+ is_next = pango2_attr_iterator_next (iter);
+ pango2_attr_iterator_range (iter, &start_index, &end_index);
}
/* Get attributes */
- attr = pango_attr_iterator_get (iter, PANGO_ATTR_FAMILY);
+ attr = pango2_attr_iterator_get (iter, PANGO2_ATTR_FAMILY);
if (attr != NULL)
- g_variant_builder_add (builder, "{ss}", "family-name", pango_attribute_get_string (attr));
+ g_variant_builder_add (builder, "{ss}", "family-name", pango2_attribute_get_string (attr));
- attr = pango_attr_iterator_get (iter, PANGO_ATTR_STYLE);
+ attr = pango2_attr_iterator_get (iter, PANGO2_ATTR_STYLE);
if (attr != NULL)
- g_variant_builder_add (builder, "{ss}", "style", pango_style_to_string (pango_attribute_get_int (attr)));
+ g_variant_builder_add (builder, "{ss}", "style", pango_style_to_string (pango2_attribute_get_int
(attr)));
- attr = pango_attr_iterator_get (iter, PANGO_ATTR_WEIGHT);
+ attr = pango2_attr_iterator_get (iter, PANGO2_ATTR_WEIGHT);
if (attr != NULL)
{
- value = g_strdup_printf ("%i", pango_attribute_get_int (attr));
+ value = g_strdup_printf ("%i", pango2_attribute_get_int (attr));
g_variant_builder_add (builder, "{ss}", "weight", value);
g_free (value);
}
- attr = pango_attr_iterator_get (iter, PANGO_ATTR_VARIANT);
+ attr = pango2_attr_iterator_get (iter, PANGO2_ATTR_VARIANT);
if (attr != NULL)
g_variant_builder_add (builder, "{ss}", "variant",
- pango_variant_to_string (pango_attribute_get_int (attr)));
+ pango_variant_to_string (pango2_attribute_get_int (attr)));
- attr = pango_attr_iterator_get (iter, PANGO_ATTR_STRETCH);
+ attr = pango2_attr_iterator_get (iter, PANGO2_ATTR_STRETCH);
if (attr != NULL)
g_variant_builder_add (builder, "{ss}", "stretch",
- pango_stretch_to_string (pango_attribute_get_int (attr)));
+ pango_stretch_to_string (pango2_attribute_get_int (attr)));
- attr = pango_attr_iterator_get (iter, PANGO_ATTR_SIZE);
+ attr = pango2_attr_iterator_get (iter, PANGO2_ATTR_SIZE);
if (attr != NULL)
{
- value = g_strdup_printf ("%i", pango_attribute_get_int (attr) / PANGO_SCALE);
+ value = g_strdup_printf ("%i", pango2_attribute_get_int (attr) / PANGO2_SCALE);
g_variant_builder_add (builder, "{ss}", "size", value);
g_free (value);
}
- attr = pango_attr_iterator_get (iter, PANGO_ATTR_UNDERLINE);
+ attr = pango2_attr_iterator_get (iter, PANGO2_ATTR_UNDERLINE);
if (attr != NULL)
g_variant_builder_add (builder, "{ss}", "underline",
- pango_line_style_to_string (pango_attribute_get_int (attr)));
+ pango_line_style_to_string (pango2_attribute_get_int (attr)));
- attr = pango_attr_iterator_get (iter, PANGO_ATTR_STRIKETHROUGH);
+ attr = pango2_attr_iterator_get (iter, PANGO2_ATTR_STRIKETHROUGH);
if (attr != NULL)
{
- if (pango_attribute_get_int (attr))
+ if (pango2_attribute_get_int (attr))
val = "true";
else
val = "false";
g_variant_builder_add (builder, "{ss}", "strikethrough", val);
}
- attr = pango_attr_iterator_get (iter, PANGO_ATTR_RISE);
+ attr = pango2_attr_iterator_get (iter, PANGO2_ATTR_RISE);
if (attr != NULL)
{
- value = g_strdup_printf ("%i", pango_attribute_get_int (attr));
+ value = g_strdup_printf ("%i", pango2_attribute_get_int (attr));
g_variant_builder_add (builder, "{ss}", "rise", value);
g_free (value);
}
- attr = pango_attr_iterator_get (iter, PANGO_ATTR_LANGUAGE);
+ attr = pango2_attr_iterator_get (iter, PANGO2_ATTR_LANGUAGE);
if (attr != NULL)
{
g_variant_builder_add (builder, "{ss}", "language",
- pango_language_to_string (pango_attribute_get_language (attr)));
+ pango2_language_to_string (pango2_attribute_get_language (attr)));
}
- attr = pango_attr_iterator_get (iter, PANGO_ATTR_SCALE);
+ attr = pango2_attr_iterator_get (iter, PANGO2_ATTR_SCALE);
if (attr != NULL)
{
- value = g_strdup_printf ("%g", pango_attribute_get_float (attr));
+ value = g_strdup_printf ("%g", pango2_attribute_get_float (attr));
g_variant_builder_add (builder, "{ss}", "scale", value);
g_free (value);
}
- attr = pango_attr_iterator_get (iter, PANGO_ATTR_FOREGROUND);
+ attr = pango2_attr_iterator_get (iter, PANGO2_ATTR_FOREGROUND);
if (attr != NULL)
{
- PangoColor *color = pango_attribute_get_color (attr);
+ Pango2Color *color = pango2_attribute_get_color (attr);
value = g_strdup_printf ("%u,%u,%u,%u",
color->red,
color->green,
@@ -387,10 +387,10 @@ gtk_pango_get_run_attributes (PangoLayout *layout,
g_free (value);
}
- attr = pango_attr_iterator_get (iter, PANGO_ATTR_BACKGROUND);
+ attr = pango2_attr_iterator_get (iter, PANGO2_ATTR_BACKGROUND);
if (attr != NULL)
{
- PangoColor *color = pango_attribute_get_color (attr);
+ Pango2Color *color = pango2_attribute_get_color (attr);
value = g_strdup_printf ("%u,%u,%u,%u",
color->red,
color->green,
@@ -399,12 +399,12 @@ gtk_pango_get_run_attributes (PangoLayout *layout,
g_variant_builder_add (builder, "{ss}", "bg-color", value);
g_free (value);
}
- pango_attr_iterator_destroy (iter);
+ pango2_attr_iterator_destroy (iter);
}
/*
* gtk_pango_move_chars:
- * @layout: a `PangoLayout`
+ * @layout: a `Pango2Layout`
* @offset: a character offset in @layout
* @count: the number of characters to move from @offset
*
@@ -412,19 +412,19 @@ gtk_pango_get_run_attributes (PangoLayout *layout,
* given @offset. @count may be positive or negative.
*
* For the purpose of this function, characters are defined
- * by what Pango considers cursor positions.
+ * by what Pango2 considers cursor positions.
*
* Returns: the new position
*/
static int
-gtk_pango_move_chars (PangoLayout *layout,
+gtk_pango_move_chars (Pango2Layout *layout,
int offset,
int count)
{
- const PangoLogAttr *attrs;
+ const Pango2LogAttr *attrs;
int n_attrs;
- attrs = pango_layout_get_log_attrs (layout, &n_attrs);
+ attrs = pango2_layout_get_log_attrs (layout, &n_attrs);
while (count > 0 && offset < n_attrs - 1)
{
@@ -448,7 +448,7 @@ gtk_pango_move_chars (PangoLayout *layout,
/*
* gtk_pango_move_words:
- * @layout: a `PangoLayout`
+ * @layout: a `Pango2Layout`
* @offset: a character offset in @layout
* @count: the number of words to move from @offset
*
@@ -457,20 +457,20 @@ gtk_pango_move_chars (PangoLayout *layout,
*
* If @count is positive, the returned position will
* be a word end, otherwise it will be a word start.
- * See the Pango documentation for details on how
+ * See the Pango2 documentation for details on how
* word starts and ends are defined.
*
* Returns: the new position
*/
static int
-gtk_pango_move_words (PangoLayout *layout,
+gtk_pango_move_words (Pango2Layout *layout,
int offset,
int count)
{
- const PangoLogAttr *attrs;
+ const Pango2LogAttr *attrs;
int n_attrs;
- attrs = pango_layout_get_log_attrs (layout, &n_attrs);
+ attrs = pango2_layout_get_log_attrs (layout, &n_attrs);
while (count > 0 && offset < n_attrs - 1)
{
@@ -494,7 +494,7 @@ gtk_pango_move_words (PangoLayout *layout,
/*
* gtk_pango_move_sentences:
- * @layout: a `PangoLayout`
+ * @layout: a `Pango2Layout`
* @offset: a character offset in @layout
* @count: the number of sentences to move from @offset
*
@@ -503,20 +503,20 @@ gtk_pango_move_words (PangoLayout *layout,
*
* If @count is positive, the returned position will
* be a sentence end, otherwise it will be a sentence start.
- * See the Pango documentation for details on how
+ * See the Pango2 documentation for details on how
* sentence starts and ends are defined.
*
* Returns: the new position
*/
static int
-gtk_pango_move_sentences (PangoLayout *layout,
+gtk_pango_move_sentences (Pango2Layout *layout,
int offset,
int count)
{
- const PangoLogAttr *attrs;
+ const Pango2LogAttr *attrs;
int n_attrs;
- attrs = pango_layout_get_log_attrs (layout, &n_attrs);
+ attrs = pango2_layout_get_log_attrs (layout, &n_attrs);
while (count > 0 && offset < n_attrs - 1)
{
@@ -541,7 +541,7 @@ gtk_pango_move_sentences (PangoLayout *layout,
#if 0
/*
* gtk_pango_move_lines:
- * @layout: a `PangoLayout`
+ * @layout: a `Pango2Layout`
* @offset: a character offset in @layout
* @count: the number of lines to move from @offset
*
@@ -555,21 +555,21 @@ gtk_pango_move_sentences (PangoLayout *layout,
* Returns: the new position
*/
static int
-gtk_pango_move_lines (PangoLayout *layout,
+gtk_pango_move_lines (Pango2Layout *layout,
int offset,
int count)
{
GSList *lines, *l;
- PangoLine *line;
+ Pango2Line *line;
int num;
const char *text;
int pos, line_pos;
int index;
int len;
- text = pango_layout_get_text (layout);
+ text = pango2_layout_get_text (layout);
index = g_utf8_offset_to_pointer (text, offset) - text;
- lines = pango_layout_get_lines (layout);
+ lines = pango2_layout_get_lines (layout);
line = NULL;
num = 0;
@@ -612,7 +612,7 @@ gtk_pango_move_lines (PangoLayout *layout,
/*
* gtk_pango_is_inside_word:
- * @layout: a `PangoLayout`
+ * @layout: a `Pango2Layout`
* @offset: a character offset in @layout
*
* Returns whether the given position is inside
@@ -621,13 +621,13 @@ gtk_pango_move_lines (PangoLayout *layout,
* Returns: %TRUE if @offset is inside a word
*/
static gboolean
-gtk_pango_is_inside_word (PangoLayout *layout,
+gtk_pango_is_inside_word (Pango2Layout *layout,
int offset)
{
- const PangoLogAttr *attrs;
+ const Pango2LogAttr *attrs;
int n_attrs;
- attrs = pango_layout_get_log_attrs (layout, &n_attrs);
+ attrs = pango2_layout_get_log_attrs (layout, &n_attrs);
while (offset >= 0 &&
!(attrs[offset].is_word_start || attrs[offset].is_word_end))
@@ -641,7 +641,7 @@ gtk_pango_is_inside_word (PangoLayout *layout,
/*
* gtk_pango_is_inside_sentence:
- * @layout: a `PangoLayout`
+ * @layout: a `Pango2Layout`
* @offset: a character offset in @layout
*
* Returns whether the given position is inside
@@ -650,13 +650,13 @@ gtk_pango_is_inside_word (PangoLayout *layout,
* Returns: %TRUE if @offset is inside a sentence
*/
static gboolean
-gtk_pango_is_inside_sentence (PangoLayout *layout,
+gtk_pango_is_inside_sentence (Pango2Layout *layout,
int offset)
{
- const PangoLogAttr *attrs;
+ const Pango2LogAttr *attrs;
int n_attrs;
- attrs = pango_layout_get_log_attrs (layout, &n_attrs);
+ attrs = pango2_layout_get_log_attrs (layout, &n_attrs);
while (offset >= 0 &&
!(attrs[offset].is_sentence_start || attrs[offset].is_sentence_end))
@@ -669,28 +669,28 @@ gtk_pango_is_inside_sentence (PangoLayout *layout,
}
static void
-pango_layout_get_line_before (PangoLayout *layout,
+pango2_layout_get_line_before (Pango2Layout *layout,
int offset,
AtspiTextBoundaryType boundary_type,
int *start_offset,
int *end_offset)
{
- PangoLineIter *iter;
- PangoLine *line, *prev_line = NULL, *prev_prev_line = NULL;
+ Pango2LineIter *iter;
+ Pango2Line *line, *prev_line = NULL, *prev_prev_line = NULL;
int index, start_index, length, end_index;
int prev_start_index, prev_length;
int prev_prev_start_index, prev_prev_length;
const char *text;
gboolean found = FALSE;
- text = pango_layout_get_text (layout);
+ text = pango2_layout_get_text (layout);
index = g_utf8_offset_to_pointer (text, offset) - text;
- iter = pango_layout_get_iter (layout);
+ iter = pango2_layout_get_iter (layout);
do
{
- line = pango_line_iter_get_line (iter);
- start_index = pango_line_get_start_index (line);
- length = pango_line_get_length (line);
+ line = pango2_line_iter_get_line (iter);
+ start_index = pango2_line_get_start_index (line);
+ length = pango2_line_get_length (line);
end_index = start_index + length;
if (index >= start_index && index <= end_index)
@@ -734,40 +734,40 @@ pango_layout_get_line_before (PangoLayout *layout,
prev_start_index = start_index;
prev_length = length;
}
- while (pango_line_iter_next_line (iter));
+ while (pango2_line_iter_next_line (iter));
if (!found)
{
start_index = prev_start_index + prev_length;
end_index = start_index;
}
- pango_line_iter_free (iter);
+ pango2_line_iter_free (iter);
*start_offset = g_utf8_pointer_to_offset (text, text + start_index);
*end_offset = g_utf8_pointer_to_offset (text, text + end_index);
}
static void
-pango_layout_get_line_at (PangoLayout *layout,
+pango2_layout_get_line_at (Pango2Layout *layout,
int offset,
AtspiTextBoundaryType boundary_type,
int *start_offset,
int *end_offset)
{
- PangoLineIter *iter;
- PangoLine *line, *prev_line = NULL;
+ Pango2LineIter *iter;
+ Pango2Line *line, *prev_line = NULL;
int index, start_index, length, end_index;
const char *text;
gboolean found = FALSE;
- text = pango_layout_get_text (layout);
+ text = pango2_layout_get_text (layout);
index = g_utf8_offset_to_pointer (text, offset) - text;
- iter = pango_layout_get_iter (layout);
+ iter = pango2_layout_get_iter (layout);
do
{
- line = pango_line_iter_get_line (iter);
- start_index = pango_line_get_start_index (line);
- length = pango_line_get_length (line);
+ line = pango2_line_iter_get_line (iter);
+ start_index = pango2_line_get_start_index (line);
+ length = pango2_line_get_length (line);
end_index = start_index + length;
if (index >= start_index && index <= end_index)
@@ -776,12 +776,12 @@ pango_layout_get_line_at (PangoLayout *layout,
switch (boundary_type)
{
case ATSPI_TEXT_BOUNDARY_LINE_START:
- if (pango_line_iter_next_line (iter))
- end_index = pango_line_get_start_index (pango_line_iter_get_line (iter));
+ if (pango2_line_iter_next_line (iter))
+ end_index = pango2_line_get_start_index (pango2_line_iter_get_line (iter));
break;
case ATSPI_TEXT_BOUNDARY_LINE_END:
if (prev_line)
- start_index = pango_line_get_start_index (prev_line) + pango_line_get_length (prev_line);
+ start_index = pango2_line_get_start_index (prev_line) + pango2_line_get_length (prev_line);
break;
case ATSPI_TEXT_BOUNDARY_CHAR:
case ATSPI_TEXT_BOUNDARY_WORD_START:
@@ -798,60 +798,60 @@ pango_layout_get_line_at (PangoLayout *layout,
prev_line = line;
}
- while (pango_line_iter_next_line (iter));
+ while (pango2_line_iter_next_line (iter));
if (!found)
{
- start_index = pango_line_get_start_index (prev_line) + pango_line_get_length (prev_line);
+ start_index = pango2_line_get_start_index (prev_line) + pango2_line_get_length (prev_line);
end_index = start_index;
}
- pango_line_iter_free (iter);
+ pango2_line_iter_free (iter);
*start_offset = g_utf8_pointer_to_offset (text, text + start_index);
*end_offset = g_utf8_pointer_to_offset (text, text + end_index);
}
static void
-pango_layout_get_line_after (PangoLayout *layout,
+pango2_layout_get_line_after (Pango2Layout *layout,
int offset,
AtspiTextBoundaryType boundary_type,
int *start_offset,
int *end_offset)
{
- PangoLineIter *iter;
- PangoLine *line, *prev_line = NULL;
+ Pango2LineIter *iter;
+ Pango2Line *line, *prev_line = NULL;
int index, start_index, length, end_index;
const char *text;
gboolean found = FALSE;
- text = pango_layout_get_text (layout);
+ text = pango2_layout_get_text (layout);
index = g_utf8_offset_to_pointer (text, offset) - text;
- iter = pango_layout_get_iter (layout);
+ iter = pango2_layout_get_iter (layout);
do
{
- line = pango_line_iter_get_line (iter);
- start_index = pango_line_get_start_index (line);
- length = pango_line_get_length (line);
+ line = pango2_line_iter_get_line (iter);
+ start_index = pango2_line_get_start_index (line);
+ length = pango2_line_get_length (line);
end_index = start_index + length;
if (index >= start_index && index <= end_index)
{
/* Found line for offset */
- if (pango_line_iter_next_line (iter))
+ if (pango2_line_iter_next_line (iter))
{
- line = pango_line_iter_get_line (iter);
+ line = pango2_line_iter_get_line (iter);
switch (boundary_type)
{
case ATSPI_TEXT_BOUNDARY_LINE_START:
- start_index = pango_line_get_start_index (line);
- if (pango_line_iter_next_line (iter))
- end_index = pango_line_get_start_index (pango_line_iter_get_line (iter));
+ start_index = pango2_line_get_start_index (line);
+ if (pango2_line_iter_next_line (iter))
+ end_index = pango2_line_get_start_index (pango2_line_iter_get_line (iter));
else
- end_index = start_index + pango_line_get_length (line);
+ end_index = start_index + pango2_line_get_length (line);
break;
case ATSPI_TEXT_BOUNDARY_LINE_END:
start_index = end_index;
- end_index = pango_line_get_start_index (line) + pango_line_get_length (line);
+ end_index = pango2_line_get_start_index (line) + pango2_line_get_length (line);
break;
case ATSPI_TEXT_BOUNDARY_CHAR:
case ATSPI_TEXT_BOUNDARY_WORD_START:
@@ -871,14 +871,14 @@ pango_layout_get_line_after (PangoLayout *layout,
prev_line = line;
}
- while (pango_line_iter_next_line (iter));
+ while (pango2_line_iter_next_line (iter));
if (!found)
{
- start_index = pango_line_get_start_index (prev_line) + pango_line_get_length (prev_line);
+ start_index = pango2_line_get_start_index (prev_line) + pango2_line_get_length (prev_line);
end_index = start_index;
}
- pango_line_iter_free (iter);
+ pango2_line_iter_free (iter);
*start_offset = g_utf8_pointer_to_offset (text, text + start_index);
*end_offset = g_utf8_pointer_to_offset (text, text + end_index);
@@ -886,7 +886,7 @@ pango_layout_get_line_after (PangoLayout *layout,
/*
* gtk_pango_get_text_before:
- * @layout: a `PangoLayout`
+ * @layout: a `Pango2Layout`
* @offset: a character offset in @layout
* @boundary_type: a #AtspiTextBoundaryType
* @start_offset: return location for the start of the returned text
@@ -902,7 +902,7 @@ pango_layout_get_line_after (PangoLayout *layout,
* from layout. Free with g_free().
*/
char *
-gtk_pango_get_text_before (PangoLayout *layout,
+gtk_pango_get_text_before (Pango2Layout *layout,
int offset,
AtspiTextBoundaryType boundary_type,
int *start_offset,
@@ -910,10 +910,10 @@ gtk_pango_get_text_before (PangoLayout *layout,
{
const char *text;
int start, end;
- const PangoLogAttr *attrs;
+ const Pango2LogAttr *attrs;
int n_attrs;
- text = pango_layout_get_text (layout);
+ text = pango2_layout_get_text (layout);
if (text[0] == 0)
{
@@ -922,7 +922,7 @@ gtk_pango_get_text_before (PangoLayout *layout,
return g_strdup ("");
}
- attrs = pango_layout_get_log_attrs (layout, &n_attrs);
+ attrs = pango2_layout_get_log_attrs (layout, &n_attrs);
start = offset;
end = start;
@@ -973,7 +973,7 @@ gtk_pango_get_text_before (PangoLayout *layout,
case ATSPI_TEXT_BOUNDARY_LINE_START:
case ATSPI_TEXT_BOUNDARY_LINE_END:
- pango_layout_get_line_before (layout, offset, boundary_type, &start, &end);
+ pango2_layout_get_line_before (layout, offset, boundary_type, &start, &end);
break;
default:
@@ -991,7 +991,7 @@ gtk_pango_get_text_before (PangoLayout *layout,
/*
* gtk_pango_get_text_after:
- * @layout: a `PangoLayout`
+ * @layout: a `Pango2Layout`
* @offset: a character offset in @layout
* @boundary_type: a #AtspiTextBoundaryType
* @start_offset: return location for the start of the returned text
@@ -1007,7 +1007,7 @@ gtk_pango_get_text_before (PangoLayout *layout,
* from layout. Free with g_free().
*/
char *
-gtk_pango_get_text_after (PangoLayout *layout,
+gtk_pango_get_text_after (Pango2Layout *layout,
int offset,
AtspiTextBoundaryType boundary_type,
int *start_offset,
@@ -1015,10 +1015,10 @@ gtk_pango_get_text_after (PangoLayout *layout,
{
const char *text;
int start, end;
- const PangoLogAttr *attrs;
+ const Pango2LogAttr *attrs;
int n_attrs;
- text = pango_layout_get_text (layout);
+ text = pango2_layout_get_text (layout);
if (text[0] == 0)
{
@@ -1027,7 +1027,7 @@ gtk_pango_get_text_after (PangoLayout *layout,
return g_strdup ("");
}
- attrs = pango_layout_get_log_attrs (layout, &n_attrs);
+ attrs = pango2_layout_get_log_attrs (layout, &n_attrs);
start = offset;
end = start;
@@ -1084,7 +1084,7 @@ gtk_pango_get_text_after (PangoLayout *layout,
case ATSPI_TEXT_BOUNDARY_LINE_START:
case ATSPI_TEXT_BOUNDARY_LINE_END:
- pango_layout_get_line_after (layout, offset, boundary_type, &start, &end);
+ pango2_layout_get_line_after (layout, offset, boundary_type, &start, &end);
break;
default:
@@ -1102,7 +1102,7 @@ gtk_pango_get_text_after (PangoLayout *layout,
/*
* gtk_pango_get_text_at:
- * @layout: a `PangoLayout`
+ * @layout: a `Pango2Layout`
* @offset: a character offset in @layout
* @boundary_type: a `AtspiTextBoundaryType`
* @start_offset: return location for the start of the returned text
@@ -1118,7 +1118,7 @@ gtk_pango_get_text_after (PangoLayout *layout,
* from layout. Free with g_free().
*/
char *
-gtk_pango_get_text_at (PangoLayout *layout,
+gtk_pango_get_text_at (Pango2Layout *layout,
int offset,
AtspiTextBoundaryType boundary_type,
int *start_offset,
@@ -1126,10 +1126,10 @@ gtk_pango_get_text_at (PangoLayout *layout,
{
const char *text;
int start, end;
- const PangoLogAttr *attrs;
+ const Pango2LogAttr *attrs;
int n_attrs;
- text = pango_layout_get_text (layout);
+ text = pango2_layout_get_text (layout);
if (text[0] == 0)
{
@@ -1138,7 +1138,7 @@ gtk_pango_get_text_at (PangoLayout *layout,
return g_strdup ("");
}
- attrs = pango_layout_get_log_attrs (layout, &n_attrs);
+ attrs = pango2_layout_get_log_attrs (layout, &n_attrs);
start = offset;
end = start;
@@ -1187,7 +1187,7 @@ gtk_pango_get_text_at (PangoLayout *layout,
case ATSPI_TEXT_BOUNDARY_LINE_START:
case ATSPI_TEXT_BOUNDARY_LINE_END:
- pango_layout_get_line_at (layout, offset, boundary_type, &start, &end);
+ pango2_layout_get_line_at (layout, offset, boundary_type, &start, &end);
break;
default:
@@ -1203,7 +1203,7 @@ gtk_pango_get_text_at (PangoLayout *layout,
return g_utf8_substring (text, start, end);
}
-char *gtk_pango_get_string_at (PangoLayout *layout,
+char *gtk_pango_get_string_at (Pango2Layout *layout,
int offset,
AtspiTextGranularity granularity,
int *start_offset,
@@ -1211,10 +1211,10 @@ char *gtk_pango_get_string_at (PangoLayout *layout,
{
const char *text;
int start, end;
- const PangoLogAttr *attrs;
+ const Pango2LogAttr *attrs;
int n_attrs;
- text = pango_layout_get_text (layout);
+ text = pango2_layout_get_text (layout);
if (text[0] == 0)
{
@@ -1223,7 +1223,7 @@ char *gtk_pango_get_string_at (PangoLayout *layout,
return g_strdup ("");
}
- attrs = pango_layout_get_log_attrs (layout, &n_attrs);
+ attrs = pango2_layout_get_log_attrs (layout, &n_attrs);
start = offset;
end = start;
@@ -1253,7 +1253,7 @@ char *gtk_pango_get_string_at (PangoLayout *layout,
break;
case ATSPI_TEXT_GRANULARITY_LINE:
- pango_layout_get_line_at (layout, offset, ATSPI_TEXT_BOUNDARY_LINE_START, &start, &end);
+ pango2_layout_get_line_at (layout, offset, ATSPI_TEXT_BOUNDARY_LINE_START, &start, &end);
break;
case ATSPI_TEXT_GRANULARITY_PARAGRAPH:
diff --git a/gtk/a11y/gtkatspipangoprivate.h b/gtk/a11y/gtkatspipangoprivate.h
index 14a20c9693..4473e2e42b 100644
--- a/gtk/a11y/gtkatspipangoprivate.h
+++ b/gtk/a11y/gtkatspipangoprivate.h
@@ -17,43 +17,43 @@
#pragma once
-#include <pango/pangocairo.h>
+#include <pango2/pangocairo.h>
#include "gtkatspiprivate.h"
G_BEGIN_DECLS
-const char *pango_wrap_mode_to_string (PangoWrapMode mode);
-const char *pango_line_style_to_string (PangoLineStyle underline);
-const char *pango_stretch_to_string (PangoStretch stretch);
-const char *pango_style_to_string (PangoStyle style);
-const char *pango_variant_to_string (PangoVariant variant);
+const char *pango_wrap_mode_to_string (Pango2WrapMode mode);
+const char *pango_line_style_to_string (Pango2LineStyle underline);
+const char *pango_stretch_to_string (Pango2Stretch stretch);
+const char *pango_style_to_string (Pango2Style style);
+const char *pango_variant_to_string (Pango2Variant variant);
-void gtk_pango_get_font_attributes (PangoFontDescription *font,
+void gtk_pango_get_font_attributes (Pango2FontDescription *font,
GVariantBuilder *builder);
-void gtk_pango_get_default_attributes (PangoLayout *layout,
+void gtk_pango_get_default_attributes (Pango2Layout *layout,
GVariantBuilder *builder);
-void gtk_pango_get_run_attributes (PangoLayout *layout,
+void gtk_pango_get_run_attributes (Pango2Layout *layout,
GVariantBuilder *builder,
int offset,
int *start_offset,
int *end_offset);
-char *gtk_pango_get_text_before (PangoLayout *layout,
+char *gtk_pango_get_text_before (Pango2Layout *layout,
int offset,
AtspiTextBoundaryType boundary_type,
int *start_offset,
int *end_offset);
-char *gtk_pango_get_text_at (PangoLayout *layout,
+char *gtk_pango_get_text_at (Pango2Layout *layout,
int offset,
AtspiTextBoundaryType boundary_type,
int *start_offset,
int *end_offset);
-char *gtk_pango_get_text_after (PangoLayout *layout,
+char *gtk_pango_get_text_after (Pango2Layout *layout,
int offset,
AtspiTextBoundaryType boundary_type,
int *start_offset,
int *end_offset);
-char *gtk_pango_get_string_at (PangoLayout *layout,
+char *gtk_pango_get_string_at (Pango2Layout *layout,
int offset,
AtspiTextGranularity granularity,
int *start_offset,
diff --git a/gtk/a11y/gtkatspitext.c b/gtk/a11y/gtkatspitext.c
index e7bd9275be..2c2a3b1324 100644
--- a/gtk/a11y/gtkatspitext.c
+++ b/gtk/a11y/gtkatspitext.c
@@ -109,7 +109,7 @@ label_handle_method (GDBusConnection *connection,
}
else if (g_strcmp0 (method_name, "GetTextBeforeOffset") == 0)
{
- PangoLayout *layout = gtk_label_get_layout (GTK_LABEL (widget));
+ Pango2Layout *layout = gtk_label_get_layout (GTK_LABEL (widget));
int offset;
AtspiTextBoundaryType boundary_type;
char *string;
@@ -124,7 +124,7 @@ label_handle_method (GDBusConnection *connection,
}
else if (g_strcmp0 (method_name, "GetTextAtOffset") == 0)
{
- PangoLayout *layout = gtk_label_get_layout (GTK_LABEL (widget));
+ Pango2Layout *layout = gtk_label_get_layout (GTK_LABEL (widget));
int offset;
AtspiTextBoundaryType boundary_type;
char *string;
@@ -139,7 +139,7 @@ label_handle_method (GDBusConnection *connection,
}
else if (g_strcmp0 (method_name, "GetTextAfterOffset") == 0)
{
- PangoLayout *layout = gtk_label_get_layout (GTK_LABEL (widget));
+ Pango2Layout *layout = gtk_label_get_layout (GTK_LABEL (widget));
int offset;
AtspiTextBoundaryType boundary_type;
char *string;
@@ -169,7 +169,7 @@ label_handle_method (GDBusConnection *connection,
}
else if (g_strcmp0 (method_name, "GetStringAtOffset") == 0)
{
- PangoLayout *layout = gtk_label_get_layout (GTK_LABEL (widget));
+ Pango2Layout *layout = gtk_label_get_layout (GTK_LABEL (widget));
int offset;
AtspiTextGranularity granularity;
char *string;
@@ -184,7 +184,7 @@ label_handle_method (GDBusConnection *connection,
}
else if (g_strcmp0 (method_name, "GetAttributes") == 0)
{
- PangoLayout *layout = gtk_label_get_layout (GTK_LABEL (widget));
+ Pango2Layout *layout = gtk_label_get_layout (GTK_LABEL (widget));
GVariantBuilder builder = G_VARIANT_BUILDER_INIT (G_VARIANT_TYPE ("a{ss}"));
int offset;
int start, end;
@@ -197,7 +197,7 @@ label_handle_method (GDBusConnection *connection,
}
else if (g_strcmp0 (method_name, "GetAttributeValue") == 0)
{
- PangoLayout *layout = gtk_label_get_layout (GTK_LABEL (widget));
+ Pango2Layout *layout = gtk_label_get_layout (GTK_LABEL (widget));
GVariantBuilder builder = G_VARIANT_BUILDER_INIT (G_VARIANT_TYPE ("a{ss}"));
int offset;
const char *name;
@@ -218,7 +218,7 @@ label_handle_method (GDBusConnection *connection,
}
else if (g_strcmp0 (method_name, "GetAttributeRun") == 0)
{
- PangoLayout *layout = gtk_label_get_layout (GTK_LABEL (widget));
+ Pango2Layout *layout = gtk_label_get_layout (GTK_LABEL (widget));
GVariantBuilder builder = G_VARIANT_BUILDER_INIT (G_VARIANT_TYPE ("a{ss}"));
int offset;
gboolean include_defaults;
@@ -236,7 +236,7 @@ label_handle_method (GDBusConnection *connection,
else if (g_strcmp0 (method_name, "GetDefaultAttributes") == 0 ||
g_strcmp0 (method_name, "GetDefaultAttributeSet") == 0)
{
- PangoLayout *layout = gtk_label_get_layout (GTK_LABEL (widget));
+ Pango2Layout *layout = gtk_label_get_layout (GTK_LABEL (widget));
GVariantBuilder builder = G_VARIANT_BUILDER_INIT (G_VARIANT_TYPE ("a{ss}"));
gtk_pango_get_default_attributes (layout, &builder);
@@ -462,7 +462,7 @@ inscription_handle_method (GDBusConnection *connection,
}
else if (g_strcmp0 (method_name, "GetTextBeforeOffset") == 0)
{
- PangoLayout *layout = gtk_inscription_get_layout (GTK_INSCRIPTION (widget));;
+ Pango2Layout *layout = gtk_inscription_get_layout (GTK_INSCRIPTION (widget));;
int offset;
AtspiTextBoundaryType boundary_type;
char *string;
@@ -477,7 +477,7 @@ inscription_handle_method (GDBusConnection *connection,
}
else if (g_strcmp0 (method_name, "GetTextAtOffset") == 0)
{
- PangoLayout *layout = gtk_inscription_get_layout (GTK_INSCRIPTION (widget));;
+ Pango2Layout *layout = gtk_inscription_get_layout (GTK_INSCRIPTION (widget));;
int offset;
AtspiTextBoundaryType boundary_type;
char *string;
@@ -492,7 +492,7 @@ inscription_handle_method (GDBusConnection *connection,
}
else if (g_strcmp0 (method_name, "GetTextAfterOffset") == 0)
{
- PangoLayout *layout = gtk_inscription_get_layout (GTK_INSCRIPTION (widget));;
+ Pango2Layout *layout = gtk_inscription_get_layout (GTK_INSCRIPTION (widget));;
int offset;
AtspiTextBoundaryType boundary_type;
char *string;
@@ -522,7 +522,7 @@ inscription_handle_method (GDBusConnection *connection,
}
else if (g_strcmp0 (method_name, "GetStringAtOffset") == 0)
{
- PangoLayout *layout = gtk_inscription_get_layout (GTK_INSCRIPTION (widget));;
+ Pango2Layout *layout = gtk_inscription_get_layout (GTK_INSCRIPTION (widget));;
int offset;
AtspiTextGranularity granularity;
char *string;
@@ -537,7 +537,7 @@ inscription_handle_method (GDBusConnection *connection,
}
else if (g_strcmp0 (method_name, "GetAttributes") == 0)
{
- PangoLayout *layout = gtk_inscription_get_layout (GTK_INSCRIPTION (widget));;
+ Pango2Layout *layout = gtk_inscription_get_layout (GTK_INSCRIPTION (widget));;
GVariantBuilder builder = G_VARIANT_BUILDER_INIT (G_VARIANT_TYPE ("a{ss}"));
int offset;
int start, end;
@@ -550,7 +550,7 @@ inscription_handle_method (GDBusConnection *connection,
}
else if (g_strcmp0 (method_name, "GetAttributeValue") == 0)
{
- PangoLayout *layout = gtk_inscription_get_layout (GTK_INSCRIPTION (widget));;
+ Pango2Layout *layout = gtk_inscription_get_layout (GTK_INSCRIPTION (widget));;
GVariantBuilder builder = G_VARIANT_BUILDER_INIT (G_VARIANT_TYPE ("a{ss}"));
int offset;
const char *name;
@@ -571,7 +571,7 @@ inscription_handle_method (GDBusConnection *connection,
}
else if (g_strcmp0 (method_name, "GetAttributeRun") == 0)
{
- PangoLayout *layout = gtk_inscription_get_layout (GTK_INSCRIPTION (widget));;
+ Pango2Layout *layout = gtk_inscription_get_layout (GTK_INSCRIPTION (widget));;
GVariantBuilder builder = G_VARIANT_BUILDER_INIT (G_VARIANT_TYPE ("a{ss}"));
int offset;
gboolean include_defaults;
@@ -589,7 +589,7 @@ inscription_handle_method (GDBusConnection *connection,
else if (g_strcmp0 (method_name, "GetDefaultAttributes") == 0 ||
g_strcmp0 (method_name, "GetDefaultAttributeSet") == 0)
{
- PangoLayout *layout = gtk_inscription_get_layout (GTK_INSCRIPTION (widget));;
+ Pango2Layout *layout = gtk_inscription_get_layout (GTK_INSCRIPTION (widget));;
GVariantBuilder builder = G_VARIANT_BUILDER_INIT (G_VARIANT_TYPE ("a{ss}"));
gtk_pango_get_default_attributes (layout, &builder);
@@ -759,7 +759,7 @@ editable_handle_method (GDBusConnection *connection,
}
else if (g_strcmp0 (method_name, "GetTextBeforeOffset") == 0)
{
- PangoLayout *layout = gtk_text_get_layout (text_widget);
+ Pango2Layout *layout = gtk_text_get_layout (text_widget);
int offset;
AtspiTextBoundaryType boundary_type;
char *string;
@@ -774,7 +774,7 @@ editable_handle_method (GDBusConnection *connection,
}
else if (g_strcmp0 (method_name, "GetTextAtOffset") == 0)
{
- PangoLayout *layout = gtk_text_get_layout (text_widget);
+ Pango2Layout *layout = gtk_text_get_layout (text_widget);
int offset;
AtspiTextBoundaryType boundary_type;
char *string;
@@ -789,7 +789,7 @@ editable_handle_method (GDBusConnection *connection,
}
else if (g_strcmp0 (method_name, "GetTextAfterOffset") == 0)
{
- PangoLayout *layout = gtk_text_get_layout (text_widget);
+ Pango2Layout *layout = gtk_text_get_layout (text_widget);
int offset;
AtspiTextBoundaryType boundary_type;
char *string;
@@ -818,7 +818,7 @@ editable_handle_method (GDBusConnection *connection,
}
else if (g_strcmp0 (method_name, "GetStringAtOffset") == 0)
{
- PangoLayout *layout = gtk_text_get_layout (text_widget);
+ Pango2Layout *layout = gtk_text_get_layout (text_widget);
int offset;
AtspiTextGranularity granularity;
char *string;
@@ -833,7 +833,7 @@ editable_handle_method (GDBusConnection *connection,
}
else if (g_strcmp0 (method_name, "GetAttributes") == 0)
{
- PangoLayout *layout = gtk_text_get_layout (text_widget);
+ Pango2Layout *layout = gtk_text_get_layout (text_widget);
GVariantBuilder builder = G_VARIANT_BUILDER_INIT (G_VARIANT_TYPE ("a{ss}"));
int offset;
int start, end;
@@ -846,7 +846,7 @@ editable_handle_method (GDBusConnection *connection,
}
else if (g_strcmp0 (method_name, "GetAttributeValue") == 0)
{
- PangoLayout *layout = gtk_text_get_layout (text_widget);
+ Pango2Layout *layout = gtk_text_get_layout (text_widget);
GVariantBuilder builder = G_VARIANT_BUILDER_INIT (G_VARIANT_TYPE ("a{ss}"));
int offset;
const char *name;
@@ -866,7 +866,7 @@ editable_handle_method (GDBusConnection *connection,
}
else if (g_strcmp0 (method_name, "GetAttributeRun") == 0)
{
- PangoLayout *layout = gtk_text_get_layout (text_widget);
+ Pango2Layout *layout = gtk_text_get_layout (text_widget);
GVariantBuilder builder = G_VARIANT_BUILDER_INIT (G_VARIANT_TYPE ("a{ss}"));
int offset;
gboolean include_defaults;
@@ -884,7 +884,7 @@ editable_handle_method (GDBusConnection *connection,
else if (g_strcmp0 (method_name, "GetDefaultAttributes") == 0 ||
g_strcmp0 (method_name, "GetDefaultAttributeSet") == 0)
{
- PangoLayout *layout = gtk_text_get_layout (text_widget);
+ Pango2Layout *layout = gtk_text_get_layout (text_widget);
GVariantBuilder builder = G_VARIANT_BUILDER_INIT (G_VARIANT_TYPE ("a{ss}"));
gtk_pango_get_default_attributes (layout, &builder);
diff --git a/gtk/a11y/gtkatspitextbuffer.c b/gtk/a11y/gtkatspitextbuffer.c
index 4a2f109907..9bddb0d7f8 100644
--- a/gtk/a11y/gtkatspitextbuffer.c
+++ b/gtk/a11y/gtkatspitextbuffer.c
@@ -58,7 +58,7 @@ gtk_text_direction_to_string (GtkTextDirection direction)
static const char *
gtk_wrap_mode_to_string (GtkWrapMode wrap_mode)
{
- /* Keep these in sync with pango_wrap_mode_to_string(); note that
+ /* Keep these in sync with pango2_wrap_mode_to_string(); note that
* here we have an extra case for NONE.
*/
switch (wrap_mode)
@@ -81,7 +81,7 @@ gtk_text_view_add_default_attributes (GtkTextView *view,
GVariantBuilder *builder)
{
GtkTextAttributes *text_attrs;
- PangoFontDescription *font;
+ Pango2FontDescription *font;
char *value;
text_attrs = gtk_text_view_get_default_attributes (view);
@@ -190,7 +190,7 @@ gtk_text_buffer_get_run_attributes (GtkTextBuffer *buffer,
while (temp_tags && !val_set)
{
GtkTextTag *tag = GTK_TEXT_TAG (temp_tags->data);
- PangoStyle style;
+ Pango2Style style;
g_object_get (tag,
"style-set", &val_set,
@@ -206,7 +206,7 @@ gtk_text_buffer_get_run_attributes (GtkTextBuffer *buffer,
while (temp_tags && !val_set)
{
GtkTextTag *tag = GTK_TEXT_TAG (temp_tags->data);
- PangoVariant variant;
+ Pango2Variant variant;
g_object_get (tag,
"variant-set", &val_set,
@@ -222,7 +222,7 @@ gtk_text_buffer_get_run_attributes (GtkTextBuffer *buffer,
while (temp_tags && !val_set)
{
GtkTextTag *tag = GTK_TEXT_TAG (temp_tags->data);
- PangoStretch stretch;
+ Pango2Stretch stretch;
g_object_get (tag,
"stretch-set", &val_set,
@@ -455,7 +455,7 @@ gtk_text_buffer_get_run_attributes (GtkTextBuffer *buffer,
while (temp_tags && !val_set)
{
GtkTextTag *tag = GTK_TEXT_TAG (temp_tags->data);
- PangoLineStyle underline;
+ Pango2LineStyle underline;
g_object_get (tag,
"underline-set", &val_set,
diff --git a/gtk/gskpango.c b/gtk/gskpango.c
index 25ffa07aac..1dae8ffcff 100644
--- a/gtk/gskpango.c
+++ b/gtk/gskpango.c
@@ -30,10 +30,10 @@
#include <math.h>
-#include <pango/pango.h>
+#include <pango2/pango.h>
#include <cairo.h>
-G_DEFINE_TYPE (GskPangoRenderer, gsk_pango_renderer, PANGO_TYPE_RENDERER)
+G_DEFINE_TYPE (GskPangoRenderer, gsk_pango_renderer, PANGO2_TYPE_RENDERER)
void
gsk_pango_renderer_set_state (GskPangoRenderer *crenderer,
@@ -46,10 +46,10 @@ gsk_pango_renderer_set_state (GskPangoRenderer *crenderer,
static void
get_color (GskPangoRenderer *crenderer,
- PangoRenderPart part,
+ Pango2RenderPart part,
GdkRGBA *rgba)
{
- const PangoColor *color = pango_renderer_get_color ((PangoRenderer *) (crenderer), part);
+ const Pango2Color *color = pango2_renderer_get_color ((Pango2Renderer *) (crenderer), part);
if (color)
{
@@ -66,7 +66,7 @@ get_color (GskPangoRenderer *crenderer,
static void
set_color (GskPangoRenderer *crenderer,
- PangoRenderPart part,
+ Pango2RenderPart part,
cairo_t *cr)
{
GdkRGBA rgba = { 1, 192./255., 203./255., 1 };
@@ -76,30 +76,30 @@ set_color (GskPangoRenderer *crenderer,
}
static void
-gsk_pango_renderer_draw_run (PangoRenderer *renderer,
+gsk_pango_renderer_draw_run (Pango2Renderer *renderer,
const char *text,
- PangoRun *run,
+ Pango2Run *run,
int x,
int y)
{
GskPangoRenderer *crenderer = (GskPangoRenderer *) (renderer);
GdkRGBA color = { 0, 0, 0, 1 };
- PangoItem *item = pango_run_get_item (run);
- PangoGlyphString *glyphs = pango_run_get_glyphs (run);
+ Pango2Item *item = pango2_run_get_item (run);
+ Pango2GlyphString *glyphs = pango2_run_get_glyphs (run);
- get_color (crenderer, PANGO_RENDER_PART_FOREGROUND, &color);
+ get_color (crenderer, PANGO2_RENDER_PART_FOREGROUND, &color);
gtk_snapshot_append_text (crenderer->snapshot,
- pango_analysis_get_font (pango_item_get_analysis (item)),
+ pango2_analysis_get_font (pango2_item_get_analysis (item)),
glyphs,
&color,
- (float) x / PANGO_SCALE,
- (float) y / PANGO_SCALE);
+ (float) x / PANGO2_SCALE,
+ (float) y / PANGO2_SCALE);
}
static void
-gsk_pango_renderer_draw_rectangle (PangoRenderer *renderer,
- PangoRenderPart part,
+gsk_pango_renderer_draw_rectangle (Pango2Renderer *renderer,
+ Pango2RenderPart part,
int x,
int y,
int width,
@@ -112,15 +112,15 @@ gsk_pango_renderer_draw_rectangle (PangoRenderer *renderer,
gtk_snapshot_append_color (crenderer->snapshot,
&color,
- &GRAPHENE_RECT_INIT ((double)x / PANGO_SCALE,
- (double)y / PANGO_SCALE,
- (double)width / PANGO_SCALE,
- (double)height / PANGO_SCALE));
+ &GRAPHENE_RECT_INIT ((double)x / PANGO2_SCALE,
+ (double)y / PANGO2_SCALE,
+ (double)width / PANGO2_SCALE,
+ (double)height / PANGO2_SCALE));
}
static void
-gsk_pango_renderer_draw_trapezoid (PangoRenderer *renderer,
- PangoRenderPart part,
+gsk_pango_renderer_draw_trapezoid (Pango2Renderer *renderer,
+ Pango2RenderPart part,
double y1_,
double x11,
double x21,
@@ -129,17 +129,17 @@ gsk_pango_renderer_draw_trapezoid (PangoRenderer *renderer,
double x22)
{
GskPangoRenderer *crenderer = (GskPangoRenderer *) (renderer);
- PangoLines *lines;
- PangoRectangle ink_rect;
+ Pango2Lines *lines;
+ Pango2Rectangle ink_rect;
cairo_t *cr;
double x, y;
- lines = pango_renderer_get_lines (renderer);
+ lines = pango2_renderer_get_lines (renderer);
if (!lines)
return;
- pango_lines_get_extents (lines, &ink_rect, NULL);
- pango_extents_to_pixels (&ink_rect, NULL);
+ pango2_lines_get_extents (lines, &ink_rect, NULL);
+ pango2_extents_to_pixels (&ink_rect, NULL);
cr = gtk_snapshot_append_cairo (crenderer->snapshot,
&GRAPHENE_RECT_INIT (ink_rect.x, ink_rect.y,
ink_rect.width, ink_rect.height));
@@ -161,8 +161,9 @@ gsk_pango_renderer_draw_trapezoid (PangoRenderer *renderer,
cairo_destroy (cr);
}
+#if 0
static void
-gsk_pango_renderer_draw_error_underline (PangoRenderer *renderer,
+gsk_pango_renderer_draw_error_underline (Pango2Renderer *renderer,
int x,
int y,
int width,
@@ -173,12 +174,12 @@ gsk_pango_renderer_draw_error_underline (PangoRenderer *renderer,
GdkRGBA rgba;
GskRoundedRect dot;
- xx = (double)x / PANGO_SCALE;
- yy = (double)y / PANGO_SCALE;
- ww = (double)width / PANGO_SCALE;
- hh = (double)height / PANGO_SCALE;
+ xx = (double)x / PANGO2_SCALE;
+ yy = (double)y / PANGO2_SCALE;
+ ww = (double)width / PANGO2_SCALE;
+ hh = (double)height / PANGO2_SCALE;
- get_color (crenderer, PANGO_RENDER_PART_UNDERLINE, &rgba);
+ get_color (crenderer, PANGO2_RENDER_PART_UNDERLINE, &rgba);
gtk_snapshot_push_repeat (crenderer->snapshot,
&GRAPHENE_RECT_INIT (xx, yy, ww, hh),
@@ -197,14 +198,45 @@ gsk_pango_renderer_draw_error_underline (PangoRenderer *renderer,
gtk_snapshot_pop (crenderer->snapshot);
}
+#endif
+
+static void
+gsk_pango_renderer_draw_shape (Pango2Renderer *renderer,
+ Pango2Rectangle *ink_rect,
+ Pango2Rectangle *logical_rect,
+ gpointer data,
+ int x,
+ int y)
+{
+ GskPangoRenderer *crenderer = (GskPangoRenderer *) (renderer);
+
+ if (crenderer->shape_handler)
+ {
+ double shape_x = (double)x / PANGO2_SCALE;
+ double shape_y = (double) (y + logical_rect->y) / PANGO2_SCALE;
+
+ if (shape_x != 0 || shape_y != 0)
+ {
+ gtk_snapshot_save (crenderer->snapshot);
+ gtk_snapshot_translate (crenderer->snapshot, &GRAPHENE_POINT_INIT (shape_x, shape_y));
+ }
+
+ crenderer->shape_handler (data,
+ crenderer->snapshot,
+ (double)logical_rect->width / PANGO2_SCALE,
+ (double)logical_rect->height / PANGO2_SCALE);
+ if (shape_x != 0 || shape_y != 0)
+ gtk_snapshot_restore (crenderer->snapshot);
+ }
+}
static void
text_renderer_set_rgba (GskPangoRenderer *crenderer,
- PangoRenderPart part,
+ Pango2RenderPart part,
const GdkRGBA *rgba)
{
- PangoRenderer *renderer = PANGO_RENDERER (crenderer);
- PangoColor color = { 0, };
+ Pango2Renderer *renderer = PANGO2_RENDERER (crenderer);
+ Pango2Color color = { 0, };
if (rgba)
{
@@ -212,27 +244,27 @@ text_renderer_set_rgba (GskPangoRenderer *crenderer,
color.green = (guint16)(rgba->green * 65535);
color.blue = (guint16)(rgba->blue * 65535);
color.alpha = (guint16)(rgba->alpha * 65535);
- pango_renderer_set_color (renderer, part, &color);
+ pango2_renderer_set_color (renderer, part, &color);
}
else
{
- pango_renderer_set_color (renderer, part, NULL);
+ pango2_renderer_set_color (renderer, part, NULL);
}
}
static GtkTextAppearance *
-get_item_appearance (PangoItem *item)
+get_item_appearance (Pango2Item *item)
{
GSList *tmp_list;
- tmp_list = pango_analysis_get_extra_attributes (pango_item_get_analysis (item));
+ tmp_list = pango2_analysis_get_extra_attributes (pango2_item_get_analysis (item));
while (tmp_list)
{
- PangoAttribute *attr = tmp_list->data;
+ Pango2Attribute *attr = tmp_list->data;
- if (pango_attribute_type (attr) == gtk_text_attr_appearance_type)
- return (GtkTextAppearance *)pango_attribute_get_pointer (attr);
+ if (pango2_attribute_type (attr) == gtk_text_attr_appearance_type)
+ return (GtkTextAppearance *)pango2_attribute_get_pointer (attr);
tmp_list = tmp_list->next;
}
@@ -241,17 +273,17 @@ get_item_appearance (PangoItem *item)
}
static void
-gsk_pango_renderer_prepare_run (PangoRenderer *renderer,
- PangoRun *run)
+gsk_pango_renderer_prepare_run (Pango2Renderer *renderer,
+ Pango2Run *run)
{
GskPangoRenderer *crenderer = GSK_PANGO_RENDERER (renderer);
const GdkRGBA *bg_rgba = NULL;
const GdkRGBA *fg_rgba = NULL;
GtkTextAppearance *appearance;
- PANGO_RENDERER_CLASS (gsk_pango_renderer_parent_class)->prepare_run (renderer, run);
+ PANGO2_RENDERER_CLASS (gsk_pango_renderer_parent_class)->prepare_run (renderer, run);
- appearance = get_item_appearance (pango_run_get_item (run));
+ appearance = get_item_appearance (pango2_run_get_item (run));
if (appearance == NULL)
return;
@@ -261,7 +293,7 @@ gsk_pango_renderer_prepare_run (PangoRenderer *renderer,
else
bg_rgba = NULL;
- text_renderer_set_rgba (crenderer, PANGO_RENDER_PART_BACKGROUND, bg_rgba);
+ text_renderer_set_rgba (crenderer, PANGO2_RENDER_PART_BACKGROUND, bg_rgba);
if (crenderer->state == GSK_PANGO_RENDERER_SELECTED &&
GTK_IS_TEXT_VIEW (crenderer->widget))
@@ -285,16 +317,16 @@ gsk_pango_renderer_prepare_run (PangoRenderer *renderer,
else
fg_rgba = appearance->fg_rgba;
- text_renderer_set_rgba (crenderer, PANGO_RENDER_PART_FOREGROUND, fg_rgba);
+ text_renderer_set_rgba (crenderer, PANGO2_RENDER_PART_FOREGROUND, fg_rgba);
if (appearance->strikethrough_rgba)
- text_renderer_set_rgba (crenderer, PANGO_RENDER_PART_STRIKETHROUGH, appearance->strikethrough_rgba);
+ text_renderer_set_rgba (crenderer, PANGO2_RENDER_PART_STRIKETHROUGH, appearance->strikethrough_rgba);
else
- text_renderer_set_rgba (crenderer, PANGO_RENDER_PART_STRIKETHROUGH, fg_rgba);
+ text_renderer_set_rgba (crenderer, PANGO2_RENDER_PART_STRIKETHROUGH, fg_rgba);
if (appearance->underline_rgba)
- text_renderer_set_rgba (crenderer, PANGO_RENDER_PART_UNDERLINE, appearance->underline_rgba);
- else if (appearance->underline == PANGO_LINE_STYLE_DOTTED)
+ text_renderer_set_rgba (crenderer, PANGO2_RENDER_PART_UNDERLINE, appearance->underline_rgba);
+ else if (appearance->underline == PANGO2_LINE_STYLE_DOTTED)
{
if (!crenderer->error_color)
{
@@ -302,15 +334,15 @@ gsk_pango_renderer_prepare_run (PangoRenderer *renderer,
crenderer->error_color = gdk_rgba_copy (&red);
}
- text_renderer_set_rgba (crenderer, PANGO_RENDER_PART_UNDERLINE, crenderer->error_color);
+ text_renderer_set_rgba (crenderer, PANGO2_RENDER_PART_UNDERLINE, crenderer->error_color);
}
else
- text_renderer_set_rgba (crenderer, PANGO_RENDER_PART_UNDERLINE, fg_rgba);
+ text_renderer_set_rgba (crenderer, PANGO2_RENDER_PART_UNDERLINE, fg_rgba);
if (appearance->overline_rgba)
- text_renderer_set_rgba (crenderer, PANGO_RENDER_PART_OVERLINE, appearance->overline_rgba);
+ text_renderer_set_rgba (crenderer, PANGO2_RENDER_PART_OVERLINE, appearance->overline_rgba);
else
- text_renderer_set_rgba (crenderer, PANGO_RENDER_PART_OVERLINE, fg_rgba);
+ text_renderer_set_rgba (crenderer, PANGO2_RENDER_PART_OVERLINE, fg_rgba);
}
@@ -322,12 +354,13 @@ gsk_pango_renderer_init (GskPangoRenderer *renderer G_GNUC_UNUSED)
static void
gsk_pango_renderer_class_init (GskPangoRendererClass *klass)
{
- PangoRendererClass *renderer_class = PANGO_RENDERER_CLASS (klass);
+ Pango2RendererClass *renderer_class = PANGO2_RENDERER_CLASS (klass);
renderer_class->draw_run = gsk_pango_renderer_draw_run;
renderer_class->draw_rectangle = gsk_pango_renderer_draw_rectangle;
renderer_class->draw_trapezoid = gsk_pango_renderer_draw_trapezoid;
- renderer_class->draw_error_underline = gsk_pango_renderer_draw_error_underline;
+ //renderer_class->draw_error_underline = gsk_pango_renderer_draw_error_underline;
+ renderer_class->draw_shape = gsk_pango_renderer_draw_shape;
renderer_class->prepare_run = gsk_pango_renderer_prepare_run;
}
@@ -383,7 +416,7 @@ gsk_pango_renderer_release (GskPangoRenderer *renderer)
/**
* gtk_snapshot_append_layout:
* @snapshot: a `GtkSnapshot`
- * @layout: the `PangoLayout` to render
+ * @layout: the `Pango2Layout` to render
* @color: the foreground color to render the layout in
*
* Creates render nodes for rendering @layout in the given foregound @color
@@ -392,40 +425,40 @@ gsk_pango_renderer_release (GskPangoRenderer *renderer)
**/
void
gtk_snapshot_append_layout (GtkSnapshot *snapshot,
- PangoLayout *layout,
+ Pango2Layout *layout,
const GdkRGBA *color)
{
GskPangoRenderer *crenderer;
g_return_if_fail (snapshot != NULL);
- g_return_if_fail (PANGO_IS_LAYOUT (layout));
+ g_return_if_fail (PANGO2_IS_LAYOUT (layout));
crenderer = gsk_pango_renderer_acquire ();
crenderer->snapshot = snapshot;
crenderer->fg_color = color;
- pango_renderer_draw_lines (PANGO_RENDERER (crenderer), pango_layout_get_lines (layout), 0, 0);
+ pango2_renderer_draw_lines (PANGO2_RENDERER (crenderer), pango2_layout_get_lines (layout), 0, 0);
gsk_pango_renderer_release (crenderer);
}
void
gtk_snapshot_append_lines (GtkSnapshot *snapshot,
- PangoLines *lines,
+ Pango2Lines *lines,
const GdkRGBA *color)
{
GskPangoRenderer *crenderer;
g_return_if_fail (snapshot != NULL);
- g_return_if_fail (PANGO_IS_LINES (lines));
+ g_return_if_fail (PANGO2_IS_LINES (lines));
crenderer = gsk_pango_renderer_acquire ();
crenderer->snapshot = snapshot;
crenderer->fg_color = color;
- pango_renderer_draw_lines (PANGO_RENDERER (crenderer), lines, 0, 0);
+ pango2_renderer_draw_lines (PANGO2_RENDERER (crenderer), lines, 0, 0);
gsk_pango_renderer_release (crenderer);
}
diff --git a/gtk/gskpango.h b/gtk/gskpango.h
index 01280b9a71..70a9e05712 100644
--- a/gtk/gskpango.h
+++ b/gtk/gskpango.h
@@ -19,7 +19,7 @@
#ifndef __GSK_PANGO_H__
#define __GSK_PANGO_H__
-#include <pango/pango.h>
+#include <pango2/pango.h>
#include "gtk/gtksnapshot.h"
G_BEGIN_DECLS
@@ -54,7 +54,7 @@ typedef gboolean (*GskPangoShapeHandler) (gpointer data,
struct _GskPangoRenderer
{
- PangoRenderer parent_instance;
+ Pango2Renderer parent_instance;
GtkWidget *widget;
GtkSnapshot *snapshot;
@@ -72,7 +72,7 @@ struct _GskPangoRenderer
struct _GskPangoRendererClass
{
- PangoRendererClass parent_class;
+ Pango2RendererClass parent_class;
};
GType gsk_pango_renderer_get_type (void) G_GNUC_CONST;
diff --git a/gtk/gtkaboutdialog.c b/gtk/gtkaboutdialog.c
index c373ccfea9..8a44d1ed25 100644
--- a/gtk/gtkaboutdialog.c
+++ b/gtk/gtkaboutdialog.c
@@ -1892,7 +1892,7 @@ text_buffer_new (GtkAboutDialog *about,
tag = gtk_text_buffer_create_tag (buffer, NULL,
"foreground-rgba", &color,
- "underline", PANGO_LINE_STYLE_SOLID,
+ "underline", PANGO2_LINE_STYLE_SOLID,
NULL);
if (strcmp (link_type, "email") == 0)
{
@@ -1923,7 +1923,7 @@ text_buffer_new (GtkAboutDialog *about,
}
tag = gtk_text_buffer_create_tag (buffer, NULL,
- "scale", PANGO_SCALE_SMALL,
+ "scale", PANGO2_SCALE_SMALL,
NULL);
gtk_text_buffer_get_start_iter (buffer, &start_iter);
diff --git a/gtk/gtkappchooserdialog.c b/gtk/gtkappchooserdialog.c
index 62b4d858bc..e48a8a6782 100644
--- a/gtk/gtkappchooserdialog.c
+++ b/gtk/gtkappchooserdialog.c
@@ -234,7 +234,7 @@ set_dialog_properties (GtkAppChooserDialog *self)
label = gtk_label_new (title);
gtk_widget_set_halign (label, GTK_ALIGN_CENTER);
gtk_label_set_single_line_mode (GTK_LABEL (label), TRUE);
- gtk_label_set_ellipsize (GTK_LABEL (label), PANGO_ELLIPSIZE_END);
+ gtk_label_set_ellipsize (GTK_LABEL (label), PANGO2_ELLIPSIZE_END);
gtk_label_set_width_chars (GTK_LABEL (label), 5);
gtk_widget_add_css_class (label, "title");
gtk_widget_set_parent (label, box);
@@ -244,7 +244,7 @@ set_dialog_properties (GtkAppChooserDialog *self)
label = gtk_label_new (subtitle);
gtk_widget_set_halign (label, GTK_ALIGN_CENTER);
gtk_label_set_single_line_mode (GTK_LABEL (label), TRUE);
- gtk_label_set_ellipsize (GTK_LABEL (label), PANGO_ELLIPSIZE_END);
+ gtk_label_set_ellipsize (GTK_LABEL (label), PANGO2_ELLIPSIZE_END);
gtk_widget_add_css_class (label, "subtitle");
gtk_widget_set_parent (label, box);
}
diff --git a/gtk/gtkcellrendererprogress.c b/gtk/gtkcellrendererprogress.c
index 076607cc09..ded915dcf7 100644
--- a/gtk/gtkcellrendererprogress.c
+++ b/gtk/gtkcellrendererprogress.c
@@ -284,13 +284,13 @@ compute_dimensions (GtkCellRenderer *cell,
int *width,
int *height)
{
- PangoRectangle logical_rect;
- PangoLayout *layout;
+ Pango2Rectangle logical_rect;
+ Pango2Layout *layout;
int xpad, ypad;
layout = gtk_widget_create_pango_layout (widget, text);
- pango_lines_get_extents (pango_layout_get_lines (layout), NULL, &logical_rect);
- pango_extents_to_pixels (&logical_rect, NULL);
+ pango2_lines_get_extents (pango2_layout_get_lines (layout), NULL, &logical_rect);
+ pango2_extents_to_pixels (&logical_rect, NULL);
gtk_cell_renderer_get_padding (cell, &xpad, &ypad);
@@ -419,8 +419,8 @@ gtk_cell_renderer_progress_snapshot (GtkCellRenderer *cell,
GtkCellRendererProgressPrivate *priv = gtk_cell_renderer_progress_get_instance_private (cellprogress);
GtkStyleContext *context;
GtkBorder padding;
- PangoLayout *layout;
- PangoRectangle logical_rect;
+ Pango2Layout *layout;
+ Pango2Rectangle logical_rect;
int x, y, w, h, x_pos, y_pos, bar_position, bar_size, start, full_size;
int xpad, ypad;
GdkRectangle clip;
@@ -507,8 +507,8 @@ gtk_cell_renderer_progress_snapshot (GtkCellRenderer *cell,
float text_xalign;
layout = gtk_widget_create_pango_layout (widget, priv->label);
- pango_lines_get_extents (pango_layout_get_lines (layout), NULL, &logical_rect);
- pango_extents_to_pixels (&logical_rect, NULL);
+ pango2_lines_get_extents (pango2_layout_get_lines (layout), NULL, &logical_rect);
+ pango2_extents_to_pixels (&logical_rect, NULL);
if (gtk_widget_get_direction (widget) != GTK_TEXT_DIR_LTR)
text_xalign = 1.0 - priv->text_xalign;
diff --git a/gtk/gtkcellrenderertext.c b/gtk/gtkcellrenderertext.c
index f580356d21..ee4ac5b68d 100644
--- a/gtk/gtkcellrenderertext.c
+++ b/gtk/gtkcellrenderertext.c
@@ -166,15 +166,15 @@ struct _GtkCellRendererTextPrivate
{
GtkWidget *entry;
- PangoAttrList *extra_attrs;
+ Pango2AttrList *extra_attrs;
GdkRGBA foreground;
GdkRGBA background;
- PangoAlignment align;
- PangoEllipsizeMode ellipsize;
- PangoFontDescription *font;
- PangoLanguage *language;
- PangoLineStyle underline_style;
- PangoWrapMode wrap_mode;
+ Pango2Alignment align;
+ Pango2EllipsizeMode ellipsize;
+ Pango2FontDescription *font;
+ Pango2Language *language;
+ Pango2LineStyle underline_style;
+ Pango2WrapMode wrap_mode;
char *text;
char *placeholder_text;
@@ -220,13 +220,13 @@ gtk_cell_renderer_text_init (GtkCellRendererText *celltext)
gtk_cell_renderer_set_padding (cell, 2, 2);
priv->font_scale = 1.0;
priv->fixed_height_rows = -1;
- priv->font = pango_font_description_new ();
+ priv->font = pango2_font_description_new ();
priv->width_chars = -1;
priv->max_width_chars = -1;
priv->wrap_width = -1;
- priv->wrap_mode = PANGO_WRAP_CHAR;
- priv->align = PANGO_ALIGN_LEFT;
+ priv->wrap_mode = PANGO2_WRAP_CHAR;
+ priv->align = PANGO2_ALIGN_LEFT;
priv->align_set = FALSE;
}
@@ -260,7 +260,7 @@ gtk_cell_renderer_text_class_init (GtkCellRendererTextClass *class)
text_cell_renderer_props[PROP_ATTRIBUTES] =
g_param_spec_boxed ("attributes", NULL, NULL,
- PANGO_TYPE_ATTR_LIST,
+ PANGO2_TYPE_ATTR_LIST,
GTK_PARAM_READWRITE);
text_cell_renderer_props[PROP_SINGLE_PARAGRAPH_MODE] =
@@ -310,7 +310,7 @@ gtk_cell_renderer_text_class_init (GtkCellRendererTextClass *class)
text_cell_renderer_props[PROP_FONT_DESC] =
g_param_spec_boxed ("font-desc", NULL, NULL,
- PANGO_TYPE_FONT_DESCRIPTION,
+ PANGO2_TYPE_FONT_DESCRIPTION,
GTK_PARAM_READWRITE);
text_cell_renderer_props[PROP_FAMILY] =
@@ -320,26 +320,26 @@ gtk_cell_renderer_text_class_init (GtkCellRendererTextClass *class)
text_cell_renderer_props[PROP_STYLE] =
g_param_spec_enum ("style", NULL, NULL,
- PANGO_TYPE_STYLE,
- PANGO_STYLE_NORMAL,
+ PANGO2_TYPE_STYLE,
+ PANGO2_STYLE_NORMAL,
GTK_PARAM_READWRITE);
text_cell_renderer_props[PROP_VARIANT] =
g_param_spec_enum ("variant", NULL, NULL,
- PANGO_TYPE_VARIANT,
- PANGO_VARIANT_NORMAL,
+ PANGO2_TYPE_VARIANT,
+ PANGO2_VARIANT_NORMAL,
GTK_PARAM_READWRITE);
text_cell_renderer_props[PROP_WEIGHT] =
g_param_spec_int ("weight", NULL, NULL,
0, G_MAXINT,
- PANGO_WEIGHT_NORMAL,
+ PANGO2_WEIGHT_NORMAL,
GTK_PARAM_READWRITE);
text_cell_renderer_props[PROP_STRETCH] =
g_param_spec_enum ("stretch", NULL, NULL,
- PANGO_TYPE_STRETCH,
- PANGO_STRETCH_NORMAL,
+ PANGO2_TYPE_STRETCH,
+ PANGO2_STRETCH_NORMAL,
GTK_PARAM_READWRITE);
text_cell_renderer_props[PROP_SIZE] =
@@ -374,8 +374,8 @@ gtk_cell_renderer_text_class_init (GtkCellRendererTextClass *class)
text_cell_renderer_props[PROP_UNDERLINE] =
g_param_spec_enum ("underline", NULL, NULL,
- PANGO_TYPE_LINE_STYLE,
- PANGO_LINE_STYLE_NONE,
+ PANGO2_TYPE_LINE_STYLE,
+ PANGO2_LINE_STYLE_NONE,
GTK_PARAM_READWRITE);
text_cell_renderer_props[PROP_LANGUAGE] =
@@ -388,13 +388,13 @@ gtk_cell_renderer_text_class_init (GtkCellRendererTextClass *class)
*
* Specifies the preferred place to ellipsize the string, if the cell renderer
* does not have enough room to display the entire string. Setting it to
- * %PANGO_ELLIPSIZE_NONE turns off ellipsizing. See the wrap-width property
+ * %PANGO2_ELLIPSIZE_NONE turns off ellipsizing. See the wrap-width property
* for another way of making the text fit into a given width.
*/
text_cell_renderer_props[PROP_ELLIPSIZE] =
g_param_spec_enum ("ellipsize", NULL, NULL,
- PANGO_TYPE_ELLIPSIZE_MODE,
- PANGO_ELLIPSIZE_NONE,
+ PANGO2_TYPE_ELLIPSIZE_MODE,
+ PANGO2_ELLIPSIZE_NONE,
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
/**
@@ -437,8 +437,8 @@ gtk_cell_renderer_text_class_init (GtkCellRendererTextClass *class)
*/
text_cell_renderer_props[PROP_WRAP_MODE] =
g_param_spec_enum ("wrap-mode", NULL, NULL,
- PANGO_TYPE_WRAP_MODE,
- PANGO_WRAP_CHAR,
+ PANGO2_TYPE_WRAP_MODE,
+ PANGO2_WRAP_CHAR,
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
/**
@@ -465,8 +465,8 @@ gtk_cell_renderer_text_class_init (GtkCellRendererTextClass *class)
*/
text_cell_renderer_props[PROP_ALIGN] =
g_param_spec_enum ("alignment", NULL, NULL,
- PANGO_TYPE_ALIGNMENT,
- PANGO_ALIGN_LEFT,
+ PANGO2_TYPE_ALIGNMENT,
+ PANGO2_ALIGN_LEFT,
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
/**
@@ -550,13 +550,13 @@ gtk_cell_renderer_text_finalize (GObject *object)
GtkCellRendererText *celltext = GTK_CELL_RENDERER_TEXT (object);
GtkCellRendererTextPrivate *priv = gtk_cell_renderer_text_get_instance_private (celltext);
- pango_font_description_free (priv->font);
+ pango2_font_description_free (priv->font);
g_free (priv->text);
g_free (priv->placeholder_text);
if (priv->extra_attrs)
- pango_attr_list_unref (priv->extra_attrs);
+ pango2_attr_list_unref (priv->extra_attrs);
if (priv->language)
g_object_unref (priv->language);
@@ -566,23 +566,23 @@ gtk_cell_renderer_text_finalize (GObject *object)
G_OBJECT_CLASS (gtk_cell_renderer_text_parent_class)->finalize (object);
}
-static PangoFontMask
+static Pango2FontMask
get_property_font_set_mask (guint prop_id)
{
switch (prop_id)
{
case PROP_FAMILY_SET:
- return PANGO_FONT_MASK_FAMILY;
+ return PANGO2_FONT_MASK_FAMILY;
case PROP_STYLE_SET:
- return PANGO_FONT_MASK_STYLE;
+ return PANGO2_FONT_MASK_STYLE;
case PROP_VARIANT_SET:
- return PANGO_FONT_MASK_VARIANT;
+ return PANGO2_FONT_MASK_VARIANT;
case PROP_WEIGHT_SET:
- return PANGO_FONT_MASK_WEIGHT;
+ return PANGO2_FONT_MASK_WEIGHT;
case PROP_STRETCH_SET:
- return PANGO_FONT_MASK_STRETCH;
+ return PANGO2_FONT_MASK_STRETCH;
case PROP_SIZE_SET:
- return PANGO_FONT_MASK_SIZE;
+ return PANGO2_FONT_MASK_SIZE;
default:
return 0;
}
@@ -620,7 +620,7 @@ gtk_cell_renderer_text_get_property (GObject *object,
break;
case PROP_FONT:
- g_value_take_string (value, pango_font_description_to_string (priv->font));
+ g_value_take_string (value, pango2_font_description_to_string (priv->font));
break;
case PROP_FONT_DESC:
@@ -628,31 +628,31 @@ gtk_cell_renderer_text_get_property (GObject *object,
break;
case PROP_FAMILY:
- g_value_set_string (value, pango_font_description_get_family (priv->font));
+ g_value_set_string (value, pango2_font_description_get_family (priv->font));
break;
case PROP_STYLE:
- g_value_set_enum (value, pango_font_description_get_style (priv->font));
+ g_value_set_enum (value, pango2_font_description_get_style (priv->font));
break;
case PROP_VARIANT:
- g_value_set_enum (value, pango_font_description_get_variant (priv->font));
+ g_value_set_enum (value, pango2_font_description_get_variant (priv->font));
break;
case PROP_WEIGHT:
- g_value_set_int (value, pango_font_description_get_weight (priv->font));
+ g_value_set_int (value, pango2_font_description_get_weight (priv->font));
break;
case PROP_STRETCH:
- g_value_set_enum (value, pango_font_description_get_stretch (priv->font));
+ g_value_set_enum (value, pango2_font_description_get_stretch (priv->font));
break;
case PROP_SIZE:
- g_value_set_int (value, pango_font_description_get_size (priv->font));
+ g_value_set_int (value, pango2_font_description_get_size (priv->font));
break;
case PROP_SIZE_POINTS:
- g_value_set_double (value, ((double)pango_font_description_get_size (priv->font)) /
(double)PANGO_SCALE);
+ g_value_set_double (value, ((double)pango2_font_description_get_size (priv->font)) /
(double)PANGO2_SCALE);
break;
case PROP_SCALE:
@@ -676,7 +676,7 @@ gtk_cell_renderer_text_get_property (GObject *object,
break;
case PROP_LANGUAGE:
- g_value_set_static_string (value, pango_language_to_string (priv->language));
+ g_value_set_static_string (value, pango2_language_to_string (priv->language));
break;
case PROP_ELLIPSIZE:
@@ -710,8 +710,8 @@ gtk_cell_renderer_text_get_property (GObject *object,
case PROP_STRETCH_SET:
case PROP_SIZE_SET:
{
- PangoFontMask mask = get_property_font_set_mask (param_id);
- g_value_set_boolean (value, (pango_font_description_get_set_fields (priv->font) & mask) != 0);
+ Pango2FontMask mask = get_property_font_set_mask (param_id);
+ g_value_set_boolean (value, (pango2_font_description_get_set_fields (priv->font) & mask) != 0);
break;
}
@@ -822,41 +822,41 @@ set_fg_color (GtkCellRendererText *celltext,
}
}
-static PangoFontMask
-set_font_desc_fields (PangoFontDescription *desc,
- PangoFontMask to_set)
+static Pango2FontMask
+set_font_desc_fields (Pango2FontDescription *desc,
+ Pango2FontMask to_set)
{
- PangoFontMask changed_mask = 0;
+ Pango2FontMask changed_mask = 0;
- if (to_set & PANGO_FONT_MASK_FAMILY)
+ if (to_set & PANGO2_FONT_MASK_FAMILY)
{
- const char *family = pango_font_description_get_family (desc);
+ const char *family = pango2_font_description_get_family (desc);
if (!family)
{
family = "sans";
- changed_mask |= PANGO_FONT_MASK_FAMILY;
+ changed_mask |= PANGO2_FONT_MASK_FAMILY;
}
- pango_font_description_set_family (desc, family);
+ pango2_font_description_set_family (desc, family);
}
- if (to_set & PANGO_FONT_MASK_STYLE)
- pango_font_description_set_style (desc, pango_font_description_get_style (desc));
- if (to_set & PANGO_FONT_MASK_VARIANT)
- pango_font_description_set_variant (desc, pango_font_description_get_variant (desc));
- if (to_set & PANGO_FONT_MASK_WEIGHT)
- pango_font_description_set_weight (desc, pango_font_description_get_weight (desc));
- if (to_set & PANGO_FONT_MASK_STRETCH)
- pango_font_description_set_stretch (desc, pango_font_description_get_stretch (desc));
- if (to_set & PANGO_FONT_MASK_SIZE)
+ if (to_set & PANGO2_FONT_MASK_STYLE)
+ pango2_font_description_set_style (desc, pango2_font_description_get_style (desc));
+ if (to_set & PANGO2_FONT_MASK_VARIANT)
+ pango2_font_description_set_variant (desc, pango2_font_description_get_variant (desc));
+ if (to_set & PANGO2_FONT_MASK_WEIGHT)
+ pango2_font_description_set_weight (desc, pango2_font_description_get_weight (desc));
+ if (to_set & PANGO2_FONT_MASK_STRETCH)
+ pango2_font_description_set_stretch (desc, pango2_font_description_get_stretch (desc));
+ if (to_set & PANGO2_FONT_MASK_SIZE)
{
- int size = pango_font_description_get_size (desc);
+ int size = pango2_font_description_get_size (desc);
if (size <= 0)
{
- size = 10 * PANGO_SCALE;
- changed_mask |= PANGO_FONT_MASK_SIZE;
+ size = 10 * PANGO2_SCALE;
+ changed_mask |= PANGO2_FONT_MASK_SIZE;
}
- pango_font_description_set_size (desc, size);
+ pango2_font_description_set_size (desc, size);
}
return changed_mask;
@@ -864,37 +864,37 @@ set_font_desc_fields (PangoFontDescription *desc,
static void
notify_set_changed (GObject *object,
- PangoFontMask changed_mask)
+ Pango2FontMask changed_mask)
{
- if (changed_mask & PANGO_FONT_MASK_FAMILY)
+ if (changed_mask & PANGO2_FONT_MASK_FAMILY)
g_object_notify_by_pspec (object, text_cell_renderer_props[PROP_FAMILY_SET]);
- if (changed_mask & PANGO_FONT_MASK_STYLE)
+ if (changed_mask & PANGO2_FONT_MASK_STYLE)
g_object_notify_by_pspec (object, text_cell_renderer_props[PROP_STYLE_SET]);
- if (changed_mask & PANGO_FONT_MASK_VARIANT)
+ if (changed_mask & PANGO2_FONT_MASK_VARIANT)
g_object_notify_by_pspec (object, text_cell_renderer_props[PROP_VARIANT_SET]);
- if (changed_mask & PANGO_FONT_MASK_WEIGHT)
+ if (changed_mask & PANGO2_FONT_MASK_WEIGHT)
g_object_notify_by_pspec (object, text_cell_renderer_props[PROP_WEIGHT_SET]);
- if (changed_mask & PANGO_FONT_MASK_STRETCH)
+ if (changed_mask & PANGO2_FONT_MASK_STRETCH)
g_object_notify_by_pspec (object, text_cell_renderer_props[PROP_STRETCH_SET]);
- if (changed_mask & PANGO_FONT_MASK_SIZE)
+ if (changed_mask & PANGO2_FONT_MASK_SIZE)
g_object_notify_by_pspec (object, text_cell_renderer_props[PROP_SIZE_SET]);
}
static void
notify_fields_changed (GObject *object,
- PangoFontMask changed_mask)
+ Pango2FontMask changed_mask)
{
- if (changed_mask & PANGO_FONT_MASK_FAMILY)
+ if (changed_mask & PANGO2_FONT_MASK_FAMILY)
g_object_notify_by_pspec (object, text_cell_renderer_props[PROP_FAMILY]);
- if (changed_mask & PANGO_FONT_MASK_STYLE)
+ if (changed_mask & PANGO2_FONT_MASK_STYLE)
g_object_notify_by_pspec (object, text_cell_renderer_props[PROP_STYLE]);
- if (changed_mask & PANGO_FONT_MASK_VARIANT)
+ if (changed_mask & PANGO2_FONT_MASK_VARIANT)
g_object_notify_by_pspec (object, text_cell_renderer_props[PROP_VARIANT]);
- if (changed_mask & PANGO_FONT_MASK_WEIGHT)
+ if (changed_mask & PANGO2_FONT_MASK_WEIGHT)
g_object_notify_by_pspec (object, text_cell_renderer_props[PROP_WEIGHT]);
- if (changed_mask & PANGO_FONT_MASK_STRETCH)
+ if (changed_mask & PANGO2_FONT_MASK_STRETCH)
g_object_notify_by_pspec (object, text_cell_renderer_props[PROP_STRETCH]);
- if (changed_mask & PANGO_FONT_MASK_SIZE)
+ if (changed_mask & PANGO2_FONT_MASK_SIZE)
{
g_object_notify_by_pspec (object, text_cell_renderer_props[PROP_SIZE]);
g_object_notify_by_pspec (object, text_cell_renderer_props[PROP_SIZE_POINTS]);
@@ -903,25 +903,25 @@ notify_fields_changed (GObject *object,
static void
set_font_description (GtkCellRendererText *celltext,
- PangoFontDescription *font_desc)
+ Pango2FontDescription *font_desc)
{
GtkCellRendererTextPrivate *priv = gtk_cell_renderer_text_get_instance_private (celltext);
GObject *object = G_OBJECT (celltext);
- PangoFontDescription *new_font_desc;
- PangoFontMask old_mask, new_mask, changed_mask, set_changed_mask;
+ Pango2FontDescription *new_font_desc;
+ Pango2FontMask old_mask, new_mask, changed_mask, set_changed_mask;
if (font_desc)
- new_font_desc = pango_font_description_copy (font_desc);
+ new_font_desc = pango2_font_description_copy (font_desc);
else
- new_font_desc = pango_font_description_new ();
+ new_font_desc = pango2_font_description_new ();
- old_mask = pango_font_description_get_set_fields (priv->font);
- new_mask = pango_font_description_get_set_fields (new_font_desc);
+ old_mask = pango2_font_description_get_set_fields (priv->font);
+ new_mask = pango2_font_description_get_set_fields (new_font_desc);
changed_mask = old_mask | new_mask;
set_changed_mask = old_mask ^ new_mask;
- pango_font_description_free (priv->font);
+ pango2_font_description_free (priv->font);
priv->font = new_font_desc;
g_object_freeze_notify (object);
@@ -952,7 +952,7 @@ gtk_cell_renderer_text_set_property (GObject *object,
if (priv->markup_set)
{
if (priv->extra_attrs)
- pango_attr_list_unref (priv->extra_attrs);
+ pango2_attr_list_unref (priv->extra_attrs);
priv->extra_attrs = NULL;
priv->markup_set = FALSE;
}
@@ -963,21 +963,21 @@ gtk_cell_renderer_text_set_property (GObject *object,
case PROP_ATTRIBUTES:
if (priv->extra_attrs)
- pango_attr_list_unref (priv->extra_attrs);
+ pango2_attr_list_unref (priv->extra_attrs);
priv->extra_attrs = g_value_get_boxed (value);
if (priv->extra_attrs)
- pango_attr_list_ref (priv->extra_attrs);
+ pango2_attr_list_ref (priv->extra_attrs);
break;
case PROP_MARKUP:
{
const char *str;
char *text = NULL;
GError *error = NULL;
- PangoAttrList *attrs = NULL;
+ Pango2AttrList *attrs = NULL;
str = g_value_get_string (value);
- if (str && !pango_parse_markup (str, -1, 0, &attrs, &text, NULL, &error))
+ if (str && !pango2_parse_markup (str, -1, 0, &attrs, &text, NULL, &error))
{
g_warning ("Failed to set text from markup due to error parsing markup: %s",
error->message);
@@ -988,7 +988,7 @@ gtk_cell_renderer_text_set_property (GObject *object,
g_free (priv->text);
if (priv->extra_attrs)
- pango_attr_list_unref (priv->extra_attrs);
+ pango2_attr_list_unref (priv->extra_attrs);
priv->text = text;
priv->extra_attrs = attrs;
@@ -1040,17 +1040,17 @@ gtk_cell_renderer_text_set_property (GObject *object,
case PROP_FONT:
{
- PangoFontDescription *font_desc = NULL;
+ Pango2FontDescription *font_desc = NULL;
const char *name;
name = g_value_get_string (value);
if (name)
- font_desc = pango_font_description_from_string (name);
+ font_desc = pango2_font_description_from_string (name);
set_font_description (celltext, font_desc);
- pango_font_description_free (font_desc);
+ pango2_font_description_free (font_desc);
if (priv->fixed_height_rows != -1)
priv->calc_fixed_height = TRUE;
@@ -1072,38 +1072,38 @@ gtk_cell_renderer_text_set_property (GObject *object,
case PROP_SIZE:
case PROP_SIZE_POINTS:
{
- PangoFontMask old_set_mask = pango_font_description_get_set_fields (priv->font);
+ Pango2FontMask old_set_mask = pango2_font_description_get_set_fields (priv->font);
switch (param_id)
{
case PROP_FAMILY:
- pango_font_description_set_family (priv->font,
+ pango2_font_description_set_family (priv->font,
g_value_get_string (value));
break;
case PROP_STYLE:
- pango_font_description_set_style (priv->font,
+ pango2_font_description_set_style (priv->font,
g_value_get_enum (value));
break;
case PROP_VARIANT:
- pango_font_description_set_variant (priv->font,
+ pango2_font_description_set_variant (priv->font,
g_value_get_enum (value));
break;
case PROP_WEIGHT:
- pango_font_description_set_weight (priv->font,
+ pango2_font_description_set_weight (priv->font,
g_value_get_int (value));
break;
case PROP_STRETCH:
- pango_font_description_set_stretch (priv->font,
+ pango2_font_description_set_stretch (priv->font,
g_value_get_enum (value));
break;
case PROP_SIZE:
- pango_font_description_set_size (priv->font,
+ pango2_font_description_set_size (priv->font,
g_value_get_int (value));
g_object_notify_by_pspec (object, pspec);
break;
case PROP_SIZE_POINTS:
- pango_font_description_set_size (priv->font,
- g_value_get_double (value) * PANGO_SCALE);
+ pango2_font_description_set_size (priv->font,
+ g_value_get_double (value) * PANGO2_SCALE);
g_object_notify_by_pspec (object, pspec);
break;
default:
@@ -1113,7 +1113,7 @@ gtk_cell_renderer_text_set_property (GObject *object,
if (priv->fixed_height_rows != -1)
priv->calc_fixed_height = TRUE;
- notify_set_changed (object, old_set_mask & pango_font_description_get_set_fields (priv->font));
+ notify_set_changed (object, old_set_mask & pango2_font_description_get_set_fields (priv->font));
g_object_notify_by_pspec (object, text_cell_renderer_props[PROP_FONT_DESC]);
g_object_notify_by_pspec (object, text_cell_renderer_props[PROP_FONT]);
@@ -1163,7 +1163,7 @@ gtk_cell_renderer_text_set_property (GObject *object,
priv->language_set = TRUE;
if (priv->language)
g_object_unref (priv->language);
- priv->language = pango_language_from_string (g_value_get_string (value));
+ priv->language = pango2_language_from_string (g_value_get_string (value));
g_object_notify_by_pspec (object, text_cell_renderer_props[PROP_LANGUAGE_SET]);
break;
@@ -1231,12 +1231,12 @@ gtk_cell_renderer_text_set_property (GObject *object,
case PROP_SIZE_SET:
if (!g_value_get_boolean (value))
{
- pango_font_description_unset_fields (priv->font,
+ pango2_font_description_unset_fields (priv->font,
get_property_font_set_mask (param_id));
}
else
{
- PangoFontMask changed_mask;
+ Pango2FontMask changed_mask;
changed_mask = set_font_desc_fields (priv->font,
get_property_font_set_mask (param_id));
@@ -1316,23 +1316,23 @@ show_placeholder_text (GtkCellRendererText *celltext)
}
static void
-add_attr (PangoAttrList *attr_list,
- PangoAttribute *attr)
+add_attr (Pango2AttrList *attr_list,
+ Pango2Attribute *attr)
{
- pango_attribute_set_range (attr, 0, G_MAXINT);
- pango_attr_list_insert (attr_list, attr);
+ pango2_attribute_set_range (attr, 0, G_MAXINT);
+ pango2_attr_list_insert (attr_list, attr);
}
-static PangoLayout*
+static Pango2Layout*
get_layout (GtkCellRendererText *celltext,
GtkWidget *widget,
const GdkRectangle *cell_area,
GtkCellRendererState flags)
{
GtkCellRendererTextPrivate *priv = gtk_cell_renderer_text_get_instance_private (celltext);
- PangoAttrList *attr_list;
- PangoLayout *layout;
- PangoLineStyle uline;
+ Pango2AttrList *attr_list;
+ Pango2Layout *layout;
+ Pango2LineStyle uline;
int xpad;
gboolean placeholder_layout = show_placeholder_text (celltext);
@@ -1342,39 +1342,39 @@ get_layout (GtkCellRendererText *celltext,
gtk_cell_renderer_get_padding (GTK_CELL_RENDERER (celltext), &xpad, NULL);
if (priv->extra_attrs)
- attr_list = pango_attr_list_copy (priv->extra_attrs);
+ attr_list = pango2_attr_list_copy (priv->extra_attrs);
else
- attr_list = pango_attr_list_new ();
+ attr_list = pango2_attr_list_new ();
- pango_layout_set_single_paragraph (layout, priv->single_paragraph);
+ pango2_layout_set_single_paragraph (layout, priv->single_paragraph);
if (!placeholder_layout && cell_area)
{
/* Add options that affect appearance but not size */
/* note that background doesn't go here, since it affects
- * background_area not the PangoLayout area
+ * background_area not the Pango2Layout area
*/
if (priv->foreground_set
&& (flags & GTK_CELL_RENDERER_SELECTED) == 0)
{
- PangoColor color;
+ Pango2Color color;
color.red = CLAMP (priv->foreground.red * 65535. + 0.5, 0, 65535);
color.green = CLAMP (priv->foreground.green * 65535. + 0.5, 0, 65535);
color.blue = CLAMP (priv->foreground.blue * 65535. + 0.5, 0, 65535);
color.alpha = CLAMP (priv->foreground.alpha * 65535. + 0.5, 0, 65535);
- add_attr (attr_list, pango_attr_foreground_new (&color));
+ add_attr (attr_list, pango2_attr_foreground_new (&color));
}
if (priv->strikethrough_set)
- add_attr (attr_list, pango_attr_strikethrough_new (priv->strikethrough));
+ add_attr (attr_list, pango2_attr_strikethrough_new (priv->strikethrough));
}
else if (placeholder_layout)
{
- PangoColor color;
+ Pango2Color color;
GtkStyleContext *context;
GdkRGBA fg = { 0.5, 0.5, 0.5, 1.0 };
@@ -1386,96 +1386,96 @@ get_layout (GtkCellRendererText *celltext,
color.blue = CLAMP (fg.blue * 65535. + 0.5, 0, 65535);
color.alpha = CLAMP (fg.alpha * 65535. + 0.5, 0, 65535);
- add_attr (attr_list, pango_attr_foreground_new (&color));
+ add_attr (attr_list, pango2_attr_foreground_new (&color));
}
- add_attr (attr_list, pango_attr_font_desc_new (priv->font));
+ add_attr (attr_list, pango2_attr_font_desc_new (priv->font));
if (priv->scale_set &&
priv->font_scale != 1.0)
- add_attr (attr_list, pango_attr_scale_new (priv->font_scale));
+ add_attr (attr_list, pango2_attr_scale_new (priv->font_scale));
if (priv->underline_set)
uline = priv->underline_style;
else
- uline = PANGO_LINE_STYLE_NONE;
+ uline = PANGO2_LINE_STYLE_NONE;
if (priv->language_set)
- add_attr (attr_list, pango_attr_language_new (priv->language));
+ add_attr (attr_list, pango2_attr_language_new (priv->language));
if ((flags & GTK_CELL_RENDERER_PRELIT) == GTK_CELL_RENDERER_PRELIT)
{
switch (uline)
{
- case PANGO_LINE_STYLE_NONE:
- uline = PANGO_LINE_STYLE_SOLID;
+ case PANGO2_LINE_STYLE_NONE:
+ uline = PANGO2_LINE_STYLE_SOLID;
break;
- case PANGO_LINE_STYLE_SOLID:
- uline = PANGO_LINE_STYLE_DOUBLE;
+ case PANGO2_LINE_STYLE_SOLID:
+ uline = PANGO2_LINE_STYLE_DOUBLE;
break;
- case PANGO_LINE_STYLE_DOUBLE:
- case PANGO_LINE_STYLE_DOTTED:
- case PANGO_LINE_STYLE_DASHED:
- case PANGO_LINE_STYLE_WAVY:
+ case PANGO2_LINE_STYLE_DOUBLE:
+ case PANGO2_LINE_STYLE_DOTTED:
+ case PANGO2_LINE_STYLE_DASHED:
+ case PANGO2_LINE_STYLE_WAVY:
default:
break;
}
}
- if (uline != PANGO_LINE_STYLE_NONE)
- add_attr (attr_list, pango_attr_underline_new (priv->underline_style));
+ if (uline != PANGO2_LINE_STYLE_NONE)
+ add_attr (attr_list, pango2_attr_underline_new (priv->underline_style));
if (priv->rise_set)
- add_attr (attr_list, pango_attr_rise_new (priv->rise));
+ add_attr (attr_list, pango2_attr_rise_new (priv->rise));
/* Now apply the attributes as they will effect the outcome
- * of pango_layout_get_extents() */
- pango_layout_set_attributes (layout, attr_list);
- pango_attr_list_unref (attr_list);
+ * of pango2_layout_get_extents() */
+ pango2_layout_set_attributes (layout, attr_list);
+ pango2_attr_list_unref (attr_list);
if (priv->ellipsize_set)
- pango_layout_set_ellipsize (layout, priv->ellipsize);
+ pango2_layout_set_ellipsize (layout, priv->ellipsize);
else
- pango_layout_set_ellipsize (layout, PANGO_ELLIPSIZE_NONE);
+ pango2_layout_set_ellipsize (layout, PANGO2_ELLIPSIZE_NONE);
if (priv->wrap_width != -1)
{
- PangoRectangle rect;
+ Pango2Rectangle rect;
int width, text_width;
- pango_lines_get_extents (pango_layout_get_lines (layout), NULL, &rect);
+ pango2_lines_get_extents (pango2_layout_get_lines (layout), NULL, &rect);
text_width = rect.width;
if (cell_area)
- width = (cell_area->width - xpad * 2) * PANGO_SCALE;
+ width = (cell_area->width - xpad * 2) * PANGO2_SCALE;
else
- width = priv->wrap_width * PANGO_SCALE;
+ width = priv->wrap_width * PANGO2_SCALE;
width = MIN (width, text_width);
- pango_layout_set_width (layout, width);
- pango_layout_set_wrap (layout, priv->wrap_mode);
+ pango2_layout_set_width (layout, width);
+ pango2_layout_set_wrap (layout, priv->wrap_mode);
}
else
{
- pango_layout_set_width (layout, -1);
- pango_layout_set_wrap (layout, PANGO_WRAP_CHAR);
+ pango2_layout_set_width (layout, -1);
+ pango2_layout_set_wrap (layout, PANGO2_WRAP_CHAR);
}
if (priv->align_set)
- pango_layout_set_alignment (layout, priv->align);
+ pango2_layout_set_alignment (layout, priv->align);
else
{
- PangoAlignment align;
+ Pango2Alignment align;
if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL)
- align = PANGO_ALIGN_RIGHT;
+ align = PANGO2_ALIGN_RIGHT;
else
- align = PANGO_ALIGN_LEFT;
+ align = PANGO2_ALIGN_LEFT;
- pango_layout_set_alignment (layout, align);
+ pango2_layout_set_alignment (layout, align);
}
return layout;
@@ -1486,7 +1486,7 @@ static void
get_size (GtkCellRenderer *cell,
GtkWidget *widget,
const GdkRectangle *cell_area,
- PangoLayout *layout,
+ Pango2Layout *layout,
int *x_offset,
int *y_offset,
int *width,
@@ -1494,7 +1494,7 @@ get_size (GtkCellRenderer *cell,
{
GtkCellRendererText *celltext = GTK_CELL_RENDERER_TEXT (cell);
GtkCellRendererTextPrivate *priv = gtk_cell_renderer_text_get_instance_private (celltext);
- PangoRectangle rect;
+ Pango2Rectangle rect;
int xpad, ypad;
int cell_width, cell_height;
float xalign, yalign;
@@ -1504,36 +1504,36 @@ get_size (GtkCellRenderer *cell,
if (priv->calc_fixed_height)
{
GtkStyleContext *style_context;
- PangoContext *context;
- PangoFontMetrics *metrics;
- PangoFontDescription *font_desc;
+ Pango2Context *context;
+ Pango2FontMetrics *metrics;
+ Pango2FontDescription *font_desc;
int row_height;
style_context = gtk_widget_get_style_context (widget);
font_desc = gtk_css_style_get_pango_font (gtk_style_context_lookup_style (style_context));
- pango_font_description_merge_static (font_desc, priv->font, TRUE);
+ pango2_font_description_merge_static (font_desc, priv->font, TRUE);
if (priv->scale_set)
- pango_font_description_set_size (font_desc,
- priv->font_scale * pango_font_description_get_size (font_desc));
+ pango2_font_description_set_size (font_desc,
+ priv->font_scale * pango2_font_description_get_size (font_desc));
context = gtk_widget_get_pango_context (widget);
- metrics = pango_context_get_metrics (context,
+ metrics = pango2_context_get_metrics (context,
font_desc,
- pango_context_get_language (context));
- row_height = (pango_font_metrics_get_ascent (metrics) +
- pango_font_metrics_get_descent (metrics));
- pango_font_metrics_free (metrics);
+ pango2_context_get_language (context));
+ row_height = (pango2_font_metrics_get_ascent (metrics) +
+ pango2_font_metrics_get_descent (metrics));
+ pango2_font_metrics_free (metrics);
- pango_font_description_free (font_desc);
+ pango2_font_description_free (font_desc);
gtk_cell_renderer_get_fixed_size (cell, &cell_width, &cell_height);
gtk_cell_renderer_set_fixed_size (cell,
cell_width, 2 * ypad +
- priv->fixed_height_rows * PANGO_PIXELS (row_height));
+ priv->fixed_height_rows * PANGO2_PIXELS (row_height));
if (height)
{
@@ -1545,8 +1545,8 @@ get_size (GtkCellRenderer *cell,
return;
}
- pango_lines_get_extents (pango_layout_get_lines (layout), NULL, &rect);
- pango_extents_to_pixels (&rect, NULL);
+ pango2_lines_get_extents (pango2_layout_get_lines (layout), NULL, &rect);
+ pango2_extents_to_pixels (&rect, NULL);
gtk_cell_renderer_get_alignment (cell, &xalign, &yalign);
@@ -1558,7 +1558,7 @@ get_size (GtkCellRenderer *cell,
else
*x_offset = xalign * (cell_area->width - (rect.width + (2 * xpad)));
- if ((priv->ellipsize_set && priv->ellipsize != PANGO_ELLIPSIZE_NONE) || priv->wrap_width != -1)
+ if ((priv->ellipsize_set && priv->ellipsize != PANGO2_ELLIPSIZE_NONE) || priv->wrap_width != -1)
*x_offset = MAX(*x_offset, 0);
*y_offset = yalign * (cell_area->height - (rect.height + (2 * ypad)));
@@ -1583,11 +1583,11 @@ gtk_cell_renderer_text_snapshot (GtkCellRenderer *cell,
GtkCellRendererText *celltext = GTK_CELL_RENDERER_TEXT (cell);
GtkCellRendererTextPrivate *priv = gtk_cell_renderer_text_get_instance_private (celltext);
GtkStyleContext *context;
- PangoLayout *layout;
+ Pango2Layout *layout;
int x_offset = 0;
int y_offset = 0;
int xpad, ypad;
- PangoRectangle rect;
+ Pango2Rectangle rect;
layout = get_layout (celltext, widget, cell_area, flags);
get_size (cell, widget, cell_area, layout, &x_offset, &y_offset, NULL, NULL);
@@ -1605,14 +1605,14 @@ gtk_cell_renderer_text_snapshot (GtkCellRenderer *cell,
gtk_cell_renderer_get_padding (cell, &xpad, &ypad);
- if (priv->ellipsize_set && priv->ellipsize != PANGO_ELLIPSIZE_NONE)
- pango_layout_set_width (layout,
- (cell_area->width - x_offset - 2 * xpad) * PANGO_SCALE);
+ if (priv->ellipsize_set && priv->ellipsize != PANGO2_ELLIPSIZE_NONE)
+ pango2_layout_set_width (layout,
+ (cell_area->width - x_offset - 2 * xpad) * PANGO2_SCALE);
else if (priv->wrap_width == -1)
- pango_layout_set_width (layout, -1);
+ pango2_layout_set_width (layout, -1);
- pango_lines_get_extents (pango_layout_get_lines (layout), NULL, &rect);
- pango_extents_to_pixels (&rect, NULL);
+ pango2_lines_get_extents (pango2_layout_get_lines (layout), NULL, &rect);
+ pango2_extents_to_pixels (&rect, NULL);
x_offset = x_offset - rect.x;
gtk_snapshot_push_clip (snapshot,
@@ -1777,10 +1777,10 @@ gtk_cell_renderer_text_get_preferred_width (GtkCellRenderer *cell,
{
GtkCellRendererText *celltext = GTK_CELL_RENDERER_TEXT (cell);
GtkCellRendererTextPrivate *priv = gtk_cell_renderer_text_get_instance_private (celltext);
- PangoLayout *layout;
- PangoContext *context;
- PangoFontMetrics *metrics;
- PangoRectangle rect;
+ Pango2Layout *layout;
+ Pango2Context *context;
+ Pango2FontMetrics *metrics;
+ Pango2Rectangle rect;
int char_width, text_width, ellipsize_chars, xpad;
int min_width, nat_width;
@@ -1797,48 +1797,48 @@ gtk_cell_renderer_text_get_preferred_width (GtkCellRenderer *cell,
layout = get_layout (celltext, widget, NULL, 0);
/* Fetch the length of the complete unwrapped text */
- pango_layout_set_width (layout, -1);
- pango_lines_get_extents (pango_layout_get_lines (layout), NULL, &rect);
+ pango2_layout_set_width (layout, -1);
+ pango2_lines_get_extents (pango2_layout_get_lines (layout), NULL, &rect);
text_width = rect.width;
/* Fetch the average size of a character */
- context = pango_layout_get_context (layout);
- metrics = pango_context_get_metrics (context,
- pango_context_get_font_description (context),
- pango_context_get_language (context));
+ context = pango2_layout_get_context (layout);
+ metrics = pango2_context_get_metrics (context,
+ pango2_context_get_font_description (context),
+ pango2_context_get_language (context));
- char_width = pango_font_metrics_get_approximate_char_width (metrics);
+ char_width = pango2_font_metrics_get_approximate_char_width (metrics);
- pango_font_metrics_free (metrics);
+ pango2_font_metrics_free (metrics);
g_object_unref (layout);
/* enforce minimum width for ellipsized labels at ~3 chars */
- if (priv->ellipsize_set && priv->ellipsize != PANGO_ELLIPSIZE_NONE)
+ if (priv->ellipsize_set && priv->ellipsize != PANGO2_ELLIPSIZE_NONE)
ellipsize_chars = 3;
else
ellipsize_chars = 0;
- if ((priv->ellipsize_set && priv->ellipsize != PANGO_ELLIPSIZE_NONE) || priv->width_chars > 0)
+ if ((priv->ellipsize_set && priv->ellipsize != PANGO2_ELLIPSIZE_NONE) || priv->width_chars > 0)
min_width = xpad * 2 +
- MIN (PANGO_PIXELS_CEIL (text_width),
- (PANGO_PIXELS (char_width) * MAX (priv->width_chars, ellipsize_chars)));
+ MIN (PANGO2_PIXELS_CEIL (text_width),
+ (PANGO2_PIXELS (char_width) * MAX (priv->width_chars, ellipsize_chars)));
/* If no width-chars set, minimum for wrapping text will be the wrap-width */
else if (priv->wrap_width > -1)
- min_width = xpad * 2 + rect.x + MIN (PANGO_PIXELS_CEIL (text_width), priv->wrap_width);
+ min_width = xpad * 2 + rect.x + MIN (PANGO2_PIXELS_CEIL (text_width), priv->wrap_width);
else
- min_width = xpad * 2 + rect.x + PANGO_PIXELS_CEIL (text_width);
+ min_width = xpad * 2 + rect.x + PANGO2_PIXELS_CEIL (text_width);
if (priv->width_chars > 0)
nat_width = xpad * 2 +
- MAX ((PANGO_PIXELS (char_width) * priv->width_chars), PANGO_PIXELS_CEIL (text_width));
+ MAX ((PANGO2_PIXELS (char_width) * priv->width_chars), PANGO2_PIXELS_CEIL (text_width));
else
- nat_width = xpad * 2 + PANGO_PIXELS_CEIL (text_width);
+ nat_width = xpad * 2 + PANGO2_PIXELS_CEIL (text_width);
nat_width = MAX (nat_width, min_width);
if (priv->max_width_chars > 0)
{
- int max_width = xpad * 2 + PANGO_PIXELS (char_width) * priv->max_width_chars;
+ int max_width = xpad * 2 + PANGO2_PIXELS (char_width) * priv->max_width_chars;
min_width = MIN (min_width, max_width);
nat_width = MIN (nat_width, max_width);
@@ -1859,17 +1859,17 @@ gtk_cell_renderer_text_get_preferred_height_for_width (GtkCellRenderer *cell,
int *natural_height)
{
GtkCellRendererText *celltext = GTK_CELL_RENDERER_TEXT (cell);
- PangoLayout *layout;
+ Pango2Layout *layout;
int xpad, ypad;
- PangoRectangle ext;
+ Pango2Rectangle ext;
gtk_cell_renderer_get_padding (cell, &xpad, &ypad);
layout = get_layout (celltext, widget, NULL, 0);
- pango_layout_set_width (layout, (width - xpad * 2) * PANGO_SCALE);
- pango_lines_get_extents (pango_layout_get_lines (layout), NULL, &ext);
- pango_extents_to_pixels (&ext, NULL);
+ pango2_layout_set_width (layout, (width - xpad * 2) * PANGO2_SCALE);
+ pango2_lines_get_extents (pango2_layout_get_lines (layout), NULL, &ext);
+ pango2_extents_to_pixels (&ext, NULL);
if (minimum_height)
*minimum_height = ext.height + ypad * 2;
@@ -1908,7 +1908,7 @@ gtk_cell_renderer_text_get_aligned_area (GtkCellRenderer *cell,
GdkRectangle *aligned_area)
{
GtkCellRendererText *celltext = GTK_CELL_RENDERER_TEXT (cell);
- PangoLayout *layout;
+ Pango2Layout *layout;
int x_offset = 0;
int y_offset = 0;
diff --git a/gtk/gtkcolorbutton.c b/gtk/gtkcolorbutton.c
index 3d33e8ccf0..f0c7e69e19 100644
--- a/gtk/gtkcolorbutton.c
+++ b/gtk/gtkcolorbutton.c
@@ -279,8 +279,8 @@ gtk_color_button_drag_prepare (GtkDragSource *source,
static void
gtk_color_button_init (GtkColorButton *button)
{
- PangoLayout *layout;
- PangoRectangle rect;
+ Pango2Layout *layout;
+ Pango2Rectangle rect;
GtkDragSource *source;
GtkDropTarget *dest;
@@ -297,8 +297,8 @@ gtk_color_button_init (GtkColorButton *button)
gtk_widget_set_can_focus (button->swatch, FALSE);
gtk_widget_remove_css_class (button->swatch, "activatable");
layout = gtk_widget_create_pango_layout (GTK_WIDGET (button), "Black");
- pango_lines_get_extents (pango_layout_get_lines (layout), NULL, &rect);
- pango_extents_to_pixels (&rect, NULL);
+ pango2_lines_get_extents (pango2_layout_get_lines (layout), NULL, &rect);
+ pango2_extents_to_pixels (&rect, NULL);
g_object_unref (layout);
gtk_widget_set_size_request (button->swatch, rect.width, rect.height);
diff --git a/gtk/gtkcssenumvalue.c b/gtk/gtkcssenumvalue.c
index 1296493808..92b857c98c 100644
--- a/gtk/gtkcssenumvalue.c
+++ b/gtk/gtkcssenumvalue.c
@@ -223,9 +223,9 @@ gtk_css_font_size_get_default_px (GtkStyleProvider *provider,
if (font_size == 0)
return DEFAULT_FONT_SIZE_PT * get_dpi (style) / 72.0;
else if (gtk_settings_get_font_size_is_absolute (settings))
- return (double) font_size / PANGO_SCALE;
+ return (double) font_size / PANGO2_SCALE;
else
- return ((double) font_size / PANGO_SCALE) * get_dpi (style) / 72.0;
+ return ((double) font_size / PANGO2_SCALE) * get_dpi (style) / 72.0;
}
static GtkCssValue *
@@ -339,7 +339,7 @@ _gtk_css_font_size_value_get (const GtkCssValue *value)
return value->value;
}
-/* PangoStyle */
+/* Pango2Style */
static const GtkCssValueClass GTK_CSS_VALUE_FONT_STYLE = {
"GtkCssFontStyleValue",
@@ -353,13 +353,13 @@ static const GtkCssValueClass GTK_CSS_VALUE_FONT_STYLE = {
};
static GtkCssValue font_style_values[] = {
- { >K_CSS_VALUE_FONT_STYLE, 1, TRUE, PANGO_STYLE_NORMAL, "normal" },
- { >K_CSS_VALUE_FONT_STYLE, 1, TRUE, PANGO_STYLE_OBLIQUE, "oblique" },
- { >K_CSS_VALUE_FONT_STYLE, 1, TRUE, PANGO_STYLE_ITALIC, "italic" }
+ { >K_CSS_VALUE_FONT_STYLE, 1, TRUE, PANGO2_STYLE_NORMAL, "normal" },
+ { >K_CSS_VALUE_FONT_STYLE, 1, TRUE, PANGO2_STYLE_OBLIQUE, "oblique" },
+ { >K_CSS_VALUE_FONT_STYLE, 1, TRUE, PANGO2_STYLE_ITALIC, "italic" }
};
GtkCssValue *
-_gtk_css_font_style_value_new (PangoStyle font_style)
+_gtk_css_font_style_value_new (Pango2Style font_style)
{
g_return_val_if_fail (font_style < G_N_ELEMENTS (font_style_values), NULL);
@@ -382,15 +382,15 @@ _gtk_css_font_style_value_try_parse (GtkCssParser *parser)
return NULL;
}
-PangoStyle
+Pango2Style
_gtk_css_font_style_value_get (const GtkCssValue *value)
{
- g_return_val_if_fail (value->class == >K_CSS_VALUE_FONT_STYLE, PANGO_STYLE_NORMAL);
+ g_return_val_if_fail (value->class == >K_CSS_VALUE_FONT_STYLE, PANGO2_STYLE_NORMAL);
return value->value;
}
-/* PangoWeight */
+/* Pango2Weight */
#define BOLDER -1
#define LIGHTER -2
@@ -402,7 +402,7 @@ gtk_css_value_font_weight_compute (GtkCssValue *value,
GtkCssStyle *style,
GtkCssStyle *parent_style)
{
- PangoWeight new_weight;
+ Pango2Weight new_weight;
int parent_value;
if (value->value >= 0)
@@ -434,7 +434,7 @@ gtk_css_value_font_weight_compute (GtkCssValue *value,
else
{
g_assert_not_reached ();
- new_weight = PANGO_WEIGHT_NORMAL;
+ new_weight = PANGO2_WEIGHT_NORMAL;
}
return _gtk_css_number_value_new (new_weight, GTK_CSS_NUMBER);
@@ -470,17 +470,17 @@ gtk_css_font_weight_value_try_parse (GtkCssParser *parser)
}
if (gtk_css_parser_try_ident (parser, "normal"))
- return _gtk_css_number_value_new (PANGO_WEIGHT_NORMAL, GTK_CSS_NUMBER);
+ return _gtk_css_number_value_new (PANGO2_WEIGHT_NORMAL, GTK_CSS_NUMBER);
if (gtk_css_parser_try_ident (parser, "bold"))
- return _gtk_css_number_value_new (PANGO_WEIGHT_BOLD, GTK_CSS_NUMBER);
+ return _gtk_css_number_value_new (PANGO2_WEIGHT_BOLD, GTK_CSS_NUMBER);
return NULL;
}
-PangoWeight
+Pango2Weight
gtk_css_font_weight_value_get (const GtkCssValue *value)
{
- g_return_val_if_fail (value->class == >K_CSS_VALUE_FONT_WEIGHT, PANGO_WEIGHT_NORMAL);
+ g_return_val_if_fail (value->class == >K_CSS_VALUE_FONT_WEIGHT, PANGO2_WEIGHT_NORMAL);
return value->value;
}
@@ -488,7 +488,7 @@ gtk_css_font_weight_value_get (const GtkCssValue *value)
#undef BOLDER
#undef LIGHTER
-/* PangoStretch */
+/* Pango2Stretch */
static const GtkCssValueClass GTK_CSS_VALUE_FONT_STRETCH = {
"GtkCssFontStretchValue",
@@ -502,19 +502,19 @@ static const GtkCssValueClass GTK_CSS_VALUE_FONT_STRETCH = {
};
static GtkCssValue font_stretch_values[] = {
- { >K_CSS_VALUE_FONT_STRETCH, 1, TRUE, PANGO_STRETCH_ULTRA_CONDENSED, "ultra-condensed" },
- { >K_CSS_VALUE_FONT_STRETCH, 1, TRUE, PANGO_STRETCH_EXTRA_CONDENSED, "extra-condensed" },
- { >K_CSS_VALUE_FONT_STRETCH, 1, TRUE, PANGO_STRETCH_CONDENSED, "condensed" },
- { >K_CSS_VALUE_FONT_STRETCH, 1, TRUE, PANGO_STRETCH_SEMI_CONDENSED, "semi-condensed" },
- { >K_CSS_VALUE_FONT_STRETCH, 1, TRUE, PANGO_STRETCH_NORMAL, "normal" },
- { >K_CSS_VALUE_FONT_STRETCH, 1, TRUE, PANGO_STRETCH_SEMI_EXPANDED, "semi-expanded" },
- { >K_CSS_VALUE_FONT_STRETCH, 1, TRUE, PANGO_STRETCH_EXPANDED, "expanded" },
- { >K_CSS_VALUE_FONT_STRETCH, 1, TRUE, PANGO_STRETCH_EXTRA_EXPANDED, "extra-expanded" },
- { >K_CSS_VALUE_FONT_STRETCH, 1, TRUE, PANGO_STRETCH_ULTRA_EXPANDED, "ultra-expanded" },
+ { >K_CSS_VALUE_FONT_STRETCH, 1, TRUE, PANGO2_STRETCH_ULTRA_CONDENSED, "ultra-condensed" },
+ { >K_CSS_VALUE_FONT_STRETCH, 1, TRUE, PANGO2_STRETCH_EXTRA_CONDENSED, "extra-condensed" },
+ { >K_CSS_VALUE_FONT_STRETCH, 1, TRUE, PANGO2_STRETCH_CONDENSED, "condensed" },
+ { >K_CSS_VALUE_FONT_STRETCH, 1, TRUE, PANGO2_STRETCH_SEMI_CONDENSED, "semi-condensed" },
+ { >K_CSS_VALUE_FONT_STRETCH, 1, TRUE, PANGO2_STRETCH_NORMAL, "normal" },
+ { >K_CSS_VALUE_FONT_STRETCH, 1, TRUE, PANGO2_STRETCH_SEMI_EXPANDED, "semi-expanded" },
+ { >K_CSS_VALUE_FONT_STRETCH, 1, TRUE, PANGO2_STRETCH_EXPANDED, "expanded" },
+ { >K_CSS_VALUE_FONT_STRETCH, 1, TRUE, PANGO2_STRETCH_EXTRA_EXPANDED, "extra-expanded" },
+ { >K_CSS_VALUE_FONT_STRETCH, 1, TRUE, PANGO2_STRETCH_ULTRA_EXPANDED, "ultra-expanded" },
};
GtkCssValue *
-_gtk_css_font_stretch_value_new (PangoStretch font_stretch)
+_gtk_css_font_stretch_value_new (Pango2Stretch font_stretch)
{
/* FIXME support 'normal' and percentages */
@@ -543,10 +543,10 @@ _gtk_css_font_stretch_value_try_parse (GtkCssParser *parser)
return NULL;
}
-PangoStretch
+Pango2Stretch
_gtk_css_font_stretch_value_get (const GtkCssValue *value)
{
- g_return_val_if_fail (value->class == >K_CSS_VALUE_FONT_STRETCH, PANGO_STRETCH_NORMAL);
+ g_return_val_if_fail (value->class == >K_CSS_VALUE_FONT_STRETCH, PANGO2_STRETCH_NORMAL);
return value->value;
}
diff --git a/gtk/gtkcssenumvalueprivate.h b/gtk/gtkcssenumvalueprivate.h
index b6d3b0f757..4f4e9253a4 100644
--- a/gtk/gtkcssenumvalueprivate.h
+++ b/gtk/gtkcssenumvalueprivate.h
@@ -43,16 +43,16 @@ GtkCssFontSize _gtk_css_font_size_value_get (const GtkCssValue *value)
double gtk_css_font_size_get_default_px (GtkStyleProvider *provider,
GtkCssStyle *style);
-GtkCssValue * _gtk_css_font_style_value_new (PangoStyle style);
+GtkCssValue * _gtk_css_font_style_value_new (Pango2Style style);
GtkCssValue * _gtk_css_font_style_value_try_parse (GtkCssParser *parser);
-PangoStyle _gtk_css_font_style_value_get (const GtkCssValue *value);
+Pango2Style _gtk_css_font_style_value_get (const GtkCssValue *value);
GtkCssValue * gtk_css_font_weight_value_try_parse (GtkCssParser *parser);
-PangoWeight gtk_css_font_weight_value_get (const GtkCssValue *value);
+Pango2Weight gtk_css_font_weight_value_get (const GtkCssValue *value);
-GtkCssValue * _gtk_css_font_stretch_value_new (PangoStretch stretch);
+GtkCssValue * _gtk_css_font_stretch_value_new (Pango2Stretch stretch);
GtkCssValue * _gtk_css_font_stretch_value_try_parse (GtkCssParser *parser);
-PangoStretch _gtk_css_font_stretch_value_get (const GtkCssValue *value);
+Pango2Stretch _gtk_css_font_stretch_value_get (const GtkCssValue *value);
GtkCssValue * _gtk_css_text_decoration_line_value_new (GtkTextDecorationLine line);
GtkTextDecorationLine _gtk_css_text_decoration_line_try_parse_one (GtkCssParser *parser,
diff --git a/gtk/gtkcssshadowvalueprivate.h b/gtk/gtkcssshadowvalueprivate.h
index 21efac1908..a3ec9c558c 100644
--- a/gtk/gtkcssshadowvalueprivate.h
+++ b/gtk/gtkcssshadowvalueprivate.h
@@ -21,7 +21,7 @@
#define __GTK_SHADOW_H__
#include <cairo.h>
-#include <pango/pango.h>
+#include <pango2/pango.h>
#include <gtk/css/gtkcss.h>
#include "gtk/css/gtkcsstokenizerprivate.h"
diff --git a/gtk/gtkcssstyle.c b/gtk/gtkcssstyle.c
index fc1aa097d8..6072e9cc17 100644
--- a/gtk/gtkcssstyle.c
+++ b/gtk/gtkcssstyle.c
@@ -385,49 +385,49 @@ gtk_css_style_to_string (GtkCssStyle *style)
return g_string_free (string, FALSE);
}
-static PangoLineStyle
+static Pango2LineStyle
get_pango_line_style_from_style (GtkTextDecorationStyle style)
{
switch (style)
{
case GTK_CSS_TEXT_DECORATION_STYLE_DOUBLE:
- return PANGO_LINE_STYLE_DOUBLE;
+ return PANGO2_LINE_STYLE_DOUBLE;
case GTK_CSS_TEXT_DECORATION_STYLE_WAVY:
- return PANGO_LINE_STYLE_DOTTED;
+ return PANGO2_LINE_STYLE_DOTTED;
case GTK_CSS_TEXT_DECORATION_STYLE_SOLID:
default:
- return PANGO_LINE_STYLE_SOLID;
+ return PANGO2_LINE_STYLE_SOLID;
}
- g_return_val_if_reached (PANGO_LINE_STYLE_SOLID);
+ g_return_val_if_reached (PANGO2_LINE_STYLE_SOLID);
}
-PangoTextTransform
+Pango2TextTransform
gtk_css_style_get_pango_text_transform (GtkCssStyle *style)
{
switch (_gtk_css_text_transform_value_get (style->font_variant->text_transform))
{
case GTK_CSS_TEXT_TRANSFORM_NONE:
- return PANGO_TEXT_TRANSFORM_NONE;
+ return PANGO2_TEXT_TRANSFORM_NONE;
case GTK_CSS_TEXT_TRANSFORM_LOWERCASE:
- return PANGO_TEXT_TRANSFORM_LOWERCASE;
+ return PANGO2_TEXT_TRANSFORM_LOWERCASE;
case GTK_CSS_TEXT_TRANSFORM_UPPERCASE:
- return PANGO_TEXT_TRANSFORM_UPPERCASE;
+ return PANGO2_TEXT_TRANSFORM_UPPERCASE;
case GTK_CSS_TEXT_TRANSFORM_CAPITALIZE:
- return PANGO_TEXT_TRANSFORM_CAPITALIZE;
+ return PANGO2_TEXT_TRANSFORM_CAPITALIZE;
default:
- return PANGO_TEXT_TRANSFORM_NONE;
+ return PANGO2_TEXT_TRANSFORM_NONE;
}
}
-static PangoAttrList *
-add_pango_attr (PangoAttrList *attrs,
- PangoAttribute *attr)
+static Pango2AttrList *
+add_pango_attr (Pango2AttrList *attrs,
+ Pango2Attribute *attr)
{
if (attrs == NULL)
- attrs = pango_attr_list_new ();
+ attrs = pango2_attr_list_new ();
- pango_attr_list_insert (attrs, attr);
+ pango2_attr_list_insert (attrs, attr);
return attrs;
}
@@ -582,10 +582,10 @@ gtk_css_style_compute_font_features (GtkCssStyle *style)
return NULL;
}
-PangoAttrList *
+Pango2AttrList *
gtk_css_style_get_pango_attributes (GtkCssStyle *style)
{
- PangoAttrList *attrs = NULL;
+ Pango2AttrList *attrs = NULL;
GtkTextDecorationLine decoration_line;
GtkTextDecorationStyle decoration_style;
const GdkRGBA *color;
@@ -602,27 +602,27 @@ gtk_css_style_get_pango_attributes (GtkCssStyle *style)
if (decoration_line & GTK_CSS_TEXT_DECORATION_LINE_UNDERLINE)
{
- attrs = add_pango_attr (attrs, pango_attr_underline_new (get_pango_line_style_from_style
(decoration_style)));
+ attrs = add_pango_attr (attrs, pango2_attr_underline_new (get_pango_line_style_from_style
(decoration_style)));
if (!gdk_rgba_equal (color, decoration_color))
- attrs = add_pango_attr (attrs, pango_attr_underline_color_new (&(PangoColor){decoration_color->red *
65535. + 0.5,
+ attrs = add_pango_attr (attrs, pango2_attr_underline_color_new (&(Pango2Color){decoration_color->red
* 65535. + 0.5,
decoration_color->green
* 65535. + 0.5,
decoration_color->blue
* 65535. + 0.5,
decoration_color->alpha
* 65535. + 0.5}));
}
if (decoration_line & GTK_CSS_TEXT_DECORATION_LINE_OVERLINE)
{
- attrs = add_pango_attr (attrs, pango_attr_overline_new (get_pango_line_style_from_style
(decoration_style)));
+ attrs = add_pango_attr (attrs, pango2_attr_overline_new (get_pango_line_style_from_style
(decoration_style)));
if (!gdk_rgba_equal (color, decoration_color))
- attrs = add_pango_attr (attrs, pango_attr_overline_color_new (&(PangoColor){decoration_color->red *
65535. + 0.5,
+ attrs = add_pango_attr (attrs, pango2_attr_overline_color_new (&(Pango2Color){decoration_color->red
* 65535. + 0.5,
decoration_color->green
* 65535. + 0.5,
decoration_color->blue *
65535. + 0.5,
decoration_color->alpha
* 65535. + 0.5}));
}
if (decoration_line & GTK_CSS_TEXT_DECORATION_LINE_LINE_THROUGH)
{
- attrs = add_pango_attr (attrs, pango_attr_strikethrough_new (get_pango_line_style_from_style
(decoration_style)));
+ attrs = add_pango_attr (attrs, pango2_attr_strikethrough_new (get_pango_line_style_from_style
(decoration_style)));
if (!gdk_rgba_equal (color, decoration_color))
- attrs = add_pango_attr (attrs, pango_attr_strikethrough_color_new
(&(PangoColor){decoration_color->red * 65535. + 0.5,
+ attrs = add_pango_attr (attrs, pango2_attr_strikethrough_color_new
(&(Pango2Color){decoration_color->red * 65535. + 0.5,
decoration_color->green * 65535. + 0.5,
decoration_color->blue * 65535. + 0.5,
decoration_color->alpha * 65535. + 0.5}));
@@ -632,7 +632,7 @@ gtk_css_style_get_pango_attributes (GtkCssStyle *style)
letter_spacing = _gtk_css_number_value_get (style->font->letter_spacing, 100);
if (letter_spacing != 0)
{
- attrs = add_pango_attr (attrs, pango_attr_letter_spacing_new (letter_spacing * PANGO_SCALE));
+ attrs = add_pango_attr (attrs, pango2_attr_letter_spacing_new (letter_spacing * PANGO2_SCALE));
}
/* line-height */
@@ -641,9 +641,9 @@ gtk_css_style_get_pango_attributes (GtkCssStyle *style)
if (height != 0.0)
{
if (gtk_css_number_value_get_dimension (style->font->line_height) == GTK_CSS_DIMENSION_LENGTH)
- attrs = add_pango_attr (attrs, pango_attr_line_height_new_absolute (height * PANGO_SCALE));
+ attrs = add_pango_attr (attrs, pango2_attr_line_height_new_absolute (height * PANGO2_SCALE));
else
- attrs = add_pango_attr (attrs, pango_attr_line_height_new (height));
+ attrs = add_pango_attr (attrs, pango2_attr_line_height_new (height));
}
}
@@ -651,22 +651,22 @@ gtk_css_style_get_pango_attributes (GtkCssStyle *style)
switch (_gtk_css_font_variant_caps_value_get (style->font_variant->font_variant_caps))
{
case GTK_CSS_FONT_VARIANT_CAPS_SMALL_CAPS:
- attrs = add_pango_attr (attrs, pango_attr_variant_new (PANGO_VARIANT_SMALL_CAPS));
+ attrs = add_pango_attr (attrs, pango2_attr_variant_new (PANGO2_VARIANT_SMALL_CAPS));
break;
case GTK_CSS_FONT_VARIANT_CAPS_ALL_SMALL_CAPS:
- attrs = add_pango_attr (attrs, pango_attr_variant_new (PANGO_VARIANT_ALL_SMALL_CAPS));
+ attrs = add_pango_attr (attrs, pango2_attr_variant_new (PANGO2_VARIANT_ALL_SMALL_CAPS));
break;
case GTK_CSS_FONT_VARIANT_CAPS_PETITE_CAPS:
- attrs = add_pango_attr (attrs, pango_attr_variant_new (PANGO_VARIANT_PETITE_CAPS));
+ attrs = add_pango_attr (attrs, pango2_attr_variant_new (PANGO2_VARIANT_PETITE_CAPS));
break;
case GTK_CSS_FONT_VARIANT_CAPS_ALL_PETITE_CAPS:
- attrs = add_pango_attr (attrs, pango_attr_variant_new (PANGO_VARIANT_ALL_PETITE_CAPS));
+ attrs = add_pango_attr (attrs, pango2_attr_variant_new (PANGO2_VARIANT_ALL_PETITE_CAPS));
break;
case GTK_CSS_FONT_VARIANT_CAPS_UNICASE:
- attrs = add_pango_attr (attrs, pango_attr_variant_new (PANGO_VARIANT_UNICASE));
+ attrs = add_pango_attr (attrs, pango2_attr_variant_new (PANGO2_VARIANT_UNICASE));
break;
case GTK_CSS_FONT_VARIANT_CAPS_TITLING_CAPS:
- attrs = add_pango_attr (attrs, pango_attr_variant_new (PANGO_VARIANT_TITLE_CAPS));
+ attrs = add_pango_attr (attrs, pango2_attr_variant_new (PANGO2_VARIANT_TITLE_CAPS));
break;
case GTK_CSS_FONT_VARIANT_CAPS_NORMAL:
default:
@@ -679,30 +679,30 @@ gtk_css_style_get_pango_attributes (GtkCssStyle *style)
if (font_features)
{
- attrs = add_pango_attr (attrs, pango_attr_font_features_new (font_features));
+ attrs = add_pango_attr (attrs, pango2_attr_font_features_new (font_features));
g_free (font_features);
}
}
/* text-transform */
{
- PangoTextTransform transform = gtk_css_style_get_pango_text_transform (style);
+ Pango2TextTransform transform = gtk_css_style_get_pango_text_transform (style);
- if (transform != PANGO_TEXT_TRANSFORM_NONE)
- attrs = add_pango_attr (attrs, pango_attr_text_transform_new (transform));
+ if (transform != PANGO2_TEXT_TRANSFORM_NONE)
+ attrs = add_pango_attr (attrs, pango2_attr_text_transform_new (transform));
}
return attrs;
}
-PangoFontDescription *
+Pango2FontDescription *
gtk_css_style_get_pango_font (GtkCssStyle *style)
{
- PangoFontDescription *description;
+ Pango2FontDescription *description;
GtkCssValue *v;
char *str;
- description = pango_font_description_new ();
+ description = pango2_font_description_new ();
v = style->font->font_family;
if (_gtk_css_array_value_get_n_values (v) > 1)
@@ -717,31 +717,31 @@ gtk_css_style_get_pango_font (GtkCssStyle *style)
g_string_append (s, _gtk_css_string_value_get (_gtk_css_array_value_get_nth (v, i)));
}
- pango_font_description_set_family (description, s->str);
+ pango2_font_description_set_family (description, s->str);
g_string_free (s, TRUE);
}
else
{
- pango_font_description_set_family (description,
+ pango2_font_description_set_family (description,
_gtk_css_string_value_get (_gtk_css_array_value_get_nth (v, 0)));
}
v = style->core->font_size;
- pango_font_description_set_absolute_size (description, round (_gtk_css_number_value_get (v, 100) *
PANGO_SCALE));
+ pango2_font_description_set_absolute_size (description, round (_gtk_css_number_value_get (v, 100) *
PANGO2_SCALE));
v = style->font->font_style;
- pango_font_description_set_style (description, _gtk_css_font_style_value_get (v));
+ pango2_font_description_set_style (description, _gtk_css_font_style_value_get (v));
v = style->font->font_weight;
- pango_font_description_set_weight (description, _gtk_css_number_value_get (v, 100));
+ pango2_font_description_set_weight (description, _gtk_css_number_value_get (v, 100));
v = style->font->font_stretch;
- pango_font_description_set_stretch (description, _gtk_css_font_stretch_value_get (v));
+ pango2_font_description_set_stretch (description, _gtk_css_font_stretch_value_get (v));
v = style->font->font_variation_settings;
str = gtk_css_font_variations_value_get_variations (v);
if (str)
- pango_font_description_set_variations (description, str);
+ pango2_font_description_set_variations (description, str);
g_free (str);
return description;
diff --git a/gtk/gtkcssstyleprivate.h b/gtk/gtkcssstyleprivate.h
index d618b7d741..41075ee2b9 100644
--- a/gtk/gtkcssstyleprivate.h
+++ b/gtk/gtkcssstyleprivate.h
@@ -264,10 +264,10 @@ gboolean gtk_css_style_print (GtkCssStyle
guint indent,
gboolean skip_initial);
-PangoTextTransform gtk_css_style_get_pango_text_transform (GtkCssStyle *style);
+Pango2TextTransform gtk_css_style_get_pango_text_transform (GtkCssStyle *style);
char * gtk_css_style_compute_font_features (GtkCssStyle *style);
-PangoAttrList * gtk_css_style_get_pango_attributes (GtkCssStyle *style);
-PangoFontDescription * gtk_css_style_get_pango_font (GtkCssStyle *style);
+Pango2AttrList * gtk_css_style_get_pango_attributes (GtkCssStyle *style);
+Pango2FontDescription * gtk_css_style_get_pango_font (GtkCssStyle *style);
GtkCssValues *gtk_css_values_new (GtkCssValuesType type);
GtkCssValues *gtk_css_values_ref (GtkCssValues *values);
diff --git a/gtk/gtkcssstylepropertyimpl.c b/gtk/gtkcssstylepropertyimpl.c
index 4ee8a200ef..ff787159eb 100644
--- a/gtk/gtkcssstylepropertyimpl.c
+++ b/gtk/gtkcssstylepropertyimpl.c
@@ -890,19 +890,19 @@ _gtk_css_style_property_init_properties (void)
GTK_STYLE_PROPERTY_INHERIT,
GTK_CSS_AFFECTS_TEXT_SIZE,
font_style_parse,
- _gtk_css_font_style_value_new (PANGO_STYLE_NORMAL));
+ _gtk_css_font_style_value_new (PANGO2_STYLE_NORMAL));
gtk_css_style_property_register ("font-weight",
GTK_CSS_PROPERTY_FONT_WEIGHT,
GTK_STYLE_PROPERTY_INHERIT | GTK_STYLE_PROPERTY_ANIMATED,
GTK_CSS_AFFECTS_TEXT_SIZE,
font_weight_parse,
- _gtk_css_number_value_new (PANGO_WEIGHT_NORMAL, GTK_CSS_NUMBER));
+ _gtk_css_number_value_new (PANGO2_WEIGHT_NORMAL, GTK_CSS_NUMBER));
gtk_css_style_property_register ("font-stretch",
GTK_CSS_PROPERTY_FONT_STRETCH,
GTK_STYLE_PROPERTY_INHERIT,
GTK_CSS_AFFECTS_TEXT_SIZE,
font_stretch_parse,
- _gtk_css_font_stretch_value_new (PANGO_STRETCH_NORMAL));
+ _gtk_css_font_stretch_value_new (PANGO2_STRETCH_NORMAL));
gtk_css_style_property_register ("letter-spacing",
GTK_CSS_PROPERTY_LETTER_SPACING,
diff --git a/gtk/gtkemojichooser.c b/gtk/gtkemojichooser.c
index c7f1edba3f..056cd35414 100644
--- a/gtk/gtkemojichooser.c
+++ b/gtk/gtkemojichooser.c
@@ -543,13 +543,13 @@ add_emoji (GtkWidget *box,
{
GtkWidget *child;
GtkWidget *label;
- PangoAttrList *attrs;
+ Pango2AttrList *attrs;
GVariant *codes;
char text[64];
char *p = text;
int i;
- PangoLayout *layout;
- PangoRectangle rect;
+ Pango2Layout *layout;
+ Pango2Rectangle rect;
codes = g_variant_get_child_value (item, 0);
for (i = 0; i < g_variant_n_children (codes); i++)
@@ -567,16 +567,16 @@ add_emoji (GtkWidget *box,
p[0] = 0;
label = gtk_label_new (text);
- attrs = pango_attr_list_new ();
- pango_attr_list_insert (attrs, pango_attr_scale_new (PANGO_SCALE_X_LARGE));
+ attrs = pango2_attr_list_new ();
+ pango2_attr_list_insert (attrs, pango2_attr_scale_new (PANGO2_SCALE_X_LARGE));
gtk_label_set_attributes (GTK_LABEL (label), attrs);
- pango_attr_list_unref (attrs);
+ pango2_attr_list_unref (attrs);
layout = gtk_label_get_layout (GTK_LABEL (label));
- pango_lines_get_extents (pango_layout_get_lines (layout), &rect, NULL);
+ pango2_lines_get_extents (pango2_layout_get_lines (layout), &rect, NULL);
/* Check for fallback rendering that generates too wide items */
- if (pango_lines_get_unknown_glyphs_count (pango_layout_get_lines (layout)) > 0 ||
+ if (pango2_lines_get_unknown_glyphs_count (pango2_layout_get_lines (layout)) > 0 ||
rect.width >= 1.5 * chooser->emoji_max_width)
{
g_object_ref_sink (label);
@@ -665,7 +665,7 @@ get_emoji_data (void)
GBytes *bytes;
const char *lang;
- lang = pango_language_to_string (gtk_get_default_language ());
+ lang = pango2_language_to_string (gtk_get_default_language ());
bytes = get_emoji_data_by_language (lang);
if (bytes)
return bytes;
@@ -984,16 +984,16 @@ gtk_emoji_chooser_init (GtkEmojiChooser *chooser)
* as multiply glyphs.
*/
{
- PangoLayout *layout = gtk_widget_create_pango_layout (GTK_WIDGET (chooser), "🙂");
- PangoAttrList *attrs;
- PangoRectangle rect;
+ Pango2Layout *layout = gtk_widget_create_pango_layout (GTK_WIDGET (chooser), "🙂");
+ Pango2AttrList *attrs;
+ Pango2Rectangle rect;
- attrs = pango_attr_list_new ();
- pango_attr_list_insert (attrs, pango_attr_scale_new (PANGO_SCALE_X_LARGE));
- pango_layout_set_attributes (layout, attrs);
- pango_attr_list_unref (attrs);
+ attrs = pango2_attr_list_new ();
+ pango2_attr_list_insert (attrs, pango2_attr_scale_new (PANGO2_SCALE_X_LARGE));
+ pango2_layout_set_attributes (layout, attrs);
+ pango2_attr_list_unref (attrs);
- pango_lines_get_extents (pango_layout_get_lines (layout), &rect, NULL);
+ pango2_lines_get_extents (pango2_layout_get_lines (layout), &rect, NULL);
chooser->emoji_max_width = rect.width;
g_object_unref (layout);
diff --git a/gtk/gtkemojicompletion.c b/gtk/gtkemojicompletion.c
index 31669c85d5..a0d2693d42 100644
--- a/gtk/gtkemojicompletion.c
+++ b/gtk/gtkemojicompletion.c
@@ -456,16 +456,16 @@ add_emoji_variation (GtkWidget *box,
{
GtkWidget *child;
GtkWidget *label;
- PangoAttrList *attrs;
+ Pango2AttrList *attrs;
char text[64];
get_text (emoji_data, modifier, text, 64);
label = gtk_label_new (text);
- attrs = pango_attr_list_new ();
- pango_attr_list_insert (attrs, pango_attr_scale_new (PANGO_SCALE_X_LARGE));
+ attrs = pango2_attr_list_new ();
+ pango2_attr_list_insert (attrs, pango2_attr_scale_new (PANGO2_SCALE_X_LARGE));
gtk_label_set_attributes (GTK_LABEL (label), attrs);
- pango_attr_list_unref (attrs);
+ pango2_attr_list_unref (attrs);
child = g_object_new (GTK_TYPE_FLOW_BOX_CHILD, "css-name", "emoji", NULL);
g_object_set_data_full (G_OBJECT (child), "text", g_strdup (text), g_free);
@@ -487,7 +487,7 @@ add_emoji (GtkWidget *list,
GtkWidget *child;
GtkWidget *label;
GtkWidget *box;
- PangoAttrList *attrs;
+ Pango2AttrList *attrs;
char text[64];
const char *name;
GtkWidget *stack;
@@ -496,10 +496,10 @@ add_emoji (GtkWidget *list,
get_text (emoji_data, 0, text, 64);
label = gtk_label_new (text);
- attrs = pango_attr_list_new ();
- pango_attr_list_insert (attrs, pango_attr_scale_new (PANGO_SCALE_X_LARGE));
+ attrs = pango2_attr_list_new ();
+ pango2_attr_list_insert (attrs, pango2_attr_scale_new (PANGO2_SCALE_X_LARGE));
gtk_label_set_attributes (GTK_LABEL (label), attrs);
- pango_attr_list_unref (attrs);
+ pango2_attr_list_unref (attrs);
gtk_widget_add_css_class (label, "emoji");
child = g_object_new (GTK_TYPE_LIST_BOX_ROW, "css-name", "emoji-completion-row", NULL);
diff --git a/gtk/gtkentry.c b/gtk/gtkentry.c
index b0cee37e4c..5938380fcb 100644
--- a/gtk/gtkentry.c
+++ b/gtk/gtkentry.c
@@ -140,21 +140,21 @@
* The `GtkEntry` implementation of the `GtkBuildable` interface supports a
* custom <attributes> element, which supports any number of <attribute>
* elements. The <attribute> element has attributes named “name“, “value“,
- * “start“ and “end“ and allows you to specify `PangoAttribute` values for
+ * “start“ and “end“ and allows you to specify `Pango2Attribute` values for
* this label.
*
- * An example of a UI definition fragment specifying Pango attributes:
+ * An example of a UI definition fragment specifying Pango2 attributes:
* ```xml
* <object class="GtkEntry">
* <attributes>
- * <attribute name="weight" value="PANGO_WEIGHT_BOLD"/>
+ * <attribute name="weight" value="PANGO2_WEIGHT_BOLD"/>
* <attribute name="background" value="red" start="5" end="10"/>
* </attributes>
* </object>
* ```
*
* The start and end attributes specify the range of characters to which the
- * Pango attribute applies. If start and end are not specified, the attribute
+ * Pango2 attribute applies. If start and end are not specified, the attribute
* is applied to the whole text. Note that specifying ranges does not make much
* sense with translatable attributes. Use markup embedded in the translatable
* content instead.
@@ -414,7 +414,7 @@ gtk_entry_buildable_custom_finished (GtkBuildable *buildable,
if (data->attrs)
{
gtk_entry_set_attributes (GTK_ENTRY (buildable), data->attrs);
- pango_attr_list_unref (data->attrs);
+ pango2_attr_list_unref (data->attrs);
}
g_object_unref (data->object);
@@ -885,16 +885,16 @@ gtk_entry_class_init (GtkEntryClass *class)
/**
* GtkEntry:attributes: (attributes org.gtk.Property.get=gtk_entry_get_attributes
org.gtk.Property.set=gtk_entry_set_attributes)
*
- * A list of Pango attributes to apply to the text of the entry.
+ * A list of Pango2 attributes to apply to the text of the entry.
*
* This is mainly useful to change the size or weight of the text.
*
- * The `PangoAttribute`'s @start_index and @end_index must refer to the
+ * The `Pango2Attribute`'s @start_index and @end_index must refer to the
* [class@Gtk.EntryBuffer] text, i.e. without the preedit string.
*/
entry_props[PROP_ATTRIBUTES] =
g_param_spec_boxed ("attributes", NULL, NULL,
- PANGO_TYPE_ATTR_LIST,
+ PANGO2_TYPE_ATTR_LIST,
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
/**
@@ -904,7 +904,7 @@ gtk_entry_class_init (GtkEntryClass *class)
*/
entry_props[PROP_TABS] =
g_param_spec_boxed ("tabs", NULL, NULL,
- PANGO_TYPE_TAB_ARRAY,
+ PANGO2_TYPE_TAB_ARRAY,
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
/**
@@ -3017,7 +3017,7 @@ gtk_entry_get_icon_tooltip_text (GtkEntry *entry,
return NULL;
if (icon_info->tooltip &&
- !pango_parse_markup (icon_info->tooltip, -1, 0, NULL, &text, NULL, NULL))
+ !pango2_parse_markup (icon_info->tooltip, -1, 0, NULL, &text, NULL, NULL))
g_assert (NULL == text); /* text should still be NULL in case of markup errors */
return text;
@@ -3116,7 +3116,7 @@ gtk_entry_get_icon_tooltip_markup (GtkEntry *entry,
* Sets @tooltip as the contents of the tooltip for the icon at
* the specified position.
*
- * @tooltip is assumed to be marked up with Pango Markup.
+ * @tooltip is assumed to be marked up with Pango2 Markup.
*
* Use %NULL for @tooltip to remove an existing tooltip.
*
@@ -3537,9 +3537,9 @@ gtk_entry_get_input_hints (GtkEntry *entry)
/**
* gtk_entry_set_attributes: (attributes org.gtk.Method.set_property=attributes)
* @entry: a `GtkEntry`
- * @attrs: a `PangoAttrList`
+ * @attrs: a `Pango2AttrList`
*
- * Sets a `PangoAttrList`.
+ * Sets a `Pango2AttrList`.
*
* The attributes in the list are applied to the entry text.
*
@@ -3549,7 +3549,7 @@ gtk_entry_get_input_hints (GtkEntry *entry)
*/
void
gtk_entry_set_attributes (GtkEntry *entry,
- PangoAttrList *attrs)
+ Pango2AttrList *attrs)
{
GtkEntryPrivate *priv = gtk_entry_get_instance_private (entry);
@@ -3568,7 +3568,7 @@ gtk_entry_set_attributes (GtkEntry *entry,
*
* Returns: (transfer none) (nullable): the attribute list
*/
-PangoAttrList *
+Pango2AttrList *
gtk_entry_get_attributes (GtkEntry *entry)
{
GtkEntryPrivate *priv = gtk_entry_get_instance_private (entry);
@@ -3581,16 +3581,16 @@ gtk_entry_get_attributes (GtkEntry *entry)
/**
* gtk_entry_set_tabs: (attributes org.gtk.Method.set_property=tabs)
* @entry: a `GtkEntry`
- * @tabs: (nullable): a `PangoTabArray`
+ * @tabs: (nullable): a `Pango2TabArray`
*
- * Sets a `PangoTabArray`.
+ * Sets a `Pango2TabArray`.
*
* The tabstops in the array are applied to the entry text.
*/
void
gtk_entry_set_tabs (GtkEntry *entry,
- PangoTabArray *tabs)
+ Pango2TabArray *tabs)
{
GtkEntryPrivate *priv = gtk_entry_get_instance_private (entry);
@@ -3610,7 +3610,7 @@ gtk_entry_set_tabs (GtkEntry *entry,
* Returns: (nullable) (transfer none): the tabstops
*/
-PangoTabArray *
+Pango2TabArray *
gtk_entry_get_tabs (GtkEntry *entry)
{
GtkEntryPrivate *priv = gtk_entry_get_instance_private (entry);
diff --git a/gtk/gtkentry.h b/gtk/gtkentry.h
index c55538f57a..71b905bace 100644
--- a/gtk/gtkentry.h
+++ b/gtk/gtkentry.h
@@ -271,16 +271,16 @@ GtkInputHints gtk_entry_get_input_hints (GtkEntry
GDK_AVAILABLE_IN_ALL
void gtk_entry_set_attributes (GtkEntry *entry,
- PangoAttrList *attrs);
+ Pango2AttrList *attrs);
GDK_AVAILABLE_IN_ALL
-PangoAttrList *gtk_entry_get_attributes (GtkEntry *entry);
+Pango2AttrList *gtk_entry_get_attributes (GtkEntry *entry);
GDK_AVAILABLE_IN_ALL
void gtk_entry_set_tabs (GtkEntry *entry,
- PangoTabArray *tabs);
+ Pango2TabArray *tabs);
GDK_AVAILABLE_IN_ALL
-PangoTabArray *gtk_entry_get_tabs (GtkEntry *entry);
+Pango2TabArray *gtk_entry_get_tabs (GtkEntry *entry);
GDK_AVAILABLE_IN_ALL
gboolean gtk_entry_grab_focus_without_selecting (GtkEntry *entry);
diff --git a/gtk/gtkfilechooserdialog.c b/gtk/gtkfilechooserdialog.c
index 754aebc650..c02c6e62e6 100644
--- a/gtk/gtkfilechooserdialog.c
+++ b/gtk/gtkfilechooserdialog.c
@@ -485,7 +485,7 @@ setup_search (GtkFileChooserDialog *dialog)
label = gtk_label_new (NULL);
gtk_widget_set_halign (label, GTK_ALIGN_CENTER);
gtk_label_set_single_line_mode (GTK_LABEL (label), TRUE);
- gtk_label_set_ellipsize (GTK_LABEL (label), PANGO_ELLIPSIZE_END);
+ gtk_label_set_ellipsize (GTK_LABEL (label), PANGO2_ELLIPSIZE_END);
gtk_label_set_width_chars (GTK_LABEL (label), 5);
gtk_widget_add_css_class (label, "title");
gtk_widget_set_parent (label, box);
@@ -497,7 +497,7 @@ setup_search (GtkFileChooserDialog *dialog)
label = gtk_label_new (NULL);
gtk_widget_set_halign (label, GTK_ALIGN_CENTER);
gtk_label_set_single_line_mode (GTK_LABEL (label), TRUE);
- gtk_label_set_ellipsize (GTK_LABEL (label), PANGO_ELLIPSIZE_END);
+ gtk_label_set_ellipsize (GTK_LABEL (label), PANGO2_ELLIPSIZE_END);
gtk_widget_add_css_class (label, "subtitle");
gtk_widget_set_parent (label, box);
diff --git a/gtk/gtkfilechooserwidget.c b/gtk/gtkfilechooserwidget.c
index 6e212f5ab2..a5b0d138f7 100644
--- a/gtk/gtkfilechooserwidget.c
+++ b/gtk/gtkfilechooserwidget.c
@@ -378,7 +378,7 @@ enum {
G_TYPE_STRING, /* MODEL_COL_DATE_TEXT */ \
G_TYPE_STRING, /* MODEL_COL_TIME_TEXT */ \
G_TYPE_STRING, /* MODEL_COL_LOCATION_TEXT */ \
- PANGO_TYPE_ELLIPSIZE_MODE /* MODEL_COL_ELLIPSIZE */
+ PANGO2_TYPE_ELLIPSIZE_MODE /* MODEL_COL_ELLIPSIZE */
#define DEFAULT_RECENT_FILES_LIMIT 50
@@ -4564,7 +4564,7 @@ file_system_model_set (GtkFileSystemModel *model,
break;
}
case MODEL_COL_ELLIPSIZE:
- g_value_set_enum (value, info ? PANGO_ELLIPSIZE_END : PANGO_ELLIPSIZE_NONE);
+ g_value_set_enum (value, info ? PANGO2_ELLIPSIZE_END : PANGO2_ELLIPSIZE_NONE);
break;
case MODEL_COL_LOCATION_TEXT:
{
diff --git a/gtk/gtkfontbutton.c b/gtk/gtkfontbutton.c
index 16b6630e46..135e7c9a02 100644
--- a/gtk/gtkfontbutton.c
+++ b/gtk/gtkfontbutton.c
@@ -92,12 +92,12 @@ struct _GtkFontButton
GtkWidget *font_size_box;
int font_size;
- PangoFontDescription *font_desc;
- PangoFontFamily *font_family;
- PangoFontFace *font_face;
- PangoFontMap *font_map;
+ Pango2FontDescription *font_desc;
+ Pango2FontFamily *font_family;
+ Pango2FontFace *font_face;
+ Pango2FontMap *font_map;
char *font_features;
- PangoLanguage *language;
+ Pango2Language *language;
char *preview_text;
GtkFontFilterFunc font_filter;
gpointer font_filter_data;
@@ -165,16 +165,16 @@ static void gtk_font_button_set_language (GtkFontButton *button,
static guint font_button_signals[LAST_SIGNAL] = { 0 };
-static PangoFontFamily * gtk_font_button_font_chooser_get_font_family (GtkFontChooser *chooser);
-static PangoFontFace * gtk_font_button_font_chooser_get_font_face (GtkFontChooser *chooser);
+static Pango2FontFamily * gtk_font_button_font_chooser_get_font_family (GtkFontChooser *chooser);
+static Pango2FontFace * gtk_font_button_font_chooser_get_font_face (GtkFontChooser *chooser);
static int gtk_font_button_font_chooser_get_font_size (GtkFontChooser *chooser);
static void gtk_font_button_font_chooser_set_filter_func (GtkFontChooser *chooser,
GtkFontFilterFunc filter_func,
gpointer filter_data,
GDestroyNotify data_destroy);
static void gtk_font_button_font_chooser_set_font_map (GtkFontChooser *chooser,
- PangoFontMap *font_map);
-static PangoFontMap * gtk_font_button_font_chooser_get_font_map (GtkFontChooser *chooser);
+ Pango2FontMap *font_map);
+static Pango2FontMap * gtk_font_button_font_chooser_get_font_map (GtkFontChooser *chooser);
static void
@@ -197,7 +197,7 @@ clear_font_data (GtkFontButton *font_button)
{
g_clear_object (&font_button->font_family);
g_clear_object (&font_button->font_face);
- g_clear_pointer (&font_button->font_desc, pango_font_description_free);
+ g_clear_pointer (&font_button->font_desc, pango2_font_description_free);
g_clear_pointer (&font_button->fontname, g_free);
g_clear_pointer (&font_button->font_features, g_free);
}
@@ -213,48 +213,48 @@ clear_font_filter_data (GtkFontButton *font_button)
}
static gboolean
-font_description_style_equal (const PangoFontDescription *a,
- const PangoFontDescription *b)
+font_description_style_equal (const Pango2FontDescription *a,
+ const Pango2FontDescription *b)
{
- return (pango_font_description_get_weight (a) == pango_font_description_get_weight (b) &&
- pango_font_description_get_style (a) == pango_font_description_get_style (b) &&
- pango_font_description_get_stretch (a) == pango_font_description_get_stretch (b) &&
- pango_font_description_get_variant (a) == pango_font_description_get_variant (b));
+ return (pango2_font_description_get_weight (a) == pango2_font_description_get_weight (b) &&
+ pango2_font_description_get_style (a) == pango2_font_description_get_style (b) &&
+ pango2_font_description_get_stretch (a) == pango2_font_description_get_stretch (b) &&
+ pango2_font_description_get_variant (a) == pango2_font_description_get_variant (b));
}
static void
gtk_font_button_update_font_data (GtkFontButton *font_button)
{
const char *name;
- PangoFontMap *font_map;
- PangoFontFamily *family;
+ Pango2FontMap *font_map;
+ Pango2FontFamily *family;
g_assert (font_button->font_desc != NULL);
- font_button->fontname = pango_font_description_to_string (font_button->font_desc);
+ font_button->fontname = pango2_font_description_to_string (font_button->font_desc);
- name = pango_font_description_get_family (font_button->font_desc);
+ name = pango2_font_description_get_family (font_button->font_desc);
if (name == NULL)
return;
- font_map = pango_context_get_font_map (gtk_widget_get_pango_context (font_button->font_label));
- family = pango_font_map_get_family (font_map, name);
+ font_map = pango2_context_get_font_map (gtk_widget_get_pango_context (font_button->font_label));
+ family = pango2_font_map_get_family (font_map, name);
g_set_object (&font_button->font_family, family);
for (int i = 0; i < g_list_model_get_n_items (G_LIST_MODEL (font_button->font_family)); i++)
{
- PangoFontFace *face = g_list_model_get_item (G_LIST_MODEL (font_button->font_family), i);
- PangoFontDescription *tmp_desc = pango_font_face_describe (face);
+ Pango2FontFace *face = g_list_model_get_item (G_LIST_MODEL (font_button->font_family), i);
+ Pango2FontDescription *tmp_desc = pango2_font_face_describe (face);
if (font_description_style_equal (tmp_desc, font_button->font_desc))
{
g_set_object (&font_button->font_face, face);
- pango_font_description_free (tmp_desc);
+ pango2_font_description_free (tmp_desc);
g_object_unref (face);
break;
}
- pango_font_description_free (tmp_desc);
+ pango2_font_description_free (tmp_desc);
g_object_unref (face);
}
}
@@ -308,7 +308,7 @@ gtk_font_button_set_show_preview_entry (GtkFontButton *font_button,
}
}
-static PangoFontFamily *
+static Pango2FontFamily *
gtk_font_button_font_chooser_get_font_family (GtkFontChooser *chooser)
{
GtkFontButton *font_button = GTK_FONT_BUTTON (chooser);
@@ -316,7 +316,7 @@ gtk_font_button_font_chooser_get_font_family (GtkFontChooser *chooser)
return font_button->font_family;
}
-static PangoFontFace *
+static Pango2FontFace *
gtk_font_button_font_chooser_get_font_face (GtkFontChooser *chooser)
{
GtkFontButton *font_button = GTK_FONT_BUTTON (chooser);
@@ -357,14 +357,14 @@ gtk_font_button_font_chooser_set_filter_func (GtkFontChooser *chooser,
static void
gtk_font_button_take_font_desc (GtkFontButton *font_button,
- PangoFontDescription *font_desc)
+ Pango2FontDescription *font_desc)
{
GObject *object = G_OBJECT (font_button);
if (font_button->font_desc && font_desc &&
- pango_font_description_equal (font_button->font_desc, font_desc))
+ pango2_font_description_equal (font_button->font_desc, font_desc))
{
- pango_font_description_free (font_desc);
+ pango2_font_description_free (font_desc);
return;
}
@@ -375,12 +375,12 @@ gtk_font_button_take_font_desc (GtkFontButton *font_button,
if (font_desc)
font_button->font_desc = font_desc; /* adopted */
else
- font_button->font_desc = pango_font_description_from_string (_("Sans 12"));
+ font_button->font_desc = pango2_font_description_from_string (_("Sans 12"));
- if (pango_font_description_get_size_is_absolute (font_button->font_desc))
- font_button->font_size = pango_font_description_get_size (font_button->font_desc);
+ if (pango2_font_description_get_size_is_absolute (font_button->font_desc))
+ font_button->font_size = pango2_font_description_get_size (font_button->font_desc);
else
- font_button->font_size = pango_font_description_get_size (font_button->font_desc) / PANGO_SCALE;
+ font_button->font_size = pango2_font_description_get_size (font_button->font_desc) / PANGO2_SCALE;
gtk_font_button_update_font_data (font_button);
gtk_font_button_update_font_info (font_button);
@@ -395,7 +395,7 @@ gtk_font_button_take_font_desc (GtkFontButton *font_button,
g_object_thaw_notify (object);
}
-static const PangoFontDescription *
+static const Pango2FontDescription *
gtk_font_button_get_font_desc (GtkFontButton *font_button)
{
return font_button->font_desc;
@@ -403,25 +403,25 @@ gtk_font_button_get_font_desc (GtkFontButton *font_button)
static void
gtk_font_button_font_chooser_set_font_map (GtkFontChooser *chooser,
- PangoFontMap *font_map)
+ Pango2FontMap *font_map)
{
GtkFontButton *font_button = GTK_FONT_BUTTON (chooser);
if (g_set_object (&font_button->font_map, font_map))
{
- PangoContext *context;
+ Pango2Context *context;
if (!font_map)
- font_map = pango_font_map_get_default ();
+ font_map = pango2_font_map_get_default ();
context = gtk_widget_get_pango_context (font_button->font_label);
- pango_context_set_font_map (context, font_map);
+ pango2_context_set_font_map (context, font_map);
if (font_button->font_dialog)
gtk_font_chooser_set_font_map (GTK_FONT_CHOOSER (font_button->font_dialog), font_map);
}
}
-static PangoFontMap *
+static Pango2FontMap *
gtk_font_button_font_chooser_get_font_map (GtkFontChooser *chooser)
{
GtkFontButton *font_button = GTK_FONT_BUTTON (chooser);
@@ -604,7 +604,7 @@ gtk_font_button_init (GtkFontButton *font_button)
font_button->level = GTK_FONT_CHOOSER_LEVEL_FAMILY |
GTK_FONT_CHOOSER_LEVEL_STYLE |
GTK_FONT_CHOOSER_LEVEL_SIZE;
- font_button->language = pango_language_get_default ();
+ font_button->language = pango2_language_get_default ();
gtk_font_button_take_font_desc (font_button, NULL);
@@ -705,7 +705,7 @@ gtk_font_button_get_property (GObject *object,
g_value_set_string (value, font_button->font_features);
break;
case GTK_FONT_CHOOSER_PROP_LANGUAGE:
- g_value_set_string (value, pango_language_to_string (font_button->language));
+ g_value_set_string (value, pango2_language_to_string (font_button->language));
break;
case GTK_FONT_CHOOSER_PROP_LEVEL:
g_value_set_flags (value, font_button->level);
@@ -931,9 +931,9 @@ static void
gtk_font_button_set_font_name (GtkFontButton *font_button,
const char *fontname)
{
- PangoFontDescription *font_desc;
+ Pango2FontDescription *font_desc;
- font_desc = pango_font_description_from_string (fontname);
+ font_desc = pango2_font_description_from_string (fontname);
gtk_font_button_take_font_desc (font_button, font_desc);
}
@@ -962,7 +962,7 @@ gtk_font_button_clicked (GtkButton *button,
gtk_font_chooser_set_show_preview_entry (font_dialog, font_button->show_preview_entry);
gtk_font_chooser_set_level (GTK_FONT_CHOOSER (font_dialog), font_button->level);
- gtk_font_chooser_set_language (GTK_FONT_CHOOSER (font_dialog), pango_language_to_string
(font_button->language));
+ gtk_font_chooser_set_language (GTK_FONT_CHOOSER (font_dialog), pango2_language_to_string
(font_button->language));
if (font_button->preview_text)
{
@@ -1034,7 +1034,7 @@ response_cb (GtkDialog *dialog,
font_button->font_desc = gtk_font_chooser_get_font_desc (font_chooser);
if (font_button->font_desc)
- font_button->fontname = pango_font_description_to_string (font_button->font_desc);
+ font_button->fontname = pango2_font_description_to_string (font_button->font_desc);
font_button->font_family = gtk_font_chooser_get_font_family (font_chooser);
if (font_button->font_family)
g_object_ref (font_button->font_family);
@@ -1044,7 +1044,7 @@ response_cb (GtkDialog *dialog,
font_button->font_size = gtk_font_chooser_get_font_size (font_chooser);
g_free (font_button->font_features);
font_button->font_features = gtk_font_chooser_get_font_features (font_chooser);
- font_button->language = pango_language_from_string (gtk_font_chooser_get_language (font_chooser));
+ font_button->language = pango2_language_from_string (gtk_font_chooser_get_language (font_chooser));
/* Set label font */
gtk_font_button_update_font_info (font_button);
@@ -1126,151 +1126,151 @@ skip:
}
static char *
-pango_font_description_to_css (PangoFontDescription *desc,
+pango2_font_description_to_css (Pango2FontDescription *desc,
const char *features,
const char *language)
{
GString *s;
- PangoFontMask set;
+ Pango2FontMask set;
s = g_string_new ("* { ");
- set = pango_font_description_get_set_fields (desc);
- if (set & PANGO_FONT_MASK_FAMILY)
+ set = pango2_font_description_get_set_fields (desc);
+ if (set & PANGO2_FONT_MASK_FAMILY)
{
g_string_append (s, "font-family: \"");
- g_string_append (s, pango_font_description_get_family (desc));
+ g_string_append (s, pango2_font_description_get_family (desc));
g_string_append (s, "\"; ");
}
- if (set & PANGO_FONT_MASK_STYLE)
+ if (set & PANGO2_FONT_MASK_STYLE)
{
- switch (pango_font_description_get_style (desc))
+ switch (pango2_font_description_get_style (desc))
{
- case PANGO_STYLE_NORMAL:
+ case PANGO2_STYLE_NORMAL:
g_string_append (s, "font-style: normal; ");
break;
- case PANGO_STYLE_OBLIQUE:
+ case PANGO2_STYLE_OBLIQUE:
g_string_append (s, "font-style: oblique; ");
break;
- case PANGO_STYLE_ITALIC:
+ case PANGO2_STYLE_ITALIC:
g_string_append (s, "font-style: italic; ");
break;
default:
break;
}
}
- if (set & PANGO_FONT_MASK_VARIANT)
+ if (set & PANGO2_FONT_MASK_VARIANT)
{
- switch (pango_font_description_get_variant (desc))
+ switch (pango2_font_description_get_variant (desc))
{
- case PANGO_VARIANT_NORMAL:
+ case PANGO2_VARIANT_NORMAL:
g_string_append (s, "font-variant: normal; ");
break;
- case PANGO_VARIANT_SMALL_CAPS:
+ case PANGO2_VARIANT_SMALL_CAPS:
g_string_append (s, "font-variant: small-caps; ");
break;
- case PANGO_VARIANT_ALL_SMALL_CAPS:
+ case PANGO2_VARIANT_ALL_SMALL_CAPS:
g_string_append (s, "font-variant: all-small-caps; ");
break;
- case PANGO_VARIANT_PETITE_CAPS:
+ case PANGO2_VARIANT_PETITE_CAPS:
g_string_append (s, "font-variant: petite-caps; ");
break;
- case PANGO_VARIANT_ALL_PETITE_CAPS:
+ case PANGO2_VARIANT_ALL_PETITE_CAPS:
g_string_append (s, "font-variant: all-petite-caps; ");
break;
- case PANGO_VARIANT_UNICASE:
+ case PANGO2_VARIANT_UNICASE:
g_string_append (s, "font-variant: unicase; ");
break;
- case PANGO_VARIANT_TITLE_CAPS:
+ case PANGO2_VARIANT_TITLE_CAPS:
g_string_append (s, "font-variant: titling-caps; ");
break;
default:
break;
}
}
- if (set & PANGO_FONT_MASK_WEIGHT)
+ if (set & PANGO2_FONT_MASK_WEIGHT)
{
- switch (pango_font_description_get_weight (desc))
+ switch (pango2_font_description_get_weight (desc))
{
- case PANGO_WEIGHT_THIN:
+ case PANGO2_WEIGHT_THIN:
g_string_append (s, "font-weight: 100; ");
break;
- case PANGO_WEIGHT_ULTRALIGHT:
+ case PANGO2_WEIGHT_ULTRALIGHT:
g_string_append (s, "font-weight: 200; ");
break;
- case PANGO_WEIGHT_LIGHT:
- case PANGO_WEIGHT_SEMILIGHT:
+ case PANGO2_WEIGHT_LIGHT:
+ case PANGO2_WEIGHT_SEMILIGHT:
g_string_append (s, "font-weight: 300; ");
break;
- case PANGO_WEIGHT_BOOK:
- case PANGO_WEIGHT_NORMAL:
+ case PANGO2_WEIGHT_BOOK:
+ case PANGO2_WEIGHT_NORMAL:
g_string_append (s, "font-weight: 400; ");
break;
- case PANGO_WEIGHT_MEDIUM:
+ case PANGO2_WEIGHT_MEDIUM:
g_string_append (s, "font-weight: 500; ");
break;
- case PANGO_WEIGHT_SEMIBOLD:
+ case PANGO2_WEIGHT_SEMIBOLD:
g_string_append (s, "font-weight: 600; ");
break;
- case PANGO_WEIGHT_BOLD:
+ case PANGO2_WEIGHT_BOLD:
g_string_append (s, "font-weight: 700; ");
break;
- case PANGO_WEIGHT_ULTRABOLD:
+ case PANGO2_WEIGHT_ULTRABOLD:
g_string_append (s, "font-weight: 800; ");
break;
- case PANGO_WEIGHT_HEAVY:
- case PANGO_WEIGHT_ULTRAHEAVY:
+ case PANGO2_WEIGHT_HEAVY:
+ case PANGO2_WEIGHT_ULTRAHEAVY:
g_string_append (s, "font-weight: 900; ");
break;
default:
break;
}
}
- if (set & PANGO_FONT_MASK_STRETCH)
+ if (set & PANGO2_FONT_MASK_STRETCH)
{
- switch (pango_font_description_get_stretch (desc))
+ switch (pango2_font_description_get_stretch (desc))
{
- case PANGO_STRETCH_ULTRA_CONDENSED:
+ case PANGO2_STRETCH_ULTRA_CONDENSED:
g_string_append (s, "font-stretch: ultra-condensed; ");
break;
- case PANGO_STRETCH_EXTRA_CONDENSED:
+ case PANGO2_STRETCH_EXTRA_CONDENSED:
g_string_append (s, "font-stretch: extra-condensed; ");
break;
- case PANGO_STRETCH_CONDENSED:
+ case PANGO2_STRETCH_CONDENSED:
g_string_append (s, "font-stretch: condensed; ");
break;
- case PANGO_STRETCH_SEMI_CONDENSED:
+ case PANGO2_STRETCH_SEMI_CONDENSED:
g_string_append (s, "font-stretch: semi-condensed; ");
break;
- case PANGO_STRETCH_NORMAL:
+ case PANGO2_STRETCH_NORMAL:
g_string_append (s, "font-stretch: normal; ");
break;
- case PANGO_STRETCH_SEMI_EXPANDED:
+ case PANGO2_STRETCH_SEMI_EXPANDED:
g_string_append (s, "font-stretch: semi-expanded; ");
break;
- case PANGO_STRETCH_EXPANDED:
+ case PANGO2_STRETCH_EXPANDED:
g_string_append (s, "font-stretch: expanded; ");
break;
- case PANGO_STRETCH_EXTRA_EXPANDED:
+ case PANGO2_STRETCH_EXTRA_EXPANDED:
break;
- case PANGO_STRETCH_ULTRA_EXPANDED:
+ case PANGO2_STRETCH_ULTRA_EXPANDED:
g_string_append (s, "font-stretch: ultra-expanded; ");
break;
default:
break;
}
}
- if (set & PANGO_FONT_MASK_SIZE)
+ if (set & PANGO2_FONT_MASK_SIZE)
{
- g_string_append_printf (s, "font-size: %dpt; ", pango_font_description_get_size (desc) / PANGO_SCALE);
+ g_string_append_printf (s, "font-size: %dpt; ", pango2_font_description_get_size (desc) /
PANGO2_SCALE);
}
- if (set & PANGO_FONT_MASK_VARIATIONS)
+ if (set & PANGO2_FONT_MASK_VARIATIONS)
{
const char *variations;
g_string_append (s, "font-variation-settings: ");
- variations = pango_font_description_get_variations (desc);
+ variations = pango2_font_description_get_variations (desc);
add_css_variations (s, variations);
g_string_append (s, "; ");
}
@@ -1301,7 +1301,7 @@ gtk_font_button_label_use_font (GtkFontButton *font_button)
}
else
{
- PangoFontDescription *desc;
+ Pango2FontDescription *desc;
char *data;
if (!font_button->provider)
@@ -1312,18 +1312,18 @@ gtk_font_button_label_use_font (GtkFontButton *font_button)
GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
}
- desc = pango_font_description_copy (font_button->font_desc);
+ desc = pango2_font_description_copy (font_button->font_desc);
if (!font_button->use_size)
- pango_font_description_unset_fields (desc, PANGO_FONT_MASK_SIZE);
+ pango2_font_description_unset_fields (desc, PANGO2_FONT_MASK_SIZE);
- data = pango_font_description_to_css (desc,
+ data = pango2_font_description_to_css (desc,
font_button->font_features,
- pango_language_to_string (font_button->language));
+ pango2_language_to_string (font_button->language));
gtk_css_provider_load_from_data (font_button->provider, data, -1);
g_free (data);
- pango_font_description_free (desc);
+ pango2_font_description_free (desc);
}
}
@@ -1335,11 +1335,11 @@ gtk_font_button_update_font_info (GtkFontButton *font_button)
char *family_style;
if (font_button->font_family)
- fam_name = pango_font_family_get_name (font_button->font_family);
+ fam_name = pango2_font_family_get_name (font_button->font_family);
else
fam_name = C_("font", "None");
if (font_button->font_face)
- face_name = pango_font_face_get_name (font_button->font_face);
+ face_name = pango2_font_face_get_name (font_button->font_face);
else
face_name = "";
@@ -1353,10 +1353,10 @@ gtk_font_button_update_font_info (GtkFontButton *font_button)
if ((font_button->level & GTK_FONT_CHOOSER_LEVEL_SIZE) != 0)
{
- /* mirror Pango, which doesn't translate this either */
+ /* mirror Pango2, which doesn't translate this either */
char *size = g_strdup_printf ("%2.4g%s",
- pango_font_description_get_size (font_button->font_desc) /
(double)PANGO_SCALE,
- pango_font_description_get_size_is_absolute (font_button->font_desc) ?
"px" : "");
+ pango2_font_description_get_size (font_button->font_desc) /
(double)PANGO2_SCALE,
+ pango2_font_description_get_size_is_absolute (font_button->font_desc) ?
"px" : "");
gtk_label_set_text (GTK_LABEL (font_button->size_label), size);
@@ -1392,7 +1392,7 @@ static void
gtk_font_button_set_language (GtkFontButton *font_button,
const char *language)
{
- font_button->language = pango_language_from_string (language);
+ font_button->language = pango2_language_from_string (language);
if (font_button->font_dialog)
gtk_font_chooser_set_language (GTK_FONT_CHOOSER (font_button->font_dialog), language);
diff --git a/gtk/gtkfontchooser.c b/gtk/gtkfontchooser.c
index f359bd7788..b569dfe9de 100644
--- a/gtk/gtkfontchooser.c
+++ b/gtk/gtkfontchooser.c
@@ -65,12 +65,12 @@ gtk_font_chooser_default_init (GtkFontChooserInterface *iface)
/**
* GtkFontChooser:font-desc: (attributes org.gtk.Property.get=gtk_font_chooser_get_font_desc
org.gtk.Property.set=gtk_font_chooser_set_font_desc)
*
- * The font description as a `PangoFontDescription`.
+ * The font description as a `Pango2FontDescription`.
*/
g_object_interface_install_property
(iface,
g_param_spec_boxed ("font-desc", NULL, NULL,
- PANGO_TYPE_FONT_DESCRIPTION,
+ PANGO2_TYPE_FONT_DESCRIPTION,
GTK_PARAM_READWRITE));
/**
@@ -81,7 +81,7 @@ gtk_font_chooser_default_init (GtkFontChooserInterface *iface)
g_object_interface_install_property
(iface,
g_param_spec_string ("preview-text", NULL, NULL,
- pango_language_get_sample_string (NULL),
+ pango2_language_get_sample_string (NULL),
GTK_PARAM_READWRITE));
/**
@@ -115,7 +115,7 @@ gtk_font_chooser_default_init (GtkFontChooserInterface *iface)
* The selected font features.
*
* The format of the string is compatible with
- * CSS and with Pango attributes.
+ * CSS and with Pango2 attributes.
*/
g_object_interface_install_property
(iface,
@@ -160,16 +160,16 @@ gtk_font_chooser_default_init (GtkFontChooserInterface *iface)
* gtk_font_chooser_get_font_family:
* @fontchooser: a `GtkFontChooser`
*
- * Gets the `PangoFontFamily` representing the selected font family.
+ * Gets the `Pango2FontFamily` representing the selected font family.
*
* Font families are a collection of font faces.
*
* If the selected font is not installed, returns %NULL.
*
- * Returns: (nullable) (transfer none): A `PangoFontFamily` representing the
+ * Returns: (nullable) (transfer none): A `Pango2FontFamily` representing the
* selected font family
*/
-PangoFontFamily *
+Pango2FontFamily *
gtk_font_chooser_get_font_family (GtkFontChooser *fontchooser)
{
g_return_val_if_fail (GTK_IS_FONT_CHOOSER (fontchooser), NULL);
@@ -181,15 +181,15 @@ gtk_font_chooser_get_font_family (GtkFontChooser *fontchooser)
* gtk_font_chooser_get_font_face:
* @fontchooser: a `GtkFontChooser`
*
- * Gets the `PangoFontFace` representing the selected font group
+ * Gets the `Pango2FontFace` representing the selected font group
* details (i.e. family, slant, weight, width, etc).
*
* If the selected font is not installed, returns %NULL.
*
- * Returns: (nullable) (transfer none): A `PangoFontFace` representing the
+ * Returns: (nullable) (transfer none): A `Pango2FontFace` representing the
* selected font group details
*/
-PangoFontFace *
+Pango2FontFace *
gtk_font_chooser_get_font_face (GtkFontChooser *fontchooser)
{
g_return_val_if_fail (GTK_IS_FONT_CHOOSER (fontchooser), NULL);
@@ -226,7 +226,7 @@ gtk_font_chooser_get_font_size (GtkFontChooser *fontchooser)
* structure. For example, “Helvetica Italic Bold 12” could be
* normalized to “Helvetica Bold Italic 12”.
*
- * Use [method@Pango.FontDescription.equal] if you want to compare two
+ * Use [method@Pango2.FontDescription.equal] if you want to compare two
* font descriptions.
*
* Returns: (nullable) (transfer full): A string with the name
@@ -274,16 +274,16 @@ gtk_font_chooser_set_font (GtkFontChooser *fontchooser,
* structure. For example, “Helvetica Italic Bold 12” could be
* normalized to “Helvetica Bold Italic 12”.
*
- * Use [method@Pango.FontDescription.equal] if you want to compare two
+ * Use [method@Pango2.FontDescription.equal] if you want to compare two
* font descriptions.
*
- * Returns: (nullable) (transfer full): A `PangoFontDescription` for the
+ * Returns: (nullable) (transfer full): A `Pango2FontDescription` for the
* current font
*/
-PangoFontDescription *
+Pango2FontDescription *
gtk_font_chooser_get_font_desc (GtkFontChooser *fontchooser)
{
- PangoFontDescription *font_desc;
+ Pango2FontDescription *font_desc;
g_return_val_if_fail (GTK_IS_FONT_CHOOSER (fontchooser), NULL);
@@ -295,13 +295,13 @@ gtk_font_chooser_get_font_desc (GtkFontChooser *fontchooser)
/**
* gtk_font_chooser_set_font_desc: (attributes org.gtk.Method.set_property=font-desc)
* @fontchooser: a `GtkFontChooser`
- * @font_desc: a `PangoFontDescription`
+ * @font_desc: a `Pango2FontDescription`
*
* Sets the currently-selected font from @font_desc.
*/
void
gtk_font_chooser_set_font_desc (GtkFontChooser *fontchooser,
- const PangoFontDescription *font_desc)
+ const Pango2FontDescription *font_desc)
{
g_return_if_fail (GTK_IS_FONT_CHOOSER (fontchooser));
g_return_if_fail (font_desc != NULL);
@@ -421,7 +421,7 @@ _gtk_font_chooser_font_activated (GtkFontChooser *chooser,
/**
* gtk_font_chooser_set_font_map:
* @fontchooser: a `GtkFontChooser`
- * @fontmap: (nullable): a `PangoFontMap`
+ * @fontmap: (nullable): a `Pango2FontMap`
*
* Sets a custom font map to use for this font chooser widget.
*
@@ -430,31 +430,31 @@ _gtk_font_chooser_font_activated (GtkFontChooser *chooser,
*
* ```c
* FcConfig *config;
- * PangoFcFontMap *fontmap;
+ * Pango2FcFontMap *fontmap;
*
* config = FcInitLoadConfigAndFonts ();
* FcConfigAppFontAddFile (config, my_app_font_file);
*
- * fontmap = pango_fc_font_map_new ();
- * pango_fc_font_map_set_config (fontmap, config);
+ * fontmap = pango2_fc_font_map_new ();
+ * pango2_fc_font_map_set_config (fontmap, config);
*
- * gtk_font_chooser_set_font_map (font_chooser, PANGO_FONT_MAP (fontmap));
+ * gtk_font_chooser_set_font_map (font_chooser, PANGO2_FONT_MAP (fontmap));
* ```
*
* Note that other GTK widgets will only be able to use the
* application-specific font if it is present in the font map they use:
*
* ```c
- * context = gtk_widget_get_pango_context (label);
- * pango_context_set_font_map (context, fontmap);
+ * context = gtk_widget_get_pango2_context (label);
+ * pango2_context_set_font_map (context, fontmap);
* ```
*/
void
gtk_font_chooser_set_font_map (GtkFontChooser *fontchooser,
- PangoFontMap *fontmap)
+ Pango2FontMap *fontmap)
{
g_return_if_fail (GTK_IS_FONT_CHOOSER (fontchooser));
- g_return_if_fail (fontmap == NULL || PANGO_IS_FONT_MAP (fontmap));
+ g_return_if_fail (fontmap == NULL || PANGO2_IS_FONT_MAP (fontmap));
if (GTK_FONT_CHOOSER_GET_IFACE (fontchooser)->set_font_map)
GTK_FONT_CHOOSER_GET_IFACE (fontchooser)->set_font_map (fontchooser, fontmap);
@@ -467,12 +467,12 @@ gtk_font_chooser_set_font_map (GtkFontChooser *fontchooser,
* Gets the custom font map of this font chooser widget,
* or %NULL if it does not have one.
*
- * Returns: (nullable) (transfer full): a `PangoFontMap`
+ * Returns: (nullable) (transfer full): a `Pango2FontMap`
*/
-PangoFontMap *
+Pango2FontMap *
gtk_font_chooser_get_font_map (GtkFontChooser *fontchooser)
{
- PangoFontMap *fontmap = NULL;
+ Pango2FontMap *fontmap = NULL;
g_return_val_if_fail (GTK_IS_FONT_CHOOSER (fontchooser), NULL);
diff --git a/gtk/gtkfontchooser.h b/gtk/gtkfontchooser.h
index 2ce7897d03..44027951a9 100644
--- a/gtk/gtkfontchooser.h
+++ b/gtk/gtkfontchooser.h
@@ -31,8 +31,8 @@ G_BEGIN_DECLS
/**
* GtkFontFilterFunc:
- * @family: a `PangoFontFamily`
- * @face: a `PangoFontFace` belonging to @family
+ * @family: a `Pango2FontFamily`
+ * @face: a `Pango2FontFace` belonging to @family
* @data: (closure): user data passed to gtk_font_chooser_set_filter_func()
*
* The type of function that is used for deciding what fonts get
@@ -42,8 +42,8 @@ G_BEGIN_DECLS
*
* Returns: %TRUE if the font should be displayed
*/
-typedef gboolean (*GtkFontFilterFunc) (const PangoFontFamily *family,
- const PangoFontFace *face,
+typedef gboolean (*GtkFontFilterFunc) (const Pango2FontFamily *family,
+ const Pango2FontFace *face,
gpointer data);
/**
@@ -81,8 +81,8 @@ struct _GtkFontChooserIface
GTypeInterface base_iface;
/* Methods */
- PangoFontFamily * (* get_font_family) (GtkFontChooser *fontchooser);
- PangoFontFace * (* get_font_face) (GtkFontChooser *fontchooser);
+ Pango2FontFamily * (* get_font_family) (GtkFontChooser *fontchooser);
+ Pango2FontFace * (* get_font_face) (GtkFontChooser *fontchooser);
int (* get_font_size) (GtkFontChooser *fontchooser);
void (* set_filter_func) (GtkFontChooser *fontchooser,
@@ -96,8 +96,8 @@ struct _GtkFontChooserIface
/* More methods */
void (* set_font_map) (GtkFontChooser *fontchooser,
- PangoFontMap *fontmap);
- PangoFontMap * (* get_font_map) (GtkFontChooser *fontchooser);
+ Pango2FontMap *fontmap);
+ Pango2FontMap * (* get_font_map) (GtkFontChooser *fontchooser);
/*< private >*/
/* Padding; remove in GTK-next */
@@ -108,18 +108,18 @@ GDK_AVAILABLE_IN_ALL
GType gtk_font_chooser_get_type (void) G_GNUC_CONST;
GDK_AVAILABLE_IN_ALL
-PangoFontFamily *gtk_font_chooser_get_font_family (GtkFontChooser *fontchooser);
+Pango2FontFamily *gtk_font_chooser_get_font_family (GtkFontChooser *fontchooser);
GDK_AVAILABLE_IN_ALL
-PangoFontFace *gtk_font_chooser_get_font_face (GtkFontChooser *fontchooser);
+Pango2FontFace *gtk_font_chooser_get_font_face (GtkFontChooser *fontchooser);
GDK_AVAILABLE_IN_ALL
int gtk_font_chooser_get_font_size (GtkFontChooser *fontchooser);
GDK_AVAILABLE_IN_ALL
-PangoFontDescription *
+Pango2FontDescription *
gtk_font_chooser_get_font_desc (GtkFontChooser *fontchooser);
GDK_AVAILABLE_IN_ALL
void gtk_font_chooser_set_font_desc (GtkFontChooser *fontchooser,
- const PangoFontDescription *font_desc);
+ const Pango2FontDescription *font_desc);
GDK_AVAILABLE_IN_ALL
char * gtk_font_chooser_get_font (GtkFontChooser *fontchooser);
@@ -144,9 +144,9 @@ void gtk_font_chooser_set_filter_func (GtkFontChooser *fo
GDestroyNotify destroy);
GDK_AVAILABLE_IN_ALL
void gtk_font_chooser_set_font_map (GtkFontChooser *fontchooser,
- PangoFontMap *fontmap);
+ Pango2FontMap *fontmap);
GDK_AVAILABLE_IN_ALL
-PangoFontMap * gtk_font_chooser_get_font_map (GtkFontChooser *fontchooser);
+Pango2FontMap * gtk_font_chooser_get_font_map (GtkFontChooser *fontchooser);
GDK_AVAILABLE_IN_ALL
void gtk_font_chooser_set_level (GtkFontChooser *fontchooser,
GtkFontChooserLevel level);
diff --git a/gtk/gtkfontchooserdialog.c b/gtk/gtkfontchooserdialog.c
index e731df8e45..014091159c 100644
--- a/gtk/gtkfontchooserdialog.c
+++ b/gtk/gtkfontchooserdialog.c
@@ -204,14 +204,14 @@ gtk_font_chooser_dialog_map (GtkWidget *widget)
static void
update_button (GtkFontChooserDialog *dialog)
{
- PangoFontDescription *desc;
+ Pango2FontDescription *desc;
desc = gtk_font_chooser_get_font_desc (GTK_FONT_CHOOSER (dialog->fontchooser));
gtk_widget_set_sensitive (dialog->select_button, desc != NULL);
if (desc)
- pango_font_description_free (desc);
+ pango2_font_description_free (desc);
}
static void
diff --git a/gtk/gtkfontchooserutils.c b/gtk/gtkfontchooserutils.c
index 6dd2a3fd9d..2d8cc19fae 100644
--- a/gtk/gtkfontchooserutils.c
+++ b/gtk/gtkfontchooserutils.c
@@ -33,13 +33,13 @@ get_delegate (GtkFontChooser *receiver)
GTK_FONT_CHOOSER_DELEGATE_QUARK);
}
-static PangoFontFamily *
+static Pango2FontFamily *
delegate_get_font_family (GtkFontChooser *chooser)
{
return gtk_font_chooser_get_font_family (get_delegate (chooser));
}
-static PangoFontFace *
+static Pango2FontFace *
delegate_get_font_face (GtkFontChooser *chooser)
{
return gtk_font_chooser_get_font_face (get_delegate (chooser));
@@ -65,12 +65,12 @@ delegate_set_filter_func (GtkFontChooser *chooser,
static void
delegate_set_font_map (GtkFontChooser *chooser,
- PangoFontMap *map)
+ Pango2FontMap *map)
{
gtk_font_chooser_set_font_map (get_delegate (chooser), map);
}
-static PangoFontMap *
+static Pango2FontMap *
delegate_get_font_map (GtkFontChooser *chooser)
{
return gtk_font_chooser_get_font_map (get_delegate (chooser));
diff --git a/gtk/gtkfontchooserwidget.c b/gtk/gtkfontchooserwidget.c
index ffea312c9a..3370272757 100644
--- a/gtk/gtkfontchooserwidget.c
+++ b/gtk/gtkfontchooserwidget.c
@@ -129,15 +129,15 @@ struct _GtkFontChooserWidget
GtkStringList *languages;
GHashTable *language_table;
- PangoLanguage *filter_language;
+ Pango2Language *filter_language;
gboolean filter_by_language;
gboolean filter_by_monospace;
- PangoFontMap *font_map;
+ Pango2FontMap *font_map;
- PangoFontDescription *font_desc;
+ Pango2FontDescription *font_desc;
char *font_features;
- PangoLanguage *language;
+ Pango2Language *language;
GtkFontFilterFunc filter_func;
gpointer filter_data;
@@ -181,11 +181,11 @@ static char *gtk_font_chooser_widget_get_font (GtkFontChooserWidget *
static void gtk_font_chooser_widget_set_font (GtkFontChooserWidget *fontchooser,
const char *fontname);
-static PangoFontDescription *gtk_font_chooser_widget_get_font_desc (GtkFontChooserWidget *fontchooser);
+static Pango2FontDescription *gtk_font_chooser_widget_get_font_desc (GtkFontChooserWidget *fontchooser);
static void gtk_font_chooser_widget_merge_font_desc(GtkFontChooserWidget *fontchooser,
- const PangoFontDescription *font_desc);
+ const Pango2FontDescription *font_desc);
static void gtk_font_chooser_widget_take_font_desc (GtkFontChooserWidget *fontchooser,
- PangoFontDescription *font_desc);
+ Pango2FontDescription *font_desc);
static const char *gtk_font_chooser_widget_get_preview_text (GtkFontChooserWidget *fontchooser);
@@ -277,7 +277,7 @@ gtk_font_chooser_widget_get_property (GObject *object,
g_value_set_string (value, fontchooser->font_features);
break;
case GTK_FONT_CHOOSER_PROP_LANGUAGE:
- g_value_set_string (value, pango_language_to_string (fontchooser->language));
+ g_value_set_string (value, pango2_language_to_string (fontchooser->language));
break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
@@ -310,14 +310,14 @@ size_change_cb (GtkAdjustment *adjustment,
gpointer user_data)
{
GtkFontChooserWidget *fontchooser = user_data;
- PangoFontDescription *font_desc;
+ Pango2FontDescription *font_desc;
double size = gtk_adjustment_get_value (adjustment);
- font_desc = pango_font_description_new ();
- if (pango_font_description_get_size_is_absolute (fontchooser->font_desc))
- pango_font_description_set_absolute_size (font_desc, size * PANGO_SCALE);
+ font_desc = pango2_font_description_new ();
+ if (pango2_font_description_get_size_is_absolute (fontchooser->font_desc))
+ pango2_font_description_set_absolute_size (font_desc, size * PANGO2_SCALE);
else
- pango_font_description_set_size (font_desc, size * PANGO_SCALE);
+ pango2_font_description_set_size (font_desc, size * PANGO2_SCALE);
gtk_font_chooser_widget_take_font_desc (fontchooser, font_desc);
}
@@ -344,42 +344,42 @@ user_filter_cb (gpointer item,
gpointer data)
{
GtkFontChooserWidget *self = GTK_FONT_CHOOSER_WIDGET (data);
- PangoFontFamily *family;
- PangoFontFace *face;
+ Pango2FontFamily *family;
+ Pango2FontFace *face;
- if (PANGO_IS_FONT_FAMILY (item))
+ if (PANGO2_IS_FONT_FAMILY (item))
{
family = item;
- face = pango_font_family_get_face (family, NULL);
+ face = pango2_font_family_get_face (family, NULL);
}
else
{
- face = PANGO_FONT_FACE (item);
- family = pango_font_face_get_family (face);
+ face = PANGO2_FONT_FACE (item);
+ family = pango2_font_face_get_family (face);
}
if (self->filter_by_monospace &&
- !pango_font_face_is_monospace (face))
+ !pango2_font_face_is_monospace (face))
return FALSE;
if (self->filter_by_language &&
self->filter_language)
{
- PangoFontDescription *desc;
- PangoContext *context;
- PangoFont *font;
+ Pango2FontDescription *desc;
+ Pango2Context *context;
+ Pango2Font *font;
gboolean ret;
- PangoLanguage **langs;
+ Pango2Language **langs;
- desc = pango_font_face_describe (face);
- pango_font_description_set_size (desc, 20);
+ desc = pango2_font_face_describe (face);
+ pango2_font_description_set_size (desc, 20);
context = gtk_widget_get_pango_context (GTK_WIDGET (self));
- font = pango_context_load_font (context, desc);
+ font = pango2_context_load_font (context, desc);
ret = FALSE;
- langs = pango_font_face_get_languages (pango_font_get_face (font));
+ langs = pango2_font_face_get_languages (pango2_font_get_face (font));
if (langs)
{
for (int i = 0; langs[i]; i++)
@@ -393,7 +393,7 @@ user_filter_cb (gpointer item,
}
g_object_unref (font);
- pango_font_description_free (desc);
+ pango2_font_description_free (desc);
return ret;
}
@@ -499,17 +499,17 @@ resize_by_scroll_cb (GtkEventControllerScroll *controller,
static void
maybe_update_preview_text (GtkFontChooserWidget *self,
- PangoFontFace *face,
- PangoFontDescription *desc)
+ Pango2FontFace *face,
+ Pango2FontDescription *desc)
{
- PangoContext *context;
- PangoFont *font;
+ Pango2Context *context;
+ Pango2Font *font;
const char *sample;
- PangoLanguage **languages;
+ Pango2Language **languages;
GHashTable *langs = NULL;
- PangoLanguage *default_lang;
- PangoLanguage *alt_default = NULL;
- PangoLanguage *lang = NULL;
+ Pango2Language *default_lang;
+ Pango2Language *alt_default = NULL;
+ Pango2Language *lang = NULL;
int i;
const char *p;
@@ -519,12 +519,12 @@ maybe_update_preview_text (GtkFontChooserWidget *self,
if (self->filter_by_language && self->filter_language)
{
- sample = pango_language_get_sample_string (self->filter_language);
+ sample = pango2_language_get_sample_string (self->filter_language);
gtk_font_chooser_widget_set_preview_text (self, sample);
return;
}
- /* We do the work only once, and cache the result on the PangoFontFace */
+ /* We do the work only once, and cache the result on the Pango2FontFace */
sample = (const char *)g_object_get_data (G_OBJECT (face), "gtk-sample-text");
if (sample)
{
@@ -533,15 +533,15 @@ maybe_update_preview_text (GtkFontChooserWidget *self,
}
context = gtk_widget_get_pango_context (GTK_WIDGET (self));
- font = pango_context_load_font (context, desc);
+ font = pango2_context_load_font (context, desc);
- default_lang = pango_language_get_default ();
- p = pango_language_to_string (default_lang);
+ default_lang = pango2_language_get_default ();
+ p = pango2_language_to_string (default_lang);
/* The default language tends to be of the form en-us.
* Since fontconfig languages just have the language part,
* and we want to use direct pointer comparisons, we need
- * an PangoLanguage for the shortened default language.
+ * an Pango2Language for the shortened default language.
*/
if (strchr (p, '-'))
{
@@ -549,10 +549,10 @@ maybe_update_preview_text (GtkFontChooserWidget *self,
for (i = 0; p[i] != '-' && i < 9; i++)
q[i] = p[i];
q[i] = '\0';
- alt_default = pango_language_from_string (q);
+ alt_default = pango2_language_from_string (q);
}
- languages = pango_font_face_get_languages (pango_font_get_face (font));
+ languages = pango2_font_face_get_languages (pango2_font_get_face (font));
/* If the font supports the default language, just use it. */
if (languages)
@@ -574,10 +574,10 @@ maybe_update_preview_text (GtkFontChooserWidget *self,
const GUnicodeScript *scripts;
int num, j;
- scripts = pango_language_get_scripts (languages[i], &num);
+ scripts = pango2_language_get_scripts (languages[i], &num);
for (j = 0; j < num; j++)
{
- lang = pango_script_get_sample_language (scripts[j]);
+ lang = pango2_script_get_sample_language (scripts[j]);
if (lang)
g_hash_table_add (langs, lang);
}
@@ -591,9 +591,9 @@ maybe_update_preview_text (GtkFontChooserWidget *self,
}
else
{
- PangoLanguage **preferred;
+ Pango2Language **preferred;
- preferred = pango_language_get_preferred ();
+ preferred = pango2_language_get_preferred ();
if (preferred)
{
for (i = 0; preferred[i]; i++)
@@ -609,7 +609,7 @@ maybe_update_preview_text (GtkFontChooserWidget *self,
g_hash_table_unref (langs);
found:
- sample = pango_language_get_sample_string (lang);
+ sample = pango2_language_get_sample_string (lang);
gtk_font_chooser_widget_set_preview_text (self, sample);
g_object_set_data (G_OBJECT (face), "gtk-sample-text", (gpointer)sample);
}
@@ -628,21 +628,21 @@ selection_changed_cb (GtkSingleSelection *selection,
item = gtk_single_selection_get_selected_item (selection);
if (item)
{
- PangoFontFace *face;
- PangoFontDescription *desc;
+ Pango2FontFace *face;
+ Pango2FontDescription *desc;
- if (PANGO_IS_FONT_FAMILY (item))
- face = pango_font_family_get_face (item, NULL);
+ if (PANGO2_IS_FONT_FAMILY (item))
+ face = pango2_font_family_get_face (item, NULL);
else
face = item;
- desc = pango_font_face_describe (face);
- pango_font_description_set_variations (self->font_desc, NULL);
+ desc = pango2_font_face_describe (face);
+ pango2_font_description_set_variations (self->font_desc, NULL);
gtk_font_chooser_widget_merge_font_desc (self, desc);
g_simple_action_set_enabled (G_SIMPLE_ACTION (self->tweak_action), TRUE);
maybe_update_preview_text (self, face, desc);
- pango_font_description_free (desc);
+ pango2_font_description_free (desc);
}
else
{
@@ -661,43 +661,43 @@ get_font_name (GObject *ignore,
if (item == NULL)
return NULL;
- if (PANGO_IS_FONT_FACE (item))
+ if (PANGO2_IS_FONT_FACE (item))
{
- return g_strconcat (pango_font_family_get_name (pango_font_face_get_family (item)),
+ return g_strconcat (pango2_font_family_get_name (pango2_font_face_get_family (item)),
" ",
- pango_font_face_get_name (item),
+ pango2_font_face_get_name (item),
NULL);
}
else
{
- return g_strdup (pango_font_family_get_name (item));
+ return g_strdup (pango2_font_family_get_name (item));
}
}
-static PangoAttrList *
+static Pango2AttrList *
get_font_attributes (GObject *ignore,
gpointer item)
{
- PangoAttribute *attribute;
- PangoAttrList *attrs;
+ Pango2Attribute *attribute;
+ Pango2AttrList *attrs;
- attrs = pango_attr_list_new ();
+ attrs = pango2_attr_list_new ();
if (item)
{
- PangoFontFace *face;
- PangoFontDescription *font_desc;
+ Pango2FontFace *face;
+ Pango2FontDescription *font_desc;
- if (PANGO_IS_FONT_FAMILY (item))
- face = pango_font_family_get_face (item, NULL);
+ if (PANGO2_IS_FONT_FAMILY (item))
+ face = pango2_font_family_get_face (item, NULL);
else
face = item;
if (face)
{
- font_desc = pango_font_face_describe (face);
- attribute = pango_attr_font_desc_new (font_desc);
- pango_attr_list_insert (attrs, attribute);
- pango_font_description_free (font_desc);
+ font_desc = pango2_font_face_describe (face);
+ attribute = pango2_attr_font_desc_new (font_desc);
+ pango2_attr_list_insert (attrs, attribute);
+ pango2_font_description_free (font_desc);
}
}
@@ -707,23 +707,23 @@ get_font_attributes (GObject *ignore,
static void
gtk_font_chooser_widget_update_preview_attributes (GtkFontChooserWidget *fontchooser)
{
- PangoAttrList *attrs;
+ Pango2AttrList *attrs;
- attrs = pango_attr_list_new ();
+ attrs = pango2_attr_list_new ();
/* Prevent font fallback */
- pango_attr_list_insert (attrs, pango_attr_fallback_new (FALSE));
+ pango2_attr_list_insert (attrs, pango2_attr_fallback_new (FALSE));
/* Force current font and features */
- pango_attr_list_insert (attrs, pango_attr_font_desc_new (fontchooser->font_desc));
+ pango2_attr_list_insert (attrs, pango2_attr_font_desc_new (fontchooser->font_desc));
if (fontchooser->font_features)
- pango_attr_list_insert (attrs, pango_attr_font_features_new (fontchooser->font_features));
+ pango2_attr_list_insert (attrs, pango2_attr_font_features_new (fontchooser->font_features));
if (fontchooser->language)
- pango_attr_list_insert (attrs, pango_attr_language_new (fontchooser->language));
+ pango2_attr_list_insert (attrs, pango2_attr_language_new (fontchooser->language));
gtk_entry_set_attributes (GTK_ENTRY (fontchooser->preview), attrs);
- pango_attr_list_unref (attrs);
+ pango2_attr_list_unref (attrs);
}
static void
@@ -993,30 +993,30 @@ static void
add_languages_from_font (GtkFontChooserWidget *self,
gpointer item)
{
- PangoFontFace *face;
- PangoFontDescription *desc;
- PangoFont *font;
- PangoContext *context;
+ Pango2FontFace *face;
+ Pango2FontDescription *desc;
+ Pango2Font *font;
+ Pango2Context *context;
GtkSelectionModel *model = gtk_list_view_get_model (GTK_LIST_VIEW (self->language_list));
- PangoLanguage *default_lang = pango_language_get_default ();
- PangoLanguage **langs;
+ Pango2Language *default_lang = pango2_language_get_default ();
+ Pango2Language **langs;
int i;
- if (PANGO_IS_FONT_FAMILY (item))
- face = pango_font_family_get_face (PANGO_FONT_FAMILY (item), NULL);
+ if (PANGO2_IS_FONT_FAMILY (item))
+ face = pango2_font_family_get_face (PANGO2_FONT_FAMILY (item), NULL);
else
- face = PANGO_FONT_FACE (item);
+ face = PANGO2_FONT_FACE (item);
if (!face)
return;
- desc = pango_font_face_describe (face);
- pango_font_description_set_size (desc, 20);
+ desc = pango2_font_face_describe (face);
+ pango2_font_description_set_size (desc, 20);
context = gtk_widget_get_pango_context (GTK_WIDGET (self));
- font = pango_context_load_font (context, desc);
+ font = pango2_context_load_font (context, desc);
- langs = pango_font_face_get_languages (pango_font_get_face (font));
+ langs = pango2_font_face_get_languages (pango2_font_get_face (font));
if (langs)
{
for (i = 0; langs[i]; i++)
@@ -1026,11 +1026,11 @@ add_languages_from_font (GtkFontChooserWidget *self,
g_hash_table_add (self->language_table, langs[i]);
if (get_language_name (langs[i]))
{
- const char *l = pango_language_to_string (langs[i]);
+ const char *l = pango2_language_to_string (langs[i]);
gulong id = 0;
/* Pre-select the default language */
- if (pango_language_matches (default_lang, l))
+ if (pango2_language_matches (default_lang, l))
id = g_signal_connect (model, "items-changed", G_CALLBACK (select_added), NULL);
gtk_string_list_append (self->languages, l);
@@ -1043,7 +1043,7 @@ add_languages_from_font (GtkFontChooserWidget *self,
}
g_object_unref (font);
- pango_font_description_free (desc);
+ pango2_font_description_free (desc);
}
static gboolean
@@ -1099,12 +1099,12 @@ add_to_fontlist (GtkWidget *widget,
static void
update_fontlist (GtkFontChooserWidget *self)
{
- PangoFontMap *fontmap;
+ Pango2FontMap *fontmap;
GListModel *model;
fontmap = self->font_map;
if (!fontmap)
- fontmap = pango_font_map_get_default ();
+ fontmap = pango2_font_map_get_default ();
if ((self->level & GTK_FONT_CHOOSER_LEVEL_STYLE) == 0)
model = g_object_ref (G_LIST_MODEL (fontmap));
@@ -1138,13 +1138,13 @@ bind_lang_item (GtkSignalListItemFactory *factory,
GtkWidget *label;
gpointer obj;
const char *str;
- PangoLanguage *language;
+ Pango2Language *language;
const char *name;
obj = gtk_list_item_get_item (GTK_LIST_ITEM (item));
str = gtk_string_object_get_string (GTK_STRING_OBJECT (obj));
- language = pango_language_from_string (str);
+ language = pango2_language_from_string (str);
name = get_language_name (language);
label = gtk_list_item_get_child (GTK_LIST_ITEM (item));
@@ -1155,7 +1155,7 @@ static char *
get_lang_name (gpointer this,
const char *lang)
{
- return g_strdup (get_language_name (pango_language_from_string (lang)));
+ return g_strdup (get_language_name (pango2_language_from_string (lang)));
}
static void
@@ -1169,7 +1169,7 @@ language_selection_changed (GtkSelectionModel *model,
obj = gtk_single_selection_get_selected_item (GTK_SINGLE_SELECTION (model));
if (obj)
- self->filter_language = pango_language_from_string (gtk_string_object_get_string (obj));
+ self->filter_language = pango2_language_from_string (gtk_string_object_get_string (obj));
else
self->filter_language = NULL;
@@ -1216,24 +1216,24 @@ gtk_font_chooser_widget_init (GtkFontChooserWidget *self)
self->axes = g_hash_table_new_full (axis_hash, axis_equal, NULL, axis_free);
/* Default preview string */
- self->preview_text = g_strdup (pango_language_get_sample_string (NULL));
+ self->preview_text = g_strdup (pango2_language_get_sample_string (NULL));
self->show_preview_entry = TRUE;
- self->font_desc = pango_font_description_new ();
+ self->font_desc = pango2_font_description_new ();
self->level = GTK_FONT_CHOOSER_LEVEL_FAMILY |
GTK_FONT_CHOOSER_LEVEL_STYLE |
GTK_FONT_CHOOSER_LEVEL_SIZE;
- self->language = pango_language_get_default ();
+ self->language = pango2_language_get_default ();
/* Set default preview text */
gtk_editable_set_text (GTK_EDITABLE (self->preview), self->preview_text);
gtk_font_chooser_widget_update_preview_attributes (self);
- /* Set the upper values of the spin/scale with G_MAXINT / PANGO_SCALE */
+ /* Set the upper values of the spin/scale with G_MAXINT / PANGO2_SCALE */
gtk_spin_button_set_range (GTK_SPIN_BUTTON (self->size_spin),
- 1.0, (double)(G_MAXINT / PANGO_SCALE));
+ 1.0, (double)(G_MAXINT / PANGO2_SCALE));
gtk_adjustment_set_upper (gtk_range_get_adjustment (GTK_RANGE (self->size_slider)),
- (double)(G_MAXINT / PANGO_SCALE));
+ (double)(G_MAXINT / PANGO2_SCALE));
self->tweak_action = G_ACTION (g_simple_action_new_stateful ("tweak", NULL, g_variant_new_boolean
(FALSE)));
g_signal_connect (self->tweak_action, "change-state", G_CALLBACK (change_tweak), self);
@@ -1269,7 +1269,7 @@ gtk_font_chooser_widget_finalize (GObject *object)
GtkFontChooserWidget *fontchooser = GTK_FONT_CHOOSER_WIDGET (object);
if (fontchooser->font_desc)
- pango_font_description_free (fontchooser->font_desc);
+ pango2_font_description_free (fontchooser->font_desc);
if (fontchooser->filter_data_destroy)
fontchooser->filter_data_destroy (fontchooser->filter_data);
@@ -1290,7 +1290,7 @@ gtk_font_chooser_widget_finalize (GObject *object)
}
static gboolean
-my_pango_font_family_equal (const char *familya,
+my_pango2_font_family_equal (const char *familya,
const char *familyb)
{
return g_ascii_strcasecmp (familya, familyb) == 0;
@@ -1302,7 +1302,7 @@ gtk_font_chooser_widget_ensure_matching_selection (GtkFontChooserWidget *self)
const char *desc_family;
guint i, n;
- desc_family = pango_font_description_get_family (self->font_desc);
+ desc_family = pango2_font_description_get_family (self->font_desc);
if (desc_family == NULL)
{
gtk_single_selection_set_selected (self->selection, GTK_INVALID_LIST_POSITION);
@@ -1313,36 +1313,36 @@ gtk_font_chooser_widget_ensure_matching_selection (GtkFontChooserWidget *self)
for (i = 0; i < n; i++)
{
gpointer item;
- PangoFontFace *face;
- PangoFontFamily *family;
- PangoFontDescription *merged;
+ Pango2FontFace *face;
+ Pango2FontFamily *family;
+ Pango2FontDescription *merged;
item = g_list_model_get_item (G_LIST_MODEL (self->selection), i);
g_object_unref (item);
- if (PANGO_IS_FONT_FAMILY (item))
+ if (PANGO2_IS_FONT_FAMILY (item))
{
family = item;
- face = pango_font_family_get_face (family, NULL);
+ face = pango2_font_family_get_face (family, NULL);
}
else
{
face = item;
- family = pango_font_face_get_family (face);
+ family = pango2_font_face_get_family (face);
}
- if (!my_pango_font_family_equal (desc_family, pango_font_family_get_name (family)))
+ if (!my_pango2_font_family_equal (desc_family, pango2_font_family_get_name (family)))
continue;
- merged = pango_font_face_describe (face);
- pango_font_description_merge_static (merged, self->font_desc, FALSE);
+ merged = pango2_font_face_describe (face);
+ pango2_font_description_merge_static (merged, self->font_desc, FALSE);
- if (pango_font_description_equal (merged, self->font_desc))
+ if (pango2_font_description_equal (merged, self->font_desc))
{
- pango_font_description_free (merged);
+ pango2_font_description_free (merged);
break;
}
- pango_font_description_free (merged);
+ pango2_font_description_free (merged);
}
if (i < n)
@@ -1354,20 +1354,20 @@ gtk_font_chooser_widget_ensure_matching_selection (GtkFontChooserWidget *self)
return FALSE;
}
-static PangoFontFace *
+static Pango2FontFace *
gtk_font_chooser_widget_get_face (GtkFontChooser *chooser)
{
GtkFontChooserWidget *self = GTK_FONT_CHOOSER_WIDGET (chooser);
gpointer item;
item = gtk_single_selection_get_selected_item (self->selection);
- if (PANGO_IS_FONT_FAMILY (item))
- return pango_font_family_get_face (item, NULL);
+ if (PANGO2_IS_FONT_FAMILY (item))
+ return pango2_font_family_get_face (item, NULL);
else
return item;
}
-static PangoFontFamily *
+static Pango2FontFamily *
gtk_font_chooser_widget_get_family (GtkFontChooser *chooser)
{
GtkFontChooserWidget *self = GTK_FONT_CHOOSER_WIDGET (chooser);
@@ -1377,20 +1377,20 @@ gtk_font_chooser_widget_get_family (GtkFontChooser *chooser)
if (item == NULL)
return NULL;
- if (PANGO_IS_FONT_FAMILY (item))
+ if (PANGO2_IS_FONT_FAMILY (item))
return item;
else
- return pango_font_face_get_family (item);
+ return pango2_font_face_get_family (item);
}
static int
gtk_font_chooser_widget_get_size (GtkFontChooser *chooser)
{
GtkFontChooserWidget *fontchooser = GTK_FONT_CHOOSER_WIDGET (chooser);
- PangoFontDescription *desc = gtk_font_chooser_widget_get_font_desc (fontchooser);
+ Pango2FontDescription *desc = gtk_font_chooser_widget_get_font_desc (fontchooser);
if (desc)
- return pango_font_description_get_size (desc);
+ return pango2_font_description_get_size (desc);
return -1;
}
@@ -1398,15 +1398,15 @@ gtk_font_chooser_widget_get_size (GtkFontChooser *chooser)
static char *
gtk_font_chooser_widget_get_font (GtkFontChooserWidget *fontchooser)
{
- PangoFontDescription *desc = gtk_font_chooser_widget_get_font_desc (fontchooser);
+ Pango2FontDescription *desc = gtk_font_chooser_widget_get_font_desc (fontchooser);
if (desc)
- return pango_font_description_to_string (desc);
+ return pango2_font_description_to_string (desc);
return NULL;
}
-static PangoFontDescription *
+static Pango2FontDescription *
gtk_font_chooser_widget_get_font_desc (GtkFontChooserWidget *self)
{
if (gtk_single_selection_get_selected_item (self->selection))
@@ -1419,9 +1419,9 @@ static void
gtk_font_chooser_widget_set_font (GtkFontChooserWidget *fontchooser,
const char *fontname)
{
- PangoFontDescription *font_desc;
+ Pango2FontDescription *font_desc;
- font_desc = pango_font_description_from_string (fontname);
+ font_desc = pango2_font_description_from_string (fontname);
gtk_font_chooser_widget_take_font_desc (fontchooser, font_desc);
}
@@ -1458,7 +1458,7 @@ adjustment_changed (GtkAdjustment *adjustment,
Axis *axis)
{
GtkFontChooserWidget *fontchooser = GTK_FONT_CHOOSER_WIDGET (axis->fontchooser);
- PangoFontDescription *font_desc;
+ Pango2FontDescription *font_desc;
GString *s;
fontchooser->updating_variations = TRUE;
@@ -1466,8 +1466,8 @@ adjustment_changed (GtkAdjustment *adjustment,
s = g_string_new ("");
add_font_variations (fontchooser, s);
- font_desc = pango_font_description_new ();
- pango_font_description_set_variations (font_desc, s->str);
+ font_desc = pango2_font_description_new ();
+ pango2_font_description_set_variations (font_desc, s->str);
gtk_font_chooser_widget_take_font_desc (fontchooser, font_desc);
g_string_free (s, TRUE);
@@ -1636,7 +1636,7 @@ get_axes_and_values (hb_font_t *font,
static gboolean
gtk_font_chooser_widget_update_font_variations (GtkFontChooserWidget *fontchooser)
{
- PangoFont *pango_font;
+ Pango2Font *pango2_font;
hb_font_t *hb_font;
hb_face_t *hb_face;
unsigned int n_axes;
@@ -1654,9 +1654,9 @@ gtk_font_chooser_widget_update_font_variations (GtkFontChooserWidget *fontchoose
if ((fontchooser->level & GTK_FONT_CHOOSER_LEVEL_VARIATIONS) == 0)
return FALSE;
- pango_font = pango_context_load_font (gtk_widget_get_pango_context (GTK_WIDGET (fontchooser)),
+ pango2_font = pango2_context_load_font (gtk_widget_get_pango_context (GTK_WIDGET (fontchooser)),
fontchooser->font_desc);
- hb_font = pango_font_get_hb_font (pango_font);
+ hb_font = pango2_font_get_hb_font (pango2_font);
hb_face = hb_font_get_face (hb_font);
if (!hb_ot_var_has_data (hb_face))
@@ -1673,7 +1673,7 @@ gtk_font_chooser_widget_update_font_variations (GtkFontChooserWidget *fontchoose
has_axis = TRUE;
}
- g_object_unref (pango_font);
+ g_object_unref (pango2_font);
return has_axis;
}
@@ -1698,7 +1698,7 @@ find_language_and_script (GtkFontChooserWidget *fontchooser,
hb_language_t lang;
const char *langname, *p;
- langname = pango_language_to_string (fontchooser->language);
+ langname = pango2_language_to_string (fontchooser->language);
p = strchr (langname, '-');
lang = hb_language_from_string (langname, p ? p - langname : -1);
@@ -1967,7 +1967,7 @@ update_feature_example (GtkFontChooserWidget *fontchooser,
hb_font_t *hb_font,
hb_tag_t script_tag,
hb_tag_t lang_tag,
- PangoFontDescription *font_desc)
+ Pango2FontDescription *font_desc)
{
const char *letter_case[] = { "smcp", "c2sc", "pcap", "c2pc", "unic", "cpsp", "case", NULL };
const char *number_case[] = { "xxxx", "lnum", "onum", NULL };
@@ -1982,25 +1982,25 @@ update_feature_example (GtkFontChooserWidget *fontchooser,
if (g_strv_contains (number_case, item->name) ||
g_strv_contains (number_spacing, item->name))
{
- PangoAttrList *attrs;
- PangoAttribute *attr;
- PangoFontDescription *desc;
+ Pango2AttrList *attrs;
+ Pango2Attribute *attr;
+ Pango2FontDescription *desc;
char *str;
- attrs = pango_attr_list_new ();
+ attrs = pango2_attr_list_new ();
- desc = pango_font_description_copy (font_desc);
- pango_font_description_unset_fields (desc, PANGO_FONT_MASK_SIZE);
- pango_attr_list_insert (attrs, pango_attr_font_desc_new (desc));
- pango_font_description_free (desc);
+ desc = pango2_font_description_copy (font_desc);
+ pango2_font_description_unset_fields (desc, PANGO2_FONT_MASK_SIZE);
+ pango2_attr_list_insert (attrs, pango2_attr_font_desc_new (desc));
+ pango2_font_description_free (desc);
str = g_strconcat (item->name, " 1", NULL);
- attr = pango_attr_font_features_new (str);
- pango_attr_list_insert (attrs, attr);
+ attr = pango2_attr_font_features_new (str);
+ pango2_attr_list_insert (attrs, attr);
gtk_label_set_text (GTK_LABEL (item->example), "0123456789");
gtk_label_set_attributes (GTK_LABEL (item->example), attrs);
- pango_attr_list_unref (attrs);
+ pango2_attr_list_unref (attrs);
}
else if (g_strv_contains (letter_case, item->name) ||
g_strv_contains (number_formatting, item->name) ||
@@ -2024,34 +2024,34 @@ update_feature_example (GtkFontChooserWidget *fontchooser,
if (input[0] != '\0')
{
- PangoAttrList *attrs;
- PangoAttribute *attr;
- PangoFontDescription *desc;
+ Pango2AttrList *attrs;
+ Pango2Attribute *attr;
+ Pango2FontDescription *desc;
char *str;
text = g_strconcat (input, " ⟶ ", input, NULL);
- attrs = pango_attr_list_new ();
+ attrs = pango2_attr_list_new ();
- desc = pango_font_description_copy (font_desc);
- pango_font_description_unset_fields (desc, PANGO_FONT_MASK_SIZE);
- pango_attr_list_insert (attrs, pango_attr_font_desc_new (desc));
- pango_font_description_free (desc);
+ desc = pango2_font_description_copy (font_desc);
+ pango2_font_description_unset_fields (desc, PANGO2_FONT_MASK_SIZE);
+ pango2_attr_list_insert (attrs, pango2_attr_font_desc_new (desc));
+ pango2_font_description_free (desc);
str = g_strconcat (item->name, " 0", NULL);
- attr = pango_attr_font_features_new (str);
- pango_attribute_set_range (attr, 0, strlen (input));
- pango_attr_list_insert (attrs, attr);
+ attr = pango2_attr_font_features_new (str);
+ pango2_attribute_set_range (attr, 0, strlen (input));
+ pango2_attr_list_insert (attrs, attr);
str = g_strconcat (item->name, " 1", NULL);
- attr = pango_attr_font_features_new (str);
- pango_attribute_set_range (attr, strlen (input) + strlen (" ⟶ "),
+ attr = pango2_attr_font_features_new (str);
+ pango2_attribute_set_range (attr, strlen (input) + strlen (" ⟶ "),
2 * strlen (input) + strlen (" ⟶ "));
- pango_attr_list_insert (attrs, attr);
+ pango2_attr_list_insert (attrs, attr);
gtk_label_set_text (GTK_LABEL (item->example), text);
gtk_label_set_attributes (GTK_LABEL (item->example), attrs);
g_free (text);
- pango_attr_list_unref (attrs);
+ pango2_attr_list_unref (attrs);
}
else
gtk_label_set_markup (GTK_LABEL (item->example), "");
@@ -2076,7 +2076,7 @@ add_check_group (GtkFontChooserWidget *fontchooser,
{
GtkWidget *label;
GtkWidget *group;
- PangoAttrList *attrs;
+ Pango2AttrList *attrs;
int i;
group = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
@@ -2086,10 +2086,10 @@ add_check_group (GtkFontChooserWidget *fontchooser,
gtk_label_set_xalign (GTK_LABEL (label), 0.0);
gtk_widget_set_halign (label, GTK_ALIGN_START);
g_object_set (label, "margin-top", 10, "margin-bottom", 10, NULL);
- attrs = pango_attr_list_new ();
- pango_attr_list_insert (attrs, pango_attr_weight_new (PANGO_WEIGHT_BOLD));
+ attrs = pango2_attr_list_new ();
+ pango2_attr_list_insert (attrs, pango2_attr_weight_new (PANGO2_WEIGHT_BOLD));
gtk_label_set_attributes (GTK_LABEL (label), attrs);
- pango_attr_list_unref (attrs);
+ pango2_attr_list_unref (attrs);
gtk_box_append (GTK_BOX (group), label);
for (i = 0; tags[i]; i++)
@@ -2148,7 +2148,7 @@ add_radio_group (GtkFontChooserWidget *fontchooser,
GtkWidget *group;
int i;
GtkWidget *group_button = NULL;
- PangoAttrList *attrs;
+ Pango2AttrList *attrs;
group = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0);
gtk_widget_set_halign (group, GTK_ALIGN_FILL);
@@ -2157,10 +2157,10 @@ add_radio_group (GtkFontChooserWidget *fontchooser,
gtk_label_set_xalign (GTK_LABEL (label), 0.0);
gtk_widget_set_halign (label, GTK_ALIGN_START);
g_object_set (label, "margin-top", 10, "margin-bottom", 10, NULL);
- attrs = pango_attr_list_new ();
- pango_attr_list_insert (attrs, pango_attr_weight_new (PANGO_WEIGHT_BOLD));
+ attrs = pango2_attr_list_new ();
+ pango2_attr_list_insert (attrs, pango2_attr_weight_new (PANGO2_WEIGHT_BOLD));
gtk_label_set_attributes (GTK_LABEL (label), attrs);
- pango_attr_list_unref (attrs);
+ pango2_attr_list_unref (attrs);
gtk_box_append (GTK_BOX (group), label);
for (i = 0; tags[i]; i++)
@@ -2234,7 +2234,7 @@ gtk_font_chooser_widget_populate_features (GtkFontChooserWidget *fontchooser)
static gboolean
gtk_font_chooser_widget_update_font_features (GtkFontChooserWidget *fontchooser)
{
- PangoFont *pango_font;
+ Pango2Font *pango2_font;
hb_font_t *hb_font;
hb_tag_t script_tag;
hb_tag_t lang_tag;
@@ -2254,9 +2254,9 @@ gtk_font_chooser_widget_update_font_features (GtkFontChooserWidget *fontchooser)
if ((fontchooser->level & GTK_FONT_CHOOSER_LEVEL_FEATURES) == 0)
return FALSE;
- pango_font = pango_context_load_font (gtk_widget_get_pango_context (GTK_WIDGET (fontchooser)),
+ pango2_font = pango2_context_load_font (gtk_widget_get_pango_context (GTK_WIDGET (fontchooser)),
fontchooser->font_desc);
- hb_font = pango_font_get_hb_font (pango_font);
+ hb_font = pango2_font_get_hb_font (pango2_font);
if (hb_font)
{
@@ -2327,7 +2327,7 @@ gtk_font_chooser_widget_update_font_features (GtkFontChooserWidget *fontchooser)
}
}
- g_object_unref (pango_font);
+ g_object_unref (pango2_font);
return has_feature;
}
@@ -2388,33 +2388,33 @@ update_font_features (GtkFontChooserWidget *fontchooser)
static void
gtk_font_chooser_widget_merge_font_desc (GtkFontChooserWidget *fontchooser,
- const PangoFontDescription *font_desc)
+ const Pango2FontDescription *font_desc)
{
- PangoFontMask mask;
+ Pango2FontMask mask;
g_assert (font_desc != NULL);
/* iter may be NULL if the font doesn't exist on the list */
- mask = pango_font_description_get_set_fields (font_desc);
+ mask = pango2_font_description_get_set_fields (font_desc);
/* sucky test, because we can't restrict the comparison to
* only the parts that actually do get merged */
- if (pango_font_description_equal (font_desc, fontchooser->font_desc))
+ if (pango2_font_description_equal (font_desc, fontchooser->font_desc))
return;
- pango_font_description_merge (fontchooser->font_desc, font_desc, TRUE);
+ pango2_font_description_merge (fontchooser->font_desc, font_desc, TRUE);
- if (mask & PANGO_FONT_MASK_SIZE)
+ if (mask & PANGO2_FONT_MASK_SIZE)
{
- double font_size = (double) pango_font_description_get_size (fontchooser->font_desc) / PANGO_SCALE;
+ double font_size = (double) pango2_font_description_get_size (fontchooser->font_desc) / PANGO2_SCALE;
/* XXX: This clamps, which can cause it to reloop into here, do we need
* to block its signal handler?
*/
gtk_range_set_value (GTK_RANGE (fontchooser->size_slider), font_size);
gtk_spin_button_set_value (GTK_SPIN_BUTTON (fontchooser->size_spin), font_size);
}
- if (mask & (PANGO_FONT_MASK_FAMILY | PANGO_FONT_MASK_STYLE | PANGO_FONT_MASK_VARIANT |
- PANGO_FONT_MASK_WEIGHT | PANGO_FONT_MASK_STRETCH))
+ if (mask & (PANGO2_FONT_MASK_FAMILY | PANGO2_FONT_MASK_STYLE | PANGO2_FONT_MASK_VARIANT |
+ PANGO2_FONT_MASK_WEIGHT | PANGO2_FONT_MASK_STRETCH))
{
gboolean has_tweak = FALSE;
@@ -2428,10 +2428,10 @@ gtk_font_chooser_widget_merge_font_desc (GtkFontChooserWidget *fontchooser
g_simple_action_set_enabled (G_SIMPLE_ACTION (fontchooser->tweak_action), has_tweak);
}
- if (mask & PANGO_FONT_MASK_VARIATIONS)
+ if (mask & PANGO2_FONT_MASK_VARIATIONS)
{
- if (pango_font_description_get_variations (fontchooser->font_desc)[0] == '\0')
- pango_font_description_unset_fields (fontchooser->font_desc, PANGO_FONT_MASK_VARIANT);
+ if (pango2_font_description_get_variations (fontchooser->font_desc)[0] == '\0')
+ pango2_font_description_unset_fields (fontchooser->font_desc, PANGO2_FONT_MASK_VARIANT);
}
gtk_font_chooser_widget_update_preview_attributes (fontchooser);
@@ -2442,24 +2442,24 @@ gtk_font_chooser_widget_merge_font_desc (GtkFontChooserWidget *fontchooser
static void
gtk_font_chooser_widget_take_font_desc (GtkFontChooserWidget *fontchooser,
- PangoFontDescription *font_desc)
+ Pango2FontDescription *font_desc)
{
- PangoFontMask mask;
+ Pango2FontMask mask;
if (font_desc == NULL)
- font_desc = pango_font_description_from_string (GTK_FONT_CHOOSER_DEFAULT_FONT_NAME);
+ font_desc = pango2_font_description_from_string (GTK_FONT_CHOOSER_DEFAULT_FONT_NAME);
- mask = pango_font_description_get_set_fields (font_desc);
+ mask = pango2_font_description_get_set_fields (font_desc);
gtk_font_chooser_widget_merge_font_desc (fontchooser, font_desc);
- if (mask & (PANGO_FONT_MASK_FAMILY | PANGO_FONT_MASK_STYLE | PANGO_FONT_MASK_VARIANT |
- PANGO_FONT_MASK_WEIGHT | PANGO_FONT_MASK_STRETCH))
+ if (mask & (PANGO2_FONT_MASK_FAMILY | PANGO2_FONT_MASK_STYLE | PANGO2_FONT_MASK_VARIANT |
+ PANGO2_FONT_MASK_WEIGHT | PANGO2_FONT_MASK_STRETCH))
{
gtk_single_selection_set_selected (fontchooser->selection, GTK_INVALID_LIST_POSITION);
gtk_font_chooser_widget_ensure_matching_selection (fontchooser);
}
- pango_font_description_free (font_desc);
+ pango2_font_description_free (font_desc);
}
static const char *
@@ -2509,28 +2509,28 @@ gtk_font_chooser_widget_set_show_preview_entry (GtkFontChooserWidget *fontchoose
static void
gtk_font_chooser_widget_set_font_map (GtkFontChooser *chooser,
- PangoFontMap *fontmap)
+ Pango2FontMap *fontmap)
{
GtkFontChooserWidget *fontchooser = GTK_FONT_CHOOSER_WIDGET (chooser);
if (g_set_object (&fontchooser->font_map, fontmap))
{
- PangoContext *context;
+ Pango2Context *context;
if (!fontmap)
- fontmap = pango_font_map_get_default ();
+ fontmap = pango2_font_map_get_default ();
context = gtk_widget_get_pango_context (fontchooser->family_face_list);
- pango_context_set_font_map (context, fontmap);
+ pango2_context_set_font_map (context, fontmap);
context = gtk_widget_get_pango_context (fontchooser->preview);
- pango_context_set_font_map (context, fontmap);
+ pango2_context_set_font_map (context, fontmap);
update_fontlist (fontchooser);
}
}
-static PangoFontMap *
+static Pango2FontMap *
gtk_font_chooser_widget_get_font_map (GtkFontChooser *chooser)
{
GtkFontChooserWidget *fontchooser = GTK_FONT_CHOOSER_WIDGET (chooser);
@@ -2543,18 +2543,18 @@ gtk_font_chooser_widget_filter_cb (gpointer item,
gpointer data)
{
GtkFontChooserWidget *self = GTK_FONT_CHOOSER_WIDGET (data);
- PangoFontFamily *family;
- PangoFontFace *face;
+ Pango2FontFamily *family;
+ Pango2FontFace *face;
- if (PANGO_IS_FONT_FAMILY (item))
+ if (PANGO2_IS_FONT_FAMILY (item))
{
family = item;
- face = pango_font_family_get_face (family, NULL);
+ face = pango2_font_family_get_face (family, NULL);
}
else
{
face = item;
- family = pango_font_face_get_family (face);
+ family = pango2_font_face_get_family (face);
}
return self->filter_func (family, face, self->filter_data);
@@ -2631,9 +2631,9 @@ static void
gtk_font_chooser_widget_set_language (GtkFontChooserWidget *fontchooser,
const char *language)
{
- PangoLanguage *lang;
+ Pango2Language *lang;
- lang = pango_language_from_string (language);
+ lang = pango2_language_from_string (language);
if (fontchooser->language == lang)
return;
diff --git a/gtk/gtkglarea.c b/gtk/gtkglarea.c
index 155a55ed80..c05b53d45d 100644
--- a/gtk/gtkglarea.c
+++ b/gtk/gtkglarea.c
@@ -651,15 +651,15 @@ gtk_gl_area_draw_error_screen (GtkGLArea *area,
int height)
{
GtkGLAreaPrivate *priv = gtk_gl_area_get_instance_private (area);
- PangoLayout *layout;
- PangoRectangle ext;
+ Pango2Layout *layout;
+ Pango2Rectangle ext;
layout = gtk_widget_create_pango_layout (GTK_WIDGET (area),
priv->error->message);
- pango_layout_set_width (layout, width * PANGO_SCALE);
- pango_layout_set_alignment (layout, PANGO_ALIGN_CENTER);
- pango_lines_get_extents (pango_layout_get_lines (layout), NULL, &ext);
- pango_extents_to_pixels (&ext, NULL);
+ pango2_layout_set_width (layout, width * PANGO2_SCALE);
+ pango2_layout_set_alignment (layout, PANGO2_ALIGN_CENTER);
+ pango2_lines_get_extents (pango2_layout_get_lines (layout), NULL, &ext);
+ pango2_extents_to_pixels (&ext, NULL);
gtk_snapshot_render_layout (snapshot,
gtk_widget_get_style_context (GTK_WIDGET (area)),
diff --git a/gtk/gtkheaderbar.c b/gtk/gtkheaderbar.c
index ec66d392bc..d85b91d771 100644
--- a/gtk/gtkheaderbar.c
+++ b/gtk/gtkheaderbar.c
@@ -272,7 +272,7 @@ construct_title_label (GtkHeaderBar *bar)
gtk_widget_set_valign (label, GTK_ALIGN_CENTER);
gtk_label_set_wrap (GTK_LABEL (label), FALSE);
gtk_label_set_single_line_mode (GTK_LABEL (label), TRUE);
- gtk_label_set_ellipsize (GTK_LABEL (label), PANGO_ELLIPSIZE_END);
+ gtk_label_set_ellipsize (GTK_LABEL (label), PANGO2_ELLIPSIZE_END);
gtk_label_set_width_chars (GTK_LABEL (label), MIN_TITLE_CHARS);
gtk_center_box_set_center_widget (GTK_CENTER_BOX (bar->center_box), label);
diff --git a/gtk/gtkiconview.c b/gtk/gtkiconview.c
index c647b16c9c..399b15f14e 100644
--- a/gtk/gtkiconview.c
+++ b/gtk/gtkiconview.c
@@ -4679,15 +4679,15 @@ update_text_cell (GtkIconView *icon_view)
if (icon_view->priv->item_orientation == GTK_ORIENTATION_VERTICAL)
g_object_set (icon_view->priv->text_cell,
- "alignment", PANGO_ALIGN_CENTER,
- "wrap-mode", PANGO_WRAP_WORD_CHAR,
+ "alignment", PANGO2_ALIGN_CENTER,
+ "wrap-mode", PANGO2_WRAP_WORD_CHAR,
"xalign", 0.5,
"yalign", 0.0,
NULL);
else
g_object_set (icon_view->priv->text_cell,
- "alignment", PANGO_ALIGN_LEFT,
- "wrap-mode", PANGO_WRAP_WORD_CHAR,
+ "alignment", PANGO2_ALIGN_LEFT,
+ "wrap-mode", PANGO2_WRAP_WORD_CHAR,
"xalign", 0.0,
"yalign", 0.5,
NULL);
diff --git a/gtk/gtkimage.c b/gtk/gtkimage.c
index 3b9a28b9d9..171ecdba1f 100644
--- a/gtk/gtkimage.c
+++ b/gtk/gtkimage.c
@@ -963,18 +963,18 @@ gtk_image_unrealize (GtkWidget *widget)
static float
gtk_image_get_baseline_align (GtkImage *image)
{
- PangoContext *pango_context;
- PangoFontMetrics *metrics;
+ Pango2Context *pango2_context;
+ Pango2FontMetrics *metrics;
if (image->baseline_align == 0.0)
{
- pango_context = gtk_widget_get_pango_context (GTK_WIDGET (image));
- metrics = pango_context_get_metrics (pango_context, NULL, NULL);
+ pango2_context = gtk_widget_get_pango_context (GTK_WIDGET (image));
+ metrics = pango2_context_get_metrics (pango2_context, NULL, NULL);
image->baseline_align =
- (float)pango_font_metrics_get_ascent (metrics) /
- (pango_font_metrics_get_ascent (metrics) + pango_font_metrics_get_descent (metrics));
+ (float)pango2_font_metrics_get_ascent (metrics) /
+ (pango2_font_metrics_get_ascent (metrics) + pango2_font_metrics_get_descent (metrics));
- pango_font_metrics_free (metrics);
+ pango2_font_metrics_free (metrics);
}
return image->baseline_align;
diff --git a/gtk/gtkimcontext.c b/gtk/gtkimcontext.c
index a46f5d7571..6a170bec8e 100644
--- a/gtk/gtkimcontext.c
+++ b/gtk/gtkimcontext.c
@@ -86,7 +86,7 @@ struct _GtkIMContextPrivate {
static void gtk_im_context_real_get_preedit_string (GtkIMContext *context,
char **str,
- PangoAttrList **attrs,
+ Pango2AttrList **attrs,
int *cursor_pos);
static gboolean gtk_im_context_real_filter_keypress (GtkIMContext *context,
GdkEvent *event);
@@ -362,13 +362,13 @@ gtk_im_context_init (GtkIMContext *im_context)
static void
gtk_im_context_real_get_preedit_string (GtkIMContext *context,
char **str,
- PangoAttrList **attrs,
+ Pango2AttrList **attrs,
int *cursor_pos)
{
if (str)
*str = g_strdup ("");
if (attrs)
- *attrs = pango_attr_list_new ();
+ *attrs = pango2_attr_list_new ();
if (cursor_pos)
*cursor_pos = 0;
}
@@ -483,7 +483,7 @@ gtk_im_context_set_client_widget (GtkIMContext *context,
* string. The string retrieved must be freed with g_free().
* @attrs: (out) (transfer full): location to store the retrieved
* attribute list. When you are done with this list, you
- * must unreference it with [method@Pango.AttrList.unref].
+ * must unreference it with [method@Pango2.AttrList.unref].
* @cursor_pos: (out): location to store position of cursor
* (in characters) within the preedit string.
*
@@ -495,7 +495,7 @@ gtk_im_context_set_client_widget (GtkIMContext *context,
void
gtk_im_context_get_preedit_string (GtkIMContext *context,
char **str,
- PangoAttrList **attrs,
+ Pango2AttrList **attrs,
int *cursor_pos)
{
GtkIMContextClass *klass;
diff --git a/gtk/gtkimcontext.h b/gtk/gtkimcontext.h
index d4268d7e12..996344330e 100644
--- a/gtk/gtkimcontext.h
+++ b/gtk/gtkimcontext.h
@@ -65,7 +65,7 @@ struct _GtkIMContextClass
GtkWidget *widget);
void (*get_preedit_string) (GtkIMContext *context,
char **str,
- PangoAttrList **attrs,
+ Pango2AttrList **attrs,
int *cursor_pos);
gboolean (*filter_keypress) (GtkIMContext *context,
GdkEvent *event);
@@ -113,7 +113,7 @@ void gtk_im_context_set_client_widget (GtkIMContext *context,
GDK_AVAILABLE_IN_ALL
void gtk_im_context_get_preedit_string (GtkIMContext *context,
char **str,
- PangoAttrList **attrs,
+ Pango2AttrList **attrs,
int *cursor_pos);
GDK_AVAILABLE_IN_ALL
gboolean gtk_im_context_filter_keypress (GtkIMContext *context,
diff --git a/gtk/gtkimcontextime.c b/gtk/gtkimcontextime.c
index adb122f2c6..54b70a9f2e 100644
--- a/gtk/gtkimcontextime.c
+++ b/gtk/gtkimcontextime.c
@@ -107,7 +107,7 @@ static gboolean gtk_im_context_ime_filter_keypress (GtkIMContext *context,
static void gtk_im_context_ime_reset (GtkIMContext *context);
static void gtk_im_context_ime_get_preedit_string (GtkIMContext *context,
char **str,
- PangoAttrList **attrs,
+ Pango2AttrList **attrs,
int *cursor_pos);
static void gtk_im_context_ime_focus_in (GtkIMContext *context);
static void gtk_im_context_ime_focus_out (GtkIMContext *context);
@@ -502,10 +502,10 @@ get_utf8_preedit_string (GtkIMContextIME *context_ime,
}
-static PangoAttrList *
+static Pango2AttrList *
get_pango_attr_list (GtkIMContextIME *context_ime, const char *utf8str)
{
- PangoAttrList *attrs = pango_attr_list_new ();
+ Pango2AttrList *attrs = pango2_attr_list_new ();
HWND hwnd;
HIMC himc;
guint8 *buf = NULL;
@@ -522,7 +522,7 @@ get_pango_attr_list (GtkIMContextIME *context_ime, const char *utf8str)
const char *schr = utf8str, *echr;
guint16 f_red, f_green, f_blue, b_red, b_green, b_blue;
glong len, spos = 0, epos, sidx = 0, eidx;
- PangoAttribute *attr;
+ Pango2Attribute *attr;
/*
* get attributes list of IME.
@@ -557,10 +557,9 @@ get_pango_attr_list (GtkIMContextIME *context_ime, const char *utf8str)
switch (buf[spos])
{
case ATTR_TARGET_CONVERTED:
- attr = pango_attr_underline_new (PANGO_UNDERLINE_DOUBLE);
- attr->start_index = sidx;
- attr->end_index = eidx;
- pango_attr_list_change (attrs, attr);
+ attr = pango2_attr_underline_new (PANGO_UNDERLINE_DOUBLE);
+ pango2_attribute_set_range (attr, sidx, eidx);
+ pango2_attr_list_change (attrs, attr);
f_red = f_green = f_blue = 0;
b_red = b_green = b_blue = 0xffff;
break;
@@ -573,21 +572,18 @@ get_pango_attr_list (GtkIMContextIME *context_ime, const char *utf8str)
b_red = b_green = b_blue = 0x7fff;
break;
default: /* ATTR_INPUT,ATTR_CONVERTED,ATTR_FIXEDCONVERTED */
- attr = pango_attr_underline_new (PANGO_UNDERLINE_SINGLE);
- attr->start_index = sidx;
- attr->end_index = eidx;
- pango_attr_list_change (attrs, attr);
+ attr = pango2_attr_underline_new (PANGO_UNDERLINE_SINGLE);
+ pango2_attribute_set_range (attr, sidx, eidx);
+ pango2_attr_list_change (attrs, attr);
f_red = f_green = f_blue = 0;
b_red = b_green = b_blue = 0xffff;
}
- attr = pango_attr_foreground_new (f_red, f_green, f_blue);
- attr->start_index = sidx;
- attr->end_index = eidx;
- pango_attr_list_change (attrs, attr);
- attr = pango_attr_background_new (b_red, b_green, b_blue);
- attr->start_index = sidx;
- attr->end_index = eidx;
- pango_attr_list_change (attrs, attr);
+ attr = pango2_attr_foreground_new (&(PangoColor){f_red, f_green, f_blue});
+ pango2_attribute_set_range (attr, sidx, eidx);
+ pango2_attr_list_change (attrs, attr);
+ attr = pango2_attr_background_new (&(PangoColor){b_red, b_green, b_blue};
+ pango2_attribute_set_range (attr, sidx, eidx);
+ pango2_attr_list_change (attrs, attr);
schr = echr;
spos = epos;
@@ -606,7 +602,7 @@ get_pango_attr_list (GtkIMContextIME *context_ime, const char *utf8str)
static void
gtk_im_context_ime_get_preedit_string (GtkIMContext *context,
char **str,
- PangoAttrList **attrs,
+ Pango2AttrList **attrs,
int *cursor_pos)
{
char *utf8str = NULL;
diff --git a/gtk/gtkimcontextquartz.c b/gtk/gtkimcontextquartz.c
index 85ed794952..56d675e9ae 100644
--- a/gtk/gtkimcontextquartz.c
+++ b/gtk/gtkimcontextquartz.c
@@ -65,7 +65,7 @@ G_DEFINE_TYPE_WITH_CODE (GtkIMContextQuartz, gtk_im_context_quartz, GTK_TYPE_IM_
static void
quartz_get_preedit_string (GtkIMContext *context,
char **str,
- PangoAttrList **attrs,
+ Pango2AttrList **attrs,
int *cursor_pos)
{
GtkIMContextQuartz *qc = GTK_IM_CONTEXT_QUARTZ (context);
@@ -77,12 +77,12 @@ quartz_get_preedit_string (GtkIMContext *context,
if (attrs)
{
- *attrs = pango_attr_list_new ();
+ *attrs = pango2_attr_list_new ();
int len = g_utf8_strlen (*str, -1);
char *ch = *str;
if (len > 0)
{
- PangoAttribute *attr;
+ Pango2Attribute *attr;
int i = 0;
for (;;)
{
@@ -91,17 +91,15 @@ quartz_get_preedit_string (GtkIMContext *context,
if (i >= qc->cursor_index &&
i < qc->cursor_index + qc->selected_len)
- attr = pango_attr_underline_new (PANGO_LINE_STYLE_DOUBLE);
+ attr = pango2_attr_underline_new (PANGO2_LINE_STYLE_DOUBLE);
else
- attr = pango_attr_underline_new (PANGO_LINE_STYLE_SOLID);
-
- attr->start_index = s - *str;
+ attr = pango2_attr_underline_new (PANGO2_LINE_STYLE_SOLID);
if (!*ch)
- attr->end_index = attr->start_index + strlen (s);
+ pango2_attribute_set_range (s - *str, s - *str + strlen (s));
else
- attr->end_index = ch - *str;
+ pango2_attribute_set_range (s - *str, ch - *str);
- pango_attr_list_change (*attrs, attr);
+ pango2_attr_list_change (*attrs, attr);
if (!*ch)
break;
diff --git a/gtk/gtkimcontextsimple.c b/gtk/gtkimcontextsimple.c
index 85f72b7f74..f878a63076 100644
--- a/gtk/gtkimcontextsimple.c
+++ b/gtk/gtkimcontextsimple.c
@@ -151,7 +151,7 @@ static gboolean gtk_im_context_simple_filter_keypress (GtkIMContext
static void gtk_im_context_simple_reset (GtkIMContext *context);
static void gtk_im_context_simple_get_preedit_string (GtkIMContext *context,
char **str,
- PangoAttrList **attrs,
+ Pango2AttrList **attrs,
int *cursor_pos);
static void init_compose_table_async (GCancellable *cancellable,
@@ -1206,7 +1206,7 @@ gtk_im_context_simple_reset (GtkIMContext *context)
static void
gtk_im_context_simple_get_preedit_string (GtkIMContext *context,
char **str,
- PangoAttrList **attrs,
+ Pango2AttrList **attrs,
int *cursor_pos)
{
GtkIMContextSimple *context_simple = GTK_IM_CONTEXT_SIMPLE (context);
@@ -1270,19 +1270,19 @@ gtk_im_context_simple_get_preedit_string (GtkIMContext *context,
if (attrs)
{
- *attrs = pango_attr_list_new ();
+ *attrs = pango2_attr_list_new ();
if (s->len)
{
- PangoAttribute *attr;
+ Pango2Attribute *attr;
- attr = pango_attr_underline_new (PANGO_LINE_STYLE_SOLID);
- pango_attribute_set_range (attr, 0, s->len);
- pango_attr_list_insert (*attrs, attr);
+ attr = pango2_attr_underline_new (PANGO2_LINE_STYLE_SOLID);
+ pango2_attribute_set_range (attr, 0, s->len);
+ pango2_attr_list_insert (*attrs, attr);
- attr = pango_attr_fallback_new (TRUE);
- pango_attribute_set_range (attr, 0, s->len);
- pango_attr_list_insert (*attrs, attr);
+ attr = pango2_attr_fallback_new (TRUE);
+ pango2_attribute_set_range (attr, 0, s->len);
+ pango2_attr_list_insert (*attrs, attr);
}
}
diff --git a/gtk/gtkimcontextwayland.c b/gtk/gtkimcontextwayland.c
index d8d374a364..1809a1cc36 100644
--- a/gtk/gtkimcontextwayland.c
+++ b/gtk/gtkimcontextwayland.c
@@ -603,7 +603,7 @@ gtk_im_context_wayland_set_client_widget (GtkIMContext *context,
static void
gtk_im_context_wayland_get_preedit_string (GtkIMContext *context,
char **str,
- PangoAttrList **attrs,
+ Pango2AttrList **attrs,
int *cursor_pos)
{
GtkIMContextWayland *context_wayland = GTK_IM_CONTEXT_WAYLAND (context);
@@ -636,30 +636,30 @@ gtk_im_context_wayland_get_preedit_string (GtkIMContext *context,
*str = g_strdup (preedit_str);
if (attrs)
{
- PangoAttribute *attr;
+ Pango2Attribute *attr;
guint len = strlen (preedit_str);
if (!*attrs)
- *attrs = pango_attr_list_new ();
+ *attrs = pango2_attr_list_new ();
- attr = pango_attr_underline_new (PANGO_LINE_STYLE_SOLID);
- pango_attribute_set_range (attr, 0, len);
- pango_attr_list_insert (*attrs, attr);
+ attr = pango2_attr_underline_new (PANGO2_LINE_STYLE_SOLID);
+ pango2_attribute_set_range (attr, 0, len);
+ pango2_attr_list_insert (*attrs, attr);
/* enable fallback, since IBus will send us things like ⎄ */
- attr = pango_attr_fallback_new (TRUE);
- pango_attribute_set_range (attr, 0, len);
- pango_attr_list_insert (*attrs, attr);
+ attr = pango2_attr_fallback_new (TRUE);
+ pango2_attribute_set_range (attr, 0, len);
+ pango2_attr_list_insert (*attrs, attr);
if (context_wayland->current_preedit.cursor_begin
!= context_wayland->current_preedit.cursor_end)
{
/* FIXME: Oh noes, how to highlight while taking into account user preferences? */
- PangoAttribute *cursor = pango_attr_weight_new (PANGO_WEIGHT_BOLD);
- pango_attribute_set_range (cursor,
+ Pango2Attribute *cursor = pango2_attr_weight_new (PANGO2_WEIGHT_BOLD);
+ pango2_attribute_set_range (cursor,
context_wayland->current_preedit.cursor_begin,
context_wayland->current_preedit.cursor_end);
- pango_attr_list_insert (*attrs, cursor);
+ pango2_attr_list_insert (*attrs, cursor);
}
}
}
diff --git a/gtk/gtkimmulticontext.c b/gtk/gtkimmulticontext.c
index 0a5ef9a5a6..4bbdd19f37 100644
--- a/gtk/gtkimmulticontext.c
+++ b/gtk/gtkimmulticontext.c
@@ -68,7 +68,7 @@ static void gtk_im_multicontext_set_client_widget (GtkIMContext
GtkWidget *widget);
static void gtk_im_multicontext_get_preedit_string (GtkIMContext *context,
char **str,
- PangoAttrList **attrs,
+ Pango2AttrList **attrs,
int *cursor_pos);
static gboolean gtk_im_multicontext_filter_keypress (GtkIMContext *context,
GdkEvent *event);
@@ -347,7 +347,7 @@ gtk_im_multicontext_set_client_widget (GtkIMContext *context,
static void
gtk_im_multicontext_get_preedit_string (GtkIMContext *context,
char **str,
- PangoAttrList **attrs,
+ Pango2AttrList **attrs,
int *cursor_pos)
{
GtkIMMulticontext *multicontext = GTK_IM_MULTICONTEXT (context);
@@ -360,7 +360,7 @@ gtk_im_multicontext_get_preedit_string (GtkIMContext *context,
if (str)
*str = g_strdup ("");
if (attrs)
- *attrs = pango_attr_list_new ();
+ *attrs = pango2_attr_list_new ();
}
}
diff --git a/gtk/gtkinscription.c b/gtk/gtkinscription.c
index d6d9f08e30..07fa5eaaf9 100644
--- a/gtk/gtkinscription.c
+++ b/gtk/gtkinscription.c
@@ -71,10 +71,10 @@ struct _GtkInscription
guint nat_lines;
float xalign;
float yalign;
- PangoAttrList *attrs;
+ Pango2AttrList *attrs;
GtkInscriptionOverflow overflow;
- PangoLayout *layout;
+ Pango2Layout *layout;
};
enum
@@ -158,7 +158,7 @@ gtk_inscription_get_property (GObject *object,
break;
case PROP_WRAP_MODE:
- g_value_set_enum (value, pango_layout_get_wrap (self->layout));
+ g_value_set_enum (value, pango2_layout_get_wrap (self->layout));
break;
case PROP_XALIGN:
@@ -236,28 +236,28 @@ gtk_inscription_set_property (GObject *object,
}
static void
-update_pango_alignment (GtkInscription *self)
+update_pango2_alignment (GtkInscription *self)
{
- PangoAlignment align;
+ Pango2Alignment align;
gboolean ltr;
ltr = _gtk_widget_get_direction (GTK_WIDGET (self)) != GTK_TEXT_DIR_RTL;
if (self->xalign < 0.33)
- align = ltr ? PANGO_ALIGN_LEFT : PANGO_ALIGN_RIGHT;
+ align = ltr ? PANGO2_ALIGN_LEFT : PANGO2_ALIGN_RIGHT;
else if (self->xalign < 0.67)
- align = PANGO_ALIGN_CENTER;
+ align = PANGO2_ALIGN_CENTER;
else
- align = ltr ? PANGO_ALIGN_RIGHT : PANGO_ALIGN_LEFT;
+ align = ltr ? PANGO2_ALIGN_RIGHT : PANGO2_ALIGN_LEFT;
- pango_layout_set_alignment (self->layout, align);
+ pango2_layout_set_alignment (self->layout, align);
}
static void
gtk_inscription_update_layout_attributes (GtkInscription *self,
- PangoAttrList *css_attrs)
+ Pango2AttrList *css_attrs)
{
- PangoAttrList *new_attrs;
+ Pango2AttrList *new_attrs;
if (css_attrs == NULL)
css_attrs = gtk_css_style_get_pango_attributes (gtk_css_node_get_style (gtk_widget_get_css_node
(GTK_WIDGET (self))));
@@ -266,8 +266,8 @@ gtk_inscription_update_layout_attributes (GtkInscription *self,
new_attrs = _gtk_pango_attr_list_merge (new_attrs, self->attrs);
- pango_layout_set_attributes (self->layout, new_attrs);
- pango_attr_list_unref (new_attrs);
+ pango2_layout_set_attributes (self->layout, new_attrs);
+ pango2_attr_list_unref (new_attrs);
}
static void
@@ -295,29 +295,29 @@ gtk_inscription_direction_changed (GtkWidget *widget,
GTK_WIDGET_CLASS (gtk_inscription_parent_class)->direction_changed (widget, previous_direction);
- update_pango_alignment (self);
+ update_pango2_alignment (self);
}
-static PangoFontMetrics *
+static Pango2FontMetrics *
gtk_inscription_get_font_metrics (GtkInscription *self)
{
- PangoContext *context;
+ Pango2Context *context;
context = gtk_widget_get_pango_context (GTK_WIDGET (self));
- return pango_context_get_metrics (context, NULL, NULL);
+ return pango2_context_get_metrics (context, NULL, NULL);
}
static int
get_char_pixels (GtkInscription *self)
{
int char_width, digit_width;
- PangoFontMetrics *metrics;
+ Pango2FontMetrics *metrics;
metrics = gtk_inscription_get_font_metrics (self);
- char_width = pango_font_metrics_get_approximate_char_width (metrics);
- digit_width = pango_font_metrics_get_approximate_digit_width (metrics);
- pango_font_metrics_free (metrics);
+ char_width = pango2_font_metrics_get_approximate_char_width (metrics);
+ digit_width = pango2_font_metrics_get_approximate_digit_width (metrics);
+ pango2_font_metrics_free (metrics);
return MAX (char_width, digit_width);
}
@@ -340,13 +340,13 @@ static int
get_line_pixels (GtkInscription *self,
int *baseline)
{
- PangoFontMetrics *metrics;
+ Pango2FontMetrics *metrics;
int ascent, descent;
metrics = gtk_inscription_get_font_metrics (self);
- ascent = pango_font_metrics_get_ascent (metrics);
- descent = pango_font_metrics_get_descent (metrics);
+ ascent = pango2_font_metrics_get_ascent (metrics);
+ descent = pango2_font_metrics_get_descent (metrics);
if (baseline)
*baseline = ascent;
@@ -397,12 +397,12 @@ gtk_inscription_measure (GtkWidget *widget,
else
gtk_inscription_measure_height (self, minimum, natural, minimum_baseline, natural_baseline);
- *minimum = PANGO_PIXELS_CEIL (*minimum);
- *natural = PANGO_PIXELS_CEIL (*natural);
+ *minimum = PANGO2_PIXELS_CEIL (*minimum);
+ *natural = PANGO2_PIXELS_CEIL (*natural);
if (*minimum_baseline > 0)
- *minimum_baseline = PANGO_PIXELS_CEIL (*minimum_baseline);
+ *minimum_baseline = PANGO2_PIXELS_CEIL (*minimum_baseline);
if (*natural_baseline > 0)
- *natural_baseline = PANGO_PIXELS_CEIL (*natural_baseline);
+ *natural_baseline = PANGO2_PIXELS_CEIL (*natural_baseline);
}
static void
@@ -413,25 +413,25 @@ gtk_inscription_get_layout_location (GtkInscription *self,
GtkWidget *widget = GTK_WIDGET (self);
const int widget_width = gtk_widget_get_width (widget);
const int widget_height = gtk_widget_get_height (widget);
- PangoRectangle logical;
+ Pango2Rectangle logical;
float xalign;
int baseline;
float x, y;
- PangoLines *lines;
+ Pango2Lines *lines;
g_assert (x_out);
g_assert (y_out);
- lines = pango_layout_get_lines (self->layout);
+ lines = pango2_layout_get_lines (self->layout);
xalign = self->xalign;
if (_gtk_widget_get_direction (widget) != GTK_TEXT_DIR_LTR)
xalign = 1.0 - xalign;
- pango_lines_get_extents (lines, NULL, &logical);
- pango_extents_to_pixels (&logical, NULL);
+ pango2_lines_get_extents (lines, NULL, &logical);
+ pango2_extents_to_pixels (&logical, NULL);
- if (pango_layout_get_width (self->layout) > 0)
+ if (pango2_layout_get_width (self->layout) > 0)
x = 0.f;
else
x = floor ((xalign * (widget_width - logical.width)) - logical.x);
@@ -439,11 +439,11 @@ gtk_inscription_get_layout_location (GtkInscription *self,
baseline = gtk_widget_get_allocated_baseline (widget);
if (baseline != -1)
{
- int layout_baseline = pango_lines_get_baseline (lines) / PANGO_SCALE;
+ int layout_baseline = pango2_lines_get_baseline (lines) / PANGO2_SCALE;
/* yalign is 0 because we can't support yalign while baseline aligning */
y = baseline - layout_baseline;
}
- else if (pango_lines_is_ellipsized (lines))
+ else if (pango2_lines_is_ellipsized (lines))
{
y = 0.f;
}
@@ -466,32 +466,32 @@ gtk_inscription_allocate (GtkWidget *widget,
{
GtkInscription *self = GTK_INSCRIPTION (widget);
- pango_layout_set_width (self->layout, width * PANGO_SCALE);
+ pango2_layout_set_width (self->layout, width * PANGO2_SCALE);
switch (self->overflow)
{
case GTK_INSCRIPTION_OVERFLOW_CLIP:
- pango_layout_set_height (self->layout, -1);
+ pango2_layout_set_height (self->layout, -1);
/* figure out if we're single line (clip horizontally)
* or multiline (clip vertically):
* If we can't fit 2 rows, we're single line.
*/
{
- PangoLineIter *iter = pango_layout_get_iter (self->layout);
- if (pango_line_iter_next_line (iter))
+ Pango2LineIter *iter = pango2_layout_get_iter (self->layout);
+ if (pango2_line_iter_next_line (iter))
{
- PangoRectangle rect;
- pango_line_iter_get_line_extents (iter, NULL, &rect);
- if (rect.y + rect.height > height * PANGO_SCALE)
+ Pango2Rectangle rect;
+ pango2_line_iter_get_line_extents (iter, NULL, &rect);
+ if (rect.y + rect.height > height * PANGO2_SCALE)
{
- while (!pango_line_is_paragraph_start (pango_line_iter_get_line (iter)))
+ while (!pango2_line_is_paragraph_start (pango2_line_iter_get_line (iter)))
{
- if (!pango_line_iter_next_line (iter))
+ if (!pango2_line_iter_next_line (iter))
break;
}
- if (!pango_line_is_paragraph_start (pango_line_iter_get_line (iter)))
+ if (!pango2_line_is_paragraph_start (pango2_line_iter_get_line (iter)))
{
- pango_layout_set_width (self->layout, -1);
+ pango2_layout_set_width (self->layout, -1);
}
}
}
@@ -501,7 +501,7 @@ gtk_inscription_allocate (GtkWidget *widget,
case GTK_INSCRIPTION_OVERFLOW_ELLIPSIZE_START:
case GTK_INSCRIPTION_OVERFLOW_ELLIPSIZE_MIDDLE:
case GTK_INSCRIPTION_OVERFLOW_ELLIPSIZE_END:
- pango_layout_set_height (self->layout, height * PANGO_SCALE);
+ pango2_layout_set_height (self->layout, height * PANGO2_SCALE);
break;
default:
g_assert_not_reached();
@@ -554,7 +554,7 @@ gtk_inscription_class_init (GtkInscriptionClass *klass)
*/
properties[PROP_ATTRIBUTES] =
g_param_spec_boxed ("attributes", NULL, NULL,
- PANGO_TYPE_ATTR_LIST,
+ PANGO2_TYPE_ATTR_LIST,
G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY | G_PARAM_STATIC_STRINGS);
/**
@@ -564,9 +564,9 @@ gtk_inscription_class_init (GtkInscriptionClass *klass)
* [property@Gtk.Inscription:attributes] properties, mainly intended for use in
* GtkBuilder ui files to ease translation support and bindings.
*
- * This function uses [func@Pango.parse_markup] to parse the markup into text and
+ * This function uses [func@Pango2.parse_markup] to parse the markup into text and
* attributes. The markup must be valid. If you cannot ensure that, consider using
- * [func@Pango.parse_markup] and setting the two properties yourself.
+ * [func@Pango2.parse_markup] and setting the two properties yourself.
*
* Since: 4.8
*/
@@ -690,14 +690,14 @@ gtk_inscription_class_init (GtkInscriptionClass *klass)
*
* Controls how the line wrapping is done.
*
- * Note that unlike `GtkLabel`, the default here is %PANGO_WRAP_WORD_CHAR.
+ * Note that unlike `GtkLabel`, the default here is %PANGO2_WRAP_WORD_CHAR.
*
* Since: 4.8
*/
properties[PROP_WRAP_MODE] =
g_param_spec_enum ("wrap-mode", NULL, NULL,
- PANGO_TYPE_WRAP_MODE,
- PANGO_WRAP_WORD_CHAR,
+ PANGO2_TYPE_WRAP_MODE,
+ PANGO2_WRAP_WORD_CHAR,
G_PARAM_READWRITE | G_PARAM_EXPLICIT_NOTIFY | G_PARAM_STATIC_STRINGS);
/**
@@ -749,12 +749,12 @@ gtk_inscription_init (GtkInscription *self)
self->yalign = DEFAULT_YALIGN;
self->layout = gtk_widget_create_pango_layout (GTK_WIDGET (self), NULL);
- pango_layout_set_wrap (self->layout, PANGO_WRAP_WORD_CHAR);
- update_pango_alignment (self);
+ pango2_layout_set_wrap (self->layout, PANGO2_WRAP_WORD_CHAR);
+ update_pango2_alignment (self);
}
/* for a11y */
-PangoLayout *
+Pango2Layout *
gtk_inscription_get_layout (GtkInscription *self)
{
return self->layout;
@@ -799,7 +799,7 @@ gtk_inscription_set_text (GtkInscription *self,
g_free (self->text);
self->text = g_strdup (text);
- pango_layout_set_text (self->layout,
+ pango2_layout_set_text (self->layout,
self->text ? self->text : "",
-1);
@@ -1039,7 +1039,7 @@ gtk_inscription_set_xalign (GtkInscription *self,
self->xalign = xalign;
- update_pango_alignment (self);
+ update_pango2_alignment (self);
gtk_widget_queue_draw (GTK_WIDGET (self));
@@ -1118,7 +1118,7 @@ gtk_inscription_get_yalign (GtkInscription *self)
/**
* gtk_inscription_set_attributes: (attributes org.gtk.Method.set_property=attributes)
* @self: a `GtkInscription`
- * @attrs: (nullable): a [struct@Pango.AttrList]
+ * @attrs: (nullable): a [struct@Pango2.AttrList]
*
* Apply attributes to the inscription text.
*
@@ -1128,7 +1128,7 @@ gtk_inscription_get_yalign (GtkInscription *self)
*/
void
gtk_inscription_set_attributes (GtkInscription *self,
- PangoAttrList *attrs)
+ Pango2AttrList *attrs)
{
g_return_if_fail (GTK_IS_INSCRIPTION (self));
@@ -1136,10 +1136,10 @@ gtk_inscription_set_attributes (GtkInscription *self,
return;
if (attrs)
- pango_attr_list_ref (attrs);
+ pango2_attr_list_ref (attrs);
if (self->attrs)
- pango_attr_list_unref (self->attrs);
+ pango2_attr_list_unref (self->attrs);
self->attrs = attrs;
gtk_inscription_update_layout_attributes (self, NULL);
@@ -1159,7 +1159,7 @@ gtk_inscription_set_attributes (GtkInscription *self,
*
* Since: 4.8
*/
-PangoAttrList *
+Pango2AttrList *
gtk_inscription_get_attributes (GtkInscription *self)
{
g_return_val_if_fail (GTK_IS_INSCRIPTION (self), NULL);
@@ -1190,16 +1190,16 @@ gtk_inscription_set_text_overflow (GtkInscription *self,
switch (self->overflow)
{
case GTK_INSCRIPTION_OVERFLOW_CLIP:
- pango_layout_set_ellipsize (self->layout, PANGO_ELLIPSIZE_NONE);
+ pango2_layout_set_ellipsize (self->layout, PANGO2_ELLIPSIZE_NONE);
break;
case GTK_INSCRIPTION_OVERFLOW_ELLIPSIZE_START:
- pango_layout_set_ellipsize (self->layout, PANGO_ELLIPSIZE_START);
+ pango2_layout_set_ellipsize (self->layout, PANGO2_ELLIPSIZE_START);
break;
case GTK_INSCRIPTION_OVERFLOW_ELLIPSIZE_MIDDLE:
- pango_layout_set_ellipsize (self->layout, PANGO_ELLIPSIZE_MIDDLE);
+ pango2_layout_set_ellipsize (self->layout, PANGO2_ELLIPSIZE_MIDDLE);
break;
case GTK_INSCRIPTION_OVERFLOW_ELLIPSIZE_END:
- pango_layout_set_ellipsize (self->layout, PANGO_ELLIPSIZE_END);
+ pango2_layout_set_ellipsize (self->layout, PANGO2_ELLIPSIZE_END);
break;
default:
g_assert_not_reached();
@@ -1240,14 +1240,14 @@ gtk_inscription_get_text_overflow (GtkInscription *self)
*/
void
gtk_inscription_set_wrap_mode (GtkInscription *self,
- PangoWrapMode wrap_mode)
+ Pango2WrapMode wrap_mode)
{
g_return_if_fail (GTK_IS_INSCRIPTION (self));
- if (pango_layout_get_wrap (self->layout) == wrap_mode)
+ if (pango2_layout_get_wrap (self->layout) == wrap_mode)
return;
- pango_layout_set_wrap (self->layout, wrap_mode);
+ pango2_layout_set_wrap (self->layout, wrap_mode);
gtk_widget_queue_draw (GTK_WIDGET (self));
@@ -1266,12 +1266,12 @@ gtk_inscription_set_wrap_mode (GtkInscription *self,
*
* Since:4.8
*/
-PangoWrapMode
+Pango2WrapMode
gtk_inscription_get_wrap_mode (GtkInscription *self)
{
- g_return_val_if_fail (GTK_IS_INSCRIPTION (self), PANGO_WRAP_WORD_CHAR);
+ g_return_val_if_fail (GTK_IS_INSCRIPTION (self), PANGO2_WRAP_WORD_CHAR);
- return pango_layout_get_wrap (self->layout);
+ return pango2_layout_get_wrap (self->layout);
}
/**
@@ -1289,7 +1289,7 @@ void
gtk_inscription_set_markup (GtkInscription *self,
const char *markup)
{
- PangoAttrList *attrs;
+ Pango2AttrList *attrs;
char *text;
GError *error = NULL;
@@ -1300,7 +1300,7 @@ gtk_inscription_set_markup (GtkInscription *self,
text = NULL;
attrs = NULL;
}
- else if (!pango_parse_markup (markup, -1,
+ else if (!pango2_parse_markup (markup, -1,
0,
&attrs, &text,
NULL,
@@ -1315,5 +1315,5 @@ gtk_inscription_set_markup (GtkInscription *self,
gtk_inscription_set_attributes (self, attrs);
g_clear_pointer (&text, g_free);
- g_clear_pointer (&attrs, pango_attr_list_unref);
+ g_clear_pointer (&attrs, pango2_attr_list_unref);
}
diff --git a/gtk/gtkinscription.h b/gtk/gtkinscription.h
index 164d05991a..46a5c83e8a 100644
--- a/gtk/gtkinscription.h
+++ b/gtk/gtkinscription.h
@@ -61,10 +61,10 @@ GDK_AVAILABLE_IN_4_8
void gtk_inscription_set_text (GtkInscription *self,
const char *text);
GDK_AVAILABLE_IN_4_8
-PangoAttrList * gtk_inscription_get_attributes (GtkInscription *self);
+Pango2AttrList * gtk_inscription_get_attributes (GtkInscription *self);
GDK_AVAILABLE_IN_4_8
void gtk_inscription_set_attributes (GtkInscription *self,
- PangoAttrList *attrs);
+ Pango2AttrList *attrs);
GDK_AVAILABLE_IN_4_8
void gtk_inscription_set_markup (GtkInscription *self,
const char *markup);
@@ -74,10 +74,10 @@ GDK_AVAILABLE_IN_4_8
void gtk_inscription_set_text_overflow (GtkInscription *self,
GtkInscriptionOverflow overflow);
GDK_AVAILABLE_IN_4_8
-PangoWrapMode gtk_inscription_get_wrap_mode (GtkInscription *self);
+Pango2WrapMode gtk_inscription_get_wrap_mode (GtkInscription *self);
GDK_AVAILABLE_IN_4_8
void gtk_inscription_set_wrap_mode (GtkInscription *self,
- PangoWrapMode wrap_mode);
+ Pango2WrapMode wrap_mode);
GDK_AVAILABLE_IN_4_8
guint gtk_inscription_get_min_chars (GtkInscription *self);
diff --git a/gtk/gtkinscriptionprivate.h b/gtk/gtkinscriptionprivate.h
index 97de354e27..67969f8a32 100644
--- a/gtk/gtkinscriptionprivate.h
+++ b/gtk/gtkinscriptionprivate.h
@@ -26,7 +26,7 @@
G_BEGIN_DECLS
-PangoLayout * gtk_inscription_get_layout (GtkInscription *self);
+Pango2Layout * gtk_inscription_get_layout (GtkInscription *self);
G_END_DECLS
diff --git a/gtk/gtklabel.c b/gtk/gtklabel.c
index 8cbd8fbe31..79e585a930 100644
--- a/gtk/gtklabel.c
+++ b/gtk/gtklabel.c
@@ -94,21 +94,21 @@
* The GtkLabel implementation of the GtkBuildable interface supports a
* custom <attributes> element, which supports any number of <attribute>
* elements. The <attribute> element has attributes named “name“, “value“,
- * “start“ and “end“ and allows you to specify [struct@Pango.Attribute]
+ * “start“ and “end“ and allows you to specify [struct@Pango2.Attribute]
* values for this label.
*
- * An example of a UI definition fragment specifying Pango attributes:
+ * An example of a UI definition fragment specifying Pango2 attributes:
* ```xml
* <object class="GtkLabel">
* <attributes>
- * <attribute name="weight" value="PANGO_WEIGHT_BOLD"/>
+ * <attribute name="weight" value="PANGO2_WEIGHT_BOLD"/>
* <attribute name="background" value="red" start="5" end="10"/>
* </attributes>
* </object>
* ```
*
* The start and end attributes specify the range of characters to which the
- * Pango attribute applies. If start and end are not specified, the attribute is
+ * Pango2 attribute applies. If start and end are not specified, the attribute is
* applied to the whole text. Note that specifying ranges does not make much
* sense with translatable attributes. Use markup embedded in the translatable
* content instead.
@@ -169,8 +169,8 @@
* gtk_label_set_markup (GTK_LABEL (label), "<small>Small text</small>");
* ```
*
- * (See the Pango manual for complete documentation] of available
- * tags, [func@Pango.parse_markup])
+ * (See the Pango2 manual for complete documentation] of available
+ * tags, [func@Pango2.parse_markup])
*
* The markup passed to gtk_label_set_markup() must be valid; for example,
* literal <, > and & characters must be escaped as <, >, and &.
@@ -178,13 +178,13 @@
* [method@Gtk.Label.set_markup], you’ll want to escape it with
* g_markup_escape_text() or g_markup_printf_escaped().
*
- * Markup strings are just a convenient way to set the [struct@Pango.AttrList]
+ * Markup strings are just a convenient way to set the [struct@Pango2.AttrList]
* on a label; [method@Gtk.Label.set_attributes] may be a simpler way to set
- * attributes in some cases. Be careful though; [struct@Pango.AttrList] tends
+ * attributes in some cases. Be careful though; [struct@Pango2.AttrList] tends
* to cause internationalization problems, unless you’re applying attributes
* to the entire string (i.e. unless you set the range of each attribute
* to [0, %G_MAXINT)). The reason is that specifying the start_index and
- * end_index for a [struct@Pango.Attribute] requires knowledge of the exact
+ * end_index for a [struct@Pango2.Attribute] requires knowledge of the exact
* string being displayed, so translations will cause problems.
*
* # Selectable labels
@@ -199,7 +199,7 @@
* A label can contain any number of paragraphs, but will have
* performance problems if it contains more than a small number.
* Paragraphs are separated by newlines or other paragraph separators
- * understood by Pango.
+ * understood by Pango2.
*
* Labels can automatically wrap text if you call [method@Gtk.Label.set_wrap].
*
@@ -219,7 +219,7 @@
*
* # Links
*
- * GTK supports markup for clickable hyperlinks in addition to regular Pango
+ * GTK supports markup for clickable hyperlinks in addition to regular Pango2
* markup. The markup for links is borrowed from HTML, using the `<a>` with
* “href“, “title“ and “class“ attributes. GTK renders links similar to the
* way they appear in web browsers, with colored, underlined text. The “title“
@@ -253,9 +253,9 @@ struct _GtkLabel
GtkWidget *mnemonic_widget;
GtkEventController *mnemonic_controller;
- PangoAttrList *attrs;
- PangoAttrList *markup_attrs;
- PangoLayout *layout;
+ Pango2AttrList *attrs;
+ Pango2AttrList *markup_attrs;
+ Pango2Layout *layout;
GtkWidget *popup_menu;
GMenuModel *extra_menu;
@@ -335,7 +335,7 @@ typedef struct
gboolean visited; /* get set when the link is activated; this flag
* gets preserved over later set_markup() calls
*/
- int start; /* position of the link in the PangoLayout */
+ int start; /* position of the link in the Pango2Layout */
int end;
} GtkLabelLink;
@@ -612,9 +612,9 @@ gtk_label_init (GtkLabel *self)
self->jtype = GTK_JUSTIFY_LEFT;
self->wrap = FALSE;
- self->wrap_mode = PANGO_WRAP_WORD;
+ self->wrap_mode = PANGO2_WRAP_WORD;
self->natural_wrap_mode = GTK_NATURAL_WRAP_INHERIT;
- self->ellipsize = PANGO_ELLIPSIZE_NONE;
+ self->ellipsize = PANGO2_ELLIPSIZE_NONE;
self->use_underline = FALSE;
self->use_markup = FALSE;
@@ -677,7 +677,7 @@ gtk_label_buildable_custom_finished (GtkBuildable *buildable,
if (data->attrs)
{
gtk_label_set_attributes (GTK_LABEL (buildable), data->attrs);
- pango_attr_list_unref (data->attrs);
+ pango2_attr_list_unref (data->attrs);
}
g_object_unref (data->object);
@@ -777,15 +777,15 @@ gtk_label_state_flags_changed (GtkWidget *widget,
static void
gtk_label_update_layout_attributes (GtkLabel *self,
- PangoAttrList *style_attrs)
+ Pango2AttrList *style_attrs)
{
GtkWidget *widget = GTK_WIDGET (self);
GtkCssStyle *style;
- PangoAttrList *attrs;
+ Pango2AttrList *attrs;
if (self->layout == NULL)
{
- pango_attr_list_unref (style_attrs);
+ pango2_attr_list_unref (style_attrs);
return;
}
@@ -793,39 +793,39 @@ gtk_label_update_layout_attributes (GtkLabel *self,
{
guint i;
- attrs = pango_attr_list_new ();
+ attrs = pango2_attr_list_new ();
for (i = 0; i < self->select_info->n_links; i++)
{
const GtkLabelLink *link = &self->select_info->links[i];
const GdkRGBA *link_color;
- PangoAttrList *link_attrs;
- PangoAttribute *attr;
+ Pango2AttrList *link_attrs;
+ Pango2Attribute *attr;
style = gtk_css_node_get_style (link->cssnode);
link_attrs = gtk_css_style_get_pango_attributes (style);
if (link_attrs)
{
- GSList *attributes = pango_attr_list_get_attributes (link_attrs);
+ GSList *attributes = pango2_attr_list_get_attributes (link_attrs);
GSList *l;
for (l = attributes; l; l = l->next)
{
attr = l->data;
- pango_attribute_set_range (attr, link->start, link->end);
- pango_attr_list_insert (attrs, attr);
+ pango2_attribute_set_range (attr, link->start, link->end);
+ pango2_attr_list_insert (attrs, attr);
}
g_slist_free (attributes);
}
link_color = gtk_css_color_value_get_rgba (style->core->color);
- attr = pango_attr_foreground_new (&(PangoColor){link_color->red * 65535,
+ attr = pango2_attr_foreground_new (&(Pango2Color){link_color->red * 65535,
link_color->green * 65535,
link_color->blue * 65535,
link_color->alpha * 65535});
- pango_attribute_set_range (attr, link->start, link->end);
- pango_attr_list_insert (attrs, attr);
+ pango2_attribute_set_range (attr, link->start, link->end);
+ pango2_attr_list_insert (attrs, attr);
- pango_attr_list_unref (link_attrs);
+ pango2_attr_list_unref (link_attrs);
}
}
else
@@ -838,15 +838,15 @@ gtk_label_update_layout_attributes (GtkLabel *self,
if (style_attrs)
{
attrs = _gtk_pango_attr_list_merge (attrs, style_attrs);
- pango_attr_list_unref (style_attrs);
+ pango2_attr_list_unref (style_attrs);
}
attrs = _gtk_pango_attr_list_merge (attrs, self->markup_attrs);
attrs = _gtk_pango_attr_list_merge (attrs, self->attrs);
- pango_layout_set_attributes (self->layout, attrs);
+ pango2_layout_set_attributes (self->layout, attrs);
- pango_attr_list_unref (attrs);
+ pango2_attr_list_unref (attrs);
}
static void
@@ -855,14 +855,14 @@ gtk_label_css_changed (GtkWidget *widget,
{
GtkLabel *self = GTK_LABEL (widget);
gboolean attrs_affected;
- PangoAttrList *new_attrs = NULL;
+ Pango2AttrList *new_attrs = NULL;
GTK_WIDGET_CLASS (gtk_label_parent_class)->css_changed (widget, change);
if (gtk_css_style_change_affects (change, GTK_CSS_AFFECTS_TEXT_ATTRS))
{
new_attrs = gtk_css_style_get_pango_attributes (gtk_css_style_change_get_new_style (change));
- attrs_affected = (self->layout && pango_layout_get_attributes (self->layout)) ||
+ attrs_affected = (self->layout && pango2_layout_get_attributes (self->layout)) ||
new_attrs;
}
else
@@ -877,19 +877,19 @@ gtk_label_css_changed (GtkWidget *widget,
}
}
-static PangoDirection
+static Pango2Direction
get_cursor_direction (GtkLabel *self)
{
- PangoLines *lines;
+ Pango2Lines *lines;
g_assert (self->select_info);
gtk_label_ensure_layout (self);
- lines = pango_layout_get_lines (self->layout);
- for (int i = 0; i < pango_lines_get_line_count (lines); i++)
+ lines = pango2_layout_get_lines (self->layout);
+ for (int i = 0; i < pango2_lines_get_line_count (lines); i++)
{
- PangoLine *line = pango_lines_get_lines (lines)[i];
+ Pango2Line *line = pango2_lines_get_lines (lines)[i];
/* If self->select_info->selection_end is at the very end of
* the line, we don't know if the cursor is on this line or
@@ -898,11 +898,11 @@ get_cursor_direction (GtkLabel *self)
* definitely in this paragraph, which is good enough
* to figure out the resolved direction.
*/
- if (pango_line_get_start_index (line) + pango_line_get_length (line) >=
self->select_info->selection_end)
- return pango_line_get_resolved_direction (line);
+ if (pango2_line_get_start_index (line) + pango2_line_get_length (line) >=
self->select_info->selection_end)
+ return pango2_line_get_resolved_direction (line);
}
- return PANGO_DIRECTION_LTR;
+ return PANGO2_DIRECTION_LTR;
}
static int
@@ -966,19 +966,19 @@ nope:
*
* Returns: a new reference to a pango layout
*/
-static PangoLayout *
+static Pango2Layout *
gtk_label_get_measuring_layout (GtkLabel *self,
- PangoLayout *existing_layout,
+ Pango2Layout *existing_layout,
int width)
{
- PangoLines *lines;
- PangoLayout *copy;
+ Pango2Lines *lines;
+ Pango2Layout *copy;
if (existing_layout != NULL)
{
if (existing_layout != self->layout)
{
- pango_layout_set_width (existing_layout, width);
+ pango2_layout_set_width (existing_layout, width);
return existing_layout;
}
@@ -987,7 +987,7 @@ gtk_label_get_measuring_layout (GtkLabel *self,
gtk_label_ensure_layout (self);
- if (pango_layout_get_width (self->layout) == width)
+ if (pango2_layout_get_width (self->layout) == width)
{
g_object_ref (self->layout);
return self->layout;
@@ -1000,7 +1000,7 @@ gtk_label_get_measuring_layout (GtkLabel *self,
if (gtk_widget_get_width (GTK_WIDGET (self)) <= 1)
{
g_object_ref (self->layout);
- pango_layout_set_width (self->layout, width);
+ pango2_layout_set_width (self->layout, width);
return self->layout;
}
@@ -1009,36 +1009,36 @@ gtk_label_get_measuring_layout (GtkLabel *self,
* can just return the current layout, because for measuring purposes, it will be
* identical.
*/
- lines = pango_layout_get_lines (self->layout);
- if (!pango_lines_is_wrapped (lines) && !pango_lines_is_ellipsized (lines))
+ lines = pango2_layout_get_lines (self->layout);
+ if (!pango2_lines_is_wrapped (lines) && !pango2_lines_is_ellipsized (lines))
{
- PangoRectangle rect;
+ Pango2Rectangle rect;
if (width == -1)
return g_object_ref (self->layout);
- pango_lines_get_extents (lines, NULL, &rect);
+ pango2_lines_get_extents (lines, NULL, &rect);
if (rect.width <= width)
return g_object_ref (self->layout);
}
- copy = pango_layout_copy (self->layout);
- pango_layout_set_width (copy, width);
+ copy = pango2_layout_copy (self->layout);
+ pango2_layout_set_width (copy, width);
return copy;
}
static int
-get_char_pixels (PangoLayout *layout)
+get_char_pixels (Pango2Layout *layout)
{
- PangoContext *context;
- PangoFontMetrics *metrics;
+ Pango2Context *context;
+ Pango2FontMetrics *metrics;
int char_width, digit_width;
- context = pango_layout_get_context (layout);
- metrics = pango_context_get_metrics (context, NULL, NULL);
- char_width = pango_font_metrics_get_approximate_char_width (metrics);
- digit_width = pango_font_metrics_get_approximate_digit_width (metrics);
- pango_font_metrics_free (metrics);
+ context = pango2_layout_get_context (layout);
+ metrics = pango2_context_get_metrics (context, NULL, NULL);
+ char_width = pango2_font_metrics_get_approximate_char_width (metrics);
+ digit_width = pango2_font_metrics_get_approximate_digit_width (metrics);
+ pango2_font_metrics_free (metrics);
return MAX (char_width, digit_width);
}
@@ -1088,7 +1088,7 @@ get_static_size (GtkLabel *self,
int *natural_baseline)
{
int minimum_default, natural_default;
- PangoLayout *layout;
+ Pango2Layout *layout;
get_default_widths (self, &minimum_default, &natural_default);
@@ -1096,12 +1096,12 @@ get_static_size (GtkLabel *self,
if (orientation == GTK_ORIENTATION_HORIZONTAL)
{
- pango_lines_get_size (pango_layout_get_lines (layout), natural, NULL);
+ pango2_lines_get_size (pango2_layout_get_lines (layout), natural, NULL);
if (self->ellipsize)
{
layout = gtk_label_get_measuring_layout (self, layout, 0);
- pango_lines_get_size (pango_layout_get_lines (layout), minimum, NULL);
- /* yes, Pango ellipsizes even when that needs more space */
+ pango2_lines_get_size (pango2_layout_get_lines (layout), minimum, NULL);
+ /* yes, Pango2 ellipsizes even when that needs more space */
*minimum = MIN (*minimum, *natural);
}
else
@@ -1113,8 +1113,8 @@ get_static_size (GtkLabel *self,
}
else
{
- pango_lines_get_size (pango_layout_get_lines (layout), NULL, minimum);
- *minimum_baseline = pango_lines_get_baseline (pango_layout_get_lines (layout));
+ pango2_lines_get_size (pango2_layout_get_lines (layout), NULL, minimum);
+ *minimum_baseline = pango2_lines_get_baseline (pango2_layout_get_lines (layout));
*natural = *minimum;
*natural_baseline = *minimum_baseline;
@@ -1131,23 +1131,23 @@ get_height_for_width (GtkLabel *self,
int *minimum_baseline,
int *natural_baseline)
{
- PangoLayout *layout;
+ Pango2Layout *layout;
int natural_width, text_height, baseline;
if (width < 0)
{
/* Minimum height is assuming infinite width */
layout = gtk_label_get_measuring_layout (self, NULL, -1);
- pango_lines_get_size (pango_layout_get_lines (layout), NULL, minimum_height);
- baseline = pango_lines_get_baseline (pango_layout_get_lines (layout));
+ pango2_lines_get_size (pango2_layout_get_lines (layout), NULL, minimum_height);
+ baseline = pango2_lines_get_baseline (pango2_layout_get_lines (layout));
*minimum_baseline = baseline;
/* Natural height is assuming natural width */
get_default_widths (self, NULL, &natural_width);
layout = gtk_label_get_measuring_layout (self, layout, natural_width);
- pango_lines_get_size (pango_layout_get_lines (layout), NULL, natural_height);
- baseline = pango_lines_get_baseline (pango_layout_get_lines (layout));
+ pango2_lines_get_size (pango2_layout_get_lines (layout), NULL, natural_height);
+ baseline = pango2_lines_get_baseline (pango2_layout_get_lines (layout));
*natural_baseline = baseline;
}
else
@@ -1155,12 +1155,12 @@ get_height_for_width (GtkLabel *self,
/* minimum = natural for any given width */
layout = gtk_label_get_measuring_layout (self, NULL, width);
- pango_lines_get_size (pango_layout_get_lines (layout), NULL, &text_height);
+ pango2_lines_get_size (pango2_layout_get_lines (layout), NULL, &text_height);
*minimum_height = text_height;
*natural_height = text_height;
- baseline = pango_lines_get_baseline (pango_layout_get_lines (layout));
+ baseline = pango2_lines_get_baseline (pango2_layout_get_lines (layout));
*minimum_baseline = baseline;
*natural_baseline = baseline;
}
@@ -1169,22 +1169,22 @@ get_height_for_width (GtkLabel *self,
}
static int
-my_pango_layout_get_width_for_height (PangoLayout *layout,
+my_pango_layout_get_width_for_height (Pango2Layout *layout,
int for_height,
int min,
int max)
{
int mid, text_width, text_height;
- min = PANGO_PIXELS_CEIL (min);
- max = PANGO_PIXELS_CEIL (max);
+ min = PANGO2_PIXELS_CEIL (min);
+ max = PANGO2_PIXELS_CEIL (max);
while (min < max)
{
mid = (min + max) / 2;
- pango_layout_set_width (layout, mid * PANGO_SCALE);
- pango_lines_get_size (pango_layout_get_lines (layout), &text_width, &text_height);
- text_width = PANGO_PIXELS_CEIL (text_width);
+ pango2_layout_set_width (layout, mid * PANGO2_SCALE);
+ pango2_lines_get_size (pango2_layout_get_lines (layout), &text_width, &text_height);
+ text_width = PANGO2_PIXELS_CEIL (text_width);
if (text_width > mid)
min = text_width;
else if (text_height > for_height)
@@ -1193,7 +1193,7 @@ my_pango_layout_get_width_for_height (PangoLayout *layout,
max = mid;
}
- return min * PANGO_SCALE;
+ return min * PANGO2_SCALE;
}
static void
@@ -1202,7 +1202,7 @@ get_width_for_height (GtkLabel *self,
int *minimum_width,
int *natural_width)
{
- PangoLayout *layout;
+ Pango2Layout *layout;
int minimum_default, natural_default;
get_default_widths (self, &minimum_default, &natural_default);
@@ -1211,12 +1211,12 @@ get_width_for_height (GtkLabel *self,
{
/* Minimum width is as many line breaks as possible */
layout = gtk_label_get_measuring_layout (self, NULL, MAX (minimum_default, 0));
- pango_lines_get_size (pango_layout_get_lines (layout), minimum_width, NULL);
+ pango2_lines_get_size (pango2_layout_get_lines (layout), minimum_width, NULL);
*minimum_width = MAX (*minimum_width, minimum_default);
/* Natural width is natural width - or as wide as possible */
layout = gtk_label_get_measuring_layout (self, layout, natural_default);
- pango_lines_get_size (pango_layout_get_lines (layout), natural_width, NULL);
+ pango2_lines_get_size (pango2_layout_get_lines (layout), natural_width, NULL);
*natural_width = MAX (*natural_width, *minimum_width);
}
else
@@ -1226,15 +1226,15 @@ get_width_for_height (GtkLabel *self,
/* Can't use a measuring layout here, because we need to force
* ellipsizing mode */
gtk_label_ensure_layout (self);
- layout = pango_layout_copy (self->layout);
- pango_layout_set_ellipsize (layout, PANGO_ELLIPSIZE_NONE);
+ layout = pango2_layout_copy (self->layout);
+ pango2_layout_set_ellipsize (layout, PANGO2_ELLIPSIZE_NONE);
/* binary search for the smallest width where the height doesn't
* eclipse the given height */
min = MAX (minimum_default, 0);
- pango_layout_set_width (layout, -1);
- pango_lines_get_size (pango_layout_get_lines (layout), &max, NULL);
+ pango2_layout_set_width (layout, -1);
+ pango2_lines_get_size (pango2_layout_get_lines (layout), &max, NULL);
/* first, do natural width */
if (self->natural_wrap_mode == GTK_NATURAL_WRAP_NONE)
@@ -1244,16 +1244,16 @@ get_width_for_height (GtkLabel *self,
else
{
if (self->natural_wrap_mode == GTK_NATURAL_WRAP_WORD)
- pango_layout_set_wrap (layout, PANGO_WRAP_WORD);
+ pango2_layout_set_wrap (layout, PANGO2_WRAP_WORD);
*natural_width = my_pango_layout_get_width_for_height (layout, height, min, max);
}
/* then, do minimum width */
- if (self->ellipsize != PANGO_ELLIPSIZE_NONE)
+ if (self->ellipsize != PANGO2_ELLIPSIZE_NONE)
{
g_object_unref (layout);
layout = gtk_label_get_measuring_layout (self, NULL, MAX (minimum_default, 0));
- pango_lines_get_size (pango_layout_get_lines (layout), minimum_width, NULL);
+ pango2_lines_get_size (pango2_layout_get_lines (layout), minimum_width, NULL);
*minimum_width = MAX (*minimum_width, minimum_default);
}
else if (self->natural_wrap_mode == GTK_NATURAL_WRAP_INHERIT)
@@ -1262,7 +1262,7 @@ get_width_for_height (GtkLabel *self,
}
else
{
- pango_layout_set_wrap (layout, self->wrap_mode);
+ pango2_layout_set_wrap (layout, self->wrap_mode);
*minimum_width = my_pango_layout_get_width_for_height (layout, height, min, *natural_width);
}
}
@@ -1282,7 +1282,7 @@ gtk_label_measure (GtkWidget *widget,
GtkLabel *self = GTK_LABEL (widget);
if (for_size > 0)
- for_size *= PANGO_SCALE;
+ for_size *= PANGO2_SCALE;
if (!self->wrap)
get_static_size (self, orientation, minimum, natural, minimum_baseline, natural_baseline);
@@ -1291,12 +1291,12 @@ gtk_label_measure (GtkWidget *widget,
else
get_width_for_height (self, for_size, minimum, natural);
- *minimum = PANGO_PIXELS_CEIL (*minimum);
- *natural = PANGO_PIXELS_CEIL (*natural);
+ *minimum = PANGO2_PIXELS_CEIL (*minimum);
+ *natural = PANGO2_PIXELS_CEIL (*natural);
if (*minimum_baseline > 0)
- *minimum_baseline = PANGO_PIXELS_CEIL (*minimum_baseline);
+ *minimum_baseline = PANGO2_PIXELS_CEIL (*minimum_baseline);
if (*natural_baseline > 0)
- *natural_baseline = PANGO_PIXELS_CEIL (*natural_baseline);
+ *natural_baseline = PANGO2_PIXELS_CEIL (*natural_baseline);
}
static void
@@ -1307,7 +1307,7 @@ get_layout_location (GtkLabel *self,
GtkWidget *widget = GTK_WIDGET (self);
const int widget_width = gtk_widget_get_width (widget);
const int widget_height = gtk_widget_get_height (widget);
- PangoRectangle logical;
+ Pango2Rectangle logical;
float xalign;
int baseline;
int x, y;
@@ -1320,15 +1320,15 @@ get_layout_location (GtkLabel *self,
if (_gtk_widget_get_direction (widget) != GTK_TEXT_DIR_LTR)
xalign = 1.0 - xalign;
- pango_lines_get_extents (pango_layout_get_lines (self->layout), NULL, &logical);
- pango_extents_to_pixels (&logical, NULL);
+ pango2_lines_get_extents (pango2_layout_get_lines (self->layout), NULL, &logical);
+ pango2_extents_to_pixels (&logical, NULL);
x = floor ((xalign * (widget_width - logical.width)) - logical.x);
baseline = gtk_widget_get_allocated_baseline (widget);
if (baseline != -1)
{
- int layout_baseline = pango_lines_get_baseline (pango_layout_get_lines (self->layout)) / PANGO_SCALE;
+ int layout_baseline = pango2_lines_get_baseline (pango2_layout_get_lines (self->layout)) /
PANGO2_SCALE;
/* yalign is 0 because we can't support yalign while baseline aligning */
y = baseline - layout_baseline;
}
@@ -1352,9 +1352,9 @@ gtk_label_size_allocate (GtkWidget *widget,
if (self->layout)
{
if (self->ellipsize || self->wrap)
- pango_layout_set_width (self->layout, width * PANGO_SCALE);
+ pango2_layout_set_width (self->layout, width * PANGO2_SCALE);
else
- pango_layout_set_width (self->layout, -1);
+ pango2_layout_set_width (self->layout, -1);
}
if (self->popup_menu)
@@ -1433,7 +1433,7 @@ gtk_label_snapshot (GtkWidget *widget,
gtk_widget_has_focus (widget) &&
gtk_widget_is_drawable (widget))
{
- PangoDirection cursor_direction;
+ Pango2Direction cursor_direction;
cursor_direction = get_cursor_direction (self);
gtk_snapshot_render_insertion_cursor (snapshot, context,
@@ -1539,8 +1539,8 @@ gtk_label_finalize (GObject *object)
g_free (self->text);
g_clear_object (&self->layout);
- g_clear_pointer (&self->attrs, pango_attr_list_unref);
- g_clear_pointer (&self->markup_attrs, pango_attr_list_unref);
+ g_clear_pointer (&self->attrs, pango2_attr_list_unref);
+ g_clear_pointer (&self->markup_attrs, pango2_attr_list_unref);
if (self->select_info)
g_object_unref (self->select_info->provider);
@@ -1578,7 +1578,7 @@ range_is_in_ellipsis_full (GtkLabel *self,
int *ellipsis_start,
int *ellipsis_end)
{
- PangoLineIter *iter;
+ Pango2LineIter *iter;
gboolean in_ellipsis;
if (!self->ellipsize)
@@ -1586,41 +1586,41 @@ range_is_in_ellipsis_full (GtkLabel *self,
gtk_label_ensure_layout (self);
- if (!pango_lines_is_ellipsized (pango_layout_get_lines (self->layout)))
+ if (!pango2_lines_is_ellipsized (pango2_layout_get_lines (self->layout)))
return FALSE;
- iter = pango_layout_get_iter (self->layout);
+ iter = pango2_layout_get_iter (self->layout);
in_ellipsis = FALSE;
do {
- PangoRun *run;
+ Pango2Run *run;
- run = pango_line_iter_get_run (iter);
+ run = pango2_line_iter_get_run (iter);
if (run)
{
- PangoItem *item;
+ Pango2Item *item;
- item = pango_run_get_item (run);
+ item = pango2_run_get_item (run);
- if (pango_item_get_byte_offset (item) <= range_start && range_end <= pango_item_get_byte_offset
(item) + pango_item_get_byte_length (item))
+ if (pango2_item_get_byte_offset (item) <= range_start && range_end <= pango2_item_get_byte_offset
(item) + pango2_item_get_byte_length (item))
{
- if (pango_analysis_get_flags (pango_item_get_analysis (item)) & PANGO_ANALYSIS_FLAG_IS_ELLIPSIS)
+ if (pango2_analysis_get_flags (pango2_item_get_analysis (item)) &
PANGO2_ANALYSIS_FLAG_IS_ELLIPSIS)
{
if (ellipsis_start)
- *ellipsis_start = pango_item_get_byte_offset (item);
+ *ellipsis_start = pango2_item_get_byte_offset (item);
if (ellipsis_end)
- *ellipsis_end = pango_item_get_byte_offset (item) + pango_item_get_byte_length (item);
+ *ellipsis_end = pango2_item_get_byte_offset (item) + pango2_item_get_byte_length (item);
in_ellipsis = TRUE;
}
break;
}
- else if (pango_item_get_byte_offset (item) + pango_item_get_byte_length (item) >= range_end)
+ else if (pango2_item_get_byte_offset (item) + pango2_item_get_byte_length (item) >= range_end)
break;
}
- } while (pango_line_iter_next_run (iter));
+ } while (pango2_line_iter_next_run (iter));
- pango_line_iter_free (iter);
+ pango2_line_iter_free (iter);
return in_ellipsis;
}
@@ -1692,7 +1692,7 @@ get_layout_index (GtkLabel *self,
int trailing = 0;
const char *cluster;
const char *cluster_end;
- PangoLine *line;
+ Pango2Line *line;
int lx, ly;
*index = 0;
@@ -1704,10 +1704,10 @@ get_layout_index (GtkLabel *self,
x -= lx;
y -= ly;
- x *= PANGO_SCALE;
- y *= PANGO_SCALE;
+ x *= PANGO2_SCALE;
+ y *= PANGO2_SCALE;
- line = pango_lines_pos_to_index (pango_layout_get_lines (self->layout),
+ line = pango2_lines_pos_to_index (pango2_layout_get_lines (self->layout),
x, y,
index, &trailing);
@@ -2071,7 +2071,7 @@ gtk_label_root (GtkWidget *widget)
gtk_label_setup_mnemonic (self);
- /* The PangoContext is replaced when the display changes, so clear the layouts */
+ /* The Pango2Context is replaced when the display changes, so clear the layouts */
gtk_label_clear_layout (GTK_LABEL (widget));
}
@@ -2288,7 +2288,7 @@ gtk_label_class_init (GtkLabelClass *class)
*
* The contents of the label.
*
- * If the string contains Pango markup (see [func@Pango.parse_markup]),
+ * If the string contains Pango2 markup (see [func@Pango2.parse_markup]),
* you will have to set the [property@Gtk.Label:use-markup] property to
* %TRUE in order for the label to display the markup attributes. See also
* [method@Gtk.Label.set_markup] for a convenience function that sets both
@@ -2311,15 +2311,15 @@ gtk_label_class_init (GtkLabelClass *class)
*/
label_props[PROP_ATTRIBUTES] =
g_param_spec_boxed ("attributes", NULL, NULL,
- PANGO_TYPE_ATTR_LIST,
+ PANGO2_TYPE_ATTR_LIST,
GTK_PARAM_READWRITE);
/**
* GtkLabel:use-markup: (attributes org.gtk.Property.get=gtk_label_get_use_markup
org.gtk.Property.set=gtk_label_set_use_markup)
*
- * %TRUE if the text of the label includes Pango markup.
+ * %TRUE if the text of the label includes Pango2 markup.
*
- * See [func@Pango.parse_markup].
+ * See [func@Pango2.parse_markup].
*/
label_props[PROP_USE_MARKUP] =
g_param_spec_boolean ("use-markup", NULL, NULL,
@@ -2394,7 +2394,7 @@ gtk_label_class_init (GtkLabelClass *class)
* Controls how the line wrapping is done.
*
* This only affects the formatting if line wrapping is on (see the
- * [property@Gtk.Label:wrap] property). The default is %PANGO_WRAP_WORD,
+ * [property@Gtk.Label:wrap] property). The default is %PANGO2_WRAP_WORD,
* which means wrap on word boundaries.
*
* For sizing behavior, also consider the [property@Gtk.Label:natural-wrap-mode]
@@ -2402,8 +2402,8 @@ gtk_label_class_init (GtkLabelClass *class)
*/
label_props[PROP_WRAP_MODE] =
g_param_spec_enum ("wrap-mode", NULL, NULL,
- PANGO_TYPE_WRAP_MODE,
- PANGO_WRAP_WORD,
+ PANGO2_TYPE_WRAP_MODE,
+ PANGO2_WRAP_WORD,
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
/**
@@ -2463,7 +2463,7 @@ gtk_label_class_init (GtkLabelClass *class)
* not have enough room to display the entire string.
*
* Note that setting this property to a value other than
- * %PANGO_ELLIPSIZE_NONE has the side-effect that the label requests
+ * %PANGO2_ELLIPSIZE_NONE has the side-effect that the label requests
* only enough space to display the ellipsis "...". In particular, this
* means that ellipsizing labels do not work well in notebook tabs, unless
* the [property@Gtk.NotebookPage:tab-expand] child property is set to %TRUE.
@@ -2472,8 +2472,8 @@ gtk_label_class_init (GtkLabelClass *class)
*/
label_props[PROP_ELLIPSIZE] =
g_param_spec_enum ("ellipsize", NULL, NULL,
- PANGO_TYPE_ELLIPSIZE_MODE,
- PANGO_ELLIPSIZE_NONE,
+ PANGO2_TYPE_ELLIPSIZE_MODE,
+ PANGO2_ELLIPSIZE_NONE,
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
/**
@@ -3089,7 +3089,7 @@ gtk_label_recalculate (GtkLabel *self)
}
else
{
- g_clear_pointer (&self->markup_attrs, pango_attr_list_unref);
+ g_clear_pointer (&self->markup_attrs, pango2_attr_list_unref);
gtk_label_set_text_internal (self, g_strdup (self->label));
}
@@ -3147,7 +3147,7 @@ gtk_label_set_text (GtkLabel *self,
/**
* gtk_label_set_attributes: (attributes org.gtk.Method.set_property=attributes)
* @self: a `GtkLabel`
- * @attrs: (nullable): a [struct@Pango.AttrList]
+ * @attrs: (nullable): a [struct@Pango2.AttrList]
*
* Apply attributes to the label text.
*
@@ -3160,7 +3160,7 @@ gtk_label_set_text (GtkLabel *self,
*/
void
gtk_label_set_attributes (GtkLabel *self,
- PangoAttrList *attrs)
+ Pango2AttrList *attrs)
{
g_return_if_fail (GTK_IS_LABEL (self));
@@ -3168,10 +3168,10 @@ gtk_label_set_attributes (GtkLabel *self,
return;
if (attrs)
- pango_attr_list_ref (attrs);
+ pango2_attr_list_ref (attrs);
if (self->attrs)
- pango_attr_list_unref (self->attrs);
+ pango2_attr_list_unref (self->attrs);
self->attrs = attrs;
g_object_notify_by_pspec (G_OBJECT (self), label_props[PROP_ATTRIBUTES]);
@@ -3186,16 +3186,16 @@ gtk_label_set_attributes (GtkLabel *self,
*
* Gets the labels attribute list.
*
- * This is the [struct@Pango.AttrList] that was set on the label using
+ * This is the [struct@Pango2.AttrList] that was set on the label using
* [method@Gtk.Label.set_attributes], if any. This function does not
* reflect attributes that come from the labels markup (see
* [method@Gtk.Label.set_markup]). If you want to get the effective
* attributes for the label, use
- * `pango_layout_get_attribute (gtk_label_get_layout (self))`.
+ * `pango2_layout_get_attribute (gtk_label_get_layout (self))`.
*
* Returns: (nullable) (transfer none): the attribute list
*/
-PangoAttrList *
+Pango2AttrList *
gtk_label_get_attributes (GtkLabel *self)
{
g_return_val_if_fail (GTK_IS_LABEL (self), NULL);
@@ -3210,7 +3210,7 @@ gtk_label_get_attributes (GtkLabel *self)
*
* Sets the text of the label.
*
- * The label is interpreted as including embedded underlines and/or Pango
+ * The label is interpreted as including embedded underlines and/or Pango2
* markup depending on the values of the [property@Gtk.Label:use-underline]
* and [property@Gtk.Label:use-markup] properties.
*/
@@ -3235,7 +3235,7 @@ gtk_label_set_label (GtkLabel *self,
* Fetches the text from a label.
*
* The returned text includes any embedded underlines indicating
- * mnemonics and Pango markup. (See [method@Gtk.Label.get_text]).
+ * mnemonics and Pango2 markup. (See [method@Gtk.Label.get_text]).
*
* Returns: the text of the label widget. This string is
* owned by the widget and must not be modified or freed.
@@ -3622,7 +3622,7 @@ gtk_label_set_markup_internal (GtkLabel *self,
{
char *text = NULL;
GError *error = NULL;
- PangoAttrList *attrs = NULL;
+ Pango2AttrList *attrs = NULL;
char *str_for_display = NULL;
GtkLabelLink *links = NULL;
guint n_links = 0;
@@ -3650,7 +3650,7 @@ gtk_label_set_markup_internal (GtkLabel *self,
gtk_widget_add_css_class (GTK_WIDGET (self), "link");
}
- if (!pango_parse_markup (str_for_display, -1,
+ if (!pango2_parse_markup (str_for_display, -1,
with_uline && do_mnemonics ? '_' : 0,
&attrs, &text,
with_uline && do_mnemonics ? &accel_keyval : NULL,
@@ -3662,7 +3662,7 @@ gtk_label_set_markup_internal (GtkLabel *self,
if (text)
gtk_label_set_text_internal (self, text);
- g_clear_pointer (&self->markup_attrs, pango_attr_list_unref);
+ g_clear_pointer (&self->markup_attrs, pango2_attr_list_unref);
self->markup_attrs = attrs;
self->mnemonic_keyval = accel_keyval;
@@ -3683,8 +3683,8 @@ error_set:
*
* Sets the labels text and attributes from markup.
*
- * The string must be marked up with Pango markup
- * (see [func@Pango.parse_markup]).
+ * The string must be marked up with Pango2 markup
+ * (see [func@Pango2.parse_markup]).
*
* If the @str is external data, you may need to escape it
* with g_markup_escape_text() or g_markup_printf_escaped():
@@ -3736,7 +3736,7 @@ gtk_label_set_markup (GtkLabel *self,
*
* Sets the labels text, attributes and mnemonic from markup.
*
- * Parses @str which is marked up with Pango markup (see [func@Pango.parse_markup]),
+ * Parses @str which is marked up with Pango2 markup (see [func@Pango2.parse_markup]),
* setting the label’s text and attribute list based on the parse results.
* If characters in @str are preceded by an underscore, they are underlined
* indicating that they represent a keyboard accelerator called a mnemonic.
@@ -3771,7 +3771,7 @@ gtk_label_set_markup_with_mnemonic (GtkLabel *self,
* Fetches the text from a label.
*
* The returned text is as it appears on screen. This does not include
- * any embedded underlines indicating mnemonics or Pango markup. (See
+ * any embedded underlines indicating mnemonics or Pango2 markup. (See
* [method@Gtk.Label.get_label])
*
* Returns: the text in the label widget. This is the internal
@@ -3839,7 +3839,7 @@ gtk_label_get_justify (GtkLabel *self)
/**
* gtk_label_set_ellipsize: (attributes org.gtk.Method.set_property=ellipsize)
* @self: a `GtkLabel`
- * @mode: a `PangoEllipsizeMode`
+ * @mode: a `Pango2EllipsizeMode`
*
* Sets the mode used to ellipsizei the text.
*
@@ -3848,12 +3848,12 @@ gtk_label_get_justify (GtkLabel *self)
*/
void
gtk_label_set_ellipsize (GtkLabel *self,
- PangoEllipsizeMode mode)
+ Pango2EllipsizeMode mode)
{
g_return_if_fail (GTK_IS_LABEL (self));
- g_return_if_fail (mode >= PANGO_ELLIPSIZE_NONE && mode <= PANGO_ELLIPSIZE_END);
+ g_return_if_fail (mode >= PANGO2_ELLIPSIZE_NONE && mode <= PANGO2_ELLIPSIZE_END);
- if ((PangoEllipsizeMode) self->ellipsize != mode)
+ if ((Pango2EllipsizeMode) self->ellipsize != mode)
{
self->ellipsize = mode;
@@ -3873,12 +3873,12 @@ gtk_label_set_ellipsize (GtkLabel *self,
*
* See [method@Gtk.Label.set_ellipsize].
*
- * Returns: `PangoEllipsizeMode`
+ * Returns: `Pango2EllipsizeMode`
**/
-PangoEllipsizeMode
+Pango2EllipsizeMode
gtk_label_get_ellipsize (GtkLabel *self)
{
- g_return_val_if_fail (GTK_IS_LABEL (self), PANGO_ELLIPSIZE_NONE);
+ g_return_val_if_fail (GTK_IS_LABEL (self), PANGO2_ELLIPSIZE_NONE);
return self->ellipsize;
}
@@ -4023,7 +4023,7 @@ gtk_label_get_wrap (GtkLabel *self)
* Controls how line wrapping is done.
*
* This only affects the label if line wrapping is on. (See
- * [method@Gtk.Label.set_wrap]) The default is %PANGO_WRAP_WORD
+ * [method@Gtk.Label.set_wrap]) The default is %PANGO2_WRAP_WORD
* which means wrap on word boundaries.
*
* For sizing behavior, also consider the [property@Gtk.Label:natural-wrap-mode]
@@ -4031,7 +4031,7 @@ gtk_label_get_wrap (GtkLabel *self)
*/
void
gtk_label_set_wrap_mode (GtkLabel *self,
- PangoWrapMode wrap_mode)
+ Pango2WrapMode wrap_mode)
{
g_return_if_fail (GTK_IS_LABEL (self));
@@ -4054,10 +4054,10 @@ gtk_label_set_wrap_mode (GtkLabel *self,
*
* Returns: the line wrap mode
*/
-PangoWrapMode
+Pango2WrapMode
gtk_label_get_wrap_mode (GtkLabel *self)
{
- g_return_val_if_fail (GTK_IS_LABEL (self), PANGO_WRAP_WORD);
+ g_return_val_if_fail (GTK_IS_LABEL (self), PANGO2_WRAP_WORD);
return self->wrap_mode;
}
@@ -4118,7 +4118,7 @@ gtk_label_clear_layout (GtkLabel *self)
static void
gtk_label_ensure_layout (GtkLabel *self)
{
- PangoAlignment align;
+ Pango2Alignment align;
gboolean rtl;
if (self->layout)
@@ -4132,30 +4132,30 @@ gtk_label_ensure_layout (GtkLabel *self)
switch (self->jtype)
{
case GTK_JUSTIFY_LEFT:
- align = rtl ? PANGO_ALIGN_RIGHT : PANGO_ALIGN_LEFT;
+ align = rtl ? PANGO2_ALIGN_RIGHT : PANGO2_ALIGN_LEFT;
break;
case GTK_JUSTIFY_RIGHT:
- align = rtl ? PANGO_ALIGN_LEFT : PANGO_ALIGN_RIGHT;
+ align = rtl ? PANGO2_ALIGN_LEFT : PANGO2_ALIGN_RIGHT;
break;
case GTK_JUSTIFY_CENTER:
- align = PANGO_ALIGN_CENTER;
+ align = PANGO2_ALIGN_CENTER;
break;
case GTK_JUSTIFY_FILL:
- align = PANGO_ALIGN_JUSTIFY;
+ align = PANGO2_ALIGN_JUSTIFY;
break;
default:
g_assert_not_reached();
}
- pango_layout_set_alignment (self->layout, align);
- pango_layout_set_ellipsize (self->layout, self->ellipsize);
- pango_layout_set_wrap (self->layout, self->wrap_mode);
- pango_layout_set_single_paragraph (self->layout, self->single_line_mode);
+ pango2_layout_set_alignment (self->layout, align);
+ pango2_layout_set_ellipsize (self->layout, self->ellipsize);
+ pango2_layout_set_wrap (self->layout, self->wrap_mode);
+ pango2_layout_set_single_paragraph (self->layout, self->single_line_mode);
if (self->lines > 0)
- pango_layout_set_height (self->layout, - self->lines);
+ pango2_layout_set_height (self->layout, - self->lines);
if (self->ellipsize || self->wrap)
- pango_layout_set_width (self->layout, gtk_widget_get_width (GTK_WIDGET (self)) * PANGO_SCALE);
+ pango2_layout_set_width (self->layout, gtk_widget_get_width (GTK_WIDGET (self)) * PANGO2_SCALE);
}
/**
@@ -4201,12 +4201,12 @@ gtk_label_move_forward_word (GtkLabel *self,
length = g_utf8_strlen (self->text, -1);
if (new_pos < length)
{
- const PangoLogAttr *log_attrs;
+ const Pango2LogAttr *log_attrs;
int n_attrs;
gtk_label_ensure_layout (self);
- log_attrs = pango_layout_get_log_attrs (self->layout, &n_attrs);
+ log_attrs = pango2_layout_get_log_attrs (self->layout, &n_attrs);
/* Find the next word end */
new_pos++;
@@ -4225,12 +4225,12 @@ gtk_label_move_backward_word (GtkLabel *self,
if (new_pos > 0)
{
- const PangoLogAttr *log_attrs;
+ const Pango2LogAttr *log_attrs;
int n_attrs;
gtk_label_ensure_layout (self);
- log_attrs = pango_layout_get_log_attrs (self->layout, &n_attrs);
+ log_attrs = pango2_layout_get_log_attrs (self->layout, &n_attrs);
new_pos -= 1;
@@ -5143,7 +5143,7 @@ gtk_label_get_selection_bounds (GtkLabel *self,
* gtk_label_get_layout:
* @self: a `GtkLabel`
*
- * Gets the `PangoLayout` used to display the label.
+ * Gets the `Pango2Layout` used to display the label.
*
* The layout is useful to e.g. convert text positions to pixel
* positions, in combination with [method@Gtk.Label.get_layout_offsets].
@@ -5151,9 +5151,9 @@ gtk_label_get_selection_bounds (GtkLabel *self,
* freed by the caller. The @label is free to recreate its layout
* at any time, so it should be considered read-only.
*
- * Returns: (transfer none): the [class@Pango.Layout] for this label
+ * Returns: (transfer none): the [class@Pango2.Layout] for this label
*/
-PangoLayout*
+Pango2Layout*
gtk_label_get_layout (GtkLabel *self)
{
g_return_val_if_fail (GTK_IS_LABEL (self), NULL);
@@ -5169,13 +5169,13 @@ gtk_label_get_layout (GtkLabel *self)
* @x: (out) (optional): location to store X offset of layout
* @y: (out) (optional): location to store Y offset of layout
*
- * Obtains the coordinates where the label will draw its `PangoLayout`.
+ * Obtains the coordinates where the label will draw its `Pango2Layout`.
*
* The coordinates are useful to convert mouse events into coordinates
- * inside the [class@Pango.Layout], e.g. to take some action if some part
- * of the label is clicked. Remember when using the [class@Pango.Layout]
- * functions you need to convert to and from pixels using PANGO_PIXELS()
- * or [const@Pango.SCALE].
+ * inside the [class@Pango2.Layout], e.g. to take some action if some part
+ * of the label is clicked. Remember when using the [class@Pango2.Layout]
+ * functions you need to convert to and from pixels using PANGO2_PIXELS()
+ * or [const@Pango2.SCALE].
*/
void
gtk_label_get_layout_offsets (GtkLabel *self,
@@ -5222,7 +5222,7 @@ gtk_label_set_use_markup (GtkLabel *self,
* gtk_label_get_use_markup: (attributes org.gtk.Method.get_property=use-markup)
* @self: a `GtkLabel`
*
- * Returns whether the label’s text is interpreted as Pango markup.
+ * Returns whether the label’s text is interpreted as Pango2 markup.
*
* See [method@Gtk.Label.set_use_markup].
*
@@ -5331,10 +5331,10 @@ get_better_cursor (GtkLabel *self,
{
GdkSeat *seat;
GdkDevice *keyboard;
- PangoDirection keymap_direction;
- PangoDirection cursor_direction;
+ Pango2Direction keymap_direction;
+ Pango2Direction cursor_direction;
gboolean split_cursor;
- PangoRectangle strong_pos, weak_pos;
+ Pango2Rectangle strong_pos, weak_pos;
seat = gdk_display_get_default_seat (gtk_widget_get_display (GTK_WIDGET (self)));
if (seat)
@@ -5344,7 +5344,7 @@ get_better_cursor (GtkLabel *self,
if (keyboard)
keymap_direction = gdk_device_get_direction (keyboard);
else
- keymap_direction = PANGO_DIRECTION_LTR;
+ keymap_direction = PANGO2_DIRECTION_LTR;
cursor_direction = get_cursor_direction (self);
@@ -5354,25 +5354,25 @@ get_better_cursor (GtkLabel *self,
gtk_label_ensure_layout (self);
- pango_lines_get_cursor_pos (pango_layout_get_lines (self->layout), NULL, index,
+ pango2_lines_get_cursor_pos (pango2_layout_get_lines (self->layout), NULL, index,
&strong_pos, &weak_pos);
if (split_cursor)
{
- *x = strong_pos.x / PANGO_SCALE;
- *y = strong_pos.y / PANGO_SCALE;
+ *x = strong_pos.x / PANGO2_SCALE;
+ *y = strong_pos.y / PANGO2_SCALE;
}
else
{
if (keymap_direction == cursor_direction)
{
- *x = strong_pos.x / PANGO_SCALE;
- *y = strong_pos.y / PANGO_SCALE;
+ *x = strong_pos.x / PANGO2_SCALE;
+ *y = strong_pos.y / PANGO2_SCALE;
}
else
{
- *x = weak_pos.x / PANGO_SCALE;
- *y = weak_pos.y / PANGO_SCALE;
+ *x = weak_pos.x / PANGO2_SCALE;
+ *y = weak_pos.y / PANGO2_SCALE;
}
}
}
@@ -5387,7 +5387,7 @@ gtk_label_move_logically (GtkLabel *self,
if (self->text)
{
- const PangoLogAttr *log_attrs;
+ const Pango2LogAttr *log_attrs;
int n_attrs;
int length;
@@ -5395,7 +5395,7 @@ gtk_label_move_logically (GtkLabel *self,
length = g_utf8_strlen (self->text, -1);
- log_attrs = pango_layout_get_log_attrs (self->layout, &n_attrs);
+ log_attrs = pango2_layout_get_log_attrs (self->layout, &n_attrs);
while (count > 0 && offset < length)
{
@@ -5445,7 +5445,7 @@ gtk_label_move_visually (GtkLabel *self,
{
GdkSeat *seat;
GdkDevice *keyboard;
- PangoDirection keymap_direction;
+ Pango2Direction keymap_direction;
seat = gdk_display_get_default_seat (gtk_widget_get_display (GTK_WIDGET (self)));
if (seat)
@@ -5455,20 +5455,20 @@ gtk_label_move_visually (GtkLabel *self,
if (keyboard)
keymap_direction = gdk_device_get_direction (keyboard);
else
- keymap_direction = PANGO_DIRECTION_LTR;
+ keymap_direction = PANGO2_DIRECTION_LTR;
strong = keymap_direction == get_cursor_direction (self);
}
if (count > 0)
{
- pango_lines_move_cursor (pango_layout_get_lines (self->layout), strong,
+ pango2_lines_move_cursor (pango2_layout_get_lines (self->layout), strong,
NULL, index, 0, 1, NULL, &new_index, &new_trailing);
count--;
}
else
{
- pango_lines_move_cursor (pango_layout_get_lines (self->layout), strong,
+ pango2_lines_move_cursor (pango2_layout_get_lines (self->layout), strong,
NULL, index, 0, -1, NULL, &new_index, &new_trailing);
count++;
}
diff --git a/gtk/gtklabel.h b/gtk/gtklabel.h
index 4a42a4ba32..412125d285 100644
--- a/gtk/gtklabel.h
+++ b/gtk/gtklabel.h
@@ -52,9 +52,9 @@ GDK_AVAILABLE_IN_ALL
const char * gtk_label_get_text (GtkLabel *self);
GDK_AVAILABLE_IN_ALL
void gtk_label_set_attributes (GtkLabel *self,
- PangoAttrList *attrs);
+ Pango2AttrList *attrs);
GDK_AVAILABLE_IN_ALL
-PangoAttrList *gtk_label_get_attributes (GtkLabel *self);
+Pango2AttrList *gtk_label_get_attributes (GtkLabel *self);
GDK_AVAILABLE_IN_ALL
void gtk_label_set_label (GtkLabel *self,
const char *str);
@@ -94,9 +94,9 @@ GDK_AVAILABLE_IN_ALL
GtkJustification gtk_label_get_justify (GtkLabel *self);
GDK_AVAILABLE_IN_ALL
void gtk_label_set_ellipsize (GtkLabel *self,
- PangoEllipsizeMode mode);
+ Pango2EllipsizeMode mode);
GDK_AVAILABLE_IN_ALL
-PangoEllipsizeMode gtk_label_get_ellipsize (GtkLabel *self);
+Pango2EllipsizeMode gtk_label_get_ellipsize (GtkLabel *self);
GDK_AVAILABLE_IN_ALL
void gtk_label_set_width_chars (GtkLabel *self,
int n_chars);
@@ -119,9 +119,9 @@ GDK_AVAILABLE_IN_ALL
gboolean gtk_label_get_wrap (GtkLabel *self);
GDK_AVAILABLE_IN_ALL
void gtk_label_set_wrap_mode (GtkLabel *self,
- PangoWrapMode wrap_mode);
+ Pango2WrapMode wrap_mode);
GDK_AVAILABLE_IN_ALL
-PangoWrapMode gtk_label_get_wrap_mode (GtkLabel *self);
+Pango2WrapMode gtk_label_get_wrap_mode (GtkLabel *self);
GDK_AVAILABLE_IN_4_6
void gtk_label_set_natural_wrap_mode (GtkLabel *self,
GtkNaturalWrapMode wrap_mode);
@@ -142,7 +142,7 @@ gboolean gtk_label_get_selection_bounds (GtkLabel *self,
int *end);
GDK_AVAILABLE_IN_ALL
-PangoLayout *gtk_label_get_layout (GtkLabel *self);
+Pango2Layout *gtk_label_get_layout (GtkLabel *self);
GDK_AVAILABLE_IN_ALL
void gtk_label_get_layout_offsets (GtkLabel *self,
int *x,
diff --git a/gtk/gtkmain.c b/gtk/gtkmain.c
index f76f384bb2..01df9ecdc0 100644
--- a/gtk/gtkmain.c
+++ b/gtk/gtkmain.c
@@ -794,7 +794,7 @@ gtk_get_locale_direction (void)
/**
* gtk_get_default_language:
*
- * Returns the `PangoLanguage` for the default language
+ * Returns the `Pango2Language` for the default language
* currently in effect.
*
* Note that this can change over the life of an
@@ -805,16 +805,16 @@ gtk_get_locale_direction (void)
* the right-to-left or left-to-right text direction.
*
* This function is equivalent to
- * [func@Pango.Language.get_default].
+ * [func@Pango2.Language.get_default].
* See that function for details.
*
* Returns: (transfer none): the default language as a
- * `PangoLanguage`
+ * `Pango2Language`
*/
-PangoLanguage *
+Pango2Language *
gtk_get_default_language (void)
{
- return pango_language_get_default ();
+ return pango2_language_get_default ();
}
typedef struct {
diff --git a/gtk/gtkmain.h b/gtk/gtkmain.h
index 876422fc48..ccabb4c483 100644
--- a/gtk/gtkmain.h
+++ b/gtk/gtkmain.h
@@ -84,7 +84,7 @@ gboolean gtk_init_check_abi_check (int num_checks,
GDK_AVAILABLE_IN_ALL
void gtk_disable_setlocale (void);
GDK_AVAILABLE_IN_ALL
-PangoLanguage * gtk_get_default_language (void) G_GNUC_CONST;
+Pango2Language * gtk_get_default_language (void) G_GNUC_CONST;
GDK_AVAILABLE_IN_ALL
GtkTextDirection gtk_get_locale_direction (void);
diff --git a/gtk/gtkmountoperation.c b/gtk/gtkmountoperation.c
index 2d14523e63..3d08ccf7f3 100644
--- a/gtk/gtkmountoperation.c
+++ b/gtk/gtkmountoperation.c
@@ -1582,7 +1582,7 @@ create_show_processes_dialog (GtkMountOperation *op,
NULL);
renderer = gtk_cell_renderer_text_new ();
g_object_set (renderer,
- "ellipsize", PANGO_ELLIPSIZE_MIDDLE,
+ "ellipsize", PANGO2_ELLIPSIZE_MIDDLE,
"ellipsize-set", TRUE,
NULL);
gtk_tree_view_column_pack_start (column, renderer, TRUE);
diff --git a/gtk/gtkpango.c b/gtk/gtkpango.c
index 5e6cbeb875..0495e6377d 100644
--- a/gtk/gtkpango.c
+++ b/gtk/gtkpango.c
@@ -24,56 +24,56 @@
#include "config.h"
#include "gtkpango.h"
-#include <pango/pangocairo.h>
+#include <pango2/pangocairo.h>
#include "gtkintl.h"
#include "gtkbuilderprivate.h"
static gboolean
-attr_list_merge_filter (PangoAttribute *attribute,
+attr_list_merge_filter (Pango2Attribute *attribute,
gpointer list)
{
- pango_attr_list_change (list, pango_attribute_copy (attribute));
+ pango2_attr_list_change (list, pango2_attribute_copy (attribute));
return FALSE;
}
/*
- * _gtk_pango_attr_list_merge:
- * @into: (nullable): a `PangoAttrList` where attributes are merged
- * @from: (nullable): a `PangoAttrList` with the attributes to merge
+ * _gtk_pango2_attr_list_merge:
+ * @into: (nullable): a `Pango2AttrList` where attributes are merged
+ * @from: (nullable): a `Pango2AttrList` with the attributes to merge
*
* Merges attributes from @from into @into.
*
* Returns: the merged list.
*/
-PangoAttrList *
-_gtk_pango_attr_list_merge (PangoAttrList *into,
- PangoAttrList *from)
+Pango2AttrList *
+_gtk_pango_attr_list_merge (Pango2AttrList *into,
+ Pango2AttrList *from)
{
if (from)
{
if (into)
- pango_attr_list_filter (from, attr_list_merge_filter, into);
+ pango2_attr_list_filter (from, attr_list_merge_filter, into);
else
- return pango_attr_list_ref (from);
+ return pango2_attr_list_ref (from);
}
return into;
}
-static PangoAttribute *
+static Pango2Attribute *
attribute_from_text (GtkBuilder *builder,
const char *name,
const char *value,
GError **error)
{
- PangoAttribute *attribute = NULL;
- PangoAttrType type;
- PangoLanguage *language;
- PangoFontDescription *font_desc;
+ Pango2Attribute *attribute = NULL;
+ Pango2AttrType type;
+ Pango2Language *language;
+ Pango2FontDescription *font_desc;
GdkRGBA *color;
GValue val = G_VALUE_INIT;
- if (!gtk_builder_value_from_string_type (builder, PANGO_TYPE_ATTR_TYPE, name, &val, error))
+ if (!gtk_builder_value_from_string_type (builder, PANGO2_TYPE_ATTR_TYPE, name, &val, error))
return NULL;
type = g_value_get_enum (&val);
@@ -81,199 +81,202 @@ attribute_from_text (GtkBuilder *builder,
switch (type)
{
- case PANGO_ATTR_LANGUAGE:
- if ((language = pango_language_from_string (value)))
+ case PANGO2_ATTR_LANGUAGE:
+ if ((language = pango2_language_from_string (value)))
{
- attribute = pango_attr_language_new (language);
+ attribute = pango2_attr_language_new (language);
g_value_init (&val, G_TYPE_INT);
}
break;
- case PANGO_ATTR_STYLE:
- if (gtk_builder_value_from_string_type (builder, PANGO_TYPE_STYLE, value, &val, error))
- attribute = pango_attr_style_new (g_value_get_enum (&val));
+ case PANGO2_ATTR_STYLE:
+ if (gtk_builder_value_from_string_type (builder, PANGO2_TYPE_STYLE, value, &val, error))
+ attribute = pango2_attr_style_new (g_value_get_enum (&val));
break;
- case PANGO_ATTR_WEIGHT:
- if (gtk_builder_value_from_string_type (builder, PANGO_TYPE_WEIGHT, value, &val, error))
- attribute = pango_attr_weight_new (g_value_get_enum (&val));
+ case PANGO2_ATTR_WEIGHT:
+ if (gtk_builder_value_from_string_type (builder, PANGO2_TYPE_WEIGHT, value, &val, error))
+ attribute = pango2_attr_weight_new (g_value_get_enum (&val));
break;
- case PANGO_ATTR_VARIANT:
- if (gtk_builder_value_from_string_type (builder, PANGO_TYPE_VARIANT, value, &val, error))
- attribute = pango_attr_variant_new (g_value_get_enum (&val));
+ case PANGO2_ATTR_VARIANT:
+ if (gtk_builder_value_from_string_type (builder, PANGO2_TYPE_VARIANT, value, &val, error))
+ attribute = pango2_attr_variant_new (g_value_get_enum (&val));
break;
- case PANGO_ATTR_STRETCH:
- if (gtk_builder_value_from_string_type (builder, PANGO_TYPE_STRETCH, value, &val, error))
- attribute = pango_attr_stretch_new (g_value_get_enum (&val));
+ case PANGO2_ATTR_STRETCH:
+ if (gtk_builder_value_from_string_type (builder, PANGO2_TYPE_STRETCH, value, &val, error))
+ attribute = pango2_attr_stretch_new (g_value_get_enum (&val));
break;
- case PANGO_ATTR_UNDERLINE:
- if (gtk_builder_value_from_string_type (builder, PANGO_TYPE_LINE_STYLE, value, &val, NULL))
- attribute = pango_attr_underline_new (g_value_get_enum (&val));
+ case PANGO2_ATTR_UNDERLINE:
+ if (gtk_builder_value_from_string_type (builder, PANGO2_TYPE_LINE_STYLE, value, &val, NULL))
+ attribute = pango2_attr_underline_new (g_value_get_enum (&val));
break;
- case PANGO_ATTR_UNDERLINE_POSITION:
- if (gtk_builder_value_from_string_type (builder, PANGO_TYPE_UNDERLINE_POSITION, value, &val, NULL))
- attribute = pango_attr_underline_position_new (g_value_get_enum (&val));
+ case PANGO2_ATTR_UNDERLINE_POSITION:
+ if (gtk_builder_value_from_string_type (builder, PANGO2_TYPE_UNDERLINE_POSITION, value, &val, NULL))
+ attribute = pango2_attr_underline_position_new (g_value_get_enum (&val));
break;
- case PANGO_ATTR_STRIKETHROUGH:
- if (gtk_builder_value_from_string_type (builder, PANGO_TYPE_LINE_STYLE, value, &val, NULL))
- attribute = pango_attr_strikethrough_new (g_value_get_enum (&val));
+ case PANGO2_ATTR_STRIKETHROUGH:
+ if (gtk_builder_value_from_string_type (builder, PANGO2_TYPE_LINE_STYLE, value, &val, NULL))
+ attribute = pango2_attr_strikethrough_new (g_value_get_enum (&val));
break;
- case PANGO_ATTR_GRAVITY:
- if (gtk_builder_value_from_string_type (builder, PANGO_TYPE_GRAVITY, value, &val, error))
- attribute = pango_attr_gravity_new (g_value_get_enum (&val));
+ case PANGO2_ATTR_GRAVITY:
+ if (gtk_builder_value_from_string_type (builder, PANGO2_TYPE_GRAVITY, value, &val, error))
+ attribute = pango2_attr_gravity_new (g_value_get_enum (&val));
break;
- case PANGO_ATTR_GRAVITY_HINT:
- if (gtk_builder_value_from_string_type (builder, PANGO_TYPE_GRAVITY_HINT, value, &val, error))
- attribute = pango_attr_gravity_hint_new (g_value_get_enum (&val));
+ case PANGO2_ATTR_GRAVITY_HINT:
+ if (gtk_builder_value_from_string_type (builder, PANGO2_TYPE_GRAVITY_HINT, value, &val, error))
+ attribute = pango2_attr_gravity_hint_new (g_value_get_enum (&val));
break;
- case PANGO_ATTR_FAMILY:
- attribute = pango_attr_family_new (value);
+ case PANGO2_ATTR_FAMILY:
+ attribute = pango2_attr_family_new (value);
g_value_init (&val, G_TYPE_INT);
break;
- case PANGO_ATTR_SIZE:
+ case PANGO2_ATTR_SIZE:
if (gtk_builder_value_from_string_type (builder, G_TYPE_INT, value, &val, error))
- attribute = pango_attr_size_new (g_value_get_int (&val));
+ attribute = pango2_attr_size_new (g_value_get_int (&val));
break;
- case PANGO_ATTR_ABSOLUTE_SIZE:
+ case PANGO2_ATTR_ABSOLUTE_SIZE:
if (gtk_builder_value_from_string_type (builder, G_TYPE_INT, value, &val, error))
- attribute = pango_attr_size_new_absolute (g_value_get_int (&val));
+ attribute = pango2_attr_size_new_absolute (g_value_get_int (&val));
break;
- case PANGO_ATTR_FONT_DESC:
- if ((font_desc = pango_font_description_from_string (value)))
+ case PANGO2_ATTR_FONT_DESC:
+ if ((font_desc = pango2_font_description_from_string (value)))
{
- attribute = pango_attr_font_desc_new (font_desc);
- pango_font_description_free (font_desc);
+ attribute = pango2_attr_font_desc_new (font_desc);
+ pango2_font_description_free (font_desc);
g_value_init (&val, G_TYPE_INT);
}
break;
- case PANGO_ATTR_FOREGROUND:
+ case PANGO2_ATTR_FOREGROUND:
if (gtk_builder_value_from_string_type (builder, GDK_TYPE_RGBA, value, &val, error))
{
color = g_value_get_boxed (&val);
- attribute = pango_attr_foreground_new (&(PangoColor){color->red * 65535,
+ attribute = pango2_attr_foreground_new (&(Pango2Color){color->red * 65535,
color->green * 65535,
color->blue * 65535,
color->alpha * 65535});
}
break;
- case PANGO_ATTR_BACKGROUND:
+ case PANGO2_ATTR_BACKGROUND:
if (gtk_builder_value_from_string_type (builder, GDK_TYPE_RGBA, value, &val, error))
{
color = g_value_get_boxed (&val);
- attribute = pango_attr_background_new (&(PangoColor){color->red * 65535,
+ attribute = pango2_attr_background_new (&(Pango2Color){color->red * 65535,
color->green * 65535,
color->blue * 65535,
color->alpha * 65535});
}
break;
- case PANGO_ATTR_UNDERLINE_COLOR:
+ case PANGO2_ATTR_UNDERLINE_COLOR:
if (gtk_builder_value_from_string_type (builder, GDK_TYPE_RGBA, value, &val, error))
{
color = g_value_get_boxed (&val);
- attribute = pango_attr_underline_color_new (&(PangoColor){color->red * 65535,
+ attribute = pango2_attr_underline_color_new (&(Pango2Color){color->red * 65535,
color->green * 65535,
color->blue * 65535,
color->alpha * 65535});
}
break;
- case PANGO_ATTR_STRIKETHROUGH_COLOR:
+ case PANGO2_ATTR_STRIKETHROUGH_COLOR:
if (gtk_builder_value_from_string_type (builder, GDK_TYPE_RGBA, value, &val, error))
{
color = g_value_get_boxed (&val);
- attribute = pango_attr_strikethrough_color_new (&(PangoColor){color->red * 65535,
+ attribute = pango2_attr_strikethrough_color_new (&(Pango2Color){color->red * 65535,
color->green * 65535,
color->blue * 65535,
color->alpha * 65535});
}
break;
- /* PangoAttrFloat */
- case PANGO_ATTR_SCALE:
+ /* Pango2AttrFloat */
+ case PANGO2_ATTR_SCALE:
if (gtk_builder_value_from_string_type (builder, G_TYPE_DOUBLE, value, &val, error))
- attribute = pango_attr_scale_new (g_value_get_double (&val));
+ attribute = pango2_attr_scale_new (g_value_get_double (&val));
break;
- case PANGO_ATTR_LETTER_SPACING:
+ case PANGO2_ATTR_LETTER_SPACING:
if (gtk_builder_value_from_string_type (builder, G_TYPE_INT, value, &val, error))
- attribute = pango_attr_letter_spacing_new (g_value_get_int (&val));
+ attribute = pango2_attr_letter_spacing_new (g_value_get_int (&val));
break;
- case PANGO_ATTR_RISE:
+ case PANGO2_ATTR_RISE:
if (gtk_builder_value_from_string_type (builder, G_TYPE_INT, value, &val, error))
- attribute = pango_attr_rise_new (g_value_get_int (&val));
+ attribute = pango2_attr_rise_new (g_value_get_int (&val));
break;
- case PANGO_ATTR_FALLBACK:
+ case PANGO2_ATTR_FALLBACK:
if (gtk_builder_value_from_string_type (builder, G_TYPE_BOOLEAN, value, &val, error))
- attribute = pango_attr_fallback_new (g_value_get_boolean (&val));
+ attribute = pango2_attr_fallback_new (g_value_get_boolean (&val));
break;
- case PANGO_ATTR_FONT_FEATURES:
- attribute = pango_attr_font_features_new (value);
+ case PANGO2_ATTR_FONT_FEATURES:
+ attribute = pango2_attr_font_features_new (value);
break;
- case PANGO_ATTR_ALLOW_BREAKS:
+ case PANGO2_ATTR_PALETTE:
+ attribute = pango2_attr_palette_new (value);
+ break;
+ case PANGO2_ATTR_ALLOW_BREAKS:
if (gtk_builder_value_from_string_type (builder, G_TYPE_BOOLEAN, value, &val, error))
- attribute = pango_attr_allow_breaks_new (g_value_get_boolean (&val));
+ attribute = pango2_attr_allow_breaks_new (g_value_get_boolean (&val));
break;
- case PANGO_ATTR_SHOW:
- if (gtk_builder_value_from_string_type (builder, PANGO_TYPE_SHOW_FLAGS, value, &val, error))
- attribute = pango_attr_show_new (g_value_get_flags (&val));
+ case PANGO2_ATTR_SHOW:
+ if (gtk_builder_value_from_string_type (builder, PANGO2_TYPE_SHOW_FLAGS, value, &val, error))
+ attribute = pango2_attr_show_new (g_value_get_flags (&val));
break;
- case PANGO_ATTR_INSERT_HYPHENS:
+ case PANGO2_ATTR_INSERT_HYPHENS:
if (gtk_builder_value_from_string_type (builder, G_TYPE_BOOLEAN, value, &val, error))
- attribute = pango_attr_insert_hyphens_new (g_value_get_boolean (&val));
+ attribute = pango2_attr_insert_hyphens_new (g_value_get_boolean (&val));
break;
- case PANGO_ATTR_OVERLINE:
- if (gtk_builder_value_from_string_type (builder, PANGO_TYPE_LINE_STYLE, value, &val, NULL))
- attribute = pango_attr_overline_new (g_value_get_enum (&val));
+ case PANGO2_ATTR_OVERLINE:
+ if (gtk_builder_value_from_string_type (builder, PANGO2_TYPE_LINE_STYLE, value, &val, NULL))
+ attribute = pango2_attr_overline_new (g_value_get_enum (&val));
break;
- case PANGO_ATTR_OVERLINE_COLOR:
+ case PANGO2_ATTR_OVERLINE_COLOR:
if (gtk_builder_value_from_string_type (builder, GDK_TYPE_RGBA, value, &val, error))
{
color = g_value_get_boxed (&val);
- attribute = pango_attr_overline_color_new (&(PangoColor){color->red * 65535,
+ attribute = pango2_attr_overline_color_new (&(Pango2Color){color->red * 65535,
color->green * 65535,
color->blue * 65535,
color->alpha * 65535});
}
break;
- case PANGO_ATTR_LINE_HEIGHT:
+ case PANGO2_ATTR_LINE_HEIGHT:
if (gtk_builder_value_from_string_type (builder, G_TYPE_DOUBLE, value, &val, error))
- attribute = pango_attr_line_height_new (g_value_get_double (&val));
+ attribute = pango2_attr_line_height_new (g_value_get_double (&val));
break;
- case PANGO_ATTR_ABSOLUTE_LINE_HEIGHT:
+ case PANGO2_ATTR_ABSOLUTE_LINE_HEIGHT:
if (gtk_builder_value_from_string_type (builder, G_TYPE_INT, value, &val, error))
- attribute = pango_attr_line_height_new_absolute (g_value_get_int (&val) * PANGO_SCALE);
+ attribute = pango2_attr_line_height_new_absolute (g_value_get_int (&val) * PANGO2_SCALE);
break;
- case PANGO_ATTR_LINE_SPACING:
+ case PANGO2_ATTR_LINE_SPACING:
if (gtk_builder_value_from_string_type (builder, G_TYPE_INT, value, &val, error))
- attribute = pango_attr_line_spacing_new (g_value_get_int (&val) * PANGO_SCALE);
+ attribute = pango2_attr_line_spacing_new (g_value_get_int (&val) * PANGO2_SCALE);
break;
- case PANGO_ATTR_TEXT_TRANSFORM:
- if (gtk_builder_value_from_string_type (builder, PANGO_TYPE_TEXT_TRANSFORM, value, &val, error))
- attribute = pango_attr_text_transform_new (g_value_get_enum (&val));
+ case PANGO2_ATTR_TEXT_TRANSFORM:
+ if (gtk_builder_value_from_string_type (builder, PANGO2_TYPE_TEXT_TRANSFORM, value, &val, error))
+ attribute = pango2_attr_text_transform_new (g_value_get_enum (&val));
break;
- case PANGO_ATTR_WORD:
- attribute = pango_attr_word_new ();
+ case PANGO2_ATTR_WORD:
+ attribute = pango2_attr_word_new ();
break;
- case PANGO_ATTR_SENTENCE:
- attribute = pango_attr_sentence_new ();
+ case PANGO2_ATTR_SENTENCE:
+ attribute = pango2_attr_sentence_new ();
break;
- case PANGO_ATTR_PARAGRAPH:
- attribute = pango_attr_paragraph_new ();
+ case PANGO2_ATTR_PARAGRAPH:
+ attribute = pango2_attr_paragraph_new ();
break;
- case PANGO_ATTR_BASELINE_SHIFT:
- if (gtk_builder_value_from_string_type (builder, PANGO_TYPE_BASELINE_SHIFT, value, &val, NULL))
- attribute = pango_attr_baseline_shift_new (g_value_get_enum (&val));
+ case PANGO2_ATTR_BASELINE_SHIFT:
+ if (gtk_builder_value_from_string_type (builder, PANGO2_TYPE_BASELINE_SHIFT, value, &val, NULL))
+ attribute = pango2_attr_baseline_shift_new (g_value_get_enum (&val));
else if (gtk_builder_value_from_string_type (builder, G_TYPE_INT, value, &val, NULL))
- attribute = pango_attr_baseline_shift_new (g_value_get_enum (&val));
+ attribute = pango2_attr_baseline_shift_new (g_value_get_enum (&val));
else
g_set_error (error,
GTK_BUILDER_ERROR,
GTK_BUILDER_ERROR_INVALID_VALUE,
"Could not parse '%s' as baseline shift value", value);
break;
- case PANGO_ATTR_FONT_SCALE:
- if (gtk_builder_value_from_string_type (builder, PANGO_TYPE_FONT_SCALE, value, &val, error))
- attribute = pango_attr_font_scale_new (g_value_get_enum (&val));
+ case PANGO2_ATTR_FONT_SCALE:
+ if (gtk_builder_value_from_string_type (builder, PANGO2_TYPE_FONT_SCALE, value, &val, error))
+ attribute = pango2_attr_font_scale_new (g_value_get_enum (&val));
break;
- case PANGO_ATTR_INVALID:
- case PANGO_ATTR_SHAPE:
+ case PANGO2_ATTR_INVALID:
+ case PANGO2_ATTR_SHAPE:
default:
break;
}
@@ -295,7 +298,7 @@ gtk_pango_attribute_start_element (GtkBuildableParseContext *context,
if (strcmp (element_name, "attribute") == 0)
{
- PangoAttribute *attr = NULL;
+ Pango2Attribute *attr = NULL;
const char *name = NULL;
const char *value = NULL;
const char *start = NULL;
@@ -347,12 +350,12 @@ gtk_pango_attribute_start_element (GtkBuildableParseContext *context,
return;
}
- pango_attribute_set_range (attr, start_val, end_val);
+ pango2_attribute_set_range (attr, start_val, end_val);
if (!data->attrs)
- data->attrs = pango_attr_list_new ();
+ data->attrs = pango2_attr_list_new ();
- pango_attr_list_insert (data->attrs, attr);
+ pango2_attr_list_insert (data->attrs, attr);
}
else if (strcmp (element_name, "attributes") == 0)
{
diff --git a/gtk/gtkpango.h b/gtk/gtkpango.h
index 55cab30b3c..0f5d8d547e 100644
--- a/gtk/gtkpango.h
+++ b/gtk/gtkpango.h
@@ -25,13 +25,13 @@
#ifndef __GTK_PANGO_H__
#define __GTK_PANGO_H__
-#include <pango/pangocairo.h>
+#include <pango2/pangocairo.h>
#include "gtkbuildable.h"
G_BEGIN_DECLS
-PangoAttrList *_gtk_pango_attr_list_merge (PangoAttrList *into,
- PangoAttrList *from) G_GNUC_WARN_UNUSED_RESULT;
+Pango2AttrList *_gtk_pango_attr_list_merge (Pango2AttrList *into,
+ Pango2AttrList *from) G_GNUC_WARN_UNUSED_RESULT;
gboolean gtk_buildable_attribute_tag_start (GtkBuildable *buildable,
GtkBuilder *builder,
@@ -43,7 +43,7 @@ gboolean gtk_buildable_attribute_tag_start (GtkBuildable *buildable,
typedef struct {
GtkBuilder *builder;
GObject *object;
- PangoAttrList *attrs;
+ Pango2AttrList *attrs;
} GtkPangoAttributeParserData;
void
diff --git a/gtk/gtkplacesview.c b/gtk/gtkplacesview.c
index d62f8f2a40..331281d08f 100644
--- a/gtk/gtkplacesview.c
+++ b/gtk/gtkplacesview.c
@@ -587,14 +587,14 @@ populate_servers (GtkPlacesView *view)
label = gtk_label_new (name);
gtk_widget_set_hexpand (label, TRUE);
gtk_label_set_xalign (GTK_LABEL (label), 0.0);
- gtk_label_set_ellipsize (GTK_LABEL (label), PANGO_ELLIPSIZE_END);
+ gtk_label_set_ellipsize (GTK_LABEL (label), PANGO2_ELLIPSIZE_END);
gtk_grid_attach (GTK_GRID (grid), label, 0, 0, 1, 1);
/* the uri itself */
label = gtk_label_new (uris[i]);
gtk_widget_set_hexpand (label, TRUE);
gtk_label_set_xalign (GTK_LABEL (label), 0.0);
- gtk_label_set_ellipsize (GTK_LABEL (label), PANGO_ELLIPSIZE_END);
+ gtk_label_set_ellipsize (GTK_LABEL (label), PANGO2_ELLIPSIZE_END);
gtk_widget_add_css_class (label, "dim-label");
gtk_grid_attach (GTK_GRID (grid), label, 0, 1, 1, 1);
diff --git a/gtk/gtkprintcontext.c b/gtk/gtkprintcontext.c
index 12a39db911..0711da8432 100644
--- a/gtk/gtkprintcontext.c
+++ b/gtk/gtkprintcontext.c
@@ -27,8 +27,8 @@
* drawing pages for printing.
*
* This includes the cairo context and important parameters like page size
- * and resolution. It also lets you easily create [class@Pango.Layout] and
- * [class@Pango.Context] objects that match the font metrics of the cairo surface.
+ * and resolution. It also lets you easily create [class@Pango2.Layout] and
+ * [class@Pango2.Context] objects that match the font metrics of the cairo surface.
*
* `GtkPrintContext` objects get passed to the
* [signal@Gtk.PrintOperation::begin-print],
@@ -46,8 +46,8 @@
* int page_nr)
* {
* cairo_t *cr;
- * PangoLayout *layout;
- * PangoFontDescription *desc;
+ * Pango2Layout *layout;
+ * Pango2FontDescription *desc;
*
* cr = gtk_print_context_get_cairo_context (context);
*
@@ -78,7 +78,7 @@
* pango_font_description_free (desc);
*
* cairo_move_to (cr, 30, 20);
- * pango_cairo_layout_path (cr, layout);
+ * pango2_cairo_layout_path (cr, layout);
*
* // Font Outline
* cairo_set_source_rgb (cr, 0.93, 1.0, 0.47);
@@ -175,10 +175,10 @@ _gtk_print_context_new (GtkPrintOperation *op)
return context;
}
-static PangoFontMap *
+static Pango2FontMap *
_gtk_print_context_get_fontmap (GtkPrintContext *context)
{
- return pango_font_map_get_default ();
+ return pango2_font_map_get_default ();
}
/**
@@ -544,12 +544,12 @@ _gtk_print_context_set_hard_margins (GtkPrintContext *context,
* gtk_print_context_get_pango_fontmap:
* @context: a `GtkPrintContext`
*
- * Returns a `PangoFontMap` that is suitable for use
+ * Returns a `Pango2FontMap` that is suitable for use
* with the `GtkPrintContext`.
*
* Returns: (transfer none): the font map of @context
*/
-PangoFontMap *
+Pango2FontMap *
gtk_print_context_get_pango_fontmap (GtkPrintContext *context)
{
g_return_val_if_fail (GTK_IS_PRINT_CONTEXT (context), NULL);
@@ -561,30 +561,30 @@ gtk_print_context_get_pango_fontmap (GtkPrintContext *context)
* gtk_print_context_create_pango_context:
* @context: a `GtkPrintContext`
*
- * Creates a new `PangoContext` that can be used with the
+ * Creates a new `Pango2Context` that can be used with the
* `GtkPrintContext`.
*
- * Returns: (transfer full): a new Pango context for @context
+ * Returns: (transfer full): a new Pango2 context for @context
*/
-PangoContext *
+Pango2Context *
gtk_print_context_create_pango_context (GtkPrintContext *context)
{
- PangoContext *pango_context;
+ Pango2Context *pango_context;
cairo_font_options_t *options;
g_return_val_if_fail (GTK_IS_PRINT_CONTEXT (context), NULL);
- pango_context = pango_context_new_with_font_map (_gtk_print_context_get_fontmap (context));
+ pango_context = pango2_context_new_with_font_map (_gtk_print_context_get_fontmap (context));
options = cairo_font_options_create ();
cairo_font_options_set_hint_metrics (options, CAIRO_HINT_METRICS_OFF);
- pango_cairo_context_set_font_options (pango_context, options);
+ pango2_cairo_context_set_font_options (pango_context, options);
cairo_font_options_destroy (options);
/* We use the unit-scaled resolution, as we still want
* fonts given in points to work
*/
- pango_font_map_set_resolution (pango_context_get_font_map (pango_context),
+ pango2_font_map_set_resolution (pango2_context_get_font_map (pango_context),
context->surface_dpi_y / context->pixels_per_unit_y);
return pango_context;
}
@@ -593,23 +593,23 @@ gtk_print_context_create_pango_context (GtkPrintContext *context)
* gtk_print_context_create_pango_layout:
* @context: a `GtkPrintContext`
*
- * Creates a new `PangoLayout` that is suitable for use
+ * Creates a new `Pango2Layout` that is suitable for use
* with the `GtkPrintContext`.
*
- * Returns: (transfer full): a new Pango layout for @context
+ * Returns: (transfer full): a new Pango2 layout for @context
*/
-PangoLayout *
+Pango2Layout *
gtk_print_context_create_pango_layout (GtkPrintContext *context)
{
- PangoContext *pango_context;
- PangoLayout *layout;
+ Pango2Context *pango_context;
+ Pango2Layout *layout;
g_return_val_if_fail (GTK_IS_PRINT_CONTEXT (context), NULL);
pango_context = gtk_print_context_create_pango_context (context);
- layout = pango_layout_new (pango_context);
+ layout = pango2_layout_new (pango_context);
- pango_cairo_update_context (context->cr, pango_context);
+ pango2_cairo_update_context (context->cr, pango_context);
g_object_unref (pango_context);
return layout;
diff --git a/gtk/gtkprintcontext.h b/gtk/gtkprintcontext.h
index 3c4ede2bbf..9a769b2a6b 100644
--- a/gtk/gtkprintcontext.h
+++ b/gtk/gtkprintcontext.h
@@ -24,7 +24,7 @@
#error "Only <gtk/gtk.h> can be included directly."
#endif
-#include <pango/pango.h>
+#include <pango2/pango.h>
#include <gtk/gtkpagesetup.h>
@@ -63,11 +63,11 @@ gboolean gtk_print_context_get_hard_margins (GtkPrintContext *context,
/* Fonts */
GDK_AVAILABLE_IN_ALL
-PangoFontMap *gtk_print_context_get_pango_fontmap (GtkPrintContext *context);
+Pango2FontMap *gtk_print_context_get_pango_fontmap (GtkPrintContext *context);
GDK_AVAILABLE_IN_ALL
-PangoContext *gtk_print_context_create_pango_context (GtkPrintContext *context);
+Pango2Context *gtk_print_context_create_pango_context (GtkPrintContext *context);
GDK_AVAILABLE_IN_ALL
-PangoLayout *gtk_print_context_create_pango_layout (GtkPrintContext *context);
+Pango2Layout *gtk_print_context_create_pango_layout (GtkPrintContext *context);
/* Needed for preview implementations */
GDK_AVAILABLE_IN_ALL
diff --git a/gtk/gtkprintunixdialog.c b/gtk/gtkprintunixdialog.c
index cf13d9ebe9..62af4a23ec 100644
--- a/gtk/gtkprintunixdialog.c
+++ b/gtk/gtkprintunixdialog.c
@@ -2376,8 +2376,8 @@ draw_page (GtkDrawingArea *da,
double page_width, page_height;
GtkPageOrientation orientation;
gboolean landscape;
- PangoLayout *layout;
- PangoFontDescription *font;
+ Pango2Layout *layout;
+ Pango2FontDescription *font;
char *text;
GdkRGBA color;
GtkNumberUpLayout number_up_layout;
@@ -2493,21 +2493,21 @@ draw_page (GtkDrawingArea *da,
page_width = (double)w / pages_x;
page_height = (double)h / pages_y;
- layout = pango_cairo_create_layout (cr);
+ layout = pango2_cairo_create_layout (cr);
- font = pango_font_description_new ();
- pango_font_description_set_family (font, "sans");
+ font = pango2_font_description_new ();
+ pango2_font_description_set_family (font, "sans");
if (page_height > 0)
- pango_font_description_set_absolute_size (font, page_height * 0.4 * PANGO_SCALE);
+ pango2_font_description_set_absolute_size (font, page_height * 0.4 * PANGO2_SCALE);
else
- pango_font_description_set_absolute_size (font, 1);
+ pango2_font_description_set_absolute_size (font, 1);
- pango_layout_set_font_description (layout, font);
- pango_font_description_free (font);
+ pango2_layout_set_font_description (layout, font);
+ pango2_font_description_free (font);
- pango_layout_set_width (layout, page_width * PANGO_SCALE);
- pango_layout_set_alignment (layout, PANGO_ALIGN_CENTER);
+ pango2_layout_set_width (layout, page_width * PANGO2_SCALE);
+ pango2_layout_set_alignment (layout, PANGO2_ALIGN_CENTER);
switch (number_up_layout)
{
@@ -2593,15 +2593,15 @@ draw_page (GtkDrawingArea *da,
for (x = start_x; x != end_x + dx; x += dx)
{
text = g_strdup_printf ("%d", i++);
- pango_layout_set_text (layout, text, -1);
+ pango2_layout_set_text (layout, text, -1);
g_free (text);
- pango_lines_get_size (pango_layout_get_lines (layout), &layout_w, &layout_h);
+ pango2_lines_get_size (pango2_layout_get_lines (layout), &layout_w, &layout_h);
cairo_save (cr);
cairo_translate (cr,
x * page_width,
y * page_height + (page_height - layout_h / 1024.0) / 2);
- pango_cairo_show_layout (cr, layout);
+ pango2_cairo_show_layout (cr, layout);
cairo_restore (cr);
}
}
@@ -2611,15 +2611,15 @@ draw_page (GtkDrawingArea *da,
for (y = start_y; y != end_y + dy; y += dy)
{
text = g_strdup_printf ("%d", i++);
- pango_layout_set_text (layout, text, -1);
+ pango2_layout_set_text (layout, text, -1);
g_free (text);
- pango_lines_get_size (pango_layout_get_lines (layout), &layout_w, &layout_h);
+ pango2_lines_get_size (pango2_layout_get_lines (layout), &layout_w, &layout_h);
cairo_save (cr);
cairo_translate (cr,
x * page_width,
y * page_height + (page_height - layout_h / 1024.0) / 2);
- pango_cairo_show_layout (cr, layout);
+ pango2_cairo_show_layout (cr, layout);
cairo_restore (cr);
}
}
@@ -2632,9 +2632,9 @@ draw_page (GtkDrawingArea *da,
if (page_setup != NULL)
{
- PangoContext *pango_c = NULL;
- PangoFontDescription *pango_f = NULL;
- int font_size = 12 * PANGO_SCALE;
+ Pango2Context *pango_c = NULL;
+ Pango2FontDescription *pango_f = NULL;
+ int font_size = 12 * PANGO2_SCALE;
pos_x += 1;
pos_y += 1;
@@ -2653,46 +2653,46 @@ draw_page (GtkDrawingArea *da,
cairo_restore (cr);
cairo_save (cr);
- layout = pango_cairo_create_layout (cr);
+ layout = pango2_cairo_create_layout (cr);
- font = pango_font_description_new ();
- pango_font_description_set_family (font, "sans");
+ font = pango2_font_description_new ();
+ pango2_font_description_set_family (font, "sans");
pango_c = gtk_widget_get_pango_context (widget);
if (pango_c != NULL)
{
- pango_f = pango_context_get_font_description (pango_c);
+ pango_f = pango2_context_get_font_description (pango_c);
if (pango_f != NULL)
- font_size = pango_font_description_get_size (pango_f);
+ font_size = pango2_font_description_get_size (pango_f);
}
- pango_font_description_set_size (font, font_size);
- pango_layout_set_font_description (layout, font);
- pango_font_description_free (font);
+ pango2_font_description_set_size (font, font_size);
+ pango2_layout_set_font_description (layout, font);
+ pango2_font_description_free (font);
- pango_layout_set_width (layout, -1);
- pango_layout_set_alignment (layout, PANGO_ALIGN_CENTER);
+ pango2_layout_set_width (layout, -1);
+ pango2_layout_set_alignment (layout, PANGO2_ALIGN_CENTER);
if (_gtk_print_get_default_user_units () == GTK_UNIT_MM)
text = g_strdup_printf ("%.1f mm", paper_height);
else
text = g_strdup_printf ("%.2f inch", paper_height);
- pango_layout_set_text (layout, text, -1);
+ pango2_layout_set_text (layout, text, -1);
g_free (text);
- pango_lines_get_size (pango_layout_get_lines (layout), &layout_w, &layout_h);
+ pango2_lines_get_size (pango2_layout_get_lines (layout), &layout_w, &layout_h);
ltr = gtk_widget_get_direction (GTK_WIDGET (dialog)) == GTK_TEXT_DIR_LTR;
if (ltr)
- cairo_translate (cr, pos_x - layout_w / PANGO_SCALE - 2 * RULER_DISTANCE,
- (height - layout_h / PANGO_SCALE) / 2);
+ cairo_translate (cr, pos_x - layout_w / PANGO2_SCALE - 2 * RULER_DISTANCE,
+ (height - layout_h / PANGO2_SCALE) / 2);
else
cairo_translate (cr, pos_x + w + 2 * RULER_DISTANCE,
- (height - layout_h / PANGO_SCALE) / 2);
+ (height - layout_h / PANGO2_SCALE) / 2);
gdk_cairo_set_source_rgba (cr, &color);
- pango_cairo_show_layout (cr, layout);
+ pango2_cairo_show_layout (cr, layout);
cairo_restore (cr);
cairo_save (cr);
@@ -2702,15 +2702,15 @@ draw_page (GtkDrawingArea *da,
else
text = g_strdup_printf ("%.2f inch", paper_width);
- pango_layout_set_text (layout, text, -1);
+ pango2_layout_set_text (layout, text, -1);
g_free (text);
- pango_lines_get_size (pango_layout_get_lines (layout), &layout_w, &layout_h);
+ pango2_lines_get_size (pango2_layout_get_lines (layout), &layout_w, &layout_h);
- cairo_translate (cr, (width - layout_w / PANGO_SCALE) / 2,
+ cairo_translate (cr, (width - layout_w / PANGO2_SCALE) / 2,
pos_y + h + 2 * RULER_DISTANCE);
gdk_cairo_set_source_rgba (cr, &color);
- pango_cairo_show_layout (cr, layout);
+ pango2_cairo_show_layout (cr, layout);
g_object_unref (layout);
diff --git a/gtk/gtkprogressbar.c b/gtk/gtkprogressbar.c
index ac4526971f..52b12df3f6 100644
--- a/gtk/gtkprogressbar.c
+++ b/gtk/gtkprogressbar.c
@@ -245,17 +245,17 @@ gtk_progress_bar_class_init (GtkProgressBarClass *class)
* The preferred place to ellipsize the string.
*
* The text will be ellipsized if the progress bar does not have enough room
- * to display the entire string, specified as a `PangoEllipsizeMode`.
+ * to display the entire string, specified as a `Pango2EllipsizeMode`.
*
* Note that setting this property to a value other than
- * %PANGO_ELLIPSIZE_NONE has the side-effect that the progress bar requests
+ * %PANGO2_ELLIPSIZE_NONE has the side-effect that the progress bar requests
* only enough space to display the ellipsis ("..."). Another means to set a
* progress bar's width is [method@Gtk.Widget.set_size_request].
*/
progress_props[PROP_ELLIPSIZE] =
g_param_spec_enum ("ellipsize", NULL, NULL,
- PANGO_TYPE_ELLIPSIZE_MODE,
- PANGO_ELLIPSIZE_NONE,
+ PANGO2_TYPE_ELLIPSIZE_MODE,
+ PANGO2_ELLIPSIZE_NONE,
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
g_object_class_install_properties (gobject_class, NUM_PROPERTIES, progress_props);
@@ -447,7 +447,7 @@ gtk_progress_bar_init (GtkProgressBar *pbar)
pbar->activity_pos = 0;
pbar->activity_dir = 1;
pbar->activity_blocks = 5;
- pbar->ellipsize = PANGO_ELLIPSIZE_NONE;
+ pbar->ellipsize = PANGO2_ELLIPSIZE_NONE;
pbar->show_text = FALSE;
pbar->text = NULL;
@@ -1090,7 +1090,7 @@ gtk_progress_bar_get_inverted (GtkProgressBar *pbar)
/**
* gtk_progress_bar_set_ellipsize: (attributes org.gtk.Method.set_property=ellipsize)
* @pbar: a `GtkProgressBar`
- * @mode: a `PangoEllipsizeMode`
+ * @mode: a `Pango2EllipsizeMode`
*
* Sets the mode used to ellipsize the text.
*
@@ -1099,13 +1099,13 @@ gtk_progress_bar_get_inverted (GtkProgressBar *pbar)
*/
void
gtk_progress_bar_set_ellipsize (GtkProgressBar *pbar,
- PangoEllipsizeMode mode)
+ Pango2EllipsizeMode mode)
{
g_return_if_fail (GTK_IS_PROGRESS_BAR (pbar));
- g_return_if_fail (mode >= PANGO_ELLIPSIZE_NONE &&
- mode <= PANGO_ELLIPSIZE_END);
+ g_return_if_fail (mode >= PANGO2_ELLIPSIZE_NONE &&
+ mode <= PANGO2_ELLIPSIZE_END);
- if ((PangoEllipsizeMode)pbar->ellipsize == mode)
+ if ((Pango2EllipsizeMode)pbar->ellipsize == mode)
return;
pbar->ellipsize = mode;
@@ -1124,12 +1124,12 @@ gtk_progress_bar_set_ellipsize (GtkProgressBar *pbar,
*
* See [method@Gtk.ProgressBar.set_ellipsize].
*
- * Returns: `PangoEllipsizeMode`
+ * Returns: `Pango2EllipsizeMode`
*/
-PangoEllipsizeMode
+Pango2EllipsizeMode
gtk_progress_bar_get_ellipsize (GtkProgressBar *pbar)
{
- g_return_val_if_fail (GTK_IS_PROGRESS_BAR (pbar), PANGO_ELLIPSIZE_NONE);
+ g_return_val_if_fail (GTK_IS_PROGRESS_BAR (pbar), PANGO2_ELLIPSIZE_NONE);
return pbar->ellipsize;
}
diff --git a/gtk/gtkprogressbar.h b/gtk/gtkprogressbar.h
index 75dc092d07..aaab77a3bb 100644
--- a/gtk/gtkprogressbar.h
+++ b/gtk/gtkprogressbar.h
@@ -73,9 +73,9 @@ GDK_AVAILABLE_IN_ALL
gboolean gtk_progress_bar_get_inverted (GtkProgressBar *pbar);
GDK_AVAILABLE_IN_ALL
void gtk_progress_bar_set_ellipsize (GtkProgressBar *pbar,
- PangoEllipsizeMode mode);
+ Pango2EllipsizeMode mode);
GDK_AVAILABLE_IN_ALL
-PangoEllipsizeMode gtk_progress_bar_get_ellipsize (GtkProgressBar *pbar);
+Pango2EllipsizeMode gtk_progress_bar_get_ellipsize (GtkProgressBar *pbar);
GDK_AVAILABLE_IN_ALL
void gtk_progress_bar_set_show_text (GtkProgressBar *pbar,
diff --git a/gtk/gtkrender.c b/gtk/gtkrender.c
index 414b940517..0f3eb30a5d 100644
--- a/gtk/gtkrender.c
+++ b/gtk/gtkrender.c
@@ -337,7 +337,7 @@ gtk_render_focus (GtkStyleContext *context,
* @cr: a `cairo_t`
* @x: X origin
* @y: Y origin
- * @layout: the `PangoLayout` to render
+ * @layout: the `Pango2Layout` to render
*
* Renders @layout on the coordinates @x, @y
**/
@@ -346,13 +346,13 @@ gtk_render_layout (GtkStyleContext *context,
cairo_t *cr,
double x,
double y,
- PangoLayout *layout)
+ Pango2Layout *layout)
{
GtkSnapshot *snapshot;
GskRenderNode *node;
g_return_if_fail (GTK_IS_STYLE_CONTEXT (context));
- g_return_if_fail (PANGO_IS_LAYOUT (layout));
+ g_return_if_fail (PANGO2_IS_LAYOUT (layout));
g_return_if_fail (cr != NULL);
snapshot = gtk_snapshot_new ();
diff --git a/gtk/gtkrender.h b/gtk/gtkrender.h
index 2d70770ece..825bfa980d 100644
--- a/gtk/gtkrender.h
+++ b/gtk/gtkrender.h
@@ -23,7 +23,7 @@
#endif
#include <cairo.h>
-#include <pango/pango.h>
+#include <pango2/pango.h>
#include <gdk/gdk.h>
#include <gtk/gtkenums.h>
@@ -86,7 +86,7 @@ void gtk_render_layout (GtkStyleContext *context,
cairo_t *cr,
double x,
double y,
- PangoLayout *layout);
+ Pango2Layout *layout);
GDK_AVAILABLE_IN_ALL
void gtk_render_line (GtkStyleContext *context,
cairo_t *cr,
diff --git a/gtk/gtkscale.c b/gtk/gtkscale.c
index 7d289d9363..a21038e215 100644
--- a/gtk/gtkscale.c
+++ b/gtk/gtkscale.c
@@ -1563,16 +1563,16 @@ gtk_scale_finalize (GObject *object)
* gtk_scale_get_layout:
* @scale: A `GtkScale`
*
- * Gets the `PangoLayout` used to display the scale.
+ * Gets the `Pango2Layout` used to display the scale.
*
* The returned object is owned by the scale so does not need
* to be freed by the caller.
*
- * Returns: (transfer none) (nullable): the [class@Pango.Layout]
+ * Returns: (transfer none) (nullable): the [class@Pango2.Layout]
* for this scale, or %NULL if the [property@GtkScale:draw-value]
* property is %FALSE.
*/
-PangoLayout *
+Pango2Layout *
gtk_scale_get_layout (GtkScale *scale)
{
GtkScalePrivate *priv = gtk_scale_get_instance_private (scale);
@@ -1592,9 +1592,9 @@ gtk_scale_get_layout (GtkScale *scale)
* @y: (out) (optional): location to store Y offset of layout
*
* Obtains the coordinates where the scale will draw the
- * `PangoLayout` representing the text in the scale.
+ * `Pango2Layout` representing the text in the scale.
*
- * Remember when using the `PangoLayout` function you need to
+ * Remember when using the `Pango2Layout` function you need to
* convert to and from pixels using `PANGO_PIXELS()` or `PANGO_SCALE`.
*
* If the [property@GtkScale:draw-value] property is %FALSE, the return
diff --git a/gtk/gtkscale.h b/gtk/gtkscale.h
index d7d11f8d01..6d814ab2f1 100644
--- a/gtk/gtkscale.h
+++ b/gtk/gtkscale.h
@@ -111,7 +111,7 @@ GDK_AVAILABLE_IN_ALL
GtkPositionType gtk_scale_get_value_pos (GtkScale *scale);
GDK_AVAILABLE_IN_ALL
-PangoLayout * gtk_scale_get_layout (GtkScale *scale);
+Pango2Layout * gtk_scale_get_layout (GtkScale *scale);
GDK_AVAILABLE_IN_ALL
void gtk_scale_get_layout_offsets (GtkScale *scale,
int *x,
diff --git a/gtk/gtksettings.c b/gtk/gtksettings.c
index 814dbe5a4e..08bff8e054 100644
--- a/gtk/gtksettings.c
+++ b/gtk/gtksettings.c
@@ -36,12 +36,12 @@
#ifdef GDK_WINDOWING_X11
#include "x11/gdkx.h"
-#include <pango/pangofc-fontmap.h>
+#include <pango2/pangofc-fontmap.h>
#endif
#ifdef GDK_WINDOWING_WAYLAND
#include "wayland/gdkwayland.h"
-#include <pango/pangofc-fontmap.h>
+#include <pango2/pangofc-fontmap.h>
#endif
#ifdef GDK_WINDOWING_BROADWAY
@@ -1286,30 +1286,30 @@ settings_invalidate_style (GtkSettings *settings)
static void
settings_update_font_values (GtkSettings *settings)
{
- PangoFontDescription *desc;
+ Pango2FontDescription *desc;
const char *font_name;
font_name = g_value_get_string (&settings->property_values[PROP_FONT_NAME - 1].value);
- desc = pango_font_description_from_string (font_name);
+ desc = pango2_font_description_from_string (font_name);
if (desc != NULL &&
- (pango_font_description_get_set_fields (desc) & PANGO_FONT_MASK_SIZE) != 0)
+ (pango2_font_description_get_set_fields (desc) & PANGO2_FONT_MASK_SIZE) != 0)
{
- settings->font_size = pango_font_description_get_size (desc);
- settings->font_size_absolute = pango_font_description_get_size_is_absolute (desc);
+ settings->font_size = pango2_font_description_get_size (desc);
+ settings->font_size_absolute = pango2_font_description_get_size_is_absolute (desc);
}
else
{
- settings->font_size = 10 * PANGO_SCALE;
+ settings->font_size = 10 * PANGO2_SCALE;
settings->font_size_absolute = FALSE;
}
g_free (settings->font_family);
if (desc != NULL &&
- (pango_font_description_get_set_fields (desc) & PANGO_FONT_MASK_FAMILY) != 0)
+ (pango2_font_description_get_set_fields (desc) & PANGO2_FONT_MASK_FAMILY) != 0)
{
- settings->font_family = g_strdup (pango_font_description_get_family (desc));
+ settings->font_family = g_strdup (pango2_font_description_get_family (desc));
}
else
{
@@ -1317,7 +1317,7 @@ settings_update_font_values (GtkSettings *settings)
}
if (desc)
- pango_font_description_free (desc);
+ pango2_font_description_free (desc);
}
static void
@@ -1688,16 +1688,16 @@ settings_update_fontconfig (GtkSettings *settings)
if (timestamp != last_update_timestamp)
{
- PangoFontMap *fontmap = pango_font_map_get_default ();
+ Pango2FontMap *fontmap = pango2_font_map_get_default ();
gboolean update_needed = FALSE;
/* bug 547680 */
- if (PANGO_IS_FC_FONT_MAP (fontmap))
+ if (PANGO2_IS_FC_FONT_MAP (fontmap))
{
FcConfig *config;
- config = pango_fc_font_map_get_config (PANGO_FC_FONT_MAP (fontmap));
- pango_fc_font_map_set_config (PANGO_FC_FONT_MAP (fontmap), config);
+ config = pango2_fc_font_map_get_config (PANGO2_FC_FONT_MAP (fontmap));
+ pango2_fc_font_map_set_config (PANGO2_FC_FONT_MAP (fontmap), config);
}
last_update_timestamp = timestamp;
diff --git a/gtk/gtkshortcutsgroup.c b/gtk/gtkshortcutsgroup.c
index d51c12a3ba..192143297e 100644
--- a/gtk/gtkshortcutsgroup.c
+++ b/gtk/gtkshortcutsgroup.c
@@ -339,19 +339,19 @@ gtk_shortcuts_group_class_init (GtkShortcutsGroupClass *klass)
static void
gtk_shortcuts_group_init (GtkShortcutsGroup *self)
{
- PangoAttrList *attrs;
+ Pango2AttrList *attrs;
gtk_orientable_set_orientation (GTK_ORIENTABLE (self), GTK_ORIENTATION_VERTICAL);
gtk_box_set_spacing (GTK_BOX (self), 10);
- attrs = pango_attr_list_new ();
- pango_attr_list_insert (attrs, pango_attr_weight_new (PANGO_WEIGHT_BOLD));
+ attrs = pango2_attr_list_new ();
+ pango2_attr_list_insert (attrs, pango2_attr_weight_new (PANGO2_WEIGHT_BOLD));
self->title = g_object_new (GTK_TYPE_LABEL,
"attributes", attrs,
"visible", TRUE,
"xalign", 0.0f,
NULL);
- pango_attr_list_unref (attrs);
+ pango2_attr_list_unref (attrs);
gtk_box_append (GTK_BOX (self), GTK_WIDGET (self->title));
}
diff --git a/gtk/gtkshortcutswindow.c b/gtk/gtkshortcutswindow.c
index 7c864ec5cd..e293aaee16 100644
--- a/gtk/gtkshortcutswindow.c
+++ b/gtk/gtkshortcutswindow.c
@@ -826,7 +826,7 @@ gtk_shortcuts_window_init (GtkShortcutsWindow *self)
GtkWidget *scroller;
GtkWidget *label;
GtkWidget *empty;
- PangoAttrList *attributes;
+ Pango2AttrList *attributes;
gtk_window_set_resizable (GTK_WINDOW (self), FALSE);
@@ -961,14 +961,14 @@ gtk_shortcuts_window_init (GtkShortcutsWindow *self)
"pixel-size", 72,
NULL),
0, 0, 1, 1);
- attributes = pango_attr_list_new ();
- pango_attr_list_insert (attributes, pango_attr_weight_new (PANGO_WEIGHT_BOLD));
- pango_attr_list_insert (attributes, pango_attr_scale_new (1.44));
+ attributes = pango2_attr_list_new ();
+ pango2_attr_list_insert (attributes, pango2_attr_weight_new (PANGO2_WEIGHT_BOLD));
+ pango2_attr_list_insert (attributes, pango2_attr_scale_new (1.44));
label = g_object_new (GTK_TYPE_LABEL,
"label", _("No Results Found"),
"attributes", attributes,
NULL);
- pango_attr_list_unref (attributes);
+ pango2_attr_list_unref (attributes);
gtk_grid_attach (GTK_GRID (empty), label, 0, 1, 1, 1);
label = g_object_new (GTK_TYPE_LABEL,
"label", _("Try a different search"),
diff --git a/gtk/gtksidebarrow.c b/gtk/gtksidebarrow.c
index a471705aa6..89e4cdb82c 100644
--- a/gtk/gtksidebarrow.c
+++ b/gtk/gtksidebarrow.c
@@ -280,9 +280,9 @@ gtk_sidebar_row_set_property (GObject *object,
self->section_type = g_value_get_enum (value);
if (self->section_type == GTK_PLACES_SECTION_COMPUTER ||
self->section_type == GTK_PLACES_SECTION_OTHER_LOCATIONS)
- gtk_label_set_ellipsize (GTK_LABEL (self->label_widget), PANGO_ELLIPSIZE_NONE);
+ gtk_label_set_ellipsize (GTK_LABEL (self->label_widget), PANGO2_ELLIPSIZE_NONE);
else
- gtk_label_set_ellipsize (GTK_LABEL (self->label_widget), PANGO_ELLIPSIZE_END);
+ gtk_label_set_ellipsize (GTK_LABEL (self->label_widget), PANGO2_ELLIPSIZE_END);
break;
case PROP_PLACE_TYPE:
diff --git a/gtk/gtksnapshot.c b/gtk/gtksnapshot.c
index cdf61845d5..f700d760cf 100644
--- a/gtk/gtksnapshot.c
+++ b/gtk/gtksnapshot.c
@@ -2081,7 +2081,7 @@ gtk_snapshot_render_focus (GtkSnapshot *snapshot,
* @context: the style context that defines the text
* @x: X origin of the rectangle
* @y: Y origin of the rectangle
- * @layout: the `PangoLayout` to render
+ * @layout: the `Pango2Layout` to render
*
* Creates a render node for rendering @layout according to the style
* information in @context, and appends it to the current node of @snapshot,
@@ -2092,7 +2092,7 @@ gtk_snapshot_render_layout (GtkSnapshot *snapshot,
GtkStyleContext *context,
double x,
double y,
- PangoLayout *layout)
+ Pango2Layout *layout)
{
const bool needs_translate = (x != 0 || y != 0);
const GdkRGBA *fg_color;
@@ -2101,7 +2101,7 @@ gtk_snapshot_render_layout (GtkSnapshot *snapshot,
g_return_if_fail (snapshot != NULL);
g_return_if_fail (GTK_IS_STYLE_CONTEXT (context));
- g_return_if_fail (PANGO_IS_LAYOUT (layout));
+ g_return_if_fail (PANGO2_IS_LAYOUT (layout));
if (needs_translate)
{
@@ -2125,8 +2125,8 @@ gtk_snapshot_render_layout (GtkSnapshot *snapshot,
void
gtk_snapshot_append_text (GtkSnapshot *snapshot,
- PangoFont *font,
- PangoGlyphString *glyphs,
+ Pango2Font *font,
+ Pango2GlyphString *glyphs,
const GdkRGBA *color,
float x,
float y)
diff --git a/gtk/gtksnapshot.h b/gtk/gtksnapshot.h
index 4ff34b2cdb..8f8078edf7 100644
--- a/gtk/gtksnapshot.h
+++ b/gtk/gtksnapshot.h
@@ -221,12 +221,12 @@ void gtk_snapshot_append_outset_shadow (GtkSnapshot
/* next function implemented in gskpango.c */
GDK_AVAILABLE_IN_ALL
void gtk_snapshot_append_layout (GtkSnapshot *snapshot,
- PangoLayout *layout,
+ Pango2Layout *layout,
const GdkRGBA *color);
GDK_AVAILABLE_IN_ALL
void gtk_snapshot_append_lines (GtkSnapshot *snapshot,
- PangoLines *lines,
+ Pango2Lines *lines,
const GdkRGBA *color);
@@ -256,15 +256,15 @@ void gtk_snapshot_render_layout (GtkSnapshot
GtkStyleContext *context,
double x,
double y,
- PangoLayout *layout);
+ Pango2Layout *layout);
GDK_AVAILABLE_IN_ALL /* in gtkstylecontext.c */
void gtk_snapshot_render_insertion_cursor (GtkSnapshot *snapshot,
GtkStyleContext *context,
double x,
double y,
- PangoLayout *layout,
+ Pango2Layout *layout,
int index,
- PangoDirection direction);
+ Pango2Direction direction);
G_END_DECLS
diff --git a/gtk/gtksnapshotprivate.h b/gtk/gtksnapshotprivate.h
index 99714c5a99..1051a94628 100644
--- a/gtk/gtksnapshotprivate.h
+++ b/gtk/gtksnapshotprivate.h
@@ -25,8 +25,8 @@
G_BEGIN_DECLS
void gtk_snapshot_append_text (GtkSnapshot *snapshot,
- PangoFont *font,
- PangoGlyphString *glyphs,
+ Pango2Font *font,
+ Pango2GlyphString *glyphs,
const GdkRGBA *color,
float x,
float y);
diff --git a/gtk/gtkstylecontext.c b/gtk/gtkstylecontext.c
index bb96e16fb6..3043cb3abf 100644
--- a/gtk/gtkstylecontext.c
+++ b/gtk/gtkstylecontext.c
@@ -959,7 +959,7 @@ draw_insertion_cursor (GtkStyleContext *context,
double height,
double aspect_ratio,
gboolean is_primary,
- PangoDirection direction,
+ Pango2Direction direction,
gboolean draw_arrow)
{
GdkRGBA primary_color;
@@ -998,7 +998,7 @@ draw_insertion_cursor (GtkStyleContext *context,
if (draw_arrow)
{
- if (direction == PANGO_DIRECTION_RTL)
+ if (direction == PANGO2_DIRECTION_RTL)
{
double x0, y0, x1, y1, x2, y2;
@@ -1016,7 +1016,7 @@ draw_insertion_cursor (GtkStyleContext *context,
cairo_line_to (cr, x1, y1);
cairo_line_to (cr, xx1 - dx, yy1 - dy);
}
- else if (direction == PANGO_DIRECTION_LTR)
+ else if (direction == PANGO2_DIRECTION_LTR)
{
double x0, y0, x1, y1, x2, y2;
@@ -1054,7 +1054,7 @@ static void
get_insertion_cursor_bounds (double width,
double height,
double aspect_ratio,
- PangoDirection direction,
+ Pango2Direction direction,
gboolean draw_arrow,
graphene_rect_t *bounds)
{
@@ -1077,7 +1077,7 @@ snapshot_insertion_cursor (GtkSnapshot *snapshot,
double height,
double aspect_ratio,
gboolean is_primary,
- PangoDirection direction,
+ Pango2Direction direction,
gboolean draw_arrow)
{
if (width != 0 || draw_arrow)
@@ -1104,7 +1104,7 @@ snapshot_insertion_cursor (GtkSnapshot *snapshot,
stem_width = height * aspect_ratio + 1;
/* put (stem_width % 2) on the proper side of the cursor */
- if (direction == PANGO_DIRECTION_LTR)
+ if (direction == PANGO2_DIRECTION_LTR)
offset = stem_width / 2;
else
offset = stem_width - stem_width / 2;
@@ -1121,9 +1121,9 @@ snapshot_insertion_cursor (GtkSnapshot *snapshot,
* @context: a `GtkStyleContext`
* @x: X origin
* @y: Y origin
- * @layout: the `PangoLayout` of the text
- * @index: the index in the `PangoLayout`
- * @direction: the `PangoDirection` of the text
+ * @layout: the `Pango2Layout` of the text
+ * @index: the index in the `Pango2Layout`
+ * @direction: the `Pango2Direction` of the text
*
* Draws a text caret using @snapshot at the specified index of @layout.
*/
@@ -1132,22 +1132,22 @@ gtk_snapshot_render_insertion_cursor (GtkSnapshot *snapshot,
GtkStyleContext *context,
double x,
double y,
- PangoLayout *layout,
+ Pango2Layout *layout,
int index,
- PangoDirection direction)
+ Pango2Direction direction)
{
GtkStyleContextPrivate *priv = gtk_style_context_get_instance_private (context);
gboolean split_cursor;
double aspect_ratio;
- PangoRectangle strong_pos, weak_pos;
- PangoRectangle *cursor1, *cursor2;
+ Pango2Rectangle strong_pos, weak_pos;
+ Pango2Rectangle *cursor1, *cursor2;
GdkSeat *seat;
- PangoDirection keyboard_direction;
- PangoDirection direction2;
+ Pango2Direction keyboard_direction;
+ Pango2Direction direction2;
g_return_if_fail (snapshot != NULL);
g_return_if_fail (GTK_IS_STYLE_CONTEXT (context));
- g_return_if_fail (PANGO_IS_LAYOUT (layout));
+ g_return_if_fail (PANGO2_IS_LAYOUT (layout));
g_return_if_fail (index >= 0);
g_object_get (gtk_settings_get_for_display (priv->display),
@@ -1155,7 +1155,7 @@ gtk_snapshot_render_insertion_cursor (GtkSnapshot *snapshot,
"gtk-cursor-aspect-ratio", &aspect_ratio,
NULL);
- keyboard_direction = PANGO_DIRECTION_LTR;
+ keyboard_direction = PANGO2_DIRECTION_LTR;
seat = gdk_display_get_default_seat (priv->display);
if (seat)
{
@@ -1165,9 +1165,9 @@ gtk_snapshot_render_insertion_cursor (GtkSnapshot *snapshot,
keyboard_direction = gdk_device_get_direction (keyboard);
}
- pango_lines_get_caret_pos (pango_layout_get_lines (layout), NULL, index, &strong_pos, &weak_pos);
+ pango2_lines_get_caret_pos (pango2_layout_get_lines (layout), NULL, index, &strong_pos, &weak_pos);
- direction2 = PANGO_DIRECTION_NEUTRAL;
+ direction2 = PANGO2_DIRECTION_NEUTRAL;
if (split_cursor)
{
@@ -1175,7 +1175,7 @@ gtk_snapshot_render_insertion_cursor (GtkSnapshot *snapshot,
if (strong_pos.x != weak_pos.x || strong_pos.y != weak_pos.y)
{
- direction2 = (direction == PANGO_DIRECTION_LTR) ? PANGO_DIRECTION_RTL : PANGO_DIRECTION_LTR;
+ direction2 = (direction == PANGO2_DIRECTION_LTR) ? PANGO2_DIRECTION_RTL : PANGO2_DIRECTION_LTR;
cursor2 = &weak_pos;
}
}
@@ -1188,25 +1188,25 @@ gtk_snapshot_render_insertion_cursor (GtkSnapshot *snapshot,
}
gtk_snapshot_save (snapshot);
- gtk_snapshot_translate (snapshot, &GRAPHENE_POINT_INIT (x + PANGO_PIXELS (MIN (cursor1->x, cursor1->x +
cursor1->width)), y + PANGO_PIXELS (cursor1->y)));
+ gtk_snapshot_translate (snapshot, &GRAPHENE_POINT_INIT (x + PANGO2_PIXELS (MIN (cursor1->x, cursor1->x +
cursor1->width)), y + PANGO2_PIXELS (cursor1->y)));
snapshot_insertion_cursor (snapshot,
context,
- PANGO_PIXELS (cursor1->width),
- PANGO_PIXELS (cursor1->height),
+ PANGO2_PIXELS (cursor1->width),
+ PANGO2_PIXELS (cursor1->height),
aspect_ratio,
TRUE,
direction,
- direction2 != PANGO_DIRECTION_NEUTRAL);
+ direction2 != PANGO2_DIRECTION_NEUTRAL);
gtk_snapshot_restore (snapshot);
- if (direction2 != PANGO_DIRECTION_NEUTRAL)
+ if (direction2 != PANGO2_DIRECTION_NEUTRAL)
{
gtk_snapshot_save (snapshot);
- gtk_snapshot_translate (snapshot, &GRAPHENE_POINT_INIT (x + PANGO_PIXELS (MIN (cursor2->x, cursor2->x
+ cursor2->width)), y + PANGO_PIXELS (cursor2->y)));
+ gtk_snapshot_translate (snapshot, &GRAPHENE_POINT_INIT (x + PANGO2_PIXELS (MIN (cursor2->x, cursor2->x
+ cursor2->width)), y + PANGO2_PIXELS (cursor2->y)));
snapshot_insertion_cursor (snapshot,
context,
- PANGO_PIXELS (cursor2->width),
- PANGO_PIXELS (cursor2->height),
+ PANGO2_PIXELS (cursor2->width),
+ PANGO2_PIXELS (cursor2->height),
aspect_ratio,
FALSE,
direction2,
diff --git a/gtk/gtktext.c b/gtk/gtktext.c
index f58b1e0250..56008e637e 100644
--- a/gtk/gtktext.c
+++ b/gtk/gtktext.c
@@ -161,9 +161,9 @@ struct _GtkTextPrivate
int text_baseline;
- PangoLayout *cached_layout;
- PangoAttrList *attrs;
- PangoTabArray *tabs;
+ Pango2Layout *cached_layout;
+ Pango2AttrList *attrs;
+ Pango2TabArray *tabs;
GdkContentProvider *selection_content;
@@ -234,7 +234,7 @@ struct _GtkTextPrivate
guint mouse_cursor_obscured : 1;
guint need_im_reset : 1;
guint real_changed : 1;
- guint resolved_dir : 4; /* PangoDirection */
+ guint resolved_dir : 4; /* Pango2Direction */
guint select_words : 1;
guint select_lines : 1;
guint truncate_multiline : 1;
@@ -498,7 +498,7 @@ static void gtk_text_draw_text (GtkText *self,
static void gtk_text_draw_cursor (GtkText *self,
GtkSnapshot *snapshot,
CursorType type);
-static PangoLayout *gtk_text_ensure_layout (GtkText *self,
+static Pango2Layout *gtk_text_ensure_layout (GtkText *self,
gboolean include_preedit);
static void gtk_text_reset_layout (GtkText *self);
static void gtk_text_recompute (GtkText *self);
@@ -895,16 +895,16 @@ gtk_text_class_init (GtkTextClass *class)
/**
* GtkText:attributes: (attributes org.gtk.Property.get=gtk_text_get_attributes
org.gtk.Property.set=gtk_text_set_attributes)
*
- * A list of Pango attributes to apply to the text of the `GtkText`.
+ * A list of Pango2 attributes to apply to the text of the `GtkText`.
*
* This is mainly useful to change the size or weight of the text.
*
- * The `PangoAttribute`'s @start_index and @end_index must refer to the
+ * The `Pango2Attribute`'s @start_index and @end_index must refer to the
* `GtkEntryBuffer` text, i.e. without the preedit string.
*/
text_props[PROP_ATTRIBUTES] =
g_param_spec_boxed ("attributes", NULL, NULL,
- PANGO_TYPE_ATTR_LIST,
+ PANGO2_TYPE_ATTR_LIST,
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
/**
@@ -914,7 +914,7 @@ gtk_text_class_init (GtkTextClass *class)
*/
text_props[PROP_TABS] =
g_param_spec_boxed ("tabs", NULL, NULL,
- PANGO_TYPE_TAB_ARRAY,
+ PANGO2_TYPE_TAB_ARRAY,
GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
/**
@@ -2001,10 +2001,10 @@ gtk_text_finalize (GObject *object)
g_free (priv->im_module);
if (priv->tabs)
- pango_tab_array_free (priv->tabs);
+ pango2_tab_array_free (priv->tabs);
if (priv->attrs)
- pango_attr_list_unref (priv->attrs);
+ pango2_attr_list_unref (priv->attrs);
G_OBJECT_CLASS (gtk_text_parent_class)->finalize (object);
@@ -2284,21 +2284,21 @@ static int
gtk_text_get_selection_bound_location (GtkText *self)
{
GtkTextPrivate *priv = gtk_text_get_instance_private (self);
- PangoLayout *layout;
- PangoRectangle pos;
+ Pango2Layout *layout;
+ Pango2Rectangle pos;
int x;
const char *text;
int index;
layout = gtk_text_ensure_layout (self, FALSE);
- text = pango_layout_get_text (layout);
+ text = pango2_layout_get_text (layout);
index = g_utf8_offset_to_pointer (text, priv->selection_bound) - text;
- pango_lines_index_to_pos (pango_layout_get_lines (layout), NULL, index, &pos);
+ pango2_lines_index_to_pos (pango2_layout_get_lines (layout), NULL, index, &pos);
if (gtk_widget_get_direction (GTK_WIDGET (self)) == GTK_TEXT_DIR_RTL)
- x = (pos.x + pos.width) / PANGO_SCALE;
+ x = (pos.x + pos.width) / PANGO2_SCALE;
else
- x = pos.x / PANGO_SCALE;
+ x = pos.x / PANGO2_SCALE;
return x;
}
@@ -2376,11 +2376,11 @@ gtk_text_measure (GtkWidget *widget,
{
GtkText *self = GTK_TEXT (widget);
GtkTextPrivate *priv = gtk_text_get_instance_private (self);
- PangoContext *context;
- PangoFontMetrics *metrics;
+ Pango2Context *context;
+ Pango2FontMetrics *metrics;
context = gtk_widget_get_pango_context (widget);
- metrics = pango_context_get_metrics (context, NULL, NULL);
+ metrics = pango2_context_get_metrics (context, NULL, NULL);
if (orientation == GTK_ORIENTATION_HORIZONTAL)
{
@@ -2389,9 +2389,9 @@ gtk_text_measure (GtkWidget *widget,
int digit_width;
int char_pixels;
- char_width = pango_font_metrics_get_approximate_char_width (metrics);
- digit_width = pango_font_metrics_get_approximate_digit_width (metrics);
- char_pixels = (MAX (char_width, digit_width) + PANGO_SCALE - 1) / PANGO_SCALE;
+ char_width = pango2_font_metrics_get_approximate_char_width (metrics);
+ digit_width = pango2_font_metrics_get_approximate_digit_width (metrics);
+ char_pixels = (MAX (char_width, digit_width) + PANGO2_SCALE - 1) / PANGO2_SCALE;
if (priv->width_chars >= 0)
min = char_pixels * priv->width_chars;
@@ -2405,12 +2405,12 @@ gtk_text_measure (GtkWidget *widget,
if (priv->propagate_text_width)
{
- PangoLayout *layout;
- PangoRectangle ext;
+ Pango2Layout *layout;
+ Pango2Rectangle ext;
layout = gtk_text_ensure_layout (self, TRUE);
- pango_lines_get_extents (pango_layout_get_lines (layout), NULL, &ext);
- pango_extents_to_pixels (&ext, NULL);
+ pango2_lines_get_extents (pango2_layout_get_lines (layout), NULL, &ext);
+ pango2_extents_to_pixels (&ext, NULL);
nat = MIN (ext.width, nat);
}
@@ -2433,20 +2433,20 @@ gtk_text_measure (GtkWidget *widget,
else
{
int height, baseline;
- PangoLayout *layout;
- PangoRectangle ext;
+ Pango2Layout *layout;
+ Pango2Rectangle ext;
layout = gtk_text_ensure_layout (self, TRUE);
- priv->ascent = pango_font_metrics_get_ascent (metrics);
- priv->descent = pango_font_metrics_get_descent (metrics);
+ priv->ascent = pango2_font_metrics_get_ascent (metrics);
+ priv->descent = pango2_font_metrics_get_descent (metrics);
- pango_lines_get_extents (pango_layout_get_lines (layout), NULL, &ext);
- pango_extents_to_pixels (&ext, NULL);
+ pango2_lines_get_extents (pango2_layout_get_lines (layout), NULL, &ext);
+ pango2_extents_to_pixels (&ext, NULL);
- height = MAX (ext.height, PANGO_PIXELS (priv->ascent + priv->descent));
+ height = MAX (ext.height, PANGO2_PIXELS (priv->ascent + priv->descent));
- baseline = pango_lines_get_baseline (pango_layout_get_lines (layout)) / PANGO_SCALE;
+ baseline = pango2_lines_get_baseline (pango2_layout_get_lines (layout)) / PANGO2_SCALE;
*minimum = *natural = height;
@@ -2466,7 +2466,7 @@ gtk_text_measure (GtkWidget *widget,
*natural_baseline = baseline;
}
- pango_font_metrics_free (metrics);
+ pango2_font_metrics_free (metrics);
}
static void
@@ -2586,15 +2586,15 @@ gtk_text_get_pixel_ranges (GtkText *self,
if (priv->selection_bound != priv->current_pos)
{
- PangoLayout *layout = gtk_text_ensure_layout (self, TRUE);
- PangoLines *lines = pango_layout_get_lines (layout);
- PangoLine *line = pango_lines_get_lines (lines)[0];
- const char *text = pango_layout_get_text (layout);
+ Pango2Layout *layout = gtk_text_ensure_layout (self, TRUE);
+ Pango2Lines *lines = pango2_layout_get_lines (layout);
+ Pango2Line *line = pango2_lines_get_lines (lines)[0];
+ const char *text = pango2_layout_get_text (layout);
int start_index = g_utf8_offset_to_pointer (text, priv->selection_bound) - text;
int end_index = g_utf8_offset_to_pointer (text, priv->current_pos) - text;
int real_n_ranges, i;
- pango_lines_get_x_ranges (lines, line,
+ pango2_lines_get_x_ranges (lines, line,
NULL, MIN (start_index, end_index),
NULL, MAX (start_index, end_index),
ranges,
@@ -2606,8 +2606,8 @@ gtk_text_get_pixel_ranges (GtkText *self,
for (i = 0; i < real_n_ranges; ++i)
{
- r[2 * i + 1] = (r[2 * i + 1] - r[2 * i]) / PANGO_SCALE;
- r[2 * i] = r[2 * i] / PANGO_SCALE;
+ r[2 * i + 1] = (r[2 * i + 1] - r[2 * i]) / PANGO2_SCALE;
+ r[2 * i] = r[2 * i] / PANGO2_SCALE;
}
}
@@ -3457,8 +3457,8 @@ gtk_text_get_selection_bounds (GtkText *self,
static gunichar
find_invisible_char (GtkWidget *widget)
{
- PangoLayout *layout;
- PangoAttrList *attr_list;
+ Pango2Layout *layout;
+ Pango2AttrList *attr_list;
int i;
gunichar invisible_chars [] = {
0x25cf, /* BLACK CIRCLE */
@@ -3469,11 +3469,11 @@ find_invisible_char (GtkWidget *widget)
layout = gtk_widget_create_pango_layout (widget, NULL);
- attr_list = pango_attr_list_new ();
- pango_attr_list_insert (attr_list, pango_attr_fallback_new (FALSE));
+ attr_list = pango2_attr_list_new ();
+ pango2_attr_list_insert (attr_list, pango2_attr_fallback_new (FALSE));
- pango_layout_set_attributes (layout, attr_list);
- pango_attr_list_unref (attr_list);
+ pango2_layout_set_attributes (layout, attr_list);
+ pango2_attr_list_unref (attr_list);
for (i = 0; i < G_N_ELEMENTS (invisible_chars); i++)
{
@@ -3481,9 +3481,9 @@ find_invisible_char (GtkWidget *widget)
int len, count;
len = g_unichar_to_utf8 (invisible_chars[i], text);
- pango_layout_set_text (layout, text, len);
+ pango2_layout_set_text (layout, text, len);
- count = pango_lines_get_unknown_glyphs_count (pango_layout_get_lines (layout));
+ count = pango2_lines_get_unknown_glyphs_count (pango2_layout_get_lines (layout));
if (count == 0)
{
@@ -3742,12 +3742,12 @@ get_better_cursor_x (GtkText *self,
GtkTextPrivate *priv = gtk_text_get_instance_private (self);
GdkSeat *seat;
GdkDevice *keyboard = NULL;
- PangoDirection direction = PANGO_DIRECTION_LTR;
+ Pango2Direction direction = PANGO2_DIRECTION_LTR;
gboolean split_cursor;
- PangoLayout *layout = gtk_text_ensure_layout (self, TRUE);
- const char *text = pango_layout_get_text (layout);
+ Pango2Layout *layout = gtk_text_ensure_layout (self, TRUE);
+ const char *text = pango2_layout_get_text (layout);
int index = g_utf8_offset_to_pointer (text, offset) - text;
- PangoRectangle strong_pos, weak_pos;
+ Pango2Rectangle strong_pos, weak_pos;
seat = gdk_display_get_default_seat (gtk_widget_get_display (GTK_WIDGET (self)));
if (seat)
@@ -3759,12 +3759,12 @@ get_better_cursor_x (GtkText *self,
"gtk-split-cursor", &split_cursor,
NULL);
- pango_lines_get_cursor_pos (pango_layout_get_lines (layout), NULL, index, &strong_pos, &weak_pos);
+ pango2_lines_get_cursor_pos (pango2_layout_get_lines (layout), NULL, index, &strong_pos, &weak_pos);
if (split_cursor)
- return strong_pos.x / PANGO_SCALE;
+ return strong_pos.x / PANGO2_SCALE;
else
- return (direction == priv->resolved_dir) ? strong_pos.x / PANGO_SCALE : weak_pos.x / PANGO_SCALE;
+ return (direction == priv->resolved_dir) ? strong_pos.x / PANGO2_SCALE : weak_pos.x / PANGO2_SCALE;
}
static void
@@ -3798,7 +3798,7 @@ gtk_text_move_cursor (GtkText *self,
break;
case GTK_MOVEMENT_WORDS:
- if (priv->resolved_dir == PANGO_DIRECTION_RTL)
+ if (priv->resolved_dir == PANGO2_DIRECTION_RTL)
count *= -1;
G_GNUC_FALLTHROUGH;
@@ -3859,7 +3859,7 @@ gtk_text_move_cursor (GtkText *self,
break;
case GTK_MOVEMENT_WORDS:
- if (priv->resolved_dir == PANGO_DIRECTION_RTL)
+ if (priv->resolved_dir == PANGO2_DIRECTION_RTL)
count *= -1;
while (count > 0)
@@ -4034,11 +4034,11 @@ gtk_text_backspace (GtkText *self)
if (prev_pos < priv->current_pos)
{
- PangoLayout *layout = gtk_text_ensure_layout (self, FALSE);
- const PangoLogAttr *log_attrs;
+ Pango2Layout *layout = gtk_text_ensure_layout (self, FALSE);
+ const Pango2LogAttr *log_attrs;
int n_attrs;
- log_attrs = pango_layout_get_log_attrs (layout, &n_attrs);
+ log_attrs = pango2_layout_get_log_attrs (layout, &n_attrs);
/* Deleting parts of characters */
if (log_attrs[priv->current_pos].backspace_deletes_character)
@@ -4422,26 +4422,26 @@ gtk_text_recompute (GtkText *self)
gtk_text_update_handles (self);
}
-static PangoLayout *
+static Pango2Layout *
gtk_text_create_layout (GtkText *self,
gboolean include_preedit)
{
GtkTextPrivate *priv = gtk_text_get_instance_private (self);
GtkWidget *widget = GTK_WIDGET (self);
- PangoLayout *layout;
- PangoAttrList *tmp_attrs = NULL;
+ Pango2Layout *layout;
+ Pango2AttrList *tmp_attrs = NULL;
char *preedit_string = NULL;
int preedit_length = 0;
- PangoAttrList *preedit_attrs = NULL;
+ Pango2AttrList *preedit_attrs = NULL;
char *display_text;
guint n_bytes;
layout = gtk_widget_create_pango_layout (widget, NULL);
- pango_layout_set_single_paragraph (layout, TRUE);
+ pango2_layout_set_single_paragraph (layout, TRUE);
tmp_attrs = gtk_css_style_get_pango_attributes (gtk_css_node_get_style (gtk_widget_get_css_node (widget)));
if (!tmp_attrs)
- tmp_attrs = pango_attr_list_new ();
+ tmp_attrs = pango2_attr_list_new ();
tmp_attrs = _gtk_pango_attr_list_merge (tmp_attrs, priv->attrs);
display_text = gtk_text_get_display_text (self, 0, -1);
@@ -4462,27 +4462,27 @@ gtk_text_create_layout (GtkText *self,
pos = g_utf8_offset_to_pointer (display_text, priv->current_pos) - display_text;
g_string_insert (tmp_string, pos, preedit_string);
- pango_layout_set_text (layout, tmp_string->str, tmp_string->len);
- pango_attr_list_splice (tmp_attrs, preedit_attrs, pos, preedit_length);
+ pango2_layout_set_text (layout, tmp_string->str, tmp_string->len);
+ pango2_attr_list_splice (tmp_attrs, preedit_attrs, pos, preedit_length);
g_string_free (tmp_string, TRUE);
}
else
{
- PangoDirection pango_dir;
+ Pango2Direction pango_dir;
if (gtk_text_get_display_mode (self) == DISPLAY_NORMAL)
pango_dir = gdk_find_base_dir (display_text, n_bytes);
else
- pango_dir = PANGO_DIRECTION_NEUTRAL;
+ pango_dir = PANGO2_DIRECTION_NEUTRAL;
- if (pango_dir == PANGO_DIRECTION_NEUTRAL)
+ if (pango_dir == PANGO2_DIRECTION_NEUTRAL)
{
if (gtk_widget_has_focus (widget))
{
GdkDisplay *display;
GdkSeat *seat;
GdkDevice *keyboard = NULL;
- PangoDirection direction = PANGO_DIRECTION_LTR;
+ Pango2Direction direction = PANGO2_DIRECTION_LTR;
display = gtk_widget_get_display (widget);
seat = gdk_display_get_default_seat (display);
@@ -4491,42 +4491,42 @@ gtk_text_create_layout (GtkText *self,
if (keyboard)
direction = gdk_device_get_direction (keyboard);
- if (direction == PANGO_DIRECTION_RTL)
- pango_dir = PANGO_DIRECTION_RTL;
+ if (direction == PANGO2_DIRECTION_RTL)
+ pango_dir = PANGO2_DIRECTION_RTL;
else
- pango_dir = PANGO_DIRECTION_LTR;
+ pango_dir = PANGO2_DIRECTION_LTR;
}
else
{
if (gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL)
- pango_dir = PANGO_DIRECTION_RTL;
+ pango_dir = PANGO2_DIRECTION_RTL;
else
- pango_dir = PANGO_DIRECTION_LTR;
+ pango_dir = PANGO2_DIRECTION_LTR;
}
}
- pango_context_set_base_dir (gtk_widget_get_pango_context (widget), pango_dir);
+ pango2_context_set_base_dir (gtk_widget_get_pango_context (widget), pango_dir);
priv->resolved_dir = pango_dir;
- pango_layout_set_text (layout, display_text, n_bytes);
+ pango2_layout_set_text (layout, display_text, n_bytes);
}
- pango_layout_set_attributes (layout, tmp_attrs);
+ pango2_layout_set_attributes (layout, tmp_attrs);
if (priv->tabs)
- pango_layout_set_tabs (layout, priv->tabs);
+ pango2_layout_set_tabs (layout, priv->tabs);
g_free (preedit_string);
g_free (display_text);
- pango_attr_list_unref (preedit_attrs);
- pango_attr_list_unref (tmp_attrs);
+ pango2_attr_list_unref (preedit_attrs);
+ pango2_attr_list_unref (tmp_attrs);
return layout;
}
-static PangoLayout *
+static Pango2Layout *
gtk_text_ensure_layout (GtkText *self,
gboolean include_preedit)
{
@@ -4552,26 +4552,26 @@ get_layout_position (GtkText *self,
{
GtkTextPrivate *priv = gtk_text_get_instance_private (self);
const int text_height = gtk_widget_get_height (GTK_WIDGET (self));
- PangoLayout *layout;
- PangoLines *lines;
- PangoRectangle logical_rect;
+ Pango2Layout *layout;
+ Pango2Lines *lines;
+ Pango2Rectangle logical_rect;
int y_pos, area_height;
- PangoLine *line;
+ Pango2Line *line;
layout = gtk_text_ensure_layout (self, TRUE);
- lines = pango_layout_get_lines (layout);
+ lines = pango2_layout_get_lines (layout);
- area_height = PANGO_SCALE * text_height;
+ area_height = PANGO2_SCALE * text_height;
- line = pango_lines_get_lines (lines)[0];
- pango_line_get_extents (line, NULL, &logical_rect);
+ line = pango2_lines_get_lines (lines)[0];
+ pango2_line_get_extents (line, NULL, &logical_rect);
/* Align primarily for locale's ascent/descent */
if (priv->text_baseline < 0)
y_pos = ((area_height - priv->ascent - priv->descent) / 2 +
priv->ascent + logical_rect.y);
else
- y_pos = PANGO_SCALE * priv->text_baseline - pango_lines_get_baseline (lines);
+ y_pos = PANGO2_SCALE * priv->text_baseline - pango2_lines_get_baseline (lines);
/* Now see if we need to adjust to fit in actual drawn string */
if (logical_rect.height > area_height)
@@ -4581,7 +4581,7 @@ get_layout_position (GtkText *self,
else if (y_pos + logical_rect.height > area_height)
y_pos = area_height - logical_rect.height;
- y_pos = y_pos / PANGO_SCALE;
+ y_pos = y_pos / PANGO2_SCALE;
if (x)
*x = - priv->scroll_offset;
@@ -4599,7 +4599,7 @@ gtk_text_draw_text (GtkText *self,
GtkTextPrivate *priv = gtk_text_get_instance_private (self);
GtkWidget *widget = GTK_WIDGET (self);
GtkStyleContext *context;
- PangoLayout *layout;
+ Pango2Layout *layout;
int x, y;
/* Nothing to display at all */
@@ -4615,7 +4615,7 @@ gtk_text_draw_text (GtkText *self,
if (priv->selection_bound != priv->current_pos)
{
- const char *text = pango_layout_get_text (layout);
+ const char *text = pango2_layout_get_text (layout);
int start_index = g_utf8_offset_to_pointer (text, priv->selection_bound) - text;
int end_index = g_utf8_offset_to_pointer (text, priv->current_pos) - text;
cairo_region_t *clip;
@@ -4653,18 +4653,18 @@ gtk_text_draw_cursor (GtkText *self,
GtkTextPrivate *priv = gtk_text_get_instance_private (self);
GtkWidget *widget = GTK_WIDGET (self);
GtkStyleContext *context;
- PangoRectangle cursor_rect;
+ Pango2Rectangle cursor_rect;
int cursor_index;
gboolean block;
gboolean block_at_line_end;
- PangoLayout *layout;
+ Pango2Layout *layout;
const char *text;
int x, y;
context = gtk_widget_get_style_context (widget);
layout = g_object_ref (gtk_text_ensure_layout (self, TRUE));
- text = pango_layout_get_text (layout);
+ text = pango2_layout_get_text (layout);
gtk_text_get_layout_offsets (self, &x, &y);
if (type == CURSOR_DND)
@@ -4689,10 +4689,10 @@ gtk_text_draw_cursor (GtkText *self,
int height = gtk_widget_get_height (widget);
graphene_rect_t bounds;
- bounds.origin.x = PANGO_PIXELS (cursor_rect.x) + x;
- bounds.origin.y = PANGO_PIXELS (cursor_rect.y) + y;
- bounds.size.width = PANGO_PIXELS (cursor_rect.width);
- bounds.size.height = PANGO_PIXELS (cursor_rect.height);
+ bounds.origin.x = PANGO2_PIXELS (cursor_rect.x) + x;
+ bounds.origin.y = PANGO2_PIXELS (cursor_rect.y) + y;
+ bounds.size.width = PANGO2_PIXELS (cursor_rect.width);
+ bounds.size.height = PANGO2_PIXELS (cursor_rect.height);
gtk_style_context_save_to_node (context, priv->block_cursor_node);
@@ -4831,8 +4831,8 @@ gtk_text_find_position (GtkText *self,
int x)
{
GtkTextPrivate *priv = gtk_text_get_instance_private (self);
- PangoLayout *layout;
- PangoLine *line;
+ Pango2Layout *layout;
+ Pango2Line *line;
int index;
int pos;
int trailing;
@@ -4840,11 +4840,11 @@ gtk_text_find_position (GtkText *self,
int cursor_index;
layout = gtk_text_ensure_layout (self, TRUE);
- text = pango_layout_get_text (layout);
+ text = pango2_layout_get_text (layout);
cursor_index = g_utf8_offset_to_pointer (text, priv->current_pos) - text;
- line = pango_lines_get_lines (pango_layout_get_lines (layout))[0];
- pango_line_x_to_index (line, x * PANGO_SCALE, &index, &trailing);
+ line = pango2_lines_get_lines (pango2_layout_get_lines (layout))[0];
+ pango2_line_x_to_index (line, x * PANGO2_SCALE, &index, &trailing);
if (index >= cursor_index && priv->preedit_length)
{
@@ -4882,20 +4882,20 @@ gtk_text_get_cursor_locations (GtkText *self,
}
else
{
- PangoLayout *layout = gtk_text_ensure_layout (self, TRUE);
- const char *text = pango_layout_get_text (layout);
- PangoRectangle strong_pos, weak_pos;
+ Pango2Layout *layout = gtk_text_ensure_layout (self, TRUE);
+ const char *text = pango2_layout_get_text (layout);
+ Pango2Rectangle strong_pos, weak_pos;
int index;
index = g_utf8_offset_to_pointer (text, priv->current_pos + priv->preedit_cursor) - text;
- pango_lines_get_cursor_pos (pango_layout_get_lines (layout), NULL, index, &strong_pos, &weak_pos);
+ pango2_lines_get_cursor_pos (pango2_layout_get_lines (layout), NULL, index, &strong_pos, &weak_pos);
if (strong_x)
- *strong_x = strong_pos.x / PANGO_SCALE;
+ *strong_x = strong_pos.x / PANGO2_SCALE;
if (weak_x)
- *weak_x = weak_pos.x / PANGO_SCALE;
+ *weak_x = weak_pos.x / PANGO2_SCALE;
}
}
@@ -4920,24 +4920,24 @@ gtk_text_get_scroll_limits (GtkText *self,
{
GtkTextPrivate *priv = gtk_text_get_instance_private (self);
float xalign;
- PangoLayout *layout;
- PangoLine *line;
- PangoRectangle logical_rect;
+ Pango2Layout *layout;
+ Pango2Line *line;
+ Pango2Rectangle logical_rect;
int text_width, width;
layout = gtk_text_ensure_layout (self, TRUE);
- line = pango_lines_get_lines (pango_layout_get_lines (layout))[0];
+ line = pango2_lines_get_lines (pango2_layout_get_lines (layout))[0];
- pango_line_get_extents (line, NULL, &logical_rect);
+ pango2_line_get_extents (line, NULL, &logical_rect);
/* Display as much text as we can */
- if (priv->resolved_dir == PANGO_DIRECTION_LTR)
+ if (priv->resolved_dir == PANGO2_DIRECTION_LTR)
xalign = priv->xalign;
else
xalign = 1.0 - priv->xalign;
- text_width = PANGO_PIXELS(logical_rect.width);
+ text_width = PANGO2_PIXELS(logical_rect.width);
width = gtk_widget_get_width (GTK_WIDGET (self));
if (text_width > width)
@@ -5032,12 +5032,12 @@ gtk_text_move_visually (GtkText *self,
{
GtkTextPrivate *priv = gtk_text_get_instance_private (self);
int index;
- PangoLayout *layout = gtk_text_ensure_layout (self, FALSE);
+ Pango2Layout *layout = gtk_text_ensure_layout (self, FALSE);
const char *text;
gboolean split_cursor;
gboolean strong;
- text = pango_layout_get_text (layout);
+ text = pango2_layout_get_text (layout);
index = g_utf8_offset_to_pointer (text, start) - text;
@@ -5053,7 +5053,7 @@ gtk_text_move_visually (GtkText *self,
GdkDisplay *display;
GdkSeat *seat;
GdkDevice *keyboard = NULL;
- PangoDirection direction = PANGO_DIRECTION_LTR;
+ Pango2Direction direction = PANGO2_DIRECTION_LTR;
display = gtk_widget_get_display (GTK_WIDGET (self));
seat = gdk_display_get_default_seat (display);
@@ -5071,14 +5071,14 @@ gtk_text_move_visually (GtkText *self,
if (count > 0)
{
- pango_lines_move_cursor (pango_layout_get_lines (layout), strong,
+ pango2_lines_move_cursor (pango2_layout_get_lines (layout), strong,
NULL, index, 0, 1,
NULL, &new_index, &new_trailing);
count--;
}
else
{
- pango_lines_move_cursor (pango_layout_get_lines (layout), strong,
+ pango2_lines_move_cursor (pango2_layout_get_lines (layout), strong,
NULL, index, 0, -1,
NULL, &new_index, &new_trailing);
count++;
@@ -5113,11 +5113,11 @@ gtk_text_move_logically (GtkText *self,
}
else
{
- PangoLayout *layout = gtk_text_ensure_layout (self, FALSE);
- const PangoLogAttr *log_attrs;
+ Pango2Layout *layout = gtk_text_ensure_layout (self, FALSE);
+ const Pango2LogAttr *log_attrs;
int n_attrs;
- log_attrs = pango_layout_get_log_attrs (layout, &n_attrs);
+ log_attrs = pango2_layout_get_log_attrs (layout, &n_attrs);
while (count > 0 && new_pos < length)
{
@@ -5157,11 +5157,11 @@ gtk_text_move_forward_word (GtkText *self,
}
else if (new_pos < length)
{
- PangoLayout *layout = gtk_text_ensure_layout (self, FALSE);
- const PangoLogAttr *log_attrs;
+ Pango2Layout *layout = gtk_text_ensure_layout (self, FALSE);
+ const Pango2LogAttr *log_attrs;
int n_attrs;
- log_attrs = pango_layout_get_log_attrs (layout, &n_attrs);
+ log_attrs = pango2_layout_get_log_attrs (layout, &n_attrs);
/* Find the next word boundary */
new_pos++;
@@ -5188,11 +5188,11 @@ gtk_text_move_backward_word (GtkText *self,
}
else if (start > 0)
{
- PangoLayout *layout = gtk_text_ensure_layout (self, FALSE);
- const PangoLogAttr *log_attrs;
+ Pango2Layout *layout = gtk_text_ensure_layout (self, FALSE);
+ const Pango2LogAttr *log_attrs;
int n_attrs;
- log_attrs = pango_layout_get_log_attrs (layout, &n_attrs);
+ log_attrs = pango2_layout_get_log_attrs (layout, &n_attrs);
new_pos = start - 1;
@@ -5209,12 +5209,12 @@ static void
gtk_text_delete_whitespace (GtkText *self)
{
GtkTextPrivate *priv = gtk_text_get_instance_private (self);
- PangoLayout *layout = gtk_text_ensure_layout (self, FALSE);
- const PangoLogAttr *log_attrs;
+ Pango2Layout *layout = gtk_text_ensure_layout (self, FALSE);
+ const Pango2LogAttr *log_attrs;
int n_attrs;
int start, end;
- log_attrs = pango_layout_get_log_attrs (layout, &n_attrs);
+ log_attrs = pango2_layout_get_log_attrs (layout, &n_attrs);
start = end = priv->current_pos;
@@ -5871,10 +5871,10 @@ gtk_text_set_max_width_chars (GtkText *self,
}
}
-PangoLayout *
+Pango2Layout *
gtk_text_get_layout (GtkText *self)
{
- PangoLayout *layout;
+ Pango2Layout *layout;
g_return_val_if_fail (GTK_IS_TEXT (self), NULL);
@@ -6647,7 +6647,7 @@ gtk_text_set_placeholder_text (GtkText *self,
"label", text,
"css-name", "placeholder",
"xalign", priv->xalign,
- "ellipsize", PANGO_ELLIPSIZE_END,
+ "ellipsize", PANGO2_ELLIPSIZE_END,
NULL);
gtk_label_set_attributes (GTK_LABEL (priv->placeholder), priv->attrs);
gtk_widget_insert_after (priv->placeholder, GTK_WIDGET (self), NULL);
@@ -6787,23 +6787,23 @@ gtk_text_get_input_hints (GtkText *self)
/**
* gtk_text_set_attributes: (attributes org.gtk.Method.set_property=attributes)
* @self: a `GtkText`
- * @attrs: (nullable): a `PangoAttrList`
+ * @attrs: (nullable): a `Pango2AttrList`
*
* Sets attributes that are applied to the text.
*/
void
gtk_text_set_attributes (GtkText *self,
- PangoAttrList *attrs)
+ Pango2AttrList *attrs)
{
GtkTextPrivate *priv = gtk_text_get_instance_private (self);
g_return_if_fail (GTK_IS_TEXT (self));
if (attrs)
- pango_attr_list_ref (attrs);
+ pango2_attr_list_ref (attrs);
if (priv->attrs)
- pango_attr_list_unref (priv->attrs);
+ pango2_attr_list_unref (priv->attrs);
priv->attrs = attrs;
if (priv->placeholder)
@@ -6825,7 +6825,7 @@ gtk_text_set_attributes (GtkText *self,
*
* Returns: (transfer none) (nullable): the attribute list
*/
-PangoAttrList *
+Pango2AttrList *
gtk_text_get_attributes (GtkText *self)
{
GtkTextPrivate *priv = gtk_text_get_instance_private (self);
@@ -6838,23 +6838,23 @@ gtk_text_get_attributes (GtkText *self)
/**
* gtk_text_set_tabs: (attributes org.gtk.Method.set_property=tabs)
* @self: a `GtkText`
- * @tabs: (nullable): a `PangoTabArray`
+ * @tabs: (nullable): a `Pango2TabArray`
*
* Sets tabstops that are applied to the text.
*/
void
gtk_text_set_tabs (GtkText *self,
- PangoTabArray *tabs)
+ Pango2TabArray *tabs)
{
GtkTextPrivate *priv = gtk_text_get_instance_private (self);
g_return_if_fail (GTK_IS_TEXT (self));
if (priv->tabs)
- pango_tab_array_free(priv->tabs);
+ pango2_tab_array_free(priv->tabs);
if (tabs)
- priv->tabs = pango_tab_array_copy (tabs);
+ priv->tabs = pango2_tab_array_copy (tabs);
else
priv->tabs = NULL;
@@ -6874,7 +6874,7 @@ gtk_text_set_tabs (GtkText *self,
*
* Returns: (nullable) (transfer none): the tabstops
*/
-PangoTabArray *
+Pango2TabArray *
gtk_text_get_tabs (GtkText *self)
{
GtkTextPrivate *priv = gtk_text_get_instance_private (self);
@@ -7147,41 +7147,41 @@ gtk_text_compute_cursor_extents (GtkText *self,
graphene_rect_t *strong,
graphene_rect_t *weak)
{
- PangoLayout *layout;
- PangoRectangle pango_strong_pos;
- PangoRectangle pango_weak_pos;
+ Pango2Layout *layout;
+ Pango2Rectangle pango2_strong_pos;
+ Pango2Rectangle pango2_weak_pos;
int offset_x, offset_y, index;
const char *text;
g_return_if_fail (GTK_IS_TEXT (self));
layout = gtk_text_ensure_layout (self, TRUE);
- text = pango_layout_get_text (layout);
+ text = pango2_layout_get_text (layout);
position = CLAMP (position, 0, g_utf8_strlen (text, -1));
index = g_utf8_offset_to_pointer (text, position) - text;
- pango_lines_get_cursor_pos (pango_layout_get_lines (layout),
+ pango2_lines_get_cursor_pos (pango2_layout_get_lines (layout),
NULL, index,
- strong ? &pango_strong_pos : NULL,
- weak ? &pango_weak_pos : NULL);
+ strong ? &pango2_strong_pos : NULL,
+ weak ? &pango2_weak_pos : NULL);
gtk_text_get_layout_offsets (self, &offset_x, &offset_y);
if (strong)
{
graphene_rect_init (strong,
- offset_x + pango_strong_pos.x / PANGO_SCALE,
- offset_y + pango_strong_pos.y / PANGO_SCALE,
+ offset_x + pango2_strong_pos.x / PANGO2_SCALE,
+ offset_y + pango2_strong_pos.y / PANGO2_SCALE,
0,
- pango_strong_pos.height / PANGO_SCALE);
+ pango2_strong_pos.height / PANGO2_SCALE);
}
if (weak)
{
graphene_rect_init (weak,
- offset_x + pango_weak_pos.x / PANGO_SCALE,
- offset_y + pango_weak_pos.y / PANGO_SCALE,
+ offset_x + pango2_weak_pos.x / PANGO2_SCALE,
+ offset_y + pango2_weak_pos.y / PANGO2_SCALE,
0,
- pango_weak_pos.height / PANGO_SCALE);
+ pango2_weak_pos.height / PANGO2_SCALE);
}
}
diff --git a/gtk/gtktext.h b/gtk/gtktext.h
index 4240aa92f5..7aa9b54570 100644
--- a/gtk/gtktext.h
+++ b/gtk/gtktext.h
@@ -120,16 +120,16 @@ GtkInputHints gtk_text_get_input_hints (GtkText *self);
GDK_AVAILABLE_IN_ALL
void gtk_text_set_attributes (GtkText *self,
- PangoAttrList *attrs);
+ Pango2AttrList *attrs);
GDK_AVAILABLE_IN_ALL
-PangoAttrList * gtk_text_get_attributes (GtkText *self);
+Pango2AttrList * gtk_text_get_attributes (GtkText *self);
GDK_AVAILABLE_IN_ALL
void gtk_text_set_tabs (GtkText *self,
- PangoTabArray *tabs);
+ Pango2TabArray *tabs);
GDK_AVAILABLE_IN_ALL
-PangoTabArray * gtk_text_get_tabs (GtkText *self);
+Pango2TabArray * gtk_text_get_tabs (GtkText *self);
GDK_AVAILABLE_IN_ALL
gboolean gtk_text_grab_focus_without_selecting (GtkText *self);
diff --git a/gtk/gtktextattributes.c b/gtk/gtktextattributes.c
index 6c4adb4de9..c90ae53478 100644
--- a/gtk/gtktextattributes.c
+++ b/gtk/gtktextattributes.c
@@ -119,10 +119,10 @@ gtk_text_attributes_copy_values (GtkTextAttributes *src,
/* Remove refs */
if (dest->tabs)
- pango_tab_array_free (dest->tabs);
+ pango2_tab_array_free (dest->tabs);
if (dest->font)
- pango_font_description_free (dest->font);
+ pango2_font_description_free (dest->font);
if (dest->pg_bg_rgba)
gdk_rgba_free (dest->pg_bg_rgba);
@@ -151,12 +151,12 @@ gtk_text_attributes_copy_values (GtkTextAttributes *src,
*dest = *src;
if (src->tabs)
- dest->tabs = pango_tab_array_copy (src->tabs);
+ dest->tabs = pango2_tab_array_copy (src->tabs);
dest->language = src->language;
if (src->font)
- dest->font = pango_font_description_copy (src->font);
+ dest->font = pango2_font_description_copy (src->font);
if (src->pg_bg_rgba)
dest->pg_bg_rgba = gdk_rgba_copy (src->pg_bg_rgba);
@@ -218,10 +218,10 @@ gtk_text_attributes_unref (GtkTextAttributes *values)
if (values->refcount == 0)
{
if (values->tabs)
- pango_tab_array_free (values->tabs);
+ pango2_tab_array_free (values->tabs);
if (values->font)
- pango_font_description_free (values->font);
+ pango2_font_description_free (values->font);
if (values->pg_bg_rgba)
gdk_rgba_free (values->pg_bg_rgba);
@@ -341,9 +341,9 @@ _gtk_text_attributes_fill_from_tags (GtkTextAttributes *dest,
if (vals->font)
{
if (dest->font)
- pango_font_description_merge (dest->font, vals->font, TRUE);
+ pango2_font_description_merge (dest->font, vals->font, TRUE);
else
- dest->font = pango_font_description_copy (vals->font);
+ dest->font = pango2_font_description_copy (vals->font);
}
/* multiply all the scales together to get a composite */
@@ -393,8 +393,8 @@ _gtk_text_attributes_fill_from_tags (GtkTextAttributes *dest,
if (tag->priv->tabs_set)
{
if (dest->tabs)
- pango_tab_array_free (dest->tabs);
- dest->tabs = pango_tab_array_copy (vals->tabs);
+ pango2_tab_array_free (dest->tabs);
+ dest->tabs = pango2_tab_array_copy (vals->tabs);
}
if (tag->priv->wrap_mode_set)
@@ -462,7 +462,7 @@ _gtk_text_tag_affects_size (GtkTextTag *tag)
GtkTextTagPrivate *priv = tag->priv;
return
- (priv->values->font && pango_font_description_get_set_fields (priv->values->font) != 0) ||
+ (priv->values->font && pango2_font_description_get_set_fields (priv->values->font) != 0) ||
priv->scale_set ||
priv->justification_set ||
priv->left_margin_set ||
diff --git a/gtk/gtktextattributes.h b/gtk/gtktextattributes.h
index c8c1af3e87..1665692657 100644
--- a/gtk/gtktextattributes.h
+++ b/gtk/gtktextattributes.h
@@ -71,10 +71,10 @@ struct _GtkTextAppearance
/* super/subscript rise, can be negative */
int rise;
- guint underline : 4; /* PangoLineStyle */
- guint overline : 4; /* PangoLineStyle */
- guint strikethrough : 4; /* PangoLineStyle */
- guint underline_position : 4; /* PangoUnderlinePosition */
+ guint underline : 4; /* Pango2LineStyle */
+ guint overline : 4; /* Pango2LineStyle */
+ guint strikethrough : 4; /* Pango2LineStyle */
+ guint underline_position : 4; /* Pango2UnderlinePosition */
/* Whether to use background-related values; this is irrelevant for
* the values struct when in a tag, but is used for the composite
@@ -96,7 +96,7 @@ struct _GtkTextAppearance
* @appearance: GtkTextAppearance for text.
* @justification: GtkJustification for text.
* @direction: GtkTextDirection for text.
- * @font: `PangoFontDescription` for text.
+ * @font: `Pango2FontDescription` for text.
* @font_scale: Font scale factor.
* @left_margin: Width of the left margin in pixels.
* @right_margin: Width of the right margin in pixels.
@@ -105,15 +105,15 @@ struct _GtkTextAppearance
* @pixels_below_lines: Pixels of blank space below paragraphs.
* @pixels_inside_wrap: Pixels of blank space between wrapped lines in
* a paragraph.
- * @tabs: Custom `PangoTabArray` for this text.
+ * @tabs: Custom `Pango2TabArray` for this text.
* @wrap_mode: `GtkWrapMode` for text.
- * @language: `PangoLanguage` for text.
+ * @language: `Pango2Language` for text.
* @invisible: Hide the text.
* @bg_full_height: Background is fit to full line height rather than
* baseline +/- ascent/descent (font height).
* @editable: Can edit this text.
* @no_fallback: Whether to disable font fallback.
- * @letter_spacing: Extra space to insert between graphemes, in Pango units
+ * @letter_spacing: Extra space to insert between graphemes, in Pango2 units
*
* Using GtkTextAttributes directly should rarely be necessary.
* It’s primarily useful with gtk_text_iter_get_attributes().
@@ -130,13 +130,13 @@ struct _GtkTextAttributes
GtkTextAppearance appearance;
- PangoFontDescription *font;
+ Pango2FontDescription *font;
char *font_features;
GdkRGBA *pg_bg_rgba;
- PangoTabArray *tabs;
- PangoLanguage *language;
+ Pango2TabArray *tabs;
+ Pango2Language *language;
double font_scale;
@@ -157,10 +157,10 @@ struct _GtkTextAttributes
guint editable : 1;
guint no_fallback: 1;
guint no_breaks : 1;
- guint show_spaces : 3; /* PangoShowFlags */
+ guint show_spaces : 3; /* Pango2ShowFlags */
guint no_hyphens : 1;
guint line_height_is_absolute : 1;
- guint text_transform : 3; /* PangoTextTransform */
+ guint text_transform : 3; /* Pango2TextTransform */
guint word : 1;
guint sentence : 1;
};
diff --git a/gtk/gtktextbtree.c b/gtk/gtktextbtree.c
index 6cfc39d494..b397a372bb 100644
--- a/gtk/gtktextbtree.c
+++ b/gtk/gtktextbtree.c
@@ -559,7 +559,7 @@ gtk_text_btree_resolve_bidi (GtkTextIter *start,
{
GtkTextBTree *tree = _gtk_text_iter_get_btree (start);
GtkTextLine *start_line, *end_line, *start_line_prev, *end_line_next, *line;
- PangoDirection last_strong, dir_above_propagated, dir_below_propagated;
+ Pango2Direction last_strong, dir_above_propagated, dir_below_propagated;
/* Resolve the strong bidi direction for all lines between
* start and end.
@@ -575,19 +575,19 @@ gtk_text_btree_resolve_bidi (GtkTextIter *start,
/* Loop through the segments and search for a strong character
*/
GtkTextLineSegment *seg = line->segments;
- line->dir_strong = PANGO_DIRECTION_NEUTRAL;
+ line->dir_strong = PANGO2_DIRECTION_NEUTRAL;
while (seg)
{
if (seg->type == >k_text_char_type && seg->byte_count > 0)
{
- PangoDirection pango_dir;
+ Pango2Direction pango2_dir;
- pango_dir = gdk_find_base_dir (seg->body.chars, seg->byte_count);
+ pango2_dir = gdk_find_base_dir (seg->body.chars, seg->byte_count);
- if (pango_dir != PANGO_DIRECTION_NEUTRAL)
+ if (pango2_dir != PANGO2_DIRECTION_NEUTRAL)
{
- line->dir_strong = pango_dir;
+ line->dir_strong = pango2_dir;
break;
}
}
@@ -603,7 +603,7 @@ gtk_text_btree_resolve_bidi (GtkTextIter *start,
* direction before start. It is neutral if start is in the beginning
* of the buffer.
*/
- dir_above_propagated = PANGO_DIRECTION_NEUTRAL;
+ dir_above_propagated = PANGO2_DIRECTION_NEUTRAL;
if (start_line_prev)
dir_above_propagated = start_line_prev->dir_propagated_forward;
@@ -614,7 +614,7 @@ gtk_text_btree_resolve_bidi (GtkTextIter *start,
last_strong = dir_above_propagated;
while (line != end_line_next)
{
- if (line->dir_strong != PANGO_DIRECTION_NEUTRAL)
+ if (line->dir_strong != PANGO2_DIRECTION_NEUTRAL)
last_strong = line->dir_strong;
line->dir_propagated_forward = last_strong;
@@ -629,7 +629,7 @@ gtk_text_btree_resolve_bidi (GtkTextIter *start,
GtkTextIter end_propagate;
while (line &&
- line->dir_strong == PANGO_DIRECTION_NEUTRAL &&
+ line->dir_strong == PANGO2_DIRECTION_NEUTRAL &&
line->dir_propagated_forward != last_strong)
{
GtkTextLine *prev = line;
@@ -661,7 +661,7 @@ gtk_text_btree_resolve_bidi (GtkTextIter *start,
* direction after end. It is neutral if end is at the end of
* the buffer.
*/
- dir_below_propagated = PANGO_DIRECTION_NEUTRAL;
+ dir_below_propagated = PANGO2_DIRECTION_NEUTRAL;
if (end_line_next)
dir_below_propagated = end_line_next->dir_propagated_back;
@@ -672,7 +672,7 @@ gtk_text_btree_resolve_bidi (GtkTextIter *start,
last_strong = dir_below_propagated;
while (line != start_line_prev)
{
- if (line->dir_strong != PANGO_DIRECTION_NEUTRAL)
+ if (line->dir_strong != PANGO2_DIRECTION_NEUTRAL)
last_strong = line->dir_strong;
line->dir_propagated_back = last_strong;
@@ -687,7 +687,7 @@ gtk_text_btree_resolve_bidi (GtkTextIter *start,
GtkTextIter start_propagate;
while (line &&
- line->dir_strong == PANGO_DIRECTION_NEUTRAL &&
+ line->dir_strong == PANGO2_DIRECTION_NEUTRAL &&
line->dir_propagated_back != last_strong)
{
GtkTextLine *prev = line;
@@ -705,7 +705,7 @@ gtk_text_btree_resolve_bidi (GtkTextIter *start,
* line we ended up on didn't get a direction from forwards
* propagation.
*/
- if (line && line->dir_propagated_forward == PANGO_DIRECTION_NEUTRAL)
+ if (line && line->dir_propagated_forward == PANGO2_DIRECTION_NEUTRAL)
{
_gtk_text_btree_get_iter_at_line (tree, &start_propagate, line, 0);
_gtk_text_btree_invalidate_region (tree, &start_propagate, start, FALSE);
@@ -1146,7 +1146,7 @@ _gtk_text_btree_insert (GtkTextIter *iter,
{
sol = eol;
- pango_find_paragraph_boundary (text + sol,
+ pango2_find_paragraph_boundary (text + sol,
len - sol,
&delim,
&eol);
@@ -4738,9 +4738,9 @@ gtk_text_line_new (void)
GtkTextLine *line;
line = g_slice_new0 (GtkTextLine);
- line->dir_strong = PANGO_DIRECTION_NEUTRAL;
- line->dir_propagated_forward = PANGO_DIRECTION_NEUTRAL;
- line->dir_propagated_back = PANGO_DIRECTION_NEUTRAL;
+ line->dir_strong = PANGO2_DIRECTION_NEUTRAL;
+ line->dir_propagated_forward = PANGO2_DIRECTION_NEUTRAL;
+ line->dir_propagated_back = PANGO2_DIRECTION_NEUTRAL;
return line;
}
diff --git a/gtk/gtktextbuffer.c b/gtk/gtktextbuffer.c
index 54f7800480..97d05b191a 100644
--- a/gtk/gtktextbuffer.c
+++ b/gtk/gtktextbuffer.c
@@ -4040,7 +4040,7 @@ gtk_text_buffer_backspace (GtkTextBuffer *buffer,
GtkTextIter start;
GtkTextIter end;
gboolean retval = FALSE;
- const PangoLogAttr *attrs;
+ const Pango2LogAttr *attrs;
int offset;
gboolean backspace_deletes_character;
@@ -4301,7 +4301,7 @@ struct _CacheEntry
{
int line;
int char_len;
- PangoLogAttr *attrs;
+ Pango2LogAttr *attrs;
};
struct _GtkTextLogAttrCache
@@ -4333,7 +4333,7 @@ clear_log_attr_cache (GtkTextLogAttrCache *cache)
}
}
-static PangoLogAttr*
+static Pango2LogAttr*
compute_log_attrs (const GtkTextIter *iter,
int *char_lenp)
{
@@ -4341,7 +4341,7 @@ compute_log_attrs (const GtkTextIter *iter,
GtkTextIter end;
char *paragraph;
int char_len, byte_len;
- PangoLogAttr *attrs = NULL;
+ Pango2LogAttr *attrs = NULL;
start = *iter;
end = *iter;
@@ -4356,12 +4356,12 @@ compute_log_attrs (const GtkTextIter *iter,
if (char_lenp != NULL)
*char_lenp = char_len;
- attrs = g_new (PangoLogAttr, char_len + 1);
+ attrs = g_new (Pango2LogAttr, char_len + 1);
- /* FIXME we need to follow PangoLayout and allow different language
+ /* FIXME we need to follow Pango2Layout and allow different language
* tags within the paragraph
*/
- pango_get_log_attrs (paragraph, byte_len, NULL, -1,
+ pango2_get_log_attrs (paragraph, byte_len, NULL, -1,
gtk_text_iter_get_language (&start),
attrs,
char_len + 1);
@@ -4372,9 +4372,9 @@ compute_log_attrs (const GtkTextIter *iter,
}
/* The return value from this is valid until you call this a second time.
- * Returns (char_len + 1) PangoLogAttr's, one for each text position.
+ * Returns (char_len + 1) Pango2LogAttr's, one for each text position.
*/
-const PangoLogAttr *
+const Pango2LogAttr *
_gtk_text_buffer_get_line_log_attrs (GtkTextBuffer *buffer,
const GtkTextIter *anywhere_in_line,
int *char_len)
@@ -4460,7 +4460,7 @@ _gtk_text_buffer_spew (GtkTextBuffer *buffer)
static void
insert_tags_for_attributes (GtkTextBuffer *buffer,
- PangoAttrIterator *iter,
+ Pango2AttrIterator *iter,
GtkTextIter *start,
GtkTextIter *end)
{
@@ -4473,7 +4473,7 @@ insert_tags_for_attributes (GtkTextBuffer *buffer,
#define LANGUAGE_ATTR(attr_name) \
{ \
- const char *language = pango_language_to_string (pango_attribute_get_language (attr)); \
+ const char *language = pango2_language_to_string (pango2_attribute_get_language (attr)); \
g_snprintf (name, 256, "language=%s", language); \
tag = gtk_text_tag_table_lookup (table, name); \
if (!tag) \
@@ -4488,7 +4488,7 @@ insert_tags_for_attributes (GtkTextBuffer *buffer,
#define STRING_ATTR(attr_name) \
{ \
- const char *string = pango_attribute_get_string (attr); \
+ const char *string = pango2_attribute_get_string (attr); \
g_snprintf (name, 256, #attr_name "=%s", string); \
tag = gtk_text_tag_table_lookup (table, name); \
if (!tag) \
@@ -4503,7 +4503,7 @@ insert_tags_for_attributes (GtkTextBuffer *buffer,
#define INT_ATTR(attr_name) \
{ \
- int value = pango_attribute_get_int (attr); \
+ int value = pango2_attribute_get_int (attr); \
g_snprintf (name, 256, #attr_name "=%d", value); \
tag = gtk_text_tag_table_lookup (table, name); \
if (!tag) \
@@ -4518,8 +4518,8 @@ insert_tags_for_attributes (GtkTextBuffer *buffer,
#define FONT_ATTR(attr_name) \
{ \
- PangoFontDescription *desc = pango_attribute_get_font_desc (attr); \
- char *str = pango_font_description_to_string (desc); \
+ Pango2FontDescription *desc = pango2_attribute_get_font_desc (attr); \
+ char *str = pango2_font_description_to_string (desc); \
g_snprintf (name, 256, "font-desc=%s", str); \
g_free (str); \
tag = gtk_text_tag_table_lookup (table, name); \
@@ -4535,7 +4535,7 @@ insert_tags_for_attributes (GtkTextBuffer *buffer,
#define FLOAT_ATTR(attr_name) \
{ \
- float value = pango_attribute_get_float (attr); \
+ float value = pango2_attribute_get_float (attr); \
g_snprintf (name, 256, #attr_name "=%g", value); \
tag = gtk_text_tag_table_lookup (table, name); \
if (!tag) \
@@ -4550,7 +4550,7 @@ insert_tags_for_attributes (GtkTextBuffer *buffer,
#define RGBA_ATTR(attr_name) \
{ \
- PangoColor *color = pango_attribute_get_color (attr); \
+ Pango2Color *color = pango2_attribute_get_color (attr); \
GdkRGBA rgba; \
rgba.red = color->red / 65535.; \
rgba.green = color->green / 65535.; \
@@ -4583,161 +4583,161 @@ insert_tags_for_attributes (GtkTextBuffer *buffer,
gtk_text_buffer_apply_tag (buffer, tag, start, end); \
}
- attrs = pango_attr_iterator_get_attrs (iter);
+ attrs = pango2_attr_iterator_get_attrs (iter);
for (l = attrs; l; l = l->next)
{
- PangoAttribute *attr = l->data;
+ Pango2Attribute *attr = l->data;
- switch (pango_attribute_type (attr))
+ switch (pango2_attribute_type (attr))
{
- case PANGO_ATTR_LANGUAGE:
+ case PANGO2_ATTR_LANGUAGE:
LANGUAGE_ATTR (language);
break;
- case PANGO_ATTR_FAMILY:
+ case PANGO2_ATTR_FAMILY:
STRING_ATTR (family);
break;
- case PANGO_ATTR_STYLE:
+ case PANGO2_ATTR_STYLE:
INT_ATTR (style);
break;
- case PANGO_ATTR_WEIGHT:
+ case PANGO2_ATTR_WEIGHT:
INT_ATTR (weight);
break;
- case PANGO_ATTR_VARIANT:
+ case PANGO2_ATTR_VARIANT:
INT_ATTR (variant);
break;
- case PANGO_ATTR_STRETCH:
+ case PANGO2_ATTR_STRETCH:
INT_ATTR (stretch);
break;
- case PANGO_ATTR_SIZE:
+ case PANGO2_ATTR_SIZE:
INT_ATTR (size);
break;
- case PANGO_ATTR_FONT_DESC:
+ case PANGO2_ATTR_FONT_DESC:
FONT_ATTR (font_desc);
break;
- case PANGO_ATTR_FOREGROUND:
+ case PANGO2_ATTR_FOREGROUND:
RGBA_ATTR (foreground_rgba);
break;
- case PANGO_ATTR_BACKGROUND:
+ case PANGO2_ATTR_BACKGROUND:
RGBA_ATTR (background_rgba);
break;
- case PANGO_ATTR_UNDERLINE:
+ case PANGO2_ATTR_UNDERLINE:
INT_ATTR (underline);
break;
- case PANGO_ATTR_UNDERLINE_POSITION:
+ case PANGO2_ATTR_UNDERLINE_POSITION:
INT_ATTR (underline_position);
break;
- case PANGO_ATTR_UNDERLINE_COLOR:
+ case PANGO2_ATTR_UNDERLINE_COLOR:
RGBA_ATTR (underline_rgba);
break;
- case PANGO_ATTR_OVERLINE:
+ case PANGO2_ATTR_OVERLINE:
INT_ATTR (overline);
break;
- case PANGO_ATTR_OVERLINE_COLOR:
+ case PANGO2_ATTR_OVERLINE_COLOR:
RGBA_ATTR (overline_rgba);
break;
- case PANGO_ATTR_STRIKETHROUGH:
+ case PANGO2_ATTR_STRIKETHROUGH:
INT_ATTR (strikethrough);
break;
- case PANGO_ATTR_STRIKETHROUGH_COLOR:
+ case PANGO2_ATTR_STRIKETHROUGH_COLOR:
RGBA_ATTR (strikethrough_rgba);
break;
- case PANGO_ATTR_RISE:
+ case PANGO2_ATTR_RISE:
INT_ATTR (rise);
break;
- case PANGO_ATTR_SCALE:
+ case PANGO2_ATTR_SCALE:
FLOAT_ATTR (scale);
break;
- case PANGO_ATTR_FALLBACK:
+ case PANGO2_ATTR_FALLBACK:
INT_ATTR (fallback);
break;
- case PANGO_ATTR_LETTER_SPACING:
+ case PANGO2_ATTR_LETTER_SPACING:
INT_ATTR (letter_spacing);
break;
- case PANGO_ATTR_LINE_HEIGHT:
+ case PANGO2_ATTR_LINE_HEIGHT:
FLOAT_ATTR (line_height);
break;
- case PANGO_ATTR_LINE_SPACING:
+ case PANGO2_ATTR_LINE_SPACING:
INT_ATTR (pixels_inside_wrap);
break;
- case PANGO_ATTR_ABSOLUTE_LINE_HEIGHT:
+ case PANGO2_ATTR_ABSOLUTE_LINE_HEIGHT:
break;
- case PANGO_ATTR_FONT_FEATURES:
+ case PANGO2_ATTR_FONT_FEATURES:
STRING_ATTR (font_features);
break;
- case PANGO_ATTR_ALLOW_BREAKS:
+ case PANGO2_ATTR_ALLOW_BREAKS:
INT_ATTR (allow_breaks);
break;
- case PANGO_ATTR_SHOW:
+ case PANGO2_ATTR_SHOW:
INT_ATTR (show_spaces);
break;
- case PANGO_ATTR_INSERT_HYPHENS:
+ case PANGO2_ATTR_INSERT_HYPHENS:
INT_ATTR (insert_hyphens);
break;
- case PANGO_ATTR_TEXT_TRANSFORM:
+ case PANGO2_ATTR_TEXT_TRANSFORM:
INT_ATTR (text_transform);
break;
- case PANGO_ATTR_WORD:
+ case PANGO2_ATTR_WORD:
VOID_ATTR (word);
break;
- case PANGO_ATTR_SENTENCE:
+ case PANGO2_ATTR_SENTENCE:
VOID_ATTR (sentence);
break;
- case PANGO_ATTR_PARAGRAPH:
+ case PANGO2_ATTR_PARAGRAPH:
VOID_ATTR (paragraph);
break;
- case PANGO_ATTR_BASELINE_SHIFT:
+ case PANGO2_ATTR_BASELINE_SHIFT:
INT_ATTR (baseline_shift);
break;
- case PANGO_ATTR_FONT_SCALE:
+ case PANGO2_ATTR_FONT_SCALE:
INT_ATTR (font_scale);
break;
- case PANGO_ATTR_ABSOLUTE_SIZE:
- case PANGO_ATTR_GRAVITY:
- case PANGO_ATTR_GRAVITY_HINT:
+ case PANGO2_ATTR_ABSOLUTE_SIZE:
+ case PANGO2_ATTR_GRAVITY:
+ case PANGO2_ATTR_GRAVITY_HINT:
break;
- case PANGO_ATTR_INVALID:
+ case PANGO2_ATTR_INVALID:
default:
g_assert_not_reached ();
break;
}
}
- g_slist_free_full (attrs, (GDestroyNotify)pango_attribute_destroy);
+ g_slist_free_full (attrs, (GDestroyNotify)pango2_attribute_destroy);
#undef LANGUAGE_ATTR
#undef STRING_ATTR
@@ -4751,10 +4751,10 @@ static void
gtk_text_buffer_insert_with_attributes (GtkTextBuffer *buffer,
GtkTextIter *iter,
const char *text,
- PangoAttrList *attributes)
+ Pango2AttrList *attributes)
{
GtkTextMark *mark;
- PangoAttrIterator *attr;
+ Pango2AttrIterator *attr;
g_return_if_fail (GTK_IS_TEXT_BUFFER (buffer));
@@ -4766,7 +4766,7 @@ gtk_text_buffer_insert_with_attributes (GtkTextBuffer *buffer,
/* create mark with right gravity */
mark = gtk_text_buffer_create_mark (buffer, NULL, iter, FALSE);
- attr = pango_attr_list_get_iterator (attributes);
+ attr = pango2_attr_list_get_iterator (attributes);
do
{
@@ -4774,7 +4774,7 @@ gtk_text_buffer_insert_with_attributes (GtkTextBuffer *buffer,
int start_offset;
GtkTextIter start_iter;
- pango_attr_iterator_range (attr, &start, &end);
+ pango2_attr_iterator_range (attr, &start, &end);
if (end == G_MAXINT) /* last chunk */
end = start - 1; /* resulting in -1 to be passed to _insert */
@@ -4787,17 +4787,17 @@ gtk_text_buffer_insert_with_attributes (GtkTextBuffer *buffer,
gtk_text_buffer_get_iter_at_mark (buffer, iter, mark);
}
- while (pango_attr_iterator_next (attr));
+ while (pango2_attr_iterator_next (attr));
gtk_text_buffer_delete_mark (buffer, mark);
- pango_attr_iterator_destroy (attr);
+ pango2_attr_iterator_destroy (attr);
}
/**
* gtk_text_buffer_insert_markup:
* @buffer: a `GtkTextBuffer`
* @iter: location to insert the markup
- * @markup: a nul-terminated UTF-8 string containing Pango markup
+ * @markup: a nul-terminated UTF-8 string containing Pango2 markup
* @len: length of @markup in bytes, or -1
*
* Inserts the text in @markup at position @iter.
@@ -4813,11 +4813,11 @@ gtk_text_buffer_insert_markup (GtkTextBuffer *buffer,
const char *markup,
int len)
{
- PangoAttrList *attributes;
+ Pango2AttrList *attributes;
char *text;
GError *error = NULL;
- if (!pango_parse_markup (markup, len, 0, &attributes, &text, NULL, &error))
+ if (!pango2_parse_markup (markup, len, 0, &attributes, &text, NULL, &error))
{
g_warning ("Invalid markup string: %s", error->message);
g_error_free (error);
@@ -4826,7 +4826,7 @@ gtk_text_buffer_insert_markup (GtkTextBuffer *buffer,
gtk_text_buffer_insert_with_attributes (buffer, iter, text, attributes);
- pango_attr_list_unref (attributes);
+ pango2_attr_list_unref (attributes);
g_free (text);
}
diff --git a/gtk/gtktextbufferprivate.h b/gtk/gtktextbufferprivate.h
index b67e22a38e..705c765e14 100644
--- a/gtk/gtktextbufferprivate.h
+++ b/gtk/gtktextbufferprivate.h
@@ -27,7 +27,7 @@ void _gtk_text_buffer_spew (GtkTextBuffer *buff
GtkTextBTree* _gtk_text_buffer_get_btree (GtkTextBuffer *buffer);
-const PangoLogAttr* _gtk_text_buffer_get_line_log_attrs (GtkTextBuffer *buffer,
+const Pango2LogAttr* _gtk_text_buffer_get_line_log_attrs (GtkTextBuffer *buffer,
const GtkTextIter *anywhere_in_line,
int *char_len);
diff --git a/gtk/gtktextiter.c b/gtk/gtktextiter.c
index 7da46fda8c..2644a497f0 100644
--- a/gtk/gtktextiter.c
+++ b/gtk/gtktextiter.c
@@ -1535,11 +1535,11 @@ gtk_text_iter_get_attributes (const GtkTextIter *iter,
*
* Returns: (transfer full): language in effect at @iter
*/
-PangoLanguage *
+Pango2Language *
gtk_text_iter_get_language (const GtkTextIter *iter)
{
GtkTextAttributes *values;
- PangoLanguage *retval;
+ Pango2Language *retval;
values = gtk_text_attributes_new ();
@@ -2922,13 +2922,13 @@ gtk_text_iter_backward_visible_lines (GtkTextIter *iter,
}
}
-typedef gboolean (* FindLogAttrFunc) (const PangoLogAttr *attrs,
+typedef gboolean (* FindLogAttrFunc) (const Pango2LogAttr *attrs,
int offset,
int len,
int *found_offset,
gboolean already_moved_initially);
-typedef gboolean (* TestLogAttrFunc) (const PangoLogAttr *attrs,
+typedef gboolean (* TestLogAttrFunc) (const Pango2LogAttr *attrs,
int offset,
int min_offset,
int len);
@@ -2936,7 +2936,7 @@ typedef gboolean (* TestLogAttrFunc) (const PangoLogAttr *attrs,
/* Word funcs */
static gboolean
-find_word_end_func (const PangoLogAttr *attrs,
+find_word_end_func (const Pango2LogAttr *attrs,
int offset,
int len,
int *found_offset,
@@ -2961,7 +2961,7 @@ find_word_end_func (const PangoLogAttr *attrs,
}
static gboolean
-is_word_end_func (const PangoLogAttr *attrs,
+is_word_end_func (const Pango2LogAttr *attrs,
int offset,
int min_offset,
int len)
@@ -2970,7 +2970,7 @@ is_word_end_func (const PangoLogAttr *attrs,
}
static gboolean
-find_word_start_func (const PangoLogAttr *attrs,
+find_word_start_func (const Pango2LogAttr *attrs,
int offset,
int len,
int *found_offset,
@@ -2995,7 +2995,7 @@ find_word_start_func (const PangoLogAttr *attrs,
}
static gboolean
-is_word_start_func (const PangoLogAttr *attrs,
+is_word_start_func (const Pango2LogAttr *attrs,
int offset,
int min_offset,
int len)
@@ -3004,7 +3004,7 @@ is_word_start_func (const PangoLogAttr *attrs,
}
static gboolean
-inside_word_func (const PangoLogAttr *attrs,
+inside_word_func (const Pango2LogAttr *attrs,
int offset,
int min_offset,
int len)
@@ -3023,7 +3023,7 @@ inside_word_func (const PangoLogAttr *attrs,
/* Sentence funcs */
static gboolean
-find_sentence_end_func (const PangoLogAttr *attrs,
+find_sentence_end_func (const Pango2LogAttr *attrs,
int offset,
int len,
int *found_offset,
@@ -3048,7 +3048,7 @@ find_sentence_end_func (const PangoLogAttr *attrs,
}
static gboolean
-is_sentence_end_func (const PangoLogAttr *attrs,
+is_sentence_end_func (const Pango2LogAttr *attrs,
int offset,
int min_offset,
int len)
@@ -3057,7 +3057,7 @@ is_sentence_end_func (const PangoLogAttr *attrs,
}
static gboolean
-find_sentence_start_func (const PangoLogAttr *attrs,
+find_sentence_start_func (const Pango2LogAttr *attrs,
int offset,
int len,
int *found_offset,
@@ -3082,7 +3082,7 @@ find_sentence_start_func (const PangoLogAttr *attrs,
}
static gboolean
-is_sentence_start_func (const PangoLogAttr *attrs,
+is_sentence_start_func (const Pango2LogAttr *attrs,
int offset,
int min_offset,
int len)
@@ -3091,7 +3091,7 @@ is_sentence_start_func (const PangoLogAttr *attrs,
}
static gboolean
-inside_sentence_func (const PangoLogAttr *attrs,
+inside_sentence_func (const Pango2LogAttr *attrs,
int offset,
int min_offset,
int len)
@@ -3112,7 +3112,7 @@ test_log_attrs (const GtkTextIter *iter,
TestLogAttrFunc func)
{
int char_len;
- const PangoLogAttr *attrs;
+ const Pango2LogAttr *attrs;
int offset;
g_return_val_if_fail (iter != NULL, FALSE);
@@ -3134,7 +3134,7 @@ find_line_log_attrs (const GtkTextIter *iter,
gboolean already_moved_initially)
{
int char_len;
- const PangoLogAttr *attrs;
+ const Pango2LogAttr *attrs;
int offset;
g_return_val_if_fail (iter != NULL, FALSE);
@@ -3625,7 +3625,7 @@ gtk_text_iter_backward_sentence_starts (GtkTextIter *iter,
}
static gboolean
-find_forward_cursor_pos_func (const PangoLogAttr *attrs,
+find_forward_cursor_pos_func (const Pango2LogAttr *attrs,
int offset,
int len,
int *found_offset,
@@ -3649,7 +3649,7 @@ find_forward_cursor_pos_func (const PangoLogAttr *attrs,
}
static gboolean
-find_backward_cursor_pos_func (const PangoLogAttr *attrs,
+find_backward_cursor_pos_func (const Pango2LogAttr *attrs,
int offset,
int len,
int *found_offset,
@@ -3673,7 +3673,7 @@ find_backward_cursor_pos_func (const PangoLogAttr *attrs,
}
static gboolean
-is_cursor_pos_func (const PangoLogAttr *attrs,
+is_cursor_pos_func (const Pango2LogAttr *attrs,
int offset,
int min_offset,
int len)
@@ -3698,7 +3698,7 @@ is_cursor_pos_func (const PangoLogAttr *attrs,
* the letter then a "combining mark" that causes the accent to be
* rendered; so the cursor can’t go between those two characters.
*
- * See also the [struct@Pango.LogAttr] struct and the [func@Pango.break]
+ * See also the [struct@Pango2.LogAttr] struct and the [func@Pango2.break]
* function.
*
* Returns: %TRUE if we moved and the new position is dereferenceable
@@ -3842,7 +3842,7 @@ gtk_text_iter_backward_visible_cursor_positions (GtkTextIter *iter,
* Determine if @iter is at a cursor position.
*
* See [method@Gtk.TextIter.forward_cursor_position] or
- * [struct@Pango.LogAttr] or [func@Pango.break] for details
+ * [struct@Pango2.LogAttr] or [func@Pango2.break] for details
* on what a cursor position is.
*
* Returns: %TRUE if the cursor can be placed at @iter
diff --git a/gtk/gtktextiter.h b/gtk/gtktextiter.h
index 3a3107e49a..9886597a88 100644
--- a/gtk/gtktextiter.h
+++ b/gtk/gtktextiter.h
@@ -219,7 +219,7 @@ GDK_AVAILABLE_IN_ALL
int gtk_text_iter_get_bytes_in_line (const GtkTextIter *iter);
GDK_AVAILABLE_IN_ALL
-PangoLanguage* gtk_text_iter_get_language (const GtkTextIter *iter);
+Pango2Language* gtk_text_iter_get_language (const GtkTextIter *iter);
GDK_AVAILABLE_IN_ALL
gboolean gtk_text_iter_is_end (const GtkTextIter *iter);
GDK_AVAILABLE_IN_ALL
diff --git a/gtk/gtktextlayout.c b/gtk/gtktextlayout.c
index afcbbc5566..e76985c510 100644
--- a/gtk/gtktextlayout.c
+++ b/gtk/gtktextlayout.c
@@ -5,7 +5,7 @@
* Copyright (c) 1994-1997 Sun Microsystems, Inc.
* Copyright (c) 2000 Red Hat, Inc.
* Tk->Gtk port by Havoc Pennington
- * Pango support by Owen Taylor
+ * Pango2 support by Owen Taylor
*
* This file can be used under your choice of two licenses, the LGPL
* and the original Tk license.
@@ -125,7 +125,7 @@ static void gtk_text_layout_emit_changed (GtkTextLayout *layout,
static void gtk_text_layout_invalidate_all (GtkTextLayout *layout);
-static PangoAttribute *gtk_text_attr_appearance_new (const GtkTextAppearance *appearance);
+static Pango2Attribute *gtk_text_attr_appearance_new (const GtkTextAppearance *appearance);
static void gtk_text_layout_after_mark_set_handler (GtkTextBuffer *buffer,
const GtkTextIter *location,
@@ -179,11 +179,11 @@ enum {
LAST_ARG
};
-#define PIXEL_BOUND(d) (((d) + PANGO_SCALE - 1) / PANGO_SCALE)
+#define PIXEL_BOUND(d) (((d) + PANGO2_SCALE - 1) / PANGO2_SCALE)
static guint signals[LAST_SIGNAL] = { 0 };
-PangoAttrType gtk_text_attr_appearance_type = 0;
+Pango2AttrType gtk_text_attr_appearance_type = 0;
G_DEFINE_TYPE_WITH_PRIVATE (GtkTextLayout, gtk_text_layout, G_TYPE_OBJECT)
@@ -208,7 +208,7 @@ gtk_text_layout_dispose (GObject *object)
if (layout->preedit_attrs != NULL)
{
- pango_attr_list_unref (layout->preedit_attrs);
+ pango2_attr_list_unref (layout->preedit_attrs);
layout->preedit_attrs = NULL;
}
@@ -402,8 +402,8 @@ gtk_text_layout_set_default_style (GtkTextLayout *layout,
void
gtk_text_layout_set_contexts (GtkTextLayout *layout,
- PangoContext *ltr_context,
- PangoContext *rtl_context)
+ Pango2Context *ltr_context,
+ Pango2Context *rtl_context)
{
g_return_if_fail (GTK_IS_TEXT_LAYOUT (layout));
@@ -576,9 +576,9 @@ gtk_text_layout_get_cursor_visible (GtkTextLayout *layout)
/**
* gtk_text_layout_set_preedit_string:
- * @layout: a `PangoLayout`
+ * @layout: a `Pango2Layout`
* @preedit_string: a string to display at the insertion point
- * @preedit_attrs: a `PangoAttrList` of attributes that apply to @preedit_string
+ * @preedit_attrs: a `Pango2AttrList` of attributes that apply to @preedit_string
* @cursor_pos: position of cursor within preedit string in chars
*
* Set the preedit string and attributes. The preedit string is a
@@ -588,7 +588,7 @@ gtk_text_layout_get_cursor_visible (GtkTextLayout *layout)
void
gtk_text_layout_set_preedit_string (GtkTextLayout *layout,
const char *preedit_string,
- PangoAttrList *preedit_attrs,
+ Pango2AttrList *preedit_attrs,
int cursor_pos)
{
g_return_if_fail (GTK_IS_TEXT_LAYOUT (layout));
@@ -597,13 +597,13 @@ gtk_text_layout_set_preedit_string (GtkTextLayout *layout,
g_free (layout->preedit_string);
if (layout->preedit_attrs)
- pango_attr_list_unref (layout->preedit_attrs);
+ pango2_attr_list_unref (layout->preedit_attrs);
if (preedit_string)
{
layout->preedit_string = g_strdup (preedit_string);
layout->preedit_len = strlen (layout->preedit_string);
- pango_attr_list_ref (preedit_attrs);
+ pango2_attr_list_ref (preedit_attrs);
layout->preedit_attrs = preedit_attrs;
cursor_pos = CLAMP (cursor_pos, 0, g_utf8_strlen (layout->preedit_string, -1));
@@ -1058,7 +1058,7 @@ gtk_text_layout_wrap (GtkTextLayout *layout,
GtkTextLineData *line_data)
{
GtkTextLineDisplay *display;
- PangoRectangle ink_rect, logical_rect;
+ Pango2Rectangle ink_rect, logical_rect;
g_return_val_if_fail (GTK_IS_TEXT_LAYOUT (layout), NULL);
g_return_val_if_fail (line != NULL, NULL);
@@ -1073,9 +1073,9 @@ gtk_text_layout_wrap (GtkTextLayout *layout,
line_data->width = display->width;
line_data->height = display->height;
line_data->valid = TRUE;
- pango_lines_get_extents (pango_layout_get_lines (display->layout), &ink_rect, &logical_rect);
- pango_extents_to_pixels (&ink_rect, NULL);
- pango_extents_to_pixels (&logical_rect, NULL);
+ pango2_lines_get_extents (pango2_layout_get_lines (display->layout), &ink_rect, &logical_rect);
+ pango2_extents_to_pixels (&ink_rect, NULL);
+ pango2_extents_to_pixels (&logical_rect, NULL);
line_data->top_ink = MAX (0, logical_rect.x - ink_rect.x);
line_data->bottom_ink = MAX (0, logical_rect.x + logical_rect.width - ink_rect.x - ink_rect.width);
gtk_text_line_display_unref (display);
@@ -1204,66 +1204,66 @@ totally_invisible_line (GtkTextLayout *layout,
static void
set_para_values (GtkTextLayout *layout,
- PangoDirection base_dir,
+ Pango2Direction base_dir,
GtkTextAttributes *style,
GtkTextLineDisplay *display)
{
- PangoAlignment pango_align = PANGO_ALIGN_LEFT;
- PangoWrapMode pango_wrap = PANGO_WRAP_WORD;
+ Pango2Alignment pango2_align = PANGO2_ALIGN_LEFT;
+ Pango2WrapMode pango2_wrap = PANGO2_WRAP_WORD;
int h_margin;
int h_padding;
switch (base_dir)
{
/* If no base direction was found, then use the style direction */
- case PANGO_DIRECTION_NEUTRAL :
+ case PANGO2_DIRECTION_NEUTRAL :
display->direction = style->direction;
/* Override the base direction */
if (display->direction == GTK_TEXT_DIR_RTL)
- base_dir = PANGO_DIRECTION_RTL;
+ base_dir = PANGO2_DIRECTION_RTL;
else
- base_dir = PANGO_DIRECTION_LTR;
+ base_dir = PANGO2_DIRECTION_LTR;
break;
- case PANGO_DIRECTION_RTL :
+ case PANGO2_DIRECTION_RTL :
display->direction = GTK_TEXT_DIR_RTL;
break;
- case PANGO_DIRECTION_LTR:
- case PANGO_DIRECTION_WEAK_LTR:
- case PANGO_DIRECTION_WEAK_RTL:
+ case PANGO2_DIRECTION_LTR:
+ case PANGO2_DIRECTION_WEAK_LTR:
+ case PANGO2_DIRECTION_WEAK_RTL:
default:
display->direction = GTK_TEXT_DIR_LTR;
break;
}
if (display->direction == GTK_TEXT_DIR_RTL)
- display->layout = pango_layout_new (layout->rtl_context);
+ display->layout = pango2_layout_new (layout->rtl_context);
else
- display->layout = pango_layout_new (layout->ltr_context);
+ display->layout = pango2_layout_new (layout->ltr_context);
switch (style->justification)
{
case GTK_JUSTIFY_LEFT:
case GTK_JUSTIFY_RIGHT:
- pango_align = PANGO_ALIGN_NATURAL;
+ pango2_align = PANGO2_ALIGN_NATURAL;
break;
case GTK_JUSTIFY_CENTER:
- pango_align = PANGO_ALIGN_CENTER;
+ pango2_align = PANGO2_ALIGN_CENTER;
break;
case GTK_JUSTIFY_FILL:
- pango_align = GTK_JUSTIFY_FILL;
+ pango2_align = GTK_JUSTIFY_FILL;
break;
default:
g_assert_not_reached ();
break;
}
- pango_layout_set_alignment (display->layout, pango_align);
- pango_layout_set_spacing (display->layout, style->pixels_inside_wrap * PANGO_SCALE);
+ pango2_layout_set_alignment (display->layout, pango2_align);
+ pango2_layout_set_spacing (display->layout, style->pixels_inside_wrap * PANGO2_SCALE);
if (style->tabs)
- pango_layout_set_tabs (display->layout, style->tabs);
+ pango2_layout_set_tabs (display->layout, style->tabs);
display->top_margin = style->pixels_above_lines;
display->height = style->pixels_above_lines + style->pixels_below_lines;
@@ -1273,20 +1273,20 @@ set_para_values (GtkTextLayout *layout,
display->x_offset = display->left_margin;
- pango_layout_set_indent (display->layout,
- style->indent * PANGO_SCALE);
+ pango2_layout_set_indent (display->layout,
+ style->indent * PANGO2_SCALE);
switch (style->wrap_mode)
{
case GTK_WRAP_CHAR:
- pango_wrap = PANGO_WRAP_CHAR;
+ pango2_wrap = PANGO2_WRAP_CHAR;
break;
case GTK_WRAP_WORD:
- pango_wrap = PANGO_WRAP_WORD;
+ pango2_wrap = PANGO2_WRAP_WORD;
break;
case GTK_WRAP_WORD_CHAR:
- pango_wrap = PANGO_WRAP_WORD_CHAR;
+ pango2_wrap = PANGO2_WRAP_WORD_CHAR;
break;
case GTK_WRAP_NONE:
@@ -1300,8 +1300,8 @@ set_para_values (GtkTextLayout *layout,
if (style->wrap_mode != GTK_WRAP_NONE)
{
int layout_width = (layout->screen_width - h_margin - h_padding);
- pango_layout_set_width (display->layout, layout_width * PANGO_SCALE);
- pango_layout_set_wrap (display->layout, pango_wrap);
+ pango2_layout_set_width (display->layout, layout_width * PANGO2_SCALE);
+ pango2_layout_set_wrap (display->layout, pango2_wrap);
}
display->total_width = MAX (layout->screen_width, layout->width) - h_margin - h_padding;
@@ -1420,29 +1420,29 @@ gtk_text_attr_appearance_compare (gconstpointer data1,
overline_equal (appearance1, appearance2);
}
-static PangoAttribute *
+static Pango2Attribute *
gtk_text_attr_appearance_new (const GtkTextAppearance *appearance)
{
- PangoAttribute *attr;
+ Pango2Attribute *attr;
if (gtk_text_attr_appearance_type == 0)
gtk_text_attr_appearance_type =
- pango_attr_type_register ("appearance",
- PANGO_ATTR_VALUE_POINTER,
- PANGO_ATTR_AFFECTS_RENDERING,
- PANGO_ATTR_MERGE_OVERRIDES,
+ pango2_attr_type_register ("appearance",
+ PANGO2_ATTR_VALUE_POINTER,
+ PANGO2_ATTR_AFFECTS_RENDERING,
+ PANGO2_ATTR_MERGE_OVERRIDES,
gtk_text_attr_appearance_copy,
gtk_text_attr_appearance_destroy,
gtk_text_attr_appearance_compare,
NULL);
- attr = pango_attribute_new (gtk_text_attr_appearance_type, appearance);
+ attr = pango2_attribute_new (gtk_text_attr_appearance_type, appearance);
return attr;
}
static void
-convert_pango_color (PangoColor *result,
+convert_pango2_color (Pango2Color *result,
const GdkRGBA *rgba)
{
result->red = rgba->red * 65535.;
@@ -1455,79 +1455,79 @@ static void
add_generic_attrs (GtkTextLayout *layout,
GtkTextAppearance *appearance,
int byte_count,
- PangoAttrList *attrs,
+ Pango2AttrList *attrs,
int start,
gboolean size_only,
gboolean is_text)
{
- PangoAttribute *attr;
- PangoColor color;
+ Pango2Attribute *attr;
+ Pango2Color color;
- if (appearance->underline != PANGO_LINE_STYLE_NONE)
+ if (appearance->underline != PANGO2_LINE_STYLE_NONE)
{
- attr = pango_attr_underline_new (appearance->underline);
- pango_attribute_set_range (attr, start, start + byte_count);
- pango_attr_list_insert (attrs, attr);
+ attr = pango2_attr_underline_new (appearance->underline);
+ pango2_attribute_set_range (attr, start, start + byte_count);
+ pango2_attr_list_insert (attrs, attr);
}
- if (appearance->underline_position != PANGO_UNDERLINE_POSITION_NORMAL)
+ if (appearance->underline_position != PANGO2_UNDERLINE_POSITION_NORMAL)
{
- attr = pango_attr_underline_position_new (appearance->underline_position);
- pango_attribute_set_range (attr, start, start + byte_count);
- pango_attr_list_insert (attrs, attr);
+ attr = pango2_attr_underline_position_new (appearance->underline_position);
+ pango2_attribute_set_range (attr, start, start + byte_count);
+ pango2_attr_list_insert (attrs, attr);
}
if (appearance->underline_rgba)
{
- convert_pango_color (&color, appearance->underline_rgba);
- attr = pango_attr_underline_color_new (&color);
- pango_attribute_set_range (attr, start, start + byte_count);
- pango_attr_list_insert (attrs, attr);
+ convert_pango2_color (&color, appearance->underline_rgba);
+ attr = pango2_attr_underline_color_new (&color);
+ pango2_attribute_set_range (attr, start, start + byte_count);
+ pango2_attr_list_insert (attrs, attr);
}
- if (appearance->overline != PANGO_LINE_STYLE_NONE)
+ if (appearance->overline != PANGO2_LINE_STYLE_NONE)
{
- attr = pango_attr_overline_new (appearance->overline);
- pango_attribute_set_range (attr, start, start + byte_count);
- pango_attr_list_insert (attrs, attr);
+ attr = pango2_attr_overline_new (appearance->overline);
+ pango2_attribute_set_range (attr, start, start + byte_count);
+ pango2_attr_list_insert (attrs, attr);
}
if (appearance->overline_rgba)
{
- convert_pango_color (&color, appearance->overline_rgba);
- attr = pango_attr_overline_color_new (&color);
- pango_attribute_set_range (attr, start, start + byte_count);
- pango_attr_list_insert (attrs, attr);
+ convert_pango2_color (&color, appearance->overline_rgba);
+ attr = pango2_attr_overline_color_new (&color);
+ pango2_attribute_set_range (attr, start, start + byte_count);
+ pango2_attr_list_insert (attrs, attr);
}
if (appearance->strikethrough)
{
- attr = pango_attr_strikethrough_new (appearance->strikethrough);
- pango_attribute_set_range (attr, start, start + byte_count);
- pango_attr_list_insert (attrs, attr);
+ attr = pango2_attr_strikethrough_new (appearance->strikethrough);
+ pango2_attribute_set_range (attr, start, start + byte_count);
+ pango2_attr_list_insert (attrs, attr);
}
if (appearance->strikethrough_rgba)
{
- convert_pango_color (&color, appearance->strikethrough_rgba);
- attr = pango_attr_strikethrough_color_new (&color);
- pango_attribute_set_range (attr, start, start + byte_count);
- pango_attr_list_insert (attrs, attr);
+ convert_pango2_color (&color, appearance->strikethrough_rgba);
+ attr = pango2_attr_strikethrough_color_new (&color);
+ pango2_attribute_set_range (attr, start, start + byte_count);
+ pango2_attr_list_insert (attrs, attr);
}
if (appearance->rise != 0)
{
- attr = pango_attr_rise_new (appearance->rise);
- pango_attribute_set_range (attr, start, start + byte_count);
- pango_attr_list_insert (attrs, attr);
+ attr = pango2_attr_rise_new (appearance->rise);
+ pango2_attribute_set_range (attr, start, start + byte_count);
+ pango2_attr_list_insert (attrs, attr);
}
if (!size_only)
{
attr = gtk_text_attr_appearance_new (appearance);
- pango_attribute_set_range (attr, start, start + byte_count);
- ((GtkTextAppearance *) pango_attribute_get_pointer (attr))->is_text = is_text;
- pango_attr_list_insert (attrs, attr);
+ pango2_attribute_set_range (attr, start, start + byte_count);
+ ((GtkTextAppearance *) pango2_attribute_get_pointer (attr))->is_text = is_text;
+ pango2_attr_list_insert (attrs, attr);
}
}
@@ -1535,137 +1535,137 @@ static void
add_text_attrs (GtkTextLayout *layout,
GtkTextAttributes *style,
int byte_count,
- PangoAttrList *attrs,
+ Pango2AttrList *attrs,
int start,
gboolean size_only,
- PangoAttribute **last_font_attr,
- PangoAttribute **last_scale_attr,
- PangoAttribute **last_fallback_attr)
+ Pango2Attribute **last_font_attr,
+ Pango2Attribute **last_scale_attr,
+ Pango2Attribute **last_fallback_attr)
{
- PangoAttribute *attr;
+ Pango2Attribute *attr;
guint last_start, last_end;
if (*last_font_attr)
- pango_attribute_get_range (*last_font_attr, &last_start, &last_end);
+ pango2_attribute_get_range (*last_font_attr, &last_start, &last_end);
if (*last_font_attr &&
- pango_font_description_equal (style->font, pango_attribute_get_font_desc (*last_font_attr)) &&
+ pango2_font_description_equal (style->font, pango2_attribute_get_font_desc (*last_font_attr)) &&
last_end >= start)
{
- pango_attribute_set_range (*last_font_attr,
+ pango2_attribute_set_range (*last_font_attr,
MIN (last_start, start),
MAX (last_end, start + byte_count));
}
else
{
- attr = pango_attr_font_desc_new (style->font);
- pango_attribute_set_range (attr, start, start + byte_count);
- pango_attr_list_insert (attrs, attr);
+ attr = pango2_attr_font_desc_new (style->font);
+ pango2_attribute_set_range (attr, start, start + byte_count);
+ pango2_attr_list_insert (attrs, attr);
*last_font_attr = attr;
}
if (*last_scale_attr)
- pango_attribute_get_range (*last_scale_attr, &last_start, &last_end);
+ pango2_attribute_get_range (*last_scale_attr, &last_start, &last_end);
if (*last_scale_attr &&
- style->font_scale == pango_attribute_get_float (*last_scale_attr) &&
+ style->font_scale == pango2_attribute_get_float (*last_scale_attr) &&
last_end >= start)
{
- pango_attribute_set_range (*last_scale_attr,
+ pango2_attribute_set_range (*last_scale_attr,
MIN (last_start, start),
MAX (last_end, start + byte_count));
}
else if (style->font_scale != 1.0)
{
- attr = pango_attr_scale_new (style->font_scale);
- pango_attribute_set_range (attr, start, start + byte_count);
- pango_attr_list_insert (attrs, attr);
+ attr = pango2_attr_scale_new (style->font_scale);
+ pango2_attribute_set_range (attr, start, start + byte_count);
+ pango2_attr_list_insert (attrs, attr);
*last_scale_attr = attr;
}
if (*last_fallback_attr)
- pango_attribute_get_range (*last_fallback_attr, &last_start, &last_end);
+ pango2_attribute_get_range (*last_fallback_attr, &last_start, &last_end);
if (*last_fallback_attr &&
- (!style->no_fallback) == pango_attribute_get_boolean (*last_fallback_attr) &&
+ (!style->no_fallback) == pango2_attribute_get_boolean (*last_fallback_attr) &&
last_end >= start)
{
- pango_attribute_set_range (*last_fallback_attr,
+ pango2_attribute_set_range (*last_fallback_attr,
MIN (last_start, start),
MAX (last_end, start + byte_count));
}
else if (style->no_fallback)
{
- attr = pango_attr_fallback_new (!style->no_fallback);
- pango_attribute_set_range (attr, start, start + byte_count);
- pango_attr_list_insert (attrs, attr);
+ attr = pango2_attr_fallback_new (!style->no_fallback);
+ pango2_attribute_set_range (attr, start, start + byte_count);
+ pango2_attr_list_insert (attrs, attr);
*last_fallback_attr = attr;
}
if (style->letter_spacing != 0)
{
- attr = pango_attr_letter_spacing_new (style->letter_spacing);
- pango_attribute_set_range (attr, start, start + byte_count);
- pango_attr_list_insert (attrs, attr);
+ attr = pango2_attr_letter_spacing_new (style->letter_spacing);
+ pango2_attribute_set_range (attr, start, start + byte_count);
+ pango2_attr_list_insert (attrs, attr);
}
if (style->line_height != 0.0)
{
if (style->line_height_is_absolute)
- attr = pango_attr_line_height_new_absolute (style->line_height * PANGO_SCALE);
+ attr = pango2_attr_line_height_new_absolute (style->line_height * PANGO2_SCALE);
else
- attr = pango_attr_line_height_new (style->line_height);
- pango_attribute_set_range (attr, start, start + byte_count);
- pango_attr_list_insert (attrs, attr);
+ attr = pango2_attr_line_height_new (style->line_height);
+ pango2_attribute_set_range (attr, start, start + byte_count);
+ pango2_attr_list_insert (attrs, attr);
}
if (style->font_features)
{
- attr = pango_attr_font_features_new (style->font_features);
- pango_attribute_set_range (attr, start, start + byte_count);
- pango_attr_list_insert (attrs, attr);
+ attr = pango2_attr_font_features_new (style->font_features);
+ pango2_attribute_set_range (attr, start, start + byte_count);
+ pango2_attr_list_insert (attrs, attr);
}
if (style->no_breaks)
{
- attr = pango_attr_allow_breaks_new (FALSE);
- pango_attribute_set_range (attr, start, start + byte_count);
- pango_attr_list_insert (attrs, attr);
+ attr = pango2_attr_allow_breaks_new (FALSE);
+ pango2_attribute_set_range (attr, start, start + byte_count);
+ pango2_attr_list_insert (attrs, attr);
}
- if (style->show_spaces != PANGO_SHOW_NONE)
+ if (style->show_spaces != PANGO2_SHOW_NONE)
{
- attr = pango_attr_show_new (style->show_spaces);
- pango_attribute_set_range (attr, start, start + byte_count);
- pango_attr_list_insert (attrs, attr);
+ attr = pango2_attr_show_new (style->show_spaces);
+ pango2_attribute_set_range (attr, start, start + byte_count);
+ pango2_attr_list_insert (attrs, attr);
}
if (style->no_hyphens)
{
- attr = pango_attr_insert_hyphens_new (FALSE);
- pango_attribute_set_range (attr, start, start + byte_count);
- pango_attr_list_insert (attrs, attr);
+ attr = pango2_attr_insert_hyphens_new (FALSE);
+ pango2_attribute_set_range (attr, start, start + byte_count);
+ pango2_attr_list_insert (attrs, attr);
}
- if (style->text_transform != PANGO_TEXT_TRANSFORM_NONE)
+ if (style->text_transform != PANGO2_TEXT_TRANSFORM_NONE)
{
- attr = pango_attr_text_transform_new (style->text_transform);
- pango_attribute_set_range (attr, start, start + byte_count);
- pango_attr_list_insert (attrs, attr);
+ attr = pango2_attr_text_transform_new (style->text_transform);
+ pango2_attribute_set_range (attr, start, start + byte_count);
+ pango2_attr_list_insert (attrs, attr);
}
if (style->word)
{
- attr = pango_attr_word_new ();
- pango_attribute_set_range (attr, start, start + byte_count);
- pango_attr_list_insert (attrs, attr);
+ attr = pango2_attr_word_new ();
+ pango2_attribute_set_range (attr, start, start + byte_count);
+ pango2_attr_list_insert (attrs, attr);
}
if (style->sentence)
{
- attr = pango_attr_sentence_new ();
- pango_attribute_set_range (attr, start, start + byte_count);
- pango_attr_list_insert (attrs, attr);
+ attr = pango2_attr_sentence_new ();
+ pango2_attribute_set_range (attr, start, start + byte_count);
+ pango2_attr_list_insert (attrs, attr);
}
}
@@ -1674,11 +1674,11 @@ add_paintable_attrs (GtkTextLayout *layout,
GtkTextLineDisplay *display,
GtkTextAttributes *style,
GtkTextLineSegment *seg,
- PangoAttrList *attrs,
+ Pango2AttrList *attrs,
int start)
{
- PangoAttribute *attr;
- PangoRectangle logical_rect;
+ Pango2Attribute *attr;
+ Pango2Rectangle logical_rect;
GtkTextPaintable *paintable = &seg->body.paintable;
int width, height;
@@ -1697,15 +1697,14 @@ add_paintable_attrs (GtkTextLayout *layout,
}
logical_rect.x = 0;
- logical_rect.y = -height * PANGO_SCALE;
- logical_rect.width = width * PANGO_SCALE;
- logical_rect.height = height * PANGO_SCALE;
+ logical_rect.y = -height * PANGO2_SCALE;
+ logical_rect.width = width * PANGO2_SCALE;
+ logical_rect.height = height * PANGO2_SCALE;
- attr = pango_attr_shape_new (&logical_rect, &logical_rect,
+ attr = pango2_attr_shape_new (&logical_rect, &logical_rect,
paintable->paintable, NULL, NULL);
- pango_attribute_set_range (attr, start, start + seg->byte_count);
- pango_attr_list_insert (attrs, attr);
-#endif
+ pango2_attribute_set_range (attr, start, start + seg->byte_count);
+ pango2_attr_list_insert (attrs, attr);
}
static void
@@ -1713,11 +1712,11 @@ add_child_attrs (GtkTextLayout *layout,
GtkTextLineDisplay *display,
GtkTextAttributes *style,
GtkTextLineSegment *seg,
- PangoAttrList *attrs,
+ Pango2AttrList *attrs,
int start)
{
- PangoAttribute *attr;
- PangoRectangle logical_rect;
+ Pango2Attribute *attr;
+ Pango2Rectangle logical_rect;
int width, height;
GSList *tmp_list;
GtkWidget *widget = NULL;
@@ -1765,15 +1764,14 @@ add_child_attrs (GtkTextLayout *layout,
}
logical_rect.x = 0;
- logical_rect.y = -height * PANGO_SCALE;
- logical_rect.width = width * PANGO_SCALE;
- logical_rect.height = height * PANGO_SCALE;
+ logical_rect.y = -height * PANGO2_SCALE;
+ logical_rect.width = width * PANGO2_SCALE;
+ logical_rect.height = height * PANGO2_SCALE;
- attr = pango_attr_shape_new (&logical_rect, &logical_rect,
+ attr = pango2_attr_shape_new (&logical_rect, &logical_rect,
widget, NULL, NULL);
- pango_attribute_set_range (attr, start, start + seg->byte_count);
- pango_attr_list_insert (attrs, attr);
-#endif
+ pango2_attribute_set_range (attr, start, start + seg->byte_count);
+ pango2_attr_list_insert (attrs, attr);
}
/*
@@ -1799,21 +1797,21 @@ get_block_cursor (GtkTextLayout *layout,
GdkRectangle *pos,
gboolean *cursor_at_line_end)
{
- PangoRectangle pango_pos;
+ Pango2Rectangle pango2_pos;
if (layout->overwrite_mode &&
gtk_text_iter_editable (insert_iter, TRUE) &&
_gtk_text_util_get_block_cursor_location (display->layout,
insert_index,
- &pango_pos,
+ &pango2_pos,
cursor_at_line_end))
{
if (pos)
{
- pos->x = PANGO_PIXELS (pango_pos.x);
- pos->y = PANGO_PIXELS (pango_pos.y);
- pos->width = PANGO_PIXELS (pango_pos.width);
- pos->height = PANGO_PIXELS (pango_pos.height);
+ pos->x = PANGO2_PIXELS (pango2_pos.x);
+ pos->y = PANGO2_PIXELS (pango2_pos.y);
+ pos->width = PANGO2_PIXELS (pango2_pos.width);
+ pos->height = PANGO2_PIXELS (pango2_pos.height);
}
return TRUE;
@@ -1868,15 +1866,15 @@ add_cursor (GtkTextLayout *layout,
}
static gboolean
-is_shape (PangoRun *run)
+is_shape (Pango2Run *run)
{
- PangoItem *item = pango_run_get_item (run);
+ Pango2Item *item = pango2_run_get_item (run);
- for (GSList *l = pango_analysis_get_extra_attributes (pango_item_get_analysis (item)); l; l = l->next)
+ for (GSList *l = pango2_analysis_get_extra_attributes (pango2_item_get_analysis (item)); l; l = l->next)
{
- PangoAttribute *attr = l->data;
+ Pango2Attribute *attr = l->data;
- if (pango_attribute_type (attr) == PANGO_ATTR_SHAPE)
+ if (pango2_attribute_type (attr) == PANGO2_ATTR_SHAPE)
return TRUE;
}
@@ -1887,13 +1885,13 @@ static void
allocate_child_widgets (GtkTextLayout *text_layout,
GtkTextLineDisplay *display)
{
- PangoLayout *layout = display->layout;
- PangoLineIter *run_iter;
+ Pango2Layout *layout = display->layout;
+ Pango2LineIter *run_iter;
- run_iter = pango_layout_get_iter (layout);
+ run_iter = pango2_layout_get_iter (layout);
do
{
- PangoRun *run = pango_line_iter_get_run (run_iter);
+ Pango2Run *run = pango2_line_iter_get_run (run_iter);
if (run && is_shape (run))
{
@@ -1907,7 +1905,7 @@ allocate_child_widgets (GtkTextLayout *text_layout,
/* The pango iterator iterates in visual order.
* We use the byte index to find the child widget.
*/
- byte_index = pango_line_iter_get_index (run_iter);
+ byte_index = pango2_line_iter_get_index (run_iter);
line_display_index_to_iter (text_layout, display, &text_iter, byte_index, 0);
anchor = gtk_text_iter_get_child_anchor (&text_iter);
if (anchor)
@@ -1916,7 +1914,7 @@ allocate_child_widgets (GtkTextLayout *text_layout,
for (i = 0; i < n_widgets; i++)
{
GtkWidget *child = widgets[i];
- PangoRectangle extents;
+ Pango2Rectangle extents;
if (_gtk_anchored_child_get_layout (child) == text_layout)
{
@@ -1925,7 +1923,7 @@ allocate_child_widgets (GtkTextLayout *text_layout,
* the widget with respect to the top of the line
* and the left side of the buffer
*/
- pango_line_iter_get_run_extents (run_iter,
+ pango2_line_iter_get_run_extents (run_iter,
NULL,
&extents);
@@ -1933,17 +1931,17 @@ allocate_child_widgets (GtkTextLayout *text_layout,
signals[ALLOCATE_CHILD],
0,
child,
- PANGO_PIXELS (extents.x) + display->x_offset,
- PANGO_PIXELS (extents.y) + display->top_margin);
+ PANGO2_PIXELS (extents.x) + display->x_offset,
+ PANGO2_PIXELS (extents.y) + display->top_margin);
}
}
g_free (widgets);
}
}
- while (pango_line_iter_next_run (run_iter));
+ while (pango2_line_iter_next_run (run_iter));
- pango_line_iter_free (run_iter);
+ pango2_line_iter_free (run_iter);
}
void
@@ -1955,9 +1953,9 @@ gtk_text_layout_update_children (GtkTextLayout *text_layout,
static void
convert_color (GdkRGBA *result,
- PangoAttribute *attr)
+ Pango2Attribute *attr)
{
- PangoColor *color = pango_attribute_get_color (attr);
+ Pango2Color *color = pango2_attribute_get_color (attr);
result->red = color->red / 65535.;
result->green = color->green / 65535.;
result->blue = color->blue / 65535.;
@@ -1965,29 +1963,29 @@ convert_color (GdkRGBA *result,
}
/* This function is used to convert the preedit string attributes, which are
- * standard PangoAttributes, into the custom attributes used by the text
+ * standard Pango2Attributes, into the custom attributes used by the text
* widget and insert them into an attr list with a given offset.
*/
static void
add_preedit_attrs (GtkTextLayout *layout,
GtkTextAttributes *style,
- PangoAttrList *attrs,
+ Pango2AttrList *attrs,
int offset,
gboolean size_only)
{
- PangoAttrIterator *iter = pango_attr_list_get_iterator (layout->preedit_attrs);
+ Pango2AttrIterator *iter = pango2_attr_list_get_iterator (layout->preedit_attrs);
do
{
GtkTextAppearance appearance = style->appearance;
- PangoFontDescription *font_desc = pango_font_description_copy_static (style->font);
- PangoAttribute *insert_attr;
+ Pango2FontDescription *font_desc = pango2_font_description_copy_static (style->font);
+ Pango2Attribute *insert_attr;
GSList *extra_attrs = NULL;
GSList *tmp_list;
- PangoLanguage *language;
+ Pango2Language *language;
int start, end;
- pango_attr_iterator_range (iter, &start, &end);
+ pango2_attr_iterator_range (iter, &start, &end);
if (end == G_MAXINT)
end = layout->preedit_len;
@@ -1995,7 +1993,7 @@ add_preedit_attrs (GtkTextLayout *layout,
if (end == start)
continue;
- pango_attr_iterator_get_font (iter, font_desc, &language, &extra_attrs);
+ pango2_attr_iterator_get_font (iter, font_desc, &language, &extra_attrs);
if (appearance.fg_rgba)
appearance.fg_rgba = gdk_rgba_copy (appearance.fg_rgba);
@@ -2011,73 +2009,73 @@ add_preedit_attrs (GtkTextLayout *layout,
tmp_list = extra_attrs;
while (tmp_list)
{
- PangoAttribute *attr = tmp_list->data;
+ Pango2Attribute *attr = tmp_list->data;
GdkRGBA rgba;
- switch (pango_attribute_type (attr))
+ switch (pango2_attribute_type (attr))
{
- case PANGO_ATTR_FOREGROUND:
+ case PANGO2_ATTR_FOREGROUND:
convert_color (&rgba, attr);
if (appearance.fg_rgba)
gdk_rgba_free (appearance.fg_rgba);
appearance.fg_rgba = gdk_rgba_copy (&rgba);
break;
- case PANGO_ATTR_BACKGROUND:
+ case PANGO2_ATTR_BACKGROUND:
convert_color (&rgba, attr);
if (appearance.bg_rgba)
gdk_rgba_free (appearance.bg_rgba);
appearance.bg_rgba = gdk_rgba_copy (&rgba);
appearance.draw_bg = TRUE;
break;
- case PANGO_ATTR_UNDERLINE:
- appearance.underline = pango_attribute_get_int (attr);
+ case PANGO2_ATTR_UNDERLINE:
+ appearance.underline = pango2_attribute_get_int (attr);
break;
- case PANGO_ATTR_UNDERLINE_COLOR:
+ case PANGO2_ATTR_UNDERLINE_COLOR:
convert_color (&rgba, attr);
if (appearance.underline_rgba)
gdk_rgba_free (appearance.underline_rgba);
appearance.underline_rgba = gdk_rgba_copy (&rgba);
break;
- case PANGO_ATTR_OVERLINE:
- appearance.overline = pango_attribute_get_int (attr);
+ case PANGO2_ATTR_OVERLINE:
+ appearance.overline = pango2_attribute_get_int (attr);
break;
- case PANGO_ATTR_OVERLINE_COLOR:
+ case PANGO2_ATTR_OVERLINE_COLOR:
convert_color (&rgba, attr);
if (appearance.overline_rgba)
gdk_rgba_free (appearance.overline_rgba);
appearance.overline_rgba = gdk_rgba_copy (&rgba);
break;
- case PANGO_ATTR_STRIKETHROUGH:
- appearance.strikethrough = pango_attribute_get_int (attr);
+ case PANGO2_ATTR_STRIKETHROUGH:
+ appearance.strikethrough = pango2_attribute_get_int (attr);
break;
- case PANGO_ATTR_STRIKETHROUGH_COLOR:
+ case PANGO2_ATTR_STRIKETHROUGH_COLOR:
convert_color (&rgba, attr);
if (appearance.strikethrough_rgba)
gdk_rgba_free (appearance.strikethrough_rgba);
appearance.strikethrough_rgba = gdk_rgba_copy (&rgba);
break;
- case PANGO_ATTR_RISE:
- appearance.rise = pango_attribute_get_int (attr);
+ case PANGO2_ATTR_RISE:
+ appearance.rise = pango2_attribute_get_int (attr);
break;
default:
break;
}
- pango_attribute_destroy (attr);
+ pango2_attribute_destroy (attr);
tmp_list = tmp_list->next;
}
g_slist_free (extra_attrs);
- insert_attr = pango_attr_font_desc_new (font_desc);
- pango_attribute_set_range (insert_attr, start + offset, end + offset);
- pango_attr_list_insert (attrs, insert_attr);
+ insert_attr = pango2_attr_font_desc_new (font_desc);
+ pango2_attribute_set_range (insert_attr, start + offset, end + offset);
+ pango2_attr_list_insert (attrs, insert_attr);
if (language)
{
- insert_attr = pango_attr_language_new (language);
- pango_attribute_set_range (insert_attr, start + offset, end + offset);
- pango_attr_list_insert (attrs, insert_attr);
+ insert_attr = pango2_attr_language_new (language);
+ pango2_attribute_set_range (insert_attr, start + offset, end + offset);
+ pango2_attr_list_insert (attrs, insert_attr);
}
add_generic_attrs (layout, &appearance, end - start,
@@ -2095,11 +2093,11 @@ add_preedit_attrs (GtkTextLayout *layout,
if (appearance.strikethrough_rgba)
gdk_rgba_free (appearance.strikethrough_rgba);
- pango_font_description_free (font_desc);
+ pango2_font_description_free (font_desc);
}
- while (pango_attr_iterator_next (iter));
+ while (pango2_attr_iterator_next (iter));
- pango_attr_iterator_destroy (iter);
+ pango2_attr_iterator_destroy (iter);
}
/* Iterate over the line and fill in display->cursors.
@@ -2246,22 +2244,22 @@ gtk_text_layout_create_display (GtkTextLayout *layout,
GtkTextAttributes *style;
char *text;
int text_pixel_width;
- PangoAttrList *attrs;
+ Pango2AttrList *attrs;
int text_allocated, layout_byte_offset;
- PangoRectangle extents;
+ Pango2Rectangle extents;
gboolean para_values_set = FALSE;
GSList *cursor_byte_offsets = NULL;
GSList *cursor_segs = NULL;
GSList *tmp_list1, *tmp_list2;
gboolean saw_widget = FALSE;
- PangoDirection base_dir;
+ Pango2Direction base_dir;
GPtrArray *tags;
gboolean initial_toggle_segments;
int h_margin;
int h_padding;
- PangoAttribute *last_font_attr = NULL;
- PangoAttribute *last_scale_attr = NULL;
- PangoAttribute *last_fallback_attr = NULL;
+ Pango2Attribute *last_font_attr = NULL;
+ Pango2Attribute *last_scale_attr = NULL;
+ Pango2Attribute *last_fallback_attr = NULL;
GtkTextBTree *btree;
g_return_val_if_fail (line != NULL, NULL);
@@ -2279,20 +2277,20 @@ gtk_text_layout_create_display (GtkTextLayout *layout,
*/
if (totally_invisible_line (layout, line, &iter))
{
- display->layout = pango_layout_new (layout->ltr_context);
+ display->layout = pango2_layout_new (layout->ltr_context);
return g_steal_pointer (&display);
}
/* Find the bidi base direction */
base_dir = line->dir_propagated_forward;
- if (base_dir == PANGO_DIRECTION_NEUTRAL)
+ if (base_dir == PANGO2_DIRECTION_NEUTRAL)
base_dir = line->dir_propagated_back;
if (line == priv->cursor_line &&
- line->dir_strong == PANGO_DIRECTION_NEUTRAL)
+ line->dir_strong == PANGO2_DIRECTION_NEUTRAL)
{
base_dir = (layout->keyboard_direction == GTK_TEXT_DIR_LTR) ?
- PANGO_DIRECTION_LTR : PANGO_DIRECTION_RTL;
+ PANGO2_DIRECTION_LTR : PANGO2_DIRECTION_RTL;
}
btree = _gtk_text_buffer_get_btree (layout->buffer);
@@ -2302,7 +2300,7 @@ gtk_text_layout_create_display (GtkTextLayout *layout,
text_allocated = _gtk_text_line_byte_count (line);
text = g_malloc (text_allocated);
- attrs = pango_attr_list_new ();
+ attrs = pango2_attr_list_new ();
/* Iterate over segments, creating display chunks for them, and updating the tags array. */
layout_byte_offset = 0; /* current length of layout text (includes preedit, does not include invisible
text) */
@@ -2498,7 +2496,7 @@ gtk_text_layout_create_display (GtkTextLayout *layout,
release_style (layout, style);
}
- /* Pango doesn't want the trailing paragraph delimiters */
+ /* Pango2 doesn't want the trailing paragraph delimiters */
{
/* Only one character has type G_UNICODE_PARAGRAPH_SEPARATOR in
@@ -2524,8 +2522,8 @@ gtk_text_layout_create_display (GtkTextLayout *layout,
}
}
- pango_layout_set_text (display->layout, text, layout_byte_offset);
- pango_layout_set_attributes (display->layout, attrs);
+ pango2_layout_set_text (display->layout, text, layout_byte_offset);
+ pango2_layout_set_attributes (display->layout, attrs);
tmp_list1 = cursor_byte_offsets;
tmp_list2 = cursor_segs;
@@ -2539,7 +2537,7 @@ gtk_text_layout_create_display (GtkTextLayout *layout,
g_slist_free (cursor_byte_offsets);
g_slist_free (cursor_segs);
- pango_lines_get_extents (pango_layout_get_lines (display->layout), NULL, &extents);
+ pango2_lines_get_extents (pango2_layout_get_lines (display->layout), NULL, &extents);
text_pixel_width = PIXEL_BOUND (extents.width);
@@ -2547,36 +2545,36 @@ gtk_text_layout_create_display (GtkTextLayout *layout,
h_padding = layout->left_padding + layout->right_padding;
display->width = text_pixel_width + h_margin + h_padding;
- display->height += PANGO_PIXELS (extents.height);
+ display->height += PANGO2_PIXELS (extents.height);
/* If we aren't wrapping, we need to do the alignment of each
* paragraph ourselves.
*/
- if (pango_layout_get_width (display->layout) < 0)
+ if (pango2_layout_get_width (display->layout) < 0)
{
int excess = display->total_width - text_pixel_width;
- switch (pango_layout_get_alignment (display->layout))
+ switch (pango2_layout_get_alignment (display->layout))
{
- case PANGO_ALIGN_LEFT:
+ case PANGO2_ALIGN_LEFT:
default:
break;
- case PANGO_ALIGN_CENTER:
+ case PANGO2_ALIGN_CENTER:
display->x_offset += excess / 2;
break;
- case PANGO_ALIGN_RIGHT:
+ case PANGO2_ALIGN_RIGHT:
display->x_offset += excess;
break;
- case PANGO_ALIGN_NATURAL:
+ case PANGO2_ALIGN_NATURAL:
{
- PangoLine *first_line;
+ Pango2Line *first_line;
- first_line = pango_lines_get_lines (pango_layout_get_lines (display->layout))[0];
- if (first_line && pango_line_get_resolved_direction (first_line) == PANGO_DIRECTION_RTL)
+ first_line = pango2_lines_get_lines (pango2_layout_get_lines (display->layout))[0];
+ if (first_line && pango2_line_get_resolved_direction (first_line) == PANGO2_DIRECTION_RTL)
display->x_offset += excess;
}
break;
- case PANGO_ALIGN_JUSTIFY:
+ case PANGO2_ALIGN_JUSTIFY:
break;
}
}
@@ -2586,7 +2584,7 @@ gtk_text_layout_create_display (GtkTextLayout *layout,
invalidate_cached_style (layout);
g_free (text);
- pango_attr_list_unref (attrs);
+ pango2_attr_list_unref (attrs);
if (tags != NULL)
g_ptr_array_free (tags, TRUE);
@@ -2685,7 +2683,7 @@ line_display_index_to_iter (GtkTextLayout *layout,
if (_gtk_text_iter_get_text_line (iter) != display->line)
{
/* Clamp to end of line - really this clamping should have been done
- * before here, maybe in Pango, this is a broken band-aid I think
+ * before here, maybe in Pango2, this is a broken band-aid I think
*/
gtk_text_layout_get_iter_at_line (layout, iter, display->line, 0);
if (!gtk_text_iter_ends_line (iter))
@@ -2796,12 +2794,12 @@ gtk_text_layout_get_iter_at_position (GtkTextLayout *layout,
}
else
{
- /* Ignore the return value from pango. Pango is doing
+ /* Ignore the return value from pango. Pango2 is doing
* the right thing even if we are outside the layout in the
* x-direction.
*/
- pango_lines_pos_to_index (pango_layout_get_lines (display->layout),
- x * PANGO_SCALE, y * PANGO_SCALE,
+ pango2_lines_pos_to_index (pango2_layout_get_lines (display->layout),
+ x * PANGO2_SCALE, y * PANGO2_SCALE,
&byte_index, trailing);
}
@@ -2841,8 +2839,8 @@ gtk_text_layout_get_cursor_locations (GtkTextLayout *layout,
int index;
GtkTextIter insert_iter;
- PangoRectangle pango_strong_pos;
- PangoRectangle pango_weak_pos;
+ Pango2Rectangle pango2_strong_pos;
+ Pango2Rectangle pango2_weak_pos;
g_return_if_fail (layout != NULL);
g_return_if_fail (iter != NULL);
@@ -2860,24 +2858,24 @@ gtk_text_layout_get_cursor_locations (GtkTextLayout *layout,
if (gtk_text_iter_equal (iter, &insert_iter))
index += layout->preedit_cursor - layout->preedit_len;
- pango_lines_get_cursor_pos (pango_layout_get_lines (display->layout), NULL, index,
- strong_pos ? &pango_strong_pos : NULL,
- weak_pos ? &pango_weak_pos : NULL);
+ pango2_lines_get_cursor_pos (pango2_layout_get_lines (display->layout), NULL, index,
+ strong_pos ? &pango2_strong_pos : NULL,
+ weak_pos ? &pango2_weak_pos : NULL);
if (strong_pos)
{
- strong_pos->x = display->x_offset + pango_strong_pos.x / PANGO_SCALE;
- strong_pos->y = line_top + display->top_margin + pango_strong_pos.y / PANGO_SCALE;
+ strong_pos->x = display->x_offset + pango2_strong_pos.x / PANGO2_SCALE;
+ strong_pos->y = line_top + display->top_margin + pango2_strong_pos.y / PANGO2_SCALE;
strong_pos->width = 0;
- strong_pos->height = pango_strong_pos.height / PANGO_SCALE;
+ strong_pos->height = pango2_strong_pos.height / PANGO2_SCALE;
}
if (weak_pos)
{
- weak_pos->x = display->x_offset + pango_weak_pos.x / PANGO_SCALE;
- weak_pos->y = line_top + display->top_margin + pango_weak_pos.y / PANGO_SCALE;
+ weak_pos->x = display->x_offset + pango2_weak_pos.x / PANGO2_SCALE;
+ weak_pos->y = line_top + display->top_margin + pango2_weak_pos.y / PANGO2_SCALE;
weak_pos->width = 0;
- weak_pos->height = pango_weak_pos.height / PANGO_SCALE;
+ weak_pos->height = pango2_weak_pos.height / PANGO2_SCALE;
}
gtk_text_line_display_unref (display);
@@ -2985,7 +2983,7 @@ gtk_text_layout_get_iter_location (GtkTextLayout *layout,
const GtkTextIter *iter,
GdkRectangle *rect)
{
- PangoRectangle pango_rect;
+ Pango2Rectangle pango2_rect;
GtkTextLine *line;
GtkTextBTree *tree;
GtkTextLineDisplay *display;
@@ -3003,16 +3001,16 @@ gtk_text_layout_get_iter_location (GtkTextLayout *layout,
rect->y = _gtk_text_btree_find_line_top (tree, line, layout);
- x_offset = display->x_offset * PANGO_SCALE;
+ x_offset = display->x_offset * PANGO2_SCALE;
byte_index = gtk_text_iter_get_line_index (iter);
- pango_lines_index_to_pos (pango_layout_get_lines (display->layout), NULL, byte_index, &pango_rect);
+ pango2_lines_index_to_pos (pango2_layout_get_lines (display->layout), NULL, byte_index, &pango2_rect);
- rect->x = PANGO_PIXELS (x_offset + pango_rect.x);
- rect->y += PANGO_PIXELS (pango_rect.y) + display->top_margin;
- rect->width = PANGO_PIXELS (pango_rect.width);
- rect->height = PANGO_PIXELS (pango_rect.height);
+ rect->x = PANGO2_PIXELS (x_offset + pango2_rect.x);
+ rect->y += PANGO2_PIXELS (pango2_rect.y) + display->top_margin;
+ rect->width = PANGO2_PIXELS (pango2_rect.width);
+ rect->height = PANGO2_PIXELS (pango2_rect.height);
gtk_text_line_display_unref (display);
}
@@ -3047,18 +3045,18 @@ find_display_line_below (GtkTextLayout *layout,
while (line && !found_line)
{
GtkTextLineDisplay *display = gtk_text_layout_get_line_display (layout, line, FALSE);
- PangoLineIter *line_iter;
+ Pango2LineIter *line_iter;
- line_iter = pango_layout_get_iter (display->layout);
+ line_iter = pango2_layout_get_iter (display->layout);
line_top += display->top_margin;
do
{
- PangoRectangle ext;
- PangoLine *pango_line = pango_line_iter_get_line (line_iter);
+ Pango2Rectangle ext;
+ Pango2Line *pango2_line = pango2_line_iter_get_line (line_iter);
- found_byte = pango_line_get_start_index (pango_line);
+ found_byte = pango2_line_get_start_index (pango2_line);
if (line_top >= y)
{
@@ -3066,13 +3064,13 @@ find_display_line_below (GtkTextLayout *layout,
break;
}
- pango_line_iter_get_line_extents (line_iter, NULL, &ext);
- pango_extents_to_pixels (&ext, NULL);
+ pango2_line_iter_get_line_extents (line_iter, NULL, &ext);
+ pango2_extents_to_pixels (&ext, NULL);
line_top += ext.height;
}
- while (pango_line_iter_next_line (line_iter));
+ while (pango2_line_iter_next_line (line_iter));
- pango_line_iter_free (line_iter);
+ pango2_line_iter_free (line_iter);
line_top += display->bottom_margin;
gtk_text_line_display_unref (display);
@@ -3114,41 +3112,41 @@ find_display_line_above (GtkTextLayout *layout,
while (line && !found_line)
{
GtkTextLineDisplay *display = gtk_text_layout_get_line_display (layout, line, FALSE);
- PangoRectangle logical_rect;
- PangoLineIter *line_iter;
+ Pango2Rectangle logical_rect;
+ Pango2LineIter *line_iter;
int tmp_top;
- line_iter = pango_layout_get_iter (display->layout);
+ line_iter = pango2_layout_get_iter (display->layout);
line_top -= display->top_margin + display->bottom_margin;
- pango_line_iter_get_layout_extents (line_iter, NULL, &logical_rect);
- line_top -= logical_rect.height / PANGO_SCALE;
+ pango2_line_iter_get_layout_extents (line_iter, NULL, &logical_rect);
+ line_top -= logical_rect.height / PANGO2_SCALE;
tmp_top = line_top + display->top_margin;
do
{
- PangoRectangle ext;
+ Pango2Rectangle ext;
- PangoLine *pango_line = pango_line_iter_get_line (line_iter);
+ Pango2Line *pango2_line = pango2_line_iter_get_line (line_iter);
- found_byte = pango_line_get_start_index (pango_line);
+ found_byte = pango2_line_get_start_index (pango2_line);
- pango_line_iter_get_line_extents (line_iter, NULL, &ext);
- pango_extents_to_pixels (&ext, NULL);
+ pango2_line_iter_get_line_extents (line_iter, NULL, &ext);
+ pango2_extents_to_pixels (&ext, NULL);
tmp_top -= ext.height;
if (tmp_top < y)
{
found_line = line;
- pango_line_iter_free (line_iter);
+ pango2_line_iter_free (line_iter);
goto done;
}
}
- while (pango_line_iter_next_line (line_iter));
+ while (pango2_line_iter_next_line (line_iter));
- pango_line_iter_free (line_iter);
+ pango2_line_iter_free (line_iter);
gtk_text_line_display_unref (display);
@@ -3224,7 +3222,7 @@ gtk_text_layout_move_iter_to_previous_line (GtkTextLayout *layout,
GtkTextLine *line;
GtkTextLineDisplay *display;
int line_byte;
- PangoLine *pango_line;
+ Pango2Line *pango2_line;
GtkTextIter orig;
gboolean update_byte = FALSE;
int line_no;
@@ -3262,14 +3260,14 @@ gtk_text_layout_move_iter_to_previous_line (GtkTextLayout *layout,
}
line_no = 0;
- pango_line = pango_lines_get_lines (pango_layout_get_lines (display->layout))[line_no];
+ pango2_line = pango2_lines_get_lines (pango2_layout_get_lines (display->layout))[line_no];
if (update_byte)
{
- line_byte = pango_line_get_start_index (pango_line) + pango_line_get_length (pango_line);
+ line_byte = pango2_line_get_start_index (pango2_line) + pango2_line_get_length (pango2_line);
}
- if (line_byte < pango_line_get_length (pango_line) || line_no + 1 == pango_lines_get_line_count
(pango_layout_get_lines (display->layout))) /* first line of paragraph */
+ if (line_byte < pango2_line_get_length (pango2_line) || line_no + 1 == pango2_lines_get_line_count
(pango2_layout_get_lines (display->layout))) /* first line of paragraph */
{
GtkTextLine *prev_line;
@@ -3287,11 +3285,11 @@ gtk_text_layout_move_iter_to_previous_line (GtkTextLayout *layout,
if (display->height > 0)
{
- PangoLines *lines = pango_layout_get_lines (display->layout);
- pango_line = pango_lines_get_lines (lines)[pango_lines_get_line_count (lines) - 1];
+ Pango2Lines *lines = pango2_layout_get_lines (display->layout);
+ pango2_line = pango2_lines_get_lines (lines)[pango2_lines_get_line_count (lines) - 1];
line_display_index_to_iter (layout, display, iter,
- pango_line_get_start_index (pango_line) + pango_line_get_length
(pango_line), 0);
+ pango2_line_get_start_index (pango2_line) + pango2_line_get_length
(pango2_line), 0);
break;
}
@@ -3300,21 +3298,21 @@ gtk_text_layout_move_iter_to_previous_line (GtkTextLayout *layout,
}
else
{
- int prev_offset = pango_line_get_start_index (pango_line);
+ int prev_offset = pango2_line_get_start_index (pango2_line);
line_no++;
- while (line_no < pango_lines_get_line_count (pango_layout_get_lines (display->layout)))
+ while (line_no < pango2_lines_get_line_count (pango2_layout_get_lines (display->layout)))
{
- pango_line = pango_lines_get_lines (pango_layout_get_lines (display->layout))[line_no];
+ pango2_line = pango2_lines_get_lines (pango2_layout_get_lines (display->layout))[line_no];
- if (line_byte < pango_line_get_start_index (pango_line) + pango_line_get_length (pango_line) ||
- line_no + 1 == pango_lines_get_line_count (pango_layout_get_lines (display->layout)))
+ if (line_byte < pango2_line_get_start_index (pango2_line) + pango2_line_get_length (pango2_line) ||
+ line_no + 1 == pango2_lines_get_line_count (pango2_layout_get_lines (display->layout)))
{
line_display_index_to_iter (layout, display, iter, prev_offset, 0);
break;
}
- prev_offset = pango_line_get_start_index (pango_line);
+ prev_offset = pango2_line_get_start_index (pango2_line);
line_no++;
}
}
@@ -3348,7 +3346,7 @@ gtk_text_layout_move_iter_to_next_line (GtkTextLayout *layout,
gboolean found = FALSE;
gboolean found_after = FALSE;
gboolean first = TRUE;
- PangoLines *lines;
+ Pango2Lines *lines;
int line_no;
g_return_val_if_fail (GTK_IS_TEXT_LAYOUT (layout), FALSE);
@@ -3373,19 +3371,19 @@ gtk_text_layout_move_iter_to_next_line (GtkTextLayout *layout,
else
line_byte = 0;
- lines = pango_layout_get_lines (display->layout);
+ lines = pango2_layout_get_lines (display->layout);
line_no = 0;
- while (line_no < pango_lines_get_line_count (lines) && !found_after)
+ while (line_no < pango2_lines_get_line_count (lines) && !found_after)
{
- PangoLine *pango_line = pango_lines_get_lines (lines)[line_no];
+ Pango2Line *pango2_line = pango2_lines_get_lines (lines)[line_no];
if (found)
{
line_display_index_to_iter (layout, display, iter,
- pango_line_get_start_index (pango_line), 0);
+ pango2_line_get_start_index (pango2_line), 0);
found_after = TRUE;
}
- else if (line_byte < pango_line_get_start_index (pango_line) + pango_line_get_length (pango_line)
|| line_no + 1 == pango_lines_get_line_count (lines))
+ else if (line_byte < pango2_line_get_start_index (pango2_line) + pango2_line_get_length
(pango2_line) || line_no + 1 == pango2_lines_get_line_count (lines))
found = TRUE;
line_no++;
@@ -3423,7 +3421,7 @@ gtk_text_layout_move_iter_to_line_end (GtkTextLayout *layout,
GtkTextLineDisplay *display;
int line_byte;
GtkTextIter orig;
- PangoLines *lines;
+ Pango2Lines *lines;
int line_no;
g_return_val_if_fail (GTK_IS_TEXT_LAYOUT (layout), FALSE);
@@ -3435,24 +3433,24 @@ gtk_text_layout_move_iter_to_line_end (GtkTextLayout *layout,
display = gtk_text_layout_get_line_display (layout, line, FALSE);
line_byte = line_display_iter_to_index (layout, display, iter);
- lines = pango_layout_get_lines (display->layout);
+ lines = pango2_layout_get_lines (display->layout);
line_no = 0;
- while (line_no < pango_lines_get_line_count (lines))
+ while (line_no < pango2_lines_get_line_count (lines))
{
- PangoLine *pango_line = pango_lines_get_lines (lines)[line_no];
+ Pango2Line *pango2_line = pango2_lines_get_lines (lines)[line_no];
- if (line_byte < pango_line_get_start_index (pango_line) + pango_line_get_length (pango_line) ||
line_no + 1 == pango_lines_get_line_count (lines))
+ if (line_byte < pango2_line_get_start_index (pango2_line) + pango2_line_get_length (pango2_line) ||
line_no + 1 == pango2_lines_get_line_count (lines))
{
line_display_index_to_iter (layout, display, iter,
- direction < 0 ? pango_line_get_start_index (pango_line) :
pango_line_get_start_index (pango_line) + pango_line_get_length (pango_line),
+ direction < 0 ? pango2_line_get_start_index (pango2_line) :
pango2_line_get_start_index (pango2_line) + pango2_line_get_length (pango2_line),
0);
/* FIXME: As a bad hack, we move back one position when we
* are inside a paragraph to avoid going to next line on a
* forced break not at whitespace. Real fix is to keep track
* of whether marks are at leading or trailing edge? */
- if (direction > 0 && pango_line_get_length (pango_line) > 0 &&
+ if (direction > 0 && pango2_line_get_length (pango2_line) > 0 &&
!gtk_text_iter_ends_line (iter) &&
!_gtk_text_btree_char_is_invisible (iter))
gtk_text_iter_backward_char (iter);
@@ -3484,7 +3482,7 @@ gtk_text_layout_iter_starts_line (GtkTextLayout *layout,
GtkTextLine *line;
GtkTextLineDisplay *display;
int line_byte;
- PangoLines *lines;
+ Pango2Lines *lines;
int line_no;
g_return_val_if_fail (GTK_IS_TEXT_LAYOUT (layout), FALSE);
@@ -3494,21 +3492,21 @@ gtk_text_layout_iter_starts_line (GtkTextLayout *layout,
display = gtk_text_layout_get_line_display (layout, line, FALSE);
line_byte = line_display_iter_to_index (layout, display, iter);
- lines = pango_layout_get_lines (display->layout);
+ lines = pango2_layout_get_lines (display->layout);
line_no = 0;
- while (line_no < pango_lines_get_line_count (lines))
+ while (line_no < pango2_lines_get_line_count (lines))
{
- PangoLine *pango_line = pango_lines_get_lines (lines)[line_no];
+ Pango2Line *pango2_line = pango2_lines_get_lines (lines)[line_no];
- if (line_byte < pango_line_get_start_index (pango_line) + pango_line_get_length (pango_line) ||
- line_no + 1 == pango_lines_get_line_count (lines))
+ if (line_byte < pango2_line_get_start_index (pango2_line) + pango2_line_get_length (pango2_line) ||
+ line_no + 1 == pango2_lines_get_line_count (lines))
{
/* We're located on this line or the para delimiters before
* it
*/
gtk_text_line_display_unref (display);
- if (line_byte == pango_line_get_start_index (pango_line))
+ if (line_byte == pango2_line_get_start_index (pango2_line))
return TRUE;
else
return FALSE;
@@ -3549,7 +3547,7 @@ gtk_text_layout_move_iter_to_x (GtkTextLayout *layout,
GtkTextLine *line;
GtkTextLineDisplay *display;
int line_byte;
- PangoLineIter *line_iter;
+ Pango2LineIter *line_iter;
g_return_if_fail (GTK_IS_TEXT_LAYOUT (layout));
g_return_if_fail (iter != NULL);
@@ -3559,23 +3557,23 @@ gtk_text_layout_move_iter_to_x (GtkTextLayout *layout,
display = gtk_text_layout_get_line_display (layout, line, FALSE);
line_byte = line_display_iter_to_index (layout, display, iter);
- line_iter = pango_layout_get_iter (display->layout);
+ line_iter = pango2_layout_get_iter (display->layout);
do
{
- PangoLine *pango_line = pango_line_iter_get_line (line_iter);
+ Pango2Line *pango2_line = pango2_line_iter_get_line (line_iter);
- if (line_byte < pango_line_get_start_index (pango_line) + pango_line_get_length (pango_line) ||
- pango_line_iter_at_last_line (line_iter))
+ if (line_byte < pango2_line_get_start_index (pango2_line) + pango2_line_get_length (pango2_line) ||
+ pango2_line_iter_at_last_line (line_iter))
{
- PangoRectangle logical_rect;
+ Pango2Rectangle logical_rect;
int byte_index, trailing;
- int x_offset = display->x_offset * PANGO_SCALE;
+ int x_offset = display->x_offset * PANGO2_SCALE;
- pango_line_iter_get_line_extents (line_iter, NULL, &logical_rect);
+ pango2_line_iter_get_line_extents (line_iter, NULL, &logical_rect);
- pango_line_x_to_index (pango_line,
- x * PANGO_SCALE - x_offset - logical_rect.x,
+ pango2_line_x_to_index (pango2_line,
+ x * PANGO2_SCALE - x_offset - logical_rect.x,
&byte_index, &trailing);
line_display_index_to_iter (layout, display, iter, byte_index, trailing);
@@ -3583,9 +3581,9 @@ gtk_text_layout_move_iter_to_x (GtkTextLayout *layout,
break;
}
}
- while (pango_line_iter_next_line (line_iter));
+ while (pango2_line_iter_next_line (line_iter));
- pango_line_iter_free (line_iter);
+ pango2_line_iter_free (line_iter);
gtk_text_line_display_unref (display);
}
@@ -3647,14 +3645,14 @@ gtk_text_layout_move_iter_visually (GtkTextLayout *layout,
if (count > 0)
{
- pango_lines_move_cursor (pango_layout_get_lines (display->layout), strong,
+ pango2_lines_move_cursor (pango2_layout_get_lines (display->layout), strong,
NULL, line_byte, 0, 1,
NULL, &new_index, &new_trailing);
count--;
}
else
{
- pango_lines_move_cursor (pango_layout_get_lines (display->layout), strong,
+ pango2_lines_move_cursor (pango2_layout_get_lines (display->layout), strong,
NULL, line_byte, 0, -1,
NULL, &new_index, &new_trailing);
count++;
@@ -3845,42 +3843,42 @@ render_para (GskPangoRenderer *crenderer,
gboolean draw_selection_text,
float cursor_alpha)
{
- PangoLayout *layout = line_display->layout;
+ Pango2Layout *layout = line_display->layout;
int byte_offset = 0;
- PangoLineIter *iter;
+ Pango2LineIter *iter;
int screen_width;
gboolean first = TRUE;
- iter = pango_layout_get_iter (layout);
+ iter = pango2_layout_get_iter (layout);
screen_width = line_display->total_width;
do
{
- PangoLine *line = pango_line_iter_get_line (iter);
+ Pango2Line *line = pango2_line_iter_get_line (iter);
int selection_y, selection_height;
- PangoRectangle ext;
+ Pango2Rectangle ext;
int first_y, last_y;
- PangoRectangle line_rect;
+ Pango2Rectangle line_rect;
int baseline;
gboolean at_last_line;
- pango_line_iter_get_line_extents (iter, NULL, &line_rect);
- baseline = pango_line_iter_get_line_baseline (iter);
- pango_line_iter_get_line_extents (iter, NULL, &ext);
+ pango2_line_iter_get_line_extents (iter, NULL, &line_rect);
+ baseline = pango2_line_iter_get_line_baseline (iter);
+ pango2_line_iter_get_line_extents (iter, NULL, &ext);
first_y = ext.y;
last_y = ext.y + ext.height;
/* Adjust for margins */
- line_rect.x += line_display->x_offset * PANGO_SCALE;
- line_rect.y += line_display->top_margin * PANGO_SCALE;
- baseline += line_display->top_margin * PANGO_SCALE;
+ line_rect.x += line_display->x_offset * PANGO2_SCALE;
+ line_rect.y += line_display->top_margin * PANGO2_SCALE;
+ baseline += line_display->top_margin * PANGO2_SCALE;
/* Selection is the height of the line, plus top/bottom
* margin if we're the first/last line
*/
- selection_y = PANGO_PIXELS (first_y) + line_display->top_margin;
- selection_height = PANGO_PIXELS (last_y) - PANGO_PIXELS (first_y);
+ selection_y = PANGO2_PIXELS (first_y) + line_display->top_margin;
+ selection_height = PANGO2_PIXELS (last_y) - PANGO2_PIXELS (first_y);
if (first)
{
@@ -3889,7 +3887,7 @@ render_para (GskPangoRenderer *crenderer,
first = FALSE;
}
- at_last_line = pango_line_iter_at_last_line (iter);
+ at_last_line = pango2_line_iter_at_last_line (iter);
if (at_last_line)
selection_height += line_display->bottom_margin;
@@ -3897,7 +3895,7 @@ render_para (GskPangoRenderer *crenderer,
* only do it if the selection is opaque.
*/
if (selection_start_index < byte_offset &&
- selection_end_index > pango_line_get_length (line) + byte_offset &&
+ selection_end_index > pango2_line_get_length (line) + byte_offset &&
selection->alpha >= 1)
{
gtk_snapshot_append_color (crenderer->snapshot,
@@ -3910,7 +3908,7 @@ render_para (GskPangoRenderer *crenderer,
if (draw_selection_text)
{
gsk_pango_renderer_set_state (crenderer, GSK_PANGO_RENDERER_SELECTED);
- pango_renderer_draw_line (PANGO_RENDERER (crenderer),
+ pango2_renderer_draw_line (PANGO2_RENDERER (crenderer),
line,
line_rect.x,
baseline);
@@ -3927,23 +3925,23 @@ render_para (GskPangoRenderer *crenderer,
selection_height));
gsk_pango_renderer_set_state (crenderer, GSK_PANGO_RENDERER_NORMAL);
- pango_renderer_draw_line (PANGO_RENDERER (crenderer),
+ pango2_renderer_draw_line (PANGO2_RENDERER (crenderer),
line,
line_rect.x,
baseline);
/* Check if some part of the line is selected; the newline
- * that is after pango_line_get_length (line) for the last line of the
+ * that is after pango2_line_get_length (line) for the last line of the
* paragraph counts as part of the line for this
*/
- if ((selection_start_index < byte_offset + pango_line_get_length (line) ||
- (selection_start_index == byte_offset + pango_line_get_length (line) &&
pango_line_iter_at_last_line (iter))) &&
+ if ((selection_start_index < byte_offset + pango2_line_get_length (line) ||
+ (selection_start_index == byte_offset + pango2_line_get_length (line) &&
pango2_line_iter_at_last_line (iter))) &&
selection_end_index > byte_offset)
{
int *ranges = NULL;
int n_ranges, i;
- pango_lines_get_x_ranges (pango_line_iter_get_lines (iter), line, NULL, selection_start_index,
NULL, selection_end_index, &ranges, &n_ranges);
+ pango2_lines_get_x_ranges (pango2_line_iter_get_lines (iter), line, NULL,
selection_start_index, NULL, selection_end_index, &ranges, &n_ranges);
gsk_pango_renderer_set_state (crenderer, GSK_PANGO_RENDERER_SELECTED);
@@ -3951,20 +3949,20 @@ render_para (GskPangoRenderer *crenderer,
{
graphene_rect_t bounds;
- bounds.origin.x = line_display->x_offset + PANGO_PIXELS (ranges[2*i]);
+ bounds.origin.x = line_display->x_offset + PANGO2_PIXELS (ranges[2*i]);
bounds.origin.y = selection_y;
- bounds.size.width = PANGO_PIXELS (ranges[2*i + 1]) - PANGO_PIXELS (ranges[2*i]);
+ bounds.size.width = PANGO2_PIXELS (ranges[2*i + 1]) - PANGO2_PIXELS (ranges[2*i]);
bounds.size.height = selection_height;
- if (bounds.origin.x < PANGO_PIXELS (line_rect.x))
+ if (bounds.origin.x < PANGO2_PIXELS (line_rect.x))
{
- bounds.size.width -= PANGO_PIXELS (line_rect.x) - bounds.origin.x;
- bounds.origin.x = PANGO_PIXELS (line_rect.x);
+ bounds.size.width -= PANGO2_PIXELS (line_rect.x) - bounds.origin.x;
+ bounds.origin.x = PANGO2_PIXELS (line_rect.x);
}
bounds.size.width = MIN (bounds.size.width,
- PANGO_PIXELS (line_rect.x) +
- PANGO_PIXELS (line_rect.width) -
+ PANGO2_PIXELS (line_rect.x) +
+ PANGO2_PIXELS (line_rect.width) -
bounds.origin.x);
gtk_snapshot_append_color (crenderer->snapshot, selection, &bounds);
@@ -3972,7 +3970,7 @@ render_para (GskPangoRenderer *crenderer,
if (draw_selection_text)
{
gtk_snapshot_push_clip (crenderer->snapshot, &bounds);
- pango_renderer_draw_line (PANGO_RENDERER (crenderer),
+ pango2_renderer_draw_line (PANGO2_RENDERER (crenderer),
line,
line_rect.x,
baseline);
@@ -3983,28 +3981,28 @@ render_para (GskPangoRenderer *crenderer,
g_free (ranges);
/* Paint in the ends of the line */
- if (line_rect.x > line_display->left_margin * PANGO_SCALE &&
+ if (line_rect.x > line_display->left_margin * PANGO2_SCALE &&
((line_display->direction == GTK_TEXT_DIR_LTR && selection_start_index < byte_offset) ||
- (line_display->direction == GTK_TEXT_DIR_RTL && selection_end_index > byte_offset +
pango_line_get_length (line))))
+ (line_display->direction == GTK_TEXT_DIR_RTL && selection_end_index > byte_offset +
pango2_line_get_length (line))))
gtk_snapshot_append_color (crenderer->snapshot,
selection,
&GRAPHENE_RECT_INIT (line_display->left_margin,
selection_y,
- PANGO_PIXELS (line_rect.x) -
line_display->left_margin,
+ PANGO2_PIXELS (line_rect.x) -
line_display->left_margin,
selection_height));
if (line_rect.x + line_rect.width <
- (screen_width + line_display->left_margin) * PANGO_SCALE &&
- ((line_display->direction == GTK_TEXT_DIR_LTR && selection_end_index > byte_offset +
pango_line_get_length (line)) ||
+ (screen_width + line_display->left_margin) * PANGO2_SCALE &&
+ ((line_display->direction == GTK_TEXT_DIR_LTR && selection_end_index > byte_offset +
pango2_line_get_length (line)) ||
(line_display->direction == GTK_TEXT_DIR_RTL && selection_start_index < byte_offset)))
{
int nonlayout_width = line_display->left_margin
+ screen_width
- - PANGO_PIXELS (line_rect.x)
- - PANGO_PIXELS (line_rect.width);
+ - PANGO2_PIXELS (line_rect.x)
+ - PANGO2_PIXELS (line_rect.width);
gtk_snapshot_append_color (crenderer->snapshot,
selection,
- &GRAPHENE_RECT_INIT (PANGO_PIXELS (line_rect.x) + PANGO_PIXELS
(line_rect.width),
+ &GRAPHENE_RECT_INIT (PANGO2_PIXELS (line_rect.x) +
PANGO2_PIXELS (line_rect.width),
selection_y,
nonlayout_width,
selection_height));
@@ -4014,8 +4012,8 @@ render_para (GskPangoRenderer *crenderer,
gtk_widget_has_focus (crenderer->widget) &&
cursor_alpha > 0 &&
byte_offset <= line_display->insert_index &&
- (line_display->insert_index < byte_offset + pango_line_get_length (line) ||
- (at_last_line && line_display->insert_index == byte_offset + pango_line_get_length
(line))))
+ (line_display->insert_index < byte_offset + pango2_line_get_length (line) ||
+ (at_last_line && line_display->insert_index == byte_offset + pango2_line_get_length
(line))))
{
GtkStyleContext *context;
GdkRGBA cursor_color;
@@ -4040,7 +4038,7 @@ render_para (GskPangoRenderer *crenderer,
{
gsk_pango_renderer_set_state (crenderer, GSK_PANGO_RENDERER_CURSOR);
gtk_snapshot_push_clip (crenderer->snapshot, &bounds);
- pango_renderer_draw_line (PANGO_RENDERER (crenderer),
+ pango2_renderer_draw_line (PANGO2_RENDERER (crenderer),
line,
line_rect.x,
baseline);
@@ -4050,11 +4048,11 @@ render_para (GskPangoRenderer *crenderer,
}
}
- byte_offset += pango_line_get_length (line);
+ byte_offset += pango2_line_get_length (line);
}
- while (pango_line_iter_next_line (iter));
+ while (pango2_line_iter_next_line (iter));
- pango_line_iter_free (iter);
+ pango2_line_iter_free (iter);
}
static gboolean
@@ -4217,7 +4215,7 @@ gtk_text_layout_snapshot (GtkTextLayout *layout,
}
if (line_display->node == NULL &&
- (pango_layout_get_character_count (line_display->layout) > 0 ||
+ (pango2_layout_get_character_count (line_display->layout) > 0 ||
selection_start_index != -1 || selection_end_index != -1 ||
line_display->has_block_cursor))
{
@@ -4249,11 +4247,11 @@ gtk_text_layout_snapshot (GtkTextLayout *layout,
for (int i = 0; i < line_display->cursors->len; i++)
{
- PangoDirection dir;
+ Pango2Direction dir;
CursorPosition cursor;
cursor = g_array_index (line_display->cursors, CursorPosition, i);
- dir = (line_display->direction == GTK_TEXT_DIR_RTL) ? PANGO_DIRECTION_RTL :
PANGO_DIRECTION_LTR;
+ dir = (line_display->direction == GTK_TEXT_DIR_RTL) ? PANGO2_DIRECTION_RTL :
PANGO2_DIRECTION_LTR;
if (cursor.is_insert || cursor.is_selection_bound)
gtk_snapshot_push_opacity (cursor_snapshot, cursor_alpha);
diff --git a/gtk/gtktextlayoutprivate.h b/gtk/gtktextlayoutprivate.h
index 703f7457b1..a03af601ab 100644
--- a/gtk/gtktextlayoutprivate.h
+++ b/gtk/gtktextlayoutprivate.h
@@ -5,7 +5,7 @@
* Copyright (c) 1994-1997 Sun Microsystems, Inc.
* Copyright (c) 2000 Red Hat, Inc.
* Tk->Gtk port by Havoc Pennington
- * Pango support by Owen Taylor
+ * Pango2 support by Owen Taylor
*
* This file can be used under your choice of two licenses, the LGPL
* and the original Tk license.
@@ -121,9 +121,9 @@ struct _GtkTextLayout
/* Default style used if no tags override it */
GtkTextAttributes *default_style;
- /* Pango contexts used for creating layouts */
- PangoContext *ltr_context;
- PangoContext *rtl_context;
+ /* Pango2 contexts used for creating layouts */
+ Pango2Context *ltr_context;
+ Pango2Context *rtl_context;
/* A cache of one style; this is used to ensure
* we don't constantly regenerate the style
@@ -151,7 +151,7 @@ struct _GtkTextLayout
/* The preedit string and attributes, if any */
char *preedit_string;
- PangoAttrList *preedit_attrs;
+ Pango2AttrList *preedit_attrs;
int preedit_len;
int preedit_cursor;
};
@@ -170,11 +170,11 @@ struct _CursorPosition {
struct _GtkTextLineDisplay
{
- PangoLayout *layout;
+ Pango2Layout *layout;
GskRenderNode *node;
- GArray *cursors; /* indexes of cursors in the PangoLayout, and mark names */
+ GArray *cursors; /* indexes of cursors in the Pango2Layout, and mark names */
/* GSequenceIter backpointer for use within cache */
GSequenceIter *cache_iter;
@@ -212,7 +212,7 @@ struct _GtkTextLineDisplay
};
#ifdef GTK_COMPILATION
-extern G_GNUC_INTERNAL PangoAttrType gtk_text_attr_appearance_type;
+extern G_GNUC_INTERNAL Pango2AttrType gtk_text_attr_appearance_type;
#endif
GType gtk_text_layout_get_type (void) G_GNUC_CONST;
@@ -224,8 +224,8 @@ GtkTextBuffer *gtk_text_layout_get_buffer (GtkTextLayout *lay
void gtk_text_layout_set_default_style (GtkTextLayout *layout,
GtkTextAttributes *values);
void gtk_text_layout_set_contexts (GtkTextLayout *layout,
- PangoContext *ltr_context,
- PangoContext *rtl_context);
+ Pango2Context *ltr_context,
+ Pango2Context *rtl_context);
void gtk_text_layout_set_cursor_direction (GtkTextLayout *layout,
GtkTextDirection direction);
void gtk_text_layout_set_overwrite_mode (GtkTextLayout *layout,
@@ -238,7 +238,7 @@ void gtk_text_layout_set_screen_width (GtkTextLayout *layout,
int width);
void gtk_text_layout_set_preedit_string (GtkTextLayout *layout,
const char *preedit_string,
- PangoAttrList *preedit_attrs,
+ Pango2AttrList *preedit_attrs,
int cursor_pos);
void gtk_text_layout_set_cursor_visible (GtkTextLayout *layout,
diff --git a/gtk/gtktextprivate.h b/gtk/gtktextprivate.h
index b6a61843af..a0e914ce1e 100644
--- a/gtk/gtktextprivate.h
+++ b/gtk/gtktextprivate.h
@@ -97,7 +97,7 @@ void gtk_text_enter_text (GtkText *entry,
void gtk_text_set_positions (GtkText *entry,
int current_pos,
int selection_bound);
-PangoLayout * gtk_text_get_layout (GtkText *entry);
+Pango2Layout * gtk_text_get_layout (GtkText *entry);
void gtk_text_get_layout_offsets (GtkText *entry,
int *x,
int *y);
diff --git a/gtk/gtktexttag.c b/gtk/gtktexttag.c
index 7f8dbcef23..0d3a34a789 100644
--- a/gtk/gtktexttag.c
+++ b/gtk/gtktexttag.c
@@ -310,7 +310,7 @@ gtk_text_tag_class_init (GtkTextTagClass *klass)
* Font description as string, e.g. \"Sans Italic 12\".
*
* Note that the initial value of this property depends on
- * the internals of `PangoFontDescription`.
+ * the internals of `Pango2FontDescription`.
*/
g_object_class_install_property (object_class,
PROP_FONT,
@@ -321,12 +321,12 @@ gtk_text_tag_class_init (GtkTextTagClass *klass)
/**
* GtkTextTag:font-desc:
*
- * Font description as a `PangoFontDescription`.
+ * Font description as a `Pango2FontDescription`.
*/
g_object_class_install_property (object_class,
PROP_FONT_DESC,
g_param_spec_boxed ("font-desc", NULL, NULL,
- PANGO_TYPE_FONT_DESCRIPTION,
+ PANGO2_TYPE_FONT_DESCRIPTION,
GTK_PARAM_READWRITE));
/**
@@ -343,25 +343,25 @@ gtk_text_tag_class_init (GtkTextTagClass *klass)
/**
* GtkTextTag:style:
*
- * Font style as a `PangoStyle`, e.g. %PANGO_STYLE_ITALIC.
+ * Font style as a `Pango2Style`, e.g. %PANGO2_STYLE_ITALIC.
*/
g_object_class_install_property (object_class,
PROP_STYLE,
g_param_spec_enum ("style", NULL, NULL,
- PANGO_TYPE_STYLE,
- PANGO_STYLE_NORMAL,
+ PANGO2_TYPE_STYLE,
+ PANGO2_STYLE_NORMAL,
GTK_PARAM_READWRITE));
/**
* GtkTextTag:variant:
*
- * Font variant as a `PangoVariant`, e.g. %PANGO_VARIANT_SMALL_CAPS.
+ * Font variant as a `Pango2Variant`, e.g. %PANGO2_VARIANT_SMALL_CAPS.
*/
g_object_class_install_property (object_class,
PROP_VARIANT,
g_param_spec_enum ("variant", NULL, NULL,
- PANGO_TYPE_VARIANT,
- PANGO_VARIANT_NORMAL,
+ PANGO2_TYPE_VARIANT,
+ PANGO2_VARIANT_NORMAL,
GTK_PARAM_READWRITE));
/**
* GtkTextTag:weight:
@@ -373,25 +373,25 @@ gtk_text_tag_class_init (GtkTextTagClass *klass)
g_param_spec_int ("weight", NULL, NULL,
0,
G_MAXINT,
- PANGO_WEIGHT_NORMAL,
+ PANGO2_WEIGHT_NORMAL,
GTK_PARAM_READWRITE));
/**
* GtkTextTag:stretch:
*
- * Font stretch as a `PangoStretch`, e.g. %PANGO_STRETCH_CONDENSED.
+ * Font stretch as a `Pango2Stretch`, e.g. %PANGO2_STRETCH_CONDENSED.
*/
g_object_class_install_property (object_class,
PROP_STRETCH,
g_param_spec_enum ("stretch", NULL, NULL,
- PANGO_TYPE_STRETCH,
- PANGO_STRETCH_NORMAL,
+ PANGO2_TYPE_STRETCH,
+ PANGO2_STRETCH_NORMAL,
GTK_PARAM_READWRITE));
/**
* GtkTextTag:size:
*
- * Font size in Pango units.
+ * Font size in Pango2 units.
*/
g_object_class_install_property (object_class,
PROP_SIZE,
@@ -407,7 +407,7 @@ gtk_text_tag_class_init (GtkTextTagClass *klass)
* Font size as a scale factor relative to the default font size.
*
* This properly adapts to theme changes, etc. so is recommended.
- * Pango predefines some scales such as %PANGO_SCALE_X_LARGE.
+ * Pango2 predefines some scales such as %PANGO2_SCALE_X_LARGE.
*/
g_object_class_install_property (object_class,
PROP_SCALE,
@@ -447,7 +447,7 @@ gtk_text_tag_class_init (GtkTextTagClass *klass)
*
* The language this text is in, as an ISO code.
*
- * Pango can use this as a hint when rendering the text.
+ * Pango2 can use this as a hint when rendering the text.
* If not set, an appropriate default will be used.
*
* Note that the initial value of this property depends
@@ -501,7 +501,7 @@ gtk_text_tag_class_init (GtkTextTagClass *klass)
/**
* GtkTextTag:rise:
*
- * Offset of text above the baseline, in Pango units.
+ * Offset of text above the baseline, in Pango2 units.
*
* Negative values go below the baseline.
*/
@@ -584,15 +584,15 @@ gtk_text_tag_class_init (GtkTextTagClass *klass)
g_object_class_install_property (object_class,
PROP_UNDERLINE,
g_param_spec_enum ("underline", NULL, NULL,
- PANGO_TYPE_LINE_STYLE,
- PANGO_LINE_STYLE_NONE,
+ PANGO2_TYPE_LINE_STYLE,
+ PANGO2_LINE_STYLE_NONE,
GTK_PARAM_READWRITE));
g_object_class_install_property (object_class,
PROP_UNDERLINE_POSITION,
g_param_spec_enum ("underline-position", NULL, NULL,
- PANGO_TYPE_UNDERLINE_POSITION,
- PANGO_UNDERLINE_POSITION_NORMAL,
+ PANGO2_TYPE_UNDERLINE_POSITION,
+ PANGO2_UNDERLINE_POSITION_NORMAL,
GTK_PARAM_READWRITE));
/**
@@ -602,7 +602,7 @@ gtk_text_tag_class_init (GtkTextTagClass *klass)
*
* If not set, underlines will use the foreground color.
*
- * If [property@Gtk.TextTag:underline] is set to %PANGO_UNDERLINE_ERROR,
+ * If [property@Gtk.TextTag:underline] is set to %PANGO2_UNDERLINE_ERROR,
* an alternate color may be applied instead of the foreground. Setting
* this property will always override those defaults.
*/
@@ -620,8 +620,8 @@ gtk_text_tag_class_init (GtkTextTagClass *klass)
g_object_class_install_property (object_class,
PROP_OVERLINE,
g_param_spec_enum ("overline", NULL, NULL,
- PANGO_TYPE_LINE_STYLE,
- PANGO_LINE_STYLE_NONE,
+ PANGO2_TYPE_LINE_STYLE,
+ PANGO2_LINE_STYLE_NONE,
GTK_PARAM_READWRITE));
/**
@@ -671,7 +671,7 @@ gtk_text_tag_class_init (GtkTextTagClass *klass)
g_object_class_install_property (object_class,
PROP_TABS,
g_param_spec_boxed ("tabs", NULL, NULL,
- PANGO_TYPE_TAB_ARRAY,
+ PANGO2_TYPE_TAB_ARRAY,
GTK_PARAM_READWRITE));
/**
@@ -728,7 +728,7 @@ gtk_text_tag_class_init (GtkTextTagClass *klass)
/**
* GtkTextTag:letter-spacing:
*
- * Extra spacing between graphemes, in Pango units.
+ * Extra spacing between graphemes, in Pango2 units.
*/
g_object_class_install_property (object_class,
PROP_LETTER_SPACING,
@@ -766,8 +766,8 @@ gtk_text_tag_class_init (GtkTextTagClass *klass)
g_object_class_install_property (object_class,
PROP_SHOW_SPACES,
g_param_spec_flags ("show-spaces", NULL, NULL,
- PANGO_TYPE_SHOW_FLAGS,
- PANGO_SHOW_NONE,
+ PANGO2_TYPE_SHOW_FLAGS,
+ PANGO2_SHOW_NONE,
GTK_PARAM_READWRITE));
/**
@@ -791,8 +791,8 @@ gtk_text_tag_class_init (GtkTextTagClass *klass)
g_object_class_install_property (object_class,
PROP_TEXT_TRANSFORM,
g_param_spec_enum ("text-transform", NULL, NULL,
- PANGO_TYPE_TEXT_TRANSFORM,
- PANGO_TEXT_TRANSFORM_NONE,
+ PANGO2_TYPE_TEXT_TRANSFORM,
+ PANGO2_TEXT_TRANSFORM_NONE,
GTK_PARAM_READWRITE));
/**
@@ -1159,63 +1159,63 @@ set_pg_bg_rgba (GtkTextTag *tag, GdkRGBA *rgba)
}
}
-static PangoFontMask
+static Pango2FontMask
get_property_font_set_mask (guint prop_id)
{
switch (prop_id)
{
case PROP_FAMILY_SET:
- return PANGO_FONT_MASK_FAMILY;
+ return PANGO2_FONT_MASK_FAMILY;
case PROP_STYLE_SET:
- return PANGO_FONT_MASK_STYLE;
+ return PANGO2_FONT_MASK_STYLE;
case PROP_VARIANT_SET:
- return PANGO_FONT_MASK_VARIANT;
+ return PANGO2_FONT_MASK_VARIANT;
case PROP_WEIGHT_SET:
- return PANGO_FONT_MASK_WEIGHT;
+ return PANGO2_FONT_MASK_WEIGHT;
case PROP_STRETCH_SET:
- return PANGO_FONT_MASK_STRETCH;
+ return PANGO2_FONT_MASK_STRETCH;
case PROP_SIZE_SET:
- return PANGO_FONT_MASK_SIZE;
+ return PANGO2_FONT_MASK_SIZE;
default:
return 0;
}
}
-static PangoFontMask
-set_font_desc_fields (PangoFontDescription *desc,
- PangoFontMask to_set)
+static Pango2FontMask
+set_font_desc_fields (Pango2FontDescription *desc,
+ Pango2FontMask to_set)
{
- PangoFontMask changed_mask = 0;
+ Pango2FontMask changed_mask = 0;
- if (to_set & PANGO_FONT_MASK_FAMILY)
+ if (to_set & PANGO2_FONT_MASK_FAMILY)
{
- const char *family = pango_font_description_get_family (desc);
+ const char *family = pango2_font_description_get_family (desc);
if (!family)
{
family = "sans";
- changed_mask |= PANGO_FONT_MASK_FAMILY;
+ changed_mask |= PANGO2_FONT_MASK_FAMILY;
}
- pango_font_description_set_family (desc, family);
+ pango2_font_description_set_family (desc, family);
}
- if (to_set & PANGO_FONT_MASK_STYLE)
- pango_font_description_set_style (desc, pango_font_description_get_style (desc));
- if (to_set & PANGO_FONT_MASK_VARIANT)
- pango_font_description_set_variant (desc, pango_font_description_get_variant (desc));
- if (to_set & PANGO_FONT_MASK_WEIGHT)
- pango_font_description_set_weight (desc, pango_font_description_get_weight (desc));
- if (to_set & PANGO_FONT_MASK_STRETCH)
- pango_font_description_set_stretch (desc, pango_font_description_get_stretch (desc));
- if (to_set & PANGO_FONT_MASK_SIZE)
+ if (to_set & PANGO2_FONT_MASK_STYLE)
+ pango2_font_description_set_style (desc, pango2_font_description_get_style (desc));
+ if (to_set & PANGO2_FONT_MASK_VARIANT)
+ pango2_font_description_set_variant (desc, pango2_font_description_get_variant (desc));
+ if (to_set & PANGO2_FONT_MASK_WEIGHT)
+ pango2_font_description_set_weight (desc, pango2_font_description_get_weight (desc));
+ if (to_set & PANGO2_FONT_MASK_STRETCH)
+ pango2_font_description_set_stretch (desc, pango2_font_description_get_stretch (desc));
+ if (to_set & PANGO2_FONT_MASK_SIZE)
{
- int size = pango_font_description_get_size (desc);
+ int size = pango2_font_description_get_size (desc);
if (size <= 0)
{
- size = 10 * PANGO_SCALE;
- changed_mask |= PANGO_FONT_MASK_SIZE;
+ size = 10 * PANGO2_SCALE;
+ changed_mask |= PANGO2_FONT_MASK_SIZE;
}
- pango_font_description_set_size (desc, size);
+ pango2_font_description_set_size (desc, size);
}
return changed_mask;
@@ -1223,66 +1223,66 @@ set_font_desc_fields (PangoFontDescription *desc,
static void
notify_set_changed (GObject *object,
- PangoFontMask changed_mask)
+ Pango2FontMask changed_mask)
{
- if (changed_mask & PANGO_FONT_MASK_FAMILY)
+ if (changed_mask & PANGO2_FONT_MASK_FAMILY)
g_object_notify (object, "family-set");
- if (changed_mask & PANGO_FONT_MASK_STYLE)
+ if (changed_mask & PANGO2_FONT_MASK_STYLE)
g_object_notify (object, "style-set");
- if (changed_mask & PANGO_FONT_MASK_VARIANT)
+ if (changed_mask & PANGO2_FONT_MASK_VARIANT)
g_object_notify (object, "variant-set");
- if (changed_mask & PANGO_FONT_MASK_WEIGHT)
+ if (changed_mask & PANGO2_FONT_MASK_WEIGHT)
g_object_notify (object, "weight-set");
- if (changed_mask & PANGO_FONT_MASK_STRETCH)
+ if (changed_mask & PANGO2_FONT_MASK_STRETCH)
g_object_notify (object, "stretch-set");
- if (changed_mask & PANGO_FONT_MASK_SIZE)
+ if (changed_mask & PANGO2_FONT_MASK_SIZE)
g_object_notify (object, "size-set");
}
static void
notify_fields_changed (GObject *object,
- PangoFontMask changed_mask)
+ Pango2FontMask changed_mask)
{
- if (changed_mask & PANGO_FONT_MASK_FAMILY)
+ if (changed_mask & PANGO2_FONT_MASK_FAMILY)
g_object_notify (object, "family");
- if (changed_mask & PANGO_FONT_MASK_STYLE)
+ if (changed_mask & PANGO2_FONT_MASK_STYLE)
g_object_notify (object, "style");
- if (changed_mask & PANGO_FONT_MASK_VARIANT)
+ if (changed_mask & PANGO2_FONT_MASK_VARIANT)
g_object_notify (object, "variant");
- if (changed_mask & PANGO_FONT_MASK_WEIGHT)
+ if (changed_mask & PANGO2_FONT_MASK_WEIGHT)
g_object_notify (object, "weight");
- if (changed_mask & PANGO_FONT_MASK_STRETCH)
+ if (changed_mask & PANGO2_FONT_MASK_STRETCH)
g_object_notify (object, "stretch");
- if (changed_mask & PANGO_FONT_MASK_SIZE)
+ if (changed_mask & PANGO2_FONT_MASK_SIZE)
g_object_notify (object, "size");
}
static void
set_font_description (GtkTextTag *text_tag,
- PangoFontDescription *font_desc)
+ Pango2FontDescription *font_desc)
{
GtkTextTagPrivate *priv = text_tag->priv;
GObject *object = G_OBJECT (text_tag);
- PangoFontDescription *new_font_desc;
- PangoFontMask old_mask, new_mask, changed_mask, set_changed_mask;
+ Pango2FontDescription *new_font_desc;
+ Pango2FontMask old_mask, new_mask, changed_mask, set_changed_mask;
if (font_desc)
- new_font_desc = pango_font_description_copy (font_desc);
+ new_font_desc = pango2_font_description_copy (font_desc);
else
- new_font_desc = pango_font_description_new ();
+ new_font_desc = pango2_font_description_new ();
if (priv->values->font)
- old_mask = pango_font_description_get_set_fields (priv->values->font);
+ old_mask = pango2_font_description_get_set_fields (priv->values->font);
else
old_mask = 0;
- new_mask = pango_font_description_get_set_fields (new_font_desc);
+ new_mask = pango2_font_description_get_set_fields (new_font_desc);
changed_mask = old_mask | new_mask;
set_changed_mask = old_mask ^ new_mask;
if (priv->values->font)
- pango_font_description_free (priv->values->font);
+ pango2_font_description_free (priv->values->font);
priv->values->font = new_font_desc;
g_object_freeze_notify (object);
@@ -1290,17 +1290,17 @@ set_font_description (GtkTextTag *text_tag,
g_object_notify (object, "font-desc");
g_object_notify (object, "font");
- if (changed_mask & PANGO_FONT_MASK_FAMILY)
+ if (changed_mask & PANGO2_FONT_MASK_FAMILY)
g_object_notify (object, "family");
- if (changed_mask & PANGO_FONT_MASK_STYLE)
+ if (changed_mask & PANGO2_FONT_MASK_STYLE)
g_object_notify (object, "style");
- if (changed_mask & PANGO_FONT_MASK_VARIANT)
+ if (changed_mask & PANGO2_FONT_MASK_VARIANT)
g_object_notify (object, "variant");
- if (changed_mask & PANGO_FONT_MASK_WEIGHT)
+ if (changed_mask & PANGO2_FONT_MASK_WEIGHT)
g_object_notify (object, "weight");
- if (changed_mask & PANGO_FONT_MASK_STRETCH)
+ if (changed_mask & PANGO2_FONT_MASK_STRETCH)
g_object_notify (object, "stretch");
- if (changed_mask & PANGO_FONT_MASK_SIZE)
+ if (changed_mask & PANGO2_FONT_MASK_SIZE)
{
g_object_notify (object, "size");
g_object_notify (object, "size-points");
@@ -1317,7 +1317,7 @@ gtk_text_tag_ensure_font (GtkTextTag *text_tag)
GtkTextTagPrivate *priv = text_tag->priv;
if (!priv->values->font)
- priv->values->font = pango_font_description_new ();
+ priv->values->font = pango2_font_description_new ();
}
static void
@@ -1381,17 +1381,17 @@ gtk_text_tag_set_property (GObject *object,
case PROP_FONT:
{
- PangoFontDescription *font_desc = NULL;
+ Pango2FontDescription *font_desc = NULL;
const char *name;
name = g_value_get_string (value);
if (name)
- font_desc = pango_font_description_from_string (name);
+ font_desc = pango2_font_description_from_string (name);
set_font_description (text_tag, font_desc);
if (font_desc)
- pango_font_description_free (font_desc);
+ pango2_font_description_free (font_desc);
size_changed = TRUE;
}
@@ -1399,7 +1399,7 @@ gtk_text_tag_set_property (GObject *object,
case PROP_FONT_DESC:
{
- PangoFontDescription *font_desc;
+ Pango2FontDescription *font_desc;
font_desc = g_value_get_boxed (value);
@@ -1417,41 +1417,41 @@ gtk_text_tag_set_property (GObject *object,
case PROP_SIZE:
case PROP_SIZE_POINTS:
{
- PangoFontMask old_set_mask;
+ Pango2FontMask old_set_mask;
gtk_text_tag_ensure_font (text_tag);
- old_set_mask = pango_font_description_get_set_fields (priv->values->font);
+ old_set_mask = pango2_font_description_get_set_fields (priv->values->font);
switch (prop_id)
{
case PROP_FAMILY:
- pango_font_description_set_family (priv->values->font,
+ pango2_font_description_set_family (priv->values->font,
g_value_get_string (value));
break;
case PROP_STYLE:
- pango_font_description_set_style (priv->values->font,
+ pango2_font_description_set_style (priv->values->font,
g_value_get_enum (value));
break;
case PROP_VARIANT:
- pango_font_description_set_variant (priv->values->font,
+ pango2_font_description_set_variant (priv->values->font,
g_value_get_enum (value));
break;
case PROP_WEIGHT:
- pango_font_description_set_weight (priv->values->font,
+ pango2_font_description_set_weight (priv->values->font,
g_value_get_int (value));
break;
case PROP_STRETCH:
- pango_font_description_set_stretch (priv->values->font,
+ pango2_font_description_set_stretch (priv->values->font,
g_value_get_enum (value));
break;
case PROP_SIZE:
- pango_font_description_set_size (priv->values->font,
+ pango2_font_description_set_size (priv->values->font,
g_value_get_int (value));
g_object_notify (object, "size-points");
break;
case PROP_SIZE_POINTS:
- pango_font_description_set_size (priv->values->font,
- g_value_get_double (value) * PANGO_SCALE);
+ pango2_font_description_set_size (priv->values->font,
+ g_value_get_double (value) * PANGO2_SCALE);
g_object_notify (object, "size");
break;
@@ -1460,7 +1460,7 @@ gtk_text_tag_set_property (GObject *object,
}
size_changed = TRUE;
- notify_set_changed (object, old_set_mask & pango_font_description_get_set_fields
(priv->values->font));
+ notify_set_changed (object, old_set_mask & pango2_font_description_get_set_fields
(priv->values->font));
g_object_notify (object, "font-desc");
g_object_notify (object, "font");
@@ -1607,7 +1607,7 @@ gtk_text_tag_set_property (GObject *object,
case PROP_LANGUAGE:
priv->language_set = TRUE;
- priv->values->language = pango_language_from_string (g_value_get_string (value));
+ priv->values->language = pango2_language_from_string (g_value_get_string (value));
g_object_notify (object, "language-set");
break;
@@ -1615,11 +1615,11 @@ gtk_text_tag_set_property (GObject *object,
priv->tabs_set = TRUE;
if (priv->values->tabs)
- pango_tab_array_free (priv->values->tabs);
+ pango2_tab_array_free (priv->values->tabs);
/* FIXME I'm not sure if this is a memleak or not */
priv->values->tabs =
- pango_tab_array_copy (g_value_get_boxed (value));
+ pango2_tab_array_copy (g_value_get_boxed (value));
g_object_notify (object, "tabs-set");
@@ -1733,12 +1733,12 @@ gtk_text_tag_set_property (GObject *object,
if (!g_value_get_boolean (value))
{
if (priv->values->font)
- pango_font_description_unset_fields (priv->values->font,
+ pango2_font_description_unset_fields (priv->values->font,
get_property_font_set_mask (prop_id));
}
else
{
- PangoFontMask changed_mask;
+ Pango2FontMask changed_mask;
gtk_text_tag_ensure_font (text_tag);
changed_mask = set_font_desc_fields (priv->values->font,
@@ -1930,7 +1930,7 @@ gtk_text_tag_get_property (GObject *object,
gtk_text_tag_ensure_font (tag);
- str = pango_font_description_to_string (priv->values->font);
+ str = pango2_font_description_to_string (priv->values->font);
g_value_take_string (value, str);
}
break;
@@ -1942,37 +1942,37 @@ gtk_text_tag_get_property (GObject *object,
case PROP_FAMILY:
gtk_text_tag_ensure_font (tag);
- g_value_set_string (value, pango_font_description_get_family (priv->values->font));
+ g_value_set_string (value, pango2_font_description_get_family (priv->values->font));
break;
case PROP_STYLE:
gtk_text_tag_ensure_font (tag);
- g_value_set_enum (value, pango_font_description_get_style (priv->values->font));
+ g_value_set_enum (value, pango2_font_description_get_style (priv->values->font));
break;
case PROP_VARIANT:
gtk_text_tag_ensure_font (tag);
- g_value_set_enum (value, pango_font_description_get_variant (priv->values->font));
+ g_value_set_enum (value, pango2_font_description_get_variant (priv->values->font));
break;
case PROP_WEIGHT:
gtk_text_tag_ensure_font (tag);
- g_value_set_int (value, pango_font_description_get_weight (priv->values->font));
+ g_value_set_int (value, pango2_font_description_get_weight (priv->values->font));
break;
case PROP_STRETCH:
gtk_text_tag_ensure_font (tag);
- g_value_set_enum (value, pango_font_description_get_stretch (priv->values->font));
+ g_value_set_enum (value, pango2_font_description_get_stretch (priv->values->font));
break;
case PROP_SIZE:
gtk_text_tag_ensure_font (tag);
- g_value_set_int (value, pango_font_description_get_size (priv->values->font));
+ g_value_set_int (value, pango2_font_description_get_size (priv->values->font));
break;
case PROP_SIZE_POINTS:
gtk_text_tag_ensure_font (tag);
- g_value_set_double (value, ((double)pango_font_description_get_size (priv->values->font)) /
(double)PANGO_SCALE);
+ g_value_set_double (value, ((double)pango2_font_description_get_size (priv->values->font)) /
(double)PANGO2_SCALE);
break;
case PROP_SCALE:
@@ -2063,7 +2063,7 @@ gtk_text_tag_get_property (GObject *object,
break;
case PROP_LANGUAGE:
- g_value_set_string (value, pango_language_to_string (priv->values->language));
+ g_value_set_string (value, pango2_language_to_string (priv->values->language));
break;
case PROP_TABS:
@@ -2135,8 +2135,8 @@ gtk_text_tag_get_property (GObject *object,
case PROP_STRETCH_SET:
case PROP_SIZE_SET:
{
- PangoFontMask set_mask = priv->values->font ? pango_font_description_get_set_fields
(priv->values->font) : 0;
- PangoFontMask test_mask = get_property_font_set_mask (prop_id);
+ Pango2FontMask set_mask = priv->values->font ? pango2_font_description_get_set_fields
(priv->values->font) : 0;
+ Pango2FontMask test_mask = get_property_font_set_mask (prop_id);
g_value_set_boolean (value, (set_mask & test_mask) != 0);
break;
diff --git a/gtk/gtktextutil.c b/gtk/gtktextutil.c
index 433767d52f..922e367d9d 100644
--- a/gtk/gtktextutil.c
+++ b/gtk/gtktextutil.c
@@ -44,36 +44,36 @@
static void
append_n_lines (GString *str,
const char *text,
- PangoLines *lines,
+ Pango2Lines *lines,
int first,
int n_lines)
{
- PangoLine *line;
+ Pango2Line *line;
int i;
for (i = first; i < first + n_lines; i++)
{
- line = pango_lines_get_lines (lines)[i];
+ line = pango2_lines_get_lines (lines)[i];
g_string_append_len (str,
- &text[pango_line_get_start_index (line)],
- pango_line_get_length (line));
+ &text[pango2_line_get_start_index (line)],
+ pango2_line_get_length (line));
}
}
static void
-limit_layout_lines (PangoLayout *layout)
+limit_layout_lines (Pango2Layout *layout)
{
const char *text;
GString *str;
- PangoLines *lines;
+ Pango2Lines *lines;
int n_lines;
- lines = pango_layout_get_lines (layout);
- n_lines = pango_lines_get_line_count (lines);
+ lines = pango2_layout_get_lines (layout);
+ n_lines = pango2_lines_get_line_count (lines);
if (n_lines >= DRAG_ICON_MAX_LINES)
{
- text = pango_layout_get_text (layout);
+ text = pango2_layout_get_text (layout);
str = g_string_new (NULL);
/* get first lines */
@@ -84,7 +84,7 @@ limit_layout_lines (PangoLayout *layout)
/* get last lines */
append_n_lines (str, text, lines, n_lines - DRAG_ICON_MAX_LINES / 2, DRAG_ICON_MAX_LINES / 2);
- pango_layout_set_text (layout, str->str, -1);
+ pango2_layout_set_text (layout, str->str, -1);
g_string_free (str, TRUE);
}
}
@@ -106,8 +106,8 @@ gtk_text_util_create_drag_icon (GtkWidget *widget,
{
GtkCssStyle *style;
GtkSnapshot *snapshot;
- PangoContext *context;
- PangoLayout *layout;
+ Pango2Context *context;
+ Pango2Layout *layout;
GdkPaintable *paintable;
int layout_width;
int layout_height;
@@ -118,14 +118,14 @@ gtk_text_util_create_drag_icon (GtkWidget *widget,
g_return_val_if_fail (text != NULL, NULL);
context = gtk_widget_get_pango_context (widget);
- layout = pango_layout_new (context);
+ layout = pango2_layout_new (context);
- pango_layout_set_text (layout, text, len);
- pango_layout_set_wrap (layout, PANGO_WRAP_WORD_CHAR);
- pango_lines_get_size (pango_layout_get_lines (layout), &layout_width, NULL);
+ pango2_layout_set_text (layout, text, len);
+ pango2_layout_set_wrap (layout, PANGO2_WRAP_WORD_CHAR);
+ pango2_lines_get_size (pango2_layout_get_lines (layout), &layout_width, NULL);
- layout_width = MIN (layout_width, DRAG_ICON_MAX_WIDTH * PANGO_SCALE);
- pango_layout_set_width (layout, layout_width);
+ layout_width = MIN (layout_width, DRAG_ICON_MAX_WIDTH * PANGO2_SCALE);
+ pango2_layout_set_width (layout, layout_width);
limit_layout_lines (layout);
@@ -145,11 +145,11 @@ gtk_text_util_create_drag_icon (GtkWidget *widget,
bg_widget = gtk_widget_get_parent (widget);
else
bg_widget = widget;
- pango_lines_get_size (pango_layout_get_lines (layout), &layout_width, &layout_height);
+ pango2_lines_get_size (pango2_layout_get_lines (layout), &layout_width, &layout_height);
gtk_snapshot_render_background (snapshot,
gtk_widget_get_style_context (bg_widget),
- 0, 0, layout_width / PANGO_SCALE,
- layout_height / PANGO_SCALE);
+ 0, 0, layout_width / PANGO2_SCALE,
+ layout_height / PANGO2_SCALE);
}
gtk_snapshot_append_layout (snapshot, layout, color);
@@ -178,7 +178,7 @@ set_attributes_from_style (GtkWidget *widget,
*values->appearance.fg_rgba = *gtk_css_color_value_get_rgba (style->core->color);
if (values->font)
- pango_font_description_free (values->font);
+ pango2_font_description_free (values->font);
values->font = gtk_css_style_get_pango_font (style);
}
@@ -209,7 +209,7 @@ gtk_text_util_create_rich_drag_icon (GtkWidget *widget,
GtkTextBuffer *new_buffer;
GtkTextLayout *layout;
GtkTextAttributes *style;
- PangoContext *ltr_context, *rtl_context;
+ Pango2Context *ltr_context, *rtl_context;
GtkTextIter iter;
GdkDisplay *display;
@@ -228,9 +228,9 @@ gtk_text_util_create_rich_drag_icon (GtkWidget *widget,
layout = gtk_text_layout_new ();
ltr_context = gtk_widget_create_pango_context (widget);
- pango_context_set_base_dir (ltr_context, PANGO_DIRECTION_LTR);
+ pango2_context_set_base_dir (ltr_context, PANGO2_DIRECTION_LTR);
rtl_context = gtk_widget_create_pango_context (widget);
- pango_context_set_base_dir (rtl_context, PANGO_DIRECTION_RTL);
+ pango2_context_set_base_dir (rtl_context, PANGO2_DIRECTION_RTL);
gtk_text_layout_set_contexts (layout, ltr_context, rtl_context);
@@ -290,27 +290,27 @@ gtk_text_util_create_rich_drag_icon (GtkWidget *widget,
}
static int
-layout_get_char_width (PangoLayout *layout)
+layout_get_char_width (Pango2Layout *layout)
{
int width;
- PangoFontMetrics *metrics;
- const PangoFontDescription *font_desc;
- PangoContext *context = pango_layout_get_context (layout);
+ Pango2FontMetrics *metrics;
+ const Pango2FontDescription *font_desc;
+ Pango2Context *context = pango2_layout_get_context (layout);
- font_desc = pango_layout_get_font_description (layout);
+ font_desc = pango2_layout_get_font_description (layout);
if (!font_desc)
- font_desc = pango_context_get_font_description (context);
+ font_desc = pango2_context_get_font_description (context);
- metrics = pango_context_get_metrics (context, font_desc, NULL);
- width = pango_font_metrics_get_approximate_char_width (metrics);
- pango_font_metrics_free (metrics);
+ metrics = pango2_context_get_metrics (context, font_desc, NULL);
+ width = pango2_font_metrics_get_approximate_char_width (metrics);
+ pango2_font_metrics_free (metrics);
return width;
}
/*
* _gtk_text_util_get_block_cursor_location
- * @layout: a `PangoLayout`
+ * @layout: a `Pango2Layout`
* @index: index at which cursor is located
* @pos: cursor location
* @at_line_end: whether cursor is drawn at line end, not over some
@@ -320,13 +320,13 @@ layout_get_char_width (PangoLayout *layout)
* It may not be the case if character at index is invisible.
*/
gboolean
-_gtk_text_util_get_block_cursor_location (PangoLayout *layout,
+_gtk_text_util_get_block_cursor_location (Pango2Layout *layout,
int index,
- PangoRectangle *pos,
+ Pango2Rectangle *pos,
gboolean *at_line_end)
{
- PangoRectangle strong_pos, weak_pos;
- PangoLine *line;
+ Pango2Rectangle strong_pos, weak_pos;
+ Pango2Line *line;
gboolean rtl;
int line_no;
const char *text;
@@ -335,7 +335,7 @@ _gtk_text_util_get_block_cursor_location (PangoLayout *layout,
g_return_val_if_fail (index >= 0, FALSE);
g_return_val_if_fail (pos != NULL, FALSE);
- pango_lines_index_to_pos (pango_layout_get_lines (layout), NULL, index, pos);
+ pango2_lines_index_to_pos (pango2_layout_get_lines (layout), NULL, index, pos);
if (pos->width != 0)
{
@@ -351,18 +351,18 @@ _gtk_text_util_get_block_cursor_location (PangoLayout *layout,
}
line = NULL;
- pango_lines_index_to_line (pango_layout_get_lines (layout), index, &line, &line_no, NULL, NULL);
+ pango2_lines_index_to_line (pango2_layout_get_lines (layout), index, &line, &line_no, NULL, NULL);
g_return_val_if_fail (line != NULL, FALSE);
- text = pango_layout_get_text (layout);
+ text = pango2_layout_get_text (layout);
- if (index < pango_line_get_start_index (line) + pango_line_get_length (line))
+ if (index < pango2_line_get_start_index (line) + pango2_line_get_length (line))
{
/* this may be a zero-width character in the middle of the line,
* or it could be a character where line is wrapped, we do want
* block cursor in latter case */
if (g_utf8_next_char (text + index) - text !=
- pango_line_get_start_index (line) + pango_line_get_length (line))
+ pango2_line_get_start_index (line) + pango2_line_get_length (line))
{
/* zero-width character in the middle of the line, do not
* bother with block cursor */
@@ -374,7 +374,7 @@ _gtk_text_util_get_block_cursor_location (PangoLayout *layout,
* be on the left or on the right depending on text direction, or it
* even could be in the middle of visual layout in bidi text. */
- pango_lines_get_cursor_pos (pango_layout_get_lines (layout), NULL, index, &strong_pos, &weak_pos);
+ pango2_lines_get_cursor_pos (pango2_layout_get_lines (layout), NULL, index, &strong_pos, &weak_pos);
if (strong_pos.x != weak_pos.x)
{
@@ -385,27 +385,27 @@ _gtk_text_util_get_block_cursor_location (PangoLayout *layout,
/* In case when index points to the end of line, pos->x is always most right
* pixel of the layout line, so we need to correct it for RTL text. */
- if (pango_line_get_length (line))
+ if (pango2_line_get_length (line))
{
- if (pango_line_get_resolved_direction (line) == PANGO_DIRECTION_RTL)
+ if (pango2_line_get_resolved_direction (line) == PANGO2_DIRECTION_RTL)
{
- PangoLineIter *iter;
- PangoRectangle line_rect;
+ Pango2LineIter *iter;
+ Pango2Rectangle line_rect;
int i;
int left, right;
const char *p;
p = g_utf8_prev_char (text + index);
- pango_line_index_to_x (line, p - text, FALSE, &left);
- pango_line_index_to_x (line, p - text, TRUE, &right);
+ pango2_line_index_to_x (line, p - text, FALSE, &left);
+ pango2_line_index_to_x (line, p - text, TRUE, &right);
pos->x = MIN (left, right);
- iter = pango_layout_get_iter (layout);
+ iter = pango2_layout_get_iter (layout);
for (i = 0; i < line_no; i++)
- pango_line_iter_next_line (iter);
- pango_line_iter_get_line_extents (iter, NULL, &line_rect);
- pango_line_iter_free (iter);
+ pango2_line_iter_next_line (iter);
+ pango2_line_iter_get_line_extents (iter, NULL, &line_rect);
+ pango2_line_iter_free (iter);
rtl = TRUE;
pos->x += line_rect.x;
@@ -415,8 +415,8 @@ _gtk_text_util_get_block_cursor_location (PangoLayout *layout,
}
else
{
- PangoContext *context = pango_layout_get_context (layout);
- rtl = pango_context_get_base_dir (context) == PANGO_DIRECTION_RTL;
+ Pango2Context *context = pango2_layout_get_context (layout);
+ rtl = pango2_context_get_base_dir (context) == PANGO2_DIRECTION_RTL;
}
pos->width = layout_get_char_width (layout);
diff --git a/gtk/gtktextutil.h b/gtk/gtktextutil.h
index 512532c4d0..66f0cf281f 100644
--- a/gtk/gtktextutil.h
+++ b/gtk/gtktextutil.h
@@ -41,9 +41,9 @@ GdkPaintable * gtk_text_util_create_rich_drag_icon (GtkWidget *widget,
GtkTextIter *start,
GtkTextIter *end);
-gboolean _gtk_text_util_get_block_cursor_location (PangoLayout *layout,
+gboolean _gtk_text_util_get_block_cursor_location (Pango2Layout *layout,
int index_,
- PangoRectangle *rectangle,
+ Pango2Rectangle *rectangle,
gboolean *at_line_end);
G_END_DECLS
diff --git a/gtk/gtktextview.c b/gtk/gtktextview.c
index 9cbf82d608..9a21fa4ce1 100644
--- a/gtk/gtktextview.c
+++ b/gtk/gtktextview.c
@@ -272,7 +272,7 @@ struct _GtkTextViewPrivate
guint32 obscured_cursor_timestamp;
gint64 handle_place_time;
- PangoTabArray *tabs;
+ Pango2TabArray *tabs;
guint editable : 1;
@@ -1005,7 +1005,7 @@ gtk_text_view_class_init (GtkTextViewClass *klass)
g_object_class_install_property (gobject_class,
PROP_TABS,
g_param_spec_boxed ("tabs", NULL, NULL,
- PANGO_TYPE_TAB_ARRAY,
+ PANGO2_TYPE_TAB_ARRAY,
GTK_PARAM_READWRITE));
/**
@@ -3668,7 +3668,7 @@ gtk_text_view_get_indent (GtkTextView *text_view)
/**
* gtk_text_view_set_tabs: (attributes org.gtk.Method.set_property=tabs)
* @text_view: a `GtkTextView`
- * @tabs: tabs as a `PangoTabArray`
+ * @tabs: tabs as a `Pango2TabArray`
*
* Sets the default tab stops for paragraphs in @text_view.
*
@@ -3676,7 +3676,7 @@ gtk_text_view_get_indent (GtkTextView *text_view)
*/
void
gtk_text_view_set_tabs (GtkTextView *text_view,
- PangoTabArray *tabs)
+ Pango2TabArray *tabs)
{
GtkTextViewPrivate *priv;
@@ -3685,18 +3685,18 @@ gtk_text_view_set_tabs (GtkTextView *text_view,
priv = text_view->priv;
if (priv->tabs)
- pango_tab_array_free (priv->tabs);
+ pango2_tab_array_free (priv->tabs);
- priv->tabs = tabs ? pango_tab_array_copy (tabs) : NULL;
+ priv->tabs = tabs ? pango2_tab_array_copy (tabs) : NULL;
if (priv->layout && priv->layout->default_style)
{
/* some unkosher futzing in internal struct details... */
if (priv->layout->default_style->tabs)
- pango_tab_array_free (priv->layout->default_style->tabs);
+ pango2_tab_array_free (priv->layout->default_style->tabs);
priv->layout->default_style->tabs =
- priv->tabs ? pango_tab_array_copy (priv->tabs) : NULL;
+ priv->tabs ? pango2_tab_array_copy (priv->tabs) : NULL;
gtk_text_layout_default_style_changed (priv->layout);
}
@@ -3712,18 +3712,18 @@ gtk_text_view_set_tabs (GtkTextView *text_view,
*
* Tags in the buffer may override the defaults. The returned array
* will be %NULL if “standard” (8-space) tabs are used. Free the
- * return value with [method Pango TabArray free].
+ * return value with [method Pango2 TabArray free].
*
* Returns: (nullable) (transfer full): copy of default tab array,
* or %NULL if standard tabs are used; must be freed with
- * [method Pango TabArray free].
+ * [method Pango2 TabArray free].
*/
-PangoTabArray*
+Pango2TabArray*
gtk_text_view_get_tabs (GtkTextView *text_view)
{
g_return_val_if_fail (GTK_IS_TEXT_VIEW (text_view), NULL);
- return text_view->priv->tabs ? pango_tab_array_copy (text_view->priv->tabs) : NULL;
+ return text_view->priv->tabs ? pango2_tab_array_copy (text_view->priv->tabs) : NULL;
}
static void
@@ -3929,7 +3929,7 @@ gtk_text_view_finalize (GObject *object)
cancel_pending_scroll (text_view);
if (priv->tabs)
- pango_tab_array_free (priv->tabs);
+ pango2_tab_array_free (priv->tabs);
if (priv->hadjustment)
g_object_unref (priv->hadjustment);
@@ -4524,7 +4524,7 @@ gtk_text_view_size_allocate (GtkWidget *widget,
{
GtkTextView *text_view;
GtkTextViewPrivate *priv;
- PangoRectangle ext;
+ Pango2Rectangle ext;
int width, height;
GdkRectangle text_rect;
GdkRectangle left_rect;
@@ -4532,7 +4532,7 @@ gtk_text_view_size_allocate (GtkWidget *widget,
GdkRectangle top_rect;
GdkRectangle bottom_rect;
GtkWidget *chooser;
- PangoLayout *layout;
+ Pango2Layout *layout;
guint mru_size;
text_view = GTK_TEXT_VIEW (widget);
@@ -4620,8 +4620,8 @@ gtk_text_view_size_allocate (GtkWidget *widget,
/* Optimize display cache size */
layout = gtk_widget_create_pango_layout (widget, "X");
- pango_lines_get_extents (pango_layout_get_lines (layout), NULL, &ext);
- pango_extents_to_pixels (&ext, NULL);
+ pango2_lines_get_extents (pango2_layout_get_lines (layout), NULL, &ext);
+ pango2_extents_to_pixels (&ext, NULL);
if (ext.height > 0)
{
mru_size = SCREEN_HEIGHT (widget) / ext.height * 3;
@@ -6237,7 +6237,7 @@ iter_line_is_rtl (const GtkTextIter *iter)
{
GtkTextIter start, end;
char *text;
- PangoDirection direction;
+ Pango2Direction direction;
start = end = *iter;
gtk_text_iter_set_line_offset (&start, 0);
@@ -6247,7 +6247,7 @@ iter_line_is_rtl (const GtkTextIter *iter)
g_free (text);
- return direction == PANGO_DIRECTION_RTL;
+ return direction == PANGO2_DIRECTION_RTL;
}
static void
@@ -7670,7 +7670,7 @@ gtk_text_view_set_attributes_from_style (GtkTextView *text_view,
*values->appearance.fg_rgba = *color;
if (values->font)
- pango_font_description_free (values->font);
+ pango2_font_description_free (values->font);
values->font = gtk_css_style_get_pango_font (style);
@@ -7687,14 +7687,14 @@ gtk_text_view_set_attributes_from_style (GtkTextView *text_view,
switch (decoration_style)
{
case GTK_CSS_TEXT_DECORATION_STYLE_DOUBLE:
- values->appearance.underline = PANGO_LINE_STYLE_DOUBLE;
+ values->appearance.underline = PANGO2_LINE_STYLE_DOUBLE;
break;
case GTK_CSS_TEXT_DECORATION_STYLE_WAVY:
- values->appearance.underline = PANGO_LINE_STYLE_DOTTED;
+ values->appearance.underline = PANGO2_LINE_STYLE_DOTTED;
break;
case GTK_CSS_TEXT_DECORATION_STYLE_SOLID:
default:
- values->appearance.underline = PANGO_LINE_STYLE_SOLID;
+ values->appearance.underline = PANGO2_LINE_STYLE_SOLID;
break;
}
@@ -7705,14 +7705,14 @@ gtk_text_view_set_attributes_from_style (GtkTextView *text_view,
}
else
{
- values->appearance.underline = PANGO_LINE_STYLE_NONE;
+ values->appearance.underline = PANGO2_LINE_STYLE_NONE;
gdk_rgba_free (values->appearance.underline_rgba);
values->appearance.underline_rgba = NULL;
}
if (decoration_line & GTK_CSS_TEXT_DECORATION_LINE_OVERLINE)
{
- values->appearance.overline = PANGO_LINE_STYLE_SOLID;
+ values->appearance.overline = PANGO2_LINE_STYLE_SOLID;
if (values->appearance.overline_rgba)
*values->appearance.overline_rgba = *decoration_color;
else
@@ -7720,7 +7720,7 @@ gtk_text_view_set_attributes_from_style (GtkTextView *text_view,
}
else
{
- values->appearance.overline = PANGO_LINE_STYLE_NONE;
+ values->appearance.overline = PANGO2_LINE_STYLE_NONE;
gdk_rgba_free (values->appearance.overline_rgba);
values->appearance.overline_rgba = NULL;
}
@@ -7741,7 +7741,7 @@ gtk_text_view_set_attributes_from_style (GtkTextView *text_view,
}
/* letter-spacing */
- values->letter_spacing = _gtk_css_number_value_get (style->font->letter_spacing, 100) * PANGO_SCALE;
+ values->letter_spacing = _gtk_css_number_value_get (style->font->letter_spacing, 100) * PANGO2_SCALE;
/* line-height */
@@ -7768,7 +7768,7 @@ gtk_text_view_check_keymap_direction (GtkTextView *text_view)
GtkSettings *settings = gtk_widget_get_settings (GTK_WIDGET (text_view));
GdkSeat *seat;
GdkDevice *keyboard;
- PangoDirection direction;
+ Pango2Direction direction;
GtkTextDirection new_cursor_dir;
GtkTextDirection new_keyboard_dir;
gboolean split_cursor;
@@ -7785,13 +7785,13 @@ gtk_text_view_check_keymap_direction (GtkTextView *text_view)
if (keyboard)
direction = gdk_device_get_direction (keyboard);
else
- direction = PANGO_DIRECTION_LTR;
+ direction = PANGO2_DIRECTION_LTR;
g_object_get (settings,
"gtk-split-cursor", &split_cursor,
NULL);
- if (direction == PANGO_DIRECTION_RTL)
+ if (direction == PANGO2_DIRECTION_RTL)
new_keyboard_dir = GTK_TEXT_DIR_RTL;
else
new_keyboard_dir = GTK_TEXT_DIR_LTR;
@@ -7818,7 +7818,7 @@ gtk_text_view_ensure_layout (GtkTextView *text_view)
{
GtkTextAttributes *style;
const GList *iter;
- PangoContext *ltr_context, *rtl_context;
+ Pango2Context *ltr_context, *rtl_context;
DV(g_print(G_STRLOC"\n"));
@@ -7852,8 +7852,8 @@ gtk_text_view_ensure_layout (GtkTextView *text_view)
ltr_context = gtk_widget_create_pango_context (GTK_WIDGET (text_view));
rtl_context = gtk_widget_create_pango_context (GTK_WIDGET (text_view));
- pango_context_set_base_dir (ltr_context, PANGO_DIRECTION_LTR);
- pango_context_set_base_dir (rtl_context, PANGO_DIRECTION_RTL);
+ pango2_context_set_base_dir (ltr_context, PANGO2_DIRECTION_LTR);
+ pango2_context_set_base_dir (rtl_context, PANGO2_DIRECTION_RTL);
gtk_text_layout_set_contexts (priv->layout, ltr_context, rtl_context);
g_object_unref (ltr_context);
g_object_unref (rtl_context);
@@ -7876,7 +7876,7 @@ gtk_text_view_ensure_layout (GtkTextView *text_view)
priv->layout->left_padding = priv->left_padding;
style->indent = priv->indent;
- style->tabs = priv->tabs ? pango_tab_array_copy (priv->tabs) : NULL;
+ style->tabs = priv->tabs ? pango2_tab_array_copy (priv->tabs) : NULL;
style->wrap_mode = priv->wrap_mode;
style->justification = priv->justify;
@@ -8519,7 +8519,7 @@ gtk_text_view_preedit_changed_handler (GtkIMContext *context,
{
GtkTextViewPrivate *priv;
char *str;
- PangoAttrList *attrs;
+ Pango2AttrList *attrs;
int cursor_pos;
GtkTextIter iter;
@@ -8550,7 +8550,7 @@ gtk_text_view_preedit_changed_handler (GtkIMContext *context,
gtk_text_buffer_get_insert (get_buffer (text_view)));
out:
- pango_attr_list_unref (attrs);
+ pango2_attr_list_unref (attrs);
g_free (str);
}
@@ -10145,16 +10145,16 @@ gtk_text_view_buffer_notify_undo (GtkTextBuffer *buffer,
* gtk_text_view_get_ltr_context:
* @text_view: a `GtkTextView`
*
- * Gets the `PangoContext` that is used for rendering LTR directed
+ * Gets the `Pango2Context` that is used for rendering LTR directed
* text layouts.
*
* The context may be replaced when CSS changes occur.
*
- * Returns: (transfer none): a `PangoContext`
+ * Returns: (transfer none): a `Pango2Context`
*
* Since: 4.4
*/
-PangoContext *
+Pango2Context *
gtk_text_view_get_ltr_context (GtkTextView *text_view)
{
g_return_val_if_fail (GTK_IS_TEXT_VIEW (text_view), NULL);
@@ -10168,16 +10168,16 @@ gtk_text_view_get_ltr_context (GtkTextView *text_view)
* gtk_text_view_get_rtl_context:
* @text_view: a `GtkTextView`
*
- * Gets the `PangoContext` that is used for rendering RTL directed
+ * Gets the `Pango2Context` that is used for rendering RTL directed
* text layouts.
*
* The context may be replaced when CSS changes occur.
*
- * Returns: (transfer none): a `PangoContext`
+ * Returns: (transfer none): a `Pango2Context`
*
* Since: 4.4
*/
-PangoContext *
+Pango2Context *
gtk_text_view_get_rtl_context (GtkTextView *text_view)
{
g_return_val_if_fail (GTK_IS_TEXT_VIEW (text_view), NULL);
diff --git a/gtk/gtktextview.h b/gtk/gtktextview.h
index 325077a871..baa742f0f8 100644
--- a/gtk/gtktextview.h
+++ b/gtk/gtktextview.h
@@ -400,9 +400,9 @@ GDK_AVAILABLE_IN_ALL
int gtk_text_view_get_indent (GtkTextView *text_view);
GDK_AVAILABLE_IN_ALL
void gtk_text_view_set_tabs (GtkTextView *text_view,
- PangoTabArray *tabs);
+ Pango2TabArray *tabs);
GDK_AVAILABLE_IN_ALL
-PangoTabArray* gtk_text_view_get_tabs (GtkTextView *text_view);
+Pango2TabArray* gtk_text_view_get_tabs (GtkTextView *text_view);
GDK_AVAILABLE_IN_ALL
void gtk_text_view_set_input_purpose (GtkTextView *text_view,
@@ -428,9 +428,9 @@ void gtk_text_view_set_extra_menu (GtkTextView *text_vi
GDK_AVAILABLE_IN_ALL
GMenuModel * gtk_text_view_get_extra_menu (GtkTextView *text_view);
GDK_AVAILABLE_IN_ALL
-PangoContext *gtk_text_view_get_rtl_context (GtkTextView *text_view);
+Pango2Context *gtk_text_view_get_rtl_context (GtkTextView *text_view);
GDK_AVAILABLE_IN_ALL
-PangoContext *gtk_text_view_get_ltr_context (GtkTextView *text_view);
+Pango2Context *gtk_text_view_get_ltr_context (GtkTextView *text_view);
G_END_DECLS
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index 8433bc3ec9..de7135403c 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -571,7 +571,7 @@ static void gtk_widget_pop_verify_invariants (GtkWidget
#define gtk_widget_push_verify_invariants(widget)
#define gtk_widget_pop_verify_invariants(widget)
#endif
-static PangoContext* gtk_widget_peek_pango_context (GtkWidget *widget);
+static Pango2Context* gtk_widget_peek_pango_context (GtkWidget *widget);
static void gtk_widget_update_default_pango_context (GtkWidget *widget);
static void gtk_widget_propagate_state (GtkWidget *widget,
const GtkStateData *data);
@@ -1383,7 +1383,7 @@ gtk_widget_class_init (GtkWidgetClass *klass)
* GtkWidget:tooltip-markup: (attributes org.gtk.Property.get=gtk_widget_get_tooltip_markup
org.gtk.Property.set=gtk_widget_set_tooltip_markup)
*
* Sets the text of tooltip to be the given string, which is marked up
- * with Pango markup.
+ * with Pango2 markup.
*
* Also see [method@Gtk.Tooltip.set_markup].
*
@@ -6308,7 +6308,7 @@ gtk_widget_pop_verify_invariants (GtkWidget *widget)
}
#endif /* G_ENABLE_CONSISTENCY_CHECKS */
-static PangoContext *
+static Pango2Context *
gtk_widget_peek_pango_context (GtkWidget *widget)
{
return g_object_get_qdata (G_OBJECT (widget), quark_pango_context);
@@ -6318,7 +6318,7 @@ gtk_widget_peek_pango_context (GtkWidget *widget)
* gtk_widget_get_pango_context:
* @widget: a `GtkWidget`
*
- * Gets a `PangoContext` with the appropriate font map, font description,
+ * Gets a `Pango2Context` with the appropriate font map, font description,
* and base direction for this widget.
*
* Unlike the context returned by [method@Gtk.Widget.create_pango_context],
@@ -6328,12 +6328,12 @@ gtk_widget_peek_pango_context (GtkWidget *widget)
* This can be tracked by listening to changes of the
* [property@Gtk.Widget:root] property on the widget.
*
- * Returns: (transfer none): the `PangoContext` for the widget.
+ * Returns: (transfer none): the `Pango2Context` for the widget.
*/
-PangoContext *
+Pango2Context *
gtk_widget_get_pango_context (GtkWidget *widget)
{
- PangoContext *context;
+ Pango2Context *context;
g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL);
@@ -6350,38 +6350,38 @@ gtk_widget_get_pango_context (GtkWidget *widget)
return context;
}
-static PangoFontMap *
+static Pango2FontMap *
gtk_widget_get_effective_font_map (GtkWidget *widget)
{
GtkWidgetPrivate *priv = gtk_widget_get_instance_private (widget);
- PangoFontMap *font_map;
+ Pango2FontMap *font_map;
- font_map = PANGO_FONT_MAP (g_object_get_qdata (G_OBJECT (widget), quark_font_map));
+ font_map = PANGO2_FONT_MAP (g_object_get_qdata (G_OBJECT (widget), quark_font_map));
if (font_map)
return font_map;
else if (priv->parent)
return gtk_widget_get_effective_font_map (priv->parent);
else
- return pango_font_map_get_default ();
+ return pango2_font_map_get_default ();
}
gboolean
gtk_widget_update_pango_context (GtkWidget *widget,
- PangoContext *context,
+ Pango2Context *context,
GtkTextDirection direction)
{
GtkWidgetPrivate *priv = gtk_widget_get_instance_private (widget);
GtkCssStyle *style = gtk_css_node_get_style (priv->cssnode);
- PangoFontDescription *font_desc;
+ Pango2FontDescription *font_desc;
GtkSettings *settings;
cairo_font_options_t *font_options;
guint old_serial;
- old_serial = pango_context_get_serial (context);
+ old_serial = pango2_context_get_serial (context);
font_desc = gtk_css_style_get_pango_font (style);
- pango_context_set_font_description (context, font_desc);
- pango_font_description_free (font_desc);
+ pango2_context_set_font_description (context, font_desc);
+ pango2_font_description_free (font_desc);
settings = gtk_widget_get_settings (widget);
@@ -6391,15 +6391,15 @@ gtk_widget_update_pango_context (GtkWidget *widget,
gboolean hint_font_metrics;
g_object_get (settings, "gtk-hint-font-metrics", &hint_font_metrics, NULL);
- pango_context_set_round_glyph_positions (context, hint_font_metrics);
+ pango2_context_set_round_glyph_positions (context, hint_font_metrics);
}
if (direction != GTK_TEXT_DIR_NONE)
- pango_context_set_base_dir (context, direction == GTK_TEXT_DIR_LTR
- ? PANGO_DIRECTION_LTR
- : PANGO_DIRECTION_RTL);
+ pango2_context_set_base_dir (context, direction == GTK_TEXT_DIR_LTR
+ ? PANGO2_DIRECTION_LTR
+ : PANGO2_DIRECTION_RTL);
- pango_font_map_set_resolution (pango_context_get_font_map (context), _gtk_css_number_value_get
(style->core->dpi, 100));
+ pango2_font_map_set_resolution (pango2_context_get_font_map (context), _gtk_css_number_value_get
(style->core->dpi, 100));
font_options = (cairo_font_options_t*)g_object_get_qdata (G_OBJECT (widget), quark_font_options);
if (settings && font_options)
@@ -6408,24 +6408,24 @@ gtk_widget_update_pango_context (GtkWidget *widget,
options = cairo_font_options_copy (gtk_settings_get_font_options (settings));
cairo_font_options_merge (options, font_options);
- pango_cairo_context_set_font_options (context, options);
+ pango2_cairo_context_set_font_options (context, options);
cairo_font_options_destroy (options);
}
else if (settings)
{
- pango_cairo_context_set_font_options (context,
+ pango2_cairo_context_set_font_options (context,
gtk_settings_get_font_options (settings));
}
- pango_context_set_font_map (context, gtk_widget_get_effective_font_map (widget));
+ pango2_context_set_font_map (context, gtk_widget_get_effective_font_map (widget));
- return old_serial != pango_context_get_serial (context);
+ return old_serial != pango2_context_get_serial (context);
}
static void
gtk_widget_update_default_pango_context (GtkWidget *widget)
{
- PangoContext *context = gtk_widget_peek_pango_context (widget);
+ Pango2Context *context = gtk_widget_peek_pango_context (widget);
if (!context)
return;
@@ -6440,7 +6440,7 @@ gtk_widget_update_default_pango_context (GtkWidget *widget)
* @options: (nullable): a `cairo_font_options_t`
* to unset any previously set default font options
*
- * Sets the `cairo_font_options_t` used for Pango rendering
+ * Sets the `cairo_font_options_t` used for Pango2 rendering
* in this widget.
*
* When not set, the default font options for the `GdkDisplay`
@@ -6499,10 +6499,10 @@ gtk_widget_set_font_map_recurse (GtkWidget *widget, gpointer user_data)
/**
* gtk_widget_set_font_map:
* @widget: a `GtkWidget`
- * @font_map: (nullable): a `PangoFontMap`, or %NULL to unset any
+ * @font_map: (nullable): a `Pango2FontMap`, or %NULL to unset any
* previously set font map
*
- * Sets the font map to use for Pango rendering.
+ * Sets the font map to use for Pango2 rendering.
*
* The font map is the object that is used to look up fonts.
* Setting a custom font map can be useful in special situations,
@@ -6513,13 +6513,13 @@ gtk_widget_set_font_map_recurse (GtkWidget *widget, gpointer user_data)
*/
void
gtk_widget_set_font_map (GtkWidget *widget,
- PangoFontMap *font_map)
+ Pango2FontMap *font_map)
{
- PangoFontMap *map;
+ Pango2FontMap *map;
g_return_if_fail (GTK_IS_WIDGET (widget));
- map = PANGO_FONT_MAP (g_object_get_qdata (G_OBJECT (widget), quark_font_map));
+ map = PANGO2_FONT_MAP (g_object_get_qdata (G_OBJECT (widget), quark_font_map));
if (map == font_map)
return;
@@ -6541,38 +6541,38 @@ gtk_widget_set_font_map (GtkWidget *widget,
*
* See [method@Gtk.Widget.set_font_map].
*
- * Returns: (transfer none) (nullable): A `PangoFontMap`
+ * Returns: (transfer none) (nullable): A `Pango2FontMap`
*/
-PangoFontMap *
+Pango2FontMap *
gtk_widget_get_font_map (GtkWidget *widget)
{
g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL);
- return PANGO_FONT_MAP (g_object_get_qdata (G_OBJECT (widget), quark_font_map));
+ return PANGO2_FONT_MAP (g_object_get_qdata (G_OBJECT (widget), quark_font_map));
}
/**
* gtk_widget_create_pango_context:
* @widget: a `GtkWidget`
*
- * Creates a new `PangoContext` with the appropriate font map,
+ * Creates a new `Pango2Context` with the appropriate font map,
* font options, font description, and base direction for drawing
* text for this widget.
*
* See also [method@Gtk.Widget.get_pango_context].
*
- * Returns: (transfer full): the new `PangoContext`
+ * Returns: (transfer full): the new `Pango2Context`
*/
-PangoContext *
+Pango2Context *
gtk_widget_create_pango_context (GtkWidget *widget)
{
- PangoContext *context;
+ Pango2Context *context;
g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL);
- context = pango_context_new_with_font_map (pango_font_map_get_default ());
+ context = pango2_context_new_with_font_map (pango2_font_map_get_default ());
gtk_widget_update_pango_context (widget, context, _gtk_widget_get_direction (widget));
- pango_context_set_language (context, gtk_get_default_language ());
+ pango2_context_set_language (context, gtk_get_default_language ());
return context;
}
@@ -6582,31 +6582,31 @@ gtk_widget_create_pango_context (GtkWidget *widget)
* @widget: a `GtkWidget`
* @text: (nullable): text to set on the layout
*
- * Creates a new `PangoLayout` with the appropriate font map,
+ * Creates a new `Pango2Layout` with the appropriate font map,
* font description, and base direction for drawing text for
* this widget.
*
- * If you keep a `PangoLayout` created in this way around,
- * you need to re-create it when the widget `PangoContext`
+ * If you keep a `Pango2Layout` created in this way around,
+ * you need to re-create it when the widget `Pango2Context`
* is replaced. This can be tracked by listening to changes
* of the [property@Gtk.Widget:root] property on the widget.
*
- * Returns: (transfer full): the new `PangoLayout`
+ * Returns: (transfer full): the new `Pango2Layout`
**/
-PangoLayout *
+Pango2Layout *
gtk_widget_create_pango_layout (GtkWidget *widget,
const char *text)
{
- PangoLayout *layout;
- PangoContext *context;
+ Pango2Layout *layout;
+ Pango2Context *context;
g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL);
context = gtk_widget_get_pango_context (widget);
- layout = pango_layout_new (context);
+ layout = pango2_layout_new (context);
if (text)
- pango_layout_set_text (layout, text, -1);
+ pango2_layout_set_text (layout, text, -1);
return layout;
}
@@ -9760,7 +9760,7 @@ gtk_widget_get_tooltip_text (GtkWidget *widget)
* @markup: (nullable): the contents of the tooltip for @widget
*
* Sets @markup as the contents of the tooltip, which is marked
- * up with Pango markup.
+ * up with Pango2 markup.
*
* This function will take care of setting the
* [property@Gtk.Widget:has-tooltip] as a side effect, and of the
@@ -9798,7 +9798,7 @@ gtk_widget_set_tooltip_markup (GtkWidget *widget,
*/
if (priv->tooltip_markup != NULL)
{
- pango_parse_markup (priv->tooltip_markup, -1, 0, NULL,
+ pango2_parse_markup (priv->tooltip_markup, -1, 0, NULL,
&priv->tooltip_text,
NULL,
NULL);
diff --git a/gtk/gtkwidget.h b/gtk/gtkwidget.h
index 0788fcdd81..a15765a44c 100644
--- a/gtk/gtkwidget.h
+++ b/gtk/gtkwidget.h
@@ -633,16 +633,16 @@ void gtk_widget_remove_controller (GtkWidget *widget,
GtkEventController *controller);
GDK_AVAILABLE_IN_ALL
-PangoContext *gtk_widget_create_pango_context (GtkWidget *widget);
+Pango2Context *gtk_widget_create_pango_context (GtkWidget *widget);
GDK_AVAILABLE_IN_ALL
-PangoContext *gtk_widget_get_pango_context (GtkWidget *widget);
+Pango2Context *gtk_widget_get_pango_context (GtkWidget *widget);
GDK_AVAILABLE_IN_ALL
void gtk_widget_set_font_options (GtkWidget *widget,
const cairo_font_options_t *options);
GDK_AVAILABLE_IN_ALL
const cairo_font_options_t *gtk_widget_get_font_options (GtkWidget *widget);
GDK_AVAILABLE_IN_ALL
-PangoLayout *gtk_widget_create_pango_layout (GtkWidget *widget,
+Pango2Layout *gtk_widget_create_pango_layout (GtkWidget *widget,
const char *text);
/* Functions for setting directionality for widgets */
@@ -872,9 +872,9 @@ void gtk_widget_activate_default (GtkWidget *widget);
GDK_AVAILABLE_IN_ALL
void gtk_widget_set_font_map (GtkWidget *widget,
- PangoFontMap *font_map);
+ Pango2FontMap *font_map);
GDK_AVAILABLE_IN_ALL
-PangoFontMap * gtk_widget_get_font_map (GtkWidget *widget);
+Pango2FontMap * gtk_widget_get_font_map (GtkWidget *widget);
GDK_AVAILABLE_IN_ALL
GtkWidget * gtk_widget_get_first_child (GtkWidget *widget);
diff --git a/gtk/gtkwidgetprivate.h b/gtk/gtkwidgetprivate.h
index e1e336e6e6..76deb4703a 100644
--- a/gtk/gtkwidgetprivate.h
+++ b/gtk/gtkwidgetprivate.h
@@ -371,7 +371,7 @@ void gtk_widget_realize_at_context (GtkWidget *widget);
void gtk_widget_unrealize_at_context (GtkWidget *widget);
gboolean gtk_widget_update_pango_context (GtkWidget *widget,
- PangoContext *context,
+ Pango2Context *context,
GtkTextDirection direction);
/* inline getters */
diff --git a/gtk/inspector/fpsoverlay.c b/gtk/inspector/fpsoverlay.c
index 859ebdf5b9..cf38d8aec3 100644
--- a/gtk/inspector/fpsoverlay.c
+++ b/gtk/inspector/fpsoverlay.c
@@ -90,15 +90,15 @@ gtk_fps_overlay_snapshot (GtkInspectorOverlay *overlay,
{
GtkFpsOverlay *self = GTK_FPS_OVERLAY (overlay);
GtkFpsInfo *info;
- PangoLayout *layout;
- PangoAttrList *attrs;
+ Pango2Layout *layout;
+ Pango2AttrList *attrs;
gint64 now;
double fps;
char *fps_string;
graphene_rect_t bounds;
gboolean has_bounds;
double overlay_opacity;
- PangoRectangle ext;
+ Pango2Rectangle ext;
now = gdk_frame_clock_get_frame_time (gtk_widget_get_frame_clock (widget));
info = g_hash_table_lookup (self->infos, widget);
@@ -153,12 +153,12 @@ gtk_fps_overlay_snapshot (GtkInspectorOverlay *overlay,
}
layout = gtk_widget_create_pango_layout (widget, fps_string);
- attrs = pango_attr_list_new ();
- pango_attr_list_insert (attrs, pango_attr_font_features_new ("tnum=1"));
- pango_layout_set_attributes (layout, attrs);
- pango_attr_list_unref (attrs);
- pango_lines_get_extents (pango_layout_get_lines (layout), NULL, &ext);
- pango_extents_to_pixels (&ext, NULL);
+ attrs = pango2_attr_list_new ();
+ pango2_attr_list_insert (attrs, pango2_attr_font_features_new ("tnum=1"));
+ pango2_layout_set_attributes (layout, attrs);
+ pango2_attr_list_unref (attrs);
+ pango2_lines_get_extents (pango2_layout_get_lines (layout), NULL, &ext);
+ pango2_extents_to_pixels (&ext, NULL);
gtk_snapshot_save (snapshot);
if (has_bounds)
diff --git a/gtk/inspector/general.c b/gtk/inspector/general.c
index 9beea5b5e6..0b4af495ba 100644
--- a/gtk/inspector/general.c
+++ b/gtk/inspector/general.c
@@ -527,13 +527,13 @@ init_vulkan (GtkInspectorGeneral *gen)
static void
set_monospace_font (GtkWidget *w)
{
- PangoAttrList *attrs;
+ Pango2AttrList *attrs;
- attrs = pango_attr_list_new ();
- pango_attr_list_insert (attrs, pango_attr_fallback_new (FALSE));
- pango_attr_list_insert (attrs, pango_attr_family_new ("Monospace"));
+ attrs = pango2_attr_list_new ();
+ pango2_attr_list_insert (attrs, pango2_attr_fallback_new (FALSE));
+ pango2_attr_list_insert (attrs, pango2_attr_family_new ("Monospace"));
gtk_label_set_attributes (GTK_LABEL (w), attrs);
- pango_attr_list_unref (attrs);
+ pango2_attr_list_unref (attrs);
}
static void
@@ -737,17 +737,17 @@ init_display (GtkInspectorGeneral *gen)
static void
init_pango (GtkInspectorGeneral *gen)
{
- PangoFontMap *fontmap;
+ Pango2FontMap *fontmap;
const char *type;
const char *name;
- fontmap = pango_font_map_get_default ();
+ fontmap = pango2_font_map_get_default ();
type = G_OBJECT_TYPE_NAME (fontmap);
- if (strcmp (type, "PangoFcFontMap") == 0)
+ if (strcmp (type, "Pango2FcFontMap") == 0)
name = "fontconfig";
- else if (strcmp (type, "PangoCoreTextFontMap") == 0)
+ else if (strcmp (type, "Pango2CoreTextFontMap") == 0)
name = "coretext";
- else if (strcmp (type, "PangoDirectWriteFontMap") == 0)
+ else if (strcmp (type, "Pango2DirectWriteFontMap") == 0)
name = "win32";
else
name = type;
diff --git a/gtk/inspector/gtkdataviewer.c b/gtk/inspector/gtkdataviewer.c
index bea24dd6d9..cbcafb892e 100644
--- a/gtk/inspector/gtkdataviewer.c
+++ b/gtk/inspector/gtkdataviewer.c
@@ -280,7 +280,7 @@ gtk_data_viewer_load_value (GtkDataViewer *self,
GFile *file = g_value_get_object (value);
self->contents = gtk_label_new (g_file_peek_path (file));
- gtk_label_set_ellipsize (GTK_LABEL (self->contents), PANGO_ELLIPSIZE_START);
+ gtk_label_set_ellipsize (GTK_LABEL (self->contents), PANGO2_ELLIPSIZE_START);
gtk_widget_set_halign (self->contents, GTK_ALIGN_CENTER);
gtk_widget_set_parent (self->contents, GTK_WIDGET (self));
}
@@ -295,7 +295,7 @@ gtk_data_viewer_load_value (GtkDataViewer *self,
{
GFile *file = l->data;
GtkWidget *label = gtk_label_new (g_file_peek_path (file));
- gtk_label_set_ellipsize (GTK_LABEL (label), PANGO_ELLIPSIZE_START);
+ gtk_label_set_ellipsize (GTK_LABEL (label), PANGO2_ELLIPSIZE_START);
gtk_widget_set_halign (label, GTK_ALIGN_CENTER);
gtk_box_append (GTK_BOX (self->contents), label);
}
diff --git a/gtk/inspector/prop-editor.c b/gtk/inspector/prop-editor.c
index cc3dc89e24..5d7de9c390 100644
--- a/gtk/inspector/prop-editor.c
+++ b/gtk/inspector/prop-editor.c
@@ -363,13 +363,13 @@ static void
attr_list_modified (GtkEntry *entry, ObjectProperty *p)
{
GValue val = G_VALUE_INIT;
- PangoAttrList *attrs;
+ Pango2AttrList *attrs;
- attrs = pango_attr_list_from_string (gtk_editable_get_text (GTK_EDITABLE (entry)));
+ attrs = pango2_attr_list_from_string (gtk_editable_get_text (GTK_EDITABLE (entry)));
if (!attrs)
return;
- g_value_init (&val, PANGO_TYPE_ATTR_LIST);
+ g_value_init (&val, PANGO2_TYPE_ATTR_LIST);
g_value_take_boxed (&val, attrs);
set_property_value (p->obj, p->spec, &val);
g_value_unset (&val);
@@ -407,14 +407,14 @@ attr_list_changed (GObject *object, GParamSpec *pspec, gpointer data)
GValue val = G_VALUE_INIT;
char *str = NULL;
const char *text;
- PangoAttrList *attrs;
+ Pango2AttrList *attrs;
- g_value_init (&val, PANGO_TYPE_ATTR_LIST);
+ g_value_init (&val, PANGO2_TYPE_ATTR_LIST);
get_property_value (object, pspec, &val);
attrs = g_value_get_boxed (&val);
if (attrs)
- str = pango_attr_list_to_string (attrs);
+ str = pango2_attr_list_to_string (attrs);
if (str == NULL)
str = g_strdup ("");
text = gtk_editable_get_text (GTK_EDITABLE (entry));
@@ -781,7 +781,7 @@ font_modified (GtkFontChooser *fb, GParamSpec *pspec, ObjectProperty *p)
{
GValue val = G_VALUE_INIT;
- g_value_init (&val, PANGO_TYPE_FONT_DESCRIPTION);
+ g_value_init (&val, PANGO2_TYPE_FONT_DESCRIPTION);
g_object_get_property (G_OBJECT (fb), "font-desc", &val);
set_property_value (p->obj, p->spec, &val);
g_value_unset (&val);
@@ -792,10 +792,10 @@ font_changed (GObject *object, GParamSpec *pspec, gpointer data)
{
GtkFontChooser *fb = GTK_FONT_CHOOSER (data);
GValue val = G_VALUE_INIT;
- const PangoFontDescription *font_desc;
- PangoFontDescription *fb_font_desc;
+ const Pango2FontDescription *font_desc;
+ Pango2FontDescription *fb_font_desc;
- g_value_init (&val, PANGO_TYPE_FONT_DESCRIPTION);
+ g_value_init (&val, PANGO2_TYPE_FONT_DESCRIPTION);
get_property_value (object, pspec, &val);
font_desc = g_value_get_boxed (&val);
@@ -803,7 +803,7 @@ font_changed (GObject *object, GParamSpec *pspec, gpointer data)
if (font_desc == NULL ||
(fb_font_desc != NULL &&
- !pango_font_description_equal (fb_font_desc, font_desc)))
+ !pango2_font_description_equal (fb_font_desc, font_desc)))
{
block_controller (G_OBJECT (fb));
gtk_font_chooser_set_font_desc (fb, font_desc);
@@ -811,7 +811,7 @@ font_changed (GObject *object, GParamSpec *pspec, gpointer data)
}
g_value_unset (&val);
- pango_font_description_free (fb_font_desc);
+ pango2_font_description_free (fb_font_desc);
}
static char *
@@ -1186,7 +1186,7 @@ property_editor (GObject *object,
object, spec, G_CALLBACK (rgba_modified));
}
else if (type == G_TYPE_PARAM_BOXED &&
- G_PARAM_SPEC_VALUE_TYPE (spec) == PANGO_TYPE_FONT_DESCRIPTION)
+ G_PARAM_SPEC_VALUE_TYPE (spec) == PANGO2_TYPE_FONT_DESCRIPTION)
{
prop_edit = gtk_font_button_new ();
@@ -1215,7 +1215,7 @@ property_editor (GObject *object,
gtk_widget_set_valign (prop_edit, GTK_ALIGN_CENTER);
}
else if (type == G_TYPE_PARAM_BOXED &&
- G_PARAM_SPEC_VALUE_TYPE (spec) == PANGO_TYPE_ATTR_LIST)
+ G_PARAM_SPEC_VALUE_TYPE (spec) == PANGO2_TYPE_ATTR_LIST)
{
prop_edit = gtk_entry_new ();
@@ -1668,7 +1668,7 @@ constructed (GObject *object)
if (!can_modify)
{
label = gtk_label_new ("");
- gtk_label_set_ellipsize (GTK_LABEL (label), PANGO_ELLIPSIZE_END);
+ gtk_label_set_ellipsize (GTK_LABEL (label), PANGO2_ELLIPSIZE_END);
gtk_label_set_max_width_chars (GTK_LABEL (label), 20);
gtk_label_set_xalign (GTK_LABEL (label), 0.0);
gtk_widget_set_hexpand (label, TRUE);
diff --git a/gtk/inspector/recorder.c b/gtk/inspector/recorder.c
index 05078eb71b..ca3a3ff43b 100644
--- a/gtk/inspector/recorder.c
+++ b/gtk/inspector/recorder.c
@@ -909,17 +909,17 @@ populate_render_node_properties (GtkListStore *store,
case GSK_TEXT_NODE:
{
- const PangoFont *font = gsk_text_node_get_font (node);
+ const Pango2Font *font = gsk_text_node_get_font (node);
const GdkRGBA *color = gsk_text_node_get_color (node);
const graphene_point_t *offset = gsk_text_node_get_offset (node);
- PangoFontDescription *desc;
+ Pango2FontDescription *desc;
GString *s;
- desc = pango_font_describe ((PangoFont *)font);
- tmp = pango_font_description_to_string (desc);
+ desc = pango2_font_describe ((Pango2Font *)font);
+ tmp = pango2_font_description_to_string (desc);
add_text_row (store, "Font", tmp);
g_free (tmp);
- pango_font_description_free (desc);
+ pango2_font_description_free (desc);
s = g_string_sized_new (0);
gsk_text_node_serialize_glyphs (node, s);
diff --git a/gtk/language-names.c b/gtk/language-names.c
index 6dd2f22ec4..235d87bd30 100644
--- a/gtk/language-names.c
+++ b/gtk/language-names.c
@@ -44,7 +44,7 @@ get_win32_all_locales_scripts (LPWSTR locale_w, DWORD flags, LPARAM param)
gint i;
const LCTYPE iso639_lctypes[] = { LOCALE_SISO639LANGNAME, LOCALE_SISO639LANGNAME2 };
GHashTable *ht_scripts_langs = (GHashTable *) param;
- PangoLanguage *lang;
+ Pango2Language *lang;
gint langname_size, locale_abbrev_size;
langname_size = GetLocaleInfoEx (locale_w, LOCALE_SLOCALIZEDDISPLAYNAME, langname_w, 0);
@@ -60,7 +60,7 @@ get_win32_all_locales_scripts (LPWSTR locale_w, DWORD flags, LPARAM param)
langname = g_utf16_to_utf8 (langname_w, -1, NULL, NULL, NULL);
locale = g_utf16_to_utf8 (locale_w, -1, NULL, NULL, NULL);
p = strchr (locale, '-');
- lang = pango_language_from_string (locale);
+ lang = pango2_language_from_string (locale);
if (g_hash_table_lookup (ht_scripts_langs, lang) == NULL)
g_hash_table_insert (ht_scripts_langs, lang, langname);
@@ -77,7 +77,7 @@ get_win32_all_locales_scripts (LPWSTR locale_w, DWORD flags, LPARAM param)
GetLocaleInfoEx (locale_w, iso639_lctypes[i], locale_abbrev_w, locale_abbrev_size);
locale_abbrev = g_utf16_to_utf8 (locale_abbrev_w, -1, NULL, NULL, NULL);
- lang = pango_language_from_string (locale_abbrev);
+ lang = pango2_language_from_string (locale_abbrev);
if (g_hash_table_lookup (ht_scripts_langs, lang) == NULL)
g_hash_table_insert (ht_scripts_langs, lang, langname);
@@ -235,22 +235,22 @@ languages_parse_start_tag (GMarkupParseContext *ctx,
if (ccode != NULL)
g_hash_table_insert (language_map,
- pango_language_from_string (ccode),
+ pango2_language_from_string (ccode),
g_strdup (display_name));
if (ccode_longB != NULL)
g_hash_table_insert (language_map,
- pango_language_from_string (ccode_longB),
+ pango2_language_from_string (ccode_longB),
g_strdup (display_name));
if (ccode_longT != NULL)
g_hash_table_insert (language_map,
- pango_language_from_string (ccode_longT),
+ pango2_language_from_string (ccode_longT),
g_strdup (display_name));
if (ccode_id != NULL)
g_hash_table_insert (language_map,
- pango_language_from_string (ccode_id),
+ pango2_language_from_string (ccode_id),
g_strdup (display_name));
g_free (display_name);
@@ -316,7 +316,7 @@ languages_init (void)
}
const char *
-get_language_name (PangoLanguage *language)
+get_language_name (Pango2Language *language)
{
languages_init ();
@@ -332,5 +332,5 @@ get_language_name_for_tag (guint32 tag)
lang = hb_ot_tag_to_language (tag);
s = hb_language_to_string (lang);
- return get_language_name (pango_language_from_string (s));
+ return get_language_name (pango2_language_from_string (s));
}
diff --git a/gtk/language-names.h b/gtk/language-names.h
index 562f7ae2f8..4f27985dfa 100644
--- a/gtk/language-names.h
+++ b/gtk/language-names.h
@@ -1,11 +1,11 @@
#ifndef LANGUAGE_NAMES_H
#define LANGUAGE_NAMES_H
-#include <pango/pango.h>
+#include <pango2/pango.h>
G_BEGIN_DECLS
-const char * get_language_name (PangoLanguage *language);
+const char * get_language_name (Pango2Language *language);
const char * get_language_name_for_tag (guint32 tag);
G_END_DECLS
diff --git a/gtk/meson.build b/gtk/meson.build
index 9d7abc5ce9..d40d30c57a 100644
--- a/gtk/meson.build
+++ b/gtk/meson.build
@@ -1251,7 +1251,7 @@ if build_gir
'--quiet',
]
- gdk_gir_inc = [ 'cairo-1.0', 'Gio-2.0', 'GdkPixbuf-2.0', 'Pango-2.0' ]
+ gdk_gir_inc = [ 'cairo-1.0', 'Gio-2.0', 'GdkPixbuf-2.0', 'Pango2-1.0' ]
gdk_gir = gnome.generate_gir(libgtk,
sources: gdk_public_headers + gdk_public_sources + [ gdkenum_h ],
diff --git a/gtk/ui/gtkfontchooserwidget.ui b/gtk/ui/gtkfontchooserwidget.ui
index 24437263d0..c7079a1201 100644
--- a/gtk/ui/gtkfontchooserwidget.ui
+++ b/gtk/ui/gtkfontchooserwidget.ui
@@ -163,7 +163,7 @@
</closure>
</binding>
<binding name="attributes">
- <closure type="PangoAttrList" function="get_font_attributes">
+ <closure type="Pango2AttrList" function="get_font_attributes">
<lookup name="item">GtkListItem</lookup>
</closure>
</binding>
@@ -313,7 +313,7 @@
</closure>
</binding>
<binding name="attributes" object="GtkFontChooserWidget">
- <closure type="PangoAttrList" function="get_font_attributes">
+ <closure type="Pango2AttrList" function="get_font_attributes">
<lookup name="selected-item">selection</lookup>
</closure>
</binding>
diff --git a/tests/input.c b/tests/input.c
index 01099d2129..62ceedf899 100644
--- a/tests/input.c
+++ b/tests/input.c
@@ -9,7 +9,7 @@ struct _DemoWidget
GtkWidget parent_instance;
GtkIMContext *im_context;
- PangoLayout *layout;
+ Pango2Layout *layout;
};
struct _DemoWidgetClass
@@ -24,8 +24,8 @@ commit_cb (GtkIMContext *context,
const char *str,
DemoWidget *demo)
{
- pango_layout_set_text (demo->layout, str, -1);
- pango_layout_set_attributes (demo->layout, NULL);
+ pango2_layout_set_text (demo->layout, str, -1);
+ pango2_layout_set_attributes (demo->layout, NULL);
gtk_widget_queue_draw (GTK_WIDGET (demo));
}
@@ -34,14 +34,14 @@ preedit_changed_cb (GtkIMContext *context,
DemoWidget *demo)
{
char *str;
- PangoAttrList *attrs;
+ Pango2AttrList *attrs;
int cursor_pos;
gtk_im_context_get_preedit_string (context, &str, &attrs, &cursor_pos);
- pango_layout_set_text (demo->layout, str, -1);
- pango_layout_set_attributes (demo->layout, attrs);
+ pango2_layout_set_text (demo->layout, str, -1);
+ pango2_layout_set_attributes (demo->layout, attrs);
g_free (str);
- pango_attr_list_unref (attrs);
+ pango2_attr_list_unref (attrs);
gtk_widget_queue_draw (GTK_WIDGET (demo));
}
@@ -55,8 +55,8 @@ key_pressed_cb (GtkEventControllerKey *controller,
{
if (keyval == GDK_KEY_BackSpace)
{
- pango_layout_set_text (demo->layout, "", -1);
- pango_layout_set_attributes (demo->layout, NULL);
+ pango2_layout_set_text (demo->layout, "", -1);
+ pango2_layout_set_attributes (demo->layout, NULL);
gtk_widget_queue_draw (GTK_WIDGET (demo));
return TRUE;
diff --git a/tests/rendernode-create-tests.c b/tests/rendernode-create-tests.c
index b12ea7ddd0..62b47466fa 100644
--- a/tests/rendernode-create-tests.c
+++ b/tests/rendernode-create-tests.c
@@ -360,9 +360,9 @@ text (guint n)
{
GPtrArray *nodes;
GskRenderNode *container;
- PangoFontDescription *desc;
- PangoContext *context;
- PangoLayout *layout;
+ Pango2FontDescription *desc;
+ Pango2Context *context;
+ Pango2Layout *layout;
GtkSettings *settings;
char *usr_dict_words;
char **words;
@@ -381,68 +381,68 @@ text (guint n)
}
n_words = g_strv_length (words);
- context = pango_context_new ();
+ context = pango2_context_new ();
nodes = g_ptr_array_new_with_free_func ((GDestroyNotify) gsk_render_node_unref);
settings = gtk_settings_get_default ();
g_object_get (settings, "gtk-xft-dpi", &dpi_int, NULL);
if (dpi_int > 0)
- pango_font_map_set_resolution (pango_font_map_get_default (), dpi_int / 1024.);
+ pango2_font_map_set_resolution (pango2_font_map_get_default (), dpi_int / 1024.);
- desc = pango_font_description_new ();
- pango_font_description_set_family (desc, "Cantarell");
- layout = pango_layout_new (context);
+ desc = pango2_font_description_new ();
+ pango2_font_description_set_family (desc, "Cantarell");
+ layout = pango2_layout_new (context);
for (i = 0; i < n; i++)
{
- PangoFont *font;
- PangoLineIter *iter;
- PangoRun *run;
+ Pango2Font *font;
+ Pango2LineIter *iter;
+ Pango2Run *run;
GdkRGBA color;
- PangoRectangle ext;
+ Pango2Rectangle ext;
int x, y;
- pango_layout_set_text (layout, words[g_random_int_range (0, n_words)], -1);
+ pango2_layout_set_text (layout, words[g_random_int_range (0, n_words)], -1);
if (g_random_boolean ())
- pango_font_description_set_style (desc, PANGO_STYLE_ITALIC);
+ pango2_font_description_set_style (desc, PANGO2_STYLE_ITALIC);
else
- pango_font_description_set_style (desc, PANGO_STYLE_NORMAL);
+ pango2_font_description_set_style (desc, PANGO2_STYLE_NORMAL);
- pango_font_description_set_weight (desc, 100 * g_random_int_range (1, 10));
- pango_font_description_set_size (desc, PANGO_SCALE * g_random_int_range (8,32));
+ pango2_font_description_set_weight (desc, 100 * g_random_int_range (1, 10));
+ pango2_font_description_set_size (desc, PANGO2_SCALE * g_random_int_range (8,32));
- font = pango_context_load_font (context, desc);
- pango_layout_set_font_description (layout, desc);
+ font = pango2_context_load_font (context, desc);
+ pango2_layout_set_font_description (layout, desc);
- pango_lines_get_extents (pango_layout_get_lines (layout), NULL, &ext);
- pango_extents_to_pixels (&ext, NULL);
+ pango2_lines_get_extents (pango2_layout_get_lines (layout), NULL, &ext);
+ pango2_extents_to_pixels (&ext, NULL);
x = ext.width >= 1000 ? 0 : g_random_int_range (0, 1000 - ext.width);
y = ext.height >= 1000 ? 0 : g_random_int_range (0, 1000 - ext.height);
hsv_to_rgb (&color, g_random_double (), g_random_double_range (0.5, 1.0), g_random_double_range (0.15,
0.75));
- iter = pango_layout_get_iter (layout);
+ iter = pango2_layout_get_iter (layout);
do
{
- run = pango_line_iter_get_run (iter);
+ run = pango2_line_iter_get_run (iter);
if (run != NULL)
{
- PangoGlyphString *glyphs;
+ Pango2GlyphString *glyphs;
GskRenderNode *node;
- glyphs = pango_run_get_glyphs (run);
+ glyphs = pango2_run_get_glyphs (run);
node = gsk_text_node_new (font, glyphs, &color, &GRAPHENE_POINT_INIT (x, y));
if (node)
g_ptr_array_add (nodes, node);
}
}
- while (pango_line_iter_next_run (iter));
- pango_line_iter_free (iter);
+ while (pango2_line_iter_next_run (iter));
+ pango2_line_iter_free (iter);
g_object_unref (font);
}
- pango_font_description_free (desc);
+ pango2_font_description_free (desc);
g_object_unref (layout);
container = gsk_container_node_new ((GskRenderNode **) nodes->pdata, nodes->len);
diff --git a/tests/testblur.c b/tests/testblur.c
index 618862cf1c..98280d5ba9 100644
--- a/tests/testblur.c
+++ b/tests/testblur.c
@@ -105,12 +105,12 @@ main (int argc, char **argv)
value_label = gtk_label_new ("FF");
gtk_widget_set_margin_top (value_label, 32);
{
- PangoAttrList *attrs;
+ Pango2AttrList *attrs;
- attrs = pango_attr_list_new ();
- pango_attr_list_insert (attrs, pango_attr_scale_new (6.0));
+ attrs = pango2_attr_list_new ();
+ pango2_attr_list_insert (attrs, pango2_attr_scale_new (6.0));
gtk_label_set_attributes (GTK_LABEL (value_label), attrs);
- pango_attr_list_unref (attrs);
+ pango2_attr_list_unref (attrs);
}
gtk_box_append (GTK_BOX (blur_box), value_label);
diff --git a/tests/testcellarea.c b/tests/testcellarea.c
index 4e08983cea..6a42b54556 100644
--- a/tests/testcellarea.c
+++ b/tests/testcellarea.c
@@ -105,7 +105,7 @@ simple_iconview (void)
cell_3 = renderer = gtk_cell_renderer_text_new ();
g_object_set (G_OBJECT (renderer),
- "wrap-mode", PANGO_WRAP_WORD,
+ "wrap-mode", PANGO2_WRAP_WORD,
"wrap-width", 215,
NULL);
gtk_cell_area_box_pack_start (GTK_CELL_AREA_BOX (area), renderer, FALSE, TRUE, FALSE);
@@ -375,7 +375,7 @@ focus_iconview (gboolean color_bg, GtkCellRenderer **focus, GtkCellRenderer **si
renderer = gtk_cell_renderer_text_new ();
g_object_set (G_OBJECT (renderer),
- "wrap-mode", PANGO_WRAP_WORD,
+ "wrap-mode", PANGO2_WRAP_WORD,
"wrap-width", 150,
NULL);
diff --git a/tests/testcellrenderertext.c b/tests/testcellrenderertext.c
index 1f72ccf9db..fe857ee4cc 100644
--- a/tests/testcellrenderertext.c
+++ b/tests/testcellrenderertext.c
@@ -37,26 +37,26 @@ struct cell_params {
int height; /* 8 */
int width_chars; /* 9 */
int wrap_width; /* 10 */
- PangoWrapMode wrap_mode; /* 11 */
+ Pango2WrapMode wrap_mode; /* 11 */
gboolean single_paragraph_mode; /* 12 */
- PangoEllipsizeMode ellipsize; /* 13 */
- PangoAlignment alignment; /* 14 */
+ Pango2EllipsizeMode ellipsize; /* 13 */
+ Pango2Alignment alignment; /* 14 */
/* COL_BACKGROUND */ /* 15 */
/* COL_LINE_NUM */ /* 16 */
};
-#define WO PANGO_WRAP_WORD
-#define CH PANGO_WRAP_CHAR
-#define WC PANGO_WRAP_WORD_CHAR
+#define WO PANGO2_WRAP_WORD
+#define CH PANGO2_WRAP_CHAR
+#define WC PANGO2_WRAP_WORD_CHAR
-#define NO PANGO_ELLIPSIZE_NONE
-#define ST PANGO_ELLIPSIZE_START
-#define MI PANGO_ELLIPSIZE_MIDDLE
-#define EN PANGO_ELLIPSIZE_END
+#define NO PANGO2_ELLIPSIZE_NONE
+#define ST PANGO2_ELLIPSIZE_START
+#define MI PANGO2_ELLIPSIZE_MIDDLE
+#define EN PANGO2_ELLIPSIZE_END
-#define AL PANGO_ALIGN_LEFT
-#define AC PANGO_ALIGN_CENTER
-#define AR PANGO_ALIGN_RIGHT
+#define AL PANGO2_ALIGN_LEFT
+#define AC PANGO2_ALIGN_CENTER
+#define AR PANGO2_ALIGN_RIGHT
#define TESTL "LEFT JUSTIFIED This is really truly verily some very long
text\n\330\247\331\204\330\263\331\204\330\247\331\205 \330\271\331\204\331\212\331\203\331\205
\330\247\331\204\330\263\331\204\330\247\331\205 \330\271\331\204\331\212\331\203\331\205
\330\247\331\204\330\263\331\204\330\247\331\205 \330\271\331\204\331\212\331\203\331\205"
@@ -97,7 +97,7 @@ static const struct cell_params cell_params[] = {
{ "10 10 .5 1 T -1 -1 -1 -1 CH F NO", TESTC, 10, 10, 0.5, 1.0, TRUE, -1, -1, -1, -1, CH, FALSE, NO ,
AL }, /* 17 */
{ "10 10 1 1 T -1 -1 -1 -1 CH F NO", TESTR, 10, 10, 1.0, 1.0, TRUE, -1, -1, -1, -1, CH, FALSE, NO ,
AL }, /* 18 */
- /* Test Pango alignment (not xalign) */
+ /* Test Pango2 alignment (not xalign) */
{ "0 0 0 0 T -1 -1 -1 -1 CH F NO AL", TESTL, 0, 0, 0.0, 0.0, TRUE, -1, -1, -1, 20, WO, FALSE, NO
, AL }, /* 19 */
{ "0 0 0 0 T -1 -1 -1 -1 CH F NO AC", TESTC, 0, 0, 0.0, 0.0, TRUE, -1, -1, -1, 20, WO, FALSE, NO
, AC }, /* 20 */
{ "0 0 0 0 T -1 -1 -1 -1 CH F NO AR", TESTR, 0, 0, 0.0, 0.0, TRUE, -1, -1, -1, 20, WO, FALSE, NO
, AR }, /* 21 */
@@ -121,10 +121,10 @@ create_list_store (void)
G_TYPE_INT, /* 8 */
G_TYPE_INT, /* 9 */
G_TYPE_INT, /* 10 */
- PANGO_TYPE_WRAP_MODE, /* 11 */
+ PANGO2_TYPE_WRAP_MODE, /* 11 */
G_TYPE_BOOLEAN, /* 12 */
- PANGO_TYPE_ELLIPSIZE_MODE, /* 13 */
- PANGO_TYPE_ALIGNMENT, /* 14 */
+ PANGO2_TYPE_ELLIPSIZE_MODE, /* 13 */
+ PANGO2_TYPE_ALIGNMENT, /* 14 */
G_TYPE_STRING, /* 15 */
G_TYPE_STRING); /* 16 */
diff --git a/tests/testcenterbox.c b/tests/testcenterbox.c
index 0b420baea4..8defdc2f33 100644
--- a/tests/testcenterbox.c
+++ b/tests/testcenterbox.c
@@ -29,15 +29,15 @@ main (int argc, char *argv[])
gtk_window_set_child (GTK_WINDOW (window), box);
child = gtk_label_new ("Start Start Start Start Start");
- gtk_label_set_ellipsize (GTK_LABEL (child), PANGO_ELLIPSIZE_END);
+ gtk_label_set_ellipsize (GTK_LABEL (child), PANGO2_ELLIPSIZE_END);
gtk_center_box_set_start_widget (GTK_CENTER_BOX (box), child);
child = gtk_label_new ("Center");
- gtk_label_set_ellipsize (GTK_LABEL (child), PANGO_ELLIPSIZE_END);
+ gtk_label_set_ellipsize (GTK_LABEL (child), PANGO2_ELLIPSIZE_END);
gtk_center_box_set_center_widget (GTK_CENTER_BOX (box), child);
child = gtk_label_new ("End");
- gtk_label_set_ellipsize (GTK_LABEL (child), PANGO_ELLIPSIZE_END);
+ gtk_label_set_ellipsize (GTK_LABEL (child), PANGO2_ELLIPSIZE_END);
gtk_center_box_set_end_widget (GTK_CENTER_BOX (box), child);
g_signal_connect (window, "destroy", G_CALLBACK (quit_cb), &done);
diff --git a/tests/testcombo.c b/tests/testcombo.c
index 21794045df..ead02b5724 100644
--- a/tests/testcombo.c
+++ b/tests/testcombo.c
@@ -1276,7 +1276,7 @@ main (int argc, char **argv)
g_object_unref (model);
gtk_box_append (GTK_BOX (boom), combobox);
renderer = gtk_cell_renderer_text_new ();
- g_object_set (G_OBJECT (renderer), "ellipsize", PANGO_ELLIPSIZE_END, NULL);
+ g_object_set (G_OBJECT (renderer), "ellipsize", PANGO2_ELLIPSIZE_END, NULL);
gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (combobox), renderer, TRUE);
gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (combobox), renderer,
diff --git a/tests/testdropdown.c b/tests/testdropdown.c
index 357759defa..4d83eadbf0 100644
--- a/tests/testdropdown.c
+++ b/tests/testdropdown.c
@@ -214,7 +214,7 @@ drop_down_new_from_strings (const char *const *titles,
static char *
get_family_name (gpointer item)
{
- return g_strdup (pango_font_family_get_name (PANGO_FONT_FAMILY (item)));
+ return g_strdup (pango2_font_family_get_name (PANGO2_FONT_FAMILY (item)));
}
static char *
@@ -471,7 +471,7 @@ main (int argc, char *argv[])
button = gtk_drop_down_new (NULL, NULL);
- model = G_LIST_MODEL (pango_font_map_get_default ());
+ model = G_LIST_MODEL (pango2_font_map_get_default ());
gtk_drop_down_set_model (GTK_DROP_DOWN (button), model);
gtk_drop_down_set_selected (GTK_DROP_DOWN (button), 0);
diff --git a/tests/testellipsise.c b/tests/testellipsise.c
index 81ebd98f8e..9b1847be21 100644
--- a/tests/testellipsise.c
+++ b/tests/testellipsise.c
@@ -32,7 +32,7 @@ combo_changed_cb (GtkWidget *combo,
int active;
active = gtk_combo_box_get_active (GTK_COMBO_BOX (combo));
- gtk_label_set_ellipsize (GTK_LABEL (label), (PangoEllipsizeMode)active);
+ gtk_label_set_ellipsize (GTK_LABEL (label), (Pango2EllipsizeMode)active);
}
static void
@@ -43,7 +43,7 @@ overlay_draw (GtkDrawingArea *da,
gpointer data)
{
GtkWidget *widget = GTK_WIDGET (da);
- PangoLayout *layout;
+ Pango2Layout *layout;
const double dashes[] = { 6, 18 };
GtkAllocation label_allocation;
GtkRequisition minimum_size, natural_size;
@@ -62,12 +62,12 @@ overlay_draw (GtkDrawingArea *da,
gtk_widget_get_preferred_size (label, &minimum_size, &natural_size);
- pango_layout_set_markup (layout,
+ pango2_layout_set_markup (layout,
"<span color='#c33'>\342\227\217 requisition</span>\n"
"<span color='#3c3'>\342\227\217 natural size</span>\n"
"<span color='#33c'>\342\227\217 allocation</span>", -1);
- pango_cairo_show_layout (cr, layout);
+ pango2_cairo_show_layout (cr, layout);
g_object_unref (layout);
gtk_widget_get_allocation (label, &label_allocation);
diff --git a/tests/testflowbox.c b/tests/testflowbox.c
index c43f2a2575..36dd42bc44 100644
--- a/tests/testflowbox.c
+++ b/tests/testflowbox.c
@@ -144,7 +144,7 @@ populate_flowbox_wrappy (GtkFlowBox *flowbox)
gtk_frame_set_child (GTK_FRAME (frame), widget);
gtk_label_set_wrap (GTK_LABEL (widget), TRUE);
- gtk_label_set_wrap_mode (GTK_LABEL (widget), PANGO_WRAP_WORD);
+ gtk_label_set_wrap_mode (GTK_LABEL (widget), PANGO2_WRAP_WORD);
gtk_label_set_width_chars (GTK_LABEL (widget), 10);
g_object_set_data_full (G_OBJECT (frame), "id", (gpointer)g_strdup (strings[i]), g_free);
diff --git a/tests/testfontchooserdialog.c b/tests/testfontchooserdialog.c
index 039f156572..7a40d14df1 100644
--- a/tests/testfontchooserdialog.c
+++ b/tests/testfontchooserdialog.c
@@ -25,18 +25,18 @@
static gboolean
-monospace_filter (const PangoFontFamily *family,
- const PangoFontFace *face,
+monospace_filter (const Pango2FontFamily *family,
+ const Pango2FontFace *face,
gpointer data)
{
- return pango_font_face_is_monospace ((PangoFontFace *) face);
+ return pango2_font_face_is_monospace ((Pango2FontFace *) face);
}
static void
notify_font_cb (GtkFontChooser *fontchooser, GParamSpec *pspec, gpointer data)
{
- PangoFontFamily *family;
- PangoFontFace *face;
+ Pango2FontFamily *family;
+ Pango2FontFace *face;
g_debug ("Changed font name %s", gtk_font_chooser_get_font (fontchooser));
@@ -45,14 +45,14 @@ notify_font_cb (GtkFontChooser *fontchooser, GParamSpec *pspec, gpointer data)
if (family)
{
g_debug (" Family: %s is-monospace:%s",
- pango_font_family_get_name (family),
- pango_font_face_is_monospace (face) ? "true" : "false");
+ pango2_font_family_get_name (family),
+ pango2_font_face_is_monospace (face) ? "true" : "false");
}
else
g_debug (" No font family!");
if (face)
- g_debug (" Face description: %s", pango_font_face_get_name (face));
+ g_debug (" Face description: %s", pango2_font_face_get_name (face));
else
g_debug (" No font face!");
}
@@ -117,7 +117,7 @@ main (int argc, char *argv[])
if (argc > 0)
{
FcConfig *config;
- PangoFontMap *fontmap;
+ Pango2FontMap *fontmap;
int i;
/* Create a custom font configuration by adding font files specified
@@ -127,8 +127,8 @@ main (int argc, char *argv[])
for (i = 0; i < argc; i++)
FcConfigAppFontAddFile (config, (const FcChar8 *)argv[i]);
- fontmap = PANGO_FONT_MAP (pango_fc_font_map_new ());
- pango_fc_font_map_set_config (PANGO_FC_FONT_MAP (fontmap), config);
+ fontmap = PANGO_FONT_MAP (pango2_fc_font_map_new ());
+ pango2_fc_font_map_set_config (PANGO_FC_FONT_MAP (fontmap), config);
gtk_font_chooser_set_font_map (GTK_FONT_CHOOSER (font_button), fontmap);
}
#endif
diff --git a/tests/testgrid.c b/tests/testgrid.c
index e2af187dc5..d3deb94101 100644
--- a/tests/testgrid.c
+++ b/tests/testgrid.c
@@ -125,7 +125,7 @@ text_grid (void)
gtk_grid_attach (GTK_GRID (grid), test_widget ("2", "blue"), 0, 1, 1, 1);
label = gtk_label_new ("Some text that may wrap if it has to");
- gtk_label_set_ellipsize (GTK_LABEL (label), PANGO_ELLIPSIZE_END);
+ gtk_label_set_ellipsize (GTK_LABEL (label), PANGO2_ELLIPSIZE_END);
gtk_label_set_width_chars (GTK_LABEL (label), 10);
gtk_grid_attach (GTK_GRID (grid), label, 1, 1, 1, 1);
@@ -155,7 +155,7 @@ box_comparison (void)
gtk_box_append (GTK_BOX (box), test_widget ("1", "white"));
label = gtk_label_new ("Some ellipsizing text");
- gtk_label_set_ellipsize (GTK_LABEL (label), PANGO_ELLIPSIZE_END);
+ gtk_label_set_ellipsize (GTK_LABEL (label), PANGO2_ELLIPSIZE_END);
gtk_label_set_width_chars (GTK_LABEL (label), 10);
gtk_box_append (GTK_BOX (box), label);
@@ -176,7 +176,7 @@ box_comparison (void)
gtk_grid_attach (GTK_GRID (grid), test_widget ("1", "white"), 0, 0, 1, 1);
label = gtk_label_new ("Some ellipsizing text");
- gtk_label_set_ellipsize (GTK_LABEL (label), PANGO_ELLIPSIZE_END);
+ gtk_label_set_ellipsize (GTK_LABEL (label), PANGO2_ELLIPSIZE_END);
gtk_label_set_width_chars (GTK_LABEL (label), 10);
gtk_grid_attach (GTK_GRID (grid), label, 1, 0, 1, 1);
gtk_widget_set_hexpand (label, TRUE);
diff --git a/tests/testgtk.c b/tests/testgtk.c
index bc5b2f63ea..d61fec5e96 100644
--- a/tests/testgtk.c
+++ b/tests/testgtk.c
@@ -941,25 +941,25 @@ static void create_labels (GtkWidget *widget)
frame = gtk_frame_new ("Normal Label");
label = gtk_label_new ("This is a Normal label");
- gtk_label_set_ellipsize (GTK_LABEL (label), PANGO_ELLIPSIZE_START);
+ gtk_label_set_ellipsize (GTK_LABEL (label), PANGO2_ELLIPSIZE_START);
gtk_frame_set_child (GTK_FRAME (frame), label);
gtk_box_append (GTK_BOX (vbox), frame);
frame = gtk_frame_new ("Multi-line Label");
label = gtk_label_new ("This is a Multi-line label.\nSecond line\nThird line");
- gtk_label_set_ellipsize (GTK_LABEL (label), PANGO_ELLIPSIZE_END);
+ gtk_label_set_ellipsize (GTK_LABEL (label), PANGO2_ELLIPSIZE_END);
gtk_frame_set_child (GTK_FRAME (frame), label);
gtk_box_append (GTK_BOX (vbox), frame);
frame = gtk_frame_new ("Left Justified Label");
label = gtk_label_new ("This is a Left-Justified\nMulti-line label.\nThird line");
- gtk_label_set_ellipsize (GTK_LABEL (label), PANGO_ELLIPSIZE_MIDDLE);
+ gtk_label_set_ellipsize (GTK_LABEL (label), PANGO2_ELLIPSIZE_MIDDLE);
gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
gtk_frame_set_child (GTK_FRAME (frame), label);
gtk_box_append (GTK_BOX (vbox), frame);
frame = gtk_frame_new ("Right Justified Label");
- gtk_label_set_ellipsize (GTK_LABEL (label), PANGO_ELLIPSIZE_START);
+ gtk_label_set_ellipsize (GTK_LABEL (label), PANGO2_ELLIPSIZE_START);
label = gtk_label_new ("This is a Right-Justified\nMulti-line label.\nFourth line, (j/k)");
gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_RIGHT);
gtk_frame_set_child (GTK_FRAME (frame), label);
@@ -1082,9 +1082,9 @@ on_rotated_text_draw (GtkDrawingArea *drawing_area,
int n_words;
int i;
double radius;
- PangoLayout *layout;
- PangoContext *context;
- PangoFontDescription *desc;
+ Pango2Layout *layout;
+ Pango2Context *context;
+ Pango2FontDescription *desc;
cairo_set_source_rgb (cr, 1, 1, 1);
cairo_paint (cr);
@@ -1105,10 +1105,10 @@ on_rotated_text_draw (GtkDrawingArea *drawing_area,
cairo_scale (cr, radius / DEFAULT_TEXT_RADIUS, radius / DEFAULT_TEXT_RADIUS);
context = gtk_widget_get_pango_context (GTK_WIDGET (drawing_area));
- layout = pango_layout_new (context);
- desc = pango_font_description_from_string ("Sans Bold 30");
- pango_layout_set_font_description (layout, desc);
- pango_font_description_free (desc);
+ layout = pango2_layout_new (context);
+ desc = pango2_font_description_from_string ("Sans Bold 30");
+ pango2_layout_set_font_description (layout, desc);
+ pango2_font_description_free (desc);
n_words = G_N_ELEMENTS (words);
for (i = 0; i < n_words; i++)
@@ -1118,13 +1118,13 @@ on_rotated_text_draw (GtkDrawingArea *drawing_area,
cairo_save (cr);
cairo_rotate (cr, 2 * G_PI * i / n_words);
- pango_cairo_update_layout (cr, layout);
+ pango2_cairo_update_layout (cr, layout);
- pango_layout_set_text (layout, words[i], -1);
- pango_lines_get_size (pango_layout_get_lines (layout), &layout_width, &layout_height);
+ pango2_layout_set_text (layout, words[i], -1);
+ pango2_lines_get_size (pango2_layout_get_lines (layout), &layout_width, &layout_height);
- cairo_move_to (cr, - layout_width / 2 / PANGO_SCALE, - DEFAULT_TEXT_RADIUS);
- pango_cairo_show_layout (cr, layout);
+ cairo_move_to (cr, - layout_width / 2 / PANGO2_SCALE, - DEFAULT_TEXT_RADIUS);
+ pango2_cairo_show_layout (cr, layout);
cairo_restore (cr);
}
@@ -5131,10 +5131,10 @@ create_progress_bar (GtkWidget *widget)
};
static const char *ellipsize_items[] = {
- "None", // PANGO_ELLIPSIZE_NONE,
- "Start", // PANGO_ELLIPSIZE_START,
- "Middle", // PANGO_ELLIPSIZE_MIDDLE,
- "End", // PANGO_ELLIPSIZE_END
+ "None", // PANGO2_ELLIPSIZE_NONE,
+ "Start", // PANGO2_ELLIPSIZE_START,
+ "Middle", // PANGO2_ELLIPSIZE_MIDDLE,
+ "End", // PANGO2_ELLIPSIZE_END
};
if (!pdata)
@@ -5169,7 +5169,7 @@ create_progress_bar (GtkWidget *widget)
pdata->pbar = gtk_progress_bar_new ();
gtk_progress_bar_set_ellipsize (GTK_PROGRESS_BAR (pdata->pbar),
- PANGO_ELLIPSIZE_MIDDLE);
+ PANGO2_ELLIPSIZE_MIDDLE);
gtk_widget_set_halign (pdata->pbar, GTK_ALIGN_CENTER);
gtk_widget_set_valign (pdata->pbar, GTK_ALIGN_CENTER);
gtk_box_append (GTK_BOX (vbox2), pdata->pbar);
@@ -5238,7 +5238,7 @@ create_progress_bar (GtkWidget *widget)
gtk_widget_set_valign (label, GTK_ALIGN_CENTER);
pdata->elmenu = build_option_menu (ellipsize_items,
sizeof (ellipsize_items) / sizeof (ellipsize_items[0]),
- 2, // PANGO_ELLIPSIZE_MIDDLE
+ 2, // PANGO2_ELLIPSIZE_MIDDLE
progressbar_toggle_ellipsize,
pdata);
gtk_grid_attach (GTK_GRID (grid), pdata->elmenu, 1, 10, 1, 1);
diff --git a/tests/testiconview.c b/tests/testiconview.c
index e3494db792..e5cd3c6c2e 100644
--- a/tests/testiconview.c
+++ b/tests/testiconview.c
@@ -474,7 +474,7 @@ main (int argc, char **argv)
g_object_set (cell,
"editable", TRUE,
"xalign", 0.5,
- "wrap-mode", PANGO_WRAP_WORD_CHAR,
+ "wrap-mode", PANGO2_WRAP_WORD_CHAR,
"wrap-width", 100,
NULL);
gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (icon_list),
diff --git a/tests/testlistview.c b/tests/testlistview.c
index 47e54e1023..ef88545beb 100644
--- a/tests/testlistview.c
+++ b/tests/testlistview.c
@@ -507,7 +507,7 @@ setup_widget (GtkSignalListItemFactory *factory,
data->name = gtk_label_new (NULL);
gtk_label_set_max_width_chars (GTK_LABEL (data->name), 25);
- gtk_label_set_ellipsize (GTK_LABEL (data->name), PANGO_ELLIPSIZE_END);
+ gtk_label_set_ellipsize (GTK_LABEL (data->name), PANGO2_ELLIPSIZE_END);
gtk_box_append (GTK_BOX (box), data->name);
g_signal_connect (list_item, "notify::item", G_CALLBACK (row_data_notify_item), data);
diff --git a/tests/testnouiprint.c b/tests/testnouiprint.c
index 885fa243ba..d07b3517a2 100644
--- a/tests/testnouiprint.c
+++ b/tests/testnouiprint.c
@@ -27,8 +27,8 @@ draw_page (GtkPrintOperation *operation,
int page_nr)
{
cairo_t *cr;
- PangoLayout *layout;
- PangoFontDescription *desc;
+ Pango2Layout *layout;
+ Pango2FontDescription *desc;
cr = gtk_print_context_get_cairo_context (context);
@@ -54,13 +54,13 @@ draw_page (GtkPrintOperation *operation,
/* Draw some text */
layout = gtk_print_context_create_pango_layout (context);
- pango_layout_set_text (layout, "Hello World! Printing is easy", -1);
- desc = pango_font_description_from_string ("sans 28");
- pango_layout_set_font_description (layout, desc);
- pango_font_description_free (desc);
+ pango2_layout_set_text (layout, "Hello World! Printing is easy", -1);
+ desc = pango2_font_description_from_string ("sans 28");
+ pango2_layout_set_font_description (layout, desc);
+ pango2_font_description_free (desc);
cairo_move_to (cr, 30, 20);
- pango_cairo_layout_path (cr, layout);
+ pango2_cairo_layout_path (cr, layout);
/* Font Outline */
cairo_set_source_rgb (cr, 0.93, 1.0, 0.47);
diff --git a/tests/testprint.c b/tests/testprint.c
index 896efeb114..629a67a2dd 100644
--- a/tests/testprint.c
+++ b/tests/testprint.c
@@ -18,7 +18,7 @@
#include "config.h"
#include <math.h>
-#include <pango/pangocairo.h>
+#include <pango2/pangocairo.h>
#include <gtk/gtk.h>
#include "testprintfileoperation.h"
@@ -45,8 +45,8 @@ draw_page (GtkPrintOperation *operation,
int page_nr)
{
cairo_t *cr;
- PangoLayout *layout;
- PangoFontDescription *desc;
+ Pango2Layout *layout;
+ Pango2FontDescription *desc;
cr = gtk_print_context_get_cairo_context (context);
@@ -72,13 +72,13 @@ draw_page (GtkPrintOperation *operation,
/* Draw some text */
layout = gtk_print_context_create_pango_layout (context);
- pango_layout_set_text (layout, "Hello World! Printing is easy", -1);
- desc = pango_font_description_from_string ("sans 28");
- pango_layout_set_font_description (layout, desc);
- pango_font_description_free (desc);
+ pango2_layout_set_text (layout, "Hello World! Printing is easy", -1);
+ desc = pango2_font_description_from_string ("sans 28");
+ pango2_layout_set_font_description (layout, desc);
+ pango2_font_description_free (desc);
cairo_move_to (cr, 30, 20);
- pango_cairo_layout_path (cr, layout);
+ pango2_cairo_layout_path (cr, layout);
/* Font Outline */
cairo_set_source_rgb (cr, 0.93, 1.0, 0.47);
diff --git a/tests/testprintfileoperation.c b/tests/testprintfileoperation.c
index af636d38e0..74e6796117 100644
--- a/tests/testprintfileoperation.c
+++ b/tests/testprintfileoperation.c
@@ -1,4 +1,4 @@
-#include <pango/pangocairo.h>
+#include <pango2/pangocairo.h>
#include <gtk/gtk.h>
#include <math.h>
#include "testprintfileoperation.h"
@@ -79,11 +79,11 @@ test_print_file_operation_draw_page (GtkPrintOperation *operation,
int page_nr)
{
cairo_t *cr;
- PangoLayout *layout;
+ Pango2Layout *layout;
TestPrintFileOperation *op = TEST_PRINT_FILE_OPERATION (operation);
double width, text_height;
int line, i, layout_height;
- PangoFontDescription *desc;
+ Pango2FontDescription *desc;
char *page_str;
cr = gtk_print_context_get_cairo_context (context);
@@ -100,42 +100,42 @@ test_print_file_operation_draw_page (GtkPrintOperation *operation,
layout = gtk_print_context_create_pango_layout (context);
- desc = pango_font_description_from_string ("sans 14");
- pango_layout_set_font_description (layout, desc);
- pango_font_description_free (desc);
+ desc = pango2_font_description_from_string ("sans 14");
+ pango2_layout_set_font_description (layout, desc);
+ pango2_font_description_free (desc);
- pango_layout_set_text (layout, op->filename, -1);
- pango_layout_set_width (layout, width);
- pango_layout_set_alignment (layout, PANGO_ALIGN_CENTER);
+ pango2_layout_set_text (layout, op->filename, -1);
+ pango2_layout_set_width (layout, width);
+ pango2_layout_set_alignment (layout, PANGO2_ALIGN_CENTER);
- pango_lines_get_size (pango_layout_get_lines (layout), NULL, &layout_height);
- text_height = (double)layout_height / PANGO_SCALE;
+ pango2_lines_get_size (pango2_layout_get_lines (layout), NULL, &layout_height);
+ text_height = (double)layout_height / PANGO2_SCALE;
cairo_move_to (cr, width / 2, (HEADER_HEIGHT - text_height) / 2);
- pango_cairo_show_layout (cr, layout);
+ pango2_cairo_show_layout (cr, layout);
page_str = g_strdup_printf ("%d/%d", page_nr + 1, op->num_pages);
- pango_layout_set_text (layout, page_str, -1);
+ pango2_layout_set_text (layout, page_str, -1);
g_free (page_str);
- pango_layout_set_alignment (layout, PANGO_ALIGN_RIGHT);
+ pango2_layout_set_alignment (layout, PANGO2_ALIGN_RIGHT);
cairo_move_to (cr, width - 2, (HEADER_HEIGHT - text_height) / 2);
- pango_cairo_show_layout (cr, layout);
+ pango2_cairo_show_layout (cr, layout);
g_object_unref (layout);
layout = gtk_print_context_create_pango_layout (context);
- desc = pango_font_description_from_string ("mono");
- pango_font_description_set_size (desc, op->font_size * PANGO_SCALE);
- pango_layout_set_font_description (layout, desc);
- pango_font_description_free (desc);
+ desc = pango2_font_description_from_string ("mono");
+ pango2_font_description_set_size (desc, op->font_size * PANGO2_SCALE);
+ pango2_layout_set_font_description (layout, desc);
+ pango2_font_description_free (desc);
cairo_move_to (cr, 0, HEADER_HEIGHT + HEADER_GAP);
line = page_nr * op->lines_per_page;
for (i = 0; i < op->lines_per_page && line < op->num_lines; i++, line++) {
- pango_layout_set_text (layout, op->lines[line], -1);
- pango_cairo_show_layout (cr, layout);
+ pango2_layout_set_text (layout, op->lines[line], -1);
+ pango2_cairo_show_layout (cr, layout);
cairo_rel_move_to (cr, 0, op->font_size);
}
diff --git a/tests/testtextview.c b/tests/testtextview.c
index ae7d65ec06..99fd506954 100644
--- a/tests/testtextview.c
+++ b/tests/testtextview.c
@@ -40,13 +40,13 @@ create_tags (GtkTextBuffer *buffer)
{
gtk_text_buffer_create_tag (buffer, "italic",
- "style", PANGO_STYLE_ITALIC, NULL);
+ "style", PANGO2_STYLE_ITALIC, NULL);
gtk_text_buffer_create_tag (buffer, "bold",
- "weight", PANGO_WEIGHT_BOLD, NULL);
+ "weight", PANGO2_WEIGHT_BOLD, NULL);
gtk_text_buffer_create_tag (buffer, "x-large",
- "scale", PANGO_SCALE_X_LARGE, NULL);
+ "scale", PANGO2_SCALE_X_LARGE, NULL);
gtk_text_buffer_create_tag (buffer, "semi_blue_foreground",
"foreground", "rgba(0,0,255,0.7)", NULL);
diff --git a/tests/testtooltips.c b/tests/testtooltips.c
index 80f60b67cc..b130bbba02 100644
--- a/tests/testtooltips.c
+++ b/tests/testtooltips.c
@@ -387,7 +387,7 @@ main (int argc, char *argv[])
gtk_text_buffer_insert (buffer, &iter, "Hello, the text ", -1);
tag = gtk_text_buffer_create_tag (buffer, "bold", NULL);
- g_object_set (tag, "weight", PANGO_WEIGHT_BOLD, NULL);
+ g_object_set (tag, "weight", PANGO2_WEIGHT_BOLD, NULL);
gtk_text_buffer_get_end_iter (buffer, &iter);
gtk_text_buffer_insert_with_tags (buffer, &iter, "in bold", -1, tag, NULL);
diff --git a/tests/testtreeview.c b/tests/testtreeview.c
index 3aa24d01ca..b78814a48c 100644
--- a/tests/testtreeview.c
+++ b/tests/testtreeview.c
@@ -584,7 +584,7 @@ create_tree_model (void)
g_type_class_unref (g_type_class_ref (gtk_scrolled_window_get_type ()));
g_type_class_unref (g_type_class_ref (gtk_label_get_type ()));
g_type_class_unref (g_type_class_ref (gtk_scrollbar_get_type ()));
- g_type_class_unref (g_type_class_ref (pango_layout_get_type ()));
+ g_type_class_unref (g_type_class_ref (pango2_layout_get_type ()));
t = get_model_types ();
diff --git a/tests/testverticalcells.c b/tests/testverticalcells.c
index 51df9c1e5c..612e40210d 100644
--- a/tests/testverticalcells.c
+++ b/tests/testverticalcells.c
@@ -340,7 +340,7 @@ main (int argc, char **argv)
"icon-name", ICON_COLUMN, NULL);
renderer = gtk_cell_renderer_text_new ();
- g_object_set (renderer, "scale", 1.2F, "weight", PANGO_WEIGHT_BOLD, NULL);
+ g_object_set (renderer, "scale", 1.2F, "weight", PANGO2_WEIGHT_BOLD, NULL);
gtk_tree_view_column_pack_start (column, renderer, TRUE);
gtk_tree_view_column_set_attributes (column, renderer,
"text", INFO_COLUMN,
@@ -353,7 +353,7 @@ main (int argc, char **argv)
gtk_orientable_set_orientation (GTK_ORIENTABLE (area), GTK_ORIENTATION_VERTICAL);
renderer = gtk_cell_renderer_text_new ();
- g_object_set (renderer, "ellipsize", PANGO_ELLIPSIZE_END, "editable", TRUE, NULL);
+ g_object_set (renderer, "ellipsize", PANGO2_ELLIPSIZE_END, "editable", TRUE, NULL);
gtk_tree_view_column_pack_start (column, renderer, TRUE);
gtk_tree_view_column_set_attributes (column, renderer,
"text", DESCRIPTION_COLUMN,
@@ -366,7 +366,7 @@ main (int argc, char **argv)
NULL);
renderer = gtk_cell_renderer_text_new ();
- g_object_set (renderer, "scale", 0.6F, "ellipsize", PANGO_ELLIPSIZE_END, NULL);
+ g_object_set (renderer, "scale", 0.6F, "ellipsize", PANGO2_ELLIPSIZE_END, NULL);
gtk_tree_view_column_pack_start (column, renderer, TRUE);
gtk_tree_view_column_set_attributes (column, renderer,
"text", FINE_PRINT_COLUMN,
diff --git a/tests/testwidgetfocus.c b/tests/testwidgetfocus.c
index e28d4aa794..9485d4c573 100644
--- a/tests/testwidgetfocus.c
+++ b/tests/testwidgetfocus.c
@@ -159,7 +159,7 @@ gtk_focus_widget_snapshot (GtkWidget *widget, GtkSnapshot *snapshot)
if (self->mouse_x != G_MININT && self->mouse_y != G_MININT)
{
- PangoLayout *layout;
+ Pango2Layout *layout;
char *text;
GtkAllocation alloc;
graphene_rect_t bounds;
@@ -187,7 +187,7 @@ gtk_focus_widget_snapshot (GtkWidget *widget, GtkSnapshot *snapshot)
layout = gtk_widget_create_pango_layout (widget, NULL);
text = g_strdup_printf ("%.2f×%.2f", self->mouse_x, self->mouse_y);
- pango_layout_set_text (layout, text, -1);
+ pango2_layout_set_text (layout, text, -1);
gtk_snapshot_render_layout (snapshot,
gtk_widget_get_style_context (widget),
diff --git a/testsuite/gtk/builder.c b/testsuite/gtk/builder.c
index 1616e2ba4b..88242c09e7 100644
--- a/testsuite/gtk/builder.c
+++ b/testsuite/gtk/builder.c
@@ -1901,29 +1901,29 @@ typedef struct {
} FoundAttrs;
static gboolean
-filter_pango_attrs (PangoAttribute *attr,
+filter_pango_attrs (Pango2Attribute *attr,
gpointer data)
{
FoundAttrs *found = (FoundAttrs *)data;
- guint type = pango_attribute_type (attr);
+ guint type = pango2_attribute_type (attr);
guint start, end;
- pango_attribute_get_range (attr, &start, &end);
+ pango2_attribute_get_range (attr, &start, &end);
- if (type == PANGO_ATTR_WEIGHT)
+ if (type == PANGO2_ATTR_WEIGHT)
found->weight = TRUE;
- else if (type == PANGO_ATTR_FOREGROUND)
+ else if (type == PANGO2_ATTR_FOREGROUND)
found->foreground = TRUE;
- else if (type == PANGO_ATTR_UNDERLINE)
+ else if (type == PANGO2_ATTR_UNDERLINE)
found->underline = TRUE;
/* Make sure optional start/end properties are working */
- else if (type == PANGO_ATTR_SIZE &&
+ else if (type == PANGO2_ATTR_SIZE &&
start == 5 &&
end == 10)
found->size = TRUE;
- else if (type == PANGO_ATTR_FONT_DESC)
+ else if (type == PANGO2_ATTR_FONT_DESC)
found->font_desc = TRUE;
- else if (type == PANGO_ATTR_LANGUAGE)
+ else if (type == PANGO2_ATTR_LANGUAGE)
found->language = TRUE;
return TRUE;
@@ -1938,7 +1938,7 @@ test_pango_attributes (void)
"<interface>"
" <object class=\"GtkLabel\" id=\"label1\">"
" <attributes>"
- " <attribute name=\"weight\" value=\"PANGO_WEIGHT_BOLD\"/>"
+ " <attribute name=\"weight\" value=\"PANGO2_WEIGHT_BOLD\"/>"
" <attribute name=\"foreground\" value=\"DarkSlateGray\"/>"
" <attribute name=\"underline\" value=\"True\"/>"
" <attribute name=\"size\" value=\"4\" start=\"5\" end=\"10\"/>"
@@ -1959,14 +1959,14 @@ test_pango_attributes (void)
"<interface>"
" <object class=\"GtkLabel\" id=\"label1\">"
" <attributes>"
- " <attribute name=\"weight\" value=\"PANGO_WEIGHT_BOLD\" unrecognized=\"True\"/>"
+ " <attribute name=\"weight\" value=\"PANGO2_WEIGHT_BOLD\" unrecognized=\"True\"/>"
" </attributes>"
" </object>"
"</interface>";
GObject *label;
GError *error = NULL;
- PangoAttrList *attrs, *filtered;
+ Pango2AttrList *attrs, *filtered;
/* Test attributes are set */
builder = builder_new_from_string (buffer, -1, NULL);
@@ -1976,9 +1976,9 @@ test_pango_attributes (void)
attrs = gtk_label_get_attributes (GTK_LABEL (label));
g_assert_nonnull (attrs);
- filtered = pango_attr_list_filter (attrs, filter_pango_attrs, &found);
+ filtered = pango2_attr_list_filter (attrs, filter_pango_attrs, &found);
g_assert_true (filtered);
- pango_attr_list_unref (filtered);
+ pango2_attr_list_unref (filtered);
g_assert_true (found.weight);
g_assert_true (found.foreground);
@@ -2722,7 +2722,7 @@ main (int argc, char **argv)
g_test_add_func ("/Builder/Value From String", test_value_from_string);
g_test_add_func ("/Builder/Reference Counting", test_reference_counting);
g_test_add_func ("/Builder/Window", test_window);
- g_test_add_func ("/Builder/PangoAttributes", test_pango_attributes);
+ g_test_add_func ("/Builder/Pango2Attributes", test_pango_attributes);
g_test_add_func ("/Builder/Requires", test_requires);
g_test_add_func ("/Builder/AddObjects", test_add_objects);
g_test_add_func ("/Builder/MessageArea", test_message_area);
diff --git a/testsuite/gtk/label.c b/testsuite/gtk/label.c
index 43a22c8dc8..10ded810bd 100644
--- a/testsuite/gtk/label.c
+++ b/testsuite/gtk/label.c
@@ -1,88 +1,88 @@
#include <gtk/gtk.h>
void
-print_attribute (PangoAttribute *attr, GString *string)
+print_attribute (Pango2Attribute *attr, GString *string)
{
GEnumClass *class;
GEnumValue *value;
guint start, end;
- pango_attribute_get_range (attr, &start, &end);
+ pango2_attribute_get_range (attr, &start, &end);
g_string_append_printf (string, "[%u,%u]", start, end);
- class = g_type_class_ref (pango_attr_type_get_type ());
- value = g_enum_get_value (class, pango_attribute_type (attr));
+ class = g_type_class_ref (pango2_attr_type_get_type ());
+ value = g_enum_get_value (class, pango2_attribute_type (attr));
g_string_append_printf (string, "%s=", value->value_nick);
g_type_class_unref (class);
- switch (PANGO_ATTR_VALUE_TYPE (attr))
+ switch (PANGO2_ATTR_VALUE_TYPE (attr))
{
- case PANGO_ATTR_VALUE_STRING:
- g_string_append (string, pango_attribute_get_string (attr));
+ case PANGO2_ATTR_VALUE_STRING:
+ g_string_append (string, pango2_attribute_get_string (attr));
break;
- case PANGO_ATTR_VALUE_BOOLEAN:
- g_string_append_printf (string, "%s", pango_attribute_get_boolean (attr) ? "true" : "false");
+ case PANGO2_ATTR_VALUE_BOOLEAN:
+ g_string_append_printf (string, "%s", pango2_attribute_get_boolean (attr) ? "true" : "false");
break;
- case PANGO_ATTR_VALUE_LANGUAGE:
- g_string_append (string, pango_language_to_string (pango_attribute_get_language (attr)));
+ case PANGO2_ATTR_VALUE_LANGUAGE:
+ g_string_append (string, pango2_language_to_string (pango2_attribute_get_language (attr)));
break;
- case PANGO_ATTR_VALUE_INT:
- g_string_append_printf (string, "%d", pango_attribute_get_int (attr));
+ case PANGO2_ATTR_VALUE_INT:
+ g_string_append_printf (string, "%d", pango2_attribute_get_int (attr));
break;
- case PANGO_ATTR_VALUE_FLOAT:
+ case PANGO2_ATTR_VALUE_FLOAT:
{
char val[20];
- g_ascii_formatd (val, 20, "%f", pango_attribute_get_float (attr));
+ g_ascii_formatd (val, 20, "%f", pango2_attribute_get_float (attr));
g_string_append (string, val);
}
break;
- case PANGO_ATTR_VALUE_FONT_DESC:
+ case PANGO2_ATTR_VALUE_FONT_DESC:
{
- char *text = pango_font_description_to_string (pango_attribute_get_font_desc (attr));
+ char *text = pango2_font_description_to_string (pango2_attribute_get_font_desc (attr));
g_string_append (string, text);
g_free (text);
}
break;
- case PANGO_ATTR_VALUE_COLOR:
+ case PANGO2_ATTR_VALUE_COLOR:
{
- char *text = pango_color_to_string (pango_attribute_get_color (attr));
+ char *text = pango2_color_to_string (pango2_attribute_get_color (attr));
g_string_append (string, text);
g_free (text);
}
break;
- case PANGO_ATTR_VALUE_POINTER:
+ case PANGO2_ATTR_VALUE_POINTER:
default:
g_assert_not_reached ();
}
}
void
-print_attr_list (PangoAttrList *attrs, GString *string)
+print_attr_list (Pango2AttrList *attrs, GString *string)
{
- PangoAttrIterator *iter;
+ Pango2AttrIterator *iter;
if (!attrs)
return;
- iter = pango_attr_list_get_iterator (attrs);
+ iter = pango2_attr_list_get_iterator (attrs);
do {
int start, end;
GSList *list, *l;
- pango_attr_iterator_range (iter, &start, &end);
+ pango2_attr_iterator_range (iter, &start, &end);
g_string_append_printf (string, "range %d %d\n", start, end);
- list = pango_attr_iterator_get_attrs (iter);
+ list = pango2_attr_iterator_get_attrs (iter);
for (l = list; l; l = l->next)
{
- PangoAttribute *attr = l->data;
+ Pango2Attribute *attr = l->data;
print_attribute (attr, string);
g_string_append (string, "\n");
}
- g_slist_free_full (list, (GDestroyNotify)pango_attribute_destroy);
- } while (pango_attr_iterator_next (iter));
+ g_slist_free_full (list, (GDestroyNotify)pango2_attribute_destroy);
+ } while (pango2_attr_iterator_next (iter));
- pango_attr_iterator_destroy (iter);
+ pango2_attr_iterator_destroy (iter);
}
static void
@@ -90,7 +90,7 @@ test_label_markup (void)
{
GtkWidget *window;
GtkWidget *label;
- PangoAttrList *attrs;
+ Pango2AttrList *attrs;
GString *str;
const char *text;
@@ -106,10 +106,10 @@ test_label_markup (void)
g_assert_cmpuint (gtk_label_get_mnemonic_keyval (GTK_LABEL (label)), ==, 'd');
- text = pango_layout_get_text (gtk_label_get_layout (GTK_LABEL (label)));
+ text = pango2_layout_get_text (gtk_label_get_layout (GTK_LABEL (label)));
g_assert_cmpstr (text, ==, "abc def");
- attrs = pango_layout_get_attributes (gtk_label_get_layout (GTK_LABEL (label)));
+ attrs = pango2_layout_get_attributes (gtk_label_get_layout (GTK_LABEL (label)));
str = g_string_new ("");
print_attr_list (attrs, str);
@@ -132,10 +132,10 @@ test_label_markup (void)
gtk_window_set_mnemonics_visible (GTK_WINDOW (window), FALSE);
- text = pango_layout_get_text (gtk_label_get_layout (GTK_LABEL (label)));
+ text = pango2_layout_get_text (gtk_label_get_layout (GTK_LABEL (label)));
g_assert_cmpstr (text, ==, "abc def");
- attrs = pango_layout_get_attributes (gtk_label_get_layout (GTK_LABEL (label)));
+ attrs = pango2_layout_get_attributes (gtk_label_get_layout (GTK_LABEL (label)));
g_string_set_size (str, 0);
print_attr_list (attrs, str);
@@ -152,10 +152,10 @@ test_label_markup (void)
gtk_window_set_mnemonics_visible (GTK_WINDOW (window), TRUE);
gtk_label_set_use_underline (GTK_LABEL (label), FALSE);
- text = pango_layout_get_text (gtk_label_get_layout (GTK_LABEL (label)));
+ text = pango2_layout_get_text (gtk_label_get_layout (GTK_LABEL (label)));
g_assert_cmpstr (text, ==, "abc _def");
- attrs = pango_layout_get_attributes (gtk_label_get_layout (GTK_LABEL (label)));
+ attrs = pango2_layout_get_attributes (gtk_label_get_layout (GTK_LABEL (label)));
g_string_set_size (str, 0);
print_attr_list (attrs, str);
diff --git a/testsuite/gtk/textiter.c b/testsuite/gtk/textiter.c
index 8b296b222b..d5894addb7 100644
--- a/testsuite/gtk/textiter.c
+++ b/testsuite/gtk/textiter.c
@@ -292,7 +292,7 @@ test_forward_to_tag_toggle (void)
buffer = gtk_text_buffer_new (NULL);
bold_tag = gtk_text_buffer_create_tag (buffer, "bold",
- "weight", PANGO_WEIGHT_BOLD,
+ "weight", PANGO2_WEIGHT_BOLD,
NULL);
editable_tag = gtk_text_buffer_create_tag (buffer, "not-editable",
diff --git a/testsuite/reftests/letter-spacing.c b/testsuite/reftests/letter-spacing.c
index 5e876f077e..70dc2229ae 100644
--- a/testsuite/reftests/letter-spacing.c
+++ b/testsuite/reftests/letter-spacing.c
@@ -21,10 +21,10 @@
G_MODULE_EXPORT void
set_letter_spacing (GtkLabel *label)
{
- PangoAttrList *attrs;
+ Pango2AttrList *attrs;
- attrs = pango_attr_list_new ();
- pango_attr_list_insert (attrs, pango_attr_letter_spacing_new (10 * PANGO_SCALE));
+ attrs = pango2_attr_list_new ();
+ pango2_attr_list_insert (attrs, pango2_attr_letter_spacing_new (10 * PANGO2_SCALE));
gtk_label_set_attributes (label, attrs);
- pango_attr_list_unref (attrs);
+ pango2_attr_list_unref (attrs);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]