* Changed BaseCap ID type from int to int32.
* Removed unused printer ID from PrinterCap. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39156 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -20,7 +20,7 @@ struct BaseCap {
|
||||
BaseCap(const string &label, bool isDefault);
|
||||
virtual ~BaseCap();
|
||||
|
||||
virtual int ID() const = 0;
|
||||
virtual int32 ID() const = 0;
|
||||
const char* Key() const;
|
||||
|
||||
string fLabel;
|
||||
@@ -33,7 +33,7 @@ struct PaperCap : public BaseCap {
|
||||
JobData::Paper paper, const BRect &paperRect,
|
||||
const BRect &physicalRect);
|
||||
|
||||
int ID() const;
|
||||
int32 ID() const;
|
||||
|
||||
JobData::Paper fPaper;
|
||||
BRect fPaperRect;
|
||||
@@ -44,18 +44,18 @@ struct PaperSourceCap : public BaseCap {
|
||||
PaperSourceCap(const string &label, bool isDefault,
|
||||
JobData::PaperSource paperSource);
|
||||
|
||||
int ID() const;
|
||||
int32 ID() const;
|
||||
|
||||
JobData::PaperSource fPaperSource;
|
||||
};
|
||||
|
||||
struct ResolutionCap : public BaseCap {
|
||||
ResolutionCap(const string &label, bool isDefault,
|
||||
int id, int xResolution, int yResolution);
|
||||
int32 id, int xResolution, int yResolution);
|
||||
|
||||
int ID() const;
|
||||
int32 ID() const;
|
||||
|
||||
int fID;
|
||||
int32 fID;
|
||||
int fXResolution;
|
||||
int fYResolution;
|
||||
};
|
||||
@@ -64,7 +64,7 @@ struct OrientationCap : public BaseCap {
|
||||
OrientationCap(const string &label, bool isDefault,
|
||||
JobData::Orientation orientation);
|
||||
|
||||
int ID() const;
|
||||
int32 ID() const;
|
||||
|
||||
JobData::Orientation fOrientation;
|
||||
};
|
||||
@@ -73,7 +73,7 @@ struct PrintStyleCap : public BaseCap {
|
||||
PrintStyleCap(const string &label, bool isDefault,
|
||||
JobData::PrintStyle printStyle);
|
||||
|
||||
int ID() const;
|
||||
int32 ID() const;
|
||||
|
||||
JobData::PrintStyle fPrintStyle;
|
||||
};
|
||||
@@ -83,7 +83,7 @@ struct BindingLocationCap : public BaseCap {
|
||||
bool isDefault,
|
||||
JobData::BindingLocation bindingLocation);
|
||||
|
||||
int ID() const;
|
||||
int32 ID() const;
|
||||
|
||||
JobData::BindingLocation fBindingLocation;
|
||||
};
|
||||
@@ -92,19 +92,19 @@ struct ColorCap : public BaseCap {
|
||||
ColorCap(const string &label, bool isDefault,
|
||||
JobData::Color color);
|
||||
|
||||
int ID() const;
|
||||
int32 ID() const;
|
||||
|
||||
JobData::Color fColor;
|
||||
};
|
||||
|
||||
struct ProtocolClassCap : public BaseCap {
|
||||
ProtocolClassCap(const string &label,
|
||||
bool isDefault, int protocolClass,
|
||||
bool isDefault, int32 protocolClass,
|
||||
const string &description);
|
||||
|
||||
int ID() const;
|
||||
int32 ID() const;
|
||||
|
||||
int fProtocolClass;
|
||||
int32 fProtocolClass;
|
||||
string fDescription;
|
||||
};
|
||||
|
||||
@@ -117,11 +117,11 @@ struct DriverSpecificCap : public BaseCap {
|
||||
};
|
||||
|
||||
DriverSpecificCap(const string& label,
|
||||
bool isDefault, int category, Type type);
|
||||
bool isDefault, int32 category, Type type);
|
||||
|
||||
int ID() const;
|
||||
int32 ID() const;
|
||||
|
||||
int fCategory;
|
||||
int32 fCategory;
|
||||
Type fType;
|
||||
};
|
||||
|
||||
@@ -161,19 +161,16 @@ public:
|
||||
const BaseCap* findCap(CapID category, int id) const;
|
||||
const BaseCap* findCap(CapID category, const char* label) const;
|
||||
|
||||
int getPrinterId() const;
|
||||
int getProtocolClass() const;
|
||||
|
||||
protected:
|
||||
PrinterCap(const PrinterCap &printerCap);
|
||||
PrinterCap& operator=(const PrinterCap &printerCap);
|
||||
PrinterCap(const PrinterCap& printerCap);
|
||||
PrinterCap& operator=(const PrinterCap& printerCap);
|
||||
|
||||
const PrinterData* getPrinterData() const;
|
||||
void setPrinterId(int id);
|
||||
|
||||
private:
|
||||
const PrinterData* fPrinterData;
|
||||
int fPrinterID;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@@ -118,9 +118,7 @@ JobData::load(BMessage *msg, const PrinterCap *cap, Settings settings)
|
||||
fPaper = kA4;
|
||||
|
||||
if (msg->HasInt32(kJDResolution)) {
|
||||
int32 resolution;
|
||||
msg->FindInt32(kJDResolution, &resolution);
|
||||
fResolutionID = resolution;
|
||||
msg->FindInt32(kJDResolution, &fResolutionID);
|
||||
} else if (cap->isSupport(PrinterCap::kResolution)) {
|
||||
fResolutionID = cap->getDefaultCap(PrinterCap::kResolution)->ID();
|
||||
} else {
|
||||
|
||||
@@ -56,7 +56,7 @@ struct NupCap : public BaseCap {
|
||||
fNup(nup)
|
||||
{}
|
||||
|
||||
int ID() const { return fNup; }
|
||||
int32 ID() const { return fNup; }
|
||||
|
||||
int fNup;
|
||||
};
|
||||
@@ -70,7 +70,7 @@ struct DitherCap : public BaseCap {
|
||||
fDitherType(ditherType)
|
||||
{}
|
||||
|
||||
int ID() const { return fDitherType; }
|
||||
int32 ID() const { return fDitherType; }
|
||||
|
||||
Halftone::DitherType fDitherType;
|
||||
};
|
||||
|
||||
@@ -37,7 +37,7 @@ PaperCap::PaperCap(const string &label, bool isDefault, JobData::Paper paper,
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
int32
|
||||
PaperCap::ID() const
|
||||
{
|
||||
return fPaper;
|
||||
@@ -53,7 +53,7 @@ PaperSourceCap::PaperSourceCap(const string &label, bool isDefault,
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
int32
|
||||
PaperSourceCap::ID() const
|
||||
{
|
||||
return fPaperSource;
|
||||
@@ -61,7 +61,7 @@ PaperSourceCap::ID() const
|
||||
|
||||
|
||||
ResolutionCap::ResolutionCap(const string &label, bool isDefault,
|
||||
int id, int xResolution, int yResolution)
|
||||
int32 id, int xResolution, int yResolution)
|
||||
:
|
||||
BaseCap(label, isDefault),
|
||||
fID(id),
|
||||
@@ -71,7 +71,7 @@ ResolutionCap::ResolutionCap(const string &label, bool isDefault,
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
int32
|
||||
ResolutionCap::ID() const
|
||||
{
|
||||
return fID;
|
||||
@@ -87,7 +87,7 @@ OrientationCap::OrientationCap(const string &label, bool isDefault,
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
int32
|
||||
OrientationCap::ID() const
|
||||
{
|
||||
return fOrientation;
|
||||
@@ -103,7 +103,7 @@ PrintStyleCap::PrintStyleCap(const string &label, bool isDefault,
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
int32
|
||||
PrintStyleCap::ID() const
|
||||
{
|
||||
return fPrintStyle;
|
||||
@@ -119,7 +119,7 @@ BindingLocationCap::BindingLocationCap(const string &label, bool isDefault,
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
int32
|
||||
BindingLocationCap::ID() const
|
||||
{
|
||||
return fBindingLocation;
|
||||
@@ -134,7 +134,7 @@ ColorCap::ColorCap(const string &label, bool isDefault, JobData::Color color)
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
int32
|
||||
ColorCap::ID() const
|
||||
{
|
||||
return fColor;
|
||||
@@ -142,7 +142,7 @@ ColorCap::ID() const
|
||||
|
||||
|
||||
ProtocolClassCap::ProtocolClassCap(const string &label, bool isDefault,
|
||||
int protocolClass, const string &description)
|
||||
int32 protocolClass, const string &description)
|
||||
:
|
||||
BaseCap(label, isDefault),
|
||||
fProtocolClass(protocolClass),
|
||||
@@ -151,7 +151,7 @@ ProtocolClassCap::ProtocolClassCap(const string &label, bool isDefault,
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
int32
|
||||
ProtocolClassCap::ID() const
|
||||
{
|
||||
return fProtocolClass;
|
||||
@@ -159,7 +159,7 @@ ProtocolClassCap::ID() const
|
||||
|
||||
|
||||
DriverSpecificCap::DriverSpecificCap(const string& label, bool isDefault,
|
||||
int category, Type type)
|
||||
int32 category, Type type)
|
||||
:
|
||||
BaseCap(label, isDefault),
|
||||
fCategory(category),
|
||||
@@ -168,7 +168,7 @@ DriverSpecificCap::DriverSpecificCap(const string& label, bool isDefault,
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
int32
|
||||
DriverSpecificCap::ID() const
|
||||
{
|
||||
return fCategory;
|
||||
@@ -176,8 +176,8 @@ DriverSpecificCap::ID() const
|
||||
|
||||
|
||||
PrinterCap::PrinterCap(const PrinterData *printer_data)
|
||||
: fPrinterData(printer_data),
|
||||
fPrinterID(kUnknownPrinter)
|
||||
:
|
||||
fPrinterData(printer_data)
|
||||
{
|
||||
}
|
||||
|
||||
@@ -253,18 +253,3 @@ PrinterData *PrinterCap::getPrinterData() const
|
||||
{
|
||||
return fPrinterData;
|
||||
}
|
||||
|
||||
|
||||
int
|
||||
PrinterCap::getPrinterId() const
|
||||
{
|
||||
return fPrinterID;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
PrinterCap::setPrinterId(int id)
|
||||
{
|
||||
fPrinterID = id;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user