Merge branch 'genete_static_values'
authorCarlos Lopez <genetita@gmail.com>
Wed, 1 Sep 2010 15:32:44 +0000 (17:32 +0200)
committerCarlos Lopez <genetita@gmail.com>
Wed, 1 Sep 2010 15:32:44 +0000 (17:32 +0200)
1  2 
synfig-core/src/modules/lyr_std/import.cpp

@@@ -67,6 -67,8 +67,8 @@@ SYNFIG_LAYER_SET_CVS_ID(Import,"$Id$")
  Import::Import()
  {
        time_offset=0;
+       Layer::Vocab voc(get_param_vocab());
+       Layer::fill_static(voc);
  }
  
  Import::~Import()
@@@ -86,6 -88,7 +88,7 @@@ Import::set_param(const String & param
        IMPORT(time_offset);
        if(param=="filename" && value.same_type_as(filename))
        {
+               set_param_static(param, value.get_static());
                if(!get_canvas())
                {
                        filename=value.get(filename);
                }
  
                surface.clear();
 -              if(!newimporter->get_frame(surface,Time(0),trimmed,width,height,top,left))
 +              if(!newimporter->get_frame(surface,get_canvas()->rend_desc(),Time(0),trimmed,width,height,top,left))
                {
                        synfig::warning(strprintf("Unable to get frame from \"%s\"",filename_with_path.c_str()));
                }
@@@ -187,8 -190,11 +190,11 @@@ Import::get_param(const String & param)
        {
                if(param=="filename")
                {
+                       ValueBase ret(ValueBase::TYPE_STRING);
+                       ret.set_static(get_param_static(param));
                        string curpath(cleanup_path(absolute_path(get_canvas()->get_file_path())));
-                       return relative_path(curpath,abs_filename);
+                       ret=relative_path(curpath,abs_filename);
+                       return ret;
                }
        }
        else
@@@ -222,7 -228,7 +228,7 @@@ Import::set_time(Context context, Time 
  {
        if(get_amount() && importer &&
           importer->is_animated())
 -              importer->get_frame(surface,time+time_offset,trimmed,width,height,top,left);
 +              importer->get_frame(surface,get_canvas()->rend_desc(),time+time_offset,trimmed,width,height,top,left);
  
        context.set_time(time);
  }
@@@ -232,7 -238,7 +238,7 @@@ Import::set_time(Context context, Time 
  {
        if(get_amount() && importer &&
           importer->is_animated())
 -              importer->get_frame(surface,time+time_offset,trimmed,width,height,top,left);
 +              importer->get_frame(surface,get_canvas()->rend_desc(),time+time_offset,trimmed,width,height,top,left);
  
        context.set_time(time,pos);
  }