2022-04-15 02:20:27 +02:00
|
|
|
#ifndef PAINT_EDITOR__PLUGIN_H
|
|
|
|
#define PAINT_EDITOR__PLUGIN_H
|
|
|
|
|
|
|
|
/*
|
2022-12-31 21:07:05 +01:00
|
|
|
Copyright (c) 2019-2023 Péter Magyar
|
2022-04-15 02:20:27 +02:00
|
|
|
|
|
|
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
|
|
of this software and associated documentation files (the "Software"), to deal
|
|
|
|
in the Software without restriction, including without limitation the rights
|
|
|
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
|
|
copies of the Software, and to permit persons to whom the Software is
|
|
|
|
furnished to do so, subject to the following conditions:
|
|
|
|
|
|
|
|
The above copyright notice and this permission notice shall be included in all
|
|
|
|
copies or substantial portions of the Software.
|
|
|
|
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
|
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
|
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
|
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
|
|
SOFTWARE.
|
|
|
|
*/
|
|
|
|
|
2022-08-17 13:45:14 +02:00
|
|
|
#include "core/object/reference.h"
|
2022-11-15 22:11:49 +01:00
|
|
|
#include "editor/editor_plugin.h"
|
2022-04-16 19:08:19 +02:00
|
|
|
|
|
|
|
class PaintWindow;
|
|
|
|
class Texture;
|
2022-11-16 15:25:27 +01:00
|
|
|
class PaintNode;
|
2022-11-20 21:01:54 +01:00
|
|
|
class PaintInspectorPlugin;
|
2022-04-15 02:20:27 +02:00
|
|
|
|
|
|
|
class PaintEditorPlugin : public EditorPlugin {
|
|
|
|
GDCLASS(PaintEditorPlugin, EditorPlugin);
|
|
|
|
|
|
|
|
public:
|
2022-04-16 02:35:03 +02:00
|
|
|
void make_visible(const bool visible);
|
2022-04-15 02:20:27 +02:00
|
|
|
String get_name() const;
|
2022-11-15 22:11:49 +01:00
|
|
|
void edit(Object *p_object);
|
|
|
|
bool handles(Object *p_object) const;
|
|
|
|
void edited_scene_changed();
|
|
|
|
|
|
|
|
bool forward_canvas_gui_input(const Ref<InputEvent> &p_event);
|
|
|
|
void forward_canvas_draw_over_viewport(Control *p_overlay);
|
|
|
|
void forward_canvas_force_draw_over_viewport(Control *p_overlay);
|
2022-04-15 02:20:27 +02:00
|
|
|
|
|
|
|
PaintEditorPlugin(EditorNode *p_node);
|
|
|
|
~PaintEditorPlugin();
|
|
|
|
|
|
|
|
EditorNode *editor;
|
|
|
|
|
|
|
|
protected:
|
2022-11-16 15:25:27 +01:00
|
|
|
void on_node_removed(Node *node);
|
|
|
|
|
2022-11-15 18:16:32 +01:00
|
|
|
void _notification(int p_what);
|
|
|
|
|
2022-04-15 02:20:27 +02:00
|
|
|
static void _bind_methods();
|
2022-11-15 18:16:32 +01:00
|
|
|
|
2022-11-16 15:25:27 +01:00
|
|
|
PaintNode *_active_node;
|
2022-11-20 21:01:54 +01:00
|
|
|
PaintInspectorPlugin *_inspector_plugin;
|
2022-04-15 02:20:27 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|