All Classes Namespaces Functions Variables Enumerations Properties Pages
fileformat.h
1 /*
2 
3 Pencil2D - Traditional Animation Software
4 Copyright (C) 2005-2007 Patrick Corrieri & Pascal Naidon
5 Copyright (C) 2012-2020 Matthew Chiawen Chang
6 
7 This program is free software; you can redistribute it and/or
8 modify it under the terms of the GNU General Public License
9 as published by the Free Software Foundation; version 2 of the License.
10 
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15 
16 */
17 #ifndef FILEFORMAT_H
18 #define FILEFORMAT_H
19 
20 #include <QCoreApplication>
21 #include <QString>
22 
23 //Pencil2D File Format
24 //PFF - acronym for "Pencil2D File Format"
25 #define PFF_OLD_EXTENSION ".pcl"
26 #define PFF_OLD_BIG_LETTER_EXTENSION "PCL"
27 #define PFF_EXTENSION ".pclx"
28 #define PFF_BIG_LETTER_EXTENSION "PCLX"
29 #define PFF_BACKUP_IDENTIFIER "backup"
30 
31 #define PFF_OPEN_PROJECT_EXT_FILTER \
32  QCoreApplication::translate("FileFormat", "Pencil2D formats") + " (*.pclx *.pcl);;" + QCoreApplication::translate("FileFormat", "Pencil2D Project") + " (*.pclx);;" + QCoreApplication::translate("FileFormat", "Legacy Pencil2D Project") + " (*.pcl)"
33 
34 #define PFF_SAVE_PROJECT_EXT_FILTER \
35  QCoreApplication::translate("FileFormat", "Pencil2D Project") + " (*.pclx);;" + QCoreApplication::translate("FileFormat", "Legacy Pencil2D Project") + " (*.pcl)"
36 
37 #define PFF_MOVIE_EXT \
38  QCoreApplication::translate("FileFormat", "Movie formats") + "(*.avi *.mpg *.mpeg *.mov *.mp4 *.mkv *.ogv *.swf *.flv *.webm *.wmv);;" \
39  "AVI(*.avi);;MPEG(*.mpg *.mpeg);;MOV(*.mov);;MP4(*.mp4);;MKV(*.mkv);;OGV(*.ogv)" \
40  ";;SWF(*.swf);;FLV(*.flv);;WEBM(*.webm);;WMV(*.wmv)"
41 
42 #define PFF_IMAGE_FILTER \
43  QCoreApplication::translate("FileFormat", "Image formats") + " (*.png *.jpg *.jpeg *.bmp *.tif *.tiff);;PNG (*.png);;JPG(*.jpg *.jpeg);;BMP(*.bmp);;TIFF(*.tif *.tiff)"
44 
45 #define PFF_IMAGE_SEQ_FILTER \
46  QCoreApplication::translate("FileFormat", "Image formats") + " (*.png *.jpg *.jpeg *.bmp *.tif *.tiff);;PNG (*.png);;JPG(*.jpg *.jpeg);;BMP(*.bmp);;TIFF(*.tif *.tiff)"
47 
48 #define PFF_PALETTE_EXT_FILTER \
49  QCoreApplication::translate("FileFormat", "Palette formats") + " (*.xml *.gpl);;" + QCoreApplication::translate("FileFormat", "Pencil2D Palette") + " (*.xml);;" + QCoreApplication::translate("FileFormat", "GIMP Palette") + " (*.gpl)"
50 
51 #define PFF_GIF_EXT_FILTER \
52  QCoreApplication::translate("FileFormat", "Animated GIF") + " (*.gif)"
53 
54 #define PFF_SOUND_EXT_FILTER \
55  QCoreApplication::translate("FileFormat", "Sound formats") + " (*.wav *.mp3 *.wma *.ogg *.flac *.opus *.aiff *.aac *.caf);;WAV (*.wav);;MP3 (*.mp3);;WMA (*.wma);;OGG (*.ogg);;FLAC (*.flac);;Opus (*.opus);;AIFF (*.aiff);;AAC (*.aac);;CAF (*.caf)"
56 
57 
58 #define PFF_DEFAULT_PROJECT_EXT \
59  QString(".pclx")
60 
61 #define PFF_DEFAULT_IMAGE_EXT \
62  QString(".png")
63 
64 #define PFF_DEFAULT_IMAGE_SEQ_EXT \
65  QString(".png")
66 
67 #define PFF_DEFAULT_ANIMATED_EXT \
68  QString(".gif")
69 
70 #define PFF_DEFAULT_PALETTE_EXT \
71  QString(".xml")
72 
73 #define PFF_OLD_DATA_DIR "data"
74 #define PFF_DATA_DIR "data"
75 #define PFF_XML_FILE_NAME "main.xml"
76 #define PFF_TMP_DECOMPRESS_EXT "Y2xD"
77 #define PFF_PALETTE_FILE "palette.xml"
78 
79 bool removePFFTmpDirectory(const QString& dirName);
80 QString retrieveProjectNameFromTempPath(const QString& path);
81 
82 QString detectFormatByFileNameExtension(const QString& fileName);
83 bool isMovieFormat(const QString& format);
84 
85 #endif // FILEFORMAT_H