mirror of
https://github.com/aseprite/aseprite.git
synced 2025-03-02 13:14:01 +00:00
Add app::Project class to handle projects in the near future.
This commit is contained in:
parent
da9e9fd062
commit
f0d8703ad8
@ -187,6 +187,7 @@ add_library(aseprite-library
|
||||
app/color_utils.cpp
|
||||
app/data_recovery.cpp
|
||||
app/file_selector.cpp
|
||||
app/project.cpp
|
||||
app/widget_loader.cpp
|
||||
commands/cmd_about.cpp
|
||||
commands/cmd_advanced_mode.cpp
|
||||
|
33
src/app/project.cpp
Normal file
33
src/app/project.cpp
Normal file
@ -0,0 +1,33 @@
|
||||
/* ASEPRITE
|
||||
* Copyright (C) 2001-2012 David Capello
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "app/project.h"
|
||||
|
||||
namespace app {
|
||||
|
||||
Project::Project()
|
||||
{
|
||||
}
|
||||
|
||||
Project::~Project()
|
||||
{
|
||||
}
|
||||
|
||||
} // namespace app
|
39
src/app/project.h
Normal file
39
src/app/project.h
Normal file
@ -0,0 +1,39 @@
|
||||
/* ASEPRITE
|
||||
* Copyright (C) 2001-2012 David Capello
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef APP_PROJECT_H_INCLUDED
|
||||
#define APP_PROJECT_H_INCLUDED
|
||||
|
||||
#include "app/project_observer.h"
|
||||
#include "base/disable_copying.h"
|
||||
#include "observable.h"
|
||||
|
||||
namespace app {
|
||||
|
||||
class Project : public Observable<ProjectObserver> {
|
||||
public:
|
||||
Project();
|
||||
~Project();
|
||||
|
||||
private:
|
||||
DISABLE_COPYING(Project);
|
||||
};
|
||||
|
||||
} // namespace app
|
||||
|
||||
#endif
|
40
src/app/project_event.h
Normal file
40
src/app/project_event.h
Normal file
@ -0,0 +1,40 @@
|
||||
/* ASEPRITE
|
||||
* Copyright (C) 2001-2012 David Capello
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef APP_PROJECT_EVENT_H_INCLUDED
|
||||
#define APP_PROJECT_EVENT_H_INCLUDED
|
||||
|
||||
class Document;
|
||||
|
||||
namespace app {
|
||||
|
||||
class ProjectEvent {
|
||||
public:
|
||||
ProjectEvent(Document* document)
|
||||
: m_document(document) {
|
||||
}
|
||||
|
||||
Document* document() const { return m_document; }
|
||||
|
||||
private:
|
||||
Document* m_document;
|
||||
};
|
||||
|
||||
} // namespace app
|
||||
|
||||
#endif
|
36
src/app/project_observer.h
Normal file
36
src/app/project_observer.h
Normal file
@ -0,0 +1,36 @@
|
||||
/* ASEPRITE
|
||||
* Copyright (C) 2001-2012 David Capello
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#ifndef APP_PROJECT_OBSERVER_H_INCLUDED
|
||||
#define APP_PROJECT_OBSERVER_H_INCLUDED
|
||||
|
||||
#include "app/project_event.h"
|
||||
|
||||
namespace app {
|
||||
|
||||
class ProjectObserver {
|
||||
public:
|
||||
virtual ~ProjectObserver() { }
|
||||
virtual void dispose() = 0;
|
||||
virtual void onAddDocument(ProjectEvent& ev) = 0;
|
||||
virtual void onRemoveDocument(ProjectEvent& ev) = 0;
|
||||
};
|
||||
|
||||
} // namespace app
|
||||
|
||||
#endif
|
Loading…
x
Reference in New Issue
Block a user