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