));
}
-#define DEFINE_ACTION(x,stock) { Glib::RefPtr<Gtk::Action> action( Gtk::Action::create(x, stock) ); /*action->set_sensitive(false);*/ actions_action_group->add(action); }
-#define DEFINE_ACTION2(x,stock,label) { Glib::RefPtr<Gtk::Action> action( Gtk::Action::create(x, stock,label,label) ); /*action->set_sensitive(false);*/ actions_action_group->add(action); }
-#define DEFINE_ACTION_SIG(group,x,stock,sig) { Glib::RefPtr<Gtk::Action> action( Gtk::Action::create(x, stock) ); /*action->set_sensitive(false);*/ group->add(action,sig); }
+#define DEFINE_ACTION(x,stock) { Glib::RefPtr<Gtk::Action> action( Gtk::Action::create(x, stock) ); actions_action_group->add(action); }
+#define DEFINE_ACTION2(x,stock,label) { Glib::RefPtr<Gtk::Action> action( Gtk::Action::create(x, stock,label,label) ); actions_action_group->add(action); }
+#define DEFINE_ACTION_SIG(group,x,stock,sig) { Glib::RefPtr<Gtk::Action> action( Gtk::Action::create(x, stock) ); group->add(action,sig); }
DEFINE_ACTION2("keyframe-properties", Gtk::StockID("gtk-properties"), _("Keyframe Properties"));
DEFINE_ACTION("about", Gtk::StockID("synfig-about"));
#undef DEFINE_ACTION_2
#undef DEFINE_ACTION_SIG
-// Set up synfigapp actions
- /*{
- synfigapp::Action::Book::iterator iter;
-
- for(iter=synfigapp::Action::book().begin();iter!=synfigapp::Action::book().end();++iter)
- {
- Gtk::StockID stock_id;
-
- if(!(iter->second.category&synfigapp::Action::CATEGORY_HIDDEN))
- {
- //Gtk::Image* image(manage(new Gtk::Image()));
- if(iter->second.task=="raise") stock_id=Gtk::Stock::GO_UP;
- else if(iter->second.task=="lower") stock_id=Gtk::Stock::GO_DOWN;
- else if(iter->second.task=="move_top") stock_id=Gtk::Stock::GOTO_TOP;
- else if(iter->second.task=="move_bottom") stock_id=Gtk::Stock::GOTO_BOTTOM;
- else if(iter->second.task=="remove") stock_id=Gtk::Stock::DELETE;
- else if(iter->second.task=="set_on") stock_id=Gtk::Stock::YES;
- else if(iter->second.task=="set_off") stock_id=Gtk::Stock::NO;
- //else if(iter->second.task=="duplicate") stock_id=Gtk::Stock::COPY;
- else if(iter->second.task=="remove") stock_id=Gtk::Stock::DELETE;
- else stock_id=Gtk::StockID("synfig-"+iter->second.task);
-
- actions_action_group->add(Gtk::Action::create(
- "action-"+iter->second.name,
- stock_id,
- iter->second.local_name,iter->second.local_name
- ));
- }
- }
- }
-*/
-
-
Glib::ustring ui_info =
"<ui>"
" <popup name='menu-toolbox' action='menu-toolbox'>"
// Gamma
Gtk::Table *gamma_table=manage(new Gtk::Table(2,2,false));
notebook->append_page(*gamma_table,_("Gamma"));
- //gamma_frame->add(*gamma_table);
gamma_table->attach(gamma_pattern, 0, 2, 0, 1, Gtk::EXPAND, Gtk::SHRINK|Gtk::FILL, 0, 0);
Dockable("tool_options",_("Tool Options"),Gtk::StockID("synfig-about")),
empty_label(_("This tool has no options"))
{
- //scrolled_.add(sub_vbox_);
- //scrolled_.set_policy(Gtk::POLICY_AUTOMATIC,Gtk::POLICY_AUTOMATIC);
- //scrolled_.show();
- //get_vbox()->pack_start(scrolled_);
-
add(sub_vbox_);
set_widget(empty_label);
class Dialog_ToolOptions : public Dockable
{
Gtk::Label empty_label;
- Gtk::ScrolledWindow scrolled_;
Gtk::VBox sub_vbox_;
public:
add(*create_canvas_tree());
-/*
+/* // \todo Implement canvas management in canvas browser
add_button(
Gtk::StockID("synfig-canvas_new"),
_("Insert a new canvas")
&Dock_Canvases::menu_rename
)
);
- */
+*/
}
Dock_Canvases::~Dock_Canvases()
//! Dockable::prev_widget_ is left referencing a
//! ChildrenTree that has already been destroyed.
// set_use_scrolled(false);
-/*
- add(*create_action_tree());
-
- add_button(
- Gtk::StockID("synfig-clear_redo"),
- _("Clear the REDO Stack")
- )->signal_clicked().connect(
- sigc::mem_fun(
- *this,
- &Dock_Children::clear_redo
- )
- );
-*/
}
Dock_Children::~Dock_Children()
std::list<synfigapp::ValueDesc> value_descs;
- //std::list<Gtk::TreePath> path_list(
- //param_tree_view->get_selection()->selected_foreach_iter(tmp);
iter=param_tree_view->get_selection()->get_selected();
-
value_descs.push_back((*iter)[model.value_desc]);
curves->set_value_descs(value_descs);
-
- //curves->set_value_descs(tmp.value_descs);
}
void
set_toolbar(*dynamic_cast<Gtk::Toolbar*>(App::ui_manager()->get_widget("/toolbar-history")));
add(*create_action_tree());
-
- /*
- add_button(
- Gtk::StockID("synfig-clear_undo"),
- _("Clear the UNDO Stack")
- )->signal_clicked().connect(
- sigc::mem_fun(
- *this,
- &Dock_History::clear_undo
- )
- );
- add_button(
- Gtk::StockID("synfig-clear_redo"),
- _("Clear the REDO Stack")
- )->signal_clicked().connect(
- sigc::mem_fun(
- *this,
- &Dock_History::clear_redo
- )
- );
- */
}
Dock_History::~Dock_History()
class Dock_Info : public Dock_CanvasSpecific
{
- //bool valid;
- //synfig::Point pos;
-
Gtk::Label r,g,b,a;
Gtk::Label x,y;
keyframe_action_manager->signal_show_keyframe_properties().connect(
sigc::mem_fun(*this,&Dock_Keyframes::show_keyframe_properties)
);
-/* add_button(
- Gtk::StockID("gtk-add"),
- _("Inserts a Keyframe at the current time")
- )->signal_clicked().connect(
- sigc::mem_fun(
- *this,
- &Dock_Keyframes::add_keyframe_pressed
- )
- );
-
- add_button(
- Gtk::StockID("synfig-duplicate"),
- _("Duplicates the selected keyframe at the current time")
- )->signal_clicked().connect(
- sigc::mem_fun(
- *this,
- &Dock_Keyframes::duplicate_keyframe_pressed
- )
- );
- add_button(
- Gtk::StockID("gtk-delete"),
- _("Deletes the selected Keyframe")
- )->signal_clicked().connect(
- sigc::mem_fun(
- *this,
- &Dock_Keyframes::delete_keyframe_pressed
- )
- );
-*/
Glib::ustring ui_info =
"<ui>"
" <toolbar action='toolbar-keyframe'>"
get_canvas_view()->show_keyframe_dialog();
}
-/*
-void
-Dock_Keyframes::add_keyframe_pressed()
-{
- if(get_canvas_view())
- get_canvas_view()->on_keyframe_add_pressed();
-}
-
-void
-Dock_Keyframes::duplicate_keyframe_pressed()
-{
- if(get_canvas_view())
- get_canvas_view()->on_keyframe_duplicate_pressed();
-}
-
-void
-Dock_Keyframes::delete_keyframe_pressed()
-{
- if(get_canvas_view())
- get_canvas_view()->on_keyframe_remove_pressed();
-}
-*/
-
void
Dock_Keyframes::init_canvas_view_vfunc(etl::loose_handle<CanvasView> canvas_view)
{
Dock_Layers::Dock_Layers():
Dock_CanvasSpecific("layers",_("Layers"),Gtk::StockID("synfig-layer")),
-// layer_action_manager(0)
layer_action_manager(new LayerActionManager)
{
if(layer_action_manager)layer_action_manager->set_ui_manager(App::ui_manager());
//get the pw and ph
//float pw = r.get_pw();
//float ph = r.get_ph();
-
//synfig::warning("Nav: pixel size is %f x %f", pw,ph);
//this renders that single frame
Dock_CanvasSpecific("params",_("Params"),Gtk::Stock::INDEX/*Gtk::StockID("synfig-params")*/),
action_group(Gtk::ActionGroup::create("action_group_dock_params"))
{
-/*
- App::ui_manager()->insert_action_group(action_group_layer_ops);
-
- Glib::ustring ui_info =
- "<ui>"
- " <toolbar action='toolbar-palette'>"
- " <toolitem action='amount-increase' />"
- " <toolitem action='amount-decrease' />"
- " </toolbar>"
- "</ui>"
- ;
-
- App::ui_manager()->add_ui_from_string(ui_info);
- */
}
Dock_Params::~Dock_Params()
return true;
//return signal_param_user_click()(event->button.button,row,COLUMNID_TIME_TRACK);
}
-/* else
- {
- if(event->button.button==3)
- {
- LayerList layer_list(get_selected_layers());
- if(layer_list.size()<=1)
- {
- synfigapp::ValueDesc value_desc(row[model.value_desc]);
- Gtk::Menu* menu(manage(new Gtk::Menu()));
- menu->signal_hide().connect(sigc::bind(sigc::ptr_fun(&delete_widget), menu));
- App::get_instance(param_tree_store_->canvas_interface()->get_canvas())->make_param_menu(menu,param_tree_store_->canvas_interface()->get_canvas(),value_desc,0.5f);
- menu->popup(event->button.button,gtk_get_current_event_time());
- return true;
- }
- Gtk::Menu* menu(manage(new Gtk::Menu()));
- menu->signal_hide().connect(sigc::bind(sigc::ptr_fun(&delete_widget), menu));
- std::list<synfigapp::ValueDesc> value_desc_list;
- ParamDesc param_desc(row[model.param_desc]);
- for(;!layer_list.empty();layer_list.pop_back())
- value_desc_list.push_back(synfigapp::ValueDesc(layer_list.back(),param_desc.get_name()));
- App::get_instance(param_tree_store_->canvas_interface()->get_canvas())->make_param_menu(menu,param_tree_store_->canvas_interface()->get_canvas(),value_desc_list);
- menu->popup(event->button.button,gtk_get_current_event_time());
- return true;
- }
- else
- {
- if(column->get_first_cell_renderer()==cellrenderer_value)
- return signal_param_user_click()(event->button.button,row,COLUMNID_VALUE);
- else
- return signal_param_user_click()(event->button.button,row,COLUMNID_NAME);
- }
- }
- */
}
break;
void
on_waypoint_changed( synfig::Waypoint waypoint , synfig::ValueNode::Handle value_node)
{
- // is this code used?
+ // \todo is this code used?
assert(0);
synfigapp::Action::ParamList param_list;
use_scrolled_=true;
- //set_title(local_name);
- //set_type_hint(Gdk::WINDOW_TYPE_HINT_UTILITY);
-
-
- title_label_.show();
-
attach_dnd_to(title_label_);
- //scrolled_.set_policy(Gtk::POLICY_AUTOMATIC,Gtk::POLICY_AUTOMATIC);
- //scrolled_.show();
- //scrolled_.set_shadow_type(Gtk::SHADOW_NONE);
-
toolbar_=0;
//button_box_.show();
{
title_label_.set_padding(0,0);
+ //title_label_.show();
Gtk::EventBox* event_box(manage(new Gtk::EventBox()));
event_box->set_border_width(0);
event_box->add(title_label_);
prev_widget_->show();
set_size_request(175,120);
- //scrolled_.set_shadow_type(Gtk::SHADOW_NONE);
}
delete scrolled_;
scrolled_=0;
}
-
- /*if(App::dock_manager)try{
- App::dock_manager->unregister_dockable(*this);
- std::list<Dockable*>::iterator iter;
- for(iter=App::dock_manager->dockable_list_.begin();iter!=App::dock_manager->dockable_list_.end();++iter)
- if(*iter==this)
- {
- App::dock_manager->dockable_list_.erase(iter);
- return;
- }
- } catch(...) { }
-*/
- //if(App::dock_manager)
- // App::dock_manager->dockable_list_.erase(this);
}
void
if(prev_widget_)
{
remove(*prev_widget_);
- //prev_widget_=0;
clear_previous();
}
{
DockDialog* dock_dialog(new DockDialog());
dock_dialog->get_dock_book().add(*this);
- //if(get_name()=="canvases")
- // dock_dialog->set_composition_selector(true);
+/* //hack: always display composition selector on top of canvas browser
+ if(get_name()=="canvases")
+ dock_dialog->set_composition_selector(true);
+*/
dock_dialog->present();
}
}
Gtk::Label title_label_;
//Gtk::HBox button_box_;
Gtk::HBox header_box_;
- //Gtk::VBox vbox_;
//Gtk::HandleBox handle_box_;
Gtk::ScrolledWindow *scrolled_;
bool dnd_success_;
public:
- //Gtk::VBox* get_vbox() { return &vbox_; }
void set_toolbar(Gtk::Toolbar& toolbar);
dockable.show();
- //set_current_page(get_n_pages()-1);
-
signal_changed_();
}
synfig::warning("Unable to open "+path_to_icons+"synfig_icon."+IMAGE_EXT);
}
-/*
-#define INIT_STOCK_ICON(name,iconfile,desc) \
- stock_##name=Gtk::StockItem(Gtk::StockID("synfig-" #name),desc); \
- Gtk::Stock::add(stock_##name); \
- icon_source.set_filename(path_to_icons+iconfile); \
- icon_##name.add_source(icon_source); \
- icon_factory->add(stock_##name.get_stock_id(),icon_##name)
-*/
#define INIT_STOCK_ICON(name,iconfile,desc){ \
Gtk::StockItem stockitem(Gtk::StockID("synfig-" #name),desc); \
Gtk::Stock::add(stockitem); \
INIT_STOCK_ICON(gradient,"gradient_icon."IMAGE_EXT,_("Gradient Tool"));
INIT_STOCK_ICON(star,"star_icon."IMAGE_EXT,_("Star Tool"));
+#undef INIT_STOCK_ICON
+#undef INIT_STOCK_ICON
+
icon_factory->add_default();
Gtk::IconSize::register_new("synfig-small_icon",12,12);
Gdk::Cursor
IconController::get_tool_cursor(const Glib::ustring& name,const Glib::RefPtr<Gdk::Window>& window)
{
+ //this function is never called
+ //it is commented out in WorkArea::refresh_cursor()
+ assert(0);
+ // \todo Do we still need it?
+
Glib::RefPtr<Gdk::Pixmap> pixmap;
pixmap=Gdk::Pixmap::create(window, 64, 64, 8);
pixmap->set_colormap(window->get_colormap());
drawing_area->get_window()->set_cursor(Gdk::Cursor(x));
}
-#include "iconcontroller.h"
-
+//#include "iconcontroller.h"
void
studio::WorkArea::refresh_cursor()
{