my log
[synfig.git] / synfig-studio / trunk / src / synfigapp / inputdevice.h
1 /* === S Y N F I G ========================================================= */
2 /*!     \file template.h
3 **      \brief Template Header
4 **
5 **      $Id: inputdevice.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 __SYNFIG_INPUTDEVICE_H
25 #define __SYNFIG_INPUTDEVICE_H
26
27 /* === H E A D E R S ======================================================= */
28
29 #include <synfig/color.h>
30 #include <synfig/vector.h>
31 #include <synfig/distance.h>
32 #include <synfig/string.h>
33 #include <ETL/handle>
34
35 /* === M A C R O S ========================================================= */
36
37 /* === T Y P E D E F S ===================================================== */
38
39 /* === C L A S S E S & S T R U C T S ======================================= */
40
41 class DeviceSettings;
42
43 namespace synfigapp {
44 class Settings;
45
46         
47 class InputDevice : public etl::shared_object
48 {
49 public:
50         enum Type
51         {
52                 TYPE_MOUSE,
53                 TYPE_PEN,
54                 TYPE_ERASER,
55                 TYPE_CURSOR
56         };
57
58         typedef etl::handle<InputDevice> Handle;
59         
60 private:
61         synfig::String id_;
62         Type type_;
63         synfig::String state_;
64         synfig::Color foreground_color_;
65         synfig::Color background_color_;
66         synfig::Distance        bline_width_;   
67         synfig::Real opacity_;
68         synfig::Color::BlendMethod blend_method_;
69
70         DeviceSettings* device_settings;
71
72 public:
73         InputDevice(const synfig::String id_, Type type_=TYPE_MOUSE);
74         ~InputDevice();
75
76         const synfig::String& get_id()const { return id_; }
77         const synfig::String& get_state()const { return state_; }
78         const synfig::Color& get_foreground_color()const { return foreground_color_; }
79         const synfig::Color& get_background_color()const { return background_color_; }
80         const synfig::Distance& get_bline_width()const { return bline_width_; }
81         const synfig::Real& get_opacity()const { return opacity_; }
82         const synfig::Color::BlendMethod& get_blend_method()const { return blend_method_; }
83         Type get_type()const { return type_; }
84         
85         void set_state(const synfig::String& x) { state_=x; }
86         void set_foreground_color(const synfig::Color& x) { foreground_color_=x; }
87         void set_background_color(const synfig::Color& x) { background_color_=x; }
88         void set_bline_width(const synfig::Distance& x) { bline_width_=x; }
89         void set_blend_method(const synfig::Color::BlendMethod& x) { blend_method_=x; }
90         void set_opacity(const synfig::Real& x) { opacity_=x; }
91         void set_type(Type x) { type_=x; }
92         
93         Settings& settings();
94         const Settings& settings()const;
95 }; // END of class InputDevice
96
97 }; // END of namespace synfigapp
98
99 /* === E N D =============================================================== */
100
101 #endif