Pencil2D Animation
Download Community News Docs Contribute
  • Overview
  • Articles
  • Code
  •  
  • Class List
  • Class Index
  • Class Hierarchy
  • Class Members
  • File List
Loading...
Searching...
No Matches
  • core_lib
  • src
  • interface
legacybackupelement.h
1/*
2
3Pencil2D - Traditional Animation Software
4Copyright (C) 2005-2007 Patrick Corrieri & Pascal Naidon
5Copyright (C) 2012-2020 Matthew Chiawen Chang
6
7This program is free software; you can redistribute it and/or
8modify it under the terms of the GNU General Public License
9as published by the Free Software Foundation; version 2 of the License.
10
11This program is distributed in the hope that it will be useful,
12but WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14GNU General Public License for more details.
15
16*/
17
18#ifndef LEGACYBACKUPELEMENT_H
19#define LEGACYBACKUPELEMENT_H
20
21#include <QObject>
22#include "vectorimage.h"
23#include "bitmapimage.h"
24#include "soundclip.h"
25
26class Editor;
27
28class LegacyBackupElement : public QObject
29{
30 Q_OBJECT
31public:
32 enum types { UNDEFINED, BITMAP_MODIF, VECTOR_MODIF, SOUND_MODIF };
33
34 QString undoText;
35 bool somethingSelected = false;
36 qreal rotationAngle = 0.0;
37 qreal scaleX = 1.0;
38 qreal scaleY = 1.0;
39 QPointF translation;
40 QRectF mySelection;
41 QPointF selectionAnchor;
42
43 virtual int type() { return UNDEFINED; }
44 virtual void restore(Editor*) { Q_ASSERT(false); }
45};
46
47class BackupLegacyBitmapElement : public LegacyBackupElement
48{
49 Q_OBJECT
50public:
51 explicit BackupLegacyBitmapElement(BitmapImage* bi) { bitmapImage = *bi; }
52
53 int layerId = 0;
54
55 int layer = 0;
56 int frame = 0;
57 BitmapImage bitmapImage;
58 int type() override { return LegacyBackupElement::BITMAP_MODIF; }
59 void restore(Editor*) override;
60};
61
62class BackupLegacyVectorElement : public LegacyBackupElement
63{
64 Q_OBJECT
65public:
66 explicit BackupLegacyVectorElement(VectorImage* vi) { vectorImage = *vi; }
67 int layerId = 0;
68
69 int layer = 0;
70 int frame = 0;
71 VectorImage vectorImage;
72
73 int type() override { return LegacyBackupElement::VECTOR_MODIF; }
74 void restore(Editor*) override;
75};
76
77class BackupLegacySoundElement : public LegacyBackupElement
78{
79 Q_OBJECT
80public:
81 explicit BackupLegacySoundElement(SoundClip* sound) { clip = *sound; }
82 int layerId = 0;
83
84 int layer = 0;
85 int frame = 0;
86 SoundClip clip;
87 QString fileName, originalName;
88
89 int type() override { return LegacyBackupElement::SOUND_MODIF; }
90 void restore( Editor* ) override;
91};
92
93#endif // LEGACYBACKUPELEMENT_H
BackupLegacyBitmapElement
Definition: legacybackupelement.h:48
BackupLegacySoundElement
Definition: legacybackupelement.h:78
BackupLegacyVectorElement
Definition: legacybackupelement.h:63
BitmapImage
Definition: bitmapimage.h:28
Editor
Definition: editor.h:71
LegacyBackupElement
Definition: legacybackupelement.h:29
SoundClip
Definition: soundclip.h:27
VectorImage
Definition: vectorimage.h:32
QObject
QObject::Q_OBJECT
Q_OBJECTQ_OBJECT
QPointF
QRectF
QString
Generated on Thu May 8 2025 04:47:53 for Pencil2D by doxygen 1.9.6 based on revision 4513250b1d5b1a3676ec0e67b06b7a885ceaae39