* More style changes.
* Removed namespace handling for Metrowerks compiler. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39140 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -13,11 +13,9 @@
|
||||
#include <Rect.h>
|
||||
#include <Point.h>
|
||||
|
||||
#if (!__MWERKS__ || defined(MSIPL_USING_NAMESPACE))
|
||||
|
||||
using namespace std;
|
||||
#else
|
||||
#define std
|
||||
#endif
|
||||
|
||||
|
||||
class BFile;
|
||||
class BPicture;
|
||||
|
||||
@@ -9,11 +9,7 @@
|
||||
#include <string>
|
||||
#include <SerialPort.h>
|
||||
|
||||
#if (!__MWERKS__ || defined(MSIPL_USING_NAMESPACE))
|
||||
using namespace std;
|
||||
#else
|
||||
#define std
|
||||
#endif
|
||||
|
||||
class BNode;
|
||||
|
||||
|
||||
@@ -12,11 +12,9 @@
|
||||
class BDataIO;
|
||||
class PrinterData;
|
||||
|
||||
#if (!__MWERKS__ || defined(MSIPL_USING_NAMESPACE))
|
||||
|
||||
using namespace std;
|
||||
#else
|
||||
#define std
|
||||
#endif
|
||||
|
||||
|
||||
extern "C" {
|
||||
typedef BDataIO *(*PFN_init_transport)(BMessage *);
|
||||
|
||||
@@ -6,11 +6,13 @@
|
||||
#ifndef __UIDRIVER_H
|
||||
#define __UIDRIVER_H
|
||||
|
||||
|
||||
class BMessage;
|
||||
class PrinterData;
|
||||
class PrinterCap;
|
||||
class JobData;
|
||||
|
||||
|
||||
class UIDriver {
|
||||
public:
|
||||
UIDriver(BMessage *msg, PrinterData *printer_data, const PrinterCap *printer_cap);
|
||||
|
||||
@@ -12,11 +12,9 @@
|
||||
|
||||
#include "AboutBox.h"
|
||||
|
||||
#if (!__MWERKS__ || defined(MSIPL_USING_NAMESPACE))
|
||||
|
||||
using namespace std;
|
||||
#else
|
||||
#define std
|
||||
#endif
|
||||
|
||||
|
||||
enum {
|
||||
kMsgOK = 'AbOK'
|
||||
|
||||
@@ -15,11 +15,9 @@
|
||||
|
||||
#ifdef DBG
|
||||
|
||||
#if (!__MWERKS__ || defined(MSIPL_USING_NAMESPACE))
|
||||
|
||||
using namespace std;
|
||||
#else
|
||||
#define std
|
||||
#endif
|
||||
|
||||
|
||||
void write_debug_stream(const char *format, ...)
|
||||
{
|
||||
|
||||
@@ -29,11 +29,9 @@
|
||||
#include "ValidRect.h"
|
||||
#include "DbgMsg.h"
|
||||
|
||||
#if (!__MWERKS__ || defined(MSIPL_USING_NAMESPACE))
|
||||
|
||||
using namespace std;
|
||||
#else
|
||||
#define std
|
||||
#endif
|
||||
|
||||
|
||||
// Measure printJob() time. Either true or false.
|
||||
#define MEASURE_PRINT_JOB_TIME false
|
||||
|
||||
@@ -12,11 +12,9 @@
|
||||
#include "ValidRect.h"
|
||||
#include "DbgMsg.h"
|
||||
|
||||
#if (!__MWERKS__ || defined(MSIPL_USING_NAMESPACE))
|
||||
|
||||
using namespace std;
|
||||
#else
|
||||
#define std
|
||||
#endif
|
||||
|
||||
|
||||
#include "Pattern.h"
|
||||
|
||||
|
||||
@@ -13,11 +13,9 @@
|
||||
#include <string.h>
|
||||
#include "PackBits.h"
|
||||
|
||||
#if (!__MWERKS__ || defined(MSIPL_USING_NAMESPACE))
|
||||
|
||||
using namespace std;
|
||||
#else
|
||||
#define std
|
||||
#endif
|
||||
|
||||
|
||||
#define MAXINBYTES 127
|
||||
#define CONTROL1(i) -i
|
||||
|
||||
@@ -43,11 +43,7 @@
|
||||
#include "PrintUtils.h"
|
||||
|
||||
|
||||
#if (!__MWERKS__ || defined(MSIPL_USING_NAMESPACE))
|
||||
using namespace std;
|
||||
#else
|
||||
#define std
|
||||
#endif
|
||||
|
||||
|
||||
enum MSGS {
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#include "PrintProcess.h"
|
||||
#include "DbgMsg.h"
|
||||
|
||||
|
||||
PictureData::PictureData(BFile *file)
|
||||
{
|
||||
DBGMSG(("construct PictureData\n"));
|
||||
@@ -30,18 +31,19 @@ PictureData::PictureData(BFile *file)
|
||||
DBGMSG(("3: current seek position = 0x%x\n", (int)file->Position()));
|
||||
}
|
||||
|
||||
|
||||
PictureData::~PictureData()
|
||||
{
|
||||
delete picture;
|
||||
}
|
||||
|
||||
/*--------------------------------------------------*/
|
||||
|
||||
PageData::PageData()
|
||||
{
|
||||
fHollow = true;
|
||||
}
|
||||
|
||||
|
||||
PageData::PageData(BFile *file, bool reverse)
|
||||
{
|
||||
fFile = file;
|
||||
@@ -62,7 +64,9 @@ PageData::PageData(BFile *file, bool reverse)
|
||||
}
|
||||
}
|
||||
|
||||
bool PageData::startEnum()
|
||||
|
||||
bool
|
||||
PageData::startEnum()
|
||||
{
|
||||
off_t offset;
|
||||
uchar dummy[40];
|
||||
@@ -84,7 +88,9 @@ bool PageData::startEnum()
|
||||
return fPictureCount > 0;
|
||||
}
|
||||
|
||||
bool PageData::enumObject(PictureData **picture_data)
|
||||
|
||||
bool
|
||||
PageData::enumObject(PictureData **picture_data)
|
||||
{
|
||||
if (fHollow || fPictureCount <= 0) {
|
||||
*picture_data = NULL;
|
||||
@@ -97,13 +103,8 @@ bool PageData::enumObject(PictureData **picture_data)
|
||||
return false;
|
||||
}
|
||||
|
||||
/*--------------------------------------------------*/
|
||||
|
||||
SpoolData::SpoolData(
|
||||
BFile *file,
|
||||
int page_count,
|
||||
int nup,
|
||||
bool reverse)
|
||||
SpoolData::SpoolData(BFile *file, int page_count, int nup, bool reverse)
|
||||
{
|
||||
DBGMSG(("nup = %d\n", nup));
|
||||
DBGMSG(("page_count = %d\n", page_count));
|
||||
@@ -138,6 +139,7 @@ SpoolData::SpoolData(
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
SpoolData::~SpoolData()
|
||||
{
|
||||
for (fIt = fPages.begin(); fIt != fPages.end(); fIt++) {
|
||||
@@ -145,13 +147,17 @@ SpoolData::~SpoolData()
|
||||
}
|
||||
}
|
||||
|
||||
bool SpoolData::startEnum()
|
||||
|
||||
bool
|
||||
SpoolData::startEnum()
|
||||
{
|
||||
fIt = fPages.begin();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool SpoolData::enumObject(PageData **page_data)
|
||||
|
||||
bool
|
||||
SpoolData::enumObject(PageData **page_data)
|
||||
{
|
||||
*page_data = *fIt++;
|
||||
if (fIt == fPages.end()) {
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
const char *kSDDescription = "_spool/Description";
|
||||
const char* kSDMimeType = "_spool/MimeType";
|
||||
|
||||
|
||||
SpoolMetaData::SpoolMetaData(BFile* spool_file)
|
||||
{
|
||||
BString string;
|
||||
@@ -24,6 +25,7 @@ SpoolMetaData::SpoolMetaData(BFile* spool_file)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
SpoolMetaData::~SpoolMetaData()
|
||||
{
|
||||
}
|
||||
|
||||
@@ -101,6 +101,7 @@ StatusWindow::~StatusWindow(void)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
StatusWindow::ResetStatusBar(void)
|
||||
{
|
||||
@@ -109,6 +110,7 @@ StatusWindow::ResetStatusBar(void)
|
||||
Unlock();
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
StatusWindow::UpdateStatusBar(uint32 page, uint32 copy)
|
||||
{
|
||||
@@ -145,6 +147,7 @@ StatusWindow::UpdateStatusBar(uint32 page, uint32 copy)
|
||||
return fCancelBar;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
StatusWindow::SetPageCopies(uint32 copies)
|
||||
{
|
||||
|
||||
@@ -15,11 +15,9 @@
|
||||
#include "PrinterData.h"
|
||||
#include "DbgMsg.h"
|
||||
|
||||
#if (!__MWERKS__ || defined(MSIPL_USING_NAMESPACE))
|
||||
|
||||
using namespace std;
|
||||
#else
|
||||
#define std
|
||||
#endif
|
||||
|
||||
|
||||
Transport::Transport(const PrinterData *printer_data)
|
||||
: fImage(-1), fInitTransport(0), fExitTransport(0), fDataStream(0), fAbort(false)
|
||||
@@ -74,6 +72,7 @@ Transport::Transport(const PrinterData *printer_data)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Transport::~Transport()
|
||||
{
|
||||
if (fExitTransport) {
|
||||
@@ -84,17 +83,23 @@ Transport::~Transport()
|
||||
}
|
||||
}
|
||||
|
||||
bool Transport::check_abort() const
|
||||
|
||||
bool
|
||||
Transport::check_abort() const
|
||||
{
|
||||
return fDataStream == 0;
|
||||
}
|
||||
|
||||
const string &Transport::last_error() const
|
||||
|
||||
const
|
||||
string &Transport::last_error() const
|
||||
{
|
||||
return fLastErrorString;
|
||||
}
|
||||
|
||||
bool Transport::is_print_to_file_canceled() const
|
||||
|
||||
bool
|
||||
Transport::is_print_to_file_canceled() const
|
||||
{
|
||||
// The BeOS "Print To File" transport add-on returns a non-NULL BDataIO *
|
||||
// even after user filepanel cancellation!
|
||||
@@ -102,13 +107,17 @@ bool Transport::is_print_to_file_canceled() const
|
||||
return file != NULL && file->InitCheck() != B_OK;
|
||||
}
|
||||
|
||||
void Transport::set_last_error(const char *e)
|
||||
|
||||
void
|
||||
Transport::set_last_error(const char *e)
|
||||
{
|
||||
fLastErrorString = e;
|
||||
fAbort = true;
|
||||
}
|
||||
|
||||
void Transport::write(const void *buffer, size_t size) throw(TransportException)
|
||||
|
||||
void
|
||||
Transport::write(const void *buffer, size_t size) throw(TransportException)
|
||||
{
|
||||
if (fDataStream) {
|
||||
if (size == (size_t)fDataStream->Write(buffer, size)) {
|
||||
|
||||
@@ -12,16 +12,20 @@
|
||||
#include "PageSetupDlg.h"
|
||||
#include "DbgMsg.h"
|
||||
|
||||
|
||||
UIDriver::UIDriver(BMessage *msg, PrinterData *printer_data, const PrinterCap *printer_cap)
|
||||
: fMsg(msg), fPrinterData(printer_data), fPrinterCap(printer_cap)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
UIDriver::~UIDriver()
|
||||
{
|
||||
}
|
||||
|
||||
BMessage *UIDriver::configPage()
|
||||
|
||||
BMessage*
|
||||
UIDriver::configPage()
|
||||
{
|
||||
BMessage *clone_msg = new BMessage(*fMsg);
|
||||
JobData *job_data = new JobData(clone_msg, fPrinterCap, JobData::kPageSettings);
|
||||
@@ -37,7 +41,9 @@ BMessage *UIDriver::configPage()
|
||||
return clone_msg;
|
||||
}
|
||||
|
||||
BMessage *UIDriver::configJob()
|
||||
|
||||
BMessage*
|
||||
UIDriver::configJob()
|
||||
{
|
||||
BMessage *clone_msg = new BMessage(*fMsg);
|
||||
JobData *job_data = new JobData(clone_msg, fPrinterCap, JobData::kJobSettings);
|
||||
@@ -53,13 +59,17 @@ BMessage *UIDriver::configJob()
|
||||
return clone_msg;
|
||||
}
|
||||
|
||||
long UIDriver::doPageSetup(JobData *job_data, PrinterData *printer_data, const PrinterCap *printer_cap)
|
||||
|
||||
long
|
||||
UIDriver::doPageSetup(JobData *job_data, PrinterData *printer_data, const PrinterCap *printer_cap)
|
||||
{
|
||||
PageSetupDlg *dlg = new PageSetupDlg(job_data, printer_data, printer_cap);
|
||||
return dlg->Go();
|
||||
}
|
||||
|
||||
long UIDriver::doJobSetup(JobData *job_data, PrinterData *printer_data, const PrinterCap *printer_cap)
|
||||
|
||||
long
|
||||
UIDriver::doJobSetup(JobData *job_data, PrinterData *printer_data, const PrinterCap *printer_cap)
|
||||
{
|
||||
JobSetupDlg *dlg = new JobSetupDlg(job_data, printer_data, printer_cap);
|
||||
return dlg->Go();
|
||||
|
||||
@@ -41,6 +41,7 @@ private:
|
||||
INLINE void updateRightBound(const rgb_color *row);
|
||||
};
|
||||
|
||||
|
||||
bool
|
||||
BoundsCalculator::isEmpty(const rgb_color *pixel)
|
||||
{
|
||||
@@ -60,12 +61,14 @@ BoundsCalculator::isRowEmpty(const rgb_color *row)
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
const uchar *
|
||||
BoundsCalculator::getRow(int x, int y)
|
||||
{
|
||||
return fBits + x + fBPR * y;
|
||||
}
|
||||
|
||||
|
||||
|
||||
int
|
||||
BoundsCalculator::getTop()
|
||||
{
|
||||
@@ -82,6 +85,7 @@ BoundsCalculator::getTop()
|
||||
return top;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
BoundsCalculator::getBottom()
|
||||
{
|
||||
@@ -98,6 +102,7 @@ BoundsCalculator::getBottom()
|
||||
return bottom;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
BoundsCalculator::updateLeftBound(const rgb_color *row)
|
||||
{
|
||||
@@ -110,6 +115,7 @@ BoundsCalculator::updateLeftBound(const rgb_color *row)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
BoundsCalculator::updateRightBound(const rgb_color *row)
|
||||
{
|
||||
@@ -123,6 +129,7 @@ BoundsCalculator::updateRightBound(const rgb_color *row)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// returns false if the bitmap is empty or has wrong color space.
|
||||
bool
|
||||
BoundsCalculator::getValidRect(BBitmap *bitmap, RECT *rect)
|
||||
@@ -185,12 +192,14 @@ BoundsCalculator::getValidRect(BBitmap *bitmap, RECT *rect)
|
||||
return kRectIsValid;
|
||||
}
|
||||
|
||||
|
||||
bool get_valid_rect(BBitmap *a_bitmap, RECT *rc)
|
||||
{
|
||||
BoundsCalculator calculator;
|
||||
return calculator.getValidRect(a_bitmap, rc);
|
||||
}
|
||||
|
||||
|
||||
int color_space2pixel_depth(color_space cs)
|
||||
{
|
||||
int pixel_depth;
|
||||
|
||||
Reference in New Issue
Block a user