Renaming TransportAddOn.[cpp|h] into PrintTransportAddOn.[cpp|h] as "Transport" is
not enough explicit. git-svn-id: file:///srv/svn/repos/haiku/trunk/current@3772 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
894c59e0a9
commit
73a06d9625
10
headers/private/print/PrintTransportAddOn.h
Normal file
10
headers/private/print/PrintTransportAddOn.h
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
#ifndef PRINT_TRANSPORT_ADD_ON_H
|
||||||
|
#define PRINT_TRANSPORT_ADD_ON_H
|
||||||
|
|
||||||
|
#include <DataIO.h>
|
||||||
|
#include <Directory.h>
|
||||||
|
#include <Message.h>
|
||||||
|
|
||||||
|
extern "C" BDataIO* instanciate_transport(BDirectory* printe, BMessage* msg);
|
||||||
|
|
||||||
|
#endif PRINT_TRANSPORT_ADD_ON_H
|
24
src/add-ons/print/shared/PrintTransportAddOn.cpp
Normal file
24
src/add-ons/print/shared/PrintTransportAddOn.cpp
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
#include "PrintTransportAddOn.h"
|
||||||
|
|
||||||
|
static BDataIO* gTransport = NULL;
|
||||||
|
|
||||||
|
extern "C" _EXPORT BDataIO *init_transport(BMessage *msg) {
|
||||||
|
if (msg != NULL && gTransport == NULL) {
|
||||||
|
const char* printer_name = msg->FindString("printer_name");
|
||||||
|
if (printer_name && *printer_name != '\0') {
|
||||||
|
BDirectory printer(printer_name);
|
||||||
|
if (printer.InitCheck() == B_OK) {
|
||||||
|
gTransport = instanciate_transport(&printer, msg);
|
||||||
|
return gTransport;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
extern "C" _EXPORT void exit_transport() {
|
||||||
|
if (gTransport) {
|
||||||
|
delete gTransport; gTransport = NULL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
x
Reference in New Issue
Block a user