vfs: check userland buffers before reading them.
[haiku.git] / src / add-ons / print / drivers / gutenprint / GPPrinterDriver.cpp
blob7d237cacc3dd3e4da79ad28bc09cb6ee3a8544ec
1 /*
2 * GPEntry.cpp
3 * Copyright 1999-2000 Y.Takagi. All Rights Reserved.
4 * Copyright 2010 Michael Pfeiffer.
5 */
8 #include <Debug.h>
10 #include "GPDriver.h"
11 #include "GPCapabilities.h"
12 #include "GPData.h"
13 #include "PrinterDriver.h"
14 #include "SelectPrinterDialog.h"
17 class GPPrinterDriver : public PrinterDriver
19 public:
20 GPPrinterDriver(BNode* printerFolder)
22 PrinterDriver(printerFolder)
26 const char* GetSignature() const
28 return "application/x-vnd.gutenprint";
31 const char* GetDriverName() const
33 return "Gutenprint";
36 const char* GetVersion() const
38 return "1.0";
41 const char* GetCopyright() const
43 return "Gutenprint driver "
44 "Copyright © 2010 Michael Pfeiffer.\n";
47 char* AddPrinter(char *printerName)
49 GPData* data = dynamic_cast<GPData*>(GetPrinterData());
50 ASSERT(data != NULL);
52 SelectPrinterDialog* dialog =
53 new SelectPrinterDialog(data);
55 if (dialog->Go() != B_OK)
56 return NULL;
58 return printerName;
61 PrinterData* InstantiatePrinterData(BNode* node)
63 return new GPData(node);
66 PrinterCap* InstantiatePrinterCap(PrinterData* printerData)
68 return new GPCapabilities(printerData);
71 GraphicsDriver* InstantiateGraphicsDriver(BMessage* settings,
72 PrinterData* printerData, PrinterCap* printerCap)
74 return new GPDriver(settings, printerData, printerCap);
79 PrinterDriver* instantiate_printer_driver(BNode* printerFolder)
81 return new GPPrinterDriver(printerFolder);