[pango/pango2: 15/135] Add single-paragraph mode to ItemProperties




commit bba388ebde273c3ad8486fbaa8ec5d7f08924499
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 93265148..8a47d181 100644
--- a/pango/pango-item-private.h
+++ b/pango/pango-item-private.h
@@ -57,19 +57,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 4aa39bdc..a8584549 100644
--- a/pango/pango-item.c
+++ b/pango/pango-item.c
@@ -384,8 +384,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;
@@ -460,6 +461,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]