Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix gtk3 gtkprintbackendcups patches so that they actually apply

  • Loading branch information...
commit b5685c5579c134f390788a6f118c38aa6f8aab6d 1 parent 86271af
@jralls authored
View
6 modulesets-stable/gtk-osx.modules
@@ -206,10 +206,10 @@
</after>
</autotools>
- <autotools id="gtk+-3.0" autogen-sh="configure"
+ <autotools id="gtk+-3.0" autogen-sh="autogen.sh"
autogenargs="--enable-quartz-backend --enable-quartz-relocation">
- <branch module="gtk+/3.2/gtk+-3.2.3.tar.xz" version="3.2.3"
- hash="sha256:e2cf20f2510ebbc7be122a1a33dd1f472a7d06aaf16b4f2a63eb048cd9141d3d">
+ <branch module="gtk+/3.2/gtk+-3.2.4.tar.xz" version="3.2.4"
+ hash="sha256:f981bf514858c00d7084bd6f6c34b3c60b8aebdb959e7aca6faa59ed67c136bd">
<patch file="http://git.gnome.org/browse/gtk-osx/plain/patches/0001-Bug-571582-GtkSelection-implementation-for-quartz.patch" strip="1"/>
<patch file="http://git.gnome.org/browse/gtk-osx/plain/patches/0002-gtk3-Extract-reasons-and-reasons_desc-arrays-to-file-leve.patch" strip="1"/>
<patch file="http://git.gnome.org/browse/gtk-osx/plain/patches/0003-gtk3-Create-enum-PrinterStateLevel.patch" strip="1"/>
View
4 patches/0002-gtk3-Extract-reasons-and-reasons_desc-arrays-to-file-leve.patch
@@ -12,7 +12,7 @@ diff --git a/modules/printbackends/cups/gtkprintbackendcups.c b/modules/printbac
index 12c6ab6..88c7137 100644
--- a/modules/printbackends/cups/gtkprintbackendcups.c
+++ b/modules/printbackends/cups/gtkprintbackendcups.c
-@@ -1692,6 +1692,42 @@ find_printer (GtkPrinter *printer,
+@@ -1613,6 +1613,42 @@ find_printer (GtkPrinter *printer,
printer_name = gtk_printer_get_name (printer);
return g_ascii_strcasecmp (printer_name, find_name);
}
@@ -55,7 +55,7 @@ index 12c6ab6..88c7137 100644
static void
cups_request_printer_list_cb (GtkPrintBackendCups *cups_backend,
-@@ -1763,40 +1799,6 @@ cups_request_printer_list_cb (GtkPrintBackendCups *cups_backend,
+@@ -1684,40 +1720,6 @@ cups_request_printer_list_cb (GtkPrintBackendCups *cups_backend,
gint printer_state_reason_level = 0; /* 0 - none, 1 - report, 2 - warning, 3 - error */
gboolean interested_in = FALSE;
gboolean found = FALSE;
View
2  patches/0003-gtk3-Create-enum-PrinterStateLevel.patch
@@ -12,7 +12,7 @@ diff --git a/modules/printbackends/cups/gtkprintbackendcups.c b/modules/printbac
index 88c7137..fab3f40 100644
--- a/modules/printbackends/cups/gtkprintbackendcups.c
+++ b/modules/printbackends/cups/gtkprintbackendcups.c
-@@ -1729,6 +1729,13 @@ static const char * printer_strings[] =
+@@ -1650,6 +1650,13 @@ static const char * printer_strings[] =
N_("There is a problem on printer '%s'.")
};
View
22 patches/0004-gtk3-Extract-printer-setup-variables-into-a-struct.patch
@@ -14,7 +14,7 @@ diff --git a/modules/printbackends/cups/gtkprintbackendcups.c b/modules/printbac
index fab3f40..17f3ddc 100644
--- a/modules/printbackends/cups/gtkprintbackendcups.c
+++ b/modules/printbackends/cups/gtkprintbackendcups.c
-@@ -1736,6 +1736,28 @@ typedef enum
+@@ -1657,6 +1657,28 @@ typedef enum
GTK_PRINTER_STATE_LEVEL_WARNING = 2,
GTK_PRINTER_STATE_LEVEL_ERROR = 3
} PrinterStateLevel;
@@ -43,7 +43,7 @@ index fab3f40..17f3ddc 100644
static void
cups_request_printer_list_cb (GtkPrintBackendCups *cups_backend,
GtkCupsResult *result,
-@@ -1788,32 +1810,14 @@ cups_request_printer_list_cb (GtkPrintBackendCups *cups_backend,
+@@ -1709,32 +1731,14 @@ cups_request_printer_list_cb (GtkPrintBackendCups *cups_backend,
for (attr = response->attrs; attr != NULL; attr = attr->next)
{
GtkPrinter *printer;
@@ -69,15 +69,15 @@ index fab3f40..17f3ddc 100644
- gboolean is_accepting_jobs = TRUE;
- gboolean default_printer = FALSE;
- gboolean got_printer_type = FALSE;
-- const gchar *default_cover_before = NULL;
-- const gchar *default_cover_after = NULL;
+- gchar *default_cover_before = NULL;
+- gchar *default_cover_after = NULL;
- gboolean remote_printer = FALSE;
- gchar **auth_info_required = NULL;
+ PrinterSetupInfo *info = g_slice_new0 (PrinterSetupInfo);
/* Skip leading attributes until we hit a printer...
*/
-@@ -1950,8 +1954,8 @@ cups_request_printer_list_cb (GtkPrintBackendCups *cups_backend,
+@@ -1871,8 +1875,8 @@ cups_request_printer_list_cb (GtkPrintBackendCups *cups_backend,
attr = attr->next;
}
@@ -88,7 +88,7 @@ index fab3f40..17f3ddc 100644
{
if (attr == NULL)
break;
-@@ -1959,19 +1963,19 @@ cups_request_printer_list_cb (GtkPrintBackendCups *cups_backend,
+@@ -1880,19 +1884,19 @@ cups_request_printer_list_cb (GtkPrintBackendCups *cups_backend,
continue;
}
@@ -113,7 +113,7 @@ index fab3f40..17f3ddc 100644
}
}
}
-@@ -1982,10 +1986,13 @@ cups_request_printer_list_cb (GtkPrintBackendCups *cups_backend,
+@@ -1903,10 +1907,13 @@ cups_request_printer_list_cb (GtkPrintBackendCups *cups_backend,
}
/* remove name from checklist if it was found */
@@ -130,7 +130,7 @@ index fab3f40..17f3ddc 100644
if (!printer)
{
GtkPrinterCups *cups_printer;
-@@ -2083,10 +2090,10 @@ cups_request_printer_list_cb (GtkPrintBackendCups *cups_backend,
+@@ -2003,10 +2007,10 @@ cups_request_printer_list_cb (GtkPrintBackendCups *cups_backend,
else
g_object_ref (printer);
@@ -144,7 +144,7 @@ index fab3f40..17f3ddc 100644
if (!gtk_printer_is_active (printer))
{
-@@ -2109,57 +2116,60 @@ cups_request_printer_list_cb (GtkPrintBackendCups *cups_backend,
+@@ -2031,57 +2035,60 @@ cups_request_printer_list_cb (GtkPrintBackendCups *cups_backend,
cups_request_printer_info (cups_backend, gtk_printer_get_name (printer));
#endif
@@ -226,7 +226,7 @@ index fab3f40..17f3ddc 100644
if (tmp_msg != NULL)
g_free (tmp_msg);
-@@ -2172,9 +2182,9 @@ cups_request_printer_list_cb (GtkPrintBackendCups *cups_backend,
+@@ -2093,9 +2103,9 @@ cups_request_printer_list_cb (GtkPrintBackendCups *cups_backend,
/* Set printer icon according to importance
(none, report, warning, error - report is omitted). */
@@ -238,7 +238,7 @@ index fab3f40..17f3ddc 100644
gtk_printer_set_icon_name (printer, "printer-warning");
else if (gtk_printer_is_paused (printer))
gtk_printer_set_icon_name (printer, "printer-paused");
-@@ -2187,7 +2197,8 @@ cups_request_printer_list_cb (GtkPrintBackendCups *cups_backend,
+@@ -2108,7 +2118,8 @@ cups_request_printer_list_cb (GtkPrintBackendCups *cups_backend,
/* The ref is held by GtkPrintBackend, in add_printer() */
g_object_unref (printer);
View
120 patches/0005-gtk3-Extract-function-cups_printer_handle_attribute.patch
@@ -1,17 +1,6 @@
-From f51d01d94b62e0e2567c9a8c56a327bd020389d5 Mon Sep 17 00:00:00 2001
-From: John Ralls <jralls@ceridwen.us>
-Date: Sun, 19 Feb 2012 13:28:42 -0800
-Subject: [PATCH 5/9] Extract function cups_printer_handle_attribute
-
----
- modules/printbackends/cups/gtkprintbackendcups.c | 252 +++++++++++-----------
- 1 files changed, 130 insertions(+), 122 deletions(-)
-
-diff --git a/modules/printbackends/cups/gtkprintbackendcups.c b/modules/printbackends/cups/gtkprintbackendcups.c
-index 17f3ddc..d57974e 100644
---- a/modules/printbackends/cups/gtkprintbackendcups.c
-+++ b/modules/printbackends/cups/gtkprintbackendcups.c
-@@ -1758,6 +1758,135 @@ typedef struct
+--- a/modules/printbackends/cups/gtkprintbackendcups.c 2012-04-20 14:44:01.000000000 -0700
++++ b/modules/printbackends/cups/gtkprintbackendcups.c 2012-04-20 15:07:10.000000000 -0700
+@@ -1679,6 +1679,135 @@
gboolean remote_printer;
gchar **auth_info_required;
} PrinterSetupInfo;
@@ -147,42 +136,42 @@ index 17f3ddc..d57974e 100644
static void
cups_request_printer_list_cb (GtkPrintBackendCups *cups_backend,
GtkCupsResult *result,
-@@ -1829,128 +1958,7 @@ cups_request_printer_list_cb (GtkPrintBackendCups *cups_backend,
+@@ -1750,128 +1879,7 @@
- while (attr != NULL && ippGetGroupTag (attr) == IPP_TAG_PRINTER)
+ while (attr != NULL && attr->group_tag == IPP_TAG_PRINTER)
{
-- if (strcmp (ippGetName (attr), "printer-name") == 0 &&
-- ippGetValueTag (attr) == IPP_TAG_NAME)
-- printer_name = ippGetString (attr, 0, NULL);
-- else if (strcmp (ippGetName (attr), "printer-uri-supported") == 0 &&
-- ippGetValueTag (attr) == IPP_TAG_URI)
-- printer_uri = ippGetString (attr, 0, NULL);
-- else if (strcmp (ippGetName (attr), "member-uris") == 0 &&
-- ippGetValueTag (attr) == IPP_TAG_URI)
-- member_uris = ippGetString (attr, 0, NULL);
-- else if (strcmp (ippGetName (attr), "printer-location") == 0)
-- location = ippGetString (attr, 0, NULL);
-- else if (strcmp (ippGetName (attr), "printer-info") == 0)
-- description = ippGetString (attr, 0, NULL);
-- else if (strcmp (ippGetName (attr), "printer-state-message") == 0)
-- state_msg = ippGetString (attr, 0, NULL);
-- else if (strcmp (ippGetName (attr), "printer-state-reasons") == 0)
+- if (strcmp (attr->name, "printer-name") == 0 &&
+- attr->value_tag == IPP_TAG_NAME)
+- printer_name = attr->values[0].string.text;
+- else if (strcmp (attr->name, "printer-uri-supported") == 0 &&
+- attr->value_tag == IPP_TAG_URI)
+- printer_uri = attr->values[0].string.text;
+- else if (strcmp (attr->name, "member-uris") == 0 &&
+- attr->value_tag == IPP_TAG_URI)
+- member_uris = attr->values[0].string.text;
+- else if (strcmp (attr->name, "printer-location") == 0)
+- location = attr->values[0].string.text;
+- else if (strcmp (attr->name, "printer-info") == 0)
+- description = attr->values[0].string.text;
+- else if (strcmp (attr->name, "printer-state-message") == 0)
+- state_msg = attr->values[0].string.text;
+- else if (strcmp (attr->name, "printer-state-reasons") == 0)
- /* Store most important reason to reason_msg and set
- its importance at printer_state_reason_level */
- {
-- for (i = 0; i < ippGetCount (attr); i++)
+- for (i = 0; i < attr->num_values; i++)
- {
-- if (strcmp (ippGetString (attr, i, NULL), "none") != 0)
+- if (strcmp (attr->values[i].string.text, "none") != 0)
- {
- /* Sets is_paused flag for paused printer. */
-- if (strcmp (ippGetString (attr, i, NULL), "paused") == 0)
+- if (strcmp (attr->values[i].string.text, "paused") == 0)
- {
- is_paused = TRUE;
- }
-
- interested_in = FALSE;
- for (j = 0; j < G_N_ELEMENTS (reasons); j++)
-- if (strncmp (ippGetString (attr, i, NULL), reasons[j], strlen (reasons[j])) == 0)
+- if (strncmp (attr->values[i].string.text, reasons[j], strlen (reasons[j])) == 0)
- {
- interested_in = TRUE;
- break;
@@ -190,93 +179,90 @@ index 17f3ddc..d57974e 100644
-
- if (interested_in)
- {
-- if (g_str_has_suffix (ippGetString (attr, i, NULL), "-report"))
+- if (g_str_has_suffix (attr->values[i].string.text, "-report"))
- {
- if (printer_state_reason_level <= 1)
- {
-- reason_msg = ippGetString (attr, i, NULL);
+- reason_msg = attr->values[i].string.text;
- printer_state_reason_level = 1;
- }
- }
-- else if (g_str_has_suffix (ippGetString (attr, i, NULL), "-warning"))
+- else if (g_str_has_suffix (attr->values[i].string.text, "-warning"))
- {
- if (printer_state_reason_level <= 2)
- {
-- reason_msg = ippGetString (attr, i, NULL);
+- reason_msg = attr->values[i].string.text;
- printer_state_reason_level = 2;
-- }
+- }
- }
- else /* It is error in the case of no suffix. */
- {
-- reason_msg = ippGetString (attr, i, NULL);
+- reason_msg = attr->values[i].string.text;
- printer_state_reason_level = 3;
- }
- }
- }
- }
- }
-- else if (strcmp (ippGetName (attr), "printer-state") == 0)
-- state = ippGetInteger (attr, 0);
-- else if (strcmp (ippGetName (attr), "queued-job-count") == 0)
-- job_count = ippGetInteger (attr, 0);
-- else if (strcmp (ippGetName (attr), "printer-is-accepting-jobs") == 0)
+- else if (strcmp (attr->name, "printer-state") == 0)
+- state = attr->values[0].integer;
+- else if (strcmp (attr->name, "queued-job-count") == 0)
+- job_count = attr->values[0].integer;
+- else if (strcmp (attr->name, "printer-is-accepting-jobs") == 0)
- {
-- if (ippGetBoolean (attr, 0) == 1)
+- if (attr->values[0].boolean == 1)
- is_accepting_jobs = TRUE;
- else
- is_accepting_jobs = FALSE;
- }
-- else if (strcmp (ippGetName (attr), "job-sheets-supported") == 0)
+- else if (strcmp (attr->name, "job-sheets-supported") == 0)
- {
- if (cups_backend->covers == NULL)
- {
-- cups_backend->number_of_covers = ippGetCount (attr);
+- cups_backend->number_of_covers = attr->num_values;
- cups_backend->covers = g_new (char *, cups_backend->number_of_covers + 1);
- for (i = 0; i < cups_backend->number_of_covers; i++)
-- cups_backend->covers[i] = g_strdup (ippGetString (attr, i, NULL));
+- cups_backend->covers[i] = g_strdup (attr->values[i].string.text);
- cups_backend->covers[cups_backend->number_of_covers] = NULL;
- }
- }
-- else if (strcmp (ippGetName (attr), "job-sheets-default") == 0)
+- else if (strcmp (attr->name, "job-sheets-default") == 0)
- {
-- if (ippGetCount (attr) == 2)
+- if (attr->num_values == 2)
- {
-- default_cover_before = ippGetString (attr, 0, NULL);
-- default_cover_after = ippGetString (attr, 1, NULL);
+- default_cover_before = attr->values[0].string.text;
+- default_cover_after = attr->values[1].string.text;
- }
- }
-- else if (strcmp (ippGetName (attr), "printer-type") == 0)
+- else if (strcmp (attr->name, "printer-type") == 0)
- {
- got_printer_type = TRUE;
-- if (ippGetInteger (attr, 0) & 0x00020000)
+- if (attr->values[0].integer & 0x00020000)
- default_printer = TRUE;
- else
- default_printer = FALSE;
-
-- if (ippGetInteger (attr, 0) & 0x00000002)
+- if (attr->values[0].integer & 0x00000002)
- remote_printer = TRUE;
- else
- remote_printer = FALSE;
- }
-- else if (strcmp (ippGetName (attr), "auth-info-required") == 0)
+- else if (strcmp (attr->name, "auth-info-required") == 0)
- {
-- if (strcmp (ippGetString (attr, 0, NULL), "none") != 0)
+- if (strcmp (attr->values[0].string.text, "none") != 0)
- {
-- auth_info_required = g_new0 (gchar *, ippGetCount (attr) + 1);
-- for (i = 0; i < ippGetCount (attr); i++)
-- auth_info_required[i] = g_strdup (ippGetString (attr, i, NULL));
+- auth_info_required = g_new0 (gchar *, attr->num_values + 1);
+- for (i = 0; i < attr->num_values; i++)
+- auth_info_required[i] = g_strdup (attr->values[i].string.text);
- }
- }
- else
- {
- GTK_NOTE (PRINTING,
-- g_print ("CUPS Backend: Attribute %s ignored", ippGetName (attr)));
+- g_print ("CUPS Backend: Attribute %s ignored", attr->name));
- }
-
+ cups_printer_handle_attribute (cups_backend, attr, info);
attr = attr->next;
}
---
-1.7.7.5 (Apple Git-28)
-
View
6 patches/0006-gtk3-Extract-Function-cups_create_printer.patch
@@ -11,7 +11,7 @@ diff --git a/modules/printbackends/cups/gtkprintbackendcups.c b/modules/printbac
index d57974e..6055b36 100644
--- a/modules/printbackends/cups/gtkprintbackendcups.c
+++ b/modules/printbackends/cups/gtkprintbackendcups.c
-@@ -1887,6 +1887,108 @@ cups_printer_handle_attribute (GtkPrintBackendCups *cups_backend,
+@@ -1808,6 +1808,108 @@ cups_printer_handle_attribute (GtkPrintBackendCups *cups_backend,
}
}
@@ -120,7 +120,7 @@ index d57974e..6055b36 100644
static void
cups_request_printer_list_cb (GtkPrintBackendCups *cups_backend,
GtkCupsResult *result,
-@@ -1941,7 +2043,7 @@ cups_request_printer_list_cb (GtkPrintBackendCups *cups_backend,
+@@ -1872,7 +1964,7 @@ cups_request_printer_list_cb (GtkPrintBackendCups *cups_backend,
GtkPrinter *printer;
gboolean status_changed = FALSE;
GList *node;
@@ -129,7 +129,7 @@ index d57974e..6055b36 100644
gchar *reason_msg_desc = NULL;
gchar *tmp_msg = NULL;
gchar *tmp_msg2 = NULL;
-@@ -2002,99 +2104,10 @@ cups_request_printer_list_cb (GtkPrintBackendCups *cups_backend,
+@@ -1923,99 +2025,10 @@ cups_request_printer_list_cb (GtkPrintBackendCups *cups_backend,
printer = gtk_print_backend_find_printer (backend, info->printer_name);
if (!printer)
View
6 patches/0007-gtk3-Move-some-variable-declarations-into-the-scopes-in-w.patch
@@ -12,7 +12,7 @@ diff --git a/modules/printbackends/cups/gtkprintbackendcups.c b/modules/printbac
index 6055b36..5d99dc0 100644
--- a/modules/printbackends/cups/gtkprintbackendcups.c
+++ b/modules/printbackends/cups/gtkprintbackendcups.c
-@@ -2044,12 +2044,8 @@ cups_request_printer_list_cb (GtkPrintBackendCups *cups_backend,
+@@ -1965,12 +1965,8 @@ cups_request_printer_list_cb (GtkPrintBackendCups *cups_backend,
gboolean status_changed = FALSE;
GList *node;
gint i;
@@ -26,7 +26,7 @@ index 6055b36..5d99dc0 100644
/* Skip leading attributes until we hit a printer...
*/
while (attr != NULL && ippGetGroupTag (attr) != IPP_TAG_PRINTER)
-@@ -2145,23 +2141,30 @@ cups_request_printer_list_cb (GtkPrintBackendCups *cups_backend,
+@@ -2065,23 +2062,30 @@ cups_request_printer_list_cb (GtkPrintBackendCups *cups_backend,
if (info->state_msg != NULL && strlen (info->state_msg) == 0)
{
@@ -63,7 +63,7 @@ index 6055b36..5d99dc0 100644
for (i = 0; i < G_N_ELEMENTS (printer_messages); i++)
{
if (strncmp (info->reason_msg, printer_messages[i],
-@@ -2183,23 +2186,21 @@ cups_request_printer_list_cb (GtkPrintBackendCups *cups_backend,
+@@ -2104,23 +2107,21 @@ cups_request_printer_list_cb (GtkPrintBackendCups *cups_backend,
info->state_msg = reason_msg_desc;
else
{
View
34 patches/0008-Bug-670373-gtk3-modules-printing-cups-gtkprintbackendcups.patch
@@ -1,19 +1,6 @@
-From aef6a55641986bdb574db57b536b2c71975c3c16 Mon Sep 17 00:00:00 2001
-From: John Ralls <jralls@ceridwen.us>
-Date: Sun, 19 Feb 2012 13:48:19 -0800
-Subject: [PATCH 8/9] [Bug 670373] modules/printing/cups/gtkprintbackendcups.c
- won't build with CUPS 1.6
-
-Having refactored cups_request_printer_list_cb so that the cups version-dependent block size is small enough to be handled in a single ifdef, make the ifdef HAVE_CUPS_API_1_6 block.
----
- modules/printbackends/cups/gtkprintbackendcups.c | 24 +++++++++++++++++++++-
- 1 files changed, 23 insertions(+), 1 deletions(-)
-
-diff --git a/modules/printbackends/cups/gtkprintbackendcups.c b/modules/printbackends/cups/gtkprintbackendcups.c
-index 5d99dc0..b56f85c 100644
---- a/modules/printbackends/cups/gtkprintbackendcups.c
-+++ b/modules/printbackends/cups/gtkprintbackendcups.c
-@@ -2037,7 +2037,29 @@ cups_request_printer_list_cb (GtkPrintBackendCups *cups_backend,
+--- a/modules/printbackends/cups/gtkprintbackendcups.c 2012-04-20 15:18:59.000000000 -0700
++++ b/modules/printbackends/cups/gtkprintbackendcups.c 2012-04-20 15:20:00.000000000 -0700
+@@ -1958,7 +1958,29 @@
removed_printer_checklist = gtk_print_backend_get_printer_list (backend);
response = gtk_cups_result_get_response (result);
@@ -43,13 +30,15 @@ index 5d99dc0..b56f85c 100644
for (attr = response->attrs; attr != NULL; attr = attr->next)
{
GtkPrinter *printer;
-@@ -2053,12 +2075,12 @@ cups_request_printer_list_cb (GtkPrintBackendCups *cups_backend,
-
+@@ -1971,7 +1993,6 @@
+ */
+ while (attr != NULL && attr->group_tag != IPP_TAG_PRINTER)
+ attr = attr->next;
+-
if (attr == NULL)
break;
--
- while (attr != NULL && ippGetGroupTag (attr) == IPP_TAG_PRINTER)
- {
+
+@@ -1980,6 +2001,7 @@
cups_printer_handle_attribute (cups_backend, attr, info);
attr = attr->next;
}
@@ -57,6 +46,3 @@ index 5d99dc0..b56f85c 100644
if (info->printer_name == NULL ||
(info->printer_uri == NULL && info->member_uris == NULL))
---
-1.7.7.5 (Apple Git-28)
-
Please sign in to comment.
Something went wrong with that request. Please try again.