You can subscribe to this list here.
| 2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
(128) |
Dec
(65) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2006 |
Jan
(48) |
Feb
(132) |
Mar
(95) |
Apr
(47) |
May
(54) |
Jun
(2) |
Jul
(57) |
Aug
(109) |
Sep
(131) |
Oct
(186) |
Nov
(105) |
Dec
(78) |
| 2007 |
Jan
(125) |
Feb
(105) |
Mar
(52) |
Apr
(104) |
May
(63) |
Jun
(116) |
Jul
(76) |
Aug
|
Sep
(18) |
Oct
(93) |
Nov
(110) |
Dec
(169) |
| 2008 |
Jan
(90) |
Feb
(64) |
Mar
(41) |
Apr
(23) |
May
(6) |
Jun
(18) |
Jul
(10) |
Aug
(61) |
Sep
(139) |
Oct
(50) |
Nov
(55) |
Dec
(2) |
| 2009 |
Jan
|
Feb
(1) |
Mar
(62) |
Apr
(22) |
May
(17) |
Jun
(19) |
Jul
(40) |
Aug
(21) |
Sep
|
Oct
(40) |
Nov
(23) |
Dec
|
| 2010 |
Jan
(14) |
Feb
(40) |
Mar
(9) |
Apr
(11) |
May
(19) |
Jun
(4) |
Jul
(10) |
Aug
(22) |
Sep
(15) |
Oct
|
Nov
(2) |
Dec
|
| 2011 |
Jan
(13) |
Feb
(10) |
Mar
|
Apr
(13) |
May
|
Jun
|
Jul
(2) |
Aug
(4) |
Sep
|
Oct
|
Nov
|
Dec
|
| 2012 |
Jan
|
Feb
|
Mar
|
Apr
(33) |
May
(20) |
Jun
|
Jul
(8) |
Aug
(7) |
Sep
(2) |
Oct
|
Nov
|
Dec
|
|
From: Braden M. <br...@us...> - 2006-02-06 00:50:45
|
Update of /cvsroot/openvrml/openvrml/src/libopenvrml-gl/openvrml/gl In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21583/src/libopenvrml-gl/openvrml/gl Modified Files: viewer.cpp Log Message: Added missing instances of OPENVRML_GL_LOCAL. Index: viewer.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/src/libopenvrml-gl/openvrml/gl/viewer.cpp,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** viewer.cpp 11 Aug 2005 22:50:14 -0000 1.37 --- viewer.cpp 6 Feb 2006 00:50:36 -0000 1.38 *************** *** 862,868 **** // OPENVRML_GL_LOCAL const rotation trackball(float p1x, ! float p1y, ! float p2x, ! float p2y) { // --- 862,868 ---- // OPENVRML_GL_LOCAL const rotation trackball(float p1x, ! float p1y, ! float p2x, ! float p2y) { // *************** *** 980,984 **** // Call this after each frame for debugging... ! void checkErrors(const std::string & s) { GLenum glerr; --- 980,984 ---- // Call this after each frame for debugging... ! OPENVRML_GL_LOCAL void checkErrors(const std::string & s) { GLenum glerr; *************** *** 1523,1532 **** * world creator could just as easily do that with DEF/USE ...). */ ! void computeCylinder(const double height, ! const double radius, ! const int numFacets, ! float c[][3], ! float tc[][3], ! int faces[]) { double angle, x, y; --- 1523,1532 ---- * world creator could just as easily do that with DEF/USE ...). */ ! OPENVRML_GL_LOCAL void computeCylinder(const double height, ! const double radius, ! const int numFacets, ! float c[][3], ! float tc[][3], ! int faces[]) { double angle, x, y; *************** *** 1760,1764 **** // Compute a normal at vert i,j of an ElevationGrid. ! const vec3f elevationVertexNormal( const int i, const int j, const int nx, const int nz, --- 1760,1764 ---- // Compute a normal at vert i,j of an ElevationGrid. ! OPENVRML_GL_LOCAL const vec3f elevationVertexNormal( const int i, const int j, const int nx, const int nz, *************** *** 1935,1939 **** // Extrusion cap tessellation for non-convex shapes ! struct TessExtrusion { const float * c; // coordinates array [nVerts * 3] const float * crossSection; // crossSection coordinates [nCrossSection * 2] --- 1935,1939 ---- // Extrusion cap tessellation for non-convex shapes ! struct OPENVRML_GL_LOCAL TessExtrusion { const float * c; // coordinates array [nVerts * 3] const float * crossSection; // crossSection coordinates [nCrossSection * 2] *************** *** 2007,2015 **** namespace { ! void insertExtrusionCaps(GLUtesselator & tesselator, ! const unsigned int mask, ! const size_t nSpine, ! const std::vector<vec3f> & c, ! const std::vector<vec2f> & cs) { using std::vector; --- 2007,2015 ---- namespace { ! OPENVRML_GL_LOCAL void insertExtrusionCaps(GLUtesselator & tesselator, ! const unsigned int mask, ! const size_t nSpine, ! const std::vector<vec3f> & c, ! const std::vector<vec2f> & cs) { using std::vector; *************** *** 2144,2153 **** * @retval tc */ ! void computeExtrusion_(const std::vector<rotation> & orientation, ! const std::vector<vec2f> & scale, ! const std::vector<vec2f> & crossSection, ! const std::vector<vec3f> & spine, ! std::vector<vec3f> & c, ! std::vector<vec2f> & tc) { size_t i, j, ci; --- 2144,2154 ---- * @retval tc */ ! OPENVRML_GL_LOCAL void ! computeExtrusion_(const std::vector<rotation> & orientation, ! const std::vector<vec2f> & scale, ! const std::vector<vec2f> & crossSection, ! const std::vector<vec3f> & spine, ! std::vector<vec3f> & c, ! std::vector<vec2f> & tc) { size_t i, j, ci; *************** *** 2329,2339 **** * @retval faces */ ! void computeExtrusion_(const std::vector<rotation> & orientation, ! const std::vector<vec2f> & scale, ! const std::vector<vec2f> & crossSection, ! const std::vector<vec3f> & spine, ! std::vector<vec3f> & c, ! std::vector<vec2f> & tc, ! std::vector<int32> & faces) { computeExtrusion_(orientation, scale, crossSection, spine, c, tc); --- 2330,2341 ---- * @retval faces */ ! OPENVRML_GL_LOCAL void ! computeExtrusion_(const std::vector<rotation> & orientation, ! const std::vector<vec2f> & scale, ! const std::vector<vec2f> & crossSection, ! const std::vector<vec3f> & spine, ! std::vector<vec3f> & c, ! std::vector<vec2f> & tc, ! std::vector<int32> & faces) { computeExtrusion_(orientation, scale, crossSection, spine, c, tc); *************** *** 2554,2560 **** namespace { ! void computeBounds(size_t npoints, ! const float * points, ! float (&bounds)[6]) { if (npoints == 0) { --- 2556,2562 ---- namespace { ! OPENVRML_GL_LOCAL void computeBounds(size_t npoints, ! const float * points, ! float (&bounds)[6]) { if (npoints == 0) { *************** *** 2577,2583 **** } ! void texGenParams(float bounds[], // xmin,xmax, ymin,ymax, zmin,zmax ! int axes[2], // s, t ! float params[4]) // s0, 1/sSize, t0, 1/tSize { axes[0] = 0; --- 2579,2585 ---- } ! OPENVRML_GL_LOCAL void texGenParams(float bounds[], // xmin,xmax, ymin,ymax, zmin,zmax ! int axes[2], // s, t ! float params[4]) // s0, 1/sSize, t0, 1/tSize { axes[0] = 0; *************** *** 2611,2615 **** } ! void insertShellConvex(ShellData * const s) { vec3f N; --- 2613,2617 ---- } ! OPENVRML_GL_LOCAL void insertShellConvex(ShellData * const s) { vec3f N; *************** *** 2711,2723 **** } ! void insertShellTess(GLUtesselator & tessobj, ! const std::vector<vertex_data> & vertices, ! const std::vector<int32> & coord_index, ! const bool color_per_face, ! const std::vector<openvrml::color> & color, ! const std::vector<int32> & color_index, ! const bool normal_per_face, ! const std::vector<vec3f> & normal, ! const std::vector<int32> & normal_index) { using std::vector; --- 2713,2726 ---- } ! OPENVRML_GL_LOCAL void ! insertShellTess(GLUtesselator & tessobj, ! const std::vector<vertex_data> & vertices, ! const std::vector<int32> & coord_index, ! const bool color_per_face, ! const std::vector<openvrml::color> & color, ! const std::vector<int32> & color_index, ! const bool normal_per_face, ! const std::vector<vec3f> & normal, ! const std::vector<int32> & normal_index) { using std::vector; *************** *** 2940,2948 **** namespace { ! void computeSphere(const double radius, ! const int numLatLong, ! float c[][3], ! float tc[][3], ! int *faces) { double r, angle, x, y, z; --- 2943,2951 ---- namespace { ! OPENVRML_GL_LOCAL void computeSphere(const double radius, ! const int numLatLong, ! float c[][3], ! float tc[][3], ! int *faces) { double r, angle, x, y, z; *************** *** 3422,3426 **** namespace { ! inline bool power_of_2(unsigned long n) { return !(n & (n - 1)); --- 3425,3429 ---- namespace { ! OPENVRML_GL_LOCAL inline bool power_of_2(unsigned long n) { return !(n & (n - 1)); *************** *** 3610,3618 **** * Compute a target and up vector from position/orientation/distance. */ ! void computeView(const vec3f & position, ! const rotation & orientation, ! const float distance, ! vec3f & target, ! vec3f & up) { // Graphics Gems, p 466. Convert between axis/angle and rotation matrix --- 3613,3621 ---- * Compute a target and up vector from position/orientation/distance. */ ! OPENVRML_GL_LOCAL void computeView(const vec3f & position, ! const rotation & orientation, ! const float distance, ! vec3f & target, ! vec3f & up) { // Graphics Gems, p 466. Convert between axis/angle and rotation matrix |
|
From: Braden M. <br...@us...> - 2006-02-06 00:50:44
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21583 Modified Files: ChangeLog Log Message: Added missing instances of OPENVRML_GL_LOCAL. Index: ChangeLog =================================================================== RCS file: /cvsroot/openvrml/openvrml/ChangeLog,v retrieving revision 1.1124 retrieving revision 1.1125 diff -C2 -d -r1.1124 -r1.1125 *** ChangeLog 5 Feb 2006 22:15:41 -0000 1.1124 --- ChangeLog 6 Feb 2006 00:50:35 -0000 1.1125 *************** *** 1,4 **** --- 1,40 ---- 2006-02-05 Braden McDaniel <br...@en...> + Added missing instances of OPENVRML_GL_LOCAL. + + * src/libopenvrml-gl/openvrml/gl/viewer.cpp + (checkErrors(const std::string &)): Added OPENVRML_GL_LOCAL. + (computeCylinder(double, double, int, float[][3], float[][3], + int[])): Added OPENVRML_GL_LOCAL. + (elevationVertexNormal(int, int, int, int, float, float)): Added + OPENVRML_GL_LOCAL. + (TessExtrusion): Added OPENVRML_GL_LOCAL. + (insertExtrusionCaps(GLUtesselator &, unsigned int, size_t, const + std::vector<vec3f> &, const std::vector<vec2f> &)): Added + OPENVRML_GL_LOCAL. + (computeExtrusion_(const std::vector<rotation> &, const + std::vector<vec2f> &, const std::vector<vec2f> &, const + std::vector<vec3f> &, std::vector<vec3f> &, std::vector<vec2f>&)): + Added OPENVRML_GL_LOCAL. + (computeExtrusion_(const std::vector<rotation> &, const + std::vector<vec2f> &, const std::vector<vec2f> &, const + std::vector<vec3f> &, std::vector<vec3f> &, std::vector<vec2f> &, + std::vector<int32> &)): Added OPENVRML_GL_LOCAL. + (computeBounds(size_t, const float *, float (&)[6])): Added + OPENVRML_GL_LOCAL. + (texGenParams(float[], int[], float[])): Added OPENVRML_GL_LOCAL. + (insertShellConvex(ShellData *)): Added OPENVRML_GL_LOCAL. + (insertShellTess(GLUtesselator &, const std::vector<vertex_data>&, + const std::vector<int32> &, bool, const std::vector<color> &, + const std::vector<int32> &, bool, const std::vector<vec3f> &, + const std::vector<int32> &)): Added OPENVRML_GL_LOCAL. + (computeSphere(double, int, float[][3], float[][3], int *)): Added + OPENVRML_GL_LOCAL. + (power_of_2(unsigned long)): Added OPENVRML_GL_LOCAL. + (computeView(const vec3f &, const rotation &, float, vec3f &, + vec3f &)): Added OPENVRML_GL_LOCAL. + + 2006-02-05 Braden McDaniel <br...@en...> + Refactored code into custom Gtk+ widget. |
Update of /cvsroot/openvrml/openvrml/mozilla-plugin/src/openvrml-player In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19538/mozilla-plugin/src/openvrml-player Modified Files: Makefile.am player.cpp Added Files: gtkvrmlbrowser.cpp gtkvrmlbrowser.h Removed Files: browser.cpp browser.h gtkglviewer.cpp gtkglviewer.h Log Message: Refactored code into custom Gtk+ widget. --- NEW FILE: gtkvrmlbrowser.cpp --- // -*- Mode: C++; indent-tabs-mode: nil; c-basic-offset: 4; -*- // // OpenVRML Mozilla plug-in // Copyright 2004, 2005, 2006 Braden N. McDaniel // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // # include <iostream> # include <sstream> // Must include before X11 headers. # include <boost/numeric/conversion/converter.hpp> # include <X11/keysym.h> # include <gdk/gdkx.h> # include <openvrml/browser.h> # include <openvrml/gl/viewer.h> # include "gtkvrmlbrowser.h" # include "plugin_streambuf.h" extern "C" { void gtk_vrml_browser_class_init(GtkVrmlBrowserClass * klass); void gtk_vrml_browser_init(GtkVrmlBrowser * vrml_browser); G_GNUC_INTERNAL gboolean gtk_vrml_browser_destroy(GtkWidget * widget, GdkEvent * event, gpointer data); G_GNUC_INTERNAL gboolean gtk_vrml_browser_realize(GtkWidget * widget, GdkEvent * event, gpointer data); G_GNUC_INTERNAL gboolean gtk_vrml_browser_expose_event(GtkWidget * widget, GdkEventExpose * event, gpointer data); G_GNUC_INTERNAL gboolean gtk_vrml_browser_configure_event(GtkWidget * widget, GdkEventConfigure * event, gpointer data); G_GNUC_INTERNAL gboolean gtk_vrml_browser_key_press_event(GtkWidget * widget, GdkEventKey * event, gpointer data); G_GNUC_INTERNAL gboolean gtk_vrml_browser_button_press_event(GtkWidget * widget, GdkEventButton * event, gpointer data); G_GNUC_INTERNAL gboolean gtk_vrml_browser_button_release_event(GtkWidget * widget, GdkEventButton * event, gpointer data); G_GNUC_INTERNAL gboolean gtk_vrml_browser_motion_notify_event(GtkWidget * widget, GdkEventMotion * event, gpointer data); 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; class G_GNUC_INTERNAL browser : public openvrml::browser { GIOChannel * request_channel_; public: explicit browser(GIOChannel & request_channel); private: virtual std::auto_ptr<openvrml::resource_istream> do_get_resource(const std::string & uri); }; class G_GNUC_INTERNAL GtkGLViewer : public openvrml::gl::viewer { friend void (::gtk_vrml_browser_load_url)(GtkVrmlBrowser * vrml_browser, const gchar ** url, const gchar ** parameter); friend void (::gtk_vrml_browser_set_world)(GtkVrmlBrowser * vrml_browser, openvrml::resource_istream & in); friend gint (::gtk_vrml_browser_timeout_callback)(gpointer ptr); friend gboolean (::gtk_vrml_browser_expose_event)(GtkWidget *, GdkEventExpose *, gpointer); ::browser browser_; GtkVrmlBrowser & vrml_browser_; guint timer; public: bool redrawNeeded; GtkGLViewer(GIOChannel & request_channel, GtkVrmlBrowser & vrml_browser); virtual ~GtkGLViewer() throw (); void timer_update(); protected: // // Implement pure virtual methods from openvrml::gl::viewer. // virtual void post_redraw(); virtual void set_cursor(openvrml::gl::viewer::cursor_style); virtual void swap_buffers(); virtual void set_timer(double); }; } GtkWidget * gtk_vrml_browser_new(GIOChannel * const request_channel) { GtkVrmlBrowser * const vrml_browser = GTK_VRML_BROWSER(g_object_new(GTK_TYPE_VRML_BROWSER, 0)); try { vrml_browser->viewer = new GtkGLViewer(*request_channel, *vrml_browser); } catch (std::bad_alloc &) { g_return_val_if_reached(0); } static_cast<GtkGLViewer *>(vrml_browser->viewer) ->resize(GTK_WIDGET(vrml_browser)->allocation.width, GTK_WIDGET(vrml_browser)->allocation.height); return GTK_WIDGET(vrml_browser); } void gtk_vrml_browser_load_url(GtkVrmlBrowser * const vrml_browser, const gchar ** url, const gchar ** parameter) { using std::string; using std::vector; GtkGLViewer & viewer = *static_cast<GtkGLViewer *>(vrml_browser->viewer); vector<string> url_vec, param_vec; while (url) { url_vec.push_back(*(url++)); } while (parameter) { param_vec.push_back(*(parameter++)); } viewer.browser_.load_url(url_vec, param_vec); } void gtk_vrml_browser_set_world(GtkVrmlBrowser * vrml_browser, openvrml::resource_istream & in) { GtkGLViewer & viewer = *static_cast<GtkGLViewer *>(vrml_browser->viewer); viewer.browser_.set_world(in); } void gtk_vrml_browser_class_init(GtkVrmlBrowserClass * klass) {} void gtk_vrml_browser_init(GtkVrmlBrowser * const vrml_browser) { vrml_browser->viewer = 0; if (!::gl_config) { static const int attrib_list[] = { // GDK_GL_ALPHA_SIZE, 1, GDK_GL_DOUBLEBUFFER, GDK_GL_DEPTH_SIZE, 1, GDK_GL_RGBA, GDK_GL_RED_SIZE, 1, GDK_GL_ATTRIB_LIST_NONE }; ::gl_config = gdk_gl_config_new(attrib_list); } static GdkGLContext * const share_list = 0; static const gboolean direct = false; static const int render_type = GDK_GL_RGBA_TYPE; gtk_widget_set_gl_capability(GTK_WIDGET(vrml_browser), ::gl_config, share_list, direct, render_type); gtk_widget_add_events(GTK_WIDGET(vrml_browser), GDK_EXPOSURE_MASK | GDK_BUTTON_PRESS_MASK | GDK_BUTTON_RELEASE_MASK | GDK_KEY_PRESS_MASK | GDK_POINTER_MOTION_MASK); g_signal_connect(G_OBJECT(vrml_browser), "destroy_event", G_CALLBACK(gtk_vrml_browser_destroy), 0); g_signal_connect(G_OBJECT(vrml_browser), "expose_event", G_CALLBACK(gtk_vrml_browser_expose_event), 0); g_signal_connect(G_OBJECT(vrml_browser), "configure_event", G_CALLBACK(gtk_vrml_browser_configure_event), 0); g_signal_connect(G_OBJECT(vrml_browser), "key_press_event", G_CALLBACK(gtk_vrml_browser_key_press_event), 0); g_signal_connect(G_OBJECT(vrml_browser), "button_press_event", G_CALLBACK(gtk_vrml_browser_button_press_event), 0); g_signal_connect(G_OBJECT(vrml_browser), "button_release_event", G_CALLBACK(gtk_vrml_browser_button_release_event), 0); g_signal_connect(G_OBJECT(vrml_browser), "motion_notify_event", G_CALLBACK(gtk_vrml_browser_motion_notify_event), 0); } gboolean gtk_vrml_browser_destroy(GtkWidget * const widget, GdkEvent *, gpointer) { delete static_cast<GtkGLViewer *>(GTK_VRML_BROWSER(widget)->viewer); return true; } gboolean gtk_vrml_browser_realize(GtkWidget *, GdkEvent *, gpointer) { return true; } gboolean gtk_vrml_browser_expose_event(GtkWidget * const widget, GdkEventExpose * const event, gpointer) { GdkGLDrawable * const gl_drawable = gtk_widget_get_gl_drawable(widget); g_assert(gl_drawable); GdkGLContext * const gl_context = gtk_widget_get_gl_context(widget); g_assert(gl_context); GtkGLViewer & viewer = *static_cast<GtkGLViewer *>(GTK_VRML_BROWSER(widget)->viewer); if (event->count == 0 && gdk_gl_drawable_make_current(gl_drawable, gl_context)) { viewer.redraw(); } viewer.redrawNeeded = false; if (viewer.timer == 0) { viewer.timer_update(); } return true; } gboolean gtk_vrml_browser_configure_event(GtkWidget * const widget, GdkEventConfigure *, gpointer) { GdkGLDrawable * const gl_drawable = gtk_widget_get_gl_drawable(widget); g_assert(gl_drawable); GdkGLContext * const gl_context = gtk_widget_get_gl_context(widget); g_assert(gl_context); if (GTK_VRML_BROWSER(widget)->viewer && gdk_gl_drawable_make_current(gl_drawable, gl_context)) { GtkGLViewer & viewer = *static_cast<GtkGLViewer *>(GTK_VRML_BROWSER(widget)->viewer); viewer.resize(widget->allocation.width, widget->allocation.height); } return true; } gboolean gtk_vrml_browser_key_press_event(GtkWidget * const widget, GdkEventKey * const event, gpointer) { using openvrml::gl::viewer; viewer::event_info info; info.event = viewer::event_key_down; switch (event->keyval) { case XK_Home: info.what = viewer::key_home; break; case XK_Left: info.what = viewer::key_left; break; case XK_Up: info.what = viewer::key_up; break; case XK_Right: info.what = viewer::key_right; break; case XK_Down: info.what = viewer::key_down; break; case XK_Page_Up: info.what = viewer::key_page_up; break; case XK_Page_Down: info.what = viewer::key_page_down; break; default: if (event->length <= 0) { return true; } info.what = event->string[0]; } GdkGLDrawable * const gl_drawable = gtk_widget_get_gl_drawable(widget); g_assert(gl_drawable); GdkGLContext * const gl_context = gtk_widget_get_gl_context(widget); g_assert(gl_context); if (gdk_gl_drawable_make_current(gl_drawable, gl_context)) { GtkGLViewer * const viewer = static_cast<GtkGLViewer *>(GTK_VRML_BROWSER(widget)->viewer); g_assert(viewer); viewer->input(&info); } return true; } gboolean gtk_vrml_browser_button_press_event(GtkWidget * const widget, GdkEventButton * const event, gpointer) { using openvrml::gl::viewer; viewer::event_info info; info.event = viewer::event_mouse_click; switch (event->button) { case Button1: info.what = 0; break; case Button2: info.what = 1; break; case Button3: info.what = 2; break; } info.x = int(event->x); info.y = int(event->y); GdkGLDrawable * const gl_drawable = gtk_widget_get_gl_drawable(widget); g_assert(gl_drawable); GdkGLContext * const gl_context = gtk_widget_get_gl_context(widget); g_assert(gl_context); if (gdk_gl_drawable_make_current(gl_drawable, gl_context)) { GtkGLViewer * const viewer = static_cast<GtkGLViewer *>(GTK_VRML_BROWSER(widget)->viewer); g_assert(viewer); viewer->input(&info); } return true; } gboolean gtk_vrml_browser_button_release_event(GtkWidget * const widget, GdkEventButton * const event, gpointer) { using openvrml::gl::viewer; viewer::event_info info; info.event = viewer::event_mouse_release; switch (event->button) { case Button1: info.what = 0; break; case Button2: info.what = 1; break; case Button3: info.what = 2; break; } info.x = int(event->x); info.y = int(event->y); GdkGLDrawable * const gl_drawable = gtk_widget_get_gl_drawable(widget); g_assert(gl_drawable); GdkGLContext * const gl_context = gtk_widget_get_gl_context(widget); g_assert(gl_context); if (gdk_gl_drawable_make_current(gl_drawable, gl_context)) { GtkGLViewer * const viewer = static_cast<GtkGLViewer *>(GTK_VRML_BROWSER(widget)->viewer); g_assert(viewer); viewer->input(&info); } return true; } gboolean gtk_vrml_browser_motion_notify_event(GtkWidget * const widget, GdkEventMotion * const event, gpointer) { using openvrml::gl::viewer; viewer::event_info info; info.event = viewer::event_mouse_drag; info.what = 0; if (event->state & Button1Mask) { info.what = 0; } else if (event->state & Button2Mask) { info.what = 1; } else if (event->state & Button3Mask) { info.what = 2; } else { info.event = viewer::event_mouse_move; } info.x = int(event->x); info.y = int(event->y); GdkGLDrawable * const gl_drawable = gtk_widget_get_gl_drawable(widget); g_assert(gl_drawable); GdkGLContext * const gl_context = gtk_widget_get_gl_context(widget); g_assert(gl_context); if (gdk_gl_drawable_make_current(gl_drawable, gl_context)) { GtkGLViewer * const viewer = static_cast<GtkGLViewer *>(GTK_VRML_BROWSER(widget)->viewer); g_assert(viewer); viewer->input(&info); } return true; } gint gtk_vrml_browser_timeout_callback(const gpointer ptr) { assert(ptr); GtkGLViewer & viewer = *static_cast<GtkGLViewer *>(ptr); viewer.timer_update(); return false; } namespace { browser::browser(GIOChannel & request_channel): openvrml::browser(std::cout, std::cerr), request_channel_(&request_channel) {} std::auto_ptr<openvrml::resource_istream> browser::do_get_resource(const std::string & uri) { using openvrml_player::plugin_streambuf; class plugin_resource_istream : public openvrml::resource_istream { boost::shared_ptr<plugin_streambuf> streambuf_; GIOChannel * request_channel_; public: plugin_resource_istream(const std::string & uri, GIOChannel * const request_channel): openvrml::resource_istream(0), streambuf_(new plugin_streambuf(uri)), request_channel_(request_channel) { using std::ostringstream; using openvrml_player::uninitialized_plugin_streambuf_map_; this->rdbuf(this->streambuf_.get()); bool succeeded = uninitialized_plugin_streambuf_map_ .insert(uri, this->streambuf_); g_assert(succeeded); ostringstream request; request << "get-url " << uri << '\n'; gsize bytes_written; g_io_channel_write_chars(this->request_channel_, request.str().data(), request.str().length(), &bytes_written, 0); g_io_channel_flush(this->request_channel_, 0); } private: virtual const std::string do_url() const throw () { return this->streambuf_->url(); } virtual const std::string do_type() const throw () { return this->streambuf_->type(); } virtual bool do_data_available() const throw () { return this->streambuf_->data_available(); } }; return std::auto_ptr<openvrml::resource_istream>( new plugin_resource_istream(uri, this->request_channel_)); } GtkGLViewer::GtkGLViewer(GIOChannel & request_channel, GtkVrmlBrowser & vrml_browser): browser_(request_channel), vrml_browser_(vrml_browser), timer(0), redrawNeeded(false) { this->browser_.viewer(this); } GtkGLViewer::~GtkGLViewer() throw () { if (this->timer) { g_source_remove(timer); } } void GtkGLViewer::post_redraw() { if (!this->redrawNeeded) { this->redrawNeeded = true; gtk_widget_queue_draw(GTK_WIDGET(&this->vrml_browser_)); } } void GtkGLViewer::set_cursor(cursor_style style) { GdkCursor * cursor(0); switch(style) { case cursor_inherit: XDefineCursor(GDK_WINDOW_XDISPLAY( GTK_WIDGET(&this->vrml_browser_)->window), GDK_WINDOW_XWINDOW( GTK_WIDGET(&this->vrml_browser_)->window), None); return; case cursor_info: cursor = gdk_cursor_new(GDK_HAND1); break; case cursor_cycle: cursor = gdk_cursor_new(GDK_EXCHANGE); break; case cursor_up_down: cursor = gdk_cursor_new(GDK_SB_V_DOUBLE_ARROW); break; case cursor_crosshair: cursor = gdk_cursor_new(GDK_CROSSHAIR); break; default: cursor = gdk_cursor_new(GDK_ARROW); } gdk_window_set_cursor(GTK_WIDGET(&this->vrml_browser_)->window, cursor); gdk_cursor_destroy(cursor); } void GtkGLViewer::swap_buffers() { GdkGLDrawable * const gl_drawable = gtk_widget_get_gl_drawable(GTK_WIDGET(&this->vrml_browser_)); gdk_gl_drawable_swap_buffers(gl_drawable); } void GtkGLViewer::set_timer(const double t) { if (!this->timer) { this->timer = g_timeout_add(guint(10.0 * (t + 1)), GtkFunction(gtk_vrml_browser_timeout_callback), this); } } void GtkGLViewer::timer_update() { this->timer = 0; this->viewer::update(); } } --- gtkglviewer.h DELETED --- --- NEW FILE: gtkvrmlbrowser.h --- /* -*- Mode: C; indent-tabs-mode: nil; c-basic-offset: 4; -*- * * OpenVRML Mozilla plug-in * Copyright 2004, 2005, 2006 Braden N. McDaniel * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ # ifndef GTK_VRML_BROWSER_H # define GTK_VRML_BROWSER_H # include <gtk/gtkdrawingarea.h> # include <gtk/gtkgl.h> G_BEGIN_DECLS # define GTK_TYPE_VRML_BROWSER (gtk_vrml_browser_get_type ()) # define GTK_VRML_BROWSER(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_VRML_BROWSER, GtkVrmlBrowser)) # define GTK_VRML_BROWSER_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GTK_TYPE_VRML_BROWSER, GtkVrmlBrowserClass)) # define GTK_IS_VRML_BROWSER(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GTK_TYPE_VRML_BROWSER)) # define GTK_IS_VRML_BROWSER_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_TYPE_VRML_BROWSER)) # define GTK_VRML_BROWSER_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_TYPE_VRML_BROWSER, GtkVrmlBrowserClass)) typedef struct GtkVrmlBrowser_ GtkVrmlBrowser; typedef struct GtkVrmlBrowserClass_ GtkVrmlBrowserClass; struct GtkVrmlBrowser_ { GtkDrawingArea drawing_area; void *viewer; }; struct GtkVrmlBrowserClass_ { GtkDrawingAreaClass parent_class; }; GType gtk_vrml_browser_get_type(void) G_GNUC_CONST; GtkWidget *gtk_vrml_browser_new(GIOChannel *request_channel); void gtk_vrml_browser_load_url(GtkVrmlBrowser *vrml_browser, const gchar **url, const char **parameter); G_END_DECLS # ifdef __cplusplus namespace openvrml { class resource_istream; } // // Since OpenVRML has a C++ interface, exposing this to C is Hard. // void gtk_vrml_browser_set_world(GtkVrmlBrowser * vrml_browser, openvrml::resource_istream & in); # endif # endif /* ifndef GTK_VRML_BROWSER_H */ --- gtkglviewer.cpp DELETED --- --- browser.cpp DELETED --- --- browser.h DELETED --- Index: player.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/mozilla-plugin/src/openvrml-player/player.cpp,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** player.cpp 5 Feb 2006 06:40:31 -0000 1.22 --- player.cpp 5 Feb 2006 22:15:42 -0000 1.23 *************** *** 24,31 **** // Must include before X11 headers. # include <boost/numeric/conversion/converter.hpp> ! # include <gdk/gdkx.h> ! # include "browser.h" ! # include "gtkglviewer.h" # include "command_istream.h" # include "plugin_streambuf.h" --- 24,31 ---- // Must include before X11 headers. # include <boost/numeric/conversion/converter.hpp> ! # include <gtk/gtk.h> ! # include <openvrml/browser.h> ! # include "gtkvrmlbrowser.h" # include "command_istream.h" # include "plugin_streambuf.h" *************** *** 130,133 **** --- 130,143 ---- // ::quit_flag.value(true); + + // + // We can safely shut down the Gtk main loop from here. + // + // (However, trying to shut down the command_main loop results in + // it deadlocking in g_main_context_check's call to poll. So we + // still use the annoying quit_flag condition variable (see above) + // to end that thread). + // + gtk_main_quit(); } *************** *** 160,166 **** initial_stream_reader( const boost::shared_ptr<plugin_streambuf> & streambuf, ! openvrml::browser & browser): streambuf_(streambuf), ! browser_(&browser) {} --- 170,176 ---- initial_stream_reader( const boost::shared_ptr<plugin_streambuf> & streambuf, ! GtkVrmlBrowser & vrml_browser): streambuf_(streambuf), ! vrml_browser_(&vrml_browser) {} *************** *** 197,273 **** } } in(this->streambuf_); ! this->browser_->set_world(in); } private: boost::shared_ptr<plugin_streambuf> streambuf_; ! openvrml::browser * browser_; }; GIOChannel * request_channel; - struct command_channel_data { - GMainContext * main_context; - GMainLoop * main_loop; - GIOChannel * command_channel; - }; - struct command_channel_loop { ! explicit command_channel_loop(command_istream & command_in): ! command_in_(&command_in) {} void operator()() const throw () { - command_channel_data data; - data.main_context = g_main_context_new(); - data.main_loop = g_main_loop_new(data.main_context, false); - data.command_channel = g_io_channel_unix_new(0); // stdin - GError * error = 0; - GIOStatus status = - g_io_channel_set_encoding(data.command_channel, - 0, // binary (no encoding) - &error); - if (status != G_IO_STATUS_NORMAL) { - if (error) { - g_critical(error->message); - g_error_free(error); - } - exit(EXIT_FAILURE); - } - - GSource * const command_watch = - g_io_create_watch(data.command_channel, - GIOCondition(G_IO_IN | G_IO_HUP)); - const GDestroyNotify notify = 0; - g_source_set_callback( - command_watch, - reinterpret_cast<GSourceFunc>(::command_data_available), - static_cast<command_streambuf *>(this->command_in_->rdbuf()), - notify); - guint source_id = g_source_attach(command_watch, - data.main_context); - g_return_if_fail(source_id != 0); - GSource * const quit = g_idle_source_new(); g_source_set_callback( quit, ::openvrml_player_command_channel_loop_quit_event, ! &data, notify); ! source_id = g_source_attach(quit, data.main_context); g_return_if_fail(source_id != 0); ! g_main_loop_run(data.main_loop); ! ! g_source_unref(command_watch); ! g_io_channel_unref(data.command_channel); ! ! g_main_loop_unref(data.main_loop); ! g_main_context_unref(data.main_context); } private: ! command_istream * command_in_; }; } --- 207,244 ---- } } in(this->streambuf_); ! gtk_vrml_browser_set_world(this->vrml_browser_, in); } private: boost::shared_ptr<plugin_streambuf> streambuf_; ! GtkVrmlBrowser * vrml_browser_; }; GIOChannel * request_channel; struct command_channel_loop { ! explicit command_channel_loop(GMainLoop & main_loop): ! main_loop_(&main_loop) {} void operator()() const throw () { GSource * const quit = g_idle_source_new(); + const GDestroyNotify notify = 0; g_source_set_callback( quit, ::openvrml_player_command_channel_loop_quit_event, ! this->main_loop_, notify); ! guint source_id = ! g_source_attach(quit, ! g_main_loop_get_context(this->main_loop_)); g_return_if_fail(source_id != 0); ! g_main_loop_run(this->main_loop_); } private: ! GMainLoop * main_loop_; }; } *************** *** 313,319 **** : gtk_window_new(GTK_WINDOW_TOPLEVEL); ! GtkGLViewer viewer(*(GTK_CONTAINER(window)), ::quit_flag); ! browser b(::request_channel); ! b.viewer(&viewer); gtk_widget_show_all(window); --- 284,289 ---- : gtk_window_new(GTK_WINDOW_TOPLEVEL); ! GtkWidget * const vrml_browser = gtk_vrml_browser_new(::request_channel); ! gtk_container_add(GTK_CONTAINER(window), vrml_browser); gtk_widget_show_all(window); *************** *** 321,330 **** thread_group threads; if (argc > 1) { ! const vector<string> uri(1, argv[1]), parameter; ! b.load_url(uri, parameter); } else { function0<void> command_channel_loop_func = ! command_channel_loop(command_in); threads.create_thread(command_channel_loop_func); --- 291,334 ---- thread_group threads; + GMainContext * command_main_context = 0; + GMainLoop * command_main = 0; + GIOChannel * command_channel = 0; + GSource * command_watch = 0; + if (argc > 1) { ! const gchar * url[] = { argv[1], 0 }; ! const gchar ** parameter = 0; ! gtk_vrml_browser_load_url(GTK_VRML_BROWSER(vrml_browser), ! url, ! parameter); } else { + command_main_context = g_main_context_new(); + command_main = g_main_loop_new(command_main_context, false); + command_channel = g_io_channel_unix_new(0); // stdin + GError * error = 0; + GIOStatus status = g_io_channel_set_encoding(command_channel, + 0, // binary (no encoding) + &error); + if (status != G_IO_STATUS_NORMAL) { + if (error) { + g_critical(error->message); + g_error_free(error); + } + return EXIT_FAILURE; + } + + command_watch = g_io_create_watch(command_channel, + GIOCondition(G_IO_IN | G_IO_HUP)); + const GDestroyNotify notify = 0; + g_source_set_callback( + command_watch, + reinterpret_cast<GSourceFunc>(::command_data_available), + static_cast<command_streambuf *>(command_in.rdbuf()), notify); + guint source_id = g_source_attach(command_watch, + command_main_context); + g_return_val_if_fail(source_id != 0, EXIT_FAILURE); + function0<void> command_channel_loop_func = ! command_channel_loop(*command_main); threads.create_thread(command_channel_loop_func); *************** *** 336,340 **** g_return_val_if_fail(succeeded, EXIT_FAILURE); function0<void> initial_stream_reader_func = ! initial_stream_reader(initial_stream, b); threads.create_thread(initial_stream_reader_func); } --- 340,345 ---- g_return_val_if_fail(succeeded, EXIT_FAILURE); function0<void> initial_stream_reader_func = ! initial_stream_reader(initial_stream, ! *GTK_VRML_BROWSER(vrml_browser)); threads.create_thread(initial_stream_reader_func); } *************** *** 343,351 **** threads.create_thread(read_commands); - viewer.timer_update(); gtk_main(); threads.join_all(); if (::request_channel) { GError * error = 0; --- 348,369 ---- threads.create_thread(read_commands); gtk_main(); threads.join_all(); + g_source_unref(command_watch); + + GIOStatus status = g_io_channel_shutdown(command_channel, true, &error); + if (status != G_IO_STATUS_NORMAL) { + if (error) { + g_critical(error->message); + g_error_free(error); + } + } + g_io_channel_unref(command_channel); + + g_main_loop_unref(command_main); + g_main_context_unref(command_main_context); + if (::request_channel) { GError * error = 0; *************** *** 366,386 **** gboolean openvrml_player_command_channel_loop_quit_event(const gpointer data) { ! command_channel_data & cc_data = ! *static_cast<command_channel_data *>(data); if (::quit_flag.value()) { ! GError * error = 0; ! GIOStatus status = g_io_channel_shutdown(cc_data.command_channel, ! true, ! &error); ! if (status != G_IO_STATUS_NORMAL) { ! if (error) { ! g_critical(error->message); ! g_error_free(error); ! } ! } ! ! g_main_loop_quit(cc_data.main_loop); ! return false; } --- 384,391 ---- gboolean openvrml_player_command_channel_loop_quit_event(const gpointer data) { ! GMainLoop * const main_loop = static_cast<GMainLoop *>(data); if (::quit_flag.value()) { ! g_main_loop_quit(main_loop); return false; } Index: Makefile.am =================================================================== RCS file: /cvsroot/openvrml/openvrml/mozilla-plugin/src/openvrml-player/Makefile.am,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** Makefile.am 1 Feb 2006 19:15:51 -0000 1.8 --- Makefile.am 5 Feb 2006 22:15:42 -0000 1.9 *************** *** 18,23 **** command_istream.h \ plugin_streambuf.h \ ! browser.h \ ! gtkglviewer.h \ flag.h openvrml_player_SOURCES = \ --- 18,22 ---- command_istream.h \ plugin_streambuf.h \ ! gtkvrmlbrowser.h \ flag.h openvrml_player_SOURCES = \ *************** *** 25,30 **** command_istream.cpp \ plugin_streambuf.cpp \ ! browser.cpp \ ! gtkglviewer.cpp \ flag.cpp openvrml_player_LDADD = \ --- 24,28 ---- command_istream.cpp \ plugin_streambuf.cpp \ ! gtkvrmlbrowser.cpp \ flag.cpp openvrml_player_LDADD = \ |
|
From: Braden M. <br...@us...> - 2006-02-05 22:15:49
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19538 Modified Files: ChangeLog Log Message: Refactored code into custom Gtk+ widget. Index: ChangeLog =================================================================== RCS file: /cvsroot/openvrml/openvrml/ChangeLog,v retrieving revision 1.1123 retrieving revision 1.1124 diff -C2 -d -r1.1123 -r1.1124 *** ChangeLog 5 Feb 2006 06:40:30 -0000 1.1123 --- ChangeLog 5 Feb 2006 22:15:41 -0000 1.1124 *************** *** 1,4 **** --- 1,41 ---- 2006-02-05 Braden McDaniel <br...@en...> + Refactored code into custom Gtk+ widget. + + * mozilla-plugin/src/openvrml-player/Makefile.am + (noinst_HEADERS): Removed browser.h and gtkglviewer.h. + (openvrml_player_SOURCES): Removed browser.cpp and + gtkglviewer.cpp. + * mozilla-plugin/src/openvrml-player/browser.cpp: Removed file; + code relocated to gtkvrmlbrowser.cpp. + * mozilla-plugin/src/openvrml-player/browser.h: Removed file; code + relocated to gtkvrmlbrowser.cpp. + * mozilla-plugin/src/openvrml-player/gtkglviewer.cpp: Removed + file; code relocated to gtkvrmlbrowser.cpp. + * mozilla-plugin/src/openvrml-player/gtkglviewer.h: Removed file; + code relocated to gtkvrmlbrowser.cpp. + * mozilla-plugin/src/openvrml-player/gtkvrmlbrowser.cpp: Added + file; GtkVrmlBrowser widget implementation. + * mozilla-plugin/src/openvrml-player/gtkvrmlbrowser.h: Added file; + GtkVrmlBrowser widget. + * mozilla-plugin/src/openvrml-player/player.cpp + (openvrml_player::command_istream_reader::operator()() const): End + the main (rendering) thread with a call to gtk_main_quit. + (initial_stream_reader) Changed to use GtkVrmlBrowser instead of + openvrml::browser. + (command_channel_loop::command_channel_loop(GMainLoop &)): Pass a + constructed GMainLoop instead of an + openvrml_player::command_istream. + (command_channel_loop::operator()() const): Relocated code to + create the main loop and add the command_channel watch to main. + (main(int, char *[])): Create the GMainLoop for the + command_channel_loop thread and add the command_channel watch to + it. Use GtkVrmlBrowser instead of openvrml::browser and + openvrml::viewer. + (openvrml_player_command_channel_loop_quit_event(gpointer)): + Relocated code to shut down the command_channel to main. + + 2006-02-05 Braden McDaniel <br...@en...> + * mozilla-plugin/src/openvrml-player/player.cpp (openvrml_player::command_istream_reader): Removed unused member |
|
From: Braden M. <br...@us...> - 2006-02-05 06:41:15
|
Update of /cvsroot/openvrml/openvrml/mozilla-plugin/src/openvrml-player In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12687/mozilla-plugin/src/openvrml-player Modified Files: player.cpp Log Message: Removed unused member browser_. Index: player.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/mozilla-plugin/src/openvrml-player/player.cpp,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** player.cpp 29 Jan 2006 08:09:22 -0000 1.21 --- player.cpp 5 Feb 2006 06:40:31 -0000 1.22 *************** *** 59,66 **** struct command_istream_reader { ! explicit command_istream_reader(command_istream & in, ! openvrml::browser & browser): ! in_(&in), ! browser_(&browser) {} --- 59,64 ---- struct command_istream_reader { ! explicit command_istream_reader(command_istream & in): ! in_(&in) {} *************** *** 136,140 **** private: command_istream * in_; - openvrml::browser * browser_; }; } --- 134,137 ---- *************** *** 343,347 **** } ! function0<void> read_commands = command_istream_reader(command_in, b); threads.create_thread(read_commands); --- 340,344 ---- } ! function0<void> read_commands = command_istream_reader(command_in); threads.create_thread(read_commands); |
|
From: Braden M. <br...@us...> - 2006-02-05 06:41:07
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12687 Modified Files: ChangeLog Log Message: Removed unused member browser_. Index: ChangeLog =================================================================== RCS file: /cvsroot/openvrml/openvrml/ChangeLog,v retrieving revision 1.1122 retrieving revision 1.1123 diff -C2 -d -r1.1122 -r1.1123 *** ChangeLog 5 Feb 2006 05:41:30 -0000 1.1122 --- ChangeLog 5 Feb 2006 06:40:30 -0000 1.1123 *************** *** 1,4 **** --- 1,10 ---- 2006-02-05 Braden McDaniel <br...@en...> + * mozilla-plugin/src/openvrml-player/player.cpp + (openvrml_player::command_istream_reader): Removed unused member + browser_. + + 2006-02-05 Braden McDaniel <br...@en...> + * mozilla-plugin/src/openvrml-player/plugin_streambuf.cpp (openvrml_player::plugin_streambuf::plugin_streambuf(const |
|
From: Braden M. <br...@us...> - 2006-02-05 05:41:41
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28402 Modified Files: ChangeLog Log Message: Initialze c_ to '\0', then set to traits_type::not_eof. This quells an uninitialized variable warning from valgrind. Index: ChangeLog =================================================================== RCS file: /cvsroot/openvrml/openvrml/ChangeLog,v retrieving revision 1.1121 retrieving revision 1.1122 diff -C2 -d -r1.1121 -r1.1122 *** ChangeLog 1 Feb 2006 19:15:50 -0000 1.1121 --- ChangeLog 5 Feb 2006 05:41:30 -0000 1.1122 *************** *** 1,2 **** --- 1,10 ---- + 2006-02-05 Braden McDaniel <br...@en...> + + * mozilla-plugin/src/openvrml-player/plugin_streambuf.cpp + (openvrml_player::plugin_streambuf::plugin_streambuf(const + std::string &)): Initialze c_ to '\0', then set to + traits_type::not_eof. This quells an uninitialized variable + warning from valgrind. + 2006-02-01 Braden McDaniel <br...@en...> |
|
From: Braden M. <br...@us...> - 2006-02-05 05:41:40
|
Update of /cvsroot/openvrml/openvrml/mozilla-plugin/src/openvrml-player In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28402/mozilla-plugin/src/openvrml-player Modified Files: plugin_streambuf.cpp Log Message: Initialze c_ to '\0', then set to traits_type::not_eof. This quells an uninitialized variable warning from valgrind. Index: plugin_streambuf.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/mozilla-plugin/src/openvrml-player/plugin_streambuf.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** plugin_streambuf.cpp 14 Jan 2006 06:04:56 -0000 1.2 --- plugin_streambuf.cpp 5 Feb 2006 05:41:30 -0000 1.3 *************** *** 26,32 **** initialized_(false), url_(requested_url), ! c_(traits_type::not_eof(this->c_)), npstream_destroyed_(false) { this->setg(&this->c_, &this->c_, &this->c_); } --- 26,37 ---- initialized_(false), url_(requested_url), ! c_('\0'), npstream_destroyed_(false) { + // + // This is really just here to emphasize that c_ must not be EOF. + // + this->c_ = traits_type::not_eof(this->c_); + this->setg(&this->c_, &this->c_, &this->c_); } |
|
From: Braden M. <br...@us...> - 2006-02-01 19:16:05
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4440 Modified Files: ChangeLog Log Message: Added top-level gtkglext builddir to include path. Index: ChangeLog =================================================================== RCS file: /cvsroot/openvrml/openvrml/ChangeLog,v retrieving revision 1.1120 retrieving revision 1.1121 diff -C2 -d -r1.1120 -r1.1121 *** ChangeLog 29 Jan 2006 08:09:20 -0000 1.1120 --- ChangeLog 1 Feb 2006 19:15:50 -0000 1.1121 *************** *** 1,2 **** --- 1,7 ---- + 2006-02-01 Braden McDaniel <br...@en...> + + * mozilla-plugin/src/openvrml-player/Makefile.am (AM_CPPFLAGS): + Added top-level gtkglext builddir to include path. + 2006-01-29 Braden McDaniel <br...@en...> |
|
From: Braden M. <br...@us...> - 2006-02-01 19:16:00
|
Update of /cvsroot/openvrml/openvrml/mozilla-plugin/src/openvrml-player In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4440/mozilla-plugin/src/openvrml-player Modified Files: Makefile.am Log Message: Added top-level gtkglext builddir to include path. Index: Makefile.am =================================================================== RCS file: /cvsroot/openvrml/openvrml/mozilla-plugin/src/openvrml-player/Makefile.am,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** Makefile.am 23 Jan 2006 04:45:08 -0000 1.7 --- Makefile.am 1 Feb 2006 19:15:51 -0000 1.8 *************** *** 1,4 **** --- 1,5 ---- AM_CPPFLAGS = \ -I$(top_srcdir)/lib/gtkglext \ + -I$(top_builddir)/lib/gtkglext \ -I$(top_builddir)/lib/gtkglext/gdk \ -I$(top_builddir)/../src/libopenvrml \ |
|
From: Braden M. <br...@us...> - 2006-02-01 05:27:36
|
Update of /cvsroot/openvrml/openvrml/mozilla-plugin/lib/gtkglext/gdk In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23677/gdk Removed Files: gdkglenumtypes.c gdkglenumtypes.h gdkglversion.h Log Message: Merged changes in GtkGLExt 1.1.0. --- gdkglenumtypes.h DELETED --- --- gdkglenumtypes.c DELETED --- --- gdkglversion.h DELETED --- |
|
From: Braden M. <br...@us...> - 2006-02-01 05:27:36
|
Update of /cvsroot/openvrml/openvrml/mozilla-plugin/lib/gtkglext/docs/reference/gtkglext In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23677/docs/reference/gtkglext Removed Files: version.xml Log Message: Merged changes in GtkGLExt 1.1.0. --- version.xml DELETED --- |
|
From: Braden M. <br...@us...> - 2006-02-01 05:27:36
|
Update of /cvsroot/openvrml/openvrml/mozilla-plugin/lib/gtkglext/gtk In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23677/gtk Removed Files: gtkglversion.h Log Message: Merged changes in GtkGLExt 1.1.0. --- gtkglversion.h DELETED --- |
|
From: Braden M. <br...@us...> - 2006-02-01 05:27:36
|
Update of /cvsroot/openvrml/openvrml/mozilla-plugin/lib/gtkglext In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23677 Modified Files: configure.in Removed Files: mkinstalldirs Log Message: Merged changes in GtkGLExt 1.1.0. --- mkinstalldirs DELETED --- Index: configure.in =================================================================== RCS file: /cvsroot/openvrml/openvrml/mozilla-plugin/lib/gtkglext/configure.in,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** configure.in 20 Apr 2005 20:23:28 -0000 1.3 --- configure.in 1 Feb 2006 05:27:28 -0000 1.4 *************** *** 12,19 **** # m4_define([gtkglext_major_version], [1]) ! m4_define([gtkglext_minor_version], [0]) ! m4_define([gtkglext_micro_version], [6]) ! m4_define([gtkglext_interface_age], [4]) ! m4_define([gtkglext_binary_age], [6]) m4_define([gtkglext_version], [gtkglext_major_version.gtkglext_minor_version.gtkglext_micro_version]) --- 12,19 ---- # m4_define([gtkglext_major_version], [1]) ! m4_define([gtkglext_minor_version], [1]) ! m4_define([gtkglext_micro_version], [0]) ! m4_define([gtkglext_interface_age], [0]) ! m4_define([gtkglext_binary_age], [0]) m4_define([gtkglext_version], [gtkglext_major_version.gtkglext_minor_version.gtkglext_micro_version]) *************** *** 60,63 **** --- 60,67 ---- m4_define([pango_required_version], [1.0.0]) + # Pangox + m4_define([pangox_pkg], [pangox]) + m4_define([pangox_required_version], [1.0.0]) + # PangoFT2 m4_define([pangoft2_pkg], [pangoft2]) *************** *** 344,347 **** --- 348,352 ---- gdk_pkg >= gdk_required_version \ pango_pkg >= pango_required_version \ + pangox_pkg >= pangox_required_version \ gmodule_pkg >= gmodule_required_version \ ]) *************** *** 764,768 **** ################################################## ! GDKGLEXT_PACKAGES="gdk_pkg pango_pkg gmodule_pkg" GDKGLEXT_EXTRA_CFLAGS="$GL_CFLAGS $GDKGLEXT_WIN_CFLAGS" GDKGLEXT_EXTRA_LIBS="$GL_LIBS $GDKGLEXT_WIN_LIBS" --- 769,773 ---- ################################################## ! GDKGLEXT_PACKAGES="gdk_pkg pango_pkg pangox_pkg gmodule_pkg" GDKGLEXT_EXTRA_CFLAGS="$GL_CFLAGS $GDKGLEXT_WIN_CFLAGS" GDKGLEXT_EXTRA_LIBS="$GL_LIBS $GDKGLEXT_WIN_LIBS" |
|
From: Braden M. <br...@us...> - 2006-01-29 08:09:32
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29608 Modified Files: ChangeLog Log Message: boost::thread_group manages the lifetime of created threads; eliminated use of boost::scoped_ptr for this. Index: ChangeLog =================================================================== RCS file: /cvsroot/openvrml/openvrml/ChangeLog,v retrieving revision 1.1119 retrieving revision 1.1120 diff -C2 -d -r1.1119 -r1.1120 *** ChangeLog 29 Jan 2006 07:00:58 -0000 1.1119 --- ChangeLog 29 Jan 2006 08:09:20 -0000 1.1120 *************** *** 1,4 **** --- 1,10 ---- 2006-01-29 Braden McDaniel <br...@en...> + * mozilla-plugin/src/openvrml-player/player.cpp + (main(int, char *[])): boost::thread_group manages the lifetime of + created threads; eliminated use of boost::scoped_ptr for this. + + 2006-01-29 Braden McDaniel <br...@en...> + Use g_io_channel_get_buffer_condition instead of select/FD_ISSET. |
|
From: Braden M. <br...@us...> - 2006-01-29 08:09:32
|
Update of /cvsroot/openvrml/openvrml/mozilla-plugin/src/openvrml-player In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29608/mozilla-plugin/src/openvrml-player Modified Files: player.cpp Log Message: boost::thread_group manages the lifetime of created threads; eliminated use of boost::scoped_ptr for this. Index: player.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/mozilla-plugin/src/openvrml-player/player.cpp,v retrieving revision 1.20 retrieving revision 1.21 diff -C2 -d -r1.20 -r1.21 *** player.cpp 28 Jan 2006 18:58:25 -0000 1.20 --- player.cpp 29 Jan 2006 08:09:22 -0000 1.21 *************** *** 281,285 **** using std::vector; using boost::function0; - using boost::scoped_ptr; using boost::shared_ptr; using boost::thread; --- 281,284 ---- *************** *** 325,330 **** thread_group threads; - scoped_ptr<thread> command_channel_loop_thread; - scoped_ptr<thread> initial_stream_reader_thread; if (argc > 1) { const vector<string> uri(1, argv[1]), parameter; --- 324,327 ---- *************** *** 333,338 **** function0<void> command_channel_loop_func = command_channel_loop(command_in); ! command_channel_loop_thread.reset( ! threads.create_thread(command_channel_loop_func)); shared_ptr<plugin_streambuf> initial_stream( --- 330,334 ---- function0<void> command_channel_loop_func = command_channel_loop(command_in); ! threads.create_thread(command_channel_loop_func); shared_ptr<plugin_streambuf> initial_stream( *************** *** 344,354 **** function0<void> initial_stream_reader_func = initial_stream_reader(initial_stream, b); ! initial_stream_reader_thread.reset( ! threads.create_thread(initial_stream_reader_func)); } function0<void> read_commands = command_istream_reader(command_in, b); ! scoped_ptr<thread> command_reader_thread( ! threads.create_thread(read_commands)); viewer.timer_update(); --- 340,348 ---- function0<void> initial_stream_reader_func = initial_stream_reader(initial_stream, b); ! threads.create_thread(initial_stream_reader_func); } function0<void> read_commands = command_istream_reader(command_in, b); ! threads.create_thread(read_commands); viewer.timer_update(); |
|
From: Braden M. <br...@us...> - 2006-01-29 07:01:11
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9862 Modified Files: ChangeLog Log Message: Use g_io_channel_get_buffer_condition instead of select/FD_ISSET. Index: ChangeLog =================================================================== RCS file: /cvsroot/openvrml/openvrml/ChangeLog,v retrieving revision 1.1118 retrieving revision 1.1119 diff -C2 -d -r1.1118 -r1.1119 *** ChangeLog 28 Jan 2006 18:58:25 -0000 1.1118 --- ChangeLog 29 Jan 2006 07:00:58 -0000 1.1119 *************** *** 1,2 **** --- 1,13 ---- + 2006-01-29 Braden McDaniel <br...@en...> + + Use g_io_channel_get_buffer_condition instead of select/FD_ISSET. + + * mozilla-plugin/src/openvrml.cpp + (request_data_available(GIOChannel *, GIOCondition, gpointer)): + Use g_io_channel_get_buffer_condition instead of select/FD_ISSET. + * mozilla-plugin/src/openvrml-player/command_istream.cpp + (command_data_available(GIOChannel *, GIOCondition, gpointer)): + Use g_io_channel_get_buffer_condition instead of select/FD_ISSET. + 2006-01-28 Braden McDaniel <br...@en...> |
|
From: Braden M. <br...@us...> - 2006-01-29 07:01:11
|
Update of /cvsroot/openvrml/openvrml/mozilla-plugin/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9862/mozilla-plugin/src Modified Files: openvrml.cpp Log Message: Use g_io_channel_get_buffer_condition instead of select/FD_ISSET. Index: openvrml.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/mozilla-plugin/src/openvrml.cpp,v retrieving revision 1.28 retrieving revision 1.29 diff -C2 -d -r1.28 -r1.29 *** openvrml.cpp 28 Jan 2006 18:58:25 -0000 1.28 --- openvrml.cpp 29 Jan 2006 07:00:59 -0000 1.29 *************** *** 1191,1196 **** PluginInstance & pluginInstance = *static_cast<PluginInstance *>(data); - const int fd = g_io_channel_unix_get_fd(source); - fd_set readfds; gchar c; do { --- 1191,1194 ---- *************** *** 1214,1231 **** if (c != '\n') { pluginInstance.request_line.put(c); } ! FD_ZERO(&readfds); ! FD_SET(fd, &readfds); ! ! fd_set errorfds; ! FD_ZERO(&errorfds); ! FD_SET(fd, &errorfds); ! ! timeval timeout = { 0, 0 }; ! int bits_set = select(fd + 1, &readfds, 0, &errorfds, &timeout); ! if (FD_ISSET(fd, &errorfds) || bits_set < 0) { ! g_warning(strerror(errno)); ! g_return_val_if_reached(false); ! } ! } while (c != '\n' && FD_ISSET(fd, &readfds)); if (c == '\n') { --- 1212,1216 ---- if (c != '\n') { pluginInstance.request_line.put(c); } ! } while (g_io_channel_get_buffer_condition(source) & G_IO_IN); if (c == '\n') { |
|
From: Braden M. <br...@us...> - 2006-01-29 07:01:09
|
Update of /cvsroot/openvrml/openvrml/mozilla-plugin/src/openvrml-player In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9862/mozilla-plugin/src/openvrml-player Modified Files: command_istream.cpp Log Message: Use g_io_channel_get_buffer_condition instead of select/FD_ISSET. Index: command_istream.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/mozilla-plugin/src/openvrml-player/command_istream.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** command_istream.cpp 22 Jan 2006 07:14:02 -0000 1.2 --- command_istream.cpp 29 Jan 2006 07:00:59 -0000 1.3 *************** *** 53,58 **** *static_cast<command_streambuf *>(data); - const int fd = g_io_channel_unix_get_fd(source); - fd_set readfds; do { gchar c; --- 53,56 ---- *************** *** 79,96 **** streambuf.source_buffer_.put(traits_type::to_int_type(c)); ! FD_ZERO(&readfds); ! FD_SET(fd, &readfds); ! ! fd_set errorfds; ! FD_ZERO(&errorfds); ! FD_SET(fd, &errorfds); ! ! timeval timeout = { 0, 0 }; ! int bits_set = select(fd + 1, &readfds, 0, &errorfds, &timeout); ! if (FD_ISSET(fd, &errorfds) || bits_set < 0) { ! g_warning(strerror(errno)); ! g_return_val_if_reached(false); ! } ! } while (FD_ISSET(fd, &readfds)); return true; --- 77,81 ---- streambuf.source_buffer_.put(traits_type::to_int_type(c)); ! } while (g_io_channel_get_buffer_condition(source) & G_IO_IN); return true; |
|
From: Braden M. <br...@us...> - 2006-01-28 18:58:37
|
Update of /cvsroot/openvrml/openvrml/mozilla-plugin/src/openvrml-player In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19996/mozilla-plugin/src/openvrml-player Modified Files: player.cpp Log Message: Launch the child openvrml-player process using g_spawn_async_with_pipes instead of fork/exec. Use the child process' stdin and stdout for the command and request channels, respectively, instead of specifying file descriptors for these on the command line. Index: player.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/mozilla-plugin/src/openvrml-player/player.cpp,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** player.cpp 23 Jan 2006 04:45:08 -0000 1.19 --- player.cpp 28 Jan 2006 18:58:25 -0000 1.20 *************** *** 146,150 **** GdkNativeWindow socket_id; - gint read_fd, write_fd; GOptionEntry options[] = { --- 146,149 ---- *************** *** 158,179 **** "GTK_SOCKET_ID" }, - { - "read-fd", - 0, - 0, - G_OPTION_ARG_INT, - &read_fd, - "file descriptor for reading commands", - "READ_FD" - }, - { - "write-fd", - 0, - 0, - G_OPTION_ARG_INT, - &write_fd, - "file descriptor for writing commands", - "WRITE_FD" - }, { 0, 0, 0, G_OPTION_ARG_NONE, 0, 0, 0 } }; --- 157,160 ---- *************** *** 236,241 **** struct command_channel_loop { ! command_channel_loop(const gint read_fd, command_istream & command_in): ! read_fd_(read_fd), command_in_(&command_in) {} --- 217,221 ---- struct command_channel_loop { ! explicit command_channel_loop(command_istream & command_in): command_in_(&command_in) {} *************** *** 246,250 **** data.main_context = g_main_context_new(); data.main_loop = g_main_loop_new(data.main_context, false); ! data.command_channel = g_io_channel_unix_new(this->read_fd_); GError * error = 0; GIOStatus status = --- 226,230 ---- data.main_context = g_main_context_new(); data.main_loop = g_main_loop_new(data.main_context, false); ! data.command_channel = g_io_channel_unix_new(0); // stdin GError * error = 0; GIOStatus status = *************** *** 292,296 **** private: - gint read_fd_; command_istream * command_in_; }; --- 272,275 ---- *************** *** 332,338 **** command_istream command_in; ! if (write_fd) { ! ::request_channel = g_io_channel_unix_new(write_fd); ! } GtkWidget * window = socket_id --- 311,315 ---- command_istream command_in; ! ::request_channel = g_io_channel_unix_new(1); // stdout GtkWidget * window = socket_id *************** *** 355,359 **** } else { function0<void> command_channel_loop_func = ! command_channel_loop(read_fd, command_in); command_channel_loop_thread.reset( threads.create_thread(command_channel_loop_func)); --- 332,336 ---- } else { function0<void> command_channel_loop_func = ! command_channel_loop(command_in); command_channel_loop_thread.reset( threads.create_thread(command_channel_loop_func)); |
|
From: Braden M. <br...@us...> - 2006-01-28 18:58:36
|
Update of /cvsroot/openvrml/openvrml/mozilla-plugin/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19996/mozilla-plugin/src Modified Files: openvrml.cpp Log Message: Launch the child openvrml-player process using g_spawn_async_with_pipes instead of fork/exec. Use the child process' stdin and stdout for the command and request channels, respectively, instead of specifying file descriptors for these on the command line. Index: openvrml.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/mozilla-plugin/src/openvrml.cpp,v retrieving revision 1.27 retrieving revision 1.28 diff -C2 -d -r1.27 -r1.28 *** openvrml.cpp 25 Jan 2006 04:24:24 -0000 1.27 --- openvrml.cpp 28 Jan 2006 18:58:25 -0000 1.28 *************** *** 64,69 **** int x, y; int width, height; ! pid_t player_pid; ! int out_pipe[2], in_pipe[2]; GIOChannel * request_channel; std::stringstream request_line; --- 64,68 ---- int x, y; int width, height; ! GIOChannel * command_channel; GIOChannel * request_channel; std::stringstream request_line; *************** *** 77,82 **** void SetWindow(NPWindow & window) throw (std::bad_alloc); void HandleEvent(void * event) throw (); ! int in() const throw (); ! int out() const throw (); }; --- 76,80 ---- void SetWindow(NPWindow & window) throw (std::bad_alloc); void HandleEvent(void * event) throw (); ! ssize_t WriteCommand(const std::string & command); }; *************** *** 412,423 **** command << "new-stream " << ptrdiff_t(stream) << ' ' << type << ' ' << stream->url << '\n'; ! ssize_t bytes_written = write(pluginInstance.out(), ! command.str().data(), ! command.str().length()); ! if (bytes_written < 0) { ! printerr(strerror(errno)); ! return NPERR_GENERIC_ERROR; ! } ! return NPERR_NO_ERROR; } --- 410,417 ---- command << "new-stream " << ptrdiff_t(stream) << ' ' << type << ' ' << stream->url << '\n'; ! const ssize_t bytes_written = pluginInstance.WriteCommand(command.str()); ! return (bytes_written < 0) ! ? NPERR_GENERIC_ERROR ! : NPERR_NO_ERROR; } *************** *** 428,445 **** if (!instance || !instance->pdata) { return NPERR_INVALID_INSTANCE_ERROR; } ! PluginInstance * const pluginInstance = ! static_cast<PluginInstance *>(instance->pdata); std::ostringstream command; command << "destroy-stream " << ptrdiff_t(stream) << '\n'; ! ssize_t bytes_written = write(pluginInstance->out(), ! command.str().data(), ! command.str().length()); ! if (bytes_written < 0) { ! printerr(strerror(errno)); ! return NPERR_GENERIC_ERROR; ! } ! ! return NPERR_NO_ERROR; } --- 422,434 ---- if (!instance || !instance->pdata) { return NPERR_INVALID_INSTANCE_ERROR; } ! PluginInstance & pluginInstance = ! *static_cast<PluginInstance *>(instance->pdata); std::ostringstream command; command << "destroy-stream " << ptrdiff_t(stream) << '\n'; ! const ssize_t bytes_written = pluginInstance.WriteCommand(command.str()); ! return (bytes_written < 0) ! ? NPERR_GENERIC_ERROR ! : NPERR_NO_ERROR; } *************** *** 476,481 **** if (!instance || !instance->pdata) { return 0; } ! PluginInstance * const pluginInstance = ! static_cast<PluginInstance *>(instance->pdata); std::ostringstream command; --- 465,470 ---- if (!instance || !instance->pdata) { return 0; } ! PluginInstance & pluginInstance = ! *static_cast<PluginInstance *>(instance->pdata); std::ostringstream command; *************** *** 485,497 **** command.put(static_cast<char *>(buffer)[i]); } ! ssize_t bytes_written = write(pluginInstance->out(), ! command.str().data(), ! command.str().length()); ! if (bytes_written < 0) { ! printerr(strerror(errno)); ! return NPERR_GENERIC_ERROR; ! } ! return len; /* The number of bytes accepted */ } --- 474,480 ---- command.put(static_cast<char *>(buffer)[i]); } ! const ssize_t bytes_written = pluginInstance.WriteCommand(command.str()); ! return bytes_written; // The number of bytes accepted. } *************** *** 1004,1008 **** ! PluginInstance::PluginInstance(NPP npp) throw (std::bad_alloc): npp(npp), window(0), --- 987,991 ---- ! PluginInstance::PluginInstance(const NPP npp) throw (std::bad_alloc): npp(npp), window(0), *************** *** 1011,1063 **** width(0), height(0), ! player_pid(0), request_channel(0), scriptablePeer(new ScriptablePeer(*this)) ! { ! int result = pipe(this->out_pipe); ! if (result != 0) { ! printerr(strerror(errno)); ! } ! result = pipe(this->in_pipe); ! if (result != 0) { ! printerr(strerror(errno)); ! } ! } PluginInstance::~PluginInstance() throw () { ! if (this->player_pid) { ! if (this->request_channel) { ! GError * error = 0; ! const gboolean flush = false; ! GIOStatus status = g_io_channel_shutdown(this->request_channel, ! flush, ! &error); ! if (status != G_IO_STATUS_NORMAL) { ! if (error) { ! g_critical(error->message); ! g_error_free(error); ! } } } g_io_channel_unref(this->request_channel); ! // ! // The openvrml-player process should detect that this file ! // descriptor has been closed and terminate in response. ! // ! int result = close(this->out_pipe[1]); ! if (result != 0) { ! printerr(strerror(errno)); ! g_error("Failed to close write descriptor for " ! "OpenVRML plug-in's output pipe"); } ! int status; ! int options = 0; ! pid_t pid = waitpid(this->player_pid, &status, options); ! if (pid == -1) { ! printerr(strerror(errno)); ! } } } --- 994,1034 ---- width(0), height(0), ! command_channel(0), request_channel(0), scriptablePeer(new ScriptablePeer(*this)) ! {} PluginInstance::~PluginInstance() throw () { ! if (this->request_channel) { ! GError * error = 0; ! const gboolean flush = false; ! GIOStatus status = g_io_channel_shutdown(this->request_channel, ! flush, ! &error); ! if (status != G_IO_STATUS_NORMAL) { ! if (error) { ! printerr(error->message); ! g_error_free(error); } } + g_io_channel_unref(this->request_channel); + } ! if (this->command_channel) { ! GError * error = 0; ! const gboolean flush = false; ! GIOStatus status = g_io_channel_shutdown(this->command_channel, ! flush, ! &error); ! if (status != G_IO_STATUS_NORMAL) { ! if (error) { ! printerr(error->message); ! g_error_free(error); ! } } ! g_io_channel_unref(this->command_channel); } } *************** *** 1077,1196 **** // } else { ! this->window = GdkNativeWindow(ptrdiff_t(window.window)); ! ! fcntl(this->out_pipe[0], F_SETFD, 0); ! fcntl(this->in_pipe[1], F_SETFD, 0); ! ! this->player_pid = fork(); ! if (this->player_pid == 0) { ! using std::vector; ! using std::string; ! using boost::lexical_cast; ! int result = close(this->out_pipe[1]); ! if (result != 0) { ! g_error("Failed to close write descriptor for " ! "openvrml-player's input pipe"); ! } ! result = close(this->in_pipe[0]); ! if (result != 0) { ! g_error("Failed to close read descriptor for " ! "openvrml-player's output pipe"); ! } ! // ! // The OPENVRML_PLAYER environment variable overrides the ! // default path to the child process executable. To allow ! // OPENVRML_PLAYER to include arguments (rather than just be a ! // path to an executable), it is parsed wit ! // g_shell_parse_argv. This is particularly useful in case we ! // want to run the child process in a harness like valgrind. ! // ! gint openvrml_player_cmd_argc = 0; ! gchar ** openvrml_player_cmd_argv = 0; ! const gchar * const openvrml_player_cmd = ! g_getenv("OPENVRML_PLAYER"); ! if (!openvrml_player_cmd) { ! openvrml_player_cmd_argc = 1; ! openvrml_player_cmd_argv = ! static_cast<gchar **>(g_malloc(sizeof (gchar *))); ! if (!openvrml_player_cmd_argv) { throw std::bad_alloc(); } ! openvrml_player_cmd_argv[0] = ! OPENVRML_LIBEXECDIR_ "/openvrml-player"; ! } else { ! GError * error = 0; ! gboolean succeeded = ! g_shell_parse_argv(openvrml_player_cmd, ! &openvrml_player_cmd_argc, ! &openvrml_player_cmd_argv, ! &error); ! if (!succeeded) { ! if (error) { ! g_critical(error->message); ! g_error_free(error); ! } } } ! string socket_id_arg = ! "--gtk-socket-id=" + lexical_cast<string>(this->window); ! const char * socket_id_arg_c_str = socket_id_arg.c_str(); ! vector<char> socket_id_arg_vec( ! socket_id_arg_c_str, ! socket_id_arg_c_str + socket_id_arg.length() + 1); ! ! string read_fd_arg = ! "--read-fd=" + lexical_cast<string>(this->out_pipe[0]); ! const char * read_fd_arg_c_str = read_fd_arg.c_str(); ! vector<char> read_fd_arg_vec( ! read_fd_arg_c_str, ! read_fd_arg_c_str + read_fd_arg.length() + 1); ! string write_fd_arg = ! "--write-fd=" + lexical_cast<string>(this->in_pipe[1]); ! const char * write_fd_arg_c_str = write_fd_arg.c_str(); ! vector<char> write_fd_arg_vec( ! write_fd_arg_c_str, ! write_fd_arg_c_str + write_fd_arg.length() + 1); ! const gint argv_size = openvrml_player_cmd_argc + 4; ! gchar ** const argv = ! static_cast<gchar **>( ! g_malloc(sizeof (gchar *) * argv_size)); ! if (!argv) { throw std::bad_alloc(); } ! gint i; ! for (i = 0; i < openvrml_player_cmd_argc; ++i) { ! argv[i] = openvrml_player_cmd_argv[i]; } ! argv[i++] = &socket_id_arg_vec.front(); ! argv[i++] = &read_fd_arg_vec.front(); ! argv[i++] = &write_fd_arg_vec.front(); ! argv[i] = 0; ! result = execv(argv[0], argv); ! if (result < 0) { ! g_error("Failed to start openvrml-player"); ! } - g_free(argv); - g_strfreev(openvrml_player_cmd_argv); - } else if (this->player_pid > 0) { - int result = close(this->out_pipe[0]); - if (result != 0) { - printerr(strerror(errno)); - } - result = close(this->in_pipe[1]); - if (result != 0) { - printerr(strerror(errno)); - } - this->request_channel = - g_io_channel_unix_new(this->in_pipe[0]); - g_io_add_watch(this->request_channel, - G_IO_IN, - request_data_available, - this); - } else if (this->player_pid < 0) { - printerr(strerror(errno)); - } } } --- 1048,1148 ---- // } else { ! using std::string; ! using std::vector; ! using boost::lexical_cast; ! this->window = GdkNativeWindow(ptrdiff_t(window.window)); ! // ! // The OPENVRML_PLAYER environment variable overrides the default ! // path to the child process executable. To allow OPENVRML_PLAYER ! // to include arguments (rather than just be a path to an ! // executable), it is parsed wit g_shell_parse_argv. This is ! // particularly useful in case we want to run the child process in ! // a harness like valgrind. ! // ! gint openvrml_player_cmd_argc = 0; ! gchar ** openvrml_player_cmd_argv = 0; ! const gchar * const openvrml_player_cmd = ! g_getenv("OPENVRML_PLAYER"); ! if (!openvrml_player_cmd) { ! openvrml_player_cmd_argc = 1; ! openvrml_player_cmd_argv = ! static_cast<gchar **>(g_malloc(sizeof (gchar *))); ! if (!openvrml_player_cmd_argv) { throw std::bad_alloc(); } ! openvrml_player_cmd_argv[0] = ! OPENVRML_LIBEXECDIR_ "/openvrml-player"; ! } else { ! GError * error = 0; ! gboolean succeeded = ! g_shell_parse_argv(openvrml_player_cmd, ! &openvrml_player_cmd_argc, ! &openvrml_player_cmd_argv, ! &error); ! if (!succeeded) { ! if (error) { ! g_critical(error->message); ! g_error_free(error); } } + } ! string socket_id_arg = ! "--gtk-socket-id=" + lexical_cast<string>(this->window); ! const char * socket_id_arg_c_str = socket_id_arg.c_str(); ! vector<char> socket_id_arg_vec( ! socket_id_arg_c_str, ! socket_id_arg_c_str + socket_id_arg.length() + 1); ! const gint argv_size = openvrml_player_cmd_argc + 2; ! gchar ** const argv = ! static_cast<gchar **>(g_malloc(sizeof (gchar *) * argv_size)); ! if (!argv) { throw std::bad_alloc(); } ! gint i; ! for (i = 0; i < openvrml_player_cmd_argc; ++i) { ! argv[i] = openvrml_player_cmd_argv[i]; ! } ! argv[i++] = &socket_id_arg_vec.front(); ! argv[i] = 0; ! gchar * const working_directory = g_get_current_dir(); ! if (!working_directory) { throw std::bad_alloc(); }; ! gchar ** envp = 0; ! GPid * const child_pid = 0; ! gint standard_input, standard_output; ! gint * const standard_error = 0; ! GError * error = 0; ! gboolean succeeded = g_spawn_async_with_pipes(working_directory, ! argv, ! envp, ! GSpawnFlags(0), ! 0, ! 0, ! child_pid, ! &standard_input, ! &standard_output, ! standard_error, ! &error); ! if (!succeeded) { ! if (error) { ! g_critical(error->message); ! g_error_free(error); } ! } ! g_free(working_directory); ! g_free(argv); ! g_strfreev(openvrml_player_cmd_argv); ! ! this->command_channel = g_io_channel_unix_new(standard_input); ! if (!this->command_channel) { throw std::bad_alloc(); } ! ! this->request_channel = g_io_channel_unix_new(standard_output); ! if (!this->command_channel) { throw std::bad_alloc(); } ! g_io_add_watch(this->request_channel, ! G_IO_IN, ! request_data_available, ! this); } } *************** *** 1199,1210 **** {} ! int PluginInstance::in() const throw () { ! return this->in_pipe[0]; ! } ! int PluginInstance::out() const throw () ! { ! return this->out_pipe[1]; } --- 1151,1184 ---- {} ! ssize_t PluginInstance::WriteCommand(const std::string & command) { ! gsize bytes_written; ! GError * error = 0; ! GIOStatus status = g_io_channel_write_chars(this->command_channel, ! command.data(), ! command.length(), ! &bytes_written, ! &error); ! if (status != G_IO_STATUS_NORMAL) { ! if (error) { ! printerr(error->message); ! g_error_free(error); ! } ! return -1; ! } ! do { ! status = g_io_channel_flush(this->command_channel, &error); ! } while (status == G_IO_STATUS_AGAIN); ! ! if (status != G_IO_STATUS_NORMAL) { ! if (error) { ! printerr(error->message); ! g_error_free(error); ! } ! return -1; ! } ! ! return bytes_written; } |
|
From: Braden M. <br...@us...> - 2006-01-28 18:58:36
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19996 Modified Files: ChangeLog Log Message: Launch the child openvrml-player process using g_spawn_async_with_pipes instead of fork/exec. Use the child process' stdin and stdout for the command and request channels, respectively, instead of specifying file descriptors for these on the command line. Index: ChangeLog =================================================================== RCS file: /cvsroot/openvrml/openvrml/ChangeLog,v retrieving revision 1.1117 retrieving revision 1.1118 diff -C2 -d -r1.1117 -r1.1118 *** ChangeLog 25 Jan 2006 04:24:24 -0000 1.1117 --- ChangeLog 28 Jan 2006 18:58:25 -0000 1.1118 *************** *** 1,2 **** --- 1,42 ---- + 2006-01-28 Braden McDaniel <br...@en...> + + Launch the child openvrml-player process using + g_spawn_async_with_pipes instead of fork/exec. Use the child + process' stdin and stdout for the command and request channels, + respectively, instead of specifying file descriptors for these on + the command line. + + * mozilla-plugin/src/openvrml.cpp (PluginInstance): Removed + player_pid, out_pipe, in_pipe members; added command_channel + member. Removed in() and out() member functions; added + WriteCommand(const std::string &) member function. + (NPP_NewStream(NPP, NPMIMEType, NPStream *, NPBool, uint16 *)): + Delegate writing to the command channel to + PluginInstance::WriteCommand(const std::string &). + (NPP_DestroyStream(NPP, NPStream *, NPError)): Delegate writing to + the command channel to PluginInstance::WriteCommand(const + std::string &). + (NPP_Write(NPP, NPStream *, int32, int32, void *)): Delegate + writing to the command channel to + PluginInstance::WriteCommand(const std::string &). + (PluginInstance::PluginInstance(NPP)): Removed initialization of + player_pid, out_pipe, in_pipe. + (PluginInstance::~PluginInstance()): Shutdown/unref + command_channel; don't wait on child process. + (PluginInstance::SetWindow(NPWindow &)): Use + g_spawn_async_with_pipes instead of fork/exec. + (PluginInstance::WriteCommand(const std::string &)): Added + function; wrapper to simplify usage/error handling for + g_io_channel_write_chars. + * mozilla-plugin/src/openvrml-player/player.cpp + (read_fd): Removed. + (write_fd): Removed. + (options): Removed entries for read-fd and write-fd. + (command_channel_loop): Removed read_fd_ member. + (command_channel_loop::command_channel_loop(command_istream &)): + Removed read_fd argument; create command_channel to read from + stdin. + (main(int, char *[])): Create request_channel to write to stdout. + 2006-01-24 Braden McDaniel <br...@en...> |
|
From: Braden M. <br...@us...> - 2006-01-25 04:24:33
|
Update of /cvsroot/openvrml/openvrml/mozilla-plugin/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16453/mozilla-plugin/src Modified Files: openvrml.cpp Log Message: Fixed size allocated for argv. Index: openvrml.cpp =================================================================== RCS file: /cvsroot/openvrml/openvrml/mozilla-plugin/src/openvrml.cpp,v retrieving revision 1.26 retrieving revision 1.27 diff -C2 -d -r1.26 -r1.27 *** openvrml.cpp 24 Jan 2006 15:01:27 -0000 1.26 --- openvrml.cpp 25 Jan 2006 04:24:24 -0000 1.27 *************** *** 1154,1161 **** write_fd_arg_c_str + write_fd_arg.length() + 1); gchar ** const argv = static_cast<gchar **>( ! g_malloc( ! sizeof (gchar *) * openvrml_player_cmd_argc + 4)); if (!argv) { throw std::bad_alloc(); } gint i; --- 1154,1161 ---- write_fd_arg_c_str + write_fd_arg.length() + 1); + const gint argv_size = openvrml_player_cmd_argc + 4; gchar ** const argv = static_cast<gchar **>( ! g_malloc(sizeof (gchar *) * argv_size)); if (!argv) { throw std::bad_alloc(); } gint i; |
|
From: Braden M. <br...@us...> - 2006-01-25 04:24:33
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16453 Modified Files: ChangeLog Log Message: Fixed size allocated for argv. Index: ChangeLog =================================================================== RCS file: /cvsroot/openvrml/openvrml/ChangeLog,v retrieving revision 1.1116 retrieving revision 1.1117 diff -C2 -d -r1.1116 -r1.1117 *** ChangeLog 24 Jan 2006 15:01:27 -0000 1.1116 --- ChangeLog 25 Jan 2006 04:24:24 -0000 1.1117 *************** *** 2,5 **** --- 2,10 ---- * mozilla-plugin/src/openvrml.cpp (PluginInstance::SetWindow): + Fixed size allocated for argv. + + 2006-01-24 Braden McDaniel <br...@en...> + + * mozilla-plugin/src/openvrml.cpp (PluginInstance::SetWindow): Parse OPENVRML_PLAYER environment variable with g_shell_parse_argv such that arguments can be passed along with the executable name. |
|
From: Braden M. <br...@us...> - 2006-01-24 15:01:38
|
Update of /cvsroot/openvrml/openvrml In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13582 Modified Files: ChangeLog Log Message: Parse OPENVRML_PLAYER environment variable with g_shell_parse_argv such that arguments can be passed along with the executable name. Index: ChangeLog =================================================================== RCS file: /cvsroot/openvrml/openvrml/ChangeLog,v retrieving revision 1.1115 retrieving revision 1.1116 diff -C2 -d -r1.1115 -r1.1116 *** ChangeLog 23 Jan 2006 04:45:07 -0000 1.1115 --- ChangeLog 24 Jan 2006 15:01:27 -0000 1.1116 *************** *** 1,2 **** --- 1,8 ---- + 2006-01-24 Braden McDaniel <br...@en...> + + * mozilla-plugin/src/openvrml.cpp (PluginInstance::SetWindow): + Parse OPENVRML_PLAYER environment variable with g_shell_parse_argv + such that arguments can be passed along with the executable name. + 2006-01-22 Braden McDaniel <br...@en...> |