]> git.decadent.org.uk Git - videolink.git/blobdiff - videolink.cpp
Removed support for Mozilla 1.7.
[videolink.git] / videolink.cpp
index a5792bbb1fce7bb46753638a13305c3103b47442..74b8a21a067979a5317ba0abc9bd645558e4dc40 100644 (file)
 #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 <nsPresContext.h>
 #include <nsIPrefService.h>
 #include <nsIPresShell.h>
-#if MOZ_VERSION_MAJOR > 1 || (MOZ_VERSION_MAJOR == 1 && MOZ_VERSION_MINOR >= 8)
-#   include <nsServiceManagerUtils.h>
-#else
-#   include <nsIServiceManagerUtils.h>
-#endif
+#include <nsServiceManagerUtils.h>
 #include <nsIWebBrowser.h>
 #include <nsString.h>
 
@@ -187,7 +178,6 @@ namespace
        video::frame_params frame_params_;
        std::string output_dir_;
        browser_widget browser_widget_;
-       agent_style_sheet_holder main_style_sheet_, frame_style_sheet_;
 
        dvd_generator generator_;
        typedef std::map<std::string, dvd_generator::pgc_ref>
@@ -210,15 +200,6 @@ namespace
        dvd_generator::mpeg_encoder encoder)
            : frame_params_(frame_params),
              output_dir_(output_dir),
-             main_style_sheet_(
-                 init_agent_style_sheet(
-                     "file://" VIDEOLINK_SHARE_DIR "/videolink.css")),
-             frame_style_sheet_(
-                 init_agent_style_sheet(
-                     std::string("file://" VIDEOLINK_SHARE_DIR "/")
-                     .append(frame_params.common_name)
-                     .append(".css")
-                     .c_str())),
              generator_(frame_params, encoder),
              pending_window_update_(false),
              pending_req_count_(0),
@@ -456,13 +437,9 @@ namespace
        nsCOMPtr<nsIDOMWindow> dom_window;
        check(browser->GetContentDOMWindow(getter_AddRefs(dom_window)));
 
-       // If we haven't done so already, apply the stylesheet and
-       // disable scrollbars.
+       // If we haven't done so already, disable scrollbars.
        if (!have_tweaked_page_)
        {
-           apply_agent_style_sheet(main_style_sheet_, pres_shell);
-           apply_agent_style_sheet(frame_style_sheet_, pres_shell);
-
            // This actually only needs to be done once.
            nsCOMPtr<nsIDOMBarProp> dom_bar_prop;
            check(dom_window->GetScrollbars(getter_AddRefs(dom_bar_prop)));
@@ -668,12 +645,7 @@ namespace
                check(event_state_man->SetContentState(content,
                                                       NS_EVENT_STATE_HOVER));
 
-#              if MOZ_VERSION_MAJOR > 1                                   \
-                    || (MOZ_VERSION_MAJOR == 1 && MOZ_VERSION_MINOR >= 8)
-                   pres_shell->FlushPendingNotifications(Flush_Display);
-#              else
-                   pres_shell->FlushPendingNotifications(true);
-#              endif
+               pres_shell->FlushPendingNotifications(Flush_Display);
 
                // We may have to exit and wait for image loading
                // to complete, at which point we will be called
@@ -749,15 +721,12 @@ namespace
        nsCOMPtr<nsIPrefBranch> pref_branch;
        check(pref_service->GetBranch("", getter_AddRefs(pref_branch)));
 
-#      if MOZ_VERSION_MAJOR > 1                                 \
-           || (MOZ_VERSION_MAJOR == 1 && MOZ_VERSION_MINOR >= 8)
-           // Disable IE-compatibility kluge that causes backgrounds to
-           // sometimes/usually be missing from snapshots.  This is only
-           // effective from Mozilla 1.8 onward.
-           check(pref_branch->SetBoolPref(
-                     "layout.fire_onload_after_image_background_loads",
-                     true));
-#      endif
+       // Disable IE-compatibility kluge that causes backgrounds to
+       // sometimes/usually be missing from snapshots.  This is only
+       // effective from Mozilla 1.8 onward.
+       check(pref_branch->SetBoolPref(
+                 "layout.fire_onload_after_image_background_loads",
+                 true));
 
        // Set display resolution.  With standard-definition video we
        // will be fitting ~600 pixels across a screen typically
@@ -778,7 +747,7 @@ namespace
        // separately, but don't know how yet.  Setting one to 40
        // but not the other is *bad*, so currently we set neither.
 
-#      if MOZ_VERSION_MAJOR == 1 && MOZ_VERSION_MINOR < 8
+#      if 0
            check(pref_branch->SetIntPref("browser.display.screen_resolution",
                                          40));
 #      endif
@@ -945,6 +914,10 @@ int main(int argc, char ** argv)
        // Initialise Mozilla
        browser_widget::initialiser browser_init;
        set_browser_preferences();
+       init_agent_style_sheet("file://" VIDEOLINK_SHARE_DIR "/videolink.css");
+       init_agent_style_sheet(std::string("file://" VIDEOLINK_SHARE_DIR "/")
+                              .append(frame_params.common_name).append(".css")
+                              .c_str());
        if (!preview_mode)
            null_prompt_service::install();