290
293
consumer=output.GetConsumer();
292
298
stp_set_outfunc(stpvars, writefunc);
293
299
stp_set_outdata(stpvars, consumer);
295
cerr << "Done - merging vars" << endl;
297
301
stp_vars_t *tmpvars=stp_vars_create_copy(stpvars);
298
302
const stp_vars_t *current_vars = stp_printer_get_defaults(stp_get_printer(stpvars));
299
303
stp_merge_printvars(tmpvars, current_vars);
301
cerr << "Done - commencing print" << endl;
303
305
writeerror=false;
327
329
// Deal with borderless mode by adding the bleed area to the media size
328
330
// and reducing the negative margins to zero.
332
// Obsolete hack - but shouldn't cause problems now borderless is working
333
// properly in Gutenprint - so leave it for now:
330
334
// The bottom bleed is excessively large on the R300 - presumably because
331
335
// the driver just increases the form length to work around the lack of
332
336
// a true bleed option.
336
340
void GPrinter::GetImageableArea()
338
stp_get_media_size(stpvars, &pagewidth, &pageheight);
342
// pagewidth=pageheight=0;
343
// stp_get_media_size(stpvars, &pagewidth, &pageheight);
345
// cerr << "Media size returned: " << pagewidth << " by " << pageheight << endl;
347
const char *papersize=stp_get_string_parameter(stpvars,"PageSize");
350
const stp_papersize_t *paper=stp_get_papersize_by_name(papersize);
355
pagewidth=minwidth=maxwidth=paper->width;
356
stp_set_page_width(stpvars,pagewidth);
357
cerr << "Width: " << pagewidth << endl;
362
stp_get_size_limit(stpvars,&mw,&mh,&nw,&nh);
365
cerr << "Custom width..." << endl;
369
pageheight=minheight=maxheight=paper->height;
370
stp_set_page_height(stpvars,pageheight);
371
cerr << "Height: " << pageheight << endl;
376
stp_get_size_limit(stpvars,&mw,&mh,&nw,&nh);
379
cerr << "Custom height..." << endl;
385
pagewidth=pageheight=0;
386
stp_get_media_size(stpvars, &pagewidth, &pageheight);
341
390
stp_get_imageable_area(stpvars, &l, &r, &b, &t);
392
cerr << "Imageable area from GP: L: " << l << ", R: " << r << ", T: " << t << ", B: " << b << endl;
343
394
leftbleed=rightbleed=topbleed=bottombleed=0;
383
434
cerr << "Right bleed: " << rightbleed << endl;
384
435
cerr << "Top bleed: " << topbleed << endl;
385
436
cerr << "Bottom bleed: " << bottombleed << endl;
439
// There seems to be a problem with GutenPrint's setlocale() calls.
440
cerr << "After reading papersize and margins: " << setlocale(LC_ALL,"") << endl;
444
void GPrinter::GetSizeLimits(int &minw,int &maxw,int &minh,int &maxh)
453
void GPrinter::SetCustomWidth(int w)
455
stp_set_page_width(stpvars,w);
460
void GPrinter::SetCustomHeight(int h)
462
stp_set_page_height(stpvars,h);
389
467
GPrinter::GPrinter(PrintOutput &output,ConfigFile *ini,const char *section)
390
468
: GPrinterSettings(output,ini,section), source(NULL), firstrow(0), firstpixel(0), progress(NULL)
392
cerr << "GPrinter initialised" << endl;
393
470
stpImage.rep=this;