editor_factory.cpp 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /* editor_factory.cpp - value editors factory instances
  2. * Copyright (C) 2017-2018 caryoscelus
  3. *
  4. * This program is free software: you can redistribute it and/or modify
  5. * it under the terms of the GNU General Public License as published by
  6. * the Free Software Foundation, either version 3 of the License, or
  7. * (at your option) any later version.
  8. *
  9. * This program is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  12. * GNU General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU General Public License
  15. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  16. */
  17. #include <QPushButton>
  18. #include <core/util/class_init.h>
  19. #include <core/color/color.h>
  20. #include <geom_helpers/knots.h>
  21. #include <geom_helpers/rectangle.h>
  22. #include <generic/custom_widgets.h>
  23. #include <generic/node_editor_widget.h>
  24. #include "color_button.h"
  25. #include "point_value_editor.h"
  26. #include <canvas/editors/bezier_editor.h>
  27. #include <widgets/canvas.h>
  28. namespace rainynite::studio {
  29. using ColorEditWidget = NodeEditorWidget<ColorButton, core::colors::Color>;
  30. REGISTER_CUSTOM_WIDGET(ColorEdit, core::colors::Color, ColorEditWidget);
  31. using PointValueEditWidget = NodeEditorWidget<PointValueEditor, Geom::Point>;
  32. REGISTER_CUSTOM_WIDGET(PointValueEdit, Geom::Point, PointValueEditWidget);
  33. REGISTER_CANVAS_EDITOR(Canvas, BezierEditor, Geom::BezierKnots);
  34. REGISTER_NODE_EDITOR_SHOW_CHILDREN(RectangleAB, true);
  35. REGISTER_NODE_EDITOR_SHOW_CHILDREN(CirclePR, true);
  36. REGISTER_NODE_EDITOR_SHOW_CHILDREN(RenderShape, true);
  37. REGISTER_NODE_EDITOR_SHOW_CHILDREN(PathXY, true);
  38. REGISTER_NODE_EDITOR_SHOW_CHILDREN(Translate, true);
  39. REGISTER_NODE_EDITOR_SHOW_CHILDREN(Rotate, true);
  40. REGISTER_NODE_EDITOR_SHOW_CHILDREN(Scale, true);
  41. REGISTER_NODE_EDITOR_SHOW_CHILDREN(BoneP, true);
  42. REGISTER_TEMPLATE_NODE_EDITOR_SHOW_CHILDREN(Frame, "Frame", true)
  43. REGISTER_TEMPLATE_NODE_EDITOR_SHOW_CHILDREN(List, "List", true)
  44. REGISTER_TEMPLATE_NODE_EDITOR_SHOW_CHILDREN(ListFrame, "List/Frame", true)
  45. REGISTER_TEMPLATE_NODE_EDITOR_SHOW_CHILDREN(Interpolate, "Interpolate", true)
  46. } // namespace rainynite::studio