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
b2f995a8
Commit
b2f995a8
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: Store editor controller in NSContainer.
parent
c135e0d8
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
99 additions
and
1 deletion
+99
-1
mshtml_private.h
dlls/mshtml/mshtml_private.h
+4
-0
nsembed.c
dlls/mshtml/nsembed.c
+70
-1
nsiface.idl
dlls/mshtml/nsiface.idl
+25
-0
No files found.
dlls/mshtml/mshtml_private.h
View file @
b2f995a8
...
...
@@ -140,6 +140,8 @@ struct NSContainer {
nsIBaseWindow
*
window
;
nsIWebBrowserFocus
*
focus
;
nsIController
*
editor_controller
;
LONG
ref
;
NSContainer
*
parent
;
...
...
@@ -376,6 +378,7 @@ void release_nodes(HTMLDocument*);
BOOL
install_wine_gecko
(
void
);
/* commands */
typedef
struct
{
DWORD
id
;
HRESULT
(
*
query
)(
HTMLDocument
*
,
OLECMD
*
);
...
...
@@ -384,6 +387,7 @@ typedef struct {
extern
const
cmdtable_t
editmode_cmds
[];
/* timer */
#define UPDATE_UI 0x0001
#define UPDATE_TITLE 0x0002
...
...
dlls/mshtml/nsembed.c
View file @
b2f995a8
...
...
@@ -42,6 +42,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
#define NS_STRINGSTREAM_CONTRACTID "@mozilla.org/io/string-input-stream;1"
#define NS_COMMANDPARAMS_CONTRACTID "@mozilla.org/embedcomp/command-params;1"
#define NS_HTMLSERIALIZER_CONTRACTID "@mozilla.org/layout/contentserializer;1?mimetype=text/html"
#define NS_EDITORCONTROLLER_CONTRACTID "@mozilla.org/editor/editorcontroller;1"
#define APPSTARTUP_TOPIC "app-startup"
...
...
@@ -580,6 +581,58 @@ void nsnode_to_nsstring(nsIDOMNode *nsdoc, nsAString *str)
nsIContentSerializer_Release
(
serializer
);
}
static
nsIController
*
get_editor_controller
(
NSContainer
*
This
)
{
nsIController
*
ret
=
NULL
;
nsIEditingSession
*
editing_session
=
NULL
;
nsIInterfaceRequestor
*
iface_req
;
nsIControllerContext
*
ctrlctx
;
nsIEditor
*
editor
=
NULL
;
nsresult
nsres
;
nsres
=
nsIWebBrowser_QueryInterface
(
This
->
webbrowser
,
&
IID_nsIInterfaceRequestor
,
(
void
**
)
&
iface_req
);
if
(
NS_FAILED
(
nsres
))
{
ERR
(
"Could not get nsIInterfaceRequestor: %08x
\n
"
,
nsres
);
return
NULL
;
}
nsres
=
nsIInterfaceRequestor_GetInterface
(
iface_req
,
&
IID_nsIEditingSession
,
(
void
**
)
&
editing_session
);
nsIInterfaceRequestor_Release
(
iface_req
);
if
(
NS_FAILED
(
nsres
))
{
ERR
(
"Could not get nsIEditingSession: %08x
\n
"
,
nsres
);
return
NULL
;
}
nsres
=
nsIEditingSession_GetEditorForWindow
(
editing_session
,
This
->
doc
->
window
->
nswindow
,
&
editor
);
nsIEditingSession_Release
(
editing_session
);
if
(
NS_FAILED
(
nsres
))
{
ERR
(
"Could not get editor: %08x
\n
"
,
nsres
);
return
NULL
;
}
nsres
=
nsIComponentManager_CreateInstanceByContractID
(
pCompMgr
,
NS_EDITORCONTROLLER_CONTRACTID
,
NULL
,
&
IID_nsIControllerContext
,
(
void
**
)
&
ctrlctx
);
if
(
NS_SUCCEEDED
(
nsres
))
{
nsres
=
nsIControllerContext_SetCommandContext
(
ctrlctx
,
editor
);
if
(
NS_FAILED
(
nsres
))
ERR
(
"SetCommandContext failed: %08x
\n
"
,
nsres
);
nsres
=
nsIControllerContext_QueryInterface
(
ctrlctx
,
&
IID_nsIController
,
(
void
**
)
&
ret
);
nsIControllerContext_Release
(
ctrlctx
);
if
(
NS_FAILED
(
nsres
))
ERR
(
"Could not get nsIController interface: %08x
\n
"
,
nsres
);
}
else
{
ERR
(
"Could not create edit controller: %08x
\n
"
,
nsres
);
}
nsISupports_Release
(
editor
);
return
ret
;
}
void
set_ns_editmode
(
NSContainer
*
This
)
{
nsIInterfaceRequestor
*
iface_req
;
...
...
@@ -637,6 +690,14 @@ static void handle_load_event(NSContainer *This, nsIDOMEvent *event)
if
(
!
This
->
doc
)
return
;
if
(
This
->
editor_controller
)
{
nsIController_Release
(
This
->
editor_controller
);
This
->
editor_controller
=
NULL
;
}
if
(
This
->
doc
->
usermode
==
EDITMODE
)
This
->
editor_controller
=
get_editor_controller
(
This
);
task
=
mshtml_alloc
(
sizeof
(
task_t
));
task
->
doc
=
This
->
doc
;
...
...
@@ -1318,7 +1379,9 @@ static nsresult NSAPI nsDOMEventListener_HandleEvent(nsIDOMEventListener *iface,
if
(
!
strcmpW
(
loadW
,
type
))
{
handle_load_event
(
This
,
event
);
}
else
if
(
This
->
doc
&&
This
->
doc
->
usermode
==
EDITMODE
)
{
}
else
if
(
This
->
doc
)
{
update_doc
(
This
->
doc
,
UPDATE_UI
);
if
(
This
->
doc
->
usermode
==
EDITMODE
)
handle_edit_event
(
This
->
doc
,
event
);
}
...
...
@@ -1485,6 +1548,7 @@ NSContainer *NSContainer_Create(HTMLDocument *doc, NSContainer *parent)
ret
->
ref
=
1
;
ret
->
bscallback
=
NULL
;
ret
->
content_listener
=
NULL
;
ret
->
editor_controller
=
NULL
;
if
(
parent
)
nsIWebBrowserChrome_AddRef
(
NSWBCHROME
(
parent
));
...
...
@@ -1605,6 +1669,11 @@ void NSContainer_Release(NSContainer *This)
nsIWebBrowserFocus_Release
(
This
->
focus
);
This
->
focus
=
NULL
;
if
(
This
->
editor_controller
)
{
nsIController_Release
(
This
->
editor_controller
);
This
->
editor_controller
=
NULL
;
}
if
(
This
->
content_listener
)
{
nsIURIContentListener_Release
(
This
->
content_listener
);
This
->
content_listener
=
NULL
;
...
...
dlls/mshtml/nsiface.idl
View file @
b2f995a8
...
...
@@ -111,6 +111,7 @@ typedef nsISupports nsIWebProgressListener;
typedef nsISupports nsIDOMCSSValue;
typedef nsISupports nsIDOMCSSRule;
typedef nsISupports nsIPrintSession;
typedef nsISupports nsIControllerCommandTable;
[
object,
...
...
@@ -1611,6 +1612,30 @@ interface nsICommandManager : nsISupports
[
object,
uuid(47b82b60-a36f-4167-8072-6f421151ed50)
/* NOT_FROZEN */
]
interface nsIControllerContext : nsISupports
{
nsresult Init(nsIControllerCommandTable *aCommandTable);
nsresult SetCommandContext(nsISupports *aCommandContext);
}
[
object,
uuid(d5b61b82-1da4-11d3-bf87-00105a1b0627)
/* NOT_FROZEN */
]
interface nsIController : nsISupports
{
nsresult IsCommandEnabled(const char *command, PRBool *_retval);
nsresult SupportsCommand(const char *command, PRBool *_retval);
nsresult DoCommand(const char *command);
nsresult OnEvent(const char *eventName);
}
[
object,
uuid(d650439a-ca29-410d-a906-b0557fb62fcd)
/* NOT_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