Renamed class members to fit our style guidelines
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@16449 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -97,23 +97,23 @@ virtual void _ReservedPrintJob4();
|
|||||||
char* GetCurrentPrinterName() const;
|
char* GetCurrentPrinterName() const;
|
||||||
void LoadDefaultSettings();
|
void LoadDefaultSettings();
|
||||||
|
|
||||||
char * print_job_name;
|
char * fPrintJobName;
|
||||||
int32 page_number;
|
int32 fPageNumber;
|
||||||
BFile * spoolFile;
|
BFile * fSpoolFile;
|
||||||
print_file_header current_header;
|
print_file_header fCurrentHeader;
|
||||||
BRect paper_size;
|
BRect fPaperSize;
|
||||||
BRect usable_size;
|
BRect fUsableSize;
|
||||||
int pr_error;
|
status_t fError;
|
||||||
char spool_file_name[256];
|
char fSpoolFileName[256];
|
||||||
BMessage *setup_msg;
|
BMessage *fSetupMessage;
|
||||||
BMessage *default_setup_msg;
|
BMessage *fDefaultSetupMessage;
|
||||||
char stop_the_show;
|
char fAbort;
|
||||||
int32 first_page;
|
int32 fFirstPage;
|
||||||
int32 last_page;
|
int32 fLastPage;
|
||||||
short v_xres;
|
short fXResolution;
|
||||||
short v_yres;
|
short fYResolution;
|
||||||
_page_header_ * m_curPageHeader;
|
_page_header_ * fCurrentPageHeader;
|
||||||
off_t m_curPageHeaderOffset;
|
off_t fCurrentPageHeaderOffset;
|
||||||
uint32 _reserved[2];
|
uint32 _reserved[2];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -44,23 +44,23 @@ EnsureValidMessenger()
|
|||||||
|
|
||||||
BPrintJob::BPrintJob(const char *job_name)
|
BPrintJob::BPrintJob(const char *job_name)
|
||||||
:
|
:
|
||||||
print_job_name(NULL),
|
fPrintJobName(NULL),
|
||||||
page_number(0),
|
fPageNumber(0),
|
||||||
spoolFile(NULL),
|
fSpoolFile(NULL),
|
||||||
pr_error(B_OK),
|
fError(B_OK),
|
||||||
setup_msg(NULL),
|
fSetupMessage(NULL),
|
||||||
default_setup_msg(NULL),
|
fDefaultSetupMessage(NULL),
|
||||||
m_curPageHeader(NULL)
|
fCurrentPageHeader(NULL)
|
||||||
{
|
{
|
||||||
memset(¤t_header, 0, sizeof(current_header));
|
memset(&fCurrentHeader, 0, sizeof(fCurrentHeader));
|
||||||
if (job_name != NULL)
|
if (job_name != NULL)
|
||||||
print_job_name = strdup(job_name);
|
fPrintJobName = strdup(job_name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
BPrintJob::~BPrintJob()
|
BPrintJob::~BPrintJob()
|
||||||
{
|
{
|
||||||
free(print_job_name);
|
free(fPrintJobName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -91,11 +91,11 @@ BPrintJob::BeginJob()
|
|||||||
if (path.InitCheck() < B_OK)
|
if (path.InitCheck() < B_OK)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
stop_the_show = 0;
|
fAbort = 0;
|
||||||
page_number = 0;
|
fPageNumber = 0;
|
||||||
|
|
||||||
strncpy(spool_file_name, path.Path(), sizeof(spool_file_name));
|
strncpy(fSpoolFileName, path.Path(), sizeof(fSpoolFileName));
|
||||||
spoolFile = new BFile(spool_file_name, B_READ_WRITE|B_CREATE_FILE);
|
fSpoolFile = new BFile(fSpoolFileName, B_READ_WRITE|B_CREATE_FILE);
|
||||||
|
|
||||||
AddSetupSpec();
|
AddSetupSpec();
|
||||||
}
|
}
|
||||||
@@ -104,7 +104,7 @@ BPrintJob::BeginJob()
|
|||||||
void
|
void
|
||||||
BPrintJob::CommitJob()
|
BPrintJob::CommitJob()
|
||||||
{
|
{
|
||||||
if (page_number <= 0) {
|
if (fPageNumber <= 0) {
|
||||||
BAlert *alert = new BAlert("Alert", "No Pages to print!", "Okay");
|
BAlert *alert = new BAlert("Alert", "No Pages to print!", "Okay");
|
||||||
alert->Go();
|
alert->Go();
|
||||||
CancelJob();
|
CancelJob();
|
||||||
@@ -132,17 +132,17 @@ BPrintJob::CommitJob()
|
|||||||
app_info appInfo;
|
app_info appInfo;
|
||||||
be_app->GetAppInfo(&appInfo);
|
be_app->GetAppInfo(&appInfo);
|
||||||
|
|
||||||
spoolFile->WriteAttr("_spool/Page Count", B_INT32_TYPE, 0, &page_number, sizeof(int32));
|
fSpoolFile->WriteAttr("_spool/Page Count", B_INT32_TYPE, 0, &fPageNumber, sizeof(int32));
|
||||||
spoolFile->WriteAttr("_spool/Description", B_STRING_TYPE, 0, print_job_name, strlen(print_job_name) + 1);
|
fSpoolFile->WriteAttr("_spool/Description", B_STRING_TYPE, 0, fPrintJobName, strlen(fPrintJobName) + 1);
|
||||||
spoolFile->WriteAttr("_spool/Printer", B_STRING_TYPE, 0, printerName, strlen(printerName) + 1);
|
fSpoolFile->WriteAttr("_spool/Printer", B_STRING_TYPE, 0, printerName, strlen(printerName) + 1);
|
||||||
spoolFile->WriteAttr("_spool/Status", B_STRING_TYPE, 0, "waiting", strlen("waiting") + 1);
|
fSpoolFile->WriteAttr("_spool/Status", B_STRING_TYPE, 0, "waiting", strlen("waiting") + 1);
|
||||||
spoolFile->WriteAttr("_spool/MimeType", B_STRING_TYPE, 0, appInfo.signature, strlen(appInfo.signature) + 1);
|
fSpoolFile->WriteAttr("_spool/MimeType", B_STRING_TYPE, 0, appInfo.signature, strlen(appInfo.signature) + 1);
|
||||||
|
|
||||||
message = new BMessage(PSRV_PRINT_SPOOLED_JOB);
|
message = new BMessage(PSRV_PRINT_SPOOLED_JOB);
|
||||||
reply = new BMessage;
|
reply = new BMessage;
|
||||||
|
|
||||||
message->AddString("JobName", print_job_name);
|
message->AddString("JobName", fPrintJobName);
|
||||||
message->AddString("Spool File", spool_file_name);
|
message->AddString("Spool File", fSpoolFileName);
|
||||||
sPrintServer->SendMessage(message, reply);
|
sPrintServer->SendMessage(message, reply);
|
||||||
|
|
||||||
delete message;
|
delete message;
|
||||||
@@ -161,9 +161,9 @@ BPrintJob::ConfigJob()
|
|||||||
void
|
void
|
||||||
BPrintJob::CancelJob()
|
BPrintJob::CancelJob()
|
||||||
{
|
{
|
||||||
stop_the_show = 1;
|
fAbort = 1;
|
||||||
BEntry(spool_file_name).Remove();
|
BEntry(fSpoolFileName).Remove();
|
||||||
delete spoolFile;
|
delete fSpoolFile;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -185,7 +185,7 @@ bool
|
|||||||
BPrintJob::CanContinue()
|
BPrintJob::CanContinue()
|
||||||
{
|
{
|
||||||
// Check if our local error storage is still B_OK
|
// Check if our local error storage is still B_OK
|
||||||
return pr_error == B_OK && !stop_the_show;
|
return fError == B_OK && !fAbort;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -212,8 +212,8 @@ BPrintJob::Settings()
|
|||||||
{
|
{
|
||||||
BMessage *message = NULL;
|
BMessage *message = NULL;
|
||||||
|
|
||||||
if (setup_msg != NULL)
|
if (fSetupMessage != NULL)
|
||||||
message = new BMessage(*setup_msg);
|
message = new BMessage(*fSetupMessage);
|
||||||
|
|
||||||
return message;
|
return message;
|
||||||
}
|
}
|
||||||
@@ -225,8 +225,8 @@ BPrintJob::SetSettings(BMessage *message)
|
|||||||
if (message != NULL) {
|
if (message != NULL) {
|
||||||
HandlePageSetup(message);
|
HandlePageSetup(message);
|
||||||
HandlePrintSetup(message);
|
HandlePrintSetup(message);
|
||||||
delete setup_msg;
|
delete fSetupMessage;
|
||||||
setup_msg = message;
|
fSetupMessage = message;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -254,20 +254,20 @@ BPrintJob::IsSettingsMessageValid(BMessage *message) const
|
|||||||
BRect
|
BRect
|
||||||
BPrintJob::PaperRect()
|
BPrintJob::PaperRect()
|
||||||
{
|
{
|
||||||
if (default_setup_msg == NULL)
|
if (fDefaultSetupMessage == NULL)
|
||||||
LoadDefaultSettings();
|
LoadDefaultSettings();
|
||||||
|
|
||||||
return paper_size;
|
return fPaperSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
BRect
|
BRect
|
||||||
BPrintJob::PrintableRect()
|
BPrintJob::PrintableRect()
|
||||||
{
|
{
|
||||||
if (default_setup_msg == NULL)
|
if (fDefaultSetupMessage == NULL)
|
||||||
LoadDefaultSettings();
|
LoadDefaultSettings();
|
||||||
|
|
||||||
return usable_size;
|
return fUsableSize;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -278,12 +278,12 @@ BPrintJob::GetResolution(int32 *xdpi, int32 *ydpi)
|
|||||||
|
|
||||||
const BMessage *message = NULL;
|
const BMessage *message = NULL;
|
||||||
|
|
||||||
if (setup_msg != NULL)
|
if (fSetupMessage != NULL)
|
||||||
message = setup_msg;
|
message = fSetupMessage;
|
||||||
else {
|
else {
|
||||||
if (default_setup_msg == NULL)
|
if (fDefaultSetupMessage == NULL)
|
||||||
LoadDefaultSettings();
|
LoadDefaultSettings();
|
||||||
message = default_setup_msg;
|
message = fDefaultSetupMessage;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (message != NULL) {
|
if (message != NULL) {
|
||||||
@@ -303,14 +303,14 @@ BPrintJob::GetResolution(int32 *xdpi, int32 *ydpi)
|
|||||||
int32
|
int32
|
||||||
BPrintJob::FirstPage()
|
BPrintJob::FirstPage()
|
||||||
{
|
{
|
||||||
return first_page;
|
return fFirstPage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
int32
|
int32
|
||||||
BPrintJob::LastPage()
|
BPrintJob::LastPage()
|
||||||
{
|
{
|
||||||
return last_page;
|
return fLastPage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -359,7 +359,7 @@ BPrintJob::MangleName(char *filename)
|
|||||||
{
|
{
|
||||||
char sysTime[10];
|
char sysTime[10];
|
||||||
snprintf(sysTime, sizeof(sysTime), "@%lld", system_time() / 1000);
|
snprintf(sysTime, sizeof(sysTime), "@%lld", system_time() / 1000);
|
||||||
strncpy(filename, print_job_name, B_FILE_NAME_LENGTH - sizeof(sysTime));
|
strncpy(filename, fPrintJobName, B_FILE_NAME_LENGTH - sizeof(sysTime));
|
||||||
strcat(filename, sysTime);
|
strcat(filename, sysTime);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -374,13 +374,13 @@ bool
|
|||||||
BPrintJob::HandlePrintSetup(BMessage *message)
|
BPrintJob::HandlePrintSetup(BMessage *message)
|
||||||
{
|
{
|
||||||
if (message->HasRect(PSRV_FIELD_PRINTABLE_RECT))
|
if (message->HasRect(PSRV_FIELD_PRINTABLE_RECT))
|
||||||
message->FindRect(PSRV_FIELD_PRINTABLE_RECT, &usable_size);
|
message->FindRect(PSRV_FIELD_PRINTABLE_RECT, &fUsableSize);
|
||||||
if (message->HasRect(PSRV_FIELD_PAPER_RECT))
|
if (message->HasRect(PSRV_FIELD_PAPER_RECT))
|
||||||
message->FindRect(PSRV_FIELD_PAPER_RECT, &paper_size);
|
message->FindRect(PSRV_FIELD_PAPER_RECT, &fPaperSize);
|
||||||
if (message->HasInt32(PSRV_FIELD_FIRST_PAGE))
|
if (message->HasInt32(PSRV_FIELD_FIRST_PAGE))
|
||||||
message->FindInt32(PSRV_FIELD_FIRST_PAGE, &first_page);
|
message->FindInt32(PSRV_FIELD_FIRST_PAGE, &fFirstPage);
|
||||||
if (message->HasInt32(PSRV_FIELD_LAST_PAGE))
|
if (message->HasInt32(PSRV_FIELD_LAST_PAGE))
|
||||||
message->FindInt32(PSRV_FIELD_LAST_PAGE, &last_page);
|
message->FindInt32(PSRV_FIELD_LAST_PAGE, &fLastPage);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -392,7 +392,7 @@ BPrintJob::NewPage()
|
|||||||
// TODO: this function could be removed, and its functionality moved
|
// TODO: this function could be removed, and its functionality moved
|
||||||
// to SpoolPage()
|
// to SpoolPage()
|
||||||
// TODO: Implement for real
|
// TODO: Implement for real
|
||||||
page_number++;
|
fPageNumber++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -405,8 +405,8 @@ BPrintJob::EndLastPage()
|
|||||||
void
|
void
|
||||||
BPrintJob::AddSetupSpec()
|
BPrintJob::AddSetupSpec()
|
||||||
{
|
{
|
||||||
if (setup_msg != NULL && spoolFile != NULL)
|
if (fSetupMessage != NULL && fSpoolFile != NULL)
|
||||||
setup_msg->Flatten(spoolFile);
|
fSetupMessage->Flatten(fSpoolFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -414,12 +414,12 @@ void
|
|||||||
BPrintJob::AddPicture(BPicture *picture, BRect *rect, BPoint where)
|
BPrintJob::AddPicture(BPicture *picture, BRect *rect, BPoint where)
|
||||||
{
|
{
|
||||||
ASSERT(picture != NULL);
|
ASSERT(picture != NULL);
|
||||||
ASSERT(spoolFile != NULL);
|
ASSERT(fSpoolFile != NULL);
|
||||||
ASSERT(rect != NULL);
|
ASSERT(rect != NULL);
|
||||||
|
|
||||||
spoolFile->Write(&where, sizeof(where));
|
fSpoolFile->Write(&where, sizeof(where));
|
||||||
spoolFile->Write(rect, sizeof(*rect));
|
fSpoolFile->Write(rect, sizeof(*rect));
|
||||||
picture->Flatten(spoolFile);
|
picture->Flatten(fSpoolFile);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -454,12 +454,12 @@ BPrintJob::LoadDefaultSettings()
|
|||||||
sPrintServer->SendMessage(&message, reply);
|
sPrintServer->SendMessage(&message, reply);
|
||||||
|
|
||||||
if (reply->HasRect(PSRV_FIELD_PAPER_RECT))
|
if (reply->HasRect(PSRV_FIELD_PAPER_RECT))
|
||||||
reply->FindRect(PSRV_FIELD_PAPER_RECT, &paper_size);
|
reply->FindRect(PSRV_FIELD_PAPER_RECT, &fPaperSize);
|
||||||
if (reply->HasRect(PSRV_FIELD_PRINTABLE_RECT))
|
if (reply->HasRect(PSRV_FIELD_PRINTABLE_RECT))
|
||||||
reply->FindRect(PSRV_FIELD_PRINTABLE_RECT, &usable_size);
|
reply->FindRect(PSRV_FIELD_PRINTABLE_RECT, &fUsableSize);
|
||||||
|
|
||||||
delete default_setup_msg;
|
delete fDefaultSetupMessage;
|
||||||
default_setup_msg = reply;
|
fDefaultSetupMessage = reply;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user