DEFINE_ACTION("quality-08", _("Use Quality Level 8"));
DEFINE_ACTION("quality-09", _("Use Quality Level 9"));
DEFINE_ACTION("quality-10", _("Use Quality Level 10"));
- DEFINE_ACTION("lowres-pixel-2", _("Set Low-Res pixel size to 2"));
- DEFINE_ACTION("lowres-pixel-3", _("Set Low-Res pixel size to 3"));
- DEFINE_ACTION("lowres-pixel-4", _("Set Low-Res pixel size to 4"));
- DEFINE_ACTION("lowres-pixel-5", _("Set Low-Res pixel size to 5"));
- DEFINE_ACTION("lowres-pixel-6", _("Set Low-Res pixel size to 6"));
- DEFINE_ACTION("lowres-pixel-8", _("Set Low-Res pixel size to 8"));
- DEFINE_ACTION("lowres-pixel-10", _("Set Low-Res pixel size to 10"));
- DEFINE_ACTION("lowres-pixel-12", _("Set Low-Res pixel size to 12"));
- DEFINE_ACTION("lowres-pixel-15", _("Set Low-Res pixel size to 15"));
- DEFINE_ACTION("lowres-pixel-20", _("Set Low-Res pixel size to 20"));
- DEFINE_ACTION("lowres-pixel-24", _("Set Low-Res pixel size to 24"));
- DEFINE_ACTION("lowres-pixel-30", _("Set Low-Res pixel size to 30"));
- DEFINE_ACTION("lowres-pixel-40", _("Set Low-Res pixel size to 40"));
- DEFINE_ACTION("lowres-pixel-60", _("Set Low-Res pixel size to 60"));
- DEFINE_ACTION("lowres-pixel-120", _("Set Low-Res pixel size to 120"));
+ for(list<int>::iterator iter = CanvasView::get_pixel_sizes().begin(); iter != CanvasView::get_pixel_sizes().end(); iter++)
+ DEFINE_ACTION(strprintf("lowres-pixel-%d", *iter), strprintf(_("Set Low-Res pixel size to %d"), *iter));
DEFINE_ACTION("play", _("Play"));
// DEFINE_ACTION("pause", _("Pause"));
DEFINE_ACTION("stop", _("Stop"));
" <menuitem action='quality-09' />"
" <menuitem action='quality-10' />"
" </menu>"
-" <menu action='menu-lowres-pixel'>"
-" <menuitem action='lowres-pixel-2' />"
-" <menuitem action='lowres-pixel-3' />"
-" <menuitem action='lowres-pixel-4' />"
-" <menuitem action='lowres-pixel-5' />"
-" <menuitem action='lowres-pixel-6' />"
-" <menuitem action='lowres-pixel-8' />"
-" <menuitem action='lowres-pixel-10' />"
-" <menuitem action='lowres-pixel-12' />"
-" <menuitem action='lowres-pixel-15' />"
-" <menuitem action='lowres-pixel-20' />"
-" <menuitem action='lowres-pixel-24' />"
-" <menuitem action='lowres-pixel-30' />"
-" <menuitem action='lowres-pixel-40' />"
-" <menuitem action='lowres-pixel-60' />"
-" <menuitem action='lowres-pixel-120' />"
+" <menu action='menu-lowres-pixel'>";
+
+ for(list<int>::iterator iter = CanvasView::get_pixel_sizes().begin(); iter != CanvasView::get_pixel_sizes().end(); iter++)
+ ui_info += strprintf(" <menuitem action='lowres-pixel-%d' />", *iter);
+
+ ui_info +=
" </menu>"
" <separator name='bleh08'/>"
" <menuitem action='play'/>"
+std::list<int>&
+CanvasView::get_pixel_sizes()
+{
+ // prime factors of 120 are 2, 2, 2, 3, 5 - see TILE_SIZE in synfig-core/trunk/src/synfig/target_tile.h
+ static int pixel_size_array[] = {2,3,4,5,6,8,10,12,15,20,24,30,40,60,120};
+ static list<int> pixel_sizes = list<int>(pixel_size_array, pixel_size_array + sizeof(pixel_size_array) / sizeof(int));
+
+ return pixel_sizes;
+}
+
Gtk::Widget *
CanvasView::create_time_bar()
{
}
}
- // prime factors of 120 are 2, 2, 2, 3, 5
- int pixel_size_array[] = {2,3,4,5,6,8,10,12,15,20,24,30,40,60,120};
- list<int> pixel_sizes(pixel_size_array, pixel_size_array + sizeof(pixel_size_array) / sizeof(int));
-
// Low-Res Quality Menu
{
int i;
- for(list<int>::iterator iter = pixel_sizes.begin(); iter != pixel_sizes.end(); iter++)
+ for(list<int>::iterator iter = CanvasView::get_pixel_sizes().begin(); iter != CanvasView::get_pixel_sizes().end(); iter++)
{
i = *iter;
Glib::RefPtr<Gtk::RadioAction> action(Gtk::RadioAction::create(low_res_pixel_size_group,strprintf("lowres-pixel-%d",i),