| 
									
										
										
										
											2015-02-12 23:16:25 +08:00
										 |  |  | // Aseprite
 | 
					
						
							| 
									
										
										
										
											2021-04-08 05:11:30 +08:00
										 |  |  | // Copyright (C) 2018-2021  Igara Studio S.A.
 | 
					
						
							| 
									
										
										
										
											2018-03-16 03:05:56 +08:00
										 |  |  | // Copyright (C) 2001-2018  David Capello
 | 
					
						
							| 
									
										
										
										
											2015-02-12 23:16:25 +08:00
										 |  |  | //
 | 
					
						
							| 
									
										
										
										
											2016-08-27 04:02:58 +08:00
										 |  |  | // This program is distributed under the terms of
 | 
					
						
							|  |  |  | // the End-User License Agreement for Aseprite.
 | 
					
						
							| 
									
										
										
										
											2013-11-11 05:27:11 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-03-30 07:46:56 +08:00
										 |  |  | #ifndef APP_UI_TIMELINE_TIMELINE_H_INCLUDED
 | 
					
						
							|  |  |  | #define APP_UI_TIMELINE_TIMELINE_H_INCLUDED
 | 
					
						
							| 
									
										
										
										
											2014-03-30 06:40:17 +08:00
										 |  |  | #pragma once
 | 
					
						
							| 
									
										
										
										
											2013-11-11 05:27:11 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-07-07 13:47:42 +08:00
										 |  |  | #include "app/doc_observer.h"
 | 
					
						
							| 
									
										
										
										
											2018-07-07 21:07:21 +08:00
										 |  |  | #include "app/doc_range.h"
 | 
					
						
							| 
									
										
										
										
											2020-12-30 21:25:37 +08:00
										 |  |  | #include "app/docs_observer.h"
 | 
					
						
							| 
									
										
										
										
											2017-03-30 08:18:29 +08:00
										 |  |  | #include "app/loop_tag.h"
 | 
					
						
							| 
									
										
										
										
											2015-02-15 20:48:38 +08:00
										 |  |  | #include "app/pref/preferences.h"
 | 
					
						
							| 
									
										
										
										
											2013-11-11 09:59:25 +08:00
										 |  |  | #include "app/ui/editor/editor_observer.h"
 | 
					
						
							| 
									
										
										
										
											2015-05-10 06:55:33 +08:00
										 |  |  | #include "app/ui/input_chain_element.h"
 | 
					
						
							| 
									
										
										
										
											2017-03-30 07:46:56 +08:00
										 |  |  | #include "app/ui/timeline/ani_controls.h"
 | 
					
						
							| 
									
										
										
										
											2021-04-08 05:11:30 +08:00
										 |  |  | #include "app/ui/timeline/timeline_observer.h"
 | 
					
						
							| 
									
										
										
										
											2020-12-30 21:25:37 +08:00
										 |  |  | #include "base/debug.h"
 | 
					
						
							| 
									
										
										
										
											2014-12-29 07:39:11 +08:00
										 |  |  | #include "doc/frame.h"
 | 
					
						
							| 
									
										
										
										
											2018-07-07 13:47:42 +08:00
										 |  |  | #include "doc/layer.h"
 | 
					
						
							| 
									
										
										
										
											2016-06-14 04:24:41 +08:00
										 |  |  | #include "doc/selected_frames.h"
 | 
					
						
							| 
									
										
										
										
											2016-06-14 01:50:43 +08:00
										 |  |  | #include "doc/selected_layers.h"
 | 
					
						
							| 
									
										
										
										
											2014-10-21 09:21:31 +08:00
										 |  |  | #include "doc/sprite.h"
 | 
					
						
							| 
									
										
										
										
											2020-12-30 21:25:37 +08:00
										 |  |  | #include "doc/tag.h"
 | 
					
						
							|  |  |  | #include "gfx/color.h"
 | 
					
						
							| 
									
										
										
										
											2016-09-14 02:02:00 +08:00
										 |  |  | #include "obs/connection.h"
 | 
					
						
							| 
									
										
										
										
											2021-04-08 05:11:30 +08:00
										 |  |  | #include "obs/observable.h"
 | 
					
						
							| 
									
										
										
										
											2015-09-18 02:19:47 +08:00
										 |  |  | #include "ui/scroll_bar.h"
 | 
					
						
							| 
									
										
										
										
											2014-08-08 21:33:45 +08:00
										 |  |  | #include "ui/timer.h"
 | 
					
						
							| 
									
										
										
										
											2013-11-11 05:27:11 +08:00
										 |  |  | #include "ui/widget.h"
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-05-29 02:08:17 +08:00
										 |  |  | #include <memory>
 | 
					
						
							| 
									
										
										
										
											2013-11-11 05:27:11 +08:00
										 |  |  | #include <vector>
 | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-10-21 09:21:31 +08:00
										 |  |  | namespace doc { | 
					
						
							| 
									
										
										
										
											2013-11-11 05:27:11 +08:00
										 |  |  |   class Cel; | 
					
						
							|  |  |  |   class Layer; | 
					
						
							| 
									
										
										
										
											2014-04-10 08:56:06 +08:00
										 |  |  |   class LayerImage; | 
					
						
							| 
									
										
										
										
											2013-11-11 05:27:11 +08:00
										 |  |  |   class Sprite; | 
					
						
							|  |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-12-11 11:34:16 +08:00
										 |  |  | namespace ui { | 
					
						
							|  |  |  |   class Graphics; | 
					
						
							| 
									
										
										
										
											2018-12-14 01:08:56 +08:00
										 |  |  |   class TooltipManager; | 
					
						
							| 
									
										
										
										
											2013-12-11 11:34:16 +08:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-11-11 05:27:11 +08:00
										 |  |  | namespace app { | 
					
						
							| 
									
										
										
										
											2015-02-17 22:43:25 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  |   namespace skin { | 
					
						
							|  |  |  |     class SkinTheme; | 
					
						
							|  |  |  |   } | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-10-21 09:21:31 +08:00
										 |  |  |   using namespace doc; | 
					
						
							| 
									
										
										
										
											2013-11-11 05:27:11 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-08-14 04:25:39 +08:00
										 |  |  |   class CommandExecutionEvent; | 
					
						
							| 
									
										
										
										
											2014-05-18 08:27:44 +08:00
										 |  |  |   class ConfigureTimelinePopup; | 
					
						
							| 
									
										
										
										
											2013-11-11 05:27:11 +08:00
										 |  |  |   class Context; | 
					
						
							| 
									
										
										
										
											2018-07-07 22:54:44 +08:00
										 |  |  |   class Doc; | 
					
						
							| 
									
										
										
										
											2013-11-11 05:27:11 +08:00
										 |  |  |   class Editor; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-07-07 13:47:42 +08:00
										 |  |  |   class Timeline : public ui::Widget, | 
					
						
							|  |  |  |                    public ui::ScrollableViewDelegate, | 
					
						
							| 
									
										
										
										
											2021-04-08 05:11:30 +08:00
										 |  |  |                    public obs::observable<TimelineObserver>, | 
					
						
							| 
									
										
										
										
											2018-07-07 13:47:42 +08:00
										 |  |  |                    public ContextObserver, | 
					
						
							| 
									
										
										
										
											2018-07-07 19:38:04 +08:00
										 |  |  |                    public DocsObserver, | 
					
						
							| 
									
										
										
										
											2018-07-07 13:47:42 +08:00
										 |  |  |                    public DocObserver, | 
					
						
							|  |  |  |                    public EditorObserver, | 
					
						
							|  |  |  |                    public InputChainElement, | 
					
						
							| 
									
										
										
										
											2019-10-02 01:55:08 +08:00
										 |  |  |                    public TagProvider { | 
					
						
							| 
									
										
										
										
											2013-11-11 05:27:11 +08:00
										 |  |  |   public: | 
					
						
							| 
									
										
										
										
											2018-07-07 21:07:21 +08:00
										 |  |  |     typedef DocRange Range; | 
					
						
							| 
									
										
										
										
											2014-08-08 07:19:31 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-11-11 05:27:11 +08:00
										 |  |  |     enum State { | 
					
						
							|  |  |  |       STATE_STANDBY, | 
					
						
							|  |  |  |       STATE_SCROLLING, | 
					
						
							| 
									
										
										
										
											2013-12-15 20:42:05 +08:00
										 |  |  |       STATE_SELECTING_LAYERS, | 
					
						
							|  |  |  |       STATE_SELECTING_FRAMES, | 
					
						
							|  |  |  |       STATE_SELECTING_CELS, | 
					
						
							| 
									
										
										
										
											2013-11-11 05:27:11 +08:00
										 |  |  |       STATE_MOVING_SEPARATOR, | 
					
						
							| 
									
										
										
										
											2014-04-10 08:56:06 +08:00
										 |  |  |       STATE_MOVING_RANGE, | 
					
						
							| 
									
										
										
										
											2013-12-18 11:01:55 +08:00
										 |  |  |       STATE_MOVING_ONIONSKIN_RANGE_LEFT, | 
					
						
							| 
									
										
										
										
											2017-11-29 08:16:37 +08:00
										 |  |  |       STATE_MOVING_ONIONSKIN_RANGE_RIGHT, | 
					
						
							| 
									
										
										
										
											2020-12-30 21:25:37 +08:00
										 |  |  |       STATE_MOVING_TAG, | 
					
						
							|  |  |  |       STATE_RESIZING_TAG_LEFT, | 
					
						
							|  |  |  |       STATE_RESIZING_TAG_RIGHT, | 
					
						
							| 
									
										
										
										
											2017-11-29 08:16:37 +08:00
										 |  |  |       // Changing layers flags states
 | 
					
						
							|  |  |  |       STATE_SHOWING_LAYERS, | 
					
						
							|  |  |  |       STATE_HIDING_LAYERS, | 
					
						
							|  |  |  |       STATE_LOCKING_LAYERS, | 
					
						
							|  |  |  |       STATE_UNLOCKING_LAYERS, | 
					
						
							|  |  |  |       STATE_ENABLING_CONTINUOUS_LAYERS, | 
					
						
							|  |  |  |       STATE_DISABLING_CONTINUOUS_LAYERS, | 
					
						
							|  |  |  |       STATE_EXPANDING_LAYERS, | 
					
						
							|  |  |  |       STATE_COLLAPSING_LAYERS, | 
					
						
							| 
									
										
										
										
											2013-11-11 05:27:11 +08:00
										 |  |  |     }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-04-10 08:56:06 +08:00
										 |  |  |     enum DropOp { kMove, kCopy }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-12-14 01:08:56 +08:00
										 |  |  |     Timeline(ui::TooltipManager* tooltipManager); | 
					
						
							| 
									
										
										
										
											2013-11-11 05:27:11 +08:00
										 |  |  |     ~Timeline(); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     void updateUsingEditor(Editor* editor); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-07-30 12:28:15 +08:00
										 |  |  |     Sprite* sprite() { return m_sprite; } | 
					
						
							| 
									
										
										
										
											2013-11-11 05:27:11 +08:00
										 |  |  |     Layer* getLayer() { return m_layer; } | 
					
						
							| 
									
										
										
										
											2014-12-29 07:39:11 +08:00
										 |  |  |     frame_t getFrame() { return m_frame; } | 
					
						
							| 
									
										
										
										
											2013-11-11 05:27:11 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  |     State getState() const { return m_state; } | 
					
						
							|  |  |  |     bool isMovingCel() const; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-12-16 07:21:31 +08:00
										 |  |  |     Range range() const { return m_range; } | 
					
						
							| 
									
										
										
										
											2016-08-25 23:31:00 +08:00
										 |  |  |     const SelectedLayers& selectedLayers() const { return m_range.selectedLayers(); } | 
					
						
							|  |  |  |     const SelectedFrames& selectedFrames() const { return m_range.selectedFrames(); } | 
					
						
							| 
									
										
										
										
											2013-12-16 07:21:31 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-08-05 20:40:11 +08:00
										 |  |  |     void prepareToMoveRange(); | 
					
						
							| 
									
										
										
										
											2018-06-09 01:40:02 +08:00
										 |  |  |     void moveRange(const Range& range); | 
					
						
							|  |  |  |     void setRange(const Range& range); | 
					
						
							| 
									
										
										
										
											2015-08-05 20:40:11 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-08-08 21:33:45 +08:00
										 |  |  |     void activateClipboardRange(); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-04-10 08:56:06 +08:00
										 |  |  |     // Drag-and-drop operations. These actions are used by commands
 | 
					
						
							|  |  |  |     // called from popup menus.
 | 
					
						
							|  |  |  |     void dropRange(DropOp op); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-10-02 01:55:08 +08:00
										 |  |  |     // TagProvider impl
 | 
					
						
							| 
									
										
										
										
											2017-03-30 08:18:29 +08:00
										 |  |  |     // Returns the active frame tag depending on the timeline status
 | 
					
						
							|  |  |  |     // E.g. if other frame tags are collapsed, the focused band has
 | 
					
						
							|  |  |  |     // priority and tags in other bands are ignored.
 | 
					
						
							| 
									
										
										
										
											2019-10-02 01:55:08 +08:00
										 |  |  |     Tag* getTagByFrame(const frame_t frame, | 
					
						
							|  |  |  |                        const bool getLoopTagIfNone) override; | 
					
						
							| 
									
										
										
										
											2017-03-30 08:18:29 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-09-18 02:19:47 +08:00
										 |  |  |     // ScrollableViewDelegate impl
 | 
					
						
							| 
									
										
										
											
												Refactor several "getNoun()" getters to "noun()"
This is a work-in-progress to create a consistent API and finally
separate the whole Aseprite base/gfx/ui libs into a reusable C++ library.
Classes:
app::IFileItem, app::AppMenuItem, app::skin::SkinPart,
gfx::Rect, gfx::Border, she::FileDialog,
ui::IButtonIcon, ui::Graphics, ui::Overlay, ui::Widget,
ui::ScrollableViewDelegate, and UI events
											
										 
											2015-12-05 01:39:04 +08:00
										 |  |  |     gfx::Size visibleSize() const override; | 
					
						
							|  |  |  |     gfx::Point viewScroll() const override; | 
					
						
							| 
									
										
										
										
											2015-09-18 02:19:47 +08:00
										 |  |  |     void setViewScroll(const gfx::Point& pt) override; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-12-02 04:14:18 +08:00
										 |  |  |     void lockRange(); | 
					
						
							|  |  |  |     void unlockRange(); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2019-09-06 02:03:13 +08:00
										 |  |  |     void clearAndInvalidateRange(); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-11-11 05:27:11 +08:00
										 |  |  |   protected: | 
					
						
							| 
									
										
										
										
											2014-08-15 10:07:47 +08:00
										 |  |  |     bool onProcessMessage(ui::Message* msg) override; | 
					
						
							| 
									
										
										
										
											2017-08-15 21:39:06 +08:00
										 |  |  |     void onInitTheme(ui::InitThemeEvent& ev) override; | 
					
						
							| 
									
										
										
										
											2017-07-19 04:07:35 +08:00
										 |  |  |     void onInvalidateRegion(const gfx::Region& region) override; | 
					
						
							| 
									
										
										
										
											2015-12-04 08:50:05 +08:00
										 |  |  |     void onSizeHint(ui::SizeHintEvent& ev) override; | 
					
						
							| 
									
										
										
										
											2015-04-07 21:48:04 +08:00
										 |  |  |     void onResize(ui::ResizeEvent& ev) override; | 
					
						
							| 
									
										
										
										
											2014-08-15 10:07:47 +08:00
										 |  |  |     void onPaint(ui::PaintEvent& ev) override; | 
					
						
							| 
									
										
										
										
											2013-11-11 05:27:11 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-07-07 08:06:03 +08:00
										 |  |  |     // DocObserver impl.
 | 
					
						
							|  |  |  |     void onGeneralUpdate(DocEvent& ev) override; | 
					
						
							| 
									
										
										
										
											2018-07-07 13:47:42 +08:00
										 |  |  |     void onAddLayer(DocEvent& ev) override; | 
					
						
							| 
									
										
										
										
											2019-04-14 03:25:21 +08:00
										 |  |  |     void onBeforeRemoveLayer(DocEvent& ev) override; | 
					
						
							| 
									
										
										
										
											2019-04-24 21:17:12 +08:00
										 |  |  |     void onAfterRemoveLayer(DocEvent& ev) override; | 
					
						
							| 
									
										
										
										
											2018-07-07 13:47:42 +08:00
										 |  |  |     void onAddFrame(DocEvent& ev) override; | 
					
						
							|  |  |  |     void onRemoveFrame(DocEvent& ev) override; | 
					
						
							|  |  |  |     void onLayerNameChange(DocEvent& ev) override; | 
					
						
							| 
									
										
										
										
											2019-10-02 01:55:08 +08:00
										 |  |  |     void onAddTag(DocEvent& ev) override; | 
					
						
							|  |  |  |     void onRemoveTag(DocEvent& ev) override; | 
					
						
							| 
									
										
										
										
											2013-11-11 05:27:11 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-07-29 11:53:24 +08:00
										 |  |  |     // app::Context slots.
 | 
					
						
							| 
									
										
										
										
											2015-08-14 04:25:39 +08:00
										 |  |  |     void onAfterCommandExecution(CommandExecutionEvent& ev); | 
					
						
							| 
									
										
										
										
											2014-07-29 11:53:24 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-07-29 03:44:21 +08:00
										 |  |  |     // ContextObserver impl
 | 
					
						
							| 
									
										
										
										
											2018-07-07 13:47:42 +08:00
										 |  |  |     void onActiveSiteChange(const Site& site) override; | 
					
						
							| 
									
										
										
										
											2017-07-29 03:44:21 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2018-07-07 19:38:04 +08:00
										 |  |  |     // DocsObserver impl.
 | 
					
						
							| 
									
										
										
										
											2018-07-07 22:54:44 +08:00
										 |  |  |     void onRemoveDocument(Doc* document) override; | 
					
						
							| 
									
										
										
										
											2013-11-11 07:29:51 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-11-11 09:59:25 +08:00
										 |  |  |     // EditorObserver impl.
 | 
					
						
							| 
									
										
										
										
											2015-04-07 21:48:04 +08:00
										 |  |  |     void onStateChanged(Editor* editor) override; | 
					
						
							| 
									
										
										
										
											2014-08-28 20:36:34 +08:00
										 |  |  |     void onAfterFrameChanged(Editor* editor) override; | 
					
						
							|  |  |  |     void onAfterLayerChanged(Editor* editor) override; | 
					
						
							| 
									
										
										
										
											2015-04-01 04:31:45 +08:00
										 |  |  |     void onDestroyEditor(Editor* editor) override; | 
					
						
							| 
									
										
										
										
											2013-11-11 09:59:25 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-05-10 06:55:33 +08:00
										 |  |  |     // InputChainElement impl
 | 
					
						
							| 
									
										
										
										
											2018-06-06 00:11:29 +08:00
										 |  |  |     void onNewInputPriority(InputChainElement* element, | 
					
						
							|  |  |  |                             const ui::Message* msg) override; | 
					
						
							| 
									
										
										
										
											2015-05-10 06:55:33 +08:00
										 |  |  |     bool onCanCut(Context* ctx) override; | 
					
						
							|  |  |  |     bool onCanCopy(Context* ctx) override; | 
					
						
							|  |  |  |     bool onCanPaste(Context* ctx) override; | 
					
						
							|  |  |  |     bool onCanClear(Context* ctx) override; | 
					
						
							|  |  |  |     bool onCut(Context* ctx) override; | 
					
						
							|  |  |  |     bool onCopy(Context* ctx) override; | 
					
						
							|  |  |  |     bool onPaste(Context* ctx) override; | 
					
						
							|  |  |  |     bool onClear(Context* ctx) override; | 
					
						
							|  |  |  |     void onCancel(Context* ctx) override; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-11-11 05:27:11 +08:00
										 |  |  |   private: | 
					
						
							| 
									
										
										
										
											2015-09-15 21:57:43 +08:00
										 |  |  |     struct DrawCelData; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-03-10 03:41:03 +08:00
										 |  |  |     struct Hit { | 
					
						
							|  |  |  |       int part; | 
					
						
							| 
									
										
										
										
											2016-08-25 23:31:00 +08:00
										 |  |  |       layer_t layer; | 
					
						
							| 
									
										
										
										
											2015-03-10 03:41:03 +08:00
										 |  |  |       frame_t frame; | 
					
						
							| 
									
										
										
										
											2019-10-02 01:55:08 +08:00
										 |  |  |       ObjectId tag; | 
					
						
							| 
									
										
										
										
											2016-08-27 05:18:25 +08:00
										 |  |  |       bool veryBottom; | 
					
						
							| 
									
										
										
										
											2017-03-30 07:36:41 +08:00
										 |  |  |       int band; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |       Hit(int part = 0, | 
					
						
							|  |  |  |           layer_t layer = -1, | 
					
						
							|  |  |  |           frame_t frame = 0, | 
					
						
							| 
									
										
										
										
											2019-10-02 01:55:08 +08:00
										 |  |  |           ObjectId tag = NullId, | 
					
						
							| 
									
										
										
										
											2017-04-13 02:53:54 +08:00
										 |  |  |           int band = -1); | 
					
						
							|  |  |  |       bool operator!=(const Hit& other) const; | 
					
						
							| 
									
										
										
										
											2019-10-02 01:55:08 +08:00
										 |  |  |       Tag* getTag() const; | 
					
						
							| 
									
										
										
										
											2015-03-10 03:41:03 +08:00
										 |  |  |     }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-07-22 09:59:45 +08:00
										 |  |  |     struct DropTarget { | 
					
						
							| 
									
										
										
										
											2016-08-27 05:18:25 +08:00
										 |  |  |       enum HHit { | 
					
						
							|  |  |  |         HNone, | 
					
						
							|  |  |  |         Before, | 
					
						
							|  |  |  |         After | 
					
						
							|  |  |  |       }; | 
					
						
							|  |  |  |       enum VHit { | 
					
						
							|  |  |  |         VNone, | 
					
						
							|  |  |  |         Bottom, | 
					
						
							|  |  |  |         Top, | 
					
						
							|  |  |  |         FirstChild, | 
					
						
							|  |  |  |         VeryBottom | 
					
						
							|  |  |  |       }; | 
					
						
							| 
									
										
										
										
											2017-04-13 02:53:54 +08:00
										 |  |  |       DropTarget(); | 
					
						
							| 
									
										
										
										
											2018-06-13 04:11:10 +08:00
										 |  |  |       DropTarget(const DropTarget& o); | 
					
						
							|  |  |  |       bool operator!=(const DropTarget& o) const { | 
					
						
							|  |  |  |         return (hhit != o.hhit || | 
					
						
							|  |  |  |                 vhit != o.vhit || | 
					
						
							|  |  |  |                 outside != o.outside); | 
					
						
							|  |  |  |       } | 
					
						
							| 
									
										
										
										
											2014-07-22 09:59:45 +08:00
										 |  |  |       HHit hhit; | 
					
						
							|  |  |  |       VHit vhit; | 
					
						
							| 
									
										
										
										
											2018-06-13 04:11:10 +08:00
										 |  |  |       bool outside; | 
					
						
							| 
									
										
										
										
											2014-07-22 09:59:45 +08:00
										 |  |  |     }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-04-13 03:11:35 +08:00
										 |  |  |     struct Row { | 
					
						
							|  |  |  |       Row(); | 
					
						
							| 
									
										
										
										
											2017-04-13 03:24:43 +08:00
										 |  |  |       Row(Layer* layer, | 
					
						
							|  |  |  |           const int level, | 
					
						
							|  |  |  |           const LayerFlags inheritedFlags); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |       Layer* layer() const { return m_layer; } | 
					
						
							|  |  |  |       int level() const { return m_level; } | 
					
						
							| 
									
										
										
										
											2017-04-13 02:53:54 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  |       bool parentVisible() const; | 
					
						
							|  |  |  |       bool parentEditable() const; | 
					
						
							| 
									
										
										
										
											2017-04-13 03:24:43 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  |     private: | 
					
						
							|  |  |  |       Layer* m_layer; | 
					
						
							|  |  |  |       int m_level; | 
					
						
							|  |  |  |       LayerFlags m_inheritedFlags; | 
					
						
							| 
									
										
										
										
											2016-08-25 23:31:00 +08:00
										 |  |  |     }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     bool selectedLayersBounds(const SelectedLayers& layers, | 
					
						
							|  |  |  |                               layer_t* first, layer_t* last) const; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-09-18 03:39:55 +08:00
										 |  |  |     void setLayer(Layer* layer); | 
					
						
							| 
									
										
										
										
											2016-05-28 00:45:12 +08:00
										 |  |  |     void setFrame(frame_t frame, bool byUser); | 
					
						
							| 
									
										
										
										
											2014-04-30 09:51:14 +08:00
										 |  |  |     bool allLayersVisible(); | 
					
						
							|  |  |  |     bool allLayersInvisible(); | 
					
						
							|  |  |  |     bool allLayersLocked(); | 
					
						
							|  |  |  |     bool allLayersUnlocked(); | 
					
						
							| 
									
										
										
										
											2015-01-20 20:38:39 +08:00
										 |  |  |     bool allLayersContinuous(); | 
					
						
							|  |  |  |     bool allLayersDiscontinuous(); | 
					
						
							| 
									
										
										
										
											2013-11-11 07:29:51 +08:00
										 |  |  |     void detachDocument(); | 
					
						
							| 
									
										
										
										
											2015-03-11 03:25:20 +08:00
										 |  |  |     void setCursor(ui::Message* msg, const Hit& hit); | 
					
						
							| 
									
										
										
										
											2018-08-03 02:03:55 +08:00
										 |  |  |     void getDrawableLayers(layer_t* firstLayer, layer_t* lastLayer); | 
					
						
							|  |  |  |     void getDrawableFrames(frame_t* firstFrame, frame_t* lastFrame); | 
					
						
							| 
									
										
										
										
											2013-12-11 11:34:16 +08:00
										 |  |  |     void drawPart(ui::Graphics* g, const gfx::Rect& bounds, | 
					
						
							| 
									
										
										
										
											2017-03-14 05:13:38 +08:00
										 |  |  |                   const std::string* text, | 
					
						
							|  |  |  |                   ui::Style* style, | 
					
						
							|  |  |  |                   const bool is_active = false, | 
					
						
							|  |  |  |                   const bool is_hover = false, | 
					
						
							|  |  |  |                   const bool is_clicked = false, | 
					
						
							|  |  |  |                   const bool is_disabled = false); | 
					
						
							| 
									
										
										
										
											2015-03-10 00:57:16 +08:00
										 |  |  |     void drawTop(ui::Graphics* g); | 
					
						
							| 
									
										
										
										
											2013-12-11 11:34:16 +08:00
										 |  |  |     void drawHeader(ui::Graphics* g); | 
					
						
							| 
									
										
										
										
											2014-12-29 07:39:11 +08:00
										 |  |  |     void drawHeaderFrame(ui::Graphics* g, frame_t frame); | 
					
						
							| 
									
										
										
										
											2016-08-25 23:31:00 +08:00
										 |  |  |     void drawLayer(ui::Graphics* g, layer_t layerIdx); | 
					
						
							|  |  |  |     void drawCel(ui::Graphics* g, layer_t layerIdx, frame_t frame, Cel* cel, DrawCelData* data); | 
					
						
							| 
									
										
										
										
											2015-01-20 20:38:39 +08:00
										 |  |  |     void drawCelLinkDecorators(ui::Graphics* g, const gfx::Rect& bounds, | 
					
						
							| 
									
										
										
										
											2015-09-15 21:57:43 +08:00
										 |  |  |                                Cel* cel, frame_t frame, bool is_active, bool is_hover, | 
					
						
							|  |  |  |                                DrawCelData* data); | 
					
						
							| 
									
										
										
										
											2019-10-02 01:55:08 +08:00
										 |  |  |     void drawTags(ui::Graphics* g); | 
					
						
							| 
									
										
										
										
											2020-12-30 21:25:37 +08:00
										 |  |  |     void drawTagBraces(ui::Graphics* g, | 
					
						
							|  |  |  |                        gfx::Color tagColor, | 
					
						
							|  |  |  |                        const gfx::Rect& bounds, | 
					
						
							|  |  |  |                        const gfx::Rect& clipBounds); | 
					
						
							| 
									
										
										
										
											2014-03-30 23:53:57 +08:00
										 |  |  |     void drawRangeOutline(ui::Graphics* g); | 
					
						
							| 
									
										
										
										
											2013-12-11 11:34:16 +08:00
										 |  |  |     void drawPaddings(ui::Graphics* g); | 
					
						
							| 
									
										
										
										
											2016-08-25 23:31:00 +08:00
										 |  |  |     bool drawPart(ui::Graphics* g, int part, layer_t layer, frame_t frame); | 
					
						
							| 
									
										
										
										
											2014-08-08 21:33:45 +08:00
										 |  |  |     void drawClipboardRange(ui::Graphics* g); | 
					
						
							| 
									
										
										
										
											2013-12-16 04:26:29 +08:00
										 |  |  |     gfx::Rect getLayerHeadersBounds() const; | 
					
						
							|  |  |  |     gfx::Rect getFrameHeadersBounds() const; | 
					
						
							| 
									
										
										
										
											2013-12-18 11:01:55 +08:00
										 |  |  |     gfx::Rect getOnionskinFramesBounds() const; | 
					
						
							| 
									
										
										
										
											2013-12-16 04:26:29 +08:00
										 |  |  |     gfx::Rect getCelsBounds() const; | 
					
						
							| 
									
										
										
										
											2015-03-11 03:25:20 +08:00
										 |  |  |     gfx::Rect getPartBounds(const Hit& hit) const; | 
					
						
							| 
									
										
										
										
											2014-07-22 09:59:45 +08:00
										 |  |  |     gfx::Rect getRangeBounds(const Range& range) const; | 
					
						
							| 
									
										
										
										
											2018-03-30 03:21:43 +08:00
										 |  |  |     gfx::Rect getRangeClipBounds(const Range& range) const; | 
					
						
							| 
									
										
										
										
											2015-03-10 03:41:03 +08:00
										 |  |  |     void invalidateHit(const Hit& hit); | 
					
						
							| 
									
										
										
										
											2018-03-30 03:13:10 +08:00
										 |  |  |     void invalidateLayer(const Layer* layer); | 
					
						
							|  |  |  |     void invalidateFrame(const frame_t frame); | 
					
						
							| 
									
										
										
										
											2018-03-30 03:25:43 +08:00
										 |  |  |     void invalidateRange(); | 
					
						
							| 
									
										
										
										
											2017-04-13 03:46:40 +08:00
										 |  |  |     void regenerateRows(); | 
					
						
							| 
									
										
										
										
											2017-03-27 08:52:50 +08:00
										 |  |  |     void regenerateTagBands(); | 
					
						
							| 
									
										
										
										
											2017-03-30 07:36:41 +08:00
										 |  |  |     int visibleTagBands() const; | 
					
						
							| 
									
										
										
										
											2015-09-18 02:19:47 +08:00
										 |  |  |     void updateScrollBars(); | 
					
						
							| 
									
										
										
										
											2015-03-11 03:25:20 +08:00
										 |  |  |     void updateByMousePos(ui::Message* msg, const gfx::Point& mousePos); | 
					
						
							| 
									
										
										
										
											2015-03-10 03:41:03 +08:00
										 |  |  |     Hit hitTest(ui::Message* msg, const gfx::Point& mousePos); | 
					
						
							| 
									
										
										
										
											2015-08-20 21:51:41 +08:00
										 |  |  |     Hit hitTestCel(const gfx::Point& mousePos); | 
					
						
							| 
									
										
										
										
											2015-03-10 03:41:03 +08:00
										 |  |  |     void setHot(const Hit& hit); | 
					
						
							| 
									
										
										
										
											2016-08-25 23:31:00 +08:00
										 |  |  |     void showCel(layer_t layer, frame_t frame); | 
					
						
							| 
									
										
										
										
											2013-11-11 05:27:11 +08:00
										 |  |  |     void showCurrentCel(); | 
					
						
							| 
									
										
										
										
											2017-04-15 00:18:01 +08:00
										 |  |  |     void focusTagBand(int band); | 
					
						
							| 
									
										
										
										
											2013-11-11 05:27:11 +08:00
										 |  |  |     void cleanClk(); | 
					
						
							| 
									
										
										
										
											2015-09-18 02:19:47 +08:00
										 |  |  |     gfx::Size getScrollableSize() const; | 
					
						
							|  |  |  |     gfx::Point getMaxScrollablePos() const; | 
					
						
							| 
									
										
										
										
											2016-08-25 23:31:00 +08:00
										 |  |  |     layer_t getLayerIndex(const Layer* layer) const; | 
					
						
							|  |  |  |     bool isLayerActive(const layer_t layerIdx) const; | 
					
						
							|  |  |  |     bool isFrameActive(const frame_t frame) const; | 
					
						
							| 
									
										
										
										
											2018-06-06 00:11:29 +08:00
										 |  |  |     bool isCelActive(const layer_t layerIdx, const frame_t frame) const; | 
					
						
							| 
									
										
										
										
											2018-06-07 23:21:21 +08:00
										 |  |  |     bool isCelLooselyActive(const layer_t layerIdx, const frame_t frame) const; | 
					
						
							| 
									
										
										
										
											2014-07-22 09:59:45 +08:00
										 |  |  |     void updateStatusBar(ui::Message* msg); | 
					
						
							| 
									
										
										
										
											2017-07-29 03:44:21 +08:00
										 |  |  |     void updateStatusBarForFrame(const frame_t frame, | 
					
						
							| 
									
										
										
										
											2019-10-02 01:55:08 +08:00
										 |  |  |                                  const Tag* tag, | 
					
						
							| 
									
										
										
										
											2017-07-29 03:44:21 +08:00
										 |  |  |                                  const Cel* cel); | 
					
						
							| 
									
										
										
										
											2014-07-22 09:59:45 +08:00
										 |  |  |     void updateDropRange(const gfx::Point& pt); | 
					
						
							| 
									
										
										
										
											2014-08-08 21:33:45 +08:00
										 |  |  |     void clearClipboardRange(); | 
					
						
							| 
									
										
										
										
											2014-04-10 08:56:06 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-07-25 10:50:45 +08:00
										 |  |  |     // The layer of the bottom (e.g. Background layer)
 | 
					
						
							| 
									
										
										
										
											2016-08-25 23:31:00 +08:00
										 |  |  |     layer_t firstLayer() const { return 0; } | 
					
						
							| 
									
										
										
										
											2014-07-25 10:50:45 +08:00
										 |  |  |     // The layer of the top.
 | 
					
						
							| 
									
										
										
										
											2017-04-13 03:11:35 +08:00
										 |  |  |     layer_t lastLayer() const { return m_rows.size()-1; } | 
					
						
							| 
									
										
										
										
											2014-07-25 10:50:45 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2014-12-29 07:39:11 +08:00
										 |  |  |     frame_t firstFrame() const { return frame_t(0); } | 
					
						
							|  |  |  |     frame_t lastFrame() const { return m_sprite->lastFrame(); } | 
					
						
							| 
									
										
										
										
											2014-07-25 10:50:45 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-08-25 23:31:00 +08:00
										 |  |  |     bool validLayer(layer_t layer) const { return layer >= firstLayer() && layer <= lastLayer(); } | 
					
						
							| 
									
										
										
										
											2014-12-29 07:39:11 +08:00
										 |  |  |     bool validFrame(frame_t frame) const { return frame >= firstFrame() && frame <= lastFrame(); } | 
					
						
							| 
									
										
										
										
											2014-07-25 10:50:45 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-03-10 00:57:16 +08:00
										 |  |  |     int topHeight() const; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-02-15 20:48:38 +08:00
										 |  |  |     DocumentPreferences& docPref() const; | 
					
						
							| 
									
										
										
										
											2016-08-04 09:13:04 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  |     // Theme/dimensions
 | 
					
						
							| 
									
										
										
										
											2015-02-17 22:43:25 +08:00
										 |  |  |     skin::SkinTheme* skinTheme() const; | 
					
						
							| 
									
										
										
										
											2016-08-04 09:13:04 +08:00
										 |  |  |     gfx::Size celBoxSize() const; | 
					
						
							| 
									
										
										
										
											2016-08-07 15:18:24 +08:00
										 |  |  |     int headerBoxWidth() const; | 
					
						
							| 
									
										
										
										
											2016-08-04 09:13:04 +08:00
										 |  |  |     int headerBoxHeight() const; | 
					
						
							|  |  |  |     int layerBoxHeight() const; | 
					
						
							|  |  |  |     int frameBoxWidth() const; | 
					
						
							|  |  |  |     int outlineWidth() const; | 
					
						
							| 
									
										
										
										
											2017-03-27 08:52:50 +08:00
										 |  |  |     int oneTagHeight() const; | 
					
						
							| 
									
										
										
										
											2019-10-02 01:55:08 +08:00
										 |  |  |     int calcTagVisibleToFrame(Tag* tag) const; | 
					
						
							| 
									
										
										
										
											2015-02-15 20:48:38 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-07-25 20:51:58 +08:00
										 |  |  |     void updateCelOverlayBounds(const Hit& hit); | 
					
						
							|  |  |  |     void drawCelOverlay(ui::Graphics* g); | 
					
						
							|  |  |  |     void onThumbnailsPrefChange(); | 
					
						
							| 
									
										
										
										
											2017-11-22 01:30:30 +08:00
										 |  |  |     void setZoom(const double zoom); | 
					
						
							|  |  |  |     void setZoomAndUpdate(const double zoom, | 
					
						
							|  |  |  |                           const bool updatePref); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  |     double zoom() const; | 
					
						
							| 
									
										
										
										
											2019-10-02 01:55:08 +08:00
										 |  |  |     int tagFramesDuration(const Tag* tag) const; | 
					
						
							| 
									
										
										
										
											2017-07-29 03:44:21 +08:00
										 |  |  |     // Calculate the duration of the selected range of frames
 | 
					
						
							|  |  |  |     int selectedFramesDuration() const; | 
					
						
							| 
									
										
										
										
											2015-02-15 20:48:38 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-11-29 08:16:37 +08:00
										 |  |  |     void setLayerVisibleFlag(const layer_t layer, const bool state); | 
					
						
							|  |  |  |     void setLayerEditableFlag(const layer_t layer, const bool state); | 
					
						
							|  |  |  |     void setLayerContinuousFlag(const layer_t layer, const bool state); | 
					
						
							|  |  |  |     void setLayerCollapsedFlag(const layer_t layer, const bool state); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-06-17 01:37:24 +08:00
										 |  |  |     int separatorX() const; | 
					
						
							| 
									
										
										
										
											2020-06-12 02:30:06 +08:00
										 |  |  |     void setSeparatorX(int newValue); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-12-30 21:25:37 +08:00
										 |  |  |     static gfx::Color highlightColor(const gfx::Color color); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-09-18 02:19:47 +08:00
										 |  |  |     ui::ScrollBar m_hbar; | 
					
						
							|  |  |  |     ui::ScrollBar m_vbar; | 
					
						
							|  |  |  |     gfx::Rect m_viewportArea; | 
					
						
							| 
									
										
										
										
											2016-08-04 09:14:33 +08:00
										 |  |  |     double m_zoom; | 
					
						
							| 
									
										
										
										
											2013-11-11 05:27:11 +08:00
										 |  |  |     Context* m_context; | 
					
						
							| 
									
										
										
										
											2013-11-11 09:59:25 +08:00
										 |  |  |     Editor* m_editor; | 
					
						
							| 
									
										
										
										
											2018-07-07 22:54:44 +08:00
										 |  |  |     Doc* m_document; | 
					
						
							| 
									
										
										
										
											2013-11-11 05:27:11 +08:00
										 |  |  |     Sprite* m_sprite; | 
					
						
							|  |  |  |     Layer* m_layer; | 
					
						
							| 
									
										
										
										
											2014-12-29 07:39:11 +08:00
										 |  |  |     frame_t m_frame; | 
					
						
							| 
									
										
										
										
											2017-12-02 04:14:18 +08:00
										 |  |  |     int m_rangeLocks; | 
					
						
							| 
									
										
										
										
											2013-12-15 20:42:05 +08:00
										 |  |  |     Range m_range; | 
					
						
							| 
									
										
										
										
											2016-08-25 23:31:00 +08:00
										 |  |  |     Range m_startRange; | 
					
						
							| 
									
										
										
										
											2014-07-22 09:59:45 +08:00
										 |  |  |     Range m_dropRange; | 
					
						
							| 
									
										
										
										
											2013-11-11 05:27:11 +08:00
										 |  |  |     State m_state; | 
					
						
							| 
									
										
										
										
											2017-03-27 08:52:50 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2017-04-13 03:11:35 +08:00
										 |  |  |     // Data used to display each row in the timeline
 | 
					
						
							|  |  |  |     std::vector<Row> m_rows; | 
					
						
							| 
									
										
										
										
											2017-03-27 08:52:50 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  |     // Data used to display frame tags
 | 
					
						
							| 
									
										
										
										
											2017-03-27 08:54:08 +08:00
										 |  |  |     int m_tagBands; | 
					
						
							| 
									
										
										
										
											2017-03-30 07:36:41 +08:00
										 |  |  |     int m_tagFocusBand; | 
					
						
							| 
									
										
										
										
											2019-10-02 01:55:08 +08:00
										 |  |  |     std::map<Tag*, int> m_tagBand; | 
					
						
							| 
									
										
										
										
											2017-03-27 08:52:50 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-11-11 05:27:11 +08:00
										 |  |  |     int m_separator_x; | 
					
						
							|  |  |  |     int m_separator_w; | 
					
						
							| 
									
										
										
										
											2013-12-18 11:01:55 +08:00
										 |  |  |     int m_origFrames; | 
					
						
							| 
									
										
										
										
											2015-03-10 03:41:03 +08:00
										 |  |  |     Hit m_hot;       // The 'hot' part is where the mouse is on top of
 | 
					
						
							| 
									
										
										
										
											2014-07-22 09:59:45 +08:00
										 |  |  |     DropTarget m_dropTarget; | 
					
						
							| 
									
										
										
										
											2015-03-10 03:41:03 +08:00
										 |  |  |     Hit m_clk; // The 'clk' part is where the mouse's button was pressed (maybe for a drag & drop operation)
 | 
					
						
							| 
									
										
										
										
											2014-04-10 08:56:06 +08:00
										 |  |  |     // Absolute mouse positions for scrolling.
 | 
					
						
							| 
									
										
										
										
											2014-02-03 05:46:19 +08:00
										 |  |  |     gfx::Point m_oldPos; | 
					
						
							| 
									
										
										
										
											2014-05-18 08:27:44 +08:00
										 |  |  |     // Configure timeline
 | 
					
						
							| 
									
										
										
										
											2021-05-29 02:08:17 +08:00
										 |  |  |     std::unique_ptr<ConfigureTimelinePopup> m_confPopup; | 
					
						
							| 
									
										
										
										
											2016-09-14 02:02:00 +08:00
										 |  |  |     obs::scoped_connection m_ctxConn; | 
					
						
							| 
									
										
										
										
											2016-11-23 05:05:56 +08:00
										 |  |  |     obs::connection m_firstFrameConn; | 
					
						
							| 
									
										
										
										
											2014-08-08 21:33:45 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  |     // Marching ants stuff to show the range in the clipboard.
 | 
					
						
							|  |  |  |     // TODO merge this with the marching ants of the sprite editor (ui::Editor)
 | 
					
						
							|  |  |  |     ui::Timer m_clipboard_timer; | 
					
						
							|  |  |  |     int m_offset_count; | 
					
						
							| 
									
										
										
										
											2017-07-19 04:07:35 +08:00
										 |  |  |     bool m_redrawMarchingAntsOnly; | 
					
						
							| 
									
										
										
										
											2014-08-28 09:43:24 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  |     bool m_scroll;   // True if the drag-and-drop operation is a scroll operation.
 | 
					
						
							|  |  |  |     bool m_copy;     // True if the drag-and-drop operation is a copy.
 | 
					
						
							| 
									
										
										
										
											2015-09-18 03:39:55 +08:00
										 |  |  |     bool m_fromTimeline; | 
					
						
							| 
									
										
										
										
											2015-04-07 21:48:04 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  |     AniControls m_aniControls; | 
					
						
							| 
									
										
										
										
											2015-08-05 20:40:11 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2016-07-25 21:17:53 +08:00
										 |  |  |     // Data used for thumbnails.
 | 
					
						
							| 
									
										
										
										
											2016-07-25 20:51:58 +08:00
										 |  |  |     bool m_thumbnailsOverlayVisible; | 
					
						
							| 
									
										
										
										
											2019-04-12 01:29:20 +08:00
										 |  |  |     gfx::Rect m_thumbnailsOverlayBounds; | 
					
						
							| 
									
										
										
										
											2016-07-25 20:51:58 +08:00
										 |  |  |     Hit m_thumbnailsOverlayHit; | 
					
						
							|  |  |  |     gfx::Point m_thumbnailsOverlayDirection; | 
					
						
							| 
									
										
										
										
											2016-09-26 22:39:40 +08:00
										 |  |  |     obs::connection m_thumbnailsPrefConn; | 
					
						
							| 
									
										
										
										
											2016-07-25 20:51:58 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2015-08-05 20:40:11 +08:00
										 |  |  |     // Temporal data used to move the range.
 | 
					
						
							|  |  |  |     struct MoveRange { | 
					
						
							| 
									
										
										
										
											2016-08-25 23:31:00 +08:00
										 |  |  |       layer_t activeRelativeLayer; | 
					
						
							| 
									
										
										
										
											2015-08-05 20:40:11 +08:00
										 |  |  |       frame_t activeRelativeFrame; | 
					
						
							|  |  |  |     } m_moveRangeData; | 
					
						
							| 
									
										
										
										
											2020-12-30 21:25:37 +08:00
										 |  |  | 
 | 
					
						
							|  |  |  |     // Temporal data used to move tags.
 | 
					
						
							|  |  |  |     struct ResizeTag { | 
					
						
							|  |  |  |       doc::ObjectId tag = doc::NullId; | 
					
						
							|  |  |  |       doc::frame_t from, to; | 
					
						
							|  |  |  |       void reset() { | 
					
						
							|  |  |  |         tag = doc::NullId; | 
					
						
							|  |  |  |       } | 
					
						
							|  |  |  |       void reset(const doc::ObjectId tagId) { | 
					
						
							|  |  |  |         auto tag = doc::get<doc::Tag>(tagId); | 
					
						
							|  |  |  |         if (tag) { | 
					
						
							|  |  |  |           this->tag = tagId; | 
					
						
							|  |  |  |           this->from = tag->fromFrame(); | 
					
						
							|  |  |  |           this->to = tag->toFrame(); | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  |         else { | 
					
						
							|  |  |  |           this->tag = doc::NullId; | 
					
						
							|  |  |  |         } | 
					
						
							|  |  |  |       } | 
					
						
							|  |  |  |     } m_resizeTagData; | 
					
						
							| 
									
										
										
										
											2013-11-11 05:27:11 +08:00
										 |  |  |   }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-04-17 23:29:48 +08:00
										 |  |  | #ifdef ENABLE_UI
 | 
					
						
							| 
									
										
										
										
											2017-12-02 04:14:18 +08:00
										 |  |  |   class LockTimelineRange { | 
					
						
							|  |  |  |   public: | 
					
						
							|  |  |  |     LockTimelineRange(Timeline* timeline) | 
					
						
							|  |  |  |       : m_timeline(timeline) { | 
					
						
							| 
									
										
										
										
											2020-04-17 23:29:48 +08:00
										 |  |  |       if (m_timeline) | 
					
						
							|  |  |  |         m_timeline->lockRange(); | 
					
						
							| 
									
										
										
										
											2017-12-02 04:14:18 +08:00
										 |  |  |     } | 
					
						
							|  |  |  |     ~LockTimelineRange() { | 
					
						
							| 
									
										
										
										
											2020-04-17 23:29:48 +08:00
										 |  |  |       if (m_timeline) | 
					
						
							|  |  |  |         m_timeline->unlockRange(); | 
					
						
							| 
									
										
										
										
											2017-12-02 04:14:18 +08:00
										 |  |  |     } | 
					
						
							|  |  |  |   private: | 
					
						
							|  |  |  |     Timeline* m_timeline; | 
					
						
							|  |  |  |   }; | 
					
						
							| 
									
										
										
										
											2020-04-17 23:29:48 +08:00
										 |  |  | #else  // !ENABLE_UI
 | 
					
						
							|  |  |  |   class LockTimelineRange { | 
					
						
							|  |  |  |   public: | 
					
						
							|  |  |  |     LockTimelineRange(Timeline* timeline) { } | 
					
						
							|  |  |  |   }; | 
					
						
							|  |  |  | #endif
 | 
					
						
							| 
									
										
										
										
											2017-12-02 04:14:18 +08:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2013-11-11 05:27:11 +08:00
										 |  |  | } // namespace app
 | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | #endif
 |