X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=videolink.cpp;h=59956c744eb673a36ce7234669f9fc51798a543c;hb=aa18f5f499d46fd795cc46be93a2e4983e595a19;hp=3d2daebd0176644a008444e729c76e86ebd85be3;hpb=4b8bff9ce93df43b120c5cf4d1476d3a435f99d3;p=videolink.git diff --git a/videolink.cpp b/videolink.cpp index 3d2daeb..59956c7 100644 --- a/videolink.cpp +++ b/videolink.cpp @@ -43,10 +43,19 @@ #include // required before nsILink.h #include #include +#if MOZ_VERSION_MAJOR > 1 || (MOZ_VERSION_MAJOR == 1 && MOZ_VERSION_MINOR >= 8) +# include +#else +# include + typedef nsIPresContext nsPresContext; // ugh +#endif #include -#include #include -#include +#if MOZ_VERSION_MAJOR > 1 || (MOZ_VERSION_MAJOR == 1 && MOZ_VERSION_MINOR >= 8) +# include +#else +# include +#endif #include #include @@ -178,7 +187,7 @@ namespace 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_; @@ -210,7 +219,7 @@ namespace : frame_params_(frame_params), output_dir_(output_dir), encoder_(encoder), - stylesheet_(load_css("file://" VIDEOLINK_LIB_DIR "/videolink.css")), + stylesheet_(load_css("file://" VIDEOLINK_SHARE_DIR "/videolink.css")), pending_window_update_(false), pending_req_count_(0), have_tweaked_page_(false), @@ -422,7 +431,7 @@ namespace assert(doc_shell); nsCOMPtr pres_shell; check(doc_shell->GetPresShell(getter_AddRefs(pres_shell))); - nsCOMPtr pres_context; + nsCOMPtr pres_context; check(doc_shell->GetPresContext(getter_AddRefs(pres_context))); nsCOMPtr dom_window; check(browser->GetContentDOMWindow(getter_AddRefs(dom_window))); @@ -526,7 +535,7 @@ namespace }; void videolink_window::process_links(nsIPresShell * pres_shell, - nsIPresContext * pres_context, + nsPresContext * pres_context, nsIDOMWindow * dom_window) { Glib::RefPtr window(get_window()); @@ -703,7 +712,12 @@ namespace 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 @@ -850,17 +864,22 @@ namespace check(CallGetService(pref_service_cid, getter_AddRefs(pref_service))); nsCOMPtr 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)); + + // Turn off link underlining. This is also set in the agent + // stylesheet, but seems to be overridden by preferences in + // Mozilla 1.8. + check(pref_branch->SetBoolPref("browser.underline_anchors", + false)); # endif // Set display resolution. With standard-definition video we @@ -871,9 +890,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