comparison gtk3/dw.c @ 1152:58b5374355ab

Added print jobname parameter to dw_print_new(). If parameter is NULL a dummy name will be used.
author bsmith@81767d24-ef19-dc11-ae90-00e081727c95
date Mon, 12 Sep 2011 19:26:49 +0000
parents cf934fd39d03
children e6a2f57c0842
comparison
equal deleted inserted replaced
1151:641aa6941b2a 1152:58b5374355ab
10246 } 10246 }
10247 10247
10248 /* 10248 /*
10249 * Creates a new print object. 10249 * Creates a new print object.
10250 * Parameters: 10250 * Parameters:
10251 * jobname: Name of the print job to show in the queue.
10251 * flags: Flags to initially configure the print object. 10252 * flags: Flags to initially configure the print object.
10252 * pages: Number of pages to print. 10253 * pages: Number of pages to print.
10253 * drawfunc: The pointer to the function to be used as the callback. 10254 * drawfunc: The pointer to the function to be used as the callback.
10254 * drawdata: User data to be passed to the handler function. 10255 * drawdata: User data to be passed to the handler function.
10255 * Returns: 10256 * Returns:
10256 * A handle to the print object or NULL on failure. 10257 * A handle to the print object or NULL on failure.
10257 */ 10258 */
10258 HPRINT API dw_print_new(unsigned long flags, unsigned int pages, void *drawfunc, void *drawdata) 10259 HPRINT API dw_print_new(char *jobname, unsigned long flags, unsigned int pages, void *drawfunc, void *drawdata)
10259 { 10260 {
10260 GtkPrintOperation *op; 10261 GtkPrintOperation *op;
10261 int _locked_by_me = FALSE; 10262 int _locked_by_me = FALSE;
10262 10263
10263 if(!drawfunc) 10264 if(!drawfunc)
10265 10266
10266 DW_MUTEX_LOCK; 10267 DW_MUTEX_LOCK;
10267 if((op = gtk_print_operation_new())) 10268 if((op = gtk_print_operation_new()))
10268 { 10269 {
10269 gtk_print_operation_set_n_pages(op, pages); 10270 gtk_print_operation_set_n_pages(op, pages);
10271 gtk_print_operation_set_job_name(op, jobname ? jobname : "Dynamic Windows Print Job");
10270 g_object_set_data(G_OBJECT(op), "_dw_drawfunc", drawfunc); 10272 g_object_set_data(G_OBJECT(op), "_dw_drawfunc", drawfunc);
10271 g_object_set_data(G_OBJECT(op), "_dw_drawdata", drawdata); 10273 g_object_set_data(G_OBJECT(op), "_dw_drawdata", drawdata);
10272 g_signal_connect(op, "draw_page", G_CALLBACK(_dw_draw_page), NULL); 10274 g_signal_connect(op, "draw_page", G_CALLBACK(_dw_draw_page), NULL);
10273 } 10275 }
10274 DW_MUTEX_UNLOCK; 10276 DW_MUTEX_UNLOCK;