summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2014-08-30 14:09:19 -0400
committerMatthias Clasen <mclasen@redhat.com>2014-09-02 13:58:47 -0400
commit95ccc8910223d7d092f4cc30c93b4a5f9dcd301a (patch)
tree851d73e982d8b195089404b47cceb0b3152aae33
parent0068b78276c4ac7df95d97fa270a5e8ca4b58348 (diff)
downloadpango-95ccc8910223d7d092f4cc30c93b4a5f9dcd301a.tar.gz
Add an analysis flag to mark the ellipsis run
Without this, it is hard to determine if you are 'inside the ellipsis'. We need to know this in GTK+, e.g. to skip link processing. I decided not to turn the flags into an enum at the time to avoid possible language binding problems. https://bugzilla.gnome.org/show_bug.cgi?id=735719
-rw-r--r--pango/ellipsize.c2
-rw-r--r--pango/pango-item.h13
2 files changed, 13 insertions, 2 deletions
diff --git a/pango/ellipsize.c b/pango/ellipsize.c
index 1c8aa241..ade33ec7 100644
--- a/pango/ellipsize.c
+++ b/pango/ellipsize.c
@@ -645,6 +645,8 @@ fixup_ellipsis_run (EllipsizeState *state)
level = MIN (level, state->run_info[i].run->item->analysis.level);
item->analysis.level = level;
+
+ item->analysis.flags |= PANGO_ANALYSIS_FLAG_IS_ELLIPSIS;
}
/* Computes the new list of runs for the line
diff --git a/pango/pango-item.h b/pango/pango-item.h
index b8e8ab67..4f84dc9b 100644
--- a/pango/pango-item.h
+++ b/pango/pango-item.h
@@ -29,7 +29,6 @@ G_BEGIN_DECLS
typedef struct _PangoAnalysis PangoAnalysis;
typedef struct _PangoItem PangoItem;
-/* TODO: if more flags are needed, turn this into a real PangoAnalysisFlags enum */
/**
* PANGO_ANALYSIS_FLAG_CENTERED_BASELINE:
*
@@ -41,6 +40,16 @@ typedef struct _PangoItem PangoItem;
#define PANGO_ANALYSIS_FLAG_CENTERED_BASELINE (1 << 0)
/**
+ * PANGO_ANALYSIS_FLAG_IS_ELLIPSIS:
+ *
+ * This flag is used to mark runs that hold ellipsized text,
+ * in an ellipsized layout.
+ *
+ * Since: 1.36.7
+ */
+#define PANGO_ANALYSIS_FLAG_IS_ELLIPSIS (1 << 1)
+
+/**
* PangoAnalysis:
* @shape_engine: the engine for doing rendering-system-dependent processing.
* @lang_engine: the engine for doing rendering-system-independent processing.
@@ -74,7 +83,7 @@ struct _PangoAnalysis
/**
* PangoItem:
*
- * The #PangoItem structure stores information abouta segment of text.
+ * The #PangoItem structure stores information about a segment of text.
*/
struct _PangoItem
{