summaryrefslogtreecommitdiff
path: root/eel/eel-canvas-rect-ellipse.c
diff options
context:
space:
mode:
authormonsta <[email protected]>2016-08-21 03:29:50 +0300
committermonsta <[email protected]>2016-08-22 16:40:21 +0300
commit3c6122df79f4d6e86d7afa0e6c4b64403de7bc44 (patch)
treebd06579cadb62b290fb983f61a02e4dedb3f64b1 /eel/eel-canvas-rect-ellipse.c
parent6f295db45ebcb52c6e9ad39f8d639e35f88c5ef5 (diff)
downloadcaja-3c6122df79f4d6e86d7afa0e6c4b64403de7bc44.tar.bz2
caja-3c6122df79f4d6e86d7afa0e6c4b64403de7bc44.tar.xz
drop a large amount of completely unused code
Diffstat (limited to 'eel/eel-canvas-rect-ellipse.c')
-rw-r--r--eel/eel-canvas-rect-ellipse.c225
1 files changed, 0 insertions, 225 deletions
diff --git a/eel/eel-canvas-rect-ellipse.c b/eel/eel-canvas-rect-ellipse.c
index 0ed0c826..b1300679 100644
--- a/eel/eel-canvas-rect-ellipse.c
+++ b/eel/eel-canvas-rect-ellipse.c
@@ -35,7 +35,6 @@
#include <config.h>
#include <math.h>
#include "eel-canvas-rect-ellipse.h"
-#include "eel-canvas-util.h"
#include <string.h>
#ifdef HAVE_RENDER
@@ -88,7 +87,6 @@ static void eel_canvas_re_unrealize (EelCanvasItem *item);
static void eel_canvas_re_bounds (EelCanvasItem *item, double *x1, double *y1, double *x2, double *y2);
static void eel_canvas_re_translate (EelCanvasItem *item, double dx, double dy);
static void eel_canvas_rect_update (EelCanvasItem *item, double i2w_dx, double i2w_dy, int flags);
-static void eel_canvas_ellipse_update (EelCanvasItem *item, double i2w_dx, double i2w_dy, int flags);
typedef struct
{
@@ -1073,229 +1071,6 @@ eel_canvas_rect_update (EelCanvasItem *item, double i2w_dx, double i2w_dy, gint
}
}
-/* Ellipse item */
-
-
-static void eel_canvas_ellipse_class_init (EelCanvasEllipseClass *klass);
-
-#if GTK_CHECK_VERSION(3,0,0)
-static void eel_canvas_ellipse_draw (EelCanvasItem *item, cairo_t *cr, cairo_region_t *region);
-#else
-static void eel_canvas_ellipse_draw (EelCanvasItem *item, GdkDrawable *drawable, GdkEventExpose *expose);
-#endif
-static double eel_canvas_ellipse_point (EelCanvasItem *item, double x, double y, int cx, int cy,
- EelCanvasItem **actual_item);
-
-
-GType
-eel_canvas_ellipse_get_type (void)
-{
- static GType ellipse_type = 0;
-
- if (!ellipse_type)
- {
- GTypeInfo ellipse_info =
- {
- sizeof (EelCanvasEllipseClass),
- (GBaseInitFunc) NULL,
- (GBaseFinalizeFunc) NULL,
- (GClassInitFunc) eel_canvas_ellipse_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (EelCanvasEllipse),
- 0, /* n_preallocs */
- (GInstanceInitFunc) NULL
-
- };
-
- ellipse_type = g_type_register_static (eel_canvas_re_get_type (),
- "EelCanvasEllipse",
- &ellipse_info,
- 0);
- }
-
- return ellipse_type;
-}
-
-static void
-eel_canvas_ellipse_class_init (EelCanvasEllipseClass *klass)
-{
- EelCanvasItemClass *item_class;
-
- item_class = (EelCanvasItemClass *) klass;
-
- item_class->draw = eel_canvas_ellipse_draw;
- item_class->point = eel_canvas_ellipse_point;
- item_class->update = eel_canvas_ellipse_update;
-}
-
-static void
-#if GTK_CHECK_VERSION(3,0,0)
-eel_canvas_ellipse_draw (EelCanvasItem *item, cairo_t *cr, cairo_region_t *region)
-#else
-eel_canvas_ellipse_draw (EelCanvasItem *item, GdkDrawable *drawable, GdkEventExpose *expose)
-#endif
-{
- EelCanvasRE *re;
- int x1, y1, x2, y2;
- double i2w_dx, i2w_dy;
-
- re = EEL_CANVAS_RE (item);
-
- /* Get canvas pixel coordinates */
-
- i2w_dx = 0.0;
- i2w_dy = 0.0;
- eel_canvas_item_i2w (item, &i2w_dx, &i2w_dy);
-
- eel_canvas_w2c (item->canvas,
- re->x1 + i2w_dx,
- re->y1 + i2w_dy,
- &x1, &y1);
- eel_canvas_w2c (item->canvas,
- re->x2 + i2w_dx,
- re->y2 + i2w_dy,
- &x2, &y2);
-
-#if GTK_CHECK_VERSION(3,0,0)
- cairo_save (cr);
-#else
- cairo_t *cr = gdk_cairo_create (drawable);
- gdk_cairo_region (cr, expose->region);
- cairo_clip (cr);
-#endif
-
- cairo_save (cr);
- cairo_translate (cr, (x1 + x2) / 2., (y1 + y2) / 2.);
- cairo_scale (cr, (x2 - x1), (y2 - y1));
- cairo_arc (cr, 0, 0, 1, 0, 2 * G_PI);
- cairo_restore (cr);
-
- if (re->fill_set)
- {
-#if GTK_CHECK_VERSION(3,0,0)
- eel_canvas_set_source_color (cr, &re->fill_color);
-#else
- eel_canvas_set_source_color (cr, re->fill_color);
-#endif
- cairo_fill_preserve (cr);
- }
-
- if (re->outline_set)
- {
-#if GTK_CHECK_VERSION(3,0,0)
- eel_canvas_set_source_color (cr, &re->outline_color);
-#else
- eel_canvas_set_source_color (cr, re->outline_color);
-#endif
- if (re->width_pixels) {
- cairo_set_line_width (cr, (int) re->width);
- } else {
- cairo_set_line_width (cr, (int) (re->width * re->item.canvas->pixels_per_unit + 0.5));
- }
-
- cairo_stroke_preserve (cr);
- }
-
-#if GTK_CHECK_VERSION(3,0,0)
- cairo_restore (cr);
-#else
- cairo_destroy (cr);
-#endif
-}
-
-static double
-eel_canvas_ellipse_point (EelCanvasItem *item, double x, double y, int cx, int cy, EelCanvasItem **actual_item)
-{
- EelCanvasRE *re;
- double dx, dy;
- double scaled_dist;
- double outline_dist;
- double center_dist;
- double width;
- double a, b;
- double diamx, diamy;
-
- re = EEL_CANVAS_RE (item);
-
- *actual_item = item;
-
- if (re->outline_set)
- {
- if (re->width_pixels)
- width = re->width / item->canvas->pixels_per_unit;
- else
- width = re->width;
- }
- else
- width = 0.0;
-
- /* Compute the distance between the center of the ellipse and the point, with the ellipse
- * considered as being scaled to a circle.
- */
-
- dx = x - (re->x1 + re->x2) / 2.0;
- dy = y - (re->y1 + re->y2) / 2.0;
- center_dist = sqrt (dx * dx + dy * dy);
-
- a = dx / ((re->x2 + width - re->x1) / 2.0);
- b = dy / ((re->y2 + width - re->y1) / 2.0);
- scaled_dist = sqrt (a * a + b * b);
-
- /* If the scaled distance is greater than 1, then we are outside. Compute the distance from
- * the point to the edge of the circle, then scale back to the original un-scaled coordinate
- * system.
- */
-
- if (scaled_dist > 1.0)
- return (center_dist / scaled_dist) * (scaled_dist - 1.0);
-
- /* We are inside the outer edge of the ellipse. If it is filled, then we are "inside".
- * Otherwise, do the same computation as above, but also check whether we are inside the
- * outline.
- */
-
- if (re->fill_set)
- return 0.0;
-
- if (scaled_dist > EEL_CANVAS_EPSILON)
- outline_dist = (center_dist / scaled_dist) * (1.0 - scaled_dist) - width;
- else
- {
- /* Handle very small distance */
-
- diamx = re->x2 - re->x1;
- diamy = re->y2 - re->y1;
-
- if (diamx < diamy)
- outline_dist = (diamx - width) / 2.0;
- else
- outline_dist = (diamy - width) / 2.0;
- }
-
- if (outline_dist < 0.0)
- return 0.0;
-
- return outline_dist;
-}
-
-static void
-eel_canvas_ellipse_update (EelCanvasItem *item, double i2w_dx, double i2w_dy, gint flags)
-{
- EelCanvasRE *re;
- double x0, y0, x1, y1;
-
-#ifdef VERBOSE
- g_print ("eel_canvas_sllipse_update item %x\n", item);
-#endif
-
- eel_canvas_re_update_shared (item, i2w_dx, i2w_dy, flags);
- re = EEL_CANVAS_RE (item);
-
- get_bounds (re, &x0, &y0, &x1, &y1);
- eel_canvas_update_bbox (item, x0, y0, x1, y1);
-}
-
static int
rect_empty (const Rect *src)
{