mirror of
https://github.com/aseprite/aseprite.git
synced 2025-03-14 13:21:34 +00:00
Replace base::Signal/Observable* with obs::signal/observable
We can use the obs library directly for signal/slots and observable objects.
This commit is contained in:
parent
3ee397a0ec
commit
6377b550e3
@ -9,9 +9,9 @@
|
||||
#pragma once
|
||||
|
||||
#include "app/app_brushes.h"
|
||||
#include "base/signal.h"
|
||||
#include "base/unique_ptr.h"
|
||||
#include "doc/pixel_format.h"
|
||||
#include "obs/signal.h"
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
@ -88,8 +88,8 @@ namespace app {
|
||||
InputChain& inputChain();
|
||||
|
||||
// App Signals
|
||||
base::Signal0<void> Exit;
|
||||
base::Signal0<void> PaletteChange;
|
||||
obs::signal<void()> Exit;
|
||||
obs::signal<void()> PaletteChange;
|
||||
|
||||
private:
|
||||
typedef std::vector<std::string> FileList;
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Aseprite
|
||||
// Copyright (C) 2001-2015 David Capello
|
||||
// Copyright (C) 2001-2016 David Capello
|
||||
//
|
||||
// This program is distributed under the terms of
|
||||
// the End-User License Agreement for Aseprite.
|
||||
@ -9,8 +9,8 @@
|
||||
#pragma once
|
||||
|
||||
#include "app/brush_slot.h"
|
||||
#include "base/signal.h"
|
||||
#include "doc/brushes.h"
|
||||
#include "obs/signal.h"
|
||||
|
||||
#include <vector>
|
||||
|
||||
@ -40,7 +40,7 @@ namespace app {
|
||||
void unlockBrushSlot(slot_id slot);
|
||||
bool isBrushSlotLocked(slot_id slot) const;
|
||||
|
||||
base::Signal0<void> ItemsChange;
|
||||
obs::signal<void()> ItemsChange;
|
||||
|
||||
private:
|
||||
void load(const std::string& filename);
|
||||
|
@ -8,9 +8,9 @@
|
||||
#define APP_APP_MENUS_H_INCLUDED
|
||||
#pragma once
|
||||
|
||||
#include "base/connection.h"
|
||||
#include "base/disable_copying.h"
|
||||
#include "base/unique_ptr.h"
|
||||
#include "obs/connection.h"
|
||||
#include "ui/base.h"
|
||||
#include "ui/menu.h"
|
||||
|
||||
@ -69,7 +69,7 @@ namespace app {
|
||||
base::UniquePtr<Menu> m_frameTagPopupMenu;
|
||||
base::UniquePtr<Menu> m_palettePopupMenu;
|
||||
base::UniquePtr<Menu> m_inkPopupMenu;
|
||||
base::ScopedConnection m_recentFilesConn;
|
||||
obs::scoped_connection m_recentFilesConn;
|
||||
};
|
||||
|
||||
} // namespace app
|
||||
|
@ -92,7 +92,7 @@ void AddCel::addCel(Layer* layer, Cel* cel)
|
||||
ev.sprite(layer->sprite());
|
||||
ev.layer(layer);
|
||||
ev.cel(cel);
|
||||
doc->notifyObservers<DocumentEvent&>(&DocumentObserver::onAddCel, ev);
|
||||
doc->notify_observers<DocumentEvent&>(&DocumentObserver::onAddCel, ev);
|
||||
}
|
||||
|
||||
void AddCel::removeCel(Layer* layer, Cel* cel)
|
||||
@ -102,7 +102,7 @@ void AddCel::removeCel(Layer* layer, Cel* cel)
|
||||
ev.sprite(layer->sprite());
|
||||
ev.layer(layer);
|
||||
ev.cel(cel);
|
||||
doc->notifyObservers<DocumentEvent&>(&DocumentObserver::onRemoveCel, ev);
|
||||
doc->notify_observers<DocumentEvent&>(&DocumentObserver::onRemoveCel, ev);
|
||||
|
||||
static_cast<LayerImage*>(layer)->removeCel(cel);
|
||||
layer->incrementVersion();
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Aseprite
|
||||
// Copyright (C) 2001-2015 David Capello
|
||||
// Copyright (C) 2001-2016 David Capello
|
||||
//
|
||||
// This program is distributed under the terms of
|
||||
// the End-User License Agreement for Aseprite.
|
||||
@ -56,7 +56,7 @@ void AddFrame::onExecute()
|
||||
DocumentEvent ev(doc);
|
||||
ev.sprite(sprite);
|
||||
ev.frame(m_newFrame);
|
||||
doc->notifyObservers<DocumentEvent&>(&DocumentObserver::onAddFrame, ev);
|
||||
doc->notify_observers<DocumentEvent&>(&DocumentObserver::onAddFrame, ev);
|
||||
}
|
||||
|
||||
void AddFrame::onUndo()
|
||||
@ -74,7 +74,7 @@ void AddFrame::onUndo()
|
||||
DocumentEvent ev(doc);
|
||||
ev.sprite(sprite);
|
||||
ev.frame(m_newFrame);
|
||||
doc->notifyObservers<DocumentEvent&>(&DocumentObserver::onRemoveFrame, ev);
|
||||
doc->notify_observers<DocumentEvent&>(&DocumentObserver::onRemoveFrame, ev);
|
||||
}
|
||||
|
||||
} // namespace cmd
|
||||
|
@ -73,7 +73,7 @@ void AddLayer::addLayer(Layer* folder, Layer* newLayer, Layer* afterThis)
|
||||
DocumentEvent ev(doc);
|
||||
ev.sprite(folder->sprite());
|
||||
ev.layer(newLayer);
|
||||
doc->notifyObservers<DocumentEvent&>(&DocumentObserver::onAddLayer, ev);
|
||||
doc->notify_observers<DocumentEvent&>(&DocumentObserver::onAddLayer, ev);
|
||||
}
|
||||
|
||||
void AddLayer::removeLayer(Layer* folder, Layer* layer)
|
||||
@ -82,12 +82,12 @@ void AddLayer::removeLayer(Layer* folder, Layer* layer)
|
||||
DocumentEvent ev(doc);
|
||||
ev.sprite(layer->sprite());
|
||||
ev.layer(layer);
|
||||
doc->notifyObservers<DocumentEvent&>(&DocumentObserver::onBeforeRemoveLayer, ev);
|
||||
doc->notify_observers<DocumentEvent&>(&DocumentObserver::onBeforeRemoveLayer, ev);
|
||||
|
||||
static_cast<LayerFolder*>(folder)->removeLayer(layer);
|
||||
folder->incrementVersion();
|
||||
|
||||
doc->notifyObservers<DocumentEvent&>(&DocumentObserver::onAfterRemoveLayer, ev);
|
||||
doc->notify_observers<DocumentEvent&>(&DocumentObserver::onAfterRemoveLayer, ev);
|
||||
|
||||
delete layer;
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Aseprite
|
||||
// Copyright (C) 2001-2015 David Capello
|
||||
// Copyright (C) 2001-2016 David Capello
|
||||
//
|
||||
// This program is distributed under the terms of
|
||||
// the End-User License Agreement for Aseprite.
|
||||
@ -52,7 +52,7 @@ void MoveLayer::onFireNotifications()
|
||||
DocumentEvent ev(doc);
|
||||
ev.sprite(layer->sprite());
|
||||
ev.layer(layer);
|
||||
doc->notifyObservers<DocumentEvent&>(&DocumentObserver::onLayerRestacked, ev);
|
||||
doc->notify_observers<DocumentEvent&>(&DocumentObserver::onLayerRestacked, ev);
|
||||
}
|
||||
|
||||
} // namespace cmd
|
||||
|
@ -50,7 +50,7 @@ void RemoveFrame::onExecute()
|
||||
DocumentEvent ev(doc);
|
||||
ev.sprite(sprite);
|
||||
ev.frame(m_frame);
|
||||
doc->notifyObservers<DocumentEvent&>(&DocumentObserver::onRemoveFrame, ev);
|
||||
doc->notify_observers<DocumentEvent&>(&DocumentObserver::onRemoveFrame, ev);
|
||||
}
|
||||
|
||||
void RemoveFrame::onUndo()
|
||||
@ -67,7 +67,7 @@ void RemoveFrame::onUndo()
|
||||
DocumentEvent ev(doc);
|
||||
ev.sprite(sprite);
|
||||
ev.frame(m_frame);
|
||||
doc->notifyObservers<DocumentEvent&>(&DocumentObserver::onAddFrame, ev);
|
||||
doc->notify_observers<DocumentEvent&>(&DocumentObserver::onAddFrame, ev);
|
||||
}
|
||||
|
||||
} // namespace cmd
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Aseprite
|
||||
// Copyright (C) 2001-2015 David Capello
|
||||
// Copyright (C) 2001-2016 David Capello
|
||||
//
|
||||
// This program is distributed under the terms of
|
||||
// the End-User License Agreement for Aseprite.
|
||||
@ -51,7 +51,7 @@ void SetCelFrame::onFireNotifications()
|
||||
ev.layer(cel->layer());
|
||||
ev.cel(cel);
|
||||
ev.frame(cel->frame());
|
||||
doc->notifyObservers<DocumentEvent&>(&DocumentObserver::onCelFrameChanged, ev);
|
||||
doc->notify_observers<DocumentEvent&>(&DocumentObserver::onCelFrameChanged, ev);
|
||||
}
|
||||
|
||||
} // namespace cmd
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Aseprite
|
||||
// Copyright (C) 2001-2015 David Capello
|
||||
// Copyright (C) 2001-2016 David Capello
|
||||
//
|
||||
// This program is distributed under the terms of
|
||||
// the End-User License Agreement for Aseprite.
|
||||
@ -44,7 +44,7 @@ void SetCelOpacity::onFireNotifications()
|
||||
DocumentEvent ev(cel->document());
|
||||
ev.sprite(cel->sprite());
|
||||
ev.cel(cel);
|
||||
cel->document()->notifyObservers<DocumentEvent&>(&DocumentObserver::onCelOpacityChange, ev);
|
||||
cel->document()->notify_observers<DocumentEvent&>(&DocumentObserver::onCelOpacityChange, ev);
|
||||
}
|
||||
|
||||
} // namespace cmd
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Aseprite
|
||||
// Copyright (C) 2001-2015 David Capello
|
||||
// Copyright (C) 2001-2016 David Capello
|
||||
//
|
||||
// This program is distributed under the terms of
|
||||
// the End-User License Agreement for Aseprite.
|
||||
@ -46,7 +46,7 @@ void SetCelPosition::onFireNotifications()
|
||||
DocumentEvent ev(cel->document());
|
||||
ev.sprite(cel->sprite());
|
||||
ev.cel(cel);
|
||||
cel->document()->notifyObservers<DocumentEvent&>(&DocumentObserver::onCelPositionChanged, ev);
|
||||
cel->document()->notify_observers<DocumentEvent&>(&DocumentObserver::onCelPositionChanged, ev);
|
||||
}
|
||||
|
||||
} // namespace cmd
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Aseprite
|
||||
// Copyright (C) 2001-2015 David Capello
|
||||
// Copyright (C) 2001-2016 David Capello
|
||||
//
|
||||
// This program is distributed under the terms of
|
||||
// the End-User License Agreement for Aseprite.
|
||||
@ -44,7 +44,7 @@ void SetFrameDuration::onFireNotifications()
|
||||
DocumentEvent ev(doc);
|
||||
ev.sprite(sprite);
|
||||
ev.frame(m_frame);
|
||||
doc->notifyObservers<DocumentEvent&>(&DocumentObserver::onFrameDurationChanged, ev);
|
||||
doc->notify_observers<DocumentEvent&>(&DocumentObserver::onFrameDurationChanged, ev);
|
||||
}
|
||||
|
||||
} // namespace cmd
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Aseprite
|
||||
// Copyright (C) 2001-2015 David Capello
|
||||
// Copyright (C) 2001-2016 David Capello
|
||||
//
|
||||
// This program is distributed under the terms of
|
||||
// the End-User License Agreement for Aseprite.
|
||||
@ -44,7 +44,7 @@ void SetLayerBlendMode::onFireNotifications()
|
||||
DocumentEvent ev(doc);
|
||||
ev.sprite(layer->sprite());
|
||||
ev.layer(layer);
|
||||
doc->notifyObservers<DocumentEvent&>(&DocumentObserver::onLayerBlendModeChange, ev);
|
||||
doc->notify_observers<DocumentEvent&>(&DocumentObserver::onLayerBlendModeChange, ev);
|
||||
}
|
||||
|
||||
} // namespace cmd
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Aseprite
|
||||
// Copyright (C) 2001-2015 David Capello
|
||||
// Copyright (C) 2001-2016 David Capello
|
||||
//
|
||||
// This program is distributed under the terms of
|
||||
// the End-User License Agreement for Aseprite.
|
||||
@ -44,7 +44,7 @@ void SetLayerName::onFireNotifications()
|
||||
DocumentEvent ev(doc);
|
||||
ev.sprite(layer->sprite());
|
||||
ev.layer(layer);
|
||||
doc->notifyObservers<DocumentEvent&>(&DocumentObserver::onLayerNameChange, ev);
|
||||
doc->notify_observers<DocumentEvent&>(&DocumentObserver::onLayerNameChange, ev);
|
||||
}
|
||||
|
||||
} // namespace cmd
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Aseprite
|
||||
// Copyright (C) 2001-2015 David Capello
|
||||
// Copyright (C) 2001-2016 David Capello
|
||||
//
|
||||
// This program is distributed under the terms of
|
||||
// the End-User License Agreement for Aseprite.
|
||||
@ -44,7 +44,7 @@ void SetLayerOpacity::onFireNotifications()
|
||||
DocumentEvent ev(doc);
|
||||
ev.sprite(layer->sprite());
|
||||
ev.layer(layer);
|
||||
doc->notifyObservers<DocumentEvent&>(&DocumentObserver::onLayerOpacityChange, ev);
|
||||
doc->notify_observers<DocumentEvent&>(&DocumentObserver::onLayerOpacityChange, ev);
|
||||
}
|
||||
|
||||
} // namespace cmd
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Aseprite
|
||||
// Copyright (C) 2001-2015 David Capello
|
||||
// Copyright (C) 2001-2016 David Capello
|
||||
//
|
||||
// This program is distributed under the terms of
|
||||
// the End-User License Agreement for Aseprite.
|
||||
@ -109,7 +109,7 @@ void SetPixelFormat::setFormat(PixelFormat format)
|
||||
// Generate notification
|
||||
DocumentEvent ev(sprite->document());
|
||||
ev.sprite(sprite);
|
||||
sprite->document()->notifyObservers<DocumentEvent&>(&DocumentObserver::onPixelFormatChanged, ev);
|
||||
sprite->document()->notify_observers<DocumentEvent&>(&DocumentObserver::onPixelFormatChanged, ev);
|
||||
}
|
||||
|
||||
} // namespace cmd
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Aseprite
|
||||
// Copyright (C) 2001-2015 David Capello
|
||||
// Copyright (C) 2001-2016 David Capello
|
||||
//
|
||||
// This program is distributed under the terms of
|
||||
// the End-User License Agreement for Aseprite.
|
||||
@ -47,7 +47,7 @@ void SetSpriteSize::onFireNotifications()
|
||||
Sprite* sprite = this->sprite();
|
||||
DocumentEvent ev(sprite->document());
|
||||
ev.sprite(sprite);
|
||||
sprite->document()->notifyObservers<DocumentEvent&>(&DocumentObserver::onSpriteSizeChanged, ev);
|
||||
sprite->document()->notify_observers<DocumentEvent&>(&DocumentObserver::onSpriteSizeChanged, ev);
|
||||
}
|
||||
|
||||
} // namespace cmd
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Aseprite
|
||||
// Copyright (C) 2001-2015 David Capello
|
||||
// Copyright (C) 2001-2016 David Capello
|
||||
//
|
||||
// This program is distributed under the terms of
|
||||
// the End-User License Agreement for Aseprite.
|
||||
@ -45,7 +45,7 @@ void SetTotalFrames::onFireNotifications()
|
||||
DocumentEvent ev(doc);
|
||||
ev.sprite(sprite);
|
||||
ev.frame(sprite->totalFrames());
|
||||
doc->notifyObservers<DocumentEvent&>(&DocumentObserver::onTotalFramesChanged, ev);
|
||||
doc->notify_observers<DocumentEvent&>(&DocumentObserver::onTotalFramesChanged, ev);
|
||||
}
|
||||
|
||||
} // namespace cmd
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Aseprite
|
||||
// Copyright (C) 2001-2015 David Capello
|
||||
// Copyright (C) 2001-2016 David Capello
|
||||
//
|
||||
// This program is distributed under the terms of
|
||||
// the End-User License Agreement for Aseprite.
|
||||
@ -43,7 +43,7 @@ void SetTransparentColor::onFireNotifications()
|
||||
Sprite* sprite = this->sprite();
|
||||
DocumentEvent ev(sprite->document());
|
||||
ev.sprite(sprite);
|
||||
sprite->document()->notifyObservers<DocumentEvent&>(&DocumentObserver::onSpriteTransparentColorChanged, ev);
|
||||
sprite->document()->notify_observers<DocumentEvent&>(&DocumentObserver::onSpriteTransparentColorChanged, ev);
|
||||
}
|
||||
|
||||
} // namespace cmd
|
||||
|
@ -59,16 +59,16 @@ public:
|
||||
centerWindow();
|
||||
load_window_pos(this, "CelProperties");
|
||||
|
||||
UIContext::instance()->addObserver(this);
|
||||
UIContext::instance()->add_observer(this);
|
||||
}
|
||||
|
||||
~CelPropertiesWindow() {
|
||||
UIContext::instance()->removeObserver(this);
|
||||
UIContext::instance()->remove_observer(this);
|
||||
}
|
||||
|
||||
void setCel(Document* doc, Cel* cel) {
|
||||
if (m_document) {
|
||||
m_document->removeObserver(this);
|
||||
m_document->remove_observer(this);
|
||||
m_document = nullptr;
|
||||
m_cel = nullptr;
|
||||
}
|
||||
@ -79,7 +79,7 @@ public:
|
||||
m_range = App::instance()->timeline()->range();
|
||||
|
||||
if (m_document)
|
||||
m_document->addObserver(this);
|
||||
m_document->add_observer(this);
|
||||
|
||||
updateFromCel();
|
||||
}
|
||||
|
@ -267,13 +267,13 @@ private:
|
||||
if (m_hotAccel != i) {
|
||||
m_hotAccel = i;
|
||||
|
||||
m_changeConn = base::Connection();
|
||||
m_changeConn = obs::connection();
|
||||
m_changeButton.reset(new Button(""));
|
||||
m_changeConn = m_changeButton->Click.connect(base::Bind<void>(&KeyItem::onChangeAccel, this, i));
|
||||
setup_mini_look(m_changeButton.get());
|
||||
addChild(m_changeButton.get());
|
||||
|
||||
m_deleteConn = base::Connection();
|
||||
m_deleteConn = obs::connection();
|
||||
m_deleteButton.reset(new Button(""));
|
||||
m_deleteConn = m_deleteButton->Click.connect(base::Bind<void>(&KeyItem::onDeleteAccel, this, i));
|
||||
setup_mini_look(m_deleteButton.get());
|
||||
@ -299,7 +299,7 @@ private:
|
||||
|
||||
if (i == 0 && !m_addButton &&
|
||||
(!m_menuitem || m_menuitem->getCommand())) {
|
||||
m_addConn = base::Connection();
|
||||
m_addConn = obs::connection();
|
||||
m_addButton.reset(new Button(""));
|
||||
m_addConn = m_addButton->Click.connect(base::Bind<void>(&KeyItem::onAddAccel, this));
|
||||
setup_mini_look(m_addButton.get());
|
||||
@ -322,9 +322,9 @@ private:
|
||||
}
|
||||
|
||||
void destroyButtons() {
|
||||
m_changeConn = base::Connection();
|
||||
m_deleteConn = base::Connection();
|
||||
m_addConn = base::Connection();
|
||||
m_changeConn = obs::connection();
|
||||
m_deleteConn = obs::connection();
|
||||
m_addConn = obs::connection();
|
||||
|
||||
if (!m_lockButtons) {
|
||||
m_changeButton.reset();
|
||||
@ -349,9 +349,9 @@ private:
|
||||
base::SharedPtr<ui::Button> m_changeButton;
|
||||
base::SharedPtr<ui::Button> m_deleteButton;
|
||||
base::SharedPtr<ui::Button> m_addButton;
|
||||
base::ScopedConnection m_changeConn;
|
||||
base::ScopedConnection m_deleteConn;
|
||||
base::ScopedConnection m_addConn;
|
||||
obs::scoped_connection m_changeConn;
|
||||
obs::scoped_connection m_deleteConn;
|
||||
obs::scoped_connection m_addConn;
|
||||
int m_hotAccel;
|
||||
bool m_lockButtons;
|
||||
};
|
||||
|
@ -88,16 +88,16 @@ public:
|
||||
centerWindow();
|
||||
load_window_pos(this, "LayerProperties");
|
||||
|
||||
UIContext::instance()->addObserver(this);
|
||||
UIContext::instance()->add_observer(this);
|
||||
}
|
||||
|
||||
~LayerPropertiesWindow() {
|
||||
UIContext::instance()->removeObserver(this);
|
||||
UIContext::instance()->remove_observer(this);
|
||||
}
|
||||
|
||||
void setLayer(LayerImage* layer) {
|
||||
if (m_layer) {
|
||||
document()->removeObserver(this);
|
||||
document()->remove_observer(this);
|
||||
m_layer = nullptr;
|
||||
}
|
||||
|
||||
@ -105,7 +105,7 @@ public:
|
||||
m_layer = const_cast<LayerImage*>(layer);
|
||||
|
||||
if (m_layer)
|
||||
document()->addObserver(this);
|
||||
document()->add_observer(this);
|
||||
|
||||
updateFromLayer();
|
||||
}
|
||||
|
@ -117,7 +117,7 @@ private:
|
||||
// PaletteEntryEditor instance.
|
||||
bool m_selfPalChange;
|
||||
|
||||
base::ScopedConnection m_palChangeConn;
|
||||
obs::scoped_connection m_palChangeConn;
|
||||
|
||||
// Palette used for relative changes.
|
||||
Palette m_fromPalette;
|
||||
|
@ -67,8 +67,8 @@ private:
|
||||
case ui::kOpenMessage:
|
||||
load_window_pos(this, "UndoHistory");
|
||||
|
||||
m_ctx->addObserver(this);
|
||||
m_ctx->documents().addObserver(this);
|
||||
m_ctx->add_observer(this);
|
||||
m_ctx->documents().add_observer(this);
|
||||
if (m_ctx->activeDocument()) {
|
||||
m_frame = m_ctx->activeSite().frame();
|
||||
|
||||
@ -82,8 +82,8 @@ private:
|
||||
|
||||
if (m_document)
|
||||
detachDocument();
|
||||
m_ctx->documents().removeObserver(this);
|
||||
m_ctx->removeObserver(this);
|
||||
m_ctx->documents().remove_observer(this);
|
||||
m_ctx->remove_observer(this);
|
||||
break;
|
||||
}
|
||||
return app::gen::UndoHistory::onProcessMessage(msg);
|
||||
@ -161,7 +161,7 @@ private:
|
||||
return;
|
||||
|
||||
DocumentUndo* history = m_document->undoHistory();
|
||||
history->addObserver(this);
|
||||
history->add_observer(this);
|
||||
|
||||
refillList(history);
|
||||
}
|
||||
@ -171,7 +171,7 @@ private:
|
||||
return;
|
||||
|
||||
clearList();
|
||||
m_document->undoHistory()->removeObserver(this);
|
||||
m_document->undoHistory()->remove_observer(this);
|
||||
m_document = nullptr;
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Aseprite
|
||||
// Copyright (C) 2001-2015 David Capello
|
||||
// Copyright (C) 2001-2016 David Capello
|
||||
//
|
||||
// This program is distributed under the terms of
|
||||
// the End-User License Agreement for Aseprite.
|
||||
@ -8,8 +8,8 @@
|
||||
#define APP_COMMANDS_FILTERS_COLOR_CURVE_EDITOR_H_INCLUDED
|
||||
#pragma once
|
||||
|
||||
#include "base/signal.h"
|
||||
#include "gfx/point.h"
|
||||
#include "obs/signal.h"
|
||||
#include "ui/widget.h"
|
||||
|
||||
namespace filters {
|
||||
@ -25,7 +25,7 @@ namespace app {
|
||||
|
||||
ColorCurve* getCurve() const { return m_curve; }
|
||||
|
||||
base::Signal0<void> CurveEditorChange;
|
||||
obs::signal<void()> CurveEditorChange;
|
||||
|
||||
protected:
|
||||
bool onProcessMessage(ui::Message* msg) override;
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Aseprite
|
||||
// Copyright (C) 2001-2015 David Capello
|
||||
// Copyright (C) 2001-2016 David Capello
|
||||
//
|
||||
// This program is distributed under the terms of
|
||||
// the End-User License Agreement for Aseprite.
|
||||
@ -10,8 +10,8 @@
|
||||
|
||||
#include "app/ui/button_set.h"
|
||||
#include "app/ui/skin/skin_part.h"
|
||||
#include "base/signal.h"
|
||||
#include "filters/target.h"
|
||||
#include "obs/signal.h"
|
||||
#include "ui/tooltips.h"
|
||||
|
||||
namespace ui {
|
||||
@ -30,7 +30,7 @@ namespace app {
|
||||
Target getTarget() const { return m_target; }
|
||||
void setTarget(Target target);
|
||||
|
||||
base::Signal0<void> TargetChange;
|
||||
obs::signal<void()> TargetChange;
|
||||
|
||||
protected:
|
||||
void onItemChange(Item* item) override;
|
||||
|
@ -12,8 +12,8 @@
|
||||
#include "app/context_flags.h"
|
||||
#include "base/disable_copying.h"
|
||||
#include "base/exception.h"
|
||||
#include "base/signal.h"
|
||||
#include "doc/context.h"
|
||||
#include "obs/signal.h"
|
||||
|
||||
#include <vector>
|
||||
|
||||
@ -67,8 +67,8 @@ namespace app {
|
||||
void executeCommand(const char* commandName);
|
||||
virtual void executeCommand(Command* command, const Params& params = Params());
|
||||
|
||||
base::Signal1<void, CommandExecutionEvent&> BeforeCommandExecution;
|
||||
base::Signal1<void, CommandExecutionEvent&> AfterCommandExecution;
|
||||
obs::signal<void (CommandExecutionEvent&)> BeforeCommandExecution;
|
||||
obs::signal<void (CommandExecutionEvent&)> AfterCommandExecution;
|
||||
|
||||
protected:
|
||||
virtual void onCreateDocument(doc::CreateDocumentArgs* args) override;
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Aseprite
|
||||
// Copyright (C) 2001-2015 David Capello
|
||||
// Copyright (C) 2001-2016 David Capello
|
||||
//
|
||||
// This program is distributed under the terms of
|
||||
// the End-User License Agreement for Aseprite.
|
||||
@ -29,15 +29,15 @@ BackupObserver::BackupObserver(Session* session, doc::Context* ctx)
|
||||
, m_done(false)
|
||||
, m_thread(base::Bind<void>(&BackupObserver::backgroundThread, this))
|
||||
{
|
||||
m_ctx->addObserver(this);
|
||||
m_ctx->documents().addObserver(this);
|
||||
m_ctx->add_observer(this);
|
||||
m_ctx->documents().add_observer(this);
|
||||
}
|
||||
|
||||
BackupObserver::~BackupObserver()
|
||||
{
|
||||
m_thread.join();
|
||||
m_ctx->documents().removeObserver(this);
|
||||
m_ctx->removeObserver(this);
|
||||
m_ctx->documents().remove_observer(this);
|
||||
m_ctx->remove_observer(this);
|
||||
}
|
||||
|
||||
void BackupObserver::stop()
|
||||
|
@ -103,7 +103,7 @@ color_t Document::bgColor(Layer* layer) const
|
||||
void Document::notifyGeneralUpdate()
|
||||
{
|
||||
doc::DocumentEvent ev(this);
|
||||
notifyObservers<doc::DocumentEvent&>(&doc::DocumentObserver::onGeneralUpdate, ev);
|
||||
notify_observers<doc::DocumentEvent&>(&doc::DocumentObserver::onGeneralUpdate, ev);
|
||||
}
|
||||
|
||||
void Document::notifySpritePixelsModified(Sprite* sprite, const gfx::Region& region, frame_t frame)
|
||||
@ -112,7 +112,7 @@ void Document::notifySpritePixelsModified(Sprite* sprite, const gfx::Region& reg
|
||||
ev.sprite(sprite);
|
||||
ev.region(region);
|
||||
ev.frame(frame);
|
||||
notifyObservers<doc::DocumentEvent&>(&doc::DocumentObserver::onSpritePixelsModified, ev);
|
||||
notify_observers<doc::DocumentEvent&>(&doc::DocumentObserver::onSpritePixelsModified, ev);
|
||||
}
|
||||
|
||||
void Document::notifyExposeSpritePixels(Sprite* sprite, const gfx::Region& region)
|
||||
@ -120,7 +120,7 @@ void Document::notifyExposeSpritePixels(Sprite* sprite, const gfx::Region& regio
|
||||
doc::DocumentEvent ev(this);
|
||||
ev.sprite(sprite);
|
||||
ev.region(region);
|
||||
notifyObservers<doc::DocumentEvent&>(&doc::DocumentObserver::onExposeSpritePixels, ev);
|
||||
notify_observers<doc::DocumentEvent&>(&doc::DocumentObserver::onExposeSpritePixels, ev);
|
||||
}
|
||||
|
||||
void Document::notifyLayerMergedDown(Layer* srcLayer, Layer* targetLayer)
|
||||
@ -129,7 +129,7 @@ void Document::notifyLayerMergedDown(Layer* srcLayer, Layer* targetLayer)
|
||||
ev.sprite(srcLayer->sprite());
|
||||
ev.layer(srcLayer);
|
||||
ev.targetLayer(targetLayer);
|
||||
notifyObservers<doc::DocumentEvent&>(&doc::DocumentObserver::onLayerMergedDown, ev);
|
||||
notify_observers<doc::DocumentEvent&>(&doc::DocumentObserver::onLayerMergedDown, ev);
|
||||
}
|
||||
|
||||
void Document::notifyCelMoved(Layer* fromLayer, frame_t fromFrame, Layer* toLayer, frame_t toFrame)
|
||||
@ -140,7 +140,7 @@ void Document::notifyCelMoved(Layer* fromLayer, frame_t fromFrame, Layer* toLaye
|
||||
ev.frame(fromFrame);
|
||||
ev.targetLayer(toLayer);
|
||||
ev.targetFrame(toFrame);
|
||||
notifyObservers<doc::DocumentEvent&>(&doc::DocumentObserver::onCelMoved, ev);
|
||||
notify_observers<doc::DocumentEvent&>(&doc::DocumentObserver::onCelMoved, ev);
|
||||
}
|
||||
|
||||
void Document::notifyCelCopied(Layer* fromLayer, frame_t fromFrame, Layer* toLayer, frame_t toFrame)
|
||||
@ -151,13 +151,13 @@ void Document::notifyCelCopied(Layer* fromLayer, frame_t fromFrame, Layer* toLay
|
||||
ev.frame(fromFrame);
|
||||
ev.targetLayer(toLayer);
|
||||
ev.targetFrame(toFrame);
|
||||
notifyObservers<doc::DocumentEvent&>(&doc::DocumentObserver::onCelCopied, ev);
|
||||
notify_observers<doc::DocumentEvent&>(&doc::DocumentObserver::onCelCopied, ev);
|
||||
}
|
||||
|
||||
void Document::notifySelectionChanged()
|
||||
{
|
||||
doc::DocumentEvent ev(this);
|
||||
notifyObservers<doc::DocumentEvent&>(&doc::DocumentObserver::onSelectionChanged, ev);
|
||||
notify_observers<doc::DocumentEvent&>(&doc::DocumentObserver::onSelectionChanged, ev);
|
||||
}
|
||||
|
||||
bool Document::isModified() const
|
||||
|
@ -13,7 +13,6 @@
|
||||
#include "app/transformation.h"
|
||||
#include "base/disable_copying.h"
|
||||
#include "base/mutex.h"
|
||||
#include "base/observable.h"
|
||||
#include "base/shared_ptr.h"
|
||||
#include "base/unique_ptr.h"
|
||||
#include "doc/blend_mode.h"
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Aseprite
|
||||
// Copyright (C) 2001-2015 David Capello
|
||||
// Copyright (C) 2001-2016 David Capello
|
||||
//
|
||||
// This program is distributed under the terms of
|
||||
// the End-User License Agreement for Aseprite.
|
||||
@ -47,7 +47,7 @@ void DocumentUndo::add(CmdTransaction* cmd)
|
||||
}
|
||||
|
||||
m_undoHistory.add(cmd);
|
||||
notifyObservers(&DocumentUndoObserver::onAddUndoState, this);
|
||||
notify_observers(&DocumentUndoObserver::onAddUndoState, this);
|
||||
}
|
||||
|
||||
bool DocumentUndo::canUndo() const
|
||||
@ -63,19 +63,19 @@ bool DocumentUndo::canRedo() const
|
||||
void DocumentUndo::undo()
|
||||
{
|
||||
m_undoHistory.undo();
|
||||
notifyObservers(&DocumentUndoObserver::onAfterUndo, this);
|
||||
notify_observers(&DocumentUndoObserver::onAfterUndo, this);
|
||||
}
|
||||
|
||||
void DocumentUndo::redo()
|
||||
{
|
||||
m_undoHistory.redo();
|
||||
notifyObservers(&DocumentUndoObserver::onAfterRedo, this);
|
||||
notify_observers(&DocumentUndoObserver::onAfterRedo, this);
|
||||
}
|
||||
|
||||
void DocumentUndo::clearRedo()
|
||||
{
|
||||
m_undoHistory.clearRedo();
|
||||
notifyObservers(&DocumentUndoObserver::onClearRedo, this);
|
||||
notify_observers(&DocumentUndoObserver::onClearRedo, this);
|
||||
}
|
||||
|
||||
bool DocumentUndo::isSavedState() const
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Aseprite
|
||||
// Copyright (C) 2001-2015 David Capello
|
||||
// Copyright (C) 2001-2016 David Capello
|
||||
//
|
||||
// This program is distributed under the terms of
|
||||
// the End-User License Agreement for Aseprite.
|
||||
@ -9,9 +9,9 @@
|
||||
#pragma once
|
||||
|
||||
#include "base/disable_copying.h"
|
||||
#include "base/observable.h"
|
||||
#include "base/unique_ptr.h"
|
||||
#include "doc/sprite_position.h"
|
||||
#include "obs/observable.h"
|
||||
#include "undo/undo_history.h"
|
||||
|
||||
#include <string>
|
||||
@ -27,7 +27,7 @@ namespace app {
|
||||
class CmdTransaction;
|
||||
class DocumentUndoObserver;
|
||||
|
||||
class DocumentUndo : public base::Observable<DocumentUndoObserver> {
|
||||
class DocumentUndo : public obs::observable<DocumentUndoObserver> {
|
||||
public:
|
||||
DocumentUndo();
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Aseprite
|
||||
// Copyright (C) 2001-2015 David Capello
|
||||
// Copyright (C) 2001-2016 David Capello
|
||||
//
|
||||
// This program is distributed under the terms of
|
||||
// the End-User License Agreement for Aseprite.
|
||||
@ -8,7 +8,7 @@
|
||||
#define APP_PREF_OPTION_H_INCLUDED
|
||||
#pragma once
|
||||
|
||||
#include "base/signal.h"
|
||||
#include "obs/signal.h"
|
||||
#include <string>
|
||||
|
||||
namespace app {
|
||||
@ -18,8 +18,8 @@ namespace app {
|
||||
Section(const std::string& name) : m_name(name) { }
|
||||
const char* name() const { return m_name.c_str(); }
|
||||
|
||||
base::Signal0<void> BeforeChange;
|
||||
base::Signal0<void> AfterChange;
|
||||
obs::signal<void()> BeforeChange;
|
||||
obs::signal<void()> AfterChange;
|
||||
|
||||
private:
|
||||
std::string m_name;
|
||||
@ -87,8 +87,8 @@ namespace app {
|
||||
m_section->AfterChange();
|
||||
}
|
||||
|
||||
base::Signal1<void, const T&> BeforeChange;
|
||||
base::Signal1<void, const T&> AfterChange;
|
||||
obs::signal<void(const T&)> BeforeChange;
|
||||
obs::signal<void(const T&)> AfterChange;
|
||||
|
||||
private:
|
||||
Section* m_section;
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Aseprite
|
||||
// Copyright (C) 2001-2015 David Capello
|
||||
// Copyright (C) 2001-2016 David Capello
|
||||
//
|
||||
// This program is distributed under the terms of
|
||||
// the End-User License Agreement for Aseprite.
|
||||
@ -10,11 +10,11 @@
|
||||
|
||||
#include "app/project_observer.h"
|
||||
#include "base/disable_copying.h"
|
||||
#include "base/observable.h"
|
||||
#include "obs/observable.h"
|
||||
|
||||
namespace app {
|
||||
|
||||
class Project : public base::Observable<ProjectObserver> {
|
||||
class Project : public obs::observable<ProjectObserver> {
|
||||
public:
|
||||
Project();
|
||||
~Project();
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Aseprite
|
||||
// Copyright (C) 2001-2015 David Capello
|
||||
// Copyright (C) 2001-2016 David Capello
|
||||
//
|
||||
// This program is distributed under the terms of
|
||||
// the End-User License Agreement for Aseprite.
|
||||
@ -9,7 +9,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "base/recent_items.h"
|
||||
#include "base/signal.h"
|
||||
#include "obs/signal.h"
|
||||
|
||||
#include <string>
|
||||
|
||||
@ -35,7 +35,7 @@ namespace app {
|
||||
void addRecentFile(const char* filename);
|
||||
void removeRecentFile(const char* filename);
|
||||
|
||||
base::Signal0<void> Changed;
|
||||
obs::signal<void()> Changed;
|
||||
|
||||
private:
|
||||
std::string normalizePath(std::string fn);
|
||||
|
@ -30,7 +30,7 @@ public:
|
||||
~ActiveToolChangeTrigger() {
|
||||
Tool* newTool = m_manager->activeTool();
|
||||
if (m_oldTool != newTool) {
|
||||
m_manager->notifyObservers(
|
||||
m_manager->notify_observers(
|
||||
&ActiveToolObserver::onActiveToolChange, newTool);
|
||||
}
|
||||
}
|
||||
@ -202,7 +202,7 @@ void ActiveToolManager::setSelectedTool(Tool* tool)
|
||||
ActiveToolChangeTrigger trigger(this);
|
||||
|
||||
m_selectedTool = tool;
|
||||
notifyObservers(&ActiveToolObserver::onSelectedToolChange, tool);
|
||||
notify_observers(&ActiveToolObserver::onSelectedToolChange, tool);
|
||||
}
|
||||
|
||||
// static
|
||||
|
@ -8,7 +8,7 @@
|
||||
#define APP_TOOLS_ACTIVE_TOOL_H_INCLUDED
|
||||
#pragma once
|
||||
|
||||
#include "base/observable.h"
|
||||
#include "obs/observable.h"
|
||||
|
||||
namespace app {
|
||||
namespace tools {
|
||||
@ -21,7 +21,7 @@ class ToolBox;
|
||||
|
||||
// Manages the coordination between different UI elements that show
|
||||
// information about the active tool.
|
||||
class ActiveToolManager : public base::Observable<ActiveToolObserver> {
|
||||
class ActiveToolManager : public obs::observable<ActiveToolObserver> {
|
||||
public:
|
||||
ActiveToolManager(ToolBox* toolbox);
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Aseprite
|
||||
// Copyright (C) 2001-2015 David Capello
|
||||
// Copyright (C) 2001-2016 David Capello
|
||||
//
|
||||
// This program is distributed under the terms of
|
||||
// the End-User License Agreement for Aseprite.
|
||||
@ -8,7 +8,7 @@
|
||||
#define APP_UI_ANIMATED_WIDGET_H_INCLUDED
|
||||
#pragma once
|
||||
|
||||
#include "base/connection.h"
|
||||
#include "obs/connection.h"
|
||||
#include "ui/timer.h"
|
||||
|
||||
#include <cmath>
|
||||
@ -87,7 +87,7 @@ namespace app {
|
||||
int m_animation;
|
||||
int m_animationTime;
|
||||
int m_animationLifespan;
|
||||
base::ScopedConnection m_scopedConn;
|
||||
obs::scoped_connection m_scopedConn;
|
||||
};
|
||||
|
||||
} // namespace app
|
||||
|
@ -9,7 +9,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "app/ui/skin/skin_part.h"
|
||||
#include "base/signal.h"
|
||||
#include "obs/signal.h"
|
||||
#include "ui/grid.h"
|
||||
|
||||
#include <string>
|
||||
@ -51,8 +51,8 @@ namespace app {
|
||||
void setTriggerOnMouseUp(bool state);
|
||||
void setMultipleSelection(bool state);
|
||||
|
||||
base::Signal1<void, Item*> ItemChange;
|
||||
base::Signal1<void, Item*> RightClick;
|
||||
obs::signal<void(Item*)> ItemChange;
|
||||
obs::signal<void(Item*)> RightClick;
|
||||
|
||||
protected:
|
||||
virtual void onItemChange(Item* item);
|
||||
|
@ -247,7 +247,7 @@ ColorBar::ColorBar(int align)
|
||||
|
||||
onColorButtonChange(getFgColor());
|
||||
|
||||
UIContext::instance()->addObserver(this);
|
||||
UIContext::instance()->add_observer(this);
|
||||
m_beforeCmdConn = UIContext::instance()->BeforeCommandExecution.connect(&ColorBar::onBeforeExecuteCommand, this);
|
||||
m_afterCmdConn = UIContext::instance()->AfterCommandExecution.connect(&ColorBar::onAfterExecuteCommand, this);
|
||||
m_fgConn = Preferences::instance().colorBar.fgColor.AfterChange.connect(base::Bind<void>(&ColorBar::onFgColorChangeFromPreferences, this));
|
||||
@ -258,7 +258,7 @@ ColorBar::ColorBar(int align)
|
||||
|
||||
ColorBar::~ColorBar()
|
||||
{
|
||||
UIContext::instance()->removeObserver(this);
|
||||
UIContext::instance()->remove_observer(this);
|
||||
}
|
||||
|
||||
void ColorBar::setPixelFormat(PixelFormat pixelFormat)
|
||||
@ -369,12 +369,12 @@ void ColorBar::onActiveSiteChange(const doc::Site& site)
|
||||
{
|
||||
if (m_lastDocument != site.document()) {
|
||||
if (m_lastDocument)
|
||||
m_lastDocument->removeObserver(this);
|
||||
m_lastDocument->remove_observer(this);
|
||||
|
||||
m_lastDocument = const_cast<doc::Document*>(site.document());
|
||||
|
||||
if (m_lastDocument)
|
||||
m_lastDocument->addObserver(this);
|
||||
m_lastDocument->add_observer(this);
|
||||
|
||||
hideRemap();
|
||||
}
|
||||
|
@ -13,14 +13,14 @@
|
||||
#include "app/ui/color_button.h"
|
||||
#include "app/ui/input_chain_element.h"
|
||||
#include "app/ui/palette_view.h"
|
||||
#include "base/connection.h"
|
||||
#include "base/signal.h"
|
||||
#include "base/unique_ptr.h"
|
||||
#include "doc/context_observer.h"
|
||||
#include "doc/document_observer.h"
|
||||
#include "doc/documents_observer.h"
|
||||
#include "doc/pixel_format.h"
|
||||
#include "doc/sort_palette.h"
|
||||
#include "obs/connection.h"
|
||||
#include "obs/signal.h"
|
||||
#include "ui/box.h"
|
||||
#include "ui/button.h"
|
||||
#include "ui/splitter.h"
|
||||
@ -92,7 +92,7 @@ namespace app {
|
||||
bool onClear(Context* ctx) override;
|
||||
void onCancel(Context* ctx) override;
|
||||
|
||||
base::Signal0<void> ChangeSelection;
|
||||
obs::signal<void()> ChangeSelection;
|
||||
|
||||
protected:
|
||||
void onAppPaletteChange();
|
||||
@ -161,11 +161,11 @@ namespace app {
|
||||
base::UniquePtr<doc::Palette> m_oldPalette;
|
||||
doc::Document* m_lastDocument;
|
||||
bool m_ascending;
|
||||
base::ScopedConnection m_beforeCmdConn;
|
||||
base::ScopedConnection m_afterCmdConn;
|
||||
base::ScopedConnection m_fgConn;
|
||||
base::ScopedConnection m_bgConn;
|
||||
base::ScopedConnection m_appPalChangeConn;
|
||||
obs::scoped_connection m_beforeCmdConn;
|
||||
obs::scoped_connection m_afterCmdConn;
|
||||
obs::scoped_connection m_fgConn;
|
||||
obs::scoped_connection m_bgConn;
|
||||
obs::scoped_connection m_appPalChangeConn;
|
||||
ui::MouseButtons m_lastButtons;
|
||||
};
|
||||
|
||||
|
@ -56,12 +56,12 @@ ColorButton::ColorButton(const app::Color& color,
|
||||
|
||||
setup_mini_font(this);
|
||||
|
||||
UIContext::instance()->addObserver(this);
|
||||
UIContext::instance()->add_observer(this);
|
||||
}
|
||||
|
||||
ColorButton::~ColorButton()
|
||||
{
|
||||
UIContext::instance()->removeObserver(this);
|
||||
UIContext::instance()->remove_observer(this);
|
||||
|
||||
delete m_window; // widget, window
|
||||
}
|
||||
|
@ -10,9 +10,9 @@
|
||||
|
||||
#include "app/color.h"
|
||||
#include "app/ui/color_source.h"
|
||||
#include "base/signal.h"
|
||||
#include "doc/context_observer.h"
|
||||
#include "doc/pixel_format.h"
|
||||
#include "obs/signal.h"
|
||||
#include "ui/button.h"
|
||||
|
||||
namespace app {
|
||||
@ -37,7 +37,7 @@ namespace app {
|
||||
app::Color getColorByPosition(const gfx::Point& pos) override;
|
||||
|
||||
// Signals
|
||||
base::Signal1<void, const app::Color&> Change;
|
||||
obs::signal<void(const app::Color&)> Change;
|
||||
|
||||
protected:
|
||||
// Events
|
||||
|
@ -14,8 +14,8 @@
|
||||
#include "app/ui/hex_color_entry.h"
|
||||
#include "app/ui/palette_view.h"
|
||||
#include "app/ui/popup_window_pin.h"
|
||||
#include "base/connection.h"
|
||||
#include "base/signal.h"
|
||||
#include "obs/connection.h"
|
||||
#include "obs/signal.h"
|
||||
#include "ui/grid.h"
|
||||
#include "ui/label.h"
|
||||
#include "ui/view.h"
|
||||
@ -38,7 +38,7 @@ namespace app {
|
||||
app::Color getColor() const;
|
||||
|
||||
// Signals
|
||||
base::Signal1<void, const app::Color&> ColorChange;
|
||||
obs::signal<void(const app::Color&)> ColorChange;
|
||||
|
||||
protected:
|
||||
void onMakeFloating() override;
|
||||
@ -67,7 +67,7 @@ namespace app {
|
||||
HsvSliders m_hsvSliders;
|
||||
GraySlider m_graySlider;
|
||||
ui::Label m_maskLabel;
|
||||
base::ScopedConnection m_onPaletteChangeConn;
|
||||
obs::scoped_connection m_onPaletteChangeConn;
|
||||
bool m_canPin;
|
||||
|
||||
// This variable is used to avoid updating the m_hexColorEntry text
|
||||
|
@ -10,7 +10,7 @@
|
||||
|
||||
#include "app/color.h"
|
||||
#include "app/ui/color_source.h"
|
||||
#include "base/signal.h"
|
||||
#include "obs/signal.h"
|
||||
#include "ui/mouse_buttons.h"
|
||||
#include "ui/widget.h"
|
||||
|
||||
@ -24,7 +24,7 @@ namespace app {
|
||||
void selectColor(const app::Color& color);
|
||||
|
||||
// Signals
|
||||
base::Signal2<void, const app::Color&, ui::MouseButtons> ColorChange;
|
||||
obs::signal<void(const app::Color&, ui::MouseButtons)> ColorChange;
|
||||
|
||||
protected:
|
||||
void onSizeHint(ui::SizeHintEvent& ev) override;
|
||||
|
@ -9,7 +9,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "app/color.h"
|
||||
#include "base/signal.h"
|
||||
#include "obs/signal.h"
|
||||
#include "ui/event.h"
|
||||
#include "ui/grid.h"
|
||||
#include "ui/widget.h"
|
||||
@ -42,7 +42,7 @@ namespace app {
|
||||
void resetRelativeSliders();
|
||||
|
||||
// Signals
|
||||
base::Signal1<void, ColorSlidersChangeEvent&> ColorChange;
|
||||
obs::signal<void(ColorSlidersChangeEvent&)> ColorChange;
|
||||
|
||||
protected:
|
||||
void onSizeHint(ui::SizeHintEvent& ev) override;
|
||||
|
@ -39,7 +39,6 @@
|
||||
#include "app/ui/skin/style.h"
|
||||
#include "app/ui_context.h"
|
||||
#include "base/bind.h"
|
||||
#include "base/connection.h"
|
||||
#include "base/scoped_value.h"
|
||||
#include "base/unique_ptr.h"
|
||||
#include "doc/brush.h"
|
||||
@ -47,6 +46,7 @@
|
||||
#include "doc/image.h"
|
||||
#include "doc/palette.h"
|
||||
#include "doc/remap.h"
|
||||
#include "obs/connection.h"
|
||||
#include "she/surface.h"
|
||||
#include "she/system.h"
|
||||
#include "ui/button.h"
|
||||
@ -391,7 +391,7 @@ class ContextBar::InkShadesField : public HBox {
|
||||
public:
|
||||
enum ClickType { DragAndDrop, Select };
|
||||
|
||||
base::Signal0<void> Click;
|
||||
obs::signal<void()> Click;
|
||||
|
||||
ShadeWidget(const Shade& colors, ClickType click)
|
||||
: Widget(kGenericWidget)
|
||||
@ -680,7 +680,7 @@ class ContextBar::InkShadesField : public HBox {
|
||||
int m_dragIndex;
|
||||
bool m_dropBefore;
|
||||
int m_boxSize;
|
||||
base::ScopedConnection m_conn;
|
||||
obs::scoped_connection m_conn;
|
||||
};
|
||||
|
||||
public:
|
||||
@ -1184,7 +1184,7 @@ public:
|
||||
tooltipManager->addTooltipFor(at(1), "Cancel drag and drop", BOTTOM);
|
||||
}
|
||||
|
||||
base::Signal1<void, ContextBarObserver::DropAction> DropPixels;
|
||||
obs::signal<void(ContextBarObserver::DropAction)> DropPixels;
|
||||
|
||||
protected:
|
||||
void onItemChange(Item* item) override {
|
||||
@ -1389,7 +1389,7 @@ ContextBar::ContextBar()
|
||||
m_freehandAlgo->setupTooltips(tooltipManager);
|
||||
m_symmetry->setupTooltips(tooltipManager);
|
||||
|
||||
App::instance()->activeToolManager()->addObserver(this);
|
||||
App::instance()->activeToolManager()->add_observer(this);
|
||||
|
||||
auto& pref = Preferences::instance();
|
||||
pref.symmetryMode.enabled.AfterChange.connect(
|
||||
@ -1406,7 +1406,7 @@ ContextBar::ContextBar()
|
||||
|
||||
ContextBar::~ContextBar()
|
||||
{
|
||||
App::instance()->activeToolManager()->removeObserver(this);
|
||||
App::instance()->activeToolManager()->remove_observer(this);
|
||||
}
|
||||
|
||||
void ContextBar::onSizeHint(SizeHintEvent& ev)
|
||||
@ -1480,7 +1480,7 @@ void ContextBar::onFgOrBgColorChange(doc::Brush::ImageColor imageColor)
|
||||
|
||||
void ContextBar::onDropPixels(ContextBarObserver::DropAction action)
|
||||
{
|
||||
notifyObservers(&ContextBarObserver::onDropPixels, action);
|
||||
notify_observers(&ContextBarObserver::onDropPixels, action);
|
||||
}
|
||||
|
||||
void ContextBar::updateForActiveTool()
|
||||
|
@ -14,9 +14,10 @@
|
||||
#include "app/tools/ink_type.h"
|
||||
#include "app/tools/tool_loop_modifiers.h"
|
||||
#include "app/ui/context_bar_observer.h"
|
||||
#include "base/connection.h"
|
||||
#include "base/observable.h"
|
||||
#include "doc/brush.h"
|
||||
#include "obs/connection.h"
|
||||
#include "obs/observable.h"
|
||||
#include "obs/signal.h"
|
||||
#include "ui/box.h"
|
||||
|
||||
#include <vector>
|
||||
@ -40,7 +41,7 @@ namespace app {
|
||||
class BrushSlot;
|
||||
|
||||
class ContextBar : public ui::Box
|
||||
, public base::Observable<ContextBarObserver>
|
||||
, public obs::observable<ContextBarObserver>
|
||||
, public tools::ActiveToolObserver {
|
||||
public:
|
||||
ContextBar();
|
||||
@ -69,7 +70,7 @@ namespace app {
|
||||
void setInkType(tools::InkType type);
|
||||
|
||||
// Signals
|
||||
base::Signal0<void> BrushChange;
|
||||
obs::signal<void()> BrushChange;
|
||||
|
||||
protected:
|
||||
void onSizeHint(ui::SizeHintEvent& ev) override;
|
||||
@ -137,10 +138,10 @@ namespace app {
|
||||
doc::BrushRef m_activeBrush;
|
||||
ui::Label* m_selectBoxHelp;
|
||||
SymmetryField* m_symmetry;
|
||||
base::ScopedConnection m_sizeConn;
|
||||
base::ScopedConnection m_angleConn;
|
||||
base::ScopedConnection m_opacityConn;
|
||||
base::ScopedConnection m_freehandAlgoConn;
|
||||
obs::scoped_connection m_sizeConn;
|
||||
obs::scoped_connection m_angleConn;
|
||||
obs::scoped_connection m_opacityConn;
|
||||
obs::scoped_connection m_freehandAlgoConn;
|
||||
};
|
||||
|
||||
} // namespace app
|
||||
|
@ -59,7 +59,7 @@ public:
|
||||
setup_mini_look(&m_deleteButton);
|
||||
}
|
||||
|
||||
base::Signal0<void> Regenerate;
|
||||
obs::signal<void()> Regenerate;
|
||||
|
||||
protected:
|
||||
void onSizeHint(SizeHintEvent& ev) override {
|
||||
|
@ -38,7 +38,7 @@ namespace app {
|
||||
|
||||
// Triggered when the list is empty (because the user deleted all
|
||||
// sessions).
|
||||
base::Signal0<void> Empty;
|
||||
obs::signal<void()> Empty;
|
||||
|
||||
private:
|
||||
void fillList();
|
||||
|
@ -32,7 +32,7 @@ public:
|
||||
setFocusMagnet(true);
|
||||
}
|
||||
|
||||
base::Signal1<void, const std::string&> ExecuteCommand;
|
||||
obs::signal<void(const std::string&)> ExecuteCommand;
|
||||
|
||||
protected:
|
||||
bool onProcessMessage(Message* msg) override {
|
||||
@ -84,7 +84,7 @@ DevConsoleView::DevConsoleView()
|
||||
|
||||
DevConsoleView::~DevConsoleView()
|
||||
{
|
||||
// m_document->removeObserver(this);
|
||||
// m_document->remove_observer(this);
|
||||
// delete m_editor;
|
||||
}
|
||||
|
||||
|
@ -57,12 +57,12 @@ public:
|
||||
DocumentViewPreviewDelegate* previewDelegate)
|
||||
: Editor(document)
|
||||
, m_previewDelegate(previewDelegate) {
|
||||
addObserver(this);
|
||||
add_observer(this);
|
||||
setCustomizationDelegate(this);
|
||||
}
|
||||
|
||||
~AppEditor() {
|
||||
removeObserver(this);
|
||||
remove_observer(this);
|
||||
setCustomizationDelegate(NULL);
|
||||
}
|
||||
|
||||
@ -172,12 +172,12 @@ DocumentView::DocumentView(Document* document, Type type,
|
||||
m_view->setExpansive(true);
|
||||
|
||||
m_editor->setDocumentView(this);
|
||||
m_document->addObserver(this);
|
||||
m_document->add_observer(this);
|
||||
}
|
||||
|
||||
DocumentView::~DocumentView()
|
||||
{
|
||||
m_document->removeObserver(this);
|
||||
m_document->remove_observer(this);
|
||||
delete m_editor;
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Aseprite
|
||||
// Copyright (C) 2001-2015 David Capello
|
||||
// Copyright (C) 2001-2016 David Capello
|
||||
//
|
||||
// This program is distributed under the terms of
|
||||
// the End-User License Agreement for Aseprite.
|
||||
@ -8,7 +8,7 @@
|
||||
#define APP_UI_DROP_DOWN_BUTTON_H_INCLUDED
|
||||
#pragma once
|
||||
|
||||
#include "base/signal.h"
|
||||
#include "obs/signal.h"
|
||||
#include "ui/box.h"
|
||||
|
||||
namespace ui {
|
||||
@ -25,8 +25,8 @@ namespace app {
|
||||
ui::Button* mainButton() { return m_button; }
|
||||
ui::Button* dropDown() { return m_dropDown; }
|
||||
|
||||
base::Signal0<void> Click;
|
||||
base::Signal0<void> DropDownClick;
|
||||
obs::signal<void()> Click;
|
||||
obs::signal<void()> DropDownClick;
|
||||
|
||||
protected:
|
||||
void onButtonClick(ui::Event& ev);
|
||||
|
@ -173,7 +173,7 @@ Editor::Editor(Document* document, EditorFlags flags)
|
||||
|
||||
this->setFocusStop(true);
|
||||
|
||||
App::instance()->activeToolManager()->addObserver(this);
|
||||
App::instance()->activeToolManager()->add_observer(this);
|
||||
|
||||
m_fgColorChangeConn =
|
||||
Preferences::instance().colorBar.fgColor.AfterChange.connect(
|
||||
@ -201,7 +201,7 @@ Editor::Editor(Document* document, EditorFlags flags)
|
||||
m_docPref.show.AfterChange.connect(
|
||||
base::Bind<void>(&Editor::onShowExtrasChange, this));
|
||||
|
||||
m_document->addObserver(this);
|
||||
m_document->add_observer(this);
|
||||
|
||||
m_state->onEnterState(this);
|
||||
}
|
||||
@ -214,8 +214,8 @@ Editor::~Editor()
|
||||
}
|
||||
|
||||
m_observers.notifyDestroyEditor(this);
|
||||
m_document->removeObserver(this);
|
||||
App::instance()->activeToolManager()->removeObserver(this);
|
||||
m_document->remove_observer(this);
|
||||
App::instance()->activeToolManager()->remove_observer(this);
|
||||
|
||||
setCustomizationDelegate(NULL);
|
||||
|
||||
@ -973,14 +973,14 @@ Rect Editor::editorToScreen(const Rect& rc)
|
||||
editorToScreen(rc.point2()));
|
||||
}
|
||||
|
||||
void Editor::addObserver(EditorObserver* observer)
|
||||
void Editor::add_observer(EditorObserver* observer)
|
||||
{
|
||||
m_observers.addObserver(observer);
|
||||
m_observers.add_observer(observer);
|
||||
}
|
||||
|
||||
void Editor::removeObserver(EditorObserver* observer)
|
||||
void Editor::remove_observer(EditorObserver* observer)
|
||||
{
|
||||
m_observers.removeObserver(observer);
|
||||
m_observers.remove_observer(observer);
|
||||
}
|
||||
|
||||
void Editor::setCustomizationDelegate(EditorCustomizationDelegate* delegate)
|
||||
|
@ -19,12 +19,12 @@
|
||||
#include "app/ui/editor/editor_observers.h"
|
||||
#include "app/ui/editor/editor_state.h"
|
||||
#include "app/ui/editor/editor_states_history.h"
|
||||
#include "base/connection.h"
|
||||
#include "doc/document_observer.h"
|
||||
#include "doc/frame.h"
|
||||
#include "doc/image_buffer.h"
|
||||
#include "filters/tiled_mode.h"
|
||||
#include "gfx/fwd.h"
|
||||
#include "obs/connection.h"
|
||||
#include "render/zoom.h"
|
||||
#include "ui/base.h"
|
||||
#include "ui/cursor_type.h"
|
||||
@ -152,8 +152,8 @@ namespace app {
|
||||
gfx::Rect screenToEditor(const gfx::Rect& rc);
|
||||
gfx::Rect editorToScreen(const gfx::Rect& rc);
|
||||
|
||||
void addObserver(EditorObserver* observer);
|
||||
void removeObserver(EditorObserver* observer);
|
||||
void add_observer(EditorObserver* observer);
|
||||
void remove_observer(EditorObserver* observer);
|
||||
|
||||
void setCustomizationDelegate(EditorCustomizationDelegate* delegate);
|
||||
|
||||
@ -297,17 +297,17 @@ namespace app {
|
||||
ui::Timer m_antsTimer;
|
||||
int m_antsOffset;
|
||||
|
||||
base::ScopedConnection m_fgColorChangeConn;
|
||||
base::ScopedConnection m_contextBarBrushChangeConn;
|
||||
base::ScopedConnection m_showExtrasConn;
|
||||
obs::scoped_connection m_fgColorChangeConn;
|
||||
obs::scoped_connection m_contextBarBrushChangeConn;
|
||||
obs::scoped_connection m_showExtrasConn;
|
||||
|
||||
// Slots listeing document preferences.
|
||||
base::ScopedConnection m_tiledConn;
|
||||
base::ScopedConnection m_gridConn;
|
||||
base::ScopedConnection m_pixelGridConn;
|
||||
base::ScopedConnection m_bgConn;
|
||||
base::ScopedConnection m_onionskinConn;
|
||||
base::ScopedConnection m_symmetryModeConn;
|
||||
obs::scoped_connection m_tiledConn;
|
||||
obs::scoped_connection m_gridConn;
|
||||
obs::scoped_connection m_pixelGridConn;
|
||||
obs::scoped_connection m_bgConn;
|
||||
obs::scoped_connection m_onionskinConn;
|
||||
obs::scoped_connection m_symmetryModeConn;
|
||||
|
||||
EditorObservers m_observers;
|
||||
|
||||
|
@ -17,42 +17,42 @@ namespace app {
|
||||
|
||||
void EditorObservers::notifyDestroyEditor(Editor* editor)
|
||||
{
|
||||
notifyObservers(&EditorObserver::onDestroyEditor, editor);
|
||||
notify_observers(&EditorObserver::onDestroyEditor, editor);
|
||||
}
|
||||
|
||||
void EditorObservers::notifyStateChanged(Editor* editor)
|
||||
{
|
||||
notifyObservers(&EditorObserver::onStateChanged, editor);
|
||||
notify_observers(&EditorObserver::onStateChanged, editor);
|
||||
}
|
||||
|
||||
void EditorObservers::notifyScrollChanged(Editor* editor)
|
||||
{
|
||||
notifyObservers(&EditorObserver::onScrollChanged, editor);
|
||||
notify_observers(&EditorObserver::onScrollChanged, editor);
|
||||
}
|
||||
|
||||
void EditorObservers::notifyZoomChanged(Editor* editor)
|
||||
{
|
||||
notifyObservers(&EditorObserver::onZoomChanged, editor);
|
||||
notify_observers(&EditorObserver::onZoomChanged, editor);
|
||||
}
|
||||
|
||||
void EditorObservers::notifyBeforeFrameChanged(Editor* editor)
|
||||
{
|
||||
notifyObservers(&EditorObserver::onBeforeFrameChanged, editor);
|
||||
notify_observers(&EditorObserver::onBeforeFrameChanged, editor);
|
||||
}
|
||||
|
||||
void EditorObservers::notifyAfterFrameChanged(Editor* editor)
|
||||
{
|
||||
notifyObservers(&EditorObserver::onAfterFrameChanged, editor);
|
||||
notify_observers(&EditorObserver::onAfterFrameChanged, editor);
|
||||
}
|
||||
|
||||
void EditorObservers::notifyBeforeLayerChanged(Editor* editor)
|
||||
{
|
||||
notifyObservers(&EditorObserver::onBeforeLayerChanged, editor);
|
||||
notify_observers(&EditorObserver::onBeforeLayerChanged, editor);
|
||||
}
|
||||
|
||||
void EditorObservers::notifyAfterLayerChanged(Editor* editor)
|
||||
{
|
||||
notifyObservers(&EditorObserver::onAfterLayerChanged, editor);
|
||||
notify_observers(&EditorObserver::onAfterLayerChanged, editor);
|
||||
}
|
||||
|
||||
} // namespace app
|
||||
|
@ -9,12 +9,12 @@
|
||||
#pragma once
|
||||
|
||||
#include "app/ui/editor/editor_observer.h"
|
||||
#include "base/observable.h"
|
||||
#include "obs/observable.h"
|
||||
|
||||
namespace app {
|
||||
class Editor;
|
||||
|
||||
class EditorObservers : public base::Observable<EditorObserver> {
|
||||
class EditorObservers : public obs::observable<EditorObserver> {
|
||||
public:
|
||||
void notifyDestroyEditor(Editor* editor);
|
||||
void notifyStateChanged(Editor* editor);
|
||||
|
@ -8,7 +8,7 @@
|
||||
#define APP_UI_EDITOR_VIEW_H_INCLUDED
|
||||
#pragma once
|
||||
|
||||
#include "base/connection.h"
|
||||
#include "obs/connection.h"
|
||||
#include "ui/view.h"
|
||||
|
||||
namespace app {
|
||||
@ -35,7 +35,7 @@ namespace app {
|
||||
void setupScrollbars();
|
||||
|
||||
Type m_type;
|
||||
base::ScopedConnection m_scrollSettingsConn;
|
||||
obs::scoped_connection m_scrollSettingsConn;
|
||||
static Method g_scrollUpdateMethod;
|
||||
};
|
||||
|
||||
|
@ -97,18 +97,18 @@ MovingPixelsState::MovingPixelsState(Editor* editor, MouseMessage* msg, PixelsMo
|
||||
// PlayAnimation command.
|
||||
m_editor->manager()->addMessageFilter(kKeyDownMessage, m_editor);
|
||||
m_editor->manager()->addMessageFilter(kKeyUpMessage, m_editor);
|
||||
m_editor->addObserver(this);
|
||||
m_editor->add_observer(this);
|
||||
m_observingEditor = true;
|
||||
|
||||
ContextBar* contextBar = App::instance()->contextBar();
|
||||
contextBar->updateForMovingPixels();
|
||||
contextBar->addObserver(this);
|
||||
contextBar->add_observer(this);
|
||||
}
|
||||
|
||||
MovingPixelsState::~MovingPixelsState()
|
||||
{
|
||||
ContextBar* contextBar = App::instance()->contextBar();
|
||||
contextBar->removeObserver(this);
|
||||
contextBar->remove_observer(this);
|
||||
contextBar->updateForActiveTool();
|
||||
|
||||
m_pixelsMovement.reset(NULL);
|
||||
@ -665,7 +665,7 @@ void MovingPixelsState::removeAsEditorObserver()
|
||||
{
|
||||
if (m_observingEditor) {
|
||||
m_observingEditor = false;
|
||||
m_editor->removeObserver(this);
|
||||
m_editor->remove_observer(this);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
#include "app/ui/editor/pixels_movement.h"
|
||||
#include "app/ui/editor/standby_state.h"
|
||||
#include "app/ui/status_bar.h"
|
||||
#include "base/connection.h"
|
||||
#include "obs/connection.h"
|
||||
|
||||
namespace doc {
|
||||
class Image;
|
||||
@ -82,9 +82,9 @@ namespace app {
|
||||
// used to remove the dragged image).
|
||||
bool m_discarded;
|
||||
|
||||
base::ScopedConnection m_ctxConn;
|
||||
base::ScopedConnection m_opaqueConn;
|
||||
base::ScopedConnection m_transparentConn;
|
||||
obs::scoped_connection m_ctxConn;
|
||||
obs::scoped_connection m_opaqueConn;
|
||||
obs::scoped_connection m_transparentConn;
|
||||
};
|
||||
|
||||
} // namespace app
|
||||
|
@ -12,11 +12,11 @@
|
||||
#include "app/extra_cel.h"
|
||||
#include "app/transaction.h"
|
||||
#include "app/ui/editor/handle_type.h"
|
||||
#include "base/connection.h"
|
||||
#include "base/shared_ptr.h"
|
||||
#include "doc/algorithm/flip_type.h"
|
||||
#include "doc/site.h"
|
||||
#include "gfx/size.h"
|
||||
#include "obs/connection.h"
|
||||
|
||||
namespace doc {
|
||||
class Image;
|
||||
@ -126,9 +126,9 @@ namespace app {
|
||||
Mask* m_currentMask;
|
||||
bool m_opaque;
|
||||
color_t m_maskColor;
|
||||
base::ScopedConnection m_pivotVisConn;
|
||||
base::ScopedConnection m_pivotPosConn;
|
||||
base::ScopedConnection m_rotAlgoConn;
|
||||
obs::scoped_connection m_pivotVisConn;
|
||||
obs::scoped_connection m_pivotPosConn;
|
||||
obs::scoped_connection m_rotAlgoConn;
|
||||
ExtraCelRef m_extraCel;
|
||||
};
|
||||
|
||||
|
@ -9,9 +9,9 @@
|
||||
#pragma once
|
||||
|
||||
#include "app/ui/editor/state_with_wheel_behavior.h"
|
||||
#include "base/connection.h"
|
||||
#include "base/time.h"
|
||||
#include "doc/frame.h"
|
||||
#include "obs/connection.h"
|
||||
#include "ui/timer.h"
|
||||
|
||||
namespace app {
|
||||
@ -51,7 +51,7 @@ namespace app {
|
||||
bool m_pingPongForward;
|
||||
doc::frame_t m_refFrame;
|
||||
|
||||
base::ScopedConnection m_ctxConn;
|
||||
obs::scoped_connection m_ctxConn;
|
||||
};
|
||||
|
||||
} // namespace app
|
||||
|
@ -12,7 +12,7 @@
|
||||
#include "app/ui/editor/editor_decorator.h"
|
||||
#include "app/ui/editor/handle_type.h"
|
||||
#include "app/ui/editor/state_with_wheel_behavior.h"
|
||||
#include "base/connection.h"
|
||||
#include "obs/connection.h"
|
||||
|
||||
namespace app {
|
||||
namespace tools {
|
||||
@ -76,8 +76,8 @@ namespace app {
|
||||
void onPivotChange(Editor* editor);
|
||||
|
||||
Decorator* m_decorator;
|
||||
base::ScopedConnection m_pivotVisConn;
|
||||
base::ScopedConnection m_pivotPosConn;
|
||||
obs::scoped_connection m_pivotVisConn;
|
||||
obs::scoped_connection m_pivotPosConn;
|
||||
bool m_transformSelectionHandlesAreVisible;
|
||||
};
|
||||
|
||||
|
@ -9,8 +9,8 @@
|
||||
#pragma once
|
||||
|
||||
#include "app/file_system.h"
|
||||
#include "base/signal.h"
|
||||
#include "base/time.h"
|
||||
#include "obs/signal.h"
|
||||
#include "ui/timer.h"
|
||||
#include "ui/widget.h"
|
||||
|
||||
@ -40,9 +40,9 @@ namespace app {
|
||||
|
||||
gfx::Rect thumbnailBounds();
|
||||
|
||||
base::Signal0<void> FileSelected;
|
||||
base::Signal0<void> FileAccepted;
|
||||
base::Signal0<void> CurrentFolderChanged;
|
||||
obs::signal<void()> FileSelected;
|
||||
obs::signal<void()> FileAccepted;
|
||||
obs::signal<void()> CurrentFolderChanged;
|
||||
|
||||
protected:
|
||||
virtual bool onProcessMessage(ui::Message* msg) override;
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Aseprite
|
||||
// Copyright (C) 2001-2015 David Capello
|
||||
// Copyright (C) 2001-2016 David Capello
|
||||
//
|
||||
// This program is distributed under the terms of
|
||||
// the End-User License Agreement for Aseprite.
|
||||
@ -28,7 +28,7 @@ namespace app {
|
||||
|
||||
void showPopup(const gfx::Rect& bounds);
|
||||
|
||||
base::Signal1<void, const std::string&> Load;
|
||||
obs::signal<void(const std::string&)> Load;
|
||||
|
||||
protected:
|
||||
void onChangeFont();
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Aseprite
|
||||
// Copyright (C) 2001-2015 David Capello
|
||||
// Copyright (C) 2001-2016 David Capello
|
||||
//
|
||||
// This program is distributed under the terms of
|
||||
// the End-User License Agreement for Aseprite.
|
||||
@ -9,7 +9,7 @@
|
||||
#pragma once
|
||||
|
||||
#include "app/color.h"
|
||||
#include "base/signal.h"
|
||||
#include "obs/signal.h"
|
||||
#include "ui/box.h"
|
||||
#include "ui/entry.h"
|
||||
#include "ui/label.h"
|
||||
@ -24,7 +24,7 @@ namespace app {
|
||||
void setColor(const app::Color& color);
|
||||
|
||||
// Signals
|
||||
base::Signal1<void, const app::Color&> ColorChange;
|
||||
obs::signal<void(const app::Color&)> ColorChange;
|
||||
|
||||
protected:
|
||||
void onEntryChange();
|
||||
|
@ -8,8 +8,6 @@
|
||||
#define APP_INPUT_CHAIN_H_INCLUDED
|
||||
#pragma once
|
||||
|
||||
#include "base/observable.h"
|
||||
|
||||
#include <vector>
|
||||
|
||||
namespace app {
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Aseprite
|
||||
// Copyright (C) 2001-2015 David Capello
|
||||
// Copyright (C) 2001-2016 David Capello
|
||||
//
|
||||
// This program is distributed under the terms of
|
||||
// the End-User License Agreement for Aseprite.
|
||||
@ -8,7 +8,7 @@
|
||||
#define APP_UI_MARCHING_ANTS_H_INCLUDED
|
||||
#pragma once
|
||||
|
||||
#include "base/connection.h"
|
||||
#include "obs/connection.h"
|
||||
#include "ui/timer.h"
|
||||
|
||||
#include <cmath>
|
||||
@ -55,7 +55,7 @@ namespace app {
|
||||
|
||||
ui::Timer m_timer;
|
||||
int m_offset;
|
||||
base::ScopedConnection m_scopedConn;
|
||||
obs::scoped_connection m_scopedConn;
|
||||
};
|
||||
|
||||
} // namespace app
|
||||
|
@ -11,8 +11,9 @@
|
||||
#include "app/color.h"
|
||||
#include "app/ui/color_source.h"
|
||||
#include "app/ui/marching_ants.h"
|
||||
#include "base/connection.h"
|
||||
#include "doc/palette_picks.h"
|
||||
#include "obs/connection.h"
|
||||
#include "obs/signal.h"
|
||||
#include "ui/event.h"
|
||||
#include "ui/mouse_buttons.h"
|
||||
#include "ui/widget.h"
|
||||
@ -81,7 +82,7 @@ namespace app {
|
||||
void pasteFromClipboard();
|
||||
void discardClipboardSelection();
|
||||
|
||||
base::Signal0<void> FocusEnter;
|
||||
obs::signal<void()> FocusEnter;
|
||||
|
||||
protected:
|
||||
bool onProcessMessage(ui::Message* msg) override;
|
||||
@ -151,7 +152,7 @@ namespace app {
|
||||
int m_rangeAnchor;
|
||||
doc::PalettePicks m_selectedEntries;
|
||||
bool m_isUpdatingColumns;
|
||||
base::ScopedConnection m_conn;
|
||||
obs::scoped_connection m_conn;
|
||||
Hit m_hot;
|
||||
bool m_copy;
|
||||
};
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Aseprite
|
||||
// Copyright (C) 2001-2015 David Capello
|
||||
// Copyright (C) 2001-2016 David Capello
|
||||
//
|
||||
// This program is distributed under the terms of
|
||||
// the End-User License Agreement for Aseprite.
|
||||
@ -22,7 +22,7 @@ namespace app {
|
||||
|
||||
doc::Palette* selectedPalette();
|
||||
|
||||
base::Signal1<void, doc::Palette*> PalChange;
|
||||
obs::signal<void(doc::Palette*)> PalChange;
|
||||
|
||||
protected:
|
||||
virtual void onResourceChange(Resource* resource) override;
|
||||
|
@ -106,7 +106,7 @@ public:
|
||||
setupIcons();
|
||||
}
|
||||
|
||||
base::Signal0<void> Popup;
|
||||
obs::signal<void()> Popup;
|
||||
|
||||
private:
|
||||
|
||||
@ -352,7 +352,7 @@ void PreviewEditorWindow::updateUsingEditor(Editor* editor)
|
||||
miniEditor->setFrame(editor->frame());
|
||||
miniEditor->setState(EditorStatePtr(new NavigateState));
|
||||
miniEditor->setAnimationSpeedMultiplier(m_aniSpeed);
|
||||
miniEditor->addObserver(this);
|
||||
miniEditor->add_observer(this);
|
||||
layout();
|
||||
|
||||
if (!autoScroll)
|
||||
@ -454,7 +454,7 @@ void PreviewEditorWindow::hideWindow()
|
||||
void PreviewEditorWindow::destroyDocView()
|
||||
{
|
||||
if (m_docView) {
|
||||
m_docView->editor()->removeObserver(this);
|
||||
m_docView->editor()->remove_observer(this);
|
||||
|
||||
delete m_docView;
|
||||
m_docView = nullptr;
|
||||
|
@ -8,7 +8,7 @@
|
||||
#define APP_UI_RECENT_LISTBOX_H_INCLUDED
|
||||
#pragma once
|
||||
|
||||
#include "base/connection.h"
|
||||
#include "obs/connection.h"
|
||||
#include "ui/listbox.h"
|
||||
|
||||
namespace app {
|
||||
@ -27,8 +27,8 @@ namespace app {
|
||||
private:
|
||||
void rebuildList();
|
||||
|
||||
base::ScopedConnection m_recentFilesConn;
|
||||
base::ScopedConnection m_showFullPathConn;
|
||||
obs::scoped_connection m_recentFilesConn;
|
||||
obs::scoped_connection m_showFullPathConn;
|
||||
};
|
||||
|
||||
class RecentFilesListBox : public RecentListBox {
|
||||
|
@ -12,7 +12,7 @@
|
||||
|
||||
#include "app/ui/keyboard_shortcuts.h"
|
||||
#include "base/bind.h"
|
||||
#include "base/signal.h"
|
||||
#include "obs/signal.h"
|
||||
|
||||
#include <cctype>
|
||||
|
||||
@ -33,7 +33,7 @@ public:
|
||||
updateText();
|
||||
}
|
||||
|
||||
base::Signal1<void, const ui::Accelerator*> AccelChange;
|
||||
obs::signal<void(const ui::Accelerator*)> AccelChange;
|
||||
|
||||
protected:
|
||||
bool onProcessMessage(Message* msg) override {
|
||||
|
@ -540,16 +540,16 @@ StatusBar::StatusBar()
|
||||
tooltipManager->addTooltipFor(m_zoomEntry, "Zoom Level", BOTTOM);
|
||||
tooltipManager->addTooltipFor(m_newFrame, "New Frame", BOTTOM);
|
||||
|
||||
UIContext::instance()->addObserver(this);
|
||||
UIContext::instance()->documents().addObserver(this);
|
||||
App::instance()->activeToolManager()->addObserver(this);
|
||||
UIContext::instance()->add_observer(this);
|
||||
UIContext::instance()->documents().add_observer(this);
|
||||
App::instance()->activeToolManager()->add_observer(this);
|
||||
}
|
||||
|
||||
StatusBar::~StatusBar()
|
||||
{
|
||||
App::instance()->activeToolManager()->removeObserver(this);
|
||||
UIContext::instance()->documents().removeObserver(this);
|
||||
UIContext::instance()->removeObserver(this);
|
||||
App::instance()->activeToolManager()->remove_observer(this);
|
||||
UIContext::instance()->documents().remove_observer(this);
|
||||
UIContext::instance()->remove_observer(this);
|
||||
|
||||
delete m_tipwindow; // widget
|
||||
delete m_snapToGridWindow;
|
||||
@ -692,14 +692,14 @@ void StatusBar::onResize(ResizeEvent& ev)
|
||||
void StatusBar::onActiveSiteChange(const doc::Site& site)
|
||||
{
|
||||
if (m_doc && site.document() != m_doc) {
|
||||
m_doc->removeObserver(this);
|
||||
m_doc->remove_observer(this);
|
||||
m_doc = nullptr;
|
||||
}
|
||||
|
||||
if (site.document() && site.sprite()) {
|
||||
if (!m_doc) {
|
||||
m_doc = const_cast<doc::Document*>(site.document());
|
||||
m_doc->addObserver(this);
|
||||
m_doc->add_observer(this);
|
||||
}
|
||||
else {
|
||||
ASSERT(m_doc == site.document());
|
||||
@ -725,7 +725,7 @@ void StatusBar::onRemoveDocument(doc::Document* doc)
|
||||
{
|
||||
if (m_doc &&
|
||||
m_doc == doc) {
|
||||
m_doc->removeObserver(this);
|
||||
m_doc->remove_observer(this);
|
||||
m_doc = nullptr;
|
||||
}
|
||||
}
|
||||
|
@ -138,7 +138,7 @@ Timeline::Timeline()
|
||||
|
||||
m_ctxConn = m_context->AfterCommandExecution.connect(
|
||||
&Timeline::onAfterCommandExecution, this);
|
||||
m_context->documents().addObserver(this);
|
||||
m_context->documents().add_observer(this);
|
||||
|
||||
setDoubleBuffered(true);
|
||||
addChild(&m_aniControls);
|
||||
@ -159,7 +159,7 @@ Timeline::~Timeline()
|
||||
m_clipboard_timer.stop();
|
||||
|
||||
detachDocument();
|
||||
m_context->documents().removeObserver(this);
|
||||
m_context->documents().remove_observer(this);
|
||||
delete m_confPopup;
|
||||
}
|
||||
|
||||
@ -179,7 +179,7 @@ void Timeline::updateUsingEditor(Editor* editor)
|
||||
m_editor = editor;
|
||||
|
||||
if (m_editor)
|
||||
m_editor->addObserver(this);
|
||||
m_editor->add_observer(this);
|
||||
else
|
||||
return; // No editor specified.
|
||||
|
||||
@ -187,7 +187,7 @@ void Timeline::updateUsingEditor(Editor* editor)
|
||||
DocumentView* view = m_editor->getDocumentView();
|
||||
view->getSite(&site);
|
||||
|
||||
site.document()->addObserver(this);
|
||||
site.document()->add_observer(this);
|
||||
|
||||
// If we are already in the same position as the "editor", we don't
|
||||
// need to update the at all timeline.
|
||||
@ -214,12 +214,12 @@ void Timeline::updateUsingEditor(Editor* editor)
|
||||
void Timeline::detachDocument()
|
||||
{
|
||||
if (m_document) {
|
||||
m_document->removeObserver(this);
|
||||
m_document->remove_observer(this);
|
||||
m_document = NULL;
|
||||
}
|
||||
|
||||
if (m_editor) {
|
||||
m_editor->removeObserver(this);
|
||||
m_editor->remove_observer(this);
|
||||
m_editor = NULL;
|
||||
}
|
||||
|
||||
@ -1193,7 +1193,7 @@ void Timeline::onDestroyEditor(Editor* editor)
|
||||
{
|
||||
ASSERT(m_editor == editor);
|
||||
if (m_editor == editor) {
|
||||
m_editor->removeObserver(this);
|
||||
m_editor->remove_observer(this);
|
||||
m_editor = nullptr;
|
||||
}
|
||||
}
|
||||
|
@ -13,12 +13,12 @@
|
||||
#include "app/ui/ani_controls.h"
|
||||
#include "app/ui/editor/editor_observer.h"
|
||||
#include "app/ui/input_chain_element.h"
|
||||
#include "base/connection.h"
|
||||
#include "doc/document_observer.h"
|
||||
#include "doc/documents_observer.h"
|
||||
#include "doc/frame.h"
|
||||
#include "doc/layer_index.h"
|
||||
#include "doc/sprite.h"
|
||||
#include "obs/connection.h"
|
||||
#include "ui/scroll_bar.h"
|
||||
#include "ui/timer.h"
|
||||
#include "ui/widget.h"
|
||||
@ -277,7 +277,7 @@ namespace app {
|
||||
gfx::Point m_oldPos;
|
||||
// Configure timeline
|
||||
ConfigureTimelinePopup* m_confPopup;
|
||||
base::ScopedConnection m_ctxConn;
|
||||
obs::scoped_connection m_ctxConn;
|
||||
|
||||
// Marching ants stuff to show the range in the clipboard.
|
||||
// TODO merge this with the marching ants of the sprite editor (ui::Editor)
|
||||
|
@ -24,8 +24,8 @@
|
||||
#include "app/ui/status_bar.h"
|
||||
#include "app/ui_context.h"
|
||||
#include "base/bind.h"
|
||||
#include "base/signal.h"
|
||||
#include "gfx/size.h"
|
||||
#include "obs/signal.h"
|
||||
#include "she/surface.h"
|
||||
#include "ui/ui.h"
|
||||
|
||||
@ -47,7 +47,7 @@ public:
|
||||
|
||||
ToolGroup* toolGroup() { return m_group; }
|
||||
|
||||
base::Signal1<void, Tool*> ToolSelected;
|
||||
obs::signal<void(Tool*)> ToolSelected;
|
||||
|
||||
protected:
|
||||
bool onProcessMessage(Message* msg) override;
|
||||
@ -101,12 +101,12 @@ ToolBar::ToolBar()
|
||||
m_selectedInGroup[tool->getGroup()] = tool;
|
||||
}
|
||||
|
||||
App::instance()->activeToolManager()->addObserver(this);
|
||||
App::instance()->activeToolManager()->add_observer(this);
|
||||
}
|
||||
|
||||
ToolBar::~ToolBar()
|
||||
{
|
||||
App::instance()->activeToolManager()->removeObserver(this);
|
||||
App::instance()->activeToolManager()->remove_observer(this);
|
||||
|
||||
delete m_popupWindow;
|
||||
delete m_tipWindow;
|
||||
|
@ -9,8 +9,8 @@
|
||||
#pragma once
|
||||
|
||||
#include "app/tools/active_tool_observer.h"
|
||||
#include "base/connection.h"
|
||||
#include "gfx/point.h"
|
||||
#include "obs/connection.h"
|
||||
#include "ui/timer.h"
|
||||
#include "ui/widget.h"
|
||||
|
||||
@ -90,7 +90,7 @@ namespace app {
|
||||
ui::Timer m_tipTimer;
|
||||
bool m_tipOpened;
|
||||
|
||||
base::Connection m_closeConn;
|
||||
obs::connection m_closeConn;
|
||||
};
|
||||
|
||||
} // namespace app
|
||||
|
@ -11,7 +11,7 @@
|
||||
#include "app/ui/input_chain_element.h"
|
||||
#include "app/ui/tabs.h"
|
||||
#include "app/ui/workspace_panel.h"
|
||||
#include "base/signal.h"
|
||||
#include "obs/signal.h"
|
||||
#include "ui/widget.h"
|
||||
|
||||
namespace app {
|
||||
@ -71,7 +71,7 @@ namespace app {
|
||||
bool onClear(Context* ctx) override;
|
||||
void onCancel(Context* ctx) override;
|
||||
|
||||
base::Signal0<void> ActiveViewChanged;
|
||||
obs::signal<void()> ActiveViewChanged;
|
||||
|
||||
protected:
|
||||
void onPaint(ui::PaintEvent& ev) override;
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Aseprite
|
||||
// Copyright (C) 2001-2015 David Capello
|
||||
// Copyright (C) 2001-2016 David Capello
|
||||
//
|
||||
// This program is distributed under the terms of
|
||||
// the End-User License Agreement for Aseprite.
|
||||
@ -10,7 +10,6 @@
|
||||
|
||||
#include "app/ui/animated_widget.h"
|
||||
#include "app/ui/workspace_views.h"
|
||||
#include "base/signal.h"
|
||||
#include "ui/widget.h"
|
||||
|
||||
#include <map>
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Aseprite
|
||||
// Copyright (C) 2001-2015 David Capello
|
||||
// Copyright (C) 2001-2016 David Capello
|
||||
//
|
||||
// This program is distributed under the terms of
|
||||
// the End-User License Agreement for Aseprite.
|
||||
@ -21,7 +21,7 @@ namespace app {
|
||||
|
||||
void setZoom(const render::Zoom& zoom);
|
||||
|
||||
base::Signal1<void, const render::Zoom&> ZoomChange;
|
||||
obs::signal<void(const render::Zoom&)> ZoomChange;
|
||||
|
||||
private:
|
||||
// SliderDelegate impl
|
||||
|
@ -35,7 +35,7 @@ UIContext::UIContext()
|
||||
: m_lastSelectedDoc(nullptr)
|
||||
, m_lastSelectedView(nullptr)
|
||||
{
|
||||
documents().addObserver(&Preferences::instance());
|
||||
documents().add_observer(&Preferences::instance());
|
||||
|
||||
ASSERT(m_instance == NULL);
|
||||
m_instance = this;
|
||||
@ -46,7 +46,7 @@ UIContext::~UIContext()
|
||||
ASSERT(m_instance == this);
|
||||
m_instance = NULL;
|
||||
|
||||
documents().removeObserver(&Preferences::instance());
|
||||
documents().remove_observer(&Preferences::instance());
|
||||
|
||||
// The context must be empty at this point. (It's to check if the UI
|
||||
// is working correctly, i.e. closing all files when the user can
|
||||
|
@ -50,11 +50,11 @@ namespace {
|
||||
}
|
||||
|
||||
void observeUIContext() {
|
||||
UIContext::instance()->documents().addObserver(this);
|
||||
UIContext::instance()->documents().add_observer(this);
|
||||
}
|
||||
|
||||
void unobserveUIContext() {
|
||||
UIContext::instance()->documents().removeObserver(this);
|
||||
UIContext::instance()->documents().remove_observer(this);
|
||||
}
|
||||
|
||||
bool valid() {
|
||||
|
@ -69,9 +69,8 @@ if(WIN32)
|
||||
win32_exception.cpp)
|
||||
endif()
|
||||
|
||||
# TODO remove dependency with observable library
|
||||
add_library(base-lib ${BASE_SOURCES})
|
||||
target_link_libraries(base-lib obs modp_b64)
|
||||
target_link_libraries(base-lib modp_b64)
|
||||
|
||||
if(WIN32)
|
||||
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
|
||||
|
@ -1,20 +0,0 @@
|
||||
// Aseprite Base Library
|
||||
// Copyright (c) 2001-2016 David Capello
|
||||
//
|
||||
// This file is released under the terms of the MIT license.
|
||||
// Read LICENSE.txt for more information.
|
||||
|
||||
#ifndef BASE_CONNETION_H_INCLUDED
|
||||
#define BASE_CONNETION_H_INCLUDED
|
||||
#pragma once
|
||||
|
||||
#include "obs/connection.h"
|
||||
|
||||
namespace base {
|
||||
|
||||
using Connection = obs::connection;
|
||||
using ScopedConnection = obs::scoped_connection;
|
||||
|
||||
} // namespace base
|
||||
|
||||
#endif
|
@ -1,40 +0,0 @@
|
||||
// Aseprite Base Library
|
||||
// Copyright (c) 2001-2016 David Capello
|
||||
//
|
||||
// This file is released under the terms of the MIT license.
|
||||
// Read LICENSE.txt for more information.
|
||||
|
||||
#ifndef BASE_OBSERVABLE_H_INCLUDED
|
||||
#define BASE_OBSERVABLE_H_INCLUDED
|
||||
#pragma once
|
||||
|
||||
#include "obs/observable.h"
|
||||
|
||||
namespace base {
|
||||
|
||||
template<typename Observer>
|
||||
class Observable : private obs::observable<Observer> {
|
||||
typedef obs::observable<Observer> Base;
|
||||
public:
|
||||
|
||||
void addObserver(Observer* observer) {
|
||||
Base::add_observer(observer);
|
||||
}
|
||||
|
||||
void removeObserver(Observer* observer) {
|
||||
Base::remove_observer(observer);
|
||||
}
|
||||
|
||||
void notifyObservers(void (Observer::*method)()) {
|
||||
Base::notify_observers(method);
|
||||
}
|
||||
|
||||
template<typename ...Args>
|
||||
void notifyObservers(void (Observer::*method)(Args...), Args ...args) {
|
||||
Base::template notify_observers<Args...>(method, std::forward<Args>(args)...);
|
||||
}
|
||||
};
|
||||
|
||||
} // namespace base
|
||||
|
||||
#endif // BASE_OBSERVERS_H_INCLUDED
|
@ -1,26 +0,0 @@
|
||||
// Aseprite Base Library
|
||||
// Copyright (c) 2001-2016 David Capello
|
||||
//
|
||||
// This file is released under the terms of the MIT license.
|
||||
// Read LICENSE.txt for more information.
|
||||
|
||||
#ifndef BASE_SIGNAL_H_INCLUDED
|
||||
#define BASE_SIGNAL_H_INCLUDED
|
||||
#pragma once
|
||||
|
||||
#include "obs/signal.h"
|
||||
|
||||
namespace base {
|
||||
|
||||
template<typename R>
|
||||
using Signal0 = obs::signal0<R>;
|
||||
|
||||
template<typename R, typename A1>
|
||||
using Signal1 = obs::signal1<R, A1>;
|
||||
|
||||
template<typename R, typename A1, typename A2>
|
||||
using Signal2 = obs::signal2<R, A1, A2>;
|
||||
|
||||
} // namespace base
|
||||
|
||||
#endif
|
@ -19,12 +19,12 @@ Context::Context()
|
||||
: m_docs(this)
|
||||
, m_activeDoc(NULL)
|
||||
{
|
||||
m_docs.addObserver(this);
|
||||
m_docs.add_observer(this);
|
||||
}
|
||||
|
||||
Context::~Context()
|
||||
{
|
||||
m_docs.removeObserver(this);
|
||||
m_docs.remove_observer(this);
|
||||
}
|
||||
|
||||
Site Context::activeSite() const
|
||||
@ -44,7 +44,7 @@ Document* Context::activeDocument() const
|
||||
void Context::notifyActiveSiteChanged()
|
||||
{
|
||||
Site site = activeSite();
|
||||
notifyObservers<const Site&>(&ContextObserver::onActiveSiteChange, site);
|
||||
notify_observers<const Site&>(&ContextObserver::onActiveSiteChange, site);
|
||||
}
|
||||
|
||||
void Context::onGetActiveSite(Site* site) const
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Aseprite Document Library
|
||||
// Copyright (c) 2001-2015 David Capello
|
||||
// Copyright (c) 2001-2016 David Capello
|
||||
//
|
||||
// This file is released under the terms of the MIT license.
|
||||
// Read LICENSE.txt for more information.
|
||||
@ -9,17 +9,17 @@
|
||||
#pragma once
|
||||
|
||||
#include "base/disable_copying.h"
|
||||
#include "base/observable.h"
|
||||
#include "doc/context_observer.h"
|
||||
#include "doc/documents.h"
|
||||
#include "doc/documents_observer.h"
|
||||
#include "obs/observable.h"
|
||||
|
||||
namespace doc {
|
||||
class Command;
|
||||
class Document;
|
||||
class Settings;
|
||||
|
||||
class Context : public base::Observable<ContextObserver>
|
||||
class Context : public obs::observable<ContextObserver>
|
||||
, public DocumentsObserver {
|
||||
public:
|
||||
Context();
|
||||
|
@ -70,7 +70,7 @@ void Document::setFilename(const std::string& filename)
|
||||
else
|
||||
m_filename = filename;
|
||||
|
||||
notifyObservers(&DocumentObserver::onFileNameChanged, this);
|
||||
notify_observers(&DocumentObserver::onFileNameChanged, this);
|
||||
}
|
||||
|
||||
void Document::close()
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Aseprite Document Library
|
||||
// Copyright (c) 2001-2015 David Capello
|
||||
// Copyright (c) 2001-2016 David Capello
|
||||
//
|
||||
// This file is released under the terms of the MIT license.
|
||||
// Read LICENSE.txt for more information.
|
||||
@ -10,18 +10,18 @@
|
||||
|
||||
#include <string>
|
||||
|
||||
#include "base/observable.h"
|
||||
#include "base/unique_ptr.h"
|
||||
#include "doc/document_observer.h"
|
||||
#include "doc/object.h"
|
||||
#include "doc/sprites.h"
|
||||
#include "obs/observable.h"
|
||||
|
||||
namespace doc {
|
||||
|
||||
class Context;
|
||||
|
||||
class Document : public Object
|
||||
, public base::Observable<DocumentObserver> {
|
||||
, public obs::observable<DocumentObserver> {
|
||||
public:
|
||||
Document();
|
||||
~Document();
|
||||
|
@ -34,7 +34,7 @@ Document* Documents::add(int width, int height, ColorMode mode, int ncolors)
|
||||
// Ask to observers to create the document (maybe a doc::Document or
|
||||
// a derived class).
|
||||
CreateDocumentArgs args;
|
||||
notifyObservers(&DocumentsObserver::onCreateDocument, &args);
|
||||
notify_observers(&DocumentsObserver::onCreateDocument, &args);
|
||||
if (!args.document())
|
||||
args.setDocument(new Document());
|
||||
|
||||
@ -59,7 +59,7 @@ Document* Documents::add(Document* doc)
|
||||
|
||||
m_docs.insert(begin(), doc);
|
||||
|
||||
notifyObservers(&DocumentsObserver::onAddDocument, doc);
|
||||
notify_observers(&DocumentsObserver::onAddDocument, doc);
|
||||
return doc;
|
||||
}
|
||||
|
||||
@ -71,7 +71,7 @@ void Documents::remove(Document* doc)
|
||||
|
||||
m_docs.erase(it);
|
||||
|
||||
notifyObservers(&DocumentsObserver::onRemoveDocument, doc);
|
||||
notify_observers(&DocumentsObserver::onRemoveDocument, doc);
|
||||
|
||||
doc->setContext(NULL);
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Aseprite Document Library
|
||||
// Copyright (c) 2001-2015 David Capello
|
||||
// Copyright (c) 2001-2016 David Capello
|
||||
//
|
||||
// This file is released under the terms of the MIT license.
|
||||
// Read LICENSE.txt for more information.
|
||||
@ -9,10 +9,10 @@
|
||||
#pragma once
|
||||
|
||||
#include "base/disable_copying.h"
|
||||
#include "base/observable.h"
|
||||
#include "doc/color_mode.h"
|
||||
#include "doc/documents_observer.h"
|
||||
#include "doc/object_id.h"
|
||||
#include "obs/observable.h"
|
||||
|
||||
#include <vector>
|
||||
|
||||
@ -20,7 +20,7 @@ namespace doc {
|
||||
class Context;
|
||||
class Document;
|
||||
|
||||
class Documents : public base::Observable<DocumentsObserver> {
|
||||
class Documents : public obs::observable<DocumentsObserver> {
|
||||
public:
|
||||
typedef std::vector<Document*>::iterator iterator;
|
||||
typedef std::vector<Document*>::const_iterator const_iterator;
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Aseprite Document Library
|
||||
// Copyright (c) 2001-2015 David Capello
|
||||
// Copyright (c) 2001-2016 David Capello
|
||||
//
|
||||
// This file is released under the terms of the MIT license.
|
||||
// Read LICENSE.txt for more information.
|
||||
@ -51,7 +51,7 @@ Sprite* Sprites::add(Sprite* spr)
|
||||
m_sprites.insert(begin(), spr);
|
||||
spr->setDocument(m_doc);
|
||||
|
||||
notifyObservers(&SpritesObserver::onAddSprite, spr);
|
||||
notify_observers(&SpritesObserver::onAddSprite, spr);
|
||||
return spr;
|
||||
}
|
||||
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Aseprite Document Library
|
||||
// Copyright (c) 2001-2015 David Capello
|
||||
// Copyright (c) 2001-2016 David Capello
|
||||
//
|
||||
// This file is released under the terms of the MIT license.
|
||||
// Read LICENSE.txt for more information.
|
||||
@ -9,18 +9,18 @@
|
||||
#pragma once
|
||||
|
||||
#include "base/disable_copying.h"
|
||||
#include "base/observable.h"
|
||||
#include "doc/color_mode.h"
|
||||
#include "doc/object_id.h"
|
||||
#include "doc/sprite.h"
|
||||
#include "doc/sprites_observer.h"
|
||||
#include "obs/observable.h"
|
||||
|
||||
#include <vector>
|
||||
|
||||
namespace doc {
|
||||
class Document;
|
||||
|
||||
class Sprites : base::Observable<SpritesObserver> {
|
||||
class Sprites : obs::observable<SpritesObserver> {
|
||||
public:
|
||||
typedef std::vector<Sprite*>::iterator iterator;
|
||||
typedef std::vector<Sprite*>::const_iterator const_iterator;
|
||||
|
@ -1 +1 @@
|
||||
Subproject commit 89c97405025c17fbce5b147aae86fe35b00f98e5
|
||||
Subproject commit 83dfe27536785acedb258e55ac762486d95e2ab0
|
@ -59,4 +59,5 @@ target_link_libraries(ui-lib
|
||||
clip
|
||||
gfx-lib
|
||||
base-lib
|
||||
obs
|
||||
${PIXMAN_LIBRARY})
|
||||
|
@ -8,7 +8,7 @@
|
||||
#define UI_BUTTON_H_INCLUDED
|
||||
#pragma once
|
||||
|
||||
#include "base/signal.h"
|
||||
#include "obs/signal.h"
|
||||
#include "ui/widget.h"
|
||||
|
||||
#include <vector>
|
||||
@ -52,7 +52,7 @@ namespace ui {
|
||||
IButtonIcon* iconInterface() const { return m_iconInterface; }
|
||||
|
||||
// Signals
|
||||
base::Signal1<void, Event&> Click;
|
||||
obs::signal<void(Event&)> Click;
|
||||
|
||||
protected:
|
||||
// Events
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Aseprite UI Library
|
||||
// Copyright (C) 2001-2013, 2015 David Capello
|
||||
// Copyright (C) 2001-2016 David Capello
|
||||
//
|
||||
// This file is released under the terms of the MIT license.
|
||||
// Read LICENSE.txt for more information.
|
||||
@ -8,7 +8,7 @@
|
||||
#define UI_COMBOBOX_H_INCLUDED
|
||||
#pragma once
|
||||
|
||||
#include "base/signal.h"
|
||||
#include "obs/signal.h"
|
||||
#include "ui/widget.h"
|
||||
|
||||
#include <string>
|
||||
@ -85,9 +85,9 @@ namespace ui {
|
||||
gfx::Rect getListBoxPos() const;
|
||||
|
||||
// Signals
|
||||
base::Signal0<void> Change;
|
||||
base::Signal0<void> OpenListBox;
|
||||
base::Signal0<void> CloseListBox;
|
||||
obs::signal<void()> Change;
|
||||
obs::signal<void()> OpenListBox;
|
||||
obs::signal<void()> CloseListBox;
|
||||
|
||||
protected:
|
||||
bool onProcessMessage(Message* msg) override;
|
||||
|
@ -1,5 +1,5 @@
|
||||
// Aseprite UI Library
|
||||
// Copyright (C) 2001-2013, 2015 David Capello
|
||||
// Copyright (C) 2001-2016 David Capello
|
||||
//
|
||||
// This file is released under the terms of the MIT license.
|
||||
// Read LICENSE.txt for more information.
|
||||
@ -8,7 +8,7 @@
|
||||
#define UI_ENTRY_H_INCLUDED
|
||||
#pragma once
|
||||
|
||||
#include "base/signal.h"
|
||||
#include "obs/signal.h"
|
||||
#include "ui/timer.h"
|
||||
#include "ui/widget.h"
|
||||
|
||||
@ -43,7 +43,7 @@ namespace ui {
|
||||
gfx::Rect getEntryTextBounds() const;
|
||||
|
||||
// Signals
|
||||
base::Signal0<void> Change;
|
||||
obs::signal<void()> Change;
|
||||
|
||||
protected:
|
||||
// Events
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user