[gtk/wip/otte/lottie: 264/339] roundedbox: Remove unused API




commit f6bac2335c71a552d7d81b031bd40a890063725c
Author: Benjamin Otte <otte redhat com>
Date:   Wed Dec 2 08:50:16 2020 +0100

    roundedbox: Remove unused API

 gtk/gtkroundedbox.c        | 142 ---------------------------------------------
 gtk/gtkroundedboxprivate.h |  16 -----
 2 files changed, 158 deletions(-)
---
diff --git a/gtk/gtkroundedbox.c b/gtk/gtkroundedbox.c
index c068c8587d..9ea6782573 100644
--- a/gtk/gtkroundedbox.c
+++ b/gtk/gtkroundedbox.c
@@ -26,139 +26,6 @@
 
 #include <string.h>
 
-/**
- * _gtk_rounded_box_init_rect:
- * @box: box to initialize
- * @x: x coordinate of box
- * @y: y coordinate of box
- * @width: width of box
- * @height: height of box
- *
- * Initializes the given @box to represent the given rectangle.
- * The
- **/
-void
-_gtk_rounded_box_init_rect (GskRoundedRect *box,
-                            double          x,
-                            double          y,
-                            double          width,
-                            double          height)
-{
-  memset (box, 0, sizeof (GskRoundedRect));
-
-  box->bounds.origin.x = x;
-  box->bounds.origin.y = y;
-  box->bounds.size.width = width;
-  box->bounds.size.height = height;
-}
-
-/* clamp border radius, following CSS specs */
-static void
-gtk_rounded_box_clamp_border_radius (GskRoundedRect *box)
-{
-  double factor = 1.0;
-  double corners;
-
-  corners = box->corner[GSK_CORNER_TOP_LEFT].width + box->corner[GSK_CORNER_TOP_RIGHT].width;
-  if (corners != 0)
-    factor = MIN (factor, box->bounds.size.width / corners);
-
-  corners = box->corner[GSK_CORNER_TOP_RIGHT].height + box->corner[GSK_CORNER_BOTTOM_RIGHT].height;
-  if (corners != 0)
-    factor = MIN (factor, box->bounds.size.height / corners);
-
-  corners = box->corner[GSK_CORNER_BOTTOM_RIGHT].width + box->corner[GSK_CORNER_BOTTOM_LEFT].width;
-  if (corners != 0)
-    factor = MIN (factor, box->bounds.size.width / corners);
-
-  corners = box->corner[GSK_CORNER_TOP_LEFT].height + box->corner[GSK_CORNER_BOTTOM_LEFT].height;
-  if (corners != 0)
-    factor = MIN (factor, box->bounds.size.height / corners);
-
-  box->corner[GSK_CORNER_TOP_LEFT].width *= factor;
-  box->corner[GSK_CORNER_TOP_LEFT].height *= factor;
-  box->corner[GSK_CORNER_TOP_RIGHT].width *= factor;
-  box->corner[GSK_CORNER_TOP_RIGHT].height *= factor;
-  box->corner[GSK_CORNER_BOTTOM_RIGHT].width *= factor;
-  box->corner[GSK_CORNER_BOTTOM_RIGHT].height *= factor;
-  box->corner[GSK_CORNER_BOTTOM_LEFT].width *= factor;
-  box->corner[GSK_CORNER_BOTTOM_LEFT].height *= factor;
-}
-
-static void
-_gtk_rounded_box_apply_border_radius (GskRoundedRect *box,
-                                      const GtkCssValue * const corner[4])
-{
-  box->corner[GSK_CORNER_TOP_LEFT].width = _gtk_css_corner_value_get_x (corner[GSK_CORNER_TOP_LEFT],
-                                                                          box->bounds.size.width);
-  box->corner[GSK_CORNER_TOP_LEFT].height = _gtk_css_corner_value_get_y (corner[GSK_CORNER_TOP_LEFT],
-                                                                        box->bounds.size.height);
-
-  box->corner[GSK_CORNER_TOP_RIGHT].width = _gtk_css_corner_value_get_x (corner[GSK_CORNER_TOP_RIGHT],
-                                                                           box->bounds.size.width);
-  box->corner[GSK_CORNER_TOP_RIGHT].height = _gtk_css_corner_value_get_y (corner[GSK_CORNER_TOP_RIGHT],
-                                                                         box->bounds.size.height);
-
-  box->corner[GSK_CORNER_BOTTOM_RIGHT].width = _gtk_css_corner_value_get_x (corner[GSK_CORNER_BOTTOM_RIGHT],
-                                                                              box->bounds.size.width);
-  box->corner[GSK_CORNER_BOTTOM_RIGHT].height = _gtk_css_corner_value_get_y (corner[GSK_CORNER_BOTTOM_RIGHT],
-                                                                            box->bounds.size.height);
-
-  box->corner[GSK_CORNER_BOTTOM_LEFT].width = _gtk_css_corner_value_get_x (corner[GSK_CORNER_BOTTOM_LEFT],
-                                                                             box->bounds.size.width);
-  box->corner[GSK_CORNER_BOTTOM_LEFT].height = _gtk_css_corner_value_get_y (corner[GSK_CORNER_BOTTOM_LEFT],
-                                                                           box->bounds.size.height);
-
-  gtk_rounded_box_clamp_border_radius (box);
-}
-
-void
-gtk_rounded_boxes_init_for_style (GskRoundedRect *border_box,
-                                  GskRoundedRect *padding_box,
-                                  GskRoundedRect *content_box,
-                                  GtkCssStyle    *style,
-                                  double          x,
-                                  double          y,
-                                  double          width,
-                                  double          height)
-{
-  const GtkCssValue *corner[4];
-  GskRoundedRect box;
-
-  gsk_rounded_rect_init_from_rect (&box, &GRAPHENE_RECT_INIT (x, y, width, height), 0);
-
-  corner[GSK_CORNER_TOP_LEFT] = style->border->border_top_left_radius;
-  corner[GSK_CORNER_TOP_RIGHT] = style->border->border_top_right_radius;
-  corner[GSK_CORNER_BOTTOM_LEFT] = style->border->border_bottom_left_radius;
-  corner[GSK_CORNER_BOTTOM_RIGHT] = style->border->border_bottom_right_radius;
-
-  _gtk_rounded_box_apply_border_radius (&box, corner);
-
-  if (border_box)
-    gsk_rounded_rect_init_copy (border_box, &box);
-
-  if (padding_box || content_box)
-    {
-      gsk_rounded_rect_shrink (&box,
-                               _gtk_css_number_value_get (style->border->border_top_width, 100),
-                               _gtk_css_number_value_get (style->border->border_right_width, 100),
-                               _gtk_css_number_value_get (style->border->border_bottom_width, 100),
-                               _gtk_css_number_value_get (style->border->border_left_width, 100));
-      if (padding_box)
-        gsk_rounded_rect_init_copy (padding_box, &box);
-
-      if (content_box)
-        {
-          gsk_rounded_rect_shrink (&box,
-                                   _gtk_css_number_value_get (style->size->padding_top, 100),
-                                   _gtk_css_number_value_get (style->size->padding_right, 100),
-                                   _gtk_css_number_value_get (style->size->padding_bottom, 100),
-                                   _gtk_css_number_value_get (style->size->padding_left, 100));
-          gsk_rounded_rect_init_copy (content_box, &box);
-        }
-    }
-}
-
 typedef struct {
   double angle1;
   double angle2;
@@ -591,12 +458,3 @@ _gtk_rounded_box_path_left (const GskRoundedRect *outer,
   cairo_close_path (cr);
 }
 
-void
-_gtk_rounded_box_clip_path (const GskRoundedRect *box,
-                            cairo_t              *cr)
-{
-  cairo_rectangle (cr,
-                   box->bounds.origin.x, box->bounds.origin.y,
-                   box->bounds.size.width, box->bounds.size.height);
-}
-
diff --git a/gtk/gtkroundedboxprivate.h b/gtk/gtkroundedboxprivate.h
index 4bf2c2fb72..208d30c302 100644
--- a/gtk/gtkroundedboxprivate.h
+++ b/gtk/gtkroundedboxprivate.h
@@ -28,20 +28,6 @@
 
 G_BEGIN_DECLS
 
-void            _gtk_rounded_box_init_rect                      (GskRoundedRect         *box,
-                                                                 double                  x,
-                                                                 double                  y,
-                                                                 double                  width,
-                                                                 double                  height);
-void            gtk_rounded_boxes_init_for_style                (GskRoundedRect         *border_box,
-                                                                 GskRoundedRect         *padding_box,
-                                                                 GskRoundedRect         *content_box,
-                                                                 GtkCssStyle            *style,
-                                                                 double                  x,
-                                                                 double                  y,
-                                                                 double                  width,
-                                                                 double                  height);
-
 double          _gtk_rounded_box_guess_length                   (const GskRoundedRect   *box,
                                                                  GtkCssSide              side);
 
@@ -60,8 +46,6 @@ void            _gtk_rounded_box_path_bottom                    (const GskRounde
 void            _gtk_rounded_box_path_left                      (const GskRoundedRect   *outer,
                                                                  const GskRoundedRect   *inner,
                                                                  cairo_t                *cr);
-void            _gtk_rounded_box_clip_path                      (const GskRoundedRect   *box,
-                                                                 cairo_t                *cr);
 
 G_END_DECLS
 


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