/* === S Y N F I G ========================================================= */
-/*! \file instance.h
+/*! \file gtkmm/instance.h
** \brief writeme
**
-** $Id: instance.h,v 1.2 2005/01/13 18:37:30 darco Exp $
+** $Id$
**
** \legal
-** Copyright (c) 2002 Robert B. Quattlebaum Jr.
+** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
+** Copyright (c) 2007 Chris Moore
**
-** This software and associated documentation
-** are CONFIDENTIAL and PROPRIETARY property of
-** the above-mentioned copyright holder.
+** This package 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.
**
-** You may not copy, print, publish, or in any
-** other way distribute this software without
-** a prior written agreement with
-** the copyright holder.
+** This package 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.
** \endlegal
*/
/* ========================================================================= */
#include <synfig/canvas.h>
/* === M A C R O S ========================================================= */
+#define DEFAULT_FILENAME_PREFIX _("Synfig Animation ") // will be followed by a different number for each document
/* === T Y P E D E F S ===================================================== */
namespace studio {
class CanvasView;
-
+
class Instance : public synfigapp::Instance
{
public:
typedef std::list< etl::handle<CanvasView> > CanvasViewList;
+ enum Status
+ {
+ STATUS_OK,
+ STATUS_ERROR,
+ STATUS_CANCEL
+ };
+
class CanvasTreeModel : public Gtk::TreeModel::ColumnRecord
{
public:
Gtk::TreeModelColumn<bool> is_editable;
Gtk::TreeModelColumn<synfigapp::ValueDesc> value_desc;
-
+
CanvasTreeModel()
{
add(value);
add(link_id);
}
} canvas_tree_model;
-
+
private:
sigc::signal<void,CanvasView*> signal_canvas_view_created_;
sigc::signal<void,CanvasView*> signal_canvas_view_deleted_;
-
+
sigc::signal<void> signal_undo_redo_status_changed_;
//! Tree containing the canvases -- used for the "canvas browser"
//! List of canvas view windows
CanvasViewList canvas_view_list_;
-
+
bool undo_status_;
bool redo_status_;
bool get_redo_status()const { return redo_status_; }
int get_visible_canvases()const;
-
+
Glib::RefPtr<Gtk::TreeStore> canvas_tree_store() { return canvas_tree_store_; }
Glib::RefPtr<const Gtk::TreeStore> canvas_tree_store()const { return canvas_tree_store_; }
static int get_count() { return instance_count_; }
//etl::handle<synfig::Canvas> get_canvas()const { return synfigapp::Instance::get_canvas(); }
-
+
etl::handle<CanvasView> find_canvas_view(etl::handle<synfig::Canvas> canvas);
//! Sets the focus to a specific canvas
void focus(etl::handle<synfig::Canvas> canvas);
CanvasViewList & canvas_view_list() { return canvas_view_list_; }
-
- const CanvasViewList & canvas_view_list()const { return canvas_view_list_; }
- bool save_as(const synfig::String &filename)const;
+ const CanvasViewList & canvas_view_list()const { return canvas_view_list_; }
bool save_as(const synfig::String &filename);
//! Opens a "Save As" dialog, and then saves the composition to that file
- void dialog_save_as();
+ //! returns true if the save was successful
+ bool dialog_save_as();
- bool save();
+ Status save();
void dialog_cvs_commit();
void dialog_cvs_update();
void dialog_cvs_revert();
-
+
//! Closes the instance of this composition
void close();
-
+
void revert();
-
+
void update_all_titles();
void refresh_canvas_tree();
-
+
bool safe_revert();
bool safe_close();