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-01-04 03:21:36
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv29653 Modified Files: Tag: OpenVRML-0_16-BRANCH ChangeLog Log Message: Since stdout is used to communicate with the host process, send all browser output to stderr. Index: ChangeLog =================================================================== RCS file: /cvsroot/openvrml/openvrml/ChangeLog,v retrieving revision 1.1310.2.89 retrieving revision 1.1310.2.90 diff -C2 -d -r1.1310.2.89 -r1.1310.2.90 *** ChangeLog 4 Jan 2007 02:43:24 -0000 1.1310.2.89 --- ChangeLog 4 Jan 2007 03:21:34 -0000 1.1310.2.90 *************** *** 2,5 **** --- 2,12 ---- * src/openvrml-gtkplug/gtkvrmlbrowser.cpp + (browser::browser(GIOChannel &)): Since stdout is used to + communicate with the host process, send all browser output to + stderr. + + 2007-01-03 Braden McDaniel <br...@en...> + + * src/openvrml-gtkplug/gtkvrmlbrowser.cpp (browser::do_get_resource(const std::string &)): Check the return status given by g_io_channel_write_chars and g_io_channel_flush; |
From: Braden M. <br...@us...> - 2007-01-04 02:43:39
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv13491 Modified Files: ChangeLog Log Message: Check the return status given by g_io_channel_write_chars and g_io_channel_flush; set badbit and bail if there's a problem. Index: ChangeLog =================================================================== RCS file: /cvsroot/openvrml/openvrml/ChangeLog,v retrieving revision 1.1411 retrieving revision 1.1412 diff -C2 -d -r1.1411 -r1.1412 *** ChangeLog 4 Jan 2007 02:12:45 -0000 1.1411 --- ChangeLog 4 Jan 2007 02:43:37 -0000 1.1412 *************** *** 1,4 **** --- 1,11 ---- 2007-01-03 Braden McDaniel <br...@en...> + * src/openvrml-gtkplug/gtkvrmlbrowser.cpp + (browser::do_get_resource(const std::string &)): Check the return + status given by g_io_channel_write_chars and g_io_channel_flush; + set badbit and bail if there's a problem. + + 2007-01-03 Braden McDaniel <br...@en...> + Factored command and request channel shutdown into separate functions. |
From: Braden M. <br...@us...> - 2007-01-04 02:43:39
|
Update of /cvsroot/openvrml/openvrml/src/openvrml-gtkplug In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv13491/src/openvrml-gtkplug Modified Files: gtkvrmlbrowser.cpp Log Message: Check the return status given by g_io_channel_write_chars and g_io_channel_flush; set badbit and bail if there's a problem. Index: gtkvrmlbrowser.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/openvrml-gtkplug/gtkvrmlbrowser.cpp,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** gtkvrmlbrowser.cpp 6 Dec 2006 01:52:58 -0000 1.5 --- gtkvrmlbrowser.cpp 4 Jan 2007 02:43:37 -0000 1.6 *************** *** 504,513 **** request << "get-url " << uri << '\n'; gsize bytes_written; ! g_io_channel_write_chars(this->request_channel_, ! request.str().data(), ! request.str().length(), ! &bytes_written, ! 0); ! g_io_channel_flush(this->request_channel_, 0); // --- 504,527 ---- request << "get-url " << uri << '\n'; gsize bytes_written; ! GError * error = 0; ! scope_guard error_guard = make_guard(g_error_free, ref(error)); ! GIOStatus io_status = ! g_io_channel_write_chars(this->request_channel_, ! request.str().data(), ! request.str().length(), ! &bytes_written, ! &error); ! if (io_status != G_IO_STATUS_NORMAL) { ! g_warning(error->message); ! this->setstate(ios_base::badbit); ! return; ! } ! ! io_status = g_io_channel_flush(this->request_channel_, &error); ! if (io_status != G_IO_STATUS_NORMAL) { ! g_warning(error->message); ! this->setstate(ios_base::badbit); ! return; ! } // |
From: Braden M. <br...@us...> - 2007-01-04 02:43:26
|
Update of /cvsroot/openvrml/openvrml/src/openvrml-gtkplug In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv13448/src/openvrml-gtkplug Modified Files: Tag: OpenVRML-0_16-BRANCH gtkvrmlbrowser.cpp Log Message: Check the return status given by g_io_channel_write_chars and g_io_channel_flush; set badbit and bail if there's a problem. Index: gtkvrmlbrowser.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/openvrml-gtkplug/gtkvrmlbrowser.cpp,v retrieving revision 1.2.2.3 retrieving revision 1.2.2.4 diff -C2 -d -r1.2.2.3 -r1.2.2.4 *** gtkvrmlbrowser.cpp 6 Dec 2006 01:52:49 -0000 1.2.2.3 --- gtkvrmlbrowser.cpp 4 Jan 2007 02:43:24 -0000 1.2.2.4 *************** *** 504,513 **** request << "get-url " << uri << '\n'; gsize bytes_written; ! g_io_channel_write_chars(this->request_channel_, ! request.str().data(), ! request.str().length(), ! &bytes_written, ! 0); ! g_io_channel_flush(this->request_channel_, 0); // --- 504,527 ---- request << "get-url " << uri << '\n'; gsize bytes_written; ! GError * error = 0; ! scope_guard error_guard = make_guard(g_error_free, ref(error)); ! GIOStatus io_status = ! g_io_channel_write_chars(this->request_channel_, ! request.str().data(), ! request.str().length(), ! &bytes_written, ! &error); ! if (io_status != G_IO_STATUS_NORMAL) { ! g_warning(error->message); ! this->setstate(ios_base::badbit); ! return; ! } ! ! io_status = g_io_channel_flush(this->request_channel_, &error); ! if (io_status != G_IO_STATUS_NORMAL) { ! g_warning(error->message); ! this->setstate(ios_base::badbit); ! return; ! } // |
From: Braden M. <br...@us...> - 2007-01-04 02:43:26
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv13448 Modified Files: Tag: OpenVRML-0_16-BRANCH ChangeLog Log Message: Check the return status given by g_io_channel_write_chars and g_io_channel_flush; set badbit and bail if there's a problem. Index: ChangeLog =================================================================== RCS file: /cvsroot/openvrml/openvrml/ChangeLog,v retrieving revision 1.1310.2.88 retrieving revision 1.1310.2.89 diff -C2 -d -r1.1310.2.88 -r1.1310.2.89 *** ChangeLog 4 Jan 2007 02:12:23 -0000 1.1310.2.88 --- ChangeLog 4 Jan 2007 02:43:24 -0000 1.1310.2.89 *************** *** 1,4 **** --- 1,11 ---- 2007-01-03 Braden McDaniel <br...@en...> + * src/openvrml-gtkplug/gtkvrmlbrowser.cpp + (browser::do_get_resource(const std::string &)): Check the return + status given by g_io_channel_write_chars and g_io_channel_flush; + set badbit and bail if there's a problem. + + 2007-01-03 Braden McDaniel <br...@en...> + Factored command and request channel shutdown into separate functions. |
From: Braden M. <br...@us...> - 2007-01-04 02:12:48
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv32496 Modified Files: ChangeLog Log Message: Factored command and request channel shutdown into separate functions. Index: ChangeLog =================================================================== RCS file: /cvsroot/openvrml/openvrml/ChangeLog,v retrieving revision 1.1410 retrieving revision 1.1411 diff -C2 -d -r1.1410 -r1.1411 *** ChangeLog 3 Jan 2007 23:44:43 -0000 1.1410 --- ChangeLog 4 Jan 2007 02:12:45 -0000 1.1411 *************** *** 1,4 **** --- 1,18 ---- 2007-01-03 Braden McDaniel <br...@en...> + Factored command and request channel shutdown into separate + functions. + + * src/openvrml-gtkplug/main.cpp + (command_channel_shutdown(GIOChannel *)): Added function to shut + down the command channel. + (request_channel_shutdown(GIOChannel *)): Added function to shut + down the request channel. + (main(int, char *[])): Use scope_guard to remove any returned + GError; use scope_guard to call shutdown functions for the command + and request channels. + + 2007-01-03 Braden McDaniel <br...@en...> + * src/libopenvrml/openvrml/browser.cpp (openvrml::browser::root_scene_loader::operator()() const): Don't |
From: Braden M. <br...@us...> - 2007-01-04 02:12:47
|
Update of /cvsroot/openvrml/openvrml/src/openvrml-gtkplug In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv32496/src/openvrml-gtkplug Modified Files: main.cpp Log Message: Factored command and request channel shutdown into separate functions. Index: main.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/openvrml-gtkplug/main.cpp,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** main.cpp 15 Dec 2006 07:39:48 -0000 1.8 --- main.cpp 4 Jan 2007 02:12:46 -0000 1.9 *************** *** 313,316 **** --- 313,322 ---- GtkVrmlBrowser * const vrml_browser_; }; + + G_GNUC_INTERNAL void + command_channel_shutdown(GIOChannel * command_channel); + + G_GNUC_INTERNAL void + request_channel_shutdown(GIOChannel * request_channel); } *************** *** 322,325 **** --- 328,332 ---- using std::vector; using boost::function0; + using boost::ref; using boost::shared_ptr; using boost::thread; *************** *** 336,339 **** --- 343,347 ---- GError * error = 0; + scope_guard error_guard = make_guard(g_error_free, ref(error)); GOptionContext * const context = *************** *** 344,351 **** gboolean succeeded = g_option_context_parse(context, &argc, &argv, &error); if (!succeeded) { ! if (error) { ! g_critical(error->message); ! g_error_free(error); ! } return EXIT_FAILURE; } --- 352,356 ---- gboolean succeeded = g_option_context_parse(context, &argc, &argv, &error); if (!succeeded) { ! if (error) { g_critical(error->message); } return EXIT_FAILURE; } *************** *** 370,380 **** } - command_istream command_in; - GIOChannel * const request_channel = g_io_channel_unix_new(1); // stdout GtkWidget * const window = gtk_plug_new(socket_id); GtkWidget * const vrml_browser = gtk_vrml_browser_new(request_channel); gtk_container_add(GTK_CONTAINER(window), vrml_browser); --- 375,396 ---- } 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, + request_channel); + boost::ignore_unused_variable_warning(request_channel_guard); + GIOStatus status = g_io_channel_set_encoding(request_channel, + 0, // binary (no encoding) + &error); + if (status != G_IO_STATUS_NORMAL) { + if (error) { g_critical(error->message); } + return EXIT_FAILURE; + } GtkWidget * const window = gtk_plug_new(socket_id); + 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); *************** *** 384,399 **** GIOChannel * const command_channel = g_io_channel_unix_new(0); // stdin error = 0; ! GIOStatus status = g_io_channel_set_encoding(command_channel, ! 0, // binary (no encoding) ! &error); if (status != G_IO_STATUS_NORMAL) { ! if (error) { ! g_critical(error->message); ! g_error_free(error); ! } return EXIT_FAILURE; } function0<void> command_channel_loop_func = command_channel_loop(*command_channel, --- 400,419 ---- GIOChannel * const command_channel = g_io_channel_unix_new(0); // stdin + g_return_val_if_fail(command_channel, EXIT_FAILURE); + scope_guard command_channel_guard = make_guard(command_channel_shutdown, + command_channel); + boost::ignore_unused_variable_warning(command_channel_guard); + error = 0; ! status = g_io_channel_set_encoding(command_channel, ! 0, // binary (no encoding) ! &error); if (status != G_IO_STATUS_NORMAL) { ! if (error) { g_critical(error->message); } return EXIT_FAILURE; } + command_istream command_in; + function0<void> command_channel_loop_func = command_channel_loop(*command_channel, *************** *** 417,442 **** threads.join_all(); ! status = g_io_channel_shutdown(command_channel, true, &error); ! if (status != G_IO_STATUS_NORMAL) { ! if (error) { ! g_critical(error->message); ! g_error_free(error); } } - g_io_channel_unref(command_channel); ! if (request_channel) { GError * error = 0; ! const gboolean flush = false; GIOStatus status = g_io_channel_shutdown(request_channel, flush, &error); if (status != G_IO_STATUS_NORMAL) { ! if (error) { ! g_critical(error->message); ! g_error_free(error); ! } } } - g_io_channel_unref(request_channel); } --- 437,477 ---- threads.join_all(); ! error_guard.dismiss(); ! } ! ! namespace { ! ! void command_channel_shutdown(GIOChannel * const command_channel) ! { ! using boost::ref; ! ! static const gboolean flush = true; ! GError * error = 0; ! scope_guard error_guard = make_guard(g_error_free, ref(error)); ! const GIOStatus status = g_io_channel_shutdown(command_channel, ! flush, ! &error); ! if (status != G_IO_STATUS_NORMAL) { ! if (error) { g_critical(error->message); } } + g_io_channel_unref(command_channel); + error_guard.dismiss(); } ! void request_channel_shutdown(GIOChannel * const request_channel) ! { ! using boost::ref; ! ! static const gboolean flush = false; GError * error = 0; ! scope_guard error_guard = make_guard(g_error_free, ref(error)); GIOStatus status = g_io_channel_shutdown(request_channel, flush, &error); if (status != G_IO_STATUS_NORMAL) { ! if (error) { g_critical(error->message); } } + g_io_channel_unref(request_channel); + error_guard.dismiss(); } } |
From: Braden M. <br...@us...> - 2007-01-04 02:12:25
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv32456 Modified Files: Tag: OpenVRML-0_16-BRANCH ChangeLog Log Message: Factored command and request channel shutdown into separate functions. Index: ChangeLog =================================================================== RCS file: /cvsroot/openvrml/openvrml/ChangeLog,v retrieving revision 1.1310.2.87 retrieving revision 1.1310.2.88 diff -C2 -d -r1.1310.2.87 -r1.1310.2.88 *** ChangeLog 3 Jan 2007 23:43:23 -0000 1.1310.2.87 --- ChangeLog 4 Jan 2007 02:12:23 -0000 1.1310.2.88 *************** *** 1,4 **** --- 1,18 ---- 2007-01-03 Braden McDaniel <br...@en...> + Factored command and request channel shutdown into separate + functions. + + * src/openvrml-gtkplug/main.cpp + (command_channel_shutdown(GIOChannel *)): Added function to shut + down the command channel. + (request_channel_shutdown(GIOChannel *)): Added function to shut + down the request channel. + (main(int, char *[])): Use scope_guard to remove any returned + GError; use scope_guard to call shutdown functions for the command + and request channels. + + 2007-01-03 Braden McDaniel <br...@en...> + * src/libopenvrml/openvrml/browser.cpp (openvrml::browser::root_scene_loader::operator()() const): Don't |
From: Braden M. <br...@us...> - 2007-01-04 02:12:25
|
Update of /cvsroot/openvrml/openvrml/src/openvrml-gtkplug In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv32456/src/openvrml-gtkplug Modified Files: Tag: OpenVRML-0_16-BRANCH main.cpp Log Message: Factored command and request channel shutdown into separate functions. Index: main.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/openvrml-gtkplug/main.cpp,v retrieving revision 1.2.2.7 retrieving revision 1.2.2.8 diff -C2 -d -r1.2.2.7 -r1.2.2.8 *** main.cpp 15 Dec 2006 07:39:31 -0000 1.2.2.7 --- main.cpp 4 Jan 2007 02:12:24 -0000 1.2.2.8 *************** *** 313,316 **** --- 313,322 ---- GtkVrmlBrowser * const vrml_browser_; }; + + G_GNUC_INTERNAL void + command_channel_shutdown(GIOChannel * command_channel); + + G_GNUC_INTERNAL void + request_channel_shutdown(GIOChannel * request_channel); } *************** *** 322,325 **** --- 328,332 ---- using std::vector; using boost::function0; + using boost::ref; using boost::shared_ptr; using boost::thread; *************** *** 336,339 **** --- 343,347 ---- GError * error = 0; + scope_guard error_guard = make_guard(g_error_free, ref(error)); GOptionContext * const context = *************** *** 344,351 **** gboolean succeeded = g_option_context_parse(context, &argc, &argv, &error); if (!succeeded) { ! if (error) { ! g_critical(error->message); ! g_error_free(error); ! } return EXIT_FAILURE; } --- 352,356 ---- gboolean succeeded = g_option_context_parse(context, &argc, &argv, &error); if (!succeeded) { ! if (error) { g_critical(error->message); } return EXIT_FAILURE; } *************** *** 370,380 **** } - command_istream command_in; - GIOChannel * const request_channel = g_io_channel_unix_new(1); // stdout GtkWidget * const window = gtk_plug_new(socket_id); GtkWidget * const vrml_browser = gtk_vrml_browser_new(request_channel); gtk_container_add(GTK_CONTAINER(window), vrml_browser); --- 375,396 ---- } 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, + request_channel); + boost::ignore_unused_variable_warning(request_channel_guard); + GIOStatus status = g_io_channel_set_encoding(request_channel, + 0, // binary (no encoding) + &error); + if (status != G_IO_STATUS_NORMAL) { + if (error) { g_critical(error->message); } + return EXIT_FAILURE; + } GtkWidget * const window = gtk_plug_new(socket_id); + 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); *************** *** 384,399 **** GIOChannel * const command_channel = g_io_channel_unix_new(0); // stdin error = 0; ! GIOStatus status = g_io_channel_set_encoding(command_channel, ! 0, // binary (no encoding) ! &error); if (status != G_IO_STATUS_NORMAL) { ! if (error) { ! g_critical(error->message); ! g_error_free(error); ! } return EXIT_FAILURE; } function0<void> command_channel_loop_func = command_channel_loop(*command_channel, --- 400,419 ---- GIOChannel * const command_channel = g_io_channel_unix_new(0); // stdin + g_return_val_if_fail(command_channel, EXIT_FAILURE); + scope_guard command_channel_guard = make_guard(command_channel_shutdown, + command_channel); + boost::ignore_unused_variable_warning(command_channel_guard); + error = 0; ! status = g_io_channel_set_encoding(command_channel, ! 0, // binary (no encoding) ! &error); if (status != G_IO_STATUS_NORMAL) { ! if (error) { g_critical(error->message); } return EXIT_FAILURE; } + command_istream command_in; + function0<void> command_channel_loop_func = command_channel_loop(*command_channel, *************** *** 417,442 **** threads.join_all(); ! status = g_io_channel_shutdown(command_channel, true, &error); ! if (status != G_IO_STATUS_NORMAL) { ! if (error) { ! g_critical(error->message); ! g_error_free(error); } } - g_io_channel_unref(command_channel); ! if (request_channel) { GError * error = 0; ! const gboolean flush = false; GIOStatus status = g_io_channel_shutdown(request_channel, flush, &error); if (status != G_IO_STATUS_NORMAL) { ! if (error) { ! g_critical(error->message); ! g_error_free(error); ! } } } - g_io_channel_unref(request_channel); } --- 437,477 ---- threads.join_all(); ! error_guard.dismiss(); ! } ! ! namespace { ! ! void command_channel_shutdown(GIOChannel * const command_channel) ! { ! using boost::ref; ! ! static const gboolean flush = true; ! GError * error = 0; ! scope_guard error_guard = make_guard(g_error_free, ref(error)); ! const GIOStatus status = g_io_channel_shutdown(command_channel, ! flush, ! &error); ! if (status != G_IO_STATUS_NORMAL) { ! if (error) { g_critical(error->message); } } + g_io_channel_unref(command_channel); + error_guard.dismiss(); } ! void request_channel_shutdown(GIOChannel * const request_channel) ! { ! using boost::ref; ! ! static const gboolean flush = false; GError * error = 0; ! scope_guard error_guard = make_guard(g_error_free, ref(error)); GIOStatus status = g_io_channel_shutdown(request_channel, flush, &error); if (status != G_IO_STATUS_NORMAL) { ! if (error) { g_critical(error->message); } } + g_io_channel_unref(request_channel); + error_guard.dismiss(); } } |
From: Braden M. <br...@us...> - 2007-01-03 23:44:46
|
Update of /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv5557/src/libopenvrml/openvrml Modified Files: browser.cpp Log Message: Don't lock the browser-wide mutex in root_scene_loader. Index: browser.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml/browser.cpp,v retrieving revision 1.199 retrieving revision 1.200 diff -C2 -d -r1.199 -r1.200 *** browser.cpp 28 Dec 2006 23:12:20 -0000 1.199 --- browser.cpp 3 Jan 2007 23:44:43 -0000 1.200 *************** *** 6130,6135 **** { try { - boost::recursive_mutex::scoped_lock lock(this->browser_->mutex_); - using std::endl; --- 6130,6133 ---- |
From: Braden M. <br...@us...> - 2007-01-03 23:44:46
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv5557 Modified Files: ChangeLog Log Message: Don't lock the browser-wide mutex in root_scene_loader. Index: ChangeLog =================================================================== RCS file: /cvsroot/openvrml/openvrml/ChangeLog,v retrieving revision 1.1409 retrieving revision 1.1410 diff -C2 -d -r1.1409 -r1.1410 *** ChangeLog 3 Jan 2007 23:08:39 -0000 1.1409 --- ChangeLog 3 Jan 2007 23:44:43 -0000 1.1410 *************** *** 1,4 **** --- 1,10 ---- 2007-01-03 Braden McDaniel <br...@en...> + * src/libopenvrml/openvrml/browser.cpp + (openvrml::browser::root_scene_loader::operator()() const): Don't + lock the browser-wide mutex here. + + 2007-01-03 Braden McDaniel <br...@en...> + On second thought, retaining copies in the guard_impl is really the only safe thing to do (in the event someone wants to invoke |
From: Braden M. <br...@us...> - 2007-01-03 23:43:27
|
Update of /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv5146/src/libopenvrml/openvrml Modified Files: Tag: OpenVRML-0_16-BRANCH browser.cpp Log Message: Don't lock the browser-wide mutex in root_scene_loader. Index: browser.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml/browser.cpp,v retrieving revision 1.190.2.7 retrieving revision 1.190.2.8 diff -C2 -d -r1.190.2.7 -r1.190.2.8 *** browser.cpp 28 Dec 2006 23:10:57 -0000 1.190.2.7 --- browser.cpp 3 Jan 2007 23:43:23 -0000 1.190.2.8 *************** *** 6096,6101 **** { try { - boost::recursive_mutex::scoped_lock lock(this->browser_->mutex_); - using std::endl; --- 6096,6099 ---- |
From: Braden M. <br...@us...> - 2007-01-03 23:43:24
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv5146 Modified Files: Tag: OpenVRML-0_16-BRANCH ChangeLog Log Message: Don't lock the browser-wide mutex in root_scene_loader. Index: ChangeLog =================================================================== RCS file: /cvsroot/openvrml/openvrml/ChangeLog,v retrieving revision 1.1310.2.86 retrieving revision 1.1310.2.87 diff -C2 -d -r1.1310.2.86 -r1.1310.2.87 *** ChangeLog 3 Jan 2007 23:08:16 -0000 1.1310.2.86 --- ChangeLog 3 Jan 2007 23:43:23 -0000 1.1310.2.87 *************** *** 1,4 **** --- 1,10 ---- 2007-01-03 Braden McDaniel <br...@en...> + * src/libopenvrml/openvrml/browser.cpp + (openvrml::browser::root_scene_loader::operator()() const): Don't + lock the browser-wide mutex here. + + 2007-01-03 Braden McDaniel <br...@en...> + On second thought, retaining copies in the guard_impl is really the only safe thing to do (in the event someone wants to invoke |
From: Braden M. <br...@us...> - 2007-01-03 23:08:41
|
Update of /cvsroot/openvrml/openvrml/src/libopenvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv21055/src/libopenvrml Modified Files: private.h Log Message: On second thought, retaining copies in the guard_impl is really the only safe thing to do (in the event someone wants to invoke make_guard with temporaries). The case where this is not desirable can be solved by using boost::ref in the call to make_guard. Index: private.h =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/private.h,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -d -r1.13 -r1.14 *** private.h 2 Jan 2007 00:08:33 -0000 1.13 --- private.h 3 Jan 2007 23:08:39 -0000 1.14 *************** *** 191,195 **** class OPENVRML_LOCAL scope_guard_impl1 : public scope_guard_impl_base { Function function; ! const Param & param; public: --- 191,195 ---- class OPENVRML_LOCAL scope_guard_impl1 : public scope_guard_impl_base { Function function; ! const Param param; public: *************** *** 224,230 **** class OPENVRML_LOCAL scope_guard_impl3 : public scope_guard_impl_base { Function function; ! const Param1 & param1; ! const Param2 & param2; ! const Param3 & param3; public: --- 224,230 ---- class OPENVRML_LOCAL scope_guard_impl3 : public scope_guard_impl_base { Function function; ! const Param1 param1; ! const Param2 param2; ! const Param3 param3; public: *************** *** 315,319 **** Object & obj; MemberFunction mem_fun; ! const Param & param; public: --- 315,319 ---- Object & obj; MemberFunction mem_fun; ! const Param param; public: |
From: Braden M. <br...@us...> - 2007-01-03 23:08:40
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv21055 Modified Files: ChangeLog Log Message: On second thought, retaining copies in the guard_impl is really the only safe thing to do (in the event someone wants to invoke make_guard with temporaries). The case where this is not desirable can be solved by using boost::ref in the call to make_guard. Index: ChangeLog =================================================================== RCS file: /cvsroot/openvrml/openvrml/ChangeLog,v retrieving revision 1.1408 retrieving revision 1.1409 diff -C2 -d -r1.1408 -r1.1409 *** ChangeLog 3 Jan 2007 17:03:45 -0000 1.1408 --- ChangeLog 3 Jan 2007 23:08:39 -0000 1.1409 *************** *** 1,4 **** --- 1,22 ---- 2007-01-03 Braden McDaniel <br...@en...> + On second thought, retaining copies in the guard_impl is really + the only safe thing to do (in the event someone wants to invoke + make_guard with temporaries). The case where this is not desirable + can be solved by using boost::ref in the call to make_guard. + + * mozilla-plugin/src/openvrml.cpp + (plugin_instance::set_window(NPWindow &)): Use boost::ref instead + of explicitly giving a reference template parameter to make_guard. + * src/libopenvrml/private.h + (openvrml_::scope_guard_impl1): Store a copy to the callback + function parameter. + (openvrml_::scope_guard_impl3): Store a copy to the callback + function parameter. + (openvrml_::obj_scope_guard_impl1): Store a copy to the callback + function parameter. + + 2007-01-03 Braden McDaniel <br...@en...> + * m4/jdk.m4: Removed obsolete commented-out macro. |
From: Braden M. <br...@us...> - 2007-01-03 23:08:40
|
Update of /cvsroot/openvrml/openvrml/mozilla-plugin/src In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv21055/mozilla-plugin/src Modified Files: openvrml.cpp Log Message: On second thought, retaining copies in the guard_impl is really the only safe thing to do (in the event someone wants to invoke make_guard with temporaries). The case where this is not desirable can be solved by using boost::ref in the call to make_guard. Index: openvrml.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/mozilla-plugin/src/openvrml.cpp,v retrieving revision 1.49 retrieving revision 1.50 diff -C2 -d -r1.49 -r1.50 *** openvrml.cpp 2 Jan 2007 00:08:33 -0000 1.49 --- openvrml.cpp 3 Jan 2007 23:08:39 -0000 1.50 *************** *** 30,33 **** --- 30,34 ---- # include <boost/multi_index/detail/scope_guard.hpp> # include <boost/noncopyable.hpp> + # include <boost/ref.hpp> # include <boost/scoped_ptr.hpp> # include <mozilla-config.h> *************** *** 1109,1112 **** --- 1110,1114 ---- using std::vector; using boost::lexical_cast; + using boost::ref; this->window = GdkNativeWindow(ptrdiff_t(window.window)); *************** *** 1123,1128 **** gchar ** openvrml_gtkplug_cmd_argv = 0; scope_guard openvrml_gtkplug_cmd_argv_guard = ! make_guard<void (*)(gchar **), gchar ** &>( ! g_strfreev, openvrml_gtkplug_cmd_argv); boost::ignore_unused_variable_warning(openvrml_gtkplug_cmd_argv_guard); const gchar * const openvrml_gtkplug_cmd = --- 1125,1129 ---- gchar ** openvrml_gtkplug_cmd_argv = 0; scope_guard openvrml_gtkplug_cmd_argv_guard = ! make_guard(g_strfreev, ref(openvrml_gtkplug_cmd_argv)); boost::ignore_unused_variable_warning(openvrml_gtkplug_cmd_argv_guard); const gchar * const openvrml_gtkplug_cmd = *************** *** 1138,1144 **** } else { GError * error = 0; ! scope_guard error_guard = ! make_guard<void (*)(GError *), GError * &>(g_error_free, ! error); gboolean succeeded = g_shell_parse_argv(openvrml_gtkplug_cmd, --- 1139,1143 ---- } else { GError * error = 0; ! scope_guard error_guard = make_guard(g_error_free, ref(error)); gboolean succeeded = g_shell_parse_argv(openvrml_gtkplug_cmd, *************** *** 1191,1196 **** gint * const standard_error = 0; GError * error = 0; ! scope_guard error_guard = ! make_guard<void (*)(GError *), GError * &>(g_error_free, error); gboolean succeeded = g_spawn_async_with_pipes(working_dir, argv, --- 1190,1194 ---- 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, argv, |
From: Braden M. <br...@us...> - 2007-01-03 23:08:18
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv21011 Modified Files: Tag: OpenVRML-0_16-BRANCH ChangeLog Log Message: On second thought, retaining copies in the guard_impl is really the only safe thing to do (in the event someone wants to invoke make_guard with temporaries). The case where this is not desirable can be solved by using boost::ref in the call to make_guard. Index: ChangeLog =================================================================== RCS file: /cvsroot/openvrml/openvrml/ChangeLog,v retrieving revision 1.1310.2.85 retrieving revision 1.1310.2.86 diff -C2 -d -r1.1310.2.85 -r1.1310.2.86 *** ChangeLog 3 Jan 2007 17:02:53 -0000 1.1310.2.85 --- ChangeLog 3 Jan 2007 23:08:16 -0000 1.1310.2.86 *************** *** 1,4 **** --- 1,22 ---- 2007-01-03 Braden McDaniel <br...@en...> + On second thought, retaining copies in the guard_impl is really + the only safe thing to do (in the event someone wants to invoke + make_guard with temporaries). The case where this is not desirable + can be solved by using boost::ref in the call to make_guard. + + * mozilla-plugin/src/openvrml.cpp + (plugin_instance::set_window(NPWindow &)): Use boost::ref instead + of explicitly giving a reference template parameter to make_guard. + * src/libopenvrml/private.h + (openvrml_::scope_guard_impl1): Store a copy to the callback + function parameter. + (openvrml_::scope_guard_impl3): Store a copy to the callback + function parameter. + (openvrml_::obj_scope_guard_impl1): Store a copy to the callback + function parameter. + + 2007-01-03 Braden McDaniel <br...@en...> + * m4/jdk.m4: Removed obsolete commented-out macro. |
From: Braden M. <br...@us...> - 2007-01-03 23:08:18
|
Update of /cvsroot/openvrml/openvrml/mozilla-plugin/src In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv21011/mozilla-plugin/src Modified Files: Tag: OpenVRML-0_16-BRANCH openvrml.cpp Log Message: On second thought, retaining copies in the guard_impl is really the only safe thing to do (in the event someone wants to invoke make_guard with temporaries). The case where this is not desirable can be solved by using boost::ref in the call to make_guard. Index: openvrml.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/mozilla-plugin/src/openvrml.cpp,v retrieving revision 1.37.2.12 retrieving revision 1.37.2.13 diff -C2 -d -r1.37.2.12 -r1.37.2.13 *** openvrml.cpp 2 Jan 2007 00:07:28 -0000 1.37.2.12 --- openvrml.cpp 3 Jan 2007 23:08:17 -0000 1.37.2.13 *************** *** 30,33 **** --- 30,34 ---- # include <boost/multi_index/detail/scope_guard.hpp> # include <boost/noncopyable.hpp> + # include <boost/ref.hpp> # include <boost/scoped_ptr.hpp> # include <mozilla-config.h> *************** *** 1109,1112 **** --- 1110,1114 ---- using std::vector; using boost::lexical_cast; + using boost::ref; this->window = GdkNativeWindow(ptrdiff_t(window.window)); *************** *** 1123,1128 **** gchar ** openvrml_gtkplug_cmd_argv = 0; scope_guard openvrml_gtkplug_cmd_argv_guard = ! make_guard<void (*)(gchar **), gchar ** &>( ! g_strfreev, openvrml_gtkplug_cmd_argv); boost::ignore_unused_variable_warning(openvrml_gtkplug_cmd_argv_guard); const gchar * const openvrml_gtkplug_cmd = --- 1125,1129 ---- gchar ** openvrml_gtkplug_cmd_argv = 0; scope_guard openvrml_gtkplug_cmd_argv_guard = ! make_guard(g_strfreev, ref(openvrml_gtkplug_cmd_argv)); boost::ignore_unused_variable_warning(openvrml_gtkplug_cmd_argv_guard); const gchar * const openvrml_gtkplug_cmd = *************** *** 1138,1144 **** } else { GError * error = 0; ! scope_guard error_guard = ! make_guard<void (*)(GError *), GError * &>(g_error_free, ! error); gboolean succeeded = g_shell_parse_argv(openvrml_gtkplug_cmd, --- 1139,1143 ---- } else { GError * error = 0; ! scope_guard error_guard = make_guard(g_error_free, ref(error)); gboolean succeeded = g_shell_parse_argv(openvrml_gtkplug_cmd, *************** *** 1191,1196 **** gint * const standard_error = 0; GError * error = 0; ! scope_guard error_guard = ! make_guard<void (*)(GError *), GError * &>(g_error_free, error); gboolean succeeded = g_spawn_async_with_pipes(working_dir, argv, --- 1190,1194 ---- 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, argv, |
From: Braden M. <br...@us...> - 2007-01-03 23:08:18
|
Update of /cvsroot/openvrml/openvrml/src/libopenvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv21011/src/libopenvrml Modified Files: Tag: OpenVRML-0_16-BRANCH private.h Log Message: On second thought, retaining copies in the guard_impl is really the only safe thing to do (in the event someone wants to invoke make_guard with temporaries). The case where this is not desirable can be solved by using boost::ref in the call to make_guard. Index: private.h =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/private.h,v retrieving revision 1.11.2.2 retrieving revision 1.11.2.3 diff -C2 -d -r1.11.2.2 -r1.11.2.3 *** private.h 2 Jan 2007 00:07:29 -0000 1.11.2.2 --- private.h 3 Jan 2007 23:08:17 -0000 1.11.2.3 *************** *** 191,195 **** class OPENVRML_LOCAL scope_guard_impl1 : public scope_guard_impl_base { Function function; ! const Param & param; public: --- 191,195 ---- class OPENVRML_LOCAL scope_guard_impl1 : public scope_guard_impl_base { Function function; ! const Param param; public: *************** *** 224,230 **** class OPENVRML_LOCAL scope_guard_impl3 : public scope_guard_impl_base { Function function; ! const Param1 & param1; ! const Param2 & param2; ! const Param3 & param3; public: --- 224,230 ---- class OPENVRML_LOCAL scope_guard_impl3 : public scope_guard_impl_base { Function function; ! const Param1 param1; ! const Param2 param2; ! const Param3 param3; public: *************** *** 315,319 **** Object & obj; MemberFunction mem_fun; ! const Param & param; public: --- 315,319 ---- Object & obj; MemberFunction mem_fun; ! const Param param; public: |
From: Braden M. <br...@us...> - 2007-01-03 17:03:47
|
Update of /cvsroot/openvrml/openvrml/m4 In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv2581/m4 Modified Files: jdk.m4 Log Message: Removed obsolete commented-out macro. Index: jdk.m4 =================================================================== RCS file: /cvsroot/openvrml/openvrml/m4/jdk.m4,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** jdk.m4 27 Apr 2006 04:45:56 -0000 1.4 --- jdk.m4 3 Jan 2007 17:03:46 -0000 1.5 *************** *** 88,94 **** fi ]) - - dnl AC_DEFUN([OV_PROG_JAVADOC], - dnl [AC_REQUIRE([OV_WITH_JDK])dnl - dnl AC_ARG_VAR([JAVADOC], [Java API documentation generator])dnl - dnl ]) --- 88,89 ---- |
From: Braden M. <br...@us...> - 2007-01-03 17:03:47
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv2581 Modified Files: ChangeLog Log Message: Removed obsolete commented-out macro. Index: ChangeLog =================================================================== RCS file: /cvsroot/openvrml/openvrml/ChangeLog,v retrieving revision 1.1407 retrieving revision 1.1408 diff -C2 -d -r1.1407 -r1.1408 *** ChangeLog 2 Jan 2007 03:57:28 -0000 1.1407 --- ChangeLog 3 Jan 2007 17:03:45 -0000 1.1408 *************** *** 1,2 **** --- 1,6 ---- + 2007-01-03 Braden McDaniel <br...@en...> + + * m4/jdk.m4: Removed obsolete commented-out macro. + 2007-01-01 Braden McDaniel <br...@en...> |
From: Braden M. <br...@us...> - 2007-01-03 17:03:01
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv2105 Modified Files: Tag: OpenVRML-0_16-BRANCH ChangeLog Log Message: Removed obsolete commented-out macro. Index: ChangeLog =================================================================== RCS file: /cvsroot/openvrml/openvrml/ChangeLog,v retrieving revision 1.1310.2.84 retrieving revision 1.1310.2.85 diff -C2 -d -r1.1310.2.84 -r1.1310.2.85 *** ChangeLog 2 Jan 2007 03:54:39 -0000 1.1310.2.84 --- ChangeLog 3 Jan 2007 17:02:53 -0000 1.1310.2.85 *************** *** 1,2 **** --- 1,6 ---- + 2007-01-03 Braden McDaniel <br...@en...> + + * m4/jdk.m4: Removed obsolete commented-out macro. + 2007-01-01 Braden McDaniel <br...@en...> |
From: Braden M. <br...@us...> - 2007-01-03 17:02:59
|
Update of /cvsroot/openvrml/openvrml/m4 In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv2105/m4 Modified Files: Tag: OpenVRML-0_16-BRANCH jdk.m4 Log Message: Removed obsolete commented-out macro. Index: jdk.m4 =================================================================== RCS file: /cvsroot/openvrml/openvrml/m4/jdk.m4,v retrieving revision 1.4 retrieving revision 1.4.2.1 diff -C2 -d -r1.4 -r1.4.2.1 *** jdk.m4 27 Apr 2006 04:45:56 -0000 1.4 --- jdk.m4 3 Jan 2007 17:02:56 -0000 1.4.2.1 *************** *** 88,94 **** fi ]) - - dnl AC_DEFUN([OV_PROG_JAVADOC], - dnl [AC_REQUIRE([OV_WITH_JDK])dnl - dnl AC_ARG_VAR([JAVADOC], [Java API documentation generator])dnl - dnl ]) --- 88,89 ---- |
From: Braden M. <br...@us...> - 2007-01-02 03:57:34
|
Update of /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv8999/src/libopenvrml/openvrml Modified Files: vrml97node.cpp Log Message: Factored platform-specific code in text_node::update_face into its own function. Index: vrml97node.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml/openvrml/vrml97node.cpp,v retrieving revision 1.117 retrieving revision 1.118 diff -C2 -d -r1.117 -r1.118 *** vrml97node.cpp 2 Jan 2007 00:08:33 -0000 1.117 --- vrml97node.cpp 2 Jan 2007 03:57:28 -0000 1.118 *************** *** 22890,22893 **** --- 22890,23101 ---- }; + typedef std::basic_string<unsigned char, unsigned_char_traits> + unsigned_char_string; + + OPENVRML_LOCAL void + get_font_filename(const std::vector<std::string> & family, + const std::string & style, + const unsigned_char_string & language, + std::vector<char> & filename, + FT_Long & face_index) + { + using std::vector; + # ifdef _WIN32 + LOGFONT lf; + lf.lfHeight = 0; + lf.lfWidth = 0; + lf.lfEscapement = 0; + lf.lfOrientation = 0; + lf.lfWeight = FW_MEDIUM; + lf.lfItalic = FALSE; + lf.lfUnderline = FALSE; + lf.lfStrikeOut = FALSE; + lf.lfCharSet = DEFAULT_CHARSET; + lf.lfOutPrecision = OUT_TT_ONLY_PRECIS; + lf.lfClipPrecision = CLIP_DEFAULT_PRECIS; + lf.lfQuality = DEFAULT_QUALITY; + lf.lfPitchAndFamily = VARIABLE_PITCH | FF_ROMAN; + + HDC hdc = CreateCompatibleDC(0); + scope_guard hdc_guard = make_guard(&DeleteDC, hdc); + HFONT hfont = CreateFontIndirect(&lf); + SelectObject(hdc, hfont); + TCHAR faceName[256] = {}; + GetTextFace(hdc, sizeof faceName / sizeof (TCHAR), faceName); + const int faceNameLen = lstrlen(faceName); + + // + // Get the fonts folder. + // + TCHAR fontsPath[MAX_PATH]; + HRESULT status = + SHGetFolderPath(NULL, CSIDL_FONTS, NULL, SHGFP_TYPE_CURRENT, + fontsPath); + if (FAILED(status)) { /* bail */ } + + // + // Enumerate the fonts in the registry and pick one that matches. + // + HKEY fontsKey; + LONG result = + RegOpenKeyEx( + HKEY_LOCAL_MACHINE, + "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Fonts", + 0, + KEY_READ, + &fontsKey); + if (result != ERROR_SUCCESS) { /* bail */ } + scope_guard fontsKey_guard = make_guard(&RegCloseKey, fontsKey); + + DWORD maxValueNameLen, maxValueLen; + result = RegQueryInfoKey(fontsKey, + NULL, // lpClass + NULL, // lpcClass + NULL, // lpReserved + NULL, // lpcSubKeys + NULL, // lpcMaxSubKeyLen + NULL, // lpcMaxClassLen + NULL, // lpcValues + &maxValueNameLen, + &maxValueLen, + NULL, // lpcbSecurityDescriptor + NULL); // lpftLastWriteTime + + DWORD index = 0; + vector<TCHAR> valueName(maxValueNameLen + 1); + DWORD type; + vector<BYTE> data(maxValueLen); + TCHAR fontPath[MAX_PATH] = {}; + result = ERROR_SUCCESS; + while (result != ERROR_NO_MORE_ITEMS) { + DWORD dataLength = DWORD(data.size()); + DWORD valueNameLength = DWORD(valueName.size()); + result = RegEnumValue(fontsKey, + index, + &valueName.front(), + &valueNameLength, + NULL, + &type, + &data.front(), + &dataLength); + if (result == ERROR_MORE_DATA) { + data.resize(dataLength); + continue; + } + if (result == ERROR_SUCCESS) { + if (DWORD(faceNameLen + 1) <= valueNameLength + && std::equal(faceName, faceName + faceNameLen, + valueName.begin())) { + HRESULT strcat_result = StringCchCat(fontPath, + MAX_PATH, + fontsPath); + assert(SUCCEEDED(strcat_result)); + strcat_result = StringCchCat(fontPath, MAX_PATH, "\\"); + assert(SUCCEEDED(strcat_result)); + strcat_result = + StringCchCat(fontPath, + MAX_PATH, + reinterpret_cast<STRSAFE_LPCSTR>( + &data.front())); + assert(SUCCEEDED(strcat_result)); + break; + } + ++index; + } + } + + const size_t fontPathLen = lstrlen(fontPath); + assert(fontPathLen != 0); + filename.assign(fontPath, fontPath + fontPathLen + 1); + face_index = 0; + # else + using std::string; + + string fontName; + // + // Set the family. + // + for (size_t i = 0; i < family.size(); ++i) { + const string & element = family[i]; + if (element == "SERIF") { + fontName += "serif"; + } else if (element == "SANS") { + fontName += "sans"; + } else if (element == "TYPEWRITER") { + fontName += "monospace"; + } else { + fontName += element; + } + if (i + 1 < family.size()) { fontName += ", "; } + } + + // + // Set the weight. + // + if (style.find("BOLD") != string::npos) { + fontName += ":bold"; + } + + // + // Set the slant. + // + if (style.find("ITALIC") != string::npos) { + fontName += ":italic"; + } + + // + // For now, at least, we only want outline fonts. + // + fontName += ":outline=True"; + + FcPattern * const initialPattern = + FcNameParse(unsigned_char_string(fontName.begin(), + fontName.end()).c_str()); + if (!initialPattern) { throw std::bad_alloc(); } + scope_guard initialPattern_guard = + make_guard(&FcPatternDestroy, initialPattern); + boost::ignore_unused_variable_warning(initialPattern_guard); + + // + // Set the language. + // + if (!language.empty()) { + FcPatternAddString(initialPattern, + FC_LANG, + language.c_str()); + } + + FcConfigSubstitute(0, initialPattern, FcMatchPattern); + FcDefaultSubstitute(initialPattern); + + FcResult result = FcResultMatch; + FcPattern * const matchedPattern = + FcFontMatch(0, initialPattern, &result); + if (result != FcResultMatch) { throw FontconfigError(result); } + assert(matchedPattern); + scope_guard matchedPattern_guard = + make_guard(&FcPatternDestroy, matchedPattern); + boost::ignore_unused_variable_warning(matchedPattern_guard); + + FcChar8 * filename_c_str = 0; + result = FcPatternGetString(matchedPattern, + FC_FILE, + 0, + &filename_c_str); + if (result != FcResultMatch) { throw FontconfigError(result); } + + size_t filenameLen = 0; + for (; filename_c_str[filenameLen]; ++filenameLen) {} + + filename.assign(filename_c_str, filename_c_str + filenameLen + 1); + + int face_index_int = 0; + result = FcPatternGetInteger(matchedPattern, FC_INDEX, 0, + &face_index_int); + if (result != FcResultMatch) { throw FontconfigError(result); } + face_index = FT_Long(face_index_int); + # endif + } + # endif // OPENVRML_ENABLE_RENDER_TEXT_NODE *************** *** 22901,22906 **** # ifdef OPENVRML_ENABLE_RENDER_TEXT_NODE using std::string; - typedef std::basic_string<unsigned char, unsigned_char_traits> - unsigned_char_string; unsigned_char_string language; --- 23109,23112 ---- *************** *** 22924,23125 **** try { ! # ifdef _WIN32 ! LOGFONT lf; ! lf.lfHeight = 0; ! lf.lfWidth = 0; ! lf.lfEscapement = 0; ! lf.lfOrientation = 0; ! lf.lfWeight = FW_MEDIUM; ! lf.lfItalic = FALSE; ! lf.lfUnderline = FALSE; ! lf.lfStrikeOut = FALSE; ! lf.lfCharSet = DEFAULT_CHARSET; ! lf.lfOutPrecision = OUT_TT_ONLY_PRECIS; ! lf.lfClipPrecision = CLIP_DEFAULT_PRECIS; ! lf.lfQuality = DEFAULT_QUALITY; ! lf.lfPitchAndFamily = VARIABLE_PITCH | FF_ROMAN; ! ! HDC hdc = CreateCompatibleDC(0); ! scope_guard hdc_guard = make_guard(&DeleteDC, hdc); ! HFONT hfont = CreateFontIndirect(&lf); ! SelectObject(hdc, hfont); ! TCHAR faceName[256] = {}; ! GetTextFace(hdc, sizeof faceName / sizeof (TCHAR), faceName); ! const int faceNameLen = lstrlen(faceName); ! ! // ! // Get the fonts folder. ! // ! TCHAR fontsPath[MAX_PATH]; ! HRESULT status = ! SHGetFolderPath(NULL, CSIDL_FONTS, NULL, SHGFP_TYPE_CURRENT, ! fontsPath); ! if (FAILED(status)) { /* bail */ } ! ! // ! // Enumerate the fonts in the registry and pick one that matches. ! // ! HKEY fontsKey; ! LONG result = ! RegOpenKeyEx( ! HKEY_LOCAL_MACHINE, ! "SOFTWARE\\Microsoft\\Windows NT\\CurrentVersion\\Fonts", ! 0, ! KEY_READ, ! &fontsKey); ! if (result != ERROR_SUCCESS) { /* bail */ } ! scope_guard fontsKey_guard = make_guard(&RegCloseKey, fontsKey); ! ! DWORD maxValueNameLen, maxValueLen; ! result = RegQueryInfoKey(fontsKey, ! NULL, // lpClass ! NULL, // lpcClass ! NULL, // lpReserved ! NULL, // lpcSubKeys ! NULL, // lpcMaxSubKeyLen ! NULL, // lpcMaxClassLen ! NULL, // lpcValues ! &maxValueNameLen, ! &maxValueLen, ! NULL, // lpcbSecurityDescriptor ! NULL); // lpftLastWriteTime ! ! DWORD index = 0; ! std::vector<TCHAR> valueName(maxValueNameLen + 1); ! DWORD type; ! std::vector<BYTE> data(maxValueLen); ! TCHAR fontPath[MAX_PATH] = {}; ! result = ERROR_SUCCESS; ! while (result != ERROR_NO_MORE_ITEMS) { ! DWORD dataLength = DWORD(data.size()); ! DWORD valueNameLength = DWORD(valueName.size()); ! result = RegEnumValue(fontsKey, ! index, ! &valueName.front(), ! &valueNameLength, ! NULL, ! &type, ! &data.front(), ! &dataLength); ! if (result == ERROR_MORE_DATA) { ! data.resize(dataLength); ! continue; ! } ! if (result == ERROR_SUCCESS) { ! if (DWORD(faceNameLen + 1) <= valueNameLength ! && std::equal(faceName, faceName + faceNameLen, ! valueName.begin())) { ! HRESULT strcat_result = StringCchCat(fontPath, ! MAX_PATH, ! fontsPath); ! assert(SUCCEEDED(strcat_result)); ! strcat_result = StringCchCat(fontPath, ! MAX_PATH, ! "\\"); ! assert(SUCCEEDED(strcat_result)); ! strcat_result = ! StringCchCat(fontPath, ! MAX_PATH, ! reinterpret_cast<STRSAFE_LPCSTR>( ! &data.front())); ! assert(SUCCEEDED(strcat_result)); ! break; ! } ! ++index; ! } ! } ! ! const size_t fontPathLen = lstrlen(fontPath); ! assert(fontPathLen != 0); ! const std::vector<char> ftFilename(fontPath, ! fontPath + fontPathLen + 1); ! const FT_Long face_index = 0; ! # else // Everybody else use fontconfig. ! using std::vector; ! ! string fontName; ! // ! // Set the family. ! // ! for (size_t i = 0; i < family.size(); ++i) { ! const std::string & element = family[i]; ! if (element == "SERIF") { ! fontName += "serif"; ! } else if (element == "SANS") { ! fontName += "sans"; ! } else if (element == "TYPEWRITER") { ! fontName += "monospace"; ! } else { ! fontName += element; ! } ! if (i + 1 < family.size()) { fontName += ", "; } ! } ! ! // ! // Set the weight. ! // ! if (style.find("BOLD") != string::npos) { ! fontName += ":bold"; ! } ! ! // ! // Set the slant. ! // ! if (style.find("ITALIC") != string::npos) { ! fontName += ":italic"; ! } ! ! // ! // For now, at least, we only want outline fonts. ! // ! fontName += ":outline=True"; ! ! FcPattern * const initialPattern = ! FcNameParse(unsigned_char_string(fontName.begin(), ! fontName.end()).c_str()); ! if (!initialPattern) { throw std::bad_alloc(); } ! scope_guard initialPattern_guard = ! make_guard(&FcPatternDestroy, initialPattern); ! boost::ignore_unused_variable_warning(initialPattern_guard); ! ! // ! // Set the language. ! // ! if (!language.empty()) { ! FcPatternAddString(initialPattern, ! FC_LANG, ! language.c_str()); ! } ! ! FcConfigSubstitute(0, initialPattern, FcMatchPattern); ! FcDefaultSubstitute(initialPattern); ! ! FcResult result = FcResultMatch; ! FcPattern * const matchedPattern = ! FcFontMatch(0, initialPattern, &result); ! if (result != FcResultMatch) { throw FontconfigError(result); } ! assert(matchedPattern); ! scope_guard matchedPattern_guard = ! make_guard(&FcPatternDestroy, matchedPattern); ! boost::ignore_unused_variable_warning(matchedPattern_guard); ! ! FcChar8 * filename = 0; ! result = FcPatternGetString(matchedPattern, ! FC_FILE, ! 0, ! &filename); ! if (result != FcResultMatch) { throw FontconfigError(result); } ! ! int face_index = 0; ! result = FcPatternGetInteger(matchedPattern, FC_INDEX, 0, ! &face_index); ! if (result != FcResultMatch) { throw FontconfigError(result); } ! ! size_t filenameLen = 0; ! for (; filename[filenameLen]; ++filenameLen) {} - const vector<char> ftFilename(filename, - filename + filenameLen + 1); - # endif // ifdef _WIN32 text_metatype & nodeClass = const_cast<text_metatype &>( --- 23130,23137 ---- try { ! std::vector<char> ftFilename; ! FT_Long face_index; ! get_font_filename(family, style, language, ftFilename, face_index); text_metatype & nodeClass = const_cast<text_metatype &>( |
From: Braden M. <br...@us...> - 2007-01-02 03:57:34
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv8999 Modified Files: ChangeLog Log Message: Factored platform-specific code in text_node::update_face into its own function. Index: ChangeLog =================================================================== RCS file: /cvsroot/openvrml/openvrml/ChangeLog,v retrieving revision 1.1406 retrieving revision 1.1407 diff -C2 -d -r1.1406 -r1.1407 *** ChangeLog 2 Jan 2007 00:08:33 -0000 1.1406 --- ChangeLog 2 Jan 2007 03:57:28 -0000 1.1407 *************** *** 1,4 **** --- 1,17 ---- 2007-01-01 Braden McDaniel <br...@en...> + Factored platform-specific code in text_node::update_face into its + own function. + + * src/libopenvrml/openvrml/vrml97node.cpp + (get_font_filename(const std::vector<std::string> &, const + std::string &, const unsigned_char_string &, std::vector<char> &, + FT_Long &)): Get the font file name and face index. This code was + factored out of text_node::update_face. + (text_node::update_face()): Factored platform-specifc code to get + the font filename to get_font_filaname. + + 2007-01-01 Braden McDaniel <br...@en...> + ScopeGuard as initially described by Alexandrescu and Marginean copies the callback function parameters to the guard |