Commit 9fc788a6 authored by Matthias Clasen's avatar Matthias Clasen

Fix fallout from bidi deprecation

PangoDirection is still used in some public apis,
so just keep it around.

Closes: #339
parent c8793f5d
Pipeline #45512 passed with stage
in 2 minutes and 10 seconds
......@@ -35,6 +35,7 @@ pango_headers = [
'pango-break.h',
'pango-context.h',
'pango-coverage.h',
'pango-direction.h',
'pango-engine.h',
'pango-font.h',
'pango-fontmap.h',
......
......@@ -43,6 +43,8 @@
#include <fribidi.h>
#undef PANGO_DISABLE_DEPRECATED
#include "pango-bidi-type.h"
#include "pango-utils.h"
......@@ -305,6 +307,7 @@ pango_unichar_direction (gunichar ch)
return PANGO_DIRECTION_LTR;
}
/**
* pango_get_mirror_char:
* @ch: a Unicode character
......
......@@ -25,6 +25,8 @@
#include <glib.h>
#include <pango/pango-version-macros.h>
#include <pango/pango-direction.h>
G_BEGIN_DECLS
#ifndef PANGO_DISABLE_DEPRECATED
......@@ -87,46 +89,6 @@ typedef enum {
PANGO_DEPRECATED_IN_1_44
PangoBidiType pango_bidi_type_for_unichar (gunichar ch) G_GNUC_CONST;
/**
* PangoDirection:
* @PANGO_DIRECTION_LTR: A strong left-to-right direction
* @PANGO_DIRECTION_RTL: A strong right-to-left direction
* @PANGO_DIRECTION_TTB_LTR: Deprecated value; treated the
* same as %PANGO_DIRECTION_RTL.
* @PANGO_DIRECTION_TTB_RTL: Deprecated value; treated the
* same as %PANGO_DIRECTION_LTR
* @PANGO_DIRECTION_WEAK_LTR: A weak left-to-right direction
* @PANGO_DIRECTION_WEAK_RTL: A weak right-to-left direction
* @PANGO_DIRECTION_NEUTRAL: No direction specified
*
* The #PangoDirection type represents a direction in the
* Unicode bidirectional algorithm; not every value in this
* enumeration makes sense for every usage of #PangoDirection;
* for example, the return value of pango_unichar_direction()
* and pango_find_base_dir() cannot be %PANGO_DIRECTION_WEAK_LTR
* or %PANGO_DIRECTION_WEAK_RTL, since every character is either
* neutral or has a strong direction; on the other hand
* %PANGO_DIRECTION_NEUTRAL doesn't make sense to pass
* to pango_itemize_with_base_dir().
*
* The %PANGO_DIRECTION_TTB_LTR, %PANGO_DIRECTION_TTB_RTL
* values come from an earlier interpretation of this
* enumeration as the writing direction of a block of
* text and are no longer used; See #PangoGravity for how
* vertical text is handled in Pango.
*
* Deprecated: 1.44: Use fribidi for this information
**/
typedef enum {
PANGO_DIRECTION_LTR,
PANGO_DIRECTION_RTL,
PANGO_DIRECTION_TTB_LTR,
PANGO_DIRECTION_TTB_RTL,
PANGO_DIRECTION_WEAK_LTR,
PANGO_DIRECTION_WEAK_RTL,
PANGO_DIRECTION_NEUTRAL
} PangoDirection;
PANGO_DEPRECATED_IN_1_44
PangoDirection pango_unichar_direction (gunichar ch) G_GNUC_CONST;
PANGO_DEPRECATED_IN_1_44
......
......@@ -25,6 +25,7 @@
#include <pango/pango-font.h>
#include <pango/pango-fontmap.h>
#include <pango/pango-attributes.h>
#include <pango/pango-direction.h>
G_BEGIN_DECLS
......
/* Pango
* pango-direction.h: Unicode text direction
*
* Copyright (C) 2018 Matthias Clasen
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Library General Public
* License as published by the Free Software Foundation; either
* version 2 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Library General Public License for more details.
*
* You should have received a copy of the GNU Library General Public
* License along with this library; if not, write to the
* Free Software Foundation, Inc., 59 Temple Place - Suite 330,
* Boston, MA 02111-1307, USA.
*/
#ifndef __PANGO_DIRECTION_H__
#define __PANGO_DIRECTION_H__
#include <glib.h>
G_BEGIN_DECLS
/**
* PangoDirection:
* @PANGO_DIRECTION_LTR: A strong left-to-right direction
* @PANGO_DIRECTION_RTL: A strong right-to-left direction
* @PANGO_DIRECTION_TTB_LTR: Deprecated value; treated the
* same as %PANGO_DIRECTION_RTL.
* @PANGO_DIRECTION_TTB_RTL: Deprecated value; treated the
* same as %PANGO_DIRECTION_LTR
* @PANGO_DIRECTION_WEAK_LTR: A weak left-to-right direction
* @PANGO_DIRECTION_WEAK_RTL: A weak right-to-left direction
* @PANGO_DIRECTION_NEUTRAL: No direction specified
*
* The #PangoDirection type represents a direction in the
* Unicode bidirectional algorithm; not every value in this
* enumeration makes sense for every usage of #PangoDirection;
* for example, the return value of pango_unichar_direction()
* and pango_find_base_dir() cannot be %PANGO_DIRECTION_WEAK_LTR
* or %PANGO_DIRECTION_WEAK_RTL, since every character is either
* neutral or has a strong direction; on the other hand
* %PANGO_DIRECTION_NEUTRAL doesn't make sense to pass
* to pango_itemize_with_base_dir().
*
* The %PANGO_DIRECTION_TTB_LTR, %PANGO_DIRECTION_TTB_RTL
* values come from an earlier interpretation of this
* enumeration as the writing direction of a block of
* text and are no longer used; See #PangoGravity for how
* vertical text is handled in Pango.
*
* If you are interested in text direction, you should
* really use fribidi directly. PangoDirection is only
* retained because it is used in some public apis.
**/
typedef enum {
PANGO_DIRECTION_LTR,
PANGO_DIRECTION_RTL,
PANGO_DIRECTION_TTB_LTR,
PANGO_DIRECTION_TTB_RTL,
PANGO_DIRECTION_WEAK_LTR,
PANGO_DIRECTION_WEAK_RTL,
PANGO_DIRECTION_NEUTRAL
} PangoDirection;
G_END_DECLS
#endif /* __PANGO_DIRECTION_H__ */
......@@ -3851,6 +3851,9 @@ apply_no_shape_attributes (PangoLayout *layout,
}
}
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
static void
pango_layout_check_lines (PangoLayout *layout)
{
......@@ -4015,6 +4018,8 @@ pango_layout_check_lines (PangoLayout *layout)
layout->lines = g_slist_reverse (layout->lines);
}
#pragma GCC diagnostic pop
/**
* pango_layout_line_ref:
* @line: (nullable): a #PangoLayoutLine, may be %NULL
......
......@@ -793,6 +793,9 @@ pango_lookup_aliases (const char *fontname,
*n_families = 0;
}
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
/**
* pango_find_base_dir:
* @text: the text to process
......@@ -831,6 +834,8 @@ pango_find_base_dir (const gchar *text,
return dir;
}
#pragma GCC diagnostic pop
/**
* pango_is_zero_width:
* @ch: a Unicode character
......
......@@ -27,6 +27,7 @@
#include <pango/pango-break.h>
#include <pango/pango-context.h>
#include <pango/pango-coverage.h>
#include <pango/pango-direction.h>
#include <pango/pango-engine.h>
#include <pango/pango-enum-types.h>
#include <pango/pango-features.h>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment