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 <QString>
21 
22 //Pencil2D File Format
23 //PFF - acronym for "Pencil2D File Format"
24 #define PFF_OLD_EXTENSION ".pcl"
25 #define PFF_OLD_BIG_LETTER_EXTENSION "PCL"
26 #define PFF_EXTENSION ".pclx"
27 #define PFF_BIG_LETTER_EXTENSION "PCLX"
28 
29 #define PFF_OPEN_PROJECT_EXT_FILTER \
30  QObject::tr("Pencil2D formats") + " (*.pclx *.pcl);;" + QObject::tr("Pencil2D Project") + " (*.pclx);;" + QObject::tr("Legacy Pencil2D Project") + " (*.pcl)"
31 
32 #define PFF_SAVE_PROJECT_EXT_FILTER \
33  QObject::tr("Pencil2D Project") + " (*.pclx);;" + QObject::tr("Legacy Pencil2D Project") + " (*.pcl)"
34 
35 #define PFF_MOVIE_EXT \
36  QObject::tr("Movie formats") + "*.avi *.mpg *.mpeg *.mov *.mp4 *.mkv *.ogv *.swf *.flv *.webm *.wmv);;" \
37  "AVI(*.avi);;MPEG(*.mpg *.mpeg);;MOV(*.mov);;MP4(*.mp4);;MKV(*.mkv);;OGV(*.ogv)" \
38  ";;SWF(*.swf);;FLV(*.flv);;WEBM(*.webm);;WMV(*.wmv)"
39 
40 #define PFF_IMAGE_FILTER \
41  QObject::tr( "Image formats") + " (*.png *.jpg *.jpeg *.bmp *.tif *.tiff);;PNG (*.png);;JPG(*.jpg *.jpeg);;BMP(*.bmp);;TIFF(*.tif *.tiff)"
42 
43 #define PFF_IMAGE_SEQ_FILTER \
44  QObject::tr( "Image formats") + " (*.png *.jpg *.jpeg *.bmp *.tif *.tiff);;PNG (*.png);;JPG(*.jpg *.jpeg);;BMP(*.bmp);;TIFF(*.tif *.tiff)"
45 
46 #define PFF_PALETTE_EXT_FILTER \
47  QObject::tr("Palette formats") + " (*.xml *.gpl);;" + QObject::tr("Pencil2D Palette") + " (*.xml);;" + QObject::tr("GIMP Palette") + " (*.gpl)"
48 
49 #define PFF_GIF_EXT_FILTER \
50  QObject::tr("Animated GIF") + " (*.gif)"
51 
52 #define PFF_SOUND_EXT_FILTER \
53  QObject::tr("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)"
54 
55 
56 #define PFF_DEFAULT_PROJECT_EXT \
57  QString(".pclx")
58 
59 #define PFF_DEFAULT_IMAGE_EXT \
60  QString(".png")
61 
62 #define PFF_DEFAULT_IMAGE_SEQ_EXT \
63  QString(".png")
64 
65 #define PFF_DEFAULT_ANIMATED_EXT \
66  QString(".gif")
67 
68 #define PFF_DEFAULT_PALETTE_EXT \
69  QString(".xml")
70 
71 #define PFF_OLD_DATA_DIR "data"
72 #define PFF_DATA_DIR "data"
73 #define PFF_XML_FILE_NAME "main.xml"
74 #define PFF_TMP_DECOMPRESS_EXT "Y2xD"
75 #define PFF_PALETTE_FILE "palette.xml"
76 
77 bool removePFFTmpDirectory(const QString& dirName);
78 QString uniqueString(int len);
79 QString retrieveProjectNameFromTempPath(const QString& path);
80 
81 QString detectFormatByFileNameExtension(const QString& fileName);
82 bool isMovieFormat(const QString& format);
83 
84 #endif // FILEFORMAT_H