Style cleanup (thanks Korli!)
No functional changes, except for the two traces removed. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39511 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -10,10 +10,10 @@
|
|||||||
#include "ConfigView.h"
|
#include "ConfigView.h"
|
||||||
#include "WebPTranslator.h"
|
#include "WebPTranslator.h"
|
||||||
|
|
||||||
#include <StringView.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>
|
||||||
@@ -24,7 +24,7 @@ ConfigView::ConfigView(uint32 flags)
|
|||||||
{
|
{
|
||||||
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
||||||
|
|
||||||
BStringView *fTitle = new BStringView("title", "WebP Images");
|
BStringView* fTitle = new BStringView("title", "WebP Images");
|
||||||
fTitle->SetFont(be_bold_font);
|
fTitle->SetFont(be_bold_font);
|
||||||
|
|
||||||
char version[256];
|
char version[256];
|
||||||
@@ -33,15 +33,15 @@ ConfigView::ConfigView(uint32 flags)
|
|||||||
int(B_TRANSLATION_MINOR_VERSION(WEBP_TRANSLATOR_VERSION)),
|
int(B_TRANSLATION_MINOR_VERSION(WEBP_TRANSLATOR_VERSION)),
|
||||||
int(B_TRANSLATION_REVISION_VERSION(WEBP_TRANSLATOR_VERSION)),
|
int(B_TRANSLATION_REVISION_VERSION(WEBP_TRANSLATOR_VERSION)),
|
||||||
__DATE__);
|
__DATE__);
|
||||||
BStringView *fVersion = new BStringView("version", version);
|
BStringView* fVersion = new BStringView("version", version);
|
||||||
|
|
||||||
BStringView *fCopyright = new BStringView("copyright",
|
BStringView* fCopyright = new BStringView("copyright",
|
||||||
B_UTF8_COPYRIGHT "2010 Haiku Inc.");
|
B_UTF8_COPYRIGHT "2010 Haiku Inc.");
|
||||||
|
|
||||||
BStringView *fCopyright2 = new BStringView("copyright2",
|
BStringView* fCopyright2 = new BStringView("copyright2",
|
||||||
"Based on libwebp v0.1");
|
"Based on libwebp v0.1");
|
||||||
|
|
||||||
BStringView *fCopyright3 = new BStringView("copyright3",
|
BStringView* fCopyright3 = new BStringView("copyright3",
|
||||||
B_UTF8_COPYRIGHT "2010 Google Inc.");
|
B_UTF8_COPYRIGHT "2010 Google Inc.");
|
||||||
|
|
||||||
// Build the layout
|
// Build the layout
|
||||||
|
|||||||
@@ -13,9 +13,10 @@
|
|||||||
|
|
||||||
|
|
||||||
class ConfigView : public BView {
|
class ConfigView : public BView {
|
||||||
public:
|
public:
|
||||||
ConfigView(uint32 flags = B_WILL_DRAW);
|
ConfigView(uint32 flags = B_WILL_DRAW);
|
||||||
virtual ~ConfigView();
|
virtual ~ConfigView();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#endif /* CONFIG_VIEW_H */
|
#endif /* CONFIG_VIEW_H */
|
||||||
|
|||||||
@@ -83,8 +83,7 @@ WebPTranslator::WebPTranslator()
|
|||||||
WEBP_TRANSLATOR_VERSION,
|
WEBP_TRANSLATOR_VERSION,
|
||||||
sInputFormats, kNumInputFormats,
|
sInputFormats, kNumInputFormats,
|
||||||
sOutputFormats, kNumOutputFormats,
|
sOutputFormats, kNumOutputFormats,
|
||||||
"WebPTranslator_Settings",
|
"WebPTranslator_Settings", sDefaultSettings, kNumDefaultSettings,
|
||||||
sDefaultSettings, kNumDefaultSettings,
|
|
||||||
B_TRANSLATOR_BITMAP, WEBP_IMAGE_FORMAT)
|
B_TRANSLATOR_BITMAP, WEBP_IMAGE_FORMAT)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -96,9 +95,9 @@ WebPTranslator::~WebPTranslator()
|
|||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
WebPTranslator::DerivedIdentify(BPositionIO *stream,
|
WebPTranslator::DerivedIdentify(BPositionIO* stream,
|
||||||
const translation_format *format, BMessage *settings,
|
const translation_format* format, BMessage* settings,
|
||||||
translator_info *info, uint32 outType)
|
translator_info* info, uint32 outType)
|
||||||
{
|
{
|
||||||
if (!outType)
|
if (!outType)
|
||||||
outType = B_TRANSLATOR_BITMAP;
|
outType = B_TRANSLATOR_BITMAP;
|
||||||
@@ -129,9 +128,9 @@ WebPTranslator::DerivedIdentify(BPositionIO *stream,
|
|||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
WebPTranslator::DerivedTranslate(BPositionIO *stream,
|
WebPTranslator::DerivedTranslate(BPositionIO* stream,
|
||||||
const translator_info *info, BMessage *settings,
|
const translator_info* info, BMessage* settings,
|
||||||
uint32 outType, BPositionIO *target, int32 baseType)
|
uint32 outType, BPositionIO* target, int32 baseType)
|
||||||
{
|
{
|
||||||
if (!outType)
|
if (!outType)
|
||||||
outType = B_TRANSLATOR_BITMAP;
|
outType = B_TRANSLATOR_BITMAP;
|
||||||
@@ -159,11 +158,8 @@ WebPTranslator::DerivedTranslate(BPositionIO *stream,
|
|||||||
free(streamData);
|
free(streamData);
|
||||||
|
|
||||||
if (out == NULL) {
|
if (out == NULL) {
|
||||||
printf("WebPDecodeRGB(%p, %lld) failed.\n", streamData, streamSize);
|
|
||||||
return B_ILLEGAL_DATA;
|
return B_ILLEGAL_DATA;
|
||||||
}
|
}
|
||||||
printf("WebPDecodeRGB(%p, %lld) succeed: %d x %d WebP image decoded.\n",
|
|
||||||
streamData, streamSize, width, height);
|
|
||||||
|
|
||||||
FreeAllocation _(out);
|
FreeAllocation _(out);
|
||||||
|
|
||||||
@@ -192,6 +188,7 @@ WebPTranslator::DerivedTranslate(BPositionIO *stream,
|
|||||||
|
|
||||||
if (headerOnly)
|
if (headerOnly)
|
||||||
return B_OK;
|
return B_OK;
|
||||||
|
|
||||||
uint32 dataLeft = dataSize;
|
uint32 dataLeft = dataSize;
|
||||||
uint8* p = out;
|
uint8* p = out;
|
||||||
uint8 rgb[3];
|
uint8 rgb[3];
|
||||||
@@ -216,8 +213,8 @@ WebPTranslator::DerivedTranslate(BPositionIO *stream,
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
BView *
|
BView*
|
||||||
WebPTranslator::NewConfigView(TranslatorSettings *settings)
|
WebPTranslator::NewConfigView(TranslatorSettings* settings)
|
||||||
{
|
{
|
||||||
return new ConfigView();
|
return new ConfigView();
|
||||||
}
|
}
|
||||||
@@ -226,7 +223,7 @@ WebPTranslator::NewConfigView(TranslatorSettings *settings)
|
|||||||
// #pragma mark -
|
// #pragma mark -
|
||||||
|
|
||||||
|
|
||||||
BTranslator *
|
BTranslator*
|
||||||
make_nth_translator(int32 n, image_id you, uint32 flags, ...)
|
make_nth_translator(int32 n, image_id you, uint32 flags, ...)
|
||||||
{
|
{
|
||||||
if (n != 0)
|
if (n != 0)
|
||||||
|
|||||||
@@ -8,6 +8,7 @@
|
|||||||
#ifndef WEBP_TRANSLATOR_H
|
#ifndef WEBP_TRANSLATOR_H
|
||||||
#define WEBP_TRANSLATOR_H
|
#define WEBP_TRANSLATOR_H
|
||||||
|
|
||||||
|
|
||||||
#include <ByteOrder.h>
|
#include <ByteOrder.h>
|
||||||
#include <DataIO.h>
|
#include <DataIO.h>
|
||||||
#include <File.h>
|
#include <File.h>
|
||||||
@@ -29,25 +30,29 @@
|
|||||||
#define BITS_OUT_QUALITY 1
|
#define BITS_OUT_QUALITY 1
|
||||||
#define BITS_OUT_CAPABILITY 0.9
|
#define BITS_OUT_CAPABILITY 0.9
|
||||||
|
|
||||||
|
|
||||||
class WebPTranslator : public BaseTranslator {
|
class WebPTranslator : public BaseTranslator {
|
||||||
public:
|
public:
|
||||||
WebPTranslator();
|
WebPTranslator();
|
||||||
|
|
||||||
virtual status_t DerivedIdentify(BPositionIO *inSource,
|
virtual status_t DerivedIdentify(BPositionIO* stream,
|
||||||
const translation_format *inFormat, BMessage *ioExtension,
|
const translation_format* format,
|
||||||
translator_info *outInfo, uint32 outType);
|
BMessage* settings, translator_info* info,
|
||||||
|
uint32 outType);
|
||||||
|
|
||||||
virtual status_t DerivedTranslate(BPositionIO *inSource,
|
virtual status_t DerivedTranslate(BPositionIO* stream,
|
||||||
const translator_info *inInfo, BMessage *ioExtension,
|
const translator_info* info,
|
||||||
uint32 outType, BPositionIO *outDestination, int32 baseType);
|
BMessage* settings, uint32 outType,
|
||||||
|
BPositionIO* target, int32 baseType);
|
||||||
|
|
||||||
virtual BView *NewConfigView(TranslatorSettings *settings);
|
virtual BView* NewConfigView(TranslatorSettings* settings);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
virtual ~WebPTranslator();
|
virtual ~WebPTranslator();
|
||||||
// this is protected because the object is deleted by the
|
// this is protected because the object is deleted by the
|
||||||
// Release() function instead of being deleted directly by
|
// Release() function instead of being deleted directly by
|
||||||
// the user
|
// the user
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#endif // #ifndef WEBP_TRANSLATOR_H
|
#endif // #ifndef WEBP_TRANSLATOR_H
|
||||||
|
|||||||
Reference in New Issue
Block a user