mirror of
https://github.com/aseprite/aseprite.git
synced 2025-04-10 21:44:22 +00:00
Rename DocumentView -> DocView
This commit is contained in:
parent
b8317805f8
commit
b3c89cd110
@ -321,7 +321,7 @@ if(ENABLE_UI)
|
||||
ui/configure_timeline_popup.cpp
|
||||
ui/context_bar.cpp
|
||||
ui/dithering_selector.cpp
|
||||
ui/document_view.cpp
|
||||
ui/doc_view.cpp
|
||||
ui/drop_down_button.cpp
|
||||
ui/editor/brush_preview.cpp
|
||||
ui/editor/drawing_state.cpp
|
||||
|
@ -40,7 +40,7 @@
|
||||
#include "app/tools/tool_box.h"
|
||||
#include "app/ui/backup_indicator.h"
|
||||
#include "app/ui/color_bar.h"
|
||||
#include "app/ui/document_view.h"
|
||||
#include "app/ui/doc_view.h"
|
||||
#include "app/ui/editor/editor.h"
|
||||
#include "app/ui/editor/editor_view.h"
|
||||
#include "app/ui/input_chain.h"
|
||||
@ -563,7 +563,7 @@ void App::updateDisplayTitleBar()
|
||||
std::string defaultTitle = PACKAGE " v" VERSION;
|
||||
std::string title;
|
||||
|
||||
DocumentView* docView = UIContext::instance()->activeView();
|
||||
DocView* docView = UIContext::instance()->activeView();
|
||||
if (docView) {
|
||||
// Prepend the document's filename.
|
||||
title += docView->document()->name();
|
||||
|
@ -13,7 +13,7 @@
|
||||
#include "app/commands/commands.h"
|
||||
#include "app/context_access.h"
|
||||
#include "app/modules/editors.h"
|
||||
#include "app/ui/document_view.h"
|
||||
#include "app/ui/doc_view.h"
|
||||
#include "app/ui/status_bar.h"
|
||||
#include "app/ui/workspace.h"
|
||||
#include "app/ui_context.h"
|
||||
@ -69,9 +69,9 @@ protected:
|
||||
Workspace* workspace = App::instance()->workspace();
|
||||
|
||||
// Collect all document views
|
||||
DocumentViews docViews;
|
||||
DocViews docViews;
|
||||
for (auto view : *workspace) {
|
||||
DocumentView* docView = dynamic_cast<DocumentView*>(view);
|
||||
DocView* docView = dynamic_cast<DocView*>(view);
|
||||
if (docView)
|
||||
docViews.push_back(docView);
|
||||
}
|
||||
|
@ -20,7 +20,7 @@
|
||||
#include "app/modules/gui.h"
|
||||
#include "app/pref/preferences.h"
|
||||
#include "app/transaction.h"
|
||||
#include "app/ui/document_view.h"
|
||||
#include "app/ui/doc_view.h"
|
||||
#include "app/ui/editor/editor.h"
|
||||
#include "app/ui_context.h"
|
||||
#include "base/convert_to.h"
|
||||
|
@ -18,7 +18,7 @@
|
||||
#include "app/i18n/strings.h"
|
||||
#include "app/modules/gui.h"
|
||||
#include "app/transaction.h"
|
||||
#include "app/ui/document_view.h"
|
||||
#include "app/ui/doc_view.h"
|
||||
#include "app/ui/editor/editor.h"
|
||||
#include "app/ui/main_window.h"
|
||||
#include "app/ui/status_bar.h"
|
||||
@ -171,7 +171,7 @@ void NewFrameCommand::onExecute(Context* context)
|
||||
|
||||
// TODO should we use DocObserver?
|
||||
if (UIContext::instance() == context) {
|
||||
if (DocumentView* view = UIContext::instance()->activeView())
|
||||
if (DocView* view = UIContext::instance()->activeView())
|
||||
view->editor()->setFrame(writer.frame()+1);
|
||||
}
|
||||
}
|
||||
|
@ -13,7 +13,7 @@
|
||||
#include "app/commands/params.h"
|
||||
#include "app/i18n/strings.h"
|
||||
#include "app/pref/preferences.h"
|
||||
#include "app/ui/document_view.h"
|
||||
#include "app/ui/doc_view.h"
|
||||
#include "app/ui/editor/editor.h"
|
||||
#include "app/ui_context.h"
|
||||
#include "fmt/format.h"
|
||||
@ -74,7 +74,7 @@ gfx::Point MoveThing::getDelta(Context* context) const
|
||||
{
|
||||
gfx::Point delta(0, 0);
|
||||
|
||||
DocumentView* view = static_cast<UIContext*>(context)->activeView();
|
||||
DocView* view = static_cast<UIContext*>(context)->activeView();
|
||||
if (!view)
|
||||
return delta;
|
||||
|
||||
|
@ -23,7 +23,7 @@
|
||||
namespace app {
|
||||
class Command;
|
||||
class Doc;
|
||||
class DocumentView;
|
||||
class DocView;
|
||||
|
||||
class CommandPreconditionException : public base::Exception {
|
||||
public:
|
||||
@ -79,7 +79,7 @@ namespace app {
|
||||
void executeCommand(const char* commandName);
|
||||
virtual void executeCommand(Command* command, const Params& params = Params());
|
||||
|
||||
virtual DocumentView* getFirstDocumentView(Doc* document) const {
|
||||
virtual DocView* getFirstDocView(Doc* document) const {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
@ -340,11 +340,11 @@ bool CustomizedGuiManager::onProcessMessage(Message* msg)
|
||||
// If the document is already open, select it.
|
||||
Doc* doc = ctx->documents().getByFileName(fn);
|
||||
if (doc) {
|
||||
DocumentView* docView = ctx->getFirstDocumentView(doc);
|
||||
DocView* docView = ctx->getFirstDocView(doc);
|
||||
if (docView)
|
||||
ctx->setActiveView(docView);
|
||||
else {
|
||||
ASSERT(false); // Must be some DocumentView available
|
||||
ASSERT(false); // Must be some DocView available
|
||||
}
|
||||
}
|
||||
// Load the file
|
||||
|
@ -20,7 +20,7 @@
|
||||
#include "app/script/sprite_wrap.h"
|
||||
#include "app/site.h"
|
||||
#include "app/transaction.h"
|
||||
#include "app/ui/document_view.h"
|
||||
#include "app/ui/doc_view.h"
|
||||
#include "doc/mask.h"
|
||||
#include "doc/palette.h"
|
||||
#include "doc/sprite.h"
|
||||
|
@ -18,14 +18,14 @@
|
||||
#include "app/script/image_wrap.h"
|
||||
#include "app/site.h"
|
||||
#include "app/transaction.h"
|
||||
#include "app/ui/document_view.h"
|
||||
#include "app/ui/doc_view.h"
|
||||
#include "doc/sprite.h"
|
||||
|
||||
namespace app {
|
||||
|
||||
SpriteWrap::SpriteWrap(Doc* doc)
|
||||
: m_doc(doc)
|
||||
, m_view(App::instance()->context()->getFirstDocumentView(m_doc))
|
||||
, m_view(App::instance()->context()->getFirstDocView(m_doc))
|
||||
, m_transaction(nullptr)
|
||||
{
|
||||
}
|
||||
@ -79,7 +79,7 @@ doc::Sprite* SpriteWrap::sprite()
|
||||
ImageWrap* SpriteWrap::activeImage()
|
||||
{
|
||||
if (!m_view) {
|
||||
m_view = App::instance()->context()->getFirstDocumentView(m_doc);
|
||||
m_view = App::instance()->context()->getFirstDocView(m_doc);
|
||||
if (!m_view)
|
||||
return nullptr;
|
||||
}
|
||||
|
@ -19,7 +19,7 @@ namespace doc {
|
||||
|
||||
namespace app {
|
||||
class Doc;
|
||||
class DocumentView;
|
||||
class DocView;
|
||||
class ImageWrap;
|
||||
class Transaction;
|
||||
|
||||
@ -42,7 +42,7 @@ namespace app {
|
||||
|
||||
private:
|
||||
Doc* m_doc;
|
||||
app::DocumentView* m_view;
|
||||
app::DocView* m_view;
|
||||
app::Transaction* m_transaction;
|
||||
|
||||
Images m_images;
|
||||
|
@ -8,7 +8,7 @@
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include "app/ui/document_view.h"
|
||||
#include "app/ui/doc_view.h"
|
||||
|
||||
#include "app/app.h"
|
||||
#include "app/app_menus.h"
|
||||
@ -57,7 +57,7 @@ class AppEditor : public Editor,
|
||||
public EditorCustomizationDelegate {
|
||||
public:
|
||||
AppEditor(Doc* document,
|
||||
DocumentViewPreviewDelegate* previewDelegate)
|
||||
DocViewPreviewDelegate* previewDelegate)
|
||||
: Editor(document)
|
||||
, m_previewDelegate(previewDelegate) {
|
||||
add_observer(this);
|
||||
@ -150,7 +150,7 @@ protected:
|
||||
}
|
||||
|
||||
private:
|
||||
DocumentViewPreviewDelegate* m_previewDelegate;
|
||||
DocViewPreviewDelegate* m_previewDelegate;
|
||||
};
|
||||
|
||||
class PreviewEditor : public Editor,
|
||||
@ -188,8 +188,8 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
DocumentView::DocumentView(Doc* document, Type type,
|
||||
DocumentViewPreviewDelegate* previewDelegate)
|
||||
DocView::DocView(Doc* document, Type type,
|
||||
DocViewPreviewDelegate* previewDelegate)
|
||||
: Box(VERTICAL)
|
||||
, m_type(type)
|
||||
, m_document(document)
|
||||
@ -205,45 +205,45 @@ DocumentView::DocumentView(Doc* document, Type type,
|
||||
m_view->attachToView(m_editor);
|
||||
m_view->setExpansive(true);
|
||||
|
||||
m_editor->setDocumentView(this);
|
||||
m_editor->setDocView(this);
|
||||
m_document->add_observer(this);
|
||||
}
|
||||
|
||||
DocumentView::~DocumentView()
|
||||
DocView::~DocView()
|
||||
{
|
||||
m_document->remove_observer(this);
|
||||
delete m_editor;
|
||||
}
|
||||
|
||||
void DocumentView::getSite(Site* site) const
|
||||
void DocView::getSite(Site* site) const
|
||||
{
|
||||
m_editor->getSite(site);
|
||||
}
|
||||
|
||||
std::string DocumentView::getTabText()
|
||||
std::string DocView::getTabText()
|
||||
{
|
||||
return m_document->name();
|
||||
}
|
||||
|
||||
TabIcon DocumentView::getTabIcon()
|
||||
TabIcon DocView::getTabIcon()
|
||||
{
|
||||
return TabIcon::NONE;
|
||||
}
|
||||
|
||||
WorkspaceView* DocumentView::cloneWorkspaceView()
|
||||
WorkspaceView* DocView::cloneWorkspaceView()
|
||||
{
|
||||
return new DocumentView(m_document, Normal, m_previewDelegate);
|
||||
return new DocView(m_document, Normal, m_previewDelegate);
|
||||
}
|
||||
|
||||
void DocumentView::onWorkspaceViewSelected()
|
||||
void DocView::onWorkspaceViewSelected()
|
||||
{
|
||||
// Do nothing
|
||||
}
|
||||
|
||||
void DocumentView::onClonedFrom(WorkspaceView* from)
|
||||
void DocView::onClonedFrom(WorkspaceView* from)
|
||||
{
|
||||
Editor* newEditor = this->editor();
|
||||
Editor* srcEditor = static_cast<DocumentView*>(from)->editor();
|
||||
Editor* srcEditor = static_cast<DocView*>(from)->editor();
|
||||
|
||||
newEditor->setLayer(srcEditor->layer());
|
||||
newEditor->setFrame(srcEditor->frame());
|
||||
@ -253,14 +253,14 @@ void DocumentView::onClonedFrom(WorkspaceView* from)
|
||||
->setViewScroll(View::getView(srcEditor)->viewScroll());
|
||||
}
|
||||
|
||||
bool DocumentView::onCloseView(Workspace* workspace, bool quitting)
|
||||
bool DocView::onCloseView(Workspace* workspace, bool quitting)
|
||||
{
|
||||
if (m_editor->isMovingPixels())
|
||||
m_editor->dropMovingPixels();
|
||||
|
||||
// If there is another view for this document, just close the view.
|
||||
for (auto view : *workspace) {
|
||||
DocumentView* docView = dynamic_cast<DocumentView*>(view);
|
||||
DocView* docView = dynamic_cast<DocView*>(view);
|
||||
if (docView && docView != this &&
|
||||
docView->document() == document()) {
|
||||
workspace->removeView(this);
|
||||
@ -338,7 +338,7 @@ bool DocumentView::onCloseView(Workspace* workspace, bool quitting)
|
||||
}
|
||||
}
|
||||
|
||||
void DocumentView::onTabPopup(Workspace* workspace)
|
||||
void DocView::onTabPopup(Workspace* workspace)
|
||||
{
|
||||
Menu* menu = AppMenus::instance()->getDocumentTabPopupMenu();
|
||||
if (!menu)
|
||||
@ -351,7 +351,7 @@ void DocumentView::onTabPopup(Workspace* workspace)
|
||||
menu->showPopup(ui::get_mouse_position());
|
||||
}
|
||||
|
||||
bool DocumentView::onProcessMessage(Message* msg)
|
||||
bool DocView::onProcessMessage(Message* msg)
|
||||
{
|
||||
switch (msg->type()) {
|
||||
case kFocusEnterMessage:
|
||||
@ -361,25 +361,25 @@ bool DocumentView::onProcessMessage(Message* msg)
|
||||
return Box::onProcessMessage(msg);
|
||||
}
|
||||
|
||||
void DocumentView::onGeneralUpdate(DocEvent& ev)
|
||||
void DocView::onGeneralUpdate(DocEvent& ev)
|
||||
{
|
||||
if (m_editor->isVisible())
|
||||
m_editor->updateEditor();
|
||||
}
|
||||
|
||||
void DocumentView::onSpritePixelsModified(DocEvent& ev)
|
||||
void DocView::onSpritePixelsModified(DocEvent& ev)
|
||||
{
|
||||
if (m_editor->isVisible() &&
|
||||
m_editor->frame() == ev.frame())
|
||||
m_editor->drawSpriteClipped(ev.region());
|
||||
}
|
||||
|
||||
void DocumentView::onLayerMergedDown(DocEvent& ev)
|
||||
void DocView::onLayerMergedDown(DocEvent& ev)
|
||||
{
|
||||
m_editor->setLayer(ev.targetLayer());
|
||||
}
|
||||
|
||||
void DocumentView::onAddLayer(DocEvent& ev)
|
||||
void DocView::onAddLayer(DocEvent& ev)
|
||||
{
|
||||
if (current_editor == m_editor) {
|
||||
ASSERT(ev.layer() != NULL);
|
||||
@ -387,7 +387,7 @@ void DocumentView::onAddLayer(DocEvent& ev)
|
||||
}
|
||||
}
|
||||
|
||||
void DocumentView::onBeforeRemoveLayer(DocEvent& ev)
|
||||
void DocView::onBeforeRemoveLayer(DocEvent& ev)
|
||||
{
|
||||
Sprite* sprite = ev.sprite();
|
||||
Layer* layer = ev.layer();
|
||||
@ -410,7 +410,7 @@ void DocumentView::onBeforeRemoveLayer(DocEvent& ev)
|
||||
}
|
||||
}
|
||||
|
||||
void DocumentView::onAddFrame(DocEvent& ev)
|
||||
void DocView::onAddFrame(DocEvent& ev)
|
||||
{
|
||||
if (current_editor == m_editor)
|
||||
m_editor->setFrame(ev.frame());
|
||||
@ -418,7 +418,7 @@ void DocumentView::onAddFrame(DocEvent& ev)
|
||||
m_editor->setFrame(m_editor->frame()+1);
|
||||
}
|
||||
|
||||
void DocumentView::onRemoveFrame(DocEvent& ev)
|
||||
void DocView::onRemoveFrame(DocEvent& ev)
|
||||
{
|
||||
// Adjust current frame of all editors that are in a frame more
|
||||
// advanced that the removed one.
|
||||
@ -433,35 +433,35 @@ void DocumentView::onRemoveFrame(DocEvent& ev)
|
||||
}
|
||||
}
|
||||
|
||||
void DocumentView::onAddCel(DocEvent& ev)
|
||||
void DocView::onAddCel(DocEvent& ev)
|
||||
{
|
||||
UIContext::instance()->notifyActiveSiteChanged();
|
||||
}
|
||||
|
||||
void DocumentView::onRemoveCel(DocEvent& ev)
|
||||
void DocView::onRemoveCel(DocEvent& ev)
|
||||
{
|
||||
UIContext::instance()->notifyActiveSiteChanged();
|
||||
}
|
||||
|
||||
void DocumentView::onTotalFramesChanged(DocEvent& ev)
|
||||
void DocView::onTotalFramesChanged(DocEvent& ev)
|
||||
{
|
||||
if (m_editor->frame() >= m_editor->sprite()->totalFrames()) {
|
||||
m_editor->setFrame(m_editor->sprite()->lastFrame());
|
||||
}
|
||||
}
|
||||
|
||||
void DocumentView::onLayerRestacked(DocEvent& ev)
|
||||
void DocView::onLayerRestacked(DocEvent& ev)
|
||||
{
|
||||
m_editor->invalidate();
|
||||
}
|
||||
|
||||
void DocumentView::onNewInputPriority(InputChainElement* element,
|
||||
const ui::Message* msg)
|
||||
void DocView::onNewInputPriority(InputChainElement* element,
|
||||
const ui::Message* msg)
|
||||
{
|
||||
// Do nothing
|
||||
}
|
||||
|
||||
bool DocumentView::onCanCut(Context* ctx)
|
||||
bool DocView::onCanCut(Context* ctx)
|
||||
{
|
||||
if (ctx->checkFlags(ContextFlags::ActiveDocumentIsWritable |
|
||||
ContextFlags::ActiveLayerIsVisible |
|
||||
@ -476,7 +476,7 @@ bool DocumentView::onCanCut(Context* ctx)
|
||||
return false;
|
||||
}
|
||||
|
||||
bool DocumentView::onCanCopy(Context* ctx)
|
||||
bool DocView::onCanCopy(Context* ctx)
|
||||
{
|
||||
if (ctx->checkFlags(ContextFlags::ActiveDocumentIsWritable |
|
||||
ContextFlags::ActiveLayerIsVisible |
|
||||
@ -490,7 +490,7 @@ bool DocumentView::onCanCopy(Context* ctx)
|
||||
return false;
|
||||
}
|
||||
|
||||
bool DocumentView::onCanPaste(Context* ctx)
|
||||
bool DocView::onCanPaste(Context* ctx)
|
||||
{
|
||||
return
|
||||
(clipboard::get_current_format() == clipboard::ClipboardImage
|
||||
@ -501,7 +501,7 @@ bool DocumentView::onCanPaste(Context* ctx)
|
||||
&& !ctx->checkFlags(ContextFlags::ActiveLayerIsReference));
|
||||
}
|
||||
|
||||
bool DocumentView::onCanClear(Context* ctx)
|
||||
bool DocView::onCanClear(Context* ctx)
|
||||
{
|
||||
if (ctx->checkFlags(ContextFlags::ActiveDocumentIsWritable |
|
||||
ContextFlags::ActiveLayerIsVisible |
|
||||
@ -517,14 +517,14 @@ bool DocumentView::onCanClear(Context* ctx)
|
||||
return false;
|
||||
}
|
||||
|
||||
bool DocumentView::onCut(Context* ctx)
|
||||
bool DocView::onCut(Context* ctx)
|
||||
{
|
||||
ContextWriter writer(ctx);
|
||||
clipboard::cut(writer);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool DocumentView::onCopy(Context* ctx)
|
||||
bool DocView::onCopy(Context* ctx)
|
||||
{
|
||||
const ContextReader reader(ctx);
|
||||
if (reader.site()->document() &&
|
||||
@ -537,7 +537,7 @@ bool DocumentView::onCopy(Context* ctx)
|
||||
return false;
|
||||
}
|
||||
|
||||
bool DocumentView::onPaste(Context* ctx)
|
||||
bool DocView::onPaste(Context* ctx)
|
||||
{
|
||||
if (clipboard::get_current_format() == clipboard::ClipboardImage) {
|
||||
clipboard::paste();
|
||||
@ -547,7 +547,7 @@ bool DocumentView::onPaste(Context* ctx)
|
||||
return false;
|
||||
}
|
||||
|
||||
bool DocumentView::onClear(Context* ctx)
|
||||
bool DocView::onClear(Context* ctx)
|
||||
{
|
||||
ContextWriter writer(ctx);
|
||||
Doc* document = writer.document();
|
||||
@ -579,7 +579,7 @@ bool DocumentView::onClear(Context* ctx)
|
||||
return true;
|
||||
}
|
||||
|
||||
void DocumentView::onCancel(Context* ctx)
|
||||
void DocView::onCancel(Context* ctx)
|
||||
{
|
||||
// Deselect mask
|
||||
if (ctx->checkFlags(ContextFlags::ActiveDocumentIsWritable |
|
@ -4,8 +4,8 @@
|
||||
// This program is distributed under the terms of
|
||||
// the End-User License Agreement for Aseprite.
|
||||
|
||||
#ifndef APP_UI_DOCUMENT_VIEW_H_INCLUDED
|
||||
#define APP_UI_DOCUMENT_VIEW_H_INCLUDED
|
||||
#ifndef APP_UI_DOC_VIEW_H_INCLUDED
|
||||
#define APP_UI_DOC_VIEW_H_INCLUDED
|
||||
#pragma once
|
||||
|
||||
#include "app/doc_observer.h"
|
||||
@ -23,28 +23,28 @@ namespace app {
|
||||
class Editor;
|
||||
class Site;
|
||||
|
||||
class DocumentViewPreviewDelegate {
|
||||
class DocViewPreviewDelegate {
|
||||
public:
|
||||
virtual ~DocumentViewPreviewDelegate() { }
|
||||
virtual ~DocViewPreviewDelegate() { }
|
||||
virtual void onScrollOtherEditor(Editor* editor) = 0;
|
||||
virtual void onDisposeOtherEditor(Editor* editor) = 0;
|
||||
virtual void onPreviewOtherEditor(Editor* editor) = 0;
|
||||
};
|
||||
|
||||
class DocumentView : public ui::Box,
|
||||
public TabView,
|
||||
public app::DocObserver,
|
||||
public WorkspaceView,
|
||||
public app::InputChainElement {
|
||||
class DocView : public ui::Box,
|
||||
public TabView,
|
||||
public app::DocObserver,
|
||||
public WorkspaceView,
|
||||
public app::InputChainElement {
|
||||
public:
|
||||
enum Type {
|
||||
Normal,
|
||||
Preview
|
||||
};
|
||||
|
||||
DocumentView(Doc* document, Type type,
|
||||
DocumentViewPreviewDelegate* previewDelegate);
|
||||
~DocumentView();
|
||||
DocView(Doc* document, Type type,
|
||||
DocViewPreviewDelegate* previewDelegate);
|
||||
~DocView();
|
||||
|
||||
Doc* document() const { return m_document; }
|
||||
Editor* editor() { return m_editor; }
|
||||
@ -100,7 +100,7 @@ namespace app {
|
||||
Type m_type;
|
||||
Doc* m_document;
|
||||
ui::View* m_view;
|
||||
DocumentViewPreviewDelegate* m_previewDelegate;
|
||||
DocViewPreviewDelegate* m_previewDelegate;
|
||||
Editor* m_editor;
|
||||
};
|
||||
|
@ -49,7 +49,7 @@ namespace ui {
|
||||
|
||||
namespace app {
|
||||
class Context;
|
||||
class DocumentView;
|
||||
class DocView;
|
||||
class EditorCustomizationDelegate;
|
||||
class EditorRender;
|
||||
class PixelsMovement;
|
||||
@ -102,8 +102,8 @@ namespace app {
|
||||
|
||||
bool isActive() const;
|
||||
|
||||
DocumentView* getDocumentView() { return m_docView; }
|
||||
void setDocumentView(DocumentView* docView) { m_docView = docView; }
|
||||
DocView* getDocView() { return m_docView; }
|
||||
void setDocView(DocView* docView) { m_docView = docView; }
|
||||
|
||||
// Returns the current state.
|
||||
EditorStatePtr getState() { return m_state; }
|
||||
@ -384,7 +384,7 @@ namespace app {
|
||||
// TODO This field shouldn't be here. It should be removed when
|
||||
// editors.cpp are finally replaced with a fully funtional Workspace
|
||||
// widget.
|
||||
DocumentView* m_docView;
|
||||
DocView* m_docView;
|
||||
|
||||
gfx::Point m_oldPos;
|
||||
|
||||
|
@ -237,7 +237,7 @@ bool MovingPixelsState::onMouseDown(Editor* editor, MouseMessage* msg)
|
||||
// with a couple of Editors, in one is moving pixels and the other
|
||||
// one not.
|
||||
UIContext* ctx = UIContext::instance();
|
||||
ctx->setActiveView(editor->getDocumentView());
|
||||
ctx->setActiveView(editor->getDocView());
|
||||
|
||||
ContextBar* contextBar = App::instance()->contextBar();
|
||||
contextBar->updateForMovingPixels();
|
||||
|
@ -29,7 +29,7 @@ bool NavigateState::onMouseDown(Editor* editor, MouseMessage* msg)
|
||||
|
||||
// UIContext* context = UIContext::instance();
|
||||
// // When an editor is clicked the current view is changed.
|
||||
// context->setActiveView(editor->getDocumentView());
|
||||
// context->setActiveView(editor->getDocView());
|
||||
|
||||
// Start scroll loop
|
||||
EditorStatePtr newState(new ScrollingState());
|
||||
|
@ -110,7 +110,7 @@ bool PlayState::onMouseDown(Editor* editor, MouseMessage* msg)
|
||||
|
||||
// When an editor is clicked the current view is changed.
|
||||
UIContext* context = UIContext::instance();
|
||||
context->setActiveView(editor->getDocumentView());
|
||||
context->setActiveView(editor->getDocView());
|
||||
|
||||
// A click with right-button stops the animation
|
||||
if (msg->buttons() == kButtonRight) {
|
||||
|
@ -24,7 +24,7 @@
|
||||
#include "app/tools/pick_ink.h"
|
||||
#include "app/tools/tool.h"
|
||||
#include "app/ui/app_menuitem.h"
|
||||
#include "app/ui/document_view.h"
|
||||
#include "app/ui/doc_view.h"
|
||||
#include "app/ui/editor/drawing_state.h"
|
||||
#include "app/ui/editor/editor.h"
|
||||
#include "app/ui/editor/editor_customization_delegate.h"
|
||||
@ -136,7 +136,7 @@ bool StandbyState::onMouseDown(Editor* editor, MouseMessage* msg)
|
||||
Layer* layer = site.layer();
|
||||
|
||||
// When an editor is clicked the current view is changed.
|
||||
context->setActiveView(editor->getDocumentView());
|
||||
context->setActiveView(editor->getDocView());
|
||||
|
||||
// Start scroll loop
|
||||
if (editor->checkForScroll(msg) ||
|
||||
@ -684,7 +684,7 @@ void StandbyState::startFlipTransformation(Editor* editor, doc::algorithm::FlipT
|
||||
void StandbyState::transformSelection(Editor* editor, MouseMessage* msg, HandleType handle)
|
||||
{
|
||||
Doc* document = editor->document();
|
||||
for (auto docView : UIContext::instance()->getAllDocumentViews(document)) {
|
||||
for (auto docView : UIContext::instance()->getAllDocViews(document)) {
|
||||
if (docView->editor()->isMovingPixels()) {
|
||||
// TODO Transfer moving pixels state to this editor
|
||||
docView->editor()->dropMovingPixels();
|
||||
|
@ -21,7 +21,7 @@ namespace app {
|
||||
|
||||
// The chain of objects (in order) that want to receive
|
||||
// input/commands from the user (e.g. ColorBar, Timeline, and
|
||||
// Workspace/DocumentView). When each of these elements receive the
|
||||
// Workspace/DocView). When each of these elements receive the
|
||||
// user focus, they call InputChain::prioritize().
|
||||
class InputChain {
|
||||
public:
|
||||
|
@ -21,7 +21,7 @@
|
||||
#include "app/ui/browser_view.h"
|
||||
#include "app/ui/color_bar.h"
|
||||
#include "app/ui/context_bar.h"
|
||||
#include "app/ui/document_view.h"
|
||||
#include "app/ui/doc_view.h"
|
||||
#include "app/ui/editor/editor.h"
|
||||
#include "app/ui/editor/editor_view.h"
|
||||
#include "app/ui/home_view.h"
|
||||
@ -198,9 +198,9 @@ MainWindow::~MainWindow()
|
||||
m_menuBar->setMenu(NULL);
|
||||
}
|
||||
|
||||
DocumentView* MainWindow::getDocView()
|
||||
DocView* MainWindow::getDocView()
|
||||
{
|
||||
return dynamic_cast<DocumentView*>(m_workspace->activeView());
|
||||
return dynamic_cast<DocView*>(m_workspace->activeView());
|
||||
}
|
||||
|
||||
HomeView* MainWindow::getHomeView()
|
||||
@ -367,7 +367,7 @@ void MainWindow::onResize(ui::ResizeEvent& ev)
|
||||
// inform to the UIContext that the current view has changed.
|
||||
void MainWindow::onActiveViewChange()
|
||||
{
|
||||
if (DocumentView* docView = getDocView())
|
||||
if (DocView* docView = getDocView())
|
||||
UIContext::instance()->setActiveView(docView);
|
||||
else
|
||||
UIContext::instance()->setActiveView(nullptr);
|
||||
@ -377,7 +377,7 @@ void MainWindow::onActiveViewChange()
|
||||
|
||||
bool MainWindow::isTabModified(Tabs* tabs, TabView* tabView)
|
||||
{
|
||||
if (DocumentView* docView = dynamic_cast<DocumentView*>(tabView)) {
|
||||
if (DocView* docView = dynamic_cast<DocView*>(tabView)) {
|
||||
Doc* document = docView->document();
|
||||
return document->isModified();
|
||||
}
|
||||
@ -465,7 +465,7 @@ void MainWindow::onTabsContainerDoubleClicked(Tabs* tabs)
|
||||
void MainWindow::onMouseOverTab(Tabs* tabs, TabView* tabView)
|
||||
{
|
||||
// Note: tabView can be NULL
|
||||
if (DocumentView* docView = dynamic_cast<DocumentView*>(tabView)) {
|
||||
if (DocView* docView = dynamic_cast<DocView*>(tabView)) {
|
||||
Doc* document = docView->document();
|
||||
|
||||
std::string name;
|
||||
|
@ -27,7 +27,7 @@ namespace app {
|
||||
class ColorBar;
|
||||
class ContextBar;
|
||||
class DevConsoleView;
|
||||
class DocumentView;
|
||||
class DocView;
|
||||
class HomeView;
|
||||
class INotificationDelegate;
|
||||
class MainMenuBar;
|
||||
@ -102,7 +102,7 @@ namespace app {
|
||||
void onActiveViewChange();
|
||||
|
||||
private:
|
||||
DocumentView* getDocView();
|
||||
DocView* getDocView();
|
||||
HomeView* getHomeView();
|
||||
void configureWorkspaceLayout();
|
||||
|
||||
|
@ -16,7 +16,7 @@
|
||||
#include "app/modules/palettes.h"
|
||||
#include "app/res/palette_resource.h"
|
||||
#include "app/res/palettes_loader_delegate.h"
|
||||
#include "app/ui/document_view.h"
|
||||
#include "app/ui/doc_view.h"
|
||||
#include "app/ui/editor/editor.h"
|
||||
#include "app/ui/icon_button.h"
|
||||
#include "app/ui/skin/skin_theme.h"
|
||||
|
@ -273,7 +273,7 @@ void PreviewEditorWindow::onWindowResize()
|
||||
{
|
||||
Window::onWindowResize();
|
||||
|
||||
DocumentView* view = UIContext::instance()->activeView();
|
||||
DocView* view = UIContext::instance()->activeView();
|
||||
if (view)
|
||||
updateUsingEditor(view->editor());
|
||||
}
|
||||
@ -360,7 +360,7 @@ void PreviewEditorWindow::updateUsingEditor(Editor* editor)
|
||||
if (!miniEditor || miniEditor->document() != document) {
|
||||
destroyDocView();
|
||||
|
||||
m_docView = new DocumentView(document, DocumentView::Preview, this);
|
||||
m_docView = new DocView(document, DocView::Preview, this);
|
||||
addChild(m_docView);
|
||||
|
||||
miniEditor = m_docView->editor();
|
||||
|
@ -8,7 +8,7 @@
|
||||
#define APP_UI_PREVIEW_EDITOR_H_INCLUDED
|
||||
#pragma once
|
||||
|
||||
#include "app/ui/document_view.h"
|
||||
#include "app/ui/doc_view.h"
|
||||
#include "app/ui/editor/editor_observer.h"
|
||||
#include "doc/frame.h"
|
||||
#include "app/pref/preferences.h"
|
||||
@ -20,7 +20,7 @@ namespace app {
|
||||
|
||||
class PreviewEditorWindow : public ui::Window
|
||||
, public EditorObserver
|
||||
, public DocumentViewPreviewDelegate {
|
||||
, public DocViewPreviewDelegate {
|
||||
public:
|
||||
PreviewEditorWindow();
|
||||
~PreviewEditorWindow();
|
||||
@ -37,7 +37,7 @@ namespace app {
|
||||
void onScrollChanged(Editor* editor) override;
|
||||
void onZoomChanged(Editor* editor) override;
|
||||
|
||||
// DocumentViewPreviewDelegate impl
|
||||
// DocViewPreviewDelegate impl
|
||||
void onScrollOtherEditor(Editor* editor) override;
|
||||
void onDisposeOtherEditor(Editor* editor) override;
|
||||
void onPreviewOtherEditor(Editor* editor) override;
|
||||
@ -60,7 +60,7 @@ namespace app {
|
||||
void saveScrollPref();
|
||||
|
||||
bool m_isEnabled;
|
||||
DocumentView* m_docView;
|
||||
DocView* m_docView;
|
||||
MiniCenterButton* m_centerButton;
|
||||
MiniPlayButton* m_playButton;
|
||||
doc::frame_t m_refFrame;
|
||||
|
@ -31,7 +31,7 @@
|
||||
#include "app/transaction.h"
|
||||
#include "app/ui/app_menuitem.h"
|
||||
#include "app/ui/configure_timeline_popup.h"
|
||||
#include "app/ui/document_view.h"
|
||||
#include "app/ui/doc_view.h"
|
||||
#include "app/ui/editor/editor.h"
|
||||
#include "app/ui/input_chain.h"
|
||||
#include "app/ui/skin/skin_theme.h"
|
||||
@ -337,7 +337,7 @@ void Timeline::updateUsingEditor(Editor* editor)
|
||||
m_tagFocusBand = m_editor->tagFocusBand();
|
||||
|
||||
Site site;
|
||||
DocumentView* view = m_editor->getDocumentView();
|
||||
DocView* view = m_editor->getDocView();
|
||||
view->getSite(&site);
|
||||
|
||||
site.document()->add_observer(this);
|
||||
|
@ -14,7 +14,7 @@
|
||||
#include "app/pref/preferences.h"
|
||||
#include "app/site.h"
|
||||
#include "app/ui/color_bar.h"
|
||||
#include "app/ui/document_view.h"
|
||||
#include "app/ui/doc_view.h"
|
||||
#include "app/ui/editor/editor.h"
|
||||
#include "app/ui/input_chain.h"
|
||||
#include "app/ui/main_window.h"
|
||||
@ -58,7 +58,7 @@ bool UIContext::isUIAvailable() const
|
||||
return App::instance()->isGui();
|
||||
}
|
||||
|
||||
DocumentView* UIContext::activeView() const
|
||||
DocView* UIContext::activeView() const
|
||||
{
|
||||
if (!isUIAvailable())
|
||||
return nullptr;
|
||||
@ -68,13 +68,13 @@ DocumentView* UIContext::activeView() const
|
||||
return nullptr;
|
||||
|
||||
WorkspaceView* view = workspace->activeView();
|
||||
if (DocumentView* docView = dynamic_cast<DocumentView*>(view))
|
||||
if (DocView* docView = dynamic_cast<DocView*>(view))
|
||||
return docView;
|
||||
else
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void UIContext::setActiveView(DocumentView* docView)
|
||||
void UIContext::setActiveView(DocView* docView)
|
||||
{
|
||||
MainWindow* mainWin = App::instance()->mainWindow();
|
||||
|
||||
@ -125,7 +125,7 @@ void UIContext::onSetActiveDocument(Doc* document)
|
||||
bool notify = (lastSelectedDoc() != document);
|
||||
app::Context::onSetActiveDocument(document);
|
||||
|
||||
DocumentView* docView = getFirstDocumentView(document);
|
||||
DocView* docView = getFirstDocView(document);
|
||||
if (docView) { // The view can be null if we are in --batch mode
|
||||
setActiveView(docView);
|
||||
notify = false;
|
||||
@ -135,14 +135,14 @@ void UIContext::onSetActiveDocument(Doc* document)
|
||||
notifyActiveSiteChanged();
|
||||
}
|
||||
|
||||
DocumentView* UIContext::getFirstDocumentView(Doc* document) const
|
||||
DocView* UIContext::getFirstDocView(Doc* document) const
|
||||
{
|
||||
Workspace* workspace = App::instance()->workspace();
|
||||
if (!workspace) // Workspace (main window) can be null if we are in --batch mode
|
||||
return nullptr;
|
||||
|
||||
for (WorkspaceView* view : *workspace) {
|
||||
if (DocumentView* docView = dynamic_cast<DocumentView*>(view)) {
|
||||
if (DocView* docView = dynamic_cast<DocView*>(view)) {
|
||||
if (docView->document() == document) {
|
||||
return docView;
|
||||
}
|
||||
@ -152,13 +152,13 @@ DocumentView* UIContext::getFirstDocumentView(Doc* document) const
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
DocumentViews UIContext::getAllDocumentViews(Doc* document) const
|
||||
DocViews UIContext::getAllDocViews(Doc* document) const
|
||||
{
|
||||
Workspace* workspace = App::instance()->workspace();
|
||||
DocumentViews docViews;
|
||||
DocViews docViews;
|
||||
|
||||
for (WorkspaceView* view : *workspace) {
|
||||
if (DocumentView* docView = dynamic_cast<DocumentView*>(view)) {
|
||||
if (DocView* docView = dynamic_cast<DocView*>(view)) {
|
||||
if (docView->document() == document) {
|
||||
docViews.push_back(docView);
|
||||
}
|
||||
@ -170,7 +170,7 @@ DocumentViews UIContext::getAllDocumentViews(Doc* document) const
|
||||
|
||||
Editor* UIContext::activeEditor()
|
||||
{
|
||||
DocumentView* view = activeView();
|
||||
DocView* view = activeView();
|
||||
if (view)
|
||||
return view->editor();
|
||||
else
|
||||
@ -186,9 +186,9 @@ void UIContext::onAddDocument(Doc* doc)
|
||||
return;
|
||||
|
||||
// Add a new view for this document
|
||||
DocumentView* view = new DocumentView(
|
||||
DocView* view = new DocView(
|
||||
lastSelectedDoc(),
|
||||
DocumentView::Normal,
|
||||
DocView::Normal,
|
||||
App::instance()->mainWindow()->getPreviewEditor());
|
||||
|
||||
// Add a tab with the new view for the document
|
||||
@ -206,7 +206,7 @@ void UIContext::onRemoveDocument(Doc* doc)
|
||||
if (isUIAvailable()) {
|
||||
Workspace* workspace = App::instance()->workspace();
|
||||
|
||||
for (DocumentView* docView : getAllDocumentViews(doc)) {
|
||||
for (DocView* docView : getAllDocViews(doc)) {
|
||||
workspace->removeView(docView);
|
||||
delete docView;
|
||||
}
|
||||
@ -215,7 +215,7 @@ void UIContext::onRemoveDocument(Doc* doc)
|
||||
|
||||
void UIContext::onGetActiveSite(Site* site) const
|
||||
{
|
||||
DocumentView* view = activeView();
|
||||
DocView* view = activeView();
|
||||
if (view) {
|
||||
view->getSite(site);
|
||||
|
||||
|
@ -12,10 +12,10 @@
|
||||
#include "app/docs_observer.h"
|
||||
|
||||
namespace app {
|
||||
class DocumentView;
|
||||
class DocView;
|
||||
class Editor;
|
||||
|
||||
typedef std::vector<DocumentView*> DocumentViews;
|
||||
typedef std::vector<DocView*> DocViews;
|
||||
|
||||
class UIContext : public app::Context {
|
||||
public:
|
||||
@ -26,11 +26,11 @@ namespace app {
|
||||
|
||||
bool isUIAvailable() const override;
|
||||
|
||||
DocumentView* activeView() const;
|
||||
void setActiveView(DocumentView* documentView);
|
||||
DocView* activeView() const;
|
||||
void setActiveView(DocView* documentView);
|
||||
|
||||
DocumentView* getFirstDocumentView(Doc* document) const override;
|
||||
DocumentViews getAllDocumentViews(Doc* document) const;
|
||||
DocView* getFirstDocView(Doc* document) const override;
|
||||
DocViews getAllDocViews(Doc* document) const;
|
||||
|
||||
// Returns the current editor. It can be null.
|
||||
Editor* activeEditor();
|
||||
@ -46,7 +46,7 @@ namespace app {
|
||||
void onSetActiveDocument(Doc* doc) override;
|
||||
|
||||
private:
|
||||
DocumentView* m_lastSelectedView;
|
||||
DocView* m_lastSelectedView;
|
||||
static UIContext* m_instance;
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user