X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;ds=sidebyside;f=videolink.cpp;fp=videolink.cpp;h=74b8a21a067979a5317ba0abc9bd645558e4dc40;hb=fcc6457245904ddccbeef52a3fc38c18efedf8ac;hp=a5792bbb1fce7bb46753638a13305c3103b47442;hpb=3f5baaa4a9097a57f1656f3a38a9cba319019017;p=videolink.git diff --git a/videolink.cpp b/videolink.cpp index a5792bb..74b8a21 100644 --- a/videolink.cpp +++ b/videolink.cpp @@ -41,19 +41,10 @@ #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 -#if MOZ_VERSION_MAJOR > 1 || (MOZ_VERSION_MAJOR == 1 && MOZ_VERSION_MINOR >= 8) -# include -#else -# include -#endif +#include #include #include @@ -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 @@ -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 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 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 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();