Applied following patches proposed by Jorma Karvonen:
#7135 #7140 #7141 #7145 #7186 #7188 #7191 #7136 #7187 #7184 #7185 #7192 #7138 #7139 with some changes and exclusions: - all attempts to localize "fprintf(stderr,..." and "printf(..." replaced by _untranslated_ "syslog(LOG_ERR ..."; - following *Translator.rdef files, that were not added in mentioned patches were additionally created: SGI, TIFF, RAW, RTF, PPM, WebP, EXR, STXT, WonderBrush, GIF, TGA; - some small fixes for consistent catalogs building. Thank you, Jorma! Please check. ;-) git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@40357 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -0,0 +1,15 @@
|
|||||||
|
/*
|
||||||
|
* BMPTranslator.rdef
|
||||||
|
*/
|
||||||
|
|
||||||
|
resource app_signature "application/x-vnd.Haiku-BMPTranslator";
|
||||||
|
|
||||||
|
resource app_version {
|
||||||
|
major = 1,
|
||||||
|
middle = 0,
|
||||||
|
minor = 0,
|
||||||
|
variety = 0,
|
||||||
|
internal = 0,
|
||||||
|
short_info = "1.0.0",
|
||||||
|
long_info = "Haiku BMPTranslator Add-Ons."
|
||||||
|
};
|
||||||
@@ -4,13 +4,14 @@ SetSubDirSupportedPlatformsBeOSCompatible ;
|
|||||||
|
|
||||||
SubDirHdrs [ FDirName $(SUBDIR) $(DOTDOT) shared ] ;
|
SubDirHdrs [ FDirName $(SUBDIR) $(DOTDOT) shared ] ;
|
||||||
|
|
||||||
|
AddResources BMPTranslator : BMPTranslator.rdef ;
|
||||||
|
|
||||||
Translator BMPTranslator :
|
Translator BMPTranslator :
|
||||||
BMPMain.cpp
|
BMPMain.cpp
|
||||||
BMPTranslator.cpp
|
BMPTranslator.cpp
|
||||||
BMPView.cpp
|
BMPView.cpp
|
||||||
|
: be translation libtranslatorsutils.a $(TARGET_LIBSUPC++)
|
||||||
: be translation libtranslatorsutils.a $(HAIKU_LOCALE_LIBS)
|
$(HAIKU_LOCALE_LIBS)
|
||||||
$(TARGET_LIBSUPC++)
|
|
||||||
: true
|
: true
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
/*
|
||||||
|
* EXRTranslator.rdef
|
||||||
|
*/
|
||||||
|
|
||||||
|
resource app_signature "application/x-vnd.Haiku-EXRTranslator";
|
||||||
|
|
||||||
|
resource app_version {
|
||||||
|
major = 0,
|
||||||
|
middle = 1,
|
||||||
|
minor = 0,
|
||||||
|
variety = 0,
|
||||||
|
internal = 0,
|
||||||
|
short_info = "0.1.0",
|
||||||
|
long_info = "Haiku EXRTranslator Add-Ons."
|
||||||
|
};
|
||||||
@@ -7,6 +7,8 @@ SubDirSysHdrs [ FDirName $(SUBDIR) openexr imath ] ;
|
|||||||
|
|
||||||
SubDirHdrs [ FDirName $(SUBDIR) $(DOTDOT) shared ] ;
|
SubDirHdrs [ FDirName $(SUBDIR) $(DOTDOT) shared ] ;
|
||||||
|
|
||||||
|
AddResources EXRTranslator : EXRTranslator.rdef ;
|
||||||
|
|
||||||
Translator EXRTranslator :
|
Translator EXRTranslator :
|
||||||
main.cpp
|
main.cpp
|
||||||
ConfigView.cpp
|
ConfigView.cpp
|
||||||
|
|||||||
@@ -19,6 +19,7 @@
|
|||||||
#include <InterfaceDefs.h>
|
#include <InterfaceDefs.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <syslog.h>
|
||||||
|
|
||||||
extern bool debug;
|
extern bool debug;
|
||||||
|
|
||||||
@@ -40,7 +41,8 @@ GIFLoad::GIFLoad(BPositionIO *input, BPositionIO *output)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
printf("GIFLoad::GIFLoad() - Image dimensions are %d x %d\n", fWidth, fHeight);
|
syslog(LOG_ERR, "GIFLoad::GIFLoad() - Image dimensions are %d x %d\n",
|
||||||
|
fWidth, fHeight);
|
||||||
|
|
||||||
unsigned char c;
|
unsigned char c;
|
||||||
if (fInput->Read(&c, 1) < 1) {
|
if (fInput->Read(&c, 1) < 1) {
|
||||||
@@ -51,11 +53,12 @@ GIFLoad::GIFLoad(BPositionIO *input, BPositionIO *output)
|
|||||||
if (c == 0x2c) {
|
if (c == 0x2c) {
|
||||||
if ((!ReadGIFImageHeader()) || (!ReadGIFImageData())) {
|
if ((!ReadGIFImageHeader()) || (!ReadGIFImageData())) {
|
||||||
if (debug)
|
if (debug)
|
||||||
printf("GIFLoad::GIFLoad() - A fatal error occurred\n");
|
syslog(LOG_ERR, "GIFLoad::GIFLoad() - A fatal error occurred\n");
|
||||||
fatalerror = true;
|
fatalerror = true;
|
||||||
} else {
|
} else {
|
||||||
if (debug)
|
if (debug)
|
||||||
printf("GIFLoad::GIFLoad() - Found a single image and leaving\n");
|
syslog(LOG_ERR, "GIFLoad::GIFLoad() - Found a single image and "
|
||||||
|
"leaving\n");
|
||||||
}
|
}
|
||||||
free(fScanLine);
|
free(fScanLine);
|
||||||
fScanLine = NULL;
|
fScanLine = NULL;
|
||||||
@@ -99,7 +102,7 @@ GIFLoad::GIFLoad(BPositionIO *input, BPositionIO *output)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (debug)
|
if (debug)
|
||||||
printf("GIFLoad::GIFLoad() - Done\n");
|
syslog(LOG_ERR, "GIFLoad::GIFLoad() - Done\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -117,7 +120,8 @@ GIFLoad::ReadGIFHeader()
|
|||||||
if (header[10] & GIF_LOCALCOLORMAP) {
|
if (header[10] & GIF_LOCALCOLORMAP) {
|
||||||
fPalette->size_in_bits = (header[10] & 0x07) + 1;
|
fPalette->size_in_bits = (header[10] & 0x07) + 1;
|
||||||
if (debug)
|
if (debug)
|
||||||
printf("GIFLoad::ReadGIFHeader() - Found %d bit global palette\n", fPalette->size_in_bits);
|
syslog(LOG_ERR, "GIFLoad::ReadGIFHeader() - Found %d bit global palette\n",
|
||||||
|
fPalette->size_in_bits);
|
||||||
int s = 1 << fPalette->size_in_bits;
|
int s = 1 << fPalette->size_in_bits;
|
||||||
fPalette->size = s;
|
fPalette->size = s;
|
||||||
|
|
||||||
@@ -131,8 +135,8 @@ GIFLoad::ReadGIFHeader()
|
|||||||
} else { // Install BeOS system palette in case local palette isn't present
|
} else { // Install BeOS system palette in case local palette isn't present
|
||||||
color_map *map = (color_map *)system_colors();
|
color_map *map = (color_map *)system_colors();
|
||||||
for (int x = 0; x < 256; x++) {
|
for (int x = 0; x < 256; x++) {
|
||||||
fPalette->SetColor(x, map->color_list[x].red, map->color_list[x].green,
|
fPalette->SetColor(x, map->color_list[x].red,
|
||||||
map->color_list[x].blue);
|
map->color_list[x].green, map->color_list[x].blue);
|
||||||
}
|
}
|
||||||
fPalette->size = 256;
|
fPalette->size = 256;
|
||||||
fPalette->size_in_bits = 8;
|
fPalette->size_in_bits = 8;
|
||||||
@@ -169,7 +173,8 @@ GIFLoad::ReadGIFControlBlock()
|
|||||||
fPalette->usetransparent = true;
|
fPalette->usetransparent = true;
|
||||||
fPalette->transparentindex = data[4];
|
fPalette->transparentindex = data[4];
|
||||||
if (debug)
|
if (debug)
|
||||||
printf("GIFLoad::ReadGIFControlBlock() - Transparency active, using palette index %d\n", data[4]);
|
syslog(LOG_ERR, "GIFLoad::ReadGIFControlBlock() - Transparency active, "
|
||||||
|
"using palette index %d\n", data[4]);
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -178,7 +183,7 @@ GIFLoad::ReadGIFControlBlock()
|
|||||||
bool
|
bool
|
||||||
GIFLoad::ReadGIFCommentBlock()
|
GIFLoad::ReadGIFCommentBlock()
|
||||||
{
|
{
|
||||||
if (debug) printf("GIFLoad::ReadGIFCommentBlock() - Found:\n");
|
if (debug) syslog(LOG_ERR, "GIFLoad::ReadGIFCommentBlock() - Found:\n");
|
||||||
unsigned char length;
|
unsigned char length;
|
||||||
char comment_data[256];
|
char comment_data[256];
|
||||||
do {
|
do {
|
||||||
@@ -188,10 +193,10 @@ GIFLoad::ReadGIFCommentBlock()
|
|||||||
return false;
|
return false;
|
||||||
comment_data[length] = 0x00;
|
comment_data[length] = 0x00;
|
||||||
if (debug)
|
if (debug)
|
||||||
printf("%s", comment_data);
|
syslog(LOG_ERR, "%s", comment_data);
|
||||||
} while (length != 0x00);
|
} while (length != 0x00);
|
||||||
if (debug)
|
if (debug)
|
||||||
printf("\n");
|
syslog(LOG_ERR, "\n");
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -200,7 +205,7 @@ bool
|
|||||||
GIFLoad::ReadGIFUnknownBlock(unsigned char c)
|
GIFLoad::ReadGIFUnknownBlock(unsigned char c)
|
||||||
{
|
{
|
||||||
if (debug)
|
if (debug)
|
||||||
printf("GIFLoad::ReadGIFUnknownBlock() - Found: %d\n", c);
|
syslog(LOG_ERR, "GIFLoad::ReadGIFUnknownBlock() - Found: %d\n", c);
|
||||||
unsigned char length;
|
unsigned char length;
|
||||||
do {
|
do {
|
||||||
if (fInput->Read(&length, 1) < 1)
|
if (fInput->Read(&length, 1) < 1)
|
||||||
@@ -222,15 +227,17 @@ GIFLoad::ReadGIFImageHeader()
|
|||||||
int localHeight = data[6] + (data[7] << 8);
|
int localHeight = data[6] + (data[7] << 8);
|
||||||
if (fWidth != localWidth || fHeight != localHeight) {
|
if (fWidth != localWidth || fHeight != localHeight) {
|
||||||
if (debug)
|
if (debug)
|
||||||
printf("GIFLoad::ReadGIFImageHeader() - Local dimensions do not match global, setting to %d x %d\n",
|
syslog(LOG_ERR, "GIFLoad::ReadGIFImageHeader() - Local dimensions do not "
|
||||||
localWidth, localHeight);
|
"match global, setting to %d x %d\n", localWidth, localHeight);
|
||||||
fWidth = localWidth;
|
fWidth = localWidth;
|
||||||
fHeight = localHeight;
|
fHeight = localHeight;
|
||||||
}
|
}
|
||||||
|
|
||||||
fScanLine = (uint32 *)malloc(fWidth * 4);
|
fScanLine = (uint32 *)malloc(fWidth * 4);
|
||||||
if (fScanLine == NULL) {
|
if (fScanLine == NULL) {
|
||||||
if (debug) printf("GIFLoad::ReadGIFImageHeader() - Could not allocate scanline\n");
|
if (debug)
|
||||||
|
syslog(LOG_ERR, "GIFLoad::ReadGIFImageHeader() - Could not allocate "
|
||||||
|
"scanline\n");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -253,8 +260,8 @@ GIFLoad::ReadGIFImageHeader()
|
|||||||
int s = 1 << fPalette->size_in_bits;
|
int s = 1 << fPalette->size_in_bits;
|
||||||
fPalette->size = s;
|
fPalette->size = s;
|
||||||
if (debug)
|
if (debug)
|
||||||
printf("GIFLoad::ReadGIFImageHeader() - Found %d bit local palette\n",
|
syslog(LOG_ERR, "GIFLoad::ReadGIFImageHeader() - Found %d bit local "
|
||||||
fPalette->size_in_bits);
|
"palette\n", fPalette->size_in_bits);
|
||||||
|
|
||||||
unsigned char lp[256 * 3];
|
unsigned char lp[256 * 3];
|
||||||
if (fInput->Read(lp, s * 3) < s * 3)
|
if (fInput->Read(lp, s * 3) < s * 3)
|
||||||
@@ -267,9 +274,10 @@ GIFLoad::ReadGIFImageHeader()
|
|||||||
fInterlaced = data[8] & GIF_INTERLACED;
|
fInterlaced = data[8] & GIF_INTERLACED;
|
||||||
if (debug) {
|
if (debug) {
|
||||||
if (fInterlaced)
|
if (fInterlaced)
|
||||||
printf("GIFLoad::ReadGIFImageHeader() - Image is interlaced\n");
|
syslog(LOG_ERR, "GIFLoad::ReadGIFImageHeader() - Image is interlaced\n");
|
||||||
else
|
else
|
||||||
printf("GIFLoad::ReadGIFImageHeader() - Image is not interlaced\n");
|
syslog(LOG_ERR, "GIFLoad::ReadGIFImageHeader() - Image is not "
|
||||||
|
"interlaced\n");
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -287,17 +295,19 @@ GIFLoad::ReadGIFImageData()
|
|||||||
return false;
|
return false;
|
||||||
} else if (cs > fPalette->size_in_bits) {
|
} else if (cs > fPalette->size_in_bits) {
|
||||||
if (debug)
|
if (debug)
|
||||||
printf("GIFLoad::ReadGIFImageData() - Code_size should be %d, not %d, allowing it\n", fCodeSize, cs);
|
syslog(LOG_ERR, "GIFLoad::ReadGIFImageData() - Code_size should be %d, not "
|
||||||
|
"%d, allowing it\n", fCodeSize, cs);
|
||||||
if (!InitFrame(cs))
|
if (!InitFrame(cs))
|
||||||
return false;
|
return false;
|
||||||
} else if (cs < fPalette->size_in_bits) {
|
} else if (cs < fPalette->size_in_bits) {
|
||||||
if (debug)
|
if (debug)
|
||||||
printf("GIFLoad::ReadGIFImageData() - Code_size should be %d, not %d\n", fCodeSize, cs);
|
syslog(LOG_ERR, "GIFLoad::ReadGIFImageData() - Code_size should be %d, not "
|
||||||
|
"%d\n", fCodeSize, cs);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
printf("GIFLoad::ReadGIFImageData() - Starting LZW\n");
|
syslog(LOG_ERR, "GIFLoad::ReadGIFImageData() - Starting LZW\n");
|
||||||
|
|
||||||
while ((fNewCode = NextCode()) != -1 && fNewCode != fEndCode) {
|
while ((fNewCode = NextCode()) != -1 && fNewCode != fEndCode) {
|
||||||
if (fNewCode == fClearCode) {
|
if (fNewCode == fClearCode) {
|
||||||
@@ -308,7 +318,8 @@ GIFLoad::ReadGIFImageData()
|
|||||||
if (!OutputColor(fOldCode, 1)) goto bad_end;
|
if (!OutputColor(fOldCode, 1)) goto bad_end;
|
||||||
if (fNewCode == -1 || fNewCode == fEndCode) {
|
if (fNewCode == -1 || fNewCode == fEndCode) {
|
||||||
if (debug)
|
if (debug)
|
||||||
printf("GIFLoad::ReadGIFImageData() - Premature fEndCode or error\n");
|
syslog(LOG_ERR, "GIFLoad::ReadGIFImageData() - Premature fEndCode "
|
||||||
|
"or error\n");
|
||||||
goto bad_end;
|
goto bad_end;
|
||||||
}
|
}
|
||||||
continue;
|
continue;
|
||||||
@@ -373,12 +384,12 @@ GIFLoad::ReadGIFImageData()
|
|||||||
if (fNewCode == -1)
|
if (fNewCode == -1)
|
||||||
return false;
|
return false;
|
||||||
if (debug)
|
if (debug)
|
||||||
printf("GIFLoad::ReadGIFImageData() - Done\n");
|
syslog(LOG_ERR, "GIFLoad::ReadGIFImageData() - Done\n");
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
bad_end:
|
bad_end:
|
||||||
if (debug)
|
if (debug)
|
||||||
printf("GIFLoad::ReadGIFImageData() - Reached a bad end\n");
|
syslog(LOG_ERR, "GIFLoad::ReadGIFImageData() - Reached a bad end\n");
|
||||||
MemblockDeleteAll();
|
MemblockDeleteAll();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -391,7 +402,8 @@ GIFLoad::NextCode()
|
|||||||
if (fByteCount == 0) {
|
if (fByteCount == 0) {
|
||||||
if (fInput->Read(&fByteCount, 1) < 1) return -1;
|
if (fInput->Read(&fByteCount, 1) < 1) return -1;
|
||||||
if (fByteCount == 0) return fEndCode;
|
if (fByteCount == 0) return fEndCode;
|
||||||
if (fInput->Read(fByteBuffer + (255 - fByteCount), fByteCount) < fByteCount) return -1;
|
if (fInput->Read(fByteBuffer + (255 - fByteCount),
|
||||||
|
fByteCount) < fByteCount) return -1;
|
||||||
}
|
}
|
||||||
fBitBuffer |= (unsigned int)fByteBuffer[255 - fByteCount] << fBitCount;
|
fBitBuffer |= (unsigned int)fByteBuffer[255 - fByteCount] << fBitCount;
|
||||||
fByteCount--;
|
fByteCount--;
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
#include "GIFSave.h"
|
#include "GIFSave.h"
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
#include <syslog.h>
|
||||||
|
|
||||||
const int gs_pass_starts_at[] = {0, 4, 2, 1, 0};
|
const int gs_pass_starts_at[] = {0, 4, 2, 1, 0};
|
||||||
const int gs_increment_pass_by[] = {8, 8, 4, 2, 0};
|
const int gs_increment_pass_by[] = {8, 8, 4, 2, 0};
|
||||||
@@ -38,7 +39,7 @@ GIFSave::GIFSave(BBitmap *bitmap, BPositionIO *output)
|
|||||||
{
|
{
|
||||||
color_space cs = bitmap->ColorSpace();
|
color_space cs = bitmap->ColorSpace();
|
||||||
if (cs != B_RGB32 && cs != B_RGBA32 && cs != B_RGB32_BIG && cs != B_RGBA32_BIG) {
|
if (cs != B_RGB32 && cs != B_RGBA32 && cs != B_RGB32_BIG && cs != B_RGBA32_BIG) {
|
||||||
if (debug) printf("GIFSave::GIFSave() - Unknown color space\n");
|
if (debug) syslog(LOG_ERR, "GIFSave::GIFSave() - Unknown color space\n");
|
||||||
fatalerror = true;
|
fatalerror = true;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -56,10 +57,13 @@ GIFSave::GIFSave(BBitmap *bitmap, BPositionIO *output)
|
|||||||
|
|
||||||
width = bitmap->Bounds().IntegerWidth() + 1;
|
width = bitmap->Bounds().IntegerWidth() + 1;
|
||||||
height = bitmap->Bounds().IntegerHeight() + 1;
|
height = bitmap->Bounds().IntegerHeight() + 1;
|
||||||
if (debug) printf("GIFSave::GIFSave() - Image dimensions are %d by %d\n", width, height);
|
if (debug)
|
||||||
|
syslog(LOG_ERR, "GIFSave::GIFSave() - Image dimensions are %d by %d\n",
|
||||||
|
width, height);
|
||||||
|
|
||||||
if (prefs->usedithering) {
|
if (prefs->usedithering) {
|
||||||
if (debug) printf("GIFSave::GIFSave() - Using dithering\n");
|
if (debug)
|
||||||
|
syslog(LOG_ERR, "GIFSave::GIFSave() - Using dithering\n");
|
||||||
red_error = new int32[width + 2];
|
red_error = new int32[width + 2];
|
||||||
red_error = &red_error[1]; // Allow index of -1 too
|
red_error = &red_error[1]; // Allow index of -1 too
|
||||||
green_error = new int32[width + 2];
|
green_error = new int32[width + 2];
|
||||||
@@ -74,25 +78,27 @@ GIFSave::GIFSave(BBitmap *bitmap, BPositionIO *output)
|
|||||||
blue_error[x] = 0;
|
blue_error[x] = 0;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (debug) printf("GIFSave::GIFSave() - Not using dithering\n");
|
if (debug)
|
||||||
|
syslog(LOG_ERR, "GIFSave::GIFSave() - Not using dithering\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (debug) {
|
if (debug) {
|
||||||
if (prefs->interlaced) printf("GIFSave::GIFSave() - Interlaced, ");
|
if (prefs->interlaced)
|
||||||
else printf("GIFSave::GIFSave() - Not interlaced, ");
|
syslog(LOG_ERR, "GIFSave::GIFSave() - Interlaced, ");
|
||||||
|
else syslog(LOG_ERR, "GIFSave::GIFSave() - Not interlaced, ");
|
||||||
switch (prefs->palettemode) {
|
switch (prefs->palettemode) {
|
||||||
case WEB_SAFE_PALETTE:
|
case WEB_SAFE_PALETTE:
|
||||||
printf("web safe palette\n");
|
syslog(LOG_ERR, "web safe palette\n");
|
||||||
break;
|
break;
|
||||||
case BEOS_SYSTEM_PALETTE:
|
case BEOS_SYSTEM_PALETTE:
|
||||||
printf("BeOS system palette\n");
|
syslog(LOG_ERR, "BeOS system palette\n");
|
||||||
break;
|
break;
|
||||||
case GREYSCALE_PALETTE:
|
case GREYSCALE_PALETTE:
|
||||||
printf("greyscale palette\n");
|
syslog(LOG_ERR, "greyscale palette\n");
|
||||||
break;
|
break;
|
||||||
case OPTIMAL_PALETTE:
|
case OPTIMAL_PALETTE:
|
||||||
default:
|
default:
|
||||||
printf("optimal palette\n");
|
syslog(LOG_ERR, "optimal palette\n");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -101,34 +107,36 @@ GIFSave::GIFSave(BBitmap *bitmap, BPositionIO *output)
|
|||||||
if (prefs->usetransparentauto) {
|
if (prefs->usetransparentauto) {
|
||||||
palette->PrepareForAutoTransparency();
|
palette->PrepareForAutoTransparency();
|
||||||
if (debug)
|
if (debug)
|
||||||
printf("GIFSave::GIFSave() - Using transparent index %d\n", palette->TransparentIndex());
|
syslog(LOG_ERR, "GIFSave::GIFSave() - Using transparent index %d\n",
|
||||||
|
palette->TransparentIndex());
|
||||||
} else {
|
} else {
|
||||||
palette->SetTransparentColor((uint8)prefs->transparentred,
|
palette->SetTransparentColor((uint8)prefs->transparentred,
|
||||||
(uint8)prefs->transparentgreen,
|
(uint8)prefs->transparentgreen,
|
||||||
(uint8)prefs->transparentblue);
|
(uint8)prefs->transparentblue);
|
||||||
if (debug) {
|
if (debug) {
|
||||||
printf("GIFSave::GIFSave() - Found transparent color %d,%d,%d at index %d\n",
|
syslog(LOG_ERR, "GIFSave::GIFSave() - Found transparent color %d,%d,%d "
|
||||||
prefs->transparentred, prefs->transparentgreen, prefs->transparentblue,
|
"at index %d\n", prefs->transparentred,
|
||||||
palette->TransparentIndex());
|
prefs->transparentgreen, prefs->transparentblue,
|
||||||
|
palette->TransparentIndex());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (debug)
|
if (debug)
|
||||||
printf("GIFSave::GIFSave() - Not using transparency\n");
|
syslog(LOG_ERR, "GIFSave::GIFSave() - Not using transparency\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
this->output = output;
|
this->output = output;
|
||||||
this->bitmap = bitmap;
|
this->bitmap = bitmap;
|
||||||
WriteGIFHeader();
|
WriteGIFHeader();
|
||||||
if (debug) printf("GIFSave::GIFSave() - Wrote gif header\n");
|
if (debug) syslog(LOG_ERR, "GIFSave::GIFSave() - Wrote gif header\n");
|
||||||
|
|
||||||
hash = new SFHash(1 << 16);
|
hash = new SFHash(1 << 16);
|
||||||
WriteGIFControlBlock();
|
WriteGIFControlBlock();
|
||||||
if (debug) printf("GIFSave::GIFSave() - Wrote gif control block\n");
|
if (debug) syslog(LOG_ERR, "GIFSave::GIFSave() - Wrote gif control block\n");
|
||||||
WriteGIFImageHeader();
|
WriteGIFImageHeader();
|
||||||
if (debug) printf("GIFSave::GIFSave() - Wrote gif image header\n");
|
if (debug) syslog(LOG_ERR, "GIFSave::GIFSave() - Wrote gif image header\n");
|
||||||
WriteGIFImageData();
|
WriteGIFImageData();
|
||||||
if (debug) printf("GIFSave::GIFSave() - Wrote gif image data\n");
|
if (debug) syslog(LOG_ERR, "GIFSave::GIFSave() - Wrote gif image data\n");
|
||||||
|
|
||||||
if (prefs->usedithering) {
|
if (prefs->usedithering) {
|
||||||
delete [] &red_error[-1];
|
delete [] &red_error[-1];
|
||||||
|
|||||||
@@ -18,20 +18,29 @@
|
|||||||
#include "GIFView.h"
|
#include "GIFView.h"
|
||||||
#include "GIFSave.h"
|
#include "GIFSave.h"
|
||||||
#include "GIFLoad.h"
|
#include "GIFLoad.h"
|
||||||
|
|
||||||
|
|
||||||
#include <ByteOrder.h>
|
#include <ByteOrder.h>
|
||||||
#include <TypeConstants.h>
|
#include <Catalog.h>
|
||||||
#include <DataIO.h>
|
#include <DataIO.h>
|
||||||
|
#include <InterfaceDefs.h>
|
||||||
|
#include <TypeConstants.h>
|
||||||
#include <TranslatorAddOn.h>
|
#include <TranslatorAddOn.h>
|
||||||
#include <TranslatorFormats.h>
|
#include <TranslatorFormats.h>
|
||||||
#include <InterfaceDefs.h>
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <syslog.h>
|
||||||
|
|
||||||
#ifndef GIF_TYPE
|
#ifndef GIF_TYPE
|
||||||
#define GIF_TYPE 'GIF '
|
#define GIF_TYPE 'GIF '
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#undef B_TRANSLATE_CONTEXT
|
||||||
|
#define B_TRANSLATE_CONTEXT "GIFTranslator"
|
||||||
|
|
||||||
|
|
||||||
// This global will be externed in other files - set once here
|
// This global will be externed in other files - set once here
|
||||||
// for the entire translator
|
// for the entire translator
|
||||||
bool debug = false;
|
bool debug = false;
|
||||||
@@ -45,14 +54,18 @@ char translatorInfo[] = "GIF image translator v1.4";
|
|||||||
int32 translatorVersion = 0x140;
|
int32 translatorVersion = 0x140;
|
||||||
|
|
||||||
translation_format inputFormats[] = {
|
translation_format inputFormats[] = {
|
||||||
{ GIF_TYPE, B_TRANSLATOR_BITMAP, 0.8, 0.8, "image/gif", "GIF image" },
|
{ GIF_TYPE, B_TRANSLATOR_BITMAP, 0.8, 0.8, "image/gif",
|
||||||
{ B_TRANSLATOR_BITMAP, B_TRANSLATOR_BITMAP, 0.3, 0.3, "image/x-be-bitmap", "Be Bitmap Format (GIFTranslator)" },
|
"GIF image" },
|
||||||
|
{ B_TRANSLATOR_BITMAP, B_TRANSLATOR_BITMAP, 0.3, 0.3, "image/x-be-bitmap",
|
||||||
|
"Be Bitmap Format (GIFTranslator)" },
|
||||||
{ 0 }
|
{ 0 }
|
||||||
};
|
};
|
||||||
|
|
||||||
translation_format outputFormats[] = {
|
translation_format outputFormats[] = {
|
||||||
{ GIF_TYPE, B_TRANSLATOR_BITMAP, 0.8, 0.8, "image/gif", "GIF image" },
|
{ GIF_TYPE, B_TRANSLATOR_BITMAP, 0.8, 0.8, "image/gif",
|
||||||
{ B_TRANSLATOR_BITMAP, B_TRANSLATOR_BITMAP, 0.3, 0.3, "image/x-be-bitmap", "Be Bitmap Format (GIFTranslator)" },
|
"GIF image" },
|
||||||
|
{ B_TRANSLATOR_BITMAP, B_TRANSLATOR_BITMAP, 0.3, 0.3, "image/x-be-bitmap",
|
||||||
|
"Be Bitmap Format (GIFTranslator)" },
|
||||||
{ 0 }
|
{ 0 }
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -79,15 +92,18 @@ DetermineType(BPositionIO *source, bool *is_gif)
|
|||||||
if (source->Read(header, 6) != 6) return false;
|
if (source->Read(header, 6) != 6) return false;
|
||||||
header[6] = 0x00;
|
header[6] = 0x00;
|
||||||
|
|
||||||
if (strcmp((char *)header, "GIF87a") != 0 && strcmp((char *)header, "GIF89a") != 0) {
|
if (strcmp((char *)header, "GIF87a") != 0 && strcmp((char *)header,
|
||||||
|
"GIF89a") != 0) {
|
||||||
*is_gif = false;
|
*is_gif = false;
|
||||||
int32 magic = (header[0] << 24) + (header[1] << 16) + (header[2] << 8) + header[3];
|
int32 magic = (header[0] << 24) + (header[1] << 16) + (header[2] << 8)
|
||||||
|
+ header[3];
|
||||||
if (magic != B_TRANSLATOR_BITMAP) return false;
|
if (magic != B_TRANSLATOR_BITMAP) return false;
|
||||||
source->Seek(5 * 4 - 2, SEEK_CUR);
|
source->Seek(5 * 4 - 2, SEEK_CUR);
|
||||||
color_space cs;
|
color_space cs;
|
||||||
if (source->Read(&cs, 4) != 4) return false;
|
if (source->Read(&cs, 4) != 4) return false;
|
||||||
cs = (color_space)B_BENDIAN_TO_HOST_INT32(cs);
|
cs = (color_space)B_BENDIAN_TO_HOST_INT32(cs);
|
||||||
if (cs != B_RGB32 && cs != B_RGBA32 && cs != B_RGB32_BIG && cs != B_RGBA32_BIG) return false;
|
if (cs != B_RGB32 && cs != B_RGBA32 && cs != B_RGB32_BIG && cs
|
||||||
|
!= B_RGBA32_BIG) return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
source->Seek(0, SEEK_SET);
|
source->Seek(0, SEEK_SET);
|
||||||
@@ -141,7 +157,8 @@ Identify(BPositionIO *inSource, const translation_format *inFormat,
|
|||||||
if ((debug_text != NULL) && (atoi(debug_text) != 0)) debug = true;
|
if ((debug_text != NULL) && (atoi(debug_text) != 0)) debug = true;
|
||||||
|
|
||||||
if (outType == 0) outType = B_TRANSLATOR_BITMAP;
|
if (outType == 0) outType = B_TRANSLATOR_BITMAP;
|
||||||
if (outType != GIF_TYPE && outType != B_TRANSLATOR_BITMAP) return B_NO_TRANSLATOR;
|
if (outType != GIF_TYPE && outType != B_TRANSLATOR_BITMAP)
|
||||||
|
return B_NO_TRANSLATOR;
|
||||||
|
|
||||||
bool is_gif;
|
bool is_gif;
|
||||||
if (!DetermineType(inSource, &is_gif)) return B_NO_TRANSLATOR;
|
if (!DetermineType(inSource, &is_gif)) return B_NO_TRANSLATOR;
|
||||||
@@ -153,14 +170,14 @@ Identify(BPositionIO *inSource, const translation_format *inFormat,
|
|||||||
outInfo->type = GIF_TYPE;
|
outInfo->type = GIF_TYPE;
|
||||||
outInfo->quality = 0.8;
|
outInfo->quality = 0.8;
|
||||||
outInfo->capability = 0.8;
|
outInfo->capability = 0.8;
|
||||||
strcpy(outInfo->name, "GIF image");
|
strcpy(outInfo->name, B_TRANSLATE("GIF image"));
|
||||||
strcpy(outInfo->MIME, "image/gif");
|
strcpy(outInfo->MIME, "image/gif");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
outInfo->type = B_TRANSLATOR_BITMAP;
|
outInfo->type = B_TRANSLATOR_BITMAP;
|
||||||
outInfo->quality = 0.3;
|
outInfo->quality = 0.3;
|
||||||
outInfo->capability = 0.3;
|
outInfo->capability = 0.3;
|
||||||
strcpy(outInfo->name, "Be Bitmap Format (GIFTranslator)");
|
strcpy(outInfo->name, B_TRANSLATE("Be Bitmap Format (GIFTranslator)"));
|
||||||
strcpy(outInfo->MIME, "image/x-be-bitmap");
|
strcpy(outInfo->MIME, "image/x-be-bitmap");
|
||||||
}
|
}
|
||||||
return B_OK;
|
return B_OK;
|
||||||
@@ -213,7 +230,7 @@ Translate(BPositionIO *inSource, const translator_info *inInfo,
|
|||||||
|
|
||||||
if (debug) {
|
if (debug) {
|
||||||
now = system_time() - now;
|
now = system_time() - now;
|
||||||
printf("Translate() - Translation took %Ld microseconds\n", now);
|
syslog(LOG_ERR, "Translate() - Translation took %Ld microseconds\n", now);
|
||||||
}
|
}
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
@@ -223,7 +240,7 @@ GIFTranslator::GIFTranslator()
|
|||||||
: BApplication("application/x-vnd.Haiku-GIFTranslator")
|
: BApplication("application/x-vnd.Haiku-GIFTranslator")
|
||||||
{
|
{
|
||||||
BRect rect(100, 100, 339, 339);
|
BRect rect(100, 100, 339, 339);
|
||||||
gifwindow = new GIFWindow(rect, "GIF Settings");
|
gifwindow = new GIFWindow(rect, B_TRANSLATE("GIF Settings"));
|
||||||
gifwindow->Show();
|
gifwindow->Show();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
/*
|
||||||
|
* GIFTranslator.rdef
|
||||||
|
*/
|
||||||
|
|
||||||
|
resource app_signature "application/x-vnd.Haiku-GIFTranslator";
|
||||||
|
|
||||||
|
resource app_version {
|
||||||
|
major = 1,
|
||||||
|
middle = 4,
|
||||||
|
minor = 0,
|
||||||
|
variety = 0,
|
||||||
|
internal = 0,
|
||||||
|
short_info = "1.4.0",
|
||||||
|
long_info = "Haiku GIFTranslator Add-Ons."
|
||||||
|
};
|
||||||
@@ -19,6 +19,7 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
#include <Catalog.h>
|
||||||
#include <GridLayoutBuilder.h>
|
#include <GridLayoutBuilder.h>
|
||||||
#include <GroupLayout.h>
|
#include <GroupLayout.h>
|
||||||
#include <GroupLayoutBuilder.h>
|
#include <GroupLayoutBuilder.h>
|
||||||
@@ -30,6 +31,10 @@
|
|||||||
|
|
||||||
#include "GIFView.h"
|
#include "GIFView.h"
|
||||||
|
|
||||||
|
#undef B_TRANSLATE_CONTEXT
|
||||||
|
#define B_TRANSLATE_CONTEXT "GIFView"
|
||||||
|
|
||||||
|
|
||||||
extern int32 translatorVersion;
|
extern int32 translatorVersion;
|
||||||
extern char translatorName[];
|
extern char translatorName[];
|
||||||
|
|
||||||
@@ -43,25 +48,31 @@ GIFView::GIFView(const char *name)
|
|||||||
title->SetFont(be_bold_font);
|
title->SetFont(be_bold_font);
|
||||||
|
|
||||||
char version_string[100];
|
char version_string[100];
|
||||||
sprintf(version_string, "v%d.%d.%d %s", (int)(translatorVersion >> 8), (int)((translatorVersion >> 4) & 0xf),
|
sprintf(version_string, "v%d.%d.%d %s", (int)(translatorVersion >> 8),
|
||||||
(int)(translatorVersion & 0xf), __DATE__);
|
(int)((translatorVersion >> 4) & 0xf), (int)(translatorVersion & 0xf),
|
||||||
|
__DATE__);
|
||||||
BStringView *version = new BStringView("Version", version_string);
|
BStringView *version = new BStringView("Version", version_string);
|
||||||
|
|
||||||
const char *copyrightString = "©2003 Daniel Switkin, [email protected]";
|
const char *copyrightString = "©2003 Daniel Switkin, [email protected]";
|
||||||
BStringView *copyright = new BStringView("Copyright", copyrightString);
|
BStringView *copyright = new BStringView("Copyright", copyrightString);
|
||||||
|
|
||||||
// menu fields (Palette & Colors)
|
// menu fields (Palette & Colors)
|
||||||
fWebSafeMI = new BMenuItem("Websafe", new BMessage(GV_WEB_SAFE), 0, 0);
|
fWebSafeMI = new BMenuItem(B_TRANSLATE("Websafe"),
|
||||||
fBeOSSystemMI = new BMenuItem("BeOS system", new BMessage(GV_BEOS_SYSTEM), 0, 0);
|
new BMessage(GV_WEB_SAFE), 0, 0);
|
||||||
fGreyScaleMI = new BMenuItem("Greyscale", new BMessage(GV_GREYSCALE), 0, 0);
|
fBeOSSystemMI = new BMenuItem(B_TRANSLATE("BeOS system"),
|
||||||
fOptimalMI = new BMenuItem("Optimal", new BMessage(GV_OPTIMAL), 0, 0);
|
new BMessage(GV_BEOS_SYSTEM), 0, 0);
|
||||||
|
fGreyScaleMI = new BMenuItem(B_TRANSLATE("Greyscale"),
|
||||||
|
new BMessage(GV_GREYSCALE), 0, 0);
|
||||||
|
fOptimalMI = new BMenuItem(B_TRANSLATE("Optimal"),
|
||||||
|
new BMessage(GV_OPTIMAL), 0, 0);
|
||||||
fPaletteM = new BPopUpMenu("PalettePopUpMenu", true, true, B_ITEMS_IN_COLUMN);
|
fPaletteM = new BPopUpMenu("PalettePopUpMenu", true, true, B_ITEMS_IN_COLUMN);
|
||||||
fPaletteM->AddItem(fWebSafeMI);
|
fPaletteM->AddItem(fWebSafeMI);
|
||||||
fPaletteM->AddItem(fBeOSSystemMI);
|
fPaletteM->AddItem(fBeOSSystemMI);
|
||||||
fPaletteM->AddItem(fGreyScaleMI);
|
fPaletteM->AddItem(fGreyScaleMI);
|
||||||
fPaletteM->AddItem(fOptimalMI);
|
fPaletteM->AddItem(fOptimalMI);
|
||||||
|
|
||||||
fColorCountM = new BPopUpMenu("ColorCountPopUpMenu", true, true, B_ITEMS_IN_COLUMN);
|
fColorCountM = new BPopUpMenu("ColorCountPopUpMenu", true, true,
|
||||||
|
B_ITEMS_IN_COLUMN);
|
||||||
int32 count = 2;
|
int32 count = 2;
|
||||||
for (int32 i = 0; i < 8; i++) {
|
for (int32 i = 0; i < 8; i++) {
|
||||||
BMessage* message = new BMessage(GV_SET_COLOR_COUNT);
|
BMessage* message = new BMessage(GV_SET_COLOR_COUNT);
|
||||||
@@ -74,25 +85,26 @@ GIFView::GIFView(const char *name)
|
|||||||
}
|
}
|
||||||
fColorCount256MI = fColorCountMI[7];
|
fColorCount256MI = fColorCountMI[7];
|
||||||
|
|
||||||
fPaletteMF = new BMenuField("Palette", fPaletteM, NULL);
|
fPaletteMF = new BMenuField(B_TRANSLATE("Palette"), fPaletteM, NULL);
|
||||||
|
|
||||||
fColorCountMF = new BMenuField("Colors", fColorCountM, NULL);
|
fColorCountMF = new BMenuField(B_TRANSLATE("Colors"), fColorCountM, NULL);
|
||||||
|
|
||||||
// check boxes
|
// check boxes
|
||||||
fUseDitheringCB = new BCheckBox("Use dithering",
|
fUseDitheringCB = new BCheckBox(B_TRANSLATE("Use dithering"),
|
||||||
new BMessage(GV_USE_DITHERING));
|
new BMessage(GV_USE_DITHERING));
|
||||||
|
|
||||||
fInterlacedCB = new BCheckBox("Write interlaced images",
|
fInterlacedCB = new BCheckBox(B_TRANSLATE("Write interlaced images"),
|
||||||
new BMessage(GV_INTERLACED));
|
new BMessage(GV_INTERLACED));
|
||||||
|
|
||||||
fUseTransparentCB = new BCheckBox("Write transparent images",
|
fUseTransparentCB = new BCheckBox(B_TRANSLATE("Write transparent images"),
|
||||||
new BMessage(GV_USE_TRANSPARENT));
|
new BMessage(GV_USE_TRANSPARENT));
|
||||||
|
|
||||||
// radio buttons
|
// radio buttons
|
||||||
fUseTransparentAutoRB = new BRadioButton("Automatic (from alpha channel)",
|
fUseTransparentAutoRB = new BRadioButton(
|
||||||
|
B_TRANSLATE("Automatic (from alpha channel)"),
|
||||||
new BMessage(GV_USE_TRANSPARENT_AUTO));
|
new BMessage(GV_USE_TRANSPARENT_AUTO));
|
||||||
|
|
||||||
fUseTransparentColorRB = new BRadioButton("Use RGB color",
|
fUseTransparentColorRB = new BRadioButton(B_TRANSLATE("Use RGB color"),
|
||||||
new BMessage(GV_USE_TRANSPARENT_COLOR));
|
new BMessage(GV_USE_TRANSPARENT_COLOR));
|
||||||
|
|
||||||
fTransparentRedTC = new BTextControl("", "0", new BMessage(GV_TRANSPARENT_RED));
|
fTransparentRedTC = new BTextControl("", "0", new BMessage(GV_TRANSPARENT_RED));
|
||||||
|
|||||||
@@ -2,6 +2,8 @@ SubDir HAIKU_TOP src add-ons translators gif ;
|
|||||||
|
|
||||||
SetSubDirSupportedPlatformsBeOSCompatible ;
|
SetSubDirSupportedPlatformsBeOSCompatible ;
|
||||||
|
|
||||||
|
AddResources GIFTranslator : GIFTranslator.rdef ;
|
||||||
|
|
||||||
Translator GIFTranslator :
|
Translator GIFTranslator :
|
||||||
# Main Source
|
# Main Source
|
||||||
GIFTranslator.cpp
|
GIFTranslator.cpp
|
||||||
@@ -20,6 +22,14 @@ Translator GIFTranslator :
|
|||||||
: true
|
: true
|
||||||
;
|
;
|
||||||
|
|
||||||
|
DoCatalogs GIFTranslator :
|
||||||
|
x-vnd.Haiku-GIFTranslator
|
||||||
|
:
|
||||||
|
GIFTranslator.cpp
|
||||||
|
GIFView.cpp
|
||||||
|
;
|
||||||
|
|
||||||
|
|
||||||
Package haiku-translationkit-cvs :
|
Package haiku-translationkit-cvs :
|
||||||
GIFTranslator :
|
GIFTranslator :
|
||||||
boot home config add-ons Translators ;
|
boot home config add-ons Translators ;
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
/*
|
||||||
|
* HVIFTranslator.rdef
|
||||||
|
*/
|
||||||
|
|
||||||
|
resource app_signature "application/x-vnd.Haiku-HVIFTranslator";
|
||||||
|
|
||||||
|
resource app_version {
|
||||||
|
major = 1,
|
||||||
|
middle = 0,
|
||||||
|
minor = 0,
|
||||||
|
variety = 0,
|
||||||
|
internal = 0,
|
||||||
|
short_info = "1.0.0",
|
||||||
|
long_info = "Haiku HVIFTranslator Add-Ons."
|
||||||
|
};
|
||||||
@@ -4,12 +4,13 @@ UseLibraryHeaders icon ;
|
|||||||
|
|
||||||
SubDirHdrs [ FDirName $(SUBDIR) $(DOTDOT) shared ] ;
|
SubDirHdrs [ FDirName $(SUBDIR) $(DOTDOT) shared ] ;
|
||||||
|
|
||||||
|
AddResources HVIFTranslator : HVIFTranslator.rdef ;
|
||||||
|
|
||||||
Translator HVIFTranslator :
|
Translator HVIFTranslator :
|
||||||
HVIFMain.cpp
|
HVIFMain.cpp
|
||||||
HVIFTranslator.cpp
|
HVIFTranslator.cpp
|
||||||
HVIFView.cpp
|
HVIFView.cpp
|
||||||
: be translation libtranslatorsutils.a $(TARGET_LIBSUPC++)
|
: be translation libtranslatorsutils.a $(TARGET_LIBSUPC++)
|
||||||
$(HAIKU_LOCALE_LIBS)
|
|
||||||
$(HAIKU_LOCALE_LIBS)
|
$(HAIKU_LOCALE_LIBS)
|
||||||
: true
|
: true
|
||||||
;
|
;
|
||||||
|
|||||||
@@ -71,7 +71,7 @@ ConfigView::ConfigView()
|
|||||||
AddChild(stringView);
|
AddChild(stringView);
|
||||||
|
|
||||||
stringView = new BStringView("valid2",
|
stringView = new BStringView("valid2",
|
||||||
B_TRANSLATE("pixel in either direction."));
|
B_TRANSLATE("pixels in either direction."));
|
||||||
stringView->SetExplicitAlignment(leftAlignment);
|
stringView->SetExplicitAlignment(leftAlignment);
|
||||||
AddChild(stringView);
|
AddChild(stringView);
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
|
|
||||||
#include "ICOTranslator.h"
|
#include "ICOTranslator.h"
|
||||||
|
|
||||||
|
#include <Catalog.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
/*
|
||||||
|
* ICOTranslator.rdef
|
||||||
|
*/
|
||||||
|
|
||||||
|
resource app_signature "application/x-vnd.Haiku-ICOTranslator";
|
||||||
|
|
||||||
|
resource app_version {
|
||||||
|
major = 1,
|
||||||
|
middle = 0,
|
||||||
|
minor = 0,
|
||||||
|
variety = 0,
|
||||||
|
internal = 0,
|
||||||
|
short_info = "1.0.0",
|
||||||
|
long_info = "Haiku ICOTranslator Add-Ons."
|
||||||
|
};
|
||||||
@@ -4,6 +4,8 @@ SetSubDirSupportedPlatformsBeOSCompatible ;
|
|||||||
|
|
||||||
SubDirHdrs [ FDirName $(SUBDIR) $(DOTDOT) shared ] ;
|
SubDirHdrs [ FDirName $(SUBDIR) $(DOTDOT) shared ] ;
|
||||||
|
|
||||||
|
AddResources ICOTranslator : ICOTranslator.rdef ;
|
||||||
|
|
||||||
Translator ICOTranslator :
|
Translator ICOTranslator :
|
||||||
# ICOTranslator classes
|
# ICOTranslator classes
|
||||||
main.cpp
|
main.cpp
|
||||||
@@ -18,6 +20,7 @@ Translator ICOTranslator :
|
|||||||
DoCatalogs ICOTranslator :
|
DoCatalogs ICOTranslator :
|
||||||
x-vnd.Haiku-ICOTranslator
|
x-vnd.Haiku-ICOTranslator
|
||||||
:
|
:
|
||||||
|
main.cpp
|
||||||
ConfigView.cpp
|
ConfigView.cpp
|
||||||
ICOTranslator.cpp
|
ICOTranslator.cpp
|
||||||
;
|
;
|
||||||
|
|||||||
@@ -11,13 +11,11 @@
|
|||||||
#include "ICO.h"
|
#include "ICO.h"
|
||||||
#include "TranslatorWindow.h"
|
#include "TranslatorWindow.h"
|
||||||
|
|
||||||
|
|
||||||
#undef B_TRANSLATE_CONTEXT
|
#undef B_TRANSLATE_CONTEXT
|
||||||
#define B_TRANSLATE_CONTEXT "main"
|
#define B_TRANSLATE_CONTEXT "main"
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
main(int /*argc*/, char **/*argv*/)
|
main(int /*argc*/, char ** /*argv*/)
|
||||||
{
|
{
|
||||||
BApplication app("application/x-vnd.Haiku-ICOTranslator");
|
BApplication app("application/x-vnd.Haiku-ICOTranslator");
|
||||||
|
|
||||||
|
|||||||
@@ -34,6 +34,8 @@ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
#include "TranslatorWindow.h"
|
#include "TranslatorWindow.h"
|
||||||
#include "exif_parser.h"
|
#include "exif_parser.h"
|
||||||
|
|
||||||
|
#include <syslog.h>
|
||||||
|
|
||||||
#include <Alignment.h>
|
#include <Alignment.h>
|
||||||
#include <Catalog.h>
|
#include <Catalog.h>
|
||||||
#include <GridLayoutBuilder.h>
|
#include <GridLayoutBuilder.h>
|
||||||
@@ -662,7 +664,9 @@ TranslatorAboutView::TranslatorAboutView(const char* name)
|
|||||||
BView(name, 0, new BGroupLayout(B_VERTICAL))
|
BView(name, 0, new BGroupLayout(B_VERTICAL))
|
||||||
{
|
{
|
||||||
BAlignment labelAlignment = BAlignment(B_ALIGN_LEFT, B_ALIGN_TOP);
|
BAlignment labelAlignment = BAlignment(B_ALIGN_LEFT, B_ALIGN_TOP);
|
||||||
BStringView* title = new BStringView("Title", sTranslatorName);
|
BString str1(sTranslatorName);
|
||||||
|
str1.ReplaceFirst("JPEG images", B_TRANSLATE("JPEG images"));
|
||||||
|
BStringView* title = new BStringView("Title", str1.String());
|
||||||
title->SetFont(be_bold_font);
|
title->SetFont(be_bold_font);
|
||||||
title->SetExplicitAlignment(labelAlignment);
|
title->SetExplicitAlignment(labelAlignment);
|
||||||
|
|
||||||
@@ -674,7 +678,17 @@ TranslatorAboutView::TranslatorAboutView(const char* name)
|
|||||||
version->SetExplicitAlignment(labelAlignment);
|
version->SetExplicitAlignment(labelAlignment);
|
||||||
|
|
||||||
BTextView* infoView = new BTextView("info");
|
BTextView* infoView = new BTextView("info");
|
||||||
infoView->SetText(sTranslatorInfo);
|
BString str2(sTranslatorInfo);
|
||||||
|
str2.ReplaceFirst("Based on IJG library © 1994-2009, Thomas G. Lane, "
|
||||||
|
"Guido Vollbeding.\n", B_TRANSLATE("Based on IJG library © 1994-2009, "
|
||||||
|
"Thomas G. Lane, Guido Vollbeding.\n"));
|
||||||
|
str2.ReplaceFirst("with \"lossless\" encoding support patch by Ken "
|
||||||
|
"Murchison\n", B_TRANSLATE("with \"lossless\" encoding support patch "
|
||||||
|
"by Ken Murchison\n"));
|
||||||
|
str2.ReplaceFirst("With some colorspace conversion routines by Magnus "
|
||||||
|
"Hellman\n", B_TRANSLATE("With some colorspace conversion routines by "
|
||||||
|
"Magnus Hellman\n"));
|
||||||
|
infoView->SetText(str2.String());
|
||||||
infoView->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
infoView->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
||||||
infoView->MakeEditable(false);
|
infoView->MakeEditable(false);
|
||||||
|
|
||||||
@@ -695,9 +709,9 @@ TranslatorView::TranslatorView(const char* name, TranslatorSettings* settings)
|
|||||||
:
|
:
|
||||||
BTabView(name)
|
BTabView(name)
|
||||||
{
|
{
|
||||||
AddTab(new TranslatorWriteView("Write", settings->Acquire()));
|
AddTab(new TranslatorWriteView(B_TRANSLATE("Write"), settings->Acquire()));
|
||||||
AddTab(new TranslatorReadView("Read", settings->Acquire()));
|
AddTab(new TranslatorReadView(B_TRANSLATE("Read"), settings->Acquire()));
|
||||||
AddTab(new TranslatorAboutView("About"));
|
AddTab(new TranslatorAboutView(B_TRANSLATE("About")));
|
||||||
|
|
||||||
settings->Release();
|
settings->Release();
|
||||||
|
|
||||||
@@ -788,8 +802,8 @@ JPEGTranslator::DerivedTranslate(BPositionIO* inSource,
|
|||||||
&longJumpBuffer);
|
&longJumpBuffer);
|
||||||
}
|
}
|
||||||
} catch (...) {
|
} catch (...) {
|
||||||
fprintf(stderr, B_TRANSLATE("libjpeg encountered a critical error "
|
syslog(LOG_ERR, "libjpeg encountered a critical error (caught C++ "
|
||||||
"(caught C++ exception).\n"));
|
"exception).\n");
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -942,8 +956,7 @@ JPEGTranslator::Compress(BPositionIO* in, BPositionIO* out,
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
fprintf(stderr,
|
syslog(LOG_ERR, "Wrong type: Color space not implemented.\n");
|
||||||
B_TRANSLATE("Wrong type: Color space not implemented.\n"));
|
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
}
|
}
|
||||||
out_row_bytes = jpg_input_components * width;
|
out_row_bytes = jpg_input_components * width;
|
||||||
@@ -1097,8 +1110,7 @@ JPEGTranslator::Decompress(BPositionIO* in, BPositionIO* out,
|
|||||||
if (cinfo.out_color_space != JCS_RGB) {
|
if (cinfo.out_color_space != JCS_RGB) {
|
||||||
switch (cinfo.out_color_space) {
|
switch (cinfo.out_color_space) {
|
||||||
case JCS_UNKNOWN: /* error/unspecified */
|
case JCS_UNKNOWN: /* error/unspecified */
|
||||||
fprintf(stderr,
|
syslog(LOG_ERR, "From Type: Jpeg uses unknown color type\n");
|
||||||
B_TRANSLATE("From Type: Jpeg uses unknown color type\n"));
|
|
||||||
break;
|
break;
|
||||||
case JCS_GRAYSCALE: /* monochrome */
|
case JCS_GRAYSCALE: /* monochrome */
|
||||||
// Check if user wants to read only as RGB32 or not
|
// Check if user wants to read only as RGB32 or not
|
||||||
@@ -1130,9 +1142,8 @@ JPEGTranslator::Decompress(BPositionIO* in, BPositionIO* out,
|
|||||||
converter = convert_from_CMYK_to_32;
|
converter = convert_from_CMYK_to_32;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
fprintf(stderr,
|
syslog(LOG_ERR,
|
||||||
B_TRANSLATE("From Type: Jpeg uses hmm... i don't know "
|
"From Type: Jpeg uses hmm... i don't know really :(\n");
|
||||||
"really :(\n"));
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1279,7 +1290,10 @@ JPEGTranslator::PopulateInfoFromFormat(translator_info* info,
|
|||||||
info->group = formats[i].group;
|
info->group = formats[i].group;
|
||||||
info->quality = formats[i].quality;
|
info->quality = formats[i].quality;
|
||||||
info->capability = formats[i].capability;
|
info->capability = formats[i].capability;
|
||||||
strcpy(info->name, formats[i].name);
|
BString str1(formats[i].name);
|
||||||
|
str1.ReplaceFirst("Be Bitmap Format (JPEGTranslator)",
|
||||||
|
B_TRANSLATE("Be Bitmap Format (JPEGTranslator)"));
|
||||||
|
strncpy(info->name, str1.String(), sizeof(info->name));
|
||||||
strcpy(info->MIME, formats[i].MIME);
|
strcpy(info->MIME, formats[i].MIME);
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
|
|
||||||
#include <Alert.h>
|
#include <Alert.h>
|
||||||
#include <Application.h>
|
#include <Application.h>
|
||||||
|
#include <Catalog.h>
|
||||||
#include <CheckBox.h>
|
#include <CheckBox.h>
|
||||||
#include <FindDirectory.h>
|
#include <FindDirectory.h>
|
||||||
#include <Path.h>
|
#include <Path.h>
|
||||||
@@ -52,6 +53,9 @@ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
|
|
||||||
#include "BaseTranslator.h"
|
#include "BaseTranslator.h"
|
||||||
|
|
||||||
|
#undef B_TRANSLATE_CONTEXT
|
||||||
|
#define B_TRANSLATE_CONTEXT "JPEGTranslator"
|
||||||
|
|
||||||
// Settings
|
// Settings
|
||||||
#define SETTINGS_FILE "JPEGTranslator"
|
#define SETTINGS_FILE "JPEGTranslator"
|
||||||
|
|
||||||
@@ -67,15 +71,15 @@ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
#define VIEW_MSG_SET_SHOWREADERRORBOX 'JSEB'
|
#define VIEW_MSG_SET_SHOWREADERRORBOX 'JSEB'
|
||||||
|
|
||||||
// View labels
|
// View labels
|
||||||
#define VIEW_LABEL_QUALITY "Output quality"
|
#define VIEW_LABEL_QUALITY B_TRANSLATE_MARK("Output quality")
|
||||||
#define VIEW_LABEL_SMOOTHING "Output smoothing strength"
|
#define VIEW_LABEL_SMOOTHING B_TRANSLATE_MARK("Output smoothing strength")
|
||||||
#define VIEW_LABEL_PROGRESSIVE "Use progressive compression"
|
#define VIEW_LABEL_PROGRESSIVE B_TRANSLATE_MARK("Use progressive compression")
|
||||||
#define VIEW_LABEL_OPTIMIZECOLORS "Prevent colors 'washing out'"
|
#define VIEW_LABEL_OPTIMIZECOLORS B_TRANSLATE_MARK("Prevent colors 'washing out'")
|
||||||
#define VIEW_LABEL_SMALLERFILE "Make file smaller (sligthtly worse quality)"
|
#define VIEW_LABEL_SMALLERFILE B_TRANSLATE_MARK("Make file smaller (sligthtly worse quality)")
|
||||||
#define VIEW_LABEL_GRAY1ASRGB24 "Write black-and-white images as RGB24"
|
#define VIEW_LABEL_GRAY1ASRGB24 B_TRANSLATE_MARK("Write black-and-white images as RGB24")
|
||||||
#define VIEW_LABEL_ALWAYSRGB32 "Read greyscale images as RGB32"
|
#define VIEW_LABEL_ALWAYSRGB32 B_TRANSLATE_MARK("Read greyscale images as RGB32")
|
||||||
#define VIEW_LABEL_PHOTOSHOPCMYK "Use CMYK code with 0 for 100% ink coverage"
|
#define VIEW_LABEL_PHOTOSHOPCMYK B_TRANSLATE_MARK("Use CMYK code with 0 for 100% ink coverage")
|
||||||
#define VIEW_LABEL_SHOWREADERRORBOX "Show warning messages"
|
#define VIEW_LABEL_SHOWREADERRORBOX B_TRANSLATE_MARK("Show warning messages")
|
||||||
|
|
||||||
// strings for use in TranslatorSettings
|
// strings for use in TranslatorSettings
|
||||||
#define JPEG_SET_SMOOTHING "smoothing"
|
#define JPEG_SET_SMOOTHING "smoothing"
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
/*
|
||||||
|
* JPEGTranslator.rdef
|
||||||
|
*/
|
||||||
|
|
||||||
|
resource app_signature "application/x-vnd.Haiku-JPEGTranslator";
|
||||||
|
|
||||||
|
resource app_version {
|
||||||
|
major = 1,
|
||||||
|
middle = 2,
|
||||||
|
minor = 0,
|
||||||
|
variety = 0,
|
||||||
|
internal = 0,
|
||||||
|
short_info = "1.2.0",
|
||||||
|
long_info = "Haiku JPEGTranslator Add-Ons."
|
||||||
|
};
|
||||||
@@ -10,6 +10,8 @@ SubDirHdrs [ FDirName $(SUBDIR) $(DOTDOT) shared ] ;
|
|||||||
|
|
||||||
UseLibraryHeaders jpeg ;
|
UseLibraryHeaders jpeg ;
|
||||||
|
|
||||||
|
AddResources JPEGTranslator : JPEGTranslator.rdef ;
|
||||||
|
|
||||||
Translator JPEGTranslator :
|
Translator JPEGTranslator :
|
||||||
be_jdatadst.cpp
|
be_jdatadst.cpp
|
||||||
be_jdatasrc.cpp
|
be_jdatasrc.cpp
|
||||||
@@ -24,6 +26,7 @@ Translator JPEGTranslator :
|
|||||||
DoCatalogs JPEGTranslator :
|
DoCatalogs JPEGTranslator :
|
||||||
x-vnd.Haiku-JPEGTranslator
|
x-vnd.Haiku-JPEGTranslator
|
||||||
:
|
:
|
||||||
|
JPEGTranslator.h
|
||||||
JPEGTranslator.cpp
|
JPEGTranslator.cpp
|
||||||
exif_parser.cpp
|
exif_parser.cpp
|
||||||
be_jerror.cpp
|
be_jerror.cpp
|
||||||
|
|||||||
@@ -6,6 +6,7 @@
|
|||||||
|
|
||||||
#include "exif_parser.h"
|
#include "exif_parser.h"
|
||||||
|
|
||||||
|
#include <Catalog.h>
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <set>
|
#include <set>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|||||||
@@ -35,6 +35,8 @@ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
#include "jpc_cs.h"
|
#include "jpc_cs.h"
|
||||||
#include "TranslatorWindow.h"
|
#include "TranslatorWindow.h"
|
||||||
|
|
||||||
|
#include <syslog.h>
|
||||||
|
|
||||||
#include <GroupLayoutBuilder.h>
|
#include <GroupLayoutBuilder.h>
|
||||||
#include <TabView.h>
|
#include <TabView.h>
|
||||||
#include <TextView.h>
|
#include <TextView.h>
|
||||||
@@ -705,8 +707,9 @@ TranslatorAboutView::TranslatorAboutView(const char* name)
|
|||||||
BView(name, 0, new BGroupLayout(B_VERTICAL))
|
BView(name, 0, new BGroupLayout(B_VERTICAL))
|
||||||
{
|
{
|
||||||
BAlignment labelAlignment = BAlignment(B_ALIGN_LEFT, B_ALIGN_TOP);
|
BAlignment labelAlignment = BAlignment(B_ALIGN_LEFT, B_ALIGN_TOP);
|
||||||
BStringView* title = new BStringView("Title", sTranslatorName);
|
BString str1(sTranslatorName);
|
||||||
title->SetText(B_TRANSLATE_MARK("JPEG2000 images"));
|
str1.ReplaceFirst("JPEG2000 images", B_TRANSLATE("JPEG2000 images"));
|
||||||
|
BStringView* title = new BStringView("Title", str1.String());
|
||||||
title->SetFont(be_bold_font);
|
title->SetFont(be_bold_font);
|
||||||
title->SetExplicitAlignment(labelAlignment);
|
title->SetExplicitAlignment(labelAlignment);
|
||||||
|
|
||||||
@@ -1003,7 +1006,7 @@ JP2Translator::Compress(BPositionIO* in, BPositionIO* out)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
fprintf(stderr, B_TRANSLATE("Unknown color space.\n"));
|
syslog(LOG_ERR, "Unknown color space.\n");
|
||||||
return B_ERROR;
|
return B_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1124,8 +1127,8 @@ JP2Translator::Decompress(BPositionIO* in, BPositionIO* out)
|
|||||||
out_color_space = B_RGBA32;
|
out_color_space = B_RGBA32;
|
||||||
converter = read_rgba32;
|
converter = read_rgba32;
|
||||||
} else {
|
} else {
|
||||||
fprintf(stderr, B_TRANSLATE("Other than RGB with 3 or 4 color "
|
syslog(LOG_ERR, "Other than RGB with 3 or 4 color "
|
||||||
"components not implemented.\n"));
|
"components not implemented.\n");
|
||||||
return Error(ins, image, NULL, 0, NULL, B_ERROR);
|
return Error(ins, image, NULL, 0, NULL, B_ERROR);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -1141,13 +1144,12 @@ JP2Translator::Decompress(BPositionIO* in, BPositionIO* out)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case JAS_IMAGE_CS_YCBCR:
|
case JAS_IMAGE_CS_YCBCR:
|
||||||
fprintf(stderr, B_TRANSLATE("Color space YCBCR not implemented "
|
syslog(LOG_ERR, "Color space YCBCR not implemented yet.\n");
|
||||||
"yet.\n"));
|
|
||||||
return Error(ins, image, NULL, 0, NULL, B_ERROR);
|
return Error(ins, image, NULL, 0, NULL, B_ERROR);
|
||||||
break;
|
break;
|
||||||
case JAS_IMAGE_CS_UNKNOWN:
|
case JAS_IMAGE_CS_UNKNOWN:
|
||||||
default:
|
default:
|
||||||
fprintf(stderr, B_TRANSLATE("Color space unknown. \n"));
|
syslog(LOG_ERR, "Color space unknown. \n");
|
||||||
return Error(ins, image, NULL, 0, NULL, B_ERROR);
|
return Error(ins, image, NULL, 0, NULL, B_ERROR);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -1314,8 +1316,7 @@ main()
|
|||||||
{
|
{
|
||||||
BApplication app("application/x-vnd.Haiku-JPEG2000Translator");
|
BApplication app("application/x-vnd.Haiku-JPEG2000Translator");
|
||||||
JP2Translator* translator = new JP2Translator();
|
JP2Translator* translator = new JP2Translator();
|
||||||
if (LaunchTranslatorWindow(translator, B_TRANSLATE("JPEG2000 images")
|
if (LaunchTranslatorWindow(translator, sTranslatorName) == B_OK)
|
||||||
/*sTranslatorName*/) == B_OK)
|
|
||||||
app.Run();
|
app.Run();
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@@ -59,10 +59,10 @@ EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|||||||
// Settings
|
// Settings
|
||||||
#define JP2_SETTINGS_FILE "JPEG2000Translator"
|
#define JP2_SETTINGS_FILE "JPEG2000Translator"
|
||||||
|
|
||||||
#define JP2_SET_QUALITY B_TRANSLATE_MARK("quality")
|
#define JP2_SET_QUALITY "quality"
|
||||||
#define JP2_SET_GRAY1_AS_B_RGB24 B_TRANSLATE_MARK("24 from gray1")
|
#define JP2_SET_GRAY1_AS_B_RGB24 "24 from gray1"
|
||||||
#define JP2_SET_GRAY8_AS_B_RGB32 B_TRANSLATE_MARK("32 from gray8")
|
#define JP2_SET_GRAY8_AS_B_RGB32 "32 from gray8"
|
||||||
#define JP2_SET_JPC B_TRANSLATE_MARK("jpc")
|
#define JP2_SET_JPC "jpc"
|
||||||
|
|
||||||
// View messages
|
// View messages
|
||||||
#define VIEW_MSG_SET_QUALITY 'JSCQ'
|
#define VIEW_MSG_SET_QUALITY 'JSCQ'
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
/*
|
||||||
|
* JPEG2000Translator.rdef
|
||||||
|
*/
|
||||||
|
|
||||||
|
resource app_signature "application/x-vnd.Haiku-JPEG2000Translator";
|
||||||
|
|
||||||
|
resource app_version {
|
||||||
|
major = 1,
|
||||||
|
middle = 0,
|
||||||
|
minor = 0,
|
||||||
|
variety = 0,
|
||||||
|
internal = 0,
|
||||||
|
short_info = "1.0.0",
|
||||||
|
long_info = "Haiku JPEG2000Translator Add-Ons."
|
||||||
|
};
|
||||||
@@ -6,7 +6,7 @@ SubDirSysHdrs [ FDirName $(SUBDIR) libjasper ] ;
|
|||||||
|
|
||||||
SubDirHdrs [ FDirName $(SUBDIR) $(DOTDOT) shared ] ;
|
SubDirHdrs [ FDirName $(SUBDIR) $(DOTDOT) shared ] ;
|
||||||
#for BaseTranslator.h and friends
|
#for BaseTranslator.h and friends
|
||||||
|
|
||||||
# Exclude unwanted formats
|
# Exclude unwanted formats
|
||||||
CCFLAGS += -DEXCLUDE_MIF_SUPPORT
|
CCFLAGS += -DEXCLUDE_MIF_SUPPORT
|
||||||
-DEXCLUDE_PNM_SUPPORT
|
-DEXCLUDE_PNM_SUPPORT
|
||||||
@@ -62,6 +62,8 @@ local jasper_files =
|
|||||||
|
|
||||||
ObjectCcFlags [ FGristFiles $(jasper_files:S=$(SUFOBJ)) ] : -w ;
|
ObjectCcFlags [ FGristFiles $(jasper_files:S=$(SUFOBJ)) ] : -w ;
|
||||||
|
|
||||||
|
AddResources JPEG2000Translator : JPEG2000Translator.rdef ;
|
||||||
|
|
||||||
Translator JPEG2000Translator :
|
Translator JPEG2000Translator :
|
||||||
|
|
||||||
# JPEG2000Translator
|
# JPEG2000Translator
|
||||||
|
|||||||
@@ -4,6 +4,8 @@ SetSubDirSupportedPlatformsBeOSCompatible ;
|
|||||||
|
|
||||||
SubDirHdrs [ FDirName $(SUBDIR) $(DOTDOT) shared ] ;
|
SubDirHdrs [ FDirName $(SUBDIR) $(DOTDOT) shared ] ;
|
||||||
|
|
||||||
|
AddResources PCXTranslator : PCXTranslator.rdef ;
|
||||||
|
|
||||||
Translator PCXTranslator :
|
Translator PCXTranslator :
|
||||||
# PCXTranslator classes
|
# PCXTranslator classes
|
||||||
main.cpp
|
main.cpp
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
/*
|
||||||
|
* PCXTranslator.rdef
|
||||||
|
*/
|
||||||
|
|
||||||
|
resource app_signature "application/x-vnd.Haiku-PCXTranslator";
|
||||||
|
|
||||||
|
resource app_version {
|
||||||
|
major = 0,
|
||||||
|
middle = 3,
|
||||||
|
minor = 0,
|
||||||
|
variety = 0,
|
||||||
|
internal = 0,
|
||||||
|
short_info = "0.3.0",
|
||||||
|
long_info = "Haiku PCXTranslator Add-Ons."
|
||||||
|
};
|
||||||
@@ -5,6 +5,8 @@ SetSubDirSupportedPlatformsBeOSCompatible ;
|
|||||||
UseLibraryHeaders png zlib ;
|
UseLibraryHeaders png zlib ;
|
||||||
SubDirHdrs [ FDirName $(SUBDIR) $(DOTDOT) shared ] ;
|
SubDirHdrs [ FDirName $(SUBDIR) $(DOTDOT) shared ] ;
|
||||||
|
|
||||||
|
AddResources PNGTranslator : PNGTranslator.rdef ;
|
||||||
|
|
||||||
if $(HAIKU_GCC_VERSION[1]) = 2 {
|
if $(HAIKU_GCC_VERSION[1]) = 2 {
|
||||||
SubDirCcFlags -DPNG_NO_PEDANTIC_WARNINGS ;
|
SubDirCcFlags -DPNG_NO_PEDANTIC_WARNINGS ;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
/*
|
||||||
|
* PNGTranslator.rdef
|
||||||
|
*/
|
||||||
|
|
||||||
|
resource app_signature "application/x-vnd.Haiku-PNGTranslator";
|
||||||
|
|
||||||
|
resource app_version {
|
||||||
|
major = 1,
|
||||||
|
middle = 0,
|
||||||
|
minor = 0,
|
||||||
|
variety = 0,
|
||||||
|
internal = 0,
|
||||||
|
short_info = "1.0.0",
|
||||||
|
long_info = "Haiku PNGTranslator Add-Ons."
|
||||||
|
};
|
||||||
@@ -2,12 +2,21 @@ SubDir HAIKU_TOP src add-ons translators ppm ;
|
|||||||
|
|
||||||
SetSubDirSupportedPlatformsBeOSCompatible ;
|
SetSubDirSupportedPlatformsBeOSCompatible ;
|
||||||
|
|
||||||
|
AddResources PPMTranslator : PPMTranslator.rdef ;
|
||||||
|
|
||||||
Translator PPMTranslator
|
Translator PPMTranslator
|
||||||
: PPMMain.cpp PPMTranslator.cpp colorspace.cpp
|
: PPMMain.cpp PPMTranslator.cpp colorspace.cpp
|
||||||
: be translation $(TARGET_LIBSUPC++)
|
: be translation $(TARGET_LIBSUPC++) $(HAIKU_LOCALE_LIBS)
|
||||||
: true
|
: true
|
||||||
;
|
;
|
||||||
|
|
||||||
|
DoCatalogs PPMTranslator :
|
||||||
|
x-vnd.Haiku-PPMTranslator
|
||||||
|
:
|
||||||
|
PPMMain.cpp
|
||||||
|
PPMTranslator.cpp
|
||||||
|
;
|
||||||
|
|
||||||
Package haiku-translationkit-cvs :
|
Package haiku-translationkit-cvs :
|
||||||
PPMTranslator :
|
PPMTranslator :
|
||||||
boot home config add-ons Translators ;
|
boot home config add-ons Translators ;
|
||||||
|
|||||||
@@ -3,16 +3,21 @@
|
|||||||
This file may be used under the terms of the Be Sample Code License.
|
This file may be used under the terms of the Be Sample Code License.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include <Alert.h>
|
||||||
|
#include <Application.h>
|
||||||
|
#include <Catalog.h>
|
||||||
|
#include <GroupLayout.h>
|
||||||
|
#include <Screen.h>
|
||||||
#include <TranslatorAddOn.h>
|
#include <TranslatorAddOn.h>
|
||||||
#include <View.h>
|
#include <View.h>
|
||||||
#include <Window.h>
|
#include <Window.h>
|
||||||
#include <Application.h>
|
|
||||||
#include <Alert.h>
|
|
||||||
#include <Screen.h>
|
|
||||||
#include <GroupLayout.h>
|
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
|
#undef B_TRANSLATE_CONTEXT
|
||||||
|
#define B_TRANSLATE_CONTEXT "PPMMain"
|
||||||
|
|
||||||
|
|
||||||
BPoint get_window_origin();
|
BPoint get_window_origin();
|
||||||
void set_window_origin(BPoint pt);
|
void set_window_origin(BPoint pt);
|
||||||
@@ -22,7 +27,7 @@ class PPMWindow :
|
|||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
PPMWindow(BRect area) :
|
PPMWindow(BRect area) :
|
||||||
BWindow(area, "PPM Settings", B_TITLED_WINDOW,
|
BWindow(area, B_TRANSLATE("PPM Settings"), B_TITLED_WINDOW,
|
||||||
B_NOT_RESIZABLE | B_NOT_ZOOMABLE | B_AUTO_UPDATE_SIZE_LIMITS)
|
B_NOT_RESIZABLE | B_NOT_ZOOMABLE | B_AUTO_UPDATE_SIZE_LIMITS)
|
||||||
{
|
{
|
||||||
SetLayout(new BGroupLayout(B_HORIZONTAL));
|
SetLayout(new BGroupLayout(B_HORIZONTAL));
|
||||||
@@ -43,7 +48,9 @@ main()
|
|||||||
BView * v = NULL;
|
BView * v = NULL;
|
||||||
BRect r(0, 0, 1, 1);
|
BRect r(0, 0, 1, 1);
|
||||||
if (MakeConfig(NULL, &v, &r)) {
|
if (MakeConfig(NULL, &v, &r)) {
|
||||||
BAlert * err = new BAlert("Error", "Something is wrong with the PPMTranslator!", "OK");
|
BAlert * err = new BAlert("Error",
|
||||||
|
B_TRANSLATE("Something is wrong with the PPMTranslator!"),
|
||||||
|
B_TRANSLATE("OK"));
|
||||||
err->Go();
|
err->Go();
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,32 +8,36 @@
|
|||||||
/* does not buffer data. We should wrap a buffering thing around */
|
/* does not buffer data. We should wrap a buffering thing around */
|
||||||
/* the input or output when they are in ASCII mode. */
|
/* the input or output when they are in ASCII mode. */
|
||||||
|
|
||||||
#include <TranslatorAddOn.h>
|
|
||||||
#include <TranslationKit.h>
|
|
||||||
#include <ByteOrder.h>
|
|
||||||
#include <Message.h>
|
|
||||||
#include <Screen.h>
|
|
||||||
#include <Locker.h>
|
|
||||||
#include <FindDirectory.h>
|
|
||||||
#include <Path.h>
|
|
||||||
#include <PopUpMenu.h>
|
|
||||||
#include <MenuField.h>
|
|
||||||
#include <MenuItem.h>
|
|
||||||
#include <CheckBox.h>
|
|
||||||
#include <Bitmap.h>
|
#include <Bitmap.h>
|
||||||
#include <StringView.h>
|
#include <ByteOrder.h>
|
||||||
|
#include <Catalog.h>
|
||||||
|
#include <CheckBox.h>
|
||||||
|
#include <FindDirectory.h>
|
||||||
#include <GridLayoutBuilder.h>
|
#include <GridLayoutBuilder.h>
|
||||||
#include <GroupLayout.h>
|
#include <GroupLayout.h>
|
||||||
#include <GroupLayoutBuilder.h>
|
#include <GroupLayoutBuilder.h>
|
||||||
|
#include <Locker.h>
|
||||||
|
#include <MenuField.h>
|
||||||
|
#include <MenuItem.h>
|
||||||
|
#include <Message.h>
|
||||||
|
#include <Path.h>
|
||||||
|
#include <PopUpMenu.h>
|
||||||
|
#include <Screen.h>
|
||||||
#include <SpaceLayoutItem.h>
|
#include <SpaceLayoutItem.h>
|
||||||
|
#include <StringView.h>
|
||||||
|
#include <TranslatorAddOn.h>
|
||||||
|
#include <TranslationKit.h>
|
||||||
|
|
||||||
#include <ctype.h>
|
#include <ctype.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
#include <syslog.h>
|
||||||
|
|
||||||
#include "colorspace.h"
|
#include "colorspace.h"
|
||||||
|
|
||||||
|
#undef B_TRANSLATE_CONTEXT
|
||||||
|
#define B_TRANSLATE_CONTEXT "PPMTranslator"
|
||||||
|
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
#define dprintf(x) printf x
|
#define dprintf(x) printf x
|
||||||
@@ -43,10 +47,10 @@
|
|||||||
|
|
||||||
|
|
||||||
#if !defined(_PR3_COMPATIBLE_) /* R4 headers? Else we need to define these constants. */
|
#if !defined(_PR3_COMPATIBLE_) /* R4 headers? Else we need to define these constants. */
|
||||||
#define B_CMY24 ((color_space)0xC001) /* C[7:0] M[7:0] Y[7:0] No gray removal done */
|
#define B_CMY24 ((color_space)0xC001) /* C[7:0] M[7:0] Y[7:0] No gray removal done */
|
||||||
#define B_CMY32 ((color_space)0xC002) /* C[7:0] M[7:0] Y[7:0] X[7:0] No gray removal done */
|
#define B_CMY32 ((color_space)0xC002) /* C[7:0] M[7:0] Y[7:0] X[7:0] No gray removal done */
|
||||||
#define B_CMYA32 ((color_space)0xE002) /* C[7:0] M[7:0] Y[7:0] A[7:0] No gray removal done */
|
#define B_CMYA32 ((color_space)0xE002) /* C[7:0] M[7:0] Y[7:0] A[7:0] No gray removal done */
|
||||||
#define B_CMYK32 ((color_space)0xC003) /* C[7:0] M[7:0] Y[7:0] K[7:0] */
|
#define B_CMYK32 ((color_space)0xC003) /* C[7:0] M[7:0] Y[7:0] K[7:0] */
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define PPM_TRANSLATOR_VERSION 0x100
|
#define PPM_TRANSLATOR_VERSION 0x100
|
||||||
@@ -59,7 +63,7 @@ int32 translatorVersion = PPM_TRANSLATOR_VERSION;
|
|||||||
// Minor: next 4 bits
|
// Minor: next 4 bits
|
||||||
// Major: highest 24 bits
|
// Major: highest 24 bits
|
||||||
|
|
||||||
/* Be reserves all codes with non-lowecase letters in them. */
|
/* Be reserves all codes with non-lowercase letters in them. */
|
||||||
/* Luckily, there is already a reserved code for PPM. If you */
|
/* Luckily, there is already a reserved code for PPM. If you */
|
||||||
/* make up your own for a new type, use lower-case letters. */
|
/* make up your own for a new type, use lower-case letters. */
|
||||||
#define PPM_TYPE 'PPM '
|
#define PPM_TYPE 'PPM '
|
||||||
@@ -150,7 +154,8 @@ public:
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (sscanf(ptr, "%31[a-zA-Z_0-9] =", name) != 1) {
|
if (sscanf(ptr, "%31[a-zA-Z_0-9] =", name) != 1) {
|
||||||
fprintf(stderr, "unknown PPMTranslator settings line: %s", line);
|
syslog(LOG_ERR, "unknown PPMTranslator "
|
||||||
|
"settings line: %s", line);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (!strcmp(name, "color_space")) {
|
if (!strcmp(name, "color_space")) {
|
||||||
@@ -158,8 +163,10 @@ public:
|
|||||||
ptr++;
|
ptr++;
|
||||||
}
|
}
|
||||||
ptr++;
|
ptr++;
|
||||||
if (sscanf(ptr, "%d", (int*)&g_settings.out_space) != 1) {
|
if (sscanf(ptr, "%d",
|
||||||
fprintf(stderr, "illegal color space in PPMTranslator settings: %s", ptr);
|
(int*)&g_settings.out_space) != 1) {
|
||||||
|
syslog(LOG_ERR, "illegal color space "
|
||||||
|
"in PPMTranslator settings: %s", ptr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (!strcmp(name, "window_pos")) {
|
else if (!strcmp(name, "window_pos")) {
|
||||||
@@ -167,8 +174,11 @@ public:
|
|||||||
ptr++;
|
ptr++;
|
||||||
}
|
}
|
||||||
ptr++;
|
ptr++;
|
||||||
if (sscanf(ptr, "%f,%f", &g_settings.window_pos.x, &g_settings.window_pos.y) != 2) {
|
if (sscanf(ptr, "%f,%f",
|
||||||
fprintf(stderr, "illegal window position in PPMTranslator settings: %s", ptr);
|
&g_settings.window_pos.x,
|
||||||
|
&g_settings.window_pos.y) != 2) {
|
||||||
|
syslog(LOG_ERR, "illegal window position "
|
||||||
|
"in PPMTranslator settings: %s", ptr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (!strcmp(name, "write_ascii")) {
|
else if (!strcmp(name, "write_ascii")) {
|
||||||
@@ -178,14 +188,16 @@ public:
|
|||||||
ptr++;
|
ptr++;
|
||||||
int ascii = g_settings.write_ascii;
|
int ascii = g_settings.write_ascii;
|
||||||
if (sscanf(ptr, "%d", &ascii) != 1) {
|
if (sscanf(ptr, "%d", &ascii) != 1) {
|
||||||
fprintf(stderr, "illegal write_ascii value in PPMTranslator settings: %s", ptr);
|
syslog(LOG_ERR, "illegal write_ascii value "
|
||||||
|
"in PPMTranslator settings: %s", ptr);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
g_settings.write_ascii = ascii;
|
g_settings.write_ascii = ascii;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
fprintf(stderr, "unknown PPMTranslator setting: %s", line);
|
syslog(LOG_ERR,
|
||||||
|
"unknown PPMTranslator setting: %s", line);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -208,7 +220,8 @@ public:
|
|||||||
static_cast<int>((translatorVersion >> 4) & 0xf),
|
static_cast<int>((translatorVersion >> 4) & 0xf),
|
||||||
static_cast<int>(translatorVersion & 0xf));
|
static_cast<int>(translatorVersion & 0xf));
|
||||||
fprintf(f, "color_space = %d\n", g_settings.out_space);
|
fprintf(f, "color_space = %d\n", g_settings.out_space);
|
||||||
fprintf(f, "window_pos = %g,%g\n", g_settings.window_pos.x, g_settings.window_pos.y);
|
fprintf(f, "window_pos = %g,%g\n", g_settings.window_pos.x,
|
||||||
|
g_settings.window_pos.y);
|
||||||
fprintf(f, "write_ascii = %d\n", g_settings.write_ascii ? 1 : 0);
|
fprintf(f, "write_ascii = %d\n", g_settings.write_ascii ? 1 : 0);
|
||||||
fclose(f);
|
fclose(f);
|
||||||
}
|
}
|
||||||
@@ -267,14 +280,14 @@ Identify( /* required */
|
|||||||
outInfo->type = PPM_TYPE;
|
outInfo->type = PPM_TYPE;
|
||||||
outInfo->quality = 0.3; /* no alpha, etc */
|
outInfo->quality = 0.3; /* no alpha, etc */
|
||||||
outInfo->capability = 0.8; /* we're pretty good at PPM reading, though */
|
outInfo->capability = 0.8; /* we're pretty good at PPM reading, though */
|
||||||
strcpy(outInfo->name, "PPM image");
|
strcpy(outInfo->name, B_TRANSLATE("PPM image"));
|
||||||
strcpy(outInfo->MIME, "image/x-portable-pixmap");
|
strcpy(outInfo->MIME, "image/x-portable-pixmap");
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
outInfo->type = B_TRANSLATOR_BITMAP;
|
outInfo->type = B_TRANSLATOR_BITMAP;
|
||||||
outInfo->quality = 0.4; /* B_TRANSLATOR_BITMAP can do alpha, at least */
|
outInfo->quality = 0.4; /* B_TRANSLATOR_BITMAP can do alpha, at least */
|
||||||
outInfo->capability = 0.8; /* and we might not know many variations thereof */
|
outInfo->capability = 0.8; /* and we might not know many variations thereof */
|
||||||
strcpy(outInfo->name, "Be Bitmap Format (PPMTranslator)");
|
strcpy(outInfo->name, B_TRANSLATE("Be Bitmap Format (PPMTranslator)"));
|
||||||
strcpy(outInfo->MIME, "image/x-be-bitmap"); /* this is the MIME type of B_TRANSLATOR_BITMAP */
|
strcpy(outInfo->MIME, "image/x-be-bitmap"); /* this is the MIME type of B_TRANSLATOR_BITMAP */
|
||||||
}
|
}
|
||||||
return B_OK;
|
return B_OK;
|
||||||
@@ -442,46 +455,66 @@ public:
|
|||||||
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
||||||
SetLowColor(ViewColor());
|
SetLowColor(ViewColor());
|
||||||
|
|
||||||
mTitle = new BStringView("title", "PPM Image Translator");
|
mTitle = new BStringView("title",
|
||||||
|
B_TRANSLATE("PPM Image Translator"));
|
||||||
mTitle->SetFont(be_bold_font);
|
mTitle->SetFont(be_bold_font);
|
||||||
|
|
||||||
char detail[100];
|
char detail[100];
|
||||||
int ver = static_cast<int>(translatorVersion);
|
int ver = static_cast<int>(translatorVersion);
|
||||||
sprintf(detail, "Version %d.%d.%d %s", ver >> 8, ((ver >> 4) & 0xf),
|
sprintf(detail, B_TRANSLATE("Version %d.%d.%d %s"), ver >> 8,
|
||||||
|
((ver >> 4) & 0xf),
|
||||||
(ver & 0xf), __DATE__);
|
(ver & 0xf), __DATE__);
|
||||||
mDetail = new BStringView("detail", detail);
|
mDetail = new BStringView("detail", detail);
|
||||||
|
|
||||||
mBasedOn = new BStringView("basedOn",
|
mBasedOn = new BStringView("basedOn",
|
||||||
"Based on PPMTranslator sample code");
|
B_TRANSLATE("Based on PPMTranslator sample code"));
|
||||||
|
|
||||||
mCopyright = new BStringView("copyright",
|
mCopyright = new BStringView("copyright",
|
||||||
"Sample code copyright 1999, Be Incorporated");
|
B_TRANSLATE("Sample code copyright 1999, Be Incorporated"));
|
||||||
|
|
||||||
mMenu = new BPopUpMenu("Color Space");
|
mMenu = new BPopUpMenu("Color Space");
|
||||||
mMenu->AddItem(new BMenuItem("None", CSMessage(B_NO_COLOR_SPACE)));
|
mMenu->AddItem(new BMenuItem(B_TRANSLATE("None"),
|
||||||
mMenu->AddItem(new BMenuItem("RGB 8:8:8 32 bits", CSMessage(B_RGB32)));
|
CSMessage(B_NO_COLOR_SPACE)));
|
||||||
mMenu->AddItem(new BMenuItem("RGBA 8:8:8:8 32 bits", CSMessage(B_RGBA32)));
|
mMenu->AddItem(new BMenuItem(B_TRANSLATE("RGB 8:8:8 32 bits"),
|
||||||
mMenu->AddItem(new BMenuItem("RGB 5:5:5 16 bits", CSMessage(B_RGB15)));
|
CSMessage(B_RGB32)));
|
||||||
mMenu->AddItem(new BMenuItem("RGBA 5:5:5:1 16 bits", CSMessage(B_RGBA15)));
|
mMenu->AddItem(new BMenuItem(B_TRANSLATE("RGBA 8:8:8:8 32 "
|
||||||
mMenu->AddItem(new BMenuItem("RGB 5:6:5 16 bits", CSMessage(B_RGB16)));
|
"bits"), CSMessage(B_RGBA32)));
|
||||||
mMenu->AddItem(new BMenuItem("System palette 8 bits", CSMessage(B_CMAP8)));
|
mMenu->AddItem(new BMenuItem(B_TRANSLATE("RGB 5:5:5 16 bits"),
|
||||||
|
CSMessage(B_RGB15)));
|
||||||
|
mMenu->AddItem(new BMenuItem(B_TRANSLATE("RGBA 5:5:5:1 16 "
|
||||||
|
"bits"), CSMessage(B_RGBA15)));
|
||||||
|
mMenu->AddItem(new BMenuItem(B_TRANSLATE("RGB 5:6:5 16 bits"),
|
||||||
|
CSMessage(B_RGB16)));
|
||||||
|
mMenu->AddItem(new BMenuItem(B_TRANSLATE("System palette 8 "
|
||||||
|
"bits"), CSMessage(B_CMAP8)));
|
||||||
mMenu->AddSeparatorItem();
|
mMenu->AddSeparatorItem();
|
||||||
mMenu->AddItem(new BMenuItem("Grayscale 8 bits", CSMessage(B_GRAY8)));
|
mMenu->AddItem(new BMenuItem(B_TRANSLATE("Grayscale 8 bits"),
|
||||||
mMenu->AddItem(new BMenuItem("Bitmap 1 bit", CSMessage(B_GRAY1)));
|
CSMessage(B_GRAY8)));
|
||||||
mMenu->AddItem(new BMenuItem("CMY 8:8:8 32 bits", CSMessage(B_CMY32)));
|
mMenu->AddItem(new BMenuItem(B_TRANSLATE("Bitmap 1 bit"),
|
||||||
mMenu->AddItem(new BMenuItem("CMYA 8:8:8:8 32 bits", CSMessage(B_CMYA32)));
|
CSMessage(B_GRAY1)));
|
||||||
mMenu->AddItem(new BMenuItem("CMYK 8:8:8:8 32 bits", CSMessage(B_CMYK32)));
|
mMenu->AddItem(new BMenuItem(B_TRANSLATE("CMY 8:8:8 32 bits"),
|
||||||
|
CSMessage(B_CMY32)));
|
||||||
|
mMenu->AddItem(new BMenuItem(B_TRANSLATE("CMYA 8:8:8:8 32 "
|
||||||
|
"bits"), CSMessage(B_CMYA32)));
|
||||||
|
mMenu->AddItem(new BMenuItem(B_TRANSLATE("CMYK 8:8:8:8 32 "
|
||||||
|
"bits"), CSMessage(B_CMYK32)));
|
||||||
mMenu->AddSeparatorItem();
|
mMenu->AddSeparatorItem();
|
||||||
mMenu->AddItem(new BMenuItem("RGB 8:8:8 32 bits big-endian", CSMessage(B_RGB32_BIG)));
|
mMenu->AddItem(new BMenuItem(B_TRANSLATE("RGB 8:8:8 32 bits "
|
||||||
mMenu->AddItem(new BMenuItem("RGBA 8:8:8:8 32 bits big-endian", CSMessage(B_RGBA32_BIG)));
|
"big-endian"), CSMessage(B_RGB32_BIG)));
|
||||||
mMenu->AddItem(new BMenuItem("RGB 5:5:5 16 bits big-endian", CSMessage(B_RGB15_BIG)));
|
mMenu->AddItem(new BMenuItem(B_TRANSLATE("RGBA 8:8:8:8 32 "
|
||||||
mMenu->AddItem(new BMenuItem("RGBA 5:5:5:1 16 bits big-endian", CSMessage(B_RGBA15_BIG)));
|
"bits big-endian"), CSMessage(B_RGBA32_BIG)));
|
||||||
mMenu->AddItem(new BMenuItem("RGB 5:6:5 16 bits big-endian", CSMessage(B_RGB16)));
|
mMenu->AddItem(new BMenuItem(B_TRANSLATE("RGB 5:5:5 16 bits "
|
||||||
mField = new BMenuField("Input Color Space", mMenu, NULL);
|
"big-endian"), CSMessage(B_RGB15_BIG)));
|
||||||
|
mMenu->AddItem(new BMenuItem(B_TRANSLATE("RGBA 5:5:5:1 16 "
|
||||||
|
"bits big-endian"), CSMessage(B_RGBA15_BIG)));
|
||||||
|
mMenu->AddItem(new BMenuItem(B_TRANSLATE("RGB 5:6:5 16 bits "
|
||||||
|
"big-endian"), CSMessage(B_RGB16)));
|
||||||
|
mField = new BMenuField(B_TRANSLATE("Input Color Space"),
|
||||||
|
mMenu, NULL);
|
||||||
mField->SetViewColor(ViewColor());
|
mField->SetViewColor(ViewColor());
|
||||||
SelectColorSpace(g_settings.out_space);
|
SelectColorSpace(g_settings.out_space);
|
||||||
BMessage * msg = new BMessage(CHANGE_ASCII);
|
BMessage * msg = new BMessage(CHANGE_ASCII);
|
||||||
mAscii = new BCheckBox("Write ASCII", msg);
|
mAscii = new BCheckBox(B_TRANSLATE("Write ASCII"), msg);
|
||||||
if (g_settings.write_ascii)
|
if (g_settings.write_ascii)
|
||||||
mAscii->SetValue(1);
|
mAscii->SetValue(1);
|
||||||
mAscii->SetViewColor(ViewColor());
|
mAscii->SetViewColor(ViewColor());
|
||||||
@@ -616,7 +649,8 @@ MakeConfig( /* optional */
|
|||||||
BView * * outView,
|
BView * * outView,
|
||||||
BRect * outExtent)
|
BRect * outExtent)
|
||||||
{
|
{
|
||||||
PPMView * v = new PPMView("PPMTranslator Settings", B_WILL_DRAW);
|
PPMView * v = new PPMView(B_TRANSLATE("PPMTranslator Settings"),
|
||||||
|
B_WILL_DRAW);
|
||||||
*outView = v;
|
*outView = v;
|
||||||
v->ResizeTo(v->ExplicitPreferredSize());;
|
v->ResizeTo(v->ExplicitPreferredSize());;
|
||||||
*outExtent = v->Bounds();
|
*outExtent = v->Bounds();
|
||||||
@@ -639,7 +673,7 @@ GetConfigMessage( /* optional */
|
|||||||
#if defined(_PR3_COMPATIBLE_)
|
#if defined(_PR3_COMPATIBLE_)
|
||||||
const char * name = B_TRANSLATOR_EXT_BITMAP_COLOR_SPACE;
|
const char * name = B_TRANSLATOR_EXT_BITMAP_COLOR_SPACE;
|
||||||
#else
|
#else
|
||||||
const char * name = "bits/space";
|
const char * name = B_TRANSLATE_MARK("bits/space");
|
||||||
#endif
|
#endif
|
||||||
g_settings_lock.Lock();
|
g_settings_lock.Lock();
|
||||||
(void)ioExtension->RemoveName(name);
|
(void)ioExtension->RemoveName(name);
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
/*
|
||||||
|
* PPMTranslator.rdef
|
||||||
|
*/
|
||||||
|
|
||||||
|
resource app_signature "application/x-vnd.Haiku-PPMTranslator";
|
||||||
|
|
||||||
|
resource app_version {
|
||||||
|
major = 1,
|
||||||
|
middle = 0,
|
||||||
|
minor = 0,
|
||||||
|
variety = 0,
|
||||||
|
internal = 0,
|
||||||
|
short_info = "1.0.0",
|
||||||
|
long_info = "Haiku PPMTranslator Add-Ons."
|
||||||
|
};
|
||||||
@@ -8,25 +8,31 @@
|
|||||||
#include "ConfigView.h"
|
#include "ConfigView.h"
|
||||||
#include "RAWTranslator.h"
|
#include "RAWTranslator.h"
|
||||||
|
|
||||||
#include <StringView.h>
|
#include <Catalog.h>
|
||||||
#include <CheckBox.h>
|
#include <CheckBox.h>
|
||||||
#include <GroupLayout.h>
|
#include <GroupLayout.h>
|
||||||
#include <GroupLayoutBuilder.h>
|
#include <GroupLayoutBuilder.h>
|
||||||
|
#include <StringView.h>
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
#undef B_TRANSLATE_CONTEXT
|
||||||
|
#define B_TRANSLATE_CONTEXT "ConfigView"
|
||||||
|
|
||||||
|
const char* kShortName2 = B_TRANSLATE_MARK("RAWTranslator Settings");
|
||||||
|
|
||||||
|
|
||||||
ConfigView::ConfigView(uint32 flags)
|
ConfigView::ConfigView(uint32 flags)
|
||||||
: BView("RAWTranslator Settings", flags)
|
: BView(kShortName2, flags)
|
||||||
{
|
{
|
||||||
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
||||||
|
|
||||||
BStringView *fTitle = new BStringView("title", "RAW Images");
|
BStringView *fTitle = new BStringView("title", B_TRANSLATE("RAW Images"));
|
||||||
fTitle->SetFont(be_bold_font);
|
fTitle->SetFont(be_bold_font);
|
||||||
|
|
||||||
char version[256];
|
char version[256];
|
||||||
sprintf(version, "Version %d.%d.%d, %s",
|
sprintf(version, B_TRANSLATE("Version %d.%d.%d, %s"),
|
||||||
int(B_TRANSLATION_MAJOR_VERSION(RAW_TRANSLATOR_VERSION)),
|
int(B_TRANSLATION_MAJOR_VERSION(RAW_TRANSLATOR_VERSION)),
|
||||||
int(B_TRANSLATION_MINOR_VERSION(RAW_TRANSLATOR_VERSION)),
|
int(B_TRANSLATION_MINOR_VERSION(RAW_TRANSLATOR_VERSION)),
|
||||||
int(B_TRANSLATION_REVISION_VERSION(RAW_TRANSLATOR_VERSION)),
|
int(B_TRANSLATION_REVISION_VERSION(RAW_TRANSLATOR_VERSION)),
|
||||||
@@ -37,7 +43,7 @@ ConfigView::ConfigView(uint32 flags)
|
|||||||
B_UTF8_COPYRIGHT "2007-2009 Haiku Inc.");
|
B_UTF8_COPYRIGHT "2007-2009 Haiku Inc.");
|
||||||
|
|
||||||
BStringView *fCopyright2 = new BStringView("copyright2",
|
BStringView *fCopyright2 = new BStringView("copyright2",
|
||||||
"Based on Dave Coffin's dcraw 8.63");
|
B_TRANSLATE("Based on Dave Coffin's dcraw 8.63"));
|
||||||
|
|
||||||
BStringView *fCopyright3 = new BStringView("copyright3",
|
BStringView *fCopyright3 = new BStringView("copyright3",
|
||||||
B_UTF8_COPYRIGHT "1997-2007 Dave Coffin");
|
B_UTF8_COPYRIGHT "1997-2007 Dave Coffin");
|
||||||
|
|||||||
@@ -4,17 +4,28 @@ SetSubDirSupportedPlatformsBeOSCompatible ;
|
|||||||
|
|
||||||
SubDirHdrs [ FDirName $(SUBDIR) $(DOTDOT) shared ] ;
|
SubDirHdrs [ FDirName $(SUBDIR) $(DOTDOT) shared ] ;
|
||||||
|
|
||||||
|
AddResources RAWTranslator : RAWTranslator.rdef ;
|
||||||
|
|
||||||
Translator RAWTranslator :
|
Translator RAWTranslator :
|
||||||
# RawTranslator classes
|
# RawTranslator classes
|
||||||
main.cpp
|
main.cpp
|
||||||
RAWTranslator.cpp
|
RAWTranslator.cpp
|
||||||
ConfigView.cpp
|
ConfigView.cpp
|
||||||
RAW.cpp
|
RAW.cpp
|
||||||
: be translation libtranslatorsutils.a $(TARGET_LIBSUPC++)
|
: be locale translation libtranslatorsutils.a
|
||||||
|
$(TARGET_LIBSUPC++) $(HAIKU_LOCALE_LIBS)
|
||||||
$(HAIKU_LOCALE_LIBS)
|
$(HAIKU_LOCALE_LIBS)
|
||||||
: true
|
: true
|
||||||
;
|
;
|
||||||
|
|
||||||
|
DoCatalogs RAWTranslator :
|
||||||
|
x-vnd.Haiku-RAWTranslator
|
||||||
|
:
|
||||||
|
RAWTranslator.cpp
|
||||||
|
ConfigView.cpp
|
||||||
|
main.cpp
|
||||||
|
;
|
||||||
|
|
||||||
Package haiku-translationkit-cvs :
|
Package haiku-translationkit-cvs :
|
||||||
RAWTranslator
|
RAWTranslator
|
||||||
: boot home config add-ons Translators
|
: boot home config add-ons Translators
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
#include "ConfigView.h"
|
#include "ConfigView.h"
|
||||||
#include "RAW.h"
|
#include "RAW.h"
|
||||||
|
|
||||||
|
#include <Catalog.h>
|
||||||
#include <BufferIO.h>
|
#include <BufferIO.h>
|
||||||
#include <Messenger.h>
|
#include <Messenger.h>
|
||||||
#include <TranslatorRoster.h>
|
#include <TranslatorRoster.h>
|
||||||
@@ -16,6 +17,9 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
#undef B_TRANSLATE_CONTEXT
|
||||||
|
#define B_TRANSLATE_CONTEXT "RAWTranslator"
|
||||||
|
|
||||||
|
|
||||||
class FreeAllocation {
|
class FreeAllocation {
|
||||||
public:
|
public:
|
||||||
@@ -45,6 +49,7 @@ const char* kDocumentIndex = "/documentIndex";
|
|||||||
const char* kProgressMonitor = "/progressMonitor";
|
const char* kProgressMonitor = "/progressMonitor";
|
||||||
const char* kProgressMessage = "/progressMessage";
|
const char* kProgressMessage = "/progressMessage";
|
||||||
|
|
||||||
|
|
||||||
// The input formats that this translator supports.
|
// The input formats that this translator supports.
|
||||||
static const translation_format sInputFormats[] = {
|
static const translation_format sInputFormats[] = {
|
||||||
{
|
{
|
||||||
@@ -87,12 +92,15 @@ const uint32 kNumInputFormats = sizeof(sInputFormats) / sizeof(translation_forma
|
|||||||
const uint32 kNumOutputFormats = sizeof(sOutputFormats) / sizeof(translation_format);
|
const uint32 kNumOutputFormats = sizeof(sOutputFormats) / sizeof(translation_format);
|
||||||
const uint32 kNumDefaultSettings = sizeof(sDefaultSettings) / sizeof(TranSetting);
|
const uint32 kNumDefaultSettings = sizeof(sDefaultSettings) / sizeof(TranSetting);
|
||||||
|
|
||||||
|
const char* kShortName1 = B_TRANSLATE_MARK("RAW images");
|
||||||
|
const char* kShortInfo1 = B_TRANSLATE_MARK("RAW image translator");
|
||||||
|
|
||||||
|
|
||||||
// #pragma mark -
|
// #pragma mark -
|
||||||
|
|
||||||
|
|
||||||
RAWTranslator::RAWTranslator()
|
RAWTranslator::RAWTranslator()
|
||||||
: BaseTranslator("RAW images", "RAW image translator",
|
: BaseTranslator(kShortName1, kShortInfo1,
|
||||||
RAW_TRANSLATOR_VERSION,
|
RAW_TRANSLATOR_VERSION,
|
||||||
sInputFormats, kNumInputFormats,
|
sInputFormats, kNumInputFormats,
|
||||||
sOutputFormats, kNumOutputFormats,
|
sOutputFormats, kNumOutputFormats,
|
||||||
@@ -156,7 +164,9 @@ RAWTranslator::DerivedIdentify(BPositionIO *stream,
|
|||||||
info->group = B_TRANSLATOR_BITMAP;
|
info->group = B_TRANSLATOR_BITMAP;
|
||||||
info->quality = RAW_IN_QUALITY;
|
info->quality = RAW_IN_QUALITY;
|
||||||
info->capability = RAW_IN_CAPABILITY;
|
info->capability = RAW_IN_CAPABILITY;
|
||||||
snprintf(info->name, sizeof(info->name), "%s RAW image", meta.manufacturer);
|
snprintf(info->name, sizeof(info->name),
|
||||||
|
B_TRANSLATE_COMMENT("%s RAW image", "Parameter (%s) is the name of "
|
||||||
|
"the manufacturer (like \"Canon\")"), meta.manufacturer);
|
||||||
strcpy(info->MIME, "image/x-vnd.photo-raw");
|
strcpy(info->MIME, "image/x-vnd.photo-raw");
|
||||||
|
|
||||||
return B_OK;
|
return B_OK;
|
||||||
|
|||||||
@@ -8,14 +8,14 @@
|
|||||||
|
|
||||||
#include "BaseTranslator.h"
|
#include "BaseTranslator.h"
|
||||||
|
|
||||||
#include <Translator.h>
|
#include <ByteOrder.h>
|
||||||
#include <TranslatorFormats.h>
|
|
||||||
#include <TranslationDefs.h>
|
|
||||||
#include <GraphicsDefs.h>
|
|
||||||
#include <InterfaceDefs.h>
|
|
||||||
#include <DataIO.h>
|
#include <DataIO.h>
|
||||||
#include <File.h>
|
#include <File.h>
|
||||||
#include <ByteOrder.h>
|
#include <GraphicsDefs.h>
|
||||||
|
#include <InterfaceDefs.h>
|
||||||
|
#include <TranslationDefs.h>
|
||||||
|
#include <Translator.h>
|
||||||
|
#include <TranslatorFormats.h>
|
||||||
|
|
||||||
|
|
||||||
#define RAW_TRANSLATOR_VERSION B_TRANSLATION_MAKE_VERSION(0, 5, 0)
|
#define RAW_TRANSLATOR_VERSION B_TRANSLATION_MAKE_VERSION(0, 5, 0)
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
/*
|
||||||
|
* RAWTranslator.rdef
|
||||||
|
*/
|
||||||
|
|
||||||
|
resource app_signature "application/x-vnd.Haiku-RAWTranslator";
|
||||||
|
|
||||||
|
resource app_version {
|
||||||
|
major = 0,
|
||||||
|
middle = 5,
|
||||||
|
minor = 0,
|
||||||
|
variety = 0,
|
||||||
|
internal = 0,
|
||||||
|
short_info = "0.5.0",
|
||||||
|
long_info = "Haiku RAWTranslator Add-Ons."
|
||||||
|
};
|
||||||
@@ -9,6 +9,7 @@
|
|||||||
#include "TranslatorWindow.h"
|
#include "TranslatorWindow.h"
|
||||||
|
|
||||||
#include <Application.h>
|
#include <Application.h>
|
||||||
|
#include <Catalog.h>
|
||||||
|
|
||||||
#define TEST_MODE 0
|
#define TEST_MODE 0
|
||||||
#define SHOW_MODE 1
|
#define SHOW_MODE 1
|
||||||
@@ -24,6 +25,8 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
#undef B_TRANSLATE_CONTEXT
|
||||||
|
#define B_TRANSLATE_CONTEXT "RAWTranslator main"
|
||||||
|
|
||||||
int
|
int
|
||||||
main(int argc, char **argv)
|
main(int argc, char **argv)
|
||||||
@@ -63,11 +66,10 @@ main(int argc, char **argv)
|
|||||||
printf("software: %s\n", meta.software);
|
printf("software: %s\n", meta.software);
|
||||||
printf("flash used: %g\n", meta.flash_used);
|
printf("flash used: %g\n", meta.flash_used);
|
||||||
printf("ISO speed: %g\n", meta.iso_speed);
|
printf("ISO speed: %g\n", meta.iso_speed);
|
||||||
printf("shutter: ");
|
|
||||||
if (meta.shutter >= 1)
|
if (meta.shutter >= 1)
|
||||||
printf("%g sec\n", meta.shutter);
|
printf("shutter: %g sec\n", meta.shutter);
|
||||||
else
|
else
|
||||||
printf("1/%g sec\n", 1 / meta.shutter);
|
printf("shutter: 1/%g sec\n", 1 / meta.shutter);
|
||||||
printf("aperture: %g\n", meta.aperture);
|
printf("aperture: %g\n", meta.aperture);
|
||||||
printf("focal length: %g mm\n", meta.focal_length);
|
printf("focal length: %g mm\n", meta.focal_length);
|
||||||
printf("pixel aspect: %g\n", meta.pixel_aspect);
|
printf("pixel aspect: %g\n", meta.pixel_aspect);
|
||||||
@@ -116,8 +118,9 @@ main(int argc, char **argv)
|
|||||||
status = output.DetachBitmap(&bitmap);
|
status = output.DetachBitmap(&bitmap);
|
||||||
if (status == B_OK) {
|
if (status == B_OK) {
|
||||||
BWindow* window = new BWindow(BRect(0, 0, 1, 1),
|
BWindow* window = new BWindow(BRect(0, 0, 1, 1),
|
||||||
"RAW", B_TITLED_WINDOW, B_ASYNCHRONOUS_CONTROLS
|
B_TRANSLATE("RAW"), B_TITLED_WINDOW,
|
||||||
| B_NOT_RESIZABLE | B_AUTO_UPDATE_SIZE_LIMITS);
|
B_ASYNCHRONOUS_CONTROLS | B_NOT_RESIZABLE |
|
||||||
|
B_AUTO_UPDATE_SIZE_LIMITS);
|
||||||
BView* view = new BView(window->Bounds(), NULL,
|
BView* view = new BView(window->Bounds(), NULL,
|
||||||
B_WILL_DRAW, B_FOLLOW_NONE);
|
B_WILL_DRAW, B_FOLLOW_NONE);
|
||||||
window->AddChild(view);
|
window->AddChild(view);
|
||||||
@@ -140,7 +143,8 @@ main(int argc, char **argv)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
status_t status = LaunchTranslatorWindow(new RAWTranslator, "RAW Settings");
|
status_t status = LaunchTranslatorWindow(new RAWTranslator,
|
||||||
|
B_TRANSLATE("RAW Settings"));
|
||||||
if (status != B_OK)
|
if (status != B_OK)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
|
|||||||
@@ -7,13 +7,17 @@
|
|||||||
#include "ConfigView.h"
|
#include "ConfigView.h"
|
||||||
#include "RTFTranslator.h"
|
#include "RTFTranslator.h"
|
||||||
|
|
||||||
|
#include <Catalog.h>
|
||||||
#include <StringView.h>
|
#include <StringView.h>
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
|
#undef B_TRANSLATE_CONTEXT
|
||||||
|
#define B_TRANSLATE_CONTEXT "ConfigView"
|
||||||
|
|
||||||
|
|
||||||
ConfigView::ConfigView(const BRect &frame, uint32 resize, uint32 flags)
|
ConfigView::ConfigView(const BRect &frame, uint32 resize, uint32 flags)
|
||||||
: BView(frame, "RTF-Translator Settings", resize, flags)
|
: BView(frame, B_TRANSLATE("RTF-Translator Settings"), resize, flags)
|
||||||
{
|
{
|
||||||
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
||||||
|
|
||||||
@@ -22,7 +26,8 @@ ConfigView::ConfigView(const BRect &frame, uint32 resize, uint32 flags)
|
|||||||
float height = fontHeight.descent + fontHeight.ascent + fontHeight.leading;
|
float height = fontHeight.descent + fontHeight.ascent + fontHeight.leading;
|
||||||
|
|
||||||
BRect rect(10, 10, 200, 10 + height);
|
BRect rect(10, 10, 200, 10 + height);
|
||||||
BStringView *stringView = new BStringView(rect, "title", "Rich Text Format (RTF) files");
|
BStringView *stringView = new BStringView(rect, "title",
|
||||||
|
B_TRANSLATE("Rich Text Format (RTF) files"));
|
||||||
stringView->SetFont(be_bold_font);
|
stringView->SetFont(be_bold_font);
|
||||||
stringView->ResizeToPreferred();
|
stringView->ResizeToPreferred();
|
||||||
AddChild(stringView);
|
AddChild(stringView);
|
||||||
@@ -31,11 +36,11 @@ ConfigView::ConfigView(const BRect &frame, uint32 resize, uint32 flags)
|
|||||||
|
|
||||||
rect.OffsetBy(0, height + 10);
|
rect.OffsetBy(0, height + 10);
|
||||||
char version[256];
|
char version[256];
|
||||||
snprintf(version, sizeof(version), "Version %d.%d.%d, %s",
|
snprintf(version, sizeof(version), B_TRANSLATE("Version %d.%d.%d, %s"),
|
||||||
int(B_TRANSLATION_MAJOR_VERSION(RTF_TRANSLATOR_VERSION)),
|
static_cast<int>(B_TRANSLATION_MAJOR_VERSION(RTF_TRANSLATOR_VERSION)),
|
||||||
int(B_TRANSLATION_MINOR_VERSION(RTF_TRANSLATOR_VERSION)),
|
static_cast<int>(B_TRANSLATION_MINOR_VERSION(RTF_TRANSLATOR_VERSION)),
|
||||||
int(B_TRANSLATION_REVISION_VERSION(RTF_TRANSLATOR_VERSION)),
|
static_cast<int>(B_TRANSLATION_REVISION_VERSION(
|
||||||
__DATE__);
|
RTF_TRANSLATOR_VERSION)), __DATE__);
|
||||||
stringView = new BStringView(rect, "version", version);
|
stringView = new BStringView(rect, "version", version);
|
||||||
stringView->ResizeToPreferred();
|
stringView->ResizeToPreferred();
|
||||||
AddChild(stringView);
|
AddChild(stringView);
|
||||||
@@ -47,7 +52,8 @@ ConfigView::ConfigView(const BRect &frame, uint32 resize, uint32 flags)
|
|||||||
height = fontHeight.descent + fontHeight.ascent + fontHeight.leading;
|
height = fontHeight.descent + fontHeight.ascent + fontHeight.leading;
|
||||||
|
|
||||||
rect.OffsetBy(0, height + 5);
|
rect.OffsetBy(0, height + 5);
|
||||||
stringView = new BStringView(rect, "Copyright", B_UTF8_COPYRIGHT "2004-2006 Haiku Inc.");
|
stringView = new BStringView(rect,
|
||||||
|
"Copyright", B_UTF8_COPYRIGHT "2004-2006 Haiku Inc.");
|
||||||
stringView->ResizeToPreferred();
|
stringView->ResizeToPreferred();
|
||||||
AddChild(stringView);
|
AddChild(stringView);
|
||||||
|
|
||||||
|
|||||||
@@ -8,6 +8,8 @@ SubDirHdrs [ FDirName $(SUBDIR) $(DOTDOT) shared ] ;
|
|||||||
|
|
||||||
UsePrivateHeaders shared storage ;
|
UsePrivateHeaders shared storage ;
|
||||||
|
|
||||||
|
AddResources RTF-Translator : RTFTranslator.rdef ;
|
||||||
|
|
||||||
Translator RTF-Translator :
|
Translator RTF-Translator :
|
||||||
main.cpp
|
main.cpp
|
||||||
ConfigView.cpp
|
ConfigView.cpp
|
||||||
@@ -16,7 +18,16 @@ Translator RTF-Translator :
|
|||||||
RTF.cpp
|
RTF.cpp
|
||||||
RTFTranslator.cpp
|
RTFTranslator.cpp
|
||||||
|
|
||||||
: be translation libtranslatorsutils.a $(TARGET_LIBSUPC++)
|
: be translation libtranslatorsutils.a $(TARGET_LIBSUPC++)
|
||||||
|
$(HAIKU_LOCALE_LIBS)
|
||||||
$(HAIKU_LOCALE_LIBS)
|
$(HAIKU_LOCALE_LIBS)
|
||||||
: true
|
: true
|
||||||
;
|
;
|
||||||
|
|
||||||
|
DoCatalogs RTF-Translator :
|
||||||
|
x-vnd.Haiku-RTFTranslator
|
||||||
|
:
|
||||||
|
main.cpp
|
||||||
|
RTFTranslator.cpp
|
||||||
|
ConfigView.cpp
|
||||||
|
;
|
||||||
|
|||||||
@@ -9,10 +9,13 @@
|
|||||||
#include "RTF.h"
|
#include "RTF.h"
|
||||||
#include "convert.h"
|
#include "convert.h"
|
||||||
|
|
||||||
|
#include <Catalog.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
#undef B_TRANSLATE_CONTEXT
|
||||||
|
#define B_TRANSLATE_CONTEXT "RTFTranslator"
|
||||||
|
|
||||||
#define READ_BUFFER_SIZE 2048
|
#define READ_BUFFER_SIZE 2048
|
||||||
#define DATA_BUFFER_SIZE 64
|
#define DATA_BUFFER_SIZE 64
|
||||||
@@ -54,10 +57,11 @@ static const translation_format sOutputFormats[] = {
|
|||||||
RTFTranslator::RTFTranslator()
|
RTFTranslator::RTFTranslator()
|
||||||
{
|
{
|
||||||
char info[256];
|
char info[256];
|
||||||
sprintf(info, "Rich Text Format translator v%d.%d.%d %s",
|
sprintf(info, B_TRANSLATE("Rich Text Format translator v%d.%d.%d %s"),
|
||||||
int(B_TRANSLATION_MAJOR_VERSION(RTF_TRANSLATOR_VERSION)),
|
static_cast<int>(B_TRANSLATION_MAJOR_VERSION(RTF_TRANSLATOR_VERSION)),
|
||||||
int(B_TRANSLATION_MINOR_VERSION(RTF_TRANSLATOR_VERSION)),
|
static_cast<int>(B_TRANSLATION_MINOR_VERSION(RTF_TRANSLATOR_VERSION)),
|
||||||
int(B_TRANSLATION_REVISION_VERSION(RTF_TRANSLATOR_VERSION)),
|
static_cast<int>(B_TRANSLATION_REVISION_VERSION(
|
||||||
|
RTF_TRANSLATOR_VERSION)),
|
||||||
__DATE__);
|
__DATE__);
|
||||||
|
|
||||||
fInfo = strdup(info);
|
fInfo = strdup(info);
|
||||||
@@ -73,14 +77,14 @@ RTFTranslator::~RTFTranslator()
|
|||||||
const char *
|
const char *
|
||||||
RTFTranslator::TranslatorName() const
|
RTFTranslator::TranslatorName() const
|
||||||
{
|
{
|
||||||
return "RTF text files";
|
return B_TRANSLATE("RTF text files");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
const char *
|
const char *
|
||||||
RTFTranslator::TranslatorInfo() const
|
RTFTranslator::TranslatorInfo() const
|
||||||
{
|
{
|
||||||
return "Rich Text Format Translator";
|
return B_TRANSLATE("Rich Text Format Translator");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -131,7 +135,7 @@ RTFTranslator::Identify(BPositionIO *stream,
|
|||||||
info->group = B_TRANSLATOR_TEXT;
|
info->group = B_TRANSLATOR_TEXT;
|
||||||
info->quality = RTF_IN_QUALITY;
|
info->quality = RTF_IN_QUALITY;
|
||||||
info->capability = RTF_IN_CAPABILITY;
|
info->capability = RTF_IN_CAPABILITY;
|
||||||
strcpy(info->name, "RichTextFormat file");
|
strcpy(info->name, B_TRANSLATE("RichTextFormat file"));
|
||||||
strcpy(info->MIME, "text/rtf");
|
strcpy(info->MIME, "text/rtf");
|
||||||
|
|
||||||
return B_OK;
|
return B_OK;
|
||||||
@@ -168,7 +172,8 @@ RTFTranslator::Translate(BPositionIO *source,
|
|||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
RTFTranslator::MakeConfigurationView(BMessage *ioExtension, BView **_view, BRect *_extent)
|
RTFTranslator::MakeConfigurationView(BMessage *ioExtension, BView **_view,
|
||||||
|
BRect *_extent)
|
||||||
{
|
{
|
||||||
if (_view == NULL || _extent == NULL)
|
if (_view == NULL || _extent == NULL)
|
||||||
return B_BAD_VALUE;
|
return B_BAD_VALUE;
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
/*
|
||||||
|
* RTFTranslator.rdef
|
||||||
|
*/
|
||||||
|
|
||||||
|
resource app_signature "application/x-vnd.Haiku-RTFTranslator";
|
||||||
|
|
||||||
|
resource app_version {
|
||||||
|
major = 0,
|
||||||
|
middle = 6,
|
||||||
|
minor = 0,
|
||||||
|
variety = 0,
|
||||||
|
internal = 0,
|
||||||
|
short_info = "0.6.0",
|
||||||
|
long_info = "Haiku RTFTranslator Add-Ons."
|
||||||
|
};
|
||||||
@@ -6,8 +6,10 @@
|
|||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <syslog.h>
|
||||||
|
|
||||||
#include <Application.h>
|
#include <Application.h>
|
||||||
|
#include <Catalog.h>
|
||||||
#include <FileIO.h>
|
#include <FileIO.h>
|
||||||
#include <TranslatorRoster.h>
|
#include <TranslatorRoster.h>
|
||||||
|
|
||||||
@@ -17,6 +19,9 @@
|
|||||||
#include "RTF.h"
|
#include "RTF.h"
|
||||||
#include "RTFTranslator.h"
|
#include "RTFTranslator.h"
|
||||||
|
|
||||||
|
#undef B_TRANSLATE_CONTEXT
|
||||||
|
#define B_TRANSLATE_CONTEXT "main"
|
||||||
|
|
||||||
|
|
||||||
int
|
int
|
||||||
main(int argc, char** argv)
|
main(int argc, char** argv)
|
||||||
@@ -30,8 +35,9 @@ main(int argc, char** argv)
|
|||||||
BFile input;
|
BFile input;
|
||||||
status_t status = input.SetTo(argv[i], B_READ_ONLY);
|
status_t status = input.SetTo(argv[i], B_READ_ONLY);
|
||||||
if (status != B_OK) {
|
if (status != B_OK) {
|
||||||
fprintf(stderr, "Could not open file \"%s\": %s\n", argv[i],
|
syslog(LOG_ERR,
|
||||||
strerror(status));
|
"RTFTranslator:Could not open file \"%s\": %s\n",
|
||||||
|
argv[i], strerror(status));
|
||||||
result = 1;
|
result = 1;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -41,8 +47,9 @@ main(int argc, char** argv)
|
|||||||
|
|
||||||
status = parser.Parse(header);
|
status = parser.Parse(header);
|
||||||
if (status != B_OK) {
|
if (status != B_OK) {
|
||||||
fprintf(stderr, "Could not convert file \"%s\": %s\n", argv[i],
|
syslog(LOG_ERR,
|
||||||
strerror(status));
|
"RTFTranslator:Could not convert file \"%s\": %s\n",
|
||||||
|
argv[i], strerror(status));
|
||||||
result = 1;
|
result = 1;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
@@ -56,8 +63,8 @@ main(int argc, char** argv)
|
|||||||
BApplication app("application/x-vnd.Haiku-RTFTranslator");
|
BApplication app("application/x-vnd.Haiku-RTFTranslator");
|
||||||
|
|
||||||
status_t result;
|
status_t result;
|
||||||
result = LaunchTranslatorWindow(new RTFTranslator, "RTF Settings",
|
result = LaunchTranslatorWindow(new RTFTranslator,
|
||||||
BRect(0, 0, 225, 175));
|
B_TRANSLATE("RTF Settings"), BRect(0, 0, 225, 175));
|
||||||
if (result != B_OK)
|
if (result != B_OK)
|
||||||
return 1;
|
return 1;
|
||||||
|
|
||||||
|
|||||||
@@ -4,17 +4,25 @@ SetSubDirSupportedPlatformsBeOSCompatible ;
|
|||||||
|
|
||||||
SubDirHdrs [ FDirName $(SUBDIR) $(DOTDOT) shared ] ;
|
SubDirHdrs [ FDirName $(SUBDIR) $(DOTDOT) shared ] ;
|
||||||
|
|
||||||
|
AddResources SGITranslator : SGITranslator.rdef ;
|
||||||
|
|
||||||
Translator SGITranslator :
|
Translator SGITranslator :
|
||||||
SGIImage.cpp
|
SGIImage.cpp
|
||||||
SGIMain.cpp
|
SGIMain.cpp
|
||||||
SGITranslator.cpp
|
SGITranslator.cpp
|
||||||
SGIView.cpp
|
SGIView.cpp
|
||||||
|
: be translation libtranslatorsutils.a $(TARGET_LIBSUPC++) $(HAIKU_LOCALE_LIBS)
|
||||||
: be translation libtranslatorsutils.a $(TARGET_LIBSUPC++)
|
|
||||||
$(HAIKU_LOCALE_LIBS)
|
|
||||||
: true
|
: true
|
||||||
;
|
;
|
||||||
|
|
||||||
|
DoCatalogs SGITranslator :
|
||||||
|
x-vnd.Haiku-SGITranslator
|
||||||
|
:
|
||||||
|
SGIMain.cpp
|
||||||
|
SGITranslator.cpp
|
||||||
|
SGIView.cpp
|
||||||
|
;
|
||||||
|
|
||||||
Package haiku-translationkit-cvs :
|
Package haiku-translationkit-cvs :
|
||||||
SGITranslator :
|
SGITranslator :
|
||||||
boot home config add-ons Translators ;
|
boot home config add-ons Translators ;
|
||||||
|
|||||||
@@ -35,9 +35,13 @@
|
|||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
#include <Application.h>
|
#include <Application.h>
|
||||||
|
#include <Catalog.h>
|
||||||
#include "SGITranslator.h"
|
#include "SGITranslator.h"
|
||||||
#include "TranslatorWindow.h"
|
#include "TranslatorWindow.h"
|
||||||
|
|
||||||
|
#undef B_TRANSLATE_CONTEXT
|
||||||
|
#define B_TRANSLATE_CONTEXT "SGIMain"
|
||||||
|
|
||||||
// ---------------------------------------------------------------
|
// ---------------------------------------------------------------
|
||||||
// main
|
// main
|
||||||
//
|
//
|
||||||
@@ -57,7 +61,7 @@ main()
|
|||||||
BApplication app("application/x-vnd.Haiku-SGITranslator");
|
BApplication app("application/x-vnd.Haiku-SGITranslator");
|
||||||
status_t result;
|
status_t result;
|
||||||
result = LaunchTranslatorWindow(new SGITranslator,
|
result = LaunchTranslatorWindow(new SGITranslator,
|
||||||
"SGI Settings", BRect(0, 0, 225, 175));
|
B_TRANSLATE("SGI Settings"), BRect(0, 0, 225, 175));
|
||||||
if (result == B_OK) {
|
if (result == B_OK) {
|
||||||
app.Run();
|
app.Run();
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@@ -43,7 +43,9 @@
|
|||||||
#include <new>
|
#include <new>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
#include <syslog.h>
|
||||||
|
|
||||||
|
#include <Catalog.h>
|
||||||
#include <OS.h>
|
#include <OS.h>
|
||||||
|
|
||||||
#include "SGIImage.h"
|
#include "SGIImage.h"
|
||||||
@@ -52,6 +54,10 @@
|
|||||||
|
|
||||||
using std::nothrow;
|
using std::nothrow;
|
||||||
|
|
||||||
|
#undef B_TRANSLATE_CONTEXT
|
||||||
|
#define B_TRANSLATE_CONTEXT "SGITranslator"
|
||||||
|
|
||||||
|
|
||||||
// The input formats that this translator supports.
|
// The input formats that this translator supports.
|
||||||
static const translation_format sInputFormats[] = {
|
static const translation_format sInputFormats[] = {
|
||||||
{
|
{
|
||||||
@@ -152,7 +158,8 @@ make_nth_translator(int32 n, image_id you, uint32 flags, ...)
|
|||||||
// ---------------------------------------------------------------
|
// ---------------------------------------------------------------
|
||||||
SGITranslator::SGITranslator()
|
SGITranslator::SGITranslator()
|
||||||
:
|
:
|
||||||
BaseTranslator("SGI images", "SGI image translator",
|
BaseTranslator(B_TRANSLATE("SGI images"),
|
||||||
|
B_TRANSLATE("SGI image translator"),
|
||||||
SGI_TRANSLATOR_VERSION,
|
SGI_TRANSLATOR_VERSION,
|
||||||
sInputFormats, kNumInputFormats,
|
sInputFormats, kNumInputFormats,
|
||||||
sOutputFormats, kNumOutputFormats,
|
sOutputFormats, kNumOutputFormats,
|
||||||
@@ -196,7 +203,7 @@ identify_sgi_header(BPositionIO *inSource, translator_info *outInfo, uint32 outT
|
|||||||
outInfo->quality = SGI_IN_QUALITY;
|
outInfo->quality = SGI_IN_QUALITY;
|
||||||
outInfo->capability = SGI_IN_CAPABILITY;
|
outInfo->capability = SGI_IN_CAPABILITY;
|
||||||
strcpy(outInfo->MIME, "image/sgi");
|
strcpy(outInfo->MIME, "image/sgi");
|
||||||
strcpy(outInfo->name, "SGI image");
|
strcpy(outInfo->name, B_TRANSLATE("SGI image"));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
delete sgiImage;
|
delete sgiImage;
|
||||||
@@ -412,7 +419,8 @@ SGITranslator::translate_from_bits(BPositionIO *inSource, uint32 outType,
|
|||||||
for (uint32 z = 0; z < channelCount; z++) {
|
for (uint32 z = 0; z < channelCount; z++) {
|
||||||
ret = sgiImage->WriteRow(rows[z], y, z);
|
ret = sgiImage->WriteRow(rows[z], y, z);
|
||||||
if (ret < B_OK) {
|
if (ret < B_OK) {
|
||||||
printf("WriteRow() returned %s!\n", strerror(ret));
|
syslog(LOG_ERR,
|
||||||
|
"WriteRow() returned %s!\n"), strerror(ret);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -498,10 +506,11 @@ SGITranslator::translate_from_sgi(BPositionIO *inSource, uint32 outType,
|
|||||||
sizeof(TranslatorBitmap), B_SWAP_HOST_TO_BENDIAN)) < B_OK) {
|
sizeof(TranslatorBitmap), B_SWAP_HOST_TO_BENDIAN)) < B_OK) {
|
||||||
return ret;
|
return ret;
|
||||||
} else
|
} else
|
||||||
ret = outDestination->Write(&bitsHeader, sizeof(TranslatorBitmap));
|
ret = outDestination->Write(&bitsHeader,
|
||||||
|
sizeof(TranslatorBitmap));
|
||||||
}
|
}
|
||||||
if (ret < B_OK)
|
if (ret < B_OK)
|
||||||
printf("error writing bits header: %s\n", strerror(ret));
|
syslog(LOG_ERR, "error writing bits header: %s\n", strerror(ret));
|
||||||
if (ret >= B_OK && !bheaderonly) {
|
if (ret >= B_OK && !bheaderonly) {
|
||||||
// read one row at a time,
|
// read one row at a time,
|
||||||
// convert to the correct format
|
// convert to the correct format
|
||||||
@@ -738,5 +747,6 @@ SGITranslator::DerivedTranslate(BPositionIO *inSource,
|
|||||||
BView *
|
BView *
|
||||||
SGITranslator::NewConfigView(TranslatorSettings *settings)
|
SGITranslator::NewConfigView(TranslatorSettings *settings)
|
||||||
{
|
{
|
||||||
return new SGIView("SGITranslator Settings", B_WILL_DRAW, settings);
|
return new SGIView(B_TRANSLATE("SGITranslator Settings"), B_WILL_DRAW,
|
||||||
|
settings);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
/*
|
||||||
|
* SGITranslator.rdef
|
||||||
|
*/
|
||||||
|
|
||||||
|
resource app_signature "application/x-vnd.Haiku-SGITranslator";
|
||||||
|
|
||||||
|
resource app_version {
|
||||||
|
major = 1,
|
||||||
|
middle = 0,
|
||||||
|
minor = 0,
|
||||||
|
variety = 0,
|
||||||
|
internal = 0,
|
||||||
|
short_info = "1.0.0",
|
||||||
|
long_info = "Haiku SGITranslator Add-Ons."
|
||||||
|
};
|
||||||
@@ -33,6 +33,7 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
#include <Catalog.h>
|
||||||
#include <GroupLayoutBuilder.h>
|
#include <GroupLayoutBuilder.h>
|
||||||
#include <MenuBar.h>
|
#include <MenuBar.h>
|
||||||
#include <MenuField.h>
|
#include <MenuField.h>
|
||||||
@@ -49,6 +50,9 @@
|
|||||||
|
|
||||||
const char* author = "Stephan Aßmus, <[email protected]>";
|
const char* author = "Stephan Aßmus, <[email protected]>";
|
||||||
|
|
||||||
|
#undef B_TRANSLATE_CONTEXT
|
||||||
|
#define B_TRANSLATE_CONTEXT "SGIView"
|
||||||
|
|
||||||
// add_menu_item
|
// add_menu_item
|
||||||
void
|
void
|
||||||
add_menu_item(BMenu* menu,
|
add_menu_item(BMenu* menu,
|
||||||
@@ -83,11 +87,13 @@ SGIView::SGIView(const char* name, uint32 flags, TranslatorSettings* settings)
|
|||||||
{
|
{
|
||||||
BPopUpMenu* menu = new BPopUpMenu("pick compression");
|
BPopUpMenu* menu = new BPopUpMenu("pick compression");
|
||||||
|
|
||||||
uint32 currentCompression = fSettings->SetGetInt32(SGI_SETTING_COMPRESSION);
|
uint32 currentCompression =
|
||||||
|
fSettings->SetGetInt32(SGI_SETTING_COMPRESSION);
|
||||||
// create the menu items with the various compression methods
|
// create the menu items with the various compression methods
|
||||||
add_menu_item(menu, SGI_COMP_NONE, "None", currentCompression);
|
add_menu_item(menu, SGI_COMP_NONE, B_TRANSLATE("None"),
|
||||||
|
currentCompression);
|
||||||
// menu->AddSeparatorItem();
|
// menu->AddSeparatorItem();
|
||||||
add_menu_item(menu, SGI_COMP_RLE, "RLE", currentCompression);
|
add_menu_item(menu, SGI_COMP_RLE, B_TRANSLATE("RLE"), currentCompression);
|
||||||
|
|
||||||
// DON'T turn this on, it's so slow that I didn't wait long enough
|
// DON'T turn this on, it's so slow that I didn't wait long enough
|
||||||
// the one time I tested this. So I don't know if the code even works.
|
// the one time I tested this. So I don't know if the code even works.
|
||||||
@@ -97,27 +103,29 @@ SGIView::SGIView(const char* name, uint32 flags, TranslatorSettings* settings)
|
|||||||
|
|
||||||
// add_menu_item(menu, SGI_COMP_ARLE, "Agressive RLE", currentCompression);
|
// add_menu_item(menu, SGI_COMP_ARLE, "Agressive RLE", currentCompression);
|
||||||
|
|
||||||
fCompressionMF = new BMenuField("compression", "Use compression:", menu);
|
fCompressionMF = new BMenuField("compression",
|
||||||
|
B_TRANSLATE("Use compression:"), menu);
|
||||||
|
|
||||||
BAlignment labelAlignment(B_ALIGN_LEFT, B_ALIGN_NO_VERTICAL);
|
BAlignment labelAlignment(B_ALIGN_LEFT, B_ALIGN_NO_VERTICAL);
|
||||||
|
|
||||||
BStringView* titleView = new BStringView("title", "SGI image translator");
|
BStringView* titleView = new BStringView("title",
|
||||||
|
B_TRANSLATE("SGI image translator"));
|
||||||
titleView->SetFont(be_bold_font);
|
titleView->SetFont(be_bold_font);
|
||||||
titleView->SetExplicitAlignment(labelAlignment);
|
titleView->SetExplicitAlignment(labelAlignment);
|
||||||
|
|
||||||
char detail[100];
|
char detail[100];
|
||||||
sprintf(detail, "Version %d.%d.%d %s",
|
sprintf(detail, B_TRANSLATE("Version %d.%d.%d %s"),
|
||||||
static_cast<int>(B_TRANSLATION_MAJOR_VERSION(SGI_TRANSLATOR_VERSION)),
|
static_cast<int>(B_TRANSLATION_MAJOR_VERSION(SGI_TRANSLATOR_VERSION)),
|
||||||
static_cast<int>(B_TRANSLATION_MINOR_VERSION(SGI_TRANSLATOR_VERSION)),
|
static_cast<int>(B_TRANSLATION_MINOR_VERSION(SGI_TRANSLATOR_VERSION)),
|
||||||
static_cast<int>(B_TRANSLATION_REVISION_VERSION(SGI_TRANSLATOR_VERSION)),
|
static_cast<int>(B_TRANSLATION_REVISION_VERSION(
|
||||||
__DATE__);
|
SGI_TRANSLATOR_VERSION)), __DATE__);
|
||||||
BStringView* detailView = new BStringView("details", detail);
|
BStringView* detailView = new BStringView("details", detail);
|
||||||
detailView->SetExplicitAlignment(labelAlignment);
|
detailView->SetExplicitAlignment(labelAlignment);
|
||||||
|
|
||||||
BTextView* infoView = new BTextView("info");
|
BTextView* infoView = new BTextView("info");
|
||||||
infoView->SetText(BString("written by:\n")
|
infoView->SetText(BString(B_TRANSLATE("written by:\n"))
|
||||||
.Append(author)
|
.Append(author)
|
||||||
.Append("\n\nbased on GIMP SGI plugin v1.5:\n")
|
.Append(B_TRANSLATE("\n\nbased on GIMP SGI plugin v1.5:\n"))
|
||||||
.Append(kSGICopyright).String());
|
.Append(kSGICopyright).String());
|
||||||
infoView->SetExplicitAlignment(labelAlignment);
|
infoView->SetExplicitAlignment(labelAlignment);
|
||||||
infoView->SetWordWrap(false);
|
infoView->SetWordWrap(false);
|
||||||
|
|||||||
@@ -8,6 +8,8 @@ UseHeaders [ FDirName $(HAIKU_TOP) src servers registrar ] ;
|
|||||||
|
|
||||||
SubDirHdrs [ FDirName $(SUBDIR) $(DOTDOT) shared ] ;
|
SubDirHdrs [ FDirName $(SUBDIR) $(DOTDOT) shared ] ;
|
||||||
|
|
||||||
|
AddResources STXTTranslator : STXTTranslator.rdef ;
|
||||||
|
|
||||||
Translator STXTTranslator :
|
Translator STXTTranslator :
|
||||||
STXTMain.cpp
|
STXTMain.cpp
|
||||||
STXTTranslator.cpp
|
STXTTranslator.cpp
|
||||||
@@ -17,6 +19,14 @@ Translator STXTTranslator :
|
|||||||
: true
|
: true
|
||||||
;
|
;
|
||||||
|
|
||||||
|
DoCatalogs STXTTranslator :
|
||||||
|
x-vnd.Haiku-STXTTranslator
|
||||||
|
:
|
||||||
|
STXTMain.cpp
|
||||||
|
STXTTranslator.cpp
|
||||||
|
STXTView.cpp
|
||||||
|
;
|
||||||
|
|
||||||
#Package haiku-translationkit-cvs :
|
#Package haiku-translationkit-cvs :
|
||||||
# STXTTranslator :
|
# STXTTranslator :
|
||||||
# boot home config add-ons Translators ;
|
# boot home config add-ons Translators ;
|
||||||
|
|||||||
@@ -33,9 +33,13 @@
|
|||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
#include <Application.h>
|
#include <Application.h>
|
||||||
|
#include <Catalog.h>
|
||||||
#include "STXTTranslator.h"
|
#include "STXTTranslator.h"
|
||||||
#include "TranslatorWindow.h"
|
#include "TranslatorWindow.h"
|
||||||
|
|
||||||
|
#undef B_TRANSLATE_CONTEXT
|
||||||
|
#define B_TRANSLATE_CONTEXT "STXTMain"
|
||||||
|
|
||||||
// ---------------------------------------------------------------
|
// ---------------------------------------------------------------
|
||||||
// main
|
// main
|
||||||
//
|
//
|
||||||
@@ -55,7 +59,7 @@ main()
|
|||||||
BApplication app("application/x-vnd.Haiku-STXTTranslator");
|
BApplication app("application/x-vnd.Haiku-STXTTranslator");
|
||||||
status_t result;
|
status_t result;
|
||||||
result = LaunchTranslatorWindow(new STXTTranslator,
|
result = LaunchTranslatorWindow(new STXTTranslator,
|
||||||
"STXT Settings", BRect(0, 0, 225, 175));
|
B_TRANSLATE("STXT Settings"), BRect(0, 0, 225, 175));
|
||||||
if (result == B_OK) {
|
if (result == B_OK) {
|
||||||
app.Run();
|
app.Run();
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@@ -11,6 +11,7 @@
|
|||||||
#include "STXTTranslator.h"
|
#include "STXTTranslator.h"
|
||||||
#include "STXTView.h"
|
#include "STXTView.h"
|
||||||
|
|
||||||
|
#include <Catalog.h>
|
||||||
#include <CharacterSet.h>
|
#include <CharacterSet.h>
|
||||||
#include <CharacterSetRoster.h>
|
#include <CharacterSetRoster.h>
|
||||||
#include <MimeType.h>
|
#include <MimeType.h>
|
||||||
@@ -27,6 +28,8 @@
|
|||||||
using namespace BPrivate;
|
using namespace BPrivate;
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
|
#undef B_TRANSLATE_CONTEXT
|
||||||
|
#define B_TRANSLATE_CONTEXT "STXTTranslator"
|
||||||
|
|
||||||
#define READ_BUFFER_SIZE 32768
|
#define READ_BUFFER_SIZE 32768
|
||||||
#define DATA_BUFFER_SIZE 256
|
#define DATA_BUFFER_SIZE 256
|
||||||
@@ -857,7 +860,7 @@ identify_stxt_header(const TranslatorStyledTextStreamHeader &header,
|
|||||||
outInfo->group = B_TRANSLATOR_TEXT;
|
outInfo->group = B_TRANSLATOR_TEXT;
|
||||||
outInfo->quality = STXT_IN_QUALITY;
|
outInfo->quality = STXT_IN_QUALITY;
|
||||||
outInfo->capability = STXT_IN_CAPABILITY;
|
outInfo->capability = STXT_IN_CAPABILITY;
|
||||||
strcpy(outInfo->name, "Be styled text file");
|
strcpy(outInfo->name, B_TRANSLATE("Be styled text file"));
|
||||||
strcpy(outInfo->MIME, "text/x-vnd.Be-stxt");
|
strcpy(outInfo->MIME, "text/x-vnd.Be-stxt");
|
||||||
|
|
||||||
return B_OK;
|
return B_OK;
|
||||||
@@ -904,7 +907,8 @@ identify_text(uint8* data, int32 bytesRead, BPositionIO* source,
|
|||||||
if (type.GetLongDescription(description) == B_OK)
|
if (type.GetLongDescription(description) == B_OK)
|
||||||
strlcpy(outInfo->name, description, sizeof(outInfo->name));
|
strlcpy(outInfo->name, description, sizeof(outInfo->name));
|
||||||
else
|
else
|
||||||
strlcpy(outInfo->name, "Plain text file", sizeof(outInfo->name));
|
strlcpy(outInfo->name, B_TRANSLATE("Plain text file"),
|
||||||
|
sizeof(outInfo->name));
|
||||||
|
|
||||||
//strlcpy(outInfo->MIME, type.Type(), sizeof(outInfo->MIME));
|
//strlcpy(outInfo->MIME, type.Type(), sizeof(outInfo->MIME));
|
||||||
strcpy(outInfo->MIME, "text/plain");
|
strcpy(outInfo->MIME, "text/plain");
|
||||||
@@ -1333,7 +1337,8 @@ translate_from_text(BPositionIO* source, const char* encoding, bool forceEncodin
|
|||||||
|
|
||||||
|
|
||||||
STXTTranslator::STXTTranslator()
|
STXTTranslator::STXTTranslator()
|
||||||
: BaseTranslator("StyledEdit files", "StyledEdit files translator",
|
: BaseTranslator(B_TRANSLATE("StyledEdit files"),
|
||||||
|
B_TRANSLATE("StyledEdit files translator"),
|
||||||
STXT_TRANSLATOR_VERSION,
|
STXT_TRANSLATOR_VERSION,
|
||||||
sInputFormats, kNumInputFormats,
|
sInputFormats, kNumInputFormats,
|
||||||
sOutputFormats, kNumOutputFormats,
|
sOutputFormats, kNumOutputFormats,
|
||||||
@@ -1455,7 +1460,8 @@ STXTTranslator::Translate(BPositionIO* source, const translator_info* info,
|
|||||||
BView *
|
BView *
|
||||||
STXTTranslator::NewConfigView(TranslatorSettings *settings)
|
STXTTranslator::NewConfigView(TranslatorSettings *settings)
|
||||||
{
|
{
|
||||||
return new STXTView(BRect(0, 0, 225, 175), "STXTTranslator Settings",
|
return new STXTView(BRect(0, 0, 225, 175),
|
||||||
|
B_TRANSLATE("STXTTranslator Settings"),
|
||||||
B_FOLLOW_ALL, B_WILL_DRAW, settings);
|
B_FOLLOW_ALL, B_WILL_DRAW, settings);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
/*
|
||||||
|
* STXTTranslator.rdef
|
||||||
|
*/
|
||||||
|
|
||||||
|
resource app_signature "application/x-vnd.Haiku-STXTTranslator";
|
||||||
|
|
||||||
|
resource app_version {
|
||||||
|
major = 1,
|
||||||
|
middle = 0,
|
||||||
|
minor = 0,
|
||||||
|
variety = 0,
|
||||||
|
internal = 0,
|
||||||
|
short_info = "1.0.0",
|
||||||
|
long_info = "Haiku STXTTranslator Add-Ons."
|
||||||
|
};
|
||||||
@@ -4,15 +4,24 @@ SetSubDirSupportedPlatformsBeOSCompatible ;
|
|||||||
|
|
||||||
SubDirHdrs [ FDirName $(SUBDIR) $(DOTDOT) shared ] ;
|
SubDirHdrs [ FDirName $(SUBDIR) $(DOTDOT) shared ] ;
|
||||||
|
|
||||||
|
AddResources TGATranslator : TGATranslator.rdef ;
|
||||||
|
|
||||||
Translator TGATranslator :
|
Translator TGATranslator :
|
||||||
TGAMain.cpp
|
TGAMain.cpp
|
||||||
TGATranslator.cpp
|
TGATranslator.cpp
|
||||||
TGAView.cpp
|
TGAView.cpp
|
||||||
: be translation libtranslatorsutils.a $(TARGET_LIBSUPC++)
|
: be translation libtranslatorsutils.a $(TARGET_LIBSUPC++) $(HAIKU_LOCALE_LIBS)
|
||||||
$(HAIKU_LOCALE_LIBS)
|
|
||||||
: true
|
: true
|
||||||
;
|
;
|
||||||
|
|
||||||
|
DoCatalogs TGATranslator :
|
||||||
|
x-vnd.Haiku-TGATranslator
|
||||||
|
:
|
||||||
|
TGAMain.cpp
|
||||||
|
TGATranslator.cpp
|
||||||
|
TGAView.cpp
|
||||||
|
;
|
||||||
|
|
||||||
Package haiku-translationkit-cvs :
|
Package haiku-translationkit-cvs :
|
||||||
TGATranslator :
|
TGATranslator :
|
||||||
boot home config add-ons Translators ;
|
boot home config add-ons Translators ;
|
||||||
|
|||||||
@@ -28,9 +28,14 @@
|
|||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
#include <Application.h>
|
#include <Application.h>
|
||||||
|
#include <Catalog.h>
|
||||||
|
|
||||||
#include "TGATranslator.h"
|
#include "TGATranslator.h"
|
||||||
#include "TranslatorWindow.h"
|
#include "TranslatorWindow.h"
|
||||||
|
|
||||||
|
#undef B_TRANSLATE_CONTEXT
|
||||||
|
#define B_TRANSLATE_CONTEXT "TGAMain"
|
||||||
|
|
||||||
// ---------------------------------------------------------------
|
// ---------------------------------------------------------------
|
||||||
// main
|
// main
|
||||||
//
|
//
|
||||||
@@ -49,7 +54,8 @@ main()
|
|||||||
{
|
{
|
||||||
BApplication app("application/x-vnd.Haiku-TGATranslator");
|
BApplication app("application/x-vnd.Haiku-TGATranslator");
|
||||||
status_t result;
|
status_t result;
|
||||||
result = LaunchTranslatorWindow(new TGATranslator, "TGA Settings");
|
result = LaunchTranslatorWindow(new TGATranslator,
|
||||||
|
B_TRANSLATE("TGA Settings"));
|
||||||
if (result == B_OK) {
|
if (result == B_OK) {
|
||||||
app.Run();
|
app.Run();
|
||||||
return 0;
|
return 0;
|
||||||
|
|||||||
@@ -30,10 +30,16 @@
|
|||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
|
|
||||||
|
#include <Catalog.h>
|
||||||
|
|
||||||
#include "TGATranslator.h"
|
#include "TGATranslator.h"
|
||||||
#include "TGAView.h"
|
#include "TGAView.h"
|
||||||
#include "StreamBuffer.h"
|
#include "StreamBuffer.h"
|
||||||
|
|
||||||
|
#undef B_TRANSLATE_CONTEXT
|
||||||
|
#define B_TRANSLATE_CONTEXT "TGATranslator"
|
||||||
|
|
||||||
// The input formats that this translator supports.
|
// The input formats that this translator supports.
|
||||||
static const translation_format sInputFormats[] = {
|
static const translation_format sInputFormats[] = {
|
||||||
{
|
{
|
||||||
@@ -136,7 +142,8 @@ make_nth_translator(int32 n, image_id you, uint32 flags, ...)
|
|||||||
// Returns:
|
// Returns:
|
||||||
// ---------------------------------------------------------------
|
// ---------------------------------------------------------------
|
||||||
TGATranslator::TGATranslator()
|
TGATranslator::TGATranslator()
|
||||||
: BaseTranslator("TGA images", "TGA image translator",
|
: BaseTranslator(B_TRANSLATE("TGA images"),
|
||||||
|
B_TRANSLATE("TGA image translator"),
|
||||||
TGA_TRANSLATOR_VERSION,
|
TGA_TRANSLATOR_VERSION,
|
||||||
sInputFormats, kNumInputFormats,
|
sInputFormats, kNumInputFormats,
|
||||||
sOutputFormats, kNumOutputFormats,
|
sOutputFormats, kNumOutputFormats,
|
||||||
@@ -385,29 +392,40 @@ identify_tga_header(BPositionIO *inSource, translator_info *outInfo,
|
|||||||
outInfo->group = B_TRANSLATOR_BITMAP;
|
outInfo->group = B_TRANSLATOR_BITMAP;
|
||||||
outInfo->quality = TGA_IN_QUALITY;
|
outInfo->quality = TGA_IN_QUALITY;
|
||||||
outInfo->capability = TGA_IN_CAPABILITY;
|
outInfo->capability = TGA_IN_CAPABILITY;
|
||||||
sprintf(outInfo->name, "Targa image (%d bits",
|
|
||||||
imagespec.depth);
|
|
||||||
switch (fileheader.imagetype) {
|
switch (fileheader.imagetype) {
|
||||||
case TGA_NOCOMP_COLORMAP:
|
case TGA_NOCOMP_COLORMAP:
|
||||||
strcat(outInfo->name, " colormap");
|
snprintf(outInfo->name, sizeof(outInfo->name),
|
||||||
|
B_TRANSLATE("Targa image (%d bits colormap)"),
|
||||||
|
imagespec.depth);
|
||||||
break;
|
break;
|
||||||
case TGA_NOCOMP_TRUECOLOR:
|
case TGA_NOCOMP_TRUECOLOR:
|
||||||
strcat(outInfo->name, " truecolor");
|
snprintf(outInfo->name, sizeof(outInfo->name),
|
||||||
break;
|
B_TRANSLATE("Targa image (%d bits truecolor)"),
|
||||||
case TGA_NOCOMP_BW:
|
imagespec.depth);
|
||||||
strcat(outInfo->name, " gray");
|
|
||||||
break;
|
break;
|
||||||
case TGA_RLE_COLORMAP:
|
case TGA_RLE_COLORMAP:
|
||||||
strcat(outInfo->name, " RLE colormap");
|
snprintf(outInfo->name, sizeof(outInfo->name),
|
||||||
|
B_TRANSLATE("Targa image (%d bits RLE colormap)"),
|
||||||
|
imagespec.depth);
|
||||||
break;
|
break;
|
||||||
case TGA_RLE_TRUECOLOR:
|
case TGA_RLE_TRUECOLOR:
|
||||||
strcat(outInfo->name, " RLE truecolor");
|
snprintf(outInfo->name, sizeof(outInfo->name),
|
||||||
|
B_TRANSLATE("Targa image (%d bits RLE truecolor)"),
|
||||||
|
imagespec.depth);
|
||||||
break;
|
break;
|
||||||
case TGA_RLE_BW:
|
case TGA_RLE_BW:
|
||||||
strcat(outInfo->name, " RLE gray");
|
snprintf(outInfo->name, sizeof(outInfo->name),
|
||||||
|
B_TRANSLATE("Targa image (%d bits RLE gray)"),
|
||||||
|
imagespec.depth);
|
||||||
break;
|
break;
|
||||||
|
case TGA_NOCOMP_BW:
|
||||||
|
default:
|
||||||
|
snprintf(outInfo->name, sizeof(outInfo->name),
|
||||||
|
B_TRANSLATE("Targa image (%d bits gray)"),
|
||||||
|
imagespec.depth);
|
||||||
|
break;
|
||||||
|
|
||||||
}
|
}
|
||||||
strcat(outInfo->name, ")");
|
|
||||||
strcpy(outInfo->MIME, "image/x-targa");
|
strcpy(outInfo->MIME, "image/x-targa");
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2196,6 +2214,7 @@ TGATranslator::DerivedTranslate(BPositionIO *inSource,
|
|||||||
BView *
|
BView *
|
||||||
TGATranslator::NewConfigView(TranslatorSettings *settings)
|
TGATranslator::NewConfigView(TranslatorSettings *settings)
|
||||||
{
|
{
|
||||||
return new TGAView("TGATranslator Settings", B_WILL_DRAW, settings);
|
return new TGAView(B_TRANSLATE("TGATranslator Settings"),
|
||||||
|
B_WILL_DRAW, settings);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
/*
|
||||||
|
* TGATranslator.rdef
|
||||||
|
*/
|
||||||
|
|
||||||
|
resource app_signature "application/x-vnd.Haiku-TGATranslator";
|
||||||
|
|
||||||
|
resource app_version {
|
||||||
|
major = 1,
|
||||||
|
middle = 0,
|
||||||
|
minor = 0,
|
||||||
|
variety = 0,
|
||||||
|
internal = 0,
|
||||||
|
short_info = "1.0.0",
|
||||||
|
long_info = "Haiku TGATranslator Add-Ons."
|
||||||
|
};
|
||||||
@@ -29,6 +29,7 @@
|
|||||||
// DEALINGS IN THE SOFTWARE.
|
// DEALINGS IN THE SOFTWARE.
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
#include <Catalog.h>
|
||||||
#include <GroupLayout.h>
|
#include <GroupLayout.h>
|
||||||
#include <GroupLayoutBuilder.h>
|
#include <GroupLayoutBuilder.h>
|
||||||
#include <SpaceLayoutItem.h>
|
#include <SpaceLayoutItem.h>
|
||||||
@@ -36,10 +37,12 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
|
||||||
#include "TGAView.h"
|
#include "TGAView.h"
|
||||||
#include "TGATranslator.h"
|
#include "TGATranslator.h"
|
||||||
|
|
||||||
|
#undef B_TRANSLATE_CONTEXT
|
||||||
|
#define B_TRANSLATE_CONTEXT "TGAView"
|
||||||
|
|
||||||
|
|
||||||
TGAView::TGAView(const char *name, uint32 flags, TranslatorSettings *settings)
|
TGAView::TGAView(const char *name, uint32 flags, TranslatorSettings *settings)
|
||||||
:
|
:
|
||||||
@@ -53,22 +56,22 @@ TGAView::TGAView(const char *name, uint32 flags, TranslatorSettings *settings)
|
|||||||
fTitle->SetFont(be_bold_font);
|
fTitle->SetFont(be_bold_font);
|
||||||
|
|
||||||
char detail[100];
|
char detail[100];
|
||||||
sprintf(detail, "Version %d.%d.%d %s",
|
sprintf(detail, B_TRANSLATE("Version %d.%d.%d %s"),
|
||||||
static_cast<int>(B_TRANSLATION_MAJOR_VERSION(TGA_TRANSLATOR_VERSION)),
|
static_cast<int>(B_TRANSLATION_MAJOR_VERSION(TGA_TRANSLATOR_VERSION)),
|
||||||
static_cast<int>(B_TRANSLATION_MINOR_VERSION(TGA_TRANSLATOR_VERSION)),
|
static_cast<int>(B_TRANSLATION_MINOR_VERSION(TGA_TRANSLATOR_VERSION)),
|
||||||
static_cast<int>(B_TRANSLATION_REVISION_VERSION(TGA_TRANSLATOR_VERSION)),
|
static_cast<int>(B_TRANSLATION_REVISION_VERSION(
|
||||||
__DATE__);
|
TGA_TRANSLATOR_VERSION)), __DATE__);
|
||||||
fDetail = new BStringView("detail", detail);
|
fDetail = new BStringView("detail", detail);
|
||||||
fWrittenBy = new BStringView("writtenby",
|
fWrittenBy = new BStringView("writtenby",
|
||||||
"Written by the Haiku Translation Kit Team");
|
B_TRANSLATE("Written by the Haiku Translation Kit Team"));
|
||||||
|
|
||||||
fpchkIgnoreAlpha = new BCheckBox("Ignore TGA alpha channel",
|
fpchkIgnoreAlpha = new BCheckBox(B_TRANSLATE("Ignore TGA alpha channel"),
|
||||||
new BMessage(CHANGE_IGNORE_ALPHA));
|
new BMessage(CHANGE_IGNORE_ALPHA));
|
||||||
int32 val = (fSettings->SetGetBool(TGA_SETTING_IGNORE_ALPHA)) ? 1 : 0;
|
int32 val = (fSettings->SetGetBool(TGA_SETTING_IGNORE_ALPHA)) ? 1 : 0;
|
||||||
fpchkIgnoreAlpha->SetValue(val);
|
fpchkIgnoreAlpha->SetValue(val);
|
||||||
fpchkIgnoreAlpha->SetViewColor(ViewColor());
|
fpchkIgnoreAlpha->SetViewColor(ViewColor());
|
||||||
|
|
||||||
fpchkRLE = new BCheckBox("Save with RLE Compression",
|
fpchkRLE = new BCheckBox(B_TRANSLATE("Save with RLE Compression"),
|
||||||
new BMessage(CHANGE_RLE));
|
new BMessage(CHANGE_RLE));
|
||||||
val = (fSettings->SetGetBool(TGA_SETTING_RLE)) ? 1 : 0;
|
val = (fSettings->SetGetBool(TGA_SETTING_RLE)) ? 1 : 0;
|
||||||
fpchkRLE->SetValue(val);
|
fpchkRLE->SetValue(val);
|
||||||
|
|||||||
@@ -6,6 +6,8 @@ UseLibraryHeaders tiff zlib ;
|
|||||||
|
|
||||||
SubDirHdrs [ FDirName $(SUBDIR) $(DOTDOT) shared ] ;
|
SubDirHdrs [ FDirName $(SUBDIR) $(DOTDOT) shared ] ;
|
||||||
|
|
||||||
|
AddResources TIFFTranslator : TIFFTranslator.rdef ;
|
||||||
|
|
||||||
Translator TIFFTranslator :
|
Translator TIFFTranslator :
|
||||||
# [ FGristFiles $(tiff_files:S=$(SUFOBJ)) ]
|
# [ FGristFiles $(tiff_files:S=$(SUFOBJ)) ]
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
/*
|
||||||
|
* TIFFTranslator.rdef
|
||||||
|
*/
|
||||||
|
|
||||||
|
resource app_signature "application/x-vnd.Haiku-TIFFTranslator";
|
||||||
|
|
||||||
|
resource app_version {
|
||||||
|
major = 1,
|
||||||
|
middle = 0,
|
||||||
|
minor = 0,
|
||||||
|
variety = 0,
|
||||||
|
internal = 0,
|
||||||
|
short_info = "1.0.0",
|
||||||
|
long_info = "Haiku TIFFTranslator Add-Ons."
|
||||||
|
};
|
||||||
@@ -5,6 +5,7 @@ SetSubDirSupportedPlatformsBeOSCompatible ;
|
|||||||
SubDirHdrs [ FDirName $(SUBDIR) $(DOTDOT) shared ] ;
|
SubDirHdrs [ FDirName $(SUBDIR) $(DOTDOT) shared ] ;
|
||||||
SubDirHdrs [ FDirName $(SUBDIR) webp ] ;
|
SubDirHdrs [ FDirName $(SUBDIR) webp ] ;
|
||||||
|
|
||||||
|
AddResources WebPTranslator : WebPTranslator.rdef ;
|
||||||
|
|
||||||
Translator WebPTranslator :
|
Translator WebPTranslator :
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
/*
|
||||||
|
* WebPTranslator.rdef
|
||||||
|
*/
|
||||||
|
|
||||||
|
resource app_signature "application/x-vnd.Haiku-WebPTranslator";
|
||||||
|
|
||||||
|
resource app_version {
|
||||||
|
major = 0,
|
||||||
|
middle = 1,
|
||||||
|
minor = 0,
|
||||||
|
variety = 0,
|
||||||
|
internal = 0,
|
||||||
|
short_info = "0.1.0",
|
||||||
|
long_info = "Haiku WebPTranslator Add-Ons."
|
||||||
|
};
|
||||||
@@ -8,6 +8,8 @@ SEARCH_SOURCE += [ FDirName $(HAIKU_TOP) src add-ons translators wonderbrush sup
|
|||||||
UseLibraryHeaders zlib ;
|
UseLibraryHeaders zlib ;
|
||||||
SubDirHdrs [ FDirName $(SUBDIR) $(DOTDOT) shared ] ;
|
SubDirHdrs [ FDirName $(SUBDIR) $(DOTDOT) shared ] ;
|
||||||
|
|
||||||
|
AddResources WonderBrushTranslator : WonderBrushTranslator.rdef ;
|
||||||
|
|
||||||
Translator WonderBrushTranslator :
|
Translator WonderBrushTranslator :
|
||||||
Canvas.cpp
|
Canvas.cpp
|
||||||
Layer.cpp
|
Layer.cpp
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
/*
|
||||||
|
* WonderBrushTranslator.rdef
|
||||||
|
*/
|
||||||
|
|
||||||
|
resource app_signature "application/x-vnd.Haiku-WonderBrushTranslator";
|
||||||
|
|
||||||
|
resource app_version {
|
||||||
|
major = 1,
|
||||||
|
middle = 0,
|
||||||
|
minor = 0,
|
||||||
|
variety = 0,
|
||||||
|
internal = 0,
|
||||||
|
short_info = "1.0.0",
|
||||||
|
long_info = "Haiku WonderBrushTranslator Add-Ons."
|
||||||
|
};
|
||||||
Reference in New Issue
Block a user