* build fix, removed leftover debug var...
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@24533 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
parent
96d23158ea
commit
e1656f01ae
@ -2,11 +2,11 @@
|
||||
|
||||
PrintJobReader
|
||||
|
||||
Copyright (c) 2002 OpenBeOS.
|
||||
Copyright (c) 2002 OpenBeOS.
|
||||
|
||||
Author:
|
||||
Author:
|
||||
Michael Pfeiffer
|
||||
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
@ -32,6 +32,7 @@ THE SOFTWARE.
|
||||
|
||||
#include <File.h>
|
||||
#include <Message.h>
|
||||
#include <Picture.h>
|
||||
|
||||
class PrintJobPage {
|
||||
BFile fJobFile; // the job file
|
||||
@ -39,17 +40,17 @@ class PrintJobPage {
|
||||
int32 fNumberOfPictures; // of this page
|
||||
int32 fPicture; // the picture returned by NextPicture()
|
||||
status_t fStatus;
|
||||
|
||||
|
||||
public:
|
||||
PrintJobPage();
|
||||
PrintJobPage(const PrintJobPage& copy);
|
||||
PrintJobPage(BFile* jobFile, off_t start);
|
||||
status_t InitCheck() const;
|
||||
|
||||
|
||||
int32 NumberOfPictures() const { return fNumberOfPictures; }
|
||||
|
||||
|
||||
status_t NextPicture(BPicture& picture, BPoint& p, BRect& r);
|
||||
|
||||
|
||||
PrintJobPage& operator=(const PrintJobPage& copy);
|
||||
};
|
||||
|
||||
@ -65,10 +66,10 @@ class PrintJobReader {
|
||||
public:
|
||||
PrintJobReader(BFile* jobFile);
|
||||
virtual ~PrintJobReader();
|
||||
|
||||
|
||||
// test after construction if this is a valid job file
|
||||
status_t InitCheck() const;
|
||||
|
||||
|
||||
// accessors to informations from job file
|
||||
int32 NumberOfPages() const { return fNumberOfPages; }
|
||||
int32 FirstPage() const { return fFirstPage; }
|
||||
@ -78,7 +79,7 @@ public:
|
||||
BRect PrintableRect() const;
|
||||
void GetResolution(int32 *xdpi, int32 *ydpi) const;
|
||||
float GetScale() const;
|
||||
|
||||
|
||||
// retrieve page
|
||||
status_t GetPage(int32 no, PrintJobPage& pjp);
|
||||
};
|
||||
|
@ -2,11 +2,11 @@
|
||||
|
||||
PrintJobReader
|
||||
|
||||
Copyright (c) 2002 OpenBeOS.
|
||||
Copyright (c) 2002 OpenBeOS.
|
||||
|
||||
Author:
|
||||
Author:
|
||||
Michael Pfeiffer
|
||||
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
||||
this software and associated documentation files (the "Software"), to deal in
|
||||
the Software without restriction, including without limitation the rights to
|
||||
@ -45,7 +45,7 @@ PrintJobPage::PrintJobPage()
|
||||
, fNumberOfPictures(0)
|
||||
, fPicture(0)
|
||||
, fStatus(B_ERROR)
|
||||
{
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
@ -72,7 +72,7 @@ PrintJobPage& PrintJobPage::operator=(const PrintJobPage& copy)
|
||||
}
|
||||
|
||||
|
||||
PrintJobPage::PrintJobPage(BFile* jobFile, off_t start)
|
||||
PrintJobPage::PrintJobPage(BFile* jobFile, off_t start)
|
||||
: fJobFile(*jobFile)
|
||||
, fPicture(0)
|
||||
, fStatus(B_ERROR)
|
||||
@ -84,7 +84,6 @@ PrintJobPage::PrintJobPage(BFile* jobFile, off_t start)
|
||||
if (fJobFile.Seek(start, SEEK_SET) != start)
|
||||
return;
|
||||
|
||||
off_t nextPage;
|
||||
if (fJobFile.Read(&fNumberOfPictures, sizeof(int32)) == sizeof(int32)) {
|
||||
// (sizeof(int32) * 10) == padding in _page_header_
|
||||
fJobFile.Seek(sizeof(off_t) + sizeof(int32) * 10, SEEK_CUR);
|
||||
@ -105,13 +104,13 @@ status_t PrintJobPage::NextPicture(BPicture& picture, BPoint& point, BRect& rect
|
||||
if (fPicture >= fNumberOfPictures)
|
||||
return B_ERROR;
|
||||
fPicture++;
|
||||
|
||||
|
||||
fJobFile.Seek(fNextPicture, SEEK_SET);
|
||||
fJobFile.Read(&point, sizeof(BPoint));
|
||||
fJobFile.Read(&rect, sizeof(BRect));
|
||||
status_t rc = picture.Unflatten(&fJobFile);
|
||||
fNextPicture = fJobFile.Position();
|
||||
|
||||
|
||||
if (rc != B_OK)
|
||||
fPicture = fNumberOfPictures;
|
||||
|
||||
@ -122,7 +121,7 @@ status_t PrintJobPage::NextPicture(BPicture& picture, BPoint& point, BRect& rect
|
||||
// # pragma mark --- PrintJobReader
|
||||
|
||||
|
||||
PrintJobReader::PrintJobReader(BFile* jobFile)
|
||||
PrintJobReader::PrintJobReader(BFile* jobFile)
|
||||
: fJobFile(*jobFile)
|
||||
, fNumberOfPages(-1)
|
||||
, fPageIndex(NULL)
|
||||
|
Loading…
x
Reference in New Issue
Block a user