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
489b0f50
Commit
489b0f50
authored
Jul 05, 2006
by
Jacek Caban
Committed by
Alexandre Julliard
Jul 06, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
mshtml: Added get_selection implementation.
parent
6e7e6efe
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
240 additions
and
4 deletions
+240
-4
Makefile.in
dlls/mshtml/Makefile.in
+1
-0
htmldoc.c
dlls/mshtml/htmldoc.c
+17
-2
mshtml_private.h
dlls/mshtml/mshtml_private.h
+1
-0
nsiface.idl
dlls/mshtml/nsiface.idl
+29
-2
selection.c
dlls/mshtml/selection.c
+192
-0
No files found.
dlls/mshtml/Makefile.in
View file @
489b0f50
...
...
@@ -33,6 +33,7 @@ C_SRCS = \
olewnd.c
\
persist.c
\
protocol.c
\
selection.c
\
service.c
\
view.c
...
...
dlls/mshtml/htmldoc.c
View file @
489b0f50
...
...
@@ -326,8 +326,23 @@ static HRESULT WINAPI HTMLDocument_get_designMode(IHTMLDocument2 *iface, BSTR *p
static
HRESULT
WINAPI
HTMLDocument_get_selection
(
IHTMLDocument2
*
iface
,
IHTMLSelectionObject
**
p
)
{
FIXME
(
"(%p)->(%p)
\n
"
,
iface
,
p
);
return
E_NOTIMPL
;
HTMLDocument
*
This
=
HTMLDOC_THIS
(
iface
);
nsISelection
*
nsselection
=
NULL
;
TRACE
(
"(%p)->(%p)
\n
"
,
This
,
p
);
if
(
This
->
nscontainer
)
{
nsIDOMWindow
*
dom_window
=
NULL
;
nsIWebBrowser_GetContentDOMWindow
(
This
->
nscontainer
->
webbrowser
,
&
dom_window
);
if
(
dom_window
)
{
nsIDOMWindow_GetSelection
(
dom_window
,
&
nsselection
);
nsIDOMWindow_Release
(
dom_window
);
}
}
*
p
=
HTMLSelectionObject_Create
(
nsselection
);
return
S_OK
;
}
static
HRESULT
WINAPI
HTMLDocument_get_readyState
(
IHTMLDocument2
*
iface
,
BSTR
*
p
)
...
...
dlls/mshtml/mshtml_private.h
View file @
489b0f50
...
...
@@ -305,6 +305,7 @@ BSCallback *create_bscallback(HTMLDocument*,LPCOLESTR);
HRESULT
start_binding
(
BSCallback
*
,
IMoniker
*
);
IHlink
*
Hlink_Create
(
void
);
IHTMLSelectionObject
*
HTMLSelectionObject_Create
(
nsISelection
*
);
void
HTMLElement_Create
(
HTMLDOMNode
*
);
void
HTMLBodyElement_Create
(
HTMLElement
*
);
...
...
dlls/mshtml/nsiface.idl
View file @
489b0f50
/*
*
Copyright
2005
Jacek
Caban
*
Copyright
2005
-
2006
Jacek
Caban
for
CodeWeavers
*
*
This
library
is
free
software
; you can redistribute it and/or
*
modify
it
under
the
terms
of
the
GNU
Lesser
General
Public
...
...
@@ -90,7 +90,6 @@ typedef nsISupports nsIDOMAbstractView;
typedef nsISupports nsIHttpHeaderVisitor;
typedef nsISupports nsIDOMBarProp;
typedef nsISupports nsIDOMWindowCollection;
typedef nsISupports nsISelection;
typedef nsISupports nsIPrompt;
typedef nsISupports nsIAuthPrompt;
typedef nsISupports nsIDOMNamedNodeMap;
...
...
@@ -106,6 +105,7 @@ typedef nsISupports nsIDOMEntityReference;
typedef nsISupports nsIDOMHTMLFormElement;
typedef nsISupports nsIDOMHTMLOptionsCollection;
typedef nsISupports nsIDOMHTMLCollection;
typedef nsISupports nsIDOMRange;
[
object,
...
...
@@ -521,6 +521,33 @@ interface nsIDOMHTMLDocument : nsIDOMDocument
[
object,
uuid(b2c7ed59-8634-4352-9e37-5484c8b6e4e1)
]
interface nsISelection : nsISupports
{
nsresult GetAnchorNode(nsIDOMNode **aAnchorNode);
nsresult GetAnchorOffset(PRInt32 *aAnchorOffset);
nsresult GetFocusNode(nsIDOMNode **aFocusNode);
nsresult GetFocusOffset(PRInt32 *aFocusOffset);
nsresult GetIsCollapsed(PRBool *aIsCollapsed);
nsresult GetRangeCount(PRInt32 *aRangeCount);
nsresult GetRangeAt(PRInt32 index, nsIDOMRange **_retval);
nsresult Collapse(nsIDOMNode *parentNode, PRInt32 offset);
nsresult Extend(nsIDOMNode *parentNode, PRInt32 offset);
nsresult CollapseToStart();
nsresult CollapseToEnd();
nsresult ContainsNode(nsIDOMNode *node, PRBool entirelyContained, PRBool *_retval);
nsresult SelectAllChildren(nsIDOMNode *parentNode);
nsresult AddRange(nsIDOMRange *range);
nsresult RemoveRange(nsIDOMRange *range);
nsresult RemoveAllRanges();
nsresult DeleteFromDocument();
nsresult SelectionLanguageChange(PRBool langRTL);
nsresult ToString(PRUnichar **_retval);
}
[
object,
uuid(a6cf906b-15b3-11d2-932e-00805f8add32)
]
interface nsIDOMWindow : nsISupports
...
...
dlls/mshtml/selection.c
0 → 100644
View file @
489b0f50
/*
* Copyright 2006 Jacek Caban for CodeWeavers
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
*/
#include "config.h"
#include <stdarg.h>
#include <stdio.h>
#define COBJMACROS
#include "windef.h"
#include "winbase.h"
#include "winuser.h"
#include "winnls.h"
#include "ole2.h"
#include "wine/debug.h"
#include "wine/unicode.h"
#include "mshtml_private.h"
WINE_DEFAULT_DEBUG_CHANNEL
(
mshtml
);
typedef
struct
{
const
IHTMLSelectionObjectVtbl
*
lpHTMLSelectionObjectVtbl
;
LONG
ref
;
nsISelection
*
nsselection
;
}
HTMLSelectionObject
;
#define HTMLSELOBJ(x) ((IHTMLSelectionObject*) &(x)->lpHTMLSelectionObjectVtbl)
#define HTMLSELOBJ_THIS(iface) DEFINE_THIS(HTMLSelectionObject, HTMLSelectionObject, iface)
static
HRESULT
WINAPI
HTMLSelectionObject_QueryInterface
(
IHTMLSelectionObject
*
iface
,
REFIID
riid
,
void
**
ppv
)
{
HTMLSelectionObject
*
This
=
HTMLSELOBJ_THIS
(
iface
);
*
ppv
=
NULL
;
if
(
IsEqualGUID
(
&
IID_IUnknown
,
riid
))
{
TRACE
(
"(%p)->(IID_IUnknown %p)
\n
"
,
This
,
ppv
);
*
ppv
=
HTMLSELOBJ
(
This
);
}
else
if
(
IsEqualGUID
(
&
IID_IDispatch
,
riid
))
{
TRACE
(
"(%p)->(IID_IUnknown %p)
\n
"
,
This
,
ppv
);
*
ppv
=
HTMLSELOBJ
(
This
);
}
else
if
(
IsEqualGUID
(
&
IID_IHTMLSelectionObject
,
riid
))
{
TRACE
(
"(%p)->(IID_IUnknown %p)
\n
"
,
This
,
ppv
);
*
ppv
=
HTMLSELOBJ
(
This
);
}
if
(
*
ppv
)
{
IUnknown_AddRef
((
IUnknown
*
)
*
ppv
);
return
S_OK
;
}
WARN
(
"(%p)->(%s %p)
\n
"
,
This
,
debugstr_guid
(
riid
),
ppv
);
return
E_NOINTERFACE
;
}
static
ULONG
WINAPI
HTMLSelectionObject_AddRef
(
IHTMLSelectionObject
*
iface
)
{
HTMLSelectionObject
*
This
=
HTMLSELOBJ_THIS
(
iface
);
LONG
ref
=
InterlockedIncrement
(
&
This
->
ref
);
TRACE
(
"(%p) ref=%ld
\n
"
,
This
,
ref
);
return
ref
;
}
static
ULONG
WINAPI
HTMLSelectionObject_Release
(
IHTMLSelectionObject
*
iface
)
{
HTMLSelectionObject
*
This
=
HTMLSELOBJ_THIS
(
iface
);
LONG
ref
=
InterlockedDecrement
(
&
This
->
ref
);
TRACE
(
"(%p) ref=%ld
\n
"
,
This
,
ref
);
if
(
!
ref
)
{
if
(
This
->
nsselection
)
nsISelection_Release
(
This
->
nsselection
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
}
return
ref
;
}
static
HRESULT
WINAPI
HTMLSelectionObject_GetTypeInfoCount
(
IHTMLSelectionObject
*
iface
,
UINT
*
pctinfo
)
{
HTMLSelectionObject
*
This
=
HTMLSELOBJ_THIS
(
iface
);
FIXME
(
"(%p)->(%p)
\n
"
,
This
,
pctinfo
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
HTMLSelectionObject_GetTypeInfo
(
IHTMLSelectionObject
*
iface
,
UINT
iTInfo
,
LCID
lcid
,
ITypeInfo
**
ppTInfo
)
{
HTMLSelectionObject
*
This
=
HTMLSELOBJ_THIS
(
iface
);
FIXME
(
"(%p)->(%u %lu %p)
\n
"
,
This
,
iTInfo
,
lcid
,
ppTInfo
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
HTMLSelectionObject_GetIDsOfNames
(
IHTMLSelectionObject
*
iface
,
REFIID
riid
,
LPOLESTR
*
rgszNames
,
UINT
cNames
,
LCID
lcid
,
DISPID
*
rgDispId
)
{
HTMLSelectionObject
*
This
=
HTMLSELOBJ_THIS
(
iface
);
FIXME
(
"(%p)->(%s %p %u %lu %p)
\n
"
,
This
,
debugstr_guid
(
riid
),
rgszNames
,
cNames
,
lcid
,
rgDispId
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
HTMLSelectionObject_Invoke
(
IHTMLSelectionObject
*
iface
,
DISPID
dispIdMember
,
REFIID
riid
,
LCID
lcid
,
WORD
wFlags
,
DISPPARAMS
*
pDispParams
,
VARIANT
*
pVarResult
,
EXCEPINFO
*
pExcepInfo
,
UINT
*
puArgErr
)
{
HTMLSelectionObject
*
This
=
HTMLSELOBJ_THIS
(
iface
);
FIXME
(
"(%p)->(%ld %s %ld %d %p %p %p %p)
\n
"
,
This
,
dispIdMember
,
debugstr_guid
(
riid
),
lcid
,
wFlags
,
pDispParams
,
pVarResult
,
pExcepInfo
,
puArgErr
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
HTMLSelectionObject_createRange
(
IHTMLSelectionObject
*
iface
,
IDispatch
**
range
)
{
HTMLSelectionObject
*
This
=
HTMLSELOBJ_THIS
(
iface
);
FIXME
(
"(%p)->(%p)
\n
"
,
This
,
range
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
HTMLSelectionObject_empty
(
IHTMLSelectionObject
*
iface
)
{
HTMLSelectionObject
*
This
=
HTMLSELOBJ_THIS
(
iface
);
FIXME
(
"(%p)
\n
"
,
This
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
HTMLSelectionObject_clear
(
IHTMLSelectionObject
*
iface
)
{
HTMLSelectionObject
*
This
=
HTMLSELOBJ_THIS
(
iface
);
FIXME
(
"(%p)
\n
"
,
This
);
return
E_NOTIMPL
;
}
static
HRESULT
WINAPI
HTMLSelectionObject_get_type
(
IHTMLSelectionObject
*
iface
,
BSTR
*
p
)
{
HTMLSelectionObject
*
This
=
HTMLSELOBJ_THIS
(
iface
);
FIXME
(
"(%p)->(%p)
\n
"
,
This
,
p
);
return
E_NOTIMPL
;
}
#undef HTMLSELOBJ_THIS
static
const
IHTMLSelectionObjectVtbl
HTMLSelectionObjectVtbl
=
{
HTMLSelectionObject_QueryInterface
,
HTMLSelectionObject_AddRef
,
HTMLSelectionObject_Release
,
HTMLSelectionObject_GetTypeInfoCount
,
HTMLSelectionObject_GetTypeInfo
,
HTMLSelectionObject_GetIDsOfNames
,
HTMLSelectionObject_Invoke
,
HTMLSelectionObject_createRange
,
HTMLSelectionObject_empty
,
HTMLSelectionObject_clear
,
HTMLSelectionObject_get_type
};
IHTMLSelectionObject
*
HTMLSelectionObject_Create
(
nsISelection
*
nsselection
)
{
HTMLSelectionObject
*
ret
=
HeapAlloc
(
GetProcessHeap
(),
0
,
sizeof
(
HTMLSelectionObject
));
ret
->
lpHTMLSelectionObjectVtbl
=
&
HTMLSelectionObjectVtbl
;
ret
->
ref
=
1
;
ret
->
nsselection
=
nsselection
;
/* We shouldn't call AddRef here */
return
HTMLSELOBJ
(
ret
);
}
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