[aseprite] 49/308: Rename ui::Window::getKiller() -> closer()

Tobias Hansen thansen at moszumanska.debian.org
Tue Mar 8 02:44:51 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 06be4f7fa6332c8e98ea7d79dd984427c7adcd12
Author: David Capello <davidcapello at gmail.com>
Date:   Fri Dec 4 14:54:15 2015 -0300

    Rename ui::Window::getKiller() -> closer()
---
 src/app/commands/cmd_canvas_size.cpp            |  2 +-
 src/app/commands/cmd_color_quantization.cpp     |  2 +-
 src/app/commands/cmd_duplicate_sprite.cpp       |  2 +-
 src/app/commands/cmd_export_sprite_sheet.cpp    |  2 +-
 src/app/commands/cmd_frame_properties.cpp       |  2 +-
 src/app/commands/cmd_goto_frame.cpp             |  2 +-
 src/app/commands/cmd_grid.cpp                   |  2 +-
 src/app/commands/cmd_import_sprite_sheet.cpp    |  2 +-
 src/app/commands/cmd_keyboard_shortcuts.cpp     |  2 +-
 src/app/commands/cmd_mask_by_color.cpp          |  2 +-
 src/app/commands/cmd_new_file.cpp               |  2 +-
 src/app/commands/cmd_new_layer.cpp              |  2 +-
 src/app/commands/cmd_new_layer_set.cpp          |  2 +-
 src/app/commands/cmd_options.cpp                |  2 +-
 src/app/commands/cmd_palette_size.cpp           |  2 +-
 src/app/commands/cmd_paste_text.cpp             |  2 +-
 src/app/commands/cmd_sprite_properties.cpp      |  2 +-
 src/app/commands/cmd_sprite_size.cpp            |  2 +-
 src/app/commands/filters/color_curve_editor.cpp |  4 ++--
 src/app/commands/filters/filter_window.cpp      |  2 +-
 src/app/file/gif_format.cpp                     |  2 +-
 src/app/file/jpeg_format.cpp                    |  2 +-
 src/app/file/webp_format.cpp                    |  2 +-
 src/app/send_crash.cpp                          |  2 +-
 src/app/ui/file_selector.cpp                    |  6 +++---
 src/app/ui/frame_tag_window.cpp                 |  2 +-
 src/ui/alert.cpp                                |  6 +++---
 src/ui/window.cpp                               | 15 +++++----------
 src/ui/window.h                                 |  6 +++---
 29 files changed, 40 insertions(+), 45 deletions(-)

diff --git a/src/app/commands/cmd_canvas_size.cpp b/src/app/commands/cmd_canvas_size.cpp
index 8f79ead..91b5e5d 100644
--- a/src/app/commands/cmd_canvas_size.cpp
+++ b/src/app/commands/cmd_canvas_size.cpp
@@ -80,7 +80,7 @@ public:
     m_editor->backToPreviousState();
   }
 
-  bool pressedOk() { return getKiller() == ok(); }
+  bool pressedOk() { return closer() == ok(); }
 
   int getWidth()  { return width()->textInt(); }
   int getHeight() { return height()->textInt(); }
diff --git a/src/app/commands/cmd_color_quantization.cpp b/src/app/commands/cmd_color_quantization.cpp
index 39be8fa..11d777a 100644
--- a/src/app/commands/cmd_color_quantization.cpp
+++ b/src/app/commands/cmd_color_quantization.cpp
@@ -123,7 +123,7 @@ void ColorQuantizationCommand::onExecute(Context* context)
     }
 
     window.openWindowInForeground();
-    if (window.getKiller() != window.ok())
+    if (window.closer() != window.ok())
       return;
 
     bool withAlpha = window.alphaChannel()->isSelected();
diff --git a/src/app/commands/cmd_duplicate_sprite.cpp b/src/app/commands/cmd_duplicate_sprite.cpp
index d599fc5..f434348 100644
--- a/src/app/commands/cmd_duplicate_sprite.cpp
+++ b/src/app/commands/cmd_duplicate_sprite.cpp
@@ -68,7 +68,7 @@ void DuplicateSpriteCommand::onExecute(Context* context)
   // Open the window
   window.openWindowInForeground();
 
-  if (window.getKiller() == window.ok()) {
+  if (window.closer() == window.ok()) {
     set_config_bool("DuplicateSprite", "Flatten", window.flatten()->isSelected());
 
     // Make a copy of the document
diff --git a/src/app/commands/cmd_export_sprite_sheet.cpp b/src/app/commands/cmd_export_sprite_sheet.cpp
index bc8a1b7..1f320c0 100644
--- a/src/app/commands/cmd_export_sprite_sheet.cpp
+++ b/src/app/commands/cmd_export_sprite_sheet.cpp
@@ -402,7 +402,7 @@ public:
   }
 
   bool ok() const {
-    return getKiller() == exportButton();
+    return closer() == exportButton();
   }
 
   app::SpriteSheetType spriteSheetTypeValue() const {
diff --git a/src/app/commands/cmd_frame_properties.cpp b/src/app/commands/cmd_frame_properties.cpp
index 30212cf..d1b34fe 100644
--- a/src/app/commands/cmd_frame_properties.cpp
+++ b/src/app/commands/cmd_frame_properties.cpp
@@ -118,7 +118,7 @@ void FramePropertiesCommand::onExecute(Context* context)
   window.frlen()->setTextf("%d", sprite->frameDuration(firstFrame));
 
   window.openWindowInForeground();
-  if (window.getKiller() == window.ok()) {
+  if (window.closer() == window.ok()) {
     int num = window.frlen()->textInt();
 
     ContextWriter writer(reader);
diff --git a/src/app/commands/cmd_goto_frame.cpp b/src/app/commands/cmd_goto_frame.cpp
index 0952854..5fc89cc 100644
--- a/src/app/commands/cmd_goto_frame.cpp
+++ b/src/app/commands/cmd_goto_frame.cpp
@@ -122,7 +122,7 @@ protected:
       window.frame()->setTextf("%d", editor->frame()+1);
 
       window.openWindowInForeground();
-      if (window.getKiller() != window.ok())
+      if (window.closer() != window.ok())
         return editor->frame();
 
       m_frame = window.frame()->textInt();
diff --git a/src/app/commands/cmd_grid.cpp b/src/app/commands/cmd_grid.cpp
index 0930b34..e091b2c 100644
--- a/src/app/commands/cmd_grid.cpp
+++ b/src/app/commands/cmd_grid.cpp
@@ -168,7 +168,7 @@ void GridSettingsCommand::onExecute(Context* context)
 
   window->openWindowInForeground();
 
-  if (window->getKiller() == button_ok) {
+  if (window->closer() == button_ok) {
     bounds.x = grid_x->textInt();
     bounds.y = grid_y->textInt();
     bounds.w = grid_w->textInt();
diff --git a/src/app/commands/cmd_import_sprite_sheet.cpp b/src/app/commands/cmd_import_sprite_sheet.cpp
index c53430a..5aea5b5 100644
--- a/src/app/commands/cmd_import_sprite_sheet.cpp
+++ b/src/app/commands/cmd_import_sprite_sheet.cpp
@@ -93,7 +93,7 @@ public:
   }
 
   bool ok() const {
-    return getKiller() == import();
+    return closer() == import();
   }
 
   Document* document() const {
diff --git a/src/app/commands/cmd_keyboard_shortcuts.cpp b/src/app/commands/cmd_keyboard_shortcuts.cpp
index 3ce5891..d03a8f2 100644
--- a/src/app/commands/cmd_keyboard_shortcuts.cpp
+++ b/src/app/commands/cmd_keyboard_shortcuts.cpp
@@ -544,7 +544,7 @@ void KeyboardShortcutsCommand::onExecute(Context* context)
   window.setVisible(true);
   window.openWindowInForeground();
 
-  if (window.getKiller() == window.ok()) {
+  if (window.closer() == window.ok()) {
     // Save keyboard shortcuts in configuration file
     {
       ResourceFinder rf;
diff --git a/src/app/commands/cmd_mask_by_color.cpp b/src/app/commands/cmd_mask_by_color.cpp
index e981371..3ddba6e 100644
--- a/src/app/commands/cmd_mask_by_color.cpp
+++ b/src/app/commands/cmd_mask_by_color.cpp
@@ -151,7 +151,7 @@ void MaskByColorCommand::onExecute(Context* context)
   // Open the window
   m_window->openWindowInForeground();
 
-  bool apply = (m_window->getKiller() == button_ok);
+  bool apply = (m_window->closer() == button_ok);
 
   ContextWriter writer(reader);
   Document* document(writer.document());
diff --git a/src/app/commands/cmd_new_file.cpp b/src/app/commands/cmd_new_file.cpp
index 95ceca9..2f28a85 100644
--- a/src/app/commands/cmd_new_file.cpp
+++ b/src/app/commands/cmd_new_file.cpp
@@ -105,7 +105,7 @@ void NewFileCommand::onExecute(Context* context)
   // Open the window
   window.openWindowInForeground();
 
-  if (window.getKiller() == window.okButton()) {
+  if (window.closer() == window.okButton()) {
     bool ok = false;
 
     // Get the options
diff --git a/src/app/commands/cmd_new_layer.cpp b/src/app/commands/cmd_new_layer.cpp
index b33c485..8c6b16b 100644
--- a/src/app/commands/cmd_new_layer.cpp
+++ b/src/app/commands/cmd_new_layer.cpp
@@ -96,7 +96,7 @@ void NewLayerCommand::onExecute(Context* context)
 
     window->openWindowInForeground();
 
-    if (window->getKiller() != window->findChild("ok"))
+    if (window->closer() != window->findChild("ok"))
       return;
 
     name = window->findChild("name")->text();
diff --git a/src/app/commands/cmd_new_layer_set.cpp b/src/app/commands/cmd_new_layer_set.cpp
index 1eb1263..f7c257a 100644
--- a/src/app/commands/cmd_new_layer_set.cpp
+++ b/src/app/commands/cmd_new_layer_set.cpp
@@ -61,7 +61,7 @@ void NewLayerSetCommand::onExecute(Context* context)
 
   window->openWindowInForeground();
 
-  if (window->getKiller() != window->findChild("ok"))
+  if (window->closer() != window->findChild("ok"))
     return;
 
   std::string name = window->findChild("name")->text();
diff --git a/src/app/commands/cmd_options.cpp b/src/app/commands/cmd_options.cpp
index f6bedc3..b7fa837 100644
--- a/src/app/commands/cmd_options.cpp
+++ b/src/app/commands/cmd_options.cpp
@@ -169,7 +169,7 @@ public:
   }
 
   bool ok() {
-    return (getKiller() == buttonOk());
+    return (closer() == buttonOk());
   }
 
   void saveConfig() {
diff --git a/src/app/commands/cmd_palette_size.cpp b/src/app/commands/cmd_palette_size.cpp
index 2c1b668..4b38564 100644
--- a/src/app/commands/cmd_palette_size.cpp
+++ b/src/app/commands/cmd_palette_size.cpp
@@ -60,7 +60,7 @@ void PaletteSizeCommand::onExecute(Context* context)
   app::gen::PaletteSize window;
   window.colors()->setTextf("%d", palette.size());
   window.openWindowInForeground();
-  if (window.getKiller() == window.ok()) {
+  if (window.closer() == window.ok()) {
     int ncolors = window.colors()->textInt();
     if (ncolors == palette.size())
       return;
diff --git a/src/app/commands/cmd_paste_text.cpp b/src/app/commands/cmd_paste_text.cpp
index 389b1d3..7b8a928 100644
--- a/src/app/commands/cmd_paste_text.cpp
+++ b/src/app/commands/cmd_paste_text.cpp
@@ -156,7 +156,7 @@ void PasteTextCommand::onExecute(Context* ctx)
   window.userText()->setText(last_text_used);
 
   window.openWindowInForeground();
-  if (window.getKiller() != window.ok())
+  if (window.closer() != window.ok())
     return;
 
   last_text_used = window.userText()->text();
diff --git a/src/app/commands/cmd_sprite_properties.cpp b/src/app/commands/cmd_sprite_properties.cpp
index 5d8f7d0..9e1ee6a 100644
--- a/src/app/commands/cmd_sprite_properties.cpp
+++ b/src/app/commands/cmd_sprite_properties.cpp
@@ -121,7 +121,7 @@ void SpritePropertiesCommand::onExecute(Context* context)
   window.setVisible(true);
   window.openWindowInForeground();
 
-  if (window.getKiller() == window.ok()) {
+  if (window.closer() == window.ok()) {
     if (color_button) {
       ContextWriter writer(context);
       Sprite* sprite(writer.sprite());
diff --git a/src/app/commands/cmd_sprite_size.cpp b/src/app/commands/cmd_sprite_size.cpp
index 20fae3c..eb92807 100644
--- a/src/app/commands/cmd_sprite_size.cpp
+++ b/src/app/commands/cmd_sprite_size.cpp
@@ -310,7 +310,7 @@ void SpriteSizeCommand::onExecute(Context* context)
     window.openWindowInForeground();
     save_window_pos(&window, "SpriteSize");
 
-    if (window.getKiller() != window.ok())
+    if (window.closer() != window.ok())
       return;
 
     new_width = window.widthPx()->textInt();
diff --git a/src/app/commands/filters/color_curve_editor.cpp b/src/app/commands/filters/color_curve_editor.cpp
index 7e7e9cf..31d39a7 100644
--- a/src/app/commands/filters/color_curve_editor.cpp
+++ b/src/app/commands/filters/color_curve_editor.cpp
@@ -266,14 +266,14 @@ bool ColorCurveEditor::editNodeManually(gfx::Point& viewPt)
 
   window.openWindowInForeground();
 
-  if (window.getKiller() == window.ok()) {
+  if (window.closer() == window.ok()) {
     viewPt.x = int(window.x()->textDouble());
     viewPt.y = int(window.y()->textDouble());
     viewPt.x = MID(0, viewPt.x, 255);
     viewPt.y = MID(0, viewPt.y, 255);
     return true;
   }
-  else if (window.getKiller() == window.deleteButton()) {
+  else if (window.closer() == window.deleteButton()) {
     removePoint(&viewPt);
     return true;
   }
diff --git a/src/app/commands/filters/filter_window.cpp b/src/app/commands/filters/filter_window.cpp
index 0a0bdfb..89e920a 100644
--- a/src/app/commands/filters/filter_window.cpp
+++ b/src/app/commands/filters/filter_window.cpp
@@ -100,7 +100,7 @@ bool FilterWindow::doModal()
   openWindowInForeground();
 
   // Did the user press OK?
-  if (getKiller() == &m_okButton) {
+  if (closer() == &m_okButton) {
     m_preview.stop();
 
     // Apply the filter in background
diff --git a/src/app/file/gif_format.cpp b/src/app/file/gif_format.cpp
index c1e742c..c702102 100644
--- a/src/app/file/gif_format.cpp
+++ b/src/app/file/gif_format.cpp
@@ -1326,7 +1326,7 @@ base::SharedPtr<FormatOptions> GifFormat::onGetFormatOptions(FileOp* fop)
 
     win.openWindowInForeground();
 
-    if (win.getKiller() == win.ok()) {
+    if (win.closer() == win.ok()) {
       gif_options->setInterlaced(win.interlaced()->isSelected());
       gif_options->setLoop(win.loop()->isSelected());
 
diff --git a/src/app/file/jpeg_format.cpp b/src/app/file/jpeg_format.cpp
index 8c865d0..5147ce3 100644
--- a/src/app/file/jpeg_format.cpp
+++ b/src/app/file/jpeg_format.cpp
@@ -376,7 +376,7 @@ base::SharedPtr<FormatOptions> JpegFormat::onGetFormatOptions(FileOp* fop)
 
     window->openWindowInForeground();
 
-    if (window->getKiller() == ok) {
+    if (window->closer() == ok) {
       jpeg_options->quality = slider_quality->getValue() / 10.0f;
       set_config_float("JPEG", "Quality", jpeg_options->quality);
     }
diff --git a/src/app/file/webp_format.cpp b/src/app/file/webp_format.cpp
index ea15518..d52a889 100644
--- a/src/app/file/webp_format.cpp
+++ b/src/app/file/webp_format.cpp
@@ -349,7 +349,7 @@ base::SharedPtr<FormatOptions> WebPFormat::onGetFormatOptions(FileOp* fop)
 
     win.openWindowInForeground();
 
-    if (win.getKiller() == win.ok()) {
+    if (win.closer() == win.ok()) {
       webp_options->setQuality(win.quality()->getValue());
       webp_options->setMethod(win.compression()->getValue());
       webp_options->setLossless(win.lossless()->isSelected());
diff --git a/src/app/send_crash.cpp b/src/app/send_crash.cpp
index cc6cfa1..654a48b 100644
--- a/src/app/send_crash.cpp
+++ b/src/app/send_crash.cpp
@@ -66,7 +66,7 @@ void SendCrash::notificationClick()
   dlg.filename()->Click.connect(Bind(&SendCrash::onClickFilename, this));
 
   dlg.openWindowInForeground();
-  if (dlg.getKiller() == dlg.deleteFile()) {
+  if (dlg.closer() == dlg.deleteFile()) {
     try {
       base::delete_file(m_dumpFilename);
       m_dumpFilename = "";
diff --git a/src/app/ui/file_selector.cpp b/src/app/ui/file_selector.cpp
index ecec82e..e79ab46 100644
--- a/src/app/ui/file_selector.cpp
+++ b/src/app/ui/file_selector.cpp
@@ -445,8 +445,8 @@ std::string FileSelector::show(
   // open the window and run... the user press ok?
 again:
   openWindowInForeground();
-  if (getKiller() == ok ||
-      getKiller() == m_fileList) {
+  if (closer() == ok ||
+      closer() == m_fileList) {
     // open the selected file
     IFileItem* folder = m_fileList->getCurrentFolder();
     ASSERT(folder);
@@ -732,7 +732,7 @@ void FileSelector::onNewFolder()
   app::gen::NewFolderWindow window;
 
   window.openWindowInForeground();
-  if (window.getKiller() == window.ok()) {
+  if (window.closer() == window.ok()) {
     IFileItem* currentFolder = m_fileList->getCurrentFolder();
     if (currentFolder) {
       std::string dirname = window.name()->text();
diff --git a/src/app/ui/frame_tag_window.cpp b/src/app/ui/frame_tag_window.cpp
index bcf3faa..8bf17d2 100644
--- a/src/app/ui/frame_tag_window.cpp
+++ b/src/app/ui/frame_tag_window.cpp
@@ -40,7 +40,7 @@ FrameTagWindow::FrameTagWindow(const doc::Sprite* sprite, const doc::FrameTag* f
 bool FrameTagWindow::show()
 {
   openWindowInForeground();
-  return (getKiller() == ok());
+  return (closer() == ok());
 }
 
 std::string FrameTagWindow::nameValue()
diff --git a/src/ui/alert.cpp b/src/ui/alert.cpp
index c755ade..40b7f85 100644
--- a/src/ui/alert.cpp
+++ b/src/ui/alert.cpp
@@ -112,11 +112,11 @@ int Alert::show(const char* format, ...)
   // Open it
   window->openWindowInForeground();
 
-  // Check the killer
+  // Check the closer
   int ret = 0;
-  if (Widget* killer = window->getKiller()) {
+  if (Widget* closer = window->closer()) {
     for (int i=0; i<(int)buttons.size(); ++i) {
-      if (killer == buttons[i]) {
+      if (closer == buttons[i]) {
         ret = i+1;
         break;
       }
diff --git a/src/ui/window.cpp b/src/ui/window.cpp
index e2890a3..09e7b58 100644
--- a/src/ui/window.cpp
+++ b/src/ui/window.cpp
@@ -41,7 +41,7 @@ static gfx::Rect* clickedWindowPos = NULL;
 Window::Window(Type type, const std::string& text)
   : Widget(kWindowWidget)
 {
-  m_killer = NULL;
+  m_closer = NULL;
   m_isDesktop = (type == DesktopWindow);
   m_isMoveable = !m_isDesktop;
   m_isSizeable = !m_isDesktop;
@@ -63,11 +63,6 @@ Window::~Window()
   manager()->_closeWindow(this, false);
 }
 
-Widget* Window::getKiller() const
-{
-  return m_killer;
-}
-
 void Window::setAutoRemap(bool state)
 {
   m_isAutoRemap = state;
@@ -252,14 +247,14 @@ void Window::openWindowInForeground()
   m_isForeground = false;
 }
 
-void Window::closeWindow(Widget* killer)
+void Window::closeWindow(Widget* closer)
 {
-  m_killer = killer;
+  m_closer = closer;
 
   manager()->_closeWindow(this, true);
 
   // Close event
-  CloseEvent ev(killer);
+  CloseEvent ev(closer);
   onClose(ev);
 }
 
@@ -277,7 +272,7 @@ bool Window::onProcessMessage(Message* msg)
   switch (msg->type()) {
 
     case kOpenMessage:
-      m_killer = NULL;
+      m_closer = NULL;
       break;
 
     case kCloseMessage:
diff --git a/src/ui/window.h b/src/ui/window.h
index 1080224..48017b0 100644
--- a/src/ui/window.h
+++ b/src/ui/window.h
@@ -24,7 +24,7 @@ namespace ui {
     explicit Window(Type type, const std::string& text = "");
     ~Window();
 
-    Widget* getKiller() const;
+    Widget* closer() const { return m_closer; }
 
     void setAutoRemap(bool state);
     void setMoveable(bool state);
@@ -39,7 +39,7 @@ namespace ui {
 
     void openWindow();
     void openWindowInForeground();
-    void closeWindow(Widget* killer);
+    void closeWindow(Widget* closer);
 
     bool isTopLevel();
     bool isForeground() const { return m_isForeground; }
@@ -74,7 +74,7 @@ namespace ui {
     void limitSize(int* w, int* h);
     void moveWindow(const gfx::Rect& rect, bool use_blit);
 
-    Widget* m_killer;
+    Widget* m_closer;
     bool m_isDesktop : 1;
     bool m_isMoveable : 1;
     bool m_isSizeable : 1;

-- 
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