[pango/line-breaker: 1/32] Add single-paragraph mode to ItemProperties




commit 60e8025868af6dfc67b5237b2025631656d8564c
Author: Matthias Clasen <mclasen redhat com>
Date:   Fri Jan 21 23:28:57 2022 -0500

    Add single-paragraph mode to ItemProperties
    
    The line breaking code will pick it up there
    later.

 pango/pango-item-private.h | 23 ++++++++++++-----------
 pango/pango-item.c         |  7 ++++++-
 2 files changed, 18 insertions(+), 12 deletions(-)
---
diff --git a/pango/pango-item-private.h b/pango/pango-item-private.h
index db0e7932..27e8dd8e 100644
--- a/pango/pango-item-private.h
+++ b/pango/pango-item-private.h
@@ -118,19 +118,20 @@ void               pango_item_unsplit                 (PangoItem *orig,
 typedef struct _ItemProperties ItemProperties;
 struct _ItemProperties
 {
-  guint uline_single   : 1;
-  guint uline_double   : 1;
-  guint uline_low      : 1;
-  guint uline_error    : 1;
-  guint strikethrough  : 1;
-  guint oline_single   : 1;
-  guint showing_space  : 1;
-  int            letter_spacing;
-  gboolean        shape_set;
+  guint uline_single        : 1;
+  guint uline_double        : 1;
+  guint uline_low           : 1;
+  guint uline_error         : 1;
+  guint strikethrough       : 1;
+  guint oline_single        : 1;
+  guint showing_space       : 1;
+  guint no_paragraph_break  : 1;
+  guint shape_set           : 1;
+  int letter_spacing;
+  int absolute_line_height;
+  double line_height;
   PangoRectangle *shape_ink_rect;
   PangoRectangle *shape_logical_rect;
-  double line_height;
-  int    absolute_line_height;
 };
 
 void               pango_item_get_properties          (PangoItem        *item,
diff --git a/pango/pango-item.c b/pango/pango-item.c
index cd046199..3595be4f 100644
--- a/pango/pango-item.c
+++ b/pango/pango-item.c
@@ -397,8 +397,9 @@ pango_item_get_properties (PangoItem      *item,
   properties->oline_single = FALSE;
   properties->strikethrough = FALSE;
   properties->showing_space = FALSE;
-  properties->letter_spacing = 0;
+  properties->no_paragraph_break = FALSE;
   properties->shape_set = FALSE;
+  properties->letter_spacing = 0;
   properties->shape_ink_rect = NULL;
   properties->shape_logical_rect = NULL;
   properties->line_height = 0.0;
@@ -473,6 +474,10 @@ pango_item_get_properties (PangoItem      *item,
           properties->showing_space = (((PangoAttrInt *)attr)->value & PANGO_SHOW_SPACES) != 0;
           break;
 
+        case PANGO_ATTR_PARAGRAPH:
+          properties->no_paragraph_break = TRUE;
+          break;
+
         default:
           break;
         }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]