X-Git-Url: https://git.decadent.org.uk/gitweb/?a=blobdiff_plain;f=style_sheets.hpp;h=ef4aef34b7852a49292f2bd9ae70627763e289fe;hb=3a7baf39d3211c0bda3de1ab2b657e024a35b8af;hp=aa9d942d638351267d0930934e44a415a4a69fda;hpb=0acb5f1329d294faf42e247f8c2daf68d82150f6;p=videolink.git diff --git a/style_sheets.hpp b/style_sheets.hpp index aa9d942..ef4aef3 100644 --- a/style_sheets.hpp +++ b/style_sheets.hpp @@ -1,4 +1,4 @@ -// Copyright 2005 Ben Hutchings . +// Copyright 2005 Ben Hutchings . // See the file "COPYING" for licence details. #ifndef INC_STYLESHEETS_HPP @@ -9,12 +9,29 @@ class nsIPresShell; -// Load a CSS from an (absolute) URI. -// TODO: Support loading from an absolute, or better, relative filename. -already_AddRefed load_css(const char * uri); +// These functions load and apply a style-sheet as necessary, +// overriding the built-in "preferences". + +// init_agent_style_sheet() must be called once during startup +// apply_agent_style_sheet() must be called for each page + +#if MOZ_VERSION_MAJOR > 1 || (MOZ_VERSION_MAJOR == 1 && MOZ_VERSION_MINOR >= 8) + +struct agent_style_sheet_holder {}; + +// Load agent style sheet from an (absolute) URI, and register it if +// possible. +agent_style_sheet_holder init_agent_style_sheet(const char * uri); +inline void apply_agent_style_sheet(agent_style_sheet_holder, nsIPresShell *) +{} + +#else + +typedef nsCOMPtr agent_style_sheet_holder; +already_AddRefed init_agent_style_sheet(const char * uri); +void apply_agent_style_sheet(nsIStyleSheet *, nsIPresShell *); + +#endif -// Apply a style-sheet to a given presentation shell as the top-priority -// agent style-sheet and disable the preferences-derived style rules. -void apply_style_sheet(nsIStyleSheet *, nsIPresShell *); #endif // !INC_STYLESHEETS_HPP