Fix bugs in previous commit that caused FTBFS in synfig and ETL FTBFS with older...
[synfig.git] / synfig-studio / tags / synfigstudio_0_61_07_rc2 / src / synfigapp / main.h
1 /* === S Y N F I G ========================================================= */
2 /*!     \file synfigapp/main.h
3 **      \brief Template Header
4 **
5 **      $Id$
6 **
7 **      \legal
8 **      Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
9 **
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.
14 **
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.
19 **      \endlegal
20 */
21 /* ========================================================================= */
22
23 /* === S T A R T =========================================================== */
24
25 #ifndef __SYNFIGAPP_MAIN_H
26 #define __SYNFIGAPP_MAIN_H
27
28 /* === H E A D E R S ======================================================= */
29
30 #include <ETL/ref_count>
31 #include <synfig/string.h>
32 #include <synfig/general.h>
33 #include <synfig/main.h>
34 #include <synfig/distance.h>
35 #include <synfig/real.h>
36 #include <synfig/waypoint.h>
37 #include <sigc++/signal.h>
38 #include <sigc++/object.h>
39 #include "inputdevice.h"
40 #include "settings.h"
41
42 /* === M A C R O S ========================================================= */
43
44 /* === T Y P E D E F S ===================================================== */
45
46 /* === C L A S S E S & S T R U C T S ======================================= */
47
48 namespace synfig {
49         class Color;
50         class Gradient;
51 };
52
53 namespace synfigapp {
54
55 /*!     \class synfigapp::Main
56 **      \brief \writeme
57 **
58 **      \writeme
59 */
60 class Main : public synfig::Main
61 {
62         etl::reference_counter ref_count_;
63 public:
64         Main(const synfig::String &basepath,synfig::ProgressCallback *cb=0);
65         ~Main();
66
67         const etl::reference_counter& ref_count()const { return ref_count_; }
68
69         static const synfig::Color& get_foreground_color();
70         static const synfig::Color& get_background_color();
71         static const synfig::Gradient& get_gradient();
72         static const synfig::Distance& get_bline_width();
73         static synfig::Waypoint::Interpolation get_interpolation();
74
75
76         static void set_interpolation(synfig::Waypoint::Interpolation x);
77         static void set_bline_width(synfig::Distance x);
78         static void set_foreground_color(synfig::Color color);
79         static void set_background_color(synfig::Color color);
80         static void set_gradient(synfig::Gradient gradient);
81         static void set_gradient_default_colors();
82         static void color_swap();
83
84         static synfig::Color::BlendMethod get_blend_method();
85         static const synfig::Real& get_opacity();
86         static void set_blend_method(synfig::Color::BlendMethod);
87         static void set_opacity(synfig::Real);
88         static sigc::signal<void>& signal_blend_method_changed();
89         static sigc::signal<void>& signal_opacity_changed();
90         static sigc::signal<void>& signal_interpolation_changed();
91
92         // Input Device stuff
93         static InputDevice::Handle add_input_device(const synfig::String id_, InputDevice::Type type_=InputDevice::TYPE_MOUSE);
94         static InputDevice::Handle find_input_device(const synfig::String id_);
95         static InputDevice::Handle select_input_device(const synfig::String id_);
96         static bool select_input_device(InputDevice::Handle input_device);
97         static InputDevice::Handle get_selected_input_device();
98         static void set_state(synfig::String state);
99
100         static Settings& settings();
101
102         // Signal interfaces
103         static sigc::signal<void>& signal_foreground_color_changed();
104         static sigc::signal<void>& signal_background_color_changed();
105         static sigc::signal<void>& signal_gradient_changed();
106         static sigc::signal<void>& signal_bline_width_changed();
107
108 }; // END of class Main
109
110 }; // END if namespace synfigapp
111 /* === E N D =============================================================== */
112
113 #endif