1 /* === S Y N F I G ========================================================= */
2 /*! \file asyncrenderer.h
3 ** \brief Template Header
5 ** $Id: asyncrenderer.h,v 1.3 2005/01/12 07:03:42 darco Exp $
8 ** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
10 ** This package is free software; you can redistribute it and/or
11 ** modify it under the terms of the GNU General Public License as
12 ** published by the Free Software Foundation; either version 2 of
13 ** the License, or (at your option) any later version.
15 ** This package is distributed in the hope that it will be useful,
16 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18 ** General Public License for more details.
21 /* ========================================================================= */
23 /* === S T A R T =========================================================== */
25 #ifndef __SYNFIG_ASYNCRENDERER_H
26 #define __SYNFIG_ASYNCRENDERER_H
28 /* === H E A D E R S ======================================================= */
31 #include <sigc++/signal.h>
32 #include <sigc++/trackable.h>
33 #include <sigc++/connection.h>
35 #include <synfig/target_scanline.h>
36 #include <synfig/target_tile.h>
37 #include <synfig/surface.h>
38 #include <glibmm/main.h>
39 #include <ETL/ref_count>
40 #include <glibmm/thread.h>
41 #include <glibmm/dispatcher.h>
43 /* === M A C R O S ========================================================= */
45 /* === T Y P E D E F S ===================================================== */
47 /* === C L A S S E S & S T R U C T S ======================================= */
51 class AsyncRenderer : public etl::shared_object, public sigc::trackable
53 sigc::signal<void> signal_finished_;
54 sigc::signal<void> signal_success_;
56 std::list<sigc::connection> activity_connection_list;
58 //etl::handle<synfig::Target_Scanline> target_scanline;
59 //etl::handle<synfig::Target_Tile> target_tile;
60 etl::handle<synfig::Target> target;
65 synfig::ProgressCallback *cb;
67 sigc::signal<void> signal_stop_;
69 Glib::Thread* render_thread;
70 Glib::Dispatcher signal_done_;
72 sigc::connection done_connection;
75 -- ** -- P A R E N T M E M B E R S -----------------------------------------
79 AsyncRenderer(etl::handle<synfig::Target> target,synfig::ProgressCallback *cb=0);
80 virtual ~AsyncRenderer();
87 bool has_error()const { return error; }
88 bool has_success()const { return success; }
90 sigc::signal<void>& signal_finished() { return signal_finished_; }
91 sigc::signal<void>& signal_success() { return signal_success_; }
99 -- ** -- C H I L D M E M B E R S -------------------------------------------
106 }; // END of namespace studio
108 /* === E N D =============================================================== */