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