Add a patch from Gerald Young (Yoyobuae) to fix building on Win32 after the mutex...
authorpabs <pabs@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Sun, 24 Feb 2008 05:16:03 +0000 (05:16 +0000)
committerpabs <pabs@1f10aa63-cdf2-0310-b900-c93c546f37ac>
Sun, 24 Feb 2008 05:16:03 +0000 (05:16 +0000)
git-svn-id: http://svn.voria.com/code@1809 1f10aa63-cdf2-0310-b900-c93c546f37ac

synfig-core/trunk/src/modules/mod_bmp/mptr_bmp.cpp
synfig-core/trunk/src/modules/mod_bmp/trgt_bmp.cpp
synfig-core/trunk/src/synfig/node.cpp
synfig-core/trunk/src/synfig/valuenode_animated.cpp
synfig-studio/trunk/src/gtkmm/app.cpp
synfig-studio/trunk/src/gtkmm/duck.cpp
synfig-studio/trunk/src/gtkmm/duckmatic.cpp
synfig-studio/trunk/src/gtkmm/iconcontroller.cpp
synfig-studio/trunk/src/gtkmm/state_bline.cpp
synfig-studio/trunk/src/synfigapp/actions/valuenodereplace.cpp

index b42e94f..21c8f44 100644 (file)
@@ -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;
index a750f18..947ae18 100644 (file)
@@ -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"));
index 083afe7..4773ece 100644 (file)
@@ -81,9 +81,9 @@ extern clock_t _clock();
 /* === G L O B A L S ======================================================= */
 
 #ifdef HASH_MAP_H
-typedef HASH_MAP_CLASS<GUID,Node*,GUIDHash> GlobalNodeMap;
+typedef HASH_MAP_CLASS<synfig::GUID,Node*,GUIDHash> GlobalNodeMap;
 #else
-typedef map<GUID,Node*> GlobalNodeMap;
+typedef map<synfig::GUID,Node*> 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&>(guid_).make_unique();
+               const_cast<synfig::GUID&>(guid_).make_unique();
                assert(guid_);
                assert(!global_node_map().count(guid_));
                global_node_map()[guid_]=const_cast<Node*>(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);
 }
index c2d70a1..f281515 100644 (file)
@@ -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<T>* ret(new _Hermite<T>());
@@ -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<T>* ret(new _Constant<T>());
@@ -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());
index 587b996..653c19b 100644 (file)
 #      include <config.h>
 #endif
 
+#ifdef WIN32
+#define WINVER 0x0500
+#include <windows.h>
+#endif
+
 #include <fstream>
 #include <iostream>
 #include <locale>
 #include <fmod.h>
 #endif
 
-#ifdef WIN32
-#define _WIN32_WINNT 0x0500
-#include <windows.h>
-#endif
 #include <gtkmm/accelmap.h>
 #include <gtkmm/filechooser.h>
 #include <gtkmm/filechooserdialog.h>
index d682025..6b012a7 100644 (file)
@@ -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);
        }
 }
 
index 75212d4..ccedcae 100644 (file)
@@ -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<CanvasView> 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> duck=new Duck();
 
        return duck;
@@ -1070,7 +1070,7 @@ Duckmatic::add_to_ducks(const synfigapp::ValueDesc& value_desc,etl::handle<Canva
                                                0.0f),
                                        value_desc));
 
-                       duck->set_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::handle<Canva
                                                        &studio::CanvasView::popup_param_menu),
                                                0.0f),
                                        value_desc));
-                       duck->set_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::handle<Canva
                                {
                                        synfigapp::ValueDesc value_desc_origin(value_desc.get_layer(),param_desc->get_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::handle<Canva
                                                        &studio::CanvasView::popup_param_menu),
                                                1.0f),
                                        value_desc));
-                       duck->set_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::handle<Canva
 */
                                                }
                                        }
-                                       duck->set_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::handle<Canva
                                                tduck->set_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::handle<Canva
 
                                        tduck->set_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::handle<Canva
                                        tduck->set_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);
                                }
 
index 912487e..200c6ff 100644 (file)
@@ -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)
index f632f2e..51afaff 100644 (file)
@@ -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;
        }
index 6e92937..92ac51a 100644 (file)
@@ -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);