2015-02-12 23:16:25 +08:00
|
|
|
// Aseprite
|
2021-04-23 00:00:13 +08:00
|
|
|
// Copyright (C) 2019-2021 Igara Studio S.A.
|
2017-06-17 03:28:48 +08:00
|
|
|
// Copyright (C) 2001-2017 David Capello
|
2015-02-12 23:16:25 +08:00
|
|
|
//
|
2016-08-27 04:02:58 +08:00
|
|
|
// This program is distributed under the terms of
|
|
|
|
|
// the End-User License Agreement for Aseprite.
|
2007-09-19 07:57:02 +08:00
|
|
|
|
2013-08-06 08:20:19 +08:00
|
|
|
#ifndef APP_UI_EDITOR_TOOL_LOOP_IMPL_H_INCLUDED
|
|
|
|
|
#define APP_UI_EDITOR_TOOL_LOOP_IMPL_H_INCLUDED
|
2014-03-30 06:40:17 +08:00
|
|
|
#pragma once
|
2007-09-19 07:57:02 +08:00
|
|
|
|
2020-05-20 07:11:47 +08:00
|
|
|
#include "app/color.h"
|
|
|
|
|
#include "app/tools/freehand_algorithm.h"
|
|
|
|
|
#include "app/tools/ink_type.h"
|
2017-11-28 00:53:56 +08:00
|
|
|
#include "app/tools/pointer.h"
|
2020-05-20 07:11:47 +08:00
|
|
|
#include "app/tools/tool_loop.h"
|
2019-04-19 09:23:33 +08:00
|
|
|
#include "doc/brush.h"
|
2015-04-27 11:08:04 +08:00
|
|
|
#include "doc/image_ref.h"
|
2015-04-27 02:59:28 +08:00
|
|
|
#include "gfx/fwd.h"
|
|
|
|
|
|
|
|
|
|
namespace doc {
|
|
|
|
|
class Image;
|
|
|
|
|
}
|
|
|
|
|
|
2013-08-06 08:20:19 +08:00
|
|
|
namespace app {
|
2019-03-16 04:03:02 +08:00
|
|
|
class Color;
|
2013-08-06 08:20:19 +08:00
|
|
|
class Context;
|
|
|
|
|
class Editor;
|
2019-03-24 03:34:51 +08:00
|
|
|
class Site;
|
2007-09-19 07:57:02 +08:00
|
|
|
|
2020-05-20 07:11:47 +08:00
|
|
|
struct ToolLoopParams {
|
|
|
|
|
tools::Tool* tool = nullptr;
|
|
|
|
|
tools::Ink* ink = nullptr;
|
|
|
|
|
tools::Controller* controller = nullptr;
|
|
|
|
|
|
|
|
|
|
tools::ToolLoop::Button button = tools::ToolLoop::Left;
|
|
|
|
|
tools::InkType inkType = tools::InkType::DEFAULT;
|
|
|
|
|
app::Color fg;
|
|
|
|
|
app::Color bg;
|
|
|
|
|
doc::BrushRef brush;
|
|
|
|
|
|
|
|
|
|
// Options equal to (and with the same default as in)
|
|
|
|
|
// <preferences><tool>...</tool></preferences> from
|
|
|
|
|
// "data/pref.xml" file.
|
|
|
|
|
int opacity = 255;
|
|
|
|
|
int tolerance = 0;
|
2020-05-28 02:18:04 +08:00
|
|
|
bool contiguous = true;
|
2020-05-20 07:11:47 +08:00
|
|
|
tools::FreehandAlgorithm freehandAlgorithm = tools::FreehandAlgorithm::DEFAULT;
|
2021-04-23 00:00:13 +08:00
|
|
|
|
|
|
|
|
// For selection tools executed from scripts
|
|
|
|
|
tools::ToolLoopModifiers modifiers = tools::ToolLoopModifiers::kNone;
|
2020-05-20 07:11:47 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////
|
|
|
|
|
// For UI
|
|
|
|
|
|
|
|
|
|
#ifdef ENABLE_UI
|
2007-09-19 07:57:02 +08:00
|
|
|
|
2015-04-27 02:59:28 +08:00
|
|
|
tools::ToolLoop* create_tool_loop(
|
2017-06-17 03:28:48 +08:00
|
|
|
Editor* editor,
|
|
|
|
|
Context* context,
|
2017-11-28 00:53:56 +08:00
|
|
|
const tools::Pointer::Button button,
|
2020-02-16 23:42:29 +08:00
|
|
|
const bool convertLineToFreehand,
|
|
|
|
|
const bool selectTiles);
|
2015-04-27 02:59:28 +08:00
|
|
|
|
|
|
|
|
tools::ToolLoop* create_tool_loop_preview(
|
2017-06-17 03:28:48 +08:00
|
|
|
Editor* editor,
|
2020-05-06 06:42:07 +08:00
|
|
|
const doc::BrushRef& brush,
|
2017-06-17 03:28:48 +08:00
|
|
|
doc::Image* image,
|
2015-11-03 03:44:17 +08:00
|
|
|
const gfx::Point& celOrigin);
|
2013-08-06 08:20:19 +08:00
|
|
|
|
2020-05-20 07:11:47 +08:00
|
|
|
#endif // ENABLE_UI
|
|
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////
|
|
|
|
|
// For scripting
|
|
|
|
|
|
|
|
|
|
#ifdef ENABLE_SCRIPTING
|
|
|
|
|
|
|
|
|
|
tools::ToolLoop* create_tool_loop_for_script(
|
|
|
|
|
Context* context,
|
|
|
|
|
const Site& site,
|
|
|
|
|
ToolLoopParams& params);
|
|
|
|
|
|
|
|
|
|
#endif // ENABLE_SCRIPTING
|
|
|
|
|
|
2013-08-06 08:20:19 +08:00
|
|
|
} // namespace app
|
2007-09-19 07:57:02 +08:00
|
|
|
|
2009-08-18 05:38:00 +08:00
|
|
|
#endif
|