X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=synfig-studio%2Ftrunk%2Fsrc%2Fgtkmm%2Ficoncontroler.cpp;h=2e4aa0af19e75375e16b22a17e2e6fcbbee00b4c;hb=c3ad95144d148602f672e95ddda1f18fc35502f8;hp=36adb8baaa63638b64ef312c44af74132a1b28f2;hpb=02252941b29de64037116f4d37991a38d9ff0d94;p=synfig.git diff --git a/synfig-studio/trunk/src/gtkmm/iconcontroler.cpp b/synfig-studio/trunk/src/gtkmm/iconcontroler.cpp index 36adb8b..2e4aa0a 100644 --- a/synfig-studio/trunk/src/gtkmm/iconcontroler.cpp +++ b/synfig-studio/trunk/src/gtkmm/iconcontroler.cpp @@ -1,20 +1,21 @@ /* === S Y N F I G ========================================================= */ -/*! \file template.cpp +/*! \file iconcontroler.cpp ** \brief Template File ** -** $Id: iconcontroler.cpp,v 1.1.1.1 2005/01/07 03:34:36 darco Exp $ +** $Id$ ** ** \legal -** Copyright (c) 2002 Robert B. Quattlebaum Jr. +** Copyright (c) 2002-2005 Robert B. Quattlebaum Jr., Adrian Bentley ** -** This software and associated documentation -** are CONFIDENTIAL and PROPRIETARY property of -** the above-mentioned copyright holder. +** This package is free software; you can redistribute it and/or +** modify it under the terms of the GNU General Public License as +** published by the Free Software Foundation; either version 2 of +** the License, or (at your option) any later version. ** -** You may not copy, print, publish, or in any -** other way distribute this software without -** a prior written agreement with -** the copyright holder. +** This package is distributed in the hope that it will be useful, +** but WITHOUT ANY WARRANTY; without even the implied warranty of +** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +** General Public License for more details. ** \endlegal */ /* ========================================================================= */ @@ -71,7 +72,11 @@ using namespace synfig; static Glib::RefPtr _tree_pixbuf_table_value_type[(int)synfig::ValueBase::TYPE_END]; +#ifdef WIN32 IconControler::IconControler(const synfig::String& basepath) +#else +IconControler::IconControler(const synfig::String& /*basepath*/) +#endif { Gtk::IconSource icon_source; icon_source.set_direction_wildcarded(); @@ -85,6 +90,14 @@ IconControler::IconControler(const synfig::String& basepath) #else path_to_icons=IMAGE_DIR; #endif + + char* synfig_root=getenv("SYNFIG_ROOT"); + if(synfig_root) { + path_to_icons=synfig_root; + path_to_icons+=ETL_DIRECTORY_SEPERATOR; + + path_to_icons+="share/pixmaps"; + } path_to_icons+=ETL_DIRECTORY_SEPERATOR; try{ @@ -93,7 +106,7 @@ IconControler::IconControler(const synfig::String& basepath) { 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); \ @@ -121,7 +134,7 @@ IconControler::IconControler(const synfig::String& basepath) #define INIT_STOCK_ITEM(name,desc) \ stock_##name=Gtk::StockItem(Gtk::StockID("synfig-" #name),desc); \ - Gtk::Stock::add(stock_##name); + Gtk::Stock::add(stock_##name); INIT_STOCK_ICON(swap_colors,"swap_colors_icon."IMAGE_EXT,_("Swap Colors")); INIT_STOCK_ICON(canvas,"canvas_icon."IMAGE_EXT,_("Canvas")); @@ -141,7 +154,7 @@ IconControler::IconControler(const synfig::String& basepath) INIT_STOCK_ICON(saveall,"saveall_icon."IMAGE_EXT,_("Save All")); INIT_STOCK_ICON(bool,"bool_icon."IMAGE_EXT,_("Bool")); INIT_STOCK_ICON(layer,"layer_icon."IMAGE_EXT,_("Layer")); - INIT_STOCK_ICON(layer_pastecanvas,"pastecanvas_icon."IMAGE_EXT,_("PasteCanvas")); + INIT_STOCK_ICON(layer_pastecanvas,"pastecanvas_icon."IMAGE_EXT,_("Paste Canvas")); INIT_STOCK_ICON(group,"group_icon."IMAGE_EXT,_("Group")); INIT_STOCK_ICON(grid_enable,"grid_enable_icon."IMAGE_EXT,_("Show Grid")); INIT_STOCK_ICON(grid_disable,"grid_disable_icon."IMAGE_EXT,_("Hide Grid")); @@ -155,6 +168,7 @@ IconControler::IconControler(const synfig::String& basepath) INIT_STOCK_ICON(clear_redo,"clear_redo_icon."IMAGE_EXT,_("Clear Redo Stack")); INIT_STOCK_ICON(children,"children_icon."IMAGE_EXT,_("Children")); + INIT_STOCK_ICON(curves,"curves_icon."IMAGE_EXT,_("Curves")); INIT_STOCK_ICON(keyframes,"keyframe_icon."IMAGE_EXT,_("Keyframes")); INIT_STOCK_ICON(meta_data,"meta_data_icon."IMAGE_EXT,_("MetaData")); INIT_STOCK_ICON(navigator,"navigator_icon."IMAGE_EXT,_("Navigator")); @@ -189,7 +203,7 @@ IconControler::IconControler(const synfig::String& basepath) INIT_STOCK_ICON(mirror,"mirror_icon."IMAGE_EXT,_("Mirror Tool")); icon_factory->add_default(); - + Gtk::IconSize::register_new("synfig-small_icon",12,12); for(int i(0);i<(int)ValueBase::TYPE_END;i++) _tree_pixbuf_table_value_type[i]=Gtk::Button().render_icon(value_icon(ValueBase::Type(i)),Gtk::ICON_SIZE_SMALL_TOOLBAR); @@ -247,10 +261,10 @@ IconControler::get_tool_cursor(const Glib::ustring& name,const Glib::RefPtr value_node) } else { - return Gtk::StockID("synfig-value_node"); + return Gtk::StockID("synfig-value_node"); } } @@ -338,14 +352,14 @@ studio::get_action_stock_id(const synfigapp::Action::BookEntry& action) else if(action.task=="set_off") stock_id=Gtk::Stock::NO; else if(action.task=="remove") stock_id=Gtk::Stock::DELETE; else stock_id=Gtk::StockID("synfig-"+action.task); - + return stock_id; } Gtk::StockID studio::layer_icon(const synfig::String &layer) { - if(layer=="PasteCanvas" || layer=="pastecanvas") + if(layer=="PasteCanvas" || layer=="pastecanvas" || layer=="paste_canvas") return Gtk::StockID("synfig-layer_pastecanvas"); else if(layer=="rotate") return Gtk::StockID("synfig-rotate");