]> git.decadent.org.uk Git - videolink.git/blob - style_sheets.cpp
Removed support for Mozilla 1.7.
[videolink.git] / style_sheets.cpp
1 // Copyright 2005-6 Ben Hutchings <ben@decadent.org.uk>.
2 // See the file "COPYING" for licence details.
3
4 #include "style_sheets.hpp"
5
6 #include <nsCOMPtr.h>
7 #include <nsContentCID.h>
8 #include <nsIStyleSheetService.h>
9 #include <nsServiceManagerUtils.h>
10 #include <nsIURI.h>
11 #include <nsNetUtil.h>
12
13 #include "xpcom_support.hpp"
14
15 using xpcom_support::check;
16
17 // We just have to load and register a style-sheet as a user
18 // style-sheet.  There is no need to do anything for each page.
19
20 void init_agent_style_sheet(const char * uri)
21 {
22     nsCOMPtr<nsIURI> style_sheet_uri;
23     check(NS_NewURI(getter_AddRefs(style_sheet_uri), nsCString(uri)));
24
25     nsCOMPtr<nsIStyleSheetService> style_sheet_service;
26     static const nsCID style_sheet_service_cid = {
27         // NS_STYLESHEETSERVICE_CID copied from
28         // layout/base/nsStyleSheetService.cpp
29         0xfcca6f83, 0x9f7d, 0x44e4,
30         {0xa7, 0x4b, 0xb5, 0x94, 0x33, 0xe6, 0xc8, 0xc3}
31     };
32     check(CallGetService<nsIStyleSheetService>(
33               style_sheet_service_cid, getter_AddRefs(style_sheet_service)));
34     check(style_sheet_service->LoadAndRegisterSheet(
35               style_sheet_uri, nsIStyleSheetService::USER_SHEET));
36 }