Commit be8f3c72 authored by Matthias Clasen's avatar Matthias Clasen Committed by Matthias Clasen

Apply a patch by John Palmieri to use buffered io using GIOChannels, clean

2006-06-21  Matthias Clasen  <mclasen@redhat.com>

	Apply a patch by John Palmieri to use buffered io using
	GIOChannels, clean up error handling and support Cups 1.2
	api in the printing code.

	* acconfig.h:
	* configure.in: Detect Cups 1.2

	* gtk/gtkdebug.h:
	* gtk/gtkmain.c: Add a printing debug key.

	* gtk/gtkprintbackend.[hc]: Remove the GError parameter from
	gtk_print_backend_print_stream, and take a  GIOChannel instead
	of an fd.

	* gtk/gtkprinter-private.h:
	* gtk/gtkprinter.c: Replace the fd parameter of
	_gtk_printer_create_cairo_surface by a GIOChannel.

	* gtk/gtkprintjob.[hc]: Remove the GError parameter from
	gtk_print_job_send and make it return void.

	* gtk/gtkprintoperation-unix.c:
	* gtk/gtkprintjob.c: Adjust callers, add some debugging support.

	* modules/printbackends/Makefile.am: Fix DIST_SUBDIRS.

	* modules/printbackends/cups/Makefile.am:
	* modules/printbackends/lpr/Makefile.am: Add debug CFLAGS.

	* modules/printbackends/cups/gtkcupsutils.[hc]:
	* modules/printbackends/cups/gtkprintbackendcups.c:
	* modules/printbackends/file/gtkprintbackendfile.c:
	* modules/printbackends/lpr/gtkprintbackendfile.c: Adapt to
	the GIOChannel and GError changes, add debug output
parent a4290e70
2006-06-21 Matthias Clasen <mclasen@redhat.com>
Apply a patch by John Palmieri to use buffered io using
GIOChannels, clean up error handling and support Cups 1.2
api in the printing code.
* acconfig.h:
* configure.in: Detect Cups 1.2
* gtk/gtkdebug.h:
* gtk/gtkmain.c: Add a printing debug key.
* gtk/gtkprintbackend.[hc]: Remove the GError parameter from
gtk_print_backend_print_stream, and take a GIOChannel instead
of an fd.
* gtk/gtkprinter-private.h:
* gtk/gtkprinter.c: Replace the fd parameter of
_gtk_printer_create_cairo_surface by a GIOChannel.
* gtk/gtkprintjob.[hc]: Remove the GError parameter from
gtk_print_job_send and make it return void.
* gtk/gtkprintoperation-unix.c:
* gtk/gtkprintjob.c: Adjust callers, add some debugging support.
* modules/printbackends/Makefile.am: Fix DIST_SUBDIRS.
* modules/printbackends/cups/Makefile.am:
* modules/printbackends/lpr/Makefile.am: Add debug CFLAGS.
* modules/printbackends/cups/gtkcupsutils.[hc]:
* modules/printbackends/cups/gtkprintbackendcups.c:
* modules/printbackends/file/gtkprintbackendfile.c:
* modules/printbackends/lpr/gtkprintbackendfile.c: Adapt to
the GIOChannel and GError changes, add debug output
2006-06-21 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkprinter.c (gtk_enumerate_printers): Remove an
......
2006-06-21 Matthias Clasen <mclasen@redhat.com>
Apply a patch by John Palmieri to use buffered io using
GIOChannels, clean up error handling and support Cups 1.2
api in the printing code.
* acconfig.h:
* configure.in: Detect Cups 1.2
* gtk/gtkdebug.h:
* gtk/gtkmain.c: Add a printing debug key.
* gtk/gtkprintbackend.[hc]: Remove the GError parameter from
gtk_print_backend_print_stream, and take a GIOChannel instead
of an fd.
* gtk/gtkprinter-private.h:
* gtk/gtkprinter.c: Replace the fd parameter of
_gtk_printer_create_cairo_surface by a GIOChannel.
* gtk/gtkprintjob.[hc]: Remove the GError parameter from
gtk_print_job_send and make it return void.
* gtk/gtkprintoperation-unix.c:
* gtk/gtkprintjob.c: Adjust callers, add some debugging support.
* modules/printbackends/Makefile.am: Fix DIST_SUBDIRS.
* modules/printbackends/cups/Makefile.am:
* modules/printbackends/lpr/Makefile.am: Add debug CFLAGS.
* modules/printbackends/cups/gtkcupsutils.[hc]:
* modules/printbackends/cups/gtkprintbackendcups.c:
* modules/printbackends/file/gtkprintbackendfile.c:
* modules/printbackends/lpr/gtkprintbackendfile.c: Adapt to
the GIOChannel and GError changes, add debug output
2006-06-21 Matthias Clasen <mclasen@redhat.com>
* gtk/gtkprinter.c (gtk_enumerate_printers): Remove an
......
......@@ -68,6 +68,8 @@
#undef GETTEXT_PACKAGE
#undef HAVE_CUPS_API_1_2
/* #undef PACKAGE */
/* #undef VERSION */
......
......@@ -1544,6 +1544,17 @@ if test "x$CUPS_CONFIG" != "xno"; then
CUPS_CFLAGS=`cups-config --cflags | sed 's/-O[0-9]*//' | sed 's/-m[^\t]*//g'`
CUPS_LIBS=`cups-config --libs`
CUPS_API_VERSION=`cups-config --api-version`
CUPS_API_MAJOR=`echo -n $CUPS_API_VERSION | awk -F. '{print $1}'`
CUPS_API_MINOR=`echo -n $CUPS_API_VERSION | awk -F. '{print $2}'`
if test $CUPS_API_MAJOR -gt 1 -o \
$CUPS_API_MAJOR -eq 1 -a $CUPS_API_MINOR -ge 2; then
AC_DEFINE(HAVE_CUPS_API_1_2)
fi
AC_SUBST(CUPS_API_MAJOR)
AC_SUBST(CUPS_API_MINOR)
AC_SUBST(CUPS_CFLAGS)
AC_SUBST(CUPS_LIBS)
fi
......
......@@ -41,7 +41,8 @@ typedef enum {
GTK_DEBUG_MULTIHEAD = 1 << 6,
GTK_DEBUG_MODULES = 1 << 7,
GTK_DEBUG_GEOMETRY = 1 << 8,
GTK_DEBUG_ICONTHEME = 1 << 9
GTK_DEBUG_ICONTHEME = 1 << 9,
GTK_DEBUG_PRINTING = 1 << 10
} GtkDebugFlag;
#ifdef G_ENABLE_DEBUG
......
......@@ -159,7 +159,8 @@ static const GDebugKey gtk_debug_keys[] = {
{"multihead", GTK_DEBUG_MULTIHEAD},
{"modules", GTK_DEBUG_MODULES},
{"geometry", GTK_DEBUG_GEOMETRY},
{"icontheme", GTK_DEBUG_ICONTHEME}
{"icontheme", GTK_DEBUG_ICONTHEME},
{"printing", GTK_DEBUG_PRINTING}
};
#endif /* G_ENABLE_DEBUG */
......
......@@ -576,21 +576,19 @@ gtk_print_backend_find_printer (GtkPrintBackend *backend,
void
gtk_print_backend_print_stream (GtkPrintBackend *backend,
GtkPrintJob *job,
gint data_fd,
GIOChannel *data_io,
GtkPrintJobCompleteFunc callback,
gpointer user_data,
GDestroyNotify dnotify,
GError **error)
GDestroyNotify dnotify)
{
g_return_if_fail (GTK_IS_PRINT_BACKEND (backend));
GTK_PRINT_BACKEND_GET_CLASS (backend)->print_stream (backend,
job,
data_fd,
data_io,
callback,
user_data,
dnotify,
error);
dnotify);
}
void
......
......@@ -73,11 +73,10 @@ struct _GtkPrintBackendClass
void (*request_printer_list) (GtkPrintBackend *backend);
void (*print_stream) (GtkPrintBackend *backend,
GtkPrintJob *job,
gint data_fd,
GIOChannel *data_io,
GtkPrintJobCompleteFunc callback,
gpointer user_data,
GDestroyNotify dnotify,
GError **error);
GDestroyNotify dnotify);
/* Printer methods: */
void (*printer_request_details) (GtkPrinter *printer);
......@@ -85,7 +84,7 @@ struct _GtkPrintBackendClass
GtkPrintSettings *settings,
gdouble height,
gdouble width,
gint cache_fd);
GIOChannel *cache_io);
GtkPrinterOptionSet * (*printer_get_options) (GtkPrinter *printer,
GtkPrintSettings *settings,
GtkPageSetup *page_setup,
......@@ -135,11 +134,10 @@ GtkPrinter *gtk_print_backend_find_printer (GtkPrintBackend *pri
const gchar *printer_name);
void gtk_print_backend_print_stream (GtkPrintBackend *print_backend,
GtkPrintJob *job,
gint data_fd,
GIOChannel *data_io,
GtkPrintJobCompleteFunc callback,
gpointer user_data,
GDestroyNotify dnotify,
GError **error);
GDestroyNotify dnotify);
GList * gtk_print_backend_load_modules (void);
void gtk_print_backend_destroy (GtkPrintBackend *print_backend);
......
......@@ -48,7 +48,7 @@ cairo_surface_t * _gtk_printer_create_cairo_surface (GtkPrinter
GtkPrintSettings *settings,
gdouble width,
gdouble height,
gint cache_fd);
GIOChannel *cache_io);
GList * _gtk_printer_list_papers (GtkPrinter *printer);
void _gtk_printer_get_hard_margins (GtkPrinter *printer,
gdouble *top,
......
......@@ -754,12 +754,12 @@ _gtk_printer_create_cairo_surface (GtkPrinter *printer,
GtkPrintSettings *settings,
gdouble width,
gdouble height,
gint cache_fd)
GIOChannel *cache_io)
{
GtkPrintBackendClass *backend_class = GTK_PRINT_BACKEND_GET_CLASS (printer->priv->backend);
return backend_class->printer_create_cairo_surface (printer, settings,
width, height, cache_fd);
width, height, cache_io);
}
GList *
......
......@@ -47,7 +47,7 @@ struct _GtkPrintJobPrivate
{
gchar *title;
gint spool_file_fd;
GIOChannel *spool_io;
cairo_surface_t *surface;
GtkPrintStatus status;
......@@ -183,7 +183,7 @@ gtk_print_job_init (GtkPrintJob *job)
priv = job->priv = GTK_PRINT_JOB_GET_PRIVATE (job);
priv->spool_file_fd = -1;
priv->spool_io = NULL;
priv->title = g_strdup ("");
priv->surface = NULL;
......@@ -244,10 +244,10 @@ gtk_print_job_finalize (GObject *object)
GtkPrintJob *job = GTK_PRINT_JOB (object);
GtkPrintJobPrivate *priv = job->priv;
if (priv->spool_file_fd >= 0)
if (priv->spool_io != NULL)
{
close (priv->spool_file_fd);
priv->spool_file_fd = -1;
g_io_channel_unref (priv->spool_io);
priv->spool_io = NULL;
}
if (priv->backend)
......@@ -414,29 +414,26 @@ gtk_print_job_set_source_file (GtkPrintJob *job,
GError **error)
{
GtkPrintJobPrivate *priv;
GError *tmp_error;
tmp_error = NULL;
g_return_val_if_fail (GTK_IS_PRINT_JOB (job), FALSE);
priv = job->priv;
priv->spool_file_fd = g_open (filename, O_RDONLY|O_BINARY);
if (priv->spool_file_fd < 0)
{
gchar *display_filename = g_filename_display_name (filename);
int save_errno = errno;
g_set_error (error,
G_FILE_ERROR,
g_file_error_from_errno (save_errno),
_("Failed to open file '%s': %s"),
display_filename,
g_strerror (save_errno));
g_free (display_filename);
priv->spool_io = g_io_channel_new_file (filename, "r", &tmp_error);
if (tmp_error == NULL)
g_io_channel_set_encoding (priv->spool_io, NULL, &tmp_error);
if (tmp_error != NULL)
{
g_propagate_error (error, tmp_error);
return FALSE;
}
return TRUE;
return TRUE;
}
/**
......@@ -459,7 +456,11 @@ gtk_print_job_get_surface (GtkPrintJob *job,
gchar *filename;
gdouble width, height;
GtkPaperSize *paper_size;
int fd;
GError *tmp_error;
tmp_error = NULL;
g_return_val_if_fail (GTK_IS_PRINT_JOB (job), NULL);
priv = job->priv;
......@@ -467,26 +468,46 @@ gtk_print_job_get_surface (GtkPrintJob *job,
if (priv->surface)
return priv->surface;
g_return_val_if_fail (priv->spool_file_fd == -1, NULL);
g_return_val_if_fail (priv->spool_io == NULL, NULL);
priv->spool_file_fd = g_file_open_tmp ("gtkprint_XXXXXX",
&filename,
error);
if (priv->spool_file_fd == -1)
return NULL;
fd = g_file_open_tmp ("gtkprint_XXXXXX",
&filename,
&tmp_error);
if (fd == -1)
{
g_propagate_error (error, tmp_error);
return NULL;
}
fchmod (priv->spool_file_fd, S_IRUSR | S_IWUSR);
fchmod (fd, S_IRUSR | S_IWUSR);
#ifdef G_ENABLE_DEBUG
/* If we are debugging printing don't delete the tmp files */
if (!(gtk_debug_flags & GTK_DEBUG_PRINTING))
#endif /* G_ENABLE_DEBUG */
unlink (filename);
paper_size = gtk_page_setup_get_paper_size (priv->page_setup);
width = gtk_paper_size_get_width (paper_size, GTK_UNIT_POINTS);
height = gtk_paper_size_get_height (paper_size, GTK_UNIT_POINTS);
priv->spool_io = g_io_channel_unix_new (fd);
g_io_channel_set_close_on_unref (priv->spool_io, TRUE);
g_io_channel_set_encoding (priv->spool_io, NULL, &tmp_error);
if (tmp_error != NULL)
{
g_io_channel_unref (priv->spool_io);
priv->spool_io = NULL;
g_propagate_error (error, tmp_error);
return NULL;
}
priv->surface = _gtk_printer_create_cairo_surface (priv->printer,
priv->settings,
width, height,
priv->spool_file_fd);
priv->spool_io);
return priv->surface;
}
......@@ -629,46 +650,34 @@ gtk_print_job_get_property (GObject *object,
/**
* gtk_print_job_send:
* @job: a GtkPrintJob
* @callback: function to call when the job completes
* @callback: function to call when the job completes or an error occures
* @user_data: user data that gets passed to @callback
* @dnotify: destroy notify for @user_data
* @error: return location for errors, or %NULL
*
* Sends the print job off to the printer.
*
* Return value: %FALSE if an error occurred
*
* Since: 2.10
**/
gboolean
void
gtk_print_job_send (GtkPrintJob *job,
GtkPrintJobCompleteFunc callback,
gpointer user_data,
GDestroyNotify dnotify,
GError **error)
GDestroyNotify dnotify)
{
GtkPrintJobPrivate *priv;
GError *print_error = NULL;
g_return_val_if_fail (GTK_IS_PRINT_JOB (job), FALSE);
g_return_if_fail (GTK_IS_PRINT_JOB (job));
priv = job->priv;
g_return_val_if_fail (priv->spool_file_fd > 0, FALSE);
g_return_if_fail (priv->spool_io != NULL);
gtk_print_job_set_status (job, GTK_PRINT_STATUS_SENDING_DATA);
lseek (priv->spool_file_fd, 0, SEEK_SET);
g_io_channel_seek_position (priv->spool_io, 0, G_SEEK_SET, NULL);
gtk_print_backend_print_stream (priv->backend, job,
priv->spool_file_fd,
callback, user_data, dnotify,
&print_error);
if (print_error)
{
g_propagate_error (error, print_error);
return FALSE;
}
return TRUE;
priv->spool_io,
callback, user_data, dnotify);
}
GType
......
......@@ -108,11 +108,10 @@ cairo_surface_t *gtk_print_job_get_surface (GtkPrintJob
void gtk_print_job_set_track_print_status (GtkPrintJob *job,
gboolean track_status);
gboolean gtk_print_job_get_track_print_status (GtkPrintJob *job);
gboolean gtk_print_job_send (GtkPrintJob *job,
void gtk_print_job_send (GtkPrintJob *job,
GtkPrintJobCompleteFunc callback,
gpointer user_data,
GDestroyNotify dnotify,
GError **error);
GDestroyNotify dnotify);
GType gtk_print_capabilities_get_type (void) G_GNUC_CONST;
......
......@@ -306,8 +306,7 @@ unix_end_run (GtkPrintOperation *op,
if (op_unix->job != NULL)
gtk_print_job_send (op_unix->job,
unix_finish_send,
op_unix, NULL,
NULL);
op_unix, NULL);
if (wait)
{
......
......@@ -4,4 +4,4 @@ if HAVE_CUPS
SUBDIRS += cups
endif
DIST_SUBDIRS=cups pdf lpr
DIST_SUBDIRS=cups file lpr
......@@ -10,7 +10,8 @@ INCLUDES = \
-I$(top_builddir)/gdk \
$(CUPS_CFLAGS) \
-DGTK_PRINT_BACKEND_ENABLE_UNSUPPORTED \
$(GTK_DEP_CFLAGS)
$(GTK_DEP_CFLAGS) \
$(GTK_DEBUG_FLAGS)
LDADDS = \
$(GTK_DEP_LIBS) \
......
......@@ -20,6 +20,8 @@
*/
#include "gtkcupsutils.h"
#include "config.h"
#include "gtkdebug.h"
#include <errno.h>
#include <unistd.h>
......@@ -86,7 +88,7 @@ GtkCupsRequest *
gtk_cups_request_new (http_t *connection,
GtkCupsRequestType req_type,
gint operation_id,
gint data_fd,
GIOChannel *data_io,
const char *server,
const char *resource)
{
......@@ -135,7 +137,7 @@ gtk_cups_request_new (http_t *connection,
request->last_status = HTTP_CONTINUE;
request->attempts = 0;
request->data_fd = data_fd;
request->data_io = data_io;
request->ipp_request = ippNew();
request->ipp_request->request.op.operation_id = operation_id;
......@@ -514,11 +516,14 @@ _post_send (GtkCupsRequest *request)
gchar length[255];
struct stat data_info;
GTK_NOTE (PRINTING,
g_print ("CUPS Backend: %s\n", G_STRFUNC));
request->poll_state = GTK_CUPS_HTTP_WRITE;
if (request->data_fd != 0)
if (request->data_io != NULL)
{
fstat (request->data_fd, &data_info);
fstat (g_io_channel_unix_get_fd (request->data_io), &data_info);
sprintf (length, "%lu", (unsigned long)ippLength(request->ipp_request) + data_info.st_size);
}
else
......@@ -556,6 +561,9 @@ _post_write_request (GtkCupsRequest *request)
{
ipp_state_t ipp_status;
GTK_NOTE (PRINTING,
g_print ("CUPS Backend: %s\n", G_STRFUNC));
request->poll_state = GTK_CUPS_HTTP_WRITE;
ipp_status = ippWrite(request->http, request->ipp_request);
......@@ -571,7 +579,7 @@ _post_write_request (GtkCupsRequest *request)
if (ipp_status == IPP_DATA)
{
if (request->data_fd != 0)
if (request->data_io != NULL)
request->state = GTK_CUPS_POST_WRITE_DATA;
else
{
......@@ -584,10 +592,13 @@ _post_write_request (GtkCupsRequest *request)
static void
_post_write_data (GtkCupsRequest *request)
{
ssize_t bytes;
gsize bytes;
char buffer[_GTK_CUPS_MAX_CHUNK_SIZE];
http_status_t http_status;
GTK_NOTE (PRINTING,
g_print ("CUPS Backend: %s\n", G_STRFUNC));
request->poll_state = GTK_CUPS_HTTP_WRITE;
if (httpCheck (request->http))
......@@ -600,10 +611,30 @@ _post_write_data (GtkCupsRequest *request)
if (http_status == HTTP_CONTINUE || http_status == HTTP_OK)
{
GIOStatus io_status;
GError *error;
error = NULL;
/* send data */
bytes = read(request->data_fd, buffer, _GTK_CUPS_MAX_CHUNK_SIZE);
io_status =
g_io_channel_read_chars (request->data_io,
buffer,
_GTK_CUPS_MAX_CHUNK_SIZE,
&bytes,
&error);
if (io_status == G_IO_STATUS_ERROR)
{
request->state = GTK_CUPS_POST_DONE;
request->poll_state = GTK_CUPS_HTTP_IDLE;
gtk_cups_result_set_error (request->result, "Error reading from cache file: %s", error->message);
if (bytes == 0)
g_error_free (error);
return;
}
else if (bytes == 0 && io_status == G_IO_STATUS_EOF)
{
request->state = GTK_CUPS_POST_CHECK;
request->poll_state = GTK_CUPS_HTTP_READ;
......@@ -611,16 +642,13 @@ _post_write_data (GtkCupsRequest *request)
request->attempts = 0;
return;
}
else if (bytes == -1)
{
request->state = GTK_CUPS_POST_DONE;
request->poll_state = GTK_CUPS_HTTP_IDLE;
gtk_cups_result_set_error (request->result, "Error reading from cache file: %s", strerror (errno));
return;
}
if (httpWrite(request->http, buffer, (int)bytes) < bytes)
#if HAVE_CUPS_API_1_2
if (httpWrite2(request->http, buffer, bytes) < bytes)
#else
if (httpWrite(request->http, buffer, (int) bytes) < bytes)
#endif /* HAVE_CUPS_API_1_2 */
{
request->state = GTK_CUPS_POST_DONE;
request->poll_state = GTK_CUPS_HTTP_IDLE;
......@@ -642,6 +670,9 @@ _post_check (GtkCupsRequest *request)
http_status = request->last_status;
GTK_NOTE (PRINTING,
g_print ("CUPS Backend: %s - status %i\n", G_STRFUNC, http_status));
request->poll_state = GTK_CUPS_HTTP_READ;
if (http_status == HTTP_CONTINUE)
......@@ -744,6 +775,9 @@ _post_read_response (GtkCupsRequest *request)
{
ipp_state_t ipp_status;
GTK_NOTE (PRINTING,
g_print ("CUPS Backend: %s\n", G_STRFUNC));
request->poll_state = GTK_CUPS_HTTP_READ;
if (request->result->ipp_response == NULL)
......@@ -772,11 +806,14 @@ _post_read_response (GtkCupsRequest *request)
static void
_get_send (GtkCupsRequest *request)
{
GTK_NOTE (PRINTING,
g_print ("CUPS Backend: %s\n", G_STRFUNC));
request->poll_state = GTK_CUPS_HTTP_WRITE;
if (request->data_fd == 0)
if (request->data_io == NULL)
{
gtk_cups_result_set_error (request->result, "Get requires an open file descriptor");
gtk_cups_result_set_error (request->result, "Get requires an open io channel");
request->state = GTK_CUPS_GET_DONE;
request->poll_state = GTK_CUPS_HTTP_IDLE;
......@@ -813,6 +850,9 @@ _get_check (GtkCupsRequest *request)
{
http_status_t http_status;
GTK_NOTE (PRINTING,
g_print ("CUPS Backend: %s\n", G_STRFUNC));
http_status = request->last_status;
request->poll_state = GTK_CUPS_HTTP_READ;
......@@ -894,12 +934,27 @@ static void
_get_read_data (GtkCupsRequest *request)
{
char buffer[_GTK_CUPS_MAX_CHUNK_SIZE];
int bytes;
gsize bytes;
gsize bytes_written;
GIOStatus io_status;
GError *error;
GTK_NOTE (PRINTING,
g_print ("CUPS Backend: %s\n", G_STRFUNC));
error = NULL;
request->poll_state = GTK_CUPS_HTTP_READ;
#if HAVE_CUPS_API_1_2
bytes = httpRead2(request->http, buffer, sizeof(buffer));
#else
bytes = httpRead(request->http, buffer, sizeof(buffer));
#endif /* HAVE_CUPS_API_1_2 */
GTK_NOTE (PRINTING,
g_print ("CUPS Backend: %i bytes read\n", bytes));
if (bytes == 0)
{
request->state = GTK_CUPS_GET_DONE;
......@@ -907,16 +962,21 @@ _get_read_data (GtkCupsRequest *request)
return;
}
if (write (request->data_fd, buffer, bytes) == -1)
{
char *error_msg;
io_status =
g_io_channel_write_chars (request->data_io,
buffer,
bytes,
&bytes_written,
&error);
if (io_status == G_IO_STATUS_ERROR)
{
request->state = GTK_CUPS_POST_DONE;
request->poll_state = GTK_CUPS_HTTP_IDLE;
error_msg = strerror (errno);
gtk_cups_result_set_error (request->result, error_msg ? error_msg:"");
gtk_cups_result_set_error (request->result, error->message);
g_error_free (error);
}
}
......
......@@ -61,7 +61,7 @@ struct _GtkCupsRequest
gchar *server;
gchar *resource;
gint data_fd;
GIOChannel *data_io;
gint attempts;
GtkCupsResult *result;
......@@ -100,7 +100,7 @@ enum
GtkCupsRequest * gtk_cups_request_new (http_t *connection,
GtkCupsRequestType req_type,
gint operation_id,
gint data_fd,
GIOChannel *data_io,
const char *server,
const char *resource);
void gtk_cups_request_ipp_add_string (GtkCupsRequest *request,
......
......@@ -47,7 +47,7 @@
#include "gtkprintercups.h"
#include "gtkcupsutils.h"
#include "gtkdebug.h"
typedef struct _GtkPrintBackendCupsClass GtkPrintBackendCupsClass;
......@@ -147,16 +147,15 @@ static void cups_begin_polling_info (GtkPrintBack
static gboolean cups_job_info_poll_timeout (gpointer user_data);
static void gtk_print_backend_cups_print_stream (GtkPrintBackend *backend,
GtkPrintJob *job,
gint data_fd,
GIOChannel *data_io,
GtkPrintJobCompleteFunc callback,
gpointer user_data,
GDestroyNotify dnotify,
GError **error);
GDestroyNotify dnotify);
static cairo_surface_t * cups_printer_create_cairo_surface (GtkPrinter *printer,
GtkPrintSettings *settings,
gdouble width,
gdouble height,
gint cache_fd);
GIOChannel *cache_io);