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
1a4c366f
Commit
1a4c366f
authored
Oct 02, 2006
by
Jacek Caban
Committed by
Alexandre Julliard
Oct 02, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Added begining implementation of IPersistStreamInit::Save.
parent
e947b948
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
209 additions
and
3 deletions
+209
-3
mshtml_private.h
dlls/mshtml/mshtml_private.h
+1
-0
nsembed.c
dlls/mshtml/nsembed.c
+98
-0
nsiface.idl
dlls/mshtml/nsiface.idl
+62
-1
persist.c
dlls/mshtml/persist.c
+48
-2
No files found.
dlls/mshtml/mshtml_private.h
View file @
1a4c366f
...
...
@@ -318,6 +318,7 @@ void nsAString_Finish(nsAString*);
nsIInputStream
*
create_nsstream
(
const
char
*
,
PRInt32
);
nsICommandParams
*
create_nscommand_params
(
void
);
void
nsnode_to_nsstring
(
nsIDOMNode
*
,
nsAString
*
);
BSCallback
*
create_bscallback
(
IMoniker
*
);
HRESULT
start_binding
(
BSCallback
*
);
...
...
dlls/mshtml/nsembed.c
View file @
1a4c366f
...
...
@@ -41,6 +41,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
#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 NS_HTMLSERIALIZER_CONTRACTID "@mozilla.org/layout/contentserializer;1?mimetype=text/html"
#define APPSTARTUP_TOPIC "app-startup"
...
...
@@ -464,6 +465,103 @@ nsICommandParams *create_nscommand_params(void)
return
ret
;
}
static
void
nsnode_to_nsstring_rec
(
nsIContentSerializer
*
serializer
,
nsIDOMNode
*
nsnode
,
nsAString
*
str
)
{
nsIDOMNodeList
*
node_list
=
NULL
;
PRBool
has_children
=
FALSE
;
PRUint16
type
;
nsresult
nsres
;
nsIDOMNode_HasChildNodes
(
nsnode
,
&
has_children
);
nsres
=
nsIDOMNode_GetNodeType
(
nsnode
,
&
type
);
if
(
NS_FAILED
(
nsres
))
{
ERR
(
"GetType failed: %08lx
\n
"
,
nsres
);
return
;
}
switch
(
type
)
{
case
ELEMENT_NODE
:
{
nsIDOMElement
*
nselem
;
nsIDOMNode_QueryInterface
(
nsnode
,
&
IID_nsIDOMElement
,
(
void
**
)
&
nselem
);
nsIContentSerializer_AppendElementStart
(
serializer
,
nselem
,
has_children
,
str
);
nsIDOMElement_Release
(
nselem
);
break
;
}
case
TEXT_NODE
:
{
nsIDOMText
*
nstext
;
nsIDOMNode_QueryInterface
(
nsnode
,
&
IID_nsIDOMText
,
(
void
**
)
&
nstext
);
nsIContentSerializer_AppendText
(
serializer
,
nstext
,
0
,
-
1
,
str
);
nsIDOMText_Release
(
nstext
);
break
;
}
case
DOCUMENT_NODE
:
{
nsIDOMDocument
*
nsdoc
;
nsIDOMNode_QueryInterface
(
nsnode
,
&
IID_nsIDOMDocument
,
(
void
**
)
&
nsdoc
);
nsIContentSerializer_AppendDocumentStart
(
serializer
,
nsdoc
,
str
);
nsIDOMDocument_Release
(
nsdoc
);
}
default:
FIXME
(
"Unhandled type %u
\n
"
,
type
);
}
if
(
has_children
)
{
PRUint32
child_cnt
,
i
;
nsIDOMNode
*
child_node
;
nsIDOMNode_GetChildNodes
(
nsnode
,
&
node_list
);
nsIDOMNodeList_GetLength
(
node_list
,
&
child_cnt
);
for
(
i
=
0
;
i
<
child_cnt
;
i
++
)
{
nsres
=
nsIDOMNodeList_Item
(
node_list
,
i
,
&
child_node
);
if
(
NS_SUCCEEDED
(
nsres
))
{
nsnode_to_nsstring_rec
(
serializer
,
child_node
,
str
);
nsIDOMNode_Release
(
child_node
);
}
else
{
ERR
(
"Item failed: %08lx
\n
"
,
nsres
);
}
}
nsIDOMNodeList_Release
(
node_list
);
}
if
(
type
==
ELEMENT_NODE
)
{
nsIDOMElement
*
nselem
;
nsIDOMNode_QueryInterface
(
nsnode
,
&
IID_nsIDOMElement
,
(
void
**
)
&
nselem
);
nsIContentSerializer_AppendElementEnd
(
serializer
,
nselem
,
str
);
nsIDOMElement_Release
(
nselem
);
}
}
void
nsnode_to_nsstring
(
nsIDOMNode
*
nsdoc
,
nsAString
*
str
)
{
nsIContentSerializer
*
serializer
;
nsIDOMNode
*
nsnode
;
nsresult
nsres
;
nsres
=
nsIComponentManager_CreateInstanceByContractID
(
pCompMgr
,
NS_HTMLSERIALIZER_CONTRACTID
,
NULL
,
&
IID_nsIContentSerializer
,
(
void
**
)
&
serializer
);
if
(
NS_FAILED
(
nsres
))
{
ERR
(
"Could not get nsIContentSerializer: %08lx
\n
"
,
nsres
);
return
;
}
nsres
=
nsIContentSerializer_Init
(
serializer
,
0
,
100
,
NULL
,
FALSE
);
if
(
NS_FAILED
(
nsres
))
ERR
(
"Init failed: %08lx
\n
"
,
nsres
);
nsIDOMDocument_QueryInterface
(
nsdoc
,
&
IID_nsIDOMNode
,
(
void
**
)
&
nsnode
);
nsnode_to_nsstring_rec
(
serializer
,
nsnode
,
str
);
nsIDOMNode_Release
(
nsnode
);
nsres
=
nsIContentSerializer_Flush
(
serializer
,
str
);
if
(
NS_FAILED
(
nsres
))
ERR
(
"Flush failed: %08lx
\n
"
,
nsres
);
nsIContentSerializer_Release
(
serializer
);
}
void
close_gecko
()
{
TRACE
(
"()
\n
"
);
...
...
dlls/mshtml/nsiface.idl
View file @
1a4c366f
...
...
@@ -100,7 +100,6 @@ typedef nsISupports nsIDOMAttr;
typedef nsISupports nsIDOMDocumentType;
typedef nsISupports nsIDOMDOMImplementation;
typedef nsISupports nsIDOMDocumentFragment;
typedef nsISupports nsIDOMText;
typedef nsISupports nsIDOMComment;
typedef nsISupports nsIDOMCDATASection;
typedef nsISupports nsIDOMProcessingInstruction;
...
...
@@ -110,6 +109,7 @@ typedef nsISupports nsIDOMHTMLOptionsCollection;
typedef nsISupports nsIDOMHTMLCollection;
typedef nsISupports nsIDOMRange;
typedef nsISupports nsIEditor;
typedef nsISupports nsIWebProgressListener;
[
object,
...
...
@@ -391,6 +391,21 @@ interface nsIDOMNodeList : nsISupports
]
interface nsIDOMNode : nsISupports
{
enum NSNODETYPE {
ELEMENT_NODE = 1,
ATTRIBUTE_NODE = 2,
TEXT_NODE = 3,
CDATA_SELECTION_NODE = 4,
ENTITY_REFERENCE_NODE = 5,
ENTITY_NODE = 6,
PROCESSING_INSTRUCTION_NODE = 7,
COMMENT_NODE = 8,
DOCUMENT_NODE = 9,
DOCUMENT_TYPE_NODE = 10,
DOCUMENT_FRAGMENT_NODE = 11,
NOTATION_NODE = 12
};
nsresult GetNodeName(nsAString *aNodeName);
nsresult GetNodeValue(nsAString *aNodeValue);
nsresult SetNodeValue(const nsAString *aNodeValue);
...
...
@@ -493,6 +508,31 @@ interface nsIDOMNSHTMLElement : nsISupports
[
object,
uuid(a6cf9072-15b3-11d2-932e-00805f8add32)
]
interface nsIDOMCharacterData : nsIDOMNode
{
nsresult GetData(nsAString *aData);
nsresult SetData(const nsAString *aData);
nsresult GetLength(PRUint32 *aLength);
nsresult SubstringData(PRUint32 offset, PRUint32 count, nsAString *_retval);
nsresult AppendData(const nsAString *arg);
nsresult InsertData(PRUint32 offset, const nsAString *arg);
nsresult DeleteData(PRUint32 offset, PRUint32 count);
nsresult ReplaceData(PRUint32 offset, PRUint32 count, const nsAString *arg);
}
[
object,
uuid(a6cf9082-15b3-11d2-932e-00805f8add32)
]
interface nsIDOMText : nsIDOMCharacterData
{
nsresult SplitText(PRUint32 offset, nsIDOMText **_retval);
}
[
object,
uuid(a6cf9075-15b3-11d2-932e-00805f8add32)
]
interface nsIDOMDocument : nsIDOMNode
...
...
@@ -1216,6 +1256,27 @@ interface nsICommandManager : nsISupports
nsIDOMWindow *aTargetWindow);
}
[
object,
uuid(d650439a-ca29-410d-a906-b0557fb62fcd)
]
interface nsIContentSerializer : nsISupports
{
nsresult Init(PRUint32 flags, PRUint32 aWrapColumn, const char* aCharSet, PRBool aIsCopying);
nsresult AppendText(nsIDOMText *aText, PRInt32 aStartOffset, PRInt32 aEndOffset, nsAString *aStr);
nsresult AppendCDATASection(nsIDOMCDATASection *aCDATASection, PRInt32 aStartOffset,
PRInt32 aEndOffset, nsAString *aStr);
nsresult AppendProcessingInstruction(nsIDOMProcessingInstruction* aPI, PRInt32 aStartOffset,
PRInt32 aEndOffset, nsAString *aStr);
nsresult AppendComment(nsIDOMComment *aComment, PRInt32 aStartOffset, PRInt32 aEndOffset,
nsAString *aStr);
nsresult AppendDoctype(nsIDOMDocumentType *aDoctype, nsAString *aStr);
nsresult AppendElementStart(nsIDOMElement *aElement, PRBool aHasChildren, nsAString *aStr);
nsresult AppendElementEnd(nsIDOMElement *aElement, nsAString *aStr);
nsresult Flush(nsAString *aStr);
nsresult AppendDocumentStart(nsIDOMDocument *aDocument, nsAString *aStr);
}
/*
* NOTE:
* This is a private Wine interface that is implemented by our implementation
...
...
dlls/mshtml/persist.c
View file @
1a4c366f
...
...
@@ -464,8 +464,54 @@ static HRESULT WINAPI PersistStreamInit_Save(IPersistStreamInit *iface, LPSTREAM
BOOL
fClearDirty
)
{
HTMLDocument
*
This
=
PERSTRINIT_THIS
(
iface
);
FIXME
(
"(%p)->(%p %x)
\n
"
,
This
,
pStm
,
fClearDirty
);
return
E_NOTIMPL
;
nsIDOMDocument
*
nsdoc
;
nsIDOMNode
*
nsnode
;
nsAString
nsstr
;
LPCWSTR
strw
;
char
*
str
;
DWORD
len
,
written
=
0
;
nsresult
nsres
;
HRESULT
hres
;
WARN
(
"(%p)->(%p %x) needs more work
\n
"
,
This
,
pStm
,
fClearDirty
);
if
(
!
This
->
nscontainer
)
return
S_OK
;
nsres
=
nsIWebNavigation_GetDocument
(
This
->
nscontainer
->
navigation
,
&
nsdoc
);
if
(
NS_FAILED
(
nsres
))
{
ERR
(
"GetDocument failed: %08lx
\n
"
,
nsres
);
return
E_FAIL
;
}
nsres
=
nsIDOMDocument_QueryInterface
(
nsdoc
,
&
IID_nsIDOMNode
,
(
void
**
)
&
nsnode
);
nsIDOMDocument_Release
(
nsdoc
);
if
(
NS_FAILED
(
nsres
))
{
ERR
(
"Could not get nsIDOMNode failed: %08lx
\n
"
,
nsres
);
return
E_FAIL
;
}
nsAString_Init
(
&
nsstr
,
NULL
);
nsnode_to_nsstring
(
nsnode
,
&
nsstr
);
nsIDOMNode_Release
(
nsnode
);
nsAString_GetData
(
&
nsstr
,
&
strw
,
NULL
);
len
=
WideCharToMultiByte
(
CP_ACP
,
0
,
strw
,
-
1
,
NULL
,
0
,
NULL
,
NULL
);
str
=
mshtml_alloc
(
len
);
WideCharToMultiByte
(
CP_ACP
,
0
,
strw
,
-
1
,
str
,
len
,
NULL
,
NULL
);
nsAString_Finish
(
&
nsstr
);
ERR
(
"%s
\n
"
,
debugstr_a
(
str
));
hres
=
IStream_Write
(
pStm
,
str
,
len
,
&
written
);
if
(
FAILED
(
hres
))
FIXME
(
"Write failed: %08lx
\n
"
,
hres
);
mshtml_free
(
str
);
return
S_OK
;
}
static
HRESULT
WINAPI
PersistStreamInit_GetSizeMax
(
IPersistStreamInit
*
iface
,
...
...
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