comparison win/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 091ed7c20b3f
children 052f01522c53
comparison
equal deleted inserted replaced
1151:641aa6941b2a 1152:58b5374355ab
10033 } DWPrint; 10033 } DWPrint;
10034 10034
10035 /* 10035 /*
10036 * Creates a new print object. 10036 * Creates a new print object.
10037 * Parameters: 10037 * Parameters:
10038 * jobname: Name of the print job to show in the queue.
10038 * flags: Flags to initially configure the print object. 10039 * flags: Flags to initially configure the print object.
10039 * pages: Number of pages to print. 10040 * pages: Number of pages to print.
10040 * drawfunc: The pointer to the function to be used as the callback. 10041 * drawfunc: The pointer to the function to be used as the callback.
10041 * drawdata: User data to be passed to the handler function. 10042 * drawdata: User data to be passed to the handler function.
10042 * Returns: 10043 * Returns:
10043 * A handle to the print object or NULL on failure. 10044 * A handle to the print object or NULL on failure.
10044 */ 10045 */
10045 HPRINT API dw_print_new(unsigned long flags, unsigned int pages, void *drawfunc, void *drawdata) 10046 HPRINT API dw_print_new(char *jobname, unsigned long flags, unsigned int pages, void *drawfunc, void *drawdata)
10046 { 10047 {
10047 DWPrint *print; 10048 DWPrint *print;
10048 10049
10049 if(!drawfunc || !(print = calloc(1, sizeof(DWPrint)))) 10050 if(!drawfunc || !(print = calloc(1, sizeof(DWPrint))))
10050 return NULL; 10051 return NULL;
10065 free(print); 10066 free(print);
10066 return NULL; 10067 return NULL;
10067 } 10068 }
10068 10069
10069 print->di.cbSize = sizeof(DOCINFO); 10070 print->di.cbSize = sizeof(DOCINFO);
10070 print->di.lpszDocName = "Dynamic Windows Print Job"; 10071 print->di.lpszDocName = jobname ? jobname : "Dynamic Windows Print Job";
10071 return print; 10072 return print;
10072 } 10073 }
10073 10074
10074 /* 10075 /*
10075 * Runs the print job, causing the draw page callbacks to fire. 10076 * Runs the print job, causing the draw page callbacks to fire.