From: pabs Date: Sun, 24 Feb 2008 05:16:03 +0000 (+0000) Subject: Add a patch from Gerald Young (Yoyobuae) to fix building on Win32 after the mutex... X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=282b5162f219e2114a59a00743180b45c238680f;p=synfig.git Add a patch from Gerald Young (Yoyobuae) to fix building on Win32 after the mutex changes. git-svn-id: http://svn.voria.com/code@1809 1f10aa63-cdf2-0310-b900-c93c546f37ac --- diff --git a/synfig-core/trunk/src/modules/mod_bmp/mptr_bmp.cpp b/synfig-core/trunk/src/modules/mod_bmp/mptr_bmp.cpp index b42e94f..21c8f44 100644 --- a/synfig-core/trunk/src/modules/mod_bmp/mptr_bmp.cpp +++ b/synfig-core/trunk/src/modules/mod_bmp/mptr_bmp.cpp @@ -56,6 +56,7 @@ SYNFIG_IMPORTER_SET_VERSION(bmp_mptr,"0.1"); SYNFIG_IMPORTER_SET_CVS_ID(bmp_mptr,"$Id$"); /* === M E T H O D S ======================================================= */ +namespace synfig { struct BITMAPFILEHEADER { @@ -81,6 +82,8 @@ struct BITMAPINFOHEADER unsigned long biClrImportant; }; +} + #ifdef WORDS_BIGENDIAN inline long little_endian(const long &x) { @@ -132,8 +135,8 @@ bmp_mptr::get_frame(synfig::Surface &surface,Time /*time*/, synfig::ProgressCall return false; } - BITMAPFILEHEADER fileheader; - BITMAPINFOHEADER infoheader; + synfig::BITMAPFILEHEADER fileheader; + synfig::BITMAPINFOHEADER infoheader; char b_char=fgetc(file); char m_char=fgetc(file); @@ -144,7 +147,7 @@ bmp_mptr::get_frame(synfig::Surface &surface,Time /*time*/, synfig::ProgressCall return false; } - if(fread(&fileheader.bfSize, 1, sizeof(BITMAPFILEHEADER)-4, file)!=sizeof(BITMAPFILEHEADER)-4) + if(fread(&fileheader.bfSize, 1, sizeof(synfig::BITMAPFILEHEADER)-4, file)!=sizeof(synfig::BITMAPFILEHEADER)-4) { String str("bmp_mptr::get_frame(): "+strprintf(_("Failure while reading BITMAPFILEHEADER from %s"),filename.c_str())); if(cb)cb->error(str); @@ -152,7 +155,7 @@ bmp_mptr::get_frame(synfig::Surface &surface,Time /*time*/, synfig::ProgressCall return false; } - if(fread(&infoheader, 1, sizeof(BITMAPINFOHEADER), file)!=sizeof(BITMAPINFOHEADER)) + if(fread(&infoheader, 1, sizeof(synfig::BITMAPINFOHEADER), file)!=sizeof(synfig::BITMAPINFOHEADER)) { String str("bmp_mptr::get_frame(): "+strprintf(_("Failure while reading BITMAPINFOHEADER from %s"),filename.c_str())); if(cb)cb->error(str); @@ -162,9 +165,9 @@ bmp_mptr::get_frame(synfig::Surface &surface,Time /*time*/, synfig::ProgressCall int offset=little_endian(fileheader.bfOffsetBits); - if(offset!=sizeof(BITMAPFILEHEADER)+sizeof(BITMAPINFOHEADER)-2) + if(offset!=sizeof(synfig::BITMAPFILEHEADER)+sizeof(synfig::BITMAPINFOHEADER)-2) { - String str("bmp_mptr::get_frame(): "+strprintf(_("Bad BITMAPFILEHEADER in %s. (bfOffsetBits=%d, should be %d)"),filename.c_str(),offset,sizeof(BITMAPFILEHEADER)+sizeof(BITMAPINFOHEADER)-2)); + String str("bmp_mptr::get_frame(): "+strprintf(_("Bad BITMAPFILEHEADER in %s. (bfOffsetBits=%d, should be %d)"),filename.c_str(),offset,sizeof(synfig::BITMAPFILEHEADER)+sizeof(synfig::BITMAPINFOHEADER)-2)); if(cb)cb->error(str); else synfig::error(str); return false; diff --git a/synfig-core/trunk/src/modules/mod_bmp/trgt_bmp.cpp b/synfig-core/trunk/src/modules/mod_bmp/trgt_bmp.cpp index a750f18..947ae18 100644 --- a/synfig-core/trunk/src/modules/mod_bmp/trgt_bmp.cpp +++ b/synfig-core/trunk/src/modules/mod_bmp/trgt_bmp.cpp @@ -55,7 +55,8 @@ SYNFIG_TARGET_SET_VERSION(bmp,"0.1"); SYNFIG_TARGET_SET_CVS_ID(bmp,"$Id$"); /* === C L A S S E S & S T R U C T S ======================================= */ - +namespace synfig { + struct BITMAPFILEHEADER { unsigned char bfType[2]; @@ -80,6 +81,7 @@ struct BITMAPINFOHEADER unsigned long biClrImportant; }; +} /* === M E T H O D S ======================================================= */ #ifdef WORDS_BIGENDIAN @@ -195,15 +197,15 @@ bmp::start_frame(synfig::ProgressCallback *callback) return false; } - BITMAPFILEHEADER fileheader; - BITMAPINFOHEADER infoheader; + synfig::BITMAPFILEHEADER fileheader; + synfig::BITMAPINFOHEADER infoheader; fileheader.bfType[0]='B'; fileheader.bfType[1]='M'; - fileheader.bfSize=little_endian(sizeof(BITMAPFILEHEADER)+sizeof(BITMAPINFOHEADER)+rowspan*h); + fileheader.bfSize=little_endian(sizeof(synfig::BITMAPFILEHEADER)+sizeof(synfig::BITMAPINFOHEADER)+rowspan*h); fileheader.bfReserved1=0; fileheader.bfReserved2=0; - fileheader.bfOffsetBits=little_endian(sizeof(BITMAPFILEHEADER)+sizeof(BITMAPINFOHEADER)-2); + fileheader.bfOffsetBits=little_endian(sizeof(synfig::BITMAPFILEHEADER)+sizeof(synfig::BITMAPINFOHEADER)-2); infoheader.biSize=little_endian(40); infoheader.biWidth=little_endian(w); @@ -219,14 +221,14 @@ bmp::start_frame(synfig::ProgressCallback *callback) fprintf(file,"BM"); - if(!fwrite(&fileheader.bfSize,sizeof(BITMAPFILEHEADER)-4,1,file)) + if(!fwrite(&fileheader.bfSize,sizeof(synfig::BITMAPFILEHEADER)-4,1,file)) { if(callback)callback->error(_("Unable to write file header to file")); else synfig::error(_("Unable to write file header to file")); return false; } - if(!fwrite(&infoheader,sizeof(BITMAPINFOHEADER),1,file)) + if(!fwrite(&infoheader,sizeof(synfig::BITMAPINFOHEADER),1,file)) { if(callback)callback->error(_("Unable to write info header")); else synfig::error(_("Unable to write info header")); diff --git a/synfig-core/trunk/src/synfig/node.cpp b/synfig-core/trunk/src/synfig/node.cpp index 083afe7..4773ece 100644 --- a/synfig-core/trunk/src/synfig/node.cpp +++ b/synfig-core/trunk/src/synfig/node.cpp @@ -81,9 +81,9 @@ extern clock_t _clock(); /* === G L O B A L S ======================================================= */ #ifdef HASH_MAP_H -typedef HASH_MAP_CLASS GlobalNodeMap; +typedef HASH_MAP_CLASS GlobalNodeMap; #else -typedef map GlobalNodeMap; +typedef map GlobalNodeMap; #endif static GlobalNodeMap* global_node_map_; @@ -98,7 +98,7 @@ static GlobalNodeMap& global_node_map() /* === P R O C E D U R E S ================================================= */ synfig::Node* -synfig::find_node(const GUID& guid) +synfig::find_node(const synfig::GUID& guid) { if(global_node_map().count(guid)==0) return 0; @@ -106,7 +106,7 @@ synfig::find_node(const GUID& guid) } static void -refresh_node(synfig::Node* node, GUID old_guid) +refresh_node(synfig::Node* node, synfig::GUID old_guid) { assert(global_node_map().count(old_guid)); global_node_map().erase(old_guid); @@ -203,13 +203,13 @@ Node::changed() //! Gets the GUID for this value node -const GUID& +const synfig::GUID& Node::get_guid()const { #ifdef BE_FRUGAL_WITH_GUIDS if(!guid_) { - const_cast(guid_).make_unique(); + const_cast(guid_).make_unique(); assert(guid_); assert(!global_node_map().count(guid_)); global_node_map()[guid_]=const_cast(this); @@ -221,7 +221,7 @@ Node::get_guid()const //! Sets the GUID for this value node void -Node::set_guid(const GUID& x) +Node::set_guid(const synfig::GUID& x) { assert(x); @@ -236,7 +236,7 @@ Node::set_guid(const GUID& x) #endif if(guid_!=x) { - GUID oldguid(guid_); + synfig::GUID oldguid(guid_); guid_=x; refresh_node(this, oldguid); on_guid_changed(oldguid); @@ -304,7 +304,7 @@ Node::on_changed() } void -Node::on_guid_changed(GUID guid) +Node::on_guid_changed(synfig::GUID guid) { signal_guid_changed()(guid); } diff --git a/synfig-core/trunk/src/synfig/valuenode_animated.cpp b/synfig-core/trunk/src/synfig/valuenode_animated.cpp index c2d70a1..f281515 100644 --- a/synfig-core/trunk/src/synfig/valuenode_animated.cpp +++ b/synfig-core/trunk/src/synfig/valuenode_animated.cpp @@ -237,7 +237,7 @@ private: Time r,s; public: - ValueNode* clone(const GUID& deriv_guid)const + ValueNode* clone(const synfig::GUID& deriv_guid)const { { ValueNode* x(find_value_node(get_guid()^deriv_guid).get()); if(x)return x; } _Hermite* ret(new _Hermite()); @@ -538,7 +538,7 @@ private: Time r,s; public: - ValueNode* clone(const GUID& deriv_guid)const + ValueNode* clone(const synfig::GUID& deriv_guid)const { { ValueNode* x(find_value_node(get_guid()^deriv_guid).get()); if(x)return x; } _Constant* ret(new _Constant()); @@ -636,7 +636,7 @@ private: Time r,s; public: - ValueNode* clone(const GUID& deriv_guid)const + ValueNode* clone(const synfig::GUID& deriv_guid)const { { ValueNode* x(find_value_node(get_guid()^deriv_guid).get()); if(x)return x; } _AnimBool* ret(new _AnimBool()); diff --git a/synfig-studio/trunk/src/gtkmm/app.cpp b/synfig-studio/trunk/src/gtkmm/app.cpp index 587b996..653c19b 100644 --- a/synfig-studio/trunk/src/gtkmm/app.cpp +++ b/synfig-studio/trunk/src/gtkmm/app.cpp @@ -31,6 +31,11 @@ # include #endif +#ifdef WIN32 +#define WINVER 0x0500 +#include +#endif + #include #include #include @@ -122,10 +127,6 @@ #include #endif -#ifdef WIN32 -#define _WIN32_WINNT 0x0500 -#include -#endif #include #include #include diff --git a/synfig-studio/trunk/src/gtkmm/duck.cpp b/synfig-studio/trunk/src/gtkmm/duck.cpp index d682025..6b012a7 100644 --- a/synfig-studio/trunk/src/gtkmm/duck.cpp +++ b/synfig-studio/trunk/src/gtkmm/duck.cpp @@ -112,16 +112,16 @@ Duck::get_data_guid()const { if(value_desc_.is_value_node()) return value_desc_.get_value_node()->get_guid(); - return GUID::hasher(get_name()); + return synfig::GUID::hasher(get_name()); } void Duck::set_name(const synfig::String &x) { name=x; - if(guid_==GUID::zero()) + if(guid_==synfig::GUID::zero()) { - guid_=GUID::hasher(name); + guid_=synfig::GUID::hasher(name); } } diff --git a/synfig-studio/trunk/src/gtkmm/duckmatic.cpp b/synfig-studio/trunk/src/gtkmm/duckmatic.cpp index 75212d4..ccedcae 100644 --- a/synfig-studio/trunk/src/gtkmm/duckmatic.cpp +++ b/synfig-studio/trunk/src/gtkmm/duckmatic.cpp @@ -980,13 +980,13 @@ inline String guid_string(const synfigapp::ValueDesc& x) return strprintf("%s",x.get_value_node()->get_guid().get_string().c_str()); } -inline GUID calc_duck_guid(const synfigapp::ValueDesc& x,const synfig::TransformStack& transform_stack) +inline synfig::GUID calc_duck_guid(const synfigapp::ValueDesc& x,const synfig::TransformStack& transform_stack) { - GUID ret(0); + synfig::GUID ret(0); if(x.parent_is_layer_param()) { - ret=x.get_layer()->get_guid()^GUID::hasher(x.get_param_name()); + ret=x.get_layer()->get_guid()^synfig::GUID::hasher(x.get_param_name()); } else { @@ -1001,7 +1001,7 @@ inline GUID calc_duck_guid(const synfigapp::ValueDesc& x,const synfig::Transform Duck::Handle Duckmatic::create_duck_from(const synfigapp::ValueDesc& value_desc,etl::handle canvas_view, const synfig::TransformStack& transform_stack, int modifier, synfig::ParamDesc *param_desc) { - GUID duck_guid(calc_duck_guid(value_desc,transform_stack)^GUID::hasher(modifier)); + synfig::GUID duck_guid(calc_duck_guid(value_desc,transform_stack)^synfig::GUID::hasher(modifier)); etl::handle duck=new Duck(); return duck; @@ -1070,7 +1070,7 @@ Duckmatic::add_to_ducks(const synfigapp::ValueDesc& value_desc,etl::handleset_guid(calc_duck_guid(value_desc,transform_stack)^GUID::hasher(multiple)); + duck->set_guid(calc_duck_guid(value_desc,transform_stack)^synfig::GUID::hasher(multiple)); add_duck(duck); @@ -1139,7 +1139,7 @@ Duckmatic::add_to_ducks(const synfigapp::ValueDesc& value_desc,etl::handleset_guid(calc_duck_guid(value_desc,transform_stack)^GUID::hasher(multiple)); + duck->set_guid(calc_duck_guid(value_desc,transform_stack)^synfig::GUID::hasher(multiple)); add_duck(duck); @@ -1176,9 +1176,9 @@ Duckmatic::add_to_ducks(const synfigapp::ValueDesc& value_desc,etl::handleget_connect()); Duck::Handle connect_duck; - if(duck_map.find(calc_duck_guid(value_desc_origin,transform_stack)^GUID::hasher(0))!=duck_map.end()) + if(duck_map.find(calc_duck_guid(value_desc_origin,transform_stack)^synfig::GUID::hasher(0))!=duck_map.end()) { - connect_duck=duck_map[calc_duck_guid(value_desc_origin,transform_stack)^GUID::hasher(0)]; + connect_duck=duck_map[calc_duck_guid(value_desc_origin,transform_stack)^synfig::GUID::hasher(0)]; } else { @@ -1230,7 +1230,7 @@ Duckmatic::add_to_ducks(const synfigapp::ValueDesc& value_desc,etl::handleset_guid(calc_duck_guid(value_desc,transform_stack)^GUID::hasher(multiple)); + duck->set_guid(calc_duck_guid(value_desc,transform_stack)^synfig::GUID::hasher(multiple)); add_duck(duck); return true; @@ -1474,7 +1474,7 @@ Duckmatic::add_to_ducks(const synfigapp::ValueDesc& value_desc,etl::handleset_guid(calc_duck_guid(synfigapp::ValueDesc(value_node,i),transform_stack)^GUID::hasher(".v")); + duck->set_guid(calc_duck_guid(synfigapp::ValueDesc(value_node,i),transform_stack)^synfig::GUID::hasher(".v")); duck=add_similar_duck(duck); // add_duck(duck); } @@ -1528,7 +1528,7 @@ Duckmatic::add_to_ducks(const synfigapp::ValueDesc& value_desc,etl::handleset_editable(false); tduck->set_name(guid_string(synfigapp::ValueDesc(value_node,i))+".t1"); // tduck->set_name(strprintf("%x-tangent1",value_node->get_link(i).get())); - tduck->set_guid(calc_duck_guid(synfigapp::ValueDesc(value_node,i),transform_stack)^GUID::hasher(".t1")); + tduck->set_guid(calc_duck_guid(synfigapp::ValueDesc(value_node,i),transform_stack)^synfig::GUID::hasher(".t1")); tduck=add_similar_duck(tduck); // add_duck(duck); } @@ -1585,7 +1585,7 @@ Duckmatic::add_to_ducks(const synfigapp::ValueDesc& value_desc,etl::handleset_transform_stack(transform_stack); tduck->set_name(guid_string(synfigapp::ValueDesc(value_node,i))+".t2"); - tduck->set_guid(calc_duck_guid(synfigapp::ValueDesc(value_node,i),transform_stack)^GUID::hasher(".t2")); + tduck->set_guid(calc_duck_guid(synfigapp::ValueDesc(value_node,i),transform_stack)^synfig::GUID::hasher(".t2")); tduck->set_editable(false); tduck=add_similar_duck(tduck); // add_duck(duck); @@ -1650,7 +1650,7 @@ Duckmatic::add_to_ducks(const synfigapp::ValueDesc& value_desc,etl::handleset_name(guid_string(synfigapp::ValueDesc(value_node,first))+".t1"); //tduck->set_name(strprintf("%x-tangent1",value_node->get_link(first).get())); tduck=add_similar_duck(tduck); - tduck->set_guid(calc_duck_guid(synfigapp::ValueDesc(value_node,first),transform_stack)^GUID::hasher(".t1")); + tduck->set_guid(calc_duck_guid(synfigapp::ValueDesc(value_node,first),transform_stack)^synfig::GUID::hasher(".t1")); //add_duck(duck); } diff --git a/synfig-studio/trunk/src/gtkmm/iconcontroller.cpp b/synfig-studio/trunk/src/gtkmm/iconcontroller.cpp index 912487e..200c6ff 100644 --- a/synfig-studio/trunk/src/gtkmm/iconcontroller.cpp +++ b/synfig-studio/trunk/src/gtkmm/iconcontroller.cpp @@ -333,7 +333,8 @@ studio::get_tree_pixbuf(synfig::ValueBase::Type type) //return Gtk::Button().render_icon(value_icon(type),Gtk::ICON_SIZE_SMALL_TOOLBAR); return _tree_pixbuf_table_value_type[int(type)]; } - +#define TEMPORARY_DELETE_MACRO DELETE +#undef DELETE Gtk::StockID studio::get_action_stock_id(const synfigapp::Action::BookEntry& action) { @@ -353,6 +354,8 @@ studio::get_action_stock_id(const synfigapp::Action::BookEntry& action) action.task); return stock_id; } +#define DELETE TEMPORARY_DELETE_MACRO +#undef TEMPORARY_DELETE_MACRO Gtk::StockID studio::layer_icon(const synfig::String &layer) diff --git a/synfig-studio/trunk/src/gtkmm/state_bline.cpp b/synfig-studio/trunk/src/gtkmm/state_bline.cpp index f632f2e..51afaff 100644 --- a/synfig-studio/trunk/src/gtkmm/state_bline.cpp +++ b/synfig-studio/trunk/src/gtkmm/state_bline.cpp @@ -1006,7 +1006,7 @@ StateBLine_Context::refresh_ducks(bool button_down) duck->signal_user_click(2).connect( sigc::bind(sigc::mem_fun(*this,&studio::StateBLine_Context::popup_vertex_menu),value_node) ); - duck->set_guid(value_node->get_guid()^GUID::hasher(0)); + duck->set_guid(value_node->get_guid()^synfig::GUID::hasher(0)); get_work_area()->add_duck(duck); @@ -1017,7 +1017,7 @@ StateBLine_Context::refresh_ducks(bool button_down) tduck->set_origin(duck); tduck->set_scalar(-0.33333333333333333); tduck->set_tangent(true); - tduck->set_guid(value_node->get_guid()^GUID::hasher(3)); + tduck->set_guid(value_node->get_guid()^synfig::GUID::hasher(3)); tduck->signal_edited().connect( sigc::bind(sigc::mem_fun(*this,&studio::StateBLine_Context::on_tangent1_change),value_node) ); @@ -1080,7 +1080,7 @@ StateBLine_Context::refresh_ducks(bool button_down) sigc::bind(sigc::mem_fun(*this,&studio::StateBLine_Context::on_tangent1_change),value_node) ); } - tduck->set_guid(value_node->get_guid()^GUID::hasher(4)); + tduck->set_guid(value_node->get_guid()^synfig::GUID::hasher(4)); tduck->signal_user_click(2).connect( sigc::bind(sigc::mem_fun(*this,&studio::StateBLine_Context::popup_handle_menu),value_node) ); @@ -1165,8 +1165,8 @@ StateBLine_Context::refresh_ducks(bool button_down) //get_work_area()->add_duck(bezier->c2); get_work_area()->add_bezier(bezier); - duck->set_guid(GUID()); - tduck->set_guid(GUID()); + duck->set_guid(synfig::GUID()); + tduck->set_guid(synfig::GUID()); next_duck=duck; } diff --git a/synfig-studio/trunk/src/synfigapp/actions/valuenodereplace.cpp b/synfig-studio/trunk/src/synfigapp/actions/valuenodereplace.cpp index 6e92937..92ac51a 100644 --- a/synfig-studio/trunk/src/synfigapp/actions/valuenodereplace.cpp +++ b/synfig-studio/trunk/src/synfigapp/actions/valuenodereplace.cpp @@ -59,11 +59,11 @@ ACTION_SET_CVS_ID(Action::ValueNodeReplace,"$Id$"); void swap_guid(const ValueNode::Handle& a,const ValueNode::Handle& b) { - GUID old_a(a->get_guid()); - a->set_guid(GUID()); + synfig::GUID old_a(a->get_guid()); + a->set_guid(synfig::GUID()); - GUID old_b(b->get_guid()); - b->set_guid(GUID()); + synfig::GUID old_b(b->get_guid()); + b->set_guid(synfig::GUID()); a->set_guid(old_b); b->set_guid(old_a);