You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(128) |
Dec
(65) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(48) |
Feb
(132) |
Mar
(95) |
Apr
(47) |
May
(54) |
Jun
(2) |
Jul
(57) |
Aug
(109) |
Sep
(131) |
Oct
(186) |
Nov
(105) |
Dec
(78) |
2007 |
Jan
(125) |
Feb
(105) |
Mar
(52) |
Apr
(104) |
May
(63) |
Jun
(116) |
Jul
(76) |
Aug
|
Sep
(18) |
Oct
(93) |
Nov
(110) |
Dec
(169) |
2008 |
Jan
(90) |
Feb
(64) |
Mar
(41) |
Apr
(23) |
May
(6) |
Jun
(18) |
Jul
(10) |
Aug
(61) |
Sep
(139) |
Oct
(50) |
Nov
(55) |
Dec
(2) |
2009 |
Jan
|
Feb
(1) |
Mar
(62) |
Apr
(22) |
May
(17) |
Jun
(19) |
Jul
(40) |
Aug
(21) |
Sep
|
Oct
(40) |
Nov
(23) |
Dec
|
2010 |
Jan
(14) |
Feb
(40) |
Mar
(9) |
Apr
(11) |
May
(19) |
Jun
(4) |
Jul
(10) |
Aug
(22) |
Sep
(15) |
Oct
|
Nov
(2) |
Dec
|
2011 |
Jan
(13) |
Feb
(10) |
Mar
|
Apr
(13) |
May
|
Jun
|
Jul
(2) |
Aug
(4) |
Sep
|
Oct
|
Nov
|
Dec
|
2012 |
Jan
|
Feb
|
Mar
|
Apr
(33) |
May
(20) |
Jun
|
Jul
(8) |
Aug
(7) |
Sep
(2) |
Oct
|
Nov
|
Dec
|
From: Braden M. <br...@us...> - 2007-10-06 20:15:35
|
Update of /cvsroot/openvrml/openvrml/src/openvrml-player In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv18569/src/openvrml-player Modified Files: .cvsignore Removed Files: Makefile.am Log Message: Made the build less recursive. Index: .cvsignore =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/openvrml-player/.cvsignore,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** .cvsignore 23 Jan 2007 10:06:19 -0000 1.2 --- .cvsignore 6 Oct 2007 20:15:35 -0000 1.3 *************** *** 1,3 **** - Makefile - Makefile.in openvrml-player --- 1 ---- --- Makefile.am DELETED --- |
From: Braden M. <br...@us...> - 2007-10-06 20:15:35
|
Update of /cvsroot/openvrml/openvrml/src/openvrml-xembed In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv18569/src/openvrml-xembed Modified Files: .cvsignore Removed Files: Makefile.am Log Message: Made the build less recursive. Index: .cvsignore =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/openvrml-xembed/.cvsignore,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** .cvsignore 5 Feb 2007 05:36:12 -0000 1.2 --- .cvsignore 6 Oct 2007 20:15:35 -0000 1.3 *************** *** 1,3 **** - Makefile - Makefile.in openvrml-xembed --- 1 ---- --- Makefile.am DELETED --- |
From: Braden M. <br...@us...> - 2007-10-06 20:15:35
|
Update of /cvsroot/openvrml/openvrml/lib In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv18569/lib Modified Files: Makefile.am Log Message: Made the build less recursive. Index: Makefile.am =================================================================== RCS file: /cvsroot/openvrml/openvrml/lib/Makefile.am,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** Makefile.am 5 Oct 2006 03:25:59 -0000 1.6 --- Makefile.am 6 Oct 2007 20:15:35 -0000 1.7 *************** *** 1,2 **** ! SUBDIRS = antlr @gtkglext_subdir@ ! DIST_SUBDIRS = antlr gtkglext --- 1,99 ---- ! SUBDIRS = @gtkglext_subdir@ ! DIST_SUBDIRS = gtkglext ! ! noinst_HEADERS = \ ! antlr/antlr/ANTLRException.hpp \ ! antlr/antlr/ANTLRUtil.hpp \ ! antlr/antlr/ASTArray.hpp \ ! antlr/antlr/AST.hpp \ ! antlr/antlr/ASTArray.hpp \ ! antlr/antlr/ASTFactory.hpp \ ! antlr/antlr/ASTNULLType.hpp \ ! antlr/antlr/ASTPair.hpp \ ! antlr/antlr/ASTRefCount.hpp \ ! antlr/antlr/BaseAST.hpp \ ! antlr/antlr/BitSet.hpp \ ! antlr/antlr/CharBuffer.hpp \ ! antlr/antlr/CharInputBuffer.hpp \ ! antlr/antlr/CharScanner.hpp \ ! antlr/antlr/CharStreamException.hpp \ ! antlr/antlr/CharStreamIOException.hpp \ ! antlr/antlr/CircularQueue.hpp \ ! antlr/antlr/CommonAST.hpp \ ! antlr/antlr/CommonASTWithHiddenTokens.hpp \ ! antlr/antlr/CommonHiddenStreamToken.hpp \ ! antlr/antlr/CommonToken.hpp \ ! antlr/antlr/InputBuffer.hpp \ ! antlr/antlr/IOException.hpp \ ! antlr/antlr/LLkParser.hpp \ ! antlr/antlr/LexerSharedInputState.hpp \ ! antlr/antlr/MismatchedCharException.hpp \ ! antlr/antlr/MismatchedTokenException.hpp \ ! antlr/antlr/NoViableAltException.hpp \ ! antlr/antlr/NoViableAltForCharException.hpp \ ! antlr/antlr/Parser.hpp \ ! antlr/antlr/ParserSharedInputState.hpp \ ! antlr/antlr/RecognitionException.hpp \ ! antlr/antlr/RefCount.hpp \ ! antlr/antlr/SemanticException.hpp \ ! antlr/antlr/String.hpp \ ! antlr/antlr/Token.hpp \ ! antlr/antlr/TokenBuffer.hpp \ ! antlr/antlr/TokenStream.hpp \ ! antlr/antlr/TokenStreamBasicFilter.hpp \ ! antlr/antlr/TokenStreamException.hpp \ ! antlr/antlr/TokenStreamHiddenTokenFilter.hpp \ ! antlr/antlr/TokenStreamIOException.hpp \ ! antlr/antlr/TokenStreamRecognitionException.hpp \ ! antlr/antlr/TokenStreamRetryException.hpp \ ! antlr/antlr/TokenStreamSelector.hpp \ ! antlr/antlr/TreeParser.hpp \ ! antlr/antlr/TreeParserSharedInputState.hpp \ ! antlr/antlr/config.hpp ! ! AM_CPPFLAGS = -I$(top_srcdir)/lib/antlr -DANTLR_EXPORTS ! ! noinst_LTLIBRARIES = antlr/libantlr.la ! antlr_libantlr_la_LDFLAGS = -avoid-version ! ! antlr_libantlr_la_SOURCES = \ ! antlr/src/ANTLRUtil.cpp \ ! antlr/src/ASTFactory.cpp \ ! antlr/src/ASTNULLType.cpp \ ! antlr/src/ASTRefCount.cpp \ ! antlr/src/BaseAST.cpp \ ! antlr/src/BitSet.cpp \ ! antlr/src/CharBuffer.cpp \ ! antlr/src/CharScanner.cpp \ ! antlr/src/CommonAST.cpp \ ! antlr/src/CommonASTWithHiddenTokens.cpp \ ! antlr/src/CommonHiddenStreamToken.cpp \ ! antlr/src/CommonToken.cpp \ ! antlr/src/InputBuffer.cpp \ ! antlr/src/LLkParser.cpp \ ! antlr/src/MismatchedCharException.cpp \ ! antlr/src/MismatchedTokenException.cpp \ ! antlr/src/NoViableAltException.cpp \ ! antlr/src/NoViableAltForCharException.cpp \ ! antlr/src/Parser.cpp \ ! antlr/src/RecognitionException.cpp \ ! antlr/src/String.cpp \ ! antlr/src/Token.cpp \ ! antlr/src/TokenBuffer.cpp \ ! antlr/src/TokenRefCount.cpp \ ! antlr/src/TokenStreamBasicFilter.cpp \ ! antlr/src/TokenStreamHiddenTokenFilter.cpp \ ! antlr/src/TokenStreamSelector.cpp \ ! antlr/src/TreeParser.cpp ! ! EXTRA_DIST = \ ! antlr/Makefile.in \ ! antlr/doxygen.cfg \ ! antlr/antlr/Makefile.in \ ! antlr/contrib/bcb4/README \ ! antlr/contrib/bcb4/antlr.cpp \ ! antlr/contrib/bcb4/antlr.bpr \ ! antlr/scripts/cr_stripper.sh \ ! antlr/scripts/make_change_log.tcl \ ! antlr/src/Makefile.in \ ! antlr/src/dll.cpp |
From: Braden M. <br...@us...> - 2007-10-06 20:15:35
|
Update of /cvsroot/openvrml/openvrml/src/libopenvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv18569/src/libopenvrml Modified Files: .cvsignore Removed Files: Makefile.am Log Message: Made the build less recursive. Index: .cvsignore =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/.cvsignore,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** .cvsignore 29 Jul 2003 05:28:45 -0000 1.1 --- .cvsignore 6 Oct 2007 20:15:35 -0000 1.2 *************** *** 1 **** - Makefile.in --- 0 ---- --- Makefile.am DELETED --- |
From: Braden M. <br...@us...> - 2007-10-06 20:15:35
|
Update of /cvsroot/openvrml/openvrml/lib/antlr In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv18569/lib/antlr Modified Files: .cvsignore Removed Files: GNUmakefile.am Log Message: Made the build less recursive. Index: .cvsignore =================================================================== RCS file: /cvsroot/openvrml/openvrml/lib/antlr/.cvsignore,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** .cvsignore 7 Apr 2003 00:37:58 -0000 1.3 --- .cvsignore 6 Oct 2007 20:15:35 -0000 1.4 *************** *** 1,2 **** - GNUmakefile - GNUmakefile.in --- 0 ---- --- GNUmakefile.am DELETED --- |
From: Braden M. <br...@us...> - 2007-10-06 09:29:12
|
Update of /cvsroot/openvrml/openvrml/tests In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv22593/tests Modified Files: Tag: OpenVRML-0_16-BRANCH Makefile.am browser.cpp color.cpp image.cpp mat4f.cpp node_interface_set.cpp node_metatype_id.cpp rotation.cpp Log Message: Test fixes for Boost 1.34.1. Index: node_interface_set.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/tests/node_interface_set.cpp,v retrieving revision 1.3.2.1 retrieving revision 1.3.2.2 diff -C2 -d -r1.3.2.1 -r1.3.2.2 *** node_interface_set.cpp 11 Jul 2007 07:57:46 -0000 1.3.2.1 --- node_interface_set.cpp 6 Oct 2007 09:29:13 -0000 1.3.2.2 *************** *** 1,4 **** ! # define BOOST_TEST_DYN_LINK # define BOOST_TEST_MAIN # include <boost/test/unit_test.hpp> # include <openvrml/node.h> --- 1,24 ---- ! // -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 4; -*- ! // ! // Copyright 2007 Braden McDaniel ! // ! // This program 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. ! // ! // This program 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. ! // ! // You should have received a copy of the GNU General Public License ! // along with this program; if not, write to the Free Software ! // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! // ! # define BOOST_TEST_MAIN + # define BOOST_TEST_MODULE node_interface_set + # include <boost/test/unit_test.hpp> # include <openvrml/node.h> *************** *** 13,17 **** using namespace openvrml; ! void insert_eventin() { node_interface_set interfaces; --- 33,37 ---- using namespace openvrml; ! BOOST_AUTO_TEST_CASE(insert_eventin) { node_interface_set interfaces; *************** *** 22,26 **** } ! void insert_exactly_conflicting_eventin() { node_interface_set interfaces; --- 42,46 ---- } ! BOOST_AUTO_TEST_CASE(insert_exactly_conflicting_eventin) { node_interface_set interfaces; *************** *** 36,40 **** } ! void insert_conflicting_exposedfield() { node_interface_set interfaces; --- 56,60 ---- } ! BOOST_AUTO_TEST_CASE(insert_conflicting_exposedfield) { node_interface_set interfaces; *************** *** 49,53 **** } ! void insert_eventout() { node_interface_set interfaces; --- 69,73 ---- } ! BOOST_AUTO_TEST_CASE(insert_eventout) { node_interface_set interfaces; *************** *** 62,66 **** } ! void insert_exactly_conflicting_eventout() { node_interface_set interfaces; --- 82,86 ---- } ! BOOST_AUTO_TEST_CASE(insert_exactly_conflicting_eventout) { node_interface_set interfaces; *************** *** 75,79 **** } ! void insert_field() { node_interface_set interfaces; --- 95,99 ---- } ! BOOST_AUTO_TEST_CASE(insert_field) { node_interface_set interfaces; *************** *** 92,96 **** } ! void insert_exposedfield() { node_interface_set interfaces; --- 112,116 ---- } ! BOOST_AUTO_TEST_CASE(insert_exposedfield) { node_interface_set interfaces; *************** *** 113,117 **** } ! void find_exposedfield_matching_eventin() { node_interface_set interfaces; --- 133,137 ---- } ! BOOST_AUTO_TEST_CASE(find_exposedfield_matching_eventin) { node_interface_set interfaces; *************** *** 125,142 **** BOOST_REQUIRE(interface == *pos); } - - boost::unit_test::test_suite * init_unit_test_suite(int, char * []) - { - using boost::unit_test::test_suite; - test_suite * const suite = - BOOST_TEST_SUITE("node_interface_set"); - suite->add(BOOST_TEST_CASE(&insert_eventin)); - suite->add(BOOST_TEST_CASE(&insert_exactly_conflicting_eventin)); - suite->add(BOOST_TEST_CASE(&insert_conflicting_exposedfield)); - suite->add(BOOST_TEST_CASE(&insert_eventout)); - suite->add(BOOST_TEST_CASE(&insert_exactly_conflicting_eventout)); - suite->add(BOOST_TEST_CASE(&insert_field)); - suite->add(BOOST_TEST_CASE(&insert_exposedfield)); - suite->add(BOOST_TEST_CASE(&find_exposedfield_matching_eventin)); - return suite; - } --- 145,146 ---- Index: rotation.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/tests/rotation.cpp,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -C2 -d -r1.1.2.2 -r1.1.2.3 *** rotation.cpp 23 Aug 2006 06:49:49 -0000 1.1.2.2 --- rotation.cpp 6 Oct 2007 09:29:13 -0000 1.1.2.3 *************** *** 18,21 **** --- 18,24 ---- // + # define BOOST_TEST_MAIN + # define BOOST_TEST_MODULE rotation + # include <sstream> # include <boost/test/unit_test.hpp> *************** *** 25,29 **** using namespace openvrml; ! void stream_extraction_fail_on_nonnormalized_axis() { string rotation_str = "2.0 2.0 0.0 0.0"; --- 28,32 ---- using namespace openvrml; ! BOOST_AUTO_TEST_CASE(stream_extraction_fail_on_nonnormalized_axis) { string rotation_str = "2.0 2.0 0.0 0.0"; *************** *** 33,42 **** BOOST_REQUIRE(in.fail()); } - - boost::unit_test::test_suite * init_unit_test_suite(int, char * []) - { - using boost::unit_test::test_suite; - test_suite * const suite = BOOST_TEST_SUITE("rotation"); - suite->add(BOOST_TEST_CASE(&stream_extraction_fail_on_nonnormalized_axis)); - return suite; - } --- 36,37 ---- Index: color.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/tests/color.cpp,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -C2 -d -r1.1.2.2 -r1.1.2.3 *** color.cpp 23 Aug 2006 06:49:49 -0000 1.1.2.2 --- color.cpp 6 Oct 2007 09:29:13 -0000 1.1.2.3 *************** *** 18,21 **** --- 18,24 ---- // + # define BOOST_TEST_MAIN + # define BOOST_TEST_MODULE color + # include <sstream> # include <boost/test/unit_test.hpp> *************** *** 25,29 **** using namespace openvrml; ! void stream_extraction_without_commas() { color c1(1.0, 1.0, 1.0), c2(0.5, 0.5, 0.5), c3, c4; --- 28,32 ---- using namespace openvrml; ! BOOST_AUTO_TEST_CASE(stream_extraction_without_commas) { color c1(1.0, 1.0, 1.0), c2(0.5, 0.5, 0.5), c3, c4; *************** *** 36,40 **** } ! void stream_extraction_with_commas() { color c1(1.0, 1.0, 1.0), c2(0.5, 0.5, 0.5), c3, c4; --- 39,43 ---- } ! BOOST_AUTO_TEST_CASE(stream_extraction_with_commas) { color c1(1.0, 1.0, 1.0), c2(0.5, 0.5, 0.5), c3, c4; *************** *** 47,51 **** } ! void stream_extraction_fail_on_invalid_intensity() { color c; --- 50,54 ---- } ! BOOST_AUTO_TEST_CASE(stream_extraction_fail_on_invalid_intensity) { color c; *************** *** 55,66 **** BOOST_REQUIRE(in.fail()); } - - boost::unit_test::test_suite * init_unit_test_suite(int, char * []) - { - using boost::unit_test::test_suite; - test_suite * const suite = BOOST_TEST_SUITE("color"); - suite->add(BOOST_TEST_CASE(&stream_extraction_without_commas)); - suite->add(BOOST_TEST_CASE(&stream_extraction_with_commas)); - suite->add(BOOST_TEST_CASE(&stream_extraction_fail_on_invalid_intensity)); - return suite; - } --- 58,59 ---- Index: browser.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/tests/browser.cpp,v retrieving revision 1.7 retrieving revision 1.7.2.1 diff -C2 -d -r1.7 -r1.7.2.1 *** browser.cpp 28 Jul 2006 07:11:10 -0000 1.7 --- browser.cpp 6 Oct 2007 09:29:12 -0000 1.7.2.1 *************** *** 18,21 **** --- 18,24 ---- // + # define BOOST_TEST_MAIN + # define BOOST_TEST_MODULE browser + # include <fstream> # include <sstream> *************** *** 31,35 **** using namespace boost::multi_index::detail; // for scope_guard ! void create_vrml_from_stream() { test_browser b; --- 34,38 ---- using namespace boost::multi_index::detail; // for scope_guard ! BOOST_AUTO_TEST_CASE(create_vrml_from_stream) { test_browser b; *************** *** 46,50 **** } ! void create_vrml_from_stream_with_externproto() { { --- 49,53 ---- } ! BOOST_AUTO_TEST_CASE(create_vrml_from_stream_with_externproto) { { *************** *** 54,58 **** } scope_guard test_file_guard = ! make_guard(&boost::filesystem::remove, boost::filesystem::path("test.wrl")); boost::ignore_unused_variable_warning(test_file_guard); --- 57,61 ---- } scope_guard test_file_guard = ! make_guard(&boost::filesystem::remove<boost::filesystem::path>, boost::filesystem::path("test.wrl")); boost::ignore_unused_variable_warning(test_file_guard); *************** *** 71,75 **** } ! void create_vrml_from_url() { class children_listener : public openvrml::mfnode_listener { --- 74,78 ---- } ! BOOST_AUTO_TEST_CASE(create_vrml_from_url) { class children_listener : public openvrml::mfnode_listener { *************** *** 106,110 **** } scope_guard test_file_guard = ! make_guard(&boost::filesystem::remove, boost::filesystem::path("test.wrl")); boost::ignore_unused_variable_warning(test_file_guard); --- 109,113 ---- } scope_guard test_file_guard = ! make_guard(&boost::filesystem::remove<boost::filesystem::path>, boost::filesystem::path("test.wrl")); boost::ignore_unused_variable_warning(test_file_guard); *************** *** 144,155 **** BOOST_CHECK_EQUAL(children[0]->type().id(), "Shape"); } - - boost::unit_test::test_suite * init_unit_test_suite(int, char * []) - { - using boost::unit_test::test_suite; - test_suite * const suite = BOOST_TEST_SUITE("browser"); - suite->add(BOOST_TEST_CASE(&create_vrml_from_stream)); - suite->add(BOOST_TEST_CASE(&create_vrml_from_stream_with_externproto)); - suite->add(BOOST_TEST_CASE(&create_vrml_from_url)); - return suite; - } --- 147,148 ---- Index: image.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/tests/image.cpp,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -C2 -d -r1.1.2.2 -r1.1.2.3 *** image.cpp 23 Aug 2006 06:49:49 -0000 1.1.2.2 --- image.cpp 6 Oct 2007 09:29:13 -0000 1.1.2.3 *************** *** 18,21 **** --- 18,24 ---- // + # define BOOST_TEST_MAIN + # define BOOST_TEST_MODULE image + # include <sstream> # include <boost/array.hpp> *************** *** 26,30 **** using namespace openvrml; ! void stream_insertion() { const image img(2, 2, 1); --- 29,33 ---- using namespace openvrml; ! BOOST_AUTO_TEST_CASE(stream_insertion) { const image img(2, 2, 1); *************** *** 36,40 **** } ! void stream_extraction() { const boost::array<unsigned char, 4> pixels = { 0xFF, 0x00, 0xFF, 0x00 }; --- 39,43 ---- } ! BOOST_AUTO_TEST_CASE(stream_extraction) { const boost::array<unsigned char, 4> pixels = { 0xFF, 0x00, 0xFF, 0x00 }; *************** *** 48,52 **** } ! void stream_extraction_insufficient_pixel_values() { const string image_str = "2 2 1 0xFF 0x00 0xFF"; --- 51,55 ---- } ! BOOST_AUTO_TEST_CASE(stream_extraction_insufficient_pixel_values) { const string image_str = "2 2 1 0xFF 0x00 0xFF"; *************** *** 56,67 **** BOOST_REQUIRE(in.fail()); } - - boost::unit_test::test_suite * init_unit_test_suite(int, char * []) - { - using boost::unit_test::test_suite; - test_suite * const suite = BOOST_TEST_SUITE("image"); - suite->add(BOOST_TEST_CASE(&stream_insertion)); - suite->add(BOOST_TEST_CASE(&stream_extraction)); - suite->add(BOOST_TEST_CASE(&stream_extraction_insufficient_pixel_values)); - return suite; - } --- 59,60 ---- Index: mat4f.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/tests/mat4f.cpp,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -C2 -d -r1.1.2.2 -r1.1.2.3 *** mat4f.cpp 23 Aug 2006 06:49:49 -0000 1.1.2.2 --- mat4f.cpp 6 Oct 2007 09:29:13 -0000 1.1.2.3 *************** *** 18,21 **** --- 18,24 ---- // + # define BOOST_TEST_MAIN + # define BOOST_TEST_MODULE mat4f + # include <sstream> # include <boost/test/unit_test.hpp> *************** *** 25,29 **** using namespace openvrml; ! void stream_insertion() { mat4f m; --- 28,32 ---- using namespace openvrml; ! BOOST_AUTO_TEST_CASE(stream_insertion) { mat4f m; *************** *** 37,41 **** } ! void stream_extraction_numbers_only() { const mat4f m1(1, 0, 0, 0, --- 40,44 ---- } ! BOOST_AUTO_TEST_CASE(stream_extraction_numbers_only) { const mat4f m1(1, 0, 0, 0, *************** *** 53,57 **** } ! void stream_extraction_numbers_with_commas() { const mat4f m1(1, 0, 0, 0, --- 56,60 ---- } ! BOOST_AUTO_TEST_CASE(stream_extraction_numbers_with_commas) { const mat4f m1(1, 0, 0, 0, *************** *** 68,79 **** BOOST_REQUIRE_EQUAL(m1, m2); } - - boost::unit_test::test_suite * init_unit_test_suite(int, char * []) - { - using boost::unit_test::test_suite; - test_suite * const suite = BOOST_TEST_SUITE("mat4f"); - suite->add(BOOST_TEST_CASE(&stream_insertion)); - suite->add(BOOST_TEST_CASE(&stream_extraction_numbers_only)); - suite->add(BOOST_TEST_CASE(&stream_extraction_numbers_with_commas)); - return suite; - } --- 71,72 ---- Index: node_metatype_id.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/tests/node_metatype_id.cpp,v retrieving revision 1.1 retrieving revision 1.1.2.1 diff -C2 -d -r1.1 -r1.1.2.1 *** node_metatype_id.cpp 25 Jul 2006 15:32:22 -0000 1.1 --- node_metatype_id.cpp 6 Oct 2007 09:29:13 -0000 1.1.2.1 *************** *** 1,2 **** --- 1,24 ---- + // -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 4; -*- + // + // Copyright 2007 Braden McDaniel + // + // This program 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. + // + // This program 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. + // + // You should have received a copy of the GNU General Public License + // along with this program; if not, write to the Free Software + // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + // + + # define BOOST_TEST_MAIN + # define BOOST_TEST_MODULE node_metatype_id + # include <boost/test/unit_test.hpp> # include <openvrml/browser.h> *************** *** 5,29 **** using namespace openvrml; ! void construct_from_urn() { node_metatype_id id("urn:foo:bar"); } ! void construct_from_url() { node_metatype_id id("http://example.com"); } ! void construct_from_url_with_fragment_id() { node_metatype_id id("http://example.com#Foo"); } ! void construct_nested_proto_id() { node_metatype_id id("http://example.com#Foo#Bar"); } ! void construct_from_relative_url() { BOOST_CHECK_THROW(node_metatype_id id("../foo/bar"), --- 27,51 ---- using namespace openvrml; ! BOOST_AUTO_TEST_CASE(construct_from_urn) { node_metatype_id id("urn:foo:bar"); } ! BOOST_AUTO_TEST_CASE(construct_from_url) { node_metatype_id id("http://example.com"); } ! BOOST_AUTO_TEST_CASE(construct_from_url_with_fragment_id) { node_metatype_id id("http://example.com#Foo"); } ! BOOST_AUTO_TEST_CASE(construct_nested_proto_id) { node_metatype_id id("http://example.com#Foo#Bar"); } ! BOOST_AUTO_TEST_CASE(construct_from_relative_url) { BOOST_CHECK_THROW(node_metatype_id id("../foo/bar"), *************** *** 31,49 **** } ! void construct_from_arbitrary_string() { BOOST_CHECK_THROW(node_metatype_id id("string"), std::invalid_argument); } - - boost::unit_test::test_suite * init_unit_test_suite(int, char * []) - { - using boost::unit_test::test_suite; - test_suite * const suite = BOOST_TEST_SUITE("node_metatype_id"); - suite->add(BOOST_TEST_CASE(&construct_from_urn)); - suite->add(BOOST_TEST_CASE(&construct_from_url)); - suite->add(BOOST_TEST_CASE(&construct_from_url_with_fragment_id)); - suite->add(BOOST_TEST_CASE(&construct_nested_proto_id)); - suite->add(BOOST_TEST_CASE(&construct_from_relative_url)); - suite->add(BOOST_TEST_CASE(&construct_from_arbitrary_string)); - return suite; - } --- 53,58 ---- } ! BOOST_AUTO_TEST_CASE(construct_from_arbitrary_string) { BOOST_CHECK_THROW(node_metatype_id id("string"), std::invalid_argument); } Index: Makefile.am =================================================================== RCS file: /cvsroot/openvrml/openvrml/tests/Makefile.am,v retrieving revision 1.14.2.2 retrieving revision 1.14.2.3 diff -C2 -d -r1.14.2.2 -r1.14.2.3 *** Makefile.am 21 May 2007 04:19:11 -0000 1.14.2.2 --- Makefile.am 6 Oct 2007 09:29:12 -0000 1.14.2.3 *************** *** 1,7 **** AM_CPPFLAGS = \ -I$(top_builddir)/src/libopenvrml \ ! -I$(top_srcdir)/src/libopenvrml ! AM_CXXFLAGS = @PTHREAD_CFLAGS@ ! AM_LDFLAGS = @OPENVRML_RPATH@ TESTS_ENVIRONMENT = BOOST_TEST_REPORT_LEVEL=detailed --- 1,8 ---- AM_CPPFLAGS = \ -I$(top_builddir)/src/libopenvrml \ ! -I$(top_srcdir)/src/libopenvrml \ ! -DBOOST_TEST_DYN_LINK ! AM_CXXFLAGS = $(PTHREAD_CFLAGS) ! AM_LDFLAGS = $(OPENVRML_RPATH) TESTS_ENVIRONMENT = BOOST_TEST_REPORT_LEVEL=detailed |
From: Braden M. <br...@us...> - 2007-10-06 09:29:12
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv22593 Modified Files: Tag: OpenVRML-0_16-BRANCH ChangeLog Log Message: Test fixes for Boost 1.34.1. Index: ChangeLog =================================================================== RCS file: /cvsroot/openvrml/openvrml/ChangeLog,v retrieving revision 1.1310.2.196 retrieving revision 1.1310.2.197 diff -C2 -d -r1.1310.2.196 -r1.1310.2.197 *** ChangeLog 20 Sep 2007 06:49:06 -0000 1.1310.2.196 --- ChangeLog 6 Oct 2007 09:29:12 -0000 1.1310.2.197 *************** *** 1,2 **** --- 1,15 ---- + 2007-10-06 Braden McDaniel <br...@en...> + + Test fixes for Boost 1.34.1. + + * tests/Makefile.am + * tests/browser.cpp + * tests/color.cpp + * tests/image.cpp + * tests/mat4f.cpp + * tests/node_interface_set.cpp + * tests/node_metatype_id.cpp + * tests/rotation.cpp + 2007-09-20 Braden McDaniel <br...@en...> |
Update of /cvsroot/openvrml/openvrml/tests In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv22451/tests Modified Files: Makefile.am browser.cpp color.cpp image.cpp mat4f.cpp node_interface_set.cpp node_metatype_id.cpp rotation.cpp Log Message: Test fixes for Boost 1.34.1. Index: node_interface_set.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/tests/node_interface_set.cpp,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** node_interface_set.cpp 11 Jul 2007 07:57:31 -0000 1.4 --- node_interface_set.cpp 6 Oct 2007 09:29:06 -0000 1.5 *************** *** 1,4 **** ! # define BOOST_TEST_DYN_LINK # define BOOST_TEST_MAIN # include <boost/test/unit_test.hpp> # include <openvrml/node.h> --- 1,24 ---- ! // -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 4; -*- ! // ! // Copyright 2007 Braden McDaniel ! // ! // This program 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. ! // ! // This program 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. ! // ! // You should have received a copy of the GNU General Public License ! // along with this program; if not, write to the Free Software ! // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA ! // ! # define BOOST_TEST_MAIN + # define BOOST_TEST_MODULE node_interface_set + # include <boost/test/unit_test.hpp> # include <openvrml/node.h> *************** *** 13,17 **** using namespace openvrml; ! void insert_eventin() { node_interface_set interfaces; --- 33,37 ---- using namespace openvrml; ! BOOST_AUTO_TEST_CASE(insert_eventin) { node_interface_set interfaces; *************** *** 22,26 **** } ! void insert_exactly_conflicting_eventin() { node_interface_set interfaces; --- 42,46 ---- } ! BOOST_AUTO_TEST_CASE(insert_exactly_conflicting_eventin) { node_interface_set interfaces; *************** *** 36,40 **** } ! void insert_conflicting_exposedfield() { node_interface_set interfaces; --- 56,60 ---- } ! BOOST_AUTO_TEST_CASE(insert_conflicting_exposedfield) { node_interface_set interfaces; *************** *** 49,53 **** } ! void insert_eventout() { node_interface_set interfaces; --- 69,73 ---- } ! BOOST_AUTO_TEST_CASE(insert_eventout) { node_interface_set interfaces; *************** *** 62,66 **** } ! void insert_exactly_conflicting_eventout() { node_interface_set interfaces; --- 82,86 ---- } ! BOOST_AUTO_TEST_CASE(insert_exactly_conflicting_eventout) { node_interface_set interfaces; *************** *** 75,79 **** } ! void insert_field() { node_interface_set interfaces; --- 95,99 ---- } ! BOOST_AUTO_TEST_CASE(insert_field) { node_interface_set interfaces; *************** *** 92,96 **** } ! void insert_exposedfield() { node_interface_set interfaces; --- 112,116 ---- } ! BOOST_AUTO_TEST_CASE(insert_exposedfield) { node_interface_set interfaces; *************** *** 113,117 **** } ! void find_exposedfield_matching_eventin() { node_interface_set interfaces; --- 133,137 ---- } ! BOOST_AUTO_TEST_CASE(find_exposedfield_matching_eventin) { node_interface_set interfaces; *************** *** 125,142 **** BOOST_REQUIRE(interface == *pos); } - - boost::unit_test::test_suite * init_unit_test_suite(int, char * []) - { - using boost::unit_test::test_suite; - test_suite * const suite = - BOOST_TEST_SUITE("node_interface_set"); - suite->add(BOOST_TEST_CASE(&insert_eventin)); - suite->add(BOOST_TEST_CASE(&insert_exactly_conflicting_eventin)); - suite->add(BOOST_TEST_CASE(&insert_conflicting_exposedfield)); - suite->add(BOOST_TEST_CASE(&insert_eventout)); - suite->add(BOOST_TEST_CASE(&insert_exactly_conflicting_eventout)); - suite->add(BOOST_TEST_CASE(&insert_field)); - suite->add(BOOST_TEST_CASE(&insert_exposedfield)); - suite->add(BOOST_TEST_CASE(&find_exposedfield_matching_eventin)); - return suite; - } --- 145,146 ---- Index: rotation.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/tests/rotation.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** rotation.cpp 23 Aug 2006 06:41:28 -0000 1.1 --- rotation.cpp 6 Oct 2007 09:29:06 -0000 1.2 *************** *** 18,21 **** --- 18,24 ---- // + # define BOOST_TEST_MAIN + # define BOOST_TEST_MODULE rotation + # include <sstream> # include <boost/test/unit_test.hpp> *************** *** 25,29 **** using namespace openvrml; ! void stream_extraction_fail_on_nonnormalized_axis() { string rotation_str = "2.0 2.0 0.0 0.0"; --- 28,32 ---- using namespace openvrml; ! BOOST_AUTO_TEST_CASE(stream_extraction_fail_on_nonnormalized_axis) { string rotation_str = "2.0 2.0 0.0 0.0"; *************** *** 33,42 **** BOOST_REQUIRE(in.fail()); } - - boost::unit_test::test_suite * init_unit_test_suite(int, char * []) - { - using boost::unit_test::test_suite; - test_suite * const suite = BOOST_TEST_SUITE("rotation"); - suite->add(BOOST_TEST_CASE(&stream_extraction_fail_on_nonnormalized_axis)); - return suite; - } --- 36,37 ---- Index: color.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/tests/color.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** color.cpp 31 Aug 2006 07:58:43 -0000 1.2 --- color.cpp 6 Oct 2007 09:29:06 -0000 1.3 *************** *** 18,21 **** --- 18,24 ---- // + # define BOOST_TEST_MAIN + # define BOOST_TEST_MODULE color + # include <sstream> # include <boost/test/unit_test.hpp> *************** *** 25,29 **** using namespace openvrml; ! void stream_extraction_without_commas() { color c1 = make_color(1.0, 1.0, 1.0), c2 = make_color(0.5, 0.5, 0.5), c3, c4; --- 28,32 ---- using namespace openvrml; ! BOOST_AUTO_TEST_CASE(stream_extraction_without_commas) { color c1 = make_color(1.0, 1.0, 1.0), c2 = make_color(0.5, 0.5, 0.5), c3, c4; *************** *** 36,40 **** } ! void stream_extraction_with_commas() { color c1 = make_color(1.0, 1.0, 1.0), c2 = make_color(0.5, 0.5, 0.5), c3, c4; --- 39,43 ---- } ! BOOST_AUTO_TEST_CASE(stream_extraction_with_commas) { color c1 = make_color(1.0, 1.0, 1.0), c2 = make_color(0.5, 0.5, 0.5), c3, c4; *************** *** 47,51 **** } ! void stream_extraction_fail_on_invalid_intensity() { color c; --- 50,54 ---- } ! BOOST_AUTO_TEST_CASE(stream_extraction_fail_on_invalid_intensity) { color c; *************** *** 55,66 **** BOOST_REQUIRE(in.fail()); } - - boost::unit_test::test_suite * init_unit_test_suite(int, char * []) - { - using boost::unit_test::test_suite; - test_suite * const suite = BOOST_TEST_SUITE("color"); - suite->add(BOOST_TEST_CASE(&stream_extraction_without_commas)); - suite->add(BOOST_TEST_CASE(&stream_extraction_with_commas)); - suite->add(BOOST_TEST_CASE(&stream_extraction_fail_on_invalid_intensity)); - return suite; - } --- 58,59 ---- Index: browser.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/tests/browser.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** browser.cpp 22 Nov 2006 00:05:19 -0000 1.8 --- browser.cpp 6 Oct 2007 09:29:06 -0000 1.9 *************** *** 18,21 **** --- 18,24 ---- // + # define BOOST_TEST_MAIN + # define BOOST_TEST_MODULE browser + # include <fstream> # include <iostream> *************** *** 32,36 **** using namespace boost::multi_index::detail; // for scope_guard ! void create_vrml_from_stream() { test_resource_fetcher fetcher; --- 35,39 ---- using namespace boost::multi_index::detail; // for scope_guard ! BOOST_AUTO_TEST_CASE(create_vrml_from_stream) { test_resource_fetcher fetcher; *************** *** 48,52 **** } ! void create_vrml_from_stream_with_externproto() { { --- 51,55 ---- } ! BOOST_AUTO_TEST_CASE(create_vrml_from_stream_with_externproto) { { *************** *** 56,60 **** } scope_guard test_file_guard = ! make_guard(&boost::filesystem::remove, boost::filesystem::path("test.wrl")); boost::ignore_unused_variable_warning(test_file_guard); --- 59,63 ---- } scope_guard test_file_guard = ! make_guard(&boost::filesystem::remove<boost::filesystem::path>, boost::filesystem::path("test.wrl")); boost::ignore_unused_variable_warning(test_file_guard); *************** *** 74,78 **** } ! void create_vrml_from_url() { class children_listener : public openvrml::mfnode_listener { --- 77,81 ---- } ! BOOST_AUTO_TEST_CASE(create_vrml_from_url) { class children_listener : public openvrml::mfnode_listener { *************** *** 109,113 **** } scope_guard test_file_guard = ! make_guard(&boost::filesystem::remove, boost::filesystem::path("test.wrl")); boost::ignore_unused_variable_warning(test_file_guard); --- 112,116 ---- } scope_guard test_file_guard = ! make_guard(&boost::filesystem::remove<boost::filesystem::path>, boost::filesystem::path("test.wrl")); boost::ignore_unused_variable_warning(test_file_guard); *************** *** 148,159 **** BOOST_CHECK_EQUAL(children[0]->type().id(), "Shape"); } - - boost::unit_test::test_suite * init_unit_test_suite(int, char * []) - { - using boost::unit_test::test_suite; - test_suite * const suite = BOOST_TEST_SUITE("browser"); - suite->add(BOOST_TEST_CASE(&create_vrml_from_stream)); - suite->add(BOOST_TEST_CASE(&create_vrml_from_stream_with_externproto)); - suite->add(BOOST_TEST_CASE(&create_vrml_from_url)); - return suite; - } --- 151,152 ---- Index: image.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/tests/image.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** image.cpp 23 Aug 2006 06:41:28 -0000 1.1 --- image.cpp 6 Oct 2007 09:29:06 -0000 1.2 *************** *** 18,21 **** --- 18,24 ---- // + # define BOOST_TEST_MAIN + # define BOOST_TEST_MODULE image + # include <sstream> # include <boost/array.hpp> *************** *** 26,30 **** using namespace openvrml; ! void stream_insertion() { const image img(2, 2, 1); --- 29,33 ---- using namespace openvrml; ! BOOST_AUTO_TEST_CASE(stream_insertion) { const image img(2, 2, 1); *************** *** 36,40 **** } ! void stream_extraction() { const boost::array<unsigned char, 4> pixels = { 0xFF, 0x00, 0xFF, 0x00 }; --- 39,43 ---- } ! BOOST_AUTO_TEST_CASE(stream_extraction) { const boost::array<unsigned char, 4> pixels = { 0xFF, 0x00, 0xFF, 0x00 }; *************** *** 48,52 **** } ! void stream_extraction_insufficient_pixel_values() { const string image_str = "2 2 1 0xFF 0x00 0xFF"; --- 51,55 ---- } ! BOOST_AUTO_TEST_CASE(stream_extraction_insufficient_pixel_values) { const string image_str = "2 2 1 0xFF 0x00 0xFF"; *************** *** 56,67 **** BOOST_REQUIRE(in.fail()); } - - boost::unit_test::test_suite * init_unit_test_suite(int, char * []) - { - using boost::unit_test::test_suite; - test_suite * const suite = BOOST_TEST_SUITE("image"); - suite->add(BOOST_TEST_CASE(&stream_insertion)); - suite->add(BOOST_TEST_CASE(&stream_extraction)); - suite->add(BOOST_TEST_CASE(&stream_extraction_insufficient_pixel_values)); - return suite; - } --- 59,60 ---- Index: mat4f.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/tests/mat4f.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** mat4f.cpp 31 Aug 2006 07:58:43 -0000 1.2 --- mat4f.cpp 6 Oct 2007 09:29:06 -0000 1.3 *************** *** 18,21 **** --- 18,24 ---- // + # define BOOST_TEST_MAIN + # define BOOST_TEST_MODULE mat4f + # include <sstream> # include <boost/test/unit_test.hpp> *************** *** 25,29 **** using namespace openvrml; ! void stream_insertion() { mat4f m = make_mat4f(); --- 28,32 ---- using namespace openvrml; ! BOOST_AUTO_TEST_CASE(stream_insertion) { mat4f m = make_mat4f(); *************** *** 37,41 **** } ! void stream_extraction_numbers_only() { const mat4f m1 = make_mat4f(1, 0, 0, 0, --- 40,44 ---- } ! BOOST_AUTO_TEST_CASE(stream_extraction_numbers_only) { const mat4f m1 = make_mat4f(1, 0, 0, 0, *************** *** 53,57 **** } ! void stream_extraction_numbers_with_commas() { const mat4f m1 = make_mat4f(1, 0, 0, 0, --- 56,60 ---- } ! BOOST_AUTO_TEST_CASE(stream_extraction_numbers_with_commas) { const mat4f m1 = make_mat4f(1, 0, 0, 0, *************** *** 68,79 **** BOOST_REQUIRE_EQUAL(m1, m2); } - - boost::unit_test::test_suite * init_unit_test_suite(int, char * []) - { - using boost::unit_test::test_suite; - test_suite * const suite = BOOST_TEST_SUITE("mat4f"); - suite->add(BOOST_TEST_CASE(&stream_insertion)); - suite->add(BOOST_TEST_CASE(&stream_extraction_numbers_only)); - suite->add(BOOST_TEST_CASE(&stream_extraction_numbers_with_commas)); - return suite; - } --- 71,72 ---- Index: node_metatype_id.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/tests/node_metatype_id.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -C2 -d -r1.1 -r1.2 *** node_metatype_id.cpp 25 Jul 2006 15:32:22 -0000 1.1 --- node_metatype_id.cpp 6 Oct 2007 09:29:06 -0000 1.2 *************** *** 1,2 **** --- 1,24 ---- + // -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 4; -*- + // + // Copyright 2007 Braden McDaniel + // + // This program 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. + // + // This program 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. + // + // You should have received a copy of the GNU General Public License + // along with this program; if not, write to the Free Software + // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + // + + # define BOOST_TEST_MAIN + # define BOOST_TEST_MODULE node_metatype_id + # include <boost/test/unit_test.hpp> # include <openvrml/browser.h> *************** *** 5,29 **** using namespace openvrml; ! void construct_from_urn() { node_metatype_id id("urn:foo:bar"); } ! void construct_from_url() { node_metatype_id id("http://example.com"); } ! void construct_from_url_with_fragment_id() { node_metatype_id id("http://example.com#Foo"); } ! void construct_nested_proto_id() { node_metatype_id id("http://example.com#Foo#Bar"); } ! void construct_from_relative_url() { BOOST_CHECK_THROW(node_metatype_id id("../foo/bar"), --- 27,51 ---- using namespace openvrml; ! BOOST_AUTO_TEST_CASE(construct_from_urn) { node_metatype_id id("urn:foo:bar"); } ! BOOST_AUTO_TEST_CASE(construct_from_url) { node_metatype_id id("http://example.com"); } ! BOOST_AUTO_TEST_CASE(construct_from_url_with_fragment_id) { node_metatype_id id("http://example.com#Foo"); } ! BOOST_AUTO_TEST_CASE(construct_nested_proto_id) { node_metatype_id id("http://example.com#Foo#Bar"); } ! BOOST_AUTO_TEST_CASE(construct_from_relative_url) { BOOST_CHECK_THROW(node_metatype_id id("../foo/bar"), *************** *** 31,49 **** } ! void construct_from_arbitrary_string() { BOOST_CHECK_THROW(node_metatype_id id("string"), std::invalid_argument); } - - boost::unit_test::test_suite * init_unit_test_suite(int, char * []) - { - using boost::unit_test::test_suite; - test_suite * const suite = BOOST_TEST_SUITE("node_metatype_id"); - suite->add(BOOST_TEST_CASE(&construct_from_urn)); - suite->add(BOOST_TEST_CASE(&construct_from_url)); - suite->add(BOOST_TEST_CASE(&construct_from_url_with_fragment_id)); - suite->add(BOOST_TEST_CASE(&construct_nested_proto_id)); - suite->add(BOOST_TEST_CASE(&construct_from_relative_url)); - suite->add(BOOST_TEST_CASE(&construct_from_arbitrary_string)); - return suite; - } --- 53,58 ---- } ! BOOST_AUTO_TEST_CASE(construct_from_arbitrary_string) { BOOST_CHECK_THROW(node_metatype_id id("string"), std::invalid_argument); } Index: Makefile.am =================================================================== RCS file: /cvsroot/openvrml/openvrml/tests/Makefile.am,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** Makefile.am 21 May 2007 04:19:24 -0000 1.17 --- Makefile.am 6 Oct 2007 09:29:06 -0000 1.18 *************** *** 1,7 **** AM_CPPFLAGS = \ -I$(top_builddir)/src/libopenvrml \ ! -I$(top_srcdir)/src/libopenvrml ! AM_CXXFLAGS = @PTHREAD_CFLAGS@ ! AM_LDFLAGS = @OPENVRML_RPATH@ TESTS_ENVIRONMENT = BOOST_TEST_REPORT_LEVEL=detailed --- 1,8 ---- AM_CPPFLAGS = \ -I$(top_builddir)/src/libopenvrml \ ! -I$(top_srcdir)/src/libopenvrml \ ! -DBOOST_TEST_DYN_LINK ! AM_CXXFLAGS = $(PTHREAD_CFLAGS) ! AM_LDFLAGS = $(OPENVRML_RPATH) TESTS_ENVIRONMENT = BOOST_TEST_REPORT_LEVEL=detailed |
From: Braden M. <br...@us...> - 2007-10-06 09:29:05
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv22451 Modified Files: ChangeLog Log Message: Test fixes for Boost 1.34.1. Index: ChangeLog =================================================================== RCS file: /cvsroot/openvrml/openvrml/ChangeLog,v retrieving revision 1.1547 retrieving revision 1.1548 diff -C2 -d -r1.1547 -r1.1548 *** ChangeLog 26 Sep 2007 04:57:52 -0000 1.1547 --- ChangeLog 6 Oct 2007 09:29:05 -0000 1.1548 *************** *** 1,2 **** --- 1,15 ---- + 2007-10-06 Braden McDaniel <br...@en...> + + Test fixes for Boost 1.34.1. + + * tests/Makefile.am + * tests/browser.cpp + * tests/color.cpp + * tests/image.cpp + * tests/mat4f.cpp + * tests/node_interface_set.cpp + * tests/node_metatype_id.cpp + * tests/rotation.cpp + 2007-09-26 Braden McDaniel <br...@en...> |
From: Braden M. <br...@us...> - 2007-09-26 04:58:21
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv11451 Modified Files: ChangeLog Log Message: Doc-comment fixes and improvements. Index: ChangeLog =================================================================== RCS file: /cvsroot/openvrml/openvrml/ChangeLog,v retrieving revision 1.1546 retrieving revision 1.1547 diff -C2 -d -r1.1546 -r1.1547 *** ChangeLog 26 Sep 2007 04:28:23 -0000 1.1546 --- ChangeLog 26 Sep 2007 04:57:52 -0000 1.1547 *************** *** 1,4 **** --- 1,13 ---- 2007-09-26 Braden McDaniel <br...@en...> + Doc-comment fixes and improvements. + + * src/libopenvrml/openvrml/browser.cpp + * src/libopenvrml/openvrml/node.cpp + * src/libopenvrml/openvrml/read_write_mutex.cpp + * src/libopenvrml/openvrml/x3d_environmental_effects.cpp + + 2007-09-26 Braden McDaniel <br...@en...> + * src/openvrml-xembed/gtkvrmlbrowser.cpp (resource_fetcher): Removed obsolete request_channel_mutex_ |
From: Braden M. <br...@us...> - 2007-09-26 04:58:10
|
Update of /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv11451/src/libopenvrml/openvrml Modified Files: browser.cpp node.cpp read_write_mutex.cpp viewer.cpp x3d_environmental_effects.cpp Log Message: Doc-comment fixes and improvements. Index: read_write_mutex.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml/read_write_mutex.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** read_write_mutex.cpp 1 Jun 2007 05:34:02 -0000 1.2 --- read_write_mutex.cpp 26 Sep 2007 04:57:56 -0000 1.3 *************** *** 96,100 **** /** ! * @class openvrml::read_write_mutex::scoped_read_lock openvrml/read_write_lock.h * * @brief Lock the mutex for read access. --- 96,100 ---- /** ! * @class openvrml::read_write_mutex::scoped_read_lock openvrml/read_write_mutex.h * * @brief Lock the mutex for read access. *************** *** 156,160 **** /** ! * @class openvrml::read_write_mutex::scoped_write_lock openvrml/read_write_lock.h * * @brief Lock the mutex for write access. --- 156,160 ---- /** ! * @class openvrml::read_write_mutex::scoped_write_lock openvrml/read_write_mutex.h * * @brief Lock the mutex for write access. *************** *** 228,232 **** /** ! * @class openvrml::read_write_mutex::scoped_read_write_lock openvrml/read_write_lock.h * * @brief Lock the mutex for read/write access. --- 228,232 ---- /** ! * @class openvrml::read_write_mutex::scoped_read_write_lock openvrml/read_write_mutex.h * * @brief Lock the mutex for read/write access. Index: browser.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml/browser.cpp,v retrieving revision 1.223 retrieving revision 1.224 diff -C2 -d -r1.223 -r1.224 *** browser.cpp 12 Jul 2007 02:52:34 -0000 1.223 --- browser.cpp 26 Sep 2007 04:57:53 -0000 1.224 *************** *** 5368,5379 **** * @internal * - * @var boost::recursive_mutex openvrml::browser::mutex_ - * - * @brief Object mutex. - */ - - /** - * @internal - * * @var std::auto_ptr<openvrml::null_node_metatype> openvrml::browser::null_node_metatype_ * --- 5368,5371 ---- Index: x3d_environmental_effects.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml/x3d_environmental_effects.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** x3d_environmental_effects.cpp 18 May 2006 04:11:31 -0000 1.2 --- x3d_environmental_effects.cpp 26 Sep 2007 04:57:56 -0000 1.3 *************** *** 444,448 **** /** ! * @var texture_background_node::set_bind_ * * @brief set_bind eventIn --- 444,448 ---- /** ! * @var texture_background_node::set_bind_listener texture_background_node::set_bind_listener_ * * @brief set_bind eventIn *************** *** 450,454 **** /** ! * @var texture_background_node::ground_angle_ * * @brief ground_angle exposedField --- 450,454 ---- /** ! * @var exposedfield<mffloat> texture_background_node::ground_angle_ * * @brief ground_angle exposedField *************** *** 456,460 **** /** ! * @var texture_background_node::ground_color_ * * @brief ground_color exposedField --- 456,460 ---- /** ! * @var exposedfield<mfcolor> texture_background_node::ground_color_ * * @brief ground_color exposedField *************** *** 462,466 **** /** ! * @var texture_background_node::back_texture_ * * @brief back_texture exposedField --- 462,466 ---- /** ! * @var exposedfield<sfnode> texture_background_node::back_texture_ * * @brief back_texture exposedField *************** *** 468,472 **** /** ! * @var texture_background_node::bottom_texture_ * * @brief bottom_texture exposedField --- 468,472 ---- /** ! * @var exposedfield<sfnode> texture_background_node::bottom_texture_ * * @brief bottom_texture exposedField *************** *** 474,478 **** /** ! * @var texture_background_node::front_texture_ * * @brief front_texture exposedField --- 474,478 ---- /** ! * @var exposedfield<sfnode> texture_background_node::front_texture_ * * @brief front_texture exposedField *************** *** 480,484 **** /** ! * @var texture_background_node::left_texture_ * * @brief left_texture exposedField --- 480,484 ---- /** ! * @var exposedfield<sfnode> texture_background_node::left_texture_ * * @brief left_texture exposedField *************** *** 486,490 **** /** ! * @var texture_background_node::right_texture_ * * @brief right_texture exposedField --- 486,490 ---- /** ! * @var exposedfield<sfnode> texture_background_node::right_texture_ * * @brief right_texture exposedField *************** *** 492,496 **** /** ! * @var texture_background_node::top_texture_ * * @brief top_texture exposedField --- 492,496 ---- /** ! * @var exposedfield<sfnode> texture_background_node::top_texture_ * * @brief top_texture exposedField *************** *** 498,502 **** /** ! * @var texture_background_node::sky_angle_ * * @brief sky_angle exposedField --- 498,502 ---- /** ! * @var exposedfield<mffloat> texture_background_node::sky_angle_ * * @brief sky_angle exposedField *************** *** 504,508 **** /** ! * @var texture_background_node::sky_color_ * * @brief sky_color exposedField --- 504,508 ---- /** ! * @var exposedfield<mfcolor> texture_background_node::sky_color_ * * @brief sky_color exposedField *************** *** 510,514 **** /** ! * @var texture_background_node::transparency_ * * @brief transparency exposedField --- 510,514 ---- /** ! * @var exposedfield<mffloat> texture_background_node::transparency_ * * @brief transparency exposedField *************** *** 516,528 **** /** ! * @var texture_background_node::bind_time_ * ! * @brief bind_time eventOut */ /** ! * @var texture_background_node::is_bound_ * ! * @brief is_bound eventOut */ --- 516,540 ---- /** ! * @var sftime texture_background_node::bind_time_ * ! * @brief bind_time eventOut. */ /** ! * @var sftime_emitter texture_background_node::bind_time_emitter_ * ! * @brief bind_time eventOut emitter. ! */ ! ! /** ! * @var sfbool texture_background_node::is_bound_ ! * ! * @brief is_bound eventOut. ! */ ! ! /** ! * @var sfbool_emitter texture_background_node::is_bound_emitter_ ! * ! * @brief is_bound eventOut emitter. */ Index: viewer.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml/viewer.cpp,v retrieving revision 1.18 retrieving revision 1.19 diff -C2 -d -r1.18 -r1.19 *** viewer.cpp 16 Apr 2007 05:05:28 -0000 1.18 --- viewer.cpp 26 Sep 2007 04:57:56 -0000 1.19 *************** *** 1287,1291 **** * * This function delegates to ! * <code>viewer::do_frustum(const openvrml::frustum &)<code>. * * @param[in] f new frustum value. --- 1287,1291 ---- * * This function delegates to ! * <code>viewer::do_frustum(const openvrml::frustum &)</code>. * * @param[in] f new frustum value. Index: node.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml/node.cpp,v retrieving revision 1.95 retrieving revision 1.96 diff -C2 -d -r1.95 -r1.96 *** node.cpp 6 Jul 2007 20:55:28 -0000 1.95 --- node.cpp 26 Sep 2007 04:57:55 -0000 1.96 *************** *** 3660,3664 **** * @internal * ! * @var boost::mutex openvrml::geometry_node::gemoetry_reference_mutex_ * * @brief Mutex protecting @c #geometry_reference. --- 3660,3664 ---- * @internal * ! * @var boost::mutex openvrml::geometry_node::geometry_reference_mutex_ * * @brief Mutex protecting @c #geometry_reference. |
From: Braden M. <br...@us...> - 2007-09-26 04:28:23
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv32567 Modified Files: ChangeLog Log Message: Removed obsolete request_channel_mutex_ member from resource_fetcher. Index: ChangeLog =================================================================== RCS file: /cvsroot/openvrml/openvrml/ChangeLog,v retrieving revision 1.1545 retrieving revision 1.1546 diff -C2 -d -r1.1545 -r1.1546 *** ChangeLog 20 Sep 2007 06:44:44 -0000 1.1545 --- ChangeLog 26 Sep 2007 04:28:23 -0000 1.1546 *************** *** 1,2 **** --- 1,8 ---- + 2007-09-26 Braden McDaniel <br...@en...> + + * src/openvrml-xembed/gtkvrmlbrowser.cpp + (resource_fetcher): Removed obsolete request_channel_mutex_ + member. + 2007-09-20 Braden McDaniel <br...@en...> |
From: Braden M. <br...@us...> - 2007-09-26 04:28:23
|
Update of /cvsroot/openvrml/openvrml/src/openvrml-xembed In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv32567/src/openvrml-xembed Modified Files: gtkvrmlbrowser.cpp Log Message: Removed obsolete request_channel_mutex_ member from resource_fetcher. Index: gtkvrmlbrowser.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/openvrml-xembed/gtkvrmlbrowser.cpp,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** gtkvrmlbrowser.cpp 4 Sep 2007 22:45:36 -0000 1.11 --- gtkvrmlbrowser.cpp 26 Sep 2007 04:28:24 -0000 1.12 *************** *** 103,107 **** class G_GNUC_INTERNAL resource_fetcher : public openvrml::resource_fetcher { - boost::mutex request_channel_mutex_; boost::thread_group thread_group_; --- 103,106 ---- |
From: Braden M. <br...@us...> - 2007-09-20 06:49:10
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv21611 Modified Files: Tag: OpenVRML-0_16-BRANCH ChangeLog configure.ac Log Message: Use the FREETYPE_FLAGS shell variable when testing whether FreeType needs const in callback function signatures. Index: configure.ac =================================================================== RCS file: /cvsroot/openvrml/openvrml/configure.ac,v retrieving revision 1.92.2.27 retrieving revision 1.92.2.28 diff -C2 -d -r1.92.2.27 -r1.92.2.28 *** configure.ac 12 Jul 2007 06:10:36 -0000 1.92.2.27 --- configure.ac 20 Sep 2007 06:49:07 -0000 1.92.2.28 *************** *** 111,115 **** [AC_LANG_PUSH([C++]) save_CXXFLAGS="${CXXFLAGS}" ! CXXFLAGS="${CXXFLAGS} `${PKG_CONFIG} --cflags ${REQUIRE_FREETYPE}`" AC_COMPILE_IFELSE([AC_LANG_PROGRAM( [#include <ft2build.h> --- 111,115 ---- [AC_LANG_PUSH([C++]) save_CXXFLAGS="${CXXFLAGS}" ! CXXFLAGS="${CXXFLAGS} ${FREETYPE_CFLAGS}" AC_COMPILE_IFELSE([AC_LANG_PROGRAM( [#include <ft2build.h> Index: ChangeLog =================================================================== RCS file: /cvsroot/openvrml/openvrml/ChangeLog,v retrieving revision 1.1310.2.195 retrieving revision 1.1310.2.196 diff -C2 -d -r1.1310.2.195 -r1.1310.2.196 *** ChangeLog 20 Sep 2007 06:40:14 -0000 1.1310.2.195 --- ChangeLog 20 Sep 2007 06:49:06 -0000 1.1310.2.196 *************** *** 1,4 **** --- 1,9 ---- 2007-09-20 Braden McDaniel <br...@en...> + * configure.ac: Use the FREETYPE_FLAGS shell variable when testing + whether FreeType needs const in callback function signatures. + + 2007-09-20 Braden McDaniel <br...@en...> + * src/libopenvrml/openvrml/vrml97node.cpp (image_texture_node::update_texture()): Catch any exception thrown |
From: Braden M. <br...@us...> - 2007-09-20 06:44:43
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv19641 Modified Files: configure.ac ChangeLog Log Message: Use the FREETYPE_FLAGS shell variable when testing whether FreeType needs const in callback function signatures. Index: configure.ac =================================================================== RCS file: /cvsroot/openvrml/openvrml/configure.ac,v retrieving revision 1.121 retrieving revision 1.122 diff -C2 -d -r1.121 -r1.122 *** configure.ac 12 Jul 2007 06:10:51 -0000 1.121 --- configure.ac 20 Sep 2007 06:44:44 -0000 1.122 *************** *** 111,115 **** [AC_LANG_PUSH([C++]) save_CXXFLAGS="${CXXFLAGS}" ! CXXFLAGS="${CXXFLAGS} `${PKG_CONFIG} --cflags ${REQUIRE_FREETYPE}`" AC_COMPILE_IFELSE([AC_LANG_PROGRAM( [#include <ft2build.h> --- 111,115 ---- [AC_LANG_PUSH([C++]) save_CXXFLAGS="${CXXFLAGS}" ! CXXFLAGS="${CXXFLAGS} ${FREETYPE_CFLAGS}" AC_COMPILE_IFELSE([AC_LANG_PROGRAM( [#include <ft2build.h> Index: ChangeLog =================================================================== RCS file: /cvsroot/openvrml/openvrml/ChangeLog,v retrieving revision 1.1544 retrieving revision 1.1545 diff -C2 -d -r1.1544 -r1.1545 *** ChangeLog 4 Sep 2007 22:45:36 -0000 1.1544 --- ChangeLog 20 Sep 2007 06:44:44 -0000 1.1545 *************** *** 1,2 **** --- 1,7 ---- + 2007-09-20 Braden McDaniel <br...@en...> + + * configure.ac: Use the FREETYPE_FLAGS shell variable when testing + whether FreeType needs const in callback function signatures. + 2007-09-04 Braden McDaniel <br...@en...> |
From: Braden M. <br...@us...> - 2007-09-20 06:40:35
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv17952 Modified Files: Tag: OpenVRML-0_16-BRANCH ChangeLog Log Message: Catch any exception thrown in the process of creating the image stream. Index: ChangeLog =================================================================== RCS file: /cvsroot/openvrml/openvrml/ChangeLog,v retrieving revision 1.1310.2.194 retrieving revision 1.1310.2.195 diff -C2 -d -r1.1310.2.194 -r1.1310.2.195 *** ChangeLog 20 Sep 2007 00:33:04 -0000 1.1310.2.194 --- ChangeLog 20 Sep 2007 06:40:14 -0000 1.1310.2.195 *************** *** 1,2 **** --- 1,8 ---- + 2007-09-20 Braden McDaniel <br...@en...> + + * src/libopenvrml/openvrml/vrml97node.cpp + (image_texture_node::update_texture()): Catch any exception thrown + in the process of creating the image stream. + 2007-09-19 Braden McDaniel <br...@en...> |
From: Braden M. <br...@us...> - 2007-09-20 06:40:35
|
Update of /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv17952/src/libopenvrml/openvrml Modified Files: Tag: OpenVRML-0_16-BRANCH vrml97node.cpp Log Message: Catch any exception thrown in the process of creating the image stream. Index: vrml97node.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml/vrml97node.cpp,v retrieving revision 1.108.2.16 retrieving revision 1.108.2.17 diff -C2 -d -r1.108.2.16 -r1.108.2.17 *** vrml97node.cpp 9 Jul 2007 06:54:29 -0000 1.108.2.16 --- vrml97node.cpp 20 Sep 2007 06:40:15 -0000 1.108.2.17 *************** *** 12465,12483 **** /** ! * @brief Called to lazily update texture data. */ void image_texture_node::update_texture() { if (this->texture_needs_update) { ! if (!this->url_.mfstring::value().empty()) { ! using std::auto_ptr; ! auto_ptr<resource_istream> in( ! this->scene()->get_resource(this->url_.mfstring::value())); ! auto_ptr<stream_listener> listener( ! new image_stream_listener(in->url(), ! this->image_, ! *this, ! this->mutex())); ! read_stream(in, listener); } this->texture_needs_update = false; --- 12465,12487 ---- /** ! * @brief Called to update texture data lazily. */ void image_texture_node::update_texture() { if (this->texture_needs_update) { ! try { ! if (!this->url_.mfstring::value().empty()) { ! using std::auto_ptr; ! auto_ptr<resource_istream> in( ! this->scene()->get_resource(this->url_.mfstring::value())); ! auto_ptr<stream_listener> listener( ! new image_stream_listener(in->url(), ! this->image_, ! *this, ! this->mutex())); ! read_stream(in, listener); ! } ! } catch (std::exception & ex) { ! this->scene()->browser().err(ex.what()); } this->texture_needs_update = false; *************** *** 12495,12499 **** * @brief Construct. * ! * @param browser the @c browser associated with this @c node_metatype object. */ indexed_face_set_metatype:: --- 12499,12504 ---- * @brief Construct. * ! * @param browser the @c browser associated with this @c node_metatype ! * object. */ indexed_face_set_metatype:: |
From: Braden M. <br...@us...> - 2007-09-20 00:33:06
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv1832 Modified Files: Tag: OpenVRML-0_16-BRANCH ChangeLog Log Message: Add find_interface to the std namespace so ADL will work with openvrml::node_interface_set. Index: ChangeLog =================================================================== RCS file: /cvsroot/openvrml/openvrml/ChangeLog,v retrieving revision 1.1310.2.193 retrieving revision 1.1310.2.194 diff -C2 -d -r1.1310.2.193 -r1.1310.2.194 *** ChangeLog 12 Jul 2007 06:10:35 -0000 1.1310.2.193 --- ChangeLog 20 Sep 2007 00:33:04 -0000 1.1310.2.194 *************** *** 1,2 **** --- 1,7 ---- + 2007-09-19 Braden McDaniel <br...@en...> + + * src/libopenvrml/openvrml/node.h: Add find_interface to the std + namespace so ADL will work with openvrml::node_interface_set. + 2007-07-12 Braden McDaniel <br...@en...> |
From: Braden M. <br...@us...> - 2007-09-20 00:33:06
|
Update of /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv1832/src/libopenvrml/openvrml Modified Files: Tag: OpenVRML-0_16-BRANCH node.h Log Message: Add find_interface to the std namespace so ADL will work with openvrml::node_interface_set. Index: node.h =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml/node.h,v retrieving revision 1.57.2.1 retrieving revision 1.57.2.2 diff -C2 -d -r1.57.2.1 -r1.57.2.2 *** node.h 6 Mar 2007 07:23:12 -0000 1.57.2.1 --- node.h 20 Sep 2007 00:33:05 -0000 1.57.2.2 *************** *** 1317,1319 **** --- 1317,1323 ---- } + namespace std { + using openvrml::find_interface; + } + # endif |
From: Braden M. <br...@us...> - 2007-09-04 22:45:35
|
Update of /cvsroot/openvrml/openvrml/src/openvrml-xembed In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv24948/src/openvrml-xembed Modified Files: gtkvrmlbrowser.cpp main.cpp plugin_streambuf.cpp plugin_streambuf.h Log Message: If two requests for the same resource are made, it is possible that the one picked from the uninitialized_plugin_streambuf_map_ for the purpose of calling set_get_url_result will be one for which that has already been called. This change introduces the requested_plugin_streambuf_map_, which is a holding area for streambufs for which set_get_url_result has not yet been called. Index: plugin_streambuf.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/openvrml-xembed/plugin_streambuf.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** plugin_streambuf.cpp 15 May 2007 04:06:11 -0000 1.6 --- plugin_streambuf.cpp 4 Sep 2007 22:45:36 -0000 1.7 *************** *** 46,49 **** --- 46,54 ---- g_assert(this->get_url_result_ == -1); this->get_url_result_ = result; + const boost::shared_ptr<plugin_streambuf> this_ = shared_from_this(); + requested_plugin_streambuf_map_.erase(*this); + if (result == 0) { + uninitialized_plugin_streambuf_map_.insert(this->url_, this_); + } this->received_get_url_result_.notify_all(); } *************** *** 66,70 **** g_assert(!type.empty()); boost::mutex::scoped_lock lock(this->mutex_); ! bool succeeded = uninitialized_plugin_streambuf_map_.erase(this->url_); g_assert(succeeded); this->url_ = received_url; --- 71,75 ---- g_assert(!type.empty()); boost::mutex::scoped_lock lock(this->mutex_); ! bool succeeded = uninitialized_plugin_streambuf_map_.erase(*this); g_assert(succeeded); this->url_ = received_url; *************** *** 81,85 **** boost::mutex::scoped_lock lock(this->mutex_); const bool succeeded = ! uninitialized_plugin_streambuf_map_.erase(this->url_); g_assert(succeeded); this->buf_.set_eof(); --- 86,90 ---- boost::mutex::scoped_lock lock(this->mutex_); const bool succeeded = ! uninitialized_plugin_streambuf_map_.erase(*this); g_assert(succeeded); this->buf_.set_eof(); *************** *** 139,142 **** --- 144,201 ---- const boost::shared_ptr<openvrml_xembed::plugin_streambuf> + openvrml_xembed::requested_plugin_streambuf_map:: + find(const std::string & url) const + { + openvrml::read_write_mutex::scoped_read_lock lock(this->mutex_); + const base_t::const_iterator pos = this->base_t::find(url); + return pos == this->end() + ? boost::shared_ptr<plugin_streambuf>() + : pos->second; + } + + void + openvrml_xembed::requested_plugin_streambuf_map:: + insert(const std::string & url, + const boost::shared_ptr<plugin_streambuf> & streambuf) + { + openvrml::read_write_mutex::scoped_write_lock lock(this->mutex_); + this->base_t::insert(make_pair(url, streambuf)); + } + + struct + openvrml_xembed::requested_plugin_streambuf_map::map_entry_matches_streambuf : + std::unary_function<bool, value_type> { + + explicit map_entry_matches_streambuf(const plugin_streambuf * streambuf): + streambuf_(streambuf) + {} + + bool operator()(const value_type & entry) const + { + return this->streambuf_ == entry.second.get(); + } + + private: + const plugin_streambuf * const streambuf_; + }; + + bool + openvrml_xembed::requested_plugin_streambuf_map:: + erase(const plugin_streambuf & streambuf) + { + openvrml::read_write_mutex::scoped_read_write_lock lock(this->mutex_); + const base_t::iterator pos = + std::find_if(this->begin(), this->end(), + map_entry_matches_streambuf(&streambuf)); + if (pos == this->end()) { return false; } + lock.promote(); + this->base_t::erase(pos); + return true; + } + + openvrml_xembed::requested_plugin_streambuf_map + openvrml_xembed::requested_plugin_streambuf_map_; + + const boost::shared_ptr<openvrml_xembed::plugin_streambuf> openvrml_xembed::uninitialized_plugin_streambuf_map:: find(const std::string & url) const *************** *** 158,177 **** } ! /** ! * @brief Erase the first entry corresponding to @p url. ! * ! * The map may have multiple entries corresponding to @p url if the same ! * resource has been requested multiple times. A single call to @c erase will ! * only remove one of them. ! * ! * @return @c true if an entry was removed; @c false otherwise. ! */ bool openvrml_xembed::uninitialized_plugin_streambuf_map:: ! erase(const std::string & url) { ! openvrml::read_write_mutex::scoped_write_lock lock(this->mutex_); ! const map_t::iterator pos = this->map_.find(url); if (pos == this->map_.end()) { return false; } this->map_.erase(pos); return true; --- 217,246 ---- } ! struct openvrml_xembed::uninitialized_plugin_streambuf_map::map_entry_matches_streambuf : ! std::unary_function<bool, map_t::value_type> { ! ! explicit map_entry_matches_streambuf(const plugin_streambuf * streambuf): ! streambuf_(streambuf) ! {} ! ! bool operator()(const map_t::value_type & entry) const ! { ! return this->streambuf_ == entry.second.get(); ! } ! ! private: ! const plugin_streambuf * const streambuf_; ! }; ! bool openvrml_xembed::uninitialized_plugin_streambuf_map:: ! erase(const plugin_streambuf & streambuf) { ! openvrml::read_write_mutex::scoped_read_write_lock lock(this->mutex_); ! const map_t::iterator pos = ! std::find_if(this->map_.begin(), this->map_.end(), ! map_entry_matches_streambuf(&streambuf)); if (pos == this->map_.end()) { return false; } + lock.promote(); this->map_.erase(pos); return true; Index: main.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/openvrml-xembed/main.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** main.cpp 2 Sep 2007 18:27:55 -0000 1.8 --- main.cpp 4 Sep 2007 22:45:36 -0000 1.9 *************** *** 140,145 **** command_line_stream >> url >> result; ! shared_ptr<plugin_streambuf> streambuf = ! uninitialized_plugin_streambuf_map_.find(url); g_assert(streambuf); streambuf->set_get_url_result(result); --- 140,145 ---- command_line_stream >> url >> result; ! const shared_ptr<plugin_streambuf> streambuf = ! requested_plugin_streambuf_map_.find(url); g_assert(streambuf); streambuf->set_get_url_result(result); Index: gtkvrmlbrowser.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/openvrml-xembed/gtkvrmlbrowser.cpp,v retrieving revision 1.10 retrieving revision 1.11 diff -C2 -d -r1.10 -r1.11 *** gtkvrmlbrowser.cpp 2 Sep 2007 18:27:55 -0000 1.10 --- gtkvrmlbrowser.cpp 4 Sep 2007 22:45:36 -0000 1.11 *************** *** 691,699 **** using std::ostringstream; using boost::ref; ! using openvrml_xembed::uninitialized_plugin_streambuf_map_; this->rdbuf(this->streambuf_.get()); ! uninitialized_plugin_streambuf_map_.insert(uri, ! this->streambuf_); ostringstream request; --- 691,698 ---- using std::ostringstream; using boost::ref; ! using openvrml_xembed::requested_plugin_streambuf_map_; this->rdbuf(this->streambuf_.get()); ! requested_plugin_streambuf_map_.insert(uri, this->streambuf_); ostringstream request; Index: plugin_streambuf.h =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/openvrml-xembed/plugin_streambuf.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** plugin_streambuf.h 15 May 2007 04:06:11 -0000 1.5 --- plugin_streambuf.h 4 Sep 2007 22:45:36 -0000 1.6 *************** *** 33,36 **** --- 33,82 ---- namespace openvrml_xembed { + // + // plugin_streambuf Life Cycle + // + // A plugin_streambuf is first created in GtkVrmlBrowser's + // resource_fetcher::do_get_resource implementation (which is + // called whenever libopenvrml needs to load a stream). + // + // Step 1: requested_plugin_streambuf_map_ + // + // Upon creation, the plugin_streambuf is inserted into the + // requested_plugin_streambuf_map_. do_get_resource does not + // complete until the result of asking the host application to + // resolve the URL is known; i.e., + // plugin_streambuf::get_url_result. get_url_result blocks until + // the response is received from the host application; i.e., until + // plugin_streambuf::set_get_url_result has been called. + // set_get_url_result removes the plugin_streambuf from the + // requested_plugin_streambuf_map_. + // + // Step 2: uninitialized_plugin_streambuf_map_ + // + // If plugin_streambuf::set_get_url_result is given a result code + // indicating success (i.e., 0), the plugin_streambuf is inserted + // in the uninitialized_plugin_streambuf_map_. When a new-stream + // command is received for a URL, a plugin_streambuf matching that + // URL is gotten from the uninitialized_plugin_streambuf_map_ and + // plugin_streambuf::init is called on it. init removes the + // plugin_streambuf from the uninitialized_plugin_streambuf_map_ + // and inserts it in the plugin_streambuf_map_. + // + // Step 3: plugin_streambuf_map_ + // + // The plugin_streambuf_map_ comprises plugin_streambufs that are + // being written to in response to write commands and read from by + // stream readers in libopenvrml. Once the host application is + // done sending write commands for a stream, it is expected that + // it will send a destroy-stream command. In response to + // destroy-stream, bounded_buffer<>::set_eof is called on the + // plugin_streambuf's underlying bounded_buffer<> and the + // plugin_streambuf is removed from the plugin_streambuf_map_. + // + // Once the last reference to the resource_istream corresponding + // to the plugin_streambuf is removed, the plugin_streambuf is + // deleted. + // + class command_istream_reader; *************** *** 68,72 **** --- 114,140 ---- }; + extern class requested_plugin_streambuf_map : + std::multimap<std::string, boost::shared_ptr<plugin_streambuf> >, + boost::noncopyable { + + struct map_entry_matches_streambuf; + + typedef std::multimap<std::string, + boost::shared_ptr<plugin_streambuf> > + base_t; + + mutable openvrml::read_write_mutex mutex_; + + public: + const boost::shared_ptr<plugin_streambuf> + find(const std::string & url) const; + void insert(const std::string & url, + const boost::shared_ptr<plugin_streambuf> & streambuf); + bool erase(const plugin_streambuf & streambuf); + } requested_plugin_streambuf_map_; + extern class uninitialized_plugin_streambuf_map : boost::noncopyable { + struct map_entry_matches_streambuf; + mutable openvrml::read_write_mutex mutex_; typedef std::multimap<std::string, boost::shared_ptr<plugin_streambuf> > *************** *** 79,83 **** void insert(const std::string & url, const boost::shared_ptr<plugin_streambuf> & streambuf); ! bool erase(const std::string & url); size_t size() const; bool empty() const; --- 147,151 ---- void insert(const std::string & url, const boost::shared_ptr<plugin_streambuf> & streambuf); ! bool erase(const plugin_streambuf & url); size_t size() const; bool empty() const; |
From: Braden M. <br...@us...> - 2007-09-04 22:45:35
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv24948 Modified Files: ChangeLog Log Message: If two requests for the same resource are made, it is possible that the one picked from the uninitialized_plugin_streambuf_map_ for the purpose of calling set_get_url_result will be one for which that has already been called. This change introduces the requested_plugin_streambuf_map_, which is a holding area for streambufs for which set_get_url_result has not yet been called. Index: ChangeLog =================================================================== RCS file: /cvsroot/openvrml/openvrml/ChangeLog,v retrieving revision 1.1543 retrieving revision 1.1544 diff -C2 -d -r1.1543 -r1.1544 *** ChangeLog 4 Sep 2007 08:15:04 -0000 1.1543 --- ChangeLog 4 Sep 2007 22:45:36 -0000 1.1544 *************** *** 1,4 **** --- 1,58 ---- 2007-09-04 Braden McDaniel <br...@en...> + If two requests for the same resource are made, it is possible + that the one picked from the uninitialized_plugin_streambuf_map_ + for the purpose of calling set_get_url_result will be one for + which that has already been called. + + This change introduces the requested_plugin_streambuf_map_, which + is a holding area for streambufs for which set_get_url_result has + not yet been called. + + * src/openvrml-xembed/gtkvrmlbrowser.cpp + (resource_fetcher::do_get_resource(const std::string &)): Insert + the new plugin_streambuf into the requested_plugin_streambuf_map_ + instead of the uninitialized_plugin_streambuf_map_. + * src/openvrml-xembed/main.cpp + (openvrml_xembed::command_istream_reader::operator()() const): Get + the plugin_streambuf from the requested_plugin_streambuf_map_ when + handling the get-url-result command. + * src/openvrml-xembed/plugin_streambuf.cpp + (openvrml_xembed::plugin_streambuf::set_get_url_result(int)): + Erase the plugin_streambuf from the + requested_plugin_streambuf_map_ and, if the result code indicates + success, insert it in the uninitialized_plugin_streambuf_map_. + (openvrml_xembed::plugin_streambuf::init(size_t, const + std::string&, const std::string &)): Changes for parity with + change to + openvrml_xembed::uninitialized_plugin_streambuf_map::erase. + (openvrml_xembed::plugin_streambuf::fail()): Changes for parity + with change to + openvrml_xembed::uninitialized_plugin_streambuf_map::erase. + (openvrml_xembed::requested_plugin_streambuf_map::find(const + std::string &) const): Added function. Find a plugin_streambuf + given a URL. + (openvrml_xembed::requested_plugin_streambuf_map::insert(const + std::string &, const boost::shared_ptr<plugin_streambuf> &)): + Added function. Insert a plugin_streambuf into the map. + (openvrml_xembed::requested_plugin_streambuf_map::map_entry_matches_streambuf): + Predicate used in + openvrml_xembed::requested_plugin_streambuf_map::erase. + (openvrml_xembed::requested_plugin_streambuf_map::erase(const + plugin_streambuf &)): Erase a plugin_streambuf from the map. + (openvrml_xembed::requested_plugin_streambuf_map_): Map instance. + (openvrml_xembed::uninitialized_plugin_streambuf_map::map_entry_matches_streambuf): + Predicate used in + openvrml_xembed::uninitialized_plugin_streambuf_map::erase. + (openvrml_xembed::uninitialized_plugin_streambuf_map::erase(const + plugin_streambuf &)): Changed to take a reference to a + plugin_streambuf (rather than a URL). + * src/openvrml-xembed/plugin_streambuf.h + (openvrml_xembed::requested_plugin_streambuf_map): A map to hold + plugin_streambuf instances for which + plugin_streambuf::set_get_url_result has not yet been called. + + 2007-09-04 Braden McDaniel <br...@en...> + * src/libopenvrml/openvrml/vrml97node.cpp (image_texture_node::update_texture()): Catch any exception thrown |
From: Braden M. <br...@us...> - 2007-09-04 08:15:04
|
Update of /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv19795/src/libopenvrml/openvrml Modified Files: vrml97node.cpp Log Message: Catch any exception thrown in the process of creating the image stream. Index: vrml97node.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml/vrml97node.cpp,v retrieving revision 1.132 retrieving revision 1.133 diff -C2 -d -r1.132 -r1.133 *** vrml97node.cpp 1 Jul 2007 01:38:40 -0000 1.132 --- vrml97node.cpp 4 Sep 2007 08:15:05 -0000 1.133 *************** *** 12489,12507 **** /** ! * @brief Called to lazily update texture data. */ void image_texture_node::update_texture() { if (this->texture_needs_update) { ! if (!this->url_.mfstring::value().empty()) { ! using std::auto_ptr; ! auto_ptr<resource_istream> in( ! this->scene()->get_resource(this->url_.mfstring::value())); ! auto_ptr<stream_listener> listener( ! new image_stream_listener(in->url(), ! this->image_, ! *this, ! this->image_mutex_)); ! this->scene()->read_stream(in, listener); } this->texture_needs_update = false; --- 12489,12512 ---- /** ! * @brief Called to update texture data lazily. */ void image_texture_node::update_texture() { if (this->texture_needs_update) { ! try { ! if (!this->url_.mfstring::value().empty()) { ! using std::auto_ptr; ! auto_ptr<resource_istream> in( ! this->scene()->get_resource( ! this->url_.mfstring::value())); ! auto_ptr<stream_listener> listener( ! new image_stream_listener(in->url(), ! this->image_, ! *this, ! this->image_mutex_)); ! this->scene()->read_stream(in, listener); ! } ! } catch (std::exception & ex) { ! this->scene()->browser().err(ex.what()); } this->texture_needs_update = false; *************** *** 12519,12523 **** * @brief Construct. * ! * @param browser the @c browser associated with this @c node_metatype object. */ indexed_face_set_metatype:: --- 12524,12529 ---- * @brief Construct. * ! * @param browser the @c browser associated with this @c node_metatype ! * object. */ indexed_face_set_metatype:: |
From: Braden M. <br...@us...> - 2007-09-04 08:15:03
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv19795 Modified Files: ChangeLog Log Message: Catch any exception thrown in the process of creating the image stream. Index: ChangeLog =================================================================== RCS file: /cvsroot/openvrml/openvrml/ChangeLog,v retrieving revision 1.1542 retrieving revision 1.1543 diff -C2 -d -r1.1542 -r1.1543 *** ChangeLog 2 Sep 2007 18:27:55 -0000 1.1542 --- ChangeLog 4 Sep 2007 08:15:04 -0000 1.1543 *************** *** 1,2 **** --- 1,8 ---- + 2007-09-04 Braden McDaniel <br...@en...> + + * src/libopenvrml/openvrml/vrml97node.cpp + (image_texture_node::update_texture()): Catch any exception thrown + in the process of creating the image stream. + 2007-09-02 Braden McDaniel <br...@en...> |
From: Braden M. <br...@us...> - 2007-09-02 18:28:03
|
Update of /cvsroot/openvrml/openvrml/src/openvrml-xembed In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv4802/src/openvrml-xembed Modified Files: Makefile.am gtkvrmlbrowser.cpp gtkvrmlbrowser.h main.cpp Added Files: request_channel.h Log Message: Changes to facilitate setting openvrml-player's location entry after the world has been loaded. Significantly, access to the GIOChannel used by the GtkVrmlBrowser (i.e., the request channel) needed to be made thread-safe. Accordingly, all access to the request channel now goes through the function openvrml_xembed::write_request_chars. --- NEW FILE: request_channel.h --- // -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 78 -*- // // OpenVRML XEmbed control // Copyright 2007 Braden N. McDaniel // // This program 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. // // This program 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. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // # ifndef OPENVRML_XEMBED_REQUEST_CHANNEL_H # define OPENVRML_XEMBED_REQUEST_CHANNEL_H namespace openvrml_xembed { bool write_request_chars(const gchar * buf, gssize count, gsize * bytes_written); } # endif // ifndef OPENVRML_XEMBED_REQUEST_CHANNEL_H Index: main.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/openvrml-xembed/main.cpp,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** main.cpp 12 May 2007 03:29:41 -0000 1.7 --- main.cpp 2 Sep 2007 18:27:55 -0000 1.8 *************** *** 1,6 **** // -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 78 -*- // ! // OpenVRML Mozilla plug-in ! // Copyright 2004, 2005, 2006 Braden N. McDaniel // // This program is free software; you can redistribute it and/or modify --- 1,6 ---- // -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 78 -*- // ! // OpenVRML XEmbed control ! // Copyright 2004, 2005, 2006, 2007 Braden N. McDaniel // // This program is free software; you can redistribute it and/or modify *************** *** 34,37 **** --- 34,38 ---- # endif + # include "request_channel.h" # include "gtkvrmlbrowser.h" # include "command_istream.h" *************** *** 54,60 **** } namespace openvrml_xembed { ! struct command_istream_reader { command_istream_reader(command_istream & in, GtkVrmlBrowser & vrml_browser, --- 55,118 ---- } + extern "C" G_GNUC_INTERNAL + void openvrml_xembed_browser_event_func(GtkVrmlBrowser * source, + GtkVrmlBrowserEvent event, + gpointer data); + namespace openvrml_xembed { ! G_GNUC_INTERNAL GIOChannel * request_channel; ! G_GNUC_INTERNAL boost::mutex request_channel_mutex; ! ! // ! // Map a listener identifier from the client to a listener identifier ! // gotten from the GtkVrmlBrowser. ! // ! class G_GNUC_INTERNAL event_listener_id_map : std::map<gulong, gulong> { ! openvrml::read_write_mutex mutex_; ! ! public: ! using std::map<gulong, gulong>::iterator; ! using std::map<gulong, gulong>::value_type; ! ! using std::map<gulong, gulong>::end; ! ! value_type * insert(gulong command_listener_id, ! gulong widget_listener_id); ! void erase(iterator pos); ! iterator find(gulong command_listener_id); ! } event_listener_id_map_; ! ! event_listener_id_map::value_type * ! event_listener_id_map::insert(const gulong command_listener_id, ! const gulong widget_listener_id) ! { ! using std::pair; ! using std::make_pair; ! using std::map; ! ! openvrml::read_write_mutex::scoped_write_lock lock(this->mutex_); ! pair<map<gulong, gulong>::iterator, bool> result = ! this->map<gulong, gulong>::insert(make_pair(widget_listener_id, ! command_listener_id)); ! return result.second ! ? &(*result.first) ! : 0; ! } ! ! void event_listener_id_map::erase(iterator pos) ! { ! openvrml::read_write_mutex::scoped_write_lock lock(this->mutex_); ! this->std::map<gulong, gulong>::erase(pos); ! } ! ! event_listener_id_map::iterator ! event_listener_id_map::find(const gulong command_listener_id) ! { ! openvrml::read_write_mutex::scoped_read_lock lock(this->mutex_); ! return this->std::map<gulong, gulong>::find(command_listener_id); ! } ! ! struct G_GNUC_INTERNAL command_istream_reader { command_istream_reader(command_istream & in, GtkVrmlBrowser & vrml_browser, *************** *** 145,148 **** --- 203,251 ---- gtk_vrml_browser_load_url(this->vrml_browser_, urls, 0); + } else if (command == "add-browser-event-listener") { + size_t listener_id; + command_line_stream >> listener_id; + event_listener_id_map::value_type * const map_entry = + event_listener_id_map_.insert(listener_id, 0); + map_entry->second = + gtk_vrml_browser_add_listener( + this->vrml_browser_, + openvrml_xembed_browser_event_func, + &map_entry->second); + } else if (command == "remove-browser-event-listener") { + size_t listener_id; + command_line_stream >> listener_id; + const event_listener_id_map::iterator pos = + event_listener_id_map_.find(listener_id); + if (pos == event_listener_id_map_.end()) { + g_warning("Listener %lu not found", listener_id); + continue; + } + gboolean removed = + gtk_vrml_browser_remove_listener(this->vrml_browser_, + pos->second); + if (!removed) { + g_warning("No listener associated with %lu to be " + "removed", listener_id); + } + event_listener_id_map_.erase(pos); + } else if (command == "get-world-url") { + const gchar * const world_url = + gtk_vrml_browser_get_world_url(this->vrml_browser_); + scope_guard world_url_guard = + make_guard(g_free, const_cast<gchar *>(world_url)); + boost::ignore_unused_variable_warning(world_url_guard); + + std::ostringstream request; + request << "world-url " << world_url << '\n'; + gsize bytes_written; + const bool write_succeeded = + write_request_chars(request.str().data(), + request.str().length(), + &bytes_written); + if (!write_succeeded) { + g_warning("Failed to write world-url request: %s", + world_url); + } } } *************** *** 387,391 **** } ! GIOChannel * const request_channel = g_io_channel_unix_new(1); // stdout g_return_val_if_fail(request_channel, EXIT_FAILURE); scope_guard request_channel_guard = make_guard(request_channel_shutdown, --- 490,494 ---- } ! ::request_channel = g_io_channel_unix_new(1); // stdout g_return_val_if_fail(request_channel, EXIT_FAILURE); scope_guard request_channel_guard = make_guard(request_channel_shutdown, *************** *** 403,407 **** g_return_val_if_fail(window, EXIT_FAILURE); ! GtkWidget * const vrml_browser = gtk_vrml_browser_new(request_channel); g_return_val_if_fail(vrml_browser, EXIT_FAILURE); gtk_container_add(GTK_CONTAINER(window), vrml_browser); --- 506,510 ---- g_return_val_if_fail(window, EXIT_FAILURE); ! GtkWidget * const vrml_browser = gtk_vrml_browser_new(); g_return_val_if_fail(vrml_browser, EXIT_FAILURE); gtk_container_add(GTK_CONTAINER(window), vrml_browser); *************** *** 452,455 **** --- 555,576 ---- } + void openvrml_xembed_browser_event_func(GtkVrmlBrowser * /* source */, + GtkVrmlBrowserEvent event, + gpointer data) + { + using std::ostringstream; + + const gulong * listener_id = static_cast<gulong *>(data); + + ostringstream request; + request << "browser-event " << *listener_id << ' ' << event << '\n'; + gsize bytes_written; + const bool write_succeeded = + openvrml_xembed::write_request_chars(request.str().data(), + request.str().length(), + &bytes_written); + g_return_if_fail(write_succeeded); + } + namespace { *************** *** 488,489 **** --- 609,645 ---- } } + + namespace openvrml_xembed { + + bool write_request_chars(const gchar * const buf, + const gssize count, + gsize * const bytes_written) + { + g_assert(::request_channel); + + boost::mutex::scoped_lock lock(::request_channel_mutex); + + using boost::ref; + + GError * error = 0; + scope_guard error_guard = make_guard(g_error_free, ref(error)); + boost::ignore_unused_variable_warning(error_guard); + + GIOStatus status = + g_io_channel_write_chars(::request_channel, buf, count, + bytes_written, &error); + if (status != G_IO_STATUS_NORMAL) { + g_warning(error->message); + return false; + } + + status = g_io_channel_flush(::request_channel, &error); + if (status != G_IO_STATUS_NORMAL) { + g_warning(error->message); + return false; + } + + error_guard.dismiss(); + return true; + } + } Index: Makefile.am =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/openvrml-xembed/Makefile.am,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** Makefile.am 28 Apr 2007 19:12:23 -0000 1.3 --- Makefile.am 2 Sep 2007 18:27:55 -0000 1.4 *************** *** 9,14 **** -I$(mozincludedir) \ -DGTK_DISABLE_DEPRECATED ! AM_CXXFLAGS = @PTHREAD_CFLAGS@ @GTK_CFLAGS@ @GL_CFLAGS@ ! AM_LDFLAGS = @OPENVRML_RPATH@ $(GTK_LIBS) LDADD = $(top_builddir)/src/libopenvrml-gl/libopenvrml-gl.la \ $(top_builddir)/src/libopenvrml/libopenvrml.la \ --- 9,14 ---- -I$(mozincludedir) \ -DGTK_DISABLE_DEPRECATED ! AM_CXXFLAGS = $(PTHREAD_CFLAGS) $(GTK_CFLAGS) $(GL_CFLAGS) ! AM_LDFLAGS = $(OPENVRML_RPATH) $(GTK_LIBS) LDADD = $(top_builddir)/src/libopenvrml-gl/libopenvrml-gl.la \ $(top_builddir)/src/libopenvrml/libopenvrml.la \ *************** *** 23,27 **** command_istream.h \ plugin_streambuf.h \ ! gtkvrmlbrowser.h openvrml_xembed_SOURCES = \ main.cpp \ --- 23,28 ---- command_istream.h \ plugin_streambuf.h \ ! gtkvrmlbrowser.h \ ! request_channel.h openvrml_xembed_SOURCES = \ main.cpp \ Index: gtkvrmlbrowser.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/openvrml-xembed/gtkvrmlbrowser.cpp,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** gtkvrmlbrowser.cpp 15 May 2007 04:06:11 -0000 1.9 --- gtkvrmlbrowser.cpp 2 Sep 2007 18:27:55 -0000 1.10 *************** *** 24,31 **** --- 24,33 ---- // Must include before X11 headers. # include <boost/numeric/conversion/converter.hpp> + # include <boost/ptr_container/ptr_map.hpp> # include <X11/keysym.h> # include <gdk/gdkx.h> # include <openvrml/browser.h> # include <openvrml/gl/viewer.h> + # include "request_channel.h" # include "gtkvrmlbrowser.h" # include "plugin_streambuf.h" *************** *** 101,110 **** class G_GNUC_INTERNAL resource_fetcher : public openvrml::resource_fetcher { - GIOChannel * request_channel_; boost::mutex request_channel_mutex_; boost::thread_group thread_group_; public: - explicit resource_fetcher(GIOChannel & request_channel); virtual ~resource_fetcher() OPENVRML_NOTHROW; --- 103,110 ---- *************** *** 114,120 **** virtual std::auto_ptr<openvrml::resource_istream> do_get_resource(const std::string & uri); - - bool write_request_chars(const gchar * buf, gssize count, - gsize * bytes_written); }; --- 114,117 ---- *************** *** 122,126 **** class GtkGLViewer; ! class G_GNUC_INTERNAL browser_listener : public openvrml::browser_listener { --- 119,123 ---- class GtkGLViewer; ! class G_GNUC_INTERNAL redraw_listener : public openvrml::browser_listener { *************** *** 128,132 **** public: ! explicit browser_listener(GtkGLViewer & viewer); private: --- 125,129 ---- public: ! explicit redraw_listener(GtkGLViewer & viewer); private: *************** *** 134,143 **** }; class G_GNUC_INTERNAL GtkGLViewer : public openvrml::gl::viewer { ! friend class browser_listener; friend void (::gtk_vrml_browser_load_url)(GtkVrmlBrowser * vrml_browser, const gchar ** url, const gchar ** parameter); friend void (::gtk_vrml_browser_set_world)(GtkVrmlBrowser * vrml_browser, --- 131,191 ---- }; + + BOOST_STATIC_ASSERT(GTK_VRML_BROWSER_INITIALIZED + == GtkVrmlBrowserEvent( + openvrml::browser_event::initialized)); + BOOST_STATIC_ASSERT(GTK_VRML_BROWSER_SHUTDOWN + == GtkVrmlBrowserEvent( + openvrml::browser_event::shutdown)); + + class G_GNUC_INTERNAL event_func_listener : + boost::noncopyable, + public openvrml::browser_listener { + + GtkVrmlBrowser & vrml_browser_; + GtkVrmlBrowserEventFunc func_; + gpointer user_data_; + + public: + event_func_listener(GtkVrmlBrowser & vrml_browser, + GtkVrmlBrowserEventFunc func, + gpointer user_data): + vrml_browser_(vrml_browser), + func_(func), + user_data_(user_data) + {} + + virtual ~event_func_listener() OPENVRML_NOTHROW + {} + + virtual void + do_browser_changed(const openvrml::browser_event & event) + { + assert(this->func_); + (this->func_)(&this->vrml_browser_, + GtkVrmlBrowserEvent(event.id()), + this->user_data_); + } + }; + class G_GNUC_INTERNAL GtkGLViewer : public openvrml::gl::viewer { ! friend class redraw_listener; ! friend void (::gtk_vrml_browser_load_url)(GtkVrmlBrowser * vrml_browser, const gchar ** url, const gchar ** parameter); + + friend gchar * + (::gtk_vrml_browser_get_world_url)(GtkVrmlBrowser * vrml_browser); + + friend gulong + (::gtk_vrml_browser_add_listener)(GtkVrmlBrowser *, + GtkVrmlBrowserEventFunc, + gpointer user_data); + friend gboolean + (::gtk_vrml_browser_remove_listener)(GtkVrmlBrowser *, + gulong listener_id); + friend void (::gtk_vrml_browser_set_world)(GtkVrmlBrowser * vrml_browser, *************** *** 156,160 **** ::resource_fetcher fetcher_; openvrml::browser browser_; ! ::browser_listener browser_listener_; bool browser_initialized_; openvrml::read_write_mutex browser_initialized_mutex_; --- 204,208 ---- ::resource_fetcher fetcher_; openvrml::browser browser_; ! ::redraw_listener redraw_listener_; bool browser_initialized_; openvrml::read_write_mutex browser_initialized_mutex_; *************** *** 162,170 **** guint timer; public: bool redrawNeeded; ! GtkGLViewer(GIOChannel & request_channel, ! GtkVrmlBrowser & vrml_browser); virtual ~GtkGLViewer() throw (); --- 210,222 ---- guint timer; + typedef boost::ptr_map<gulong, event_func_listener> + event_func_listener_map; + + event_func_listener_map event_func_listener_map_; + public: bool redrawNeeded; ! explicit GtkGLViewer(GtkVrmlBrowser & vrml_browser); virtual ~GtkGLViewer() throw (); *************** *** 182,192 **** } ! GtkWidget * gtk_vrml_browser_new(GIOChannel * const request_channel) { GtkVrmlBrowser * const vrml_browser = GTK_VRML_BROWSER(g_object_new(GTK_TYPE_VRML_BROWSER, 0)); try { ! vrml_browser->viewer = new GtkGLViewer(*request_channel, ! *vrml_browser); } catch (std::bad_alloc &) { g_return_val_if_reached(0); --- 234,243 ---- } ! GtkWidget * gtk_vrml_browser_new() { GtkVrmlBrowser * const vrml_browser = GTK_VRML_BROWSER(g_object_new(GTK_TYPE_VRML_BROWSER, 0)); try { ! vrml_browser->viewer = new GtkGLViewer(*vrml_browser); } catch (std::bad_alloc &) { g_return_val_if_reached(0); *************** *** 241,244 **** --- 292,343 ---- } + gchar * gtk_vrml_browser_get_world_url(GtkVrmlBrowser * const vrml_browser) + { + GtkGLViewer & viewer = *static_cast<GtkGLViewer *>(vrml_browser->viewer); + return g_strdup(viewer.browser_.world_url().c_str()); + } + + gulong gtk_vrml_browser_add_listener(GtkVrmlBrowser * vrml_browser, + GtkVrmlBrowserEventFunc func, + gpointer user_data) + { + g_return_val_if_fail(vrml_browser, 0); + g_return_val_if_fail(func, 0); + + GtkGLViewer & viewer = *static_cast<GtkGLViewer *>(vrml_browser->viewer); + std::auto_ptr<event_func_listener> + listener(new event_func_listener(*vrml_browser, func, user_data)); + const gulong listener_id = ptrdiff_t(listener.get()); + const std::pair<GtkGLViewer::event_func_listener_map::iterator, bool> + result = viewer.event_func_listener_map_.insert(listener_id, + listener); + if (!result.second) { return 0; } + + scope_guard listener_map_guard = + make_obj_guard(viewer.event_func_listener_map_, + static_cast<GtkGLViewer::event_func_listener_map::size_type (GtkGLViewer::event_func_listener_map::*)(const GtkGLViewer::event_func_listener_map::key_type &)>(&GtkGLViewer::event_func_listener_map::erase), + listener_id); + + const bool add_listener_succeeded = + viewer.browser_.add_listener(*result.first->second); + + if (!add_listener_succeeded) { return 0; } + + listener_map_guard.dismiss(); + + return result.first->first; + } + + gboolean gtk_vrml_browser_remove_listener(GtkVrmlBrowser * vrml_browser, + gulong listener_id) + { + g_return_val_if_fail(vrml_browser, false); + + GtkGLViewer & viewer = *static_cast<GtkGLViewer *>(vrml_browser->viewer); + const GtkGLViewer::event_func_listener_map::size_type num_erased = + viewer.event_func_listener_map_.erase(listener_id); + return num_erased > 0; + } + void gtk_vrml_browser_set_world(GtkVrmlBrowser * vrml_browser, openvrml::resource_istream & in) *************** *** 563,570 **** namespace { - resource_fetcher::resource_fetcher(GIOChannel & request_channel): - request_channel_(&request_channel) - {} - resource_fetcher::~resource_fetcher() OPENVRML_NOTHROW { --- 662,665 ---- *************** *** 606,613 **** gsize bytes_written; const bool write_succeeded = ! this->resource_fetcher_ ! .write_request_chars(request.str().data(), ! request.str().length(), ! &bytes_written); if (!write_succeeded) { this->setstate(ios_base::badbit); --- 701,708 ---- gsize bytes_written; const bool write_succeeded = ! openvrml_xembed::write_request_chars( ! request.str().data(), ! request.str().length(), ! &bytes_written); if (!write_succeeded) { this->setstate(ios_base::badbit); *************** *** 644,683 **** } ! bool resource_fetcher::write_request_chars(const gchar * const buf, ! const gssize count, ! gsize * const bytes_written) ! { ! boost::mutex::scoped_lock lock(this->request_channel_mutex_); ! ! using boost::ref; ! ! GError * error = 0; ! scope_guard error_guard = make_guard(g_error_free, ref(error)); ! boost::ignore_unused_variable_warning(error_guard); ! ! GIOStatus status = ! g_io_channel_write_chars(this->request_channel_, buf, count, ! bytes_written, &error); ! if (status != G_IO_STATUS_NORMAL) { ! g_warning(error->message); ! return false; ! } ! ! status = g_io_channel_flush(this->request_channel_, &error); ! if (status != G_IO_STATUS_NORMAL) { ! g_warning(error->message); ! return false; ! } ! ! error_guard.dismiss(); ! return true; ! } ! ! browser_listener::browser_listener(GtkGLViewer & viewer): viewer_(viewer) {} void ! browser_listener::do_browser_changed(const openvrml::browser_event & event) { if (event.id() == openvrml::browser_event::initialized) { --- 739,748 ---- } ! redraw_listener::redraw_listener(GtkGLViewer & viewer): viewer_(viewer) {} void ! redraw_listener::do_browser_changed(const openvrml::browser_event & event) { if (event.id() == openvrml::browser_event::initialized) { *************** *** 703,711 **** // all browser output to stderr. // ! GtkGLViewer::GtkGLViewer(GIOChannel & request_channel, ! GtkVrmlBrowser & vrml_browser): ! fetcher_(request_channel), browser_(this->fetcher_, std::cerr, std::cerr), ! browser_listener_(*this), browser_initialized_(true), vrml_browser_(vrml_browser), --- 768,774 ---- // all browser output to stderr. // ! GtkGLViewer::GtkGLViewer(GtkVrmlBrowser & vrml_browser): browser_(this->fetcher_, std::cerr, std::cerr), ! redraw_listener_(*this), browser_initialized_(true), vrml_browser_(vrml_browser), *************** *** 713,717 **** redrawNeeded(false) { ! this->browser_.add_listener(this->browser_listener_); this->browser_.viewer(this); } --- 776,780 ---- redrawNeeded(false) { ! this->browser_.add_listener(this->redraw_listener_); this->browser_.viewer(this); } *************** *** 720,724 **** { if (this->timer) { g_source_remove(timer); } ! this->browser_.remove_listener(this->browser_listener_); } --- 783,787 ---- { if (this->timer) { g_source_remove(timer); } ! this->browser_.remove_listener(this->redraw_listener_); } Index: gtkvrmlbrowser.h =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/openvrml-xembed/gtkvrmlbrowser.h,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** gtkvrmlbrowser.h 5 Feb 2007 05:36:12 -0000 1.2 --- gtkvrmlbrowser.h 2 Sep 2007 18:27:55 -0000 1.3 *************** *** 46,55 **** }; GType gtk_vrml_browser_get_type(void) G_GNUC_CONST; ! GtkWidget *gtk_vrml_browser_new(GIOChannel *request_channel); void gtk_vrml_browser_load_url(GtkVrmlBrowser *vrml_browser, const gchar **url, const gchar **parameter); G_END_DECLS --- 46,73 ---- }; + // + // This must correspond to openvrml::browser_event::type_id. + // + typedef enum { + GTK_VRML_BROWSER_INITIALIZED = 1, + GTK_VRML_BROWSER_SHUTDOWN = 2 + } GtkVrmlBrowserEvent; + + typedef void (*GtkVrmlBrowserEventFunc)(GtkVrmlBrowser *source, + GtkVrmlBrowserEvent event, + gpointer data); + GType gtk_vrml_browser_get_type(void) G_GNUC_CONST; ! GtkWidget *gtk_vrml_browser_new(); void gtk_vrml_browser_load_url(GtkVrmlBrowser *vrml_browser, const gchar **url, const gchar **parameter); + gchar *gtk_vrml_browser_get_world_url(GtkVrmlBrowser *vrml_browser); + gulong gtk_vrml_browser_add_listener(GtkVrmlBrowser *vrml_browser, + GtkVrmlBrowserEventFunc func, + gpointer user_data); + gboolean gtk_vrml_browser_remove_listener(GtkVrmlBrowser *vrml_browser, + gulong listener_id); G_END_DECLS |
From: Braden M. <br...@us...> - 2007-09-02 18:28:03
|
Update of /cvsroot/openvrml/openvrml/src/openvrml-player In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv4802/src/openvrml-player Modified Files: Makefile.am player.cpp Log Message: Changes to facilitate setting openvrml-player's location entry after the world has been loaded. Significantly, access to the GIOChannel used by the GtkVrmlBrowser (i.e., the request channel) needed to be made thread-safe. Accordingly, all access to the request channel now goes through the function openvrml_xembed::write_request_chars. Index: player.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/openvrml-player/player.cpp,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** player.cpp 12 Jul 2007 05:32:24 -0000 1.25 --- player.cpp 2 Sep 2007 18:27:55 -0000 1.26 *************** *** 33,36 **** --- 33,37 ---- # include <glade/glade.h> # include <glade/glade-build.h> + # include <openvrml/browser.h> # include "filechooserdialog.h" *************** *** 96,102 **** --- 97,108 ---- G_GNUC_INTERNAL guint request_channel_watch_id; + G_GNUC_INTERNAL void get_openvrml_xembed_cmd(gint & argc, gchar ** & argv); + G_GNUC_INTERNAL GPid spawn_openvrml_xembed(GdkNativeWindow socket_id, + gint & in_fd, + gint & out_fd); G_GNUC_INTERNAL ssize_t write_command(const std::string & command); G_GNUC_INTERNAL GSource * curl_source_new(CURLM * multi_handle); G_GNUC_INTERNAL GladeXML * xml_new(GnomeProgram & program); + G_GNUC_INTERNAL void set_locationentry_text(const gchar * text); G_GNUC_INTERNAL void load_url(const gchar * url); *************** *** 127,130 **** --- 133,138 ---- curl_source_callback_data * source_callback_data; }; + + GtkWidget * location_entry; } *************** *** 221,226 **** GTK_WINDOW(app_window)); ! GtkWidget * const location_entry = ! glade_xml_get_widget(xml, "locationentry"); g_signal_connect(file_chooser_dialog, "response", --- 229,233 ---- GTK_WINDOW(app_window)); ! ::location_entry = glade_xml_get_widget(xml, "locationentry"); g_signal_connect(file_chooser_dialog, "response", *************** *** 228,326 **** location_entry); - // - // The OPENVRML_XEMBED environment variable overrides the default - // path to the child process executable. To allow OPENVRML_XEMBED - // to include arguments (rather than just be a path to an - // executable), it is parsed with g_shell_parse_argv. This is - // particularly useful in case we want to run the child process in - // a harness like valgrind. - // - gint openvrml_xembed_cmd_argc = 0; - gchar ** openvrml_xembed_cmd_argv = 0; - scope_guard openvrml_xembed_cmd_argv_guard = - make_guard(g_strfreev, ref(openvrml_xembed_cmd_argv)); - boost::ignore_unused_variable_warning(openvrml_xembed_cmd_argv_guard); - const gchar * const openvrml_xembed_cmd = g_getenv("OPENVRML_XEMBED"); - if (!openvrml_xembed_cmd) { - openvrml_xembed_cmd_argc = 1; - openvrml_xembed_cmd_argv = - static_cast<gchar **>(g_malloc0(sizeof (gchar *) * 2)); - if (!openvrml_xembed_cmd_argv) { throw std::bad_alloc(); } - openvrml_xembed_cmd_argv[0] = - g_strdup(OPENVRML_LIBEXECDIR_ "/openvrml-xembed"); - if (!openvrml_xembed_cmd_argv[0]) { throw std::bad_alloc(); } - } else { - GError * error = 0; - scope_guard error_guard = make_guard(g_error_free, ref(error)); - gboolean succeeded = - g_shell_parse_argv(openvrml_xembed_cmd, - &openvrml_xembed_cmd_argc, - &openvrml_xembed_cmd_argv, - &error); - if (!succeeded) { - throw std::runtime_error(error - ? error->message - : "g_shell_parse_argv failure"); - } - error_guard.dismiss(); - } - - GtkWidget * const socket = glade_xml_get_widget(xml, "socket"); - string socket_id_arg = - lexical_cast<string>(gtk_socket_get_id(GTK_SOCKET(socket))); - const char * socket_id_arg_c_str = socket_id_arg.c_str(); - vector<char> socket_id_arg_vec( - socket_id_arg_c_str, - socket_id_arg_c_str + socket_id_arg.length() + 1); - - const gint child_argv_size = openvrml_xembed_cmd_argc + 2; - gchar ** const child_argv = - static_cast<gchar **>(g_malloc(sizeof (gchar *) * child_argv_size)); - if (!argv) { throw std::bad_alloc(); } - scope_guard child_argv_guard = make_guard(g_free, child_argv); - boost::ignore_unused_variable_warning(child_argv_guard); - gint i; - for (i = 0; i < openvrml_xembed_cmd_argc; ++i) { - child_argv[i] = openvrml_xembed_cmd_argv[i]; - } - child_argv[i++] = &socket_id_arg_vec.front(); - child_argv[i] = 0; - - gchar * const working_dir = g_get_current_dir(); - if (!working_dir) { throw std::bad_alloc(); }; - scope_guard working_dir_guard = make_guard(g_free, working_dir); - boost::ignore_unused_variable_warning(working_dir_guard); - - gchar ** envp = 0; - GPid child_pid; gint standard_input, standard_output; ! gint * const standard_error = 0; ! GError * error = 0; ! scope_guard error_guard = make_guard(g_error_free, ref(error)); ! gboolean succeeded = g_spawn_async_with_pipes(working_dir, ! child_argv, ! envp, ! G_SPAWN_DO_NOT_REAP_CHILD, ! 0, ! 0, ! &child_pid, ! &standard_input, ! &standard_output, ! standard_error, ! &error); ! if (!succeeded) { ! throw std::runtime_error(error ! ? error->message ! : "g_spawn_async_with_pipes failure"); ! } g_child_watch_add(child_pid, openvrml_player_watch_child, 0); - // - // Don't dismiss "error_guard" yet; we reuse "error" below. - // - ::command_channel = g_io_channel_unix_new(standard_input); if (!::command_channel) { throw std::bad_alloc(); } GIOStatus status = g_io_channel_set_encoding(::command_channel, 0, // binary (no encoding) --- 235,251 ---- location_entry); gint standard_input, standard_output; ! GtkWidget * const socket = glade_xml_get_widget(xml, "socket"); ! const GPid child_pid = ! spawn_openvrml_xembed(gtk_socket_get_id(GTK_SOCKET(socket)), ! standard_input, ! standard_output); g_child_watch_add(child_pid, openvrml_player_watch_child, 0); ::command_channel = g_io_channel_unix_new(standard_input); if (!::command_channel) { throw std::bad_alloc(); } + GError * error = 0; + scope_guard error_guard = make_guard(g_error_free, ref(error)); GIOStatus status = g_io_channel_set_encoding(::command_channel, 0, // binary (no encoding) *************** *** 370,373 **** --- 295,305 ---- &req_data); + ::write_command("add-browser-event-listener " + + lexical_cast<string>(getpid()) + "\n"); + + if (remaining_args && remaining_args[0]) { + ::load_url(remaining_args[0]); + } + gtk_widget_show(app_window); *************** *** 377,380 **** --- 309,416 ---- namespace { + void get_openvrml_xembed_cmd(gint & argc, gchar ** & argv) + { + using boost::ref; + + const gchar * const openvrml_xembed_cmd = g_getenv("OPENVRML_XEMBED"); + + if (!openvrml_xembed_cmd) { + argc = 1; + argv = static_cast<gchar **>(g_malloc0(sizeof (gchar *) * 2)); + if (!argv) { throw std::bad_alloc(); } + argv[0] = g_strdup(OPENVRML_LIBEXECDIR_ "/openvrml-xembed"); + scope_guard argv_guard = make_guard(g_strfreev, ref(argv)); + boost::ignore_unused_variable_warning(argv_guard); + if (!argv[0]) { throw std::bad_alloc(); } + argv_guard.dismiss(); + return; + } + + GError * error = 0; + scope_guard error_guard = make_guard(g_error_free, ref(error)); + const gboolean succeeded = + g_shell_parse_argv(openvrml_xembed_cmd, &argc, &argv, &error); + if (!succeeded) { + throw std::runtime_error(error + ? error->message + : "g_shell_parse_argv failure"); + } + error_guard.dismiss(); + } + + GPid spawn_openvrml_xembed(const GdkNativeWindow socket_id, + gint & in_fd, + gint & out_fd) + { + using std::string; + using std::vector; + using boost::lexical_cast; + using boost::ref; + + // + // The OPENVRML_XEMBED environment variable overrides the default path + // to the child process executable. To allow OPENVRML_XEMBED to + // include arguments (rather than just be a path to an executable), it + // is parsed with g_shell_parse_argv. This is particularly useful in + // case we want to run the child process in a harness like valgrind. + // + gint openvrml_xembed_cmd_argc = 0; + gchar ** openvrml_xembed_cmd_argv = 0; + get_openvrml_xembed_cmd(openvrml_xembed_cmd_argc, + openvrml_xembed_cmd_argv); + + const string socket_id_arg = lexical_cast<string>(socket_id); + const char * socket_id_arg_c_str = socket_id_arg.c_str(); + vector<char> socket_id_arg_vec( + socket_id_arg_c_str, + socket_id_arg_c_str + socket_id_arg.length() + 1); + + const gint child_argv_size = openvrml_xembed_cmd_argc + 2; + gchar ** const child_argv = + static_cast<gchar **>(g_malloc(sizeof (gchar *) * child_argv_size)); + if (!child_argv) { throw std::bad_alloc(); } + scope_guard child_argv_guard = make_guard(g_free, child_argv); + boost::ignore_unused_variable_warning(child_argv_guard); + gint i; + for (i = 0; i < openvrml_xembed_cmd_argc; ++i) { + child_argv[i] = openvrml_xembed_cmd_argv[i]; + } + child_argv[i++] = &socket_id_arg_vec.front(); + child_argv[i] = 0; + + gchar * const working_dir = g_get_current_dir(); + if (!working_dir) { throw std::bad_alloc(); }; + scope_guard working_dir_guard = make_guard(g_free, working_dir); + boost::ignore_unused_variable_warning(working_dir_guard); + + gchar ** envp = 0; + GPid child_pid; + gint * const standard_error = 0; + GError * error = 0; + scope_guard error_guard = make_guard(g_error_free, ref(error)); + boost::ignore_unused_variable_warning(error_guard); + gboolean succeeded = + g_spawn_async_with_pipes(working_dir, + child_argv, + envp, + G_SPAWN_DO_NOT_REAP_CHILD, + 0, + 0, + &child_pid, + &in_fd, + &out_fd, + standard_error, + &error); + if (!succeeded) { + throw std::runtime_error(error + ? error->message + : "g_spawn_async_with_pipes failure"); + } + + error_guard.dismiss(); + + return child_pid; + } + GladeXML * xml_new(GnomeProgram & program) { *************** *** 404,408 **** } ! G_GNUC_INTERNAL void load_url(const gchar * url) { std::ostringstream command; --- 440,449 ---- } ! void set_locationentry_text(const gchar * const text) ! { ! gtk_entry_set_text(GTK_ENTRY(::location_entry), text); ! } ! ! void load_url(const gchar * url) { std::ostringstream command; *************** *** 761,764 **** --- 802,817 ---- } while (perform_result == CURLM_CALL_MULTI_PERFORM); } + } else if (request_type == "browser-event") { + pid_t listener_id; + long event; + req_data.request_line >> listener_id >> event; + + if (event == openvrml::browser_event::initialized) { + ::write_command("get-world-url\n"); + } + } else if (request_type == "world-url") { + std::string url; + req_data.request_line >> url; + ::set_locationentry_text(url.c_str()); } Index: Makefile.am =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/openvrml-player/Makefile.am,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** Makefile.am 9 Feb 2007 05:20:28 -0000 1.4 --- Makefile.am 2 Sep 2007 18:27:55 -0000 1.5 *************** *** 4,10 **** -DGNOME_DISABLE_DEPRECATED \ -DOPENVRML_PLAYER_PKGDATADIR_=\"$(datadir)/openvrml-player\" \ ! -DOPENVRML_LIBEXECDIR_=\"$(libexecdir)\" ! AM_CXXFLAGS = @GNOMEUI_CFLAGS@ @GLADE_CFLAGS@ @CURL_CFLAGS@ ! AM_LDFLAGS = -export-dynamic @GNOMEUI_LIBS@ @GLADE_LIBS@ @CURL_LIBS@ gladedir = $(datadir)/openvrml-player/glade --- 4,12 ---- -DGNOME_DISABLE_DEPRECATED \ -DOPENVRML_PLAYER_PKGDATADIR_=\"$(datadir)/openvrml-player\" \ ! -DOPENVRML_LIBEXECDIR_=\"$(libexecdir)\" \ ! -I$(top_builddir)/src/libopenvrml \ ! -I$(top_srcdir)/src/libopenvrml ! AM_CXXFLAGS = $(GNOMEUI_CFLAGS) $(GLADE_CFLAGS) $(CURL_CFLAGS) ! AM_LDFLAGS = -export-dynamic $(GNOMEUI_LIBS) $(GLADE_LIBS) $(CURL_LIBS) gladedir = $(datadir)/openvrml-player/glade |