]> git.decadent.org.uk Git - videolink.git/blobdiff - videolink.cpp
Changed style-sheet application in Mozila/XULRunner 1.8 to override built-in preferen...
[videolink.git] / videolink.cpp
index f26bd5d2809a7a1dbf7d050a792f6c1d71efb1b4..8ab52660ec2b3d347692a499af9cb4194c20d1fa 100644 (file)
@@ -194,7 +194,7 @@ namespace
        std::string output_dir_;
        mpeg_encoder encoder_;
        browser_widget browser_widget_;
-       nsCOMPtr<nsIStyleSheet> stylesheet_;
+       agent_style_sheet_holder style_sheet_;
 
        dvd_contents contents_;
        typedef std::map<std::string, dvd_contents::pgc_ref> resource_map_type;
@@ -219,7 +219,8 @@ namespace
            : frame_params_(frame_params),
              output_dir_(output_dir),
              encoder_(encoder),
-             stylesheet_(load_css("file://" VIDEOLINK_SHARE_DIR "/videolink.css")),
+             style_sheet_(init_agent_style_sheet(
+                              "file://"VIDEOLINK_SHARE_DIR"/videolink.css")),
              pending_window_update_(false),
              pending_req_count_(0),
              have_tweaked_page_(false),
@@ -440,7 +441,7 @@ namespace
        // disable scrollbars.
        if (!have_tweaked_page_)
        {
-           apply_style_sheet(stylesheet_, pres_shell);
+           apply_agent_style_sheet(style_sheet_, pres_shell);
 
            // This actually only needs to be done once.
            nsCOMPtr<nsIDOMBarProp> dom_bar_prop;
@@ -864,17 +865,16 @@ namespace
        check(CallGetService<nsIPrefService>(pref_service_cid,
                                             getter_AddRefs(pref_service)));
        nsCOMPtr<nsIPrefBranch> pref_branch;
+       check(pref_service->GetBranch("", getter_AddRefs(pref_branch)));
 
-       // Disable IE-compatibility kluge that causes backgrounds to
-       // sometimes/usually be missing from snapshots.  This is only
-       // effective from Mozilla 1.8 onward.
 #      if MOZ_VERSION_MAJOR > 1                                 \
            || (MOZ_VERSION_MAJOR == 1 && MOZ_VERSION_MINOR >= 8)
-       check(pref_service->GetDefaultBranch("layout",
-                                            getter_AddRefs(pref_branch)));
-       check(pref_branch->SetBoolPref(
-                 "fire_onload_after_image_background_loads",
-                 true));
+           // 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
 
        // Set display resolution.  With standard-definition video we
@@ -885,9 +885,8 @@ namespace
        // slightly different but unfortunately Mozilla doesn't
        // support non-square pixels (and neither do fontconfig or Xft
        // anyway).
-       check(pref_service->GetDefaultBranch("browser.display",
-                                            getter_AddRefs(pref_branch)));
-       check(pref_branch->SetIntPref("screen_resolution", 40));
+       check(pref_branch->SetIntPref("browser.display.screen_resolution",
+                                     40));
     }
 
 } // namespace