- Made documentation installation independent of Debian package
- Removed bogus distclean target
- Enabled more warnings
+ * Updated to work with Mozilla 1.8 and with XULRunner
--
VideoLink is written in C++ and requires a recent C++ compiler
e.g. g++ 3.3.
-It requires headers and libraries for Boost, gtkmm, Mozilla and expat.
-I have developed and tested it with Boost 1.32, gtkmm 2.2.12, Mozilla
-1.7.8 and expat 1.95.8 but it may well work with earlier or later
-versions of these.
+It requires headers and libraries for Boost, gtkmm, Mozilla or
+XULRunner, and expat. I have developed and tested it with Boost 1.32,
+gtkmm 2.2.12, Mozilla 1.7.8 and expat 1.95.8 but it may well work with
+earlier or later versions of these. I have also tested with Mozilla
+1.7.12 and XULRunner 1.8.0.5.
I use Debian Linux and have not yet attempted to build it on other
systems, but it should work on most modern Unix-like systems.
docdir := $(sharedir)/doc
mandir := $(sharedir)/man
-moz_include_dir := \
- $(shell pkg-config --variable=prefix mozilla-gtkmozembed)/include/mozilla
-moz_lib_dir := \
- $(shell pkg-config --variable=prefix mozilla-gtkmozembed)/lib/mozilla
+# Prefer XULRunner to the old Mozilla
+ifeq ($(shell pkg-config --exists xulrunner-gtkmozembed && echo yes),yes)
+ mozilla := xulrunner
+else
+ mozilla := mozilla
+endif
+
+moz_prefix := $(shell pkg-config --variable=prefix $(mozilla)-gtkmozembed)
+moz_include_dir := $(moz_prefix)/include/$(mozilla)
+moz_lib_dir := $(moz_prefix)/lib/$(mozilla)
moz_version := \
$(shell sed 's/\#define MOZILLA_VERSION "\(.*\)"/\1/; t; d' \
CFLAGS := -ansi -Wall -Wunused -Wno-unused-parameter
CPPFLAGS := -D_REENTRANT
CXXFLAGS := -ansi -Wall -Wunused
-LDFLAGS := -lpthread $(shell pkg-config --libs gtkmm-2.0 mozilla-gtkmozembed) \
+LDFLAGS := -lpthread \
+ $(shell pkg-config --libs gtkmm-2.0 $(mozilla)-gtkmozembed) \
-Wl,-rpath -Wl,$(moz_lib_dir) -lexpat
ifdef NDEBUG
.objs/browser_widget.% : CPPFLAGS += -DMOZ_LIB_DIR='"$(moz_lib_dir)"'
.objs/videolink.% \
- : CPPFLAGS += -DVIDEOLINK_SHARE_DIR='"$(sharedir)/videolink"' \
- -DMOZ_VERSION_MAJOR=$(moz_version_major) \
- -DMOZ_VERSION_MINOR=$(moz_version_minor) \
- -DMOZ_VERSION_PATCHLEVEL=$(moz_version_patchlevel)
+ : CPPFLAGS += -DVIDEOLINK_SHARE_DIR='"$(sharedir)/videolink"'
.objs/browser_widget.% .objs/generate_dvd.% .objs/pixbufs.% \
.objs/temp_file.% .objs/vob_list.% .objs/videolink.% \
: CPPFLAGS += $(shell pkg-config --cflags gtkmm-2.0)
-.objs/browser_widget.% .objs/child_iterator.% .objs/link_iterator.% \
-.objs/null_prompt_service.% .objs/style_sheets.% .objs/videolink.% \
-.objs/xpcom_support.% \
- : CPPFLAGS += $(shell pkg-config --cflags mozilla-gtkmozembed)
+.objs/browser_widget.% .objs/child_iterator.% .objs/link_iterator.% \
+.objs/null_prompt_service.% .objs/style_sheets.% .objs/videolink.% \
+.objs/xpcom_support.% \
+ : CPPFLAGS += $(shell pkg-config --cflags $(mozilla)-gtkmozembed)
# Non-virtual destructors are fine in XPCOM interface classes since
# instances are only ever called by the Release function which is virtual.
.objs/browser_widget.% .objs/child_iterator.% .objs/link_iterator.% \
: CXXFLAGS += -Wno-non-virtual-dtor
# These dig a bit deeper into Mozilla
-.objs/link_iterator.% .objs/style_sheets.% .objs/videolink.% \
- : CPPFLAGS += $(addprefix -I$(moz_include_dir)/, \
- content docshell dom gfx layout necko webshell widget)
-
-.objs/null_prompt_service.% : CPPFLAGS += -I$(moz_include_dir)/uconv
+.objs/link_iterator.% .objs/null_prompt_service.% .objs/style_sheets.% \
+.objs/videolink.% \
+ : CPPFLAGS += $(addprefix -I$(moz_include_dir)/, \
+ content docshell dom gfx layout locale necko uconv \
+ webshell widget) \
+ -DMOZILLA_INTERNAL_API \
+ -DMOZ_VERSION_MAJOR=$(moz_version_major) \
+ -DMOZ_VERSION_MINOR=$(moz_version_minor) \
+ -DMOZ_VERSION_PATCHLEVEL=$(moz_version_patchlevel)
.objs/%.d : %.cpp .objs/.created
$(CXX) $(CXXFLAGS) $(CPPFLAGS) -MM -MF $@ $<
- expat 1.x
- Gtkmm 2.0
- ffmpeg or mjpegtools
-- Mozilla 1.7.x (later versions may work but are untested)
+- Mozilla 1.7.8 or later, or XULRunner
- netpbm
- Xvfb (from XFree86 or X.org)
Maintainer: Ben Hutchings <ben@decadent.org.uk>
Section: graphics
Priority: extra
-Build-Depends: debhelper (>=4), libboost-dev, libgtkmm2.0-dev, mozilla-dev, libexpat1-dev
+Build-Depends: debhelper (>=4), libboost-dev, libgtkmm2.0-dev, libxul-dev | mozilla-dev, libexpat1-dev
Standards-Version: 3.6.2
Package: videolink
make DESTDIR=debian/videolink prefix=/usr install
dh_strip
dh_shlibdeps
- @echo "Despite the warnings from dh_shlibdeps, this should complete dependencies:"
- MOZ_VERSION=$$(dpkg-query -W --showformat='$${version}' mozilla-browser | sed 's/+b[0-9]*$$//') \
- && echo "mozilla:Depends=mozilla-browser (>= $$MOZ_VERSION), mozilla-browser (<= $${MOZ_VERSION}+b99)" >> debian/videolink.substvars
+ if pkg-config --exists xulrunner-gtkmozembed; then \
+ MOZ_VERSION=$$(dpkg-query -W --showformat='$${version}' xulrunner | sed 's/+b[0-9]*$$//') \
+ && echo "mozilla:Depends=xulrunner (>= $$MOZ_VERSION), xulrunner (<< $${MOZ_VERSION}a)" >> debian/videolink.substvars ; \
+ else \
+ MOZ_VERSION=$$(dpkg-query -W --showformat='$${version}' mozilla-browser | sed 's/+b[0-9]*$$//') \
+ && echo "mozilla:Depends=mozilla-browser (>= $$MOZ_VERSION), mozilla-browser (<< $${MOZ_VERSION}+b99)" >> debian/videolink.substvars ; \
+ fi
mkdir -p -m755 debian/videolink/usr/share/doc/videolink
install -m644 debian/copyright debian/videolink/usr/share/doc/videolink/copyright
mv debian/videolink/usr/share/doc/videolink/ChangeLog.gz \
#include <nsICharsetConverterManager.h>
#include <nsIComponentManager.h>
#include <nsIFactory.h>
-#include <nsIServiceManagerUtils.h>
+#if MOZ_VERSION_MAJOR > 1 || (MOZ_VERSION_MAJOR == 1 && MOZ_VERSION_MINOR >= 8)
+# include <nsIComponentRegistrar.h>
+# include <nsServiceManagerUtils.h>
+#else
+# include <nsIServiceManagerUtils.h>
+#endif
#include <nsIUnicodeEncoder.h>
#include "null_prompt_service.hpp"
{0xb4, 0x6a, 0x25, 0xc0, 0xb3, 0x8, 0xcb, 0xd0}
};
nsCOMPtr<nsIFactory> prompt_factory(new null_prompt_service_factory);
- check(nsComponentManager::RegisterFactory(
- prompt_service_cid,
- "Prompt Service",
- "@mozilla.org/embedcomp/prompt-service;1",
- prompt_factory,
- PR_TRUE)); // replace existing
+# if MOZ_VERSION_MAJOR > 1 \
+ || (MOZ_VERSION_MAJOR == 1 && MOZ_VERSION_MINOR >= 8)
+ nsCOMPtr<nsIComponentRegistrar> comp_registrar;
+ check(NS_GetComponentRegistrar(getter_AddRefs(comp_registrar)));
+ check(comp_registrar->RegisterFactory(
+ prompt_service_cid,
+ "Prompt Service",
+ "@mozilla.org/embedcomp/prompt-service;1",
+ prompt_factory));
+# else
+ check(nsComponentManager::RegisterFactory(
+ prompt_service_cid,
+ "Prompt Service",
+ "@mozilla.org/embedcomp/prompt-service;1",
+ prompt_factory,
+ PR_TRUE)); // replace existing
+# endif
}
#include <nsICSSLoader.h>
#include <nsICSSStyleSheet.h>
#include <nsIPresShell.h>
-#include <nsIServiceManagerUtils.h>
+#if MOZ_VERSION_MAJOR > 1 || (MOZ_VERSION_MAJOR == 1 && MOZ_VERSION_MINOR >= 8)
+# include <nsServiceManagerUtils.h>
+#else
+# include <nsIServiceManagerUtils.h>
+#endif
#include <nsIURI.h>
#include <nsNetUtil.h>
check(style_sheets.InsertObjectAt(style_sheet, 0));
check(pres_shell->SetAgentStyleSheets(style_sheets));
- check(pres_shell->EnablePrefStyleRules(false));
+ // FIXME: We need to find an alternative that works in Mozilla 1.8.
+# if MOZ_VERSION_MAJOR == 1 && MOZ_VERSION_MINOR < 8
+ check(pres_shell->EnablePrefStyleRules(false));
+# endif
// Update the display
- check(pres_shell->ReconstructStyleData());
- check(pres_shell->FlushPendingNotifications(true));
+# if MOZ_VERSION_MAJOR > 1 \
+ || (MOZ_VERSION_MAJOR == 1 && MOZ_VERSION_MINOR >= 8)
+ pres_shell->ReconstructStyleData();
+ check(pres_shell->FlushPendingNotifications(Flush_Display));
+# else
+ check(pres_shell->ReconstructStyleData());
+ check(pres_shell->FlushPendingNotifications(true));
+# endif
}
-
#include <nsIURI.h> // required before nsILink.h
#include <nsILink.h>
#include <nsIPrefBranch.h>
+#if MOZ_VERSION_MAJOR > 1 || (MOZ_VERSION_MAJOR == 1 && MOZ_VERSION_MINOR >= 8)
+# include <nsPresContext.h>
+#else
+# include <nsIPresContext.h>
+ typedef nsIPresContext nsPresContext; // ugh
+#endif
#include <nsIPrefService.h>
-#include <nsIPresContext.h>
#include <nsIPresShell.h>
-#include <nsIServiceManagerUtils.h>
+#if MOZ_VERSION_MAJOR > 1 || (MOZ_VERSION_MAJOR == 1 && MOZ_VERSION_MINOR >= 8)
+# include <nsServiceManagerUtils.h>
+#else
+# include <nsIServiceManagerUtils.h>
+#endif
#include <nsIWebBrowser.h>
#include <nsString.h>
bool process_page();
void save_screenshot();
void process_links(nsIPresShell * pres_shell,
- nsIPresContext * pres_context,
+ nsPresContext * pres_context,
nsIDOMWindow * dom_window);
video::frame_params frame_params_;
assert(doc_shell);
nsCOMPtr<nsIPresShell> pres_shell;
check(doc_shell->GetPresShell(getter_AddRefs(pres_shell)));
- nsCOMPtr<nsIPresContext> pres_context;
+ nsCOMPtr<nsPresContext> pres_context;
check(doc_shell->GetPresContext(getter_AddRefs(pres_context)));
nsCOMPtr<nsIDOMWindow> dom_window;
check(browser->GetContentDOMWindow(getter_AddRefs(dom_window)));
};
void videolink_window::process_links(nsIPresShell * pres_shell,
- nsIPresContext * pres_context,
+ nsPresContext * pres_context,
nsIDOMWindow * dom_window)
{
Glib::RefPtr<Gdk::Window> window(get_window());
check(event_state_man->SetContentState(content,
NS_EVENT_STATE_HOVER));
- pres_shell->FlushPendingNotifications(true);
+# if MOZ_VERSION_MAJOR > 1 \
+ || (MOZ_VERSION_MAJOR == 1 && MOZ_VERSION_MINOR >= 8)
+ pres_shell->FlushPendingNotifications(Flush_Display);
+# else
+ pres_shell->FlushPendingNotifications(true);
+# endif
// We may have to exit and wait for image loading
// to complete, at which point we will be called