diff --git a/headers/private/print/PrintServerAddOn.h b/headers/private/print/PrintAddOnServer.h similarity index 89% rename from headers/private/print/PrintServerAddOn.h rename to headers/private/print/PrintAddOnServer.h index 343b7f534e..6caae4187b 100644 --- a/headers/private/print/PrintServerAddOn.h +++ b/headers/private/print/PrintAddOnServer.h @@ -5,8 +5,8 @@ * Authors: * Michael Pfeiffer */ -#ifndef PRINT_SERVER_ADD_ON_H -#define PRINT_SERVER_ADD_ON_H +#ifndef PRINT_ADD_ON_SERVER_H +#define PRINT_ADD_ON_SERVER_H #include @@ -18,11 +18,11 @@ #include -class PrintServerAddOn +class PrintAddOnServer { public: - PrintServerAddOn(const char* driver); - virtual ~PrintServerAddOn(); + PrintAddOnServer(const char* driver); + virtual ~PrintAddOnServer(); status_t AddPrinter(const char* spoolFolderName); status_t ConfigPage(BDirectory* spoolFolder, diff --git a/headers/private/print/PrintServerAddOnProtocol.h b/headers/private/print/PrintAddOnServerProtocol.h similarity index 77% rename from headers/private/print/PrintServerAddOnProtocol.h rename to headers/private/print/PrintAddOnServerProtocol.h index 72011a23dc..a957093f38 100644 --- a/headers/private/print/PrintServerAddOnProtocol.h +++ b/headers/private/print/PrintAddOnServerProtocol.h @@ -5,12 +5,12 @@ * Authors: * Michael Pfeiffer */ -#ifndef PRINT_SERVER_ADD_ON_PROTOCOL_H -#define PRINT_SERVER_ADD_ON_PROTOCOL_H +#ifndef PRINT_ADD_ON_SERVER_PROTOCOL_H +#define PRINT_ADD_ON_SERVER_PROTOCOL_H -extern const char* kPrintServerAddOnApplicationSignature; +extern const char* kPrintAddOnServerApplicationSignature; -extern const char* kPrintServerAddOnStatusAttribute; +extern const char* kPrintAddOnServerStatusAttribute; extern const char* kPrinterDriverAttribute; extern const char* kPrinterNameAttribute; extern const char* kPrinterFolderAttribute; @@ -25,7 +25,7 @@ enum { // BString kPrinterDriverAttribute // BString kPrinterNameAttribute // Reply: - // int32 kPrintServerAddOnStatusAttribute + // int32 kPrintAddOnServerStatusAttribute kMessageConfigPage = 'PScp', // Request: @@ -33,7 +33,7 @@ enum { // BString kPrinterFolderAttribute // BMessage kPrintSettingsAttribute // Reply: - // int32 kPrintServerAddOnStatusAttribute + // int32 kPrintAddOnServerStatusAttribute // BMessage kPrintSettingsAttribute (if status is B_OK) kMessageConfigJob = 'PScj', @@ -42,7 +42,7 @@ enum { // BString kPrinterFolderAttribute // BMessage kPrintSettingsAttribute // Reply: - // int32 kPrintServerAddOnStatusAttribute + // int32 kPrintAddOnServerStatusAttribute // BMessage kPrintSettingsAttribute (if status is B_OK) kMessageDefaultSettings = 'PSds', @@ -50,7 +50,7 @@ enum { // BString kPrinterDriverAttribute // BString kPrinterFolderAttribute // Reply: - // int32 kPrintServerAddOnStatusAttribute + // int32 kPrintAddOnServerStatusAttribute // BMessage kPrintSettingsAttribute (if status is B_OK) kMessageTakeJob = 'PStj', @@ -59,7 +59,7 @@ enum { // BString kPrintJobFileAttribute // BString kPrinterFolderAttribute // Reply: - // int32 kPrintServerAddOnStatusAttribute + // int32 kPrintAddOnServerStatusAttribute }; #endif diff --git a/src/kits/print/Jamfile b/src/kits/print/Jamfile index 3b76ad3e74..f23ce9a8d3 100644 --- a/src/kits/print/Jamfile +++ b/src/kits/print/Jamfile @@ -13,6 +13,6 @@ StaticLibrary libprintutils.a : PicturePrinter.cpp PrinterDriverAddOn.cpp PrintTransport.cpp - PrintServerAddOn.cpp - PrintServerAddOnProtocol.cpp + PrintAddOnServer.cpp + PrintAddOnServerProtocol.cpp ; diff --git a/src/kits/print/PrintServerAddOn.cpp b/src/kits/print/PrintAddOnServer.cpp similarity index 75% rename from src/kits/print/PrintServerAddOn.cpp rename to src/kits/print/PrintAddOnServer.cpp index 4a23eaf9fb..90436987b1 100644 --- a/src/kits/print/PrintServerAddOn.cpp +++ b/src/kits/print/PrintAddOnServer.cpp @@ -1,17 +1,17 @@ -#include "PrintServerAddOn.h" +#include "PrintAddOnServer.h" #include #include #include "PrinterDriverAddOn.h" -#include "PrintServerAddOnProtocol.h" +#include "PrintAddOnServerProtocol.h" static const bigtime_t kSeconds = 1000000L; static const bigtime_t kDeliveryTimeout = 30 * kSeconds; static const bigtime_t kReplyTimeout = B_INFINITE_TIMEOUT; -PrintServerAddOn::PrintServerAddOn(const char* driver) +PrintAddOnServer::PrintAddOnServer(const char* driver) : fDriver(driver) { @@ -19,7 +19,7 @@ PrintServerAddOn::PrintServerAddOn(const char* driver) } -PrintServerAddOn::~PrintServerAddOn() +PrintAddOnServer::~PrintAddOnServer() { if (fLaunchStatus == B_OK) Quit(); @@ -27,7 +27,7 @@ PrintServerAddOn::~PrintServerAddOn() status_t -PrintServerAddOn::AddPrinter(const char* spoolFolderName) +PrintAddOnServer::AddPrinter(const char* spoolFolderName) { BMessage message(kMessageAddPrinter); message.AddString(kPrinterDriverAttribute, Driver()); @@ -43,7 +43,7 @@ PrintServerAddOn::AddPrinter(const char* spoolFolderName) status_t -PrintServerAddOn::ConfigPage(BDirectory* spoolFolder, +PrintAddOnServer::ConfigPage(BDirectory* spoolFolder, BMessage* settings) { BMessage message(kMessageConfigPage); @@ -61,7 +61,7 @@ PrintServerAddOn::ConfigPage(BDirectory* spoolFolder, status_t -PrintServerAddOn::ConfigJob(BDirectory* spoolFolder, +PrintAddOnServer::ConfigJob(BDirectory* spoolFolder, BMessage* settings) { BMessage message(kMessageConfigJob); @@ -79,7 +79,7 @@ PrintServerAddOn::ConfigJob(BDirectory* spoolFolder, status_t -PrintServerAddOn::DefaultSettings(BDirectory* spoolFolder, +PrintAddOnServer::DefaultSettings(BDirectory* spoolFolder, BMessage* settings) { BMessage message(kMessageDefaultSettings); @@ -96,7 +96,7 @@ PrintServerAddOn::DefaultSettings(BDirectory* spoolFolder, status_t -PrintServerAddOn::TakeJob(const char* spoolFile, +PrintAddOnServer::TakeJob(const char* spoolFile, BDirectory* spoolFolder) { BMessage message(kMessageTakeJob); @@ -114,44 +114,44 @@ PrintServerAddOn::TakeJob(const char* spoolFile, status_t -PrintServerAddOn::FindPathToDriver(const char* driver, BPath* path) +PrintAddOnServer::FindPathToDriver(const char* driver, BPath* path) { return PrinterDriverAddOn::FindPathToDriver(driver, path); } const char* -PrintServerAddOn::Driver() const +PrintAddOnServer::Driver() const { return fDriver.String(); } status_t -PrintServerAddOn::Launch(BMessenger& messenger) +PrintAddOnServer::Launch(BMessenger& messenger) { team_id team; status_t result = - be_roster->Launch(kPrintServerAddOnApplicationSignature, + be_roster->Launch(kPrintAddOnServerApplicationSignature, (BMessage*)NULL, &team); if (result != B_OK) { return result; } - fMessenger = BMessenger(kPrintServerAddOnApplicationSignature, team); + fMessenger = BMessenger(kPrintAddOnServerApplicationSignature, team); return result; } bool -PrintServerAddOn::IsLaunched() +PrintAddOnServer::IsLaunched() { return fLaunchStatus == B_OK; } void -PrintServerAddOn::Quit() +PrintAddOnServer::Quit() { if (fLaunchStatus == B_OK) { fMessenger.SendMessage(B_QUIT_REQUESTED); @@ -161,7 +161,7 @@ PrintServerAddOn::Quit() void -PrintServerAddOn::AddDirectory(BMessage& message, const char* name, +PrintAddOnServer::AddDirectory(BMessage& message, const char* name, BDirectory* directory) { BEntry entry; @@ -178,7 +178,7 @@ PrintServerAddOn::AddDirectory(BMessage& message, const char* name, void -PrintServerAddOn::AddEntryRef(BMessage& message, const char* name, +PrintAddOnServer::AddEntryRef(BMessage& message, const char* name, const entry_ref* entryRef) { BPath path(entryRef); @@ -190,7 +190,7 @@ PrintServerAddOn::AddEntryRef(BMessage& message, const char* name, status_t -PrintServerAddOn::SendRequest(BMessage& request, BMessage& reply) +PrintAddOnServer::SendRequest(BMessage& request, BMessage& reply) { if (!IsLaunched()) return fLaunchStatus; @@ -201,10 +201,10 @@ PrintServerAddOn::SendRequest(BMessage& request, BMessage& reply) status_t -PrintServerAddOn::GetResult(BMessage& reply) +PrintAddOnServer::GetResult(BMessage& reply) { int32 status; - status_t result = reply.FindInt32(kPrintServerAddOnStatusAttribute, + status_t result = reply.FindInt32(kPrintAddOnServerStatusAttribute, &status); if (result != B_OK) return result; @@ -213,7 +213,7 @@ PrintServerAddOn::GetResult(BMessage& reply) status_t -PrintServerAddOn::GetResultAndUpdateSettings(BMessage& reply, BMessage* settings) +PrintAddOnServer::GetResultAndUpdateSettings(BMessage& reply, BMessage* settings) { BMessage newSettings; if (reply.FindMessage(kPrintSettingsAttribute, &newSettings) == B_OK) diff --git a/src/kits/print/PrintServerAddOnProtocol.cpp b/src/kits/print/PrintAddOnServerProtocol.cpp similarity index 65% rename from src/kits/print/PrintServerAddOnProtocol.cpp rename to src/kits/print/PrintAddOnServerProtocol.cpp index 0941ac1971..3f1b464955 100644 --- a/src/kits/print/PrintServerAddOnProtocol.cpp +++ b/src/kits/print/PrintAddOnServerProtocol.cpp @@ -1,9 +1,9 @@ -#include "PrintServerAddOnProtocol.h" +#include "PrintAddOnServerProtocol.h" -const char* kPrintServerAddOnApplicationSignature = +const char* kPrintAddOnServerApplicationSignature = "application/x-vnd.haiku-print-addon-server"; -const char* kPrintServerAddOnStatusAttribute = "status"; +const char* kPrintAddOnServerStatusAttribute = "status"; const char* kPrinterDriverAttribute = "driver"; const char* kPrinterNameAttribute = "name"; const char* kPrinterFolderAttribute = "folder"; diff --git a/src/servers/print/Printer.cpp b/src/servers/print/Printer.cpp index 9b79ffeeee..bf94c76618 100644 --- a/src/servers/print/Printer.cpp +++ b/src/servers/print/Printer.cpp @@ -10,7 +10,7 @@ #include "BeUtils.h" #include "pr_server.h" -#include "PrintServerAddOn.h" +#include "PrintAddOnServer.h" #include "PrintServerApp.h" // posix @@ -180,7 +180,7 @@ status_t Printer::Remove() status_t Printer::FindPathToDriver(const char* driverName, BPath* path) { - return PrintServerAddOn::FindPathToDriver(driverName, path); + return PrintAddOnServer::FindPathToDriver(driverName, path); } @@ -199,7 +199,7 @@ Printer::FindPathToDriver(const char* driverName, BPath* path) status_t Printer::ConfigurePrinter(const char* driverName, const char* printerName) { - PrintServerAddOn addOn(driverName); + PrintAddOnServer addOn(driverName); return addOn.AddPrinter(printerName); } @@ -225,7 +225,7 @@ Printer::ConfigurePage(BMessage& settings) if (result != B_OK) return result; - PrintServerAddOn addOn(driver.String()); + PrintAddOnServer addOn(driver.String()); result = addOn.ConfigPage(SpoolDir(), &settings); if (result == B_OK) { AddCurrentPrinter(settings); @@ -255,7 +255,7 @@ Printer::ConfigureJob(BMessage& settings) if (result != B_OK) return result; - PrintServerAddOn addOn(driver.String()); + PrintAddOnServer addOn(driver.String()); result = addOn.ConfigJob(SpoolDir(), &settings); if (result == B_OK) { AddCurrentPrinter(settings); @@ -299,7 +299,7 @@ Printer::GetDefaultSettings(BMessage& settings) if (result != B_OK) return result; - PrintServerAddOn addOn(driver.String()); + PrintAddOnServer addOn(driver.String()); result = addOn.DefaultSettings(SpoolDir(), &settings); if (result == B_OK) { AddCurrentPrinter(settings); @@ -485,7 +485,7 @@ Printer::PrintSpooledJob(const char* spoolFile) if (result != B_OK) return result; - PrintServerAddOn addOn(driver.String()); + PrintAddOnServer addOn(driver.String()); return addOn.TakeJob(spoolFile, SpoolDir()); } diff --git a/src/servers/print_addon/Jamfile b/src/servers/print_addon/Jamfile index fb2d5b9390..a8e50d762e 100644 --- a/src/servers/print_addon/Jamfile +++ b/src/servers/print_addon/Jamfile @@ -7,7 +7,7 @@ AddResources print_addon_server : ; Application print_addon_server : - PrintServerAddOnApplication.cpp + PrintAddOnServerApplication.cpp ; LinkAgainst print_addon_server : diff --git a/src/servers/print_addon/PrintServerAddOnApplication.cpp b/src/servers/print_addon/PrintAddOnServerApplication.cpp similarity index 78% rename from src/servers/print_addon/PrintServerAddOnApplication.cpp rename to src/servers/print_addon/PrintAddOnServerApplication.cpp index 80cfd4dd5c..580fb18118 100644 --- a/src/servers/print_addon/PrintServerAddOnApplication.cpp +++ b/src/servers/print_addon/PrintAddOnServerApplication.cpp @@ -5,13 +5,13 @@ * Authors: * Michael Pfeiffer */ -#include "PrintServerAddOnApplication.h" +#include "PrintAddOnServerApplication.h" #include #include -PrintServerAddOnApplication::PrintServerAddOnApplication(const char* signature) +PrintAddOnServerApplication::PrintAddOnServerApplication(const char* signature) : BApplication(signature) { @@ -20,7 +20,7 @@ PrintServerAddOnApplication::PrintServerAddOnApplication(const char* signature) void -PrintServerAddOnApplication::MessageReceived(BMessage* message) +PrintAddOnServerApplication::MessageReceived(BMessage* message) { switch (message->what) { case kMessageAddPrinter: @@ -50,7 +50,7 @@ PrintServerAddOnApplication::MessageReceived(BMessage* message) void -PrintServerAddOnApplication::AddPrinter(BMessage* message) +PrintAddOnServerApplication::AddPrinter(BMessage* message) { BString driver; BString name; @@ -66,7 +66,7 @@ PrintServerAddOnApplication::AddPrinter(BMessage* message) status_t -PrintServerAddOnApplication::AddPrinter(const char* driver, +PrintAddOnServerApplication::AddPrinter(const char* driver, const char* spoolFolderName) { PrinterDriverAddOn addOn(driver); @@ -75,7 +75,7 @@ PrintServerAddOnApplication::AddPrinter(const char* driver, void -PrintServerAddOnApplication::ConfigPage(BMessage* message) +PrintAddOnServerApplication::ConfigPage(BMessage* message) { BString driver; BString folder; @@ -101,7 +101,7 @@ PrintServerAddOnApplication::ConfigPage(BMessage* message) status_t -PrintServerAddOnApplication::ConfigPage(const char* driver, +PrintAddOnServerApplication::ConfigPage(const char* driver, BDirectory* spoolFolder, BMessage* settings) { PrinterDriverAddOn addOn(driver); @@ -110,7 +110,7 @@ PrintServerAddOnApplication::ConfigPage(const char* driver, void -PrintServerAddOnApplication::ConfigJob(BMessage* message) +PrintAddOnServerApplication::ConfigJob(BMessage* message) { BString driver; BString folder; @@ -136,7 +136,7 @@ PrintServerAddOnApplication::ConfigJob(BMessage* message) status_t -PrintServerAddOnApplication::ConfigJob(const char* driver, +PrintAddOnServerApplication::ConfigJob(const char* driver, BDirectory* spoolFolder, BMessage* settings) { @@ -146,7 +146,7 @@ PrintServerAddOnApplication::ConfigJob(const char* driver, void -PrintServerAddOnApplication::DefaultSettings(BMessage* message) +PrintAddOnServerApplication::DefaultSettings(BMessage* message) { BString driver; BString folder; @@ -171,7 +171,7 @@ PrintServerAddOnApplication::DefaultSettings(BMessage* message) status_t -PrintServerAddOnApplication::DefaultSettings(const char* driver, +PrintAddOnServerApplication::DefaultSettings(const char* driver, BDirectory* spoolFolder, BMessage* settings) { PrinterDriverAddOn addOn(driver); @@ -180,7 +180,7 @@ PrintServerAddOnApplication::DefaultSettings(const char* driver, void -PrintServerAddOnApplication::TakeJob(BMessage* message) +PrintAddOnServerApplication::TakeJob(BMessage* message) { BString driver; BString folder; @@ -200,7 +200,7 @@ PrintServerAddOnApplication::TakeJob(BMessage* message) status_t -PrintServerAddOnApplication::TakeJob(const char* driver, const char* spoolFile, +PrintAddOnServerApplication::TakeJob(const char* driver, const char* spoolFile, BDirectory* spoolFolder) { PrinterDriverAddOn addOn(driver); @@ -209,18 +209,18 @@ PrintServerAddOnApplication::TakeJob(const char* driver, const char* spoolFile, void -PrintServerAddOnApplication::SendReply(BMessage* message, status_t status) +PrintAddOnServerApplication::SendReply(BMessage* message, status_t status) { BMessage reply(B_REPLY); - reply.AddInt32(kPrintServerAddOnStatusAttribute, status); + reply.AddInt32(kPrintAddOnServerStatusAttribute, status); message->SendReply(&reply); } void -PrintServerAddOnApplication::SendReply(BMessage* message, BMessage* reply) +PrintAddOnServerApplication::SendReply(BMessage* message, BMessage* reply) { - reply->AddInt32(kPrintServerAddOnStatusAttribute, B_OK); + reply->AddInt32(kPrintAddOnServerStatusAttribute, B_OK); message->SendReply(reply); } @@ -228,7 +228,7 @@ PrintServerAddOnApplication::SendReply(BMessage* message, BMessage* reply) int main(int argc, char* argv[]) { - PrintServerAddOnApplication application( - kPrintServerAddOnApplicationSignature); + PrintAddOnServerApplication application( + kPrintAddOnServerApplicationSignature); application.Run(); } diff --git a/src/servers/print_addon/PrintServerAddOnApplication.h b/src/servers/print_addon/PrintAddOnServerApplication.h similarity index 84% rename from src/servers/print_addon/PrintServerAddOnApplication.h rename to src/servers/print_addon/PrintAddOnServerApplication.h index 7a4ec3a997..ac51e4f0f8 100644 --- a/src/servers/print_addon/PrintServerAddOnApplication.h +++ b/src/servers/print_addon/PrintAddOnServerApplication.h @@ -5,8 +5,8 @@ * Authors: * Michael Pfeiffer */ -#ifndef PRINT_SERVER_ADD_ON_H -#define PRINT_SERVER_ADD_ON_H +#ifndef PRINT_ADD_ON_SERVER_H +#define PRINT_ADD_ON_SERVER_H #include #include @@ -14,13 +14,13 @@ #include #include -#include +#include -class PrintServerAddOnApplication : public BApplication +class PrintAddOnServerApplication : public BApplication { public: - PrintServerAddOnApplication(const char* signature); + PrintAddOnServerApplication(const char* signature); void MessageReceived(BMessage* message); private: