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
d42c2528
Commit
d42c2528
authored
Jun 10, 2007
by
Jacek Caban
Committed by
Alexandre Julliard
Jun 11, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Move more commands to editor command table.
parent
34f1f61a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
97 additions
and
90 deletions
+97
-90
editor.c
dlls/mshtml/editor.c
+97
-1
olecmd.c
dlls/mshtml/olecmd.c
+0
-89
No files found.
dlls/mshtml/editor.c
View file @
d42c2528
...
...
@@ -37,11 +37,19 @@
WINE_DEFAULT_DEBUG_CHANNEL
(
mshtml
);
#define NSCMD_ALIGN "cmd_align"
#define NSCMD_BOLD "cmd_bold"
#define NSCMD_FONTCOLOR "cmd_fontColor"
#define NSCMD_FONTFACE "cmd_fontFace"
#define NSCMD_ITALIC "cmd_italic"
#define NSCMD_UNDERLINE "cmd_underline"
#define NSSTATE_ATTRIBUTE "state_attribute"
#define NSALIGN_CENTER "center"
#define NSALIGN_LEFT "left"
#define NSALIGN_RIGHT "right"
#define DOM_VK_LEFT VK_LEFT
#define DOM_VK_UP VK_UP
#define DOM_VK_RIGHT VK_RIGHT
...
...
@@ -109,6 +117,20 @@ static nsresult get_ns_command_state(NSContainer *This, const char *cmd, nsIComm
return
nsres
;
}
static
void
set_ns_align
(
HTMLDocument
*
This
,
const
char
*
align_str
)
{
nsICommandParams
*
nsparam
;
if
(
!
This
->
nscontainer
)
return
;
nsparam
=
create_nscommand_params
();
nsICommandParams_SetCStringValue
(
nsparam
,
NSSTATE_ATTRIBUTE
,
align_str
);
do_ns_command
(
This
->
nscontainer
,
NSCMD_ALIGN
,
nsparam
);
nsICommandParams_Release
(
nsparam
);
}
static
nsISelection
*
get_ns_selection
(
HTMLDocument
*
This
)
{
nsIDOMWindow
*
dom_window
;
...
...
@@ -275,7 +297,7 @@ void set_font_size(HTMLDocument *This, LPCWSTR size)
FIXME
(
"range_cnt %d not supprted
\n
"
,
range_cnt
);
nsIDOMDocument_CreateElement
(
nsdoc
,
&
font_str
,
&
elem
);
nsIDOMElement_SetAttribute
(
elem
,
&
size_str
,
&
val_str
);
nsIDOMElement_SetAttribute
(
elem
,
&
size_str
,
&
val_str
);
nsISelection_GetRangeAt
(
nsselection
,
0
,
&
range
);
nsISelection_GetIsCollapsed
(
nsselection
,
&
collapsed
);
...
...
@@ -632,9 +654,83 @@ static HRESULT exec_fontsize(HTMLDocument *This, DWORD cmdexecopt, VARIANT *in,
return
S_OK
;
}
static
HRESULT
exec_bold
(
HTMLDocument
*
This
,
DWORD
cmdexecopt
,
VARIANT
*
in
,
VARIANT
*
out
)
{
TRACE
(
"(%p)
\n
"
,
This
);
if
(
in
||
out
)
FIXME
(
"unsupported args
\n
"
);
if
(
This
->
nscontainer
)
do_ns_command
(
This
->
nscontainer
,
NSCMD_BOLD
,
NULL
);
return
S_OK
;
}
static
HRESULT
exec_italic
(
HTMLDocument
*
This
,
DWORD
cmdexecopt
,
VARIANT
*
in
,
VARIANT
*
out
)
{
TRACE
(
"(%p)
\n
"
,
This
);
if
(
in
||
out
)
FIXME
(
"unsupported args
\n
"
);
if
(
This
->
nscontainer
)
do_ns_command
(
This
->
nscontainer
,
NSCMD_ITALIC
,
NULL
);
return
S_OK
;
}
static
HRESULT
exec_justifycenter
(
HTMLDocument
*
This
,
DWORD
cmdexecopt
,
VARIANT
*
in
,
VARIANT
*
out
)
{
TRACE
(
"(%p)
\n
"
,
This
);
if
(
in
||
out
)
FIXME
(
"unsupported args
\n
"
);
set_ns_align
(
This
,
NSALIGN_CENTER
);
return
S_OK
;
}
static
HRESULT
exec_justifyleft
(
HTMLDocument
*
This
,
DWORD
cmdexecopt
,
VARIANT
*
in
,
VARIANT
*
out
)
{
TRACE
(
"(%p)
\n
"
,
This
);
if
(
in
||
out
)
FIXME
(
"unsupported args
\n
"
);
set_ns_align
(
This
,
NSALIGN_LEFT
);
return
S_OK
;
}
static
HRESULT
exec_justifyright
(
HTMLDocument
*
This
,
DWORD
cmdexecopt
,
VARIANT
*
in
,
VARIANT
*
out
)
{
TRACE
(
"(%p)
\n
"
,
This
);
set_ns_align
(
This
,
NSALIGN_RIGHT
);
return
S_OK
;
}
static
HRESULT
exec_underline
(
HTMLDocument
*
This
,
DWORD
cmdexecopt
,
VARIANT
*
in
,
VARIANT
*
out
)
{
TRACE
(
"(%p)
\n
"
,
This
);
if
(
in
||
out
)
FIXME
(
"unsupported args
\n
"
);
if
(
This
->
nscontainer
)
do_ns_command
(
This
->
nscontainer
,
NSCMD_UNDERLINE
,
NULL
);
return
S_OK
;
}
const
cmdtable_t
editmode_cmds
[]
=
{
{
IDM_FONTNAME
,
NULL
,
exec_fontname
},
{
IDM_FONTSIZE
,
NULL
,
exec_fontsize
},
{
IDM_FORECOLOR
,
NULL
,
exec_forecolor
},
{
IDM_BOLD
,
NULL
,
exec_bold
},
{
IDM_ITALIC
,
NULL
,
exec_italic
},
{
IDM_JUSTIFYCENTER
,
NULL
,
exec_justifycenter
},
{
IDM_JUSTIFYRIGHT
,
NULL
,
exec_justifyright
},
{
IDM_JUSTIFYLEFT
,
NULL
,
exec_justifyleft
},
{
IDM_UNDERLINE
,
NULL
,
exec_underline
},
{
0
,
NULL
,
NULL
}
};
dlls/mshtml/olecmd.c
View file @
d42c2528
...
...
@@ -560,20 +560,6 @@ static DWORD query_align_status(HTMLDocument *This, const char *align_str)
return
OLECMDF_SUPPORTED
|
OLECMDF_ENABLED
|
(
align
&&
!
strcmp
(
align_str
,
align
)
?
OLECMDF_LATCHED
:
0
);
}
static
void
set_ns_align
(
HTMLDocument
*
This
,
const
char
*
align_str
)
{
nsICommandParams
*
nsparam
;
if
(
!
This
->
nscontainer
)
return
;
nsparam
=
create_nscommand_params
();
nsICommandParams_SetCStringValue
(
nsparam
,
NSSTATE_ATTRIBUTE
,
align_str
);
do_ns_command
(
This
->
nscontainer
,
NSCMD_ALIGN
,
nsparam
);
nsICommandParams_Release
(
nsparam
);
}
static
HRESULT
exec_mshtml_copy
(
HTMLDocument
*
This
,
DWORD
cmdexecopt
,
VARIANT
*
in
,
VARIANT
*
out
)
{
...
...
@@ -593,57 +579,6 @@ static HRESULT exec_mshtml_paste(HTMLDocument *This, DWORD cmdexecopt, VARIANT *
return
E_NOTIMPL
;
}
static
HRESULT
exec_bold
(
HTMLDocument
*
This
)
{
TRACE
(
"(%p)
\n
"
,
This
);
if
(
This
->
nscontainer
)
do_ns_command
(
This
->
nscontainer
,
NSCMD_BOLD
,
NULL
);
return
S_OK
;
}
static
HRESULT
exec_italic
(
HTMLDocument
*
This
)
{
TRACE
(
"(%p)
\n
"
,
This
);
if
(
This
->
nscontainer
)
do_ns_command
(
This
->
nscontainer
,
NSCMD_ITALIC
,
NULL
);
return
S_OK
;
}
static
HRESULT
exec_justifycenter
(
HTMLDocument
*
This
)
{
TRACE
(
"(%p)
\n
"
,
This
);
set_ns_align
(
This
,
NSALIGN_CENTER
);
return
S_OK
;
}
static
HRESULT
exec_justifyleft
(
HTMLDocument
*
This
)
{
TRACE
(
"(%p)
\n
"
,
This
);
set_ns_align
(
This
,
NSALIGN_LEFT
);
return
S_OK
;
}
static
HRESULT
exec_justifyright
(
HTMLDocument
*
This
)
{
TRACE
(
"(%p)
\n
"
,
This
);
set_ns_align
(
This
,
NSALIGN_RIGHT
);
return
S_OK
;
}
static
HRESULT
exec_underline
(
HTMLDocument
*
This
)
{
TRACE
(
"(%p)
\n
"
,
This
);
if
(
This
->
nscontainer
)
do_ns_command
(
This
->
nscontainer
,
NSCMD_UNDERLINE
,
NULL
);
return
S_OK
;
}
static
HRESULT
exec_browsemode
(
HTMLDocument
*
This
,
DWORD
cmdexecopt
,
VARIANT
*
in
,
VARIANT
*
out
)
{
WARN
(
"(%p)->(%08x %p %p)
\n
"
,
This
,
cmdexecopt
,
in
,
out
);
...
...
@@ -1092,30 +1027,6 @@ static HRESULT WINAPI OleCommandTarget_Exec(IOleCommandTarget *iface, const GUID
return
hres
;
switch
(
nCmdID
)
{
case
IDM_BOLD
:
if
(
pvaIn
||
pvaOut
)
FIXME
(
"unsupported arguments
\n
"
);
return
exec_bold
(
This
);
case
IDM_ITALIC
:
if
(
pvaIn
||
pvaOut
)
FIXME
(
"unsupported arguments
\n
"
);
return
exec_italic
(
This
);
case
IDM_JUSTIFYCENTER
:
if
(
pvaIn
||
pvaOut
)
FIXME
(
"unsupported arguments
\n
"
);
return
exec_justifycenter
(
This
);
case
IDM_JUSTIFYLEFT
:
if
(
pvaIn
||
pvaOut
)
FIXME
(
"unsupported arguments
\n
"
);
return
exec_justifyleft
(
This
);
case
IDM_JUSTIFYRIGHT
:
if
(
pvaIn
||
pvaOut
)
FIXME
(
"unsupported arguments
\n
"
);
return
exec_justifyright
(
This
);
case
IDM_UNDERLINE
:
if
(
pvaIn
||
pvaOut
)
FIXME
(
"unsupported arguments
\n
"
);
return
exec_underline
(
This
);
case
IDM_BASELINEFONT3
:
return
exec_baselinefont3
(
This
);
case
IDM_HORIZONTALLINE
:
...
...
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