From 11c0abb278300f2c4439b538b300433078a19a78 Mon Sep 17 00:00:00 2001 From: dooglus Date: Fri, 14 Sep 2007 22:34:53 +0000 Subject: [PATCH] Made a few more of the member variables in class WorkArea private. git-svn-id: http://svn.voria.com/code@672 1f10aa63-cdf2-0310-b900-c93c546f37ac --- .../trunk/src/gtkmm/mod_mirror/state_mirror.cpp | 2 +- synfig-studio/trunk/src/gtkmm/state_bline.cpp | 6 +++--- synfig-studio/trunk/src/gtkmm/state_circle.cpp | 6 +++--- synfig-studio/trunk/src/gtkmm/state_draw.cpp | 10 +++++----- synfig-studio/trunk/src/gtkmm/state_gradient.cpp | 8 ++++---- synfig-studio/trunk/src/gtkmm/state_polygon.cpp | 6 +++--- synfig-studio/trunk/src/gtkmm/state_rectangle.cpp | 6 +++--- synfig-studio/trunk/src/gtkmm/state_rotate.cpp | 2 +- synfig-studio/trunk/src/gtkmm/state_scale.cpp | 2 +- synfig-studio/trunk/src/gtkmm/state_sketch.cpp | 10 +++++----- synfig-studio/trunk/src/gtkmm/state_smoothmove.cpp | 2 +- synfig-studio/trunk/src/gtkmm/state_width.cpp | 12 ++++++------ synfig-studio/trunk/src/gtkmm/state_zoom.cpp | 6 +++--- synfig-studio/trunk/src/gtkmm/workarea.cpp | 10 +++++++++- synfig-studio/trunk/src/gtkmm/workarea.h | 21 ++++++++++++--------- 15 files changed, 60 insertions(+), 49 deletions(-) diff --git a/synfig-studio/trunk/src/gtkmm/mod_mirror/state_mirror.cpp b/synfig-studio/trunk/src/gtkmm/mod_mirror/state_mirror.cpp index b5ed9a8..ef430c9 100644 --- a/synfig-studio/trunk/src/gtkmm/mod_mirror/state_mirror.cpp +++ b/synfig-studio/trunk/src/gtkmm/mod_mirror/state_mirror.cpp @@ -194,7 +194,7 @@ StateMirror_Context::StateMirror_Context(CanvasView* canvas_view): refresh_tool_options(); App::dialog_tool_options->present(); - get_work_area()->allow_layer_clicks=true; + get_work_area()->set_allow_layer_clicks(true); get_work_area()->set_duck_dragger(duck_dragger_); // get_canvas_view()->work_area->set_cursor(Gdk::CROSSHAIR); diff --git a/synfig-studio/trunk/src/gtkmm/state_bline.cpp b/synfig-studio/trunk/src/gtkmm/state_bline.cpp index 9211a07..dc543ff 100644 --- a/synfig-studio/trunk/src/gtkmm/state_bline.cpp +++ b/synfig-studio/trunk/src/gtkmm/state_bline.cpp @@ -324,7 +324,7 @@ StateBLine_Context::StateBLine_Context(CanvasView* canvas_view): canvas_view_(canvas_view), is_working(*canvas_view), loop_(false), - prev_workarea_layer_status_(get_work_area()->allow_layer_clicks), + prev_workarea_layer_status_(get_work_area()->get_allow_layer_clicks()), duckmatic_push(get_work_area()), settings(synfigapp::Main::get_selected_input_device()->settings()), entry_id(), @@ -357,7 +357,7 @@ StateBLine_Context::StateBLine_Context(CanvasView* canvas_view): 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(); @@ -425,7 +425,7 @@ StateBLine_Context::~StateBLine_Context() get_canvas_view()->work_area->reset_cursor(); // Restore layer clicking - get_work_area()->allow_layer_clicks=prev_workarea_layer_status_; + get_work_area()->set_allow_layer_clicks(prev_workarea_layer_status_); // Enable the time bar get_canvas_view()->set_sensitive_timebar(true); diff --git a/synfig-studio/trunk/src/gtkmm/state_circle.cpp b/synfig-studio/trunk/src/gtkmm/state_circle.cpp index 6309588..791b555 100644 --- a/synfig-studio/trunk/src/gtkmm/state_circle.cpp +++ b/synfig-studio/trunk/src/gtkmm/state_circle.cpp @@ -272,7 +272,7 @@ StateCircle_Context::StateCircle_Context(CanvasView* canvas_view): canvas_view_(canvas_view), is_working(*canvas_view), duckmatic_push(get_work_area()), - prev_workarea_layer_status_(get_work_area()->allow_layer_clicks), + prev_workarea_layer_status_(get_work_area()->get_allow_layer_clicks()), settings(synfigapp::Main::get_selected_input_device()->settings()), entry_id(), adj_feather(0,0,1,0.01,0.1), @@ -315,7 +315,7 @@ StateCircle_Context::StateCircle_Context(CanvasView* canvas_view): 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(); @@ -358,7 +358,7 @@ StateCircle_Context::~StateCircle_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(); diff --git a/synfig-studio/trunk/src/gtkmm/state_draw.cpp b/synfig-studio/trunk/src/gtkmm/state_draw.cpp index 4beb8e7..c2afdf5 100644 --- a/synfig-studio/trunk/src/gtkmm/state_draw.cpp +++ b/synfig-studio/trunk/src/gtkmm/state_draw.cpp @@ -386,7 +386,7 @@ StateDraw_Context::StateDraw_Context(CanvasView* canvas_view): canvas_view_(canvas_view), is_working(*canvas_view), loop_(false), - prev_workarea_layer_status_(get_work_area()->allow_layer_clicks), + prev_workarea_layer_status_(get_work_area()->get_allow_layer_clicks()), settings(synfigapp::Main::get_selected_input_device()->settings()), entry_id(), checkbutton_pressure_width(_("Pressure Width")), @@ -448,10 +448,10 @@ StateDraw_Context::StateDraw_Context(CanvasView* canvas_view): get_work_area()->set_type_mask(Duck::TYPE_ALL-Duck::TYPE_TANGENT-Duck::TYPE_WIDTH); // Turn off layer clicking - get_work_area()->allow_layer_clicks=false; + get_work_area()->set_allow_layer_clicks(false); // Turn off duck clicking - get_work_area()->allow_duck_clicks=false; + get_work_area()->set_allow_duck_clicks(false); // clear out the ducks //get_work_area()->clear_ducks(); @@ -532,10 +532,10 @@ StateDraw_Context::~StateDraw_Context() get_canvas_view()->work_area->reset_cursor(); // Restore layer clicking - get_work_area()->allow_layer_clicks=prev_workarea_layer_status_; + get_work_area()->set_allow_layer_clicks(prev_workarea_layer_status_); // Restore duck clicking - get_work_area()->allow_duck_clicks=true; + get_work_area()->set_allow_duck_clicks(true); // Enable the time bar get_canvas_view()->set_sensitive_timebar(true); diff --git a/synfig-studio/trunk/src/gtkmm/state_gradient.cpp b/synfig-studio/trunk/src/gtkmm/state_gradient.cpp index 124658b..81c3800 100644 --- a/synfig-studio/trunk/src/gtkmm/state_gradient.cpp +++ b/synfig-studio/trunk/src/gtkmm/state_gradient.cpp @@ -245,7 +245,7 @@ StateGradient_Context::StateGradient_Context(CanvasView* canvas_view): is_working(*canvas_view), duckmatic_push(get_work_area()), settings(synfigapp::Main::get_selected_input_device()->settings()), - prev_workarea_layer_status_(get_work_area()->allow_layer_clicks), + prev_workarea_layer_status_(get_work_area()->get_allow_layer_clicks()), entry_id() { no_egress_on_selection_change=false; @@ -277,7 +277,7 @@ StateGradient_Context::StateGradient_Context(CanvasView* canvas_view): // Turn off layer clicking - get_work_area()->allow_layer_clicks=false; + get_work_area()->set_allow_layer_clicks(false); get_canvas_view()->work_area->set_cursor(Gdk::CROSSHAIR); @@ -322,8 +322,8 @@ StateGradient_Context::~StateGradient_Context() save_settings(); // Restore layer clicking -// get_work_area()->allow_layer_clicks=prev_workarea_layer_status_; - get_work_area()->allow_layer_clicks=true; +// 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(); App::dialog_tool_options->clear(); diff --git a/synfig-studio/trunk/src/gtkmm/state_polygon.cpp b/synfig-studio/trunk/src/gtkmm/state_polygon.cpp index ab1138b..2b9071c 100644 --- a/synfig-studio/trunk/src/gtkmm/state_polygon.cpp +++ b/synfig-studio/trunk/src/gtkmm/state_polygon.cpp @@ -215,7 +215,7 @@ StatePolygon_Context::increment_id() StatePolygon_Context::StatePolygon_Context(CanvasView* canvas_view): canvas_view_(canvas_view), is_working(*canvas_view), - prev_workarea_layer_status_(get_work_area()->allow_layer_clicks), + prev_workarea_layer_status_(get_work_area()->get_allow_layer_clicks()), duckmatic_push(get_work_area()), settings(synfigapp::Main::get_selected_input_device()->settings()), entry_id(), @@ -235,7 +235,7 @@ StatePolygon_Context::StatePolygon_Context(CanvasView* canvas_view): // 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(); @@ -301,7 +301,7 @@ StatePolygon_Context::~StatePolygon_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_); App::dialog_tool_options->clear(); diff --git a/synfig-studio/trunk/src/gtkmm/state_rectangle.cpp b/synfig-studio/trunk/src/gtkmm/state_rectangle.cpp index 50b542e..5511ad0 100644 --- a/synfig-studio/trunk/src/gtkmm/state_rectangle.cpp +++ b/synfig-studio/trunk/src/gtkmm/state_rectangle.cpp @@ -241,7 +241,7 @@ StateRectangle_Context::StateRectangle_Context(CanvasView* canvas_view): canvas_view_(canvas_view), is_working(*canvas_view), duckmatic_push(get_work_area()), - prev_workarea_layer_status_(get_work_area()->allow_layer_clicks), + prev_workarea_layer_status_(get_work_area()->get_allow_layer_clicks()), settings(synfigapp::Main::get_selected_input_device()->settings()), entry_id(), adj_expand(0,0,1,0.01,0.1), @@ -269,7 +269,7 @@ StateRectangle_Context::StateRectangle_Context(CanvasView* canvas_view): 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(); @@ -313,7 +313,7 @@ StateRectangle_Context::~StateRectangle_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(); diff --git a/synfig-studio/trunk/src/gtkmm/state_rotate.cpp b/synfig-studio/trunk/src/gtkmm/state_rotate.cpp index 23b84fe..95a66b1 100644 --- a/synfig-studio/trunk/src/gtkmm/state_rotate.cpp +++ b/synfig-studio/trunk/src/gtkmm/state_rotate.cpp @@ -185,7 +185,7 @@ StateRotate_Context::StateRotate_Context(CanvasView* canvas_view): //App::dialog_tool_options->set_widget(options_table); App::dialog_tool_options->present(); - get_work_area()->allow_layer_clicks=true; + get_work_area()->set_allow_layer_clicks(true); get_work_area()->set_duck_dragger(duck_dragger_); // get_canvas_view()->work_area->set_cursor(Gdk::CROSSHAIR); diff --git a/synfig-studio/trunk/src/gtkmm/state_scale.cpp b/synfig-studio/trunk/src/gtkmm/state_scale.cpp index 7468cb5..fcab54b 100644 --- a/synfig-studio/trunk/src/gtkmm/state_scale.cpp +++ b/synfig-studio/trunk/src/gtkmm/state_scale.cpp @@ -170,7 +170,7 @@ StateScale_Context::StateScale_Context(CanvasView* canvas_view): refresh_tool_options(); App::dialog_tool_options->present(); - get_work_area()->allow_layer_clicks=true; + get_work_area()->set_allow_layer_clicks(true); get_work_area()->set_duck_dragger(duck_dragger_); // get_canvas_view()->work_area->set_cursor(Gdk::CROSSHAIR); diff --git a/synfig-studio/trunk/src/gtkmm/state_sketch.cpp b/synfig-studio/trunk/src/gtkmm/state_sketch.cpp index 71a1ec8..6d7121e 100644 --- a/synfig-studio/trunk/src/gtkmm/state_sketch.cpp +++ b/synfig-studio/trunk/src/gtkmm/state_sketch.cpp @@ -230,7 +230,7 @@ StateSketch_Context::StateSketch_Context(CanvasView* canvas_view): action_group(Gtk::ActionGroup::create()), canvas_view_(canvas_view), is_working(*canvas_view), - prev_workarea_layer_status_(get_work_area()->allow_layer_clicks), + prev_workarea_layer_status_(get_work_area()->get_allow_layer_clicks()), button_clear_sketch(_("Clear Sketch")), button_undo_stroke(_("Undo Stroke")), button_save_sketch(_("Save Sketch")), @@ -333,12 +333,12 @@ StateSketch_Context::StateSketch_Context(CanvasView* canvas_view): App::dialog_tool_options->present(); // Turn off layer clicking - get_work_area()->allow_layer_clicks=false; + get_work_area()->set_allow_layer_clicks(false); get_canvas_view()->work_area->set_cursor(Gdk::PENCIL); // Turn off duck clicking - get_work_area()->allow_duck_clicks=false; + get_work_area()->set_allow_duck_clicks(false); // clear out the ducks //get_work_area()->clear_ducks(); @@ -366,10 +366,10 @@ StateSketch_Context::~StateSketch_Context() App::dialog_tool_options->clear(); // Restore layer clicking - get_work_area()->allow_layer_clicks=prev_workarea_layer_status_; + get_work_area()->set_allow_layer_clicks(prev_workarea_layer_status_); // Restore duck clicking - get_work_area()->allow_duck_clicks=true; + get_work_area()->set_allow_duck_clicks(true); // Enable the time bar //get_canvas_view()->set_sensitive_timebar(true); diff --git a/synfig-studio/trunk/src/gtkmm/state_smoothmove.cpp b/synfig-studio/trunk/src/gtkmm/state_smoothmove.cpp index 1e1539a..a29f6f1 100644 --- a/synfig-studio/trunk/src/gtkmm/state_smoothmove.cpp +++ b/synfig-studio/trunk/src/gtkmm/state_smoothmove.cpp @@ -183,7 +183,7 @@ StateSmoothMove_Context::StateSmoothMove_Context(CanvasView* canvas_view): //App::dialog_tool_options->set_widget(options_table); App::dialog_tool_options->present(); - get_work_area()->allow_layer_clicks=true; + get_work_area()->set_allow_layer_clicks(true); get_work_area()->set_duck_dragger(duck_dragger_); App::toolbox->refresh(); diff --git a/synfig-studio/trunk/src/gtkmm/state_width.cpp b/synfig-studio/trunk/src/gtkmm/state_width.cpp index c7d50bb..b8a7926 100644 --- a/synfig-studio/trunk/src/gtkmm/state_width.cpp +++ b/synfig-studio/trunk/src/gtkmm/state_width.cpp @@ -208,8 +208,8 @@ StateWidth_Context::reset() StateWidth_Context::StateWidth_Context(CanvasView* canvas_view): canvas_view_(canvas_view), is_working(*canvas_view), - prev_workarea_layer_clicking(get_work_area()->allow_layer_clicks), - prev_workarea_duck_clicking(get_work_area()->allow_duck_clicks), + prev_workarea_layer_clicking(get_work_area()->get_allow_layer_clicks()), + prev_workarea_duck_clicking(get_work_area()->get_allow_duck_clicks()), old_duckmask(get_work_area()->get_type_mask()), settings(synfigapp::Main::get_selected_input_device()->settings()), @@ -243,7 +243,7 @@ StateWidth_Context::StateWidth_Context(CanvasView* canvas_view): 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(); @@ -278,7 +278,7 @@ StateWidth_Context::StateWidth_Context(CanvasView* canvas_view): } //Disable duck clicking for the maximum coolness :) - get_work_area()->allow_duck_clicks = false; + get_work_area()->set_allow_duck_clicks(false); get_work_area()->set_type_mask((Duck::Type)((int)Duck::TYPE_WIDTH + (int)Duck::TYPE_RADIUS)); // Turn the mouse pointer to crosshairs @@ -327,10 +327,10 @@ StateWidth_Context::~StateWidth_Context() } // Restore Duck clicking - get_work_area()->allow_duck_clicks = prev_workarea_duck_clicking; + get_work_area()->set_allow_duck_clicks(prev_workarea_duck_clicking); // Restore layer clicking - get_work_area()->allow_layer_clicks = prev_workarea_layer_clicking; + get_work_area()->set_allow_layer_clicks(prev_workarea_layer_clicking); // Restore the mouse pointer get_work_area()->reset_cursor(); diff --git a/synfig-studio/trunk/src/gtkmm/state_zoom.cpp b/synfig-studio/trunk/src/gtkmm/state_zoom.cpp index ad1f439..b53a5fb 100644 --- a/synfig-studio/trunk/src/gtkmm/state_zoom.cpp +++ b/synfig-studio/trunk/src/gtkmm/state_zoom.cpp @@ -153,7 +153,7 @@ StateZoom_Context::reset() 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), + prev_workarea_layer_status_(get_work_area()->get_allow_layer_clicks()), settings(synfigapp::Main::get_selected_input_device()->settings()) { // Set up the tool options dialog @@ -167,7 +167,7 @@ StateZoom_Context::StateZoom_Context(CanvasView* canvas_view): 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(); //??? @@ -210,7 +210,7 @@ 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(); diff --git a/synfig-studio/trunk/src/gtkmm/workarea.cpp b/synfig-studio/trunk/src/gtkmm/workarea.cpp index 747f3fd..01b9a0a 100644 --- a/synfig-studio/trunk/src/gtkmm/workarea.cpp +++ b/synfig-studio/trunk/src/gtkmm/workarea.cpp @@ -2119,6 +2119,8 @@ WorkArea::set_quality(int x) } +namespace studio +{ class WorkAreaProgress : public synfig::ProgressCallback { WorkArea *work_area; @@ -2156,6 +2158,7 @@ public: return cb->amount_complete(current,total); } }; +} bool studio::WorkArea::async_update_preview() @@ -2534,7 +2537,12 @@ studio::WorkArea::queue_render_preview() { //synfig::info("queue_render_preview(): (re)queuing..."); //render_idle_func_id=g_idle_add_full(G_PRIORITY_DEFAULT,__render_preview,this,NULL); - render_idle_func_id=g_timeout_add_full(G_PRIORITY_DEFAULT,queue_time,__render_preview,this,NULL); + render_idle_func_id=g_timeout_add_full( + G_PRIORITY_DEFAULT, // priority - + queue_time, // interval - the time between calls to the function, in milliseconds (1/1000ths of a second) + __render_preview, // function - function to call + this, // data - data to pass to function + NULL); // notify - function to call when the idle is removed, or NULL queued=true; } /* else if(rendering) diff --git a/synfig-studio/trunk/src/gtkmm/workarea.h b/synfig-studio/trunk/src/gtkmm/workarea.h index 04cbcab..fa9ef0f 100644 --- a/synfig-studio/trunk/src/gtkmm/workarea.h +++ b/synfig-studio/trunk/src/gtkmm/workarea.h @@ -105,6 +105,7 @@ class WorkArea : public Gtk::Table, public Duckmatic friend class WorkAreaTarget_Full; friend class DirtyTrap; friend class WorkAreaRenderer; + friend class WorkAreaProgress; /* -- ** -- P U B L I C T Y P E S --------------------------------------------- @@ -235,11 +236,13 @@ private: etl::loose_handle selected_value_node_; - bool queued; - bool rendering; + bool allow_duck_clicks; + bool allow_layer_clicks; bool cancel; - bool curr_guide_is_x; + bool dirty; + bool queued; + bool rendering; /* -- ** -- P U B L I C D A T A ----------------------------------------------- @@ -261,14 +264,14 @@ public: int get_tile_w()const { return tile_w; } int get_tile_h()const { return tile_h; } + bool get_allow_layer_clicks() { return allow_layer_clicks; } + void set_allow_layer_clicks(bool value) { allow_layer_clicks=value; } + + bool get_allow_duck_clicks() { return allow_duck_clicks; } + void set_allow_duck_clicks(bool value) { allow_duck_clicks=value; } + // used in renderer_ducks.cpp bool solid_lines; - // used in workarea.cpp - bool dirty; - // used in mod_mirror/state_mirror.cpp - bool allow_layer_clicks; - // used in state_draw.cpp - bool allow_duck_clicks; // used in renderer_guides.cpp GuideList::iterator curr_guide; -- 2.7.4