aseprite/src/app/ui/editor/tool_loop_impl.h

89 lines
2.1 KiB
C
Raw Normal View History

2015-02-12 23:16:25 +08:00
// Aseprite
// Copyright (C) 2019-2021 Igara Studio S.A.
// 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
#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
#include "app/color.h"
#include "app/tools/freehand_algorithm.h"
#include "app/tools/ink_type.h"
#include "app/tools/pointer.h"
#include "app/tools/tool_loop.h"
#include "doc/brush.h"
#include "doc/image_ref.h"
#include "gfx/fwd.h"
namespace doc {
class Image;
}
namespace app {
2019-03-16 04:03:02 +08:00
class Color;
class Context;
class Editor;
class Site;
2007-09-19 07:57:02 +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;
bool contiguous = true;
tools::FreehandAlgorithm freehandAlgorithm = tools::FreehandAlgorithm::DEFAULT;
// For selection tools executed from scripts
tools::ToolLoopModifiers modifiers = tools::ToolLoopModifiers::kNone;
};
//////////////////////////////////////////////////////////////////////
// For UI
#ifdef ENABLE_UI
2007-09-19 07:57:02 +08:00
tools::ToolLoop* create_tool_loop(
Editor* editor,
Context* context,
const tools::Pointer::Button button,
const bool convertLineToFreehand,
const bool selectTiles);
tools::ToolLoop* create_tool_loop_preview(
Editor* editor,
const doc::BrushRef& brush,
doc::Image* image,
const gfx::Point& celOrigin);
#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
} // namespace app
2007-09-19 07:57:02 +08:00
2009-08-18 05:38:00 +08:00
#endif