xref: /haiku/src/add-ons/print/drivers/preview/PreviewDriver.cpp (revision 1c0897012494b4ae4255f28bbfc48fa5f21f390f)
1 /*
2  * Copyright 2003-2008, Haiku. All rights reserved.
3  * Distributed under the terms of the MIT License.
4  *
5  * Authors:
6  *		Michael Pfeiffer
7  */
8 
9 #include "PreviewDriver.h"
10 #include "Preview.h"
11 
12 
13 #define PREVIEW_DRIVER_DEBUG 0
14 
15 
PreviewDriver(BNode * spoolDir)16 PreviewDriver::PreviewDriver(BNode* spoolDir)
17 	: PrinterDriver(spoolDir)
18 {
19 };
20 
21 
~PreviewDriver()22 PreviewDriver::~PreviewDriver()
23 {
24 }
25 
26 
27 status_t
PrintJob(BFile * jobFile,BMessage * jobMsg)28 PreviewDriver::PrintJob(BFile *jobFile, BMessage *jobMsg)
29 {
30 #if PREVIEW_DRIVER_DEBUG
31 	return PrinterDriver::PrintJob(jobFile, jobMsg);
32 #else
33 	PreviewWindow* w = new PreviewWindow(jobFile);
34 	return w->Go();
35 #endif
36 }
37 
38 
39 PrinterDriver*
instanciate_driver(BNode * spoolDir)40 instanciate_driver(BNode *spoolDir)
41 {
42 	return new PreviewDriver(spoolDir);
43 }
44