Reformat and clean up the automake files
[synfig.git] / synfig-studio / trunk / src / synfigapp / inputdevice.cpp
index 3886f0b..4a513a6 100644 (file)
@@ -2,7 +2,7 @@
 /*!    \file inputdevice.cpp
 **     \brief Template File
 **
-**     $Id: inputdevice.cpp,v 1.2 2005/01/12 04:08:32 darco Exp $
+**     $Id$
 **
 **     \legal
 **     Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
@@ -35,6 +35,8 @@
 #include <ETL/stringf>
 #include "main.h"
 
+#include "general.h"
+
 #endif
 
 /* === U S I N G =========================================================== */
@@ -85,13 +87,19 @@ public:
 
                        return true;
                }
+               if(key=="bgcolor")
+               {
+                       Color c(input_device->get_background_color());
+                       value=strprintf("%f %f %f %f",(float)c.get_r(),(float)c.get_g(),(float)c.get_b(),(float)c.get_a());
+
+                       return true;
+               }
 
                return Settings::get_value(key, value);
        }
 
        virtual bool set_value(const synfig::String& key,const synfig::String& value)
        {
-                       DEBUGPOINT();
                if(key=="state")
                {
                        input_device->set_state(value);
@@ -120,6 +128,14 @@ public:
                        input_device->set_foreground_color(synfig::Color(r,g,b,a));
                        return true;
                }
+               if(key=="bgcolor")
+               {
+                       float r=0,g=0,b=0,a=1;
+                       if(!strscanf(value,"%f %f %f %f",&r,&g,&b,&a))
+                               return false;
+                       input_device->set_background_color(synfig::Color(r,g,b,a));
+                       return true;
+               }
 
                return Settings::set_value(key, value);
        }
@@ -128,6 +144,7 @@ public:
        {
                KeyList ret(Settings::get_key_list());
                ret.push_back("color");
+               ret.push_back("bgcolor");
                ret.push_back("state");
                ret.push_back("bline_width");
                ret.push_back("blend_method");