X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-studio%2Ftags%2Fstable%2Fsrc%2Fgtkmm%2Fstate_zoom.cpp;h=49d7913d41330cf0733b0c46b4291481bf1947a5;hb=47fce282611fbba1044921d22ca887f9b53ad91a;hp=6ff0224ab178664908a428ed8b4e69a0f691f741;hpb=f6184c2a9c2245aae802c31c8f3300e1b744359c;p=synfig.git diff --git a/synfig-studio/tags/stable/src/gtkmm/state_zoom.cpp b/synfig-studio/tags/stable/src/gtkmm/state_zoom.cpp index 6ff0224..49d7913 100644 --- a/synfig-studio/tags/stable/src/gtkmm/state_zoom.cpp +++ b/synfig-studio/tags/stable/src/gtkmm/state_zoom.cpp @@ -1,11 +1,12 @@ /* === S Y N F I G ========================================================= */ /*! \file state_zoom.cpp -** \brief Zoom Toole Implementation File +** \brief Zoom Tool Implementation File ** ** $Id$ ** ** \legal ** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley +** Copyright (c) 2008 Chris Moore ** ** This package is free software; you can redistribute it and/or ** modify it under the terms of the GNU General Public License as @@ -41,10 +42,11 @@ #include "canvasview.h" #include "workarea.h" #include "app.h" -#include "dialog_tooloptions.h" #include "toolbox.h" #include +#include "general.h" + #endif /* === U S I N G =========================================================== */ @@ -72,21 +74,12 @@ class studio::StateZoom_Context : public sigc::trackable bool prev_workarea_layer_status_; - //Toolbox settings - synfigapp::Settings& settings; - - //Toolbox display - Gtk::Table options_table; - public: - void refresh_tool_options(); //to refresh the toolbox - //events Smach::event_result event_stop_handler(const Smach::event& x); Smach::event_result event_refresh_handler(const Smach::event& x); Smach::event_result event_mouse_click_handler(const Smach::event& x); - Smach::event_result event_refresh_tool_options(const Smach::event& x); //constructor destructor StateZoom_Context(CanvasView* canvas_view); @@ -98,14 +91,9 @@ public: synfig::Canvas::Handle get_canvas()const{return canvas_view_->get_canvas();} WorkArea * get_work_area()const{return canvas_view_->get_work_area();} - //Modifying settings etc. - void load_settings(); - void save_settings(); - void reset(); - //void zoom(const Point& p1, const Point& p2); -}; // END of class StateGradient_Context +}; // END of class StateZoom_Context /* === M E T H O D S ======================================================= */ @@ -119,55 +107,19 @@ StateZoom::StateZoom(): insert(event_def(EVENT_WORKAREA_BOX,&StateZoom_Context::event_mouse_click_handler)); //insert(event_def(EVENT_WORKAREA_BUTTON_CLICK,&StateZoom_Context::event_mouse_click_handler)); insert(event_def(EVENT_WORKAREA_MOUSE_BUTTON_UP,&StateZoom_Context::event_mouse_click_handler)); - insert(event_def(EVENT_REFRESH_TOOL_OPTIONS,&StateZoom_Context::event_refresh_tool_options)); } StateZoom::~StateZoom() { } -void -StateZoom_Context::load_settings() -{ - String value; - - //parse the arguments yargh! - /*if(settings.get_value("circle.feather",value)) - set_feather(atof(value.c_str())); - else - set_feather(0);*/ -} - -void -StateZoom_Context::save_settings() -{ - //settings.set_value("circle.fallofftype",strprintf("%d",get_falloff())); -} - -void -StateZoom_Context::reset() -{ - //refresh_ducks(); -} - StateZoom_Context::StateZoom_Context(CanvasView* canvas_view): canvas_view_(canvas_view), is_working(*canvas_view), - prev_workarea_layer_status_(get_work_area()->allow_layer_clicks), - settings(synfigapp::Main::get_selected_input_device()->settings()) + prev_workarea_layer_status_(get_work_area()->get_allow_layer_clicks()) { - // Set up the tool options dialog - //options_table.attach(*manage(new Gtk::Label(_("Zoom Tool"))), 0, 2, 0, 1, Gtk::EXPAND|Gtk::FILL, Gtk::EXPAND|Gtk::FILL, 0, 0); - - load_settings(); - - options_table.show_all(); - - refresh_tool_options(); - App::dialog_tool_options->present(); - // Turn off layer clicking - get_work_area()->allow_layer_clicks=false; + get_work_area()->set_allow_layer_clicks(false); // clear out the ducks get_work_area()->clear_ducks(); //??? @@ -189,32 +141,12 @@ StateZoom_Context::StateZoom_Context(CanvasView* canvas_view): App::toolbox->refresh(); } -void -StateZoom_Context::refresh_tool_options() -{ - App::dialog_tool_options->clear(); - App::dialog_tool_options->set_widget(options_table); - App::dialog_tool_options->set_local_name(_("Zoom Tool")); - App::dialog_tool_options->set_name("zoom"); -} - -Smach::event_result -StateZoom_Context::event_refresh_tool_options(const Smach::event& x) -{ - refresh_tool_options(); - return Smach::RESULT_ACCEPT; -} - StateZoom_Context::~StateZoom_Context() { - save_settings(); - // Restore layer clicking - get_work_area()->allow_layer_clicks=prev_workarea_layer_status_; + get_work_area()->set_allow_layer_clicks(prev_workarea_layer_status_); get_canvas_view()->work_area->reset_cursor(); - App::dialog_tool_options->clear(); - // Enable the time bar //get_canvas_view()->set_sensitive_timebar(true); @@ -230,13 +162,13 @@ StateZoom_Context::~StateZoom_Context() } Smach::event_result -StateZoom_Context::event_stop_handler(const Smach::event& x) +StateZoom_Context::event_stop_handler(const Smach::event& /*x*/) { throw Smach::egress_exception(); } Smach::event_result -StateZoom_Context::event_refresh_handler(const Smach::event& x) +StateZoom_Context::event_refresh_handler(const Smach::event& /*x*/) { return Smach::RESULT_ACCEPT; }