diff options
Diffstat (limited to 'deps/icon-slicer')
-rw-r--r-- | deps/icon-slicer/SOURCES/icon-slicer-0.3-attachpoints.patch | 69 | ||||
-rw-r--r-- | deps/icon-slicer/SOURCES/icon-slicer-0.3-sugar-297.patch | 65 | ||||
-rw-r--r-- | deps/icon-slicer/SPECS/icon-slicer.spec | 4 |
3 files changed, 67 insertions, 71 deletions
diff --git a/deps/icon-slicer/SOURCES/icon-slicer-0.3-attachpoints.patch b/deps/icon-slicer/SOURCES/icon-slicer-0.3-attachpoints.patch deleted file mode 100644 index 5638add..0000000 --- a/deps/icon-slicer/SOURCES/icon-slicer-0.3-attachpoints.patch +++ /dev/null @@ -1,69 +0,0 @@ -diff -ur icon-slicer-0.3/src/main.c icon-slicer-0.3-attachpoints/src/main.c ---- icon-slicer-0.3/src/main.c 2003-06-25 22:17:32.000000000 +0200 -+++ icon-slicer-0.3-attachpoints/src/main.c 2004-09-30 10:16:43.884414198 +0200 -@@ -363,6 +363,35 @@ - } - } - -+struct AttachPointCompare { -+ int rowstride; -+ const guchar *pixels; -+}; -+ -+static gint -+compare_attach_points (gconstpointer a, -+ gconstpointer b, -+ gpointer user_data) -+{ -+ const ThemePoint *attach_point_a, *attach_point_b; -+ struct AttachPointCompare *compare; -+ guint8 red_a, red_b; -+ -+ attach_point_a = a; -+ attach_point_b = b; -+ compare = user_data; -+ -+ red_a = compare->pixels[compare->rowstride * attach_point_a->y + 4*attach_point_a->x]; -+ red_b = compare->pixels[compare->rowstride * attach_point_b->y + 4*attach_point_b->x]; -+ -+ if (red_a > red_b) -+ return -1; -+ if (red_a == red_b) -+ return 0; -+ return 1; -+} -+ -+ - static void - icon_fetch_attach_points (ThemeIcon *icon, - ThemeIconInstance *instance, -@@ -375,7 +404,8 @@ - - const guchar *pixels; - int rowstride; -- -+ struct AttachPointCompare compare; -+ - theme_source_location_start (source, &icon->location, &start_x, &start_y); - image = theme_source_find_image (source, THEME_SOURCE_USE_ATTACH_POINTS); - if (!image) -@@ -390,6 +420,8 @@ - - rowstride = gdk_pixbuf_get_rowstride (image->image); - pixels = gdk_pixbuf_get_pixels (image->image) + start_y * rowstride + start_x * 4; -+ compare.pixels = pixels; -+ compare.rowstride = rowstride; - - for (j = 0; j < source->gridsize; j++) - { -@@ -407,6 +439,10 @@ - - pixels += rowstride; - } -+ -+ instance->attach_points = g_slist_sort_with_data (instance->attach_points, -+ compare_attach_points, -+ &compare); - } - - static gboolean diff --git a/deps/icon-slicer/SOURCES/icon-slicer-0.3-sugar-297.patch b/deps/icon-slicer/SOURCES/icon-slicer-0.3-sugar-297.patch new file mode 100644 index 0000000..9cc769f --- /dev/null +++ b/deps/icon-slicer/SOURCES/icon-slicer-0.3-sugar-297.patch @@ -0,0 +1,65 @@ +--- icon-slicer-0.3/src/main.c.orig 2003-06-25 20:17:32.000000000 +0000 ++++ icon-slicer-0.3/src/main.c 2009-03-20 17:49:03.000000000 +0000 +@@ -89,7 +89,7 @@ + { + ThemeImage *image = theme_source_find_image (source, frame_index); + int start_x, start_y; +- int i, j; ++ int x, y; + + const guchar *pixels; + int rowstride; +@@ -103,7 +103,7 @@ + if (n_channels == 3) + { + out->x = start_x; +- out->y = start_x; ++ out->y = start_y; + out->width = source->gridsize; + out->height = source->gridsize; + +@@ -116,29 +116,29 @@ + + pixels = gdk_pixbuf_get_pixels (image->image) + start_y * rowstride + start_x * 4; + +- for (j = 0; j < source->gridsize; j++) ++ for (y = 0; y < source->gridsize; y++) + { +- for (i = 0; i < source->gridsize; i++) ++ for (x = 0; x < source->gridsize; x++) + { +- if (pixels[4*i + 3] > threshold) ++ if (pixels[4*x + 3] > threshold) + { + if (found) + { +- if (start_x + i < min_x) +- min_x = start_x + i; +- if (start_x + i >= max_x) +- max_x = start_x + i + 1; +- if (start_y + j < min_y) +- min_y = start_y + j; +- if (start_y + j >= max_y) +- max_y = start_y + j + 1; ++ if (start_x + x < min_x) ++ min_x = start_x + x; ++ if (start_x + x >= max_x) ++ max_x = start_x + x + 1; ++ if (start_y + y < min_y) ++ min_y = start_y + y; ++ if (start_y + y >= max_y) ++ max_y = start_y + y + 1; + } + else + { +- min_x = start_x + i; +- max_x = start_x + i + 1; +- min_y = start_y + i; +- max_y = start_y + i + 1; ++ min_x = start_x + x; ++ max_x = start_x + x + 1; ++ min_y = start_y + y; ++ max_y = start_y + y + 1; + + found = TRUE; + } diff --git a/deps/icon-slicer/SPECS/icon-slicer.spec b/deps/icon-slicer/SPECS/icon-slicer.spec index 24fb028..6154683 100644 --- a/deps/icon-slicer/SPECS/icon-slicer.spec +++ b/deps/icon-slicer/SPECS/icon-slicer.spec @@ -7,7 +7,7 @@ Release: 3.2 License: MIT Group: Development/Tools Source: icon-slicer-%{version}.tar.gz -Patch1: icon-slicer-0.3-attachpoints.patch +Patch1: icon-slicer-0.3-sugar-297.patch BuildRequires: gtk2-devel BuildRequires: popt-devel BuildRoot: %{_tmppath}/build-%{name}-root @@ -18,7 +18,7 @@ themes %prep %setup -q -%patch1 -p1 -b .attachpoints +%patch1 -p1 %build %configure |