Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
5f907804
Commit
5f907804
authored
Aug 27, 2006
by
Jacek Caban
Committed by
Alexandre Julliard
Aug 28, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Added IDM_FONTNAME implementation.
parent
80225d53
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
112 additions
and
0 deletions
+112
-0
mshtml_private.h
dlls/mshtml/mshtml_private.h
+1
-0
nsembed.c
dlls/mshtml/nsembed.c
+18
-0
olecmd.c
dlls/mshtml/olecmd.c
+93
-0
No files found.
dlls/mshtml/mshtml_private.h
View file @
5f907804
...
...
@@ -312,6 +312,7 @@ PRUint32 nsAString_GetData(const nsAString*,const PRUnichar**,PRBool*);
void
nsAString_Finish
(
nsAString
*
);
nsIInputStream
*
create_nsstream
(
const
char
*
,
PRInt32
);
nsICommandParams
*
create_nscommand_params
(
void
);
BSCallback
*
create_bscallback
(
HTMLDocument
*
,
IMoniker
*
);
HRESULT
start_binding
(
BSCallback
*
);
...
...
dlls/mshtml/nsembed.c
View file @
5f907804
...
...
@@ -40,6 +40,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
#define NS_PROFILE_CONTRACTID "@mozilla.org/profile/manager;1"
#define NS_MEMORY_CONTRACTID "@mozilla.org/xpcom/memory-service;1"
#define NS_STRINGSTREAM_CONTRACTID "@mozilla.org/io/string-input-stream;1"
#define NS_COMMANDPARAMS_CONTRACTID "@mozilla.org/embedcomp/command-params;1"
#define APPSTARTUP_TOPIC "app-startup"
...
...
@@ -447,6 +448,23 @@ nsIInputStream *create_nsstream(const char *data, PRInt32 data_len)
return
(
nsIInputStream
*
)
ret
;
}
nsICommandParams
*
create_nscommand_params
(
void
)
{
nsICommandParams
*
ret
=
NULL
;
nsresult
nsres
;
if
(
!
pCompMgr
)
return
NULL
;
nsres
=
nsIComponentManager_CreateInstanceByContractID
(
pCompMgr
,
NS_COMMANDPARAMS_CONTRACTID
,
NULL
,
&
IID_nsICommandParams
,
(
void
**
)
&
ret
);
if
(
NS_FAILED
(
nsres
))
ERR
(
"Could not get nsICommandParams
\n
"
);
return
ret
;
}
void
close_gecko
()
{
TRACE
(
"()
\n
"
);
...
...
dlls/mshtml/olecmd.c
View file @
5f907804
...
...
@@ -26,6 +26,7 @@
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "winnls.h"
#include "ole2.h"
#include "shlguid.h"
#include "mshtmdid.h"
...
...
@@ -268,6 +269,96 @@ static void do_ns_command(NSContainer *This, const char *cmd, nsICommandParams *
nsICommandManager_Release
(
cmdmgr
);
}
static
nsresult
get_ns_command_state
(
NSContainer
*
This
,
const
char
*
cmd
,
nsICommandParams
*
nsparam
)
{
nsICommandManager
*
cmdmgr
;
nsIInterfaceRequestor
*
iface_req
;
nsresult
nsres
;
nsres
=
nsIWebBrowser_QueryInterface
(
This
->
webbrowser
,
&
IID_nsIInterfaceRequestor
,
(
void
**
)
&
iface_req
);
if
(
NS_FAILED
(
nsres
))
{
ERR
(
"Could not get nsIInterfaceRequestor: %08lx
\n
"
,
nsres
);
return
nsres
;
}
nsres
=
nsIInterfaceRequestor_GetInterface
(
iface_req
,
&
IID_nsICommandManager
,
(
void
**
)
&
cmdmgr
);
nsIInterfaceRequestor_Release
(
iface_req
);
if
(
NS_FAILED
(
nsres
))
{
ERR
(
"Could not get nsICommandManager: %08lx
\n
"
,
nsres
);
return
nsres
;
}
nsres
=
nsICommandManager_GetCommandState
(
cmdmgr
,
cmd
,
NULL
,
nsparam
);
if
(
NS_FAILED
(
nsres
))
ERR
(
"GetCommandState(%s) failed: %08lx
\n
"
,
debugstr_a
(
cmd
),
nsres
);
nsICommandManager_Release
(
cmdmgr
);
return
nsres
;
}
static
HRESULT
exec_fontname
(
HTMLDocument
*
This
,
VARIANT
*
in
,
VARIANT
*
out
)
{
TRACE
(
"(%p)->(%p %p)
\n
"
,
This
,
in
,
out
);
if
(
!
This
->
nscontainer
)
return
E_FAIL
;
if
(
in
)
{
nsICommandParams
*
nsparam
=
create_nscommand_params
();
char
*
stra
;
DWORD
len
;
if
(
V_VT
(
in
)
!=
VT_BSTR
)
{
FIXME
(
"Unsupported vt=%d
\n
"
,
V_VT
(
out
));
return
E_INVALIDARG
;
}
len
=
WideCharToMultiByte
(
CP_ACP
,
0
,
V_BSTR
(
in
),
-
1
,
NULL
,
0
,
NULL
,
NULL
);
stra
=
mshtml_alloc
(
len
);
WideCharToMultiByte
(
CP_ACP
,
0
,
V_BSTR
(
in
),
-
1
,
stra
,
-
1
,
NULL
,
NULL
);
nsICommandParams_SetCStringValue
(
nsparam
,
"state_attribute"
,
stra
);
mshtml_free
(
stra
);
do_ns_command
(
This
->
nscontainer
,
"cmd_fontFace"
,
nsparam
);
nsICommandParams_Release
(
nsparam
);
}
if
(
out
)
{
nsICommandParams
*
nsparam
;
LPWSTR
strw
;
char
*
stra
;
DWORD
len
;
nsresult
nsres
;
if
(
V_VT
(
out
)
!=
VT_BSTR
)
{
FIXME
(
"Unsupported vt=%d
\n
"
,
V_VT
(
out
));
return
E_INVALIDARG
;
}
nsparam
=
create_nscommand_params
();
nsres
=
get_ns_command_state
(
This
->
nscontainer
,
"cmd_fontFace"
,
nsparam
);
if
(
NS_FAILED
(
nsres
))
return
S_OK
;
nsICommandParams_GetCStringValue
(
nsparam
,
"state_attribute"
,
&
stra
);
nsICommandParams_Release
(
nsparam
);
len
=
MultiByteToWideChar
(
CP_ACP
,
0
,
stra
,
-
1
,
NULL
,
0
);
strw
=
mshtml_alloc
(
len
*
sizeof
(
WCHAR
));
MultiByteToWideChar
(
CP_ACP
,
0
,
stra
,
-
1
,
strw
,
-
1
);
nsfree
(
stra
);
V_BSTR
(
out
)
=
SysAllocString
(
strw
);
mshtml_free
(
strw
);
}
return
S_OK
;
}
static
HRESULT
exec_bold
(
HTMLDocument
*
This
)
{
TRACE
(
"(%p)
\n
"
,
This
);
...
...
@@ -637,6 +728,8 @@ static HRESULT WINAPI OleCommandTarget_Exec(IOleCommandTarget *iface, const GUID
return
OLECMDERR_E_NOTSUPPORTED
;
}
else
if
(
IsEqualGUID
(
&
CGID_MSHTML
,
pguidCmdGroup
))
{
switch
(
nCmdID
)
{
case
IDM_FONTNAME
:
return
exec_fontname
(
This
,
pvaIn
,
pvaOut
);
case
IDM_BOLD
:
if
(
pvaIn
||
pvaOut
)
FIXME
(
"unsupported arguments
\n
"
);
...
...
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