| 
      
      
      From: <br...@us...> - 2008-07-17 04:48:41
       | 
| Revision: 3489
          http://openvrml.svn.sourceforge.net/openvrml/?rev=3489&view=rev
Author:   braden
Date:     2008-07-17 04:48:50 +0000 (Thu, 17 Jul 2008)
Log Message:
-----------
Added a comment to note that no translation of URI-encoded characters is being done.
Modified Paths:
--------------
    trunk/ChangeLog
    trunk/examples/sdl_viewer.cpp
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2008-06-28 03:48:00 UTC (rev 3488)
+++ trunk/ChangeLog	2008-07-17 04:48:50 UTC (rev 3489)
@@ -1,3 +1,9 @@
+2008-07-16 Braden McDaniel  <br...@en...>
+
+	* examples/sdl_viewer.cpp (resource_fetcher::do_get_resource(const
+	std::string &)): Added a comment to note that no translation of
+	URI-encoded characters is being done.
+
 2008-06-27 Braden McDaniel  <br...@en...>
 
 	Added parentheses to quell warnings from gcc 4.3.
Modified: trunk/examples/sdl_viewer.cpp
===================================================================
--- trunk/examples/sdl_viewer.cpp	2008-06-28 03:48:00 UTC (rev 3488)
+++ trunk/examples/sdl_viewer.cpp	2008-07-17 04:48:50 UTC (rev 3489)
@@ -221,6 +221,10 @@
         // should confirm that it is localhost, the machine name, or zero
         // length.
         //
+        // We also don't do any translation of URI-encoded characters here.
+        // That means that things like paths with spaces in them aren't going
+        // to work.  Oh, well.
+        //
         string::size_type path_start_index =
 # ifdef _WIN32
             uri.find_first_of('/', authority_start_index) + 1;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 | 
| 
      
      
      From: <br...@us...> - 2008-07-20 06:41:31
       | 
| Revision: 3490
          http://openvrml.svn.sourceforge.net/openvrml/?rev=3490&view=rev
Author:   braden
Date:     2008-07-20 06:41:31 +0000 (Sun, 20 Jul 2008)
Log Message:
-----------
Apply OPENVRML_API to symbols that libglade needs.
Modified Paths:
--------------
    trunk/ChangeLog
    trunk/src/openvrml-player/player.cpp
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2008-07-17 04:48:50 UTC (rev 3489)
+++ trunk/ChangeLog	2008-07-20 06:41:31 UTC (rev 3490)
@@ -1,3 +1,8 @@
+2008-07-20 Braden McDaniel  <br...@en...>
+
+	* src/openvrml-player/player.cpp: Apply OPENVRML_API to symbols
+	that libglade needs.
+
 2008-07-16 Braden McDaniel  <br...@en...>
 
 	* examples/sdl_viewer.cpp (resource_fetcher::do_get_resource(const
Modified: trunk/src/openvrml-player/player.cpp
===================================================================
--- trunk/src/openvrml-player/player.cpp	2008-07-17 04:48:50 UTC (rev 3489)
+++ trunk/src/openvrml-player/player.cpp	2008-07-20 06:41:31 UTC (rev 3490)
@@ -46,14 +46,16 @@
     // GTK+ signal handlers; libglade needs them to have external linkage in
     // order to connect them.
     //
-    void openvrml_player_on_about_activated(GtkWindow * window);
-    void openvrml_player_on_file_open_activated(
+    OPENVRML_API void openvrml_player_on_about_activated(GtkWindow * window);
+    OPENVRML_API void openvrml_player_on_file_open_activated(
         OpenvrmlPlayerFileChooserDialog * dialog);
-    void openvrml_player_on_locationentry_activated(GtkEntry * entry);
-    void openvrml_player_on_filechooserdialog_response(GtkDialog * dialog,
-                                                       gint arg1,
-                                                       gpointer user_data);
-    void openvrml_player_quit();
+    OPENVRML_API void
+    openvrml_player_on_locationentry_activated(GtkEntry * entry);
+    OPENVRML_API void
+    openvrml_player_on_filechooserdialog_response(GtkDialog * dialog,
+                                                  gint arg1,
+                                                  gpointer user_data);
+    OPENVRML_API void openvrml_player_quit();
 
     //
     // The following functions are 'extern "C"' because they get passed as
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 | 
| 
      
      
      From: <br...@us...> - 2008-07-23 06:49:28
       | 
| Revision: 3495
          http://openvrml.svn.sourceforge.net/openvrml/?rev=3495&view=rev
Author:   braden
Date:     2008-07-23 06:49:36 +0000 (Wed, 23 Jul 2008)
Log Message:
-----------
Use GtkBuilder in openvrml-player instead of libglade.  Note that this changes the environment variable used to locate the UI definition from OPENVRML_PLAYER_GLADEDIR to OPENVRML_PLAYER_UIDIR.
Modified Paths:
--------------
    trunk/ChangeLog
    trunk/configure.ac
    trunk/src/Makefile.am
    trunk/src/openvrml-player/filechooserdialog.cpp
    trunk/src/openvrml-player/filechooserdialog.h
    trunk/src/openvrml-player/player.cpp
Added Paths:
-----------
    trunk/src/openvrml-player/openvrml-player.ui
Removed Paths:
-------------
    trunk/src/openvrml-player/openvrml-player.glade
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2008-07-20 09:43:51 UTC (rev 3494)
+++ trunk/ChangeLog	2008-07-23 06:49:36 UTC (rev 3495)
@@ -1,3 +1,56 @@
+2008-07-23 Braden McDaniel  <br...@en...>
+
+	Use GtkBuilder in openvrml-player instead of libglade.  Note that
+	this changes the environment variable used to locate the UI
+	definition from OPENVRML_PLAYER_GLADEDIR to OPENVRML_PLAYER_UIDIR.
+
+	* configure.ac: Removed check for libglade; require gtk+-2.0 >=
+	2.12.
+	* src/Makefile.am
+	(openvrml_player_openvrml_player_CXXFLAGS): Removed GLADE_CFLAGS.
+	(openvrml_player_openvrml_player_LDFLAGS): Removed GLADE_LIBS.
+	(openvrml_player_gladedir): Removed; replaced with
+	openvrml_player_uidir.
+	(openvrml_player_glade_DATA): Removed; replaced with
+	openvrml_player_ui_DATA.
+	(openvrml_player_uidir): Added.
+	(openvrml_player_ui_DATA): Added.
+	(EXTRA_DIST): Distribute openvrml_player_ui_DATA files.
+	* src/openvrml-player/filechooserdialog.cpp
+	(openvrml_player_file_chooser_dialog_get_type()): Removed; use
+	definition provided by G_DEFINE_TYPE instead.
+	(openvrml_player_file_chooser_dialog_new(GtkWindow *)): Removed;
+	logic moved to constructor.
+	(constructor(GType, guint, GObjectConstructParam *)): Moved dialog
+	setup logic here.
+	(class_init(gpointer, gpointer)): Moved to
+	openvrml_player_file_chooser_dialog_class_init (because
+	G_DEFINE_TYPE wants the long name).
+	(init(GTypeInstance *, gpointer)): Moved to
+	openvrml_player_file_chooser_dialog_init (because G_DEFINE_TYPE
+	wants the long name).
+	(openvrml_player_file_chooser_dialog_class_init(OpenvrmlPlayerFileChooserDialogClass *)):
+	Specify the constructor function.
+	(openvrml_player_file_chooser_dialog_init(OpenvrmlPlayerFileChooserDialog *)):
+	Added.
+	* src/openvrml-player/filechooserdialog.h
+	(openvrml_player_file_chooser_dialog_new(GtkWindow *)): Removed.
+	* src/openvrml-player/openvrml-player.glade: Removed.
+	* src/openvrml-player/openvrml-player.ui: Added.
+	* src/openvrml-player/player.cpp
+	(main(int, char *[])): Removed calls to glade_init and
+	glade_register_widget; create a GtkBuilder instead of GladeXML;
+	call gtk_builder_connect_signals instead of
+	glade_xml_signal_autoconnect; call gtk_builder_get_object instead
+	of glade_xml_get_widget.
+	(xml_new(GnomeProgram &)): Removed; replaced with builder_new.
+	(builder_new(GnomeProgram &, GError **)): Create a GtkBuilder from
+	openvrml-player.ui.  Use the environment variable
+	OPENVRML_PLAYER_UIDIR to locate this file if it is not in a known
+	location.
+	(openvrml_player_build_file_chooser_dialog(GladeXML *, GType,
+	GladeWidgetInfo *)): Removed.
+
 2008-07-20 Braden McDaniel  <br...@en...>
 
 	* src/openvrml-player/player.cpp: Apply OPENVRML_API to symbols
Modified: trunk/configure.ac
===================================================================
--- trunk/configure.ac	2008-07-20 09:43:51 UTC (rev 3494)
+++ trunk/configure.ac	2008-07-23 06:49:36 UTC (rev 3495)
@@ -160,9 +160,10 @@
 # openvrml-xembed and openvrml-player both use GOption, which was
 # introduced in GLib 2.6.
 #
-PKG_CHECK_MODULES([GTK], [gtk+-2.0 gthread-2.0 glib-2.0 >= 2.6], ,
+# openvrml-player uses GtkBuilder, which was introduced in GTK+ 2.12.
+#
+PKG_CHECK_MODULES([GTK], [gtk+-2.0 >= 2.12 gthread-2.0 glib-2.0 >= 2.6], ,
                   [have_gtk=no])
-PKG_CHECK_MODULES([GLADE], [libglade-2.0], , [have_libglade=no])
 #
 # openvrml-player uses GNOME_PARAM_GOPTION_CONTEXT, which was
 # introduced in libgnome 2.14.
Modified: trunk/src/Makefile.am
===================================================================
--- trunk/src/Makefile.am	2008-07-20 09:43:51 UTC (rev 3494)
+++ trunk/src/Makefile.am	2008-07-23 06:49:36 UTC (rev 3495)
@@ -360,16 +360,14 @@
         -I$(srcdir)/libopenvrml
 openvrml_player_openvrml_player_CXXFLAGS = \
         $(GNOMEUI_CFLAGS) \
-        $(GLADE_CFLAGS) \
         $(CURL_CFLAGS)
 openvrml_player_openvrml_player_LDFLAGS = \
         -export-dynamic \
         $(GNOMEUI_LIBS) \
-        $(GLADE_LIBS) \
         $(CURL_LIBS)
 
-openvrml_player_gladedir = $(datadir)/openvrml-player/glade
-openvrml_player_glade_DATA = openvrml-player/openvrml-player.glade
+openvrml_player_uidir = $(datadir)/openvrml-player/ui
+openvrml_player_ui_DATA = openvrml-player/openvrml-player.ui
 
 openvrml_player_openvrml_player_SOURCES = \
         openvrml-player/filechooserdialog.cpp \
@@ -379,7 +377,7 @@
 EXTRA_DIST = \
         libopenvrml/openvrml-config.h.in \
         libopenvrml-gl/openvrml-gl-config.h.in \
-        $(openvrml_player_glade_DATA)
+        $(openvrml_player_ui_DATA)
 
 #
 # Automake 1.10 seems to need this for distcheck to work.
Modified: trunk/src/openvrml-player/filechooserdialog.cpp
===================================================================
--- trunk/src/openvrml-player/filechooserdialog.cpp	2008-07-20 09:43:51 UTC (rev 3494)
+++ trunk/src/openvrml-player/filechooserdialog.cpp	2008-07-23 06:49:36 UTC (rev 3495)
@@ -23,90 +23,83 @@
 
 using namespace boost::multi_index::detail; // for scope_guard
 
+G_DEFINE_TYPE(OpenvrmlPlayerFileChooserDialog,
+                        openvrml_player_file_chooser_dialog,
+                        GTK_TYPE_FILE_CHOOSER_DIALOG)
+
 namespace {
-    G_GNUC_INTERNAL void class_init(gpointer g_class, gpointer class_data);
-    G_GNUC_INTERNAL void init(GTypeInstance * instance, gpointer g_class);
-}
 
-GtkType openvrml_player_file_chooser_dialog_get_type()
-{
-    static GtkType type = 0;
+    G_GNUC_INTERNAL GObject *
+    constructor(GType type,
+                guint n_construct_properties,
+                GObjectConstructParam * construct_properties)
+    {
+        GObject * obj;
+        {
+            // Invoke parent constructor.
+            OpenvrmlPlayerFileChooserDialogClass * klass =
+                OPENVRML_PLAYER_FILE_CHOOSER_DIALOG_CLASS(
+                    g_type_class_peek(
+                        OPENVRML_PLAYER_TYPE_FILE_CHOOSER_DIALOG));
+            GObjectClass * parent_class =
+                G_OBJECT_CLASS(g_type_class_peek_parent(klass));
+            obj = parent_class->constructor(type,
+                                            n_construct_properties,
+                                            construct_properties);
+        }
 
-    if (G_UNLIKELY(!type)) {
-        type =
-            g_type_register_static_simple(
-                GTK_TYPE_FILE_CHOOSER_DIALOG,
-                "OpenvrmlPlayerFileChooserDialog",
-                sizeof (OpenvrmlPlayerFileChooserDialogClass),
-                class_init,
-                sizeof (OpenvrmlPlayerFileChooserDialog),
-                init,
-                GTypeFlags(0));
-    }
-    return type;
-}
+        GValue title = {};
+        g_value_init(&title, G_TYPE_STRING);
+        g_value_set_string(&title, "Open");
+        g_object_set_property(obj, "title", &title);
+        GValue action = {};
+        g_value_init(&action, G_TYPE_UINT);
+        g_value_set_uint(&action, GTK_FILE_CHOOSER_ACTION_OPEN);
+        g_object_set_property(obj, "action", &action);
 
-GtkWidget * openvrml_player_file_chooser_dialog_new(GtkWindow * parent)
-{
-    GtkWidget * const dialog =
-        static_cast<GtkWidget *>(
-            g_object_new(OPENVRML_PLAYER_TYPE_FILE_CHOOSER_DIALOG,
-                         "title", "Open",
-			 "action", GTK_FILE_CHOOSER_ACTION_OPEN,
-                         NULL));
-    scope_guard dialog_guard = make_guard(g_object_unref, dialog);
-    boost::ignore_unused_variable_warning(dialog_guard);
+        gtk_dialog_add_buttons(GTK_DIALOG(obj),
+                               GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
+                               GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT,
+                               NULL);
 
-    if (parent) {
-        gtk_window_set_transient_for(GTK_WINDOW(dialog), parent);
-    }
+        gtk_dialog_set_default_response(GTK_DIALOG(obj),
+                                        GTK_RESPONSE_ACCEPT);
 
-    gtk_dialog_add_buttons(GTK_DIALOG(dialog),
-                           GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
-                           GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT,
-                           NULL);
+        GtkFileFilter * const world_filter = gtk_file_filter_new();
+        g_return_val_if_fail(world_filter, 0);
+        scope_guard world_filter_guard = make_guard(g_object_unref,
+                                                    world_filter);
+        boost::ignore_unused_variable_warning(world_filter_guard);
+        gtk_file_filter_set_name(world_filter, "VRML/X3D worlds");
+        gtk_file_filter_add_mime_type(world_filter, "x-world/x-vrml");
+        gtk_file_filter_add_mime_type(world_filter, "model/vrml");
+        gtk_file_filter_add_mime_type(world_filter, "model/x3d+vrml");
 
-    gtk_dialog_set_default_response(GTK_DIALOG(dialog),
-                                    GTK_RESPONSE_ACCEPT);
+        gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(obj), world_filter);
+        world_filter_guard.dismiss();
 
-    GtkFileFilter * const world_filter = gtk_file_filter_new();
-    g_return_val_if_fail(world_filter, 0);
-    scope_guard world_filter_guard = make_guard(g_object_unref, world_filter);
-    boost::ignore_unused_variable_warning(world_filter_guard);
-    gtk_file_filter_set_name(world_filter, "VRML/X3D worlds");
-    gtk_file_filter_add_mime_type(world_filter, "x-world/x-vrml");
-    gtk_file_filter_add_mime_type(world_filter, "model/vrml");
-    gtk_file_filter_add_mime_type(world_filter, "model/x3d+vrml");
+        GtkFileFilter * const all_filter = gtk_file_filter_new();
+        g_return_val_if_fail(all_filter, 0);
+        scope_guard all_filter_guard = make_guard(g_object_unref, all_filter);
+        boost::ignore_unused_variable_warning(all_filter_guard);
+        gtk_file_filter_set_name(all_filter, "All files");
+        gtk_file_filter_add_pattern(all_filter, "*");
 
-    gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(dialog), world_filter);
-    world_filter_guard.dismiss();
+        gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(obj), all_filter);
+        all_filter_guard.dismiss();
 
-    GtkFileFilter * const all_filter = gtk_file_filter_new();
-    g_return_val_if_fail(all_filter, 0);
-    scope_guard all_filter_guard = make_guard(g_object_unref, all_filter);
-    boost::ignore_unused_variable_warning(all_filter_guard);
-    gtk_file_filter_set_name(all_filter, "All files");
-    gtk_file_filter_add_pattern(all_filter, "*");
-
-    gtk_file_chooser_add_filter(GTK_FILE_CHOOSER(dialog), all_filter);
-    all_filter_guard.dismiss();
-
-    dialog_guard.dismiss();
-
-    return dialog;
+        return obj;
+    }
 }
 
-namespace {
-
-    G_GNUC_INTERNAL GtkWidgetClass * parent_class;
-
-    void class_init(const gpointer g_class, gpointer /* class_data */)
-    {
-        ::parent_class =
-            static_cast<GtkWidgetClass *>(
-                g_type_class_peek_parent(G_OBJECT_CLASS(g_class)));
-    }
-
-    void init(GTypeInstance * /* instance */, gpointer /* g_class */)
-    {}
+void
+openvrml_player_file_chooser_dialog_class_init(
+    OpenvrmlPlayerFileChooserDialogClass * const klass)
+{
+    G_OBJECT_CLASS(klass)->constructor = constructor;
 }
+
+void
+openvrml_player_file_chooser_dialog_init(
+    OpenvrmlPlayerFileChooserDialog * dialog)
+{}
Modified: trunk/src/openvrml-player/filechooserdialog.h
===================================================================
--- trunk/src/openvrml-player/filechooserdialog.h	2008-07-20 09:43:51 UTC (rev 3494)
+++ trunk/src/openvrml-player/filechooserdialog.h	2008-07-23 06:49:36 UTC (rev 3495)
@@ -43,7 +43,6 @@
 };
 
 GType openvrml_player_file_chooser_dialog_get_type() G_GNUC_CONST;
-GtkWidget * openvrml_player_file_chooser_dialog_new(GtkWindow * parent);
 
 G_END_DECLS
 
Deleted: trunk/src/openvrml-player/openvrml-player.glade
===================================================================
--- trunk/src/openvrml-player/openvrml-player.glade	2008-07-20 09:43:51 UTC (rev 3494)
+++ trunk/src/openvrml-player/openvrml-player.glade	2008-07-23 06:49:36 UTC (rev 3495)
@@ -1,111 +0,0 @@
-<?xml version="1.0" encoding="UTF-8" standalone="no"?>
-<!DOCTYPE glade-interface SYSTEM "glade-2.0.dtd">
-<glade-interface>
-  <widget class="GtkWindow" id="window">
-    <property name="default-width">640</property>
-    <property name="default-height">480</property>
-    <signal name="delete-event" handler="openvrml_player_quit"/>
-    <child>
-      <widget class="GtkVBox" id="vbox1">
-        <property name="visible">True</property>
-        <child>
-          <widget class="GtkMenuBar" id="menubar1">
-            <property name="visible">True</property>
-            <child>
-              <widget class="GtkMenuItem" id="menuitem1">
-                <property name="visible">True</property>
-                <property name="label" translatable="yes">_File</property>
-                <property name="use_underline">True</property>
-                <child>
-                  <widget class="GtkMenu" id="menu1">
-                    <property name="visible">True</property>
-                    <child>
-                      <widget class="GtkImageMenuItem" id="imagemenuitemopen">
-                        <property name="visible">True</property>
-                        <property name="label" translatable="yes">gtk-open</property>
-                        <property name="use_underline">True</property>
-                        <property name="use_stock">True</property>
-                        <signal name="activate" handler="openvrml_player_on_file_open_activated" object="filechooserdialog"/>
-                      </widget>
-                    </child>
-                    <child>
-                      <widget class="GtkSeparatorMenuItem" id="separatormenuitem1">
-                        <property name="visible">True</property>
-                      </widget>
-                    </child>
-                    <child>
-                      <widget class="GtkImageMenuItem" id="imagemenuitem5">
-                        <property name="visible">True</property>
-                        <property name="label" translatable="yes">gtk-quit</property>
-                        <property name="use_underline">True</property>
-                        <property name="use_stock">True</property>
-                        <signal name="activate" handler="openvrml_player_quit"/>
-                      </widget>
-                    </child>
-                  </widget>
-                </child>
-              </widget>
-            </child>
-            <child>
-              <widget class="GtkMenuItem" id="menuitem4">
-                <property name="visible">True</property>
-                <property name="label" translatable="yes">_Help</property>
-                <property name="use_underline">True</property>
-                <child>
-                  <widget class="GtkMenu" id="menu3">
-                    <property name="visible">True</property>
-                    <child>
-                      <widget class="GtkImageMenuItem" id="imagemenuitem10">
-                        <property name="visible">True</property>
-                        <property name="label" translatable="yes">gtk-about</property>
-                        <property name="use_underline">True</property>
-                        <property name="use_stock">True</property>
-                        <signal name="activate" handler="openvrml_player_on_about_activated" object="window"/>
-                      </widget>
-                    </child>
-                  </widget>
-                </child>
-              </widget>
-            </child>
-          </widget>
-          <packing>
-            <property name="expand">False</property>
-          </packing>
-        </child>
-        <child>
-          <widget class="GtkHBox" id="hbox1">
-            <property name="visible">True</property>
-            <child>
-              <widget class="GtkEntry" id="locationentry">
-                <property name="visible">True</property>
-                <signal name="activate" handler="openvrml_player_on_locationentry_activated"/>
-              </widget>
-            </child>
-          </widget>
-          <packing>
-            <property name="expand">False</property>
-            <property name="position">1</property>
-          </packing>
-        </child>
-        <child>
-          <widget class="GtkSocket" id="socket">
-            <property name="visible">True</property>
-            <property name="can-focus">True</property>
-            <property name="has-focus">True</property>
-          </widget>
-        </child>
-        <child>
-          <widget class="GtkStatusbar" id="statusbar1">
-            <property name="visible">True</property>
-          </widget>
-          <packing>
-            <property name="expand">False</property>
-            <property name="position">3</property>
-          </packing>
-        </child>
-      </widget>
-    </child>
-  </widget>
-  <widget class="OpenvrmlPlayerFileChooserDialog" id="filechooserdialog">
-  </widget>
-</glade-interface>
Added: trunk/src/openvrml-player/openvrml-player.ui
===================================================================
--- trunk/src/openvrml-player/openvrml-player.ui	                        (rev 0)
+++ trunk/src/openvrml-player/openvrml-player.ui	2008-07-23 06:49:36 UTC (rev 3495)
@@ -0,0 +1,105 @@
+<?xml version="1.0"?>
+<interface>
+  <object class="GtkUIManager" id="uimanager1">
+    <child>
+      <object class="GtkActionGroup" id="actiongroup1">
+        <child>
+          <object class="GtkAction" id="menuitem1">
+            <property name="name">menuitem1</property>
+            <property name="label" translatable="yes">_File</property>
+          </object>
+        </child>
+        <child>
+          <object class="GtkAction" id="imagemenuitemopen">
+            <property name="stock_id" translatable="yes">gtk-open</property>
+            <property name="name">imagemenuitemopen</property>
+            <signal handler="openvrml_player_on_file_open_activated" name="activate" object="filechooserdialog"/>
+          </object>
+        </child>
+        <child>
+          <object class="GtkAction" id="imagemenuitem5">
+            <property name="stock_id" translatable="yes">gtk-quit</property>
+            <property name="name">imagemenuitem5</property>
+            <signal handler="openvrml_player_quit" name="activate"/>
+          </object>
+        </child>
+        <child>
+          <object class="GtkAction" id="menuitem4">
+            <property name="name">menuitem4</property>
+            <property name="label" translatable="yes">_Help</property>
+          </object>
+        </child>
+        <child>
+          <object class="GtkAction" id="imagemenuitem10">
+            <property name="stock_id" translatable="yes">gtk-about</property>
+            <property name="name">imagemenuitem10</property>
+            <signal handler="openvrml_player_on_about_activated" name="activate" object="window"/>
+          </object>
+        </child>
+      </object>
+    </child>
+    <ui>
+      <menubar name="menubar1">
+        <menu action="menuitem1">
+          <menuitem action="imagemenuitemopen"/>
+          <separator/>
+          <menuitem action="imagemenuitem5"/>
+        </menu>
+        <menu action="menuitem4">
+          <menuitem action="imagemenuitem10"/>
+        </menu>
+      </menubar>
+    </ui>
+  </object>
+  <object class="GtkWindow" id="window">
+    <property name="default-width">640</property>
+    <property name="default-height">480</property>
+    <signal handler="openvrml_player_quit" name="delete-event"/>
+    <child>
+      <object class="GtkVBox" id="vbox1">
+        <property name="visible">True</property>
+        <child>
+          <object class="GtkMenuBar" constructor="uimanager1" id="menubar1">
+            <property name="visible">True</property>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkHBox" id="hbox1">
+            <property name="visible">True</property>
+            <child>
+              <object class="GtkEntry" id="locationentry">
+                <property name="visible">True</property>
+                <signal handler="openvrml_player_on_locationentry_activated" name="activate"/>
+              </object>
+            </child>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="position">1</property>
+          </packing>
+        </child>
+        <child>
+          <object class="GtkSocket" id="socket">
+            <property name="visible">True</property>
+            <property name="can-focus">True</property>
+            <property name="has-focus">True</property>
+          </object>
+        </child>
+        <child>
+          <object class="GtkStatusbar" id="statusbar1">
+            <property name="visible">True</property>
+          </object>
+          <packing>
+            <property name="expand">False</property>
+            <property name="position">3</property>
+          </packing>
+        </child>
+      </object>
+    </child>
+  </object>
+  <object class="OpenvrmlPlayerFileChooserDialog" id="filechooserdialog">
+  </object>
+</interface>
Modified: trunk/src/openvrml-player/player.cpp
===================================================================
--- trunk/src/openvrml-player/player.cpp	2008-07-20 09:43:51 UTC (rev 3494)
+++ trunk/src/openvrml-player/player.cpp	2008-07-23 06:49:36 UTC (rev 3495)
@@ -29,8 +29,7 @@
 # include <curl/curl.h>
 # include <libgnomevfs/gnome-vfs.h>
 # include <libgnomeui/libgnomeui.h>
-# include <glade/glade.h>
-# include <glade/glade-build.h>
+# include <gtk/gtkbuilder.h>
 # include <openvrml/browser.h>
 
 # include "filechooserdialog.h"
@@ -43,7 +42,7 @@
 
 extern "C" {
     //
-    // GTK+ signal handlers; libglade needs them to have external linkage in
+    // GTK+ signal handlers; GtkBuilder needs them to have external linkage in
     // order to connect them.
     //
     OPENVRML_API void openvrml_player_on_about_activated(GtkWindow * window);
@@ -82,11 +81,6 @@
     G_GNUC_INTERNAL void openvrml_player_watch_child(GPid pid,
                                                      gint status,
                                                      gpointer data);
-    G_GNUC_INTERNAL
-    GtkWidget *
-    openvrml_player_build_file_chooser_dialog(GladeXML * xml,
-                                              GType widget_type,
-                                              GladeWidgetInfo * info);
 }
 
 namespace {
@@ -103,7 +97,8 @@
                                                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 GtkBuilder * builder_new(GnomeProgram & program,
+                                             GError ** error);
     G_GNUC_INTERNAL void set_locationentry_text(const gchar * text);
     G_GNUC_INTERNAL void load_url(const gchar * url);
 
@@ -214,29 +209,32 @@
             GNOME_PARAM_APP_DATADIR, OPENVRML_PLAYER_PKGDATADIR_,
             GNOME_PARAM_NONE);
 
-    glade_init();
-    glade_register_widget(OPENVRML_PLAYER_TYPE_FILE_CHOOSER_DIALOG,
-                          openvrml_player_build_file_chooser_dialog,
-                          0,
-                          0);
+    GError * error = 0;
+    scope_guard error_guard = make_guard(g_error_free, ref(error));
+    GtkBuilder * const builder = builder_new(*program, &error);
+    if (!builder) {
+        g_critical("Failed to create UI builder: %s", error->message);
+        return EXIT_FAILURE;
+    }
+    gtk_builder_connect_signals(builder, 0);
 
-    GladeXML * const xml = xml_new(*program);
-    glade_xml_signal_autoconnect(xml);
-
-    GtkWidget * const app_window = glade_xml_get_widget(xml, "window");
+    GtkWidget * const app_window =
+        GTK_WIDGET(gtk_builder_get_object(builder, "window"));
     GtkWidget * const file_chooser_dialog =
-        glade_xml_get_widget(xml, "filechooserdialog");
+        GTK_WIDGET(gtk_builder_get_object(builder, "filechooserdialog"));
     gtk_window_set_transient_for(GTK_WINDOW(file_chooser_dialog),
                                  GTK_WINDOW(app_window));
 
-    ::location_entry = glade_xml_get_widget(xml, "locationentry");
+    ::location_entry =
+        GTK_WIDGET(gtk_builder_get_object(builder, "locationentry"));
     g_signal_connect(file_chooser_dialog,
                      "response",
                      G_CALLBACK(openvrml_player_on_filechooserdialog_response),
                      location_entry);
 
     gint standard_input, standard_output;
-    GtkWidget * const socket = glade_xml_get_widget(xml, "socket");
+    GtkWidget * const socket =
+        GTK_WIDGET(gtk_builder_get_object(builder, "socket"));
     const GPid child_pid =
         spawn_openvrml_xembed(gtk_socket_get_id(GTK_SOCKET(socket)),
                               standard_input,
@@ -246,8 +244,6 @@
 
     ::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)
                                                  &error);
@@ -413,31 +409,36 @@
         return child_pid;
     }
 
-    GladeXML * xml_new(GnomeProgram & program)
+    GtkBuilder * builder_new(GnomeProgram & program, GError ** error)
     {
         using std::string;
 
-        const gchar * const gladedir = g_getenv("OPENVRML_PLAYER_GLADEDIR");
-        string glade_file_str;
-        const gchar * glade_file = 0;
-        if (gladedir) {
-            glade_file_str = string(gladedir) + "/openvrml-player.glade";
-            glade_file = glade_file_str.c_str();
+        const gchar * const uidir = g_getenv("OPENVRML_PLAYER_UIDIR");
+        string ui_file_str;
+        const gchar * ui_file = 0;
+        if (uidir) {
+            ui_file_str = string(uidir) + "/openvrml-player.ui";
+            ui_file = ui_file_str.c_str();
         }
 
-        if (!glade_file) {
+        if (!ui_file) {
             static const gboolean only_if_exists = true;
-            glade_file =
+            ui_file =
                 gnome_program_locate_file(&program,
                                           GNOME_FILE_DOMAIN_APP_DATADIR,
-                                          "/glade/openvrml-player.glade",
+                                          "/ui/openvrml-player.ui",
                                           only_if_exists,
                                           0);
         }
 
-        g_return_val_if_fail(glade_file, 0);
+        g_return_val_if_fail(ui_file, 0);
 
-        return glade_xml_new(glade_file, 0, 0);
+        GtkBuilder * builder = gtk_builder_new();
+        if (!gtk_builder_add_from_file(builder, ui_file, error)) {
+            return 0;
+        }
+
+        return builder;
     }
 
     void set_locationentry_text(const gchar * const text)
@@ -1020,15 +1021,6 @@
     gtk_main_quit();
 }
 
-GtkWidget *
-openvrml_player_build_file_chooser_dialog(GladeXML * /* xml */,
-                                          GType /* widget_type */,
-                                          GladeWidgetInfo * /* info */)
-{
-    GtkWidget * widget = openvrml_player_file_chooser_dialog_new(0);
-    return widget;
-}
-
 namespace {
 
     ssize_t write_command(const std::string & command)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 | 
| 
      
      
      From: <br...@us...> - 2008-07-26 08:29:23
       | 
| Revision: 3497
          http://openvrml.svn.sourceforge.net/openvrml/?rev=3497&view=rev
Author:   braden
Date:     2008-07-26 08:29:32 +0000 (Sat, 26 Jul 2008)
Log Message:
-----------
Fixed some potential crashes when processing coordinate, color, and normal indices.
Modified Paths:
--------------
    trunk/ChangeLog
    trunk/src/libopenvrml-gl/openvrml/gl/viewer.cpp
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2008-07-23 17:16:29 UTC (rev 3496)
+++ trunk/ChangeLog	2008-07-26 08:29:32 UTC (rev 3497)
@@ -1,3 +1,24 @@
+2008-07-26 Braden McDaniel  <br...@en...>
+
+	Fixed some potential crashes when processing coordinate, color,
+	and normal indices.
+
+	* src/libopenvrml-gl/openvrml/gl/viewer.cpp
+	(insertShellTess(GLUtesselator &, const std::vector<vertex_data>&,
+	const std::vector<openvrml::int32> &, bool, const
+	std::vector<openvrml::color> &, const
+	std::vector<openvrml::int32>&, bool, const
+	std::vector<openvrml::vec3f> &, const
+	std::vector<openvrml::int32>&)): Advance past invalid coordinate
+	indices.
+	(openvrml::gl::viewer::do_insert_shell(unsigned int, const
+	std::vector<vec3f> &, const std::vector<int32> &, const
+	std::vector<color> &, const std::vector<int32> &, const
+	std::vector<vec3f> & const std::vector<int32> &, const
+	std::vector<vec2f> &, const std::vector<int32> &)): Advance past
+	-1 entries and invalid coordinate indices in the colorIndex and
+	normalIndex fields.
+
 2008-07-23 Braden McDaniel  <br...@en...>
 
 	Use GtkBuilder in openvrml-player instead of libglade.  Note that
Modified: trunk/src/libopenvrml-gl/openvrml/gl/viewer.cpp
===================================================================
--- trunk/src/libopenvrml-gl/openvrml/gl/viewer.cpp	2008-07-23 17:16:29 UTC (rev 3496)
+++ trunk/src/libopenvrml-gl/openvrml/gl/viewer.cpp	2008-07-26 08:29:32 UTC (rev 3497)
@@ -2939,7 +2939,14 @@
         for (vector<openvrml::int32>::size_type i = 0;
              i < coord_index.size();
              ++i) {
-            if (coord_index[i] != -1) {
+            using openvrml::int32;
+            if (!(coord_index[i] < int32(vertices.size()))) {
+                //
+                // We've encountered an invalid coordinate index.  Advance to
+                // the next polygon.
+                //
+                while (coord_index[i + 1] != -1) { ++i; }
+            } else if (coord_index[i] != -1) {
                 gluTessVertex(&tessobj,
                               const_cast<GLdouble *>(
                                   vertices[coord_index[i]].coord),
@@ -3060,11 +3067,13 @@
                      ++i) {
                     vertices[i].color = &color[i];
                 }
-            } else {
+            } else if (color_index.size() == coord_index.size()) {
                 for (vector<int32>::size_type i = 0;
                      i < color_index.size();
                      ++i) {
-                    vertices[i].color = &color[color_index[i]];
+                    if (color_index[i] < 0) { continue; }
+                    if (!(coord_index[i] < coord.size())) { continue; }
+                    vertices[coord_index[i]].color = &color[color_index[i]];
                 }
             }
         }
@@ -3075,11 +3084,13 @@
                      ++i) {
                     vertices[i].normal = &normal[i];
                 }
-            } else {
+            } else if (normal_index.size() == coord_index.size()) {
                 for (vector<int32>::size_type i = 0;
                      i < normal_index.size();
                      ++i) {
-                    vertices[i].normal = &normal[normal_index[i]];
+                    if (normal_index[i] < 0) { continue; }
+                    if (!(coord_index[i] < coord.size())) { continue; }
+                    vertices[coord_index[i]].normal = &normal[normal_index[i]];
                 }
             }
         }
@@ -3094,6 +3105,7 @@
             for (vector<int32>::size_type i = 0;
                  i < tex_coord_index.size();
                  ++i) {
+                if (tex_coord_index[i] < 0) { continue; }
                 vertices[tex_coord_index[i]].tex_coord =
                     &tex_coord[tex_coord_index[i]];
             }
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 | 
| 
      
      
      From: <br...@us...> - 2008-08-03 06:58:04
       | 
| Revision: 3499
          http://openvrml.svn.sourceforge.net/openvrml/?rev=3499&view=rev
Author:   braden
Date:     2008-08-03 06:58:14 +0000 (Sun, 03 Aug 2008)
Log Message:
-----------
Only compile Java test programs if Script node Java support was enabled.
Modified Paths:
--------------
    trunk/ChangeLog
    trunk/tests/Makefile.am
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2008-07-26 20:20:15 UTC (rev 3498)
+++ trunk/ChangeLog	2008-08-03 06:58:14 UTC (rev 3499)
@@ -1,3 +1,8 @@
+2008-08-03 Braden McDaniel  <br...@en...>
+
+	* tests/Makefile.am: Only compile Java test programs if Script
+	node Java support was enabled.
+
 2008-07-26 Braden McDaniel  <br...@en...>
 
 	Fixed some potential crashes when processing coordinate, color,
Modified: trunk/tests/Makefile.am
===================================================================
--- trunk/tests/Makefile.am	2008-07-26 20:20:15 UTC (rev 3498)
+++ trunk/tests/Makefile.am	2008-08-03 06:58:14 UTC (rev 3499)
@@ -76,9 +76,10 @@
 
 JAVAROOT = $(top_builddir)/tests
 CLASSPATH_ENV = CLASSPATH=$(top_builddir)/src/script/java/script.jar
+if ENABLE_SCRIPT_NODE_JAVA
 dist_noinst_JAVA = TestScript.java
+endif
 
-
 EXTRA_DIST = \
         package.m4 \
         testsuite.at \
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 | 
| 
      
      
      From: <br...@us...> - 2008-08-12 10:29:07
       | 
| Revision: 3501
          http://openvrml.svn.sourceforge.net/openvrml/?rev=3501&view=rev
Author:   braden
Date:     2008-08-12 10:29:15 +0000 (Tue, 12 Aug 2008)
Log Message:
-----------
Use G_DEFINE_TYPE for custom GTK+ widgets.
Modified Paths:
--------------
    trunk/ChangeLog
    trunk/src/openvrml-player/filechooserdialog.cpp
    trunk/src/openvrml-xembed/gtkvrmlbrowser.cpp
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2008-08-12 10:15:26 UTC (rev 3500)
+++ trunk/ChangeLog	2008-08-12 10:29:15 UTC (rev 3501)
@@ -1,3 +1,10 @@
+2008-08-12 Braden McDaniel  <br...@en...>
+
+	Use G_DEFINE_TYPE for custom GTK+ widgets.
+
+	* src/openvrml-xembed/gtkvrmlbrowser.cpp
+	* src/openvrml-player/filechooserdialog.cpp
+
 2008-08-03 Braden McDaniel  <br...@en...>
 
 	* tests/Makefile.am: Only compile Java test programs if Script
Modified: trunk/src/openvrml-player/filechooserdialog.cpp
===================================================================
--- trunk/src/openvrml-player/filechooserdialog.cpp	2008-08-12 10:15:26 UTC (rev 3500)
+++ trunk/src/openvrml-player/filechooserdialog.cpp	2008-08-12 10:29:15 UTC (rev 3501)
@@ -24,8 +24,8 @@
 using namespace boost::multi_index::detail; // for scope_guard
 
 G_DEFINE_TYPE(OpenvrmlPlayerFileChooserDialog,
-                        openvrml_player_file_chooser_dialog,
-                        GTK_TYPE_FILE_CHOOSER_DIALOG)
+              openvrml_player_file_chooser_dialog,
+              GTK_TYPE_FILE_CHOOSER_DIALOG)
 
 namespace {
 
Modified: trunk/src/openvrml-xembed/gtkvrmlbrowser.cpp
===================================================================
--- trunk/src/openvrml-xembed/gtkvrmlbrowser.cpp	2008-08-12 10:15:26 UTC (rev 3500)
+++ trunk/src/openvrml-xembed/gtkvrmlbrowser.cpp	2008-08-12 10:29:15 UTC (rev 3501)
@@ -34,10 +34,11 @@
 
 using namespace boost::multi_index::detail; // for scope_guard
 
-extern "C" {
-    void gtk_vrml_browser_class_init(GtkVrmlBrowserClass * klass);
-    void gtk_vrml_browser_init(GtkVrmlBrowser * vrml_browser);
+G_DEFINE_TYPE(GtkVrmlBrowser,
+              gtk_vrml_browser,
+              GTK_TYPE_VRML_BROWSER)
 
+extern "C" {
     G_GNUC_INTERNAL gboolean gtk_vrml_browser_destroy(GtkWidget * widget,
                                                       GdkEvent * event,
                                                       gpointer data);
@@ -72,32 +73,6 @@
     G_GNUC_INTERNAL gint gtk_vrml_browser_timeout_callback(gpointer ptr);
 }
 
-GType gtk_vrml_browser_get_type()
-{
-    static GType type = 0;
-
-    if (!type) {
-        static const GTypeInfo info = {
-            sizeof (GtkVrmlBrowserClass),
-            0, // base_init
-            0, // base_finalize
-            reinterpret_cast<GClassInitFunc>(gtk_vrml_browser_class_init),
-            0, // class_finalize
-            0, // class_data
-            sizeof (GtkVrmlBrowser),
-            0, // n_preallocs
-            reinterpret_cast<GInstanceInitFunc>(gtk_vrml_browser_init),
-            0  // value_table
-        };
-
-        type = g_type_register_static(GTK_TYPE_DRAWING_AREA,
-                                      "GtkVrmlBrowser",
-                                      &info,
-                                      GTypeFlags(0));
-    }
-    return type;
-}
-
 namespace {
     G_GNUC_INTERNAL GdkGLConfig * gl_config;
 
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 | 
| 
      
      
      From: <br...@us...> - 2008-08-12 10:42:56
       | 
| Revision: 3502
          http://openvrml.svn.sourceforge.net/openvrml/?rev=3502&view=rev
Author:   braden
Date:     2008-08-12 10:43:05 +0000 (Tue, 12 Aug 2008)
Log Message:
-----------
Consistently use size_t when inserting stream handles into IOStreams.  ptrdiff_t is signed; so mixing this with size_t can lead to badness.
Modified Paths:
--------------
    trunk/ChangeLog
    trunk/mozilla-plugin/src/openvrml.cpp
    trunk/src/openvrml-player/player.cpp
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2008-08-12 10:29:15 UTC (rev 3501)
+++ trunk/ChangeLog	2008-08-12 10:43:05 UTC (rev 3502)
@@ -1,5 +1,29 @@
 2008-08-12 Braden McDaniel  <br...@en...>
 
+	Consistently use size_t when inserting stream handles into
+	IOStreams.  ptrdiff_t is signed; so mixing this with size_t can
+	lead to badness.
+
+	* src/openvrml-player/player.cpp
+	(openvrml_player_curl_source_callback(gpointer)): Cast the
+	easy_handle to size_t instead of ptrdiff_t before inserting into
+	the command stream.
+	(openvrml_player_curl_write(void *, size_t, size_t, void *)): Cast
+	the easy_handle to size_t instead of ptrdiff_t before inserting
+	into the command stream.
+	* mozilla-plugin/src/openvrml.cpp
+	(NPP_NewStream(NPP, NPMIMEType, NPStream *, NPBool, uint16 *)):
+	Cast the stream handle to size_t instead of ptrdiff_t before
+	inserting into the command stream.
+	(NPP_DestroyStream(NPP, NPStream *, NPError)): Cast the stream
+	handle to size_t instead of ptrdiff_t before inserting into the
+	command stream.
+	(NPP_Write(NPP, NPStream *, int32, int32, void *)): Cast the stream
+	handle to size_t instead of ptrdiff_t before inserting into the
+	command stream.
+
+2008-08-12 Braden McDaniel  <br...@en...>
+
 	Use G_DEFINE_TYPE for custom GTK+ widgets.
 
 	* src/openvrml-xembed/gtkvrmlbrowser.cpp
Modified: trunk/mozilla-plugin/src/openvrml.cpp
===================================================================
--- trunk/mozilla-plugin/src/openvrml.cpp	2008-08-12 10:29:15 UTC (rev 3501)
+++ trunk/mozilla-plugin/src/openvrml.cpp	2008-08-12 10:43:05 UTC (rev 3502)
@@ -439,7 +439,7 @@
         *static_cast<plugin_instance *>(instance->pdata);
 
     std::ostringstream command;
-    command << "new-stream " << ptrdiff_t(stream) << ' ' << type << ' '
+    command << "new-stream " << size_t(stream) << ' ' << type << ' '
             << stream->url << '\n';
     const ssize_t bytes_written = pluginInstance.write_command(command.str());
     return (bytes_written < 0)
@@ -457,7 +457,7 @@
         *static_cast<plugin_instance *>(instance->pdata);
 
     std::ostringstream command;
-    command << "destroy-stream " << ptrdiff_t(stream) << '\n';
+    command << "destroy-stream " << size_t(stream) << '\n';
     const ssize_t bytes_written = pluginInstance.write_command(command.str());
     return (bytes_written < 0)
         ? NPERR_GENERIC_ERROR
@@ -500,7 +500,7 @@
         *static_cast<plugin_instance *>(instance->pdata);
 
     std::ostringstream command;
-    command << "write " << ptrdiff_t(stream) << ' ' << ' ' << len << '\n';
+    command << "write " << size_t(stream) << ' ' << ' ' << len << '\n';
     for (int32 i = 0; i < len; ++i) {
         command.put(static_cast<char *>(buffer)[i]);
     }
Modified: trunk/src/openvrml-player/player.cpp
===================================================================
--- trunk/src/openvrml-player/player.cpp	2008-08-12 10:29:15 UTC (rev 3501)
+++ trunk/src/openvrml-player/player.cpp	2008-08-12 10:43:05 UTC (rev 3502)
@@ -669,7 +669,7 @@
             //
             if (entry->second.initialized()) {
                 std::ostringstream command;
-                command << "destroy-stream " << ptrdiff_t(msg->easy_handle)
+                command << "destroy-stream " << size_t(msg->easy_handle)
                         << '\n';
                 const ssize_t bytes_written = ::write_command(command.str());
                 g_return_val_if_fail(
@@ -882,7 +882,7 @@
 
         std::ostringstream new_stream_command;
         new_stream_command
-            << "new-stream " << ptrdiff_t(stream_data.handle()) << ' '
+            << "new-stream " << size_t(stream_data.handle()) << ' '
             << (type ? type : "application/octet-stream") << ' '
             << stream_data.url() << '\n';
         ::write_command(new_stream_command.str());
@@ -890,7 +890,7 @@
     }
 
     std::ostringstream write_command;
-    write_command << "write " << ptrdiff_t(stream_data.handle()) << ' '
+    write_command << "write " << size_t(stream_data.handle()) << ' '
                   << size * nmemb << '\n';
     const char * data = static_cast<char *>(ptr);
     for (; data != static_cast<char *>(ptr) + size * nmemb;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 | 
| 
      
      
      From: <br...@us...> - 2008-08-12 22:08:01
       | 
| Revision: 3506
          http://openvrml.svn.sourceforge.net/openvrml/?rev=3506&view=rev
Author:   braden
Date:     2008-08-12 22:08:09 +0000 (Tue, 12 Aug 2008)
Log Message:
-----------
Updates for 0.17.7 release.
Modified Paths:
--------------
    trunk/ChangeLog
    trunk/NEWS
    trunk/README
    trunk/configure.ac
    trunk/doc/Doxyfile
    trunk/ide-projects/Windows/VisualC9_0/OpenVRML/openvrml/openvrml.rc
    trunk/ide-projects/Windows/VisualC9_0/OpenVRML/openvrml/openvrml.vcproj
    trunk/ide-projects/Windows/VisualC9_0/OpenVRML/openvrml-gl/openvrml-gl.rc
    trunk/mozilla-plugin/configure.ac
    trunk/src/Makefile.am
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2008-08-12 16:17:20 UTC (rev 3505)
+++ trunk/ChangeLog	2008-08-12 22:08:09 UTC (rev 3506)
@@ -1,5 +1,20 @@
 2008-08-12 Braden McDaniel  <br...@en...>
 
+	Updates for 0.17.7 release.
+
+	* NEWS
+	* README
+	* configure.ac
+	* doc/Doxyfile
+	* ide-projects/Windows/VisualC9_0/OpenVRML/openvrml/openvrml.rc
+	* ide-projects/Windows/VisualC9_0/OpenVRML/openvrml/openvrml.vcproj
+	* ide-projects/Windows/VisualC9_0/OpenVRML/openvrml-gl/openvrml-gl.rc
+	* mozilla-plugin/configure.ac
+	* src/Makefile.am: Updated libopenvrml libtool library version to
+	8:6:0; updated libopenvrml-gl libtool library version to 7:2:0.
+
+2008-08-12 Braden McDaniel  <br...@en...>
+
 	Consistently use size_t when inserting stream handles into
 	IOStreams.  ptrdiff_t is signed; so mixing this with size_t can
 	lead to badness.
Modified: trunk/NEWS
===================================================================
--- trunk/NEWS	2008-08-12 16:17:20 UTC (rev 3505)
+++ trunk/NEWS	2008-08-12 22:08:09 UTC (rev 3506)
@@ -1,3 +1,13 @@
+Changes new in version 0.17.7, 12 August, 2008
+========================================================================
+
+- Fixed potential crashes when processing coordinate, color, and
+  normal indices.
+
+- Fixed potential failure in the Mozilla plug-in and openvrml-player
+  due to inconsistent handling of stream handles.
+
+
 Changes new in version 0.17.6, 17 June, 2008
 ========================================================================
 
Modified: trunk/README
===================================================================
--- trunk/README	2008-08-12 16:17:20 UTC (rev 3505)
+++ trunk/README	2008-08-12 22:08:09 UTC (rev 3506)
@@ -1,4 +1,4 @@
-OpenVRML library version 0.17.6
+OpenVRML library version 0.17.7
 Copyright 1998, 1999, 2000 Chris Morley <cm...@ve...>
 Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
    Braden McDaniel <br...@en...>
Modified: trunk/configure.ac
===================================================================
--- trunk/configure.ac	2008-08-12 16:17:20 UTC (rev 3505)
+++ trunk/configure.ac	2008-08-12 22:08:09 UTC (rev 3506)
@@ -1,4 +1,4 @@
-AC_INIT([OpenVRML], [0.17.6], [ope...@li...])
+AC_INIT([OpenVRML], [0.17.7], [ope...@li...])
 AC_PREREQ([2.53])
 AC_COPYRIGHT([Portions copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Braden McDaniel])
 AC_CONFIG_FILES([Makefile]
Modified: trunk/doc/Doxyfile
===================================================================
--- trunk/doc/Doxyfile	2008-08-12 16:17:20 UTC (rev 3505)
+++ trunk/doc/Doxyfile	2008-08-12 22:08:09 UTC (rev 3506)
@@ -5,7 +5,7 @@
 #---------------------------------------------------------------------------
 DOXYFILE_ENCODING      = UTF-8
 PROJECT_NAME           = OpenVRML
-PROJECT_NUMBER         = 0.17.6
+PROJECT_NUMBER         = 0.17.7
 OUTPUT_DIRECTORY       = 
 CREATE_SUBDIRS         = NO
 OUTPUT_LANGUAGE        = English
Modified: trunk/ide-projects/Windows/VisualC9_0/OpenVRML/openvrml/openvrml.rc
===================================================================
--- trunk/ide-projects/Windows/VisualC9_0/OpenVRML/openvrml/openvrml.rc	2008-08-12 16:17:20 UTC (rev 3505)
+++ trunk/ide-projects/Windows/VisualC9_0/OpenVRML/openvrml/openvrml.rc	2008-08-12 22:08:09 UTC (rev 3506)
@@ -11,8 +11,8 @@
 //
 
 VS_VERSION_INFO VERSIONINFO
- FILEVERSION 8,5,0,0
- PRODUCTVERSION 0,17,6,0
+ FILEVERSION 8,6,0,0
+ PRODUCTVERSION 0,17,7,0
  FILEFLAGSMASK 0x17L
 #ifdef _DEBUG
  FILEFLAGS 0x1L
@@ -28,12 +28,12 @@
         BLOCK "040904b0"
         BEGIN
             VALUE "FileDescription", "OpenVRML Library"
-            VALUE "FileVersion", "8, 5, 0, 0"
+            VALUE "FileVersion", "8, 6, 0, 0"
             VALUE "InternalName", "openvrml"
             VALUE "LegalCopyright", "Copyright (C) 2008"
             VALUE "OriginalFilename", "openvrml.dll"
             VALUE "ProductName", "OpenVRML Library"
-            VALUE "ProductVersion", "0.17.6"
+            VALUE "ProductVersion", "0.17.7"
         END
     END
     BLOCK "VarFileInfo"
Modified: trunk/ide-projects/Windows/VisualC9_0/OpenVRML/openvrml/openvrml.vcproj
===================================================================
--- trunk/ide-projects/Windows/VisualC9_0/OpenVRML/openvrml/openvrml.vcproj	2008-08-12 16:17:20 UTC (rev 3505)
+++ trunk/ide-projects/Windows/VisualC9_0/OpenVRML/openvrml/openvrml.vcproj	2008-08-12 22:08:09 UTC (rev 3506)
@@ -41,8 +41,8 @@
 			<Tool
 				Name="VCCLCompilerTool"
 				Optimization="0"
-				AdditionalIncludeDirectories=".;..\..\..\..\..\src\libopenvrml;..\..\..\..\..\libltdl"
-				PreprocessorDefinitions="NOMINMAX;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;BOOST_SPIRIT_THREADSAFE;BOOST_SPIRIT_CLOSURE_LIMIT=6;PHOENIX_LIMIT=6;PACKAGE_VERSION=\"0.17.6\";BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS;BOOST_MPL_LIMIT_VECTOR_SIZE=30;OPENVRML_BUILD_DLL;OPENVRML_ENABLE_PNG_TEXTURES;OPENVRML_ENABLE_RENDER_TEXT_NODE;OPENVRML_FT_CONST="const";OPENVRML_PKGDATADIR_=\"\";OPENVRML_PKGLIBDIR_=\"\""
+				AdditionalIncludeDirectories=".;..\..\..\..\..\src\libopenvrml"
+				PreprocessorDefinitions="NOMINMAX;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;BOOST_SPIRIT_THREADSAFE;BOOST_SPIRIT_CLOSURE_LIMIT=6;PHOENIX_LIMIT=6;PACKAGE_VERSION=\"0.17.7\";BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS;BOOST_MPL_LIMIT_VECTOR_SIZE=30;OPENVRML_BUILD_DLL;OPENVRML_ENABLE_PNG_TEXTURES;OPENVRML_ENABLE_RENDER_TEXT_NODE;OPENVRML_FT_CONST="const";OPENVRML_PKGDATADIR_=\"\";OPENVRML_PKGLIBDIR_=\"\""
 				MinimalRebuild="false"
 				BasicRuntimeChecks="0"
 				RuntimeLibrary="3"
@@ -126,8 +126,9 @@
 				Optimization="3"
 				InlineFunctionExpansion="1"
 				OmitFramePointers="true"
-				AdditionalIncludeDirectories=".;..\..\..\..\..\src\libopenvrml;..\..\..\..\..\libltdl"
-				PreprocessorDefinitions="NOMINMAX;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;BOOST_SPIRIT_THREADSAFE;PACKAGE_VERSION=\"0.17.6\";BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS;BOOST_MPL_LIMIT_VECTOR_SIZE=30;BOOST_SPIRIT_CLOSURE_LIMIT=6;PHOENIX_LIMIT=6;OPENVRML_BUILD_DLL;OPENVRML_ENABLE_PNG_TEXTURES;OPENVRML_ENABLE_RENDER_TEXT_NODE;OPENVRML_FT_CONST="const";OPENVRML_PKGDATADIR_=\"\";OPENVRML_PKGLIBDIR_=\"\";NDEBUG"
+
+				AdditionalIncludeDirectories=".;..\..\..\..\..\src\libopenvrml"
+				PreprocessorDefinitions="NOMINMAX;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;BOOST_SPIRIT_THREADSAFE;PACKAGE_VERSION=\"0.17.7\";BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS;BOOST_MPL_LIMIT_VECTOR_SIZE=30;BOOST_SPIRIT_CLOSURE_LIMIT=6;PHOENIX_LIMIT=6;OPENVRML_BUILD_DLL;OPENVRML_ENABLE_PNG_TEXTURES;OPENVRML_ENABLE_RENDER_TEXT_NODE;OPENVRML_FT_CONST="const";OPENVRML_PKGDATADIR_=\"\";OPENVRML_PKGLIBDIR_=\"\";NDEBUG"
 				StringPooling="true"
 				RuntimeLibrary="2"
 				EnableFunctionLevelLinking="true"
Modified: trunk/ide-projects/Windows/VisualC9_0/OpenVRML/openvrml-gl/openvrml-gl.rc
===================================================================
--- trunk/ide-projects/Windows/VisualC9_0/OpenVRML/openvrml-gl/openvrml-gl.rc	2008-08-12 16:17:20 UTC (rev 3505)
+++ trunk/ide-projects/Windows/VisualC9_0/OpenVRML/openvrml-gl/openvrml-gl.rc	2008-08-12 22:08:09 UTC (rev 3506)
@@ -11,8 +11,8 @@
 //
 
 VS_VERSION_INFO VERSIONINFO
- FILEVERSION 7,1,0,0
- PRODUCTVERSION 0,17,6,0
+ FILEVERSION 7,2,0,0
+ PRODUCTVERSION 0,17,7,0
  FILEFLAGSMASK 0x17L
 #ifdef _DEBUG
  FILEFLAGS 0x1L
@@ -28,12 +28,12 @@
         BLOCK "040904b0"
         BEGIN
             VALUE "FileDescription", "OpenVRML OpenGL Renderer Library"
-            VALUE "FileVersion", "7, 1, 0, 0"
+            VALUE "FileVersion", "7, 2, 0, 0"
             VALUE "InternalName", "openvrml-gl"
             VALUE "LegalCopyright", "Copyright (C) 2008"
             VALUE "OriginalFilename", "openvrml-gl.dll"
             VALUE "ProductName", "OpenVRML Library"
-            VALUE "ProductVersion", "0.17.6"
+            VALUE "ProductVersion", "0.17.7"
         END
     END
     BLOCK "VarFileInfo"
Modified: trunk/mozilla-plugin/configure.ac
===================================================================
--- trunk/mozilla-plugin/configure.ac	2008-08-12 16:17:20 UTC (rev 3505)
+++ trunk/mozilla-plugin/configure.ac	2008-08-12 22:08:09 UTC (rev 3506)
@@ -1,5 +1,5 @@
 AC_PREREQ([2.53])
-AC_INIT([OpenVRML Mozilla Plugin], [0.17.6],
+AC_INIT([OpenVRML Mozilla Plugin], [0.17.7],
         [ope...@li...])
 AC_COPYRIGHT([Portions copyright 2004, 2005, 2006, 2007, 2008 Braden McDaniel])
 AC_CONFIG_FILES([Makefile]
Modified: trunk/src/Makefile.am
===================================================================
--- trunk/src/Makefile.am	2008-08-12 16:17:20 UTC (rev 3505)
+++ trunk/src/Makefile.am	2008-08-12 22:08:09 UTC (rev 3506)
@@ -73,8 +73,8 @@
         openvrml-xembed/gtkvrmlbrowser.h \
         openvrml-player/filechooserdialog.h
 
-LIBOPENVRML_LIBRARY_VERSION =    8:5:0
-LIBOPENVRML_GL_LIBRARY_VERSION = 7:1:0
+LIBOPENVRML_LIBRARY_VERSION =    8:6:0
+LIBOPENVRML_GL_LIBRARY_VERSION = 7:2:0
 #                                | | |
 #                         +------+ | +---+
 #                         |        |     |
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 | 
| 
      
      
      From: <br...@us...> - 2008-08-14 03:15:33
       | 
| Revision: 3511
          http://openvrml.svn.sourceforge.net/openvrml/?rev=3511&view=rev
Author:   braden
Date:     2008-08-14 03:15:43 +0000 (Thu, 14 Aug 2008)
Log Message:
-----------
Fixed invocation of G_DEFINE_TYPE to point at the parent type.
Modified Paths:
--------------
    trunk/ChangeLog
    trunk/src/openvrml-xembed/gtkvrmlbrowser.cpp
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2008-08-13 14:50:34 UTC (rev 3510)
+++ trunk/ChangeLog	2008-08-14 03:15:43 UTC (rev 3511)
@@ -1,3 +1,8 @@
+2008-08-13 Braden McDaniel  <br...@en...>
+
+	* src/openvrml-xembed/gtkvrmlbrowser.cpp: Fixed invocation of
+	G_DEFINE_TYPE to point at the parent type.
+
 2008-08-12 Braden McDaniel  <br...@en...>
 
 	Updates for 0.17.7 release.
Modified: trunk/src/openvrml-xembed/gtkvrmlbrowser.cpp
===================================================================
--- trunk/src/openvrml-xembed/gtkvrmlbrowser.cpp	2008-08-13 14:50:34 UTC (rev 3510)
+++ trunk/src/openvrml-xembed/gtkvrmlbrowser.cpp	2008-08-14 03:15:43 UTC (rev 3511)
@@ -36,7 +36,7 @@
 
 G_DEFINE_TYPE(GtkVrmlBrowser,
               gtk_vrml_browser,
-              GTK_TYPE_VRML_BROWSER)
+              GTK_TYPE_DRAWING_AREA)
 
 extern "C" {
     G_GNUC_INTERNAL gboolean gtk_vrml_browser_destroy(GtkWidget * widget,
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 | 
| 
      
      
      From: <br...@us...> - 2008-08-14 03:16:32
       | 
| Revision: 3512
          http://openvrml.svn.sourceforge.net/openvrml/?rev=3512&view=rev
Author:   braden
Date:     2008-08-14 03:16:40 +0000 (Thu, 14 Aug 2008)
Log Message:
-----------
Updated "About" dialog license text to reflect GPLv3 licensing.
Modified Paths:
--------------
    trunk/ChangeLog
    trunk/src/openvrml-player/player.cpp
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2008-08-14 03:15:43 UTC (rev 3511)
+++ trunk/ChangeLog	2008-08-14 03:16:40 UTC (rev 3512)
@@ -1,5 +1,10 @@
 2008-08-13 Braden McDaniel  <br...@en...>
 
+	* src/openvrml-player/player.cpp: Updated "About" dialog license
+	text to reflect GPLv3 licensing.
+
+2008-08-13 Braden McDaniel  <br...@en...>
+
 	* src/openvrml-xembed/gtkvrmlbrowser.cpp: Fixed invocation of
 	G_DEFINE_TYPE to point at the parent type.
 
Modified: trunk/src/openvrml-player/player.cpp
===================================================================
--- trunk/src/openvrml-player/player.cpp	2008-08-14 03:15:43 UTC (rev 3511)
+++ trunk/src/openvrml-player/player.cpp	2008-08-14 03:16:40 UTC (rev 3512)
@@ -1,6 +1,6 @@
 // -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 4; fill-column: 78 -*-
 //
-// Copyright 2006, 2007  Braden McDaniel
+// Copyright 2006, 2007, 2008  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
@@ -915,7 +915,7 @@
     const gchar license[] =
         "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 "
+        "the Free Software Foundation; either version 3 of the License, or "
         "(at your option) any later version.\n\n"
 
         "This program is distributed in the hope that it will be useful, but "
@@ -924,9 +924,7 @@
         "General Public License for more details.\n\n"
 
         "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";
+        "along with this program; if not, see <http://www.gnu.org/licenses/>.";
 
     gtk_show_about_dialog(parent,
                           "name", app_name,
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 | 
| 
      
      
      From: <br...@us...> - 2008-08-14 03:22:45
       | 
| Revision: 3513
          http://openvrml.svn.sourceforge.net/openvrml/?rev=3513&view=rev
Author:   braden
Date:     2008-08-14 03:22:54 +0000 (Thu, 14 Aug 2008)
Log Message:
-----------
Updates for 0.17.8 release.
Modified Paths:
--------------
    trunk/ChangeLog
    trunk/NEWS
    trunk/README
    trunk/configure.ac
    trunk/doc/Doxyfile
    trunk/ide-projects/Windows/VisualC9_0/OpenVRML/openvrml/openvrml.rc
    trunk/ide-projects/Windows/VisualC9_0/OpenVRML/openvrml/openvrml.vcproj
    trunk/ide-projects/Windows/VisualC9_0/OpenVRML/openvrml-gl/openvrml-gl.rc
    trunk/mozilla-plugin/configure.ac
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2008-08-14 03:16:40 UTC (rev 3512)
+++ trunk/ChangeLog	2008-08-14 03:22:54 UTC (rev 3513)
@@ -1,5 +1,18 @@
 2008-08-13 Braden McDaniel  <br...@en...>
 
+	Updates for 0.17.8 release.
+
+	* NEWS
+	* README
+	* configure.ac
+	* doc/Doxyfile
+	* ide-projects/Windows/VisualC9_0/OpenVRML/openvrml/openvrml.rc
+	* ide-projects/Windows/VisualC9_0/OpenVRML/openvrml/openvrml.vcproj
+	* ide-projects/Windows/VisualC9_0/OpenVRML/openvrml-gl/openvrml-gl.rc
+	* mozilla-plugin/configure.ac
+
+2008-08-13 Braden McDaniel  <br...@en...>
+
 	* src/openvrml-player/player.cpp: Updated "About" dialog license
 	text to reflect GPLv3 licensing.
 
Modified: trunk/NEWS
===================================================================
--- trunk/NEWS	2008-08-14 03:16:40 UTC (rev 3512)
+++ trunk/NEWS	2008-08-14 03:22:54 UTC (rev 3513)
@@ -1,3 +1,9 @@
+Changes new in version 0.17.8, 13 August, 2008
+========================================================================
+
+- Fixed an initialization problem in openvrml-xembed.
+
+
 Changes new in version 0.17.7, 12 August, 2008
 ========================================================================
 
Modified: trunk/README
===================================================================
--- trunk/README	2008-08-14 03:16:40 UTC (rev 3512)
+++ trunk/README	2008-08-14 03:22:54 UTC (rev 3513)
@@ -1,4 +1,4 @@
-OpenVRML library version 0.17.7
+OpenVRML library version 0.17.8
 Copyright 1998, 1999, 2000 Chris Morley <cm...@ve...>
 Copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
    Braden McDaniel <br...@en...>
Modified: trunk/configure.ac
===================================================================
--- trunk/configure.ac	2008-08-14 03:16:40 UTC (rev 3512)
+++ trunk/configure.ac	2008-08-14 03:22:54 UTC (rev 3513)
@@ -1,4 +1,4 @@
-AC_INIT([OpenVRML], [0.17.7], [ope...@li...])
+AC_INIT([OpenVRML], [0.17.8], [ope...@li...])
 AC_PREREQ([2.53])
 AC_COPYRIGHT([Portions copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Braden McDaniel])
 AC_CONFIG_FILES([Makefile]
Modified: trunk/doc/Doxyfile
===================================================================
--- trunk/doc/Doxyfile	2008-08-14 03:16:40 UTC (rev 3512)
+++ trunk/doc/Doxyfile	2008-08-14 03:22:54 UTC (rev 3513)
@@ -5,7 +5,7 @@
 #---------------------------------------------------------------------------
 DOXYFILE_ENCODING      = UTF-8
 PROJECT_NAME           = OpenVRML
-PROJECT_NUMBER         = 0.17.7
+PROJECT_NUMBER         = 0.17.8
 OUTPUT_DIRECTORY       = 
 CREATE_SUBDIRS         = NO
 OUTPUT_LANGUAGE        = English
Modified: trunk/ide-projects/Windows/VisualC9_0/OpenVRML/openvrml/openvrml.rc
===================================================================
--- trunk/ide-projects/Windows/VisualC9_0/OpenVRML/openvrml/openvrml.rc	2008-08-14 03:16:40 UTC (rev 3512)
+++ trunk/ide-projects/Windows/VisualC9_0/OpenVRML/openvrml/openvrml.rc	2008-08-14 03:22:54 UTC (rev 3513)
@@ -12,7 +12,7 @@
 
 VS_VERSION_INFO VERSIONINFO
  FILEVERSION 8,6,0,0
- PRODUCTVERSION 0,17,7,0
+ PRODUCTVERSION 0,17,8,0
  FILEFLAGSMASK 0x17L
 #ifdef _DEBUG
  FILEFLAGS 0x1L
@@ -33,7 +33,7 @@
             VALUE "LegalCopyright", "Copyright (C) 2008"
             VALUE "OriginalFilename", "openvrml.dll"
             VALUE "ProductName", "OpenVRML Library"
-            VALUE "ProductVersion", "0.17.7"
+            VALUE "ProductVersion", "0.17.8"
         END
     END
     BLOCK "VarFileInfo"
Modified: trunk/ide-projects/Windows/VisualC9_0/OpenVRML/openvrml/openvrml.vcproj
===================================================================
--- trunk/ide-projects/Windows/VisualC9_0/OpenVRML/openvrml/openvrml.vcproj	2008-08-14 03:16:40 UTC (rev 3512)
+++ trunk/ide-projects/Windows/VisualC9_0/OpenVRML/openvrml/openvrml.vcproj	2008-08-14 03:22:54 UTC (rev 3513)
@@ -42,7 +42,7 @@
 				Name="VCCLCompilerTool"
 				Optimization="0"
 				AdditionalIncludeDirectories=".;..\..\..\..\..\src\libopenvrml"
-				PreprocessorDefinitions="NOMINMAX;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;BOOST_SPIRIT_THREADSAFE;BOOST_SPIRIT_CLOSURE_LIMIT=6;PHOENIX_LIMIT=6;PACKAGE_VERSION=\"0.17.7\";BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS;BOOST_MPL_LIMIT_VECTOR_SIZE=30;OPENVRML_BUILD_DLL;OPENVRML_ENABLE_PNG_TEXTURES;OPENVRML_ENABLE_RENDER_TEXT_NODE;OPENVRML_FT_CONST="const";OPENVRML_PKGDATADIR_=\"\";OPENVRML_PKGLIBDIR_=\"\""
+				PreprocessorDefinitions="NOMINMAX;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;BOOST_SPIRIT_THREADSAFE;BOOST_SPIRIT_CLOSURE_LIMIT=6;PHOENIX_LIMIT=6;PACKAGE_VERSION=\"0.17.8\";BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS;BOOST_MPL_LIMIT_VECTOR_SIZE=30;OPENVRML_BUILD_DLL;OPENVRML_ENABLE_PNG_TEXTURES;OPENVRML_ENABLE_RENDER_TEXT_NODE;OPENVRML_FT_CONST="const";OPENVRML_PKGDATADIR_=\"\";OPENVRML_PKGLIBDIR_=\"\""
 				MinimalRebuild="false"
 				BasicRuntimeChecks="0"
 				RuntimeLibrary="3"
@@ -128,7 +128,7 @@
 				OmitFramePointers="true"
 
 				AdditionalIncludeDirectories=".;..\..\..\..\..\src\libopenvrml"
-				PreprocessorDefinitions="NOMINMAX;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;BOOST_SPIRIT_THREADSAFE;PACKAGE_VERSION=\"0.17.7\";BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS;BOOST_MPL_LIMIT_VECTOR_SIZE=30;BOOST_SPIRIT_CLOSURE_LIMIT=6;PHOENIX_LIMIT=6;OPENVRML_BUILD_DLL;OPENVRML_ENABLE_PNG_TEXTURES;OPENVRML_ENABLE_RENDER_TEXT_NODE;OPENVRML_FT_CONST="const";OPENVRML_PKGDATADIR_=\"\";OPENVRML_PKGLIBDIR_=\"\";NDEBUG"
+				PreprocessorDefinitions="NOMINMAX;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;BOOST_SPIRIT_THREADSAFE;PACKAGE_VERSION=\"0.17.8\";BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS;BOOST_MPL_LIMIT_VECTOR_SIZE=30;BOOST_SPIRIT_CLOSURE_LIMIT=6;PHOENIX_LIMIT=6;OPENVRML_BUILD_DLL;OPENVRML_ENABLE_PNG_TEXTURES;OPENVRML_ENABLE_RENDER_TEXT_NODE;OPENVRML_FT_CONST="const";OPENVRML_PKGDATADIR_=\"\";OPENVRML_PKGLIBDIR_=\"\";NDEBUG"
 				StringPooling="true"
 				RuntimeLibrary="2"
 				EnableFunctionLevelLinking="true"
Modified: trunk/ide-projects/Windows/VisualC9_0/OpenVRML/openvrml-gl/openvrml-gl.rc
===================================================================
--- trunk/ide-projects/Windows/VisualC9_0/OpenVRML/openvrml-gl/openvrml-gl.rc	2008-08-14 03:16:40 UTC (rev 3512)
+++ trunk/ide-projects/Windows/VisualC9_0/OpenVRML/openvrml-gl/openvrml-gl.rc	2008-08-14 03:22:54 UTC (rev 3513)
@@ -12,7 +12,7 @@
 
 VS_VERSION_INFO VERSIONINFO
  FILEVERSION 7,2,0,0
- PRODUCTVERSION 0,17,7,0
+ PRODUCTVERSION 0,17,8,0
  FILEFLAGSMASK 0x17L
 #ifdef _DEBUG
  FILEFLAGS 0x1L
@@ -33,7 +33,7 @@
             VALUE "LegalCopyright", "Copyright (C) 2008"
             VALUE "OriginalFilename", "openvrml-gl.dll"
             VALUE "ProductName", "OpenVRML Library"
-            VALUE "ProductVersion", "0.17.7"
+            VALUE "ProductVersion", "0.17.8"
         END
     END
     BLOCK "VarFileInfo"
Modified: trunk/mozilla-plugin/configure.ac
===================================================================
--- trunk/mozilla-plugin/configure.ac	2008-08-14 03:16:40 UTC (rev 3512)
+++ trunk/mozilla-plugin/configure.ac	2008-08-14 03:22:54 UTC (rev 3513)
@@ -1,5 +1,5 @@
 AC_PREREQ([2.53])
-AC_INIT([OpenVRML Mozilla Plugin], [0.17.7],
+AC_INIT([OpenVRML Mozilla Plugin], [0.17.8],
         [ope...@li...])
 AC_COPYRIGHT([Portions copyright 2004, 2005, 2006, 2007, 2008 Braden McDaniel])
 AC_CONFIG_FILES([Makefile]
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 | 
| 
      
      
      From: <br...@us...> - 2008-08-15 20:22:38
       | 
| Revision: 3514
          http://openvrml.svn.sourceforge.net/openvrml/?rev=3514&view=rev
Author:   braden
Date:     2008-08-15 20:22:47 +0000 (Fri, 15 Aug 2008)
Log Message:
-----------
Symbols with internal linkage don't need visibility attributes.
Modified Paths:
--------------
    trunk/ChangeLog
    trunk/src/libopenvrml/openvrml/node.cpp
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2008-08-14 03:22:54 UTC (rev 3513)
+++ trunk/ChangeLog	2008-08-15 20:22:47 UTC (rev 3514)
@@ -1,3 +1,8 @@
+2008-08-15 Braden McDaniel  <br...@en...>
+
+	* src/libopenvrml/openvrml/node.cpp: Symbols with internal linkage
+	don't need visibility attributes.
+
 2008-08-13 Braden McDaniel  <br...@en...>
 
 	Updates for 0.17.8 release.
Modified: trunk/src/libopenvrml/openvrml/node.cpp
===================================================================
--- trunk/src/libopenvrml/openvrml/node.cpp	2008-08-14 03:22:54 UTC (rev 3513)
+++ trunk/src/libopenvrml/openvrml/node.cpp	2008-08-15 20:22:47 UTC (rev 3514)
@@ -146,7 +146,6 @@
 
     typedef boost::array<const char *, 5> node_interface_type_id;
 
-    OPENVRML_LOCAL
     const node_interface_type_id vrml97_node_interface_type_id_ = {
         "<invalid interface type>",
         "eventIn",
@@ -155,7 +154,6 @@
         "field"
     };
 
-    OPENVRML_LOCAL
     const node_interface_type_id x3d_node_interface_type_id_ = {
         "<invalid interface type>",
         "inputOnly",
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 | 
| 
      
      
      From: <br...@us...> - 2008-08-15 22:48:35
       | 
| Revision: 3516
          http://openvrml.svn.sourceforge.net/openvrml/?rev=3516&view=rev
Author:   braden
Date:     2008-08-15 22:48:45 +0000 (Fri, 15 Aug 2008)
Log Message:
-----------
Improved doc-comment.
Modified Paths:
--------------
    trunk/ChangeLog
    trunk/src/libopenvrml/openvrml/browser.cpp
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2008-08-15 20:29:54 UTC (rev 3515)
+++ trunk/ChangeLog	2008-08-15 22:48:45 UTC (rev 3516)
@@ -1,5 +1,11 @@
 2008-08-15 Braden McDaniel  <br...@en...>
 
+	* src/libopenvrml/openvrml/browser.cpp
+	(openvrml::browser::load_url(const std::vector<std::string> &,
+	const std::vector<std::string> &)): Improved doc-comment.
+
+2008-08-15 Braden McDaniel  <br...@en...>
+
 	* src/libopenvrml/openvrml/node.cpp: Symbols with internal linkage
 	don't need visibility attributes.
 
Modified: trunk/src/libopenvrml/openvrml/browser.cpp
===================================================================
--- trunk/src/libopenvrml/openvrml/browser.cpp	2008-08-15 20:29:54 UTC (rev 3515)
+++ trunk/src/libopenvrml/openvrml/browser.cpp	2008-08-15 22:48:45 UTC (rev 3516)
@@ -10757,13 +10757,21 @@
 };
 
 /**
- * @brief Load a VRML world into the browser.
+ * @brief Asynchronously load a VRML world into the @c browser.
  *
+ * This function takes an alternative URI list consistent with such lists as
+ * they appear in VRML nodes.  @c openvrml::browser_event::initialized will be
+ * emitted once the world has been loaded and initialized.
+ *
+ * For synchronously loading a world, see @c #set_world.
+ *
  * @param[in] url       a URI.
  * @param[in] parameter parameters for @p url.
  *
  * @exception std::bad_alloc                if memory allocation fails.
  * @exception boost::thread_resource_error  if thread creation fails.
+ *
+ * @sa #set_world
  */
 void openvrml::browser::load_url(const std::vector<std::string> & url,
                                  const std::vector<std::string> &)
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 | 
| 
      
      
      From: <br...@us...> - 2008-08-21 07:47:48
       | 
| Revision: 3518
          http://openvrml.svn.sourceforge.net/openvrml/?rev=3518&view=rev
Author:   braden
Date:     2008-08-21 07:47:56 +0000 (Thu, 21 Aug 2008)
Log Message:
-----------
Quell some warnings from gcc about comparing signed and unsigned types.
Modified Paths:
--------------
    trunk/ChangeLog
    trunk/src/libopenvrml-gl/openvrml/gl/viewer.cpp
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2008-08-15 22:51:59 UTC (rev 3517)
+++ trunk/ChangeLog	2008-08-21 07:47:56 UTC (rev 3518)
@@ -1,3 +1,14 @@
+2008-08-21 Braden McDaniel  <br...@en...>
+
+	* src/libopenvrml-gl/openvrml/gl/viewer.cpp
+	(openvrml::gl::viewer::do_insert_shell(unsigned int, const
+	std::vector<vec3f> & coord, const std::vector<int32> &
+	coord_index, const std::vector<color> & color, const
+	std::vector<int32> & color_index, const std::vector<vec3f> &
+	normal, const std::vector<int32> & normal_index, const
+	std::vector<vec2f> & tex_coord, const std::vector<int32> &
+	tex_coord_index)): Quell some warnings from gcc.
+
 2008-08-15 Braden McDaniel  <br...@en...>
 
 	* src/libopenvrml/openvrml/browser.cpp
Modified: trunk/src/libopenvrml-gl/openvrml/gl/viewer.cpp
===================================================================
--- trunk/src/libopenvrml-gl/openvrml/gl/viewer.cpp	2008-08-15 22:51:59 UTC (rev 3517)
+++ trunk/src/libopenvrml-gl/openvrml/gl/viewer.cpp	2008-08-21 07:47:56 UTC (rev 3518)
@@ -3072,7 +3072,7 @@
                      i < color_index.size();
                      ++i) {
                     if (color_index[i] < 0) { continue; }
-                    if (!(coord_index[i] < coord.size())) { continue; }
+                    if (!(size_t(coord_index[i]) < coord.size())) { continue; }
                     vertices[coord_index[i]].color = &color[color_index[i]];
                 }
             }
@@ -3089,7 +3089,7 @@
                      i < normal_index.size();
                      ++i) {
                     if (normal_index[i] < 0) { continue; }
-                    if (!(coord_index[i] < coord.size())) { continue; }
+                    if (!(size_t(coord_index[i]) < coord.size())) { continue; }
                     vertices[coord_index[i]].normal = &normal[normal_index[i]];
                 }
             }
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 | 
| 
      
      
      From: <br...@us...> - 2008-08-21 07:56:22
       | 
| Revision: 3520
          http://openvrml.svn.sourceforge.net/openvrml/?rev=3520&view=rev
Author:   braden
Date:     2008-08-21 07:56:31 +0000 (Thu, 21 Aug 2008)
Log Message:
-----------
Quell gcc warning about deprecated automatic conversion of string literals to char* (from const char*).
Modified Paths:
--------------
    trunk/ChangeLog
    trunk/src/script/java.cpp
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2008-08-21 07:49:40 UTC (rev 3519)
+++ trunk/ChangeLog	2008-08-21 07:56:31 UTC (rev 3520)
@@ -1,5 +1,11 @@
 2008-08-21 Braden McDaniel  <br...@en...>
 
+	* src/script/java.cpp (create_java_vm(JavaVM *&, JNIEnv *&)):
+	Quell gcc warning about deprecated automatic conversion of string
+	literals to char* (from const char*).
+
+2008-08-21 Braden McDaniel  <br...@en...>
+
 	* src/libopenvrml-gl/openvrml/gl/viewer.cpp
 	(openvrml::gl::viewer::do_insert_shell(unsigned int, const
 	std::vector<vec3f> & coord, const std::vector<int32> &
@@ -7,7 +13,8 @@
 	std::vector<int32> & color_index, const std::vector<vec3f> &
 	normal, const std::vector<int32> & normal_index, const
 	std::vector<vec2f> & tex_coord, const std::vector<int32> &
-	tex_coord_index)): Quell some warnings from gcc.
+	tex_coord_index)): Quell some warnings from gcc about comparing
+	signed and unsigned types.
 
 2008-08-15 Braden McDaniel  <br...@en...>
 
Modified: trunk/src/script/java.cpp
===================================================================
--- trunk/src/script/java.cpp	2008-08-21 07:49:40 UTC (rev 3519)
+++ trunk/src/script/java.cpp	2008-08-21 07:56:31 UTC (rev 3520)
@@ -107,9 +107,9 @@
 namespace {
 
     OPENVRML_JAVA_LOCAL lt_dlhandle libjvm_handle;
-    jint (OPENVRML_JAVA_LOCAL * CreateJavaVM)(JavaVM **, void **, void *);
+    OPENVRML_JAVA_LOCAL jint (*CreateJavaVM)(JavaVM **, void **, void *);
 
-    JavaVM * vm;
+    OPENVRML_JAVA_LOCAL JavaVM * vm;
 
     OPENVRML_JAVA_LOCAL class OPENVRML_JAVA_LOCAL load_libjvm {
     public:
@@ -319,7 +319,8 @@
         JavaVMOption options[2] = {};
         options[0].optionString =
             const_cast<char *>(classpath_option_str.c_str());
-        options[1].optionString = "-verbose:class,jni";
+        options[1].optionString =
+            const_cast<char *>("-verbose:class,jni");
 
         JavaVMInitArgs args;
         args.version = JNI_VERSION_1_2;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 | 
| 
      
      
      From: <br...@us...> - 2008-08-27 23:39:53
       | 
| Revision: 3539
          http://openvrml.svn.sourceforge.net/openvrml/?rev=3539&view=rev
Author:   braden
Date:     2008-08-27 23:40:03 +0000 (Wed, 27 Aug 2008)
Log Message:
-----------
Apply AC_CONFIG_MACRO_DIR; require at least autoconf 2.59.
Modified Paths:
--------------
    trunk/ChangeLog
    trunk/configure.ac
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2008-08-26 05:15:43 UTC (rev 3538)
+++ trunk/ChangeLog	2008-08-27 23:40:03 UTC (rev 3539)
@@ -1,3 +1,8 @@
+2008-08-27 Braden McDaniel  <br...@en...>
+
+	* configure.ac: Apply AC_CONFIG_MACRO_DIR; require at least
+	autoconf 2.59.
+
 2008-08-21 Braden McDaniel  <br...@en...>
 
 	* src/script/java.cpp (create_java_vm(JavaVM *&, JNIEnv *&)):
Modified: trunk/configure.ac
===================================================================
--- trunk/configure.ac	2008-08-26 05:15:43 UTC (rev 3538)
+++ trunk/configure.ac	2008-08-27 23:40:03 UTC (rev 3539)
@@ -1,6 +1,7 @@
 AC_INIT([OpenVRML], [0.17.8], [ope...@li...])
-AC_PREREQ([2.53])
+AC_PREREQ([2.59])
 AC_COPYRIGHT([Portions copyright 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 Braden McDaniel])
+AC_CONFIG_MACRO_DIR([m4])
 AC_CONFIG_FILES([Makefile]
                 [doc/Makefile]
                 [ide-projects/Makefile]
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 | 
| 
      
      
      From: <br...@us...> - 2008-08-27 23:42:58
       | 
| Revision: 3540
          http://openvrml.svn.sourceforge.net/openvrml/?rev=3540&view=rev
Author:   braden
Date:     2008-08-27 23:43:08 +0000 (Wed, 27 Aug 2008)
Log Message:
-----------
Use dist_ prefix instead of EXTRA_DIST for openvrml_player_ui_DATA.
Modified Paths:
--------------
    trunk/ChangeLog
    trunk/src/Makefile.am
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2008-08-27 23:40:03 UTC (rev 3539)
+++ trunk/ChangeLog	2008-08-27 23:43:08 UTC (rev 3540)
@@ -1,5 +1,11 @@
 2008-08-27 Braden McDaniel  <br...@en...>
 
+	* src/Makefile.am
+	(dist_openvrml_player_ui_DATA): Applied dist_ prefix.
+	(EXTRA_DIST): Removed openvrml_player_ui_DATA.
+
+2008-08-27 Braden McDaniel  <br...@en...>
+
 	* configure.ac: Apply AC_CONFIG_MACRO_DIR; require at least
 	autoconf 2.59.
 
Modified: trunk/src/Makefile.am
===================================================================
--- trunk/src/Makefile.am	2008-08-27 23:40:03 UTC (rev 3539)
+++ trunk/src/Makefile.am	2008-08-27 23:43:08 UTC (rev 3540)
@@ -367,7 +367,7 @@
         $(CURL_LIBS)
 
 openvrml_player_uidir = $(datadir)/openvrml-player/ui
-openvrml_player_ui_DATA = openvrml-player/openvrml-player.ui
+dist_openvrml_player_ui_DATA = openvrml-player/openvrml-player.ui
 
 openvrml_player_openvrml_player_SOURCES = \
         openvrml-player/filechooserdialog.cpp \
@@ -376,8 +376,7 @@
 
 EXTRA_DIST = \
         libopenvrml/openvrml-config.h.in \
-        libopenvrml-gl/openvrml-gl-config.h.in \
-        $(openvrml_player_ui_DATA)
+        libopenvrml-gl/openvrml-gl-config.h.in
 
 #
 # Automake 1.10 seems to need this for distcheck to work.
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 | 
| 
      
      
      From: <br...@us...> - 2008-08-27 23:44:27
       | 
| Revision: 3541
          http://openvrml.svn.sourceforge.net/openvrml/?rev=3541&view=rev
Author:   braden
Date:     2008-08-27 23:44:37 +0000 (Wed, 27 Aug 2008)
Log Message:
-----------
Add component XML descriptors to the distribution.
Modified Paths:
--------------
    trunk/ChangeLog
    trunk/data/Makefile.am
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2008-08-27 23:43:08 UTC (rev 3540)
+++ trunk/ChangeLog	2008-08-27 23:44:37 UTC (rev 3541)
@@ -1,5 +1,11 @@
 2008-08-27 Braden McDaniel  <br...@en...>
 
+	* data/Makefile.am
+	(dist_component_DATA): Add component XML descriptors to the
+	distribution.
+
+2008-08-27 Braden McDaniel  <br...@en...>
+
 	* src/Makefile.am
 	(dist_openvrml_player_ui_DATA): Applied dist_ prefix.
 	(EXTRA_DIST): Removed openvrml_player_ui_DATA.
Modified: trunk/data/Makefile.am
===================================================================
--- trunk/data/Makefile.am	2008-08-27 23:43:08 UTC (rev 3540)
+++ trunk/data/Makefile.am	2008-08-27 23:44:37 UTC (rev 3541)
@@ -1,5 +1,5 @@
 componentdir = $(pkgdatadir)/component
-component_DATA = \
+dist_component_DATA = \
         component/vrml97.xml \
         component/core.xml \
         component/time.xml \
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 | 
| 
      
      
      From: <br...@us...> - 2008-08-31 21:04:43
       | 
| Revision: 3559
          http://openvrml.svn.sourceforge.net/openvrml/?rev=3559&view=rev
Author:   braden
Date:     2008-08-31 21:04:44 +0000 (Sun, 31 Aug 2008)
Log Message:
-----------
Culled redundant includes.
Modified Paths:
--------------
    trunk/ChangeLog
    trunk/src/libopenvrml/openvrml/browser.h
    trunk/src/libopenvrml/openvrml/field_value.h
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2008-08-31 21:01:36 UTC (rev 3558)
+++ trunk/ChangeLog	2008-08-31 21:04:44 UTC (rev 3559)
@@ -1,3 +1,12 @@
+2008-08-31 Braden McDaniel  <br...@en...>
+
+	Culled redundant includes.
+
+	* src/libopenvrml/openvrml/browser.h: Don't need to include
+	read_write_mutex.h here.
+	* src/libopenvrml/openvrml/script.h: Don't need to include
+	boost/thread/mutex.hpp here.
+
 2008-08-27 Braden McDaniel  <br...@en...>
 
 	* data/Makefile.am
Modified: trunk/src/libopenvrml/openvrml/browser.h
===================================================================
--- trunk/src/libopenvrml/openvrml/browser.h	2008-08-31 21:01:36 UTC (rev 3558)
+++ trunk/src/libopenvrml/openvrml/browser.h	2008-08-31 21:04:44 UTC (rev 3559)
@@ -23,7 +23,6 @@
 #   define OPENVRML_BROWSER_H
 
 #   include <boost/thread.hpp>
-#   include <openvrml/read_write_mutex.h>
 #   include <openvrml/script.h>
 
 namespace openvrml {
Modified: trunk/src/libopenvrml/openvrml/field_value.h
===================================================================
--- trunk/src/libopenvrml/openvrml/field_value.h	2008-08-31 21:01:36 UTC (rev 3558)
+++ trunk/src/libopenvrml/openvrml/field_value.h	2008-08-31 21:04:44 UTC (rev 3559)
@@ -31,7 +31,6 @@
 #   include <boost/scoped_ptr.hpp>
 #   include <boost/shared_ptr.hpp>
 #   include <boost/utility.hpp>
-#   include <boost/thread/mutex.hpp>
 #   include <openvrml/basetypes.h>
 #   include <openvrml/read_write_mutex.h>
 
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 | 
| 
      
      
      From: <br...@us...> - 2008-09-01 04:30:21
       | 
| Revision: 3560
          http://openvrml.svn.sourceforge.net/openvrml/?rev=3560&view=rev
Author:   braden
Date:     2008-09-01 04:30:28 +0000 (Mon, 01 Sep 2008)
Log Message:
-----------
Don't need to include <boost/scoped_ptr.hpp> here.
Modified Paths:
--------------
    trunk/ChangeLog
    trunk/src/libopenvrml/openvrml/script.h
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2008-08-31 21:04:44 UTC (rev 3559)
+++ trunk/ChangeLog	2008-09-01 04:30:28 UTC (rev 3560)
@@ -1,3 +1,8 @@
+2008-09-01 Braden McDaniel  <br...@en...>
+
+	* src/libopenvrml/openvrml/script.h: Don't need to include
+	<boost/scoped_ptr.hpp> here.
+
 2008-08-31 Braden McDaniel  <br...@en...>
 
 	Culled redundant includes.
@@ -4,7 +9,7 @@
 
 	* src/libopenvrml/openvrml/browser.h: Don't need to include
 	read_write_mutex.h here.
-	* src/libopenvrml/openvrml/script.h: Don't need to include
+	* src/libopenvrml/openvrml/field_value.h: Don't need to include
 	boost/thread/mutex.hpp here.
 
 2008-08-27 Braden McDaniel  <br...@en...>
Modified: trunk/src/libopenvrml/openvrml/script.h
===================================================================
--- trunk/src/libopenvrml/openvrml/script.h	2008-08-31 21:04:44 UTC (rev 3559)
+++ trunk/src/libopenvrml/openvrml/script.h	2008-09-01 04:30:28 UTC (rev 3560)
@@ -22,7 +22,6 @@
 # ifndef OPENVRML_SCRIPT_H
 #   define OPENVRML_SCRIPT_H
 
-#   include <boost/scoped_ptr.hpp>
 #   include <openvrml/node.h>
 #   include <openvrml/event.h>
 
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 | 
| 
      
      
      From: <br...@us...> - 2008-09-06 04:06:43
       | 
| Revision: 3582
          http://openvrml.svn.sourceforge.net/openvrml/?rev=3582&view=rev
Author:   braden
Date:     2008-09-06 04:06:52 +0000 (Sat, 06 Sep 2008)
Log Message:
-----------
Use D-Bus for communication between openvrml-xembed and its hosts, openvrml-player and the Mozilla plug-in.
Modified Paths:
--------------
    trunk/ChangeLog
    trunk/README
    trunk/configure.ac
    trunk/lib/gtkglext/gdk/x11/gdkglcontext-x11.c
    trunk/mozilla-plugin/configure.ac
    trunk/mozilla-plugin/src/Makefile.am
    trunk/mozilla-plugin/src/openvrml.cpp
    trunk/src/Makefile.am
    trunk/src/openvrml-player/filechooserdialog.cpp
    trunk/src/openvrml-player/openvrml-player.ui
    trunk/src/openvrml-player/player.cpp
    trunk/src/openvrml-xembed/main.cpp
    trunk/src/openvrml-xembed/plugin_streambuf.cpp
    trunk/src/openvrml-xembed/plugin_streambuf.h
Added Paths:
-----------
    trunk/src/openvrml-player/curlbrowserhost.cpp
    trunk/src/openvrml-player/curlbrowserhost.h
    trunk/src/openvrml-xembed/browser-factory.xml
    trunk/src/openvrml-xembed/browser-host.xml
    trunk/src/openvrml-xembed/browser.cpp
    trunk/src/openvrml-xembed/browser.h
    trunk/src/openvrml-xembed/browser.xml
    trunk/src/openvrml-xembed/browserfactory.cpp
    trunk/src/openvrml-xembed/browserfactory.h
    trunk/src/openvrml-xembed/org.openvrml.BrowserControl.service.in
    trunk/src/openvrml-xembed/streamclient.cpp
    trunk/src/openvrml-xembed/streamclient.h
Removed Paths:
-------------
    trunk/src/openvrml-xembed/command_istream.cpp
    trunk/src/openvrml-xembed/command_istream.h
    trunk/src/openvrml-xembed/gtkvrmlbrowser.cpp
    trunk/src/openvrml-xembed/gtkvrmlbrowser.h
    trunk/src/openvrml-xembed/request_channel.h
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2008-09-06 03:01:00 UTC (rev 3581)
+++ trunk/ChangeLog	2008-09-06 04:06:52 UTC (rev 3582)
@@ -1,3 +1,253 @@
+2008-09-06 Braden McDaniel  <br...@en...>
+
+	Use D-Bus for communication between openvrml-xembed and its hosts,
+	openvrml-player and the Mozilla plug-in.
+
+	* README: Note changed openvrml-xembed usage.
+	* configure.ac: Check for D-Bus; emit the BrowserControl service
+	descriptor.
+	* lib/gtkglext/gdk/x11/gdkglcontext-x11.c
+	(_gdk_gl_context_destroy): Fixed usage of
+	g_object_remove_weak_pointer.
+	(_gdk_gl_context_set_gl_drawable): Fixed usage of
+	g_object_{add,remove}_weak_pointer.
+	* mozilla-plugin/configure.ac: Check for D-Bus; remove check for
+	GTK+.
+	* mozilla-plugin/src/Makefile.am
+	(AM_CXXFLAGS): Added DBUS_G_CFLAGS.
+	(BUILT_SOURCES): Build browser-host-server-glue.h.
+	(openvrml_la_LDFLAGS): Added DBUS_G_LIBS.
+	* mozilla-plugin/src/openvrml.cpp
+	(OpenvrmlNpBrowserHost): GObject implementing the
+	org.openvrml.BrowserHost D-Bus interface.
+	(OpenvrmlNpBrowserHostClass): Class object for
+	OpenvrmlNpBrowserHost.
+	(openvrml_np_browser_host_get_type()): GType object for
+	OpenvrmlNpBrowserHost.
+	(plugin_instance): Use void* for window rather than
+	GdkNativeWindow; no reason for this type to be the plug-in code's
+	only GTK+ dependency.  Removed members command_channel,
+	request_channel, request_channel_watch_id, and request_line.
+	Added browser_host--the org.openvrml.BrowserHost--and browser--the
+	proxy for the org.openvrml.Browser object.  Removed write_command
+	member funtion; added member functions new_stream, destroy_stream,
+	and write.  The latter are delegated to by NPP_NewStream,
+	NPP_DestroyStream, and NPP_Write, respectively.
+	(openvrml_np_browser_host_init(OpenvrmlNpBrowserHost *)): Instance
+	init function for the OpenvrmlNpBrowserHost GObject.
+	(openvrml_np_browser_host_class_init(OpenvrmlNpBrowserHostClass *)):
+	Class init function for the OpenvrmlNpBrowserHost GObject.
+	(openvrml_np_browser_host_get_url(OpenvrmlNpBrowserHost *, const
+	char *, GError **)): Implementation of
+	org.openvrml.BrowserHost.GetUrl.  We can delegate directly to
+	NPN_GetURL.
+	(openvrml_np_browser_host_set_world_url(OpenvrmlNpBrowserHost *,
+	const char * url, GError **)): Implementation of
+	org.openvrml.BrowserHost.SetWorldUrl.  For now, at least, we don't
+	need this to do anything.
+	(NPP_GetMIMDescription()): Use an explicit const_cast to quell the
+	gcc warning about using a string literal as a (nonconst) char*.
+	(NPP_NewStream(NPP, NPMIMEType, NPStream *, NPBool, uint16 *)):
+	Delegate to plugin_instance::new_stream.
+	(NPP_DestroyStream(NPP, NPStream *, NPError)): Delegate to
+	plugin_instance::destroy_stream.
+	(NPP_Write(NPP, NPStream *, int32, int32, void *)): Delegate to
+	plugin_instance::write.
+	(plugin_instance::plugin_instance(NPP)): Initialize the
+	browser_host; set its npp member.
+	(plugin_instance::~plugin_instance()): Emit the Shutdown signal.
+	(get_browser(DBusGConnection *, const char *, const char *,
+	guint64, GError **)): Get the org.openvrml.Browser proxy.
+	(plugin_instance::set_window(NPWindow &)): Get the plug via D-Bus;
+	we don't need (explicitly) to start up the openvrml-xembed process
+	here anymore.
+	(plugin_instance::new_stream(NPMIMEType, NPStream *)): Make a
+	blocking call to org.openvrml.Browser.NewStream.
+	(plugin_instance::destroy_stream(NPStream *)): Make a nonblocking
+	call to org.openvrml.Browser.DestroyStream.
+	(plugin_instance::write(NPStream *, int32, void *)): Make a
+	nonblocking call to org.openvrml.Browser.Write.
+	(plugin_instance::write_command(const std::string &)): Removed.
+	(request_data_available(GIOChannel *, GIOCondition, gpointer)):
+	Removed.
+	* src/Makefile.am
+	(session_bus_services_DATA): Install the
+	org.openvrml.BrowserControl service descriptor.
+	(noinst_HEADERS): Removed obsolete
+	openvrml-xembed/command_istream.h,
+	openvrml-xembed/request_channel.h, and
+	openvrml-xembed/gtkvrmlbrowser.h.
+	(openvrml_xembed_openvrml_xembed_CPPFLAGS): Look in the
+	openvrml-xembed builddir for headers (specifically, the ones
+	generated by dbus-binding-tool).
+	(openvrml_xembed_datadir): (Sub)package-specific data directory.
+	(openvrml_xembed_dbusdir): We'll install the D-Bus interface XML
+	here for lack of a better idea.
+	(dist_openvrml_xembed_dbus_DATA): D-Bus interface XML.
+	(BUILT_SOURCES): Build the introspection data headers with
+	dbus-binding-tool.
+	* src/openvrml-xembed/org.openvrml.BrowserControl.service.in
+	(openvrml_player_openvrml_player_CPPFLAGS): Look in the
+	openvrml-player builddir for headers (specifically, the ones
+	generated by dbus-binding-tool).
+	(openvrml_player_openvrml_player_CXXFLAGS): Added DBUS_G_CFLAGS.
+	(openvrml_player_openvrml_player_LDFLAGS): Added DBUS_G_LIBS.
+	(openvrml_player_openvrml_player_SOURCES): Added
+	openvrml-player/curlbrowserhost.{cpp,h}.
+	(EXTRA_DIST): Added
+	openvrml-xembed/org.openvrml.BrowserControl.service.in (configure
+	input).
+	(CLEANFILES): Added BUILT_SOURCES.
+	(DISTCLEANFILES): Clean up configure-generated files.
+	* src/openvrml-xembed/browser.cpp: Added file.
+	OpenvrmlXembedBrowser implementation (evolved from the now-defunct
+	GtkVrmlBrowser).
+	* src/openvrml-xembed/browser.h: Added file.
+	OpenvrmlXembedBrowser implements the org.openvrml.Browser D-Bus
+	interface.
+	* src/openvrml-xembed/browser.xml: Added
+	file. org.openvrml.Browser D-Bus interface definition.
+	* src/openvrml-xembed/browserfactory.cpp: Added file.
+	OpenvrmlXembedBrowserFactory implementation.
+	* src/openvrml-xembed/browserfactory.h: Added file.
+	OpenvrmlXembedBrowserFactory implements the
+	org.openvrml.BrowserFactory D-Bus interface.
+	* src/openvrml-xembed/browser-factory.xml: Added file.
+	org.openvrml.BrowserFactory D-Bus interface definition.
+	* src/openvrml-xembed/browser-host.xml: Added file.
+	org.openvrml.BrowserHost D-Bus interface definition.
+	* src/openvrml-xembed/command_istream.cpp: Removed.
+	* src/openvrml-xembed/command_istream.h: Removed.
+	* src/openvrml-xembed/gtkvrmlbrowser.cpp: Removed.
+	* src/openvrml-xembed/gtkvrmlbrowser.h: Removed.
+	* src/openvrml-xembed/plugin_streambuf.cpp
+	(openvrml_xembed::plugin_streambuf::plugin_streambuf(const
+	std::string &, uninitialized_plugin_streambuf_map &,
+	plugin_streambuf_map &)): Maintain references to the
+	uninitialized_plugin_streambuf_map and the plugin_streambuf_map.
+	Now that these maps are per-OpenvrmlXembedBrowser instance, we
+	cannot access them as globals.
+	(openvrml_xembed::plugin_streambuf::state() const): Get the
+	current state of the streambuf (i.e., requested, uninitialized, or
+	initialized).
+	(openvrml_xembed::plugin_streambuf::set_get_url_result(int)):
+	Since we no longer have the requested_plugin_streambuf_map, set
+	the state to uninitialized on success; or simply remove the stream
+	from the uninitialized_map_ on failure.
+	(openvrml_xembed::plugin_streambuf::fail()): Use the member
+	uninitialized_map_.
+	(openvrml_xembed::requested_plugin_streambuf_map::find(const
+	std::string &) const): Removed.
+	(openvrml_xembed::requested_plugin_streambuf_map::insert(const
+	std::string &, const boost::shared_ptr<plugin_streambuf> &)):
+	Removed.
+	(openvrml_xembed::requested_plugin_streambuf_map::map_entry_matches_streambuf):
+	Removed.
+	(openvrml_xembed::requested_plugin_streambuf_map::erase(const
+	plugin_streambuf &)): Removed.
+	(openvrml_xembed::requested_plugin_streambuf_map_): Removed.
+	(openvrml_xembed::uninitialized_plugin_streambuf_map_): Removed.
+	(openvrml_xembed::plugin_streambuf_map_): Removed.
+	* src/openvrml-xembed/plugin_streambuf.h
+	(openvrml_xembed::plugin_streambuf): Added state_id enum along
+	with state_ member and the corresponding state() accessor.  Added
+	reference members for the uninitialized_plugin_streambuf_map and
+	the plugin_streambuf_map.
+	(openvrml_xembed::requested_plugin_streambuf_map): Removed.
+	* src/openvrml-xembed/main.cpp
+	(initial_stream_uri): Moved to browser.cpp.
+	(openvrml_xembed::request_channel): Removed.
+	(openvrml_xembed::request_channel_mutex): Removed.
+	(openvrml_xembed::event_listener_id_map): Removed.
+	(openvrml_xembed::command_istream_reader): Removed.
+	(openvrml_xembed::initial_stream_reader): Moved to browser.cpp.
+	(openvrml_xembed::command_channel_loop): Removed.
+	(main(int, char *[])): Removed --initial-stream option and the XID
+	argument.  Rather than setting up GIOChannels, create the
+	BrowserFactory.
+	(openvrml_xembed_browser_event_func(GtkVrmlBrowser *,
+	GtkVrmlBrowserEvent, gpointer)): Removed.
+	(command_channel_shutdown(GIOChannel *)): Removed.
+	(request_channel_shutdown(GIOChannel *)): Removed.
+	* src/openvrml-xembed/request_channel.h: Removed.
+	* src/openvrml-xembed/streamclient.cpp: Added;
+	OpenvrmlXembedStreamClient interface definition.
+	* src/openvrml-xembed/streamclient.h: Added; a gobject interface
+	that a host can stream to.
+	* src/openvrml-player/openvrml-player.ui: Don't specify an object
+	target for the openvrml_player_on_file_open_activated signal
+	handler.  Create a child OpenvrmlPlayerCurlBrowserHost instead of
+	a GtkSocket.
+	* src/openvrml-player/curlbrowserhost.cpp: Added.
+	OpenvrmlPlayerCurlBrowserHost implementation.
+	* src/openvrml-player/curlbrowserhost.h: Added.
+	OpenvrmlPlayerCurlBrowserHost inherits GtkSocket and implements
+	the org.openvrml.BrowserHost D-Bus interface.
+	* src/openvrml-player/player.cpp
+	(command_channel): Removed.
+	(request_channel): Removed.
+	(request_channel_watch_id): Removed.
+	(signal_data): Added.  Data for GUI (GtkBuilder) signal handlers.
+	(curl_stream_data): Moved to curlbrowserhost.cpp.
+	(curl_source_callback_data): Removed.
+	(request_data): Removed.
+	(location_entry): Removed.
+	(OPENVRML_PLAYER_CURL_EASY_RETURN_VAL_IF_ERROR): Moved to
+	curlbrowserhost.cpp.
+	(OPENVRML_PLAYER_CURL_MULTI_RETURN_IF_ERROR): Moved to
+	curlbrowserhost.cpp.
+	(OPENVRML_PLAYER_CURL_MULTI_RETURN_VAL_IF_ERROR): Moved to
+	curlbrowserhost.cpp.
+	(main(int, char *[])): Got rid of all the command/request channel
+	setup stuff.  The browser control is now created by the
+	OpenvrmlPlayerCurlControlHost.  All we have to do in main is set
+	up the GUI.  Note that since the control isn't created until
+	realize, we defer calling _load_url until then.
+	(get_openvrml_xembed_cmd(gint &, char **&)): Removed.
+	(spawn_openvrml_xembed(GtkNativeWindow, gint &, gint &)): Removed.
+	(set_locationentry_text(const gchar *)): Removed.
+	(load_url(const gchar *)): Removed.
+	(CURLSource): Moved to curlbrowserhost.cpp.
+	(curl_source_new(CURLM *)): Moved to curlbrowserhost.cpp.
+	(reset_fds(CURLSource &)): Moved to curlbrowserhost.cpp.
+	(openvrml_player_curl_prepare(GSource *, gint *)): Moved to
+	curlbrowserhost.cpp as
+	openvrml_player_curl_browser_host_curl_prepare.
+	(openvrml_player_curl_check(GSource *)): Moved to
+	curlbrowserhost.cpp as
+	openvrml_player_curl_browser_host_curl_check.
+	(openvrml_player_curl_dispatch(GSource *, GSourceFunc, gpointer)):
+	Moved to curlbrowserhost.cpp as
+	openvrml_player_curl_browser_host_curl_dispatch.
+	(openvrml_player_curl_finalize(GSource *)): Moved to
+	curlbrowserhost.cpp as
+	openvrml_player_curl_browser_host_curl_finalize.
+	(openvrml_player_curl_source_callback(gpointer)): Moved to
+	curlbrowserhost.cpp as
+	openvrml_player_curl_browser_host_curl_source_callback.
+	(openvrml_player_request_data_available(GIOChannel *,
+	GIOCondition, gpointer)): Removed.
+	(openvrml_player_curl_write(void *, size_t, size_t, void *)):
+	Moved to curlbrowserhost.cpp as
+	openvrml_player_curl_browser_host_curl_write.
+	(openvrml_player_on_file_open_activated(GtkAction *, gpointer)):
+	Use signal_data passed in the user_data argument.
+	(openvrml_player_on_locationentry_activated(GtkEntry *,
+	gpointer)): Use signal_data passed in the user_data argument.
+	(openvrml_player_quit): No more quit dance; just call
+	gtk_main_quit.
+	(openvrml_player_watch_child(GPid, gint, gpointer)): Removed.
+	(openvrml_player_on_browserhost_realize(GtkWidget *, gpointer)):
+	Load the URL passed in user_data; see main.
+	(write_command(const std::string &)): Removed.
+	(curl_stream_data(CURL *, const char *)): Moved to
+	curlbrowserhost.cpp.
+	(curl_stream_data::handle() const): Moved to curlbrowserhost.cpp.
+	(curl_stream_data::url() const): Moved to curlbrowserhost.cpp.
+	(curl_stream_data::initialize()): Moved to curlbrowserhost.cpp.
+	(curl_stream_data::initialized() const): Moved to
+	curlbrowserhost.cpp.
+
 2008-09-01 Braden McDaniel  <br...@en...>
 
 	* src/libopenvrml/openvrml/script.h: Don't need to include
Modified: trunk/README
===================================================================
--- trunk/README	2008-09-06 03:01:00 UTC (rev 3581)
+++ trunk/README	2008-09-06 04:06:52 UTC (rev 3582)
@@ -273,11 +273,12 @@
 Mozilla-based browser will show a listing of successfully installed
 plug-ins.
 
-   It is possible, for testing or other convenience, to run the
-plug-in from the build directories.  A symbolic link to the plug-in
-module "openvrml.so" must be made in the Mozilla plug-in directory and
-the environment variable "OPENVRML_XEMBED" must be set to the full
-path name of the "openvrml-xembed" executable.
+   To run openvrml-player or the Mozilla plug-in from the build
+directories, you must first start an openvrml-xembed process.  Once
+openvrml-xembed has been installed, D-Bus will start it automatically
+as needed.  Additionally, to run the plug-in from the build
+directories, a symbolic link to the plug-in module "openvrml.so" must
+be made in the Mozilla plug-in directory.
 
 
 Conformance
Modified: trunk/configure.ac
===================================================================
--- trunk/configure.ac	2008-09-06 03:01:00 UTC (rev 3581)
+++ trunk/configure.ac	2008-09-06 04:06:52 UTC (rev 3582)
@@ -10,6 +10,7 @@
                 [models/textures/Makefile]
                 [lib/Makefile]
                 [src/Makefile]
+                [src/openvrml-xembed/org.openvrml.BrowserControl.service]
                 [src/libopenvrml/openvrml-config.h]
                 [src/libopenvrml-gl/openvrml-gl-config.h]
                 [src/script/Makefile]
@@ -161,6 +162,13 @@
 # openvrml-xembed and openvrml-player both use GOption, which was
 # introduced in GLib 2.6.
 #
+PKG_CHECK_MODULES([DBUS_G], [dbus-glib-1 glib-2.0 >= 2.6], ,
+                  [have_dbus_glib=no])
+AC_PATH_PROG([DBUS_BINDING_TOOL], [dbus-binding-tool])
+session_bus_servicesdir=`$PKG_CONFIG --variable=session_bus_services_dir dbus-1`
+AC_SUBST([session_bus_servicesdir])
+
+#
 # openvrml-player uses GtkBuilder, which was introduced in GTK+ 2.12.
 #
 PKG_CHECK_MODULES([GTK], [gtk+-2.0 >= 2.12 gthread-2.0 glib-2.0 >= 2.6], ,
Modified: trunk/lib/gtkglext/gdk/x11/gdkglcontext-x11.c
===================================================================
--- trunk/lib/gtkglext/gdk/x11/gdkglcontext-x11.c	2008-09-06 03:01:00 UTC (rev 3581)
+++ trunk/lib/gtkglext/gdk/x11/gdkglcontext-x11.c	2008-09-06 04:06:52 UTC (rev 3582)
@@ -107,9 +107,8 @@
 
   if (impl->gldrawable != NULL)
     {
-      gpointer gldrawable_location = impl->gldrawable;
       g_object_remove_weak_pointer (G_OBJECT (impl->gldrawable),
-                                    &gldrawable_location);
+                                    (gpointer *) &impl->gldrawable);
       impl->gldrawable = NULL;
     }
 
@@ -361,18 +360,16 @@
 
   if (impl->gldrawable != NULL)
     {
-      gpointer gldrawable_location = impl->gldrawable;
       g_object_remove_weak_pointer (G_OBJECT (impl->gldrawable),
-                                    &gldrawable_location);
+                                    (gpointer *) &impl->gldrawable);
       impl->gldrawable = NULL;
     }
 
   if (gldrawable != NULL && GDK_IS_GL_DRAWABLE (gldrawable))
     {
       impl->gldrawable = gldrawable;
-      gpointer gldrawable_location = impl->gldrawable;
-      g_object_add_weak_pointer (G_OBJECT (impl->gldrawable),
-                                 &gldrawable_location);
+      g_object_add_weak_pointer (G_OBJECT (gldrawable),
+                                 (gpointer *) &impl->gldrawable);
     }
 }
 
Modified: trunk/mozilla-plugin/configure.ac
===================================================================
--- trunk/mozilla-plugin/configure.ac	2008-09-06 03:01:00 UTC (rev 3581)
+++ trunk/mozilla-plugin/configure.ac	2008-09-06 04:06:52 UTC (rev 3582)
@@ -29,17 +29,15 @@
                                                         [PKG_CHECK_MODULES([MOZILLA_PLUGIN], [mozilla-plugin >= 1.6],
                                                                            [mozilla_plugin_pkg=mozilla-plugin],
                                                                            [have_mozilla_plugin=no])])])])
-PKG_CHECK_MODULES([GTK], [gtk+-2.0], , [have_gtk=no])
+PKG_CHECK_MODULES([DBUS_G], [dbus-glib-1], , [have_dbus_glib=no])
+AC_PATH_PROG([DBUS_BINDING_TOOL], [dbus-binding-tool])
 
-if test "X$enable_mozilla_plugin" != "Xno"; then
-  if test "X$have_mozilla_plugin" = "Xno"; then
-    AC_MSG_FAILURE([Mozilla plug-in development headers are required to build the Mozilla plug-in.])
-  fi
-  if test "X$have_gtk" = "Xno"; then
-    AC_MSG_FAILURE([GTK+ is required to build the Mozilla plug-in])
-  fi
-fi
+AS_IF([test "X$enable_mozilla_plugin" != "Xno"],
+      [AS_IF([test "X$have_mozilla_plugin" = "Xno"],
+             [AC_MSG_FAILURE([Mozilla plug-in development headers are required to build the Mozilla plug-in.])])
+       AS_IF([test "X$have_dbus_glib" = "Xno"],
+             [AC_MSG_FAILURE([The D-Bus GLib binding is required to build the Mozilla plug-in])])])
 AM_CONDITIONAL([ENABLE_MOZILLA_PLUGIN],
-  [test "X$enable_mozilla_plugin" != "Xno" -a "X$have_gtk" != "Xno"])
+  [test "X$enable_mozilla_plugin" != "Xno" -a "X$have_dbus_glib" != "Xno"])
 
 AC_OUTPUT
Modified: trunk/mozilla-plugin/src/Makefile.am
===================================================================
--- trunk/mozilla-plugin/src/Makefile.am	2008-09-06 03:01:00 UTC (rev 3581)
+++ trunk/mozilla-plugin/src/Makefile.am	2008-09-06 04:06:52 UTC (rev 3582)
@@ -1,17 +1,28 @@
 AM_CPPFLAGS = \
         -DGTK_DISABLE_DEPRECATED \
         -DOPENVRML_LIBEXECDIR_=\"$(libexecdir)\"
-AM_CXXFLAGS = $(MOZILLA_PLUGIN_CFLAGS) $(GTK_CFLAGS)
+AM_CXXFLAGS = $(MOZILLA_PLUGIN_CFLAGS) $(DBUS_G_CFLAGS)
 
 mozpluginsdir = $(libdir)/mozilla/plugins
 
 if ENABLE_MOZILLA_PLUGIN
 mozplugins_LTLIBRARIES = openvrml.la
+BUILT_SOURCES = browser-host-server-glue.h
 endif
 
 openvrml_la_SOURCES = openvrml.cpp
 openvrml_la_LDFLAGS = \
         -module -avoid-version \
-        $(MOZILLA_PLUGIN_LIBS)
+        $(MOZILLA_PLUGIN_LIBS) \
+        $(DBUS_G_LIBS)
 
+browser-host-server-glue.h: $(top_srcdir)/../src/openvrml-xembed/browser-host.xml
+	$(LIBTOOL) --mode=execute $(DBUS_BINDING_TOOL) \
+                   --prefix=openvrml_np_browser_host   \
+                   --mode=glib-server                  \
+                   --output=$@                         \
+                   $?
+
 EXTRA_DIST = $(openvrml_la_SOURCES)
+
+CLEANFILES = $(BUILT_SOURCES)
Modified: trunk/mozilla-plugin/src/openvrml.cpp
===================================================================
--- trunk/mozilla-plugin/src/openvrml.cpp	2008-09-06 03:01:00 UTC (rev 3581)
+++ trunk/mozilla-plugin/src/openvrml.cpp	2008-09-06 04:06:52 UTC (rev 3582)
@@ -2,7 +2,7 @@
 //
 // OpenVRML Mozilla plug-in
 //
-// Copyright 2004, 2005, 2006, 2007  Braden McDaniel
+// Copyright 2004, 2005, 2006, 2007, 2008  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
@@ -33,21 +33,50 @@
 # include <boost/scoped_ptr.hpp>
 # include <npupp.h>
 # if defined MOZ_X11
-#   include <fcntl.h>
-#   include <gdk/gdkx.h>
+#   include <dbus/dbus-glib-bindings.h>
 # else
 #   error Unsupported toolkit.
 # endif
 
+# define OPENVRML_NP_TYPE_BROWSER_HOST (openvrml_np_browser_host_get_type())
+# define OPENVRML_NP_BROWSER_HOST(obj) (G_TYPE_CHECK_INSTANCE_CAST((obj), OPENVRML_NP_TYPE_BROWSER_HOST, OpenvrmlNpBrowserHost))
+# define OPENVRML_NP_BROWSER_HOST_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS((obj), OPENVRML_NP_TYPE_BROWSER_HOST, OpenvrmlNpBrowserHostClass))
+
+G_BEGIN_DECLS
+
+typedef struct OpenvrmlNpBrowserHost_ OpenvrmlNpBrowserHost;
+typedef struct OpenvrmlNpBrowserHostClass_ OpenvrmlNpBrowserHostClass;
+
+struct OpenvrmlNpBrowserHost_ {
+    GObject parent;
+    gchar * path;
+    NPP npp;
+};
+
+struct OpenvrmlNpBrowserHostClass_ {
+    GObjectClass parent;
+    DBusGConnection * connection;
+    gchar * host_name;
+};
+
+GType openvrml_np_browser_host_get_type();
+
+int
+openvrml_np_browser_host_get_url(OpenvrmlNpBrowserHost * host, const char * url,
+                                 GError ** error);
+void openvrml_np_browser_host_set_world_url(OpenvrmlNpBrowserHost * host,
+                                            const char * url, GError ** error);
+
+G_END_DECLS
+
+# include "browser-host-server-glue.h"
+
 using namespace boost::multi_index::detail;  // for scope_guard
 
 namespace {
 
     void printerr(const char * str);
 
-    extern "C" gboolean request_data_available(GIOChannel * source,
-                                               GIOCondition condition,
-                                               gpointer data);
     class plugin_instance;
 
     typedef bool (plugin_instance::*script_callback_t)(const NPVariant *,
@@ -71,18 +100,12 @@
 
 
     class plugin_instance : boost::noncopyable {
-        friend gboolean request_data_available(GIOChannel * source,
-                                               GIOCondition condition,
-                                               gpointer data);
-
         const NPP npp;
-        GdkNativeWindow window;
+        void * window;
         int x, y;
         int width, height;
-        GIOChannel * command_channel;
-        GIOChannel * request_channel;
-        guint request_channel_watch_id;
-        std::stringstream request_line;
+        OpenvrmlNpBrowserHost * browser_host;
+        DBusGProxy * browser;
 
     public:
         NPObject * const npobj;
@@ -93,8 +116,11 @@
         void set_window(NPWindow & window)
             throw (std::bad_alloc, std::runtime_error);
         void HandleEvent(void * event) throw ();
-        ssize_t write_command(const std::string & command);
 
+        NPError new_stream(NPMIMEType type, NPStream * stream);
+        NPError destroy_stream(NPStream * stream);
+        int32 write(NPStream * stream, int32 len, void * buffer);
+
         //
         // Scripting API method implementations.
         //
@@ -105,6 +131,87 @@
     };
 } // namespace
 
+G_DEFINE_TYPE(OpenvrmlNpBrowserHost, openvrml_np_browser_host, G_TYPE_OBJECT)
+
+void openvrml_np_browser_host_init(OpenvrmlNpBrowserHost * const host)
+{
+    static size_t count = 0;
+    host->path = g_strdup_printf("/org/openvrml/BrowserHost/%u/%lu",
+                                 getpid(), count++);
+    dbus_g_connection_register_g_object(
+        OPENVRML_NP_BROWSER_HOST_GET_CLASS(host)->connection,
+        host->path,
+        G_OBJECT(host));
+}
+
+namespace {
+    enum np_host_signal_id {
+        shutdown_id,
+        last_signal_id
+    };
+
+    G_GNUC_INTERNAL guint signals[last_signal_id];
+}
+
+void openvrml_np_browser_host_class_init(OpenvrmlNpBrowserHostClass * klass)
+{
+    signals[shutdown_id] =
+        g_signal_new("shutdown",
+                     G_OBJECT_CLASS_TYPE(klass),
+                     GSignalFlags(G_SIGNAL_RUN_LAST | G_SIGNAL_DETAILED),
+                     0,
+                     NULL, NULL,
+                     g_cclosure_marshal_VOID__VOID,
+                     G_TYPE_NONE, 0);
+
+    GError * error = 0;
+    scope_guard error_guard = make_guard(g_error_free, boost::ref(error));
+    klass->connection = dbus_g_bus_get(DBUS_BUS_SESSION, &error);
+    if (!klass->connection) {
+        g_critical("Failed to open connection to bus: %s", error->message);
+        return;
+    }
+
+    klass->host_name = g_strdup_printf("org.openvrml.BrowserHost-%u",
+                                       getpid());
+
+    DBusGProxy * driver_proxy =
+        dbus_g_proxy_new_for_name(klass->connection,
+                                  DBUS_SERVICE_DBUS,
+                                  DBUS_PATH_DBUS,
+                                  DBUS_INTERFACE_DBUS);
+    scope_guard driver_proxy_guard = make_guard(g_object_unref, driver_proxy);
+    boost::ignore_unused_variable_warning(driver_proxy_guard);
+
+    guint request_ret;
+    if (!org_freedesktop_DBus_request_name(driver_proxy,
+                                           klass->host_name,
+                                           0, &request_ret,
+                                           &error)) {
+        g_critical("Request for name \"%s\" failed: %s",
+                   klass->host_name, error->message);
+        return;
+    }
+
+    dbus_g_object_type_install_info(
+        OPENVRML_NP_TYPE_BROWSER_HOST,
+        &dbus_glib_openvrml_np_browser_host_object_info);
+    error_guard.dismiss();
+}
+
+int openvrml_np_browser_host_get_url(OpenvrmlNpBrowserHost * const host,
+                                     const char * const url,
+                                     GError ** /* error */)
+{
+    return NPN_GetURL(host->npp, url, 0);
+}
+
+void openvrml_np_browser_host_set_world_url(OpenvrmlNpBrowserHost * /* host */,
+                                            const char * /* url */,
+                                            GError ** /* error */)
+{
+}
+
 char * NP_GetMIMEDescription()
 {
     return NPP_GetMIMEDescription();
@@ -279,9 +386,11 @@
 
 char * NPP_GetMIMEDescription()
 {
-    return "model/x3d+vrml:x3dv:X3D world;"
-           "model/vrml:wrl:VRML world;"
-           "x-world/x-vrml:wrl:VRML world";
+    static const char mimeDescription[] =
+        "model/x3d+vrml:x3dv:X3D world;"
+        "model/vrml:wrl:VRML world;"
+        "x-world/x-vrml:wrl:VRML world";
+    return const_cast<char *>(&mimeDescription[0]);
 }
 
 NPError NPP_Initialize()
@@ -431,20 +540,14 @@
                       NPBool /* seekable */,
                       uint16 * const stype)
 {
-    if (!instance) { return NPERR_INVALID_INSTANCE_ERROR; }
+    if (!instance || !instance->pdata) { return NPERR_INVALID_INSTANCE_ERROR; }
+
     *stype = NP_NORMAL;
 
-    assert(instance->pdata);
     plugin_instance & pluginInstance =
         *static_cast<plugin_instance *>(instance->pdata);
 
-    std::ostringstream command;
-    command << "new-stream " << size_t(stream) << ' ' << type << ' '
-            << stream->url << '\n';
-    const ssize_t bytes_written = pluginInstance.write_command(command.str());
-    return (bytes_written < 0)
-        ? NPERR_GENERIC_ERROR
-        : NPERR_NO_ERROR;
+    return pluginInstance.new_stream(type, stream);
 }
 
 NPError NPP_DestroyStream(const NPP instance,
@@ -456,12 +559,7 @@
     plugin_instance & pluginInstance =
         *static_cast<plugin_instance *>(instance->pdata);
 
-    std::ostringstream command;
-    command << "destroy-stream " << size_t(stream) << '\n';
-    const ssize_t bytes_written = pluginInstance.write_command(command.str());
-    return (bytes_written < 0)
-        ? NPERR_GENERIC_ERROR
-        : NPERR_NO_ERROR;
+    return pluginInstance.destroy_stream(stream);
 }
 
 /* PLUGIN DEVELOPERS:
@@ -499,14 +597,7 @@
     plugin_instance & pluginInstance =
         *static_cast<plugin_instance *>(instance->pdata);
 
-    std::ostringstream command;
-    command << "write " << size_t(stream) << ' ' << ' ' << len << '\n';
-    for (int32 i = 0; i < len; ++i) {
-        command.put(static_cast<char *>(buffer)[i]);
-    }
-    const ssize_t bytes_written = pluginInstance.write_command(command.str());
-
-    return bytes_written; // The number of bytes accepted.
+    return pluginInstance.write(stream, len, buffer);
 }
 
 void NPP_StreamAsFile(const NPP instance,
@@ -1043,55 +1134,62 @@
         y(0),
         width(0),
         height(0),
-        command_channel(0),
-        request_channel(0),
-        request_channel_watch_id(0),
+        browser_host(
+            OPENVRML_NP_BROWSER_HOST(
+                g_object_new(OPENVRML_NP_TYPE_BROWSER_HOST, 0))),
+        browser(0),
         npobj(NPN_CreateObject(this->npp, &npclass))
     {
+        if (!this->browser_host) { throw std::bad_alloc(); }...
 
[truncated message content] | 
| 
      
      
      From: <br...@us...> - 2008-09-07 22:31:49
       | 
| Revision: 3587
          http://openvrml.svn.sourceforge.net/openvrml/?rev=3587&view=rev
Author:   braden
Date:     2008-09-07 22:31:56 +0000 (Sun, 07 Sep 2008)
Log Message:
-----------
Use libxml's XmlTextReader interface rather than its SAX one.  The XmlTextReader interface is a lot closer to Microsoft's XmlLite interface, which should better facilitate using XmlLite when building on Windows.
Modified Paths:
--------------
    trunk/ChangeLog
    trunk/configure.ac
    trunk/src/libopenvrml/openvrml/browser.cpp
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2008-09-06 05:41:07 UTC (rev 3586)
+++ trunk/ChangeLog	2008-09-07 22:31:56 UTC (rev 3587)
@@ -1,3 +1,34 @@
+2008-09-07 Braden McDaniel  <br...@en...>
+
+	Use libxml's XmlTextReader interface rather than its SAX one.  The
+	XmlTextReader interface is a lot closer to Microsoft's XmlLite
+	interface, which should better facilitate using XmlLite when
+	building on Windows.
+
+	* configure.ac: Require at least libxml 2.5.
+	* src/libopenvrml/openvrml/browser.cpp
+	(component::parser): Removed.
+	(component::xml_reader): Added; a parser for OpenVRML's XML
+	component descriptors using libxml's XmlTextReader interface.
+	(openvrml_component_parser_startElement(void *, const xmlChar *,
+	const xmlChar **)): Removed.
+	(openvrml_component_parser_endElement(void *, const xmlChar *)):
+	Removed.
+	(component::xml_reader::xml_reader(::component &)): Added;
+	construct the xml_reader.
+	(component::xml_reader::read(const std::string &)): Added; read an
+	XML component descriptor.
+	(component::xml_reader::process_node(xmlTextReader &)): Added;
+	process a node.
+	(component::xml_reader::start_element(xmlTextReader &)): Process
+	the start of an element.
+	(component::xml_reader::end_element(xmlTextReader &)): Process the
+	end of an element.
+	(component::parser::parser(::component &)): Removed.
+	(component::parser::parse(const std::string &)): Removed.
+	(component::component(const std::string & filename)): Parse the
+	component descriptor using xml_reader.
+
 2008-09-06 Braden McDaniel  <br...@en...>
 
 	Use D-Bus for communication between openvrml-xembed and its hosts,
Modified: trunk/configure.ac
===================================================================
--- trunk/configure.ac	2008-09-06 05:41:07 UTC (rev 3586)
+++ trunk/configure.ac	2008-09-07 22:31:56 UTC (rev 3587)
@@ -111,7 +111,10 @@
 AS_IF([test X$ov_cv_boost_thread = Xno],
       [AC_MSG_FAILURE([libboost_thread$BOOST_LIB_SUFFIX not found])])
 
-PKG_CHECK_MODULES([XML], [libxml-2.0])
+#
+# The XmlTextReader interface appears in libxml 2.5.
+#
+PKG_CHECK_MODULES([XML], [libxml-2.0 >= 2.5])
 
 PKG_CHECK_MODULES([FONTCONFIG], [$REQUIRE_FONTCONFIG], , [have_fontconfig=no])
 PKG_CHECK_MODULES([FREETYPE], [$REQUIRE_FREETYPE], , [have_freetype=no])
Modified: trunk/src/libopenvrml/openvrml/browser.cpp
===================================================================
--- trunk/src/libopenvrml/openvrml/browser.cpp	2008-09-06 05:41:07 UTC (rev 3586)
+++ trunk/src/libopenvrml/openvrml/browser.cpp	2008-09-07 22:31:56 UTC (rev 3587)
@@ -47,7 +47,7 @@
 # include <boost/thread/thread.hpp>
 # include <boost/tokenizer.hpp>
 # include <boost/utility.hpp>
-# include <libxml/parser.h>
+# include <libxml/xmlreader.h>
 # include <private.h>
 # include "browser.h"
 # include "vrml97_grammar.h"
@@ -6375,37 +6375,19 @@
     };
 }
 
-extern "C"
-OPENVRML_LOCAL
-void openvrml_component_parser_startElement(void * ctx, 
-                                            const xmlChar * name, 
-                                            const xmlChar ** atts);
-extern "C"
-OPENVRML_LOCAL
-void openvrml_component_parser_endElement(void * ctx, 
-                                          const xmlChar * name);
-
 namespace {
 
     class OPENVRML_LOCAL component {
-        friend void (::openvrml_component_parser_startElement)(
-            void * ctx, 
-            const xmlChar * name, 
-            const xmlChar ** atts);
-        friend void (::openvrml_component_parser_endElement)(
-            void * ctx, 
-            const xmlChar * name);
-
         struct node_type_decl {
             openvrml::node_interface_set interfaces;
             std::string metatype_id;
         };
 
+        class xml_reader;
+
         class level : std::map<std::string, node_type_decl> {
-            friend void (::openvrml_component_parser_startElement)(
-                void * ctx, 
-                const xmlChar * name, 
-                const xmlChar ** atts);
+            friend class xml_reader;
+
         public:
             typedef std::map<std::string, size_t> dependencies_t;
 
@@ -6425,7 +6407,7 @@
             const dependencies_t & requires() const;
         };
 
-        struct parser : boost::noncopyable {
+        class xml_reader : boost::noncopyable {
             enum parse_state {
                 none,
                 component,
@@ -6434,16 +6416,22 @@
                 node,
                 field
             };
-            xmlSAXHandler handler;
-            parse_state state;
-            std::vector<component::level>::value_type * current_level;
-            level::value_type * current_node;
+
             ::component & component_;
+            parse_state state_;
+            std::vector<component::level>::value_type * current_level_;
+            level::value_type * current_node_;
 
-            explicit parser(::component & c);
+        public:
+            explicit xml_reader(::component & c);
 
-            void parse(const std::string & filename)
+            void read(const std::string & filename)
                 OPENVRML_THROW1(std::runtime_error);
+
+        private:
+            void process_node(xmlTextReader & reader);
+            void start_element(xmlTextReader & reader);
+            void end_element(xmlTextReader & reader);
         };
 
         std::string id_;
@@ -12089,183 +12077,210 @@
     return node;
 }
 
-extern "C" OPENVRML_LOCAL
-void openvrml_component_parser_startElement(void * ctx, 
-                                            const xmlChar * name,
-                                            const xmlChar ** atts)
-{
-    using std::pair;
-    using std::strcmp;
-    using std::string;
-    ::component::parser & parser = *static_cast< ::component::parser *>(ctx);
-    switch (parser.state) {
-    case component::parser::none:
-        parser.state = component::parser::component;
-        while (*atts) {
-            if (xmlStrcmp(*atts++, BAD_CAST("id")) == 0) {
-                parser.component_.id_.assign(*atts,
-                                             *atts + xmlStrlen(*atts));
-            }
-            ++atts;
+namespace {
+
+    component::xml_reader::xml_reader(::component & c):
+        component_(c),
+        state_(none),
+        current_level_(0),
+        current_node_(0)
+    {}
+
+    void component::xml_reader::read(const std::string & filename)
+        OPENVRML_THROW1(std::runtime_error)
+    {
+        static const char * const encoding = 0;
+        static const int options = 0;
+        const xmlTextReaderPtr reader =
+            xmlReaderForFile(filename.c_str(), encoding, options);
+        if (!reader) {
+            throw std::runtime_error("could not open \"" + filename
+                                     + "\" for reading");
         }
-        break;
-    case component::parser::component:
-        parser.state = ::component::parser::level;
-        parser.component_.levels_.push_back(component::level());
-        parser.current_level = &parser.component_.levels_.back();
-        break;
-    case component::parser::level:
-        if (xmlStrcmp(name, BAD_CAST("requires")) == 0) {
-            parser.state = component::parser::requires;
-            string id;
-            size_t level;
-            while (*atts) {
-                if (xmlStrcmp(*atts, BAD_CAST("id")) == 0) {
-                    ++atts;
-                    id.assign(*atts, *atts + xmlStrlen(*atts));
-                } else if (xmlStrcmp(*atts, BAD_CAST("level")) == 0) {
-                    ++atts;
-                    using boost::lexical_cast;
-                    level = lexical_cast<size_t>(
-                        string(*atts, *atts + xmlStrlen(*atts)));
-                }
-                ++atts;
+        scope_guard reader_guard = make_guard(xmlFreeTextReader, reader);
+        boost::ignore_unused_variable_warning(reader_guard);
+
+        int result;
+        while ((result = xmlTextReaderRead(reader)) == 1) {
+            this->process_node(*reader);
+        }
+
+        if (result != 0) {
+            throw std::runtime_error('\"' + filename + "\" failed to parse");
+        }
+    }
+
+    void component::xml_reader::process_node(xmlTextReader & reader)
+    {
+        const int node_type = xmlTextReaderNodeType(&reader);
+        switch (node_type) {
+        case XML_READER_TYPE_ELEMENT:
+            this->start_element(reader);
+            break;
+        case XML_READER_TYPE_END_ELEMENT:
+            this->end_element(reader);
+            break;
+        default:
+            break;
+        }
+    }
+
+    void component::xml_reader::start_element(xmlTextReader & reader)
+    {
+        using std::pair;
+        using std::strcmp;
+        using std::string;
+
+        switch (this->state_) {
+        case component::xml_reader::none:
+            this->state_ = component::xml_reader::component;
+            {
+                xmlChar * id = xmlTextReaderGetAttribute(&reader,
+                                                         BAD_CAST("id"));
+                scope_guard id_guard = make_guard(free, id);
+                boost::ignore_unused_variable_warning(id_guard);
+                this->component_.id_.assign(id, id + xmlStrlen(id));
             }
-            parser.current_level->dependencies_.insert(make_pair(id, level));
-        } else if (xmlStrcmp(name, BAD_CAST("node")) == 0) {
-            parser.state = component::parser::node;
-            string id;
-            component::node_type_decl node_type;
-            while (*atts) {
-                if (xmlStrcmp(*atts, BAD_CAST("id")) == 0) {
-                    ++atts;
-                    id.assign(*atts, *atts + xmlStrlen(*atts));
-                } else if (xmlStrcmp(*atts, BAD_CAST("metatype-id")) == 0) {
-                    ++atts;
-                    node_type.metatype_id.assign(*atts,
-                                                 *atts + xmlStrlen(*atts));
-                } else {
-                    ++atts;
+            break;
+        case component::xml_reader::component:
+            this->state_ = ::component::xml_reader::level;
+            this->component_.levels_.push_back(component::level());
+            this->current_level_ = &this->component_.levels_.back();
+            break;
+        case component::xml_reader::level:
+            if (xmlStrcmp(xmlTextReaderName(&reader), BAD_CAST("requires"))
+                == 0) {
+                using boost::lexical_cast;
+
+                xmlChar * id_chars = xmlTextReaderGetAttribute(&reader,
+                                                               BAD_CAST("id"));
+                scope_guard id_chars_guard = make_guard(free, id_chars);
+                boost::ignore_unused_variable_warning(id_chars_guard);
+                const string id(id_chars, id_chars + xmlStrlen(id_chars));
+
+                xmlChar * level_chars =
+                    xmlTextReaderGetAttribute(&reader, BAD_CAST("level"));
+                scope_guard level_chars_guard = make_guard(free, level_chars);
+                boost::ignore_unused_variable_warning(level_chars_guard);
+                const size_t level =
+                    lexical_cast<size_t>(
+                        string(level_chars,
+                               level_chars + xmlStrlen(level_chars)));
+
+                this->current_level_->dependencies_.insert(
+                    make_pair(id, level));
+            } else if (xmlStrcmp(xmlTextReaderName(&reader), BAD_CAST("node"))
+                       == 0) {
+                this->state_ = component::xml_reader::node;
+
+                xmlChar * id_chars = xmlTextReaderGetAttribute(&reader,
+                                                               BAD_CAST("id"));
+                scope_guard id_chars_guard = make_guard(free, id_chars);
+                boost::ignore_unused_variable_warning(id_chars_guard);
+                const string id(id_chars, id_chars + xmlStrlen(id_chars));
+
+                component::node_type_decl node_type;
+                xmlChar * metatype_id_chars =
+                    xmlTextReaderGetAttribute(&reader, BAD_CAST("metatype-id"));
+                scope_guard metatype_id_chars_guard =
+                    make_guard(free, metatype_id_chars);
+                boost::ignore_unused_variable_warning(metatype_id_chars_guard);
+                node_type.metatype_id.assign(
+                    metatype_id_chars,
+                    metatype_id_chars + xmlStrlen(metatype_id_chars));
+
+                pair<component::level::iterator, bool> result =
+                    this->current_level_->insert(std::make_pair(id, node_type));
+                if (result.second) {
+                    this->current_node_ = &*result.first;
                 }
-                ++atts;
+            } else {
+                xmlChar * name_chars = xmlTextReaderName(&reader);
+                const std::string name(name_chars,
+                                       name_chars + xmlStrlen(name_chars));;
+                throw std::runtime_error("unexpected element: " + name);
             }
-            pair<component::level::iterator, bool> result =
-                parser.current_level->insert(std::make_pair(id, node_type));
-            if (result.second) {
-                parser.current_node = &*result.first;
-            }
-        } else {
-            std::cerr << "unexpected element: " << name << std::endl;
-        }
-        break;
-    case component::parser::requires:
-        break;
-    case component::parser::node:
-        parser.state = component::parser::field;
-        try {
-            using openvrml::node_interface;
-            node_interface interface_;
-            while (*atts) {
+            break;
+        case component::xml_reader::requires:
+            break;
+        case component::xml_reader::node:
+            {
                 using boost::lexical_cast;
                 using openvrml::field_value;
-                if (xmlStrcmp(*atts, BAD_CAST("id")) == 0) {
-                    ++atts;
-                    interface_.id.assign(*atts, *atts + xmlStrlen(*atts));
-                } else if (xmlStrcmp(*atts, BAD_CAST("type")) == 0) {
-                    ++atts;
-                    try {
-                        interface_.field_type =
-                            lexical_cast<field_value::type_id>(
-                                string(*atts, *atts + xmlStrlen(*atts)));
-                    } catch (const boost::bad_lexical_cast &) {
-                        std::cerr << "invalid field value type identifier \""
-                                  << *atts << '\"' << std::endl;
-                        throw;
-                    }
-                } else if (xmlStrcmp(*atts, BAD_CAST("access-type")) == 0) {
-                    ++atts;
-                    try {
-                        interface_.type =
-                            lexical_cast<node_interface::type_id>(
-                                string(*atts, *atts + xmlStrlen(*atts)));
-                    } catch (const boost::bad_lexical_cast &) {
-                        std::cerr << "invalid field access type identifier \""
-                                  << *atts << '\"' << std::endl;
-                        throw;
-                    }
-                } else {
-                    ++atts;
+                using openvrml::node_interface;
+
+                node_interface interface_;
+                xmlChar * id_chars = xmlTextReaderGetAttribute(&reader,
+                                                               BAD_CAST("id"));
+                scope_guard id_chars_guard = make_guard(free, id_chars);
+                boost::ignore_unused_variable_warning(id_chars_guard);
+                interface_.id.assign(id_chars, id_chars + xmlStrlen(id_chars));
+
+                xmlChar * type_chars =
+                    xmlTextReaderGetAttribute(&reader, BAD_CAST("type"));
+                scope_guard type_chars_guard = make_guard(free, type_chars);
+                boost::ignore_unused_variable_warning(type_chars_guard);
+                const string type(type_chars,
+                                  type_chars + xmlStrlen(type_chars));
+                try {
+                    interface_.field_type =
+                        lexical_cast<field_value::type_id>(string(type));
+                } catch (const boost::bad_lexical_cast &) {
+                    throw std::runtime_error(
+                        "invalid field value type identifier \"" + type + '\"');
                 }
-                ++atts;
-            }
-            parser.current_node->second.interfaces.insert(interface_);
-        } catch (const boost::bad_lexical_cast &) {}
-        break;
-    case component::parser::field: default:
-        assert(false);
-    }
-}
 
-extern "C" OPENVRML_LOCAL
-void openvrml_component_parser_endElement(void * ctx, 
-                                          const xmlChar * /* name */)
-{
-    component::parser & parser = *static_cast<component::parser *>(ctx);
-    switch (parser.state) {
-    case component::parser::none:
-        break;
-    case component::parser::component:
-        break;
-    case component::parser::level:
-        parser.state = component::parser::component;
-        break;
-    case component::parser::requires:
-        parser.state = component::parser::level;
-        break;
-    case component::parser::node:
-        parser.state = component::parser::level;
-        break;
-    case component::parser::field:
-        parser.state = component::parser::node;
-        break;
-    }
-}
+                xmlChar * access_type_chars =
+                    xmlTextReaderGetAttribute(&reader, BAD_CAST("access-type"));
+                scope_guard access_type_chars_guard =
+                    make_guard(free, access_type_chars);
+                boost::ignore_unused_variable_warning(access_type_chars_guard);
+                const string access_type(
+                    access_type_chars,
+                    access_type_chars + xmlStrlen(access_type_chars));
 
-namespace {
+                try {
+                    interface_.type =
+                        lexical_cast<node_interface::type_id>(access_type);
+                } catch (const boost::bad_lexical_cast &) {
+                    throw std::runtime_error(
+                        "invalid field access type identifier \"" + access_type
+                        + '\"');
+                }
 
-    component::parser::parser(::component & c):
-        handler(),
-        state(none),
-        current_level(0),
-        current_node(0),
-        component_(c)
-    {
-        this->handler.startElement = openvrml_component_parser_startElement;
-        this->handler.endElement = openvrml_component_parser_endElement;
+                this->current_node_->second.interfaces.insert(interface_);
+            }
+            break;
+        case component::xml_reader::field: default:
+            assert(false);
+        }
     }
 
-    void component::parser::parse(const std::string & filename)
-        OPENVRML_THROW1(std::runtime_error)
+    void component::xml_reader::end_element(xmlTextReader & /* reader */)
     {
-        int result = xmlSAXUserParseFile(&this->handler,
-                                         this,
-                                         filename.c_str());
-        if (result != XML_ERR_OK) {
-            using std::string;
-            using boost::lexical_cast;
-            xmlErrorPtr err = xmlGetLastError();
-            throw std::runtime_error(string(err->file) + ':'
-                                     + lexical_cast<string>(err->line) + ':'
-                                     + lexical_cast<string>(err->int2) + ": "
-                                     + err->message);
+        switch (this->state_) {
+        case component::xml_reader::none:
+            break;
+        case component::xml_reader::component:
+            break;
+        case component::xml_reader::level:
+            this->state_ = component::xml_reader::component;
+            break;
+        case component::xml_reader::requires:
+            break;
+        case component::xml_reader::node:
+            this->state_ = component::xml_reader::level;
+            break;
+        case component::xml_reader::field:
+            break;
         }
     }
 
     component::component(const std::string & filename)
         OPENVRML_THROW1(std::runtime_error)
     {
-        parser p(*this);
-        p.parse(filename);
+        xml_reader reader(*this);
+        reader.read(filename);
     }
 
     const std::string & component::id() const OPENVRML_NOTHROW
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 | 
| 
      
      
      From: <br...@us...> - 2008-09-08 22:49:21
       | 
| Revision: 3588
          http://openvrml.svn.sourceforge.net/openvrml/?rev=3588&view=rev
Author:   braden
Date:     2008-09-08 22:49:31 +0000 (Mon, 08 Sep 2008)
Log Message:
-----------
Use XmlLite on Windows rather than libxml.
Modified Paths:
--------------
    trunk/ChangeLog
    trunk/ide-projects/Windows/VisualC9_0/OpenVRML/openvrml/openvrml.vcproj
    trunk/src/libopenvrml/openvrml/browser.cpp
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2008-09-07 22:31:56 UTC (rev 3587)
+++ trunk/ChangeLog	2008-09-08 22:49:31 UTC (rev 3588)
@@ -1,3 +1,40 @@
+2008-09-08 Braden McDaniel  <br...@en...>
+
+	Use XmlLite on Windows rather than libxml.
+
+	* ide-projects/Windows/VisualC9_0/OpenVRML/openvrml/openvrml.vcproj
+	Added dependencies shlwapi.lib and XmlLite.lib; removed
+	dependencies libxml2_a_dll.lib, iconv_a.lib, and WS2_32.lib.
+	* src/libopenvrml/openvrml/browser.cpp
+	(openvrml_::xml_reader): Added a wrapper that abstracts XmlLite on
+	Windows and libxml's XmlTextReader interface everywhere else.
+	(openvrml_::xml_reader::xml_reader(const std::string &)):
+	Construct using a file name.  On Windows, create an IStream from a
+	file and an IXmlReader.  Everywhere else, create a libxml
+	XmlTextReader.
+	(openvrml_::xml_reader::~xml_reader()): Clean up.
+	(openvrml_::xml_reader::read()): Delegate to IXmlReader::Read on
+	Windows; xmlTextReaderRead everywhere else.
+	(openvrml_::xml_reader::node_type() const): Get the node type
+	identifier.  Conveniently, these IDs have parity between the
+	XmlLite and XmlTextReader APIs.
+	(openvrml_::xml_reader::local_name() const): The local name of the
+	current node.
+	(openvrml_::xml_reader::value() const): The value, if any, of the
+	current node.
+	(openvrml_::xml_reader::move_to_first_attribute()): Move to the
+	first attribute of the current node.
+	(openvrml_::xml_reader::move_to_next_attribute()): Move to the
+	next attribute of the current node.
+	(component::xml_reader::read(const std::string &)): Use
+	openvrml_::xml_reader.
+	(component::xml_reader::process_node(openvrml_::xml_reader &)):
+	Use openvrml_::xml_reader.
+	(component::xml_reader::start_element(openvrml_::xml_reader &)):
+	Use openvrml_::xml_reader.
+	(component::xml_reader::end_element(openvrml_::xml_reader &)): Use
+	openvrml_::xml_reader.
+
 2008-09-07 Braden McDaniel  <br...@en...>
 
 	Use libxml's XmlTextReader interface rather than its SAX one.  The
Modified: trunk/ide-projects/Windows/VisualC9_0/OpenVRML/openvrml/openvrml.vcproj
===================================================================
--- trunk/ide-projects/Windows/VisualC9_0/OpenVRML/openvrml/openvrml.vcproj	2008-09-07 22:31:56 UTC (rev 3587)
+++ trunk/ide-projects/Windows/VisualC9_0/OpenVRML/openvrml/openvrml.vcproj	2008-09-08 22:49:31 UTC (rev 3588)
@@ -60,14 +60,14 @@
 			/>
 			<Tool
 				Name="VCResourceCompilerTool"
-				AdditionalIncludeDirectories="C:\cygwin\home\bmcdaniel\src\openvrml\openvrml\src\openvrml"
+				AdditionalIncludeDirectories=""
 			/>
 			<Tool
 				Name="VCPreLinkEventTool"
 			/>
 			<Tool
 				Name="VCLinkerTool"
-				AdditionalDependencies="gdi32.lib advapi32.lib shell32.lib libpngd.lib zlibd.lib freetype236MT_D.lib libxml2_a_dll.lib iconv_a.lib WS2_32.lib"
+				AdditionalDependencies="gdi32.lib advapi32.lib shell32.lib shlwapi.lib XmlLite.lib libpngd.lib zlibd.lib freetype236MT_D.lib"
 				OutputFile="$(SolutionDir)..\bin\$(ProjectName)d.dll"
 				IgnoreDefaultLibraryNames="libcmtd;msvcrt"
 				GenerateDebugInformation="true"
@@ -126,7 +126,6 @@
 				Optimization="3"
 				InlineFunctionExpansion="1"
 				OmitFramePointers="true"
-
 				AdditionalIncludeDirectories=".;..\..\..\..\..\src\libopenvrml"
 				PreprocessorDefinitions="NOMINMAX;_CRT_SECURE_NO_WARNINGS;_SCL_SECURE_NO_WARNINGS;BOOST_SPIRIT_THREADSAFE;PACKAGE_VERSION=\"0.17.8\";BOOST_MPL_CFG_NO_PREPROCESSED_HEADERS;BOOST_MPL_LIMIT_VECTOR_SIZE=30;BOOST_SPIRIT_CLOSURE_LIMIT=6;PHOENIX_LIMIT=6;OPENVRML_BUILD_DLL;OPENVRML_ENABLE_PNG_TEXTURES;OPENVRML_ENABLE_RENDER_TEXT_NODE;OPENVRML_FT_CONST="const";OPENVRML_PKGDATADIR_=\"\";OPENVRML_PKGLIBDIR_=\"\";NDEBUG"
 				StringPooling="true"
@@ -145,14 +144,14 @@
 			/>
 			<Tool
 				Name="VCResourceCompilerTool"
-				AdditionalIncludeDirectories="C:\cygwin\home\bmcdaniel\src\openvrml\openvrml\src\openvrml"
+				AdditionalIncludeDirectories=""
 			/>
 			<Tool
 				Name="VCPreLinkEventTool"
 			/>
 			<Tool
 				Name="VCLinkerTool"
-				AdditionalDependencies="gdi32.lib advapi32.lib shell32.lib libpng.lib zlib.lib freetype236MT.lib libxml2_a_dll.lib iconv_a.lib WS2_32.lib"
+				AdditionalDependencies="gdi32.lib advapi32.lib shell32.lib shlwapi.lib XmlLite.lib libpng.lib zlib.lib freetype236MT.lib"
 				OutputFile="$(SolutionDir)..\bin\$(ProjectName).dll"
 				IgnoreDefaultLibraryNames="libcmt"
 				GenerateDebugInformation="true"
Modified: trunk/src/libopenvrml/openvrml/browser.cpp
===================================================================
--- trunk/src/libopenvrml/openvrml/browser.cpp	2008-09-07 22:31:56 UTC (rev 3587)
+++ trunk/src/libopenvrml/openvrml/browser.cpp	2008-09-08 22:49:31 UTC (rev 3588)
@@ -30,9 +30,12 @@
 #   include <sys/timeb.h>
 #   include <direct.h>
 #   include <time.h>
+#   include <shlwapi.h>
+#   include <XmlLite.h>
 # else
 #   include <sys/time.h>
 #   include <ltdl.h>
+#   include <libxml/xmlreader.h>
 # endif
 # include <boost/algorithm/string/predicate.hpp>
 # include <boost/array.hpp>
@@ -47,7 +50,6 @@
 # include <boost/thread/thread.hpp>
 # include <boost/tokenizer.hpp>
 # include <boost/utility.hpp>
-# include <libxml/xmlreader.h>
 # include <private.h>
 # include "browser.h"
 # include "vrml97_grammar.h"
@@ -6377,6 +6379,181 @@
 
 namespace {
 
+    namespace openvrml_ {
+
+        class OPENVRML_LOCAL xml_reader {
+# ifdef _WIN32
+            IStream * input;
+            IXmlReader * reader;
+# else
+            XmlTextReaderPtr reader;
+# endif
+        public:
+            //
+            // Conveniently, these values are consistent between libxml and
+            // XmlLite.
+            //
+            enum node_type_id {
+                none_id                   = 0,
+                element_id                = 1,
+                attribute_id              = 2,
+                text_id                   = 3,
+                cdata_id                  = 4,
+                processing_instruction_id = 7,
+                comment_id                = 8,
+                document_type_id          = 10,
+                whitespace_id             = 13,
+                end_element_id            = 15,
+                xml_declaration_id        = 17
+            };
+
+            explicit xml_reader(const std::string & filename);
+            ~xml_reader();
+
+            int read();
+            node_type_id node_type() const;
+            const std::string local_name() const;
+            const std::string value() const;
+            int move_to_first_attribute();
+            int move_to_next_attribute();
+        };
+    }
+
+    openvrml_::xml_reader::xml_reader(const std::string & filename):
+# ifdef _WIN32
+        input(0),
+# endif
+        reader(0)
+    {
+# ifdef _WIN32
+        HRESULT hr;
+
+        hr = SHCreateStreamOnFile(filename.c_str(), STGM_READ, &this->input);
+        if (FAILED(hr)) {
+            throw std::runtime_error("failed to open file \"" + filename
+                                     + '\"');
+        }
+        scope_guard input_guard =
+            make_obj_guard(*this->input, &IStream::Release);
+
+        hr = CreateXmlReader(__uuidof(IXmlReader),
+                             reinterpret_cast<void **>(&this->reader),
+                             0);
+        if (FAILED(hr)) {
+            throw std::runtime_error("failed to create XML reader");
+        }
+        scope_guard reader_guard =
+            make_obj_guard(*this->reader, &IXmlReader::Release);
+
+        hr = this->reader->SetInput(this->input);
+        if (FAILED(hr)) {
+            throw std::runtime_error("failed to set input for XML reader");
+        }
+
+        input_guard.dismiss();
+        reader_guard.dismiss();
+# else
+        static const char * const encoding = 0;
+        static const int options = 0;
+        this->reader = xmlReaderForFile(filename.c_str(), encoding, options);
+# endif
+    }
+
+    openvrml_::xml_reader::~xml_reader()
+    {
+# ifdef _WIN32
+        this->reader->Release();
+        this->input->Release();
+# else
+        xmlFreeTextReader(this->reader);
+# endif
+    }
+
+    int openvrml_::xml_reader::read()
+    {
+# ifdef _WIN32
+        HRESULT hr = this->reader->Read(0);
+        return (hr == S_OK)
+            ? 1
+            : (hr == S_FALSE)
+                ? 0
+                : -1;
+# else
+        return xmlTextReaderRead(this->reader);
+# endif
+    }
+
+    openvrml_::xml_reader::node_type_id
+    openvrml_::xml_reader::node_type() const
+    {
+# ifdef _WIN32
+        XmlNodeType type;
+        this->reader->GetNodeType(&type);
+        return node_type_id(type);
+# else
+        return node_type_id(xmlTextReaderNodeType(this->reader));
+# endif
+    }
+
+    const std::string openvrml_::xml_reader::local_name() const
+    {
+# ifdef _WIN32
+        const WCHAR * name;
+        HRESULT hr = this->reader->GetLocalName(&name, 0);
+        if (FAILED(hr)) {
+            throw std::runtime_error("failed to get element name");
+        }
+        return std::string(name, name + wcslen(name));
+# else
+        const xmlChar * name = xmlTextReaderConstLocalName(this->reader);
+        return std::string(name, name + xmlStrlen(name));
+# endif
+    }
+
+    const std::string openvrml_::xml_reader::value() const
+    {
+# ifdef _WIN32
+        const WCHAR * val;
+        HRESULT hr = this->reader->GetValue(&val, 0);
+        if (FAILED(hr)) {
+            throw std::runtime_error("failed to get a value");
+        }
+        return std::string(val, val + wcslen(val));
+# else
+        const xmlChar * val = xmlTextReaderConstValue(this->reader);
+        return std::string(val, val + xmlStrlen(val));
+# endif
+    }
+
+    int openvrml_::xml_reader::move_to_first_attribute()
+    {
+# ifdef _WIN32
+        HRESULT hr = this->reader->MoveToFirstAttribute();
+        return (hr == S_OK)
+            ? 1
+            : (hr == S_FALSE)
+                ? 0
+                : -1;
+# else
+        return xmlTextReaderMoveToFirstAttribute(this->reader);
+# endif
+    }
+
+    int openvrml_::xml_reader::move_to_next_attribute()
+    {
+# ifdef _WIN32
+        HRESULT hr = this->reader->MoveToNextAttribute();
+        return (hr == S_OK)
+            ? 1
+            : (hr == S_FALSE)
+                ? 0
+                : -1;
+# else
+        return xmlTextReaderMoveToNextAttribute(this->reader);
+# endif
+    }
+
+
     class OPENVRML_LOCAL component {
         struct node_type_decl {
             openvrml::node_interface_set interfaces;
@@ -6429,9 +6606,9 @@
                 OPENVRML_THROW1(std::runtime_error);
 
         private:
-            void process_node(xmlTextReader & reader);
-            void start_element(xmlTextReader & reader);
-            void end_element(xmlTextReader & reader);
+            void process_node(openvrml_::xml_reader & reader);
+            void start_element(openvrml_::xml_reader & reader);
+            void end_element(openvrml_::xml_reader & reader);
         };
 
         std::string id_;
@@ -12089,20 +12266,10 @@
     void component::xml_reader::read(const std::string & filename)
         OPENVRML_THROW1(std::runtime_error)
     {
-        static const char * const encoding = 0;
-        static const int options = 0;
-        const xmlTextReaderPtr reader =
-            xmlReaderForFile(filename.c_str(), encoding, options);
-        if (!reader) {
-            throw std::runtime_error("could not open \"" + filename
-                                     + "\" for reading");
-        }
-        scope_guard reader_guard = make_guard(xmlFreeTextReader, reader);
-        boost::ignore_unused_variable_warning(reader_guard);
-
+        openvrml_::xml_reader reader(filename);
         int result;
-        while ((result = xmlTextReaderRead(reader)) == 1) {
-            this->process_node(*reader);
+        while ((result = reader.read()) == 1) {
+            this->process_node(reader);
         }
 
         if (result != 0) {
@@ -12110,14 +12277,14 @@
         }
     }
 
-    void component::xml_reader::process_node(xmlTextReader & reader)
+    void component::xml_reader::process_node(openvrml_::xml_reader & reader)
     {
-        const int node_type = xmlTextReaderNodeType(&reader);
+        const int node_type = reader.node_type();
         switch (node_type) {
-        case XML_READER_TYPE_ELEMENT:
+        case openvrml_::xml_reader::element_id:
             this->start_element(reader);
             break;
-        case XML_READER_TYPE_END_ELEMENT:
+        case openvrml_::xml_reader::end_element_id:
             this->end_element(reader);
             break;
         default:
@@ -12125,21 +12292,22 @@
         }
     }
 
-    void component::xml_reader::start_element(xmlTextReader & reader)
+    void component::xml_reader::start_element(openvrml_::xml_reader & reader)
     {
         using std::pair;
         using std::strcmp;
         using std::string;
+        using openvrml::node_interface;
 
+        int move_to_attr_result;
+        node_interface interface_;
+
         switch (this->state_) {
         case component::xml_reader::none:
             this->state_ = component::xml_reader::component;
-            {
-                xmlChar * id = xmlTextReaderGetAttribute(&reader,
-                                                         BAD_CAST("id"));
-                scope_guard id_guard = make_guard(free, id);
-                boost::ignore_unused_variable_warning(id_guard);
-                this->component_.id_.assign(id, id + xmlStrlen(id));
+            move_to_attr_result = reader.move_to_first_attribute();
+            if (move_to_attr_result > 0) {
+                this->component_.id_ = reader.value();
             }
             break;
         case component::xml_reader::component:
@@ -12148,115 +12316,86 @@
             this->current_level_ = &this->component_.levels_.back();
             break;
         case component::xml_reader::level:
-            if (xmlStrcmp(xmlTextReaderName(&reader), BAD_CAST("requires"))
-                == 0) {
-                using boost::lexical_cast;
+            if (reader.local_name() == "requires") {
+                string id;
+                size_t level;
+                move_to_attr_result = reader.move_to_first_attribute();
+                while (move_to_attr_result > 0) {
+                    using boost::lexical_cast;
+                    if (reader.local_name() == "id") {
+                        id = reader.value();
+                    } else if (reader.local_name() == "level") {
+                        level = lexical_cast<size_t>(reader.value());
+                    }
+                    move_to_attr_result = reader.move_to_next_attribute();
+                }
 
-                xmlChar * id_chars = xmlTextReaderGetAttribute(&reader,
-                                                               BAD_CAST("id"));
-                scope_guard id_chars_guard = make_guard(free, id_chars);
-                boost::ignore_unused_variable_warning(id_chars_guard);
-                const string id(id_chars, id_chars + xmlStrlen(id_chars));
-
-                xmlChar * level_chars =
-                    xmlTextReaderGetAttribute(&reader, BAD_CAST("level"));
-                scope_guard level_chars_guard = make_guard(free, level_chars);
-                boost::ignore_unused_variable_warning(level_chars_guard);
-                const size_t level =
-                    lexical_cast<size_t>(
-                        string(level_chars,
-                               level_chars + xmlStrlen(level_chars)));
-
                 this->current_level_->dependencies_.insert(
                     make_pair(id, level));
-            } else if (xmlStrcmp(xmlTextReaderName(&reader), BAD_CAST("node"))
-                       == 0) {
+            } else if (reader.local_name() == "node") {
                 this->state_ = component::xml_reader::node;
 
-                xmlChar * id_chars = xmlTextReaderGetAttribute(&reader,
-                                                               BAD_CAST("id"));
-                scope_guard id_chars_guard = make_guard(free, id_chars);
-                boost::ignore_unused_variable_warning(id_chars_guard);
-                const string id(id_chars, id_chars + xmlStrlen(id_chars));
-
+                string id;
                 component::node_type_decl node_type;
-                xmlChar * metatype_id_chars =
-                    xmlTextReaderGetAttribute(&reader, BAD_CAST("metatype-id"));
-                scope_guard metatype_id_chars_guard =
-                    make_guard(free, metatype_id_chars);
-                boost::ignore_unused_variable_warning(metatype_id_chars_guard);
-                node_type.metatype_id.assign(
-                    metatype_id_chars,
-                    metatype_id_chars + xmlStrlen(metatype_id_chars));
-
+                move_to_attr_result = reader.move_to_first_attribute();
+                while (move_to_attr_result > 0) {
+                    if (reader.local_name() == "id") {
+                        id = reader.value();
+                    } else if (reader.local_name() == "metatype-id") {
+                        node_type.metatype_id = reader.value();
+                    }
+                    move_to_attr_result = reader.move_to_next_attribute();
+                }
                 pair<component::level::iterator, bool> result =
                     this->current_level_->insert(std::make_pair(id, node_type));
                 if (result.second) {
                     this->current_node_ = &*result.first;
                 }
             } else {
-                xmlChar * name_chars = xmlTextReaderName(&reader);
-                const std::string name(name_chars,
-                                       name_chars + xmlStrlen(name_chars));;
-                throw std::runtime_error("unexpected element: " + name);
+                throw std::runtime_error("unexpected element: "
+                                         + reader.local_name());
             }
             break;
         case component::xml_reader::requires:
             break;
         case component::xml_reader::node:
-            {
+            move_to_attr_result = reader.move_to_first_attribute();
+            while (move_to_attr_result > 0) {
                 using boost::lexical_cast;
                 using openvrml::field_value;
-                using openvrml::node_interface;
 
-                node_interface interface_;
-                xmlChar * id_chars = xmlTextReaderGetAttribute(&reader,
-                                                               BAD_CAST("id"));
-                scope_guard id_chars_guard = make_guard(free, id_chars);
-                boost::ignore_unused_variable_warning(id_chars_guard);
-                interface_.id.assign(id_chars, id_chars + xmlStrlen(id_chars));
-
-                xmlChar * type_chars =
-                    xmlTextReaderGetAttribute(&reader, BAD_CAST("type"));
-                scope_guard type_chars_guard = make_guard(free, type_chars);
-                boost::ignore_unused_variable_warning(type_chars_guard);
-                const string type(type_chars,
-                                  type_chars + xmlStrlen(type_chars));
-                try {
-                    interface_.field_type =
-                        lexical_cast<field_value::type_id>(string(type));
-                } catch (const boost::bad_lexical_cast &) {
-                    throw std::runtime_error(
-                        "invalid field value type identifier \"" + type + '\"');
+                if (reader.local_name() == "id") {
+                    interface_.id = reader.value();
+                } else if (reader.local_name() == "type") {
+                    try {
+                        interface_.field_type =
+                            lexical_cast<field_value::type_id>(reader.value());
+                    } catch (const boost::bad_lexical_cast &) {
+                        throw std::runtime_error(
+                            "invalid field value type identifier \""
+                            + reader.value() + '\"');
+                    }
+                } else if (reader.local_name() == "access-type") {
+                    try {
+                        interface_.type =
+                            lexical_cast<node_interface::type_id>(
+                                reader.value());
+                    } catch (const boost::bad_lexical_cast &) {
+                        throw std::runtime_error(
+                            "invalid field access type identifier \""
+                            + reader.value() + '\"');
+                    }
                 }
-
-                xmlChar * access_type_chars =
-                    xmlTextReaderGetAttribute(&reader, BAD_CAST("access-type"));
-                scope_guard access_type_chars_guard =
-                    make_guard(free, access_type_chars);
-                boost::ignore_unused_variable_warning(access_type_chars_guard);
-                const string access_type(
-                    access_type_chars,
-                    access_type_chars + xmlStrlen(access_type_chars));
-
-                try {
-                    interface_.type =
-                        lexical_cast<node_interface::type_id>(access_type);
-                } catch (const boost::bad_lexical_cast &) {
-                    throw std::runtime_error(
-                        "invalid field access type identifier \"" + access_type
-                        + '\"');
-                }
-
-                this->current_node_->second.interfaces.insert(interface_);
+                move_to_attr_result = reader.move_to_next_attribute();
             }
+            this->current_node_->second.interfaces.insert(interface_);
             break;
         case component::xml_reader::field: default:
             assert(false);
         }
     }
 
-    void component::xml_reader::end_element(xmlTextReader & /* reader */)
+    void component::xml_reader::end_element(openvrml_::xml_reader & /* reader */)
     {
         switch (this->state_) {
         case component::xml_reader::none:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 | 
| 
      
      
      From: <br...@us...> - 2008-09-08 22:57:28
       | 
| Revision: 3589
          http://openvrml.svn.sourceforge.net/openvrml/?rev=3589&view=rev
Author:   braden
Date:     2008-09-08 22:57:29 +0000 (Mon, 08 Sep 2008)
Log Message:
-----------
xmlTextReaderPtr, not XmlTextReaderPtr.
Modified Paths:
--------------
    trunk/ChangeLog
    trunk/src/libopenvrml/openvrml/browser.cpp
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2008-09-08 22:49:31 UTC (rev 3588)
+++ trunk/ChangeLog	2008-09-08 22:57:29 UTC (rev 3589)
@@ -1,5 +1,10 @@
 2008-09-08 Braden McDaniel  <br...@en...>
 
+	* src/libopenvrml/openvrml/browser.cpp
+	(openvrml_::xml_reader): xmlTextReaderPtr, not XmlTextReaderPtr.
+
+2008-09-08 Braden McDaniel  <br...@en...>
+
 	Use XmlLite on Windows rather than libxml.
 
 	* ide-projects/Windows/VisualC9_0/OpenVRML/openvrml/openvrml.vcproj
Modified: trunk/src/libopenvrml/openvrml/browser.cpp
===================================================================
--- trunk/src/libopenvrml/openvrml/browser.cpp	2008-09-08 22:49:31 UTC (rev 3588)
+++ trunk/src/libopenvrml/openvrml/browser.cpp	2008-09-08 22:57:29 UTC (rev 3589)
@@ -6386,7 +6386,7 @@
             IStream * input;
             IXmlReader * reader;
 # else
-            XmlTextReaderPtr reader;
+            xmlTextReaderPtr reader;
 # endif
         public:
             //
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 | 
| 
      
      
      From: <br...@us...> - 2008-09-09 05:25:36
       | 
| Revision: 3590
          http://openvrml.svn.sourceforge.net/openvrml/?rev=3590&view=rev
Author:   braden
Date:     2008-09-09 05:25:47 +0000 (Tue, 09 Sep 2008)
Log Message:
-----------
Added doc-comments and exception specifications to openvrml_::xml_reader.
Modified Paths:
--------------
    trunk/ChangeLog
    trunk/src/libopenvrml/openvrml/browser.cpp
Modified: trunk/ChangeLog
===================================================================
--- trunk/ChangeLog	2008-09-08 22:57:29 UTC (rev 3589)
+++ trunk/ChangeLog	2008-09-09 05:25:47 UTC (rev 3590)
@@ -1,5 +1,10 @@
 2008-09-08 Braden McDaniel  <br...@en...>
 
+	* src/libopenvrml/openvrml/browser.cpp: Added doc-comments and
+	exception specifications to openvrml_::xml_reader.
+
+2008-09-08 Braden McDaniel  <br...@en...>
+
 	* src/libopenvrml/openvrml/browser.cpp
 	(openvrml_::xml_reader): xmlTextReaderPtr, not XmlTextReaderPtr.
 
Modified: trunk/src/libopenvrml/openvrml/browser.cpp
===================================================================
--- trunk/src/libopenvrml/openvrml/browser.cpp	2008-09-08 22:57:29 UTC (rev 3589)
+++ trunk/src/libopenvrml/openvrml/browser.cpp	2008-09-09 05:25:47 UTC (rev 3590)
@@ -6381,6 +6381,14 @@
 
     namespace openvrml_ {
 
+        /**
+         * @brief A wrapper that abstracts commonality between libxml's
+         *        XmlTextReader interface and Microsoft's XmlLite.
+         *
+         * There is a lot in common here between the two underlying APIs; and
+         * that's no coincidence, apparently: both APIs are based on the C#
+         * XmlReader API.
+         */
         class OPENVRML_LOCAL xml_reader {
 # ifdef _WIN32
             IStream * input;
@@ -6407,19 +6415,114 @@
                 xml_declaration_id        = 17
             };
 
-            explicit xml_reader(const std::string & filename);
-            ~xml_reader();
+            explicit xml_reader(const std::string & filename)
+                OPENVRML_THROW1(std::runtime_error);
+            ~xml_reader() OPENVRML_NOTHROW;
 
-            int read();
-            node_type_id node_type() const;
-            const std::string local_name() const;
-            const std::string value() const;
-            int move_to_first_attribute();
-            int move_to_next_attribute();
+            int read() OPENVRML_NOTHROW;
+            node_type_id node_type() const OPENVRML_NOTHROW;
+            const std::string local_name() const
+                OPENVRML_THROW2(std::runtime_error, std::bad_alloc);
+            const std::string value() const
+                OPENVRML_THROW2(std::runtime_error, std::bad_alloc);
+            int move_to_first_attribute() OPENVRML_NOTHROW;
+            int move_to_next_attribute() OPENVRML_NOTHROW;
         };
     }
 
-    openvrml_::xml_reader::xml_reader(const std::string & filename):
+    /**
+     * @enum openvrml_::xml_reader::node_type_id
+     *
+     * @brief The node type identifier.
+     *
+     * Due to the common heritage of XmlTextReader and XmlLite, the underlying
+     * APIs report consistent values that can be passed through directly to
+     * the @c openvrml_::xml_reader interface.
+     *
+     * @sa http://xmlsoft.org/html/libxml-xmlreader.html#xmlReaderTypes
+     * @sa http://msdn.microsoft.com/en-us/library/ms753141(VS.85).aspx
+     */
+
+    /**
+     * @var openvrml_::xml_reader::node_type_id openvrml_::xml_reader::none_id
+     *
+     * @brief The “null” type identifier.
+     */
+
+    /**
+     * @var openvrml_::xml_reader::node_type_id openvrml_::xml_reader::element_id
+     *
+     * @brief Element identifier.
+     */
+
+    /**
+     * @var openvrml_::xml_reader::node_type_id openvrml_::xml_reader::attribute_id
+     *
+     * @brief Attribute identifier.
+     */
+
+    /**
+     * @var openvrml_::xml_reader::node_type_id openvrml_::xml_reader::text_id
+     *
+     * @brief Text identifier.
+     */
+
+    /**
+     * @var openvrml_::xml_reader::node_type_id openvrml_::xml_reader::cdata_id
+     *
+     * @brief CDATA identifier.
+     */
+
+    /**
+     * @var openvrml_::xml_reader::node_type_id openvrml_::xml_reader::processing_instruction_id
+     *
+     * @brief Processing instruction identifier.
+     */
+
+    /**
+     * @var openvrml_::xml_reader::node_type_id openvrml_::xml_reader::comment_id
+     *
+     * @brief Comment identifier.
+     */
+
+    /**
+     * @var openvrml_::xml_reader::node_type_id openvrml_::xml_reader::document_type_id
+     *
+     * @brief Document type identifier.
+     */
+
+    /**
+     * @var openvrml_::xml_reader::node_type_id openvrml_::xml_reader::whitespace_id
+     *
+     * @brief Whitespace identifier.
+     */
+
+    /**
+     * @var openvrml_::xml_reader::node_type_id openvrml_::xml_reader::end_element_id
+     *
+     * @brief Element end tag identifier.
+     *
+     * Unlike SAX, where you get an “end of element” callback at
+     * the logical element boundary, @c #node_type only returns this value
+     * when the current node is a literal end tag.
+     */
+
+    /**
+     * @var openvrml_::xml_reader::node_type_id openvrml_::xml_reader::xml_declaration_id
+     *
+     * @brief XML declaration identifier.
+     */
+
+    /**
+     * @brief Construct from a file name.
+     *
+     * @param[in] filename  the full path to a file.
+     *
+     * @exception std::runtime_error    if opening @p filename or creating the
+     *                                  underlying XML reader fails.
+     */
+    openvrml_::xml_reader::xml_reader(const std::string & filename)
+        OPENVRML_THROW1(std::runtime_error):
 # ifdef _WIN32
         input(0),
 # endif
@@ -6456,10 +6559,16 @@
         static const char * const encoding = 0;
         static const int options = 0;
         this->reader = xmlReaderForFile(filename.c_str(), encoding, options);
+        if (!this->reader) {
+            throw std::runtime_error("failed to create XML reader");
+        }
 # endif
     }
 
-    openvrml_::xml_reader::~xml_reader()
+    /**
+     * @brief Destroy.
+     */
+    openvrml_::xml_reader::~xml_reader() OPENVRML_NOTHROW
     {
 # ifdef _WIN32
         this->reader->Release();
@@ -6469,7 +6578,14 @@
 # endif
     }
 
-    int openvrml_::xml_reader::read()
+    /**
+     * @brief Advance to the next node in the stream.
+     *
+     * @retval 1 if the node was read successfully
+     * @retval 0 if there are no more nodes to read
+     * @retval -1 if there is an error.
+     */
+    int openvrml_::xml_reader::read() OPENVRML_NOTHROW
     {
 # ifdef _WIN32
         HRESULT hr = this->reader->Read(0);
@@ -6483,8 +6599,13 @@
 # endif
     }
 
+    /**
+     * @brief The type of the current node.
+     *
+     * @return the type of the current node.
+     */
     openvrml_::xml_reader::node_type_id
-    openvrml_::xml_reader::node_type() const
+    openvrml_::xml_reader::node_type() const OPENVRML_NOTHROW
     {
 # ifdef _WIN32
         XmlNodeType type;
@@ -6495,7 +6616,16 @@
 # endif
     }
 
+    /**
+     * @brief The local (i.e., unqualified) name of the node.
+     *
+     * @return the local name of the node.
+     *
+     * @exception std::runtime_error    if there is an error getting the name.
+     * @exception std::bad_alloc        if memory allocation fails.
+     */
     const std::string openvrml_::xml_reader::local_name() const
+        OPENVRML_THROW2(std::runtime_error, std::bad_alloc)
     {
 # ifdef _WIN32
         const WCHAR * name;
@@ -6510,7 +6640,16 @@
 # endif
     }
 
+    /**
+     * @brief The text value of the node, if any.
+     *
+     * @return the text value of the node.
+     *
+     * @exception std::runtime_error    if there is an error getting the value.
+     * @exception std::bad_alloc        if memory allocation fails.
+     */
     const std::string openvrml_::xml_reader::value() const
+        OPENVRML_THROW2(std::runtime_error, std::bad_alloc)
     {
 # ifdef _WIN32
         const WCHAR * val;
@@ -6525,7 +6664,14 @@
 # endif
     }
 
-    int openvrml_::xml_reader::move_to_first_attribute()
+    /**
+     * @brief Move to the first attribute associated with the current node.
+     *
+     * @retval 1 on success
+     * @retval 0 if the current node has no attributes
+     * @retval -1 if there is an error
+     */
+    int openvrml_::xml_reader::move_to_first_attribute() OPENVRML_NOTHROW
     {
 # ifdef _WIN32
         HRESULT hr = this->reader->MoveToFirstAttribute();
@@ -6539,7 +6685,14 @@
 # endif
     }
 
-    int openvrml_::xml_reader::move_to_next_attribute()
+    /**
+     * @brief Move to the next attribute associated with the current node.
+     *
+     * @retval 1 on success
+     * @retval 0 if the current node has no more attributes
+     * @retval -1 if there is an error
+     */
+    int openvrml_::xml_reader::move_to_next_attribute() OPENVRML_NOTHROW
     {
 # ifdef _WIN32
         HRESULT hr = this->reader->MoveToNextAttribute();
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
 |