mirror of https://github.com/aseprite/aseprite.git
Replace base::SharedPtr with std::shared_ptr
We can remove our smart pointer (base::SharedPtr) as we're already using C++11 compilers on all platforms.
This commit is contained in:
parent
2d3be681e0
commit
d32fd97da5
|
@ -46,6 +46,7 @@
|
||||||
#include "keyboard_shortcuts.xml.h"
|
#include "keyboard_shortcuts.xml.h"
|
||||||
|
|
||||||
#include <map>
|
#include <map>
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
#define KEYBOARD_FILENAME_EXTENSION "aseprite-keys"
|
#define KEYBOARD_FILENAME_EXTENSION "aseprite-keys"
|
||||||
|
|
||||||
|
@ -464,9 +465,9 @@ private:
|
||||||
AppMenuItem* m_menuitem;
|
AppMenuItem* m_menuitem;
|
||||||
int m_level;
|
int m_level;
|
||||||
ui::Accelerators m_newAccels;
|
ui::Accelerators m_newAccels;
|
||||||
base::SharedPtr<ui::Button> m_changeButton;
|
std::shared_ptr<ui::Button> m_changeButton;
|
||||||
base::SharedPtr<ui::Button> m_deleteButton;
|
std::shared_ptr<ui::Button> m_deleteButton;
|
||||||
base::SharedPtr<ui::Button> m_addButton;
|
std::shared_ptr<ui::Button> m_addButton;
|
||||||
obs::scoped_connection m_changeConn;
|
obs::scoped_connection m_changeConn;
|
||||||
obs::scoped_connection m_deleteConn;
|
obs::scoped_connection m_deleteConn;
|
||||||
obs::scoped_connection m_addConn;
|
obs::scoped_connection m_addConn;
|
||||||
|
|
|
@ -12,11 +12,11 @@
|
||||||
#include "app/crash/raw_images_as.h"
|
#include "app/crash/raw_images_as.h"
|
||||||
#include "base/disable_copying.h"
|
#include "base/disable_copying.h"
|
||||||
#include "base/process.h"
|
#include "base/process.h"
|
||||||
#include "base/shared_ptr.h"
|
|
||||||
#include "base/task.h"
|
#include "base/task.h"
|
||||||
#include "doc/object_id.h"
|
#include "doc/object_id.h"
|
||||||
|
|
||||||
#include <fstream>
|
#include <fstream>
|
||||||
|
#include <memory>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
@ -87,7 +87,7 @@ namespace crash {
|
||||||
DISABLE_COPYING(Session);
|
DISABLE_COPYING(Session);
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef base::SharedPtr<Session> SessionPtr;
|
typedef std::shared_ptr<Session> SessionPtr;
|
||||||
|
|
||||||
} // namespace crash
|
} // namespace crash
|
||||||
} // namespace app
|
} // namespace app
|
||||||
|
|
|
@ -247,7 +247,7 @@ bool Doc::isFullyBackedUp() const
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
// Loaded options from file
|
// Loaded options from file
|
||||||
|
|
||||||
void Doc::setFormatOptions(const base::SharedPtr<FormatOptions>& format_options)
|
void Doc::setFormatOptions(const std::shared_ptr<FormatOptions>& format_options)
|
||||||
{
|
{
|
||||||
m_format_options = format_options;
|
m_format_options = format_options;
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,7 +16,6 @@
|
||||||
#include "base/disable_copying.h"
|
#include "base/disable_copying.h"
|
||||||
#include "base/mutex.h"
|
#include "base/mutex.h"
|
||||||
#include "base/rw_lock.h"
|
#include "base/rw_lock.h"
|
||||||
#include "base/shared_ptr.h"
|
|
||||||
#include "doc/blend_mode.h"
|
#include "doc/blend_mode.h"
|
||||||
#include "doc/color.h"
|
#include "doc/color.h"
|
||||||
#include "doc/document.h"
|
#include "doc/document.h"
|
||||||
|
@ -26,6 +25,7 @@
|
||||||
#include "obs/observable.h"
|
#include "obs/observable.h"
|
||||||
#include "os/color_space.h"
|
#include "os/color_space.h"
|
||||||
|
|
||||||
|
#include <memory>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
namespace doc {
|
namespace doc {
|
||||||
|
@ -129,8 +129,8 @@ namespace app {
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
// Loaded options from file
|
// Loaded options from file
|
||||||
|
|
||||||
void setFormatOptions(const base::SharedPtr<FormatOptions>& format_options);
|
void setFormatOptions(const std::shared_ptr<FormatOptions>& format_options);
|
||||||
base::SharedPtr<FormatOptions> getFormatOptions() const { return m_format_options; }
|
std::shared_ptr<FormatOptions> getFormatOptions() const { return m_format_options; }
|
||||||
|
|
||||||
//////////////////////////////////////////////////////////////////////
|
//////////////////////////////////////////////////////////////////////
|
||||||
// Boundaries
|
// Boundaries
|
||||||
|
@ -210,7 +210,7 @@ namespace app {
|
||||||
std::unique_ptr<doc::MaskBoundaries> m_maskBoundaries;
|
std::unique_ptr<doc::MaskBoundaries> m_maskBoundaries;
|
||||||
|
|
||||||
// Data to save the file in the same format that it was loaded
|
// Data to save the file in the same format that it was loaded
|
||||||
base::SharedPtr<FormatOptions> m_format_options;
|
std::shared_ptr<FormatOptions> m_format_options;
|
||||||
|
|
||||||
// Extra cel used to draw extra stuff (e.g. editor's pen preview, pixels in movement, etc.)
|
// Extra cel used to draw extra stuff (e.g. editor's pen preview, pixels in movement, etc.)
|
||||||
ExtraCelRef m_extraCel;
|
ExtraCelRef m_extraCel;
|
||||||
|
|
|
@ -24,7 +24,6 @@
|
||||||
#include "base/fs.h"
|
#include "base/fs.h"
|
||||||
#include "base/fstream_path.h"
|
#include "base/fstream_path.h"
|
||||||
#include "base/replace_string.h"
|
#include "base/replace_string.h"
|
||||||
#include "base/shared_ptr.h"
|
|
||||||
#include "base/string.h"
|
#include "base/string.h"
|
||||||
#include "doc/algorithm/shrink_bounds.h"
|
#include "doc/algorithm/shrink_bounds.h"
|
||||||
#include "doc/cel.h"
|
#include "doc/cel.h"
|
||||||
|
@ -48,6 +47,7 @@
|
||||||
#include <iomanip>
|
#include <iomanip>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <list>
|
#include <list>
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
using namespace doc;
|
using namespace doc;
|
||||||
|
|
||||||
|
@ -111,7 +111,7 @@ private:
|
||||||
gfx::Rect m_inTextureBounds;
|
gfx::Rect m_inTextureBounds;
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef base::SharedPtr<SampleBounds> SampleBoundsPtr;
|
typedef std::shared_ptr<SampleBounds> SampleBoundsPtr;
|
||||||
|
|
||||||
DocExporter::Item::Item(Doc* doc,
|
DocExporter::Item::Item(Doc* doc,
|
||||||
doc::FrameTag* frameTag,
|
doc::FrameTag* frameTag,
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
// Aseprite
|
// Aseprite
|
||||||
|
// Copyright (C) 2019 Igara Studio S.A.
|
||||||
// Copyright (C) 2001-2018 David Capello
|
// Copyright (C) 2001-2018 David Capello
|
||||||
//
|
//
|
||||||
// This program is distributed under the terms of
|
// This program is distributed under the terms of
|
||||||
|
@ -50,7 +51,7 @@ namespace app {
|
||||||
DISABLE_COPYING(ExtraCel);
|
DISABLE_COPYING(ExtraCel);
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef base::SharedPtr<ExtraCel> ExtraCelRef;
|
typedef std::shared_ptr<ExtraCel> ExtraCelRef;
|
||||||
|
|
||||||
} // namespace app
|
} // namespace app
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
// Aseprite
|
// Aseprite
|
||||||
|
// Copyright (C) 2019 Igara Studio S.A.
|
||||||
// Copyright (C) 2001-2018 David Capello
|
// Copyright (C) 2001-2018 David Capello
|
||||||
//
|
//
|
||||||
// This program is distributed under the terms of
|
// This program is distributed under the terms of
|
||||||
|
@ -703,7 +704,7 @@ bool BmpFormat::onLoad(FileOp *fop)
|
||||||
|
|
||||||
// Setup the file-data.
|
// Setup the file-data.
|
||||||
if (!fop->formatOptions()) {
|
if (!fop->formatOptions()) {
|
||||||
base::SharedPtr<BmpOptions> bmp_options(new BmpOptions());
|
auto bmp_options = std::make_shared<BmpOptions>();
|
||||||
|
|
||||||
bmp_options->format = format;
|
bmp_options->format = format;
|
||||||
bmp_options->compression = infoheader.biCompression;
|
bmp_options->compression = infoheader.biCompression;
|
||||||
|
|
|
@ -32,7 +32,6 @@
|
||||||
#include "base/fs.h"
|
#include "base/fs.h"
|
||||||
#include "base/mutex.h"
|
#include "base/mutex.h"
|
||||||
#include "base/scoped_lock.h"
|
#include "base/scoped_lock.h"
|
||||||
#include "base/shared_ptr.h"
|
|
||||||
#include "base/string.h"
|
#include "base/string.h"
|
||||||
#include "dio/detect_format.h"
|
#include "dio/detect_format.h"
|
||||||
#include "doc/doc.h"
|
#include "doc/doc.h"
|
||||||
|
@ -546,8 +545,7 @@ FileOp* FileOp::createSaveDocumentOperation(const Context* context,
|
||||||
|
|
||||||
// Configure output format?
|
// Configure output format?
|
||||||
if (fop->m_format->support(FILE_SUPPORT_GET_FORMAT_OPTIONS)) {
|
if (fop->m_format->support(FILE_SUPPORT_GET_FORMAT_OPTIONS)) {
|
||||||
base::SharedPtr<FormatOptions> opts =
|
auto opts = fop->m_format->getFormatOptions(fop.get());
|
||||||
fop->m_format->getFormatOptions(fop.get());
|
|
||||||
|
|
||||||
// Does the user cancelled the operation?
|
// Does the user cancelled the operation?
|
||||||
if (!opts)
|
if (!opts)
|
||||||
|
@ -904,7 +902,7 @@ void FileOp::postLoad()
|
||||||
sprite->pixelFormat() == IMAGE_RGB &&
|
sprite->pixelFormat() == IMAGE_RGB &&
|
||||||
sprite->getPalettes().size() <= 1 &&
|
sprite->getPalettes().size() <= 1 &&
|
||||||
sprite->palette(frame_t(0))->isBlack()) {
|
sprite->palette(frame_t(0))->isBlack()) {
|
||||||
base::SharedPtr<Palette> palette(
|
std::shared_ptr<Palette> palette(
|
||||||
render::create_palette_from_sprite(
|
render::create_palette_from_sprite(
|
||||||
sprite, frame_t(0), sprite->lastFrame(), true,
|
sprite, frame_t(0), sprite->lastFrame(), true,
|
||||||
nullptr, nullptr, m_config.newBlend));
|
nullptr, nullptr, m_config.newBlend));
|
||||||
|
@ -1004,12 +1002,12 @@ void FileOp::postLoad()
|
||||||
m_document->markAsSaved();
|
m_document->markAsSaved();
|
||||||
}
|
}
|
||||||
|
|
||||||
base::SharedPtr<FormatOptions> FileOp::formatOptions() const
|
std::shared_ptr<FormatOptions> FileOp::formatOptions() const
|
||||||
{
|
{
|
||||||
return m_formatOptions;
|
return m_formatOptions;
|
||||||
}
|
}
|
||||||
|
|
||||||
void FileOp::setFormatOptions(const base::SharedPtr<FormatOptions>& opts)
|
void FileOp::setFormatOptions(const std::shared_ptr<FormatOptions>& opts)
|
||||||
{
|
{
|
||||||
ASSERT(!m_formatOptions);
|
ASSERT(!m_formatOptions);
|
||||||
m_formatOptions = opts;
|
m_formatOptions = opts;
|
||||||
|
|
|
@ -14,13 +14,13 @@
|
||||||
#include "app/pref/preferences.h"
|
#include "app/pref/preferences.h"
|
||||||
#include "base/mutex.h"
|
#include "base/mutex.h"
|
||||||
#include "base/paths.h"
|
#include "base/paths.h"
|
||||||
#include "base/shared_ptr.h"
|
|
||||||
#include "doc/frame.h"
|
#include "doc/frame.h"
|
||||||
#include "doc/image_ref.h"
|
#include "doc/image_ref.h"
|
||||||
#include "doc/pixel_format.h"
|
#include "doc/pixel_format.h"
|
||||||
#include "doc/selected_frames.h"
|
#include "doc/selected_frames.h"
|
||||||
|
|
||||||
#include <cstdio>
|
#include <cstdio>
|
||||||
|
#include <memory>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
// Flags for FileOp::createLoadDocumentOperation()
|
// Flags for FileOp::createLoadDocumentOperation()
|
||||||
|
@ -143,8 +143,8 @@ namespace app {
|
||||||
void postLoad();
|
void postLoad();
|
||||||
|
|
||||||
// Special options specific to the file format.
|
// Special options specific to the file format.
|
||||||
base::SharedPtr<FormatOptions> formatOptions() const;
|
std::shared_ptr<FormatOptions> formatOptions() const;
|
||||||
void setFormatOptions(const base::SharedPtr<FormatOptions>& opts);
|
void setFormatOptions(const std::shared_ptr<FormatOptions>& opts);
|
||||||
|
|
||||||
// Helpers for file decoder/encoder (FileFormat) with
|
// Helpers for file decoder/encoder (FileFormat) with
|
||||||
// FILE_SUPPORT_SEQUENCES flag.
|
// FILE_SUPPORT_SEQUENCES flag.
|
||||||
|
@ -214,7 +214,7 @@ namespace app {
|
||||||
|
|
||||||
FileOpConfig m_config;
|
FileOpConfig m_config;
|
||||||
|
|
||||||
base::SharedPtr<FormatOptions> m_formatOptions;
|
std::shared_ptr<FormatOptions> m_formatOptions;
|
||||||
|
|
||||||
// Data for sequences.
|
// Data for sequences.
|
||||||
struct {
|
struct {
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
// Aseprite
|
// Aseprite
|
||||||
|
// Copyright (C) 2019 Igara Studio S.A.
|
||||||
// Copyright (C) 2001-2018 David Capello
|
// Copyright (C) 2001-2018 David Capello
|
||||||
//
|
//
|
||||||
// This program is distributed under the terms of
|
// This program is distributed under the terms of
|
||||||
|
@ -9,7 +10,6 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "base/paths.h"
|
#include "base/paths.h"
|
||||||
#include "base/shared_ptr.h"
|
|
||||||
#include "dio/file_format.h"
|
#include "dio/file_format.h"
|
||||||
|
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
@ -65,7 +65,7 @@ namespace app {
|
||||||
|
|
||||||
// Returns extra options for this format. It can return != NULL
|
// Returns extra options for this format. It can return != NULL
|
||||||
// only if flags() returns FILE_SUPPORT_GET_FORMAT_OPTIONS.
|
// only if flags() returns FILE_SUPPORT_GET_FORMAT_OPTIONS.
|
||||||
base::SharedPtr<FormatOptions> getFormatOptions(FileOp* fop) {
|
std::shared_ptr<FormatOptions> getFormatOptions(FileOp* fop) {
|
||||||
return onGetFormatOptions(fop);
|
return onGetFormatOptions(fop);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -87,8 +87,8 @@ namespace app {
|
||||||
#endif
|
#endif
|
||||||
virtual void onDestroyData(FileOp* fop) { }
|
virtual void onDestroyData(FileOp* fop) { }
|
||||||
|
|
||||||
virtual base::SharedPtr<FormatOptions> onGetFormatOptions(FileOp* fop) {
|
virtual std::shared_ptr<FormatOptions> onGetFormatOptions(FileOp* fop) {
|
||||||
return base::SharedPtr<FormatOptions>(0);
|
return std::shared_ptr<FormatOptions>(nullptr);
|
||||||
}
|
}
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
|
@ -96,7 +96,7 @@ class GifFormat : public FileFormat {
|
||||||
#ifdef ENABLE_SAVE
|
#ifdef ENABLE_SAVE
|
||||||
bool onSave(FileOp* fop) override;
|
bool onSave(FileOp* fop) override;
|
||||||
#endif
|
#endif
|
||||||
base::SharedPtr<FormatOptions> onGetFormatOptions(FileOp* fop) override;
|
std::shared_ptr<FormatOptions> onGetFormatOptions(FileOp* fop) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
FileFormat* CreateGifFormat()
|
FileFormat* CreateGifFormat()
|
||||||
|
@ -926,7 +926,7 @@ public:
|
||||||
else
|
else
|
||||||
m_clearColor = rgba(0, 0, 0, 0);
|
m_clearColor = rgba(0, 0, 0, 0);
|
||||||
|
|
||||||
const base::SharedPtr<GifOptions> gifOptions = fop->formatOptions();
|
const auto gifOptions = std::static_pointer_cast<GifOptions>(fop->formatOptions());
|
||||||
|
|
||||||
LOG("GIF: Saving with options: interlaced=%d loop=%d\n",
|
LOG("GIF: Saving with options: interlaced=%d loop=%d\n",
|
||||||
gifOptions->interlaced(), gifOptions->loop());
|
gifOptions->interlaced(), gifOptions->loop());
|
||||||
|
@ -1412,14 +1412,14 @@ bool GifFormat::onSave(FileOp* fop)
|
||||||
|
|
||||||
#endif // ENABLE_SAVE
|
#endif // ENABLE_SAVE
|
||||||
|
|
||||||
base::SharedPtr<FormatOptions> GifFormat::onGetFormatOptions(FileOp* fop)
|
std::shared_ptr<FormatOptions> GifFormat::onGetFormatOptions(FileOp* fop)
|
||||||
{
|
{
|
||||||
base::SharedPtr<GifOptions> gif_options;
|
std::shared_ptr<GifOptions> gif_options;
|
||||||
if (fop->document()->getFormatOptions())
|
if (fop->document()->getFormatOptions())
|
||||||
gif_options = base::SharedPtr<GifOptions>(fop->document()->getFormatOptions());
|
gif_options = std::static_pointer_cast<GifOptions>(fop->document()->getFormatOptions());
|
||||||
|
|
||||||
if (!gif_options)
|
if (!gif_options)
|
||||||
gif_options.reset(new GifOptions);
|
gif_options = std::make_shared<GifOptions>();
|
||||||
|
|
||||||
#ifdef ENABLE_UI
|
#ifdef ENABLE_UI
|
||||||
if (fop->context() && fop->context()->isUIAvailable()) {
|
if (fop->context() && fop->context()->isUIAvailable()) {
|
||||||
|
@ -1447,13 +1447,13 @@ base::SharedPtr<FormatOptions> GifFormat::onGetFormatOptions(FileOp* fop)
|
||||||
gif_options->setLoop(pref.gif.loop());
|
gif_options->setLoop(pref.gif.loop());
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
gif_options.reset(nullptr);
|
gif_options.reset();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (std::exception& e) {
|
catch (std::exception& e) {
|
||||||
Console::showException(e);
|
Console::showException(e);
|
||||||
return base::SharedPtr<GifOptions>(nullptr);
|
return std::shared_ptr<GifOptions>(nullptr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif // ENABLE_UI
|
#endif // ENABLE_UI
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
// Aseprite
|
// Aseprite
|
||||||
// Copyright (C) 2018 Igara Studio S.A.
|
// Copyright (C) 2018-2019 Igara Studio S.A.
|
||||||
// Copyright (C) 2001-2018 David Capello
|
// Copyright (C) 2001-2018 David Capello
|
||||||
//
|
//
|
||||||
// This program is distributed under the terms of
|
// This program is distributed under the terms of
|
||||||
|
@ -75,7 +75,7 @@ class JpegFormat : public FileFormat {
|
||||||
const gfx::ColorSpace* colorSpace);
|
const gfx::ColorSpace* colorSpace);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
base::SharedPtr<FormatOptions> onGetFormatOptions(FileOp* fop) override;
|
std::shared_ptr<FormatOptions> onGetFormatOptions(FileOp* fop) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
FileFormat* CreateJpegFormat()
|
FileFormat* CreateJpegFormat()
|
||||||
|
@ -355,8 +355,9 @@ bool JpegFormat::onSave(FileOp* fop)
|
||||||
const Image* image = fop->sequenceImage();
|
const Image* image = fop->sequenceImage();
|
||||||
JSAMPARRAY buffer;
|
JSAMPARRAY buffer;
|
||||||
JDIMENSION buffer_height;
|
JDIMENSION buffer_height;
|
||||||
const base::SharedPtr<JpegOptions> jpeg_options = fop->formatOptions();
|
const auto jpeg_options = std::static_pointer_cast<JpegOptions>(fop->formatOptions());
|
||||||
const int qualityValue = (int)MID(0, 100.0f * jpeg_options->quality, 100);
|
const int qualityValue = (int)MID(0, 100.0f * jpeg_options->quality, 100);
|
||||||
|
|
||||||
int c;
|
int c;
|
||||||
|
|
||||||
LOG("JPEG: Saving with options: quality=%d\n", qualityValue);
|
LOG("JPEG: Saving with options: quality=%d\n", qualityValue);
|
||||||
|
@ -520,14 +521,14 @@ void JpegFormat::saveColorSpace(FileOp* fop, jpeg_compress_struct* cinfo,
|
||||||
#endif // ENABLE_SAVE
|
#endif // ENABLE_SAVE
|
||||||
|
|
||||||
// Shows the JPEG configuration dialog.
|
// Shows the JPEG configuration dialog.
|
||||||
base::SharedPtr<FormatOptions> JpegFormat::onGetFormatOptions(FileOp* fop)
|
std::shared_ptr<FormatOptions> JpegFormat::onGetFormatOptions(FileOp* fop)
|
||||||
{
|
{
|
||||||
base::SharedPtr<JpegOptions> jpeg_options;
|
std::shared_ptr<JpegOptions> jpeg_options;
|
||||||
if (fop->document()->getFormatOptions())
|
if (fop->document()->getFormatOptions())
|
||||||
jpeg_options = base::SharedPtr<JpegOptions>(fop->document()->getFormatOptions());
|
jpeg_options = std::static_pointer_cast<JpegOptions>(fop->document()->getFormatOptions());
|
||||||
|
|
||||||
if (!jpeg_options)
|
if (!jpeg_options)
|
||||||
jpeg_options.reset(new JpegOptions);
|
jpeg_options = std::make_shared<JpegOptions>();
|
||||||
|
|
||||||
#ifdef ENABLE_UI
|
#ifdef ENABLE_UI
|
||||||
if (fop->context() && fop->context()->isUIAvailable()) {
|
if (fop->context() && fop->context()->isUIAvailable()) {
|
||||||
|
@ -549,13 +550,13 @@ base::SharedPtr<FormatOptions> JpegFormat::onGetFormatOptions(FileOp* fop)
|
||||||
jpeg_options->quality = pref.jpeg.quality();
|
jpeg_options->quality = pref.jpeg.quality();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
jpeg_options.reset(nullptr);
|
jpeg_options.reset();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (std::exception& e) {
|
catch (std::exception& e) {
|
||||||
Console::showException(e);
|
Console::showException(e);
|
||||||
return base::SharedPtr<JpegOptions>(0);
|
return std::shared_ptr<JpegOptions>(0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif // ENABLE_UI
|
#endif // ENABLE_UI
|
||||||
|
|
|
@ -64,7 +64,7 @@ class SvgFormat : public FileFormat {
|
||||||
#ifdef ENABLE_SAVE
|
#ifdef ENABLE_SAVE
|
||||||
bool onSave(FileOp* fop) override;
|
bool onSave(FileOp* fop) override;
|
||||||
#endif
|
#endif
|
||||||
base::SharedPtr<FormatOptions> onGetFormatOptions(FileOp* fop) override;
|
std::shared_ptr<FormatOptions> onGetFormatOptions(FileOp* fop) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
FileFormat* CreateSvgFormat()
|
FileFormat* CreateSvgFormat()
|
||||||
|
@ -80,7 +80,7 @@ bool SvgFormat::onSave(FileOp* fop)
|
||||||
{
|
{
|
||||||
const Image* image = fop->sequenceImage();
|
const Image* image = fop->sequenceImage();
|
||||||
int x, y, c, r, g, b, a, alpha;
|
int x, y, c, r, g, b, a, alpha;
|
||||||
const base::SharedPtr<SvgOptions> svg_options = fop->formatOptions();
|
const auto svg_options = std::static_pointer_cast<SvgOptions>(fop->formatOptions());
|
||||||
const int pixelScaleValue = MID(0, svg_options->pixelScale, 10000);
|
const int pixelScaleValue = MID(0, svg_options->pixelScale, 10000);
|
||||||
FileHandle handle(open_file_with_exception_sync_on_close(fop->filename(), "wb"));
|
FileHandle handle(open_file_with_exception_sync_on_close(fop->filename(), "wb"));
|
||||||
FILE* f = handle.get();
|
FILE* f = handle.get();
|
||||||
|
@ -164,14 +164,14 @@ bool SvgFormat::onSave(FileOp* fop)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Shows the SVG configuration dialog.
|
// Shows the SVG configuration dialog.
|
||||||
base::SharedPtr<FormatOptions> SvgFormat::onGetFormatOptions(FileOp* fop)
|
std::shared_ptr<FormatOptions> SvgFormat::onGetFormatOptions(FileOp* fop)
|
||||||
{
|
{
|
||||||
base::SharedPtr<SvgOptions> svg_options;
|
std::shared_ptr<SvgOptions> svg_options;
|
||||||
if (fop->document()->getFormatOptions())
|
if (fop->document()->getFormatOptions())
|
||||||
svg_options = base::SharedPtr<SvgOptions>(fop->document()->getFormatOptions());
|
svg_options = std::static_pointer_cast<SvgOptions>(fop->document()->getFormatOptions());
|
||||||
|
|
||||||
if (!svg_options)
|
if (!svg_options)
|
||||||
svg_options.reset(new SvgOptions);
|
svg_options = std::make_shared<SvgOptions>();
|
||||||
|
|
||||||
#ifdef ENABLE_UI
|
#ifdef ENABLE_UI
|
||||||
if (fop->context() && fop->context()->isUIAvailable()) {
|
if (fop->context() && fop->context()->isUIAvailable()) {
|
||||||
|
@ -193,13 +193,13 @@ base::SharedPtr<FormatOptions> SvgFormat::onGetFormatOptions(FileOp* fop)
|
||||||
svg_options->pixelScale = pref.svg.pixelScale();
|
svg_options->pixelScale = pref.svg.pixelScale();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
svg_options.reset(nullptr);
|
svg_options.reset();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (std::exception& e) {
|
catch (std::exception& e) {
|
||||||
Console::showException(e);
|
Console::showException(e);
|
||||||
return base::SharedPtr<SvgOptions>(nullptr);
|
return std::shared_ptr<SvgOptions>(nullptr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
// Aseprite
|
// Aseprite
|
||||||
// Copyright (C) 2018 Igara Studio S.A.
|
// Copyright (C) 2018-2019 Igara Studio S.A.
|
||||||
// Copyright (C) 2015-2018 David Capello
|
// Copyright (C) 2015-2018 David Capello
|
||||||
// Copyright (C) 2015 Gabriel Rauter
|
// Copyright (C) 2015 Gabriel Rauter
|
||||||
//
|
//
|
||||||
// This program is distributed under the terms of
|
// This program is distributed under the terms of
|
||||||
// the End-User License Agreement for Aseprite.
|
// the End-User License Agreement for Aseprite.
|
||||||
|
@ -69,7 +69,7 @@ class WebPFormat : public FileFormat {
|
||||||
#ifdef ENABLE_SAVE
|
#ifdef ENABLE_SAVE
|
||||||
bool onSave(FileOp* fop) override;
|
bool onSave(FileOp* fop) override;
|
||||||
#endif
|
#endif
|
||||||
base::SharedPtr<FormatOptions> onGetFormatOptions(FileOp* fop) override;
|
std::shared_ptr<FormatOptions> onGetFormatOptions(FileOp* fop) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
FileFormat* CreateWebPFormat()
|
FileFormat* CreateWebPFormat()
|
||||||
|
@ -139,7 +139,7 @@ bool WebPFormat::onLoad(FileOp* fop)
|
||||||
WebPInitDecoderConfig(&config);
|
WebPInitDecoderConfig(&config);
|
||||||
if (WebPGetFeatures(webp_data.bytes, webp_data.size, &config.input)) {
|
if (WebPGetFeatures(webp_data.bytes, webp_data.size, &config.input)) {
|
||||||
if (!fop->formatOptions()) {
|
if (!fop->formatOptions()) {
|
||||||
base::SharedPtr<WebPOptions> opts(new WebPOptions());
|
auto opts = std::make_shared<WebPOptions>();
|
||||||
WebPOptions::Type type = WebPOptions::Simple;
|
WebPOptions::Type type = WebPOptions::Simple;
|
||||||
switch (config.input.format) {
|
switch (config.input.format) {
|
||||||
case 0: type = WebPOptions::Simple; break;
|
case 0: type = WebPOptions::Simple; break;
|
||||||
|
@ -268,7 +268,7 @@ bool WebPFormat::onSave(FileOp* fop)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
base::SharedPtr<WebPOptions> opts = fop->formatOptions();
|
auto opts = std::static_pointer_cast<WebPOptions>(fop->formatOptions());
|
||||||
WebPConfig config;
|
WebPConfig config;
|
||||||
WebPConfigInit(&config);
|
WebPConfigInit(&config);
|
||||||
|
|
||||||
|
@ -367,14 +367,14 @@ bool WebPFormat::onSave(FileOp* fop)
|
||||||
#endif // ENABLE_SAVE
|
#endif // ENABLE_SAVE
|
||||||
|
|
||||||
// Shows the WebP configuration dialog.
|
// Shows the WebP configuration dialog.
|
||||||
base::SharedPtr<FormatOptions> WebPFormat::onGetFormatOptions(FileOp* fop)
|
std::shared_ptr<FormatOptions> WebPFormat::onGetFormatOptions(FileOp* fop)
|
||||||
{
|
{
|
||||||
base::SharedPtr<WebPOptions> opts;
|
std::shared_ptr<WebPOptions> opts;
|
||||||
if (fop->document()->getFormatOptions())
|
if (fop->document()->getFormatOptions())
|
||||||
opts = base::SharedPtr<WebPOptions>(fop->document()->getFormatOptions());
|
opts = std::static_pointer_cast<WebPOptions>(fop->document()->getFormatOptions());
|
||||||
|
|
||||||
if (!opts)
|
if (!opts)
|
||||||
opts.reset(new WebPOptions);
|
opts = std::make_shared<WebPOptions>();
|
||||||
|
|
||||||
#ifdef ENABLE_UI
|
#ifdef ENABLE_UI
|
||||||
if (fop->context() && fop->context()->isUIAvailable()) {
|
if (fop->context() && fop->context()->isUIAvailable()) {
|
||||||
|
@ -452,13 +452,13 @@ base::SharedPtr<FormatOptions> WebPFormat::onGetFormatOptions(FileOp* fop)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
opts.reset(nullptr);
|
opts.reset();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch (const std::exception& e) {
|
catch (const std::exception& e) {
|
||||||
Console::showException(e);
|
Console::showException(e);
|
||||||
return base::SharedPtr<WebPOptions>(nullptr);
|
return std::shared_ptr<WebPOptions>(nullptr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif // ENABLE_UI
|
#endif // ENABLE_UI
|
||||||
|
|
|
@ -39,7 +39,6 @@
|
||||||
#include "base/clamp.h"
|
#include "base/clamp.h"
|
||||||
#include "base/fs.h"
|
#include "base/fs.h"
|
||||||
#include "base/memory.h"
|
#include "base/memory.h"
|
||||||
#include "base/shared_ptr.h"
|
|
||||||
#include "base/string.h"
|
#include "base/string.h"
|
||||||
#include "doc/sprite.h"
|
#include "doc/sprite.h"
|
||||||
#include "os/display.h"
|
#include "os/display.h"
|
||||||
|
@ -337,7 +336,7 @@ void save_window_pos(Widget* window, const char *section)
|
||||||
// TODO Replace this with new theme styles
|
// TODO Replace this with new theme styles
|
||||||
Widget* setup_mini_font(Widget* widget)
|
Widget* setup_mini_font(Widget* widget)
|
||||||
{
|
{
|
||||||
SkinPropertyPtr skinProp = get_skin_property(widget);
|
auto skinProp = get_skin_property(widget);
|
||||||
skinProp->setMiniFont();
|
skinProp->setMiniFont();
|
||||||
return widget;
|
return widget;
|
||||||
}
|
}
|
||||||
|
@ -345,7 +344,7 @@ Widget* setup_mini_font(Widget* widget)
|
||||||
// TODO Replace this with new theme styles
|
// TODO Replace this with new theme styles
|
||||||
Widget* setup_mini_look(Widget* widget)
|
Widget* setup_mini_look(Widget* widget)
|
||||||
{
|
{
|
||||||
SkinPropertyPtr skinProp = get_skin_property(widget);
|
auto skinProp = get_skin_property(widget);
|
||||||
skinProp->setLook(MiniLook);
|
skinProp->setLook(MiniLook);
|
||||||
return widget;
|
return widget;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
// Aseprite
|
// Aseprite
|
||||||
|
// Copyright (C) 2019 Igara Studio S.A.
|
||||||
// Copyright (C) 2001-2017 David Capello
|
// Copyright (C) 2001-2017 David Capello
|
||||||
//
|
//
|
||||||
// This program is distributed under the terms of
|
// This program is distributed under the terms of
|
||||||
|
@ -35,7 +36,7 @@ public:
|
||||||
|
|
||||||
class BrushPointShape : public PointShape {
|
class BrushPointShape : public PointShape {
|
||||||
Brush* m_brush;
|
Brush* m_brush;
|
||||||
base::SharedPtr<CompressedImage> m_compressedImage;
|
std::shared_ptr<CompressedImage> m_compressedImage;
|
||||||
bool m_firstPoint;
|
bool m_firstPoint;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -10,7 +10,6 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "app/ui/button_set.h"
|
#include "app/ui/button_set.h"
|
||||||
#include "base/shared_ptr.h"
|
|
||||||
#include "doc/brushes.h"
|
#include "doc/brushes.h"
|
||||||
#include "ui/box.h"
|
#include "ui/box.h"
|
||||||
#include "ui/popup_window.h"
|
#include "ui/popup_window.h"
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
// Aseprite
|
// Aseprite
|
||||||
// Copyright (C) 2018 Igara Studio S.A.
|
// Copyright (C) 2018-2019 Igara Studio S.A.
|
||||||
// Copyright (C) 2001-2018 David Capello
|
// Copyright (C) 2001-2018 David Capello
|
||||||
//
|
//
|
||||||
// This program is distributed under the terms of
|
// This program is distributed under the terms of
|
||||||
|
@ -370,7 +370,7 @@ void ColorSliders::addSlider(const Channel channel,
|
||||||
|
|
||||||
item.relSlider->setSizeHint(gfx::Size(128, 0));
|
item.relSlider->setSizeHint(gfx::Size(128, 0));
|
||||||
item.absSlider->setSizeHint(gfx::Size(128, 0));
|
item.absSlider->setSizeHint(gfx::Size(128, 0));
|
||||||
item.absSlider->setProperty(SkinSliderPropertyPtr(new SkinSliderProperty(new ColorSliderBgPainter(channel))));
|
item.absSlider->setProperty(std::make_shared<SkinSliderProperty>(new ColorSliderBgPainter(channel)));
|
||||||
item.absSlider->setDoubleBuffered(true);
|
item.absSlider->setDoubleBuffered(true);
|
||||||
get_skin_property(item.entry)->setLook(MiniLook);
|
get_skin_property(item.entry)->setLook(MiniLook);
|
||||||
|
|
||||||
|
@ -498,7 +498,8 @@ void ColorSliders::updateSlidersBgColor()
|
||||||
|
|
||||||
void ColorSliders::updateSliderBgColor(Slider* slider, const app::Color& color)
|
void ColorSliders::updateSliderBgColor(Slider* slider, const app::Color& color)
|
||||||
{
|
{
|
||||||
SkinSliderPropertyPtr sliderProperty(slider->getProperty(SkinSliderProperty::Name));
|
auto sliderProperty = std::static_pointer_cast<SkinSliderProperty>(
|
||||||
|
slider->getProperty(SkinSliderProperty::Name));
|
||||||
|
|
||||||
static_cast<ColorSliderBgPainter*>(sliderProperty->getBgPainter())->setColor(color);
|
static_cast<ColorSliderBgPainter*>(sliderProperty->getBgPainter())->setColor(color);
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
// Aseprite
|
// Aseprite
|
||||||
|
// Copyright (C) 2019 Igara Studio S.A.
|
||||||
// Copyright (C) 2001-2016 David Capello
|
// Copyright (C) 2001-2016 David Capello
|
||||||
//
|
//
|
||||||
// This program is distributed under the terms of
|
// This program is distributed under the terms of
|
||||||
|
@ -9,7 +10,6 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "app/extra_cel.h"
|
#include "app/extra_cel.h"
|
||||||
#include "base/shared_ptr.h"
|
|
||||||
#include "doc/brush.h"
|
#include "doc/brush.h"
|
||||||
#include "doc/color.h"
|
#include "doc/color.h"
|
||||||
#include "doc/frame.h"
|
#include "doc/frame.h"
|
||||||
|
@ -93,7 +93,7 @@ namespace app {
|
||||||
gfx::Point m_editorPosition; // Position in the editor (model)
|
gfx::Point m_editorPosition; // Position in the editor (model)
|
||||||
|
|
||||||
// Information about current brush
|
// Information about current brush
|
||||||
base::SharedPtr<doc::MaskBoundaries> m_brushBoundaries;
|
std::shared_ptr<doc::MaskBoundaries> m_brushBoundaries;
|
||||||
int m_brushGen;
|
int m_brushGen;
|
||||||
int m_brushWidth;
|
int m_brushWidth;
|
||||||
int m_brushHeight;
|
int m_brushHeight;
|
||||||
|
|
|
@ -10,7 +10,6 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "base/disable_copying.h"
|
#include "base/disable_copying.h"
|
||||||
#include "base/shared_ptr.h"
|
|
||||||
#include "gfx/point.h"
|
#include "gfx/point.h"
|
||||||
|
|
||||||
namespace gfx {
|
namespace gfx {
|
||||||
|
@ -132,7 +131,7 @@ namespace app {
|
||||||
DISABLE_COPYING(EditorState);
|
DISABLE_COPYING(EditorState);
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef base::SharedPtr<EditorState> EditorStatePtr;
|
typedef std::shared_ptr<EditorState> EditorStatePtr;
|
||||||
|
|
||||||
} // namespace app
|
} // namespace app
|
||||||
|
|
||||||
|
|
|
@ -713,7 +713,7 @@ void MovingPixelsState::removeAsEditorObserver()
|
||||||
|
|
||||||
void MovingPixelsState::removePixelsMovement()
|
void MovingPixelsState::removePixelsMovement()
|
||||||
{
|
{
|
||||||
m_pixelsMovement.reset(nullptr);
|
m_pixelsMovement.reset();
|
||||||
m_ctxConn.disconnect();
|
m_ctxConn.disconnect();
|
||||||
m_opaqueConn.disconnect();
|
m_opaqueConn.disconnect();
|
||||||
m_transparentConn.disconnect();
|
m_transparentConn.disconnect();
|
||||||
|
|
|
@ -14,11 +14,12 @@
|
||||||
#include "app/site.h"
|
#include "app/site.h"
|
||||||
#include "app/tx.h"
|
#include "app/tx.h"
|
||||||
#include "app/ui/editor/handle_type.h"
|
#include "app/ui/editor/handle_type.h"
|
||||||
#include "base/shared_ptr.h"
|
|
||||||
#include "doc/algorithm/flip_type.h"
|
#include "doc/algorithm/flip_type.h"
|
||||||
#include "gfx/size.h"
|
#include "gfx/size.h"
|
||||||
#include "obs/connection.h"
|
#include "obs/connection.h"
|
||||||
|
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
namespace doc {
|
namespace doc {
|
||||||
class Image;
|
class Image;
|
||||||
class Mask;
|
class Mask;
|
||||||
|
@ -152,7 +153,7 @@ namespace app {
|
||||||
return a;
|
return a;
|
||||||
}
|
}
|
||||||
|
|
||||||
typedef base::SharedPtr<PixelsMovement> PixelsMovementPtr;
|
typedef std::shared_ptr<PixelsMovement> PixelsMovementPtr;
|
||||||
|
|
||||||
} // namespace app
|
} // namespace app
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
// Aseprite
|
// Aseprite
|
||||||
|
// Copyright (C) 2019 Igara Studio S.A.
|
||||||
// Copyright (C) 2001-2017 David Capello
|
// Copyright (C) 2001-2017 David Capello
|
||||||
//
|
//
|
||||||
// This program is distributed under the terms of
|
// This program is distributed under the terms of
|
||||||
|
@ -8,10 +9,10 @@
|
||||||
#define APP_UI_SKIN_SKIN_PART_H_INCLUDED
|
#define APP_UI_SKIN_SKIN_PART_H_INCLUDED
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "base/shared_ptr.h"
|
|
||||||
#include "gfx/rect.h"
|
#include "gfx/rect.h"
|
||||||
#include "gfx/size.h"
|
#include "gfx/size.h"
|
||||||
|
|
||||||
|
#include <memory>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
namespace os {
|
namespace os {
|
||||||
|
@ -59,7 +60,7 @@ namespace app {
|
||||||
gfx::Rect m_slicesBounds;
|
gfx::Rect m_slicesBounds;
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef base::SharedPtr<SkinPart> SkinPartPtr;
|
typedef std::shared_ptr<SkinPart> SkinPartPtr;
|
||||||
|
|
||||||
} // namespace skin
|
} // namespace skin
|
||||||
} // namespace app
|
} // namespace app
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
// Aseprite
|
// Aseprite
|
||||||
|
// Copyright (C) 2019 Igara Studio S.A.
|
||||||
// Copyright (C) 2001-2017 David Capello
|
// Copyright (C) 2001-2017 David Capello
|
||||||
//
|
//
|
||||||
// This program is distributed under the terms of
|
// This program is distributed under the terms of
|
||||||
|
@ -30,14 +31,12 @@ SkinProperty::~SkinProperty()
|
||||||
|
|
||||||
SkinPropertyPtr get_skin_property(ui::Widget* widget)
|
SkinPropertyPtr get_skin_property(ui::Widget* widget)
|
||||||
{
|
{
|
||||||
SkinPropertyPtr skinProp;
|
auto skinProp =
|
||||||
|
std::static_pointer_cast<SkinProperty>(widget->getProperty(SkinProperty::Name));
|
||||||
skinProp = widget->getProperty(SkinProperty::Name);
|
|
||||||
if (!skinProp) {
|
if (!skinProp) {
|
||||||
skinProp.reset(new SkinProperty);
|
skinProp = std::make_shared<SkinProperty>();
|
||||||
widget->setProperty(skinProp);
|
widget->setProperty(skinProp);
|
||||||
}
|
}
|
||||||
|
|
||||||
return skinProp;
|
return skinProp;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
// Aseprite
|
// Aseprite
|
||||||
// Copyright (C) 2001-2015, 2017 David Capello
|
// Copyright (C) 2019 Igara Studio S.A.
|
||||||
|
// Copyright (C) 2001-2017 David Capello
|
||||||
//
|
//
|
||||||
// This program is distributed under the terms of
|
// This program is distributed under the terms of
|
||||||
// the End-User License Agreement for Aseprite.
|
// the End-User License Agreement for Aseprite.
|
||||||
|
@ -8,9 +9,10 @@
|
||||||
#define APP_UI_SKIN_SKIN_PROPERTY_H_INCLUDED
|
#define APP_UI_SKIN_SKIN_PROPERTY_H_INCLUDED
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "base/shared_ptr.h"
|
|
||||||
#include "ui/property.h"
|
#include "ui/property.h"
|
||||||
|
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
namespace ui {
|
namespace ui {
|
||||||
class Widget;
|
class Widget;
|
||||||
}
|
}
|
||||||
|
@ -43,7 +45,7 @@ namespace app {
|
||||||
bool m_miniFont;
|
bool m_miniFont;
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef base::SharedPtr<SkinProperty> SkinPropertyPtr;
|
typedef std::shared_ptr<SkinProperty> SkinPropertyPtr;
|
||||||
|
|
||||||
SkinPropertyPtr get_skin_property(ui::Widget* widget);
|
SkinPropertyPtr get_skin_property(ui::Widget* widget);
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
// Aseprite
|
// Aseprite
|
||||||
|
// Copyright (C) 2019 Igara Studio S.A.
|
||||||
// Copyright (C) 2001-2015 David Capello
|
// Copyright (C) 2001-2015 David Capello
|
||||||
//
|
//
|
||||||
// This program is distributed under the terms of
|
// This program is distributed under the terms of
|
||||||
|
@ -9,9 +10,10 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "app/ui/skin/skin_property.h"
|
#include "app/ui/skin/skin_property.h"
|
||||||
#include "base/shared_ptr.h"
|
|
||||||
#include "gfx/rect.h"
|
#include "gfx/rect.h"
|
||||||
|
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
namespace ui {
|
namespace ui {
|
||||||
class Slider;
|
class Slider;
|
||||||
class Graphics;
|
class Graphics;
|
||||||
|
@ -41,8 +43,6 @@ namespace app {
|
||||||
ISliderBgPainter* m_painter;
|
ISliderBgPainter* m_painter;
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef base::SharedPtr<SkinSliderProperty> SkinSliderPropertyPtr;
|
|
||||||
|
|
||||||
} // namespace skin
|
} // namespace skin
|
||||||
} // namespace app
|
} // namespace app
|
||||||
|
|
||||||
|
|
|
@ -28,7 +28,6 @@
|
||||||
#include "base/bind.h"
|
#include "base/bind.h"
|
||||||
#include "base/fs.h"
|
#include "base/fs.h"
|
||||||
#include "base/log.h"
|
#include "base/log.h"
|
||||||
#include "base/shared_ptr.h"
|
|
||||||
#include "base/string.h"
|
#include "base/string.h"
|
||||||
#include "gfx/border.h"
|
#include "gfx/border.h"
|
||||||
#include "gfx/point.h"
|
#include "gfx/point.h"
|
||||||
|
@ -726,7 +725,7 @@ os::Surface* SkinTheme::sliceSheet(os::Surface* sur, const gfx::Rect& bounds)
|
||||||
|
|
||||||
os::Font* SkinTheme::getWidgetFont(const Widget* widget) const
|
os::Font* SkinTheme::getWidgetFont(const Widget* widget) const
|
||||||
{
|
{
|
||||||
SkinPropertyPtr skinPropery = widget->getProperty(SkinProperty::Name);
|
auto skinPropery = std::static_pointer_cast<SkinProperty>(widget->getProperty(SkinProperty::Name));
|
||||||
if (skinPropery && skinPropery->hasMiniFont())
|
if (skinPropery && skinPropery->hasMiniFont())
|
||||||
return getMiniFont();
|
return getMiniFont();
|
||||||
else
|
else
|
||||||
|
@ -951,7 +950,7 @@ void SkinTheme::paintEntry(PaintEvent& ev)
|
||||||
g->fillRect(BGCOLOR, bounds);
|
g->fillRect(BGCOLOR, bounds);
|
||||||
|
|
||||||
bool isMiniLook = false;
|
bool isMiniLook = false;
|
||||||
SkinPropertyPtr skinPropery = widget->getProperty(SkinProperty::Name);
|
auto skinPropery = std::static_pointer_cast<SkinProperty>(widget->getProperty(SkinProperty::Name));
|
||||||
if (skinPropery)
|
if (skinPropery)
|
||||||
isMiniLook = (skinPropery->getLook() == MiniLook);
|
isMiniLook = (skinPropery->getLook() == MiniLook);
|
||||||
|
|
||||||
|
@ -1260,11 +1259,11 @@ void SkinTheme::paintSlider(PaintEvent& ev)
|
||||||
// customized background (e.g. RGB sliders)
|
// customized background (e.g. RGB sliders)
|
||||||
ISliderBgPainter* bgPainter = NULL;
|
ISliderBgPainter* bgPainter = NULL;
|
||||||
|
|
||||||
SkinPropertyPtr skinPropery = widget->getProperty(SkinProperty::Name);
|
const auto skinPropery = std::static_pointer_cast<SkinProperty>(widget->getProperty(SkinProperty::Name));
|
||||||
if (skinPropery)
|
if (skinPropery)
|
||||||
isMiniLook = (skinPropery->getLook() == MiniLook);
|
isMiniLook = (skinPropery->getLook() == MiniLook);
|
||||||
|
|
||||||
SkinSliderPropertyPtr skinSliderPropery = widget->getProperty(SkinSliderProperty::Name);
|
const auto skinSliderPropery = std::static_pointer_cast<SkinSliderProperty>(widget->getProperty(SkinSliderProperty::Name));
|
||||||
if (skinSliderPropery)
|
if (skinSliderPropery)
|
||||||
bgPainter = skinSliderPropery->getBgPainter();
|
bgPainter = skinSliderPropery->getBgPainter();
|
||||||
|
|
||||||
|
|
|
@ -10,11 +10,11 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "app/ui/animated_widget.h"
|
#include "app/ui/animated_widget.h"
|
||||||
#include "base/shared_ptr.h"
|
|
||||||
#include "ui/mouse_buttons.h"
|
#include "ui/mouse_buttons.h"
|
||||||
#include "ui/timer.h"
|
#include "ui/timer.h"
|
||||||
#include "ui/widget.h"
|
#include "ui/widget.h"
|
||||||
|
|
||||||
|
#include <memory>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
namespace ui {
|
namespace ui {
|
||||||
|
@ -136,7 +136,7 @@ namespace app {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef base::SharedPtr<Tab> TabPtr;
|
typedef std::shared_ptr<Tab> TabPtr;
|
||||||
|
|
||||||
typedef std::vector<TabPtr> TabsList;
|
typedef std::vector<TabPtr> TabsList;
|
||||||
typedef TabsList::iterator TabsListIterator;
|
typedef TabsList::iterator TabsListIterator;
|
||||||
|
|
|
@ -33,13 +33,13 @@
|
||||||
#include "app/util/clipboard.h"
|
#include "app/util/clipboard.h"
|
||||||
#include "app/util/clipboard_native.h"
|
#include "app/util/clipboard_native.h"
|
||||||
#include "app/util/new_image_from_mask.h"
|
#include "app/util/new_image_from_mask.h"
|
||||||
#include "base/shared_ptr.h"
|
|
||||||
#include "clip/clip.h"
|
#include "clip/clip.h"
|
||||||
#include "doc/doc.h"
|
#include "doc/doc.h"
|
||||||
#include "render/dithering.h"
|
#include "render/dithering.h"
|
||||||
#include "render/ordered_dither.h"
|
#include "render/ordered_dither.h"
|
||||||
#include "render/quantization.h"
|
#include "render/quantization.h"
|
||||||
|
|
||||||
|
#include <memory>
|
||||||
#include <stdexcept>
|
#include <stdexcept>
|
||||||
|
|
||||||
namespace app {
|
namespace app {
|
||||||
|
@ -96,10 +96,10 @@ namespace clipboard {
|
||||||
|
|
||||||
using namespace doc;
|
using namespace doc;
|
||||||
|
|
||||||
static base::SharedPtr<Palette> clipboard_palette;
|
static std::shared_ptr<Palette> clipboard_palette;
|
||||||
static PalettePicks clipboard_picks;
|
static PalettePicks clipboard_picks;
|
||||||
static ImageRef clipboard_image;
|
static ImageRef clipboard_image;
|
||||||
static base::SharedPtr<Mask> clipboard_mask;
|
static std::shared_ptr<Mask> clipboard_mask;
|
||||||
static ClipboardRange clipboard_range;
|
static ClipboardRange clipboard_range;
|
||||||
|
|
||||||
static ClipboardManager* g_instance = nullptr;
|
static ClipboardManager* g_instance = nullptr;
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
// Aseprite
|
// Aseprite
|
||||||
|
// Copyright (C) 2019 Igara Studio S.A.
|
||||||
// Copyright (C) 2001-2018 David Capello
|
// Copyright (C) 2001-2018 David Capello
|
||||||
//
|
//
|
||||||
// This program is distributed under the terms of
|
// This program is distributed under the terms of
|
||||||
|
@ -41,8 +42,8 @@ static doc::ImageBufferPtr dst_buffer;
|
||||||
|
|
||||||
static void destroy_buffers()
|
static void destroy_buffers()
|
||||||
{
|
{
|
||||||
src_buffer.reset(NULL);
|
src_buffer.reset();
|
||||||
dst_buffer.reset(NULL);
|
dst_buffer.reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
static void create_buffers()
|
static void create_buffers()
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
// Aseprite
|
// Aseprite
|
||||||
|
// Copyright (C) 2019 Igara Studio S.A.
|
||||||
// Copyright (C) 2001-2015 David Capello
|
// Copyright (C) 2001-2015 David Capello
|
||||||
//
|
//
|
||||||
// This program is distributed under the terms of
|
// This program is distributed under the terms of
|
||||||
|
@ -26,7 +27,7 @@ XmlDocumentRef open_xml(const std::string& filename)
|
||||||
throw Exception("Error loading file: " + filename);
|
throw Exception("Error loading file: " + filename);
|
||||||
|
|
||||||
// Try to load the XML file
|
// Try to load the XML file
|
||||||
XmlDocumentRef doc(new TiXmlDocument());
|
auto doc = std::make_shared<TiXmlDocument>();
|
||||||
doc->SetValue(filename.c_str());
|
doc->SetValue(filename.c_str());
|
||||||
if (!doc->LoadFile(file.get()))
|
if (!doc->LoadFile(file.get()))
|
||||||
throw XmlException(doc.get());
|
throw XmlException(doc.get());
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
// Aseprite
|
// Aseprite
|
||||||
|
// Copyright (C) 2019 Igara Studio S.A.
|
||||||
// Copyright (C) 2001-2015 David Capello
|
// Copyright (C) 2001-2015 David Capello
|
||||||
//
|
//
|
||||||
// This program is distributed under the terms of
|
// This program is distributed under the terms of
|
||||||
|
@ -9,15 +10,15 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "base/exception.h"
|
#include "base/exception.h"
|
||||||
#include "base/shared_ptr.h"
|
|
||||||
|
|
||||||
#include "tinyxml.h"
|
#include "tinyxml.h"
|
||||||
|
|
||||||
|
#include <memory>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
namespace app {
|
namespace app {
|
||||||
|
|
||||||
typedef base::SharedPtr<TiXmlDocument> XmlDocumentRef;
|
typedef std::shared_ptr<TiXmlDocument> XmlDocumentRef;
|
||||||
|
|
||||||
XmlDocumentRef open_xml(const std::string& filename);
|
XmlDocumentRef open_xml(const std::string& filename);
|
||||||
void save_xml(XmlDocumentRef doc, const std::string& filename);
|
void save_xml(XmlDocumentRef doc, const std::string& filename);
|
||||||
|
|
|
@ -82,7 +82,7 @@ namespace doc {
|
||||||
std::unique_ptr<color_t> m_bgColor; // Background color (nullptr if it wasn't specified)
|
std::unique_ptr<color_t> m_bgColor; // Background color (nullptr if it wasn't specified)
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef base::SharedPtr<Brush> BrushRef;
|
typedef std::shared_ptr<Brush> BrushRef;
|
||||||
|
|
||||||
} // namespace doc
|
} // namespace doc
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
// Aseprite Document Library
|
// Aseprite Document Library
|
||||||
|
// Copyright (C) 2019 Igara Studio S.A.
|
||||||
// Copyright (c) 2001-2016 David Capello
|
// Copyright (c) 2001-2016 David Capello
|
||||||
//
|
//
|
||||||
// This file is released under the terms of the MIT license.
|
// This file is released under the terms of the MIT license.
|
||||||
|
@ -8,12 +9,13 @@
|
||||||
#define DOC_CEL_DATA_H_INCLUDED
|
#define DOC_CEL_DATA_H_INCLUDED
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "base/shared_ptr.h"
|
|
||||||
#include "doc/image_ref.h"
|
#include "doc/image_ref.h"
|
||||||
#include "doc/object.h"
|
#include "doc/object.h"
|
||||||
#include "doc/with_user_data.h"
|
#include "doc/with_user_data.h"
|
||||||
#include "gfx/rect.h"
|
#include "gfx/rect.h"
|
||||||
|
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
namespace doc {
|
namespace doc {
|
||||||
|
|
||||||
class CelData : public WithUserData {
|
class CelData : public WithUserData {
|
||||||
|
@ -68,7 +70,7 @@ namespace doc {
|
||||||
mutable gfx::RectF* m_boundsF;
|
mutable gfx::RectF* m_boundsF;
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef base::SharedPtr<CelData> CelDataRef;
|
typedef std::shared_ptr<CelData> CelDataRef;
|
||||||
|
|
||||||
} // namespace doc
|
} // namespace doc
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
// Aseprite Document Library
|
// Aseprite Document Library
|
||||||
// Copyright (c) 2001-2016 David Capello
|
// Copyright (C) 2019 Igara Studio S.A.
|
||||||
|
// Copyright (C) 2001-2016 David Capello
|
||||||
//
|
//
|
||||||
// This file is released under the terms of the MIT license.
|
// This file is released under the terms of the MIT license.
|
||||||
// Read LICENSE.txt for more information.
|
// Read LICENSE.txt for more information.
|
||||||
|
@ -9,10 +10,10 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "base/ints.h"
|
#include "base/ints.h"
|
||||||
#include "base/shared_ptr.h"
|
|
||||||
|
|
||||||
#include <vector>
|
|
||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
|
#include <memory>
|
||||||
|
#include <vector>
|
||||||
|
|
||||||
namespace doc {
|
namespace doc {
|
||||||
|
|
||||||
|
@ -33,7 +34,7 @@ namespace doc {
|
||||||
std::vector<uint8_t> m_buffer;
|
std::vector<uint8_t> m_buffer;
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef base::SharedPtr<ImageBuffer> ImageBufferPtr;
|
typedef std::shared_ptr<ImageBuffer> ImageBufferPtr;
|
||||||
|
|
||||||
} // namespace doc
|
} // namespace doc
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
// Aseprite Document Library
|
// Aseprite Document Library
|
||||||
// Copyright (c) 2018 Igara Studio S.A.
|
// Copyright (C) 2018-2019 Igara Studio S.A.
|
||||||
// Copyright (c) 2001-2016 David Capello
|
// Copyright (C) 2001-2016 David Capello
|
||||||
//
|
//
|
||||||
// This file is released under the terms of the MIT license.
|
// This file is released under the terms of the MIT license.
|
||||||
// Read LICENSE.txt for more information.
|
// Read LICENSE.txt for more information.
|
||||||
|
@ -68,7 +68,7 @@ namespace doc {
|
||||||
std::size_t required_size = for_rows + rowstride_bytes*spec.height();
|
std::size_t required_size = for_rows + rowstride_bytes*spec.height();
|
||||||
|
|
||||||
if (!m_buffer)
|
if (!m_buffer)
|
||||||
m_buffer.reset(new ImageBuffer(required_size));
|
m_buffer = std::make_shared<ImageBuffer>(required_size);
|
||||||
else
|
else
|
||||||
m_buffer->resizeIfNecessary(required_size);
|
m_buffer->resizeIfNecessary(required_size);
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
// Aseprite Document Library
|
// Aseprite Document Library
|
||||||
// Copyright (c) 2001-2015 David Capello
|
// Copyright (C) 2019 Igara Studio S.A.
|
||||||
|
// Copyright (C) 2001-2015 David Capello
|
||||||
//
|
//
|
||||||
// This file is released under the terms of the MIT license.
|
// This file is released under the terms of the MIT license.
|
||||||
// Read LICENSE.txt for more information.
|
// Read LICENSE.txt for more information.
|
||||||
|
@ -8,12 +9,13 @@
|
||||||
#define DOC_IMAGE_REF_H_INCLUDED
|
#define DOC_IMAGE_REF_H_INCLUDED
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "base/shared_ptr.h"
|
|
||||||
#include "doc/image.h"
|
#include "doc/image.h"
|
||||||
|
|
||||||
|
#include <memory>
|
||||||
|
|
||||||
namespace doc {
|
namespace doc {
|
||||||
|
|
||||||
typedef base::SharedPtr<Image> ImageRef;
|
typedef std::shared_ptr<Image> ImageRef;
|
||||||
|
|
||||||
} // namespace doc
|
} // namespace doc
|
||||||
|
|
||||||
|
|
|
@ -1,4 +1,5 @@
|
||||||
// Aseprite UI Library
|
// Aseprite UI Library
|
||||||
|
// Copyright (C) 2019 Igara Studio S.A.
|
||||||
// Copyright (C) 2001-2018 David Capello
|
// Copyright (C) 2001-2018 David Capello
|
||||||
//
|
//
|
||||||
// This file is released under the terms of the MIT license.
|
// This file is released under the terms of the MIT license.
|
||||||
|
@ -8,9 +9,9 @@
|
||||||
#define UI_ALERT_H_INCLUDED
|
#define UI_ALERT_H_INCLUDED
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "base/shared_ptr.h"
|
|
||||||
#include "ui/window.h"
|
#include "ui/window.h"
|
||||||
|
|
||||||
|
#include <memory>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <vector>
|
#include <vector>
|
||||||
|
|
||||||
|
@ -21,7 +22,7 @@ namespace ui {
|
||||||
class Slider;
|
class Slider;
|
||||||
|
|
||||||
class Alert;
|
class Alert;
|
||||||
typedef base::SharedPtr<Alert> AlertPtr;
|
typedef std::shared_ptr<Alert> AlertPtr;
|
||||||
|
|
||||||
class Alert : public Window {
|
class Alert : public Window {
|
||||||
public:
|
public:
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
// Aseprite UI Library
|
// Aseprite UI Library
|
||||||
// Copyright (C) 2001-2013, 2015 David Capello
|
// Copyright (C) 2001-2015 David Capello
|
||||||
//
|
//
|
||||||
// This file is released under the terms of the MIT license.
|
// This file is released under the terms of the MIT license.
|
||||||
// Read LICENSE.txt for more information.
|
// Read LICENSE.txt for more information.
|
||||||
|
@ -8,7 +8,6 @@
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include "base/shared_ptr.h"
|
|
||||||
#include "ui/component.h"
|
#include "ui/component.h"
|
||||||
#include "ui/property.h"
|
#include "ui/property.h"
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,6 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "base/disable_copying.h"
|
#include "base/disable_copying.h"
|
||||||
#include "base/shared_ptr.h"
|
|
||||||
#include "base/string.h"
|
#include "base/string.h"
|
||||||
#include "gfx/color.h"
|
#include "gfx/color.h"
|
||||||
#include "gfx/point.h"
|
#include "gfx/point.h"
|
||||||
|
@ -18,6 +17,7 @@
|
||||||
#include "gfx/size.h"
|
#include "gfx/size.h"
|
||||||
#include "os/paint.h"
|
#include "os/paint.h"
|
||||||
|
|
||||||
|
#include <memory>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
namespace gfx {
|
namespace gfx {
|
||||||
|
@ -200,7 +200,7 @@ namespace ui {
|
||||||
DISABLE_COPYING(CheckedDrawMode);
|
DISABLE_COPYING(CheckedDrawMode);
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef base::SharedPtr<Graphics> GraphicsPtr;
|
typedef std::shared_ptr<Graphics> GraphicsPtr;
|
||||||
|
|
||||||
} // namespace ui
|
} // namespace ui
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
// Aseprite UI Library
|
// Aseprite UI Library
|
||||||
// Copyright (C) 2001-2013, 2015 David Capello
|
// Copyright (C) 2019 Igara Studio S.A.
|
||||||
|
// Copyright (C) 2001-2015 David Capello
|
||||||
//
|
//
|
||||||
// This file is released under the terms of the MIT license.
|
// This file is released under the terms of the MIT license.
|
||||||
// Read LICENSE.txt for more information.
|
// Read LICENSE.txt for more information.
|
||||||
|
@ -9,8 +10,8 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "base/disable_copying.h"
|
#include "base/disable_copying.h"
|
||||||
#include "base/shared_ptr.h"
|
|
||||||
|
|
||||||
|
#include <memory>
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
namespace ui {
|
namespace ui {
|
||||||
|
@ -28,7 +29,7 @@ namespace ui {
|
||||||
DISABLE_COPYING(Property);
|
DISABLE_COPYING(Property);
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef base::SharedPtr<Property> PropertyPtr;
|
typedef std::shared_ptr<Property> PropertyPtr;
|
||||||
|
|
||||||
} // namespace ui
|
} // namespace ui
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue