Bump gutenprint version.
needs gutenprint8 packages to be uploaded. Change-Id: I1204ff8b1bb85cc0eb615082b205280daabbc290 Signed-off-by: Augustin Cavalier <[email protected]>
This commit is contained in:
committed by
Augustin Cavalier
parent
f95a6bc18a
commit
89f1fd6512
@@ -304,11 +304,11 @@ if [ IsPackageAvailable fontconfig_devel ] {
|
|||||||
}
|
}
|
||||||
|
|
||||||
# Gutenprint
|
# Gutenprint
|
||||||
if [ IsPackageAvailable gutenprint_devel ] {
|
if [ IsPackageAvailable gutenprint8_devel ] {
|
||||||
ExtractBuildFeatureArchives gutenprint :
|
ExtractBuildFeatureArchives gutenprint :
|
||||||
file: base gutenprint
|
file: base gutenprint8
|
||||||
runtime: lib
|
runtime: lib
|
||||||
file: devel gutenprint_devel
|
file: devel gutenprint8_devel
|
||||||
depends: base
|
depends: base
|
||||||
library: $(developLibDir)/libgutenprint.so
|
library: $(developLibDir)/libgutenprint.so
|
||||||
headers: $(developHeadersDir) $(developHeadersDir)/gutenprint
|
headers: $(developHeadersDir) $(developHeadersDir)/gutenprint
|
||||||
|
|||||||
@@ -48,16 +48,16 @@ protected:
|
|||||||
virtual bool EndDocument(bool success);
|
virtual bool EndDocument(bool success);
|
||||||
|
|
||||||
void WriteSpoolData(const void* buffer, size_t size)
|
void WriteSpoolData(const void* buffer, size_t size)
|
||||||
throw (TransportException);
|
/* throw (TransportException) */;
|
||||||
void WriteSpoolString(const char* buffer, ...)
|
void WriteSpoolString(const char* buffer, ...)
|
||||||
throw (TransportException);
|
/* throw (TransportException) */;
|
||||||
void WriteSpoolChar(char c)
|
void WriteSpoolChar(char c)
|
||||||
throw (TransportException);
|
/* throw (TransportException) */;
|
||||||
|
|
||||||
void ReadSpoolData(void* buffer, size_t size)
|
void ReadSpoolData(void* buffer, size_t size)
|
||||||
throw (TransportException);
|
/* throw (TransportException) */;
|
||||||
int ReadSpoolChar()
|
int ReadSpoolChar()
|
||||||
throw (TransportException);
|
/* throw (TransportException) */;
|
||||||
|
|
||||||
static void ConvertToRGB24(const void* src, void* dst, int width,
|
static void ConvertToRGB24(const void* src, void* dst, int width,
|
||||||
color_space cs);
|
color_space cs);
|
||||||
|
|||||||
@@ -38,9 +38,9 @@ public:
|
|||||||
~Transport();
|
~Transport();
|
||||||
|
|
||||||
void Write(const void *buffer, size_t size)
|
void Write(const void *buffer, size_t size)
|
||||||
throw (TransportException);
|
/* throw (TransportException) */;
|
||||||
void Read(void *buffer, size_t size)
|
void Read(void *buffer, size_t size)
|
||||||
throw (TransportException);
|
/* throw (TransportException) */;
|
||||||
bool CheckAbort() const;
|
bool CheckAbort() const;
|
||||||
bool IsPrintToFileCanceled() const;
|
bool IsPrintToFileCanceled() const;
|
||||||
const string& LastError() const;
|
const string& LastError() const;
|
||||||
|
|||||||
@@ -156,7 +156,6 @@ GPBinding::GetCapabilities(const char* driver, GPCapabilities* capabilities)
|
|||||||
status_t
|
status_t
|
||||||
GPBinding::BeginJob(GPJobConfiguration* configuration,
|
GPBinding::BeginJob(GPJobConfiguration* configuration,
|
||||||
OutputStream* outputStream)
|
OutputStream* outputStream)
|
||||||
throw(TransportException)
|
|
||||||
{
|
{
|
||||||
fOutputStream = outputStream;
|
fOutputStream = outputStream;
|
||||||
fJob.SetApplicationName("Gutenprint");
|
fJob.SetApplicationName("Gutenprint");
|
||||||
@@ -168,7 +167,7 @@ GPBinding::BeginJob(GPJobConfiguration* configuration,
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
GPBinding::EndJob() throw(TransportException)
|
GPBinding::EndJob()
|
||||||
{
|
{
|
||||||
fJob.End();
|
fJob.End();
|
||||||
fOutputStream = NULL;
|
fOutputStream = NULL;
|
||||||
@@ -176,13 +175,13 @@ GPBinding::EndJob() throw(TransportException)
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
GPBinding::BeginPage() throw(TransportException)
|
GPBinding::BeginPage()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
GPBinding::EndPage() throw(TransportException)
|
GPBinding::EndPage()
|
||||||
{
|
{
|
||||||
status_t status = fJob.PrintPage(fBands);
|
status_t status = fJob.PrintPage(fBands);
|
||||||
DeleteBands();
|
DeleteBands();
|
||||||
|
|||||||
@@ -44,10 +44,10 @@ public:
|
|||||||
GPCapabilities* capabilities);
|
GPCapabilities* capabilities);
|
||||||
|
|
||||||
status_t BeginJob(GPJobConfiguration* configuration,
|
status_t BeginJob(GPJobConfiguration* configuration,
|
||||||
OutputStream* outputStream) throw(TransportException);
|
OutputStream* outputStream) /* throw(TransportException) */;
|
||||||
void EndJob() throw(TransportException);
|
void EndJob() /* throw(TransportException) */;
|
||||||
void BeginPage() throw(TransportException);
|
void BeginPage() /* throw(TransportException) */;
|
||||||
void EndPage() throw(TransportException);
|
void EndPage() /* throw(TransportException) */;
|
||||||
status_t AddBitmapToPage(BBitmap* bitmap, BRect validRect, BPoint where);
|
status_t AddBitmapToPage(BBitmap* bitmap, BRect validRect, BPoint where);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
@@ -37,7 +37,6 @@ GPDriver::GPDriver(BMessage* message, PrinterData* printerData,
|
|||||||
|
|
||||||
void
|
void
|
||||||
GPDriver::Write(const void* buffer, size_t size)
|
GPDriver::Write(const void* buffer, size_t size)
|
||||||
throw (TransportException)
|
|
||||||
{
|
{
|
||||||
WriteSpoolData(buffer, size);
|
WriteSpoolData(buffer, size);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,7 +21,7 @@ public:
|
|||||||
const PrinterCap* printer_cap);
|
const PrinterCap* printer_cap);
|
||||||
|
|
||||||
void Write(const void *buffer, size_t size)
|
void Write(const void *buffer, size_t size)
|
||||||
throw(TransportException);
|
/* throw(TransportException) */;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool StartDocument();
|
bool StartDocument();
|
||||||
|
|||||||
@@ -30,32 +30,34 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void ToGutenprint(int32 fromX, int32 fromY, int32& toX, int32& toY) {
|
void ToGutenprint(int32 fromX, int32 fromY, double& toX, double& toY) {
|
||||||
toX = fromX * kGutenprintUnit / fXDPI;
|
toX = fromX * kGutenprintUnit / fXDPI;
|
||||||
toY = fromY * kGutenprintUnit / fYDPI;
|
toY = fromY * kGutenprintUnit / fYDPI;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void ToGutenprintCeiling(int32 fromX, int32 fromY, int32& toX, int32& toY) {
|
void ToGutenprintCeiling(int32 fromX, int32 fromY, double& toX,
|
||||||
|
double& toY) {
|
||||||
toX = (fromX * kGutenprintUnit + fXDPI - 1) / fXDPI;
|
toX = (fromX * kGutenprintUnit + fXDPI - 1) / fXDPI;
|
||||||
toY = (fromY * kGutenprintUnit + fYDPI - 1) / fYDPI;
|
toY = (fromY * kGutenprintUnit + fYDPI - 1) / fYDPI;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void FromGutenprint(int32 fromX, int32 fromY, int32& toX, int32& toY) {
|
void FromGutenprint(double fromX, double fromY, int32& toX, int32& toY) {
|
||||||
toX = fromX * fXDPI / kGutenprintUnit;
|
toX = (int32)(fromX * fXDPI / kGutenprintUnit);
|
||||||
toY = fromY * fYDPI / kGutenprintUnit;
|
toY = (int32)(fromY * fYDPI / kGutenprintUnit);
|
||||||
}
|
}
|
||||||
|
|
||||||
void FromGutenprintCeiling(int32 fromX, int32 fromY, int32& toX, int32& toY) {
|
void FromGutenprintCeiling(double fromX, double fromY, int32& toX,
|
||||||
toX = (fromX * fXDPI + kGutenprintUnit - 1) / kGutenprintUnit;
|
int32& toY) {
|
||||||
toY = (fromY * fYDPI + kGutenprintUnit - 1) / kGutenprintUnit;
|
toX = (int32)((fromX * fXDPI + kGutenprintUnit - 1) / kGutenprintUnit);
|
||||||
|
toY = (int32)((fromY * fYDPI + kGutenprintUnit - 1) / kGutenprintUnit);
|
||||||
}
|
}
|
||||||
|
|
||||||
void SizeFromGutenprint(int32 fromWidth, int32 fromHeight,
|
void SizeFromGutenprint(double fromWidth, double fromHeight,
|
||||||
int32& toWidth, int32& toHeight) {
|
int32& toWidth, int32& toHeight) {
|
||||||
toWidth = fromWidth * fXDPI / kGutenprintUnit;
|
toWidth = (int32)(fromWidth * fXDPI / kGutenprintUnit);
|
||||||
toHeight = fromHeight * fYDPI / kGutenprintUnit;
|
toHeight = (int32)(fromHeight * fYDPI / kGutenprintUnit);
|
||||||
}
|
}
|
||||||
|
|
||||||
void RoundUpToWholeInches(int32& width, int32& height) {
|
void RoundUpToWholeInches(int32& width, int32& height) {
|
||||||
@@ -66,8 +68,8 @@ public:
|
|||||||
}
|
}
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int32 fXDPI;
|
double fXDPI;
|
||||||
int32 fYDPI;
|
double fYDPI;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
@@ -239,18 +241,18 @@ GPJob::PrintPage(list<GPBand*>& bands) {
|
|||||||
fBands = &bands;
|
fBands = &bands;
|
||||||
fCachedBand = NULL;
|
fCachedBand = NULL;
|
||||||
|
|
||||||
Rectangle<int> imageableArea;
|
Rectangle<stp_dimension_t> imageableArea;
|
||||||
stp_get_imageable_area(fVariables, &imageableArea.left,
|
stp_get_imageable_area(fVariables, &imageableArea.left,
|
||||||
&imageableArea.right, &imageableArea.bottom, &imageableArea.top);
|
&imageableArea.right, &imageableArea.bottom, &imageableArea.top);
|
||||||
fprintf(stderr, "GPJob imageable area left %d, top %d, right %d, "
|
fprintf(stderr, "GPJob imageable area left %f, top %f, right %f, "
|
||||||
"bottom %d\n",
|
"bottom %f\n",
|
||||||
imageableArea.left, imageableArea.top, imageableArea.right,
|
imageableArea.left, imageableArea.top, imageableArea.right,
|
||||||
imageableArea.bottom);
|
imageableArea.bottom);
|
||||||
fprintf(stderr, "GPJob width %d %s, height %d %s\n",
|
fprintf(stderr, "GPJob width %f %s, height %f %s\n",
|
||||||
imageableArea.Width(),
|
imageableArea.Width(),
|
||||||
imageableArea.Width() % 72 == 0 ? "whole inches" : "not whole inches",
|
std::fmod(imageableArea.Width(), 72.) == 0.0 ? "whole inches" : "not whole inches",
|
||||||
imageableArea.Height(),
|
imageableArea.Height(),
|
||||||
imageableArea.Height() % 72 == 0 ? "whole inches" : "not whole inches"
|
std::fmod(imageableArea.Height(), 72.) == 0.0 ? "whole inches" : "not whole inches"
|
||||||
);
|
);
|
||||||
|
|
||||||
CoordinateSystem coordinateSystem;
|
CoordinateSystem coordinateSystem;
|
||||||
@@ -286,16 +288,16 @@ GPJob::PrintPage(list<GPBand*>& bands) {
|
|||||||
// calculate the position and size of the image to be printed on the page
|
// calculate the position and size of the image to be printed on the page
|
||||||
// unit: 1/72 Inches
|
// unit: 1/72 Inches
|
||||||
// constraints: the image must be inside the imageable area
|
// constraints: the image must be inside the imageable area
|
||||||
int32 left;
|
double left;
|
||||||
int32 top;
|
double top;
|
||||||
coordinateSystem.ToGutenprint(fPrintRect.left, fPrintRect.top, left, top);
|
coordinateSystem.ToGutenprint(fPrintRect.left, fPrintRect.top, left, top);
|
||||||
if (left < imageableArea.left)
|
if (left < imageableArea.left)
|
||||||
left = imageableArea.left;
|
left = imageableArea.left;
|
||||||
if (top < imageableArea.top)
|
if (top < imageableArea.top)
|
||||||
top = imageableArea.top;
|
top = imageableArea.top;
|
||||||
|
|
||||||
int32 right;
|
double right;
|
||||||
int32 bottom;
|
double bottom;
|
||||||
coordinateSystem.ToGutenprintCeiling(fPrintRect.right, fPrintRect.bottom,
|
coordinateSystem.ToGutenprintCeiling(fPrintRect.right, fPrintRect.bottom,
|
||||||
right, bottom);
|
right, bottom);
|
||||||
if (right > imageableArea.right)
|
if (right > imageableArea.right)
|
||||||
@@ -303,8 +305,8 @@ GPJob::PrintPage(list<GPBand*>& bands) {
|
|||||||
if (bottom > imageableArea.bottom)
|
if (bottom > imageableArea.bottom)
|
||||||
bottom = imageableArea.bottom;
|
bottom = imageableArea.bottom;
|
||||||
|
|
||||||
int32 width = right - left;
|
double width = right - left;
|
||||||
int32 height = bottom - top;
|
double height = bottom - top;
|
||||||
|
|
||||||
// because of rounding and clipping in the previous step,
|
// because of rounding and clipping in the previous step,
|
||||||
// now the image frame has to be synchronized
|
// now the image frame has to be synchronized
|
||||||
|
|||||||
@@ -203,12 +203,12 @@ GPParameterVisitor::VisitStringList(stp_parameter_t* parameter)
|
|||||||
} else if (strcmp(name, kPageSize) == 0) {
|
} else if (strcmp(name, kPageSize) == 0) {
|
||||||
stp_set_string_parameter(fVariables, kPageSize, key);
|
stp_set_string_parameter(fVariables, kPageSize, key);
|
||||||
|
|
||||||
int width;
|
stp_dimension_t width;
|
||||||
int height;
|
stp_dimension_t height;
|
||||||
stp_get_media_size(fVariables, &width, &height);
|
stp_get_media_size(fVariables, &width, &height);
|
||||||
BSize pageSize(width, height);
|
BSize pageSize(width, height);
|
||||||
|
|
||||||
int left, right, top, bottom;
|
stp_dimension_t left, right, top, bottom;
|
||||||
stp_get_imageable_area(fVariables, &left, &right, &bottom, &top);
|
stp_get_imageable_area(fVariables, &left, &right, &bottom, &top);
|
||||||
BRect imageableArea(left, top, right, bottom);
|
BRect imageableArea(left, top, right, bottom);
|
||||||
|
|
||||||
@@ -266,9 +266,9 @@ GPParameterVisitor::VisitDimensionParameter(stp_parameter_t* description,
|
|||||||
{
|
{
|
||||||
const char* name = description->name;
|
const char* name = description->name;
|
||||||
const char* text = description->text;
|
const char* text = description->text;
|
||||||
int lower = description->bounds.dimension.lower;
|
double lower = description->bounds.dimension.lower;
|
||||||
int upper = description->bounds.dimension.upper;
|
double upper = description->bounds.dimension.upper;
|
||||||
int defaultValue = description->deflt.dimension;
|
double defaultValue = description->deflt.dimension;
|
||||||
if (lower <= defaultValue && defaultValue <= upper)
|
if (lower <= defaultValue && defaultValue <= upper)
|
||||||
DimensionParameter(name, text, lower, upper, defaultValue,
|
DimensionParameter(name, text, lower, upper, defaultValue,
|
||||||
parameterClass);
|
parameterClass);
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ class OutputStream
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
virtual void Write(const void *buffer, size_t size)
|
virtual void Write(const void *buffer, size_t size)
|
||||||
throw(TransportException) = 0;
|
/* throw(TransportException) */ = 0;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ requires {
|
|||||||
lib:libexpat
|
lib:libexpat
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAIKU_BUILD_FEATURE_SPARC_GUTENPRINT_ENABLED
|
#ifdef HAIKU_BUILD_FEATURE_SPARC_GUTENPRINT_ENABLED
|
||||||
lib:libgutenprint
|
lib:libgutenprint >= 8
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAIKU_BUILD_FEATURE_SPARC_LIBICNS_ENABLED
|
#ifdef HAIKU_BUILD_FEATURE_SPARC_LIBICNS_ENABLED
|
||||||
lib:libicns
|
lib:libicns
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ requires {
|
|||||||
lib:libexpat
|
lib:libexpat
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAIKU_BUILD_FEATURE_X86_GUTENPRINT_ENABLED
|
#ifdef HAIKU_BUILD_FEATURE_X86_GUTENPRINT_ENABLED
|
||||||
lib:libgutenprint
|
lib:libgutenprint >= 8
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAIKU_BUILD_FEATURE_X86_LIBICNS_ENABLED
|
#ifdef HAIKU_BUILD_FEATURE_X86_LIBICNS_ENABLED
|
||||||
lib:libicns
|
lib:libicns
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ requires {
|
|||||||
lib:libexpat
|
lib:libexpat
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAIKU_BUILD_FEATURE_X86_64_GUTENPRINT_ENABLED
|
#ifdef HAIKU_BUILD_FEATURE_X86_64_GUTENPRINT_ENABLED
|
||||||
lib:libgutenprint
|
lib:libgutenprint >= 8
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAIKU_BUILD_FEATURE_X86_64_LIBICNS_ENABLED
|
#ifdef HAIKU_BUILD_FEATURE_X86_64_LIBICNS_ENABLED
|
||||||
lib:libicns
|
lib:libicns
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ requires {
|
|||||||
lib:libexpat
|
lib:libexpat
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAIKU_BUILD_FEATURE_X86_GCC2_GUTENPRINT_ENABLED
|
#ifdef HAIKU_BUILD_FEATURE_X86_GCC2_GUTENPRINT_ENABLED
|
||||||
lib:libgutenprint
|
lib:libgutenprint >= 8
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAIKU_BUILD_FEATURE_X86_GCC2_LIBICNS_ENABLED
|
#ifdef HAIKU_BUILD_FEATURE_X86_GCC2_LIBICNS_ENABLED
|
||||||
lib:libicns
|
lib:libicns
|
||||||
|
|||||||
@@ -758,7 +758,6 @@ GraphicsDriver::EndDocument(bool)
|
|||||||
|
|
||||||
void
|
void
|
||||||
GraphicsDriver::WriteSpoolData(const void* buffer, size_t size)
|
GraphicsDriver::WriteSpoolData(const void* buffer, size_t size)
|
||||||
throw (TransportException)
|
|
||||||
{
|
{
|
||||||
if (fTransport == NULL)
|
if (fTransport == NULL)
|
||||||
return;
|
return;
|
||||||
@@ -768,7 +767,6 @@ GraphicsDriver::WriteSpoolData(const void* buffer, size_t size)
|
|||||||
|
|
||||||
void
|
void
|
||||||
GraphicsDriver::WriteSpoolString(const char* format, ...)
|
GraphicsDriver::WriteSpoolString(const char* format, ...)
|
||||||
throw (TransportException)
|
|
||||||
{
|
{
|
||||||
if (fTransport == NULL)
|
if (fTransport == NULL)
|
||||||
return;
|
return;
|
||||||
@@ -784,7 +782,6 @@ GraphicsDriver::WriteSpoolString(const char* format, ...)
|
|||||||
|
|
||||||
void
|
void
|
||||||
GraphicsDriver::WriteSpoolChar(char c)
|
GraphicsDriver::WriteSpoolChar(char c)
|
||||||
throw (TransportException)
|
|
||||||
{
|
{
|
||||||
if (fTransport == NULL)
|
if (fTransport == NULL)
|
||||||
return;
|
return;
|
||||||
@@ -795,7 +792,6 @@ GraphicsDriver::WriteSpoolChar(char c)
|
|||||||
|
|
||||||
void
|
void
|
||||||
GraphicsDriver::ReadSpoolData(void* buffer, size_t size)
|
GraphicsDriver::ReadSpoolData(void* buffer, size_t size)
|
||||||
throw (TransportException)
|
|
||||||
{
|
{
|
||||||
if (fTransport == NULL)
|
if (fTransport == NULL)
|
||||||
return;
|
return;
|
||||||
@@ -805,7 +801,6 @@ GraphicsDriver::ReadSpoolData(void* buffer, size_t size)
|
|||||||
|
|
||||||
int
|
int
|
||||||
GraphicsDriver::ReadSpoolChar()
|
GraphicsDriver::ReadSpoolChar()
|
||||||
throw (TransportException)
|
|
||||||
{
|
{
|
||||||
if (fTransport == NULL)
|
if (fTransport == NULL)
|
||||||
return -1;
|
return -1;
|
||||||
|
|||||||
@@ -137,7 +137,7 @@ Transport::SetLastError(const char *e)
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
Transport::Write(const void* buffer, size_t size) throw(TransportException)
|
Transport::Write(const void* buffer, size_t size)
|
||||||
{
|
{
|
||||||
if (fDataStream) {
|
if (fDataStream) {
|
||||||
if (size == (size_t)fDataStream->Write(buffer, size)) {
|
if (size == (size_t)fDataStream->Write(buffer, size)) {
|
||||||
@@ -150,7 +150,7 @@ Transport::Write(const void* buffer, size_t size) throw(TransportException)
|
|||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
Transport::Read(void* buffer, size_t size) throw(TransportException)
|
Transport::Read(void* buffer, size_t size)
|
||||||
{
|
{
|
||||||
if (fDataStream) {
|
if (fDataStream) {
|
||||||
if (size == (size_t)fDataStream->Read(buffer, size)) {
|
if (size == (size_t)fDataStream->Read(buffer, size)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user