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