mirror of
https://github.com/aseprite/aseprite.git
synced 2025-01-29 03:32:48 +00:00
Add the AppMod to modify the main window
This commit is contained in:
parent
fed1b19050
commit
256a6bc2ea
@ -1,5 +1,5 @@
|
|||||||
// Aseprite
|
// Aseprite
|
||||||
// Copyright (C) 2018 Igara Studio S.A.
|
// Copyright (C) 2018-2019 Igara Studio S.A.
|
||||||
// Copyright (C) 2001-2018 David Capello
|
// Copyright (C) 2001-2018 David Capello
|
||||||
//
|
//
|
||||||
// This program is distributed under the terms of
|
// This program is distributed under the terms of
|
||||||
@ -11,6 +11,7 @@
|
|||||||
|
|
||||||
#include "app/app.h"
|
#include "app/app.h"
|
||||||
|
|
||||||
|
#include "app/app_mod.h"
|
||||||
#include "app/check_update.h"
|
#include "app/check_update.h"
|
||||||
#include "app/cli/app_options.h"
|
#include "app/cli/app_options.h"
|
||||||
#include "app/cli/cli_processor.h"
|
#include "app/cli/cli_processor.h"
|
||||||
@ -174,12 +175,13 @@ public:
|
|||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
App* App::m_instance = NULL;
|
App* App::m_instance = nullptr;
|
||||||
|
|
||||||
App::App()
|
App::App(AppMod* mod)
|
||||||
: m_coreModules(NULL)
|
: m_mod(mod)
|
||||||
, m_modules(NULL)
|
, m_coreModules(nullptr)
|
||||||
, m_legacy(NULL)
|
, m_modules(nullptr)
|
||||||
|
, m_legacy(nullptr)
|
||||||
, m_isGui(false)
|
, m_isGui(false)
|
||||||
, m_isShell(false)
|
, m_isShell(false)
|
||||||
#ifdef ENABLE_UI
|
#ifdef ENABLE_UI
|
||||||
@ -261,8 +263,10 @@ void App::initialize(const AppOptions& options)
|
|||||||
|
|
||||||
ui::Manager::getDefault()->invalidate();
|
ui::Manager::getDefault()->invalidate();
|
||||||
|
|
||||||
// Create the main window and show it.
|
// Create the main window.
|
||||||
m_mainWindow.reset(new MainWindow);
|
m_mainWindow.reset(new MainWindow);
|
||||||
|
if (m_mod)
|
||||||
|
m_mod->modMainWindow(m_mainWindow.get());
|
||||||
|
|
||||||
// Default status of the main window.
|
// Default status of the main window.
|
||||||
app_rebuild_documents_tabs();
|
app_rebuild_documents_tabs();
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
// Aseprite
|
// Aseprite
|
||||||
// Copyright (C) 2018 Igara Studio S.A.
|
// Copyright (C) 2018-2019 Igara Studio S.A.
|
||||||
// Copyright (C) 2001-2018 David Capello
|
// Copyright (C) 2001-2018 David Capello
|
||||||
//
|
//
|
||||||
// This program is distributed under the terms of
|
// This program is distributed under the terms of
|
||||||
@ -37,6 +37,7 @@ namespace app {
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
class AppMod;
|
||||||
class AppOptions;
|
class AppOptions;
|
||||||
class BackupIndicator;
|
class BackupIndicator;
|
||||||
class Context;
|
class Context;
|
||||||
@ -67,7 +68,7 @@ namespace app {
|
|||||||
|
|
||||||
class App {
|
class App {
|
||||||
public:
|
public:
|
||||||
App();
|
App(AppMod* mod = nullptr);
|
||||||
~App();
|
~App();
|
||||||
|
|
||||||
static App* instance() { return m_instance; }
|
static App* instance() { return m_instance; }
|
||||||
@ -86,6 +87,7 @@ namespace app {
|
|||||||
void initialize(const AppOptions& options);
|
void initialize(const AppOptions& options);
|
||||||
void run();
|
void run();
|
||||||
|
|
||||||
|
AppMod* mod() const { return m_mod; }
|
||||||
tools::ToolBox* toolBox() const;
|
tools::ToolBox* toolBox() const;
|
||||||
tools::Tool* activeTool() const;
|
tools::Tool* activeTool() const;
|
||||||
tools::ActiveToolManager* activeToolManager() const;
|
tools::ActiveToolManager* activeToolManager() const;
|
||||||
@ -127,6 +129,7 @@ namespace app {
|
|||||||
|
|
||||||
static App* m_instance;
|
static App* m_instance;
|
||||||
|
|
||||||
|
AppMod* m_mod;
|
||||||
std::unique_ptr<ui::UISystem> m_uiSystem;
|
std::unique_ptr<ui::UISystem> m_uiSystem;
|
||||||
CoreModules* m_coreModules;
|
CoreModules* m_coreModules;
|
||||||
Modules* m_modules;
|
Modules* m_modules;
|
||||||
|
22
src/app/app_mod.h
Normal file
22
src/app/app_mod.h
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
// Aseprite
|
||||||
|
// Copyright (C) 2019 Igara Studio S.A.
|
||||||
|
//
|
||||||
|
// This program is distributed under the terms of
|
||||||
|
// the End-User License Agreement for Aseprite.
|
||||||
|
|
||||||
|
#ifndef APP_APP_MOD_H_INCLUDED
|
||||||
|
#define APP_APP_MOD_H_INCLUDED
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
namespace app {
|
||||||
|
class MainWindow;
|
||||||
|
|
||||||
|
class AppMod {
|
||||||
|
public:
|
||||||
|
virtual ~AppMod() { }
|
||||||
|
virtual void modMainWindow(MainWindow* mainWindow) = 0;
|
||||||
|
};
|
||||||
|
|
||||||
|
} // namespace app
|
||||||
|
|
||||||
|
#endif
|
Loading…
x
Reference in New Issue
Block a user