Permalink
Browse files

* gtkmozembed/gtkgecko.metadata: Hide gtk_moz_embed_set_comp_path.

* gtkmozembed/WebControl.custom: Add initialization of CompPath, 
  to set the initial components path (if it hasn't been set yet by the 
  application) from the MOZILLA_FIVE_HOME env var,before the control is
  created. Without this, gtkmozembed will try to load the runtime from 
  the current process path instead of going to the runtime directory, 
  and will blow up.
  [Fixes #341815]

2008-03-10  Andreia Gaita  <avidigal@novell.com>

svn path=/trunk/gtkmozembed-sharp/; revision=97896
  • Loading branch information...
1 parent fddfd44 commit 44a292ed460563f161fc7ceb710d6ff40b3a7b07 @shana shana committed Mar 10, 2008
Showing with 35 additions and 0 deletions.
  1. +11 −0 ChangeLog
  2. +23 −0 gtkmozembed/WebControl.custom
  3. +1 −0 gtkmozembed/gtkgecko.metadata
View
@@ -1,3 +1,14 @@
+2008-03-10 Andreia Gaita <avidigal@novell.com>
+
+ * gtkmozembed/gtkgecko.metadata: Hide gtk_moz_embed_set_comp_path.
+ * gtkmozembed/WebControl.custom: Add initialization of CompPath,
+ to set the initial components path (if it hasn't been set yet by the
+ application) from the MOZILLA_FIVE_HOME env var,before the control is
+ created. Without this, gtkmozembed will try to load the runtime from
+ the current process path instead of going to the runtime directory,
+ and will blow up.
+ [Fixes #341815]
+
2006-12-22 Wade Berrier <wberrier@novell.com>
* configure.in: version bump -> 0.12
@@ -13,6 +13,15 @@ private void InitProfile (string aPath, string aDir)
aPath += System.Guid.NewGuid().ToString("N");
}
+ if (compPath.Equals (String.Empty)) {
+ string mozHome = Environment.GetEnvironmentVariable ("MOZILLA_FIVE_HOME");
+ if (mozHome != null && mozHome.Equals (String.Empty)) {
+ Console.Error.WriteLine ("Warning: MOZILLA_FIVE_HOME not set. Please set it if the gecko runtime is not in the current path, otherwise this application might not load correctly.");
+ } else {
+ CompPath = mozHome;
+ }
+ }
+
// gtk_moz_embed_set_profile_path(aPath, aDir);
SetProfilePath (aPath, aDir);
Raw = gtk_moz_embed_new ();
@@ -27,3 +36,17 @@ public WebControl() : base (IntPtr.Zero)
{
InitProfile ("gecko-sharp", "DummyProfile");
}
+
+[DllImport("gtkembedmoz.dll")]
+static extern void gtk_moz_embed_set_comp_path(IntPtr aPath);
+
+private static string compPath = String.Empty;
+public static string CompPath {
+ set {
+ compPath = value;
+ IntPtr native_value = GLib.Marshaller.StringToPtrGStrdup (compPath);
+ gtk_moz_embed_set_comp_path(native_value);
+ GLib.Marshaller.Free (native_value);
+ }
+}
+
@@ -10,6 +10,7 @@
<attr path="/api/namespace/object[@cname='GtkMozEmbed']/method[@name='StatusEnumsGetType']" name="hidden">1</attr>
<attr path="/api/namespace/object[@cname='GtkMozEmbed']/method[@name='ChromeFlagsGetType']" name="hidden">1</attr>
+ <attr path="/api/namespace/object[@cname='GtkMozEmbed']/method[@cname='gtk_moz_embed_set_comp_path']" name="hidden">1</attr>
<!-- Fixup new_window, since it needs special marshalling -->
<attr path="/api/namespace/object[@cname='GtkMozEmbed']/signal[@cname='new_window']/*/*[@type='GtkMozEmbed**']" name="pass_as">out</attr>

0 comments on commit 44a292e

Please sign in to comment.