diff options
-rw-r--r-- | python/__init__.py | 7 | ||||
-rw-r--r-- | src/Makefile.am | 39 | ||||
-rw-r--r-- | src/hulahop.cpp | 17 |
3 files changed, 41 insertions, 22 deletions
diff --git a/python/__init__.py b/python/__init__.py index 35ac97a..a30a891 100644 --- a/python/__init__.py +++ b/python/__init__.py @@ -22,7 +22,7 @@ import gtk from hulahop._hulahop import shutdown from hulahop import _hulahop -_XO_DPI = 200.0 +_XO_DPI = 200 def startup(profile_path, components_dirs=[]): _hulahop.set_profile_path(profile_path) @@ -45,10 +45,11 @@ def startup(profile_path, components_dirs=[]): branch.setIntPref('layout.css.dpi', _get_layout_dpi()) def _get_layout_dpi(): - _screen_dpi = gtk.settings_get_default().get_property('gtk-xft-dpi') + gtk_xft_dpi = gtk.settings_get_default().get_property('gtk-xft-dpi') + screen_dpi = gtk_xft_dpi / 1024 screen_width = gtk.gdk.screen_width() - if _screen_dpi != _XO_DPI or screen_width != 1200: + if screen_dpi != _XO_DPI or screen_width != 1200: return -1 # Layout: diff --git a/src/Makefile.am b/src/Makefile.am index fd3f647..5afe7b3 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,25 +1,26 @@ -INCLUDES = \ - $(DEPS_CFLAGS) \ - $(PYTHON_INCLUDES) \ - $(MOZILLA_CFLAGS) \ - -I$(MOZILLA_INCLUDE_ROOT)/docshell \ - -I$(MOZILLA_INCLUDE_ROOT)/dom \ - -I$(MOZILLA_INCLUDE_ROOT)/xulapp \ - -I$(MOZILLA_INCLUDE_ROOT)/nspr \ - -I$(MOZILLA_INCLUDE_ROOT)/pyxpcom \ - -I$(MOZILLA_INCLUDE_ROOT)/string \ - -I$(MOZILLA_INCLUDE_ROOT)/webbrwsr \ - -I$(MOZILLA_INCLUDE_ROOT)/widget \ - -I$(MOZILLA_INCLUDE_ROOT)/xpcom \ - -DMOZILLA_HOME=\"$(MOZILLA_HOME)\" \ +INCLUDES = \ + $(DEPS_CFLAGS) \ + $(PYTHON_INCLUDES) \ + $(MOZILLA_CFLAGS) \ + -I$(MOZILLA_INCLUDE_ROOT)/docshell \ + -I$(MOZILLA_INCLUDE_ROOT)/dom \ + -I$(MOZILLA_INCLUDE_ROOT)/xulapp \ + -I$(MOZILLA_INCLUDE_ROOT)/nspr \ + -I$(MOZILLA_INCLUDE_ROOT)/pyxpcom \ + -I$(MOZILLA_INCLUDE_ROOT)/string \ + -I$(MOZILLA_INCLUDE_ROOT)/webbrwsr \ + -I$(MOZILLA_INCLUDE_ROOT)/widget \ + -I$(MOZILLA_INCLUDE_ROOT)/xpcom \ + -DMOZILLA_HOME=\"$(MOZILLA_HOME)\" \ + -DPLUGIN_PATH=\"$(libdir)/mozilla/plugins\" \ -DDATA_DIR=\"$(pkgdatadir)\" noinst_LTLIBRARIES = libhulahop.la -libhulahop_la_SOURCES = \ +libhulahop_la_SOURCES = \ HulahopDirectoryProvider.cpp \ - HulahopDirectoryProvider.h \ - hulahop.cpp \ - hulahop.h \ - hulahop-web-view.cpp \ + HulahopDirectoryProvider.h \ + hulahop.cpp \ + hulahop.h \ + hulahop-web-view.cpp \ hulahop-web-view.h diff --git a/src/hulahop.cpp b/src/hulahop.cpp index 32c9f4f..8448a5b 100644 --- a/src/hulahop.cpp +++ b/src/hulahop.cpp @@ -26,11 +26,28 @@ static HulahopDirectoryProvider kDirectoryProvider; +static void +setup_plugin_path() +{ + const char *user_path; + char *new_path; + + user_path = g_getenv ("MOZ_PLUGIN_PATH"); + new_path = g_strconcat(user_path ? user_path : "", + user_path ? ":" : "", + PLUGIN_PATH, + (char *) NULL); + g_setenv ("MOZ_PLUGIN_PATH", new_path, TRUE); + g_free (new_path); +} + gboolean hulahop_startup() { nsresult rv; + setup_plugin_path(); + nsCOMPtr<nsILocalFile> greDir; rv = NS_NewNativeLocalFile(nsCString(MOZILLA_HOME), PR_TRUE, getter_AddRefs(greDir)); |