Solve the gamma problem (corrected locale when loading/saving settings file)
[synfig.git] / synfig-studio / trunk / src / gtkmm / state_polygon.cpp
index cd185fc..19b26cd 100644 (file)
@@ -1,20 +1,21 @@
-/* === S I N F G =========================================================== */
+/* === S Y N F I G ========================================================= */
 /*!    \file rotoscope_polygon.cpp
 **     \brief Template File
 **
 **     $Id: state_polygon.cpp,v 1.1.1.1 2005/01/07 03:34:36 darco Exp $
 **
 **     \legal
-**     Copyright (c) 2002 Robert B. Quattlebaum Jr.
+**     Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley
 **
-**     This software and associated documentation
-**     are CONFIDENTIAL and PROPRIETARY property of
-**     the above-mentioned copyright holder.
+**     This package is free software; you can redistribute it and/or
+**     modify it under the terms of the GNU General Public License as
+**     published by the Free Software Foundation; either version 2 of
+**     the License, or (at your option) any later version.
 **
-**     You may not copy, print, publish, or in any
-**     other way distribute this software without
-**     a prior written agreement with
-**     the copyright holder.
+**     This package is distributed in the hope that it will be useful,
+**     but WITHOUT ANY WARRANTY; without even the implied warranty of
+**     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+**     General Public License for more details.
 **     \endlegal
 */
 /* ========================================================================= */
 #include <gtkmm/dialog.h>
 #include <gtkmm/entry.h>
 
-#include <sinfg/valuenode_dynamiclist.h>
-#include <sinfgapp/action_system.h>
+#include <synfig/valuenode_dynamiclist.h>
+#include <synfigapp/action_system.h>
 
 #include "state_polygon.h"
 #include "canvasview.h"
 #include "workarea.h"
 #include "app.h"
 
-#include <sinfgapp/action.h>
+#include <synfigapp/action.h>
 #include "event_mouse.h"
 #include "event_layerclick.h"
 #include "toolbox.h"
 #include "dialog_tooloptions.h"
-#include <sinfgapp/main.h>
+#include <synfigapp/main.h>
 
 #endif
 
@@ -52,7 +53,7 @@
 
 using namespace std;
 using namespace etl;
-using namespace sinfg;
+using namespace synfig;
 using namespace studio;
 
 /* === M A C R O S ========================================================= */
@@ -75,14 +76,14 @@ class studio::StatePolygon_Context : public sigc::trackable
 
        Duckmatic::Push duckmatic_push;
        
-       std::list<sinfg::Point> polygon_point_list;
-       sinfgapp::Settings& settings;
+       std::list<synfig::Point> polygon_point_list;
+       synfigapp::Settings& settings;
 
        
-       bool on_polygon_duck_change(const sinfg::Point &point, std::list<sinfg::Point>::iterator iter);
+       bool on_polygon_duck_change(const synfig::Point &point, std::list<synfig::Point>::iterator iter);
 
 
-       void popup_handle_menu(sinfgapp::ValueDesc value_desc);
+       void popup_handle_menu(synfigapp::ValueDesc value_desc);
 
 
        void refresh_ducks();
@@ -92,8 +93,8 @@ class studio::StatePolygon_Context : public sigc::trackable
        Gtk::Button button_make;
 
 public:
-       sinfg::String get_id()const { return entry_id.get_text(); }
-       void set_id(const sinfg::String& x) { return entry_id.set_text(x); }
+       synfig::String get_id()const { return entry_id.get_text(); }
+       void set_id(const synfig::String& x) { return entry_id.set_text(x); }
 
        Smach::event_result event_stop_handler(const Smach::event& x);
 
@@ -108,11 +109,11 @@ public:
        ~StatePolygon_Context();
 
        const etl::handle<CanvasView>& get_canvas_view()const{return canvas_view_;}
-       etl::handle<sinfgapp::CanvasInterface> get_canvas_interface()const{return canvas_view_->canvas_interface();}
-       sinfg::Canvas::Handle get_canvas()const{return canvas_view_->get_canvas();}
+       etl::handle<synfigapp::CanvasInterface> get_canvas_interface()const{return canvas_view_->canvas_interface();}
+       synfig::Canvas::Handle get_canvas()const{return canvas_view_->get_canvas();}
        WorkArea * get_work_area()const{return canvas_view_->get_work_area();}
        
-       //void on_user_click(sinfg::Point point);
+       //void on_user_click(synfig::Point point);
        void load_settings();
        void save_settings();
        void reset();
@@ -216,7 +217,7 @@ StatePolygon_Context::StatePolygon_Context(CanvasView* canvas_view):
        is_working(*canvas_view),
        prev_workarea_layer_status_(get_work_area()->allow_layer_clicks),
        duckmatic_push(get_work_area()),
-       settings(sinfgapp::Main::get_selected_input_device()->settings()),
+       settings(synfigapp::Main::get_selected_input_device()->settings()),
        entry_id(),
        button_make(_("Make"))
 {
@@ -322,7 +323,7 @@ StatePolygon_Context::~StatePolygon_Context()
 Smach::event_result
 StatePolygon_Context::event_stop_handler(const Smach::event& x)
 {
-       sinfg::info("STATE RotoPolygon: Received Stop Event");
+       synfig::info("STATE RotoPolygon: Received Stop Event");
        //throw Smach::egress_exception();
        reset();
        return Smach::RESULT_ACCEPT;
@@ -332,7 +333,7 @@ StatePolygon_Context::event_stop_handler(const Smach::event& x)
 Smach::event_result
 StatePolygon_Context::event_refresh_handler(const Smach::event& x)
 {
-       sinfg::info("STATE RotoPolygon: Received Refresh Event");
+       synfig::info("STATE RotoPolygon: Received Refresh Event");
        refresh_ducks();
        return Smach::RESULT_ACCEPT;
 }
@@ -361,8 +362,8 @@ StatePolygon_Context::run()
                }
 
                {
-                       sinfgapp::Action::PassiveGrouper group(get_canvas_interface()->get_instance().get(),_("New Polygon"));
-                       sinfgapp::PushMode push_mode(get_canvas_interface(),sinfgapp::MODE_NORMAL);
+                       synfigapp::Action::PassiveGrouper group(get_canvas_interface()->get_instance().get(),_("New Polygon"));
+                       synfigapp::PushMode push_mode(get_canvas_interface(),synfigapp::MODE_NORMAL);
        
                        Layer::Handle layer(get_canvas_interface()->add_layer_to("polygon",canvas,depth));
                        layer->set_description(get_id());
@@ -377,8 +378,8 @@ StatePolygon_Context::run()
                        }
                        
                        {
-                               sinfgapp::Action::Handle action(sinfgapp::Action::create("value_desc_convert"));
-                               sinfgapp::ValueDesc value_desc(layer,"vector_list");
+                               synfigapp::Action::Handle action(synfigapp::Action::create("value_desc_convert"));
+                               synfigapp::ValueDesc value_desc(layer,"vector_list");
                                action->set_param("canvas",get_canvas());                       
                                action->set_param("canvas_interface",get_canvas_interface());                   
                                action->set_param("value_desc",value_desc);                     
@@ -413,7 +414,7 @@ StatePolygon_Context::run()
 Smach::event_result
 StatePolygon_Context::event_mouse_click_handler(const Smach::event& x)
 {
-       sinfg::info("STATE ROTOPOLYGON: Received mouse button down Event");
+       synfig::info("STATE ROTOPOLYGON: Received mouse button down Event");
        const EventMouse& event(*reinterpret_cast<const EventMouse*>(&x));
        switch(event.button)
        {
@@ -438,7 +439,7 @@ StatePolygon_Context::refresh_ducks()
        
        if(polygon_point_list.empty()) return;
 
-       std::list<sinfg::Point>::iterator iter=polygon_point_list.begin();
+       std::list<synfig::Point>::iterator iter=polygon_point_list.begin();
        
        etl::handle<WorkArea::Duck> duck;
        duck=new WorkArea::Duck(*iter);
@@ -472,7 +473,7 @@ StatePolygon_Context::refresh_ducks()
 
 
 bool
-StatePolygon_Context::on_polygon_duck_change(const sinfg::Point &point, std::list<sinfg::Point>::iterator iter)
+StatePolygon_Context::on_polygon_duck_change(const synfig::Point &point, std::list<synfig::Point>::iterator iter)
 {
        *iter=point;
        return true;