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