X-Git-Url: https://git.decadent.org.uk/gitweb/?p=videolink.git;a=blobdiff_plain;f=videolink.cpp;h=74b8a21a067979a5317ba0abc9bd645558e4dc40;hp=3d88f4edb7c57a1fe7e26c8a0ff53f348b00f361;hb=fcc6457245904ddccbeef52a3fc38c18efedf8ac;hpb=f5d9069647f70b7aab8e656f59cf42176c419461 diff --git a/videolink.cpp b/videolink.cpp index 3d88f4e..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), @@ -428,7 +409,6 @@ namespace Gdk::COLORSPACE_RGB, true, 8, // has_alpha, bits_per_sample width, height)), - link_num(0), links_it(doc), link_changing(false) { @@ -437,7 +417,6 @@ namespace Glib::RefPtr norm_pixbuf; Glib::RefPtr diff_pixbuf; - unsigned link_num; link_iterator links_it, links_end; rectangle link_rect; @@ -458,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))); @@ -609,18 +584,6 @@ namespace continue; } - ++state->link_num; - - if (state->link_num >= unsigned(dvd::menu_buttons_max)) - { - if (state->link_num == unsigned(dvd::menu_buttons_max)) - std::cerr << "No more than " << dvd::menu_buttons_max - << " buttons can be placed on a menu\n"; - std::cerr << "Ignoring link to " << uri_and_fragment - << "\n"; - continue; - } - // Check whether this is a link to a video or a page then // add it to the known resources if not already seen; then // add it to the menu entries. @@ -682,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 @@ -763,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 @@ -792,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 @@ -959,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();