Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
a3717bff
Commit
a3717bff
authored
Nov 04, 2007
by
Jacek Caban
Committed by
Alexandre Julliard
Nov 06, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Added AcceptLanguage handling.
parent
57b876dd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
70 additions
and
0 deletions
+70
-0
nsembed.c
dlls/mshtml/nsembed.c
+43
-0
nsiface.idl
dlls/mshtml/nsiface.idl
+27
-0
No files found.
dlls/mshtml/nsembed.c
View file @
a3717bff
...
...
@@ -45,6 +45,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
#define NS_EDITORCONTROLLER_CONTRACTID "@mozilla.org/editor/editorcontroller;1"
#define NS_ARRAY_CONTRACTID "@mozilla.org/array;1"
#define NS_VARIANT_CONTRACTID "@mozilla.org/variant;1"
#define NS_PREFERENCES_CONTRACTID "@mozilla.org/preferences;1"
#define APPSTARTUP_TOPIC "app-startup"
...
...
@@ -253,8 +254,39 @@ static BOOL load_wine_gecko(PRUnichar *gre_path)
return
ret
;
}
static
void
set_lang
(
nsIPrefBranch
*
pref
)
{
char
langs
[
100
];
DWORD
res
,
size
,
type
;
HKEY
hkey
;
nsresult
nsres
;
static
const
WCHAR
international_keyW
[]
=
{
'S'
,
'o'
,
'f'
,
't'
,
'w'
,
'a'
,
'r'
,
'e'
,
'\\'
,
'M'
,
'i'
,
'c'
,
'r'
,
'o'
,
's'
,
'o'
,
'f'
,
't'
,
'\\'
,
'I'
,
'n'
,
't'
,
'e'
,
'r'
,
'n'
,
'e'
,
't'
,
' '
,
'E'
,
'x'
,
'p'
,
'l'
,
'o'
,
'r'
,
'e'
,
'r'
,
'\\'
,
'I'
,
'n'
,
't'
,
'e'
,
'r'
,
'n'
,
'a'
,
't'
,
'i'
,
'o'
,
'n'
,
'a'
,
'l'
,
0
};
res
=
RegOpenKeyW
(
HKEY_CURRENT_USER
,
international_keyW
,
&
hkey
);
if
(
res
!=
ERROR_SUCCESS
)
return
;
size
=
sizeof
(
langs
);
res
=
RegQueryValueExA
(
hkey
,
"AcceptLanguage"
,
0
,
&
type
,
(
LPBYTE
)
langs
,
&
size
);
RegCloseKey
(
hkey
);
if
(
res
!=
ERROR_SUCCESS
||
type
!=
REG_SZ
)
return
;
TRACE
(
"Setting lang %s
\n
"
,
debugstr_a
(
langs
));
nsres
=
nsIPrefBranch_SetCharPref
(
pref
,
"intl.accept_languages"
,
langs
);
if
(
NS_FAILED
(
nsres
))
ERR
(
"SetCharPref failed: %08x
\n
"
,
nsres
);
}
static
void
set_profile
(
void
)
{
nsIPrefBranch
*
pref
;
nsIProfile
*
profile
;
PRBool
exists
=
FALSE
;
nsresult
nsres
;
...
...
@@ -280,6 +312,17 @@ static void set_profile(void)
ERR
(
"SetCurrentProfile failed: %08x
\n
"
,
nsres
);
nsIProfile_Release
(
profile
);
nsres
=
nsIServiceManager_GetServiceByContractID
(
pServMgr
,
NS_PREFERENCES_CONTRACTID
,
&
IID_nsIPrefBranch
,
(
void
**
)
&
pref
);
if
(
NS_FAILED
(
nsres
))
{
ERR
(
"Could not get preference service: %08x
\n
"
,
nsres
);
return
;
}
set_lang
(
pref
);
nsIPrefBranch_Release
(
pref
);
}
static
BOOL
init_xpcom
(
const
PRUnichar
*
gre_path
)
...
...
dlls/mshtml/nsiface.idl
View file @
a3717bff
...
...
@@ -1506,6 +1506,33 @@ interface nsIFile : nsISupports
[
object,
uuid(56c35506-f14b-11d3-99d3-ddbfac2ccf65)
/* FROZEN */
]
interface nsIPrefBranch : nsISupports
{
nsresult GetRoot(char **aRoot);
nsresult GetPrefType(const char *aPrefName, PRInt32 *_retval);
nsresult GetBoolPref(const char *aPrefName, PRBool *_retval);
nsresult SetBoolPref(const char *aPrefName, PRInt32 aValue);
nsresult GetCharPref(const char *aPrefName, char **_retval);
nsresult SetCharPref(const char *aPrefName, const char *aValue);
nsresult GetIntPref(const char *aPrefName, PRInt32 *_retval);
nsresult SetIntPref(const char *aPrefName, PRInt32 aValue);
nsresult GetComplexValue(const char *aPrefName, const nsIID *aType, void **aValue);
nsresult SetComplexValue(const char *aPrefName, const nsIID *aType, nsISupports *aValue);
nsresult ClearUserPref(const char *aPrefName);
nsresult LockPref(const char *aPrefName);
nsresult PrefHasUserValue(const char *aPrefName, PRBool *_retval);
nsresult PrefIsLocked(const char *aPrefName, PRBool *_retval);
nsresult UnlockPref(const char *aPrefName);
nsresult DeleteBranch(const char *aStartingAt);
nsresult GetChildList(const char *aStartingAt, PRUint32 *aCount, char ***aChildArray);
nsresult ResetBranch(const char *aStartingAt);
}
[
object,
uuid(15fd6940-8ea7-11d3-93ad-00104ba0fd40)
/* FROZEN */
]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment