[gtk-engines] thinice: Remove draw_polygon() from style class



commit 102dca03d277130a64cd6f70f21a0037659399c3
Author: Florian Müllner <fmuellner gnome org>
Date:   Thu Aug 12 20:45:46 2010 +0200

    thinice: Remove draw_polygon() from style class
    
    The hook has been deprecated/removed from GtkStyle.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=626678
    
    Reviewed-by: Benjamin Otte <otte redhat com>

 engines/thinice/src/thinice_theme_draw.c |  127 ------------------------------
 1 files changed, 0 insertions(+), 127 deletions(-)
---
diff --git a/engines/thinice/src/thinice_theme_draw.c b/engines/thinice/src/thinice_theme_draw.c
index 611d4ba..e63272a 100644
--- a/engines/thinice/src/thinice_theme_draw.c
+++ b/engines/thinice/src/thinice_theme_draw.c
@@ -160,132 +160,6 @@ thinice_style_draw_shadow(GtkStyle     *style,
 }
 
 static void
-thinice_style_draw_polygon(GtkStyle * style,
-             GdkWindow * window,
-             GtkStateType state_type,
-             GtkShadowType shadow_type,
-             GdkRectangle * area,
-             GtkWidget * widget,
-             const gchar *detail,
-             GdkPoint * points,
-             gint npoints,
-             gint fill)
-{
-  static const gdouble pi_over_4 = G_PI_4;
-  static const gdouble pi_3_over_4 = G_PI_4 * 3;
-
-  ThiniceStyle *thinice_style = THINICE_STYLE (style);
-
-  CairoColor *color1 = NULL;
-  CairoColor *color2 = NULL;
-  CairoColor *color3 = NULL;
-  CairoColor *color4 = NULL;
-  cairo_t *cr;
-
-  gdouble             angle;
-  gint                xadjust;
-  gint                yadjust;
-  gint                i;
-
-  CHECK_ARGS
-  g_return_if_fail(points != NULL);
-
-  switch (shadow_type)
-    {
-    case GTK_SHADOW_IN:
-			color1 = &thinice_style->color_cube.light[state_type];
-			color2 = &thinice_style->color_cube.dark[state_type];
-			color3 = &thinice_style->color_cube.light[state_type];
-			color4 = &thinice_style->color_cube.dark[state_type];
-      break;
-    case GTK_SHADOW_ETCHED_IN:
-			color1 = &thinice_style->color_cube.light[state_type];
-			color2 = &thinice_style->color_cube.dark[state_type];
-			color3 = &thinice_style->color_cube.dark[state_type];
-			color4 = &thinice_style->color_cube.light[state_type];
-      break;
-    case GTK_SHADOW_OUT:
-			color1 = &thinice_style->color_cube.dark[state_type];
-			color2 = &thinice_style->color_cube.light[state_type];
-			color3 = &thinice_style->color_cube.dark[state_type];
-			color4 = &thinice_style->color_cube.light[state_type];
-      break;
-    case GTK_SHADOW_ETCHED_OUT:
-			color1 = &thinice_style->color_cube.dark[state_type];
-			color2 = &thinice_style->color_cube.light[state_type];
-			color3 = &thinice_style->color_cube.light[state_type];
-			color4 = &thinice_style->color_cube.dark[state_type];
-      break;
-    default:
-      return;
-    }
-
-  cr = ge_gdk_drawable_to_cairo (window, area);
-
-  if (fill)
-    ge_cairo_polygon(cr, &thinice_style->color_cube.bg[state_type], points, npoints);
-
-  npoints--;
-
-  for (i = 0; i < npoints; i++)
-    {
-      if ((points[i].x == points[i + 1].x) &&
-          (points[i].y == points[i + 1].y))
-        {
-          angle = 0;
-        }
-      else
-        {
-          angle = atan2(points[i + 1].y - points[i].y,
-                        points[i + 1].x - points[i].x);
-        }
-
-      if ((angle > -pi_3_over_4) && (angle < pi_over_4))
-        {
-          if (angle > -pi_over_4)
-            {
-              xadjust = 0;
-              yadjust = 1;
-            }
-          else
-            {
-              xadjust = 1;
-              yadjust = 0;
-            }
-
-          ge_cairo_line(cr, color1,
-                        points[i].x - xadjust, points[i].y - yadjust,
-                        points[i + 1].x - xadjust, points[i + 1].y - yadjust);
-          ge_cairo_line(cr, color3,
-                        points[i].x, points[i].y,
-                        points[i + 1].x, points[i + 1].y);
-        }
-      else
-        {
-          if ((angle < -pi_3_over_4) || (angle > pi_3_over_4))
-            {
-              xadjust = 0;
-              yadjust = 1;
-            }
-          else
-            {
-              xadjust = 1;
-              yadjust = 0;
-            }
-
-          ge_cairo_line(cr, color4,
-                        points[i].x + xadjust, points[i].y + yadjust,
-                        points[i + 1].x + xadjust, points[i + 1].y + yadjust);
-          ge_cairo_line(cr, color2,
-                        points[i].x, points[i].y,
-                        points[i + 1].x, points[i + 1].y);
-        }
-    }
-
-   cairo_destroy(cr);
-}
-
-static void
 thinice_style_draw_arrow(GtkStyle * style,
            GdkWindow * window,
            GtkStateType state_type,
@@ -1357,7 +1231,6 @@ thinice_style_class_init (ThiniceStyleClass *klass)
   style_class->draw_hline = thinice_style_draw_hline;
   style_class->draw_vline = thinice_style_draw_vline;
   style_class->draw_shadow = thinice_style_draw_shadow;
-  style_class->draw_polygon = thinice_style_draw_polygon;
   style_class->draw_arrow = thinice_style_draw_arrow;
   style_class->draw_diamond = thinice_style_draw_diamond;
   style_class->draw_box = thinice_style_draw_box;



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