All Classes Namespaces Functions Variables Enumerations Properties Pages
pencildef.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 
18 #ifndef PENCILDEF_H
19 #define PENCILDEF_H
20 
21 #ifndef M_PI
22 #define M_PI 3.14159265358979323846
23 #endif
24 
25 #define STRINGIFY(x) #x
26 #define TOSTRING(x) STRINGIFY(x)
27 #define S__GIT_TIMESTAMP TOSTRING(GIT_TIMESTAMP)
28 #define S__GIT_COMMIT_HASH TOSTRING(GIT_CURRENT_SHA1)
29 
30 enum ToolType : int
31 {
32  INVALID_TOOL = -1,
33  PENCIL = 0,
34  ERASER,
35  SELECT,
36  MOVE,
37  HAND,
38  SMUDGE,
39  PEN,
40  POLYLINE,
41  BUCKET,
42  EYEDROPPER,
43  BRUSH,
44  TOOL_TYPE_COUNT
45 };
46 
47 enum ToolPropertyType
48 {
49  WIDTH,
50  FEATHER,
51  PRESSURE,
52  INVISIBILITY,
53  PRESERVEALPHA,
54  BEZIER,
55  USEFEATHER,
56  VECTORMERGE,
57  ANTI_ALIASING,
58  FILL_MODE,
59  STABILIZATION,
60  TOLERANCE,
61  FILLCONTOUR,
62  SHOWSELECTIONINFO,
63  USETOLERANCE,
64  BUCKETFILLEXPAND,
65  USEBUCKETFILLEXPAND,
66  BUCKETFILLLAYERMODE,
67  BUCKETFILLLAYERREFERENCEMODE,
68 };
69 
70 enum BackgroundStyle
71 {
72 
73 };
74 
75 enum StabilizationLevel
76 {
77  NONE,
78  SIMPLE,
79  STRONG
80 };
81 
82 enum TimecodeTextLevel
83 {
84  NOTEXT,
85  FRAMES, // FF
86  SMPTE, // HH:MM:SS:FF
87  SFF // S:FF
88 };
89 
90 enum class LayerVisibility
91 {
92  CURRENTONLY = 0,
93  RELATED = 1,
94  ALL = 2,
95  // If you are adding new enum values here, be sure to update the ++/-- operators below
96 };
97 
98 inline LayerVisibility& operator++(LayerVisibility& vis)
99 {
100  return vis = (vis == LayerVisibility::ALL) ? LayerVisibility::CURRENTONLY : static_cast<LayerVisibility>(static_cast<int>(vis)+1);
101 }
102 
103 inline LayerVisibility& operator--(LayerVisibility& vis)
104 {
105  return vis = (vis == LayerVisibility::CURRENTONLY) ? LayerVisibility::ALL : static_cast<LayerVisibility>(static_cast<int>(vis)-1);
106 }
107 
108 // Max frames that can be imported and loaded onto the timeline
109 const static int MaxFramesBound = 9999;
110 
111 // shortcuts command code
112 #define CMD_NEW_FILE "CmdNewFile"
113 #define CMD_OPEN_FILE "CmdOpenFile"
114 #define CMD_SAVE_FILE "CmdSaveFile"
115 #define CMD_SAVE_AS "CmdSaveAs"
116 #define CMD_IMPORT_IMAGE "CmdImportImage"
117 #define CMD_IMPORT_IMAGE_SEQ "CmdImportImageSequence"
118 #define CMD_IMPORT_MOVIE_VIDEO "CmdImportMovieVideo"
119 #define CMD_IMPORT_MOVIE_AUDIO "CmdImportMovieAudio"
120 #define CMD_IMPORT_PALETTE "CmdImportPalette"
121 #define CMD_IMPORT_SOUND "CmdImportSound"
122 #define CMD_EXPORT_IMAGE_SEQ "CmdExportImageSequence"
123 #define CMD_EXPORT_IMAGE "CmdExportImage"
124 #define CMD_EXPORT_MOVIE "CmdExportMovie"
125 #define CMD_EXPORT_PALETTE "CmdExportPalette"
126 #define CMD_EXPORT_SOUND "CmdExportSound"
127 #define CMD_UNDO "CmdUndo"
128 #define CMD_REDO "CmdRedo"
129 #define CMD_CUT "CmdCut"
130 #define CMD_COPY "CmdCopy"
131 #define CMD_PASTE "CmdPaste"
132 #define CMD_PASTE_FROM_PREVIOUS "CmdPasteFromPrevious"
133 #define CMD_SELECT_ALL "CmdSelectAll"
134 #define CMD_DESELECT_ALL "CmdDeselectAll"
135 #define CMD_CLEAR_FRAME "CmdClearFrame"
136 #define CMD_PREFERENCE "CmdPreferences"
137 #define CMD_RESET_WINDOWS "CmdResetWindows"
138 #define CMD_ZOOM_IN "CmdZoomIn"
139 #define CMD_ZOOM_OUT "CmdZoomOut"
140 #define CMD_ROTATE_CLOCK "CmdRotateClockwise"
141 #define CMD_ROTATE_ANTI_CLOCK "CmdRotateAntiClockwise"
142 #define CMD_RESET_ROTATION "CmdResetRotation"
143 #define CMD_RESET_ZOOM_ROTATE "CmdResetZoomRotate"
144 #define CMD_CENTER_VIEW "CmdCenterView"
145 #define CMD_ZOOM_400 "CmdZoom400"
146 #define CMD_ZOOM_300 "CmdZoom300"
147 #define CMD_ZOOM_200 "CmdZoom200"
148 #define CMD_ZOOM_100 "CmdZoom100"
149 #define CMD_ZOOM_50 "CmdZoom50"
150 #define CMD_ZOOM_33 "CmdZoom33"
151 #define CMD_ZOOM_25 "CmdZoom25"
152 #define CMD_FLIP_HORIZONTAL "CmdFlipHorizontal"
153 #define CMD_FLIP_VERTICAL "CmdFlipVertical"
154 #define CMD_PREVIEW "CmdPreview"
155 #define CMD_GRID "CmdGrid"
156 #define CMD_ONIONSKIN_PREV "CmdOnionSkinPrevious"
157 #define CMD_ONIONSKIN_NEXT "CmdOnionSkinNext"
158 #define CMD_TOGGLE_STATUS_BAR "CmdToggleStatusBar"
159 #define CMD_PLAY "CmdPlay"
160 #define CMD_LOOP "CmdLoop"
161 #define CMD_FLIP_INBETWEEN "CmdFlipInBetween"
162 #define CMD_FLIP_ROLLING "CmdFlipRolling"
163 #define CMD_GOTO_NEXT_FRAME "CmdGotoNextFrame"
164 #define CMD_GOTO_PREV_FRAME "CmdGotoPreviousFrame"
165 #define CMD_GOTO_NEXT_KEY_FRAME "CmdGotoNextKeyFrame"
166 #define CMD_GOTO_PREV_KEY_FRAME "CmdGotoPreviousKeyFrame"
167 #define CMD_ADD_FRAME "CmdAddFrame"
168 #define CMD_DUPLICATE_FRAME "CmdDuplicateFrame"
169 #define CMD_REMOVE_FRAME "CmdRemoveFrame"
170 #define CMD_REVERSE_SELECTED_FRAMES "CmdReverseSelectedFrames"
171 #define CMD_REMOVE_SELECTED_FRAMES "CmdRemoveSelectedFrames"
172 #define CMD_SELECTION_ADD_FRAME_EXPOSURE "CmdSelectionAddFrameExposure"
173 #define CMD_SELECTION_SUBTRACT_FRAME_EXPOSURE "CmdSelectionSubtractFrameExposure"
174 #define CMD_MOVE_FRAME_BACKWARD "CmdMoveFrameBackward"
175 #define CMD_MOVE_FRAME_FORWARD "CmdMoveFrameForward"
176 #define CMD_TOOL_MOVE "CmdToolMove"
177 #define CMD_TOOL_SELECT "CmdToolSelect"
178 #define CMD_TOOL_BRUSH "CmdToolBrush"
179 #define CMD_TOOL_POLYLINE "CmdToolPolyline"
180 #define CMD_TOOL_SMUDGE "CmdToolSmudge"
181 #define CMD_TOOL_PEN "CmdToolPen"
182 #define CMD_TOOL_HAND "CmdToolHand"
183 #define CMD_TOOL_PENCIL "CmdToolPencil"
184 #define CMD_TOOL_BUCKET "CmdToolBucket"
185 #define CMD_TOOL_EYEDROPPER "CmdToolEyedropper"
186 #define CMD_TOOL_ERASER "CmdToolEraser"
187 #define CMD_NEW_BITMAP_LAYER "CmdNewBitmapLayer"
188 #define CMD_NEW_VECTOR_LAYER "CmdNewVectorLayer"
189 #define CMD_NEW_SOUND_LAYER "CmdNewSoundLayer"
190 #define CMD_NEW_CAMERA_LAYER "CmdNewCameraLayer"
191 #define CMD_DELETE_CUR_LAYER "CmdDeleteCurrentLayer"
192 #define CMD_CURRENT_LAYER_VISIBILITY "CmdLayerVisibilityCurrentOnly"
193 #define CMD_RELATIVE_LAYER_VISIBILITY "CmdLayerVisibilityRelative"
194 #define CMD_ALL_LAYER_VISIBILITY "CmdLayerVisibilityAll"
195 #define CMD_HELP "CmdHelp"
196 #define CMD_TOGGLE_TOOLBOX "CmdToggleToolBox"
197 #define CMD_TOGGLE_TOOL_OPTIONS "CmdToggleToolOptions"
198 #define CMD_TOGGLE_COLOR_WHEEL "CmdToggleColorWheel"
199 #define CMD_TOGGLE_COLOR_INSPECTOR "CmdToggleColorInspector"
200 #define CMD_TOGGLE_COLOR_LIBRARY "CmdToggleColorLibrary"
201 #define CMD_TOGGLE_DISPLAY_OPTIONS "CmdToggleDisplayOptions"
202 #define CMD_TOGGLE_ONION_SKIN "CmdToggleOnionSkin"
203 #define CMD_TOGGLE_TIMELINE "CmdToggleTimeline"
204 #define CMD_INCREASE_SIZE "CmdIncreaseSize"
205 #define CMD_DECREASE_SIZE "CmdDecreaseSize"
206 #define CMD_EXIT "CmdExit"
207 
208 // Save / Export
209 #define LAST_PCLX_PATH "LastFilePath"
210 
211 // Import
212 #define IMPORT_REPOSITION_TYPE "ImportRepositionType"
213 
214 // Settings Group/Key Name
215 #define PENCIL2D "Pencil"
216 #define SHORTCUTS_GROUP "Shortcuts"
217 #define SETTING_AUTO_SAVE "AutoSave"
218 #define SETTING_AUTO_SAVE_NUMBER "AutosaveNumber"
219 #define SETTING_TOOL_CURSOR "ToolCursors"
220 #define SETTING_DOTTED_CURSOR "DottedCursors"
221 #define SETTING_HIGH_RESOLUTION "HighResPosition"
222 #define SETTING_BACKGROUND_STYLE "Background"
223 #define SETTING_WINDOW_OPACITY "WindowOpacity"
224 #define SETTING_WINDOW_GEOMETRY "WindowGeometry"
225 #define SETTING_WINDOW_STATE "WindowState"
226 #define SETTING_SHOW_STATUS_BAR "ShowStatusBar"
227 #define SETTING_CURVE_SMOOTHING "CurveSmoothing"
228 #define SETTING_DISPLAY_EFFECT "RenderEffect"
229 #define SETTING_SHORT_SCRUB "ShortScrub"
230 #define SETTING_FPS "Fps"
231 #define SETTING_FIELD_W "FieldW"
232 #define SETTING_FIELD_H "FieldH"
233 #define SETTING_FRAME_SIZE "FrameSize"
234 #define SETTING_TIMELINE_SIZE "TimelineSize"
235 #define SETTING_LABEL_FONT_SIZE "LabelFontSize"
236 #define SETTING_DRAW_LABEL "DrawLabel"
237 #define SETTING_QUICK_SIZING "QuickSizing"
238 #define SETTING_LAYOUT_LOCK "LayoutLock"
239 #define SETTING_ROTATION_INCREMENT "RotationIncrement"
240 #define SETTING_SHOW_SELECTION_INFO "ShowSelectionInfo"
241 #define SETTING_ASK_FOR_PRESET "AskForPreset"
242 #define SETTING_LOAD_MOST_RECENT "LoadMostRecent"
243 #define SETTING_LOAD_DEFAULT_PRESET "LoadDefaultPreset"
244 #define SETTING_DEFAULT_PRESET "DefaultPreset"
245 
246 #define SETTING_ANTIALIAS "Antialiasing"
247 #define SETTING_SHOW_GRID "ShowGrid"
248 #define SETTING_COUNT "Count"
249 #define SETTING_SHADOW "Shadow"
250 #define SETTING_PREV_ONION "PrevOnion"
251 #define SETTING_NEXT_ONION "NextOnion"
252 #define SETTING_MULTILAYER_ONION "MultilayerOnion"
253 #define SETTING_AXIS "Axis"
254 #define SETTING_CAMERABORDER "CameraBorder"
255 #define SETTING_INVISIBLE_LINES "InvisibleLines"
256 #define SETTING_OUTLINES "Outlines"
257 #define SETTING_ONION_BLUE "OnionBlue"
258 #define SETTING_ONION_RED "OnionRed"
259 
260 #define SETTING_FRAME_POOL_SIZE "FramePoolSizeInMB"
261 #define SETTING_GRID_SIZE_W "GridSizeW"
262 #define SETTING_GRID_SIZE_H "GridSizeH"
263 #define SETTING_OVERLAY_CENTER "OverlayCenter"
264 #define SETTING_OVERLAY_THIRDS "OverlayThirds"
265 #define SETTING_OVERLAY_GOLDEN "OverlayGolden"
266 #define SETTING_OVERLAY_SAFE "OverlaySafe"
267 #define SETTING_OVERLAY_PERSPECTIVE1 "OverlayPerspective1"
268 #define SETTING_OVERLAY_PERSPECTIVE2 "OverlayPerspective2"
269 #define SETTING_OVERLAY_PERSPECTIVE3 "OverlayPerspective3"
270 #define SETTING_OVERLAY_ANGLE "OverlayAngle"
271 #define SETTING_TITLE_SAFE_ON "TitleSafeOn"
272 #define SETTING_TITLE_SAFE "TitleSafe"
273 #define SETTING_ACTION_SAFE_ON "ActionSafeOn"
274 #define SETTING_ACTION_SAFE "ActionSafe"
275 #define SETTING_OVERLAY_SAFE_HELPER_TEXT_ON "OverlaySafeHelperTextOn"
276 #define SETTING_TIMECODE_TEXT "TimecodeText"
277 
278 #define SETTING_ONION_MAX_OPACITY "OnionMaxOpacity"
279 #define SETTING_ONION_MIN_OPACITY "OnionMinOpacity"
280 #define SETTING_ONION_PREV_FRAMES_NUM "OnionPrevFramesNum"
281 #define SETTING_ONION_NEXT_FRAMES_NUM "OnionNextFramesNum"
282 #define SETTING_ONION_WHILE_PLAYBACK "OnionWhilePlayback"
283 #define SETTING_ONION_TYPE "OnionType"
284 #define SETTING_FLIP_ROLL_MSEC "FlipRoll"
285 #define SETTING_FLIP_ROLL_DRAWINGS "FlipRollDrawings"
286 #define SETTING_FLIP_INBETWEEN_MSEC "FlipInbetween"
287 #define SETTING_SOUND_SCRUB_ACTIVE "SoundScrubActive"
288 #define SETTING_SOUND_SCRUB_MSEC "SoundScrubMsec"
289 
290 // Ideally this should also BucketTolerance eg.. but for compatibility sake, i'm not changing it now
291 #define SETTING_BUCKET_TOLERANCE "Tolerance"
292 #define SETTING_BUCKET_TOLERANCE_ON "BucketToleranceEnabled"
293 #define SETTING_BUCKET_FILL_EXPAND "BucketFillExpand"
294 #define SETTING_BUCKET_FILL_EXPAND_ON "BucketFillExpandEnabled"
295 #define SETTING_BUCKET_FILL_TO_LAYER_MODE "BucketFillToLayerMode"
296 #define SETTING_BUCKET_FILL_REFERENCE_MODE "BucketFillReferenceMode"
297 
298 #define SETTING_FILL_MODE "FillMode"
299 
300 #define SETTING_LAYER_VISIBILITY "LayerVisibility"
301 #define SETTING_LAYER_VISIBILITY_THRESHOLD "LayerVisibilityThreshold"
302 
303 #define SETTING_DRAW_ON_EMPTY_FRAME_ACTION "DrawOnEmptyFrameAction"
304 
305 #define SETTING_LANGUAGE "Language"
306 
307 #endif // PENCILDEF_H