Made a few more of the member variables in class WorkArea private.
authordooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Fri, 14 Sep 2007 22:34:53 +0000 (22:34 +0000)
committerdooglus <dooglus@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Fri, 14 Sep 2007 22:34:53 +0000 (22:34 +0000)
git-svn-id: http://svn.voria.com/code@672 1f10aa63-cdf2-0310-b900-c93c546f37ac

15 files changed:
synfig-studio/trunk/src/gtkmm/mod_mirror/state_mirror.cpp
synfig-studio/trunk/src/gtkmm/state_bline.cpp
synfig-studio/trunk/src/gtkmm/state_circle.cpp
synfig-studio/trunk/src/gtkmm/state_draw.cpp
synfig-studio/trunk/src/gtkmm/state_gradient.cpp
synfig-studio/trunk/src/gtkmm/state_polygon.cpp
synfig-studio/trunk/src/gtkmm/state_rectangle.cpp
synfig-studio/trunk/src/gtkmm/state_rotate.cpp
synfig-studio/trunk/src/gtkmm/state_scale.cpp
synfig-studio/trunk/src/gtkmm/state_sketch.cpp
synfig-studio/trunk/src/gtkmm/state_smoothmove.cpp
synfig-studio/trunk/src/gtkmm/state_width.cpp
synfig-studio/trunk/src/gtkmm/state_zoom.cpp
synfig-studio/trunk/src/gtkmm/workarea.cpp
synfig-studio/trunk/src/gtkmm/workarea.h

index b5ed9a8..ef430c9 100644 (file)
@@ -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);
index 9211a07..dc543ff 100644 (file)
@@ -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);
index 6309588..791b555 100644 (file)
@@ -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();
index 4beb8e7..c2afdf5 100644 (file)
@@ -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);
index 124658b..81c3800 100644 (file)
@@ -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();
index ab1138b..2b9071c 100644 (file)
@@ -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();
 
index 50b542e..5511ad0 100644 (file)
@@ -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();
 
index 23b84fe..95a66b1 100644 (file)
@@ -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);
index 7468cb5..fcab54b 100644 (file)
@@ -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);
index 71a1ec8..6d7121e 100644 (file)
@@ -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);
index 1e1539a..a29f6f1 100644 (file)
@@ -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();
index c7d50bb..b8a7926 100644 (file)
@@ -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();
index ad1f439..b53a5fb 100644 (file)
@@ -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();
index 747f3fd..01b9a0a 100644 (file)
@@ -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)
index 04cbcab..fa9ef0f 100644 (file)
@@ -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<synfig::ValueNode> 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;