diff --git a/data/pref.xml b/data/pref.xml
index 1c602a7cd..12423751f 100644
--- a/data/pref.xml
+++ b/data/pref.xml
@@ -391,7 +391,7 @@
-
+
diff --git a/src/app/CMakeLists.txt b/src/app/CMakeLists.txt
index bfc276294..a68e37a9c 100644
--- a/src/app/CMakeLists.txt
+++ b/src/app/CMakeLists.txt
@@ -499,11 +499,11 @@ add_library(app-lib
doc.cpp
doc_api.cpp
doc_diff.cpp
+ doc_exporter.cpp
doc_range.cpp
doc_range_ops.cpp
doc_undo.cpp
docs.cpp
- document_exporter.cpp
extensions.cpp
extra_cel.cpp
file/file.cpp
diff --git a/src/app/cli/cli_delegate.h b/src/app/cli/cli_delegate.h
index 3c9f464d3..7d2ad24d9 100644
--- a/src/app/cli/cli_delegate.h
+++ b/src/app/cli/cli_delegate.h
@@ -14,7 +14,7 @@ namespace app {
class AppOptions;
class Context;
- class DocumentExporter;
+ class DocExporter;
struct CliOpenFile;
class CliDelegate {
@@ -29,7 +29,7 @@ namespace app {
virtual void afterOpenFile(const CliOpenFile& cof) { }
virtual void saveFile(Context* ctx, const CliOpenFile& cof) { }
virtual void loadPalette(Context* ctx, const CliOpenFile& cof, const std::string& filename) { }
- virtual void exportFiles(Context* ctx, DocumentExporter& exporter) { }
+ virtual void exportFiles(Context* ctx, DocExporter& exporter) { }
virtual void execScript(const std::string& filename) { }
};
diff --git a/src/app/cli/cli_processor.cpp b/src/app/cli/cli_processor.cpp
index 4ede7a5f5..713cf012b 100644
--- a/src/app/cli/cli_processor.cpp
+++ b/src/app/cli/cli_processor.cpp
@@ -17,8 +17,8 @@
#include "app/commands/params.h"
#include "app/console.h"
#include "app/doc.h"
+#include "app/doc_exporter.h"
#include "app/doc_undo.h"
-#include "app/document_exporter.h"
#include "app/file/file.h"
#include "app/filename_formatter.h"
#include "app/restore_visible_layers.h"
@@ -119,7 +119,7 @@ CliProcessor::CliProcessor(CliDelegate* delegate,
, m_exporter(nullptr)
{
if (options.hasExporterParams())
- m_exporter.reset(new DocumentExporter);
+ m_exporter.reset(new DocExporter);
}
void CliProcessor::process(Context* ctx)
@@ -154,12 +154,12 @@ void CliProcessor::process(Context* ctx)
// --format
else if (opt == &m_options.format()) {
if (m_exporter) {
- DocumentExporter::DataFormat format = DocumentExporter::DefaultDataFormat;
+ DocExporter::DataFormat format = DocExporter::DefaultDataFormat;
if (value.value() == "json-hash")
- format = DocumentExporter::JsonHashDataFormat;
+ format = DocExporter::JsonHashDataFormat;
else if (value.value() == "json-array")
- format = DocumentExporter::JsonArrayDataFormat;
+ format = DocExporter::JsonArrayDataFormat;
m_exporter->setDataFormat(format);
}
diff --git a/src/app/cli/cli_processor.h b/src/app/cli/cli_processor.h
index 707c89aa7..aa64c813e 100644
--- a/src/app/cli/cli_processor.h
+++ b/src/app/cli/cli_processor.h
@@ -19,7 +19,7 @@ namespace app {
class AppOptions;
class Context;
- class DocumentExporter;
+ class DocExporter;
class CliProcessor {
public:
@@ -33,7 +33,7 @@ namespace app {
CliDelegate* m_delegate;
const AppOptions& m_options;
- base::UniquePtr m_exporter;
+ base::UniquePtr m_exporter;
};
} // namespace app
diff --git a/src/app/cli/cli_tests.cpp b/src/app/cli/cli_tests.cpp
index b9dbeffce..fa0701f71 100644
--- a/src/app/cli/cli_tests.cpp
+++ b/src/app/cli/cli_tests.cpp
@@ -8,7 +8,7 @@
#include "app/cli/app_options.h"
#include "app/cli/cli_processor.h"
-#include "app/document_exporter.h"
+#include "app/doc_exporter.h"
#include
@@ -32,7 +32,7 @@ public:
void beforeOpenFile(const CliOpenFile& cof) override { }
void afterOpenFile(const CliOpenFile& cof) override { }
void saveFile(Context* ctx, const CliOpenFile& cof) override { }
- void exportFiles(Context* ctx, DocumentExporter& exporter) override { }
+ void exportFiles(Context* ctx, DocExporter& exporter) override { }
void execScript(const std::string& filename) override { }
bool helpWasShown() const { return m_helpWasShown; }
diff --git a/src/app/cli/default_cli_delegate.cpp b/src/app/cli/default_cli_delegate.cpp
index 474cfe548..8d4265bc2 100644
--- a/src/app/cli/default_cli_delegate.cpp
+++ b/src/app/cli/default_cli_delegate.cpp
@@ -16,7 +16,7 @@
#include "app/commands/params.h"
#include "app/console.h"
#include "app/doc.h"
-#include "app/document_exporter.h"
+#include "app/doc_exporter.h"
#include "app/file/palette_file.h"
#include "app/ui_context.h"
#include "base/convert_to.h"
@@ -112,7 +112,7 @@ void DefaultCliDelegate::loadPalette(Context* ctx,
}
}
-void DefaultCliDelegate::exportFiles(Context* ctx, DocumentExporter& exporter)
+void DefaultCliDelegate::exportFiles(Context* ctx, DocExporter& exporter)
{
LOG("APP: Exporting sheet...\n");
diff --git a/src/app/cli/default_cli_delegate.h b/src/app/cli/default_cli_delegate.h
index 6c6954b67..9c1efb375 100644
--- a/src/app/cli/default_cli_delegate.h
+++ b/src/app/cli/default_cli_delegate.h
@@ -19,7 +19,7 @@ namespace app {
void afterOpenFile(const CliOpenFile& cof) override;
void saveFile(Context* ctx, const CliOpenFile& cof) override;
void loadPalette(Context* ctx, const CliOpenFile& cof, const std::string& filename) override;
- void exportFiles(Context* ctx, DocumentExporter& exporter) override;
+ void exportFiles(Context* ctx, DocExporter& exporter) override;
void execScript(const std::string& filename) override;
};
diff --git a/src/app/cli/preview_cli_delegate.cpp b/src/app/cli/preview_cli_delegate.cpp
index a98faf459..7d8e314ff 100644
--- a/src/app/cli/preview_cli_delegate.cpp
+++ b/src/app/cli/preview_cli_delegate.cpp
@@ -13,7 +13,7 @@
#include "app/cli/cli_open_file.h"
#include "app/context.h"
#include "app/doc.h"
-#include "app/document_exporter.h"
+#include "app/doc_exporter.h"
#include "app/file/file.h"
#include "base/fs.h"
#include "base/unique_ptr.h"
@@ -164,7 +164,7 @@ void PreviewCliDelegate::loadPalette(Context* ctx,
<< " - Palette: '" << filename << "'\n";
}
-void PreviewCliDelegate::exportFiles(Context* ctx, DocumentExporter& exporter)
+void PreviewCliDelegate::exportFiles(Context* ctx, DocExporter& exporter)
{
std::string type = "None";
switch (exporter.spriteSheetType()) {
@@ -188,8 +188,8 @@ void PreviewCliDelegate::exportFiles(Context* ctx, DocumentExporter& exporter)
if (!exporter.dataFilename().empty()) {
std::string format = "Unknown";
switch (exporter.dataFormat()) {
- case DocumentExporter::JsonHashDataFormat: format = "JSON Hash"; break;
- case DocumentExporter::JsonArrayDataFormat: format = "JSON Array"; break;
+ case DocExporter::JsonHashDataFormat: format = "JSON Hash"; break;
+ case DocExporter::JsonArrayDataFormat: format = "JSON Array"; break;
}
std::cout << " - Save data file: '" << exporter.dataFilename() << "'\n"
<< " - Data format: " << format << "\n";
diff --git a/src/app/cli/preview_cli_delegate.h b/src/app/cli/preview_cli_delegate.h
index 110046440..b4f2643cd 100644
--- a/src/app/cli/preview_cli_delegate.h
+++ b/src/app/cli/preview_cli_delegate.h
@@ -25,7 +25,7 @@ namespace app {
void loadPalette(Context* ctx,
const CliOpenFile& cof,
const std::string& filename) override;
- void exportFiles(Context* ctx, DocumentExporter& exporter) override;
+ void exportFiles(Context* ctx, DocExporter& exporter) override;
void execScript(const std::string& filename) override;
private:
diff --git a/src/app/commands/cmd_export_sprite_sheet.cpp b/src/app/commands/cmd_export_sprite_sheet.cpp
index 93ecc027b..a8b4b7f15 100644
--- a/src/app/commands/cmd_export_sprite_sheet.cpp
+++ b/src/app/commands/cmd_export_sprite_sheet.cpp
@@ -13,7 +13,7 @@
#include "app/context.h"
#include "app/context_access.h"
#include "app/doc.h"
-#include "app/document_exporter.h"
+#include "app/doc_exporter.h"
#include "app/file/file.h"
#include "app/file_selector.h"
#include "app/i18n/strings.h"
@@ -329,11 +329,11 @@ public:
return std::string();
}
- DocumentExporter::DataFormat dataFormatValue() const {
+ DocExporter::DataFormat dataFormatValue() const {
if (dataEnabled()->isSelected())
- return DocumentExporter::DataFormat(dataFormat()->getSelectedItemIndex());
+ return DocExporter::DataFormat(dataFormat()->getSelectedItemIndex());
else
- return DocumentExporter::DefaultDataFormat;
+ return DocExporter::DefaultDataFormat;
}
int borderPaddingValue() const {
@@ -679,7 +679,7 @@ void ExportSpriteSheetCommand::onExecute(Context* context)
bool bestFit = docPref.spriteSheet.bestFit();
std::string filename = docPref.spriteSheet.textureFilename();
std::string dataFilename = docPref.spriteSheet.dataFilename();
- DocumentExporter::DataFormat dataFormat = docPref.spriteSheet.dataFormat();
+ DocExporter::DataFormat dataFormat = docPref.spriteSheet.dataFormat();
std::string layerName = docPref.spriteSheet.layer();
std::string frameTagName = docPref.spriteSheet.frameTag();
int borderPadding = docPref.spriteSheet.borderPadding();
@@ -756,7 +756,7 @@ void ExportSpriteSheetCommand::onExecute(Context* context)
if (sheet_w == 0) sheet_w = fit.width;
if (sheet_h == 0) sheet_h = fit.height;
- DocumentExporter exporter;
+ DocExporter exporter;
if (!filename.empty())
exporter.setTextureFilename(filename);
if (!dataFilename.empty()) {
diff --git a/src/app/document_exporter.cpp b/src/app/doc_exporter.cpp
similarity index 95%
rename from src/app/document_exporter.cpp
rename to src/app/doc_exporter.cpp
index a69c9c913..59f6ac1cf 100644
--- a/src/app/document_exporter.cpp
+++ b/src/app/doc_exporter.cpp
@@ -8,7 +8,7 @@
#include "config.h"
#endif
-#include "app/document_exporter.h"
+#include "app/doc_exporter.h"
#include "app/cmd/set_pixel_format.h"
#include "app/console.h"
@@ -111,7 +111,7 @@ private:
typedef base::SharedPtr SampleBoundsPtr;
-DocumentExporter::Item::Item(Doc* doc,
+DocExporter::Item::Item(Doc* doc,
doc::FrameTag* frameTag,
doc::SelectedLayers* selLayers,
doc::SelectedFrames* selFrames)
@@ -122,7 +122,7 @@ DocumentExporter::Item::Item(Doc* doc,
{
}
-DocumentExporter::Item::Item(Item&& other)
+DocExporter::Item::Item(Item&& other)
: doc(other.doc)
, frameTag(other.frameTag)
, selLayers(other.selLayers)
@@ -132,13 +132,13 @@ DocumentExporter::Item::Item(Item&& other)
other.selFrames = nullptr;
}
-DocumentExporter::Item::~Item()
+DocExporter::Item::~Item()
{
delete selLayers;
delete selFrames;
}
-int DocumentExporter::Item::frames() const
+int DocExporter::Item::frames() const
{
if (selFrames)
return selFrames->size();
@@ -150,7 +150,7 @@ int DocumentExporter::Item::frames() const
return doc->sprite()->totalFrames();
}
-doc::frame_t DocumentExporter::Item::firstFrame() const
+doc::frame_t DocExporter::Item::firstFrame() const
{
if (selFrames)
return selFrames->firstFrame();
@@ -160,7 +160,7 @@ doc::frame_t DocumentExporter::Item::firstFrame() const
return 0;
}
-doc::SelectedFrames DocumentExporter::Item::getSelectedFrames() const
+doc::SelectedFrames DocExporter::Item::getSelectedFrames() const
{
if (selFrames)
return *selFrames;
@@ -176,7 +176,7 @@ doc::SelectedFrames DocumentExporter::Item::getSelectedFrames() const
return frames;
}
-class DocumentExporter::Sample {
+class DocExporter::Sample {
public:
Sample(Doc* document, Sprite* sprite, SelectedLayers* selLayers,
frame_t frame, const std::string& filename, int innerPadding) :
@@ -239,7 +239,7 @@ private:
bool m_isDuplicated;
};
-class DocumentExporter::Samples {
+class DocExporter::Samples {
public:
typedef std::list List;
typedef List::iterator iterator;
@@ -260,14 +260,14 @@ private:
List m_samples;
};
-class DocumentExporter::LayoutSamples {
+class DocExporter::LayoutSamples {
public:
virtual ~LayoutSamples() { }
virtual void layoutSamples(Samples& samples, int borderPadding, int shapePadding, int& width, int& height) = 0;
};
-class DocumentExporter::SimpleLayoutSamples :
- public DocumentExporter::LayoutSamples {
+class DocExporter::SimpleLayoutSamples :
+ public DocExporter::LayoutSamples {
public:
SimpleLayoutSamples(SpriteSheetType type)
: m_type(type) {
@@ -357,8 +357,8 @@ private:
SpriteSheetType m_type;
};
-class DocumentExporter::BestFitLayoutSamples :
- public DocumentExporter::LayoutSamples {
+class DocExporter::BestFitLayoutSamples :
+ public DocExporter::LayoutSamples {
public:
void layoutSamples(Samples& samples, int borderPadding, int shapePadding, int& width, int& height) override {
gfx::PackingRects pr;
@@ -393,7 +393,7 @@ public:
}
};
-DocumentExporter::DocumentExporter()
+DocExporter::DocExporter()
: m_dataFormat(DefaultDataFormat)
, m_textureWidth(0)
, m_textureHeight(0)
@@ -409,7 +409,7 @@ DocumentExporter::DocumentExporter()
{
}
-Doc* DocumentExporter::exportSheet(Context* ctx)
+Doc* DocExporter::exportSheet(Context* ctx)
{
// We output the metadata to std::cout if the user didn't specify a file.
std::ofstream fos;
@@ -463,7 +463,7 @@ Doc* DocumentExporter::exportSheet(Context* ctx)
return textureDocument.release();
}
-gfx::Size DocumentExporter::calculateSheetSize()
+gfx::Size DocExporter::calculateSheetSize()
{
Samples samples;
captureSamples(samples);
@@ -471,7 +471,7 @@ gfx::Size DocumentExporter::calculateSheetSize()
return calculateSheetSize(samples);
}
-void DocumentExporter::captureSamples(Samples& samples)
+void DocExporter::captureSamples(Samples& samples)
{
for (auto& item : m_documents) {
Doc* doc = item.doc;
@@ -597,7 +597,7 @@ void DocumentExporter::captureSamples(Samples& samples)
}
}
-void DocumentExporter::layoutSamples(Samples& samples)
+void DocExporter::layoutSamples(Samples& samples)
{
switch (m_sheetType) {
case SpriteSheetType::Packed: {
@@ -617,7 +617,7 @@ void DocumentExporter::layoutSamples(Samples& samples)
}
}
-gfx::Size DocumentExporter::calculateSheetSize(const Samples& samples) const
+gfx::Size DocExporter::calculateSheetSize(const Samples& samples) const
{
gfx::Rect fullTextureBounds(0, 0, m_textureWidth, m_textureHeight);
@@ -640,7 +640,7 @@ gfx::Size DocumentExporter::calculateSheetSize(const Samples& samples) const
// If the user didn't specified the sprite sheet size, the border is
// added right here (the left/top border padding should be added by
- // the DocumentExporter::LayoutSamples() impl).
+ // the DocExporter::LayoutSamples() impl).
if (m_textureWidth == 0) fullTextureBounds.w += m_borderPadding;
if (m_textureHeight == 0) fullTextureBounds.h += m_borderPadding;
@@ -648,7 +648,7 @@ gfx::Size DocumentExporter::calculateSheetSize(const Samples& samples) const
fullTextureBounds.y+fullTextureBounds.h);
}
-Doc* DocumentExporter::createEmptyTexture(const Samples& samples) const
+Doc* DocExporter::createEmptyTexture(const Samples& samples) const
{
PixelFormat pixelFormat = IMAGE_INDEXED;
Palette* palette = nullptr;
@@ -693,7 +693,7 @@ Doc* DocumentExporter::createEmptyTexture(const Samples& samples) const
return document.release();
}
-void DocumentExporter::renderTexture(Context* ctx, const Samples& samples, Image* textureImage) const
+void DocExporter::renderTexture(Context* ctx, const Samples& samples, Image* textureImage) const
{
textureImage->clear(0);
@@ -720,7 +720,7 @@ void DocumentExporter::renderTexture(Context* ctx, const Samples& samples, Image
}
}
-void DocumentExporter::createDataFile(const Samples& samples, std::ostream& os, Image* textureImage)
+void DocExporter::createDataFile(const Samples& samples, std::ostream& os, Image* textureImage)
{
std::string frames_begin;
std::string frames_end;
@@ -963,7 +963,7 @@ void DocumentExporter::createDataFile(const Samples& samples, std::ostream& os,
<< "}\n";
}
-void DocumentExporter::renderSample(const Sample& sample, doc::Image* dst, int x, int y) const
+void DocExporter::renderSample(const Sample& sample, doc::Image* dst, int x, int y) const
{
gfx::Clip clip(x, y, sample.trimmedBounds());
diff --git a/src/app/document_exporter.h b/src/app/doc_exporter.h
similarity index 96%
rename from src/app/document_exporter.h
rename to src/app/doc_exporter.h
index efcad4396..483acb691 100644
--- a/src/app/document_exporter.h
+++ b/src/app/doc_exporter.h
@@ -4,8 +4,8 @@
// This program is distributed under the terms of
// the End-User License Agreement for Aseprite.
-#ifndef APP_DOCUMENT_EXPORTER_H_INCLUDED
-#define APP_DOCUMENT_EXPORTER_H_INCLUDED
+#ifndef APP_DOC_EXPORTER_H_INCLUDED
+#define APP_DOC_EXPORTER_H_INCLUDED
#pragma once
#include "app/sprite_sheet_type.h"
@@ -33,7 +33,7 @@ namespace app {
class Context;
class Doc;
- class DocumentExporter {
+ class DocExporter {
public:
enum DataFormat {
JsonHashDataFormat,
@@ -41,7 +41,7 @@ namespace app {
DefaultDataFormat = JsonHashDataFormat
};
- DocumentExporter();
+ DocExporter();
DataFormat dataFormat() const { return m_dataFormat; }
const std::string& dataFilename() { return m_dataFilename; }
@@ -146,7 +146,7 @@ namespace app {
// will not be exported at all in the final result.
std::map > m_tagDelta;
- DISABLE_COPYING(DocumentExporter);
+ DISABLE_COPYING(DocExporter);
};
} // namespace app
diff --git a/src/app/pref/preferences.h b/src/app/pref/preferences.h
index 1d7a32939..9d0cc95e9 100644
--- a/src/app/pref/preferences.h
+++ b/src/app/pref/preferences.h
@@ -10,8 +10,8 @@
#include "app/color.h"
#include "app/commands/filters/cels_target.h"
+#include "app/doc_exporter.h"
#include "app/docs_observer.h"
-#include "app/document_exporter.h"
#include "app/pref/option.h"
#include "app/sprite_sheet_type.h"
#include "app/tools/freehand_algorithm.h"