diff options
Diffstat (limited to 'pango/pangocairo-context.c')
-rw-r--r-- | pango/pangocairo-context.c | 128 |
1 files changed, 64 insertions, 64 deletions
diff --git a/pango/pangocairo-context.c b/pango/pangocairo-context.c index 81b4ea17..2346b635 100644 --- a/pango/pangocairo-context.c +++ b/pango/pangocairo-context.c @@ -1,4 +1,4 @@ -/* Pango +/* Pango2 * pangocairo-context.c: Cairo context handling * * Copyright (C) 2000-2005 Red Hat Software @@ -29,31 +29,31 @@ #include <string.h> /** - * pango_cairo_update_context: + * pango2_cairo_update_context: * @cr: a Cairo context - * @context: a `PangoContext`, from a pangocairo font map + * @context: a `Pango2Context`, from a pangocairo font map * - * Updates a `PangoContext` previously created for use with Cairo to + * Updates a `Pango2Context` previously created for use with Cairo to * match the current transformation and target surface of a Cairo * context. * * If any layouts have been created for the context, it's necessary - * to call [method@Pango.Layout.context_changed] on those layouts. + * to call [method@Pango2.Layout.context_changed] on those layouts. */ void -pango_cairo_update_context (cairo_t *cr, - PangoContext *context) +pango2_cairo_update_context (cairo_t *cr, + Pango2Context *context) { cairo_matrix_t cairo_matrix; cairo_surface_t *target; - PangoMatrix pango_matrix; - const PangoMatrix *current_matrix, identity_matrix = PANGO_MATRIX_INIT; + Pango2Matrix pango2_matrix; + const Pango2Matrix *current_matrix, identity_matrix = PANGO2_MATRIX_INIT; const cairo_font_options_t *merged_options; cairo_font_options_t *old_merged_options; gboolean changed = FALSE; g_return_if_fail (cr != NULL); - g_return_if_fail (PANGO_IS_CONTEXT (context)); + g_return_if_fail (PANGO2_IS_CONTEXT (context)); target = cairo_get_target (cr); @@ -70,7 +70,7 @@ pango_cairo_update_context (cairo_t *cr, old_merged_options = context->merged_options; context->merged_options = NULL; - merged_options = pango_cairo_context_get_merged_font_options (context); + merged_options = pango2_cairo_context_get_merged_font_options (context); if (old_merged_options) { @@ -83,14 +83,14 @@ pango_cairo_update_context (cairo_t *cr, changed = TRUE; cairo_get_matrix (cr, &cairo_matrix); - pango_matrix.xx = cairo_matrix.xx; - pango_matrix.yx = cairo_matrix.yx; - pango_matrix.xy = cairo_matrix.xy; - pango_matrix.yy = cairo_matrix.yy; - pango_matrix.x0 = 0; - pango_matrix.y0 = 0; - - current_matrix = pango_context_get_matrix (context); + pango2_matrix.xx = cairo_matrix.xx; + pango2_matrix.yx = cairo_matrix.yx; + pango2_matrix.xy = cairo_matrix.xy; + pango2_matrix.yy = cairo_matrix.yy; + pango2_matrix.x0 = 0; + pango2_matrix.y0 = 0; + + current_matrix = pango2_context_get_matrix (context); if (!current_matrix) current_matrix = &identity_matrix; @@ -98,31 +98,31 @@ pango_cairo_update_context (cairo_t *cr, * also ignore matrix translation offsets */ if ((cairo_font_options_get_hint_metrics (merged_options) != CAIRO_HINT_METRICS_OFF) && - (0 != memcmp (&pango_matrix, current_matrix, sizeof (PangoMatrix)))) + (0 != memcmp (&pango2_matrix, current_matrix, sizeof (Pango2Matrix)))) changed = TRUE; - pango_context_set_matrix (context, &pango_matrix); + pango2_context_set_matrix (context, &pango2_matrix); if (changed) - pango_context_changed (context); + pango2_context_changed (context); } /** - * pango_cairo_context_set_font_options: - * @context: a `PangoContext`, from a pangocairo font map + * pango2_cairo_context_set_font_options: + * @context: a `Pango2Context`, from a pangocairo font map * @options: (nullable): a `cairo_font_options_t`, or %NULL to unset * any previously set options. A copy is made. * * Sets the font options used when rendering text with this context. * - * These options override any options that [func@Pango.cairo_update_context] + * These options override any options that [func@Pango2.cairo_update_context] * derives from the target surface. */ void -pango_cairo_context_set_font_options (PangoContext *context, - const cairo_font_options_t *options) +pango2_cairo_context_set_font_options (Pango2Context *context, + const cairo_font_options_t *options) { - g_return_if_fail (PANGO_IS_CONTEXT (context)); + g_return_if_fail (PANGO2_IS_CONTEXT (context)); if (!context->set_options && !options) return; @@ -132,7 +132,7 @@ pango_cairo_context_set_font_options (PangoContext *context, return; if (context->set_options || options) - pango_context_changed (context); + pango2_context_changed (context); if (context->set_options) cairo_font_options_destroy (context->set_options); @@ -156,29 +156,29 @@ pango_cairo_context_set_font_options (PangoContext *context, } /** - * pango_cairo_context_get_font_options: - * @context: a `PangoContext`, from a pangocairo font map + * pango2_cairo_context_get_font_options: + * @context: a `Pango2Context`, from a pangocairo font map * * Retrieves any font rendering options previously set with - * [func@Pango.cairo_context_set_font_options]. + * [func@Pango2.cairo_context_set_font_options]. * * This function does not report options that are derived from - * the target surface by [func@Pango.cairo_update_context]. + * the target surface by [func@Pango2.cairo_update_context]. * * Return value: (nullable): the font options previously set on the * context, or %NULL if no options have been set. This value is * owned by the context and must not be modified or freed. */ const cairo_font_options_t * -pango_cairo_context_get_font_options (PangoContext *context) +pango2_cairo_context_get_font_options (Pango2Context *context) { - g_return_val_if_fail (PANGO_IS_CONTEXT (context), NULL); + g_return_val_if_fail (PANGO2_IS_CONTEXT (context), NULL); return context->set_options; } const cairo_font_options_t * -pango_cairo_context_get_merged_font_options (PangoContext *context) +pango2_cairo_context_get_merged_font_options (Pango2Context *context) { if (!context->merged_options) { @@ -194,80 +194,80 @@ pango_cairo_context_get_merged_font_options (PangoContext *context) } /** - * pango_cairo_create_context: + * pango2_cairo_create_context: * @cr: a Cairo context * * Creates a context object set up to match the current transformation * and target surface of the Cairo context. * * This context can then be - * used to create a layout using [ctor@Pango.Layout.new]. + * used to create a layout using [ctor@Pango2.Layout.new]. * * This function is a convenience function that creates a context * using the default font map, then updates it to @cr. * - * Return value: (transfer full): the newly created `PangoContext` + * Return value: (transfer full): the newly created `Pango2Context` */ -PangoContext * -pango_cairo_create_context (cairo_t *cr) +Pango2Context * +pango2_cairo_create_context (cairo_t *cr) { - PangoContext *context; + Pango2Context *context; g_return_val_if_fail (cr != NULL, NULL); - context = pango_context_new (); - pango_cairo_update_context (cr, context); + context = pango2_context_new (); + pango2_cairo_update_context (cr, context); return context; } /** - * pango_cairo_update_layout: + * pango2_cairo_update_layout: * @cr: a Cairo context - * @layout: a `PangoLayout` + * @layout: a `Pango2Layout` * - * Updates the private `PangoContext` of a `PangoLayout` to match + * Updates the private `Pango2Context` of a `Pango2Layout` to match * the current transformation and target surface of a Cairo context. */ void -pango_cairo_update_layout (cairo_t *cr, - PangoLayout *layout) +pango2_cairo_update_layout (cairo_t *cr, + Pango2Layout *layout) { g_return_if_fail (cr != NULL); - g_return_if_fail (PANGO_IS_LAYOUT (layout)); + g_return_if_fail (PANGO2_IS_LAYOUT (layout)); - pango_cairo_update_context (cr, pango_layout_get_context (layout)); + pango2_cairo_update_context (cr, pango2_layout_get_context (layout)); } /** - * pango_cairo_create_layout: + * pango2_cairo_create_layout: * @cr: a Cairo context * * Creates a layout object set up to match the current transformation * and target surface of the Cairo context. * * This layout can then be used for text measurement with functions - * like [method@Pango.Lines.get_size] or drawing with functions like - * [func@Pango.cairo_show_layout]. If you change the transformation or target - * surface for @cr, you need to call [func@Pango.cairo_update_layout]. + * like [method@Pango2.Lines.get_size] or drawing with functions like + * [func@Pango2.cairo_show_layout]. If you change the transformation or target + * surface for @cr, you need to call [func@Pango2.cairo_update_layout]. * - * This function is the most convenient way to use Cairo with Pango, + * This function is the most convenient way to use Cairo with Pango2, * however it is slightly inefficient since it creates a separate - * `PangoContext` object for each layout. This might matter in an + * `Pango2Context` object for each layout. This might matter in an * application that was laying out large amounts of text. * - * Return value: (transfer full): the newly created `PangoLayout` + * Return value: (transfer full): the newly created `Pango2Layout` */ -PangoLayout * -pango_cairo_create_layout (cairo_t *cr) +Pango2Layout * +pango2_cairo_create_layout (cairo_t *cr) { - PangoContext *context; - PangoLayout *layout; + Pango2Context *context; + Pango2Layout *layout; g_return_val_if_fail (cr != NULL, NULL); - context = pango_cairo_create_context (cr); - layout = pango_layout_new (context); + context = pango2_cairo_create_context (cr); + layout = pango2_layout_new (context); g_object_unref (context); return layout; |