2015-02-12 23:16:25 +08:00
|
|
|
// Aseprite
|
2017-03-14 05:13:38 +08:00
|
|
|
// Copyright (C) 2001-2017 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
|
|
|
|
2014-08-08 07:19:31 +08:00
|
|
|
#include "app/document_range.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"
|
2014-07-29 11:53:24 +08:00
|
|
|
#include "doc/document_observer.h"
|
|
|
|
#include "doc/documents_observer.h"
|
2014-12-29 07:39:11 +08:00
|
|
|
#include "doc/frame.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"
|
2016-09-14 02:02:00 +08:00
|
|
|
#include "obs/connection.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"
|
|
|
|
|
|
|
|
#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;
|
|
|
|
}
|
|
|
|
|
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;
|
|
|
|
class Document;
|
|
|
|
class Editor;
|
|
|
|
|
|
|
|
class Timeline : public ui::Widget
|
2015-09-18 02:19:47 +08:00
|
|
|
, public ui::ScrollableViewDelegate
|
2014-07-29 11:53:24 +08:00
|
|
|
, public doc::DocumentsObserver
|
|
|
|
, public doc::DocumentObserver
|
2015-05-10 06:55:33 +08:00
|
|
|
, public app::EditorObserver
|
2017-03-30 08:18:29 +08:00
|
|
|
, public app::InputChainElement
|
|
|
|
, public app::FrameTagProvider {
|
2013-11-11 05:27:11 +08:00
|
|
|
public:
|
2014-08-08 07:19:31 +08:00
|
|
|
typedef DocumentRange Range;
|
|
|
|
|
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,
|
|
|
|
STATE_MOVING_ONIONSKIN_RANGE_RIGHT
|
2013-11-11 05:27:11 +08:00
|
|
|
};
|
|
|
|
|
2014-04-10 08:56:06 +08:00
|
|
|
enum DropOp { kMove, kCopy };
|
|
|
|
|
2013-11-11 05:27:11 +08:00
|
|
|
Timeline();
|
|
|
|
~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();
|
|
|
|
void moveRange(Range& range);
|
|
|
|
|
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);
|
|
|
|
|
2017-03-30 08:18:29 +08:00
|
|
|
// FrameTagProvider impl
|
|
|
|
// 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.
|
|
|
|
FrameTag* getFrameTagByFrame(const frame_t frame) override;
|
|
|
|
|
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;
|
|
|
|
|
2013-11-11 05:27:11 +08:00
|
|
|
protected:
|
2014-08-15 10:07:47 +08:00
|
|
|
bool onProcessMessage(ui::Message* msg) 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
|
|
|
|
|
|
|
// DocumentObserver impl.
|
2016-02-01 21:56:03 +08:00
|
|
|
void onGeneralUpdate(DocumentEvent& ev) override;
|
2014-08-15 10:07:47 +08:00
|
|
|
void onAddLayer(doc::DocumentEvent& ev) override;
|
|
|
|
void onAfterRemoveLayer(doc::DocumentEvent& ev) override;
|
|
|
|
void onAddFrame(doc::DocumentEvent& ev) override;
|
|
|
|
void onRemoveFrame(doc::DocumentEvent& ev) override;
|
2014-11-12 22:24:26 +08:00
|
|
|
void onSelectionChanged(doc::DocumentEvent& ev) override;
|
2015-08-21 11:44:28 +08:00
|
|
|
void onLayerNameChange(doc::DocumentEvent& ev) override;
|
2017-03-31 02:25:35 +08:00
|
|
|
void onAddFrameTag(DocumentEvent& ev) override;
|
|
|
|
void onRemoveFrameTag(DocumentEvent& 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
|
|
|
|
|
|
|
// DocumentsObserver impl.
|
2014-08-15 10:07:47 +08:00
|
|
|
void onRemoveDocument(doc::Document* 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
|
|
|
|
void onNewInputPriority(InputChainElement* element) override;
|
|
|
|
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;
|
2015-03-13 02:31:34 +08:00
|
|
|
ObjectId frameTag;
|
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,
|
|
|
|
ObjectId frameTag = NullId,
|
2017-04-13 02:53:54 +08:00
|
|
|
int band = -1);
|
|
|
|
bool operator!=(const Hit& other) const;
|
2015-03-13 02:31:34 +08:00
|
|
|
FrameTag* getFrameTag() 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
|
|
|
|
};
|
2014-07-22 09:59:45 +08:00
|
|
|
|
2017-04-13 02:53:54 +08:00
|
|
|
DropTarget();
|
2014-07-22 09:59:45 +08:00
|
|
|
|
|
|
|
HHit hhit;
|
|
|
|
VHit vhit;
|
|
|
|
Layer* layer;
|
2016-08-25 23:31:00 +08:00
|
|
|
ObjectId layerId;
|
2014-12-29 07:39:11 +08:00
|
|
|
frame_t frame;
|
2014-07-22 09:59:45 +08:00
|
|
|
int xpos, ypos;
|
|
|
|
};
|
|
|
|
|
2017-04-13 03:11:35 +08:00
|
|
|
struct Row {
|
2016-08-25 23:31:00 +08:00
|
|
|
Layer* layer;
|
|
|
|
int level;
|
|
|
|
LayerFlags inheritedFlags;
|
|
|
|
|
2017-04-13 03:11:35 +08:00
|
|
|
Row();
|
|
|
|
Row(Layer* layer, int level, LayerFlags inheritedFlags);
|
2017-04-13 02:53:54 +08:00
|
|
|
|
|
|
|
bool parentVisible() const;
|
|
|
|
bool parentEditable() const;
|
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);
|
2016-08-25 23:31:00 +08:00
|
|
|
void getDrawableLayers(ui::Graphics* g, layer_t* firstLayer, layer_t* lastLayer);
|
|
|
|
void getDrawableFrames(ui::Graphics* g, 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);
|
2015-02-18 03:12:10 +08:00
|
|
|
void drawFrameTags(ui::Graphics* g);
|
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;
|
2015-03-10 03:41:03 +08:00
|
|
|
void invalidateHit(const Hit& hit);
|
2013-11-11 05:27:11 +08:00
|
|
|
void regenerateLayers();
|
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();
|
|
|
|
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;
|
2014-07-22 09:59:45 +08:00
|
|
|
void updateStatusBar(ui::Message* msg);
|
|
|
|
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-22 09:59:45 +08:00
|
|
|
bool isCopyKeyPressed(ui::Message* msg);
|
|
|
|
|
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;
|
|
|
|
int calcTagVisibleToFrame(FrameTag* frameTag) 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();
|
2016-08-04 14:02:44 +08:00
|
|
|
void setZoom(double zoom);
|
2016-10-10 03:02:51 +08:00
|
|
|
void setZoomAndUpdate(double zoom);
|
2015-02-15 20:48:38 +08:00
|
|
|
|
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;
|
2013-11-11 05:27:11 +08:00
|
|
|
Document* m_document;
|
|
|
|
Sprite* m_sprite;
|
|
|
|
Layer* m_layer;
|
2014-12-29 07:39:11 +08:00
|
|
|
frame_t m_frame;
|
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;
|
2017-03-27 08:52:50 +08:00
|
|
|
std::map<FrameTag*, int> m_tagBand;
|
|
|
|
|
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
|
|
|
|
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;
|
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;
|
|
|
|
gfx::Rect m_thumbnailsOverlayInner;
|
|
|
|
gfx::Rect m_thumbnailsOverlayOuter;
|
|
|
|
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;
|
2013-11-11 05:27:11 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace app
|
|
|
|
|
|
|
|
#endif
|