From: Nikita Kitaev Date: Thu, 14 Jan 2010 00:41:40 +0000 (-0800) Subject: Consistently access workarea via get_work_area() X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=aa9ae3cd386660a2e09c962c16894e0a58510c70;p=synfig.git Consistently access workarea via get_work_area() --- diff --git a/synfig-studio/src/gtkmm/mod_mirror/state_mirror.cpp b/synfig-studio/src/gtkmm/mod_mirror/state_mirror.cpp index 4ed6a07..bcb0a3a 100644 --- a/synfig-studio/src/gtkmm/mod_mirror/state_mirror.cpp +++ b/synfig-studio/src/gtkmm/mod_mirror/state_mirror.cpp @@ -124,7 +124,7 @@ public: void update_axes() { duck_dragger_->axis=get_axis(); - get_canvas_view()->work_area->set_cursor(get_axis() == AXIS_X?Gdk::SB_H_DOUBLE_ARROW:Gdk::SB_V_DOUBLE_ARROW); + get_work_area()->set_cursor(get_axis() == AXIS_X?Gdk::SB_H_DOUBLE_ARROW:Gdk::SB_V_DOUBLE_ARROW); } Smach::event_result event_stop_handler(const Smach::event& x); @@ -202,8 +202,8 @@ StateMirror_Context::StateMirror_Context(CanvasView* canvas_view): keypress_connect=get_work_area()->signal_key_press_event().connect(sigc::mem_fun(*this,&StateMirror_Context::key_event),false); keyrelease_connect=get_work_area()->signal_key_release_event().connect(sigc::mem_fun(*this,&StateMirror_Context::key_event),false); - get_canvas_view()->work_area->set_cursor(Gdk::SB_H_DOUBLE_ARROW); -// get_canvas_view()->work_area->reset_cursor(); + get_work_area()->set_cursor(Gdk::SB_H_DOUBLE_ARROW); +// get_work_area()->reset_cursor(); App::toolbox->refresh(); @@ -217,7 +217,7 @@ StateMirror_Context::key_event(GdkEventKey *event) if (event->keyval==GDK_Shift_L || event->keyval==GDK_Shift_R ) { set_axis(get_axis()==AXIS_X ? AXIS_Y:AXIS_X); - get_canvas_view()->work_area->set_cursor(get_axis() == AXIS_X?Gdk::SB_H_DOUBLE_ARROW:Gdk::SB_V_DOUBLE_ARROW); + get_work_area()->set_cursor(get_axis() == AXIS_X?Gdk::SB_H_DOUBLE_ARROW:Gdk::SB_V_DOUBLE_ARROW); } return false; //Pass on the event to other handlers, just in case @@ -251,7 +251,7 @@ StateMirror_Context::~StateMirror_Context() save_settings(); get_work_area()->clear_duck_dragger(); - get_canvas_view()->work_area->reset_cursor(); + get_work_area()->reset_cursor(); keypress_connect.disconnect(); keyrelease_connect.disconnect(); diff --git a/synfig-studio/src/gtkmm/state_bline.cpp b/synfig-studio/src/gtkmm/state_bline.cpp index f5cbdd3..ee0ca20 100644 --- a/synfig-studio/src/gtkmm/state_bline.cpp +++ b/synfig-studio/src/gtkmm/state_bline.cpp @@ -409,7 +409,7 @@ StateBLine_Context::StateBLine_Context(CanvasView* canvas_view): // Connect a signal //get_work_area()->signal_user_click().connect(sigc::mem_fun(*this,&studio::StateBLine_Context::on_user_click)); - get_canvas_view()->work_area->set_cursor(Gdk::CROSSHAIR); + get_work_area()->set_cursor(Gdk::CROSSHAIR); App::toolbox->refresh(); } @@ -457,7 +457,7 @@ StateBLine_Context::~StateBLine_Context() save_settings(); App::dialog_tool_options->clear(); - get_canvas_view()->work_area->reset_cursor(); + get_work_area()->reset_cursor(); // Restore layer clicking get_work_area()->set_allow_layer_clicks(prev_workarea_layer_status_); diff --git a/synfig-studio/src/gtkmm/state_circle.cpp b/synfig-studio/src/gtkmm/state_circle.cpp index de0c6e3..ce155b0 100644 --- a/synfig-studio/src/gtkmm/state_circle.cpp +++ b/synfig-studio/src/gtkmm/state_circle.cpp @@ -484,7 +484,7 @@ options_table.attach(*manage(new Gtk::Label(_("Point Angle Offset:"))), 0, 1, 14 // Connect a signal //get_work_area()->signal_user_click().connect(sigc::mem_fun(*this,&studio::StateCircle_Context::on_user_click)); - get_canvas_view()->work_area->set_cursor(Gdk::CROSSHAIR); + get_work_area()->set_cursor(Gdk::CROSSHAIR); App::toolbox->refresh(); } @@ -511,7 +511,7 @@ StateCircle_Context::~StateCircle_Context() // Restore layer clicking get_work_area()->set_allow_layer_clicks(prev_workarea_layer_status_); - get_canvas_view()->work_area->reset_cursor(); + get_work_area()->reset_cursor(); App::dialog_tool_options->clear(); diff --git a/synfig-studio/src/gtkmm/state_draw.cpp b/synfig-studio/src/gtkmm/state_draw.cpp index 79c6ba0..4482045 100644 --- a/synfig-studio/src/gtkmm/state_draw.cpp +++ b/synfig-studio/src/gtkmm/state_draw.cpp @@ -488,7 +488,7 @@ StateDraw_Context::StateDraw_Context(CanvasView* canvas_view): // Connect a signal //get_work_area()->signal_user_click().connect(sigc::mem_fun(*this,&studio::StateDraw_Context::on_user_click)); - get_canvas_view()->work_area->set_cursor(Gdk::PENCIL); + get_work_area()->set_cursor(Gdk::PENCIL); App::toolbox->refresh(); @@ -545,7 +545,7 @@ StateDraw_Context::~StateDraw_Context() get_work_area()->set_type_mask(old_duckmask); - get_canvas_view()->work_area->reset_cursor(); + get_work_area()->reset_cursor(); // Restore layer clicking get_work_area()->set_allow_layer_clicks(prev_workarea_layer_status_); diff --git a/synfig-studio/src/gtkmm/state_gradient.cpp b/synfig-studio/src/gtkmm/state_gradient.cpp index bc6c3ad..8e36214 100644 --- a/synfig-studio/src/gtkmm/state_gradient.cpp +++ b/synfig-studio/src/gtkmm/state_gradient.cpp @@ -298,7 +298,7 @@ StateGradient_Context::StateGradient_Context(CanvasView* canvas_view): // Turn off layer clicking get_work_area()->set_allow_layer_clicks(false); - get_canvas_view()->work_area->set_cursor(Gdk::CROSSHAIR); + get_work_area()->set_cursor(Gdk::CROSSHAIR); // clear out the ducks get_work_area()->clear_ducks(); @@ -343,7 +343,7 @@ StateGradient_Context::~StateGradient_Context() // Restore layer clicking // get_work_area()->set_allow_layer_clicks(prev_workarea_layer_status_); get_work_area()->set_allow_layer_clicks(true); - get_canvas_view()->work_area->reset_cursor(); + get_work_area()->reset_cursor(); App::dialog_tool_options->clear(); diff --git a/synfig-studio/src/gtkmm/state_normal.cpp b/synfig-studio/src/gtkmm/state_normal.cpp index 95be889..c763022 100644 --- a/synfig-studio/src/gtkmm/state_normal.cpp +++ b/synfig-studio/src/gtkmm/state_normal.cpp @@ -253,7 +253,7 @@ StateNormal_Context::StateNormal_Context(CanvasView* canvas_view): keyrelease_connect=get_work_area()->signal_key_release_event().connect(sigc::mem_fun(*this,&StateNormal_Context::key_released),false); //these will segfault -// get_canvas_view()->work_area->set_cursor(Gdk::CROSSHAIR); +// get_work_area()->set_cursor(Gdk::CROSSHAIR); // get_work_area()->reset_cursor(); App::toolbox->refresh(); @@ -324,7 +324,7 @@ StateNormal_Context::~StateNormal_Context() save_settings(); get_work_area()->clear_duck_dragger(); - get_canvas_view()->work_area->reset_cursor(); + get_work_area()->reset_cursor(); keypress_connect.disconnect(); keyrelease_connect.disconnect(); diff --git a/synfig-studio/src/gtkmm/state_polygon.cpp b/synfig-studio/src/gtkmm/state_polygon.cpp index 865f9b1..7c11c05 100644 --- a/synfig-studio/src/gtkmm/state_polygon.cpp +++ b/synfig-studio/src/gtkmm/state_polygon.cpp @@ -369,7 +369,7 @@ StatePolygon_Context::StatePolygon_Context(CanvasView* canvas_view): // Refresh the work area get_work_area()->queue_draw(); - get_canvas_view()->work_area->set_cursor(Gdk::CROSSHAIR); + get_work_area()->set_cursor(Gdk::CROSSHAIR); // Hide the tables if they are showing prev_table_status=get_canvas_view()->tables_are_visible(); @@ -431,7 +431,7 @@ StatePolygon_Context::~StatePolygon_Context() App::dialog_tool_options->clear(); - get_canvas_view()->work_area->reset_cursor(); + get_work_area()->reset_cursor(); // Enable the time bar get_canvas_view()->set_sensitive_timebar(true); diff --git a/synfig-studio/src/gtkmm/state_rectangle.cpp b/synfig-studio/src/gtkmm/state_rectangle.cpp index 5f09681..4f3eccb 100644 --- a/synfig-studio/src/gtkmm/state_rectangle.cpp +++ b/synfig-studio/src/gtkmm/state_rectangle.cpp @@ -386,7 +386,7 @@ StateRectangle_Context::StateRectangle_Context(CanvasView* canvas_view): // Refresh the work area get_work_area()->queue_draw(); - get_canvas_view()->work_area->set_cursor(Gdk::DOTBOX); + get_work_area()->set_cursor(Gdk::DOTBOX); // Hide the tables if they are showing //prev_table_status=get_canvas_view()->tables_are_visible(); @@ -424,7 +424,7 @@ StateRectangle_Context::~StateRectangle_Context() // Restore layer clicking get_work_area()->set_allow_layer_clicks(prev_workarea_layer_status_); - get_canvas_view()->work_area->reset_cursor(); + get_work_area()->reset_cursor(); App::dialog_tool_options->clear(); diff --git a/synfig-studio/src/gtkmm/state_rotate.cpp b/synfig-studio/src/gtkmm/state_rotate.cpp index 7ffa4f2..5463a41 100644 --- a/synfig-studio/src/gtkmm/state_rotate.cpp +++ b/synfig-studio/src/gtkmm/state_rotate.cpp @@ -195,8 +195,8 @@ StateRotate_Context::StateRotate_Context(CanvasView* canvas_view): get_work_area()->set_allow_layer_clicks(true); get_work_area()->set_duck_dragger(duck_dragger_); - get_canvas_view()->work_area->set_cursor(Gdk::EXCHANGE); -// get_canvas_view()->work_area->reset_cursor(); + get_work_area()->set_cursor(Gdk::EXCHANGE); +// get_work_area()->reset_cursor(); App::toolbox->refresh(); @@ -232,7 +232,7 @@ StateRotate_Context::~StateRotate_Context() save_settings(); get_work_area()->clear_duck_dragger(); - get_canvas_view()->work_area->reset_cursor(); + get_work_area()->reset_cursor(); App::dialog_tool_options->clear(); diff --git a/synfig-studio/src/gtkmm/state_scale.cpp b/synfig-studio/src/gtkmm/state_scale.cpp index 5f8a2f5..edfb89b 100644 --- a/synfig-studio/src/gtkmm/state_scale.cpp +++ b/synfig-studio/src/gtkmm/state_scale.cpp @@ -181,8 +181,8 @@ StateScale_Context::StateScale_Context(CanvasView* canvas_view): get_work_area()->set_allow_layer_clicks(true); get_work_area()->set_duck_dragger(duck_dragger_); - get_canvas_view()->work_area->set_cursor(Gdk::SIZING); -// get_canvas_view()->work_area->reset_cursor(); + get_work_area()->set_cursor(Gdk::SIZING); +// get_work_area()->reset_cursor(); App::toolbox->refresh(); @@ -218,7 +218,7 @@ StateScale_Context::~StateScale_Context() save_settings(); get_work_area()->clear_duck_dragger(); - get_canvas_view()->work_area->reset_cursor(); + get_work_area()->reset_cursor(); App::dialog_tool_options->clear(); diff --git a/synfig-studio/src/gtkmm/state_sketch.cpp b/synfig-studio/src/gtkmm/state_sketch.cpp index db441af..f8b77a3 100644 --- a/synfig-studio/src/gtkmm/state_sketch.cpp +++ b/synfig-studio/src/gtkmm/state_sketch.cpp @@ -337,7 +337,7 @@ StateSketch_Context::StateSketch_Context(CanvasView* canvas_view): // Turn off layer clicking get_work_area()->set_allow_layer_clicks(false); - get_canvas_view()->work_area->set_cursor(Gdk::PENCIL); + get_work_area()->set_cursor(Gdk::PENCIL); // Turn off duck clicking get_work_area()->set_allow_duck_clicks(false); @@ -363,7 +363,7 @@ StateSketch_Context::StateSketch_Context(CanvasView* canvas_view): StateSketch_Context::~StateSketch_Context() { - get_canvas_view()->work_area->reset_cursor(); + get_work_area()->reset_cursor(); App::dialog_tool_options->clear(); diff --git a/synfig-studio/src/gtkmm/state_smoothmove.cpp b/synfig-studio/src/gtkmm/state_smoothmove.cpp index d8221e9..f42df35 100644 --- a/synfig-studio/src/gtkmm/state_smoothmove.cpp +++ b/synfig-studio/src/gtkmm/state_smoothmove.cpp @@ -197,8 +197,8 @@ StateSmoothMove_Context::StateSmoothMove_Context(CanvasView* canvas_view): App::toolbox->refresh(); - get_canvas_view()->work_area->set_cursor(Gdk::FLEUR); - //get_canvas_view()->work_area->reset_cursor(); + get_work_area()->set_cursor(Gdk::FLEUR); + //get_work_area()->reset_cursor(); load_settings(); } @@ -231,7 +231,7 @@ StateSmoothMove_Context::~StateSmoothMove_Context() save_settings(); get_work_area()->clear_duck_dragger(); - get_canvas_view()->work_area->reset_cursor(); + get_work_area()->reset_cursor(); App::dialog_tool_options->clear(); diff --git a/synfig-studio/src/gtkmm/state_star.cpp b/synfig-studio/src/gtkmm/state_star.cpp index dff6c4b..270571a 100644 --- a/synfig-studio/src/gtkmm/state_star.cpp +++ b/synfig-studio/src/gtkmm/state_star.cpp @@ -511,7 +511,7 @@ StateStar_Context::StateStar_Context(CanvasView* canvas_view): // Connect a signal //get_work_area()->signal_user_click().connect(sigc::mem_fun(*this,&studio::StateStar_Context::on_user_click)); - get_canvas_view()->work_area->set_cursor(Gdk::STAR); + get_work_area()->set_cursor(Gdk::STAR); App::toolbox->refresh(); } @@ -538,7 +538,7 @@ StateStar_Context::~StateStar_Context() // Restore layer clicking get_work_area()->set_allow_layer_clicks(prev_workarea_layer_status_); - get_canvas_view()->work_area->reset_cursor(); + get_work_area()->reset_cursor(); App::dialog_tool_options->clear(); diff --git a/synfig-studio/src/gtkmm/state_text.cpp b/synfig-studio/src/gtkmm/state_text.cpp index 68508ea..f475420 100644 --- a/synfig-studio/src/gtkmm/state_text.cpp +++ b/synfig-studio/src/gtkmm/state_text.cpp @@ -317,7 +317,7 @@ StateText_Context::StateText_Context(CanvasView *canvas_view): // Connect a signal //get_work_area()->signal_user_click().connect(sigc::mem_fun(*this,&studio::StateText_Context::on_user_click)); - get_canvas_view()->work_area->set_cursor(Gdk::XTERM); + get_work_area()->set_cursor(Gdk::XTERM); App::toolbox->refresh(); } @@ -344,7 +344,7 @@ StateText_Context::~StateText_Context() // Restore layer clicking get_work_area()->set_allow_layer_clicks(prev_workarea_layer_status_); - get_canvas_view()->work_area->reset_cursor(); + get_work_area()->reset_cursor(); App::dialog_tool_options->clear(); diff --git a/synfig-studio/src/gtkmm/state_zoom.cpp b/synfig-studio/src/gtkmm/state_zoom.cpp index a167639..56363e6 100644 --- a/synfig-studio/src/gtkmm/state_zoom.cpp +++ b/synfig-studio/src/gtkmm/state_zoom.cpp @@ -137,7 +137,7 @@ StateZoom_Context::StateZoom_Context(CanvasView* canvas_view): // Connect a signal //get_work_area()->signal_user_click().connect(sigc::mem_fun(*this,&studio::StateZoom_Context::on_user_click)); - get_canvas_view()->work_area->set_cursor(Gdk::CROSSHAIR); + get_work_area()->set_cursor(Gdk::CROSSHAIR); App::toolbox->refresh(); } @@ -146,7 +146,7 @@ StateZoom_Context::~StateZoom_Context() { // Restore layer clicking get_work_area()->set_allow_layer_clicks(prev_workarea_layer_status_); - get_canvas_view()->work_area->reset_cursor(); + get_work_area()->reset_cursor(); // Enable the time bar //get_canvas_view()->set_sensitive_timebar(true);