[aseprite] 234/308: Minor refactor: rename DocumentView::getEditor/Document() -> editor/document()

Tobias Hansen thansen at moszumanska.debian.org
Tue Mar 8 02:45:14 UTC 2016


This is an automated email from the git hooks/post-receive script.

thansen pushed a commit to branch master
in repository aseprite.

commit c49ec61fa0773f91353e0a42a9d3c451730e7aff
Author: David Capello <davidcapello at gmail.com>
Date:   Sat Feb 13 01:33:43 2016 -0300

    Minor refactor: rename DocumentView::getEditor/Document() -> editor/document()
---
 src/app/app.cpp                     |  2 +-
 src/app/commands/cmd_new_frame.cpp  |  4 ++--
 src/app/ui/document_view.cpp        |  8 ++++----
 src/app/ui/document_view.h          |  6 +++---
 src/app/ui/editor/standby_state.cpp |  6 +++---
 src/app/ui/main_window.cpp          |  6 +++---
 src/app/ui/preview_editor.cpp       | 18 +++++++++---------
 src/app/ui_context.cpp              | 10 +++++-----
 8 files changed, 30 insertions(+), 30 deletions(-)

diff --git a/src/app/app.cpp b/src/app/app.cpp
index 5b23e6c..22c67ab 100644
--- a/src/app/app.cpp
+++ b/src/app/app.cpp
@@ -749,7 +749,7 @@ void App::updateDisplayTitleBar()
   DocumentView* docView = UIContext::instance()->activeView();
   if (docView) {
     // Prepend the document's filename.
-    title += docView->getDocument()->name();
+    title += docView->document()->name();
     title += " - ";
   }
 
diff --git a/src/app/commands/cmd_new_frame.cpp b/src/app/commands/cmd_new_frame.cpp
index 807f592..53f2c82 100644
--- a/src/app/commands/cmd_new_frame.cpp
+++ b/src/app/commands/cmd_new_frame.cpp
@@ -1,5 +1,5 @@
 // Aseprite
-// Copyright (C) 2001-2015  David Capello
+// Copyright (C) 2001-2016  David Capello
 //
 // This program is free software; you can redistribute it and/or modify
 // it under the terms of the GNU General Public License version 2 as
@@ -168,7 +168,7 @@ void NewFrameCommand::onExecute(Context* context)
           // TODO should we use DocumentObserver?
           if (UIContext::instance() == context) {
             if (DocumentView* view = UIContext::instance()->activeView())
-              view->getEditor()->setFrame(writer.frame()+1);
+              view->editor()->setFrame(writer.frame()+1);
           }
         }
         break;
diff --git a/src/app/ui/document_view.cpp b/src/app/ui/document_view.cpp
index 14a3041..b8e3a13 100644
--- a/src/app/ui/document_view.cpp
+++ b/src/app/ui/document_view.cpp
@@ -1,5 +1,5 @@
 // Aseprite
-// Copyright (C) 2001-2015  David Capello
+// Copyright (C) 2001-2016  David Capello
 //
 // This program is free software; you can redistribute it and/or modify
 // it under the terms of the GNU General Public License version 2 as
@@ -207,8 +207,8 @@ void DocumentView::onWorkspaceViewSelected()
 
 void DocumentView::onClonedFrom(WorkspaceView* from)
 {
-  Editor* newEditor = getEditor();
-  Editor* srcEditor = static_cast<DocumentView*>(from)->getEditor();
+  Editor* newEditor = this->editor();
+  Editor* srcEditor = static_cast<DocumentView*>(from)->editor();
 
   newEditor->setLayer(srcEditor->layer());
   newEditor->setFrame(srcEditor->frame());
@@ -227,7 +227,7 @@ bool DocumentView::onCloseView(Workspace* workspace)
   for (auto view : *workspace) {
     DocumentView* docView = dynamic_cast<DocumentView*>(view);
     if (docView && docView != this &&
-        docView->getDocument() == getDocument()) {
+        docView->document() == document()) {
       workspace->removeView(this);
       delete this;
       return true;
diff --git a/src/app/ui/document_view.h b/src/app/ui/document_view.h
index 807ce9b..4f03be8 100644
--- a/src/app/ui/document_view.h
+++ b/src/app/ui/document_view.h
@@ -1,5 +1,5 @@
 // Aseprite
-// Copyright (C) 2001-2015  David Capello
+// Copyright (C) 2001-2016  David Capello
 //
 // This program is free software; you can redistribute it and/or modify
 // it under the terms of the GNU General Public License version 2 as
@@ -50,9 +50,9 @@ namespace app {
                  DocumentViewPreviewDelegate* previewDelegate);
     ~DocumentView();
 
-    Document* getDocument() const { return m_document; }
+    Document* document() const { return m_document; }
+    Editor* editor() { return m_editor; }
     void getSite(doc::Site* site) const;
-    Editor* getEditor() { return m_editor; }
 
     bool isPreview() { return m_type == Preview; }
 
diff --git a/src/app/ui/editor/standby_state.cpp b/src/app/ui/editor/standby_state.cpp
index a7bea6b..2930e8e 100644
--- a/src/app/ui/editor/standby_state.cpp
+++ b/src/app/ui/editor/standby_state.cpp
@@ -1,5 +1,5 @@
 // Aseprite
-// Copyright (C) 2001-2015  David Capello
+// Copyright (C) 2001-2016  David Capello
 //
 // This program is free software; you can redistribute it and/or modify
 // it under the terms of the GNU General Public License version 2 as
@@ -464,9 +464,9 @@ void StandbyState::transformSelection(Editor* editor, MouseMessage* msg, HandleT
   Document* document = editor->document();
 
   for (auto docView : UIContext::instance()->getAllDocumentViews(document)) {
-    if (docView->getEditor()->isMovingPixels()) {
+    if (docView->editor()->isMovingPixels()) {
       // TODO Transfer moving pixels state to this editor
-      docView->getEditor()->dropMovingPixels();
+      docView->editor()->dropMovingPixels();
     }
   }
 
diff --git a/src/app/ui/main_window.cpp b/src/app/ui/main_window.cpp
index 9bfb668..919ecc8 100644
--- a/src/app/ui/main_window.cpp
+++ b/src/app/ui/main_window.cpp
@@ -1,5 +1,5 @@
 // Aseprite
-// Copyright (C) 2001-2015  David Capello
+// Copyright (C) 2001-2016  David Capello
 //
 // This program is free software; you can redistribute it and/or modify
 // it under the terms of the GNU General Public License version 2 as
@@ -267,7 +267,7 @@ void MainWindow::onActiveViewChange()
 bool MainWindow::isTabModified(Tabs* tabs, TabView* tabView)
 {
   if (DocumentView* docView = dynamic_cast<DocumentView*>(tabView)) {
-    Document* document = docView->getDocument();
+    Document* document = docView->document();
     return document->isModified();
   }
   else {
@@ -327,7 +327,7 @@ void MainWindow::onMouseOverTab(Tabs* tabs, TabView* tabView)
 {
   // Note: tabView can be NULL
   if (DocumentView* docView = dynamic_cast<DocumentView*>(tabView)) {
-    Document* document = docView->getDocument();
+    Document* document = docView->document();
     m_statusBar->setStatusText(250, "%s",
       document->filename().c_str());
   }
diff --git a/src/app/ui/preview_editor.cpp b/src/app/ui/preview_editor.cpp
index ad32a64..0bd3e54 100644
--- a/src/app/ui/preview_editor.cpp
+++ b/src/app/ui/preview_editor.cpp
@@ -266,17 +266,17 @@ void PreviewEditorWindow::onWindowResize()
 
   DocumentView* view = UIContext::instance()->activeView();
   if (view)
-    updateUsingEditor(view->getEditor());
+    updateUsingEditor(view->editor());
 }
 
 bool PreviewEditorWindow::hasDocument() const
 {
-  return (m_docView && m_docView->getDocument() != nullptr);
+  return (m_docView && m_docView->document() != nullptr);
 }
 
 DocumentPreferences& PreviewEditorWindow::docPref()
 {
-  Document* doc = (m_docView ? m_docView->getDocument(): nullptr);
+  Document* doc = (m_docView ? m_docView->document(): nullptr);
   return Preferences::instance().document(doc);
 }
 
@@ -293,7 +293,7 @@ void PreviewEditorWindow::onCenterClicked()
 
 void PreviewEditorWindow::onPlayClicked()
 {
-  Editor* miniEditor = (m_docView ? m_docView->getEditor(): nullptr);
+  Editor* miniEditor = (m_docView ? m_docView->editor(): nullptr);
   if (!miniEditor || !miniEditor->document())
     return;
 
@@ -307,7 +307,7 @@ void PreviewEditorWindow::onPlayClicked()
 
 void PreviewEditorWindow::onPopupSpeed()
 {
-  Editor* miniEditor = (m_docView ? m_docView->getEditor(): nullptr);
+  Editor* miniEditor = (m_docView ? m_docView->editor(): nullptr);
   if (!miniEditor || !miniEditor->document())
     return;
 
@@ -330,7 +330,7 @@ void PreviewEditorWindow::updateUsingEditor(Editor* editor)
   m_relatedEditor = editor;
 
   Document* document = editor->document();
-  Editor* miniEditor = (m_docView ? m_docView->getEditor(): NULL);
+  Editor* miniEditor = (m_docView ? m_docView->editor(): nullptr);
 
   if (!isVisible())
     openWindow();
@@ -346,7 +346,7 @@ void PreviewEditorWindow::updateUsingEditor(Editor* editor)
     m_docView = new DocumentView(document, DocumentView::Preview, this);
     addChild(m_docView);
 
-    miniEditor = m_docView->getEditor();
+    miniEditor = m_docView->editor();
     miniEditor->setZoom(render::Zoom::fromScale(docPref.preview.zoom()));
     miniEditor->setLayer(editor->layer());
     miniEditor->setFrame(editor->frame());
@@ -421,7 +421,7 @@ void PreviewEditorWindow::saveScrollPref()
   if (!m_docView)
     return;
 
-  Editor* miniEditor = m_docView->getEditor();
+  Editor* miniEditor = m_docView->editor();
   ASSERT(miniEditor);
 
   docPref().preview.scroll(View::getView(miniEditor)->viewScroll());
@@ -454,7 +454,7 @@ void PreviewEditorWindow::hideWindow()
 void PreviewEditorWindow::destroyDocView()
 {
   if (m_docView) {
-    m_docView->getEditor()->removeObserver(this);
+    m_docView->editor()->removeObserver(this);
 
     delete m_docView;
     m_docView = nullptr;
diff --git a/src/app/ui_context.cpp b/src/app/ui_context.cpp
index 222d305..f5b5b8a 100644
--- a/src/app/ui_context.cpp
+++ b/src/app/ui_context.cpp
@@ -100,7 +100,7 @@ void UIContext::setActiveView(DocumentView* docView)
       mainWin->getWorkspace()->setActiveView(docView);
   }
 
-  current_editor = (docView ? docView->getEditor(): NULL);
+  current_editor = (docView ? docView->editor(): nullptr);
 
   if (current_editor)
     current_editor->requestFocus();
@@ -151,7 +151,7 @@ DocumentView* UIContext::getFirstDocumentView(doc::Document* document) const
 
   for (WorkspaceView* view : *workspace) {
     if (DocumentView* docView = dynamic_cast<DocumentView*>(view)) {
-      if (docView->getDocument() == document) {
+      if (docView->document() == document) {
         return docView;
       }
     }
@@ -167,7 +167,7 @@ DocumentViews UIContext::getAllDocumentViews(doc::Document* document) const
 
   for (WorkspaceView* view : *workspace) {
     if (DocumentView* docView = dynamic_cast<DocumentView*>(view)) {
-      if (docView->getDocument() == document) {
+      if (docView->document() == document) {
         docViews.push_back(docView);
       }
     }
@@ -180,7 +180,7 @@ Editor* UIContext::activeEditor()
 {
   DocumentView* view = activeView();
   if (view)
-    return view->getEditor();
+    return view->editor();
   else
     return NULL;
 }
@@ -203,7 +203,7 @@ void UIContext::onAddDocument(doc::Document* doc)
   App::instance()->getMainWindow()->getWorkspace()->addView(view);
 
   setActiveView(view);
-  view->getEditor()->setDefaultScroll();
+  view->editor()->setDefaultScroll();
 }
 
 void UIContext::onRemoveDocument(doc::Document* doc)

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/aseprite.git



More information about the Pkg-games-commits mailing list