diff options
author | Cosimo Cecchi <cosimoc@gnome.org> | 2012-03-16 18:00:44 -0400 |
---|---|---|
committer | Cosimo Cecchi <cosimoc@gnome.org> | 2012-03-16 18:00:44 -0400 |
commit | ba281e27b804b1c61c715f4371f352b04e9d76ad (patch) | |
tree | f4d79188c929d0878e44522f2d6311845b5f9c2d /eel | |
parent | 8e43d841355b6cd82af730bc2357f9ac1ed7c638 (diff) | |
download | nautilus-ba281e27b804b1c61c715f4371f352b04e9d76ad.tar.gz |
eel: delete unused code
We don't use EelDPoint/EelIPoint anymore; other functions here are just
unused.
Diffstat (limited to 'eel')
-rw-r--r-- | eel/eel-art-extensions.c | 106 | ||||
-rw-r--r-- | eel/eel-art-extensions.h | 36 | ||||
-rw-r--r-- | eel/eel-self-checks.c | 34 | ||||
-rw-r--r-- | eel/eel-self-checks.h | 16 |
4 files changed, 0 insertions, 192 deletions
diff --git a/eel/eel-art-extensions.c b/eel/eel-art-extensions.c index a74ccab07..b0b969a6d 100644 --- a/eel/eel-art-extensions.c +++ b/eel/eel-art-extensions.c @@ -31,10 +31,6 @@ const EelDRect eel_drect_empty = { 0.0, 0.0, 0.0, 0.0 }; const EelIRect eel_irect_empty = { 0, 0, 0, 0 }; -const EelIPoint eel_ipoint_max = { G_MAXINT, G_MAXINT }; -const EelIPoint eel_ipoint_min = { G_MININT, G_MININT }; -const EelIPoint eel_ipoint_zero = { 0, 0 }; -const EelDimensions eel_dimensions_empty = { 0, 0 }; void eel_irect_copy (EelIRect *dest, const EelIRect *src) @@ -79,46 +75,6 @@ eel_irect_is_empty (const EelIRect *src) src->y1 <= src->y0); } -EelIRect -eel_irect_assign (int x, - int y, - int width, - int height) -{ - EelIRect rectangle; - - rectangle.x0 = x; - rectangle.y0 = y; - rectangle.x1 = rectangle.x0 + width; - rectangle.y1 = rectangle.y0 + height; - - return rectangle; -} - -/** - * eel_irect_assign_dimensions: - * - * @x: X coodinate for resulting rectangle. - * @y: Y coodinate for resulting rectangle. - * @dimensions: A EelDimensions structure for the rect's width and height. - * - * Returns: An EelIRect with the given coordinates and dimensions. - */ -EelIRect -eel_irect_assign_dimensions (int x, - int y, - EelDimensions dimensions) -{ - EelIRect rectangle; - - rectangle.x0 = x; - rectangle.y0 = y; - rectangle.x1 = rectangle.x0 + dimensions.width; - rectangle.y1 = rectangle.y0 + dimensions.height; - - return rectangle; -} - /** * eel_irect_get_width: * @@ -223,68 +179,6 @@ eel_irect_equal (EelIRect rectangle_a, && rectangle_a.y1 == rectangle_b.y1; } -/** - * eel_irect_align: - * - * @container: The rectangle that is to contain the aligned rectangle. - * @aligned_width: Width of rectangle being algined. - * @aligned_height: Height of rectangle being algined. - * @x_alignment: X alignment. - * @y_alignment: Y alignment. - * - * Returns: A rectangle aligned within a container rectangle - * using the given alignment parameters. - */ -EelIRect -eel_irect_align (EelIRect container, - int aligned_width, - int aligned_height, - float x_alignment, - float y_alignment) -{ - EelIRect aligned; - int available_width; - int available_height; - - if (eel_irect_is_empty (&container)) { - return eel_irect_empty; - } - - if (aligned_width == 0 || aligned_height == 0) { - return eel_irect_empty; - } - - /* Make sure the aligment parameters are within range */ - x_alignment = MAX (0, x_alignment); - x_alignment = MIN (1.0, x_alignment); - y_alignment = MAX (0, y_alignment); - y_alignment = MIN (1.0, y_alignment); - - available_width = eel_irect_get_width (container) - aligned_width; - available_height = eel_irect_get_height (container) - aligned_height; - - aligned.x0 = floor (container.x0 + (available_width * x_alignment) + 0.5); - aligned.y0 = floor (container.y0 + (available_height * y_alignment) + 0.5); - aligned.x1 = aligned.x0 + aligned_width; - aligned.y1 = aligned.y0 + aligned_height; - - return aligned; -} - - -/** - * eel_dimensions_are_empty: - * - * @dimensions: A EelDimensions structure. - * - * Returns: Whether the dimensions are empty. - */ -gboolean -eel_dimensions_are_empty (EelDimensions dimensions) -{ - return dimensions.width <= 0 || dimensions.height <= 0; -} - EelIRect eel_irect_offset_by (EelIRect rectangle, int x, int y) { diff --git a/eel/eel-art-extensions.h b/eel/eel-art-extensions.h index ad9e9e517..d135d8060 100644 --- a/eel/eel-art-extensions.h +++ b/eel/eel-art-extensions.h @@ -30,15 +30,6 @@ G_BEGIN_DECLS -typedef struct { - double x, y; -} EelDPoint; - -typedef struct { - int x; - int y; -} EelIPoint; - typedef struct { double x0, y0, x1, y1; } EelDRect; @@ -48,17 +39,8 @@ typedef struct { int x0, y0, x1, y1; } EelIRect; -typedef struct { - int width; - int height; -} EelDimensions; - extern const EelDRect eel_drect_empty; extern const EelIRect eel_irect_empty; -extern const EelIPoint eel_ipoint_max; -extern const EelIPoint eel_ipoint_min; -extern const EelIPoint eel_ipoint_zero; -extern const EelDimensions eel_dimensions_empty; void eel_irect_copy (EelIRect *dest, const EelIRect *src); @@ -81,31 +63,13 @@ gboolean eel_irect_is_empty (const EelIRect *rectangle); gboolean eel_irect_contains_point (EelIRect outer_rectangle, int x, int y); -EelIRect eel_irect_assign (int x, - int y, - int width, - int height); -EelIRect eel_irect_assign_dimensions (int x, - int y, - EelDimensions dimensions); int eel_irect_get_width (EelIRect rectangle); int eel_irect_get_height (EelIRect rectangle); -EelIRect eel_irect_align (EelIRect container, - int aligned_width, - int aligned_height, - float x_alignment, - float y_alignment); - void eel_drect_union (EelDRect *dest, const EelDRect *src1, const EelDRect *src2); - -/* EelDimensions functions. */ -gboolean eel_dimensions_are_empty (EelDimensions dimensions); - - G_END_DECLS #endif /* EEL_ART_EXTENSIONS_H */ diff --git a/eel/eel-self-checks.c b/eel/eel-self-checks.c index f08358198..ee3c6974b 100644 --- a/eel/eel-self-checks.c +++ b/eel/eel-self-checks.c @@ -132,40 +132,6 @@ eel_check_rectangle_result (EelIRect result, } void -eel_check_dimensions_result (EelDimensions result, - int expected_width, - int expected_height) -{ - if (result.width != expected_width - || result.height != expected_height) { - eel_report_check_failure (g_strdup_printf ("width=%d, height=%d", - result.width, - result.height), - g_strdup_printf ("width=%d, height=%d", - expected_width, - expected_height)); - } - eel_after_check (); -} - -void -eel_check_point_result (EelIPoint result, - int expected_x, - int expected_y) -{ - if (result.x != expected_x - || result.y != expected_y) { - eel_report_check_failure (g_strdup_printf ("x=%d, y=%d", - result.x, - result.y), - g_strdup_printf ("x=%d, y=%d", - expected_x, - expected_y)); - } - eel_after_check (); -} - -void eel_check_integer_result (long result, long expected) { if (result != expected) { diff --git a/eel/eel-self-checks.h b/eel/eel-self-checks.h index 7910febaf..4ae83778b 100644 --- a/eel/eel-self-checks.h +++ b/eel/eel-self-checks.h @@ -47,16 +47,6 @@ G_STMT_START { \ eel_before_check (#expression, __FILE__, __LINE__); \ eel_check_rectangle_result (expression, expected_x0, expected_y0, expected_x1, expected_y1); \ } G_STMT_END -#define EEL_CHECK_DIMENSIONS_RESULT(expression, expected_width, expected_height) \ -G_STMT_START { \ - eel_before_check (#expression, __FILE__, __LINE__); \ - eel_check_dimensions_result (expression, expected_width, expected_height); \ -} G_STMT_END -#define EEL_CHECK_POINT_RESULT(expression, expected_x, expected_y) \ -G_STMT_START { \ - eel_before_check (#expression, __FILE__, __LINE__); \ - eel_check_point_result (expression, expected_x, expected_y); \ -} G_STMT_END void eel_exit_if_self_checks_failed (void); void eel_before_check_function (const char *name); @@ -80,12 +70,6 @@ void eel_check_rectangle_result (EelIRect result, int expected_y0, int expected_x1, int expected_y1); -void eel_check_dimensions_result (EelDimensions result, - int expected_width, - int expected_height); -void eel_check_point_result (EelIPoint result, - int expected_x, - int expected_y); void eel_check_string_result (char *result, const char *expected_value); |