mirror of
https://github.com/ApfelTeeSaft/reactos.git
synced 2026-09-02 04:13:34 +00:00
sync mshtml and shdocvw to wine 1.1.14
svn path=/trunk/; revision=39389
This commit is contained in:
@@ -278,5 +278,7 @@ HKCU, "Control Panel\Desktop\WindowMetrics","StatusFont",0x00000001,f5,ff,ff,ff,
|
||||
HKCU,"Software\Microsoft\Internet Explorer\Main","Start Page",,"http://www.reactos.org"
|
||||
HKCU,"Software\Microsoft\Internet Explorer\Main","Search Page",,"http://www.google.com"
|
||||
|
||||
HKCU,Software\Wine\MSHTML,"GeckoUrl",,"http://links.reactos.org/links/winegecko.php"
|
||||
|
||||
|
||||
; EOF
|
||||
|
||||
@@ -47,10 +47,10 @@ STYLE DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Hyperlink"
|
||||
FONT 8, "MS Shell Dlg"
|
||||
{
|
||||
GROUPBOX "Information om Hyperlink'en", IDC_STATIC, 5, 5, 190, 55
|
||||
LTEXT "&Type:", IDC_STATIC, 10, 22, 20, 10
|
||||
GROUPBOX "Information om Hyperlink'en", -1, 5, 5, 190, 55
|
||||
LTEXT "&Type:", -1, 10, 22, 20, 10
|
||||
COMBOBOX IDC_TYPE, 35, 20, 45, 100, WS_TABSTOP | WS_GROUP | WS_VSCROLL | CBS_DROPDOWNLIST | CBS_HASSTRINGS
|
||||
LTEXT "&URL:", IDC_STATIC, 10, 42, 20, 10
|
||||
LTEXT "&URL:", -1, 10, 42, 20, 10
|
||||
EDITTEXT IDC_URL, 35, 40, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_GROUP | WS_TABSTOP
|
||||
PUSHBUTTON "OK", IDOK, 200, 10, 45, 14, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP
|
||||
PUSHBUTTON "Annuller", IDCANCEL, 200, 28, 45, 14, WS_GROUP | WS_TABSTOP
|
||||
|
||||
@@ -48,10 +48,10 @@ STYLE DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Hyperlink"
|
||||
FONT 8, "MS Shell Dlg"
|
||||
{
|
||||
GROUPBOX "Hyperlink Informationen", IDC_STATIC, 5, 5, 190, 55
|
||||
LTEXT "&Typ:", IDC_STATIC, 10, 22, 20, 10
|
||||
GROUPBOX "Hyperlink Informationen", -1, 5, 5, 190, 55
|
||||
LTEXT "&Typ:", -1, 10, 22, 20, 10
|
||||
COMBOBOX IDC_TYPE, 35, 20, 45, 100, WS_TABSTOP | WS_GROUP | WS_VSCROLL | CBS_DROPDOWNLIST | CBS_HASSTRINGS
|
||||
LTEXT "&URL:", IDC_STATIC, 10, 42, 20, 10
|
||||
LTEXT "&URL:", -1, 10, 42, 20, 10
|
||||
EDITTEXT IDC_URL, 35, 40, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_GROUP | WS_TABSTOP
|
||||
PUSHBUTTON "OK", IDOK, 200, 10, 45, 14, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP
|
||||
PUSHBUTTON "Abbrechen", IDCANCEL, 200, 28, 45, 14, WS_GROUP | WS_TABSTOP
|
||||
|
||||
@@ -45,10 +45,10 @@ STYLE DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Hyperlink"
|
||||
FONT 8, "MS Shell Dlg"
|
||||
{
|
||||
GROUPBOX "Hyperlink Information", IDC_STATIC, 5, 5, 190, 55
|
||||
LTEXT "&Type:", IDC_STATIC, 10, 22, 20, 10
|
||||
GROUPBOX "Hyperlink Information", -1, 5, 5, 190, 55
|
||||
LTEXT "&Type:", -1, 10, 22, 20, 10
|
||||
COMBOBOX IDC_TYPE, 35, 20, 45, 100, WS_TABSTOP | WS_GROUP | WS_VSCROLL | CBS_DROPDOWNLIST | CBS_HASSTRINGS
|
||||
LTEXT "&URL:", IDC_STATIC, 10, 42, 20, 10
|
||||
LTEXT "&URL:", -1, 10, 42, 20, 10
|
||||
EDITTEXT IDC_URL, 35, 40, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_GROUP | WS_TABSTOP
|
||||
PUSHBUTTON "OK", IDOK, 200, 10, 45, 14, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP
|
||||
PUSHBUTTON "Cancel", IDCANCEL, 200, 28, 45, 14, WS_GROUP | WS_TABSTOP
|
||||
|
||||
@@ -47,10 +47,10 @@ STYLE DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Enlace"
|
||||
FONT 8, "MS Shell Dlg"
|
||||
{
|
||||
GROUPBOX "Información sobre el enlace", IDC_STATIC, 5, 5, 190, 55
|
||||
LTEXT "&Tipo :", IDC_STATIC, 10, 22, 20, 10
|
||||
GROUPBOX "Información sobre el enlace", -1, 5, 5, 190, 55
|
||||
LTEXT "&Tipo :", -1, 10, 22, 20, 10
|
||||
COMBOBOX IDC_TYPE, 35, 20, 45, 100, WS_TABSTOP | WS_GROUP | WS_VSCROLL | CBS_DROPDOWNLIST | CBS_HASSTRINGS
|
||||
LTEXT "&URL :", IDC_STATIC, 10, 42, 20, 10
|
||||
LTEXT "&URL :", -1, 10, 42, 20, 10
|
||||
EDITTEXT IDC_URL, 35, 40, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_GROUP | WS_TABSTOP
|
||||
PUSHBUTTON "Aceptar", IDOK, 200, 10, 45, 14, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP
|
||||
PUSHBUTTON "Anular", IDCANCEL, 200, 28, 45, 14, WS_GROUP | WS_TABSTOP
|
||||
|
||||
@@ -48,10 +48,10 @@ STYLE DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Hyperlien"
|
||||
FONT 8, "MS Shell Dlg"
|
||||
{
|
||||
GROUPBOX "Informations sur l'hyperlien", IDC_STATIC, 5, 5, 190, 55
|
||||
LTEXT "&Type :", IDC_STATIC, 10, 22, 20, 10
|
||||
GROUPBOX "Informations sur l'hyperlien", -1, 5, 5, 190, 55
|
||||
LTEXT "&Type :", -1, 10, 22, 20, 10
|
||||
COMBOBOX IDC_TYPE, 35, 20, 45, 100, WS_TABSTOP | WS_GROUP | WS_VSCROLL | CBS_DROPDOWNLIST | CBS_HASSTRINGS
|
||||
LTEXT "&URL :", IDC_STATIC, 10, 42, 20, 10
|
||||
LTEXT "&URL :", -1, 10, 42, 20, 10
|
||||
EDITTEXT IDC_URL, 35, 40, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_GROUP | WS_TABSTOP
|
||||
PUSHBUTTON "OK", IDOK, 200, 10, 45, 14, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP
|
||||
PUSHBUTTON "Annuler", IDCANCEL, 200, 28, 45, 14, WS_GROUP | WS_TABSTOP
|
||||
|
||||
@@ -0,0 +1,59 @@
|
||||
/*
|
||||
* Copyright 2005-2006 Jacek Caban
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
/* UTF-8 */
|
||||
#pragma code_page(65001)
|
||||
|
||||
LANGUAGE LANG_JAPANESE, SUBLANG_DEFAULT
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
{
|
||||
IDS_HTMLDISABLED "HTML レンダリングは現在、無効です。"
|
||||
IDS_HTMLDOCUMENT "HTML 文書"
|
||||
IDS_DOWNLOADING "ダウンロードしています..."
|
||||
IDS_INSTALLING "インストールしています..."
|
||||
}
|
||||
|
||||
ID_DWL_DIALOG DIALOG LOADONCALL MOVEABLE DISCARDABLE 0, 0, 260, 85
|
||||
STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Wine Gecko インストーラ"
|
||||
FONT 9, "MS Shell Dlg"
|
||||
{
|
||||
LTEXT "このアプリケーションは HTML ページを表示しようとしています。ページを表示するには Wine に" \
|
||||
"Gecko(Mozilla の HTML エンジン)をインストールする必要があります。Wine が自動的に Gecko をダウンロードしインストールするようにしたいならば" \
|
||||
" [インストール] をクリックしてください。", ID_DWL_STATUS, 10, 10, 240, 30, SS_LEFT
|
||||
CONTROL "Progress", ID_DWL_PROGRESS, PROGRESS_CLASSA, WS_BORDER|PBS_SMOOTH, 10, 40, 240, 12
|
||||
DEFPUSHBUTTON "インストール(&I)", ID_DWL_INSTALL, 200, 60, 50, 15, WS_GROUP | WS_TABSTOP
|
||||
PUSHBUTTON "キャンセル(&C)", IDCANCEL, 140, 60, 50, 15, WS_GROUP | WS_TABSTOP
|
||||
}
|
||||
|
||||
IDD_HYPERLINK DIALOG LOADONCALL MOVEABLE DISCARDABLE 0, 0, 250, 65
|
||||
STYLE DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "ハイパーリンク"
|
||||
FONT 9, "MS Shell Dlg"
|
||||
{
|
||||
GROUPBOX "ハイパーリンクの情報", -1, 5, 5, 190, 55
|
||||
LTEXT "種類(&T):", -1, 10, 22, 20, 10
|
||||
COMBOBOX IDC_TYPE, 35, 20, 45, 100, WS_TABSTOP | WS_GROUP | WS_VSCROLL | CBS_DROPDOWNLIST | CBS_HASSTRINGS
|
||||
LTEXT "&URL:", -1, 10, 42, 20, 10
|
||||
EDITTEXT IDC_URL, 35, 40, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_GROUP | WS_TABSTOP
|
||||
PUSHBUTTON "OK", IDOK, 200, 10, 45, 14, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP
|
||||
PUSHBUTTON "キャンセル", IDCANCEL, 200, 28, 45, 14, WS_GROUP | WS_TABSTOP
|
||||
}
|
||||
|
||||
#pragma code_page(default)
|
||||
@@ -18,7 +18,7 @@
|
||||
*/
|
||||
|
||||
|
||||
LANGUAGE LANG_KOREAN, SUBLANG_NEUTRAL
|
||||
LANGUAGE LANG_KOREAN, SUBLANG_DEFAULT
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
{
|
||||
@@ -31,7 +31,7 @@ STRINGTABLE DISCARDABLE
|
||||
ID_DWL_DIALOG DIALOG LOADONCALL MOVEABLE DISCARDABLE 0, 0, 260, 85
|
||||
STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Wine Gecko 설치 풀그림"
|
||||
FONT 8, "MS Shell Dlg"
|
||||
FONT 9, "MS Shell Dlg"
|
||||
{
|
||||
LTEXT "이 어플리케이션은 HTML 페이지를 보여주려고 합니다. Wine은 이 페이지를 보여주기 위해를 " \
|
||||
"Gecko (Mozilla HTML 엔진)를 설치할 것입니다. Wine이 자동으로 Gecko를 다운로드하고 설치하기를 원한다면 " \
|
||||
@@ -44,12 +44,12 @@ FONT 8, "MS Shell Dlg"
|
||||
IDD_HYPERLINK DIALOG LOADONCALL MOVEABLE DISCARDABLE 0, 0, 250, 65
|
||||
STYLE DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "하이퍼링크"
|
||||
FONT 8, "MS Shell Dlg"
|
||||
FONT 9, "MS Shell Dlg"
|
||||
{
|
||||
GROUPBOX "하이퍼링크 정보", IDC_STATIC, 5, 5, 190, 55
|
||||
LTEXT "형식(&T):", IDC_STATIC, 10, 22, 24, 10
|
||||
GROUPBOX "하이퍼링크 정보", -1, 5, 5, 190, 55
|
||||
LTEXT "형식(&T):", -1, 10, 22, 24, 10
|
||||
COMBOBOX IDC_TYPE, 35, 20, 45, 100, WS_TABSTOP | WS_GROUP | WS_VSCROLL | CBS_DROPDOWNLIST | CBS_HASSTRINGS
|
||||
LTEXT "주소(&U):", IDC_STATIC, 10, 42, 24, 10
|
||||
LTEXT "주소(&U):", -1, 10, 42, 24, 10
|
||||
EDITTEXT IDC_URL, 35, 40, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_GROUP | WS_TABSTOP
|
||||
PUSHBUTTON "확인", IDOK, 200, 10, 45, 14, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP
|
||||
PUSHBUTTON "취소", IDCANCEL, 200, 28, 45, 14, WS_GROUP | WS_TABSTOP
|
||||
|
||||
@@ -48,10 +48,10 @@ STYLE DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Webverwijzing"
|
||||
FONT 8, "MS Shell Dlg"
|
||||
{
|
||||
GROUPBOX "Webverwijzing Informatie", IDC_STATIC, 5, 5, 190, 55
|
||||
LTEXT "&Type:", IDC_STATIC, 10, 22, 20, 10
|
||||
GROUPBOX "Webverwijzing Informatie", -1, 5, 5, 190, 55
|
||||
LTEXT "&Type:", -1, 10, 22, 20, 10
|
||||
COMBOBOX IDC_TYPE, 35, 20, 45, 100, WS_TABSTOP | WS_GROUP | WS_VSCROLL | CBS_DROPDOWNLIST | CBS_HASSTRINGS
|
||||
LTEXT "&URL:", IDC_STATIC, 10, 42, 20, 10
|
||||
LTEXT "&URL:", -1, 10, 42, 20, 10
|
||||
EDITTEXT IDC_URL, 35, 40, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_GROUP | WS_TABSTOP
|
||||
PUSHBUTTON "OK", IDOK, 200, 10, 45, 14, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP
|
||||
PUSHBUTTON "Annuleren", IDCANCEL, 200, 28, 45, 14, WS_GROUP | WS_TABSTOP
|
||||
|
||||
@@ -47,10 +47,10 @@ STYLE DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Hyperkobling"
|
||||
FONT 8, "MS Shell Dlg"
|
||||
{
|
||||
GROUPBOX "Informasjon om koblingen", IDC_STATIC, 5, 5, 190, 55
|
||||
LTEXT "&Type:", IDC_STATIC, 10, 22, 20, 10
|
||||
GROUPBOX "Informasjon om koblingen", -1, 5, 5, 190, 55
|
||||
LTEXT "&Type:", -1, 10, 22, 20, 10
|
||||
COMBOBOX IDC_TYPE, 35, 20, 45, 100, WS_TABSTOP | WS_GROUP | WS_VSCROLL | CBS_DROPDOWNLIST | CBS_HASSTRINGS
|
||||
LTEXT "&URL:", IDC_STATIC, 10, 42, 20, 10
|
||||
LTEXT "&URL:", -1, 10, 42, 20, 10
|
||||
EDITTEXT IDC_URL, 35, 40, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_GROUP | WS_TABSTOP
|
||||
PUSHBUTTON "OK", IDOK, 200, 10, 45, 14, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP
|
||||
PUSHBUTTON "Avbryt", IDCANCEL, 200, 28, 45, 14, WS_GROUP | WS_TABSTOP
|
||||
|
||||
@@ -46,10 +46,10 @@ STYLE DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Hiper³¹cze"
|
||||
FONT 8, "MS Shell Dlg"
|
||||
{
|
||||
GROUPBOX "W³asnoœci hiper³¹cza", IDC_STATIC, 5, 5, 190, 55
|
||||
LTEXT "&Typ:", IDC_STATIC, 10, 22, 20, 10
|
||||
GROUPBOX "W³asnoœci hiper³¹cza", -1, 5, 5, 190, 55
|
||||
LTEXT "&Typ:", -1, 10, 22, 20, 10
|
||||
COMBOBOX IDC_TYPE, 35, 20, 45, 100, WS_TABSTOP | WS_GROUP | WS_VSCROLL | CBS_DROPDOWNLIST | CBS_HASSTRINGS
|
||||
LTEXT "&URL:", IDC_STATIC, 10, 42, 20, 10
|
||||
LTEXT "&URL:", -1, 10, 42, 20, 10
|
||||
EDITTEXT IDC_URL, 35, 40, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_GROUP | WS_TABSTOP
|
||||
PUSHBUTTON "OK", IDOK, 200, 10, 45, 14, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP
|
||||
PUSHBUTTON "Anuluj", IDCANCEL, 200, 28, 45, 14, WS_GROUP | WS_TABSTOP
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
/*
|
||||
* Copyright 2008 Ricardo Filipe
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
|
||||
LANGUAGE LANG_PORTUGUESE, SUBLANG_NEUTRAL
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
{
|
||||
IDS_HTMLDISABLED "A interpretação de HTML está desactivada."
|
||||
IDS_HTMLDOCUMENT "Documento HTML"
|
||||
IDS_DOWNLOADING "Descarregando..."
|
||||
IDS_INSTALLING "Instalando..."
|
||||
}
|
||||
|
||||
ID_DWL_DIALOG DIALOG LOADONCALL MOVEABLE DISCARDABLE 0, 0, 260, 95
|
||||
STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Instalador Wine Gecko"
|
||||
FONT 8, "MS Shell Dlg"
|
||||
{
|
||||
LTEXT "Esta aplicação está a tentar mostrar uma página HTML. O Wine precisa que o Gecko " \
|
||||
"(Motor HTML Mozilla) seja instalado para mostrar a página. Clique em Instalar se deseja que o Wine " \
|
||||
"descarregue e instale o Gecko automaticamente.", ID_DWL_STATUS, 10, 10, 240, 40, SS_LEFT
|
||||
CONTROL "Progresso", ID_DWL_PROGRESS, PROGRESS_CLASSA, WS_BORDER|PBS_SMOOTH, 10, 50, 240, 12
|
||||
DEFPUSHBUTTON "&Instalar", ID_DWL_INSTALL, 200, 70, 50, 15, WS_GROUP | WS_TABSTOP
|
||||
PUSHBUTTON "&Cancelar", IDCANCEL, 140, 70, 50, 15, WS_GROUP | WS_TABSTOP
|
||||
}
|
||||
|
||||
IDD_HYPERLINK DIALOG LOADONCALL MOVEABLE DISCARDABLE 0, 0, 250, 65
|
||||
STYLE DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Hiperligação"
|
||||
FONT 8, "MS Shell Dlg"
|
||||
{
|
||||
GROUPBOX "Informação da Hiperligação", -1, 5, 5, 190, 55
|
||||
LTEXT "&Tipo:", -1, 10, 22, 20, 10
|
||||
COMBOBOX IDC_TYPE, 35, 20, 45, 100, WS_TABSTOP | WS_GROUP | WS_VSCROLL | CBS_DROPDOWNLIST | CBS_HASSTRINGS
|
||||
LTEXT "&URL:", -1, 10, 42, 20, 10
|
||||
EDITTEXT IDC_URL, 35, 40, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_GROUP | WS_TABSTOP
|
||||
PUSHBUTTON "OK", IDOK, 200, 10, 45, 14, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP
|
||||
PUSHBUTTON "Cancelar", IDCANCEL, 200, 28, 45, 14, WS_GROUP | WS_TABSTOP
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
/*
|
||||
* Copyright 2005-2006 Jacek Caban
|
||||
* Copyright 2009 Michael Stefaniuc
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
|
||||
LANGUAGE LANG_ROMANIAN, SUBLANG_NEUTRAL
|
||||
|
||||
#pragma code_page(65001)
|
||||
|
||||
STRINGTABLE DISCARDABLE
|
||||
{
|
||||
IDS_HTMLDISABLED "Afișarea de pagini HTML este în prezent dezactivată."
|
||||
IDS_HTMLDOCUMENT "Document HTML"
|
||||
IDS_DOWNLOADING "Descarc..."
|
||||
IDS_INSTALLING "Instalez..."
|
||||
}
|
||||
|
||||
ID_DWL_DIALOG DIALOG LOADONCALL MOVEABLE DISCARDABLE 0, 0, 260, 95
|
||||
STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Instalator Wine Gecko"
|
||||
FONT 8, "MS Shell Dlg"
|
||||
{
|
||||
LTEXT "Această aplicație încearcă să afișeze o pagină HTML. Wine are nevoie de Gecko (motorul de HTML Mozilla) pentru a afișa această pagină. Apăsați „Instalează” dacă doriți ca Wine să descarce și să instaleze Gecko în mod automat.", ID_DWL_STATUS, 10, 10, 240, 40, SS_LEFT
|
||||
CONTROL "Progres", ID_DWL_PROGRESS, PROGRESS_CLASSA, WS_BORDER|PBS_SMOOTH, 10, 50, 240, 12
|
||||
DEFPUSHBUTTON "&Instalează", ID_DWL_INSTALL, 200, 70, 50, 15, WS_GROUP | WS_TABSTOP
|
||||
PUSHBUTTON "&Renunță", IDCANCEL, 140, 70, 50, 15, WS_GROUP | WS_TABSTOP
|
||||
}
|
||||
|
||||
IDD_HYPERLINK DIALOG LOADONCALL MOVEABLE DISCARDABLE 0, 0, 250, 65
|
||||
STYLE DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Hiperlegătură"
|
||||
FONT 8, "MS Shell Dlg"
|
||||
{
|
||||
GROUPBOX "Informații de hiperlegătură", -1, 5, 5, 190, 55
|
||||
LTEXT "&Tip:", -1, 10, 22, 20, 10
|
||||
COMBOBOX IDC_TYPE, 35, 20, 45, 100, WS_TABSTOP | WS_GROUP | WS_VSCROLL | CBS_DROPDOWNLIST | CBS_HASSTRINGS
|
||||
LTEXT "&URL:", -1, 10, 42, 20, 10
|
||||
EDITTEXT IDC_URL, 35, 40, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_GROUP | WS_TABSTOP
|
||||
PUSHBUTTON "OK", IDOK, 200, 10, 45, 14, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP
|
||||
PUSHBUTTON "Renunță", IDCANCEL, 200, 28, 45, 14, WS_GROUP | WS_TABSTOP
|
||||
}
|
||||
|
||||
#pragma code_page(default)
|
||||
@@ -45,10 +45,10 @@ STYLE DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Ññûëêà"
|
||||
FONT 8, "MS Shell Dlg"
|
||||
{
|
||||
GROUPBOX "Èíôîðìàöèÿ î ññûëêå", IDC_STATIC, 5, 5, 190, 55
|
||||
LTEXT "&Òèï:", IDC_STATIC, 10, 22, 20, 10
|
||||
GROUPBOX "Èíôîðìàöèÿ î ññûëêå", -1, 5, 5, 190, 55
|
||||
LTEXT "&Òèï:", -1, 10, 22, 20, 10
|
||||
COMBOBOX IDC_TYPE, 35, 20, 45, 100, WS_TABSTOP | WS_GROUP | WS_VSCROLL | CBS_DROPDOWNLIST | CBS_HASSTRINGS
|
||||
LTEXT "&Àäðåñ:", IDC_STATIC, 10, 42, 20, 10
|
||||
LTEXT "&Àäðåñ:", -1, 10, 42, 20, 10
|
||||
EDITTEXT IDC_URL, 35, 40, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_GROUP | WS_TABSTOP
|
||||
PUSHBUTTON "OK", IDOK, 200, 10, 45, 14, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP
|
||||
PUSHBUTTON "Îòìåíà", IDCANCEL, 200, 28, 45, 14, WS_GROUP | WS_TABSTOP
|
||||
|
||||
@@ -28,18 +28,18 @@ STRINGTABLE DISCARDABLE
|
||||
IDS_INSTALLING "Nameščam ..."
|
||||
}
|
||||
|
||||
ID_DWL_DIALOG DIALOG LOADONCALL MOVEABLE DISCARDABLE 0, 0, 260, 85
|
||||
ID_DWL_DIALOG DIALOG LOADONCALL MOVEABLE DISCARDABLE 0, 0, 260, 95
|
||||
STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Namestitev Wine Gecko"
|
||||
FONT 8, "MS Shell Dlg"
|
||||
{
|
||||
LTEXT "Ta program poskuša prikazati HTML stran. Wine za prikaz spletnih strani " \
|
||||
"potrebuje Gecko (Mozillin HTML prikazovalnik). Kliknite Namesti, če" \
|
||||
"želite, da Wine samodejno naloži in namesti Gecko (potrebna je povezava" \
|
||||
"z internetom).", ID_DWL_STATUS, 10, 10, 240, 30, SS_LEFT
|
||||
CONTROL "Napredek", ID_DWL_PROGRESS, PROGRESS_CLASSA, WS_BORDER|PBS_SMOOTH, 10, 40, 240, 12
|
||||
DEFPUSHBUTTON "&Namesti", ID_DWL_INSTALL, 200, 60, 50, 15, WS_GROUP | WS_TABSTOP
|
||||
PUSHBUTTON "&Prekliči", IDCANCEL, 140, 60, 50, 15, WS_GROUP | WS_TABSTOP
|
||||
"potrebuje Gecko (Mozillin HTML prikazovalnik). Kliknite Namesti, če " \
|
||||
"želite, da Wine samodejno naloži in namesti Gecko (potrebna je povezava " \
|
||||
"z internetom).", ID_DWL_STATUS, 10, 10, 240, 40, SS_LEFT
|
||||
CONTROL "Napredek", ID_DWL_PROGRESS, PROGRESS_CLASSA, WS_BORDER|PBS_SMOOTH, 10, 50, 240, 12
|
||||
DEFPUSHBUTTON "&Namesti", ID_DWL_INSTALL, 200, 70, 50, 15, WS_GROUP | WS_TABSTOP
|
||||
PUSHBUTTON "&Prekliči", IDCANCEL, 140, 70, 50, 15, WS_GROUP | WS_TABSTOP
|
||||
}
|
||||
|
||||
IDD_HYPERLINK DIALOG LOADONCALL MOVEABLE DISCARDABLE 0, 0, 250, 65
|
||||
@@ -47,10 +47,10 @@ STYLE DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Hiperpovezava"
|
||||
FONT 8, "MS Shell Dlg"
|
||||
{
|
||||
GROUPBOX "Lastnosti hiperpovezave", IDC_STATIC, 5, 5, 190, 55
|
||||
LTEXT "&Vrsta:", IDC_STATIC, 10, 22, 20, 10
|
||||
GROUPBOX "Lastnosti hiperpovezave", -1, 5, 5, 190, 55
|
||||
LTEXT "&Vrsta:", -1, 10, 22, 20, 10
|
||||
COMBOBOX IDC_TYPE, 35, 20, 45, 100, WS_TABSTOP | WS_GROUP | WS_VSCROLL | CBS_DROPDOWNLIST | CBS_HASSTRINGS
|
||||
LTEXT "&URL:", IDC_STATIC, 10, 42, 20, 10
|
||||
LTEXT "&URL:", -1, 10, 42, 20, 10
|
||||
EDITTEXT IDC_URL, 35, 40, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_GROUP | WS_TABSTOP
|
||||
PUSHBUTTON "V redu", IDOK, 200, 10, 45, 14, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP
|
||||
PUSHBUTTON "Prekliči", IDCANCEL, 200, 28, 45, 14, WS_GROUP | WS_TABSTOP
|
||||
|
||||
@@ -46,10 +46,10 @@ STYLE DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Hyperlänk"
|
||||
FONT 8, "MS Shell Dlg"
|
||||
{
|
||||
GROUPBOX "Länkinformation", IDC_STATIC, 5, 5, 190, 55
|
||||
LTEXT "&Typ:", IDC_STATIC, 10, 22, 20, 10
|
||||
GROUPBOX "Länkinformation", -1, 5, 5, 190, 55
|
||||
LTEXT "&Typ:", -1, 10, 22, 20, 10
|
||||
COMBOBOX IDC_TYPE, 35, 20, 45, 100, WS_TABSTOP | WS_GROUP | WS_VSCROLL | CBS_DROPDOWNLIST | CBS_HASSTRINGS
|
||||
LTEXT "&URL:", IDC_STATIC, 10, 42, 20, 10
|
||||
LTEXT "&URL:", -1, 10, 42, 20, 10
|
||||
EDITTEXT IDC_URL, 35, 40, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_GROUP | WS_TABSTOP
|
||||
PUSHBUTTON "Ok", IDOK, 200, 10, 45, 14, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP
|
||||
PUSHBUTTON "Avbryt", IDCANCEL, 200, 28, 45, 14, WS_GROUP | WS_TABSTOP
|
||||
|
||||
@@ -34,7 +34,7 @@ STRINGTABLE DISCARDABLE
|
||||
ID_DWL_DIALOG DIALOG LOADONCALL MOVEABLE DISCARDABLE 0, 0, 260, 85
|
||||
STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Wine Gecko 安装"
|
||||
FONT 9, "MS Song"
|
||||
FONT 9, "MS Shell Dlg"
|
||||
{
|
||||
LTEXT "这个运用程序要显示一个HTML 网页. Wine 需要装上 Gecko (Mozilla HTML " \
|
||||
"engine)才能显示HTML网页. 如果你想自动下载和安装Gecko," \
|
||||
@@ -47,12 +47,12 @@ FONT 9, "MS Song"
|
||||
IDD_HYPERLINK DIALOG LOADONCALL MOVEABLE DISCARDABLE 0, 0, 250, 65
|
||||
STYLE DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "超链接"
|
||||
FONT 9, "MS Song"
|
||||
FONT 9, "MS Shell Dlg"
|
||||
{
|
||||
GROUPBOX "超链接信息", IDC_STATIC, 5, 5, 190, 55
|
||||
LTEXT "类型(&T):", IDC_STATIC, 10, 22, 20, 10
|
||||
GROUPBOX "超链接信息", -1, 5, 5, 190, 55
|
||||
LTEXT "类型(&T):", -1, 10, 22, 20, 10
|
||||
COMBOBOX IDC_TYPE, 35, 20, 45, 100, WS_TABSTOP | WS_GROUP | WS_VSCROLL | CBS_DROPDOWNLIST | CBS_HASSTRINGS
|
||||
LTEXT "网址(&U):", IDC_STATIC, 10, 42, 20, 10
|
||||
LTEXT "网址(&U):", -1, 10, 42, 20, 10
|
||||
EDITTEXT IDC_URL, 35, 40, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_GROUP | WS_TABSTOP
|
||||
PUSHBUTTON "确定", IDOK, 200, 10, 45, 14, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP
|
||||
PUSHBUTTON "取消", IDCANCEL, 200, 28, 45, 14, WS_GROUP | WS_TABSTOP
|
||||
@@ -71,7 +71,7 @@ STRINGTABLE DISCARDABLE
|
||||
ID_DWL_DIALOG DIALOG LOADONCALL MOVEABLE DISCARDABLE 0, 0, 260, 85
|
||||
STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Wine Gecko 安裝"
|
||||
FONT 8, "PMingLiu"
|
||||
FONT 9, "MS Shell Dlg"
|
||||
{
|
||||
LTEXT "這個運用程式要顯示一個HTML 網頁. Wine 需要裝上 Gecko (Mozilla HTML " \
|
||||
"engine)才能顯示HTML網頁. 如果你想自動下載和安裝Gecko," \
|
||||
@@ -84,12 +84,12 @@ FONT 8, "PMingLiu"
|
||||
IDD_HYPERLINK DIALOG LOADONCALL MOVEABLE DISCARDABLE 0, 0, 250, 65
|
||||
STYLE DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "超鏈接"
|
||||
FONT 8, "PMingLiu"
|
||||
FONT 9, "MS Shell Dlg"
|
||||
{
|
||||
GROUPBOX "超鏈接資訊", IDC_STATIC, 5, 5, 190, 55
|
||||
LTEXT "類型(&T):", IDC_STATIC, 10, 22, 20, 10
|
||||
GROUPBOX "超鏈接資訊", -1, 5, 5, 190, 55
|
||||
LTEXT "類型(&T):", -1, 10, 22, 20, 10
|
||||
COMBOBOX IDC_TYPE, 35, 20, 45, 100, WS_TABSTOP | WS_GROUP | WS_VSCROLL | CBS_DROPDOWNLIST | CBS_HASSTRINGS
|
||||
LTEXT "網址(&U):", IDC_STATIC, 10, 42, 20, 10
|
||||
LTEXT "網址(&U):", -1, 10, 42, 20, 10
|
||||
EDITTEXT IDC_URL, 35, 40, 150, 14, ES_AUTOHSCROLL | WS_BORDER | WS_GROUP | WS_TABSTOP
|
||||
PUSHBUTTON "確定", IDOK, 200, 10, 45, 14, BS_DEFPUSHBUTTON | WS_GROUP | WS_TABSTOP
|
||||
PUSHBUTTON "取消", IDCANCEL, 200, 28, 45, 14, WS_GROUP | WS_TABSTOP
|
||||
|
||||
@@ -213,7 +213,7 @@ void ConnectionPoint_Init(ConnectionPoint *cp, ConnectionPointContainer *contain
|
||||
|
||||
static void ConnectionPoint_Destroy(ConnectionPoint *This)
|
||||
{
|
||||
int i;
|
||||
DWORD i;
|
||||
|
||||
for(i=0; i<This->sinks_size; i++) {
|
||||
if(This->sinks[i].unk)
|
||||
|
||||
@@ -65,24 +65,29 @@ static struct list dispex_data_list = LIST_INIT(dispex_data_list);
|
||||
|
||||
static REFIID tid_ids[] = {
|
||||
&IID_NULL,
|
||||
&DIID_DispCEventObj,
|
||||
&DIID_DispDOMChildrenCollection,
|
||||
&DIID_DispHTMLBody,
|
||||
&DIID_DispHTMLCommentElement,
|
||||
&DIID_DispHTMLCurrentStyle,
|
||||
&DIID_DispHTMLDocument,
|
||||
&DIID_DispHTMLDOMTextNode,
|
||||
&DIID_DispHTMLElementCollection,
|
||||
&DIID_DispHTMLGenericElement,
|
||||
&DIID_DispHTMLIFrame,
|
||||
&DIID_DispHTMLImg,
|
||||
&DIID_DispHTMLInputElement,
|
||||
&DIID_DispHTMLOptionElement,
|
||||
&DIID_DispHTMLSelectElement,
|
||||
&DIID_DispHTMLStyle,
|
||||
&DIID_DispHTMLTable,
|
||||
&DIID_DispHTMLTableRow,
|
||||
&DIID_DispHTMLUnknownElement,
|
||||
&DIID_DispHTMLWindow2,
|
||||
&IID_IHTMLBodyElement,
|
||||
&IID_IHTMLBodyElement2,
|
||||
&IID_IHTMLCommentElement,
|
||||
&IID_IHTMLControlElement,
|
||||
&IID_IHTMLCurrentStyle,
|
||||
&IID_IHTMLDocument2,
|
||||
&IID_IHTMLDocument3,
|
||||
&IID_IHTMLDocument4,
|
||||
@@ -96,12 +101,18 @@ static REFIID tid_ids[] = {
|
||||
&IID_IHTMLElement3,
|
||||
&IID_IHTMLElement4,
|
||||
&IID_IHTMLElementCollection,
|
||||
&IID_IHTMLEventObj,
|
||||
&IID_IHTMLFrameBase2,
|
||||
&IID_IHTMLGenericElement,
|
||||
&IID_IHTMLImgElement,
|
||||
&IID_IHTMLInputElement,
|
||||
&IID_IHTMLLocation,
|
||||
&IID_IHTMLOptionElement,
|
||||
&IID_IHTMLSelectElement,
|
||||
&IID_IHTMLStyle,
|
||||
&IID_IHTMLStyle2,
|
||||
&IID_IHTMLTable,
|
||||
&IID_IHTMLTableRow,
|
||||
&IID_IHTMLTextContainer,
|
||||
&IID_IHTMLUniqueName,
|
||||
&IID_IHTMLWindow2,
|
||||
@@ -109,7 +120,7 @@ static REFIID tid_ids[] = {
|
||||
&IID_IOmNavigator
|
||||
};
|
||||
|
||||
HRESULT get_typeinfo(tid_t tid, ITypeInfo **typeinfo)
|
||||
static HRESULT get_typeinfo(tid_t tid, ITypeInfo **typeinfo)
|
||||
{
|
||||
HRESULT hres;
|
||||
|
||||
@@ -286,7 +297,7 @@ static dispex_data_t *get_dispex_data(DispatchEx *This)
|
||||
return This->data->data;
|
||||
}
|
||||
|
||||
void call_disp_func(HTMLDocument *doc, IDispatch *disp)
|
||||
void call_disp_func(HTMLDocument *doc, IDispatch *disp, IDispatch *this_obj)
|
||||
{
|
||||
DISPID named_arg = DISPID_THIS;
|
||||
VARIANTARG arg;
|
||||
@@ -303,7 +314,7 @@ void call_disp_func(HTMLDocument *doc, IDispatch *disp)
|
||||
}
|
||||
|
||||
V_VT(&arg) = VT_DISPATCH;
|
||||
V_DISPATCH(&arg) = (IDispatch*)HTMLWINDOW2(doc->window);
|
||||
V_DISPATCH(&arg) = this_obj;
|
||||
VariantInit(&res);
|
||||
memset(&ei, 0, sizeof(ei));
|
||||
|
||||
@@ -325,6 +336,70 @@ static inline BOOL is_dynamic_dispid(DISPID id)
|
||||
return DISPID_DYNPROP_0 <= id && id <= DISPID_DYNPROP_MAX;
|
||||
}
|
||||
|
||||
static HRESULT get_dynamic_prop(DispatchEx *This, const WCHAR *name, BOOL alloc, dynamic_prop_t **ret)
|
||||
{
|
||||
dispex_dynamic_data_t *data = This->dynamic_data;
|
||||
|
||||
if(data) {
|
||||
unsigned i;
|
||||
|
||||
for(i=0; i < data->prop_cnt; i++) {
|
||||
if(!strcmpW(data->props[i].name, name)) {
|
||||
*ret = data->props+i;
|
||||
return S_OK;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(alloc) {
|
||||
TRACE("creating dynamic prop %s\n", debugstr_w(name));
|
||||
|
||||
if(!data) {
|
||||
data = This->dynamic_data = heap_alloc_zero(sizeof(dispex_dynamic_data_t));
|
||||
if(!data)
|
||||
return E_OUTOFMEMORY;
|
||||
}
|
||||
|
||||
if(!data->buf_size) {
|
||||
data->props = heap_alloc(sizeof(dynamic_prop_t)*4);
|
||||
if(!data->props)
|
||||
return E_OUTOFMEMORY;
|
||||
data->buf_size = 4;
|
||||
}else if(data->buf_size == data->prop_cnt) {
|
||||
dynamic_prop_t *new_props;
|
||||
|
||||
new_props = heap_realloc(data->props, sizeof(dynamic_prop_t)*(data->buf_size<<1));
|
||||
if(!new_props)
|
||||
return E_OUTOFMEMORY;
|
||||
|
||||
data->props = new_props;
|
||||
data->buf_size <<= 1;
|
||||
}
|
||||
|
||||
data->props[data->prop_cnt].name = heap_strdupW(name);
|
||||
VariantInit(&data->props[data->prop_cnt].var);
|
||||
*ret = data->props + data->prop_cnt++;
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
TRACE("not found %s\n", debugstr_w(name));
|
||||
return DISP_E_UNKNOWNNAME;
|
||||
}
|
||||
|
||||
HRESULT dispex_get_dprop_ref(DispatchEx *This, const WCHAR *name, BOOL alloc, VARIANT **ret)
|
||||
{
|
||||
dynamic_prop_t *prop;
|
||||
HRESULT hres;
|
||||
|
||||
hres = get_dynamic_prop(This, name, alloc, &prop);
|
||||
if(FAILED(hres))
|
||||
return hres;
|
||||
|
||||
*ret = &prop->var;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
#define DISPATCHEX_THIS(iface) DEFINE_THIS(DispatchEx, IDispatchEx, iface)
|
||||
|
||||
static HRESULT WINAPI DispatchEx_QueryInterface(IDispatchEx *iface, REFIID riid, void **ppv)
|
||||
@@ -410,8 +485,10 @@ static HRESULT WINAPI DispatchEx_Invoke(IDispatchEx *iface, DISPID dispIdMember,
|
||||
static HRESULT WINAPI DispatchEx_GetDispID(IDispatchEx *iface, BSTR bstrName, DWORD grfdex, DISPID *pid)
|
||||
{
|
||||
DispatchEx *This = DISPATCHEX_THIS(iface);
|
||||
dynamic_prop_t *dprop;
|
||||
dispex_data_t *data;
|
||||
int min, max, n, c;
|
||||
HRESULT hres;
|
||||
|
||||
TRACE("(%p)->(%s %x %p)\n", This, debugstr_w(bstrName), grfdex, pid);
|
||||
|
||||
@@ -443,17 +520,6 @@ static HRESULT WINAPI DispatchEx_GetDispID(IDispatchEx *iface, BSTR bstrName, DW
|
||||
min = n+1;
|
||||
}
|
||||
|
||||
if(This->dynamic_data) {
|
||||
unsigned i;
|
||||
|
||||
for(i=0; i < This->dynamic_data->prop_cnt; i++) {
|
||||
if(!strcmpW(This->dynamic_data->props[i].name, bstrName)) {
|
||||
*pid = DISPID_DYNPROP_0 + i;
|
||||
return S_OK;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(This->data->vtbl && This->data->vtbl->get_dispid) {
|
||||
HRESULT hres;
|
||||
|
||||
@@ -462,25 +528,12 @@ static HRESULT WINAPI DispatchEx_GetDispID(IDispatchEx *iface, BSTR bstrName, DW
|
||||
return hres;
|
||||
}
|
||||
|
||||
if(grfdex & fdexNameEnsure) {
|
||||
TRACE("creating dynamic prop %s\n", debugstr_w(bstrName));
|
||||
hres = get_dynamic_prop(This, bstrName, grfdex&fdexNameEnsure, &dprop);
|
||||
if(FAILED(hres))
|
||||
return hres;
|
||||
|
||||
if(!This->dynamic_data) {
|
||||
This->dynamic_data = heap_alloc_zero(sizeof(dispex_dynamic_data_t));
|
||||
This->dynamic_data->props = heap_alloc(This->dynamic_data->buf_size = 4);
|
||||
}else if(This->dynamic_data->buf_size == This->dynamic_data->prop_cnt) {
|
||||
This->dynamic_data->props = heap_realloc(This->dynamic_data->props, This->dynamic_data->buf_size<<=1);
|
||||
}
|
||||
|
||||
This->dynamic_data->props[This->dynamic_data->prop_cnt].name = heap_strdupW(bstrName);
|
||||
VariantInit(&This->dynamic_data->props[This->dynamic_data->prop_cnt].var);
|
||||
*pid = DISPID_DYNPROP_0 + This->dynamic_data->prop_cnt++;
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
TRACE("not found %s\n", debugstr_w(bstrName));
|
||||
return DISP_E_UNKNOWNNAME;
|
||||
*pid = DISPID_DYNPROP_0 + (dprop - This->dynamic_data->props);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI DispatchEx_InvokeEx(IDispatchEx *iface, DISPID id, LCID lcid, WORD wFlags, DISPPARAMS *pdp,
|
||||
@@ -514,6 +567,45 @@ static HRESULT WINAPI DispatchEx_InvokeEx(IDispatchEx *iface, DISPID id, LCID lc
|
||||
var = &This->dynamic_data->props[idx].var;
|
||||
|
||||
switch(wFlags) {
|
||||
case INVOKE_FUNC: {
|
||||
DISPID named_arg = DISPID_THIS;
|
||||
DISPPARAMS dp = {NULL, &named_arg, 0, 1};
|
||||
IDispatchEx *dispex;
|
||||
|
||||
if(V_VT(var) != VT_DISPATCH) {
|
||||
FIXME("invoke vt %d\n", V_VT(var));
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
if(pdp->cNamedArgs) {
|
||||
FIXME("named args not supported\n");
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
dp.rgvarg = heap_alloc((pdp->cArgs+1)*sizeof(VARIANTARG));
|
||||
if(!dp.rgvarg)
|
||||
return E_OUTOFMEMORY;
|
||||
|
||||
dp.cArgs = pdp->cArgs+1;
|
||||
memcpy(dp.rgvarg+1, pdp->rgvarg, pdp->cArgs*sizeof(VARIANTARG));
|
||||
|
||||
V_VT(dp.rgvarg) = VT_DISPATCH;
|
||||
V_DISPATCH(dp.rgvarg) = (IDispatch*)DISPATCHEX(This);
|
||||
|
||||
hres = IDispatch_QueryInterface(V_DISPATCH(var), &IID_IDispatchEx, (void**)&dispex);
|
||||
TRACE("%s call\n", debugstr_w(This->dynamic_data->props[idx].name));
|
||||
if(SUCCEEDED(hres)) {
|
||||
hres = IDispatchEx_InvokeEx(dispex, DISPID_VALUE, lcid, wFlags, &dp, pvarRes, pei, pspCaller);
|
||||
IDispatchEx_Release(dispex);
|
||||
}else {
|
||||
ULONG err = 0;
|
||||
hres = IDispatch_Invoke(V_DISPATCH(var), DISPID_VALUE, &IID_NULL, lcid, wFlags, pdp, pvarRes, pei, &err);
|
||||
}
|
||||
TRACE("%s ret %08x\n", debugstr_w(This->dynamic_data->props[idx].name), hres);
|
||||
|
||||
heap_free(dp.rgvarg);
|
||||
return hres;
|
||||
}
|
||||
case INVOKE_PROPERTYGET:
|
||||
return VariantCopy(pvarRes, var);
|
||||
case INVOKE_PROPERTYPUT:
|
||||
@@ -557,7 +649,7 @@ static HRESULT WINAPI DispatchEx_InvokeEx(IDispatchEx *iface, DISPID id, LCID lc
|
||||
|
||||
hres = IUnknown_QueryInterface(This->outer, tid_ids[data->funcs[n].tid], (void**)&unk);
|
||||
if(FAILED(hres)) {
|
||||
ERR("Could not get iface: %08x\n", hres);
|
||||
ERR("Could not get iface %s: %08x\n", debugstr_guid(tid_ids[data->funcs[n].tid]), hres);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
@@ -633,6 +725,8 @@ BOOL dispex_query_interface(DispatchEx *This, REFIID riid, void **ppv)
|
||||
{
|
||||
static const IID IID_UndocumentedScriptIface =
|
||||
{0x719c3050,0xf9d3,0x11cf,{0xa4,0x93,0x00,0x40,0x05,0x23,0xa8,0xa0}};
|
||||
static const IID IID_IDispatchJS =
|
||||
{0x719c3050,0xf9d3,0x11cf,{0xa4,0x93,0x00,0x40,0x05,0x23,0xa8,0xa6}};
|
||||
|
||||
if(IsEqualGUID(&IID_IDispatch, riid)) {
|
||||
TRACE("(%p)->(IID_IDispatch %p)\n", This, ppv);
|
||||
@@ -640,6 +734,9 @@ BOOL dispex_query_interface(DispatchEx *This, REFIID riid, void **ppv)
|
||||
}else if(IsEqualGUID(&IID_IDispatchEx, riid)) {
|
||||
TRACE("(%p)->(IID_IDispatchEx %p)\n", This, ppv);
|
||||
*ppv = DISPATCHEX(This);
|
||||
}else if(IsEqualGUID(&IID_IDispatchJS, riid)) {
|
||||
TRACE("(%p)->(IID_IDispatchJS %p) returning NULL\n", This, ppv);
|
||||
*ppv = NULL;
|
||||
}else if(IsEqualGUID(&IID_UndocumentedScriptIface, riid)) {
|
||||
TRACE("(%p)->(IID_UndocumentedScriptIface %p) returning NULL\n", This, ppv);
|
||||
*ppv = NULL;
|
||||
|
||||
@@ -137,7 +137,7 @@ static nsresult get_ns_command_state(NSContainer *This, const char *cmd, nsIComm
|
||||
return nsres;
|
||||
}
|
||||
|
||||
nsres = nsICommandManager_GetCommandState(cmdmgr, cmd, NULL, nsparam);
|
||||
nsres = nsICommandManager_GetCommandState(cmdmgr, cmd, This->doc->window->nswindow, nsparam);
|
||||
if(NS_FAILED(nsres))
|
||||
ERR("GetCommandState(%s) failed: %08x\n", debugstr_a(cmd), nsres);
|
||||
|
||||
@@ -341,17 +341,19 @@ static void set_font_size(HTMLDocument *This, LPCWSTR size)
|
||||
{
|
||||
nsISelection *nsselection;
|
||||
PRBool collapsed;
|
||||
nsIDOMDocument *nsdoc;
|
||||
nsIDOMElement *elem;
|
||||
nsIDOMRange *range;
|
||||
PRInt32 range_cnt = 0;
|
||||
nsAString font_str;
|
||||
nsAString size_str;
|
||||
nsAString val_str;
|
||||
nsresult nsres;
|
||||
|
||||
if(!This->nsdoc) {
|
||||
WARN("NULL nsdoc\n");
|
||||
return;
|
||||
}
|
||||
|
||||
nsselection = get_ns_selection(This);
|
||||
|
||||
if(!nsselection)
|
||||
return;
|
||||
|
||||
@@ -364,15 +366,11 @@ static void set_font_size(HTMLDocument *This, LPCWSTR size)
|
||||
}
|
||||
}
|
||||
|
||||
nsres = nsIWebNavigation_GetDocument(This->nscontainer->navigation, &nsdoc);
|
||||
if(NS_FAILED(nsres))
|
||||
return;
|
||||
|
||||
nsAString_Init(&font_str, wszFont);
|
||||
nsAString_Init(&size_str, wszSize);
|
||||
nsAString_Init(&val_str, size);
|
||||
|
||||
nsIDOMDocument_CreateElement(nsdoc, &font_str, &elem);
|
||||
nsIDOMDocument_CreateElement(This->nsdoc, &font_str, &elem);
|
||||
nsIDOMElement_SetAttribute(elem, &size_str, &val_str);
|
||||
|
||||
nsISelection_GetRangeAt(nsselection, 0, &range);
|
||||
@@ -389,6 +387,7 @@ static void set_font_size(HTMLDocument *This, LPCWSTR size)
|
||||
nsISelection_SelectAllChildren(nsselection, (nsIDOMNode*)elem);
|
||||
}
|
||||
|
||||
nsISelection_Release(nsselection);
|
||||
nsIDOMRange_Release(range);
|
||||
nsIDOMElement_Release(elem);
|
||||
|
||||
@@ -396,9 +395,6 @@ static void set_font_size(HTMLDocument *This, LPCWSTR size)
|
||||
nsAString_Finish(&size_str);
|
||||
nsAString_Finish(&val_str);
|
||||
|
||||
nsISelection_Release(nsselection);
|
||||
nsIDOMDocument_Release(nsdoc);
|
||||
|
||||
set_dirty(This, VARIANT_TRUE);
|
||||
}
|
||||
|
||||
@@ -1150,13 +1146,18 @@ static INT_PTR CALLBACK hyperlink_dlgproc(HWND hwnd, UINT msg, WPARAM wparam, LP
|
||||
|
||||
static HRESULT exec_hyperlink(HTMLDocument *This, DWORD cmdexecopt, VARIANT *in, VARIANT *out)
|
||||
{
|
||||
nsAString a_str, href_str, ns_url;
|
||||
nsIHTMLEditor *html_editor;
|
||||
nsIDOMElement *anchor_elem;
|
||||
PRBool insert_link_at_caret;
|
||||
nsISelection *nsselection;
|
||||
BSTR url = NULL;
|
||||
INT ret;
|
||||
nsISelection *nsselection;
|
||||
nsIDOMDocument *nsdoc;
|
||||
nsresult nsres;
|
||||
HRESULT hres = E_FAIL;
|
||||
|
||||
static const WCHAR wszA[] = {'a',0};
|
||||
static const WCHAR wszHref[] = {'h','r','e','f',0};
|
||||
|
||||
TRACE("%p, 0x%x, %p, %p\n", This, cmdexecopt, in, out);
|
||||
|
||||
if (cmdexecopt == OLECMDEXECOPT_DONTPROMPTUSER)
|
||||
@@ -1175,76 +1176,64 @@ static HRESULT exec_hyperlink(HTMLDocument *This, DWORD cmdexecopt, VARIANT *in,
|
||||
return OLECMDERR_E_CANCELED;
|
||||
}
|
||||
|
||||
if(!This->nsdoc) {
|
||||
WARN("NULL nsdoc\n");
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
nsselection = get_ns_selection(This);
|
||||
if (!nsselection)
|
||||
return E_FAIL;
|
||||
|
||||
nsres = nsIWebNavigation_GetDocument(This->nscontainer->navigation, &nsdoc);
|
||||
if(NS_SUCCEEDED(nsres))
|
||||
{
|
||||
static const WCHAR wszA[] = {'a',0};
|
||||
static const WCHAR wszHref[] = {'h','r','e','f',0};
|
||||
nsIHTMLEditor *html_editor;
|
||||
nsIDOMNode *text_node;
|
||||
nsIDOMElement *anchor_elem;
|
||||
nsIDOMNode *unused_node;
|
||||
nsAString a_str;
|
||||
nsAString href_str;
|
||||
nsAString ns_url;
|
||||
PRBool insert_link_at_caret;
|
||||
nsAString_Init(&a_str, wszA);
|
||||
nsAString_Init(&href_str, wszHref);
|
||||
nsAString_Init(&ns_url, url);
|
||||
|
||||
nsAString_Init(&a_str, wszA);
|
||||
nsAString_Init(&href_str, wszHref);
|
||||
nsAString_Init(&ns_url, url);
|
||||
/* create an element for the link */
|
||||
nsIDOMDocument_CreateElement(This->nsdoc, &a_str, &anchor_elem);
|
||||
nsIDOMElement_SetAttribute(anchor_elem, &href_str, &ns_url);
|
||||
|
||||
/* create an element for the link */
|
||||
nsIDOMDocument_CreateElement(nsdoc, &a_str, &anchor_elem);
|
||||
nsIDOMElement_SetAttribute(anchor_elem, &href_str, &ns_url);
|
||||
nsAString_Finish(&href_str);
|
||||
nsAString_Finish(&a_str);
|
||||
|
||||
nsAString_Finish(&href_str);
|
||||
nsAString_Finish(&a_str);
|
||||
nsISelection_GetIsCollapsed(nsselection, &insert_link_at_caret);
|
||||
|
||||
nsISelection_GetIsCollapsed(nsselection, &insert_link_at_caret);
|
||||
/* create an element with text of URL */
|
||||
if (insert_link_at_caret) {
|
||||
nsIDOMNode *text_node, *unused_node;
|
||||
|
||||
/* create an element with text of URL */
|
||||
if (insert_link_at_caret)
|
||||
{
|
||||
nsIDOMDocument_CreateTextNode(nsdoc, &ns_url, (nsIDOMText **)&text_node);
|
||||
nsIDOMDocument_CreateTextNode(This->nsdoc, &ns_url, (nsIDOMText **)&text_node);
|
||||
|
||||
/* wrap the <a> tags around the text element */
|
||||
nsIDOMElement_AppendChild(anchor_elem, text_node, &unused_node);
|
||||
nsIDOMNode_Release(text_node);
|
||||
nsIDOMNode_Release(unused_node);
|
||||
}
|
||||
/* wrap the <a> tags around the text element */
|
||||
nsIDOMElement_AppendChild(anchor_elem, text_node, &unused_node);
|
||||
nsIDOMNode_Release(text_node);
|
||||
nsIDOMNode_Release(unused_node);
|
||||
}
|
||||
|
||||
nsAString_Finish(&ns_url);
|
||||
nsAString_Finish(&ns_url);
|
||||
|
||||
nsIEditor_QueryInterface(This->nscontainer->editor, &IID_nsIHTMLEditor, (void **)&html_editor);
|
||||
if (html_editor)
|
||||
{
|
||||
if (insert_link_at_caret)
|
||||
{
|
||||
/* add them to the document at the caret position */
|
||||
nsres = nsIHTMLEditor_InsertElementAtSelection(html_editor, anchor_elem, FALSE);
|
||||
nsISelection_SelectAllChildren(nsselection, (nsIDOMNode*)anchor_elem);
|
||||
}
|
||||
else /* add them around the selection using the magic provided to us by nsIHTMLEditor */
|
||||
nsres = nsIHTMLEditor_InsertLinkAroundSelection(html_editor, anchor_elem);
|
||||
nsIHTMLEditor_Release(html_editor);
|
||||
}
|
||||
nsIEditor_QueryInterface(This->nscontainer->editor, &IID_nsIHTMLEditor, (void **)&html_editor);
|
||||
if (html_editor) {
|
||||
nsresult nsres;
|
||||
|
||||
nsIDOMElement_Release(anchor_elem);
|
||||
nsIDOMDocument_Release(nsdoc);
|
||||
if (insert_link_at_caret) {
|
||||
/* add them to the document at the caret position */
|
||||
nsres = nsIHTMLEditor_InsertElementAtSelection(html_editor, anchor_elem, FALSE);
|
||||
nsISelection_SelectAllChildren(nsselection, (nsIDOMNode*)anchor_elem);
|
||||
}else /* add them around the selection using the magic provided to us by nsIHTMLEditor */
|
||||
nsres = nsIHTMLEditor_InsertLinkAroundSelection(html_editor, anchor_elem);
|
||||
|
||||
nsIHTMLEditor_Release(html_editor);
|
||||
hres = NS_SUCCEEDED(nsres) ? S_OK : E_FAIL;
|
||||
}
|
||||
|
||||
nsISelection_Release(nsselection);
|
||||
nsIDOMElement_Release(anchor_elem);
|
||||
|
||||
if (cmdexecopt != OLECMDEXECOPT_DONTPROMPTUSER)
|
||||
SysFreeString(url);
|
||||
|
||||
TRACE("-- 0x%08x\n", nsres);
|
||||
TRACE("-- 0x%08x\n", hres);
|
||||
return hres;
|
||||
}
|
||||
|
||||
|
||||
@@ -140,8 +140,23 @@ static HRESULT WINAPI HTMLBodyElement_Invoke(IHTMLBodyElement *iface, DISPID dis
|
||||
static HRESULT WINAPI HTMLBodyElement_put_background(IHTMLBodyElement *iface, BSTR v)
|
||||
{
|
||||
HTMLBodyElement *This = HTMLBODY_THIS(iface);
|
||||
FIXME("(%p)->(%s)\n", This, debugstr_w(v));
|
||||
return E_NOTIMPL;
|
||||
HRESULT hr = S_OK;
|
||||
nsAString nsstr;
|
||||
nsresult nsres;
|
||||
|
||||
TRACE("(%p)->(%s)\n", This, debugstr_w(v));
|
||||
|
||||
nsAString_Init(&nsstr, v);
|
||||
|
||||
nsres = nsIDOMHTMLBodyElement_SetBackground(This->nsbody, &nsstr);
|
||||
if(!NS_SUCCEEDED(nsres))
|
||||
{
|
||||
hr = E_FAIL;
|
||||
}
|
||||
|
||||
nsAString_Finish(&nsstr);
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLBodyElement_get_background(IHTMLBodyElement *iface, BSTR *p)
|
||||
@@ -257,29 +272,89 @@ static HRESULT WINAPI HTMLBodyElement_get_noWrap(IHTMLBodyElement *iface, VARIAN
|
||||
static HRESULT WINAPI HTMLBodyElement_put_bgColor(IHTMLBodyElement *iface, VARIANT v)
|
||||
{
|
||||
HTMLBodyElement *This = HTMLBODY_THIS(iface);
|
||||
FIXME("(%p)->()\n", This);
|
||||
return E_NOTIMPL;
|
||||
nsAString strColor;
|
||||
nsresult nsres;
|
||||
|
||||
TRACE("(%p)->()\n", This);
|
||||
|
||||
if(!variant_to_nscolor(&v, &strColor))
|
||||
return S_OK;
|
||||
|
||||
nsres = nsIDOMHTMLBodyElement_SetBgColor(This->nsbody, &strColor);
|
||||
nsAString_Finish(&strColor);
|
||||
if(NS_FAILED(nsres))
|
||||
ERR("SetBgColor failed: %08x\n", nsres);
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLBodyElement_get_bgColor(IHTMLBodyElement *iface, VARIANT *p)
|
||||
{
|
||||
HTMLBodyElement *This = HTMLBODY_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
nsAString strColor;
|
||||
nsresult nsres;
|
||||
const PRUnichar *color;
|
||||
|
||||
TRACE("(%p)->(%p)\n", This, p);
|
||||
|
||||
nsAString_Init(&strColor, NULL);
|
||||
nsres = nsIDOMHTMLBodyElement_GetBgColor(This->nsbody, &strColor);
|
||||
if(NS_FAILED(nsres))
|
||||
ERR("SetBgColor failed: %08x\n", nsres);
|
||||
|
||||
nsAString_GetData(&strColor, &color);
|
||||
|
||||
V_VT(p) = VT_BSTR;
|
||||
V_BSTR(p) = SysAllocString(color);
|
||||
|
||||
nsAString_Finish(&strColor);
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLBodyElement_put_text(IHTMLBodyElement *iface, VARIANT v)
|
||||
{
|
||||
HTMLBodyElement *This = HTMLBODY_THIS(iface);
|
||||
FIXME("(%p)->()\n", This);
|
||||
return E_NOTIMPL;
|
||||
nsAString text;
|
||||
nsresult nsres;
|
||||
|
||||
TRACE("(%p)->(v%d)\n", This, V_VT(&v));
|
||||
|
||||
if(!variant_to_nscolor(&v, &text))
|
||||
return S_OK;
|
||||
|
||||
nsres = nsIDOMHTMLBodyElement_SetText(This->nsbody, &text);
|
||||
nsAString_Finish(&text);
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLBodyElement_get_text(IHTMLBodyElement *iface, VARIANT *p)
|
||||
{
|
||||
HTMLBodyElement *This = HTMLBODY_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
nsAString text;
|
||||
nsresult nsres;
|
||||
|
||||
TRACE("(%p)->(%p)\n", This, p);
|
||||
|
||||
nsAString_Init(&text, NULL);
|
||||
|
||||
V_VT(p) = VT_BSTR;
|
||||
V_BSTR(p) = NULL;
|
||||
|
||||
nsres = nsIDOMHTMLBodyElement_GetText(This->nsbody, &text);
|
||||
if(NS_SUCCEEDED(nsres))
|
||||
{
|
||||
const PRUnichar *sText;
|
||||
nsAString_GetData(&text, &sText);
|
||||
|
||||
V_VT(p) = VT_BSTR;
|
||||
V_BSTR(p) = SysAllocString(sText);
|
||||
}
|
||||
|
||||
nsAString_Finish(&text);
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLBodyElement_put_link(IHTMLBodyElement *iface, VARIANT v)
|
||||
@@ -469,31 +544,35 @@ static HRESULT WINAPI HTMLBodyElement_get_onbeforeunload(IHTMLBodyElement *iface
|
||||
static HRESULT WINAPI HTMLBodyElement_createTextRange(IHTMLBodyElement *iface, IHTMLTxtRange **range)
|
||||
{
|
||||
HTMLBodyElement *This = HTMLBODY_THIS(iface);
|
||||
nsIDOMDocumentRange *nsdocrange;
|
||||
nsIDOMRange *nsrange = NULL;
|
||||
nsresult nsres;
|
||||
|
||||
TRACE("(%p)->(%p)\n", This, range);
|
||||
|
||||
if(This->textcont.element.node.doc->nscontainer) {
|
||||
nsIDOMDocument *nsdoc;
|
||||
nsIDOMDocumentRange *nsdocrange;
|
||||
nsresult nsres;
|
||||
|
||||
nsIWebNavigation_GetDocument(This->textcont.element.node.doc->nscontainer->navigation, &nsdoc);
|
||||
nsIDOMDocument_QueryInterface(nsdoc, &IID_nsIDOMDocumentRange, (void**)&nsdocrange);
|
||||
nsIDOMDocument_Release(nsdoc);
|
||||
|
||||
nsres = nsIDOMDocumentRange_CreateRange(nsdocrange, &nsrange);
|
||||
if(NS_SUCCEEDED(nsres)) {
|
||||
nsres = nsIDOMRange_SelectNodeContents(nsrange, This->textcont.element.node.nsnode);
|
||||
if(NS_FAILED(nsres))
|
||||
ERR("SelectNodeContents failed: %08x\n", nsres);
|
||||
}else {
|
||||
ERR("CreateRange failed: %08x\n", nsres);
|
||||
}
|
||||
|
||||
nsIDOMDocumentRange_Release(nsdocrange);
|
||||
if(!This->textcont.element.node.doc->nsdoc) {
|
||||
WARN("No nsdoc\n");
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
nsres = nsIDOMDocument_QueryInterface(This->textcont.element.node.doc->nsdoc, &IID_nsIDOMDocumentRange,
|
||||
(void**)&nsdocrange);
|
||||
if(NS_FAILED(nsres)) {
|
||||
ERR("Could not get nsIDOMDocumentRabge iface: %08x\n", nsres);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
nsres = nsIDOMDocumentRange_CreateRange(nsdocrange, &nsrange);
|
||||
if(NS_SUCCEEDED(nsres)) {
|
||||
nsres = nsIDOMRange_SelectNodeContents(nsrange, This->textcont.element.node.nsnode);
|
||||
if(NS_FAILED(nsres))
|
||||
ERR("SelectNodeContents failed: %08x\n", nsres);
|
||||
}else {
|
||||
ERR("CreateRange failed: %08x\n", nsres);
|
||||
}
|
||||
|
||||
nsIDOMDocumentRange_Release(nsdocrange);
|
||||
|
||||
*range = HTMLTxtRange_Create(This->textcont.element.node.doc, nsrange);
|
||||
return S_OK;
|
||||
}
|
||||
@@ -594,7 +673,6 @@ static const NodeImplVtbl HTMLBodyElementImplVtbl = {
|
||||
static const tid_t HTMLBodyElement_iface_tids[] = {
|
||||
IHTMLBodyElement_tid,
|
||||
IHTMLBodyElement2_tid,
|
||||
IHTMLControlElement_tid,
|
||||
IHTMLDOMNode_tid,
|
||||
IHTMLDOMNode2_tid,
|
||||
IHTMLElement_tid,
|
||||
|
||||
@@ -32,10 +32,10 @@
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
|
||||
|
||||
typedef struct {
|
||||
struct HTMLCommentElement {
|
||||
HTMLElement element;
|
||||
const IHTMLCommentElementVtbl *lpIHTMLCommentElementVtbl;
|
||||
} HTMLCommentElement;
|
||||
};
|
||||
|
||||
#define HTMLCOMMENT(x) ((IHTMLCommentElement*) &(x)->lpIHTMLCommentElementVtbl)
|
||||
|
||||
@@ -66,16 +66,14 @@ static ULONG WINAPI HTMLCommentElement_Release(IHTMLCommentElement *iface)
|
||||
static HRESULT WINAPI HTMLCommentElement_GetTypeInfoCount(IHTMLCommentElement *iface, UINT *pctinfo)
|
||||
{
|
||||
HTMLCommentElement *This = HTMLCOMMENT_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, pctinfo);
|
||||
return E_NOTIMPL;
|
||||
return IDispatchEx_GetTypeInfoCount(DISPATCHEX(&This->element.node.dispex), pctinfo);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLCommentElement_GetTypeInfo(IHTMLCommentElement *iface, UINT iTInfo,
|
||||
LCID lcid, ITypeInfo **ppTInfo)
|
||||
{
|
||||
HTMLCommentElement *This = HTMLCOMMENT_THIS(iface);
|
||||
FIXME("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo);
|
||||
return E_NOTIMPL;
|
||||
return IDispatchEx_GetTypeInfo(DISPATCHEX(&This->element.node.dispex), iTInfo, lcid, ppTInfo);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLCommentElement_GetIDsOfNames(IHTMLCommentElement *iface, REFIID riid,
|
||||
@@ -83,9 +81,7 @@ static HRESULT WINAPI HTMLCommentElement_GetIDsOfNames(IHTMLCommentElement *ifac
|
||||
LCID lcid, DISPID *rgDispId)
|
||||
{
|
||||
HTMLCommentElement *This = HTMLCOMMENT_THIS(iface);
|
||||
FIXME("(%p)->(%s %p %u %u %p)\n", This, debugstr_guid(riid), rgszNames, cNames,
|
||||
lcid, rgDispId);
|
||||
return E_NOTIMPL;
|
||||
return IDispatchEx_GetIDsOfNames(DISPATCHEX(&This->element.node.dispex), riid, rgszNames, cNames, lcid, rgDispId);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLCommentElement_Invoke(IHTMLCommentElement *iface, DISPID dispIdMember,
|
||||
@@ -93,9 +89,8 @@ static HRESULT WINAPI HTMLCommentElement_Invoke(IHTMLCommentElement *iface, DISP
|
||||
VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
|
||||
{
|
||||
HTMLCommentElement *This = HTMLCOMMENT_THIS(iface);
|
||||
FIXME("(%p)->(%d %s %d %d %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid),
|
||||
lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
|
||||
return E_NOTIMPL;
|
||||
return IDispatchEx_Invoke(DISPATCHEX(&This->element.node.dispex), dispIdMember, riid, lcid,
|
||||
wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLCommentElement_put_text(IHTMLCommentElement *iface, BSTR v)
|
||||
@@ -144,7 +139,7 @@ static const IHTMLCommentElementVtbl HTMLCommentElementVtbl = {
|
||||
|
||||
#define HTMLCOMMENT_NODE_THIS(iface) DEFINE_THIS2(HTMLCommentElement, element.node, iface)
|
||||
|
||||
HRESULT HTMLCommentElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
|
||||
static HRESULT HTMLCommentElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
|
||||
{
|
||||
HTMLCommentElement *This = HTMLCOMMENT_NODE_THIS(iface);
|
||||
|
||||
@@ -161,7 +156,7 @@ HRESULT HTMLCommentElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void HTMLCommentElement_destructor(HTMLDOMNode *iface)
|
||||
static void HTMLCommentElement_destructor(HTMLDOMNode *iface)
|
||||
{
|
||||
HTMLCommentElement *This = HTMLCOMMENT_NODE_THIS(iface);
|
||||
|
||||
@@ -180,6 +175,7 @@ static const tid_t HTMLCommentElement_iface_tids[] = {
|
||||
IHTMLDOMNode2_tid,
|
||||
IHTMLElement_tid,
|
||||
IHTMLElement2_tid,
|
||||
IHTMLElement3_tid,
|
||||
IHTMLCommentElement_tid,
|
||||
0
|
||||
};
|
||||
|
||||
@@ -0,0 +1,940 @@
|
||||
/*
|
||||
* Copyright 2008 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 <stdarg.h>
|
||||
|
||||
#define COBJMACROS
|
||||
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#include "winuser.h"
|
||||
#include "ole2.h"
|
||||
|
||||
#include "mshtml_private.h"
|
||||
#include "htmlstyle.h"
|
||||
|
||||
#include "wine/debug.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
|
||||
|
||||
struct HTMLCurrentStyle {
|
||||
DispatchEx dispex;
|
||||
const IHTMLCurrentStyleVtbl *lpIHTMLCurrentStyleVtbl;
|
||||
|
||||
LONG ref;
|
||||
|
||||
nsIDOMCSSStyleDeclaration *nsstyle;
|
||||
};
|
||||
|
||||
#define HTMLCURSTYLE(x) ((IHTMLCurrentStyle*) &(x)->lpIHTMLCurrentStyleVtbl)
|
||||
|
||||
#define HTMLCURSTYLE_THIS(iface) DEFINE_THIS(HTMLCurrentStyle, IHTMLCurrentStyle, iface)
|
||||
|
||||
static HRESULT WINAPI HTMLCurrentStyle_QueryInterface(IHTMLCurrentStyle *iface, REFIID riid, void **ppv)
|
||||
{
|
||||
HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
|
||||
|
||||
*ppv = NULL;
|
||||
|
||||
if(IsEqualGUID(&IID_IUnknown, riid)) {
|
||||
TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
|
||||
*ppv = HTMLCURSTYLE(This);
|
||||
}else if(IsEqualGUID(&IID_IHTMLCurrentStyle, riid)) {
|
||||
TRACE("(%p)->(IID_IHTMLCurrentStyle %p)\n", This, ppv);
|
||||
*ppv = HTMLCURSTYLE(This);
|
||||
}else if(dispex_query_interface(&This->dispex, riid, ppv)) {
|
||||
return *ppv ? S_OK : E_NOINTERFACE;
|
||||
}
|
||||
|
||||
if(*ppv) {
|
||||
IUnknown_AddRef((IUnknown*)*ppv);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
WARN("unsupported %s\n", debugstr_guid(riid));
|
||||
return E_NOINTERFACE;
|
||||
}
|
||||
|
||||
static ULONG WINAPI HTMLCurrentStyle_AddRef(IHTMLCurrentStyle *iface)
|
||||
{
|
||||
HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
|
||||
LONG ref = InterlockedIncrement(&This->ref);
|
||||
|
||||
TRACE("(%p) ref=%d\n", This, ref);
|
||||
|
||||
return ref;
|
||||
}
|
||||
|
||||
static ULONG WINAPI HTMLCurrentStyle_Release(IHTMLCurrentStyle *iface)
|
||||
{
|
||||
HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
|
||||
LONG ref = InterlockedDecrement(&This->ref);
|
||||
|
||||
TRACE("(%p) ref=%d\n", This, ref);
|
||||
|
||||
if(!ref) {
|
||||
if(This->nsstyle)
|
||||
nsIDOMCSSStyleDeclaration_Release(This->nsstyle);
|
||||
heap_free(This);
|
||||
}
|
||||
|
||||
return ref;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLCurrentStyle_GetTypeInfoCount(IHTMLCurrentStyle *iface, UINT *pctinfo)
|
||||
{
|
||||
HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
|
||||
return IDispatchEx_GetTypeInfoCount(DISPATCHEX(&This->dispex), pctinfo);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLCurrentStyle_GetTypeInfo(IHTMLCurrentStyle *iface, UINT iTInfo,
|
||||
LCID lcid, ITypeInfo **ppTInfo)
|
||||
{
|
||||
HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
|
||||
return IDispatchEx_GetTypeInfo(DISPATCHEX(&This->dispex), iTInfo, lcid, ppTInfo);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLCurrentStyle_GetIDsOfNames(IHTMLCurrentStyle *iface, REFIID riid,
|
||||
LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
|
||||
{
|
||||
HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
|
||||
return IDispatchEx_GetIDsOfNames(DISPATCHEX(&This->dispex), riid, rgszNames, cNames, lcid, rgDispId);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLCurrentStyle_Invoke(IHTMLCurrentStyle *iface, DISPID dispIdMember,
|
||||
REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
|
||||
VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
|
||||
{
|
||||
HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
|
||||
return IDispatchEx_Invoke(DISPATCHEX(&This->dispex), dispIdMember, riid, lcid,
|
||||
wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLCurrentStyle_get_position(IHTMLCurrentStyle *iface, BSTR *p)
|
||||
{
|
||||
HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLCurrentStyle_get_styleFloat(IHTMLCurrentStyle *iface, BSTR *p)
|
||||
{
|
||||
HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLCurrentStyle_get_color(IHTMLCurrentStyle *iface, VARIANT *p)
|
||||
{
|
||||
HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLCurrentStyle_get_backgroundColor(IHTMLCurrentStyle *iface, VARIANT *p)
|
||||
{
|
||||
HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLCurrentStyle_get_fontFamily(IHTMLCurrentStyle *iface, BSTR *p)
|
||||
{
|
||||
HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLCurrentStyle_get_fontStyle(IHTMLCurrentStyle *iface, BSTR *p)
|
||||
{
|
||||
HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLCurrentStyle_get_fontVariant(IHTMLCurrentStyle *iface, BSTR *p)
|
||||
{
|
||||
HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLCurrentStyle_get_fontWeight(IHTMLCurrentStyle *iface, VARIANT *p)
|
||||
{
|
||||
HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLCurrentStyle_get_fontSize(IHTMLCurrentStyle *iface, VARIANT *p)
|
||||
{
|
||||
HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLCurrentStyle_get_backgroundImage(IHTMLCurrentStyle *iface, BSTR *p)
|
||||
{
|
||||
HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLCurrentStyle_get_backgroundPositionX(IHTMLCurrentStyle *iface, VARIANT *p)
|
||||
{
|
||||
HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLCurrentStyle_get_backgroundPositionY(IHTMLCurrentStyle *iface, VARIANT *p)
|
||||
{
|
||||
HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLCurrentStyle_get_backgroundRepeat(IHTMLCurrentStyle *iface, BSTR *p)
|
||||
{
|
||||
HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLCurrentStyle_get_borderLeftColor(IHTMLCurrentStyle *iface, VARIANT *p)
|
||||
{
|
||||
HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLCurrentStyle_get_borderTopColor(IHTMLCurrentStyle *iface, VARIANT *p)
|
||||
{
|
||||
HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLCurrentStyle_get_borderRightColor(IHTMLCurrentStyle *iface, VARIANT *p)
|
||||
{
|
||||
HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLCurrentStyle_get_borderBottomColor(IHTMLCurrentStyle *iface, VARIANT *p)
|
||||
{
|
||||
HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLCurrentStyle_get_borderTopStyle(IHTMLCurrentStyle *iface, BSTR *p)
|
||||
{
|
||||
HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLCurrentStyle_get_borderRightStyle(IHTMLCurrentStyle *iface, BSTR *p)
|
||||
{
|
||||
HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLCurrentStyle_get_borderBottomStyle(IHTMLCurrentStyle *iface, BSTR *p)
|
||||
{
|
||||
HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLCurrentStyle_get_borderLeftStyle(IHTMLCurrentStyle *iface, BSTR *p)
|
||||
{
|
||||
HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLCurrentStyle_get_borderTopWidth(IHTMLCurrentStyle *iface, VARIANT *p)
|
||||
{
|
||||
HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLCurrentStyle_get_borderRightWidth(IHTMLCurrentStyle *iface, VARIANT *p)
|
||||
{
|
||||
HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLCurrentStyle_get_borderBottomWidth(IHTMLCurrentStyle *iface, VARIANT *p)
|
||||
{
|
||||
HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLCurrentStyle_get_borderLeftWidth(IHTMLCurrentStyle *iface, VARIANT *p)
|
||||
{
|
||||
HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLCurrentStyle_get_left(IHTMLCurrentStyle *iface, VARIANT *p)
|
||||
{
|
||||
HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLCurrentStyle_get_top(IHTMLCurrentStyle *iface, VARIANT *p)
|
||||
{
|
||||
HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLCurrentStyle_get_width(IHTMLCurrentStyle *iface, VARIANT *p)
|
||||
{
|
||||
HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLCurrentStyle_get_height(IHTMLCurrentStyle *iface, VARIANT *p)
|
||||
{
|
||||
HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLCurrentStyle_get_paddingLeft(IHTMLCurrentStyle *iface, VARIANT *p)
|
||||
{
|
||||
HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLCurrentStyle_get_paddingTop(IHTMLCurrentStyle *iface, VARIANT *p)
|
||||
{
|
||||
HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLCurrentStyle_get_paddingRight(IHTMLCurrentStyle *iface, VARIANT *p)
|
||||
{
|
||||
HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLCurrentStyle_get_paddingBottom(IHTMLCurrentStyle *iface, VARIANT *p)
|
||||
{
|
||||
HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLCurrentStyle_get_textAlign(IHTMLCurrentStyle *iface, BSTR *p)
|
||||
{
|
||||
HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLCurrentStyle_get_textDecoration(IHTMLCurrentStyle *iface, BSTR *p)
|
||||
{
|
||||
HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLCurrentStyle_get_display(IHTMLCurrentStyle *iface, BSTR *p)
|
||||
{
|
||||
HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
|
||||
|
||||
TRACE("(%p)->(%p)\n", This, p);
|
||||
|
||||
return get_nsstyle_attr(This->nsstyle, STYLEID_DISPLAY, p);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLCurrentStyle_get_visibility(IHTMLCurrentStyle *iface, BSTR *p)
|
||||
{
|
||||
HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLCurrentStyle_get_zIndex(IHTMLCurrentStyle *iface, VARIANT *p)
|
||||
{
|
||||
HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLCurrentStyle_get_letterSpacing(IHTMLCurrentStyle *iface, VARIANT *p)
|
||||
{
|
||||
HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLCurrentStyle_get_lineHeight(IHTMLCurrentStyle *iface, VARIANT *p)
|
||||
{
|
||||
HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLCurrentStyle_get_textIndent(IHTMLCurrentStyle *iface, VARIANT *p)
|
||||
{
|
||||
HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLCurrentStyle_get_verticalAlign(IHTMLCurrentStyle *iface, VARIANT *p)
|
||||
{
|
||||
HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLCurrentStyle_get_backgroundAttachment(IHTMLCurrentStyle *iface, BSTR *p)
|
||||
{
|
||||
HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLCurrentStyle_get_marginTop(IHTMLCurrentStyle *iface, VARIANT *p)
|
||||
{
|
||||
HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLCurrentStyle_get_marginRight(IHTMLCurrentStyle *iface, VARIANT *p)
|
||||
{
|
||||
HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLCurrentStyle_get_marginBottom(IHTMLCurrentStyle *iface, VARIANT *p)
|
||||
{
|
||||
HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLCurrentStyle_get_marginLeft(IHTMLCurrentStyle *iface, VARIANT *p)
|
||||
{
|
||||
HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLCurrentStyle_get_clear(IHTMLCurrentStyle *iface, BSTR *p)
|
||||
{
|
||||
HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLCurrentStyle_get_listStyleType(IHTMLCurrentStyle *iface, BSTR *p)
|
||||
{
|
||||
HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLCurrentStyle_get_listStylePosition(IHTMLCurrentStyle *iface, BSTR *p)
|
||||
{
|
||||
HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLCurrentStyle_get_listStyleImage(IHTMLCurrentStyle *iface, BSTR *p)
|
||||
{
|
||||
HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLCurrentStyle_get_clipTop(IHTMLCurrentStyle *iface, VARIANT *p)
|
||||
{
|
||||
HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLCurrentStyle_get_clipRight(IHTMLCurrentStyle *iface, VARIANT *p)
|
||||
{
|
||||
HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLCurrentStyle_get_clipBottom(IHTMLCurrentStyle *iface, VARIANT *p)
|
||||
{
|
||||
HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLCurrentStyle_get_clipLeft(IHTMLCurrentStyle *iface, VARIANT *p)
|
||||
{
|
||||
HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLCurrentStyle_get_overflow(IHTMLCurrentStyle *iface, BSTR *p)
|
||||
{
|
||||
HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLCurrentStyle_get_pageBreakBefore(IHTMLCurrentStyle *iface, BSTR *p)
|
||||
{
|
||||
HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLCurrentStyle_get_pageBreakAfter(IHTMLCurrentStyle *iface, BSTR *p)
|
||||
{
|
||||
HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLCurrentStyle_get_cursor(IHTMLCurrentStyle *iface, BSTR *p)
|
||||
{
|
||||
HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLCurrentStyle_get_tableLayout(IHTMLCurrentStyle *iface, BSTR *p)
|
||||
{
|
||||
HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLCurrentStyle_get_borderCollapse(IHTMLCurrentStyle *iface, BSTR *p)
|
||||
{
|
||||
HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLCurrentStyle_get_direction(IHTMLCurrentStyle *iface, BSTR *p)
|
||||
{
|
||||
HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLCurrentStyle_get_behavior(IHTMLCurrentStyle *iface, BSTR *p)
|
||||
{
|
||||
HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLCurrentStyle_getAttribute(IHTMLCurrentStyle *iface, BSTR strAttributeName,
|
||||
LONG lFlags, VARIANT *AttributeValue)
|
||||
{
|
||||
HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
|
||||
FIXME("(%p)->(%s %x %p)\n", This, debugstr_w(strAttributeName), lFlags, AttributeValue);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLCurrentStyle_get_unicodeBidi(IHTMLCurrentStyle *iface, BSTR *p)
|
||||
{
|
||||
HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLCurrentStyle_get_right(IHTMLCurrentStyle *iface, VARIANT *p)
|
||||
{
|
||||
HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLCurrentStyle_get_bottom(IHTMLCurrentStyle *iface, VARIANT *p)
|
||||
{
|
||||
HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLCurrentStyle_get_imeMode(IHTMLCurrentStyle *iface, BSTR *p)
|
||||
{
|
||||
HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLCurrentStyle_get_rubyAlign(IHTMLCurrentStyle *iface, BSTR *p)
|
||||
{
|
||||
HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLCurrentStyle_get_rubyPosition(IHTMLCurrentStyle *iface, BSTR *p)
|
||||
{
|
||||
HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLCurrentStyle_get_rubyOverhang(IHTMLCurrentStyle *iface, BSTR *p)
|
||||
{
|
||||
HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLCurrentStyle_get_textAutospace(IHTMLCurrentStyle *iface, BSTR *p)
|
||||
{
|
||||
HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLCurrentStyle_get_lineBreak(IHTMLCurrentStyle *iface, BSTR *p)
|
||||
{
|
||||
HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLCurrentStyle_get_wordBreak(IHTMLCurrentStyle *iface, BSTR *p)
|
||||
{
|
||||
HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLCurrentStyle_get_textJustify(IHTMLCurrentStyle *iface, BSTR *p)
|
||||
{
|
||||
HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLCurrentStyle_get_textJustifyTrim(IHTMLCurrentStyle *iface, BSTR *p)
|
||||
{
|
||||
HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLCurrentStyle_get_textKashida(IHTMLCurrentStyle *iface, VARIANT *p)
|
||||
{
|
||||
HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLCurrentStyle_get_blockDirection(IHTMLCurrentStyle *iface, BSTR *p)
|
||||
{
|
||||
HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLCurrentStyle_get_layoutGridChar(IHTMLCurrentStyle *iface, VARIANT *p)
|
||||
{
|
||||
HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLCurrentStyle_get_layoutGridLine(IHTMLCurrentStyle *iface, VARIANT *p)
|
||||
{
|
||||
HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLCurrentStyle_get_layoutGridMode(IHTMLCurrentStyle *iface, BSTR *p)
|
||||
{
|
||||
HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLCurrentStyle_get_layoutGridType(IHTMLCurrentStyle *iface, BSTR *p)
|
||||
{
|
||||
HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLCurrentStyle_get_borderStyle(IHTMLCurrentStyle *iface, BSTR *p)
|
||||
{
|
||||
HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLCurrentStyle_get_borderColor(IHTMLCurrentStyle *iface, BSTR *p)
|
||||
{
|
||||
HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLCurrentStyle_get_borderWidth(IHTMLCurrentStyle *iface, BSTR *p)
|
||||
{
|
||||
HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLCurrentStyle_get_padding(IHTMLCurrentStyle *iface, BSTR *p)
|
||||
{
|
||||
HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLCurrentStyle_get_margin(IHTMLCurrentStyle *iface, BSTR *p)
|
||||
{
|
||||
HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLCurrentStyle_get_accelerator(IHTMLCurrentStyle *iface, BSTR *p)
|
||||
{
|
||||
HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLCurrentStyle_get_overflowX(IHTMLCurrentStyle *iface, BSTR *p)
|
||||
{
|
||||
HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLCurrentStyle_get_overflowY(IHTMLCurrentStyle *iface, BSTR *p)
|
||||
{
|
||||
HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLCurrentStyle_get_textTransform(IHTMLCurrentStyle *iface, BSTR *p)
|
||||
{
|
||||
HTMLCurrentStyle *This = HTMLCURSTYLE_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
#undef HTMLCURSTYLE_THIS
|
||||
|
||||
static const IHTMLCurrentStyleVtbl HTMLCurrentStyleVtbl = {
|
||||
HTMLCurrentStyle_QueryInterface,
|
||||
HTMLCurrentStyle_AddRef,
|
||||
HTMLCurrentStyle_Release,
|
||||
HTMLCurrentStyle_GetTypeInfoCount,
|
||||
HTMLCurrentStyle_GetTypeInfo,
|
||||
HTMLCurrentStyle_GetIDsOfNames,
|
||||
HTMLCurrentStyle_Invoke,
|
||||
HTMLCurrentStyle_get_position,
|
||||
HTMLCurrentStyle_get_styleFloat,
|
||||
HTMLCurrentStyle_get_color,
|
||||
HTMLCurrentStyle_get_backgroundColor,
|
||||
HTMLCurrentStyle_get_fontFamily,
|
||||
HTMLCurrentStyle_get_fontStyle,
|
||||
HTMLCurrentStyle_get_fontVariant,
|
||||
HTMLCurrentStyle_get_fontWeight,
|
||||
HTMLCurrentStyle_get_fontSize,
|
||||
HTMLCurrentStyle_get_backgroundImage,
|
||||
HTMLCurrentStyle_get_backgroundPositionX,
|
||||
HTMLCurrentStyle_get_backgroundPositionY,
|
||||
HTMLCurrentStyle_get_backgroundRepeat,
|
||||
HTMLCurrentStyle_get_borderLeftColor,
|
||||
HTMLCurrentStyle_get_borderTopColor,
|
||||
HTMLCurrentStyle_get_borderRightColor,
|
||||
HTMLCurrentStyle_get_borderBottomColor,
|
||||
HTMLCurrentStyle_get_borderTopStyle,
|
||||
HTMLCurrentStyle_get_borderRightStyle,
|
||||
HTMLCurrentStyle_get_borderBottomStyle,
|
||||
HTMLCurrentStyle_get_borderLeftStyle,
|
||||
HTMLCurrentStyle_get_borderTopWidth,
|
||||
HTMLCurrentStyle_get_borderRightWidth,
|
||||
HTMLCurrentStyle_get_borderBottomWidth,
|
||||
HTMLCurrentStyle_get_borderLeftWidth,
|
||||
HTMLCurrentStyle_get_left,
|
||||
HTMLCurrentStyle_get_top,
|
||||
HTMLCurrentStyle_get_width,
|
||||
HTMLCurrentStyle_get_height,
|
||||
HTMLCurrentStyle_get_paddingLeft,
|
||||
HTMLCurrentStyle_get_paddingTop,
|
||||
HTMLCurrentStyle_get_paddingRight,
|
||||
HTMLCurrentStyle_get_paddingBottom,
|
||||
HTMLCurrentStyle_get_textAlign,
|
||||
HTMLCurrentStyle_get_textDecoration,
|
||||
HTMLCurrentStyle_get_display,
|
||||
HTMLCurrentStyle_get_visibility,
|
||||
HTMLCurrentStyle_get_zIndex,
|
||||
HTMLCurrentStyle_get_letterSpacing,
|
||||
HTMLCurrentStyle_get_lineHeight,
|
||||
HTMLCurrentStyle_get_textIndent,
|
||||
HTMLCurrentStyle_get_verticalAlign,
|
||||
HTMLCurrentStyle_get_backgroundAttachment,
|
||||
HTMLCurrentStyle_get_marginTop,
|
||||
HTMLCurrentStyle_get_marginRight,
|
||||
HTMLCurrentStyle_get_marginBottom,
|
||||
HTMLCurrentStyle_get_marginLeft,
|
||||
HTMLCurrentStyle_get_clear,
|
||||
HTMLCurrentStyle_get_listStyleType,
|
||||
HTMLCurrentStyle_get_listStylePosition,
|
||||
HTMLCurrentStyle_get_listStyleImage,
|
||||
HTMLCurrentStyle_get_clipTop,
|
||||
HTMLCurrentStyle_get_clipRight,
|
||||
HTMLCurrentStyle_get_clipBottom,
|
||||
HTMLCurrentStyle_get_clipLeft,
|
||||
HTMLCurrentStyle_get_overflow,
|
||||
HTMLCurrentStyle_get_pageBreakBefore,
|
||||
HTMLCurrentStyle_get_pageBreakAfter,
|
||||
HTMLCurrentStyle_get_cursor,
|
||||
HTMLCurrentStyle_get_tableLayout,
|
||||
HTMLCurrentStyle_get_borderCollapse,
|
||||
HTMLCurrentStyle_get_direction,
|
||||
HTMLCurrentStyle_get_behavior,
|
||||
HTMLCurrentStyle_getAttribute,
|
||||
HTMLCurrentStyle_get_unicodeBidi,
|
||||
HTMLCurrentStyle_get_right,
|
||||
HTMLCurrentStyle_get_bottom,
|
||||
HTMLCurrentStyle_get_imeMode,
|
||||
HTMLCurrentStyle_get_rubyAlign,
|
||||
HTMLCurrentStyle_get_rubyPosition,
|
||||
HTMLCurrentStyle_get_rubyOverhang,
|
||||
HTMLCurrentStyle_get_textAutospace,
|
||||
HTMLCurrentStyle_get_lineBreak,
|
||||
HTMLCurrentStyle_get_wordBreak,
|
||||
HTMLCurrentStyle_get_textJustify,
|
||||
HTMLCurrentStyle_get_textJustifyTrim,
|
||||
HTMLCurrentStyle_get_textKashida,
|
||||
HTMLCurrentStyle_get_blockDirection,
|
||||
HTMLCurrentStyle_get_layoutGridChar,
|
||||
HTMLCurrentStyle_get_layoutGridLine,
|
||||
HTMLCurrentStyle_get_layoutGridMode,
|
||||
HTMLCurrentStyle_get_layoutGridType,
|
||||
HTMLCurrentStyle_get_borderStyle,
|
||||
HTMLCurrentStyle_get_borderColor,
|
||||
HTMLCurrentStyle_get_borderWidth,
|
||||
HTMLCurrentStyle_get_padding,
|
||||
HTMLCurrentStyle_get_margin,
|
||||
HTMLCurrentStyle_get_accelerator,
|
||||
HTMLCurrentStyle_get_overflowX,
|
||||
HTMLCurrentStyle_get_overflowY,
|
||||
HTMLCurrentStyle_get_textTransform
|
||||
};
|
||||
|
||||
static const tid_t HTMLCurrentStyle_iface_tids[] = {
|
||||
IHTMLCurrentStyle_tid,
|
||||
0
|
||||
};
|
||||
static dispex_static_data_t HTMLCurrentStyle_dispex = {
|
||||
NULL,
|
||||
DispHTMLCurrentStyle_tid,
|
||||
NULL,
|
||||
HTMLCurrentStyle_iface_tids
|
||||
};
|
||||
|
||||
HRESULT HTMLCurrentStyle_Create(HTMLElement *elem, IHTMLCurrentStyle **p)
|
||||
{
|
||||
nsIDOMCSSStyleDeclaration *nsstyle;
|
||||
nsIDOMDocumentView *nsdocview;
|
||||
nsIDOMAbstractView *nsview;
|
||||
nsIDOMViewCSS *nsviewcss;
|
||||
nsAString nsempty_str;
|
||||
HTMLCurrentStyle *ret;
|
||||
nsresult nsres;
|
||||
|
||||
if(!elem->node.doc->nsdoc) {
|
||||
WARN("NULL nsdoc\n");
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
nsres = nsIDOMHTMLDocument_QueryInterface(elem->node.doc->nsdoc, &IID_nsIDOMDocumentView, (void**)&nsdocview);
|
||||
if(NS_FAILED(nsres)) {
|
||||
ERR("Could not get nsIDOMDocumentView: %08x\n", nsres);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
nsres = nsIDOMDocumentView_GetDefaultView(nsdocview, &nsview);
|
||||
nsIDOMDocumentView_Release(nsdocview);
|
||||
if(NS_FAILED(nsres)) {
|
||||
ERR("GetDefaultView failed: %08x\n", nsres);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
nsres = nsIDOMAbstractView_QueryInterface(nsview, &IID_nsIDOMViewCSS, (void**)&nsviewcss);
|
||||
nsIDOMAbstractView_Release(nsview);
|
||||
if(NS_FAILED(nsres)) {
|
||||
ERR("Could not get nsIDOMViewCSS: %08x\n", nsres);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
nsAString_Init(&nsempty_str, NULL);
|
||||
nsres = nsIDOMViewCSS_GetComputedStyle(nsviewcss, (nsIDOMElement*)elem->nselem, &nsempty_str, &nsstyle);
|
||||
nsIDOMViewCSS_Release(nsviewcss);
|
||||
nsAString_Finish(&nsempty_str);
|
||||
if(NS_FAILED(nsres)) {
|
||||
ERR("GetComputedStyle failed: %08x\n", nsres);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
ret = heap_alloc_zero(sizeof(HTMLCurrentStyle));
|
||||
if(!ret) {
|
||||
nsIDOMCSSStyleDeclaration_Release(nsstyle);
|
||||
return E_OUTOFMEMORY;
|
||||
}
|
||||
|
||||
ret->lpIHTMLCurrentStyleVtbl = &HTMLCurrentStyleVtbl;
|
||||
ret->ref = 1;
|
||||
ret->nsstyle = nsstyle;
|
||||
|
||||
init_dispex(&ret->dispex, (IUnknown*)HTMLCURSTYLE(ret), &HTMLCurrentStyle_dispex);
|
||||
|
||||
*p = HTMLCURSTYLE(ret);
|
||||
return S_OK;
|
||||
}
|
||||
+421
-191
@@ -31,6 +31,7 @@
|
||||
#include "wine/debug.h"
|
||||
|
||||
#include "mshtml_private.h"
|
||||
#include "htmlevent.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
|
||||
|
||||
@@ -128,6 +129,9 @@ static HRESULT WINAPI HTMLDocument_QueryInterface(IHTMLDocument2 *iface, REFIID
|
||||
}else if(IsEqualGUID(&DIID_DispHTMLDocument, riid)) {
|
||||
TRACE("(%p)->(DIID_DispHTMLDocument %p)\n", This, ppvObject);
|
||||
*ppvObject = HTMLDOC(This);
|
||||
}else if(IsEqualGUID(&IID_ISupportErrorInfo, riid)) {
|
||||
TRACE("(%p)->(IID_ISupportErrorInfo %p)\n", This, ppvObject);
|
||||
*ppvObject = SUPPERRINFO(This);
|
||||
}else if(IsEqualGUID(&CLSID_CMarkup, riid)) {
|
||||
FIXME("(%p)->(CLSID_CMarkup %p)\n", This, ppvObject);
|
||||
return E_NOINTERFACE;
|
||||
@@ -137,6 +141,9 @@ static HRESULT WINAPI HTMLDocument_QueryInterface(IHTMLDocument2 *iface, REFIID
|
||||
}else if(IsEqualGUID(&IID_IPersistPropertyBag, riid)) {
|
||||
TRACE("(%p)->(IID_IPersistPropertyBag %p) returning NULL\n", This, ppvObject);
|
||||
return E_NOINTERFACE;
|
||||
}else if(IsEqualGUID(&IID_IMarshal, riid)) {
|
||||
TRACE("(%p)->(IID_IMarshal %p) returning NULL\n", This, ppvObject);
|
||||
return E_NOINTERFACE;
|
||||
}else if(dispex_query_interface(&This->dispex, riid, ppvObject)) {
|
||||
return *ppvObject ? S_OK : E_NOINTERFACE;
|
||||
}
|
||||
@@ -197,6 +204,9 @@ static ULONG WINAPI HTMLDocument_Release(IHTMLDocument2 *iface)
|
||||
if(This->window)
|
||||
IHTMLWindow2_Release(HTMLWINDOW2(This->window));
|
||||
|
||||
if(This->event_target)
|
||||
release_event_target(This->event_target);
|
||||
|
||||
heap_free(This->mime);
|
||||
detach_selection(This);
|
||||
detach_ranges(This);
|
||||
@@ -204,12 +214,12 @@ static ULONG WINAPI HTMLDocument_Release(IHTMLDocument2 *iface)
|
||||
|
||||
ConnectionPointContainer_Destroy(&This->cp_container);
|
||||
|
||||
if(This->nsdoc)
|
||||
nsIDOMHTMLDocument_Release(This->nsdoc);
|
||||
if(This->nscontainer)
|
||||
NSContainer_Release(This->nscontainer);
|
||||
|
||||
heap_free(This);
|
||||
|
||||
UNLOCK_MODULE();
|
||||
}
|
||||
|
||||
return ref;
|
||||
@@ -263,78 +273,60 @@ static HRESULT WINAPI HTMLDocument_get_Script(IHTMLDocument2 *iface, IDispatch *
|
||||
static HRESULT WINAPI HTMLDocument_get_all(IHTMLDocument2 *iface, IHTMLElementCollection **p)
|
||||
{
|
||||
HTMLDocument *This = HTMLDOC_THIS(iface);
|
||||
nsIDOMDocument *nsdoc = NULL;
|
||||
nsIDOMElement *nselem = NULL;
|
||||
nsresult nsres;
|
||||
|
||||
TRACE("(%p)->(%p)\n", This, p);
|
||||
|
||||
if(!This->nscontainer) {
|
||||
if(!This->nsdoc) {
|
||||
WARN("NULL nsdoc\n");
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
nsres = nsIDOMHTMLDocument_GetDocumentElement(This->nsdoc, &nselem);
|
||||
if(NS_FAILED(nsres)) {
|
||||
ERR("GetDocumentElement failed: %08x\n", nsres);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if(nselem) {
|
||||
*p = create_all_collection(get_node(This, (nsIDOMNode*)nselem, TRUE), TRUE);
|
||||
nsIDOMElement_Release(nselem);
|
||||
}else {
|
||||
*p = NULL;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
nsres = nsIWebNavigation_GetDocument(This->nscontainer->navigation, &nsdoc);
|
||||
if(NS_FAILED(nsres))
|
||||
ERR("GetDocument failed: %08x\n", nsres);
|
||||
|
||||
if(nsdoc) {
|
||||
nsres = nsIDOMHTMLDocument_GetDocumentElement(nsdoc, &nselem);
|
||||
if(NS_FAILED(nsres))
|
||||
ERR("GetDocumentElement failed: %08x\n", nsres);
|
||||
}
|
||||
|
||||
if(!nselem) {
|
||||
*p = NULL;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
*p = create_all_collection(get_node(This, (nsIDOMNode*)nselem, TRUE));
|
||||
|
||||
nsIDOMElement_Release(nselem);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLDocument_get_body(IHTMLDocument2 *iface, IHTMLElement **p)
|
||||
{
|
||||
HTMLDocument *This = HTMLDOC_THIS(iface);
|
||||
nsIDOMDocument *nsdoc;
|
||||
nsIDOMHTMLDocument *nshtmldoc;
|
||||
nsIDOMHTMLElement *nsbody = NULL;
|
||||
HTMLDOMNode *node;
|
||||
nsresult nsres;
|
||||
|
||||
TRACE("(%p)->(%p)\n", This, p);
|
||||
|
||||
*p = NULL;
|
||||
if(!This->nsdoc) {
|
||||
WARN("NULL nsdoc\n");
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
if(!This->nscontainer)
|
||||
return S_OK;
|
||||
|
||||
nsres = nsIWebNavigation_GetDocument(This->nscontainer->navigation, &nsdoc);
|
||||
nsres = nsIDOMHTMLDocument_GetBody(This->nsdoc, &nsbody);
|
||||
if(NS_FAILED(nsres)) {
|
||||
ERR("GetDocument failed: %08x\n", nsres);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
if(NS_FAILED(nsres) || !nsdoc)
|
||||
return S_OK;
|
||||
|
||||
nsIDOMDocument_QueryInterface(nsdoc, &IID_nsIDOMHTMLDocument, (void**)&nshtmldoc);
|
||||
nsIDOMDocument_Release(nsdoc);
|
||||
|
||||
nsres = nsIDOMHTMLDocument_GetBody(nshtmldoc, &nsbody);
|
||||
nsIDOMHTMLDocument_Release(nshtmldoc);
|
||||
|
||||
if(NS_FAILED(nsres) || !nsbody) {
|
||||
TRACE("Could not get body: %08x\n", nsres);
|
||||
return S_OK;
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
node = get_node(This, (nsIDOMNode*)nsbody, TRUE);
|
||||
nsIDOMHTMLElement_Release(nsbody);
|
||||
if(nsbody) {
|
||||
node = get_node(This, (nsIDOMNode*)nsbody, TRUE);
|
||||
nsIDOMHTMLElement_Release(nsbody);
|
||||
|
||||
IHTMLDOMNode_QueryInterface(HTMLDOMNODE(node), &IID_IHTMLElement, (void**)p);
|
||||
IHTMLDOMNode_QueryInterface(HTMLDOMNODE(node), &IID_IHTMLElement, (void**)p);
|
||||
}else {
|
||||
*p = NULL;
|
||||
}
|
||||
|
||||
TRACE("*p = %p\n", *p);
|
||||
return S_OK;
|
||||
@@ -350,63 +342,178 @@ static HRESULT WINAPI HTMLDocument_get_activeElement(IHTMLDocument2 *iface, IHTM
|
||||
static HRESULT WINAPI HTMLDocument_get_images(IHTMLDocument2 *iface, IHTMLElementCollection **p)
|
||||
{
|
||||
HTMLDocument *This = HTMLDOC_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
nsIDOMHTMLCollection *nscoll = NULL;
|
||||
nsresult nsres;
|
||||
|
||||
TRACE("(%p)->(%p)\n", This, p);
|
||||
|
||||
if(!p)
|
||||
return E_INVALIDARG;
|
||||
|
||||
*p = NULL;
|
||||
|
||||
if(!This->nsdoc) {
|
||||
WARN("NULL nsdoc\n");
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
nsres = nsIDOMHTMLDocument_GetImages(This->nsdoc, &nscoll);
|
||||
if(NS_FAILED(nsres)) {
|
||||
ERR("GetImages failed: %08x\n", nsres);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if(nscoll) {
|
||||
*p = create_collection_from_htmlcol(This, (IUnknown*)HTMLDOC(This), nscoll);
|
||||
nsIDOMElement_Release(nscoll);
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLDocument_get_applets(IHTMLDocument2 *iface, IHTMLElementCollection **p)
|
||||
{
|
||||
HTMLDocument *This = HTMLDOC_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
nsIDOMHTMLCollection *nscoll = NULL;
|
||||
nsresult nsres;
|
||||
|
||||
TRACE("(%p)->(%p)\n", This, p);
|
||||
|
||||
if(!p)
|
||||
return E_INVALIDARG;
|
||||
|
||||
*p = NULL;
|
||||
|
||||
if(!This->nsdoc) {
|
||||
WARN("NULL nsdoc\n");
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
nsres = nsIDOMHTMLDocument_GetApplets(This->nsdoc, &nscoll);
|
||||
if(NS_FAILED(nsres)) {
|
||||
ERR("GetApplets failed: %08x\n", nsres);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if(nscoll) {
|
||||
*p = create_collection_from_htmlcol(This, (IUnknown*)HTMLDOC(This), nscoll);
|
||||
nsIDOMElement_Release(nscoll);
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLDocument_get_links(IHTMLDocument2 *iface, IHTMLElementCollection **p)
|
||||
{
|
||||
HTMLDocument *This = HTMLDOC_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
nsIDOMHTMLCollection *nscoll = NULL;
|
||||
nsresult nsres;
|
||||
|
||||
TRACE("(%p)->(%p)\n", This, p);
|
||||
|
||||
if(!p)
|
||||
return E_INVALIDARG;
|
||||
|
||||
*p = NULL;
|
||||
|
||||
if(!This->nsdoc) {
|
||||
WARN("NULL nsdoc\n");
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
nsres = nsIDOMHTMLDocument_GetLinks(This->nsdoc, &nscoll);
|
||||
if(NS_FAILED(nsres)) {
|
||||
ERR("GetLinks failed: %08x\n", nsres);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if(nscoll) {
|
||||
*p = create_collection_from_htmlcol(This, (IUnknown*)HTMLDOC(This), nscoll);
|
||||
nsIDOMElement_Release(nscoll);
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLDocument_get_forms(IHTMLDocument2 *iface, IHTMLElementCollection **p)
|
||||
{
|
||||
HTMLDocument *This = HTMLDOC_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
nsIDOMHTMLCollection *nscoll = NULL;
|
||||
nsresult nsres;
|
||||
|
||||
TRACE("(%p)->(%p)\n", This, p);
|
||||
|
||||
if(!p)
|
||||
return E_INVALIDARG;
|
||||
|
||||
*p = NULL;
|
||||
|
||||
if(!This->nsdoc) {
|
||||
WARN("NULL nsdoc\n");
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
nsres = nsIDOMHTMLDocument_GetForms(This->nsdoc, &nscoll);
|
||||
if(NS_FAILED(nsres)) {
|
||||
ERR("GetForms failed: %08x\n", nsres);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if(nscoll) {
|
||||
*p = create_collection_from_htmlcol(This, (IUnknown*)HTMLDOC(This), nscoll);
|
||||
nsIDOMElement_Release(nscoll);
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLDocument_get_anchors(IHTMLDocument2 *iface, IHTMLElementCollection **p)
|
||||
{
|
||||
HTMLDocument *This = HTMLDOC_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
nsIDOMHTMLCollection *nscoll = NULL;
|
||||
nsresult nsres;
|
||||
|
||||
TRACE("(%p)->(%p)\n", This, p);
|
||||
|
||||
if(!p)
|
||||
return E_INVALIDARG;
|
||||
|
||||
*p = NULL;
|
||||
|
||||
if(!This->nsdoc) {
|
||||
WARN("NULL nsdoc\n");
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
nsres = nsIDOMHTMLDocument_GetAnchors(This->nsdoc, &nscoll);
|
||||
if(NS_FAILED(nsres)) {
|
||||
ERR("GetAnchors failed: %08x\n", nsres);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if(nscoll) {
|
||||
*p = create_collection_from_htmlcol(This, (IUnknown*)HTMLDOC(This), nscoll);
|
||||
nsIDOMElement_Release(nscoll);
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLDocument_put_title(IHTMLDocument2 *iface, BSTR v)
|
||||
{
|
||||
HTMLDocument *This = HTMLDOC_THIS(iface);
|
||||
nsIDOMHTMLDocument *nshtmldoc;
|
||||
nsIDOMDocument *nsdoc;
|
||||
nsAString nsstr;
|
||||
nsresult nsres;
|
||||
|
||||
TRACE("(%p)->(%s)\n", This, debugstr_w(v));
|
||||
|
||||
if(!This->nscontainer)
|
||||
return E_FAIL;
|
||||
|
||||
nsres = nsIWebNavigation_GetDocument(This->nscontainer->navigation, &nsdoc);
|
||||
if(NS_FAILED(nsres) || !nsdoc) {
|
||||
ERR("GetDocument failed: %08x\n", nsres);
|
||||
return E_FAIL;
|
||||
if(!This->nsdoc) {
|
||||
WARN("NULL nsdoc\n");
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
nsIDOMDocument_QueryInterface(nsdoc, &IID_nsIDOMHTMLDocument, (void**)&nshtmldoc);
|
||||
nsIDOMDocument_Release(nsdoc);
|
||||
|
||||
nsAString_Init(&nsstr, v);
|
||||
nsres = nsIDOMHTMLDocument_SetTitle(nshtmldoc, &nsstr);
|
||||
nsIDOMHTMLDocument_Release(nshtmldoc);
|
||||
nsres = nsIDOMHTMLDocument_SetTitle(This->nsdoc, &nsstr);
|
||||
nsAString_Finish(&nsstr);
|
||||
if(NS_FAILED(nsres))
|
||||
ERR("SetTitle failed: %08x\n", nsres);
|
||||
@@ -417,37 +524,31 @@ static HRESULT WINAPI HTMLDocument_put_title(IHTMLDocument2 *iface, BSTR v)
|
||||
static HRESULT WINAPI HTMLDocument_get_title(IHTMLDocument2 *iface, BSTR *p)
|
||||
{
|
||||
HTMLDocument *This = HTMLDOC_THIS(iface);
|
||||
nsIDOMHTMLDocument *nshtmldoc;
|
||||
nsIDOMDocument *nsdoc;
|
||||
const PRUnichar *ret;
|
||||
nsAString nsstr;
|
||||
nsresult nsres;
|
||||
|
||||
TRACE("(%p)->(%p)\n", This, p);
|
||||
|
||||
if(!This->nscontainer)
|
||||
return E_FAIL;
|
||||
|
||||
nsres = nsIWebNavigation_GetDocument(This->nscontainer->navigation, &nsdoc);
|
||||
if(NS_FAILED(nsres) || !nsdoc) {
|
||||
ERR("GetDocument failed: %08x\n", nsres);
|
||||
return E_FAIL;
|
||||
if(!This->nsdoc) {
|
||||
WARN("NULL nsdoc\n");
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
nsIDOMDocument_QueryInterface(nsdoc, &IID_nsIDOMHTMLDocument, (void**)&nshtmldoc);
|
||||
nsIDOMDocument_Release(nsdoc);
|
||||
|
||||
nsAString_Init(&nsstr, NULL);
|
||||
|
||||
nsres = nsIDOMHTMLDocument_GetTitle(nshtmldoc, &nsstr);
|
||||
nsIDOMHTMLDocument_Release(nshtmldoc);
|
||||
if (NS_FAILED(nsres))
|
||||
ERR("GetTitle failed: %08x\n", nsres);
|
||||
|
||||
nsAString_GetData(&nsstr, &ret);
|
||||
*p = SysAllocString(ret);
|
||||
nsres = nsIDOMHTMLDocument_GetTitle(This->nsdoc, &nsstr);
|
||||
if (NS_SUCCEEDED(nsres)) {
|
||||
nsAString_GetData(&nsstr, &ret);
|
||||
*p = SysAllocString(ret);
|
||||
}
|
||||
nsAString_Finish(&nsstr);
|
||||
|
||||
if(NS_FAILED(nsres)) {
|
||||
ERR("GetTitle failed: %08x\n", nsres);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -468,8 +569,15 @@ static HRESULT WINAPI HTMLDocument_put_designMode(IHTMLDocument2 *iface, BSTR v)
|
||||
static HRESULT WINAPI HTMLDocument_get_designMode(IHTMLDocument2 *iface, BSTR *p)
|
||||
{
|
||||
HTMLDocument *This = HTMLDOC_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
static WCHAR szOff[] = {'O','f','f',0};
|
||||
FIXME("(%p)->(%p) always returning Off\n", This, p);
|
||||
|
||||
if(!p)
|
||||
return E_INVALIDARG;
|
||||
|
||||
*p = SysAllocString(szOff);
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLDocument_get_selection(IHTMLDocument2 *iface, IHTMLSelectionObject **p)
|
||||
@@ -789,39 +897,27 @@ static HRESULT WINAPI HTMLDocument_get_nameProp(IHTMLDocument2 *iface, BSTR *p)
|
||||
static HRESULT WINAPI HTMLDocument_write(IHTMLDocument2 *iface, SAFEARRAY *psarray)
|
||||
{
|
||||
HTMLDocument *This = HTMLDOC_THIS(iface);
|
||||
nsIDOMDocument *domdoc;
|
||||
nsIDOMHTMLDocument *nsdoc;
|
||||
nsAString nsstr;
|
||||
VARIANT *var;
|
||||
int i;
|
||||
ULONG i;
|
||||
nsresult nsres;
|
||||
HRESULT hres;
|
||||
|
||||
TRACE("(%p)->(%p)\n", iface, psarray);
|
||||
|
||||
if(!This->nsdoc) {
|
||||
WARN("NULL nsdoc\n");
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
if(psarray->cDims != 1) {
|
||||
FIXME("cDims=%d\n", psarray->cDims);
|
||||
return E_INVALIDARG;
|
||||
}
|
||||
|
||||
if(!This->nscontainer)
|
||||
return S_OK;
|
||||
|
||||
nsres = nsIWebNavigation_GetDocument(This->nscontainer->navigation, &domdoc);
|
||||
if(NS_FAILED(nsres)) {
|
||||
ERR("GetDocument failed: %08x\n", nsres);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
nsres = nsIDOMDocument_QueryInterface(domdoc, &IID_nsIDOMHTMLDocument, (void**)&nsdoc);
|
||||
nsIDOMDocument_Release(domdoc);
|
||||
if(NS_FAILED(nsres))
|
||||
return S_OK;
|
||||
|
||||
hres = SafeArrayAccessData(psarray, (void**)&var);
|
||||
if(FAILED(hres)) {
|
||||
WARN("SafeArrayAccessData failed: %08x\n", hres);
|
||||
nsIDOMHTMLDocument_Release(nsdoc);
|
||||
return hres;
|
||||
}
|
||||
|
||||
@@ -830,7 +926,7 @@ static HRESULT WINAPI HTMLDocument_write(IHTMLDocument2 *iface, SAFEARRAY *psarr
|
||||
for(i=0; i < psarray->rgsabound[0].cElements; i++) {
|
||||
if(V_VT(var+i) == VT_BSTR) {
|
||||
nsAString_SetData(&nsstr, V_BSTR(var+i));
|
||||
nsres = nsIDOMHTMLDocument_Write(nsdoc, &nsstr);
|
||||
nsres = nsIDOMHTMLDocument_Write(This->nsdoc, &nsstr);
|
||||
if(NS_FAILED(nsres))
|
||||
ERR("Write failed: %08x\n", nsres);
|
||||
}else {
|
||||
@@ -840,7 +936,6 @@ static HRESULT WINAPI HTMLDocument_write(IHTMLDocument2 *iface, SAFEARRAY *psarr
|
||||
|
||||
nsAString_Finish(&nsstr);
|
||||
SafeArrayUnaccessData(psarray);
|
||||
nsIDOMHTMLDocument_Release(nsdoc);
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
@@ -856,15 +951,52 @@ static HRESULT WINAPI HTMLDocument_open(IHTMLDocument2 *iface, BSTR url, VARIANT
|
||||
VARIANT features, VARIANT replace, IDispatch **pomWindowResult)
|
||||
{
|
||||
HTMLDocument *This = HTMLDOC_THIS(iface);
|
||||
FIXME("(%p)->(%s %p)\n", This, debugstr_w(url), pomWindowResult);
|
||||
return E_NOTIMPL;
|
||||
nsresult nsres;
|
||||
|
||||
static const WCHAR text_htmlW[] = {'t','e','x','t','/','h','t','m','l',0};
|
||||
|
||||
TRACE("(%p)->(%s %s %s %s %p)\n", This, debugstr_w(url), debugstr_variant(&name),
|
||||
debugstr_variant(&features), debugstr_variant(&replace), pomWindowResult);
|
||||
|
||||
if(!This->nsdoc) {
|
||||
ERR("!nsdoc\n");
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
if(!url || strcmpW(url, text_htmlW) || V_VT(&name) != VT_ERROR
|
||||
|| V_VT(&features) != VT_ERROR || V_VT(&replace) != VT_ERROR)
|
||||
FIXME("unsupported args\n");
|
||||
|
||||
nsres = nsIDOMHTMLDocument_Open(This->nsdoc);
|
||||
if(NS_FAILED(nsres)) {
|
||||
ERR("Open failed: %08x\n", nsres);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
*pomWindowResult = (IDispatch*)HTMLWINDOW2(This->window);
|
||||
IHTMLWindow2_AddRef(HTMLWINDOW2(This->window));
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLDocument_close(IHTMLDocument2 *iface)
|
||||
{
|
||||
HTMLDocument *This = HTMLDOC_THIS(iface);
|
||||
FIXME("(%p)\n", This);
|
||||
return E_NOTIMPL;
|
||||
nsresult nsres;
|
||||
|
||||
TRACE("(%p)\n", This);
|
||||
|
||||
if(!This->nsdoc) {
|
||||
ERR("!nsdoc\n");
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
nsres = nsIDOMHTMLDocument_Close(This->nsdoc);
|
||||
if(NS_FAILED(nsres)) {
|
||||
ERR("Close failed: %08x\n", nsres);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLDocument_clear(IHTMLDocument2 *iface)
|
||||
@@ -942,7 +1074,6 @@ static HRESULT WINAPI HTMLDocument_createElement(IHTMLDocument2 *iface, BSTR eTa
|
||||
IHTMLElement **newElem)
|
||||
{
|
||||
HTMLDocument *This = HTMLDOC_THIS(iface);
|
||||
nsIDOMDocument *nsdoc;
|
||||
nsIDOMElement *nselem;
|
||||
HTMLElement *elem;
|
||||
nsAString tag_str;
|
||||
@@ -950,12 +1081,14 @@ static HRESULT WINAPI HTMLDocument_createElement(IHTMLDocument2 *iface, BSTR eTa
|
||||
|
||||
TRACE("(%p)->(%s %p)\n", This, debugstr_w(eTag), newElem);
|
||||
|
||||
nsIWebNavigation_GetDocument(This->nscontainer->navigation, &nsdoc);
|
||||
if(!This->nsdoc) {
|
||||
WARN("NULL nsdoc\n");
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
nsAString_Init(&tag_str, eTag);
|
||||
nsres = nsIDOMDocument_CreateElement(nsdoc, &tag_str, &nselem);
|
||||
nsres = nsIDOMDocument_CreateElement(This->nsdoc, &tag_str, &nselem);
|
||||
nsAString_Finish(&tag_str);
|
||||
nsIDOMDocument_Release(nsdoc);
|
||||
if(NS_FAILED(nsres)) {
|
||||
ERR("CreateElement failed: %08x\n", nsres);
|
||||
return E_FAIL;
|
||||
@@ -1014,29 +1147,37 @@ static HRESULT WINAPI HTMLDocument_get_ondblclick(IHTMLDocument2 *iface, VARIANT
|
||||
static HRESULT WINAPI HTMLDocument_put_onkeyup(IHTMLDocument2 *iface, VARIANT v)
|
||||
{
|
||||
HTMLDocument *This = HTMLDOC_THIS(iface);
|
||||
FIXME("(%p)\n", This);
|
||||
return E_NOTIMPL;
|
||||
|
||||
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
|
||||
|
||||
return set_doc_event(This, EVENTID_KEYUP, &v);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLDocument_get_onkeyup(IHTMLDocument2 *iface, VARIANT *p)
|
||||
{
|
||||
HTMLDocument *This = HTMLDOC_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
|
||||
TRACE("(%p)->(%p)\n", This, p);
|
||||
|
||||
return get_doc_event(This, EVENTID_KEYUP, p);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLDocument_put_onkeydown(IHTMLDocument2 *iface, VARIANT v)
|
||||
{
|
||||
HTMLDocument *This = HTMLDOC_THIS(iface);
|
||||
FIXME("(%p)\n", This);
|
||||
return E_NOTIMPL;
|
||||
|
||||
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
|
||||
|
||||
return set_doc_event(This, EVENTID_KEYDOWN, &v);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLDocument_get_onkeydown(IHTMLDocument2 *iface, VARIANT *p)
|
||||
{
|
||||
HTMLDocument *This = HTMLDOC_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
|
||||
TRACE("(%p)->(%p)\n", This, p);
|
||||
|
||||
return get_doc_event(This, EVENTID_KEYDOWN, p);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLDocument_put_onkeypress(IHTMLDocument2 *iface, VARIANT v)
|
||||
@@ -1112,15 +1253,19 @@ static HRESULT WINAPI HTMLDocument_get_onmouseout(IHTMLDocument2 *iface, VARIANT
|
||||
static HRESULT WINAPI HTMLDocument_put_onmouseover(IHTMLDocument2 *iface, VARIANT v)
|
||||
{
|
||||
HTMLDocument *This = HTMLDOC_THIS(iface);
|
||||
FIXME("(%p)\n", This);
|
||||
return E_NOTIMPL;
|
||||
|
||||
TRACE("(%p)\n", This);
|
||||
|
||||
return set_doc_event(This, EVENTID_MOUSEOVER, &v);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLDocument_get_onmouseover(IHTMLDocument2 *iface, VARIANT *p)
|
||||
{
|
||||
HTMLDocument *This = HTMLDOC_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
|
||||
TRACE("(%p)->(%p)\n", This, p);
|
||||
|
||||
return get_doc_event(This, EVENTID_MOUSEOVER, p);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLDocument_put_onreadystatechange(IHTMLDocument2 *iface, VARIANT v)
|
||||
@@ -1182,29 +1327,37 @@ static HRESULT WINAPI HTMLDocument_get_onrowenter(IHTMLDocument2 *iface, VARIANT
|
||||
static HRESULT WINAPI HTMLDocument_put_ondragstart(IHTMLDocument2 *iface, VARIANT v)
|
||||
{
|
||||
HTMLDocument *This = HTMLDOC_THIS(iface);
|
||||
FIXME("(%p)\n", This);
|
||||
return E_NOTIMPL;
|
||||
|
||||
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
|
||||
|
||||
return set_doc_event(This, EVENTID_DRAGSTART, &v);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLDocument_get_ondragstart(IHTMLDocument2 *iface, VARIANT *p)
|
||||
{
|
||||
HTMLDocument *This = HTMLDOC_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
|
||||
TRACE("(%p)->(%p)\n", This, p);
|
||||
|
||||
return get_doc_event(This, EVENTID_DRAGSTART, p);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLDocument_put_onselectstart(IHTMLDocument2 *iface, VARIANT v)
|
||||
{
|
||||
HTMLDocument *This = HTMLDOC_THIS(iface);
|
||||
FIXME("(%p)\n", This);
|
||||
return E_NOTIMPL;
|
||||
|
||||
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
|
||||
|
||||
return set_doc_event(This, EVENTID_SELECTSTART, &v);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLDocument_get_onselectstart(IHTMLDocument2 *iface, VARIANT *p)
|
||||
{
|
||||
HTMLDocument *This = HTMLDOC_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
|
||||
TRACE("(%p)->(%p)\n", This, p);
|
||||
|
||||
return get_doc_event(This, EVENTID_SELECTSTART, p);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLDocument_elementFromPoint(IHTMLDocument2 *iface, long x, long y,
|
||||
@@ -1232,30 +1385,24 @@ static HRESULT WINAPI HTMLDocument_get_styleSheets(IHTMLDocument2 *iface,
|
||||
HTMLDocument *This = HTMLDOC_THIS(iface);
|
||||
nsIDOMStyleSheetList *nsstylelist;
|
||||
nsIDOMDocumentStyle *nsdocstyle;
|
||||
nsIDOMDocument *nsdoc;
|
||||
nsresult nsres;
|
||||
|
||||
TRACE("(%p)->(%p)\n", This, p);
|
||||
|
||||
*p = NULL;
|
||||
|
||||
if(!This->nscontainer)
|
||||
return S_OK;
|
||||
|
||||
nsres = nsIWebNavigation_GetDocument(This->nscontainer->navigation, &nsdoc);
|
||||
if(NS_FAILED(nsres)) {
|
||||
ERR("GetDocument failed: %08x\n", nsres);
|
||||
return S_OK;
|
||||
if(!This->nsdoc) {
|
||||
WARN("NULL nsdoc\n");
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
if(NS_FAILED(nsres) || !nsdoc)
|
||||
return S_OK;
|
||||
|
||||
nsIDOMDocument_QueryInterface(nsdoc, &IID_nsIDOMDocumentStyle, (void**)&nsdocstyle);
|
||||
nsIDOMDocument_Release(nsdoc);
|
||||
|
||||
nsIDOMDocumentStyle_GetStyleSheets(nsdocstyle, &nsstylelist);
|
||||
nsIDOMHTMLDocument_QueryInterface(This->nsdoc, &IID_nsIDOMDocumentStyle, (void**)&nsdocstyle);
|
||||
nsres = nsIDOMDocumentStyle_GetStyleSheets(nsdocstyle, &nsstylelist);
|
||||
nsIDOMDocumentStyle_Release(nsdocstyle);
|
||||
if(NS_FAILED(nsres)) {
|
||||
ERR("GetStyleSheets failed: %08x\n", nsres);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
*p = HTMLStyleSheetsCollection_Create(nsstylelist);
|
||||
nsIDOMDocumentStyle_Release(nsstylelist);
|
||||
@@ -1428,6 +1575,39 @@ static const IHTMLDocument2Vtbl HTMLDocumentVtbl = {
|
||||
HTMLDocument_createStyleSheet
|
||||
};
|
||||
|
||||
#define SUPPINFO_THIS(iface) DEFINE_THIS(HTMLDocument, SupportErrorInfo, iface)
|
||||
|
||||
static HRESULT WINAPI SupportErrorInfo_QueryInterface(ISupportErrorInfo *iface, REFIID riid, void **ppv)
|
||||
{
|
||||
HTMLDocument *This = SUPPINFO_THIS(iface);
|
||||
return IHTMLDocument_QueryInterface(HTMLDOC(This), riid, ppv);
|
||||
}
|
||||
|
||||
static ULONG WINAPI SupportErrorInfo_AddRef(ISupportErrorInfo *iface)
|
||||
{
|
||||
HTMLDocument *This = SUPPINFO_THIS(iface);
|
||||
return IHTMLDocument_AddRef(HTMLDOC(This));
|
||||
}
|
||||
|
||||
static ULONG WINAPI SupportErrorInfo_Release(ISupportErrorInfo *iface)
|
||||
{
|
||||
HTMLDocument *This = SUPPINFO_THIS(iface);
|
||||
return IHTMLDocument_Release(HTMLDOC(This));
|
||||
}
|
||||
|
||||
static HRESULT WINAPI SupportErrorInfo_InterfaceSupportsErrorInfo(ISupportErrorInfo *iface, REFIID riid)
|
||||
{
|
||||
FIXME("(%p)->(%s)\n", iface, debugstr_guid(riid));
|
||||
return S_FALSE;
|
||||
}
|
||||
|
||||
static const ISupportErrorInfoVtbl SupportErrorInfoVtbl = {
|
||||
SupportErrorInfo_QueryInterface,
|
||||
SupportErrorInfo_AddRef,
|
||||
SupportErrorInfo_Release,
|
||||
SupportErrorInfo_InterfaceSupportsErrorInfo
|
||||
};
|
||||
|
||||
#define DISPEX_THIS(iface) DEFINE_THIS(HTMLDocument, IDispatchEx, iface)
|
||||
|
||||
static HRESULT WINAPI DocDispatchEx_QueryInterface(IDispatchEx *iface, REFIID riid, void **ppv)
|
||||
@@ -1591,53 +1771,103 @@ static dispex_static_data_t HTMLDocument_dispex = {
|
||||
HTMLDocument_iface_tids
|
||||
};
|
||||
|
||||
static HRESULT alloc_doc(HTMLDocument **ret)
|
||||
{
|
||||
HTMLDocument *doc;
|
||||
|
||||
doc = heap_alloc_zero(sizeof(HTMLDocument));
|
||||
doc->lpHTMLDocument2Vtbl = &HTMLDocumentVtbl;
|
||||
doc->lpIDispatchExVtbl = &DocDispatchExVtbl;
|
||||
doc->lpSupportErrorInfoVtbl = &SupportErrorInfoVtbl;
|
||||
doc->ref = 1;
|
||||
doc->readystate = READYSTATE_UNINITIALIZED;
|
||||
doc->scriptmode = SCRIPTMODE_GECKO;
|
||||
|
||||
list_init(&doc->bindings);
|
||||
list_init(&doc->script_hosts);
|
||||
list_init(&doc->selection_list);
|
||||
list_init(&doc->range_list);
|
||||
|
||||
HTMLDocument_HTMLDocument3_Init(doc);
|
||||
HTMLDocument_HTMLDocument5_Init(doc);
|
||||
HTMLDocument_Persist_Init(doc);
|
||||
HTMLDocument_OleCmd_Init(doc);
|
||||
HTMLDocument_OleObj_Init(doc);
|
||||
HTMLDocument_View_Init(doc);
|
||||
HTMLDocument_Window_Init(doc);
|
||||
HTMLDocument_Service_Init(doc);
|
||||
HTMLDocument_Hlink_Init(doc);
|
||||
|
||||
ConnectionPointContainer_Init(&doc->cp_container, (IUnknown*)HTMLDOC(doc));
|
||||
ConnectionPoint_Init(&doc->cp_propnotif, &doc->cp_container, &IID_IPropertyNotifySink);
|
||||
ConnectionPoint_Init(&doc->cp_htmldocevents, &doc->cp_container, &DIID_HTMLDocumentEvents);
|
||||
ConnectionPoint_Init(&doc->cp_htmldocevents2, &doc->cp_container, &DIID_HTMLDocumentEvents2);
|
||||
|
||||
init_dispex(&doc->dispex, (IUnknown*)HTMLDOC(doc), &HTMLDocument_dispex);
|
||||
|
||||
*ret = doc;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT create_doc_from_nsdoc(nsIDOMHTMLDocument *nsdoc, HTMLDocument **ret)
|
||||
{
|
||||
HTMLDocument *doc;
|
||||
HRESULT hres;
|
||||
|
||||
hres = alloc_doc(&doc);
|
||||
if(FAILED(hres))
|
||||
return hres;
|
||||
|
||||
nsIDOMHTMLDocument_AddRef(nsdoc);
|
||||
doc->nsdoc = nsdoc;
|
||||
|
||||
hres = HTMLWindow_Create(doc, NULL, &doc->window);
|
||||
if(FAILED(hres)) {
|
||||
IHTMLDocument_Release(HTMLDOC(doc));
|
||||
return hres;
|
||||
}
|
||||
|
||||
*ret = doc;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT HTMLDocument_Create(IUnknown *pUnkOuter, REFIID riid, void** ppvObject)
|
||||
{
|
||||
HTMLDocument *ret;
|
||||
HTMLDocument *doc;
|
||||
nsIDOMWindow *nswindow = NULL;
|
||||
HRESULT hres;
|
||||
|
||||
TRACE("(%p %s %p)\n", pUnkOuter, debugstr_guid(riid), ppvObject);
|
||||
|
||||
ret = heap_alloc_zero(sizeof(HTMLDocument));
|
||||
ret->lpHTMLDocument2Vtbl = &HTMLDocumentVtbl;
|
||||
ret->lpIDispatchExVtbl = &DocDispatchExVtbl;
|
||||
ret->ref = 0;
|
||||
ret->readystate = READYSTATE_UNINITIALIZED;
|
||||
hres = alloc_doc(&doc);
|
||||
if(FAILED(hres))
|
||||
return hres;
|
||||
|
||||
list_init(&ret->bindings);
|
||||
list_init(&ret->script_hosts);
|
||||
list_init(&ret->selection_list);
|
||||
list_init(&ret->range_list);
|
||||
hres = IHTMLDocument_QueryInterface(HTMLDOC(doc), riid, ppvObject);
|
||||
IHTMLDocument_Release(HTMLDOC(doc));
|
||||
if(FAILED(hres))
|
||||
return hres;
|
||||
|
||||
hres = IHTMLDocument_QueryInterface(HTMLDOC(ret), riid, ppvObject);
|
||||
doc->nscontainer = NSContainer_Create(doc, NULL);
|
||||
update_nsdocument(doc);
|
||||
|
||||
if(doc->nscontainer) {
|
||||
nsresult nsres;
|
||||
|
||||
nsres = nsIWebBrowser_GetContentDOMWindow(doc->nscontainer->webbrowser, &nswindow);
|
||||
if(NS_FAILED(nsres))
|
||||
ERR("GetContentDOMWindow failed: %08x\n", nsres);
|
||||
}
|
||||
|
||||
hres = HTMLWindow_Create(doc, nswindow, &doc->window);
|
||||
if(nswindow)
|
||||
nsIDOMWindow_Release(nswindow);
|
||||
if(FAILED(hres)) {
|
||||
heap_free(ret);
|
||||
IHTMLDocument_Release(HTMLDOC(doc));
|
||||
return hres;
|
||||
}
|
||||
|
||||
LOCK_MODULE();
|
||||
|
||||
HTMLDocument_HTMLDocument3_Init(ret);
|
||||
HTMLDocument_HTMLDocument5_Init(ret);
|
||||
HTMLDocument_Persist_Init(ret);
|
||||
HTMLDocument_OleCmd_Init(ret);
|
||||
HTMLDocument_OleObj_Init(ret);
|
||||
HTMLDocument_View_Init(ret);
|
||||
HTMLDocument_Window_Init(ret);
|
||||
HTMLDocument_Service_Init(ret);
|
||||
HTMLDocument_Hlink_Init(ret);
|
||||
|
||||
ConnectionPointContainer_Init(&ret->cp_container, (IUnknown*)HTMLDOC(ret));
|
||||
ConnectionPoint_Init(&ret->cp_propnotif, &ret->cp_container, &IID_IPropertyNotifySink);
|
||||
ConnectionPoint_Init(&ret->cp_htmldocevents, &ret->cp_container, &DIID_HTMLDocumentEvents);
|
||||
ConnectionPoint_Init(&ret->cp_htmldocevents2, &ret->cp_container, &DIID_HTMLDocumentEvents2);
|
||||
|
||||
init_dispex(&ret->dispex, (IUnknown*)HTMLDOC(ret), &HTMLDocument_dispex);
|
||||
|
||||
ret->nscontainer = NSContainer_Create(ret, NULL);
|
||||
ret->window = HTMLWindow_Create(ret);
|
||||
|
||||
get_thread_hwnd();
|
||||
|
||||
return hres;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -58,16 +58,14 @@ static ULONG WINAPI HTMLDocument3_Release(IHTMLDocument3 *iface)
|
||||
static HRESULT WINAPI HTMLDocument3_GetTypeInfoCount(IHTMLDocument3 *iface, UINT *pctinfo)
|
||||
{
|
||||
HTMLDocument *This = HTMLDOC3_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, pctinfo);
|
||||
return E_NOTIMPL;
|
||||
return IDispatchEx_GetTypeInfoCount(DISPATCHEX(This), pctinfo);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLDocument3_GetTypeInfo(IHTMLDocument3 *iface, UINT iTInfo,
|
||||
LCID lcid, ITypeInfo **ppTInfo)
|
||||
{
|
||||
HTMLDocument *This = HTMLDOC3_THIS(iface);
|
||||
FIXME("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo);
|
||||
return E_NOTIMPL;
|
||||
return IDispatchEx_GetTypeInfo(DISPATCHEX(This), iTInfo, lcid, ppTInfo);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLDocument3_GetIDsOfNames(IHTMLDocument3 *iface, REFIID riid,
|
||||
@@ -75,9 +73,7 @@ static HRESULT WINAPI HTMLDocument3_GetIDsOfNames(IHTMLDocument3 *iface, REFIID
|
||||
LCID lcid, DISPID *rgDispId)
|
||||
{
|
||||
HTMLDocument *This = HTMLDOC3_THIS(iface);
|
||||
FIXME("(%p)->(%s %p %u %u %p)\n", This, debugstr_guid(riid), rgszNames, cNames,
|
||||
lcid, rgDispId);
|
||||
return E_NOTIMPL;
|
||||
return IDispatchEx_GetIDsOfNames(DISPATCHEX(This), riid, rgszNames, cNames, lcid, rgDispId);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLDocument3_Invoke(IHTMLDocument3 *iface, DISPID dispIdMember,
|
||||
@@ -85,9 +81,8 @@ static HRESULT WINAPI HTMLDocument3_Invoke(IHTMLDocument3 *iface, DISPID dispIdM
|
||||
VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
|
||||
{
|
||||
HTMLDocument *This = HTMLDOC3_THIS(iface);
|
||||
FIXME("(%p)->(%d %s %d %d %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid),
|
||||
lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
|
||||
return E_NOTIMPL;
|
||||
return IDispatchEx_Invoke(DISPATCHEX(This), dispIdMember, riid, lcid, wFlags, pDispParams,
|
||||
pVarResult, pExcepInfo, puArgErr);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLDocument3_releaseCapture(IHTMLDocument3 *iface)
|
||||
@@ -108,7 +103,6 @@ static HRESULT WINAPI HTMLDocument3_createTextNode(IHTMLDocument3 *iface, BSTR t
|
||||
IHTMLDOMNode **newTextNode)
|
||||
{
|
||||
HTMLDocument *This = HTMLDOC3_THIS(iface);
|
||||
nsIDOMDocument *nsdoc;
|
||||
nsIDOMText *nstext;
|
||||
HTMLDOMNode *node;
|
||||
nsAString text_str;
|
||||
@@ -116,12 +110,14 @@ static HRESULT WINAPI HTMLDocument3_createTextNode(IHTMLDocument3 *iface, BSTR t
|
||||
|
||||
TRACE("(%p)->(%s %p)\n", This, debugstr_w(text), newTextNode);
|
||||
|
||||
nsIWebNavigation_GetDocument(This->nscontainer->navigation, &nsdoc);
|
||||
if(!This->nsdoc) {
|
||||
WARN("NULL nsdoc\n");
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
nsAString_Init(&text_str, text);
|
||||
nsres = nsIDOMDocument_CreateTextNode(nsdoc, &text_str, &nstext);
|
||||
nsres = nsIDOMHTMLDocument_CreateTextNode(This->nsdoc, &text_str, &nstext);
|
||||
nsAString_Finish(&text_str);
|
||||
nsIDOMDocument_Release(nsdoc);
|
||||
if(NS_FAILED(nsres)) {
|
||||
ERR("CreateTextNode failed: %08x\n", nsres);
|
||||
return E_FAIL;
|
||||
@@ -138,31 +134,26 @@ static HRESULT WINAPI HTMLDocument3_createTextNode(IHTMLDocument3 *iface, BSTR t
|
||||
static HRESULT WINAPI HTMLDocument3_get_documentElement(IHTMLDocument3 *iface, IHTMLElement **p)
|
||||
{
|
||||
HTMLDocument *This = HTMLDOC3_THIS(iface);
|
||||
nsIDOMDocument *nsdoc;
|
||||
HTMLDOMNode *node;
|
||||
nsIDOMElement *nselem = NULL;
|
||||
HTMLDOMNode *node;
|
||||
nsresult nsres;
|
||||
|
||||
TRACE("(%p)->(%p)\n", This, p);
|
||||
|
||||
if(!This->nscontainer) {
|
||||
*p = NULL;
|
||||
return S_OK;
|
||||
if(!This->nsdoc) {
|
||||
WARN("NULL nsdoc\n");
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
nsres = nsIWebNavigation_GetDocument(This->nscontainer->navigation, &nsdoc);
|
||||
if(NS_FAILED(nsres))
|
||||
ERR("GetDocument failed: %08x\n", nsres);
|
||||
|
||||
if(nsdoc) {
|
||||
nsres = nsIDOMHTMLDocument_GetDocumentElement(nsdoc, &nselem);
|
||||
if(NS_FAILED(nsres))
|
||||
ERR("GetDocumentElement failed: %08x\n", nsres);
|
||||
nsres = nsIDOMHTMLDocument_GetDocumentElement(This->nsdoc, &nselem);
|
||||
if(NS_FAILED(nsres)) {
|
||||
ERR("GetDocumentElement failed: %08x\n", nsres);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if(nselem) {
|
||||
node = get_node(This, (nsIDOMNode *)nselem, TRUE);
|
||||
nsIDOMDocument_Release(nsdoc);
|
||||
|
||||
nsIDOMElement_Release(nselem);
|
||||
IHTMLDOMNode_QueryInterface(HTMLDOMNODE(node), &IID_IHTMLElement, (void**)p);
|
||||
}else {
|
||||
*p = NULL;
|
||||
@@ -430,37 +421,36 @@ static HRESULT WINAPI HTMLDocument3_getElementById(IHTMLDocument3 *iface, BSTR v
|
||||
IHTMLElement **pel)
|
||||
{
|
||||
HTMLDocument *This = HTMLDOC3_THIS(iface);
|
||||
nsIDOMDocument *nsdoc = NULL;
|
||||
nsIDOMElement *nselem = NULL;
|
||||
nsIDOMElement *nselem;
|
||||
HTMLDOMNode *node;
|
||||
nsAString id_str;
|
||||
nsresult nsres;
|
||||
|
||||
TRACE("(%p)->(%s %p)\n", This, debugstr_w(v), pel);
|
||||
|
||||
*pel = NULL;
|
||||
|
||||
if(!This->nscontainer)
|
||||
return S_OK;
|
||||
|
||||
nsres = nsIWebNavigation_GetDocument(This->nscontainer->navigation, &nsdoc);
|
||||
if(NS_FAILED(nsres) || !nsdoc)
|
||||
return S_OK;
|
||||
|
||||
nsAString_Init(&id_str, v);
|
||||
nsIDOMDocument_GetElementById(nsdoc, &id_str, &nselem);
|
||||
nsIDOMDocument_Release(nsdoc);
|
||||
nsAString_Finish(&id_str);
|
||||
|
||||
if(!nselem) {
|
||||
*pel = NULL;
|
||||
return S_OK;
|
||||
if(!This->nsdoc) {
|
||||
WARN("NULL nsdoc\n");
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
node = get_node(This, (nsIDOMNode*)nselem, TRUE);
|
||||
nsIDOMElement_Release(nselem);
|
||||
nsAString_Init(&id_str, v);
|
||||
nsres = nsIDOMHTMLDocument_GetElementById(This->nsdoc, &id_str, &nselem);
|
||||
nsAString_Finish(&id_str);
|
||||
if(FAILED(nsres)) {
|
||||
ERR("GetElementById failed: %08x\n", nsres);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
return IHTMLDOMNode_QueryInterface(HTMLDOMNODE(node), &IID_IHTMLElement, (void**)pel);
|
||||
if(nselem) {
|
||||
node = get_node(This, (nsIDOMNode*)nselem, TRUE);
|
||||
nsIDOMElement_Release(nselem);
|
||||
|
||||
IHTMLDOMNode_QueryInterface(HTMLDOMNODE(node), &IID_IHTMLElement, (void**)pel);
|
||||
}else {
|
||||
*pel = NULL;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
||||
@@ -468,8 +458,32 @@ static HRESULT WINAPI HTMLDocument3_getElementsByTagName(IHTMLDocument3 *iface,
|
||||
IHTMLElementCollection **pelColl)
|
||||
{
|
||||
HTMLDocument *This = HTMLDOC3_THIS(iface);
|
||||
FIXME("(%p)->(%s %p)\n", This, debugstr_w(v), pelColl);
|
||||
return E_NOTIMPL;
|
||||
nsIDOMNodeList *nslist;
|
||||
nsAString id_str, ns_str;
|
||||
nsresult nsres;
|
||||
static const WCHAR str[] = {'*',0};
|
||||
|
||||
TRACE("(%p)->(%s %p)\n", This, debugstr_w(v), pelColl);
|
||||
|
||||
if(!This->nsdoc) {
|
||||
WARN("NULL nsdoc\n");
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
nsAString_Init(&id_str, v);
|
||||
nsAString_Init(&ns_str, str);
|
||||
nsres = nsIDOMHTMLDocument_GetElementsByTagNameNS(This->nsdoc, &ns_str, &id_str, &nslist);
|
||||
nsAString_Finish(&id_str);
|
||||
nsAString_Finish(&ns_str);
|
||||
if(FAILED(nsres)) {
|
||||
ERR("GetElementByName failed: %08x\n", nsres);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
*pelColl = (IHTMLElementCollection*)create_collection_from_nodelist(This, (IUnknown*)HTMLDOC3(This), nslist);
|
||||
nsIDOMNodeList_Release(nslist);
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
#undef HTMLDOC3_THIS
|
||||
@@ -549,16 +563,14 @@ static ULONG WINAPI HTMLDocument4_Release(IHTMLDocument4 *iface)
|
||||
static HRESULT WINAPI HTMLDocument4_GetTypeInfoCount(IHTMLDocument4 *iface, UINT *pctinfo)
|
||||
{
|
||||
HTMLDocument *This = HTMLDOC4_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, pctinfo);
|
||||
return E_NOTIMPL;
|
||||
return IDispatchEx_GetTypeInfoCount(DISPATCHEX(This), pctinfo);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLDocument4_GetTypeInfo(IHTMLDocument4 *iface, UINT iTInfo,
|
||||
LCID lcid, ITypeInfo **ppTInfo)
|
||||
{
|
||||
HTMLDocument *This = HTMLDOC4_THIS(iface);
|
||||
FIXME("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo);
|
||||
return E_NOTIMPL;
|
||||
return IDispatchEx_GetTypeInfo(DISPATCHEX(This), iTInfo, lcid, ppTInfo);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLDocument4_GetIDsOfNames(IHTMLDocument4 *iface, REFIID riid,
|
||||
@@ -566,9 +578,7 @@ static HRESULT WINAPI HTMLDocument4_GetIDsOfNames(IHTMLDocument4 *iface, REFIID
|
||||
LCID lcid, DISPID *rgDispId)
|
||||
{
|
||||
HTMLDocument *This = HTMLDOC4_THIS(iface);
|
||||
FIXME("(%p)->(%s %p %u %u %p)\n", This, debugstr_guid(riid), rgszNames, cNames,
|
||||
lcid, rgDispId);
|
||||
return E_NOTIMPL;
|
||||
return IDispatchEx_GetIDsOfNames(DISPATCHEX(This), riid, rgszNames, cNames, lcid, rgDispId);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLDocument4_Invoke(IHTMLDocument4 *iface, DISPID dispIdMember,
|
||||
@@ -576,16 +586,40 @@ static HRESULT WINAPI HTMLDocument4_Invoke(IHTMLDocument4 *iface, DISPID dispIdM
|
||||
VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
|
||||
{
|
||||
HTMLDocument *This = HTMLDOC4_THIS(iface);
|
||||
FIXME("(%p)->(%d %s %d %d %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid),
|
||||
lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
|
||||
return E_NOTIMPL;
|
||||
return IDispatchEx_Invoke(DISPATCHEX(This), dispIdMember, riid, lcid, wFlags, pDispParams,
|
||||
pVarResult, pExcepInfo, puArgErr);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLDocument4_focus(IHTMLDocument4 *iface)
|
||||
{
|
||||
HTMLDocument *This = HTMLDOC4_THIS(iface);
|
||||
FIXME("(%p)->()\n", This);
|
||||
return E_NOTIMPL;
|
||||
nsIDOMNSHTMLElement *nselem;
|
||||
nsIDOMHTMLElement *nsbody;
|
||||
nsresult nsres;
|
||||
|
||||
TRACE("(%p)->()\n", This);
|
||||
|
||||
nsres = nsIDOMHTMLDocument_GetBody(This->nsdoc, &nsbody);
|
||||
if(NS_FAILED(nsres) || !nsbody) {
|
||||
ERR("GetBody failed: %08x\n", nsres);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
nsres = nsIDOMHTMLElement_QueryInterface(nsbody, &IID_nsIDOMNSHTMLElement, (void**)&nselem);
|
||||
nsIDOMHTMLElement_Release(nsbody);
|
||||
if(NS_FAILED(nsres)) {
|
||||
ERR("Could not get nsIDOMNSHTMLElement: %08x\n", nsres);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
nsres = nsIDOMNSHTMLElement_focus(nselem);
|
||||
nsIDOMNSHTMLElement_Release(nselem);
|
||||
if(NS_FAILED(nsres)) {
|
||||
ERR("Focus failed: %08x\n", nsres);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLDocument4_hasFocus(IHTMLDocument4 *iface, VARIANT_BOOL *pfFocus)
|
||||
|
||||
@@ -58,25 +58,21 @@ static ULONG WINAPI HTMLDocument5_Release(IHTMLDocument5 *iface)
|
||||
static HRESULT WINAPI HTMLDocument5_GetTypeInfoCount(IHTMLDocument5 *iface, UINT *pctinfo)
|
||||
{
|
||||
HTMLDocument *This = HTMLDOC5_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, pctinfo);
|
||||
return E_NOTIMPL;
|
||||
return IDispatchEx_GetTypeInfoCount(DISPATCHEX(This), pctinfo);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLDocument5_GetTypeInfo(IHTMLDocument5 *iface, UINT iTInfo,
|
||||
LCID lcid, ITypeInfo **ppTInfo)
|
||||
{
|
||||
HTMLDocument *This = HTMLDOC5_THIS(iface);
|
||||
FIXME("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo);
|
||||
return E_NOTIMPL;
|
||||
return IDispatchEx_GetTypeInfo(DISPATCHEX(This), iTInfo, lcid, ppTInfo);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLDocument5_GetIDsOfNames(IHTMLDocument5 *iface, REFIID riid,
|
||||
LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
|
||||
{
|
||||
HTMLDocument *This = HTMLDOC5_THIS(iface);
|
||||
FIXME("(%p)->(%s %p %u %u %p)\n", This, debugstr_guid(riid), rgszNames, cNames,
|
||||
lcid, rgDispId);
|
||||
return E_NOTIMPL;
|
||||
return IDispatchEx_GetIDsOfNames(DISPATCHEX(This), riid, rgszNames, cNames, lcid, rgDispId);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLDocument5_Invoke(IHTMLDocument5 *iface, DISPID dispIdMember,
|
||||
@@ -84,9 +80,8 @@ static HRESULT WINAPI HTMLDocument5_Invoke(IHTMLDocument5 *iface, DISPID dispIdM
|
||||
VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
|
||||
{
|
||||
HTMLDocument *This = HTMLDOC5_THIS(iface);
|
||||
FIXME("(%p)->(%d %s %d %d %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid),
|
||||
lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
|
||||
return E_NOTIMPL;
|
||||
return IDispatchEx_Invoke(DISPATCHEX(This), dispIdMember, riid, lcid, wFlags, pDispParams,
|
||||
pVarResult, pExcepInfo, puArgErr);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLDocument5_put_onmousewheel(IHTMLDocument5 *iface, VARIANT v)
|
||||
@@ -129,8 +124,32 @@ static HRESULT WINAPI HTMLDocument5_createComment(IHTMLDocument5 *iface, BSTR bs
|
||||
IHTMLDOMNode **ppRetNode)
|
||||
{
|
||||
HTMLDocument *This = HTMLDOC5_THIS(iface);
|
||||
FIXME("(%p)->(%s %p)\n", This, debugstr_w(bstrdata), ppRetNode);
|
||||
return E_NOTIMPL;
|
||||
nsIDOMComment *nscomment;
|
||||
HTMLDOMNode *node;
|
||||
nsAString str;
|
||||
nsresult nsres;
|
||||
|
||||
TRACE("(%p)->(%s %p)\n", This, debugstr_w(bstrdata), ppRetNode);
|
||||
|
||||
if(!This->nsdoc) {
|
||||
WARN("NULL nsdoc\n");
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
nsAString_Init(&str, bstrdata);
|
||||
nsres = nsIDOMHTMLDocument_CreateComment(This->nsdoc, &str, &nscomment);
|
||||
nsAString_Finish(&str);
|
||||
if(NS_FAILED(nsres)) {
|
||||
ERR("CreateTextNode failed: %08x\n", nsres);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
node = &HTMLCommentElement_Create(This, (nsIDOMNode*)nscomment)->node;
|
||||
nsIDOMElement_Release(nscomment);
|
||||
|
||||
*ppRetNode = HTMLDOMNODE(node);
|
||||
IHTMLDOMNode_AddRef(HTMLDOMNODE(node));
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLDocument5_put_onfocusin(IHTMLDocument5 *iface, VARIANT v)
|
||||
@@ -220,7 +239,6 @@ static HRESULT WINAPI HTMLDocument5_get_onbeforedeactivate(IHTMLDocument5 *iface
|
||||
static HRESULT WINAPI HTMLDocument5_get_compatMode(IHTMLDocument5 *iface, BSTR *p)
|
||||
{
|
||||
HTMLDocument *This = HTMLDOC5_THIS(iface);
|
||||
nsIDOMDocument *nsdoc;
|
||||
nsIDOMNSHTMLDocument *nshtmldoc;
|
||||
nsAString mode_str;
|
||||
const PRUnichar *mode;
|
||||
@@ -228,12 +246,12 @@ static HRESULT WINAPI HTMLDocument5_get_compatMode(IHTMLDocument5 *iface, BSTR *
|
||||
|
||||
TRACE("(%p)->(%p)\n", This, p);
|
||||
|
||||
nsres = nsIWebNavigation_GetDocument(This->nscontainer->navigation, &nsdoc);
|
||||
if(NS_FAILED(nsres))
|
||||
ERR("GetDocument failed: %08x\n", nsres);
|
||||
if(!This->nsdoc) {
|
||||
WARN("NULL nsdoc\n");
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
nsres = nsIDOMDocument_QueryInterface(nsdoc, &IID_nsIDOMNSHTMLDocument, (void**)&nshtmldoc);
|
||||
nsIDOMDocument_Release(nsdoc);
|
||||
nsres = nsIDOMHTMLDocument_QueryInterface(This->nsdoc, &IID_nsIDOMNSHTMLDocument, (void**)&nshtmldoc);
|
||||
if(NS_FAILED(nsres)) {
|
||||
ERR("Could not get nsIDOMNSHTMLDocument: %08x\n", nsres);
|
||||
return S_OK;
|
||||
|
||||
+159
-588
@@ -32,48 +32,10 @@
|
||||
#include "wine/unicode.h"
|
||||
|
||||
#include "mshtml_private.h"
|
||||
#include "htmlevent.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
|
||||
|
||||
static IHTMLElementCollection *HTMLElementCollection_Create(IUnknown*,HTMLElement**,DWORD);
|
||||
|
||||
typedef struct {
|
||||
HTMLElement **buf;
|
||||
DWORD len;
|
||||
DWORD size;
|
||||
} elem_vector;
|
||||
|
||||
static void elem_vector_add(elem_vector *buf, HTMLElement *elem)
|
||||
{
|
||||
if(buf->len == buf->size) {
|
||||
buf->size <<= 1;
|
||||
buf->buf = heap_realloc(buf->buf, buf->size*sizeof(HTMLElement**));
|
||||
}
|
||||
|
||||
buf->buf[buf->len++] = elem;
|
||||
}
|
||||
|
||||
static void elem_vector_normalize(elem_vector *buf)
|
||||
{
|
||||
if(!buf->len) {
|
||||
heap_free(buf->buf);
|
||||
buf->buf = NULL;
|
||||
}else if(buf->size > buf->len) {
|
||||
buf->buf = heap_realloc(buf->buf, buf->len*sizeof(HTMLElement**));
|
||||
}
|
||||
|
||||
buf->size = buf->len;
|
||||
}
|
||||
|
||||
static BOOL is_elem_node(nsIDOMNode *node)
|
||||
{
|
||||
PRUint16 type=0;
|
||||
|
||||
nsIDOMNode_GetNodeType(node, &type);
|
||||
|
||||
return type == ELEMENT_NODE || type == COMMENT_NODE;
|
||||
}
|
||||
|
||||
#define HTMLELEM_THIS(iface) DEFINE_THIS(HTMLElement, HTMLElement, iface)
|
||||
|
||||
#define HTMLELEM_NODE_THIS(iface) DEFINE_THIS2(HTMLElement, node, iface)
|
||||
@@ -460,8 +422,10 @@ static HRESULT WINAPI HTMLElement_put_onclick(IHTMLElement *iface, VARIANT v)
|
||||
static HRESULT WINAPI HTMLElement_get_onclick(IHTMLElement *iface, VARIANT *p)
|
||||
{
|
||||
HTMLElement *This = HTMLELEM_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
|
||||
TRACE("(%p)->(%p)\n", This, p);
|
||||
|
||||
return get_node_event(&This->node, EVENTID_CLICK, p);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLElement_put_ondblclick(IHTMLElement *iface, VARIANT v)
|
||||
@@ -481,15 +445,19 @@ static HRESULT WINAPI HTMLElement_get_ondblclick(IHTMLElement *iface, VARIANT *p
|
||||
static HRESULT WINAPI HTMLElement_put_onkeydown(IHTMLElement *iface, VARIANT v)
|
||||
{
|
||||
HTMLElement *This = HTMLELEM_THIS(iface);
|
||||
FIXME("(%p)->()\n", This);
|
||||
return E_NOTIMPL;
|
||||
|
||||
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
|
||||
|
||||
return set_node_event(&This->node, EVENTID_KEYDOWN, &v);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLElement_get_onkeydown(IHTMLElement *iface, VARIANT *p)
|
||||
{
|
||||
HTMLElement *This = HTMLELEM_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
|
||||
TRACE("(%p)->(%p)\n", This, p);
|
||||
|
||||
return get_node_event(&This->node, EVENTID_KEYDOWN, p);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLElement_put_onkeyup(IHTMLElement *iface, VARIANT v)
|
||||
@@ -525,29 +493,37 @@ static HRESULT WINAPI HTMLElement_get_onkeypress(IHTMLElement *iface, VARIANT *p
|
||||
static HRESULT WINAPI HTMLElement_put_onmouseout(IHTMLElement *iface, VARIANT v)
|
||||
{
|
||||
HTMLElement *This = HTMLELEM_THIS(iface);
|
||||
FIXME("(%p)->()\n", This);
|
||||
return E_NOTIMPL;
|
||||
|
||||
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
|
||||
|
||||
return set_node_event(&This->node, EVENTID_MOUSEOUT, &v);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLElement_get_onmouseout(IHTMLElement *iface, VARIANT *p)
|
||||
{
|
||||
HTMLElement *This = HTMLELEM_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
|
||||
TRACE("(%p)->(%p)\n", This, p);
|
||||
|
||||
return get_node_event(&This->node, EVENTID_MOUSEOUT, p);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLElement_put_onmouseover(IHTMLElement *iface, VARIANT v)
|
||||
{
|
||||
HTMLElement *This = HTMLELEM_THIS(iface);
|
||||
FIXME("(%p)->()\n", This);
|
||||
return E_NOTIMPL;
|
||||
|
||||
TRACE("(%p)->()\n", This);
|
||||
|
||||
return set_node_event(&This->node, EVENTID_MOUSEOVER, &v);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLElement_get_onmouseover(IHTMLElement *iface, VARIANT *p)
|
||||
{
|
||||
HTMLElement *This = HTMLELEM_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
|
||||
TRACE("(%p)->(%p)\n", This, p);
|
||||
|
||||
return get_node_event(&This->node, EVENTID_MOUSEOVER, p);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLElement_put_onmousemove(IHTMLElement *iface, VARIANT v)
|
||||
@@ -567,36 +543,52 @@ static HRESULT WINAPI HTMLElement_get_onmousemove(IHTMLElement *iface, VARIANT *
|
||||
static HRESULT WINAPI HTMLElement_put_onmousedown(IHTMLElement *iface, VARIANT v)
|
||||
{
|
||||
HTMLElement *This = HTMLELEM_THIS(iface);
|
||||
FIXME("(%p)->()\n", This);
|
||||
return E_NOTIMPL;
|
||||
|
||||
TRACE("(%p)->()\n", This);
|
||||
|
||||
return set_node_event(&This->node, EVENTID_MOUSEDOWN, &v);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLElement_get_onmousedown(IHTMLElement *iface, VARIANT *p)
|
||||
{
|
||||
HTMLElement *This = HTMLELEM_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
|
||||
TRACE("(%p)->(%p)\n", This, p);
|
||||
|
||||
return get_node_event(&This->node, EVENTID_MOUSEDOWN, p);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLElement_put_onmouseup(IHTMLElement *iface, VARIANT v)
|
||||
{
|
||||
HTMLElement *This = HTMLELEM_THIS(iface);
|
||||
FIXME("(%p)->()\n", This);
|
||||
return E_NOTIMPL;
|
||||
|
||||
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
|
||||
|
||||
return set_node_event(&This->node, EVENTID_MOUSEUP, &v);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLElement_get_onmouseup(IHTMLElement *iface, VARIANT *p)
|
||||
{
|
||||
HTMLElement *This = HTMLELEM_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
|
||||
TRACE("(%p)->(%p)\n", This, p);
|
||||
|
||||
return get_node_event(&This->node, EVENTID_MOUSEUP, p);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLElement_get_document(IHTMLElement *iface, IDispatch **p)
|
||||
{
|
||||
HTMLElement *This = HTMLELEM_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
|
||||
TRACE("(%p)->(%p)\n", This, p);
|
||||
|
||||
if(!p)
|
||||
return E_POINTER;
|
||||
|
||||
*p = (IDispatch*)HTMLDOC(This->node.doc);
|
||||
IDispatch_AddRef(*p);
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLElement_put_title(IHTMLElement *iface, BSTR v)
|
||||
@@ -656,15 +648,19 @@ static HRESULT WINAPI HTMLElement_get_language(IHTMLElement *iface, BSTR *p)
|
||||
static HRESULT WINAPI HTMLElement_put_onselectstart(IHTMLElement *iface, VARIANT v)
|
||||
{
|
||||
HTMLElement *This = HTMLELEM_THIS(iface);
|
||||
FIXME("(%p)->()\n", This);
|
||||
return E_NOTIMPL;
|
||||
|
||||
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
|
||||
|
||||
return set_node_event(&This->node, EVENTID_SELECTSTART, &v);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLElement_get_onselectstart(IHTMLElement *iface, VARIANT *p)
|
||||
{
|
||||
HTMLElement *This = HTMLELEM_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
|
||||
TRACE("(%p)->(%p)\n", This, p);
|
||||
|
||||
return get_node_event(&This->node, EVENTID_SELECTSTART, p);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLElement_scrollIntoView(IHTMLElement *iface, VARIANT varargStart)
|
||||
@@ -746,8 +742,27 @@ static HRESULT WINAPI HTMLElement_get_offsetTop(IHTMLElement *iface, long *p)
|
||||
static HRESULT WINAPI HTMLElement_get_offsetWidth(IHTMLElement *iface, long *p)
|
||||
{
|
||||
HTMLElement *This = HTMLELEM_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
nsIDOMNSHTMLElement *nselem;
|
||||
PRInt32 offset = 0;
|
||||
nsresult nsres;
|
||||
|
||||
TRACE("(%p)->(%p)\n", This, p);
|
||||
|
||||
nsres = nsIDOMHTMLElement_QueryInterface(This->nselem, &IID_nsIDOMNSHTMLElement, (void**)&nselem);
|
||||
if(NS_FAILED(nsres)) {
|
||||
ERR("Could not get nsIDOMNSHTMLElement: %08x\n", nsres);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
nsres = nsIDOMNSHTMLElement_GetOffsetWidth(nselem, &offset);
|
||||
nsIDOMNSHTMLElement_Release(nselem);
|
||||
if(NS_FAILED(nsres)) {
|
||||
ERR("GetOffsetWidth failed: %08x\n", nsres);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
*p = offset;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLElement_get_offsetHeight(IHTMLElement *iface, long *p)
|
||||
@@ -825,15 +840,56 @@ static HRESULT WINAPI HTMLElement_get_innerHTML(IHTMLElement *iface, BSTR *p)
|
||||
static HRESULT WINAPI HTMLElement_put_innerText(IHTMLElement *iface, BSTR v)
|
||||
{
|
||||
HTMLElement *This = HTMLELEM_THIS(iface);
|
||||
FIXME("(%p)->(%s)\n", This, debugstr_w(v));
|
||||
return E_NOTIMPL;
|
||||
nsIDOMNode *nschild, *tmp;
|
||||
nsIDOMText *text_node;
|
||||
nsAString text_str;
|
||||
nsresult nsres;
|
||||
|
||||
TRACE("(%p)->(%s)\n", This, debugstr_w(v));
|
||||
|
||||
while(1) {
|
||||
nsres = nsIDOMHTMLElement_GetLastChild(This->nselem, &nschild);
|
||||
if(NS_FAILED(nsres)) {
|
||||
ERR("GetLastChild failed: %08x\n", nsres);
|
||||
return E_FAIL;
|
||||
}
|
||||
if(!nschild)
|
||||
break;
|
||||
|
||||
nsres = nsIDOMHTMLElement_RemoveChild(This->nselem, nschild, &tmp);
|
||||
nsIDOMNode_Release(nschild);
|
||||
if(NS_FAILED(nsres)) {
|
||||
ERR("RemoveChild failed: %08x\n", nsres);
|
||||
return E_FAIL;
|
||||
}
|
||||
nsIDOMNode_Release(tmp);
|
||||
}
|
||||
|
||||
nsAString_Init(&text_str, v);
|
||||
nsres = nsIDOMHTMLDocument_CreateTextNode(This->node.doc->nsdoc, &text_str, &text_node);
|
||||
nsAString_Finish(&text_str);
|
||||
if(NS_FAILED(nsres)) {
|
||||
ERR("CreateTextNode failed: %08x\n", nsres);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
nsres = nsIDOMHTMLElement_AppendChild(This->nselem, (nsIDOMNode*)text_node, &tmp);
|
||||
if(NS_FAILED(nsres)) {
|
||||
ERR("AppendChild failed: %08x\n", nsres);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
nsIDOMNode_Release(tmp);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLElement_get_innerText(IHTMLElement *iface, BSTR *p)
|
||||
{
|
||||
HTMLElement *This = HTMLELEM_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
|
||||
TRACE("(%p)->(%p)\n", This, p);
|
||||
|
||||
return get_node_text(&This->node, p);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLElement_put_outerHTML(IHTMLElement *iface, BSTR v)
|
||||
@@ -938,26 +994,22 @@ static HRESULT WINAPI HTMLElement_insertAdjacentHTML(IHTMLElement *iface, BSTR w
|
||||
BSTR html)
|
||||
{
|
||||
HTMLElement *This = HTMLELEM_THIS(iface);
|
||||
nsresult nsres;
|
||||
nsIDOMDocument *nsdoc;
|
||||
nsIDOMDocumentRange *nsdocrange;
|
||||
nsIDOMRange *range;
|
||||
nsIDOMNSRange *nsrange;
|
||||
nsIDOMNode *nsnode;
|
||||
nsAString ns_html;
|
||||
nsresult nsres;
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("(%p)->(%s %s)\n", This, debugstr_w(where), debugstr_w(html));
|
||||
|
||||
nsres = nsIWebNavigation_GetDocument(This->node.doc->nscontainer->navigation, &nsdoc);
|
||||
if(NS_FAILED(nsres))
|
||||
{
|
||||
ERR("GetDocument failed: %08x\n", nsres);
|
||||
return E_FAIL;
|
||||
if(!This->node.doc->nsdoc) {
|
||||
WARN("NULL nsdoc\n");
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
nsres = nsIDOMDocument_QueryInterface(nsdoc, &IID_nsIDOMDocumentRange, (void **)&nsdocrange);
|
||||
nsIDOMDocument_Release(nsdoc);
|
||||
nsres = nsIDOMDocument_QueryInterface(This->node.doc->nsdoc, &IID_nsIDOMDocumentRange, (void **)&nsdocrange);
|
||||
if(NS_FAILED(nsres))
|
||||
{
|
||||
ERR("getting nsIDOMDocumentRange failed: %08x\n", nsres);
|
||||
@@ -1003,25 +1055,21 @@ static HRESULT WINAPI HTMLElement_insertAdjacentText(IHTMLElement *iface, BSTR w
|
||||
BSTR text)
|
||||
{
|
||||
HTMLElement *This = HTMLELEM_THIS(iface);
|
||||
nsresult nsres;
|
||||
nsIDOMDocument *nsdoc;
|
||||
nsIDOMNode *nsnode;
|
||||
nsAString ns_text;
|
||||
nsresult nsres;
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("(%p)->(%s %s)\n", This, debugstr_w(where), debugstr_w(text));
|
||||
|
||||
nsres = nsIWebNavigation_GetDocument(This->node.doc->nscontainer->navigation, &nsdoc);
|
||||
if(NS_FAILED(nsres) || !nsdoc)
|
||||
{
|
||||
ERR("GetDocument failed: %08x\n", nsres);
|
||||
return E_FAIL;
|
||||
if(!This->node.doc->nsdoc) {
|
||||
WARN("NULL nsdoc\n");
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
nsAString_Init(&ns_text, text);
|
||||
|
||||
nsres = nsIDOMDocument_CreateTextNode(nsdoc, &ns_text, (nsIDOMText **)&nsnode);
|
||||
nsIDOMDocument_Release(nsdoc);
|
||||
nsAString_Init(&ns_text, text);
|
||||
nsres = nsIDOMDocument_CreateTextNode(This->node.doc->nsdoc, &ns_text, (nsIDOMText **)&nsnode);
|
||||
nsAString_Finish(&ns_text);
|
||||
|
||||
if(NS_FAILED(nsres) || !nsnode)
|
||||
@@ -1212,97 +1260,33 @@ static HRESULT WINAPI HTMLElement_get_onfilterchange(IHTMLElement *iface, VARIAN
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static void create_child_list(HTMLDocument *doc, HTMLElement *elem, elem_vector *buf)
|
||||
{
|
||||
nsIDOMNodeList *nsnode_list;
|
||||
nsIDOMNode *iter;
|
||||
PRUint32 list_len = 0, i;
|
||||
nsresult nsres;
|
||||
|
||||
nsres = nsIDOMNode_GetChildNodes(elem->node.nsnode, &nsnode_list);
|
||||
if(NS_FAILED(nsres)) {
|
||||
ERR("GetChildNodes failed: %08x\n", nsres);
|
||||
return;
|
||||
}
|
||||
|
||||
nsIDOMNodeList_GetLength(nsnode_list, &list_len);
|
||||
if(!list_len)
|
||||
return;
|
||||
|
||||
buf->size = list_len;
|
||||
buf->buf = heap_alloc(buf->size*sizeof(HTMLElement**));
|
||||
|
||||
for(i=0; i<list_len; i++) {
|
||||
nsres = nsIDOMNodeList_Item(nsnode_list, i, &iter);
|
||||
if(NS_FAILED(nsres)) {
|
||||
ERR("Item failed: %08x\n", nsres);
|
||||
continue;
|
||||
}
|
||||
|
||||
if(is_elem_node(iter))
|
||||
elem_vector_add(buf, HTMLELEM_NODE_THIS(get_node(doc, iter, TRUE)));
|
||||
}
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLElement_get_children(IHTMLElement *iface, IDispatch **p)
|
||||
{
|
||||
HTMLElement *This = HTMLELEM_THIS(iface);
|
||||
elem_vector buf = {NULL, 0, 0};
|
||||
nsIDOMNodeList *nsnode_list;
|
||||
nsresult nsres;
|
||||
|
||||
TRACE("(%p)->(%p)\n", This, p);
|
||||
|
||||
create_child_list(This->node.doc, This, &buf);
|
||||
|
||||
*p = (IDispatch*)HTMLElementCollection_Create((IUnknown*)HTMLELEM(This), buf.buf, buf.len);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static void create_all_list(HTMLDocument *doc, HTMLDOMNode *elem, elem_vector *buf)
|
||||
{
|
||||
nsIDOMNodeList *nsnode_list;
|
||||
nsIDOMNode *iter;
|
||||
PRUint32 list_len = 0, i;
|
||||
nsresult nsres;
|
||||
|
||||
nsres = nsIDOMNode_GetChildNodes(elem->nsnode, &nsnode_list);
|
||||
nsres = nsIDOMNode_GetChildNodes(This->node.nsnode, &nsnode_list);
|
||||
if(NS_FAILED(nsres)) {
|
||||
ERR("GetChildNodes failed: %08x\n", nsres);
|
||||
return;
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
nsIDOMNodeList_GetLength(nsnode_list, &list_len);
|
||||
if(!list_len)
|
||||
return;
|
||||
*p = (IDispatch*)create_collection_from_nodelist(This->node.doc, (IUnknown*)HTMLELEM(This), nsnode_list);
|
||||
|
||||
for(i=0; i<list_len; i++) {
|
||||
nsres = nsIDOMNodeList_Item(nsnode_list, i, &iter);
|
||||
if(NS_FAILED(nsres)) {
|
||||
ERR("Item failed: %08x\n", nsres);
|
||||
continue;
|
||||
}
|
||||
|
||||
if(is_elem_node(iter)) {
|
||||
HTMLDOMNode *node = get_node(doc, iter, TRUE);
|
||||
|
||||
elem_vector_add(buf, HTMLELEM_NODE_THIS(node));
|
||||
create_all_list(doc, node, buf);
|
||||
}
|
||||
}
|
||||
nsIDOMNodeList_Release(nsnode_list);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLElement_get_all(IHTMLElement *iface, IDispatch **p)
|
||||
{
|
||||
HTMLElement *This = HTMLELEM_THIS(iface);
|
||||
elem_vector buf = {NULL, 0, 8};
|
||||
|
||||
TRACE("(%p)->(%p)\n", This, p);
|
||||
|
||||
buf.buf = heap_alloc(buf.size*sizeof(HTMLElement**));
|
||||
|
||||
create_all_list(This->node.doc, &This->node, &buf);
|
||||
elem_vector_normalize(&buf);
|
||||
|
||||
*p = (IDispatch*)HTMLElementCollection_Create((IUnknown*)HTMLELEM(This), buf.buf, buf.len);
|
||||
*p = (IDispatch*)create_all_collection(&This->node, FALSE);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -1423,6 +1407,9 @@ HRESULT HTMLElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
|
||||
}else if(IsEqualGUID(&IID_IHTMLElement2, riid)) {
|
||||
TRACE("(%p)->(IID_IHTMLElement2 %p)\n", This, ppv);
|
||||
*ppv = HTMLELEM2(This);
|
||||
}else if(IsEqualGUID(&IID_IHTMLElement3, riid)) {
|
||||
TRACE("(%p)->(IID_IHTMLElement3 %p)\n", This, ppv);
|
||||
*ppv = HTMLELEM3(This);
|
||||
}else if(IsEqualGUID(&IID_IConnectionPointContainer, riid)) {
|
||||
TRACE("(%p)->(IID_IConnectionPointContainer %p)\n", This, ppv);
|
||||
*ppv = CONPTCONT(&This->cp_container);
|
||||
@@ -1458,6 +1445,7 @@ static const tid_t HTMLElement_iface_tids[] = {
|
||||
IHTMLDOMNode2_tid,
|
||||
IHTMLElement_tid,
|
||||
IHTMLElement2_tid,
|
||||
IHTMLElement3_tid,
|
||||
0
|
||||
};
|
||||
|
||||
@@ -1475,6 +1463,7 @@ void HTMLElement_Init(HTMLElement *This)
|
||||
ConnectionPointContainer_Init(&This->cp_container, (IUnknown*)HTMLELEM(This));
|
||||
|
||||
HTMLElement2_Init(This);
|
||||
HTMLElement3_Init(This);
|
||||
|
||||
if(!This->node.dispex.data)
|
||||
init_dispex(&This->node.dispex, (IUnknown*)HTMLELEM(This), &HTMLElement_dispex);
|
||||
@@ -1490,12 +1479,14 @@ HTMLElement *HTMLElement_Create(HTMLDocument *doc, nsIDOMNode *nsnode, BOOL use_
|
||||
|
||||
static const WCHAR wszA[] = {'A',0};
|
||||
static const WCHAR wszBODY[] = {'B','O','D','Y',0};
|
||||
static const WCHAR wszIFRAME[] = {'I','F','R','A','M','E',0};
|
||||
static const WCHAR wszIMG[] = {'I','M','G',0};
|
||||
static const WCHAR wszINPUT[] = {'I','N','P','U','T',0};
|
||||
static const WCHAR wszOPTION[] = {'O','P','T','I','O','N',0};
|
||||
static const WCHAR wszSCRIPT[] = {'S','C','R','I','P','T',0};
|
||||
static const WCHAR wszSELECT[] = {'S','E','L','E','C','T',0};
|
||||
static const WCHAR wszTABLE[] = {'T','A','B','L','E',0};
|
||||
static const WCHAR wszTR[] = {'T','R',0};
|
||||
static const WCHAR wszTEXTAREA[] = {'T','E','X','T','A','R','E','A',0};
|
||||
|
||||
nsres = nsIDOMNode_QueryInterface(nsnode, &IID_nsIDOMHTMLElement, (void**)&nselem);
|
||||
@@ -1511,6 +1502,8 @@ HTMLElement *HTMLElement_Create(HTMLDocument *doc, nsIDOMNode *nsnode, BOOL use_
|
||||
ret = HTMLAnchorElement_Create(nselem);
|
||||
else if(!strcmpW(class_name, wszBODY))
|
||||
ret = HTMLBodyElement_Create(nselem);
|
||||
else if(!strcmpW(class_name, wszIFRAME))
|
||||
ret = HTMLIFrame_Create(nselem);
|
||||
else if(!strcmpW(class_name, wszIMG))
|
||||
ret = HTMLImgElement_Create(nselem);
|
||||
else if(!strcmpW(class_name, wszINPUT))
|
||||
@@ -1523,6 +1516,8 @@ HTMLElement *HTMLElement_Create(HTMLDocument *doc, nsIDOMNode *nsnode, BOOL use_
|
||||
ret = HTMLSelectElement_Create(nselem);
|
||||
else if(!strcmpW(class_name, wszTABLE))
|
||||
ret = HTMLTable_Create(nselem);
|
||||
else if(!strcmpW(class_name, wszTR))
|
||||
ret = HTMLTableRow_Create(nselem);
|
||||
else if(!strcmpW(class_name, wszTEXTAREA))
|
||||
ret = HTMLTextAreaElement_Create(nselem);
|
||||
else if(use_generic)
|
||||
@@ -1543,427 +1538,3 @@ HTMLElement *HTMLElement_Create(HTMLDocument *doc, nsIDOMNode *nsnode, BOOL use_
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
typedef struct {
|
||||
DispatchEx dispex;
|
||||
const IHTMLElementCollectionVtbl *lpHTMLElementCollectionVtbl;
|
||||
|
||||
IUnknown *ref_unk;
|
||||
HTMLElement **elems;
|
||||
DWORD len;
|
||||
|
||||
LONG ref;
|
||||
} HTMLElementCollection;
|
||||
|
||||
#define HTMLELEMCOL(x) ((IHTMLElementCollection*) &(x)->lpHTMLElementCollectionVtbl)
|
||||
|
||||
#define ELEMCOL_THIS(iface) DEFINE_THIS(HTMLElementCollection, HTMLElementCollection, iface)
|
||||
|
||||
static HRESULT WINAPI HTMLElementCollection_QueryInterface(IHTMLElementCollection *iface,
|
||||
REFIID riid, void **ppv)
|
||||
{
|
||||
HTMLElementCollection *This = ELEMCOL_THIS(iface);
|
||||
|
||||
*ppv = NULL;
|
||||
|
||||
if(IsEqualGUID(&IID_IUnknown, riid)) {
|
||||
TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
|
||||
*ppv = HTMLELEMCOL(This);
|
||||
}else if(IsEqualGUID(&IID_IHTMLElementCollection, riid)) {
|
||||
TRACE("(%p)->(IID_IHTMLElementCollection %p)\n", This, ppv);
|
||||
*ppv = HTMLELEMCOL(This);
|
||||
}else if(dispex_query_interface(&This->dispex, riid, ppv)) {
|
||||
return *ppv ? S_OK : E_NOINTERFACE;
|
||||
}
|
||||
|
||||
if(*ppv) {
|
||||
IHTMLElementCollection_AddRef(HTMLELEMCOL(This));
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
FIXME("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppv);
|
||||
return E_NOINTERFACE;
|
||||
}
|
||||
|
||||
static ULONG WINAPI HTMLElementCollection_AddRef(IHTMLElementCollection *iface)
|
||||
{
|
||||
HTMLElementCollection *This = ELEMCOL_THIS(iface);
|
||||
LONG ref = InterlockedIncrement(&This->ref);
|
||||
|
||||
TRACE("(%p) ref=%d\n", This, ref);
|
||||
|
||||
return ref;
|
||||
}
|
||||
|
||||
static ULONG WINAPI HTMLElementCollection_Release(IHTMLElementCollection *iface)
|
||||
{
|
||||
HTMLElementCollection *This = ELEMCOL_THIS(iface);
|
||||
LONG ref = InterlockedDecrement(&This->ref);
|
||||
|
||||
TRACE("(%p) ref=%d\n", This, ref);
|
||||
|
||||
if(!ref) {
|
||||
IUnknown_Release(This->ref_unk);
|
||||
heap_free(This->elems);
|
||||
heap_free(This);
|
||||
}
|
||||
|
||||
return ref;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLElementCollection_GetTypeInfoCount(IHTMLElementCollection *iface,
|
||||
UINT *pctinfo)
|
||||
{
|
||||
HTMLElementCollection *This = ELEMCOL_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, pctinfo);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLElementCollection_GetTypeInfo(IHTMLElementCollection *iface,
|
||||
UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
|
||||
{
|
||||
HTMLElementCollection *This = ELEMCOL_THIS(iface);
|
||||
FIXME("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLElementCollection_GetIDsOfNames(IHTMLElementCollection *iface,
|
||||
REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
|
||||
{
|
||||
HTMLElementCollection *This = ELEMCOL_THIS(iface);
|
||||
FIXME("(%p)->(%s %p %u %u %p)\n", This, debugstr_guid(riid), rgszNames, cNames,
|
||||
lcid, rgDispId);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLElementCollection_Invoke(IHTMLElementCollection *iface,
|
||||
DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
|
||||
VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
|
||||
{
|
||||
HTMLElementCollection *This = ELEMCOL_THIS(iface);
|
||||
FIXME("(%p)->(%d %s %d %d %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid),
|
||||
lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLElementCollection_toString(IHTMLElementCollection *iface,
|
||||
BSTR *String)
|
||||
{
|
||||
HTMLElementCollection *This = ELEMCOL_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, String);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLElementCollection_put_length(IHTMLElementCollection *iface,
|
||||
long v)
|
||||
{
|
||||
HTMLElementCollection *This = ELEMCOL_THIS(iface);
|
||||
FIXME("(%p)->(%ld)\n", This, v);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLElementCollection_get_length(IHTMLElementCollection *iface,
|
||||
long *p)
|
||||
{
|
||||
HTMLElementCollection *This = ELEMCOL_THIS(iface);
|
||||
|
||||
TRACE("(%p)->(%p)\n", This, p);
|
||||
|
||||
*p = This->len;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLElementCollection_get__newEnum(IHTMLElementCollection *iface,
|
||||
IUnknown **p)
|
||||
{
|
||||
HTMLElementCollection *This = ELEMCOL_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static BOOL is_elem_name(HTMLElement *elem, LPCWSTR name)
|
||||
{
|
||||
const PRUnichar *str;
|
||||
nsAString nsstr, nsname;
|
||||
BOOL ret = FALSE;
|
||||
nsresult nsres;
|
||||
|
||||
static const PRUnichar nameW[] = {'n','a','m','e',0};
|
||||
|
||||
if(!elem->nselem)
|
||||
return FALSE;
|
||||
|
||||
nsAString_Init(&nsstr, NULL);
|
||||
nsIDOMHTMLElement_GetId(elem->nselem, &nsstr);
|
||||
nsAString_GetData(&nsstr, &str);
|
||||
if(!strcmpiW(str, name)) {
|
||||
nsAString_Finish(&nsstr);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
nsAString_Init(&nsname, nameW);
|
||||
nsres = nsIDOMHTMLElement_GetAttribute(elem->nselem, &nsname, &nsstr);
|
||||
nsAString_Finish(&nsname);
|
||||
if(NS_SUCCEEDED(nsres)) {
|
||||
nsAString_GetData(&nsstr, &str);
|
||||
ret = !strcmpiW(str, name);
|
||||
}
|
||||
|
||||
nsAString_Finish(&nsstr);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLElementCollection_item(IHTMLElementCollection *iface,
|
||||
VARIANT name, VARIANT index, IDispatch **pdisp)
|
||||
{
|
||||
HTMLElementCollection *This = ELEMCOL_THIS(iface);
|
||||
|
||||
TRACE("(%p)->(v(%d) v(%d) %p)\n", This, V_VT(&name), V_VT(&index), pdisp);
|
||||
|
||||
*pdisp = NULL;
|
||||
|
||||
if(V_VT(&name) == VT_I4) {
|
||||
TRACE("name is VT_I4: %d\n", V_I4(&name));
|
||||
|
||||
if(V_I4(&name) < 0)
|
||||
return E_INVALIDARG;
|
||||
if(V_I4(&name) >= This->len)
|
||||
return S_OK;
|
||||
|
||||
*pdisp = (IDispatch*)This->elems[V_I4(&name)];
|
||||
IDispatch_AddRef(*pdisp);
|
||||
TRACE("Returning pdisp=%p\n", pdisp);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
if(V_VT(&name) == VT_BSTR) {
|
||||
DWORD i;
|
||||
|
||||
TRACE("name is VT_BSTR: %s\n", debugstr_w(V_BSTR(&name)));
|
||||
|
||||
if(V_VT(&index) == VT_I4) {
|
||||
LONG idx = V_I4(&index);
|
||||
|
||||
TRACE("index = %d\n", idx);
|
||||
|
||||
if(idx < 0)
|
||||
return E_INVALIDARG;
|
||||
|
||||
for(i=0; i<This->len; i++) {
|
||||
if(is_elem_name(This->elems[i], V_BSTR(&name)) && !idx--)
|
||||
break;
|
||||
}
|
||||
|
||||
if(i != This->len) {
|
||||
*pdisp = (IDispatch*)HTMLELEM(This->elems[i]);
|
||||
IDispatch_AddRef(*pdisp);
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}else {
|
||||
elem_vector buf = {NULL, 0, 8};
|
||||
|
||||
buf.buf = heap_alloc(buf.size*sizeof(HTMLElement*));
|
||||
|
||||
for(i=0; i<This->len; i++) {
|
||||
if(is_elem_name(This->elems[i], V_BSTR(&name)))
|
||||
elem_vector_add(&buf, This->elems[i]);
|
||||
}
|
||||
|
||||
if(buf.len > 1) {
|
||||
elem_vector_normalize(&buf);
|
||||
*pdisp = (IDispatch*)HTMLElementCollection_Create(This->ref_unk, buf.buf, buf.len);
|
||||
}else {
|
||||
if(buf.len == 1) {
|
||||
*pdisp = (IDispatch*)HTMLELEM(buf.buf[0]);
|
||||
IDispatch_AddRef(*pdisp);
|
||||
}
|
||||
|
||||
heap_free(buf.buf);
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
}
|
||||
|
||||
FIXME("unsupported arguments\n");
|
||||
return E_INVALIDARG;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLElementCollection_tags(IHTMLElementCollection *iface,
|
||||
VARIANT tagName, IDispatch **pdisp)
|
||||
{
|
||||
HTMLElementCollection *This = ELEMCOL_THIS(iface);
|
||||
DWORD i;
|
||||
nsAString tag_str;
|
||||
const PRUnichar *tag;
|
||||
elem_vector buf = {NULL, 0, 8};
|
||||
|
||||
if(V_VT(&tagName) != VT_BSTR) {
|
||||
WARN("Invalid arg\n");
|
||||
return DISP_E_MEMBERNOTFOUND;
|
||||
}
|
||||
|
||||
TRACE("(%p)->(%s %p)\n", This, debugstr_w(V_BSTR(&tagName)), pdisp);
|
||||
|
||||
buf.buf = heap_alloc(buf.size*sizeof(HTMLElement*));
|
||||
|
||||
nsAString_Init(&tag_str, NULL);
|
||||
|
||||
for(i=0; i<This->len; i++) {
|
||||
if(!This->elems[i]->nselem)
|
||||
continue;
|
||||
|
||||
nsIDOMElement_GetTagName(This->elems[i]->nselem, &tag_str);
|
||||
nsAString_GetData(&tag_str, &tag);
|
||||
|
||||
if(CompareStringW(LOCALE_SYSTEM_DEFAULT, NORM_IGNORECASE, tag, -1,
|
||||
V_BSTR(&tagName), -1) == CSTR_EQUAL)
|
||||
elem_vector_add(&buf, This->elems[i]);
|
||||
}
|
||||
|
||||
nsAString_Finish(&tag_str);
|
||||
elem_vector_normalize(&buf);
|
||||
|
||||
TRACE("fount %d tags\n", buf.len);
|
||||
|
||||
*pdisp = (IDispatch*)HTMLElementCollection_Create(This->ref_unk, buf.buf, buf.len);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
#define DISPID_ELEMCOL_0 MSHTML_DISPID_CUSTOM_MIN
|
||||
|
||||
static HRESULT HTMLElementCollection_get_dispid(IUnknown *iface, BSTR name, DWORD flags, DISPID *dispid)
|
||||
{
|
||||
HTMLElementCollection *This = ELEMCOL_THIS(iface);
|
||||
WCHAR *ptr;
|
||||
DWORD idx=0;
|
||||
|
||||
for(ptr = name; *ptr && isdigitW(*ptr); ptr++)
|
||||
idx = idx*10 + (*ptr-'0');
|
||||
|
||||
if(*ptr || idx >= This->len)
|
||||
return DISP_E_UNKNOWNNAME;
|
||||
|
||||
*dispid = DISPID_ELEMCOL_0 + idx;
|
||||
TRACE("ret %x\n", *dispid);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT HTMLElementCollection_invoke(IUnknown *iface, DISPID id, LCID lcid, WORD flags, DISPPARAMS *params,
|
||||
VARIANT *res, EXCEPINFO *ei, IServiceProvider *caller)
|
||||
{
|
||||
HTMLElementCollection *This = ELEMCOL_THIS(iface);
|
||||
DWORD idx;
|
||||
|
||||
TRACE("(%p)->(%x %x %x %p %p %p %p)\n", This, id, lcid, flags, params, res, ei, caller);
|
||||
|
||||
idx = id - DISPID_ELEMCOL_0;
|
||||
if(idx >= This->len)
|
||||
return DISP_E_UNKNOWNNAME;
|
||||
|
||||
switch(flags) {
|
||||
case INVOKE_PROPERTYGET:
|
||||
V_VT(res) = VT_DISPATCH;
|
||||
V_DISPATCH(res) = (IDispatch*)HTMLELEM(This->elems[idx]);
|
||||
IHTMLElement_AddRef(HTMLELEM(This->elems[idx]));
|
||||
break;
|
||||
default:
|
||||
FIXME("unimplemented flags %x\n", flags);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
#undef ELEMCOL_THIS
|
||||
|
||||
static const IHTMLElementCollectionVtbl HTMLElementCollectionVtbl = {
|
||||
HTMLElementCollection_QueryInterface,
|
||||
HTMLElementCollection_AddRef,
|
||||
HTMLElementCollection_Release,
|
||||
HTMLElementCollection_GetTypeInfoCount,
|
||||
HTMLElementCollection_GetTypeInfo,
|
||||
HTMLElementCollection_GetIDsOfNames,
|
||||
HTMLElementCollection_Invoke,
|
||||
HTMLElementCollection_toString,
|
||||
HTMLElementCollection_put_length,
|
||||
HTMLElementCollection_get_length,
|
||||
HTMLElementCollection_get__newEnum,
|
||||
HTMLElementCollection_item,
|
||||
HTMLElementCollection_tags
|
||||
};
|
||||
|
||||
static const dispex_static_data_vtbl_t HTMLElementColection_dispex_vtbl = {
|
||||
HTMLElementCollection_get_dispid,
|
||||
HTMLElementCollection_invoke
|
||||
};
|
||||
|
||||
static const tid_t HTMLElementCollection_iface_tids[] = {
|
||||
IHTMLElementCollection_tid,
|
||||
0
|
||||
};
|
||||
static dispex_static_data_t HTMLElementCollection_dispex = {
|
||||
&HTMLElementColection_dispex_vtbl,
|
||||
DispHTMLElementCollection_tid,
|
||||
NULL,
|
||||
HTMLElementCollection_iface_tids
|
||||
};
|
||||
|
||||
IHTMLElementCollection *create_all_collection(HTMLDOMNode *node)
|
||||
{
|
||||
elem_vector buf = {NULL, 0, 8};
|
||||
|
||||
buf.buf = heap_alloc(buf.size*sizeof(HTMLElement**));
|
||||
|
||||
elem_vector_add(&buf, HTMLELEM_NODE_THIS(node));
|
||||
create_all_list(node->doc, node, &buf);
|
||||
elem_vector_normalize(&buf);
|
||||
|
||||
return HTMLElementCollection_Create((IUnknown*)HTMLDOMNODE(node), buf.buf, buf.len);
|
||||
}
|
||||
|
||||
IHTMLElementCollection *create_collection_from_nodelist(HTMLDocument *doc, IUnknown *unk, nsIDOMNodeList *nslist)
|
||||
{
|
||||
PRUint32 length = 0, i;
|
||||
elem_vector buf;
|
||||
|
||||
nsIDOMNodeList_GetLength(nslist, &length);
|
||||
|
||||
buf.len = buf.size = length;
|
||||
if(buf.len) {
|
||||
nsIDOMNode *nsnode;
|
||||
|
||||
buf.buf = heap_alloc(buf.size*sizeof(HTMLElement*));
|
||||
|
||||
for(i=0; i<length; i++) {
|
||||
nsIDOMNodeList_Item(nslist, i, &nsnode);
|
||||
buf.buf[i] = HTMLELEM_NODE_THIS(get_node(doc, nsnode, TRUE));
|
||||
nsIDOMNode_Release(nsnode);
|
||||
}
|
||||
}else {
|
||||
buf.buf = NULL;
|
||||
}
|
||||
|
||||
return HTMLElementCollection_Create(unk, buf.buf, buf.len);
|
||||
}
|
||||
|
||||
static IHTMLElementCollection *HTMLElementCollection_Create(IUnknown *ref_unk,
|
||||
HTMLElement **elems, DWORD len)
|
||||
{
|
||||
HTMLElementCollection *ret = heap_alloc_zero(sizeof(HTMLElementCollection));
|
||||
|
||||
ret->lpHTMLElementCollectionVtbl = &HTMLElementCollectionVtbl;
|
||||
ret->ref = 1;
|
||||
ret->elems = elems;
|
||||
ret->len = len;
|
||||
|
||||
init_dispex(&ret->dispex, (IUnknown*)HTMLELEMCOL(ret), &HTMLElementCollection_dispex);
|
||||
|
||||
IUnknown_AddRef(ref_unk);
|
||||
ret->ref_unk = ref_unk;
|
||||
|
||||
TRACE("ret=%p len=%d\n", ret, len);
|
||||
|
||||
return HTMLELEMCOL(ret);
|
||||
}
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
#include "wine/unicode.h"
|
||||
|
||||
#include "mshtml_private.h"
|
||||
#include "htmlevent.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
|
||||
|
||||
@@ -150,15 +151,19 @@ static HRESULT WINAPI HTMLElement2_get_onscroll(IHTMLElement2 *iface, VARIANT *p
|
||||
static HRESULT WINAPI HTMLElement2_put_ondrag(IHTMLElement2 *iface, VARIANT v)
|
||||
{
|
||||
HTMLElement *This = HTMLELEM2_THIS(iface);
|
||||
FIXME("(%p)->()\n", This);
|
||||
return E_NOTIMPL;
|
||||
|
||||
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
|
||||
|
||||
return set_node_event(&This->node, EVENTID_DRAG, &v);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLElement2_get_ondrag(IHTMLElement2 *iface, VARIANT *p)
|
||||
{
|
||||
HTMLElement *This = HTMLELEM2_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
|
||||
TRACE("(%p)->(%p)\n", This, p);
|
||||
|
||||
return get_node_event(&This->node, EVENTID_DRAG, p);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLElement2_put_ondragend(IHTMLElement2 *iface, VARIANT v)
|
||||
@@ -304,22 +309,28 @@ static HRESULT WINAPI HTMLElement2_get_onbeforepaste(IHTMLElement2 *iface, VARIA
|
||||
static HRESULT WINAPI HTMLElement2_put_onpaste(IHTMLElement2 *iface, VARIANT v)
|
||||
{
|
||||
HTMLElement *This = HTMLELEM2_THIS(iface);
|
||||
FIXME("(%p)->()\n", This);
|
||||
return E_NOTIMPL;
|
||||
|
||||
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
|
||||
|
||||
return set_node_event(&This->node, EVENTID_PASTE, &v);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLElement2_get_onpaste(IHTMLElement2 *iface, VARIANT *p)
|
||||
{
|
||||
HTMLElement *This = HTMLELEM2_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
|
||||
TRACE("(%p)->(%p)\n", This, p);
|
||||
|
||||
return get_node_event(&This->node, EVENTID_PASTE, p);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLElement2_get_currentStyle(IHTMLElement2 *iface, IHTMLCurrentStyle **p)
|
||||
{
|
||||
HTMLElement *This = HTMLELEM2_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
|
||||
TRACE("(%p)->(%p)\n", This, p);
|
||||
|
||||
return HTMLCurrentStyle_Create(This, p);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLElement2_put_onpropertychange(IHTMLElement2 *iface, VARIANT v)
|
||||
@@ -466,29 +477,37 @@ static HRESULT WINAPI HTMLElement2_get_accessKey(IHTMLElement2 *iface, BSTR *p)
|
||||
static HRESULT WINAPI HTMLElement2_put_onblur(IHTMLElement2 *iface, VARIANT v)
|
||||
{
|
||||
HTMLElement *This = HTMLELEM2_THIS(iface);
|
||||
FIXME("(%p)->()\n", This);
|
||||
return E_NOTIMPL;
|
||||
|
||||
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
|
||||
|
||||
return set_node_event(&This->node, EVENTID_BLUR, &v);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLElement2_get_onblur(IHTMLElement2 *iface, VARIANT *p)
|
||||
{
|
||||
HTMLElement *This = HTMLELEM2_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
|
||||
TRACE("(%p)->(%p)\n", This, p);
|
||||
|
||||
return get_node_event(&This->node, EVENTID_BLUR, p);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLElement2_put_onfocus(IHTMLElement2 *iface, VARIANT v)
|
||||
{
|
||||
HTMLElement *This = HTMLELEM2_THIS(iface);
|
||||
FIXME("(%p)->()\n", This);
|
||||
return E_NOTIMPL;
|
||||
|
||||
TRACE("(%p)->(%s)\n", This, debugstr_variant(&v));
|
||||
|
||||
return set_node_event(&This->node, EVENTID_FOCUS, &v);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLElement2_get_onfocus(IHTMLElement2 *iface, VARIANT *p)
|
||||
{
|
||||
HTMLElement *This = HTMLELEM2_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
|
||||
TRACE("(%p)->(%p)\n", This, p);
|
||||
|
||||
return get_node_event(&This->node, EVENTID_FOCUS, p);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLElement2_put_onresize(IHTMLElement2 *iface, VARIANT v)
|
||||
@@ -529,18 +548,18 @@ static HRESULT WINAPI HTMLElement2_removeFilter(IHTMLElement2 *iface, IUnknown *
|
||||
static HRESULT WINAPI HTMLElement2_get_clientHeight(IHTMLElement2 *iface, long *p)
|
||||
{
|
||||
HTMLElement *This = HTMLELEM2_THIS(iface);
|
||||
nsIDOMNSHTMLElement *nselem;
|
||||
nsIDOMNSElement *nselem;
|
||||
PRInt32 height=0;
|
||||
nsresult nsres;
|
||||
|
||||
TRACE("(%p)->(%p)\n", This, p);
|
||||
|
||||
nsres = nsIDOMHTMLElement_QueryInterface(This->nselem, &IID_nsIDOMNSHTMLElement, (void**)&nselem);
|
||||
nsres = nsIDOMHTMLElement_QueryInterface(This->nselem, &IID_nsIDOMNSElement, (void**)&nselem);
|
||||
if(NS_SUCCEEDED(nsres)) {
|
||||
nsIDOMNSHTMLElement_GetClientHeight(nselem, &height);
|
||||
nsIDOMNSHTMLElement_Release(nselem);
|
||||
nsIDOMNSElement_GetClientHeight(nselem, &height);
|
||||
nsIDOMNSElement_Release(nselem);
|
||||
}else {
|
||||
ERR("Could not get nsIDOMHTMLNSElement: %08x\n", nsres);
|
||||
ERR("Could not get nsIDOMNSElement: %08x\n", nsres);
|
||||
}
|
||||
|
||||
*p = height;
|
||||
@@ -550,18 +569,18 @@ static HRESULT WINAPI HTMLElement2_get_clientHeight(IHTMLElement2 *iface, long *
|
||||
static HRESULT WINAPI HTMLElement2_get_clientWidth(IHTMLElement2 *iface, long *p)
|
||||
{
|
||||
HTMLElement *This = HTMLELEM2_THIS(iface);
|
||||
nsIDOMNSHTMLElement *nselem;
|
||||
nsIDOMNSElement *nselem;
|
||||
PRInt32 width=0;
|
||||
nsresult nsres;
|
||||
|
||||
TRACE("(%p)->(%p)\n", This, p);
|
||||
|
||||
nsres = nsIDOMHTMLElement_QueryInterface(This->nselem, &IID_nsIDOMNSHTMLElement, (void**)&nselem);
|
||||
nsres = nsIDOMHTMLElement_QueryInterface(This->nselem, &IID_nsIDOMNSElement, (void**)&nselem);
|
||||
if(NS_SUCCEEDED(nsres)) {
|
||||
nsIDOMNSHTMLElement_GetClientWidth(nselem, &width);
|
||||
nsIDOMNSHTMLElement_Release(nselem);
|
||||
nsIDOMNSElement_GetClientWidth(nselem, &width);
|
||||
nsIDOMNSElement_Release(nselem);
|
||||
}else {
|
||||
ERR("Could not get nsIDOMHTMLNSElement: %08x\n", nsres);
|
||||
ERR("Could not get nsIDOMNSElement: %08x\n", nsres);
|
||||
}
|
||||
|
||||
*p = width;
|
||||
@@ -708,7 +727,7 @@ static HRESULT WINAPI HTMLElement2_createControlRange(IHTMLElement2 *iface, IDis
|
||||
static HRESULT WINAPI HTMLElement2_get_scrollHeight(IHTMLElement2 *iface, long *p)
|
||||
{
|
||||
HTMLElement *This = HTMLELEM2_THIS(iface);
|
||||
nsIDOMNSHTMLElement *nselem;
|
||||
nsIDOMNSElement *nselem;
|
||||
PRInt32 height = 0;
|
||||
nsresult nsres;
|
||||
|
||||
@@ -716,15 +735,15 @@ static HRESULT WINAPI HTMLElement2_get_scrollHeight(IHTMLElement2 *iface, long *
|
||||
|
||||
nsres = nsIDOMElement_QueryInterface(This->nselem, &IID_nsIDOMNSHTMLElement, (void**)&nselem);
|
||||
if(NS_SUCCEEDED(nsres)) {
|
||||
nsres = nsIDOMNSHTMLElement_GetScrollHeight(nselem, &height);
|
||||
nsIDOMNSHTMLElement_Release(nselem);
|
||||
nsres = nsIDOMNSElement_GetScrollHeight(nselem, &height);
|
||||
nsIDOMNSElement_Release(nselem);
|
||||
if(NS_FAILED(nsres))
|
||||
ERR("GetScrollHeight failed: %08x\n", nsres);
|
||||
}else {
|
||||
ERR("Could not get nsIDOMNSHTMLElement interface: %08x\n", nsres);
|
||||
ERR("Could not get nsIDOMNSElement interface: %08x\n", nsres);
|
||||
}
|
||||
|
||||
*p = height;
|
||||
*p = height == -1 ? 0 : height;
|
||||
TRACE("*p = %ld\n", *p);
|
||||
|
||||
return S_OK;
|
||||
@@ -733,20 +752,20 @@ static HRESULT WINAPI HTMLElement2_get_scrollHeight(IHTMLElement2 *iface, long *
|
||||
static HRESULT WINAPI HTMLElement2_get_scrollWidth(IHTMLElement2 *iface, long *p)
|
||||
{
|
||||
HTMLElement *This = HTMLELEM2_THIS(iface);
|
||||
nsIDOMNSHTMLElement *nselem;
|
||||
nsIDOMNSElement *nselem;
|
||||
PRInt32 width = 0;
|
||||
nsresult nsres;
|
||||
|
||||
TRACE("(%p)->(%p)\n", This, p);
|
||||
|
||||
nsres = nsIDOMElement_QueryInterface(This->nselem, &IID_nsIDOMNSHTMLElement, (void**)&nselem);
|
||||
nsres = nsIDOMElement_QueryInterface(This->nselem, &IID_nsIDOMNSElement, (void**)&nselem);
|
||||
if(NS_SUCCEEDED(nsres)) {
|
||||
nsres = nsIDOMNSHTMLElement_GetScrollWidth(nselem, &width);
|
||||
nsIDOMNSHTMLElement_Release(nselem);
|
||||
nsres = nsIDOMNSElement_GetScrollWidth(nselem, &width);
|
||||
nsIDOMNSElement_Release(nselem);
|
||||
if(NS_FAILED(nsres))
|
||||
ERR("GetScrollWidth failed: %08x\n", nsres);
|
||||
}else {
|
||||
ERR("Could not get nsIDOMNSHTMLElement interface: %08x\n", nsres);
|
||||
ERR("Could not get nsIDOMNSElement interface: %08x\n", nsres);
|
||||
}
|
||||
|
||||
*p = width;
|
||||
@@ -758,7 +777,7 @@ static HRESULT WINAPI HTMLElement2_get_scrollWidth(IHTMLElement2 *iface, long *p
|
||||
static HRESULT WINAPI HTMLElement2_put_scrollTop(IHTMLElement2 *iface, long v)
|
||||
{
|
||||
HTMLElement *This = HTMLELEM2_THIS(iface);
|
||||
nsIDOMNSHTMLElement *nselem;
|
||||
nsIDOMNSElement *nselem;
|
||||
nsresult nsres;
|
||||
|
||||
TRACE("(%p)->(%ld)\n", This, v);
|
||||
@@ -768,12 +787,12 @@ static HRESULT WINAPI HTMLElement2_put_scrollTop(IHTMLElement2 *iface, long v)
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
nsres = nsIDOMHTMLElement_QueryInterface(This->nselem, &IID_nsIDOMNSHTMLElement, (void**)&nselem);
|
||||
nsres = nsIDOMHTMLElement_QueryInterface(This->nselem, &IID_nsIDOMNSElement, (void**)&nselem);
|
||||
if(NS_SUCCEEDED(nsres)) {
|
||||
nsIDOMNSHTMLElement_SetScrollTop(nselem, v);
|
||||
nsIDOMNSHTMLElement_Release(nselem);
|
||||
nsIDOMNSElement_SetScrollTop(nselem, v);
|
||||
nsIDOMNSElement_Release(nselem);
|
||||
}else {
|
||||
ERR("Could not get nsIDOMNSHTMLElement interface: %08x\n", nsres);
|
||||
ERR("Could not get nsIDOMNSElement interface: %08x\n", nsres);
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
@@ -782,20 +801,20 @@ static HRESULT WINAPI HTMLElement2_put_scrollTop(IHTMLElement2 *iface, long v)
|
||||
static HRESULT WINAPI HTMLElement2_get_scrollTop(IHTMLElement2 *iface, long *p)
|
||||
{
|
||||
HTMLElement *This = HTMLELEM2_THIS(iface);
|
||||
nsIDOMNSHTMLElement *nselem;
|
||||
nsIDOMNSElement *nselem;
|
||||
PRInt32 top = 0;
|
||||
nsresult nsres;
|
||||
|
||||
TRACE("(%p)->(%p)\n", This, p);
|
||||
|
||||
nsres = nsIDOMElement_QueryInterface(This->nselem, &IID_nsIDOMNSHTMLElement, (void**)&nselem);
|
||||
nsres = nsIDOMElement_QueryInterface(This->nselem, &IID_nsIDOMNSElement, (void**)&nselem);
|
||||
if(NS_SUCCEEDED(nsres)) {
|
||||
nsres = nsIDOMNSHTMLElement_GetScrollTop(nselem, &top);
|
||||
nsIDOMNSHTMLElement_Release(nselem);
|
||||
nsres = nsIDOMNSElement_GetScrollTop(nselem, &top);
|
||||
nsIDOMNSElement_Release(nselem);
|
||||
if(NS_FAILED(nsres))
|
||||
ERR("GetScrollTop failed: %08x\n", nsres);
|
||||
}else {
|
||||
ERR("Could not get nsIDOMNSHTMLElement interface: %08x\n", nsres);
|
||||
ERR("Could not get nsIDOMNSElement interface: %08x\n", nsres);
|
||||
}
|
||||
|
||||
*p = top;
|
||||
@@ -807,7 +826,7 @@ static HRESULT WINAPI HTMLElement2_get_scrollTop(IHTMLElement2 *iface, long *p)
|
||||
static HRESULT WINAPI HTMLElement2_put_scrollLeft(IHTMLElement2 *iface, long v)
|
||||
{
|
||||
HTMLElement *This = HTMLELEM2_THIS(iface);
|
||||
nsIDOMNSHTMLElement *nselem;
|
||||
nsIDOMNSElement *nselem;
|
||||
nsresult nsres;
|
||||
|
||||
TRACE("(%p)->(%ld)\n", This, v);
|
||||
@@ -817,12 +836,12 @@ static HRESULT WINAPI HTMLElement2_put_scrollLeft(IHTMLElement2 *iface, long v)
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
nsres = nsIDOMHTMLElement_QueryInterface(This->nselem, &IID_nsIDOMNSHTMLElement, (void**)&nselem);
|
||||
nsres = nsIDOMElement_QueryInterface(This->nselem, &IID_nsIDOMNSElement, (void**)&nselem);
|
||||
if(NS_SUCCEEDED(nsres)) {
|
||||
nsIDOMNSHTMLElement_SetScrollLeft(nselem, v);
|
||||
nsIDOMNSHTMLElement_Release(nselem);
|
||||
nsIDOMNSElement_SetScrollLeft(nselem, v);
|
||||
nsIDOMNSElement_Release(nselem);
|
||||
}else {
|
||||
ERR("Could not get nsIDOMNSHTMLElement interface: %08x\n", nsres);
|
||||
ERR("Could not get nsIDOMNSElement interface: %08x\n", nsres);
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
@@ -831,8 +850,34 @@ static HRESULT WINAPI HTMLElement2_put_scrollLeft(IHTMLElement2 *iface, long v)
|
||||
static HRESULT WINAPI HTMLElement2_get_scrollLeft(IHTMLElement2 *iface, long *p)
|
||||
{
|
||||
HTMLElement *This = HTMLELEM2_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
nsIDOMNSElement *nselem;
|
||||
PRInt32 left = 0;
|
||||
nsresult nsres;
|
||||
|
||||
TRACE("(%p)->(%p)\n", This, p);
|
||||
|
||||
if(!p)
|
||||
return E_INVALIDARG;
|
||||
|
||||
if(!This->nselem)
|
||||
{
|
||||
FIXME("NULL nselem\n");
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
nsres = nsIDOMHTMLElement_QueryInterface(This->nselem, &IID_nsIDOMNSElement, (void**)&nselem);
|
||||
if(NS_SUCCEEDED(nsres))
|
||||
{
|
||||
nsres = nsIDOMNSElement_GetScrollLeft(nselem, &left);
|
||||
nsIDOMNSElement_Release(nselem);
|
||||
if(NS_FAILED(nsres))
|
||||
left = 0;
|
||||
}
|
||||
|
||||
*p = left;
|
||||
TRACE("*p = %ld\n", *p);
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLElement2_clearAttributes(IHTMLElement2 *iface)
|
||||
|
||||
@@ -0,0 +1,483 @@
|
||||
/*
|
||||
* Copyright 2008 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 <stdarg.h>
|
||||
|
||||
#define COBJMACROS
|
||||
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#include "winuser.h"
|
||||
#include "ole2.h"
|
||||
|
||||
#include "wine/debug.h"
|
||||
#include "wine/unicode.h"
|
||||
|
||||
#include "mshtml_private.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
|
||||
|
||||
#define HTMLELEM3_THIS(iface) DEFINE_THIS(HTMLElement, HTMLElement3, iface)
|
||||
|
||||
static HRESULT WINAPI HTMLElement3_QueryInterface(IHTMLElement3 *iface,
|
||||
REFIID riid, void **ppv)
|
||||
{
|
||||
HTMLElement *This = HTMLELEM3_THIS(iface);
|
||||
return IHTMLElement_QueryInterface(HTMLELEM(This), riid, ppv);
|
||||
}
|
||||
|
||||
static ULONG WINAPI HTMLElement3_AddRef(IHTMLElement3 *iface)
|
||||
{
|
||||
HTMLElement *This = HTMLELEM3_THIS(iface);
|
||||
return IHTMLElement_AddRef(HTMLELEM(This));
|
||||
}
|
||||
|
||||
static ULONG WINAPI HTMLElement3_Release(IHTMLElement3 *iface)
|
||||
{
|
||||
HTMLElement *This = HTMLELEM3_THIS(iface);
|
||||
return IHTMLElement_Release(HTMLELEM(This));
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLElement3_GetTypeInfoCount(IHTMLElement3 *iface, UINT *pctinfo)
|
||||
{
|
||||
HTMLElement *This = HTMLELEM3_THIS(iface);
|
||||
return IDispatchEx_GetTypeInfoCount(DISPATCHEX(&This->node.dispex), pctinfo);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLElement3_GetTypeInfo(IHTMLElement3 *iface, UINT iTInfo,
|
||||
LCID lcid, ITypeInfo **ppTInfo)
|
||||
{
|
||||
HTMLElement *This = HTMLELEM3_THIS(iface);
|
||||
return IDispatchEx_GetTypeInfo(DISPATCHEX(&This->node.dispex), iTInfo, lcid, ppTInfo);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLElement3_GetIDsOfNames(IHTMLElement3 *iface, REFIID riid,
|
||||
LPOLESTR *rgszNames, UINT cNames,
|
||||
LCID lcid, DISPID *rgDispId)
|
||||
{
|
||||
HTMLElement *This = HTMLELEM3_THIS(iface);
|
||||
return IDispatchEx_GetIDsOfNames(DISPATCHEX(&This->node.dispex), riid, rgszNames, cNames, lcid, rgDispId);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLElement3_Invoke(IHTMLElement3 *iface, DISPID dispIdMember,
|
||||
REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
|
||||
VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
|
||||
{
|
||||
HTMLElement *This = HTMLELEM3_THIS(iface);
|
||||
return IDispatchEx_Invoke(DISPATCHEX(&This->node.dispex), dispIdMember, riid, lcid,
|
||||
wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLElement3_mergeAttributes(IHTMLElement3 *iface, IHTMLElement *mergeThis, VARIANT *pvarFlags)
|
||||
{
|
||||
HTMLElement *This = HTMLELEM3_THIS(iface);
|
||||
FIXME("(%p)->(%p %p)\n", This, mergeThis, pvarFlags);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLElement3_get_isMultiLine(IHTMLElement3 *iface, VARIANT_BOOL *p)
|
||||
{
|
||||
HTMLElement *This = HTMLELEM3_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLElement3_get_canHaveHTML(IHTMLElement3 *iface, VARIANT_BOOL *p)
|
||||
{
|
||||
HTMLElement *This = HTMLELEM3_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLElement3_put_onlayoutcomplete(IHTMLElement3 *iface, VARIANT v)
|
||||
{
|
||||
HTMLElement *This = HTMLELEM3_THIS(iface);
|
||||
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLElement3_get_onlayoutcomplete(IHTMLElement3 *iface, VARIANT *p)
|
||||
{
|
||||
HTMLElement *This = HTMLELEM3_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLElement3_put_onpage(IHTMLElement3 *iface, VARIANT v)
|
||||
{
|
||||
HTMLElement *This = HTMLELEM3_THIS(iface);
|
||||
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLElement3_get_onpage(IHTMLElement3 *iface, VARIANT *p)
|
||||
{
|
||||
HTMLElement *This = HTMLELEM3_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLElement3_put_inflateBlock(IHTMLElement3 *iface, VARIANT_BOOL v)
|
||||
{
|
||||
HTMLElement *This = HTMLELEM3_THIS(iface);
|
||||
FIXME("(%p)->(%x)\n", This, v);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLElement3_get_inflateBlock(IHTMLElement3 *iface, VARIANT_BOOL *p)
|
||||
{
|
||||
HTMLElement *This = HTMLELEM3_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLElement3_put_onbeforedeactivate(IHTMLElement3 *iface, VARIANT v)
|
||||
{
|
||||
HTMLElement *This = HTMLELEM3_THIS(iface);
|
||||
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLElement3_get_onbeforedeactivate(IHTMLElement3 *iface, VARIANT *p)
|
||||
{
|
||||
HTMLElement *This = HTMLELEM3_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLElement3_setActive(IHTMLElement3 *iface)
|
||||
{
|
||||
HTMLElement *This = HTMLELEM3_THIS(iface);
|
||||
FIXME("(%p)\n", This);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLElement3_put_contentEditable(IHTMLElement3 *iface, BSTR v)
|
||||
{
|
||||
HTMLElement *This = HTMLELEM3_THIS(iface);
|
||||
FIXME("(%p)->(%s)\n", This, debugstr_w(v));
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLElement3_get_contentEditable(IHTMLElement3 *iface, BSTR *p)
|
||||
{
|
||||
HTMLElement *This = HTMLELEM3_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLElement3_get_isContentEditable(IHTMLElement3 *iface, VARIANT_BOOL *p)
|
||||
{
|
||||
HTMLElement *This = HTMLELEM3_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLElement3_put_hideFocus(IHTMLElement3 *iface, VARIANT_BOOL v)
|
||||
{
|
||||
HTMLElement *This = HTMLELEM3_THIS(iface);
|
||||
FIXME("(%p)->(%x)\n", This, v);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLElement3_get_hideFocus(IHTMLElement3 *iface, VARIANT_BOOL *p)
|
||||
{
|
||||
HTMLElement *This = HTMLELEM3_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static const WCHAR disabledW[] = {'d','i','s','a','b','l','e','d',0};
|
||||
|
||||
static HRESULT WINAPI HTMLElement3_put_disabled(IHTMLElement3 *iface, VARIANT_BOOL v)
|
||||
{
|
||||
HTMLElement *This = HTMLELEM3_THIS(iface);
|
||||
VARIANT *var;
|
||||
HRESULT hres;
|
||||
|
||||
TRACE("(%p)->(%x)\n", This, v);
|
||||
|
||||
if(This->node.vtbl->put_disabled)
|
||||
return This->node.vtbl->put_disabled(&This->node, v);
|
||||
|
||||
hres = dispex_get_dprop_ref(&This->node.dispex, disabledW, TRUE, &var);
|
||||
if(FAILED(hres))
|
||||
return hres;
|
||||
|
||||
VariantClear(var);
|
||||
V_VT(var) = VT_BOOL;
|
||||
V_BOOL(var) = v;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLElement3_get_disabled(IHTMLElement3 *iface, VARIANT_BOOL *p)
|
||||
{
|
||||
HTMLElement *This = HTMLELEM3_THIS(iface);
|
||||
VARIANT *var;
|
||||
HRESULT hres;
|
||||
|
||||
TRACE("(%p)->(%p)\n", This, p);
|
||||
|
||||
if(This->node.vtbl->get_disabled)
|
||||
return This->node.vtbl->get_disabled(&This->node, p);
|
||||
|
||||
hres = dispex_get_dprop_ref(&This->node.dispex, disabledW, FALSE, &var);
|
||||
if(hres == DISP_E_UNKNOWNNAME) {
|
||||
*p = VARIANT_FALSE;
|
||||
return S_OK;
|
||||
}
|
||||
if(FAILED(hres))
|
||||
return hres;
|
||||
|
||||
if(V_VT(var) != VT_BOOL) {
|
||||
FIXME("vt %d\n", V_VT(var));
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
*p = V_BOOL(var);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLElement3_get_isDisabled(IHTMLElement3 *iface, VARIANT_BOOL *p)
|
||||
{
|
||||
HTMLElement *This = HTMLELEM3_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLElement3_put_onmove(IHTMLElement3 *iface, VARIANT v)
|
||||
{
|
||||
HTMLElement *This = HTMLELEM3_THIS(iface);
|
||||
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLElement3_get_onmove(IHTMLElement3 *iface, VARIANT *p)
|
||||
{
|
||||
HTMLElement *This = HTMLELEM3_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLElement3_put_oncontrolselect(IHTMLElement3 *iface, VARIANT v)
|
||||
{
|
||||
HTMLElement *This = HTMLELEM3_THIS(iface);
|
||||
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLElement3_get_oncontrolselect(IHTMLElement3 *iface, VARIANT *p)
|
||||
{
|
||||
HTMLElement *This = HTMLELEM3_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLElement3_fireEvent(IHTMLElement3 *iface, BSTR bstrEventName,
|
||||
VARIANT *pvarEventObject, VARIANT_BOOL *pfCancelled)
|
||||
{
|
||||
HTMLElement *This = HTMLELEM3_THIS(iface);
|
||||
FIXME("(%p)->(%s %p %p)\n", This, debugstr_w(bstrEventName), pvarEventObject, pfCancelled);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLElement3_put_onresizestart(IHTMLElement3 *iface, VARIANT v)
|
||||
{
|
||||
HTMLElement *This = HTMLELEM3_THIS(iface);
|
||||
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLElement3_get_onresizestart(IHTMLElement3 *iface, VARIANT *p)
|
||||
{
|
||||
HTMLElement *This = HTMLELEM3_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLElement3_put_onresizeend(IHTMLElement3 *iface, VARIANT v)
|
||||
{
|
||||
HTMLElement *This = HTMLELEM3_THIS(iface);
|
||||
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLElement3_get_onresizeend(IHTMLElement3 *iface, VARIANT *p)
|
||||
{
|
||||
HTMLElement *This = HTMLELEM3_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLElement3_put_onmovestart(IHTMLElement3 *iface, VARIANT v)
|
||||
{
|
||||
HTMLElement *This = HTMLELEM3_THIS(iface);
|
||||
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLElement3_get_onmovestart(IHTMLElement3 *iface, VARIANT *p)
|
||||
{
|
||||
HTMLElement *This = HTMLELEM3_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLElement3_put_onmoveend(IHTMLElement3 *iface, VARIANT v)
|
||||
{
|
||||
HTMLElement *This = HTMLELEM3_THIS(iface);
|
||||
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLElement3_get_onmoveend(IHTMLElement3 *iface, VARIANT *p)
|
||||
{
|
||||
HTMLElement *This = HTMLELEM3_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLElement3_put_onmousecenter(IHTMLElement3 *iface, VARIANT v)
|
||||
{
|
||||
HTMLElement *This = HTMLELEM3_THIS(iface);
|
||||
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLElement3_get_onmousecenter(IHTMLElement3 *iface, VARIANT *p)
|
||||
{
|
||||
HTMLElement *This = HTMLELEM3_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLElement3_put_onmouseleave(IHTMLElement3 *iface, VARIANT v)
|
||||
{
|
||||
HTMLElement *This = HTMLELEM3_THIS(iface);
|
||||
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLElement3_get_onmouseleave(IHTMLElement3 *iface, VARIANT *p)
|
||||
{
|
||||
HTMLElement *This = HTMLELEM3_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLElement3_put_onactivate(IHTMLElement3 *iface, VARIANT v)
|
||||
{
|
||||
HTMLElement *This = HTMLELEM3_THIS(iface);
|
||||
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLElement3_get_onactivate(IHTMLElement3 *iface, VARIANT *p)
|
||||
{
|
||||
HTMLElement *This = HTMLELEM3_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLElement3_put_ondeactivate(IHTMLElement3 *iface, VARIANT v)
|
||||
{
|
||||
HTMLElement *This = HTMLELEM3_THIS(iface);
|
||||
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLElement3_get_ondeactivate(IHTMLElement3 *iface, VARIANT *p)
|
||||
{
|
||||
HTMLElement *This = HTMLELEM3_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLElement3_dragDrop(IHTMLElement3 *iface, VARIANT_BOOL *pfRet)
|
||||
{
|
||||
HTMLElement *This = HTMLELEM3_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, pfRet);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLElement3_get_glyphMode(IHTMLElement3 *iface, LONG *p)
|
||||
{
|
||||
HTMLElement *This = HTMLELEM3_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
#undef HTMLELEM2_THIS
|
||||
|
||||
static const IHTMLElement3Vtbl HTMLElement3Vtbl = {
|
||||
HTMLElement3_QueryInterface,
|
||||
HTMLElement3_AddRef,
|
||||
HTMLElement3_Release,
|
||||
HTMLElement3_GetTypeInfoCount,
|
||||
HTMLElement3_GetTypeInfo,
|
||||
HTMLElement3_GetIDsOfNames,
|
||||
HTMLElement3_Invoke,
|
||||
HTMLElement3_mergeAttributes,
|
||||
HTMLElement3_get_isMultiLine,
|
||||
HTMLElement3_get_canHaveHTML,
|
||||
HTMLElement3_put_onlayoutcomplete,
|
||||
HTMLElement3_get_onlayoutcomplete,
|
||||
HTMLElement3_put_onpage,
|
||||
HTMLElement3_get_onpage,
|
||||
HTMLElement3_put_inflateBlock,
|
||||
HTMLElement3_get_inflateBlock,
|
||||
HTMLElement3_put_onbeforedeactivate,
|
||||
HTMLElement3_get_onbeforedeactivate,
|
||||
HTMLElement3_setActive,
|
||||
HTMLElement3_put_contentEditable,
|
||||
HTMLElement3_get_contentEditable,
|
||||
HTMLElement3_get_isContentEditable,
|
||||
HTMLElement3_put_hideFocus,
|
||||
HTMLElement3_get_hideFocus,
|
||||
HTMLElement3_put_disabled,
|
||||
HTMLElement3_get_disabled,
|
||||
HTMLElement3_get_isDisabled,
|
||||
HTMLElement3_put_onmove,
|
||||
HTMLElement3_get_onmove,
|
||||
HTMLElement3_put_oncontrolselect,
|
||||
HTMLElement3_get_oncontrolselect,
|
||||
HTMLElement3_fireEvent,
|
||||
HTMLElement3_put_onresizestart,
|
||||
HTMLElement3_get_onresizestart,
|
||||
HTMLElement3_put_onresizeend,
|
||||
HTMLElement3_get_onresizeend,
|
||||
HTMLElement3_put_onmovestart,
|
||||
HTMLElement3_get_onmovestart,
|
||||
HTMLElement3_put_onmoveend,
|
||||
HTMLElement3_get_onmoveend,
|
||||
HTMLElement3_put_onmousecenter,
|
||||
HTMLElement3_get_onmousecenter,
|
||||
HTMLElement3_put_onmouseleave,
|
||||
HTMLElement3_get_onmouseleave,
|
||||
HTMLElement3_put_onactivate,
|
||||
HTMLElement3_get_onactivate,
|
||||
HTMLElement3_put_ondeactivate,
|
||||
HTMLElement3_get_ondeactivate,
|
||||
HTMLElement3_dragDrop,
|
||||
HTMLElement3_get_glyphMode
|
||||
};
|
||||
|
||||
void HTMLElement3_Init(HTMLElement *This)
|
||||
{
|
||||
This->lpHTMLElement3Vtbl = &HTMLElement3Vtbl;
|
||||
}
|
||||
@@ -0,0 +1,558 @@
|
||||
/*
|
||||
* Copyright 2006-2008 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 <stdarg.h>
|
||||
|
||||
#define COBJMACROS
|
||||
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#include "winuser.h"
|
||||
#include "ole2.h"
|
||||
|
||||
#include "wine/debug.h"
|
||||
|
||||
#include "mshtml_private.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
|
||||
|
||||
typedef struct {
|
||||
DispatchEx dispex;
|
||||
const IHTMLElementCollectionVtbl *lpHTMLElementCollectionVtbl;
|
||||
|
||||
IUnknown *ref_unk;
|
||||
HTMLElement **elems;
|
||||
DWORD len;
|
||||
|
||||
LONG ref;
|
||||
} HTMLElementCollection;
|
||||
|
||||
#define HTMLELEMCOL(x) ((IHTMLElementCollection*) &(x)->lpHTMLElementCollectionVtbl)
|
||||
|
||||
typedef struct {
|
||||
HTMLElement **buf;
|
||||
DWORD len;
|
||||
DWORD size;
|
||||
} elem_vector_t;
|
||||
|
||||
static IHTMLElementCollection *HTMLElementCollection_Create(IUnknown *ref_unk,
|
||||
HTMLElement **elems, DWORD len);
|
||||
|
||||
static void elem_vector_add(elem_vector_t *buf, HTMLElement *elem)
|
||||
{
|
||||
if(buf->len == buf->size) {
|
||||
buf->size <<= 1;
|
||||
buf->buf = heap_realloc(buf->buf, buf->size*sizeof(HTMLElement**));
|
||||
}
|
||||
|
||||
buf->buf[buf->len++] = elem;
|
||||
}
|
||||
|
||||
static void elem_vector_normalize(elem_vector_t *buf)
|
||||
{
|
||||
if(!buf->len) {
|
||||
heap_free(buf->buf);
|
||||
buf->buf = NULL;
|
||||
}else if(buf->size > buf->len) {
|
||||
buf->buf = heap_realloc(buf->buf, buf->len*sizeof(HTMLElement**));
|
||||
}
|
||||
|
||||
buf->size = buf->len;
|
||||
}
|
||||
|
||||
static inline BOOL is_elem_node(nsIDOMNode *node)
|
||||
{
|
||||
PRUint16 type=0;
|
||||
|
||||
nsIDOMNode_GetNodeType(node, &type);
|
||||
|
||||
return type == ELEMENT_NODE || type == COMMENT_NODE;
|
||||
}
|
||||
|
||||
#define ELEMCOL_THIS(iface) DEFINE_THIS(HTMLElementCollection, HTMLElementCollection, iface)
|
||||
#define HTMLELEM_NODE_THIS(iface) DEFINE_THIS2(HTMLElement, node, iface)
|
||||
|
||||
static HRESULT WINAPI HTMLElementCollection_QueryInterface(IHTMLElementCollection *iface,
|
||||
REFIID riid, void **ppv)
|
||||
{
|
||||
HTMLElementCollection *This = ELEMCOL_THIS(iface);
|
||||
|
||||
*ppv = NULL;
|
||||
|
||||
if(IsEqualGUID(&IID_IUnknown, riid)) {
|
||||
TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
|
||||
*ppv = HTMLELEMCOL(This);
|
||||
}else if(IsEqualGUID(&IID_IHTMLElementCollection, riid)) {
|
||||
TRACE("(%p)->(IID_IHTMLElementCollection %p)\n", This, ppv);
|
||||
*ppv = HTMLELEMCOL(This);
|
||||
}else if(dispex_query_interface(&This->dispex, riid, ppv)) {
|
||||
return *ppv ? S_OK : E_NOINTERFACE;
|
||||
}
|
||||
|
||||
if(*ppv) {
|
||||
IHTMLElementCollection_AddRef(HTMLELEMCOL(This));
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
FIXME("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppv);
|
||||
return E_NOINTERFACE;
|
||||
}
|
||||
|
||||
static ULONG WINAPI HTMLElementCollection_AddRef(IHTMLElementCollection *iface)
|
||||
{
|
||||
HTMLElementCollection *This = ELEMCOL_THIS(iface);
|
||||
LONG ref = InterlockedIncrement(&This->ref);
|
||||
|
||||
TRACE("(%p) ref=%d\n", This, ref);
|
||||
|
||||
return ref;
|
||||
}
|
||||
|
||||
static ULONG WINAPI HTMLElementCollection_Release(IHTMLElementCollection *iface)
|
||||
{
|
||||
HTMLElementCollection *This = ELEMCOL_THIS(iface);
|
||||
LONG ref = InterlockedDecrement(&This->ref);
|
||||
|
||||
TRACE("(%p) ref=%d\n", This, ref);
|
||||
|
||||
if(!ref) {
|
||||
IUnknown_Release(This->ref_unk);
|
||||
heap_free(This->elems);
|
||||
heap_free(This);
|
||||
}
|
||||
|
||||
return ref;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLElementCollection_GetTypeInfoCount(IHTMLElementCollection *iface,
|
||||
UINT *pctinfo)
|
||||
{
|
||||
HTMLElementCollection *This = ELEMCOL_THIS(iface);
|
||||
return IDispatchEx_GetTypeInfoCount(DISPATCHEX(&This->dispex), pctinfo);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLElementCollection_GetTypeInfo(IHTMLElementCollection *iface,
|
||||
UINT iTInfo, LCID lcid, ITypeInfo **ppTInfo)
|
||||
{
|
||||
HTMLElementCollection *This = ELEMCOL_THIS(iface);
|
||||
return IDispatchEx_GetTypeInfo(DISPATCHEX(&This->dispex), iTInfo, lcid, ppTInfo);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLElementCollection_GetIDsOfNames(IHTMLElementCollection *iface,
|
||||
REFIID riid, LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
|
||||
{
|
||||
HTMLElementCollection *This = ELEMCOL_THIS(iface);
|
||||
return IDispatchEx_GetIDsOfNames(DISPATCHEX(&This->dispex), riid, rgszNames, cNames, lcid, rgDispId);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLElementCollection_Invoke(IHTMLElementCollection *iface,
|
||||
DISPID dispIdMember, REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
|
||||
VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
|
||||
{
|
||||
HTMLElementCollection *This = ELEMCOL_THIS(iface);
|
||||
return IDispatchEx_Invoke(DISPATCHEX(&This->dispex), dispIdMember, riid, lcid,
|
||||
wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLElementCollection_toString(IHTMLElementCollection *iface,
|
||||
BSTR *String)
|
||||
{
|
||||
HTMLElementCollection *This = ELEMCOL_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, String);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLElementCollection_put_length(IHTMLElementCollection *iface,
|
||||
long v)
|
||||
{
|
||||
HTMLElementCollection *This = ELEMCOL_THIS(iface);
|
||||
FIXME("(%p)->(%ld)\n", This, v);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLElementCollection_get_length(IHTMLElementCollection *iface,
|
||||
long *p)
|
||||
{
|
||||
HTMLElementCollection *This = ELEMCOL_THIS(iface);
|
||||
|
||||
TRACE("(%p)->(%p)\n", This, p);
|
||||
|
||||
*p = This->len;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLElementCollection_get__newEnum(IHTMLElementCollection *iface,
|
||||
IUnknown **p)
|
||||
{
|
||||
HTMLElementCollection *This = ELEMCOL_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static BOOL is_elem_name(HTMLElement *elem, LPCWSTR name)
|
||||
{
|
||||
const PRUnichar *str;
|
||||
nsAString nsstr, nsname;
|
||||
BOOL ret = FALSE;
|
||||
nsresult nsres;
|
||||
|
||||
static const PRUnichar nameW[] = {'n','a','m','e',0};
|
||||
|
||||
if(!elem->nselem)
|
||||
return FALSE;
|
||||
|
||||
nsAString_Init(&nsstr, NULL);
|
||||
nsIDOMHTMLElement_GetId(elem->nselem, &nsstr);
|
||||
nsAString_GetData(&nsstr, &str);
|
||||
if(!strcmpiW(str, name)) {
|
||||
nsAString_Finish(&nsstr);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
nsAString_Init(&nsname, nameW);
|
||||
nsres = nsIDOMHTMLElement_GetAttribute(elem->nselem, &nsname, &nsstr);
|
||||
nsAString_Finish(&nsname);
|
||||
if(NS_SUCCEEDED(nsres)) {
|
||||
nsAString_GetData(&nsstr, &str);
|
||||
ret = !strcmpiW(str, name);
|
||||
}
|
||||
|
||||
nsAString_Finish(&nsstr);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLElementCollection_item(IHTMLElementCollection *iface,
|
||||
VARIANT name, VARIANT index, IDispatch **pdisp)
|
||||
{
|
||||
HTMLElementCollection *This = ELEMCOL_THIS(iface);
|
||||
|
||||
TRACE("(%p)->(v(%d) v(%d) %p)\n", This, V_VT(&name), V_VT(&index), pdisp);
|
||||
|
||||
*pdisp = NULL;
|
||||
|
||||
if(V_VT(&name) == VT_I4) {
|
||||
TRACE("name is VT_I4: %d\n", V_I4(&name));
|
||||
|
||||
if(V_I4(&name) < 0)
|
||||
return E_INVALIDARG;
|
||||
if(V_I4(&name) >= This->len)
|
||||
return S_OK;
|
||||
|
||||
*pdisp = (IDispatch*)This->elems[V_I4(&name)];
|
||||
IDispatch_AddRef(*pdisp);
|
||||
TRACE("Returning pdisp=%p\n", pdisp);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
if(V_VT(&name) == VT_BSTR) {
|
||||
DWORD i;
|
||||
|
||||
TRACE("name is VT_BSTR: %s\n", debugstr_w(V_BSTR(&name)));
|
||||
|
||||
if(V_VT(&index) == VT_I4) {
|
||||
LONG idx = V_I4(&index);
|
||||
|
||||
TRACE("index = %d\n", idx);
|
||||
|
||||
if(idx < 0)
|
||||
return E_INVALIDARG;
|
||||
|
||||
for(i=0; i<This->len; i++) {
|
||||
if(is_elem_name(This->elems[i], V_BSTR(&name)) && !idx--)
|
||||
break;
|
||||
}
|
||||
|
||||
if(i != This->len) {
|
||||
*pdisp = (IDispatch*)HTMLELEM(This->elems[i]);
|
||||
IDispatch_AddRef(*pdisp);
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}else {
|
||||
elem_vector_t buf = {NULL, 0, 8};
|
||||
|
||||
buf.buf = heap_alloc(buf.size*sizeof(HTMLElement*));
|
||||
|
||||
for(i=0; i<This->len; i++) {
|
||||
if(is_elem_name(This->elems[i], V_BSTR(&name)))
|
||||
elem_vector_add(&buf, This->elems[i]);
|
||||
}
|
||||
|
||||
if(buf.len > 1) {
|
||||
elem_vector_normalize(&buf);
|
||||
*pdisp = (IDispatch*)HTMLElementCollection_Create(This->ref_unk, buf.buf, buf.len);
|
||||
}else {
|
||||
if(buf.len == 1) {
|
||||
*pdisp = (IDispatch*)HTMLELEM(buf.buf[0]);
|
||||
IDispatch_AddRef(*pdisp);
|
||||
}
|
||||
|
||||
heap_free(buf.buf);
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
}
|
||||
|
||||
FIXME("unsupported arguments\n");
|
||||
return E_INVALIDARG;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLElementCollection_tags(IHTMLElementCollection *iface,
|
||||
VARIANT tagName, IDispatch **pdisp)
|
||||
{
|
||||
HTMLElementCollection *This = ELEMCOL_THIS(iface);
|
||||
DWORD i;
|
||||
nsAString tag_str;
|
||||
const PRUnichar *tag;
|
||||
elem_vector_t buf = {NULL, 0, 8};
|
||||
|
||||
if(V_VT(&tagName) != VT_BSTR) {
|
||||
WARN("Invalid arg\n");
|
||||
return DISP_E_MEMBERNOTFOUND;
|
||||
}
|
||||
|
||||
TRACE("(%p)->(%s %p)\n", This, debugstr_w(V_BSTR(&tagName)), pdisp);
|
||||
|
||||
buf.buf = heap_alloc(buf.size*sizeof(HTMLElement*));
|
||||
|
||||
nsAString_Init(&tag_str, NULL);
|
||||
|
||||
for(i=0; i<This->len; i++) {
|
||||
if(!This->elems[i]->nselem)
|
||||
continue;
|
||||
|
||||
nsIDOMElement_GetTagName(This->elems[i]->nselem, &tag_str);
|
||||
nsAString_GetData(&tag_str, &tag);
|
||||
|
||||
if(CompareStringW(LOCALE_SYSTEM_DEFAULT, NORM_IGNORECASE, tag, -1,
|
||||
V_BSTR(&tagName), -1) == CSTR_EQUAL)
|
||||
elem_vector_add(&buf, This->elems[i]);
|
||||
}
|
||||
|
||||
nsAString_Finish(&tag_str);
|
||||
elem_vector_normalize(&buf);
|
||||
|
||||
TRACE("fount %d tags\n", buf.len);
|
||||
|
||||
*pdisp = (IDispatch*)HTMLElementCollection_Create(This->ref_unk, buf.buf, buf.len);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
#define DISPID_ELEMCOL_0 MSHTML_DISPID_CUSTOM_MIN
|
||||
|
||||
static HRESULT HTMLElementCollection_get_dispid(IUnknown *iface, BSTR name, DWORD flags, DISPID *dispid)
|
||||
{
|
||||
HTMLElementCollection *This = ELEMCOL_THIS(iface);
|
||||
WCHAR *ptr;
|
||||
DWORD idx=0;
|
||||
|
||||
if(!*name)
|
||||
return DISP_E_UNKNOWNNAME;
|
||||
|
||||
for(ptr = name; *ptr && isdigitW(*ptr); ptr++)
|
||||
idx = idx*10 + (*ptr-'0');
|
||||
|
||||
if(*ptr || idx >= This->len)
|
||||
return DISP_E_UNKNOWNNAME;
|
||||
|
||||
*dispid = DISPID_ELEMCOL_0 + idx;
|
||||
TRACE("ret %x\n", *dispid);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT HTMLElementCollection_invoke(IUnknown *iface, DISPID id, LCID lcid, WORD flags, DISPPARAMS *params,
|
||||
VARIANT *res, EXCEPINFO *ei, IServiceProvider *caller)
|
||||
{
|
||||
HTMLElementCollection *This = ELEMCOL_THIS(iface);
|
||||
DWORD idx;
|
||||
|
||||
TRACE("(%p)->(%x %x %x %p %p %p %p)\n", This, id, lcid, flags, params, res, ei, caller);
|
||||
|
||||
idx = id - DISPID_ELEMCOL_0;
|
||||
if(idx >= This->len)
|
||||
return DISP_E_UNKNOWNNAME;
|
||||
|
||||
switch(flags) {
|
||||
case INVOKE_PROPERTYGET:
|
||||
V_VT(res) = VT_DISPATCH;
|
||||
V_DISPATCH(res) = (IDispatch*)HTMLELEM(This->elems[idx]);
|
||||
IHTMLElement_AddRef(HTMLELEM(This->elems[idx]));
|
||||
break;
|
||||
default:
|
||||
FIXME("unimplemented flags %x\n", flags);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
#undef ELEMCOL_THIS
|
||||
|
||||
static const IHTMLElementCollectionVtbl HTMLElementCollectionVtbl = {
|
||||
HTMLElementCollection_QueryInterface,
|
||||
HTMLElementCollection_AddRef,
|
||||
HTMLElementCollection_Release,
|
||||
HTMLElementCollection_GetTypeInfoCount,
|
||||
HTMLElementCollection_GetTypeInfo,
|
||||
HTMLElementCollection_GetIDsOfNames,
|
||||
HTMLElementCollection_Invoke,
|
||||
HTMLElementCollection_toString,
|
||||
HTMLElementCollection_put_length,
|
||||
HTMLElementCollection_get_length,
|
||||
HTMLElementCollection_get__newEnum,
|
||||
HTMLElementCollection_item,
|
||||
HTMLElementCollection_tags
|
||||
};
|
||||
|
||||
static const dispex_static_data_vtbl_t HTMLElementColection_dispex_vtbl = {
|
||||
HTMLElementCollection_get_dispid,
|
||||
HTMLElementCollection_invoke
|
||||
};
|
||||
|
||||
static const tid_t HTMLElementCollection_iface_tids[] = {
|
||||
IHTMLElementCollection_tid,
|
||||
0
|
||||
};
|
||||
static dispex_static_data_t HTMLElementCollection_dispex = {
|
||||
&HTMLElementColection_dispex_vtbl,
|
||||
DispHTMLElementCollection_tid,
|
||||
NULL,
|
||||
HTMLElementCollection_iface_tids
|
||||
};
|
||||
|
||||
static void create_all_list(HTMLDocument *doc, HTMLDOMNode *elem, elem_vector_t *buf)
|
||||
{
|
||||
nsIDOMNodeList *nsnode_list;
|
||||
nsIDOMNode *iter;
|
||||
PRUint32 list_len = 0, i;
|
||||
nsresult nsres;
|
||||
|
||||
nsres = nsIDOMNode_GetChildNodes(elem->nsnode, &nsnode_list);
|
||||
if(NS_FAILED(nsres)) {
|
||||
ERR("GetChildNodes failed: %08x\n", nsres);
|
||||
return;
|
||||
}
|
||||
|
||||
nsIDOMNodeList_GetLength(nsnode_list, &list_len);
|
||||
if(!list_len)
|
||||
return;
|
||||
|
||||
for(i=0; i<list_len; i++) {
|
||||
nsres = nsIDOMNodeList_Item(nsnode_list, i, &iter);
|
||||
if(NS_FAILED(nsres)) {
|
||||
ERR("Item failed: %08x\n", nsres);
|
||||
continue;
|
||||
}
|
||||
|
||||
if(is_elem_node(iter)) {
|
||||
HTMLDOMNode *node = get_node(doc, iter, TRUE);
|
||||
|
||||
elem_vector_add(buf, HTMLELEM_NODE_THIS(node));
|
||||
create_all_list(doc, node, buf);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
IHTMLElementCollection *create_all_collection(HTMLDOMNode *node, BOOL include_root)
|
||||
{
|
||||
elem_vector_t buf = {NULL, 0, 8};
|
||||
|
||||
buf.buf = heap_alloc(buf.size*sizeof(HTMLElement**));
|
||||
|
||||
if(include_root)
|
||||
elem_vector_add(&buf, HTMLELEM_NODE_THIS(node));
|
||||
create_all_list(node->doc, node, &buf);
|
||||
elem_vector_normalize(&buf);
|
||||
|
||||
return HTMLElementCollection_Create((IUnknown*)HTMLDOMNODE(node), buf.buf, buf.len);
|
||||
}
|
||||
|
||||
IHTMLElementCollection *create_collection_from_nodelist(HTMLDocument *doc, IUnknown *unk, nsIDOMNodeList *nslist)
|
||||
{
|
||||
PRUint32 length = 0, i;
|
||||
elem_vector_t buf;
|
||||
|
||||
nsIDOMNodeList_GetLength(nslist, &length);
|
||||
|
||||
buf.len = 0;
|
||||
buf.size = length;
|
||||
if(length) {
|
||||
nsIDOMNode *nsnode;
|
||||
|
||||
buf.buf = heap_alloc(buf.size*sizeof(HTMLElement*));
|
||||
|
||||
for(i=0; i<length; i++) {
|
||||
nsIDOMNodeList_Item(nslist, i, &nsnode);
|
||||
if(is_elem_node(nsnode))
|
||||
buf.buf[buf.len++] = HTMLELEM_NODE_THIS(get_node(doc, nsnode, TRUE));
|
||||
nsIDOMNode_Release(nsnode);
|
||||
}
|
||||
|
||||
elem_vector_normalize(&buf);
|
||||
}else {
|
||||
buf.buf = NULL;
|
||||
}
|
||||
|
||||
return HTMLElementCollection_Create(unk, buf.buf, buf.len);
|
||||
}
|
||||
|
||||
IHTMLElementCollection *create_collection_from_htmlcol(HTMLDocument *doc, IUnknown *unk, nsIDOMHTMLCollection *nscol)
|
||||
{
|
||||
PRUint32 length = 0, i;
|
||||
elem_vector_t buf;
|
||||
|
||||
nsIDOMHTMLCollection_GetLength(nscol, &length);
|
||||
|
||||
buf.len = buf.size = length;
|
||||
if(buf.len) {
|
||||
nsIDOMNode *nsnode;
|
||||
|
||||
buf.buf = heap_alloc(buf.size*sizeof(HTMLElement*));
|
||||
|
||||
for(i=0; i<length; i++) {
|
||||
nsIDOMHTMLCollection_Item(nscol, i, &nsnode);
|
||||
buf.buf[i] = HTMLELEM_NODE_THIS(get_node(doc, nsnode, TRUE));
|
||||
nsIDOMNode_Release(nsnode);
|
||||
}
|
||||
}else {
|
||||
buf.buf = NULL;
|
||||
}
|
||||
|
||||
return HTMLElementCollection_Create(unk, buf.buf, buf.len);
|
||||
}
|
||||
|
||||
static IHTMLElementCollection *HTMLElementCollection_Create(IUnknown *ref_unk,
|
||||
HTMLElement **elems, DWORD len)
|
||||
{
|
||||
HTMLElementCollection *ret = heap_alloc_zero(sizeof(HTMLElementCollection));
|
||||
|
||||
ret->lpHTMLElementCollectionVtbl = &HTMLElementCollectionVtbl;
|
||||
ret->ref = 1;
|
||||
ret->elems = elems;
|
||||
ret->len = len;
|
||||
|
||||
init_dispex(&ret->dispex, (IUnknown*)HTMLELEMCOL(ret), &HTMLElementCollection_dispex);
|
||||
|
||||
IUnknown_AddRef(ref_unk);
|
||||
ret->ref_unk = ref_unk;
|
||||
|
||||
TRACE("ret=%p len=%d\n", ret, len);
|
||||
|
||||
return HTMLELEMCOL(ret);
|
||||
}
|
||||
@@ -26,6 +26,7 @@
|
||||
#include "ole2.h"
|
||||
|
||||
#include "mshtml_private.h"
|
||||
#include "htmlevent.h"
|
||||
|
||||
#include "wine/debug.h"
|
||||
|
||||
@@ -35,18 +36,51 @@ struct event_target_t {
|
||||
IDispatch *event_table[EVENTID_LAST];
|
||||
};
|
||||
|
||||
static const WCHAR blurW[] = {'b','l','u','r',0};
|
||||
static const WCHAR onblurW[] = {'o','n','b','l','u','r',0};
|
||||
|
||||
static const WCHAR changeW[] = {'c','h','a','n','g','e',0};
|
||||
static const WCHAR onchangeW[] = {'o','n','c','h','a','n','g','e',0};
|
||||
|
||||
static const WCHAR clickW[] = {'c','l','i','c','k',0};
|
||||
static const WCHAR onclickW[] = {'o','n','c','l','i','c','k',0};
|
||||
|
||||
static const WCHAR dragW[] = {'d','r','a','g',0};
|
||||
static const WCHAR ondragW[] = {'o','n','d','r','a','g',0};
|
||||
|
||||
static const WCHAR dragstartW[] = {'d','r','a','g','s','t','a','r','t',0};
|
||||
static const WCHAR ondragstartW[] = {'o','n','d','r','a','g','s','t','a','r','t',0};
|
||||
|
||||
static const WCHAR focusW[] = {'f','o','c','u','s',0};
|
||||
static const WCHAR onfocusW[] = {'o','n','f','o','c','u','s',0};
|
||||
|
||||
static const WCHAR keydownW[] = {'k','e','y','d','o','w','n',0};
|
||||
static const WCHAR onkeydownW[] = {'o','n','k','e','y','d','o','w','n',0};
|
||||
|
||||
static const WCHAR keyupW[] = {'k','e','y','u','p',0};
|
||||
static const WCHAR onkeyupW[] = {'o','n','k','e','y','u','p',0};
|
||||
|
||||
static const WCHAR loadW[] = {'l','o','a','d',0};
|
||||
static const WCHAR onloadW[] = {'o','n','l','o','a','d',0};
|
||||
|
||||
static const WCHAR mousedownW[] = {'m','o','u','s','e','d','o','w','n',0};
|
||||
static const WCHAR onmousedownW[] = {'o','n','m','o','u','s','e','d','o','w','n',0};
|
||||
|
||||
static const WCHAR mouseoutW[] = {'m','o','u','s','e','o','u','t',0};
|
||||
static const WCHAR onmouseoutW[] = {'o','n','m','o','u','s','e','o','u','t',0};
|
||||
|
||||
static const WCHAR mouseoverW[] = {'m','o','u','s','e','o','v','e','r',0};
|
||||
static const WCHAR onmouseoverW[] = {'o','n','m','o','u','s','e','o','v','e','r',0};
|
||||
|
||||
static const WCHAR mouseupW[] = {'m','o','u','s','e','u','p',0};
|
||||
static const WCHAR onmouseupW[] = {'o','n','m','o','u','s','e','u','p',0};
|
||||
|
||||
static const WCHAR pasteW[] = {'p','a','s','t','e',0};
|
||||
static const WCHAR onpasteW[] = {'o','n','p','a','s','t','e',0};
|
||||
|
||||
static const WCHAR selectstartW[] = {'s','e','l','e','c','t','s','t','a','r','t',0};
|
||||
static const WCHAR onselectstartW[] = {'o','n','s','e','l','e','c','t','s','t','a','r','t',0};
|
||||
|
||||
typedef struct {
|
||||
LPCWSTR name;
|
||||
LPCWSTR attr_name;
|
||||
@@ -54,12 +88,24 @@ typedef struct {
|
||||
} event_info_t;
|
||||
|
||||
#define EVENT_DEFAULTLISTENER 0x0001
|
||||
#define EVENT_BUBBLE 0x0002
|
||||
|
||||
static const event_info_t event_info[] = {
|
||||
{changeW, onchangeW, EVENT_DEFAULTLISTENER},
|
||||
{clickW, onclickW, EVENT_DEFAULTLISTENER},
|
||||
{keyupW, onkeyupW, EVENT_DEFAULTLISTENER},
|
||||
{loadW, onloadW, 0}
|
||||
{blurW, onblurW, EVENT_DEFAULTLISTENER},
|
||||
{changeW, onchangeW, EVENT_DEFAULTLISTENER|EVENT_BUBBLE},
|
||||
{clickW, onclickW, EVENT_DEFAULTLISTENER|EVENT_BUBBLE},
|
||||
{dragW, ondragW, 0},
|
||||
{dragstartW, ondragstartW, 0},
|
||||
{focusW, onfocusW, EVENT_DEFAULTLISTENER},
|
||||
{keydownW, onkeydownW, EVENT_DEFAULTLISTENER|EVENT_BUBBLE},
|
||||
{keyupW, onkeyupW, EVENT_DEFAULTLISTENER|EVENT_BUBBLE},
|
||||
{loadW, onloadW, 0},
|
||||
{mousedownW, onmousedownW, EVENT_DEFAULTLISTENER|EVENT_BUBBLE},
|
||||
{mouseoutW, onmouseoutW, EVENT_DEFAULTLISTENER|EVENT_BUBBLE},
|
||||
{mouseoverW, onmouseoverW, EVENT_DEFAULTLISTENER|EVENT_BUBBLE},
|
||||
{mouseupW, onmouseupW, EVENT_DEFAULTLISTENER|EVENT_BUBBLE},
|
||||
{pasteW, onpasteW, 0},
|
||||
{selectstartW, onselectstartW, 0}
|
||||
};
|
||||
|
||||
eventid_t str_to_eid(LPCWSTR str)
|
||||
@@ -76,8 +122,12 @@ eventid_t str_to_eid(LPCWSTR str)
|
||||
}
|
||||
|
||||
typedef struct {
|
||||
DispatchEx dispex;
|
||||
const IHTMLEventObjVtbl *lpIHTMLEventObjVtbl;
|
||||
|
||||
LONG ref;
|
||||
|
||||
HTMLDOMNode *target;
|
||||
} HTMLEventObj;
|
||||
|
||||
#define HTMLEVENTOBJ(x) ((IHTMLEventObj*) &(x)->lpIHTMLEventObjVtbl)
|
||||
@@ -93,12 +143,11 @@ static HRESULT WINAPI HTMLEventObj_QueryInterface(IHTMLEventObj *iface, REFIID r
|
||||
if(IsEqualGUID(&IID_IUnknown, riid)) {
|
||||
TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
|
||||
*ppv = HTMLEVENTOBJ(This);
|
||||
}else if(IsEqualGUID(&IID_IDispatch, riid)) {
|
||||
TRACE("(%p)->(IID_IDispatch %p)\n", This, ppv);
|
||||
*ppv = HTMLEVENTOBJ(This);
|
||||
}else if(IsEqualGUID(&IID_IHTMLEventObj, riid)) {
|
||||
TRACE("(%p)->(IID_IHTMLEventObj %p)\n", This, ppv);
|
||||
*ppv = HTMLEVENTOBJ(This);
|
||||
}else if(dispex_query_interface(&This->dispex, riid, ppv)) {
|
||||
return *ppv ? S_OK : E_NOINTERFACE;
|
||||
}
|
||||
|
||||
if(*ppv) {
|
||||
@@ -171,8 +220,10 @@ static HRESULT WINAPI HTMLEventObj_Invoke(IHTMLEventObj *iface, DISPID dispIdMem
|
||||
static HRESULT WINAPI HTMLEventObj_get_srcElement(IHTMLEventObj *iface, IHTMLElement **p)
|
||||
{
|
||||
HTMLEventObj *This = HTMLEVENTOBJ_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
|
||||
TRACE("(%p)->(%p)\n", This, p);
|
||||
|
||||
return IHTMLDOMNode_QueryInterface(HTMLDOMNODE(This->target), &IID_IHTMLElement, (void**)p);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLEventObj_get_altKey(IHTMLEventObj *iface, VARIANT_BOOL *p)
|
||||
@@ -380,66 +431,154 @@ static const IHTMLEventObjVtbl HTMLEventObjVtbl = {
|
||||
HTMLEventObj_get_srcFilter
|
||||
};
|
||||
|
||||
static IHTMLEventObj *create_event(void)
|
||||
static const tid_t HTMLEventObj_iface_tids[] = {
|
||||
IHTMLEventObj_tid,
|
||||
0
|
||||
};
|
||||
|
||||
static dispex_static_data_t HTMLEventObj_dispex = {
|
||||
NULL,
|
||||
DispCEventObj_tid,
|
||||
NULL,
|
||||
HTMLEventObj_iface_tids
|
||||
};
|
||||
|
||||
static IHTMLEventObj *create_event(HTMLDOMNode *target)
|
||||
{
|
||||
HTMLEventObj *ret;
|
||||
|
||||
ret = heap_alloc(sizeof(*ret));
|
||||
ret->lpIHTMLEventObjVtbl = &HTMLEventObjVtbl;
|
||||
ret->ref = 1;
|
||||
ret->target = target;
|
||||
IHTMLDOMNode_AddRef(HTMLDOMNODE(target));
|
||||
|
||||
init_dispex(&ret->dispex, (IUnknown*)HTMLEVENTOBJ(ret), &HTMLEventObj_dispex);
|
||||
|
||||
return HTMLEVENTOBJ(ret);
|
||||
}
|
||||
|
||||
void fire_event(HTMLDocument *doc, eventid_t eid, nsIDOMNode *target)
|
||||
{
|
||||
IHTMLEventObj *prev_event, *event_obj = NULL;
|
||||
nsIDOMNode *parent, *nsnode;
|
||||
HTMLDOMNode *node;
|
||||
PRUint16 node_type;
|
||||
|
||||
node = get_node(doc, target, FALSE);
|
||||
if(!node)
|
||||
nsIDOMNode_GetNodeType(target, &node_type);
|
||||
if(node_type != ELEMENT_NODE) {
|
||||
FIXME("node type %d node supported\n", node_type);
|
||||
return;
|
||||
}
|
||||
|
||||
if(node->event_target && node->event_target->event_table[eid]) {
|
||||
doc->window->event = create_event();
|
||||
prev_event = doc->window->event;
|
||||
nsnode = target;
|
||||
nsIDOMNode_AddRef(nsnode);
|
||||
|
||||
TRACE("%s >>>\n", debugstr_w(event_info[eid].name));
|
||||
call_disp_func(doc, node->event_target->event_table[eid]);
|
||||
TRACE("%s <<<\n", debugstr_w(event_info[eid].name));
|
||||
while(1) {
|
||||
node = get_node(doc, nsnode, FALSE);
|
||||
|
||||
IHTMLEventObj_Release(doc->window->event);
|
||||
doc->window->event = NULL;
|
||||
if(node && node->event_target && node->event_target->event_table[eid]) {
|
||||
if(!event_obj)
|
||||
event_obj = doc->window->event = create_event(get_node(doc, target, TRUE));
|
||||
|
||||
TRACE("%s >>>\n", debugstr_w(event_info[eid].name));
|
||||
call_disp_func(doc, node->event_target->event_table[eid], (IDispatch*)HTMLDOMNODE(node));
|
||||
TRACE("%s <<<\n", debugstr_w(event_info[eid].name));
|
||||
}
|
||||
|
||||
if(!(event_info[eid].flags & EVENT_BUBBLE))
|
||||
break;
|
||||
|
||||
nsIDOMNode_GetParentNode(nsnode, &parent);
|
||||
nsIDOMNode_Release(nsnode);
|
||||
nsnode = parent;
|
||||
if(!nsnode)
|
||||
break;
|
||||
|
||||
nsIDOMNode_GetNodeType(nsnode, &node_type);
|
||||
if(node_type != ELEMENT_NODE)
|
||||
break;
|
||||
}
|
||||
|
||||
if(nsnode)
|
||||
nsIDOMNode_Release(nsnode);
|
||||
|
||||
if((event_info[eid].flags & EVENT_BUBBLE) && doc->event_target && doc->event_target->event_table[eid]) {
|
||||
if(!event_obj)
|
||||
event_obj = doc->window->event = create_event(get_node(doc, target, TRUE));
|
||||
|
||||
TRACE("doc %s >>>\n", debugstr_w(event_info[eid].name));
|
||||
call_disp_func(doc, doc->event_target->event_table[eid], (IDispatch*)HTMLDOC(doc));
|
||||
TRACE("doc %s <<<\n", debugstr_w(event_info[eid].name));
|
||||
}
|
||||
|
||||
if(event_obj) {
|
||||
IHTMLEventObj_Release(event_obj);
|
||||
doc->window->event = prev_event;
|
||||
}
|
||||
}
|
||||
|
||||
static HRESULT set_node_event_disp(HTMLDOMNode *node, eventid_t eid, IDispatch *disp)
|
||||
static HRESULT set_event_handler_disp(event_target_t **event_target, HTMLDocument *doc, eventid_t eid, IDispatch *disp)
|
||||
{
|
||||
if(!node->event_target)
|
||||
node->event_target = heap_alloc_zero(sizeof(event_target_t));
|
||||
else if(node->event_target->event_table[eid])
|
||||
IDispatch_Release(node->event_target->event_table[eid]);
|
||||
if(!*event_target)
|
||||
*event_target = heap_alloc_zero(sizeof(event_target_t));
|
||||
else if((*event_target)->event_table[eid])
|
||||
IDispatch_Release((*event_target)->event_table[eid]);
|
||||
|
||||
(*event_target)->event_table[eid] = disp;
|
||||
if(!disp)
|
||||
return S_OK;
|
||||
IDispatch_AddRef(disp);
|
||||
node->event_target->event_table[eid] = disp;
|
||||
|
||||
if((event_info[eid].flags & EVENT_DEFAULTLISTENER) && !node->doc->nscontainer->event_vector[eid]) {
|
||||
node->doc->nscontainer->event_vector[eid] = TRUE;
|
||||
add_nsevent_listener(node->doc->nscontainer, event_info[eid].name);
|
||||
if(doc->nscontainer && (event_info[eid].flags & EVENT_DEFAULTLISTENER)) {
|
||||
if(!doc->nscontainer->event_vector) {
|
||||
doc->nscontainer->event_vector = heap_alloc_zero(EVENTID_LAST*sizeof(BOOL));
|
||||
if(!doc->nscontainer->event_vector)
|
||||
return E_OUTOFMEMORY;
|
||||
}
|
||||
|
||||
if(!doc->nscontainer->event_vector[eid]) {
|
||||
doc->nscontainer->event_vector[eid] = TRUE;
|
||||
add_nsevent_listener(doc->nscontainer, event_info[eid].name);
|
||||
}
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT set_node_event(HTMLDOMNode *node, eventid_t eid, VARIANT *var)
|
||||
HRESULT set_event_handler(event_target_t **event_target, HTMLDocument *doc, eventid_t eid, VARIANT *var)
|
||||
{
|
||||
switch(V_VT(var)) {
|
||||
case VT_NULL:
|
||||
if(*event_target && (*event_target)->event_table[eid]) {
|
||||
IDispatch_Release((*event_target)->event_table[eid]);
|
||||
(*event_target)->event_table[eid] = NULL;
|
||||
}
|
||||
break;
|
||||
|
||||
case VT_DISPATCH:
|
||||
return set_node_event_disp(node, eid, V_DISPATCH(var));
|
||||
return set_event_handler_disp(event_target, doc, eid, V_DISPATCH(var));
|
||||
|
||||
default:
|
||||
FIXME("not supported vt=%d\n", V_VT(var));
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
return E_NOTIMPL;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HRESULT get_event_handler(event_target_t **event_target, eventid_t eid, VARIANT *var)
|
||||
{
|
||||
if(*event_target && (*event_target)->event_table[eid]) {
|
||||
V_VT(var) = VT_DISPATCH;
|
||||
V_DISPATCH(var) = (*event_target)->event_table[eid];
|
||||
IDispatch_AddRef(V_DISPATCH(var));
|
||||
}else {
|
||||
V_VT(var) = VT_NULL;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void check_event_attr(HTMLDocument *doc, nsIDOMElement *nselem)
|
||||
@@ -467,7 +606,7 @@ void check_event_attr(HTMLDocument *doc, nsIDOMElement *nselem)
|
||||
disp = script_parse_event(doc, attr_value);
|
||||
if(disp) {
|
||||
node = get_node(doc, (nsIDOMNode*)nselem, TRUE);
|
||||
set_node_event_disp(node, i, disp);
|
||||
set_event_handler_disp(&node->event_target, node->doc, i, disp);
|
||||
IDispatch_Release(disp);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,63 @@
|
||||
/*
|
||||
* Copyright 2008 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
|
||||
*/
|
||||
|
||||
typedef enum {
|
||||
EVENTID_BLUR,
|
||||
EVENTID_CHANGE,
|
||||
EVENTID_CLICK,
|
||||
EVENTID_DRAG,
|
||||
EVENTID_DRAGSTART,
|
||||
EVENTID_FOCUS,
|
||||
EVENTID_KEYDOWN,
|
||||
EVENTID_KEYUP,
|
||||
EVENTID_LOAD,
|
||||
EVENTID_MOUSEDOWN,
|
||||
EVENTID_MOUSEOUT,
|
||||
EVENTID_MOUSEOVER,
|
||||
EVENTID_MOUSEUP,
|
||||
EVENTID_PASTE,
|
||||
EVENTID_SELECTSTART,
|
||||
EVENTID_LAST
|
||||
} eventid_t;
|
||||
|
||||
eventid_t str_to_eid(LPCWSTR);
|
||||
void check_event_attr(HTMLDocument*,nsIDOMElement*);
|
||||
void release_event_target(event_target_t*);
|
||||
void fire_event(HTMLDocument*,eventid_t,nsIDOMNode*);
|
||||
HRESULT set_event_handler(event_target_t**,HTMLDocument*,eventid_t,VARIANT*);
|
||||
HRESULT get_event_handler(event_target_t**,eventid_t,VARIANT*);
|
||||
|
||||
static inline HRESULT set_node_event(HTMLDOMNode *node, eventid_t eid, VARIANT *var)
|
||||
{
|
||||
return set_event_handler(&node->event_target, node->doc, eid, var);
|
||||
}
|
||||
|
||||
static inline HRESULT get_node_event(HTMLDOMNode *node, eventid_t eid, VARIANT *var)
|
||||
{
|
||||
return get_event_handler(&node->event_target, eid, var);
|
||||
}
|
||||
|
||||
static inline HRESULT set_doc_event(HTMLDocument *doc, eventid_t eid, VARIANT *var)
|
||||
{
|
||||
return set_event_handler(&doc->event_target, doc, eid, var);
|
||||
}
|
||||
|
||||
static inline HRESULT get_doc_event(HTMLDocument *doc, eventid_t eid, VARIANT *var)
|
||||
{
|
||||
return get_event_handler(&doc->event_target, eid, var);
|
||||
}
|
||||
@@ -66,25 +66,21 @@ static ULONG WINAPI HTMLGenericElement_Release(IHTMLGenericElement *iface)
|
||||
static HRESULT WINAPI HTMLGenericElement_GetTypeInfoCount(IHTMLGenericElement *iface, UINT *pctinfo)
|
||||
{
|
||||
HTMLGenericElement *This = HTMLGENERIC_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, pctinfo);
|
||||
return E_NOTIMPL;
|
||||
return IDispatchEx_GetTypeInfoCount(DISPATCHEX(&This->element.node.dispex), pctinfo);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLGenericElement_GetTypeInfo(IHTMLGenericElement *iface, UINT iTInfo,
|
||||
LCID lcid, ITypeInfo **ppTInfo)
|
||||
{
|
||||
HTMLGenericElement *This = HTMLGENERIC_THIS(iface);
|
||||
FIXME("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo);
|
||||
return E_NOTIMPL;
|
||||
return IDispatchEx_GetTypeInfo(DISPATCHEX(&This->element.node.dispex), iTInfo, lcid, ppTInfo);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLGenericElement_GetIDsOfNames(IHTMLGenericElement *iface, REFIID riid,
|
||||
LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
|
||||
{
|
||||
HTMLGenericElement *This = HTMLGENERIC_THIS(iface);
|
||||
FIXME("(%p)->(%s %p %u %u %p)\n", This, debugstr_guid(riid), rgszNames, cNames,
|
||||
lcid, rgDispId);
|
||||
return E_NOTIMPL;
|
||||
return IDispatchEx_GetIDsOfNames(DISPATCHEX(&This->element.node.dispex), riid, rgszNames, cNames, lcid, rgDispId);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLGenericElement_Invoke(IHTMLGenericElement *iface, DISPID dispIdMember,
|
||||
@@ -92,9 +88,8 @@ static HRESULT WINAPI HTMLGenericElement_Invoke(IHTMLGenericElement *iface, DISP
|
||||
VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
|
||||
{
|
||||
HTMLGenericElement *This = HTMLGENERIC_THIS(iface);
|
||||
FIXME("(%p)->(%d %s %d %d %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid),
|
||||
lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
|
||||
return E_NOTIMPL;
|
||||
return IDispatchEx_Invoke(DISPATCHEX(&This->element.node.dispex), dispIdMember, riid, lcid, wFlags, pDispParams,
|
||||
pVarResult, pExcepInfo, puArgErr);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLGenericElement_get_recordset(IHTMLGenericElement *iface, IDispatch **p)
|
||||
@@ -162,7 +157,7 @@ static const tid_t HTMLGenericElement_iface_tids[] = {
|
||||
IHTMLDOMNode2_tid,
|
||||
IHTMLElement_tid,
|
||||
IHTMLElement2_tid,
|
||||
IHTMLElement2_tid,
|
||||
IHTMLElement3_tid,
|
||||
IHTMLGenericElement_tid,
|
||||
0
|
||||
};
|
||||
|
||||
@@ -0,0 +1,282 @@
|
||||
/*
|
||||
* Copyright 2008 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 <stdarg.h>
|
||||
|
||||
#define COBJMACROS
|
||||
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#include "winuser.h"
|
||||
#include "ole2.h"
|
||||
|
||||
#include "mshtml_private.h"
|
||||
|
||||
#include "wine/debug.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
|
||||
|
||||
typedef struct {
|
||||
HTMLElement element;
|
||||
const IHTMLFrameBase2Vtbl *lpIHTMLFrameBase2Vtbl;
|
||||
|
||||
LONG ref;
|
||||
|
||||
nsIDOMHTMLIFrameElement *nsiframe;
|
||||
HTMLDocument *content_doc;
|
||||
} HTMLIFrame;
|
||||
|
||||
#define HTMLFRAMEBASE2(x) ((IHTMLFrameBase2*) &(x)->lpIHTMLFrameBase2Vtbl)
|
||||
|
||||
#define HTMLFRAMEBASE2_THIS(iface) DEFINE_THIS(HTMLIFrame, IHTMLFrameBase2, iface)
|
||||
|
||||
static HRESULT WINAPI HTMLIFrameBase2_QueryInterface(IHTMLFrameBase2 *iface, REFIID riid, void **ppv)
|
||||
{
|
||||
HTMLIFrame *This = HTMLFRAMEBASE2_THIS(iface);
|
||||
|
||||
return IHTMLDOMNode_QueryInterface(HTMLDOMNODE(&This->element.node), riid, ppv);
|
||||
}
|
||||
|
||||
static ULONG WINAPI HTMLIFrameBase2_AddRef(IHTMLFrameBase2 *iface)
|
||||
{
|
||||
HTMLIFrame *This = HTMLFRAMEBASE2_THIS(iface);
|
||||
|
||||
return IHTMLDOMNode_AddRef(HTMLDOMNODE(&This->element.node));
|
||||
}
|
||||
|
||||
static ULONG WINAPI HTMLIFrameBase2_Release(IHTMLFrameBase2 *iface)
|
||||
{
|
||||
HTMLIFrame *This = HTMLFRAMEBASE2_THIS(iface);
|
||||
|
||||
return IHTMLDOMNode_Release(HTMLDOMNODE(&This->element.node));
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLIFrameBase2_GetTypeInfoCount(IHTMLFrameBase2 *iface, UINT *pctinfo)
|
||||
{
|
||||
HTMLIFrame *This = HTMLFRAMEBASE2_THIS(iface);
|
||||
FIXME("(%p)\n", This);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLIFrameBase2_GetTypeInfo(IHTMLFrameBase2 *iface, UINT iTInfo,
|
||||
LCID lcid, ITypeInfo **ppTInfo)
|
||||
{
|
||||
HTMLIFrame *This = HTMLFRAMEBASE2_THIS(iface);
|
||||
FIXME("(%p)\n", This);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLIFrameBase2_GetIDsOfNames(IHTMLFrameBase2 *iface, REFIID riid,
|
||||
LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
|
||||
{
|
||||
HTMLIFrame *This = HTMLFRAMEBASE2_THIS(iface);
|
||||
FIXME("(%p)\n", This);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLIFrameBase2_Invoke(IHTMLFrameBase2 *iface, DISPID dispIdMember,
|
||||
REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
|
||||
VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
|
||||
{
|
||||
HTMLIFrame *This = HTMLFRAMEBASE2_THIS(iface);
|
||||
FIXME("(%p)\n", This);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLIFrameBase2_get_contentWindow(IHTMLFrameBase2 *iface, IHTMLWindow2 **p)
|
||||
{
|
||||
HTMLIFrame *This = HTMLFRAMEBASE2_THIS(iface);
|
||||
|
||||
TRACE("(%p)->(%p)\n", This, p);
|
||||
|
||||
if(!This->content_doc) {
|
||||
nsIDOMHTMLDocument *nshtmldoc;
|
||||
nsIDOMDocument *nsdoc;
|
||||
nsresult nsres;
|
||||
HRESULT hres;
|
||||
|
||||
nsres = nsIDOMHTMLIFrameElement_GetContentDocument(This->nsiframe, &nsdoc);
|
||||
if(NS_FAILED(nsres)) {
|
||||
ERR("GetContentDocument failed: %08x\n", nsres);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
if(!nsdoc) {
|
||||
FIXME("NULL contentDocument\n");
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
nsres = nsIDOMDocument_QueryInterface(nsdoc, &IID_nsIDOMHTMLDocument, (void**)&nshtmldoc);
|
||||
nsIDOMDocument_Release(nsdoc);
|
||||
if(NS_FAILED(nsres)) {
|
||||
ERR("Could not get nsIDOMHTMLDocument iface: %08x\n", nsres);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
hres = create_doc_from_nsdoc(nshtmldoc, &This->content_doc);
|
||||
nsIDOMHTMLDocument_Release(nshtmldoc);
|
||||
if(FAILED(hres))
|
||||
return hres;
|
||||
}
|
||||
|
||||
return IHTMLDocument2_get_parentWindow(HTMLDOC(This->content_doc), p);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLIFrameBase2_put_onload(IHTMLFrameBase2 *iface, VARIANT v)
|
||||
{
|
||||
HTMLIFrame *This = HTMLFRAMEBASE2_THIS(iface);
|
||||
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLIFrameBase2_get_onload(IHTMLFrameBase2 *iface, VARIANT *p)
|
||||
{
|
||||
HTMLIFrame *This = HTMLFRAMEBASE2_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLIFrameBase2_put_onreadystatechange(IHTMLFrameBase2 *iface, VARIANT v)
|
||||
{
|
||||
HTMLIFrame *This = HTMLFRAMEBASE2_THIS(iface);
|
||||
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLIFrameBase2_get_onreadystatechange(IHTMLFrameBase2 *iface, VARIANT *p)
|
||||
{
|
||||
HTMLIFrame *This = HTMLFRAMEBASE2_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLIFrameBase2_get_readyState(IHTMLFrameBase2 *iface, BSTR *p)
|
||||
{
|
||||
HTMLIFrame *This = HTMLFRAMEBASE2_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLIFrameBase2_put_allowTransparency(IHTMLFrameBase2 *iface, VARIANT_BOOL v)
|
||||
{
|
||||
HTMLIFrame *This = HTMLFRAMEBASE2_THIS(iface);
|
||||
FIXME("(%p)->(%x)\n", This, v);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLIFrameBase2_get_allowTransparency(IHTMLFrameBase2 *iface, VARIANT_BOOL *p)
|
||||
{
|
||||
HTMLIFrame *This = HTMLFRAMEBASE2_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
#undef HTMLFRAMEBASE2_THIS
|
||||
|
||||
static const IHTMLFrameBase2Vtbl HTMLIFrameBase2Vtbl = {
|
||||
HTMLIFrameBase2_QueryInterface,
|
||||
HTMLIFrameBase2_AddRef,
|
||||
HTMLIFrameBase2_Release,
|
||||
HTMLIFrameBase2_GetTypeInfoCount,
|
||||
HTMLIFrameBase2_GetTypeInfo,
|
||||
HTMLIFrameBase2_GetIDsOfNames,
|
||||
HTMLIFrameBase2_Invoke,
|
||||
HTMLIFrameBase2_get_contentWindow,
|
||||
HTMLIFrameBase2_put_onload,
|
||||
HTMLIFrameBase2_get_onload,
|
||||
HTMLIFrameBase2_put_onreadystatechange,
|
||||
HTMLIFrameBase2_get_onreadystatechange,
|
||||
HTMLIFrameBase2_get_readyState,
|
||||
HTMLIFrameBase2_put_allowTransparency,
|
||||
HTMLIFrameBase2_get_allowTransparency
|
||||
};
|
||||
|
||||
#define HTMLIFRAME_NODE_THIS(iface) DEFINE_THIS2(HTMLIFrame, element.node, iface)
|
||||
|
||||
static HRESULT HTMLIFrame_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
|
||||
{
|
||||
HTMLIFrame *This = HTMLIFRAME_NODE_THIS(iface);
|
||||
|
||||
*ppv = NULL;
|
||||
|
||||
if(IsEqualGUID(&IID_IHTMLFrameBase2, riid)) {
|
||||
TRACE("(%p)->(IID_IHTMLFrameBase2 %p)\n", This, ppv);
|
||||
*ppv = HTMLFRAMEBASE2(This);
|
||||
}else {
|
||||
return HTMLElement_QI(&This->element.node, riid, ppv);
|
||||
}
|
||||
|
||||
IUnknown_AddRef((IUnknown*)*ppv);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static void HTMLIFrame_destructor(HTMLDOMNode *iface)
|
||||
{
|
||||
HTMLIFrame *This = HTMLIFRAME_NODE_THIS(iface);
|
||||
|
||||
if(This->content_doc)
|
||||
IHTMLDocument2_Release(HTMLDOC(This->content_doc));
|
||||
if(This->nsiframe)
|
||||
nsIDOMHTMLIFrameElement_Release(This->nsiframe);
|
||||
|
||||
HTMLElement_destructor(&This->element.node);
|
||||
}
|
||||
|
||||
#undef HTMLIFRAME_NODE_THIS
|
||||
|
||||
static const NodeImplVtbl HTMLIFrameImplVtbl = {
|
||||
HTMLIFrame_QI,
|
||||
HTMLIFrame_destructor
|
||||
};
|
||||
|
||||
static const tid_t HTMLIFrame_iface_tids[] = {
|
||||
IHTMLDOMNode_tid,
|
||||
IHTMLDOMNode2_tid,
|
||||
IHTMLElement_tid,
|
||||
IHTMLElement2_tid,
|
||||
IHTMLElement3_tid,
|
||||
IHTMLFrameBase2_tid,
|
||||
0
|
||||
};
|
||||
|
||||
static dispex_static_data_t HTMLIFrame_dispex = {
|
||||
NULL,
|
||||
DispHTMLIFrame_tid,
|
||||
NULL,
|
||||
HTMLIFrame_iface_tids
|
||||
};
|
||||
|
||||
HTMLElement *HTMLIFrame_Create(nsIDOMHTMLElement *nselem)
|
||||
{
|
||||
HTMLIFrame *ret;
|
||||
nsresult nsres;
|
||||
|
||||
ret = heap_alloc_zero(sizeof(HTMLIFrame));
|
||||
|
||||
ret->lpIHTMLFrameBase2Vtbl = &HTMLIFrameBase2Vtbl;
|
||||
ret->element.node.vtbl = &HTMLIFrameImplVtbl;
|
||||
|
||||
init_dispex(&ret->element.node.dispex, (IUnknown*)HTMLFRAMEBASE2(ret), &HTMLIFrame_dispex);
|
||||
HTMLElement_Init(&ret->element);
|
||||
|
||||
nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLIFrameElement, (void**)&ret->nsiframe);
|
||||
if(NS_FAILED(nsres))
|
||||
ERR("Could not get nsIDOMHTMLIFrameElement iface: %08x\n", nsres);
|
||||
|
||||
return &ret->element;
|
||||
}
|
||||
@@ -67,16 +67,14 @@ static ULONG WINAPI HTMLImgElement_Release(IHTMLImgElement *iface)
|
||||
static HRESULT WINAPI HTMLImgElement_GetTypeInfoCount(IHTMLImgElement *iface, UINT *pctinfo)
|
||||
{
|
||||
HTMLImgElement *This = HTMLIMG_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, pctinfo);
|
||||
return E_NOTIMPL;
|
||||
return IDispatchEx_GetTypeInfoCount(DISPATCHEX(&This->element.node.dispex), pctinfo);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLImgElement_GetTypeInfo(IHTMLImgElement *iface, UINT iTInfo,
|
||||
LCID lcid, ITypeInfo **ppTInfo)
|
||||
{
|
||||
HTMLImgElement *This = HTMLIMG_THIS(iface);
|
||||
FIXME("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo);
|
||||
return E_NOTIMPL;
|
||||
return IDispatchEx_GetTypeInfo(DISPATCHEX(&This->element.node.dispex), iTInfo, lcid, ppTInfo);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLImgElement_GetIDsOfNames(IHTMLImgElement *iface, REFIID riid,
|
||||
@@ -84,9 +82,7 @@ static HRESULT WINAPI HTMLImgElement_GetIDsOfNames(IHTMLImgElement *iface, REFII
|
||||
LCID lcid, DISPID *rgDispId)
|
||||
{
|
||||
HTMLImgElement *This = HTMLIMG_THIS(iface);
|
||||
FIXME("(%p)->(%s %p %u %u %p)\n", This, debugstr_guid(riid), rgszNames, cNames,
|
||||
lcid, rgDispId);
|
||||
return E_NOTIMPL;
|
||||
return IDispatchEx_GetIDsOfNames(DISPATCHEX(&This->element.node.dispex), riid, rgszNames, cNames, lcid, rgDispId);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLImgElement_Invoke(IHTMLImgElement *iface, DISPID dispIdMember,
|
||||
@@ -94,9 +90,8 @@ static HRESULT WINAPI HTMLImgElement_Invoke(IHTMLImgElement *iface, DISPID dispI
|
||||
VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
|
||||
{
|
||||
HTMLImgElement *This = HTMLIMG_THIS(iface);
|
||||
FIXME("(%p)->(%d %s %d %d %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid),
|
||||
lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
|
||||
return E_NOTIMPL;
|
||||
return IDispatchEx_Invoke(DISPATCHEX(&This->element.node.dispex), dispIdMember, riid, lcid, wFlags, pDispParams,
|
||||
pVarResult, pExcepInfo, puArgErr);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLImgElement_put_isMap(IHTMLImgElement *iface, VARIANT_BOOL v)
|
||||
@@ -285,8 +280,25 @@ static HRESULT WINAPI HTMLImgElement_put_src(IHTMLImgElement *iface, BSTR v)
|
||||
static HRESULT WINAPI HTMLImgElement_get_src(IHTMLImgElement *iface, BSTR *p)
|
||||
{
|
||||
HTMLImgElement *This = HTMLIMG_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
const PRUnichar *src;
|
||||
nsAString src_str;
|
||||
nsresult nsres;
|
||||
HRESULT hres;
|
||||
|
||||
TRACE("(%p)->(%p)\n", This, p);
|
||||
|
||||
nsAString_Init(&src_str, NULL);
|
||||
nsres = nsIDOMHTMLImageElement_GetSrc(This->nsimg, &src_str);
|
||||
if(NS_FAILED(nsres)) {
|
||||
ERR("GetSrc failed: %08x\n", nsres);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
nsAString_GetData(&src_str, &src);
|
||||
hres = nsuri_to_url(src, p);
|
||||
nsAString_Finish(&src_str);
|
||||
|
||||
return hres;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLImgElement_put_lowsrc(IHTMLImgElement *iface, BSTR v)
|
||||
@@ -572,6 +584,7 @@ static const tid_t HTMLImgElement_iface_tids[] = {
|
||||
IHTMLDOMNode2_tid,
|
||||
IHTMLElement_tid,
|
||||
IHTMLElement2_tid,
|
||||
IHTMLElement3_tid,
|
||||
IHTMLImgElement_tid,
|
||||
0
|
||||
};
|
||||
|
||||
@@ -288,8 +288,17 @@ static HRESULT WINAPI HTMLInputElement_get_maxLength(IHTMLInputElement *iface, l
|
||||
static HRESULT WINAPI HTMLInputElement_select(IHTMLInputElement *iface)
|
||||
{
|
||||
HTMLInputElement *This = HTMLINPUT_THIS(iface);
|
||||
FIXME("(%p)\n", This);
|
||||
return E_NOTIMPL;
|
||||
nsresult nsres;
|
||||
|
||||
TRACE("(%p)\n", This);
|
||||
|
||||
nsres = nsIDOMHTMLInputElement_Select(This->nsinput);
|
||||
if(NS_FAILED(nsres)) {
|
||||
ERR("Select failed: %08x\n", nsres);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLInputElement_put_onchange(IHTMLInputElement *iface, VARIANT v)
|
||||
@@ -372,22 +381,51 @@ static HRESULT WINAPI HTMLInputElement_get_indeterminate(IHTMLInputElement *ifac
|
||||
static HRESULT WINAPI HTMLInputElement_put_defaultChecked(IHTMLInputElement *iface, VARIANT_BOOL v)
|
||||
{
|
||||
HTMLInputElement *This = HTMLINPUT_THIS(iface);
|
||||
FIXME("(%p)->(%x)\n", This, v);
|
||||
return E_NOTIMPL;
|
||||
nsresult nsres;
|
||||
|
||||
TRACE("(%p)->(%x)\n", This, v);
|
||||
|
||||
nsres = nsIDOMHTMLInputElement_SetDefaultChecked(This->nsinput, v != VARIANT_FALSE);
|
||||
if(NS_FAILED(nsres)) {
|
||||
ERR("SetDefaultChecked failed: %08x\n", nsres);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLInputElement_get_defaultChecked(IHTMLInputElement *iface, VARIANT_BOOL *p)
|
||||
{
|
||||
HTMLInputElement *This = HTMLINPUT_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
PRBool default_checked = FALSE;
|
||||
nsresult nsres;
|
||||
|
||||
TRACE("(%p)->(%p)\n", This, p);
|
||||
|
||||
nsres = nsIDOMHTMLInputElement_GetDefaultChecked(This->nsinput, &default_checked);
|
||||
if(NS_FAILED(nsres)) {
|
||||
ERR("GetDefaultChecked failed: %08x\n", nsres);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
*p = default_checked ? VARIANT_TRUE : VARIANT_FALSE;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLInputElement_put_checked(IHTMLInputElement *iface, VARIANT_BOOL v)
|
||||
{
|
||||
HTMLInputElement *This = HTMLINPUT_THIS(iface);
|
||||
FIXME("(%p)->(%x)\n", This, v);
|
||||
return E_NOTIMPL;
|
||||
nsresult nsres;
|
||||
|
||||
TRACE("(%p)->(%x)\n", This, v);
|
||||
|
||||
nsres = nsIDOMHTMLInputElement_SetChecked(This->nsinput, v != VARIANT_FALSE);
|
||||
if(NS_FAILED(nsres)) {
|
||||
ERR("SetChecked failed: %08x\n", nsres);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLInputElement_get_checked(IHTMLInputElement *iface, VARIANT_BOOL *p)
|
||||
@@ -751,25 +789,21 @@ static ULONG WINAPI HTMLInputTextElement_Release(IHTMLInputTextElement *iface)
|
||||
static HRESULT WINAPI HTMLInputTextElement_GetTypeInfoCount(IHTMLInputTextElement *iface, UINT *pctinfo)
|
||||
{
|
||||
HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, pctinfo);
|
||||
return E_NOTIMPL;
|
||||
return IDispatchEx_GetTypeInfoCount(DISPATCHEX(&This->element.node.dispex), pctinfo);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLInputTextElement_GetTypeInfo(IHTMLInputTextElement *iface, UINT iTInfo,
|
||||
LCID lcid, ITypeInfo **ppTInfo)
|
||||
{
|
||||
HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
|
||||
FIXME("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo);
|
||||
return E_NOTIMPL;
|
||||
return IDispatchEx_GetTypeInfo(DISPATCHEX(&This->element.node.dispex), iTInfo, lcid, ppTInfo);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLInputTextElement_GetIDsOfNames(IHTMLInputTextElement *iface, REFIID riid,
|
||||
LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
|
||||
{
|
||||
HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
|
||||
FIXME("(%p)->(%s %p %u %u %p)\n", This, debugstr_guid(riid), rgszNames, cNames,
|
||||
lcid, rgDispId);
|
||||
return E_NOTIMPL;
|
||||
return IDispatchEx_GetIDsOfNames(DISPATCHEX(&This->element.node.dispex), riid, rgszNames, cNames, lcid, rgDispId);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLInputTextElement_Invoke(IHTMLInputTextElement *iface, DISPID dispIdMember,
|
||||
@@ -777,9 +811,8 @@ static HRESULT WINAPI HTMLInputTextElement_Invoke(IHTMLInputTextElement *iface,
|
||||
VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
|
||||
{
|
||||
HTMLInputElement *This = HTMLINPUTTEXT_THIS(iface);
|
||||
FIXME("(%p)->(%d %s %d %d %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid),
|
||||
lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
|
||||
return E_NOTIMPL;
|
||||
return IDispatchEx_Invoke(DISPATCHEX(&This->element.node.dispex), dispIdMember, riid, lcid, wFlags, pDispParams,
|
||||
pVarResult, pExcepInfo, puArgErr);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLInputTextElement_get_type(IHTMLInputTextElement *iface, BSTR *p)
|
||||
@@ -1049,7 +1082,7 @@ static HRESULT HTMLInputElement_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
|
||||
*ppv = HTMLINPUT(This);
|
||||
}else if(IsEqualGUID(&IID_IHTMLInputTextElement, riid)) {
|
||||
TRACE("(%p)->(IID_IHTMLInputTextElement %p)\n", This, ppv);
|
||||
*ppv = HTMLINPUT(This);
|
||||
*ppv = HTMLINPUTTEXT(This);
|
||||
}
|
||||
|
||||
if(*ppv) {
|
||||
@@ -1069,11 +1102,25 @@ static void HTMLInputElement_destructor(HTMLDOMNode *iface)
|
||||
HTMLElement_destructor(&This->element.node);
|
||||
}
|
||||
|
||||
static HRESULT HTMLInputElementImpl_put_disabled(HTMLDOMNode *iface, VARIANT_BOOL v)
|
||||
{
|
||||
HTMLInputElement *This = HTMLINPUT_NODE_THIS(iface);
|
||||
return IHTMLInputElement_put_disabled(HTMLINPUT(This), v);
|
||||
}
|
||||
|
||||
static HRESULT HTMLInputElementImpl_get_disabled(HTMLDOMNode *iface, VARIANT_BOOL *p)
|
||||
{
|
||||
HTMLInputElement *This = HTMLINPUT_NODE_THIS(iface);
|
||||
return IHTMLInputElement_get_disabled(HTMLINPUT(This), p);
|
||||
}
|
||||
|
||||
#undef HTMLINPUT_NODE_THIS
|
||||
|
||||
static const NodeImplVtbl HTMLInputElementImplVtbl = {
|
||||
HTMLInputElement_QI,
|
||||
HTMLInputElement_destructor
|
||||
HTMLInputElement_destructor,
|
||||
HTMLInputElementImpl_put_disabled,
|
||||
HTMLInputElementImpl_get_disabled,
|
||||
};
|
||||
|
||||
static const tid_t HTMLInputElement_iface_tids[] = {
|
||||
@@ -1081,6 +1128,7 @@ static const tid_t HTMLInputElement_iface_tids[] = {
|
||||
IHTMLDOMNode2_tid,
|
||||
IHTMLElement_tid,
|
||||
IHTMLElement2_tid,
|
||||
IHTMLElement3_tid,
|
||||
IHTMLInputElement_tid,
|
||||
0
|
||||
};
|
||||
@@ -1097,6 +1145,7 @@ HTMLElement *HTMLInputElement_Create(nsIDOMHTMLElement *nselem)
|
||||
nsresult nsres;
|
||||
|
||||
ret->lpHTMLInputElementVtbl = &HTMLInputElementVtbl;
|
||||
ret->lpHTMLInputTextElementVtbl = &HTMLInputTextElementVtbl;
|
||||
ret->element.node.vtbl = &HTMLInputElementImplVtbl;
|
||||
|
||||
init_dispex(&ret->element.node.dispex, (IUnknown*)HTMLINPUT(ret), &HTMLInputElement_dispex);
|
||||
|
||||
@@ -43,12 +43,11 @@ static HRESULT WINAPI HTMLLocation_QueryInterface(IHTMLLocation *iface, REFIID r
|
||||
if(IsEqualGUID(&IID_IUnknown, riid)) {
|
||||
TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
|
||||
*ppv = HTMLLOCATION(This);
|
||||
}else if(IsEqualGUID(&IID_IDispatch, riid)) {
|
||||
TRACE("(%p)->(IID_IDispatch %p)\n", This, ppv);
|
||||
*ppv = HTMLLOCATION(This);
|
||||
}else if(IsEqualGUID(&IID_IHTMLLocation, riid)) {
|
||||
TRACE("(%p)->(IID_IHTMLLocation %p)\n", This, ppv);
|
||||
*ppv = HTMLLOCATION(This);
|
||||
}else if(dispex_query_interface(&This->dispex, riid, ppv)) {
|
||||
return *ppv ? S_OK : E_NOINTERFACE;
|
||||
}
|
||||
|
||||
if(*ppv) {
|
||||
@@ -293,6 +292,18 @@ static const IHTMLLocationVtbl HTMLLocationVtbl = {
|
||||
HTMLLocation_toString
|
||||
};
|
||||
|
||||
static const tid_t HTMLLocation_iface_tids[] = {
|
||||
IHTMLLocation_tid,
|
||||
0
|
||||
};
|
||||
static dispex_static_data_t HTMLLocation_dispex = {
|
||||
NULL,
|
||||
IHTMLLocation_tid,
|
||||
NULL,
|
||||
HTMLLocation_iface_tids
|
||||
};
|
||||
|
||||
|
||||
HTMLLocation *HTMLLocation_Create(HTMLDocument *doc)
|
||||
{
|
||||
HTMLLocation *ret = heap_alloc(sizeof(*ret));
|
||||
@@ -301,5 +312,7 @@ HTMLLocation *HTMLLocation_Create(HTMLDocument *doc)
|
||||
ret->ref = 1;
|
||||
ret->doc = doc;
|
||||
|
||||
init_dispex(&ret->dispex, (IUnknown*)HTMLLOCATION(ret), &HTMLLocation_dispex);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
#include "wine/debug.h"
|
||||
|
||||
#include "mshtml_private.h"
|
||||
#include "htmlevent.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
|
||||
|
||||
@@ -102,25 +103,21 @@ static ULONG WINAPI HTMLDOMChildrenCollection_Release(IHTMLDOMChildrenCollection
|
||||
static HRESULT WINAPI HTMLDOMChildrenCollection_GetTypeInfoCount(IHTMLDOMChildrenCollection *iface, UINT *pctinfo)
|
||||
{
|
||||
HTMLDOMChildrenCollection *This = HTMLCHILDCOL_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, pctinfo);
|
||||
return E_NOTIMPL;
|
||||
return IDispatchEx_GetTypeInfoCount(DISPATCHEX(&This->dispex), pctinfo);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLDOMChildrenCollection_GetTypeInfo(IHTMLDOMChildrenCollection *iface, UINT iTInfo,
|
||||
LCID lcid, ITypeInfo **ppTInfo)
|
||||
{
|
||||
HTMLDOMChildrenCollection *This = HTMLCHILDCOL_THIS(iface);
|
||||
FIXME("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo);
|
||||
return E_NOTIMPL;
|
||||
return IDispatchEx_GetTypeInfo(DISPATCHEX(&This->dispex), iTInfo, lcid, ppTInfo);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLDOMChildrenCollection_GetIDsOfNames(IHTMLDOMChildrenCollection *iface, REFIID riid,
|
||||
LPOLESTR *rgszNames, UINT cNames, LCID lcid, DISPID *rgDispId)
|
||||
{
|
||||
HTMLDOMChildrenCollection *This = HTMLCHILDCOL_THIS(iface);
|
||||
FIXME("(%p)->(%s %p %u %u %p)\n", This, debugstr_guid(riid), rgszNames, cNames,
|
||||
lcid, rgDispId);
|
||||
return E_NOTIMPL;
|
||||
return IDispatchEx_GetIDsOfNames(DISPATCHEX(&This->dispex), riid, rgszNames, cNames, lcid, rgDispId);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLDOMChildrenCollection_Invoke(IHTMLDOMChildrenCollection *iface, DISPID dispIdMember,
|
||||
@@ -128,9 +125,8 @@ static HRESULT WINAPI HTMLDOMChildrenCollection_Invoke(IHTMLDOMChildrenCollectio
|
||||
VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
|
||||
{
|
||||
HTMLDOMChildrenCollection *This = HTMLCHILDCOL_THIS(iface);
|
||||
FIXME("(%p)->(%d %s %d %d %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid),
|
||||
lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
|
||||
return E_NOTIMPL;
|
||||
return IDispatchEx_Invoke(DISPATCHEX(&This->dispex), dispIdMember, riid, lcid,
|
||||
wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLDOMChildrenCollection_get_length(IHTMLDOMChildrenCollection *iface, long *p)
|
||||
@@ -315,16 +311,14 @@ static ULONG WINAPI HTMLDOMNode_Release(IHTMLDOMNode *iface)
|
||||
static HRESULT WINAPI HTMLDOMNode_GetTypeInfoCount(IHTMLDOMNode *iface, UINT *pctinfo)
|
||||
{
|
||||
HTMLDOMNode *This = HTMLDOMNODE_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, pctinfo);
|
||||
return E_NOTIMPL;
|
||||
return IDispatchEx_GetTypeInfoCount(DISPATCHEX(&This->dispex), pctinfo);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLDOMNode_GetTypeInfo(IHTMLDOMNode *iface, UINT iTInfo,
|
||||
LCID lcid, ITypeInfo **ppTInfo)
|
||||
{
|
||||
HTMLDOMNode *This = HTMLDOMNODE_THIS(iface);
|
||||
FIXME("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo);
|
||||
return E_NOTIMPL;
|
||||
return IDispatchEx_GetTypeInfo(DISPATCHEX(&This->dispex), iTInfo, lcid, ppTInfo);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLDOMNode_GetIDsOfNames(IHTMLDOMNode *iface, REFIID riid,
|
||||
@@ -332,9 +326,7 @@ static HRESULT WINAPI HTMLDOMNode_GetIDsOfNames(IHTMLDOMNode *iface, REFIID riid
|
||||
LCID lcid, DISPID *rgDispId)
|
||||
{
|
||||
HTMLDOMNode *This = HTMLDOMNODE_THIS(iface);
|
||||
FIXME("(%p)->(%s %p %u %u %p)\n", This, debugstr_guid(riid), rgszNames, cNames,
|
||||
lcid, rgDispId);
|
||||
return E_NOTIMPL;
|
||||
return IDispatchEx_GetIDsOfNames(DISPATCHEX(&This->dispex), riid, rgszNames, cNames, lcid, rgDispId);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLDOMNode_Invoke(IHTMLDOMNode *iface, DISPID dispIdMember,
|
||||
@@ -342,9 +334,8 @@ static HRESULT WINAPI HTMLDOMNode_Invoke(IHTMLDOMNode *iface, DISPID dispIdMembe
|
||||
VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
|
||||
{
|
||||
HTMLDOMNode *This = HTMLDOMNODE_THIS(iface);
|
||||
FIXME("(%p)->(%d %s %d %d %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid),
|
||||
lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
|
||||
return E_NOTIMPL;
|
||||
return IDispatchEx_Invoke(DISPATCHEX(&This->dispex), dispIdMember, riid, lcid,
|
||||
wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLDOMNode_get_nodeType(IHTMLDOMNode *iface, long *p)
|
||||
@@ -455,8 +446,48 @@ static HRESULT WINAPI HTMLDOMNode_insertBefore(IHTMLDOMNode *iface, IHTMLDOMNode
|
||||
VARIANT refChild, IHTMLDOMNode **node)
|
||||
{
|
||||
HTMLDOMNode *This = HTMLDOMNODE_THIS(iface);
|
||||
FIXME("(%p)->(%p v %p)\n", This, newChild, node);
|
||||
return E_NOTIMPL;
|
||||
nsIDOMNode *nsnode, *nsref = NULL;
|
||||
HTMLDOMNode *new_child;
|
||||
nsresult nsres;
|
||||
|
||||
TRACE("(%p)->(%p %s %p)\n", This, newChild, debugstr_variant(&refChild), node);
|
||||
|
||||
new_child = get_node_obj(This->doc, (IUnknown*)newChild);
|
||||
if(!new_child) {
|
||||
ERR("invalid newChild\n");
|
||||
return E_INVALIDARG;
|
||||
}
|
||||
|
||||
switch(V_VT(&refChild)) {
|
||||
case VT_NULL:
|
||||
break;
|
||||
case VT_DISPATCH: {
|
||||
HTMLDOMNode *ref_node;
|
||||
|
||||
ref_node = get_node_obj(This->doc, (IUnknown*)V_DISPATCH(&refChild));
|
||||
if(!ref_node) {
|
||||
ERR("unvalid node\n");
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
nsref = ref_node->nsnode;
|
||||
break;
|
||||
}
|
||||
default:
|
||||
FIXME("unimplemented vt %d\n", V_VT(&refChild));
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
nsres = nsIDOMNode_InsertBefore(This->nsnode, new_child->nsnode, nsref, &nsnode);
|
||||
if(NS_FAILED(nsres)) {
|
||||
ERR("InsertBefore failed: %08x\n", nsres);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
*node = HTMLDOMNODE(get_node(This->doc, nsnode, TRUE));
|
||||
nsIDOMNode_Release(nsnode);
|
||||
IHTMLDOMNode_AddRef(*node);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLDOMNode_removeChild(IHTMLDOMNode *iface, IHTMLDOMNode *oldChild,
|
||||
@@ -481,6 +512,7 @@ static HRESULT WINAPI HTMLDOMNode_removeChild(IHTMLDOMNode *iface, IHTMLDOMNode
|
||||
|
||||
/* FIXME: Make sure that node != newChild */
|
||||
*node = HTMLDOMNODE(get_node(This->doc, nsnode, TRUE));
|
||||
nsIDOMNode_Release(nsnode);
|
||||
IHTMLDOMNode_AddRef(*node);
|
||||
return S_OK;
|
||||
}
|
||||
@@ -541,8 +573,8 @@ static HRESULT WINAPI HTMLDOMNode_appendChild(IHTMLDOMNode *iface, IHTMLDOMNode
|
||||
|
||||
nsres = nsIDOMNode_AppendChild(This->nsnode, node_obj->nsnode, &nsnode);
|
||||
if(NS_FAILED(nsres)) {
|
||||
ERR("AppendChild failed: %08x\n", nsres);
|
||||
return E_FAIL;
|
||||
WARN("AppendChild failed: %08x\n", nsres);
|
||||
nsnode = node_obj->nsnode;
|
||||
}
|
||||
|
||||
/* FIXME: Make sure that node != newChild */
|
||||
@@ -739,16 +771,14 @@ static ULONG WINAPI HTMLDOMNode2_Release(IHTMLDOMNode2 *iface)
|
||||
static HRESULT WINAPI HTMLDOMNode2_GetTypeInfoCount(IHTMLDOMNode2 *iface, UINT *pctinfo)
|
||||
{
|
||||
HTMLDOMNode *This = HTMLDOMNODE2_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, pctinfo);
|
||||
return E_NOTIMPL;
|
||||
return IDispatchEx_GetTypeInfoCount(DISPATCHEX(&This->dispex), pctinfo);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLDOMNode2_GetTypeInfo(IHTMLDOMNode2 *iface, UINT iTInfo,
|
||||
LCID lcid, ITypeInfo **ppTInfo)
|
||||
{
|
||||
HTMLDOMNode *This = HTMLDOMNODE2_THIS(iface);
|
||||
FIXME("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo);
|
||||
return E_NOTIMPL;
|
||||
return IDispatchEx_GetTypeInfo(DISPATCHEX(&This->dispex), iTInfo, lcid, ppTInfo);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLDOMNode2_GetIDsOfNames(IHTMLDOMNode2 *iface, REFIID riid,
|
||||
@@ -756,9 +786,7 @@ static HRESULT WINAPI HTMLDOMNode2_GetIDsOfNames(IHTMLDOMNode2 *iface, REFIID ri
|
||||
LCID lcid, DISPID *rgDispId)
|
||||
{
|
||||
HTMLDOMNode *This = HTMLDOMNODE2_THIS(iface);
|
||||
FIXME("(%p)->(%s %p %u %u %p)\n", This, debugstr_guid(riid), rgszNames, cNames,
|
||||
lcid, rgDispId);
|
||||
return E_NOTIMPL;
|
||||
return IDispatchEx_GetIDsOfNames(DISPATCHEX(&This->dispex), riid, rgszNames, cNames, lcid, rgDispId);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLDOMNode2_Invoke(IHTMLDOMNode2 *iface, DISPID dispIdMember,
|
||||
@@ -766,9 +794,8 @@ static HRESULT WINAPI HTMLDOMNode2_Invoke(IHTMLDOMNode2 *iface, DISPID dispIdMem
|
||||
VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
|
||||
{
|
||||
HTMLDOMNode *This = HTMLDOMNODE2_THIS(iface);
|
||||
FIXME("(%p)->(%d %s %d %d %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid),
|
||||
lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
|
||||
return E_NOTIMPL;
|
||||
return IDispatchEx_Invoke(DISPATCHEX(&This->dispex), dispIdMember, riid, lcid,
|
||||
wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLDOMNode2_get_ownerDocument(IHTMLDOMNode2 *iface, IDispatch **p)
|
||||
|
||||
@@ -68,16 +68,14 @@ static ULONG WINAPI HTMLOptionElement_Release(IHTMLOptionElement *iface)
|
||||
static HRESULT WINAPI HTMLOptionElement_GetTypeInfoCount(IHTMLOptionElement *iface, UINT *pctinfo)
|
||||
{
|
||||
HTMLOptionElement *This = HTMLOPTION_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, pctinfo);
|
||||
return E_NOTIMPL;
|
||||
return IDispatchEx_GetTypeInfoCount(DISPATCHEX(&This->element.node.dispex), pctinfo);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLOptionElement_GetTypeInfo(IHTMLOptionElement *iface, UINT iTInfo,
|
||||
LCID lcid, ITypeInfo **ppTInfo)
|
||||
{
|
||||
HTMLOptionElement *This = HTMLOPTION_THIS(iface);
|
||||
FIXME("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo);
|
||||
return E_NOTIMPL;
|
||||
return IDispatchEx_GetTypeInfo(DISPATCHEX(&This->element.node.dispex), iTInfo, lcid, ppTInfo);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLOptionElement_GetIDsOfNames(IHTMLOptionElement *iface, REFIID riid,
|
||||
@@ -85,9 +83,7 @@ static HRESULT WINAPI HTMLOptionElement_GetIDsOfNames(IHTMLOptionElement *iface,
|
||||
LCID lcid, DISPID *rgDispId)
|
||||
{
|
||||
HTMLOptionElement *This = HTMLOPTION_THIS(iface);
|
||||
FIXME("(%p)->(%s %p %u %u %p)\n", This, debugstr_guid(riid), rgszNames, cNames,
|
||||
lcid, rgDispId);
|
||||
return E_NOTIMPL;
|
||||
return IDispatchEx_GetIDsOfNames(DISPATCHEX(&This->element.node.dispex), riid, rgszNames, cNames, lcid, rgDispId);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLOptionElement_Invoke(IHTMLOptionElement *iface, DISPID dispIdMember,
|
||||
@@ -95,9 +91,8 @@ static HRESULT WINAPI HTMLOptionElement_Invoke(IHTMLOptionElement *iface, DISPID
|
||||
VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
|
||||
{
|
||||
HTMLOptionElement *This = HTMLOPTION_THIS(iface);
|
||||
FIXME("(%p)->(%d %s %d %d %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid),
|
||||
lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
|
||||
return E_NOTIMPL;
|
||||
return IDispatchEx_Invoke(DISPATCHEX(&This->element.node.dispex), dispIdMember, riid, lcid, wFlags, pDispParams,
|
||||
pVarResult, pExcepInfo, puArgErr);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLOptionElement_put_selected(IHTMLOptionElement *iface, VARIANT_BOOL v)
|
||||
@@ -185,7 +180,6 @@ static HRESULT WINAPI HTMLOptionElement_get_index(IHTMLOptionElement *iface, LON
|
||||
static HRESULT WINAPI HTMLOptionElement_put_text(IHTMLOptionElement *iface, BSTR v)
|
||||
{
|
||||
HTMLOptionElement *This = HTMLOPTION_THIS(iface);
|
||||
nsIDOMDocument *nsdoc;
|
||||
nsIDOMText *text_node;
|
||||
nsAString text_str;
|
||||
nsIDOMNode *tmp;
|
||||
@@ -193,6 +187,11 @@ static HRESULT WINAPI HTMLOptionElement_put_text(IHTMLOptionElement *iface, BSTR
|
||||
|
||||
TRACE("(%p)->(%s)\n", This, debugstr_w(v));
|
||||
|
||||
if(!This->element.node.doc->nsdoc) {
|
||||
WARN("NULL nsdoc\n");
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
while(1) {
|
||||
nsIDOMNode *child;
|
||||
|
||||
@@ -210,19 +209,12 @@ static HRESULT WINAPI HTMLOptionElement_put_text(IHTMLOptionElement *iface, BSTR
|
||||
}
|
||||
}
|
||||
|
||||
nsres = nsIWebNavigation_GetDocument(This->element.node.doc->nscontainer->navigation, &nsdoc);
|
||||
if(NS_FAILED(nsres)) {
|
||||
ERR("GetDocument failed: %08x\n", nsres);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
nsAString_Init(&text_str, v);
|
||||
nsres = nsIDOMDocument_CreateTextNode(nsdoc, &text_str, &text_node);
|
||||
nsIDOMDocument_Release(nsdoc);
|
||||
nsres = nsIDOMHTMLDocument_CreateTextNode(This->element.node.doc->nsdoc, &text_str, &text_node);
|
||||
nsAString_Finish(&text_str);
|
||||
if(NS_FAILED(nsres)) {
|
||||
ERR("CreateTextNode failed: %08x\n", nsres);
|
||||
return S_OK;
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
nsres = nsIDOMHTMLOptionElement_AppendChild(This->nsoption, (nsIDOMNode*)text_node, &tmp);
|
||||
@@ -336,6 +328,7 @@ static const tid_t HTMLOptionElement_iface_tids[] = {
|
||||
IHTMLDOMNode2_tid,
|
||||
IHTMLElement_tid,
|
||||
IHTMLElement2_tid,
|
||||
IHTMLElement3_tid,
|
||||
IHTMLOptionElement_tid,
|
||||
0
|
||||
};
|
||||
@@ -456,7 +449,6 @@ static HRESULT WINAPI HTMLOptionElementFactory_create(IHTMLOptionElementFactory
|
||||
IHTMLOptionElement **optelem)
|
||||
{
|
||||
HTMLOptionElementFactory *This = HTMLOPTFACTORY_THIS(iface);
|
||||
nsIDOMDocument *nsdoc;
|
||||
nsIDOMElement *nselem;
|
||||
nsAString option_str;
|
||||
nsresult nsres;
|
||||
@@ -464,21 +456,18 @@ static HRESULT WINAPI HTMLOptionElementFactory_create(IHTMLOptionElementFactory
|
||||
|
||||
static const PRUnichar optionW[] = {'O','P','T','I','O','N',0};
|
||||
|
||||
TRACE("(%p)->(v v v v %p)\n", This, optelem);
|
||||
TRACE("(%p)->(%s %s %s %s %p)\n", This, debugstr_variant(&text), debugstr_variant(&value),
|
||||
debugstr_variant(&defaultselected), debugstr_variant(&selected), optelem);
|
||||
|
||||
*optelem = NULL;
|
||||
if(!This->doc->nscontainer)
|
||||
return E_FAIL;
|
||||
|
||||
nsres = nsIWebNavigation_GetDocument(This->doc->nscontainer->navigation, &nsdoc);
|
||||
if(NS_FAILED(nsres)) {
|
||||
ERR("GetDocument failed: %08x\n", nsres);
|
||||
return E_FAIL;
|
||||
if(!This->doc->nsdoc) {
|
||||
WARN("NULL nsdoc\n");
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
*optelem = NULL;
|
||||
|
||||
nsAString_Init(&option_str, optionW);
|
||||
nsres = nsIDOMDocument_CreateElement(nsdoc, &option_str, &nselem);
|
||||
nsIDOMDocument_Release(nsdoc);
|
||||
nsres = nsIDOMHTMLDocument_CreateElement(This->doc->nsdoc, &option_str, &nselem);
|
||||
nsAString_Finish(&option_str);
|
||||
if(NS_FAILED(nsres)) {
|
||||
ERR("CreateElement failed: %08x\n", nsres);
|
||||
|
||||
@@ -68,16 +68,14 @@ static ULONG WINAPI HTMLScriptElement_Release(IHTMLScriptElement *iface)
|
||||
static HRESULT WINAPI HTMLScriptElement_GetTypeInfoCount(IHTMLScriptElement *iface, UINT *pctinfo)
|
||||
{
|
||||
HTMLScriptElement *This = HTMLSCRIPT_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, pctinfo);
|
||||
return E_NOTIMPL;
|
||||
return IDispatchEx_GetTypeInfoCount(DISPATCHEX(&This->element.node.dispex), pctinfo);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLScriptElement_GetTypeInfo(IHTMLScriptElement *iface, UINT iTInfo,
|
||||
LCID lcid, ITypeInfo **ppTInfo)
|
||||
{
|
||||
HTMLScriptElement *This = HTMLSCRIPT_THIS(iface);
|
||||
FIXME("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo);
|
||||
return E_NOTIMPL;
|
||||
return IDispatchEx_GetTypeInfo(DISPATCHEX(&This->element.node.dispex), iTInfo, lcid, ppTInfo);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLScriptElement_GetIDsOfNames(IHTMLScriptElement *iface, REFIID riid,
|
||||
@@ -85,9 +83,7 @@ static HRESULT WINAPI HTMLScriptElement_GetIDsOfNames(IHTMLScriptElement *iface,
|
||||
LCID lcid, DISPID *rgDispId)
|
||||
{
|
||||
HTMLScriptElement *This = HTMLSCRIPT_THIS(iface);
|
||||
FIXME("(%p)->(%s %p %u %u %p)\n", This, debugstr_guid(riid), rgszNames, cNames,
|
||||
lcid, rgDispId);
|
||||
return E_NOTIMPL;
|
||||
return IDispatchEx_GetIDsOfNames(DISPATCHEX(&This->element.node.dispex), riid, rgszNames, cNames, lcid, rgDispId);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLScriptElement_Invoke(IHTMLScriptElement *iface, DISPID dispIdMember,
|
||||
@@ -95,9 +91,8 @@ static HRESULT WINAPI HTMLScriptElement_Invoke(IHTMLScriptElement *iface, DISPID
|
||||
VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
|
||||
{
|
||||
HTMLScriptElement *This = HTMLSCRIPT_THIS(iface);
|
||||
FIXME("(%p)->(%d %s %d %d %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid),
|
||||
lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
|
||||
return E_NOTIMPL;
|
||||
return IDispatchEx_Invoke(DISPATCHEX(&This->element.node.dispex), dispIdMember, riid, lcid, wFlags, pDispParams,
|
||||
pVarResult, pExcepInfo, puArgErr);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLScriptElement_put_src(IHTMLScriptElement *iface, BSTR v)
|
||||
@@ -159,15 +154,40 @@ static HRESULT WINAPI HTMLScriptElement_get_text(IHTMLScriptElement *iface, BSTR
|
||||
static HRESULT WINAPI HTMLScriptElement_put_defer(IHTMLScriptElement *iface, VARIANT_BOOL v)
|
||||
{
|
||||
HTMLScriptElement *This = HTMLSCRIPT_THIS(iface);
|
||||
FIXME("(%p)->(%x)\n", This, v);
|
||||
return E_NOTIMPL;
|
||||
HRESULT hr = S_OK;
|
||||
nsresult nsres;
|
||||
|
||||
TRACE("(%p)->(%x)\n", This, v);
|
||||
|
||||
nsres = nsIDOMHTMLScriptElement_SetDefer(This->nsscript, v != VARIANT_FALSE);
|
||||
if(NS_FAILED(nsres))
|
||||
{
|
||||
hr = E_FAIL;
|
||||
}
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLScriptElement_get_defer(IHTMLScriptElement *iface, VARIANT_BOOL *p)
|
||||
{
|
||||
HTMLScriptElement *This = HTMLSCRIPT_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
PRBool defer = FALSE;
|
||||
nsresult nsres;
|
||||
|
||||
TRACE("(%p)->(%p)\n", This, p);
|
||||
|
||||
if(!p)
|
||||
return E_INVALIDARG;
|
||||
|
||||
nsres = nsIDOMHTMLScriptElement_GetDefer(This->nsscript, &defer);
|
||||
if(NS_FAILED(nsres)) {
|
||||
ERR("GetSrc failed: %08x\n", nsres);
|
||||
}
|
||||
|
||||
*p = defer ? VARIANT_TRUE : VARIANT_FALSE;
|
||||
|
||||
TRACE("*p = %d\n", *p);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLScriptElement_get_readyState(IHTMLScriptElement *iface, BSTR *p)
|
||||
|
||||
@@ -28,6 +28,7 @@
|
||||
#include "wine/debug.h"
|
||||
|
||||
#include "mshtml_private.h"
|
||||
#include "htmlevent.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
|
||||
|
||||
@@ -289,15 +290,35 @@ static HRESULT WINAPI HTMLSelectElement_get_value(IHTMLSelectElement *iface, BST
|
||||
static HRESULT WINAPI HTMLSelectElement_put_disabled(IHTMLSelectElement *iface, VARIANT_BOOL v)
|
||||
{
|
||||
HTMLSelectElement *This = HTMLSELECT_THIS(iface);
|
||||
FIXME("(%p)->(%x)\n", This, v);
|
||||
return E_NOTIMPL;
|
||||
nsresult nsres;
|
||||
|
||||
TRACE("(%p)->(%x)\n", This, v);
|
||||
|
||||
nsres = nsIDOMHTMLSelectElement_SetDisabled(This->nsselect, v != VARIANT_FALSE);
|
||||
if(NS_FAILED(nsres)) {
|
||||
ERR("SetDisabled failed: %08x\n", nsres);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLSelectElement_get_disabled(IHTMLSelectElement *iface, VARIANT_BOOL *p)
|
||||
{
|
||||
HTMLSelectElement *This = HTMLSELECT_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
PRBool disabled = FALSE;
|
||||
nsresult nsres;
|
||||
|
||||
TRACE("(%p)->(%p)\n", This, p);
|
||||
|
||||
nsres = nsIDOMHTMLSelectElement_GetDisabled(This->nsselect, &disabled);
|
||||
if(NS_FAILED(nsres)) {
|
||||
ERR("GetDisabled failed: %08x\n", nsres);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
*p = disabled ? VARIANT_TRUE : VARIANT_FALSE;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLSelectElement_get_form(IHTMLSelectElement *iface, IHTMLFormElement **p)
|
||||
@@ -442,11 +463,25 @@ static void HTMLSelectElement_destructor(HTMLDOMNode *iface)
|
||||
HTMLElement_destructor(&This->element.node);
|
||||
}
|
||||
|
||||
static HRESULT HTMLSelectElementImpl_put_disabled(HTMLDOMNode *iface, VARIANT_BOOL v)
|
||||
{
|
||||
HTMLSelectElement *This = HTMLSELECT_NODE_THIS(iface);
|
||||
return IHTMLSelectElement_put_disabled(HTMLSELECT(This), v);
|
||||
}
|
||||
|
||||
static HRESULT HTMLSelectElementImpl_get_disabled(HTMLDOMNode *iface, VARIANT_BOOL *p)
|
||||
{
|
||||
HTMLSelectElement *This = HTMLSELECT_NODE_THIS(iface);
|
||||
return IHTMLSelectElement_get_disabled(HTMLSELECT(This), p);
|
||||
}
|
||||
|
||||
#undef HTMLSELECT_NODE_THIS
|
||||
|
||||
static const NodeImplVtbl HTMLSelectElementImplVtbl = {
|
||||
HTMLSelectElement_QI,
|
||||
HTMLSelectElement_destructor
|
||||
HTMLSelectElement_destructor,
|
||||
HTMLSelectElementImpl_put_disabled,
|
||||
HTMLSelectElementImpl_get_disabled
|
||||
};
|
||||
|
||||
static const tid_t HTMLSelectElement_tids[] = {
|
||||
@@ -454,6 +489,7 @@ static const tid_t HTMLSelectElement_tids[] = {
|
||||
IHTMLDOMNode2_tid,
|
||||
IHTMLElement_tid,
|
||||
IHTMLElement2_tid,
|
||||
IHTMLElement3_tid,
|
||||
IHTMLSelectElement_tid,
|
||||
0
|
||||
};
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,73 @@
|
||||
/*
|
||||
* Copyright 2008 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
|
||||
*/
|
||||
|
||||
struct HTMLStyle {
|
||||
DispatchEx dispex;
|
||||
const IHTMLStyleVtbl *lpHTMLStyleVtbl;
|
||||
const IHTMLStyle2Vtbl *lpHTMLStyle2Vtbl;
|
||||
|
||||
LONG ref;
|
||||
|
||||
nsIDOMCSSStyleDeclaration *nsstyle;
|
||||
};
|
||||
|
||||
#define HTMLSTYLE(x) ((IHTMLStyle*) &(x)->lpHTMLStyleVtbl)
|
||||
#define HTMLSTYLE2(x) ((IHTMLStyle2*) &(x)->lpHTMLStyle2Vtbl)
|
||||
|
||||
/* NOTE: Make sure to keep in sync with style_tbl in htmlstyle.c */
|
||||
typedef enum {
|
||||
STYLEID_BACKGROUND,
|
||||
STYLEID_BACKGROUND_COLOR,
|
||||
STYLEID_BACKGROUND_IMAGE,
|
||||
STYLEID_BORDER,
|
||||
STYLEID_BORDER_BOTTOM_STYLE,
|
||||
STYLEID_BORDER_LEFT,
|
||||
STYLEID_BORDER_LEFT_STYLE,
|
||||
STYLEID_BORDER_RIGHT_STYLE,
|
||||
STYLEID_BORDER_TOP_STYLE,
|
||||
STYLEID_BORDER_WIDTH,
|
||||
STYLEID_COLOR,
|
||||
STYLEID_CURSOR,
|
||||
STYLEID_DISPLAY,
|
||||
STYLEID_FILTER,
|
||||
STYLEID_FONT_FAMILY,
|
||||
STYLEID_FONT_SIZE,
|
||||
STYLEID_FONT_STYLE,
|
||||
STYLEID_FONT_VARIANT,
|
||||
STYLEID_FONT_WEIGHT,
|
||||
STYLEID_HEIGHT,
|
||||
STYLEID_LEFT,
|
||||
STYLEID_MARGIN,
|
||||
STYLEID_MARGIN_LEFT,
|
||||
STYLEID_MARGIN_RIGHT,
|
||||
STYLEID_OVERFLOW,
|
||||
STYLEID_PADDING_LEFT,
|
||||
STYLEID_POSITION,
|
||||
STYLEID_TEXT_ALIGN,
|
||||
STYLEID_TEXT_DECORATION,
|
||||
STYLEID_TOP,
|
||||
STYLEID_VERTICAL_ALIGN,
|
||||
STYLEID_VISIBILITY,
|
||||
STYLEID_WIDTH,
|
||||
STYLEID_Z_INDEX
|
||||
} styleid_t;
|
||||
|
||||
void HTMLStyle2_Init(HTMLStyle*);
|
||||
|
||||
HRESULT get_nsstyle_attr(nsIDOMCSSStyleDeclaration*,styleid_t,BSTR*);
|
||||
HRESULT set_nsstyle_attr(nsIDOMCSSStyleDeclaration*,styleid_t,LPCWSTR,DWORD);
|
||||
@@ -0,0 +1,610 @@
|
||||
/*
|
||||
* Copyright 2008 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 <stdarg.h>
|
||||
|
||||
#define COBJMACROS
|
||||
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#include "winuser.h"
|
||||
#include "ole2.h"
|
||||
|
||||
#include "mshtml_private.h"
|
||||
#include "htmlstyle.h"
|
||||
|
||||
#include "wine/debug.h"
|
||||
#include "wine/unicode.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
|
||||
|
||||
#define HTMLSTYLE2_THIS(iface) DEFINE_THIS(HTMLStyle, HTMLStyle2, iface)
|
||||
|
||||
static HRESULT WINAPI HTMLStyle2_QueryInterface(IHTMLStyle2 *iface, REFIID riid, void **ppv)
|
||||
{
|
||||
HTMLStyle *This = HTMLSTYLE2_THIS(iface);
|
||||
|
||||
return IHTMLStyle_QueryInterface(HTMLSTYLE(This), riid, ppv);
|
||||
}
|
||||
|
||||
static ULONG WINAPI HTMLStyle2_AddRef(IHTMLStyle2 *iface)
|
||||
{
|
||||
HTMLStyle *This = HTMLSTYLE2_THIS(iface);
|
||||
|
||||
return IHTMLStyle_AddRef(HTMLSTYLE(This));
|
||||
}
|
||||
|
||||
static ULONG WINAPI HTMLStyle2_Release(IHTMLStyle2 *iface)
|
||||
{
|
||||
HTMLStyle *This = HTMLSTYLE2_THIS(iface);
|
||||
|
||||
return IHTMLStyle_Release(HTMLSTYLE(This));
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLStyle2_GetTypeInfoCount(IHTMLStyle2 *iface, UINT *pctinfo)
|
||||
{
|
||||
HTMLStyle *This = HTMLSTYLE2_THIS(iface);
|
||||
return IDispatchEx_GetTypeInfoCount(DISPATCHEX(&This->dispex), pctinfo);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLStyle2_GetTypeInfo(IHTMLStyle2 *iface, UINT iTInfo,
|
||||
LCID lcid, ITypeInfo **ppTInfo)
|
||||
{
|
||||
HTMLStyle *This = HTMLSTYLE2_THIS(iface);
|
||||
return IDispatchEx_GetTypeInfo(DISPATCHEX(&This->dispex), iTInfo, lcid, ppTInfo);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLStyle2_GetIDsOfNames(IHTMLStyle2 *iface, REFIID riid,
|
||||
LPOLESTR *rgszNames, UINT cNames,
|
||||
LCID lcid, DISPID *rgDispId)
|
||||
{
|
||||
HTMLStyle *This = HTMLSTYLE2_THIS(iface);
|
||||
return IDispatchEx_GetIDsOfNames(DISPATCHEX(&This->dispex), riid, rgszNames, cNames, lcid, rgDispId);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLStyle2_Invoke(IHTMLStyle2 *iface, DISPID dispIdMember,
|
||||
REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
|
||||
VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
|
||||
{
|
||||
HTMLStyle *This = HTMLSTYLE2_THIS(iface);
|
||||
return IDispatchEx_Invoke(DISPATCHEX(&This->dispex), dispIdMember, riid, lcid,
|
||||
wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLStyle2_put_tableLayout(IHTMLStyle2 *iface, BSTR v)
|
||||
{
|
||||
HTMLStyle *This = HTMLSTYLE2_THIS(iface);
|
||||
FIXME("(%p)->(%s)\n", This, debugstr_w(v));
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLStyle2_get_tableLayout(IHTMLStyle2 *iface, BSTR *p)
|
||||
{
|
||||
HTMLStyle *This = HTMLSTYLE2_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLStyle2_put_borderCollapse(IHTMLStyle2 *iface, BSTR v)
|
||||
{
|
||||
HTMLStyle *This = HTMLSTYLE2_THIS(iface);
|
||||
FIXME("(%p)->(%s)\n", This, debugstr_w(v));
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLStyle2_get_borderCollapse(IHTMLStyle2 *iface, BSTR *p)
|
||||
{
|
||||
HTMLStyle *This = HTMLSTYLE2_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLStyle2_put_direction(IHTMLStyle2 *iface, BSTR v)
|
||||
{
|
||||
HTMLStyle *This = HTMLSTYLE2_THIS(iface);
|
||||
FIXME("(%p)->(%s)\n", This, debugstr_w(v));
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLStyle2_get_direction(IHTMLStyle2 *iface, BSTR *p)
|
||||
{
|
||||
HTMLStyle *This = HTMLSTYLE2_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLStyle2_put_behavior(IHTMLStyle2 *iface, BSTR v)
|
||||
{
|
||||
HTMLStyle *This = HTMLSTYLE2_THIS(iface);
|
||||
FIXME("(%p)->(%s)\n", This, debugstr_w(v));
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLStyle2_get_behavior(IHTMLStyle2 *iface, BSTR *p)
|
||||
{
|
||||
HTMLStyle *This = HTMLSTYLE2_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLStyle2_setExpression(IHTMLStyle2 *iface, BSTR propname, BSTR expression, BSTR language)
|
||||
{
|
||||
HTMLStyle *This = HTMLSTYLE2_THIS(iface);
|
||||
FIXME("(%p)->(%s %s %s)\n", This, debugstr_w(propname), debugstr_w(expression), debugstr_w(language));
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLStyle2_getExpression(IHTMLStyle2 *iface, BSTR propname, VARIANT *expression)
|
||||
{
|
||||
HTMLStyle *This = HTMLSTYLE2_THIS(iface);
|
||||
FIXME("(%p)->(%s %p)\n", This, debugstr_w(propname), expression);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLStyle2_removeExpression(IHTMLStyle2 *iface, BSTR propname, VARIANT_BOOL *pfSuccess)
|
||||
{
|
||||
HTMLStyle *This = HTMLSTYLE2_THIS(iface);
|
||||
FIXME("(%p)->(%s %p)\n", This, debugstr_w(propname), pfSuccess);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLStyle2_put_position(IHTMLStyle2 *iface, BSTR v)
|
||||
{
|
||||
HTMLStyle *This = HTMLSTYLE2_THIS(iface);
|
||||
|
||||
TRACE("(%p)->(%s)\n", This, debugstr_w(v));
|
||||
|
||||
return set_nsstyle_attr(This->nsstyle, STYLEID_POSITION, v, 0);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLStyle2_get_position(IHTMLStyle2 *iface, BSTR *p)
|
||||
{
|
||||
HTMLStyle *This = HTMLSTYLE2_THIS(iface);
|
||||
|
||||
TRACE("(%p)->(%p)\n", This, p);
|
||||
|
||||
return get_nsstyle_attr(This->nsstyle, STYLEID_POSITION, p);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLStyle2_put_unicodeBidi(IHTMLStyle2 *iface, BSTR v)
|
||||
{
|
||||
HTMLStyle *This = HTMLSTYLE2_THIS(iface);
|
||||
FIXME("(%p)->(%s)\n", This, debugstr_w(v));
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLStyle2_get_unicodeBidi(IHTMLStyle2 *iface, BSTR *p)
|
||||
{
|
||||
HTMLStyle *This = HTMLSTYLE2_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLStyle2_put_bottom(IHTMLStyle2 *iface, VARIANT v)
|
||||
{
|
||||
HTMLStyle *This = HTMLSTYLE2_THIS(iface);
|
||||
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLStyle2_get_bottom(IHTMLStyle2 *iface, VARIANT *p)
|
||||
{
|
||||
HTMLStyle *This = HTMLSTYLE2_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLStyle2_put_right(IHTMLStyle2 *iface, VARIANT v)
|
||||
{
|
||||
HTMLStyle *This = HTMLSTYLE2_THIS(iface);
|
||||
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLStyle2_get_right(IHTMLStyle2 *iface, VARIANT *p)
|
||||
{
|
||||
HTMLStyle *This = HTMLSTYLE2_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLStyle2_put_pixelBottom(IHTMLStyle2 *iface, long v)
|
||||
{
|
||||
HTMLStyle *This = HTMLSTYLE2_THIS(iface);
|
||||
FIXME("(%p)->(%ld)\n", This, v);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLStyle2_get_pixelBottom(IHTMLStyle2 *iface, long *p)
|
||||
{
|
||||
HTMLStyle *This = HTMLSTYLE2_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLStyle2_put_pixelRight(IHTMLStyle2 *iface, long v)
|
||||
{
|
||||
HTMLStyle *This = HTMLSTYLE2_THIS(iface);
|
||||
FIXME("(%p)->(%ld)\n", This, v);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLStyle2_get_pixelRight(IHTMLStyle2 *iface, long *p)
|
||||
{
|
||||
HTMLStyle *This = HTMLSTYLE2_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLStyle2_put_posBottom(IHTMLStyle2 *iface, float v)
|
||||
{
|
||||
HTMLStyle *This = HTMLSTYLE2_THIS(iface);
|
||||
FIXME("(%p)->(%f)\n", This, v);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLStyle2_get_posBottom(IHTMLStyle2 *iface, float *p)
|
||||
{
|
||||
HTMLStyle *This = HTMLSTYLE2_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLStyle2_put_posRight(IHTMLStyle2 *iface, float v)
|
||||
{
|
||||
HTMLStyle *This = HTMLSTYLE2_THIS(iface);
|
||||
FIXME("(%p)->(%f)\n", This, v);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLStyle2_get_posRight(IHTMLStyle2 *iface, float *p)
|
||||
{
|
||||
HTMLStyle *This = HTMLSTYLE2_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLStyle2_put_imeMode(IHTMLStyle2 *iface, BSTR v)
|
||||
{
|
||||
HTMLStyle *This = HTMLSTYLE2_THIS(iface);
|
||||
FIXME("(%p)->(%s)\n", This, debugstr_w(v));
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLStyle2_get_imeMode(IHTMLStyle2 *iface, BSTR *p)
|
||||
{
|
||||
HTMLStyle *This = HTMLSTYLE2_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLStyle2_put_rubyAlign(IHTMLStyle2 *iface, BSTR v)
|
||||
{
|
||||
HTMLStyle *This = HTMLSTYLE2_THIS(iface);
|
||||
FIXME("(%p)->(%s)\n", This, debugstr_w(v));
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLStyle2_get_rubyAlign(IHTMLStyle2 *iface, BSTR *p)
|
||||
{
|
||||
HTMLStyle *This = HTMLSTYLE2_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLStyle2_put_rubyPosition(IHTMLStyle2 *iface, BSTR v)
|
||||
{
|
||||
HTMLStyle *This = HTMLSTYLE2_THIS(iface);
|
||||
FIXME("(%p)->(%s)\n", This, debugstr_w(v));
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLStyle2_get_rubyPosition(IHTMLStyle2 *iface, BSTR *p)
|
||||
{
|
||||
HTMLStyle *This = HTMLSTYLE2_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLStyle2_put_rubyOverhang(IHTMLStyle2 *iface, BSTR v)
|
||||
{
|
||||
HTMLStyle *This = HTMLSTYLE2_THIS(iface);
|
||||
FIXME("(%p)->(%s)\n", This, debugstr_w(v));
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLStyle2_get_rubyOverhang(IHTMLStyle2 *iface, BSTR *p)
|
||||
{
|
||||
HTMLStyle *This = HTMLSTYLE2_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLStyle2_put_layoutGridChar(IHTMLStyle2 *iface, VARIANT v)
|
||||
{
|
||||
HTMLStyle *This = HTMLSTYLE2_THIS(iface);
|
||||
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLStyle2_get_layoutGridChar(IHTMLStyle2 *iface, VARIANT *p)
|
||||
{
|
||||
HTMLStyle *This = HTMLSTYLE2_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLStyle2_put_layoutGridLine(IHTMLStyle2 *iface, VARIANT v)
|
||||
{
|
||||
HTMLStyle *This = HTMLSTYLE2_THIS(iface);
|
||||
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLStyle2_get_layoutGridLine(IHTMLStyle2 *iface, VARIANT *p)
|
||||
{
|
||||
HTMLStyle *This = HTMLSTYLE2_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLStyle2_put_layoutGridMode(IHTMLStyle2 *iface, BSTR v)
|
||||
{
|
||||
HTMLStyle *This = HTMLSTYLE2_THIS(iface);
|
||||
FIXME("(%p)->(%s)\n", This, debugstr_w(v));
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLStyle2_get_layoutGridMode(IHTMLStyle2 *iface, BSTR *p)
|
||||
{
|
||||
HTMLStyle *This = HTMLSTYLE2_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLStyle2_put_layoutGridType(IHTMLStyle2 *iface, BSTR v)
|
||||
{
|
||||
HTMLStyle *This = HTMLSTYLE2_THIS(iface);
|
||||
FIXME("(%p)->(%s)\n", This, debugstr_w(v));
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLStyle2_get_layoutGridType(IHTMLStyle2 *iface, BSTR *p)
|
||||
{
|
||||
HTMLStyle *This = HTMLSTYLE2_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLStyle2_put_layoutGrid(IHTMLStyle2 *iface, BSTR v)
|
||||
{
|
||||
HTMLStyle *This = HTMLSTYLE2_THIS(iface);
|
||||
FIXME("(%p)->(%s)\n", This, debugstr_w(v));
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLStyle2_get_layoutGrid(IHTMLStyle2 *iface, BSTR *p)
|
||||
{
|
||||
HTMLStyle *This = HTMLSTYLE2_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLStyle2_put_wordBreak(IHTMLStyle2 *iface, BSTR v)
|
||||
{
|
||||
HTMLStyle *This = HTMLSTYLE2_THIS(iface);
|
||||
FIXME("(%p)->(%s)\n", This, debugstr_w(v));
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLStyle2_get_wordBreak(IHTMLStyle2 *iface, BSTR *p)
|
||||
{
|
||||
HTMLStyle *This = HTMLSTYLE2_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLStyle2_put_lineBreak(IHTMLStyle2 *iface, BSTR v)
|
||||
{
|
||||
HTMLStyle *This = HTMLSTYLE2_THIS(iface);
|
||||
FIXME("(%p)->(%s)\n", This, debugstr_w(v));
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLStyle2_get_lineBreak(IHTMLStyle2 *iface, BSTR *p)
|
||||
{
|
||||
HTMLStyle *This = HTMLSTYLE2_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLStyle2_put_textJustify(IHTMLStyle2 *iface, BSTR v)
|
||||
{
|
||||
HTMLStyle *This = HTMLSTYLE2_THIS(iface);
|
||||
FIXME("(%p)->(%s)\n", This, debugstr_w(v));
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLStyle2_get_textJustify(IHTMLStyle2 *iface, BSTR *p)
|
||||
{
|
||||
HTMLStyle *This = HTMLSTYLE2_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLStyle2_put_textJustifyTrim(IHTMLStyle2 *iface, BSTR v)
|
||||
{
|
||||
HTMLStyle *This = HTMLSTYLE2_THIS(iface);
|
||||
FIXME("(%p)->(%s)\n", This, debugstr_w(v));
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLStyle2_get_textJustifyTrim(IHTMLStyle2 *iface, BSTR *p)
|
||||
{
|
||||
HTMLStyle *This = HTMLSTYLE2_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLStyle2_put_textKashida(IHTMLStyle2 *iface, VARIANT v)
|
||||
{
|
||||
HTMLStyle *This = HTMLSTYLE2_THIS(iface);
|
||||
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLStyle2_get_textKashida(IHTMLStyle2 *iface, VARIANT *p)
|
||||
{
|
||||
HTMLStyle *This = HTMLSTYLE2_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLStyle2_put_textAutospace(IHTMLStyle2 *iface, BSTR v)
|
||||
{
|
||||
HTMLStyle *This = HTMLSTYLE2_THIS(iface);
|
||||
FIXME("(%p)->(%s)\n", This, debugstr_w(v));
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLStyle2_get_textAutospace(IHTMLStyle2 *iface, BSTR *p)
|
||||
{
|
||||
HTMLStyle *This = HTMLSTYLE2_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLStyle2_put_overflowX(IHTMLStyle2 *iface, BSTR v)
|
||||
{
|
||||
HTMLStyle *This = HTMLSTYLE2_THIS(iface);
|
||||
FIXME("(%p)->(%s)\n", This, debugstr_w(v));
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLStyle2_get_overflowX(IHTMLStyle2 *iface, BSTR *p)
|
||||
{
|
||||
HTMLStyle *This = HTMLSTYLE2_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLStyle2_put_overflowY(IHTMLStyle2 *iface, BSTR v)
|
||||
{
|
||||
HTMLStyle *This = HTMLSTYLE2_THIS(iface);
|
||||
FIXME("(%p)->(%s)\n", This, debugstr_w(v));
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLStyle2_get_overflowY(IHTMLStyle2 *iface, BSTR *p)
|
||||
{
|
||||
HTMLStyle *This = HTMLSTYLE2_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLStyle2_put_accelerator(IHTMLStyle2 *iface, BSTR v)
|
||||
{
|
||||
HTMLStyle *This = HTMLSTYLE2_THIS(iface);
|
||||
FIXME("(%p)->(%s)\n", This, debugstr_w(v));
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLStyle2_get_accelerator(IHTMLStyle2 *iface, BSTR *p)
|
||||
{
|
||||
HTMLStyle *This = HTMLSTYLE2_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static const IHTMLStyle2Vtbl HTMLStyle2Vtbl = {
|
||||
HTMLStyle2_QueryInterface,
|
||||
HTMLStyle2_AddRef,
|
||||
HTMLStyle2_Release,
|
||||
HTMLStyle2_GetTypeInfoCount,
|
||||
HTMLStyle2_GetTypeInfo,
|
||||
HTMLStyle2_GetIDsOfNames,
|
||||
HTMLStyle2_Invoke,
|
||||
HTMLStyle2_put_tableLayout,
|
||||
HTMLStyle2_get_tableLayout,
|
||||
HTMLStyle2_put_borderCollapse,
|
||||
HTMLStyle2_get_borderCollapse,
|
||||
HTMLStyle2_put_direction,
|
||||
HTMLStyle2_get_direction,
|
||||
HTMLStyle2_put_behavior,
|
||||
HTMLStyle2_get_behavior,
|
||||
HTMLStyle2_setExpression,
|
||||
HTMLStyle2_getExpression,
|
||||
HTMLStyle2_removeExpression,
|
||||
HTMLStyle2_put_position,
|
||||
HTMLStyle2_get_position,
|
||||
HTMLStyle2_put_unicodeBidi,
|
||||
HTMLStyle2_get_unicodeBidi,
|
||||
HTMLStyle2_put_bottom,
|
||||
HTMLStyle2_get_bottom,
|
||||
HTMLStyle2_put_right,
|
||||
HTMLStyle2_get_right,
|
||||
HTMLStyle2_put_pixelBottom,
|
||||
HTMLStyle2_get_pixelBottom,
|
||||
HTMLStyle2_put_pixelRight,
|
||||
HTMLStyle2_get_pixelRight,
|
||||
HTMLStyle2_put_posBottom,
|
||||
HTMLStyle2_get_posBottom,
|
||||
HTMLStyle2_put_posRight,
|
||||
HTMLStyle2_get_posRight,
|
||||
HTMLStyle2_put_imeMode,
|
||||
HTMLStyle2_get_imeMode,
|
||||
HTMLStyle2_put_rubyAlign,
|
||||
HTMLStyle2_get_rubyAlign,
|
||||
HTMLStyle2_put_rubyPosition,
|
||||
HTMLStyle2_get_rubyPosition,
|
||||
HTMLStyle2_put_rubyOverhang,
|
||||
HTMLStyle2_get_rubyOverhang,
|
||||
HTMLStyle2_put_layoutGridChar,
|
||||
HTMLStyle2_get_layoutGridChar,
|
||||
HTMLStyle2_put_layoutGridLine,
|
||||
HTMLStyle2_get_layoutGridLine,
|
||||
HTMLStyle2_put_layoutGridMode,
|
||||
HTMLStyle2_get_layoutGridMode,
|
||||
HTMLStyle2_put_layoutGridType,
|
||||
HTMLStyle2_get_layoutGridType,
|
||||
HTMLStyle2_put_layoutGrid,
|
||||
HTMLStyle2_get_layoutGrid,
|
||||
HTMLStyle2_put_wordBreak,
|
||||
HTMLStyle2_get_wordBreak,
|
||||
HTMLStyle2_put_lineBreak,
|
||||
HTMLStyle2_get_lineBreak,
|
||||
HTMLStyle2_put_textJustify,
|
||||
HTMLStyle2_get_textJustify,
|
||||
HTMLStyle2_put_textJustifyTrim,
|
||||
HTMLStyle2_get_textJustifyTrim,
|
||||
HTMLStyle2_put_textKashida,
|
||||
HTMLStyle2_get_textKashida,
|
||||
HTMLStyle2_put_textAutospace,
|
||||
HTMLStyle2_get_textAutospace,
|
||||
HTMLStyle2_put_overflowX,
|
||||
HTMLStyle2_get_overflowX,
|
||||
HTMLStyle2_put_overflowY,
|
||||
HTMLStyle2_get_overflowY,
|
||||
HTMLStyle2_put_accelerator,
|
||||
HTMLStyle2_get_accelerator
|
||||
};
|
||||
|
||||
void HTMLStyle2_Init(HTMLStyle *This)
|
||||
{
|
||||
This->lpHTMLStyle2Vtbl = &HTMLStyle2Vtbl;
|
||||
}
|
||||
@@ -56,8 +56,8 @@ typedef struct {
|
||||
nsIDOMCSSRuleList *nslist;
|
||||
} HTMLStyleSheetRulesCollection;
|
||||
|
||||
#define HTMLSTYLESHEET(x) ((IHTMLStyleSheet*) &(x)->lpHTMLStyleSheetVtbl);
|
||||
#define HTMLSTYLESHEETSCOL(x) ((IHTMLStyleSheetsCollection*) &(x)->lpHTMLStyleSheetsCollectionVtbl);
|
||||
#define HTMLSTYLESHEET(x) ((IHTMLStyleSheet*) &(x)->lpHTMLStyleSheetVtbl)
|
||||
#define HTMLSTYLESHEETSCOL(x) ((IHTMLStyleSheetsCollection*) &(x)->lpHTMLStyleSheetsCollectionVtbl)
|
||||
#define HTMLSTYLERULESCOL(x) ((IHTMLStyleSheetRulesCollection*) &(x)->lpHTMLStyleSheetRulesCollectionVtbl)
|
||||
|
||||
#define HTMLSTYLERULESCOL_THIS(iface) \
|
||||
|
||||
@@ -37,6 +37,7 @@ typedef struct {
|
||||
const IHTMLTableVtbl *lpHTMLTableVtbl;
|
||||
|
||||
ConnectionPoint cp;
|
||||
nsIDOMHTMLTableElement *nstable;
|
||||
} HTMLTable;
|
||||
|
||||
#define HTMLTABLE(x) ((IHTMLTable*) &(x)->lpHTMLTableVtbl)
|
||||
@@ -68,16 +69,14 @@ static ULONG WINAPI HTMLTable_Release(IHTMLTable *iface)
|
||||
static HRESULT WINAPI HTMLTable_GetTypeInfoCount(IHTMLTable *iface, UINT *pctinfo)
|
||||
{
|
||||
HTMLTable *This = HTMLTABLE_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, pctinfo);
|
||||
return E_NOTIMPL;
|
||||
return IDispatchEx_GetTypeInfoCount(DISPATCHEX(&This->element.node.dispex), pctinfo);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLTable_GetTypeInfo(IHTMLTable *iface, UINT iTInfo,
|
||||
LCID lcid, ITypeInfo **ppTInfo)
|
||||
{
|
||||
HTMLTable *This = HTMLTABLE_THIS(iface);
|
||||
FIXME("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo);
|
||||
return E_NOTIMPL;
|
||||
return IDispatchEx_GetTypeInfo(DISPATCHEX(&This->element.node.dispex), iTInfo, lcid, ppTInfo);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLTable_GetIDsOfNames(IHTMLTable *iface, REFIID riid,
|
||||
@@ -85,9 +84,7 @@ static HRESULT WINAPI HTMLTable_GetIDsOfNames(IHTMLTable *iface, REFIID riid,
|
||||
LCID lcid, DISPID *rgDispId)
|
||||
{
|
||||
HTMLTable *This = HTMLTABLE_THIS(iface);
|
||||
FIXME("(%p)->(%s %p %u %u %p)\n", This, debugstr_guid(riid), rgszNames, cNames,
|
||||
lcid, rgDispId);
|
||||
return E_NOTIMPL;
|
||||
return IDispatchEx_GetIDsOfNames(DISPATCHEX(&This->element.node.dispex), riid, rgszNames, cNames, lcid, rgDispId);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLTable_Invoke(IHTMLTable *iface, DISPID dispIdMember,
|
||||
@@ -95,9 +92,8 @@ static HRESULT WINAPI HTMLTable_Invoke(IHTMLTable *iface, DISPID dispIdMember,
|
||||
VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
|
||||
{
|
||||
HTMLTable *This = HTMLTABLE_THIS(iface);
|
||||
FIXME("(%p)->(%d %s %d %d %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid),
|
||||
lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
|
||||
return E_NOTIMPL;
|
||||
return IDispatchEx_Invoke(DISPATCHEX(&This->element.node.dispex), dispIdMember, riid, lcid, wFlags, pDispParams,
|
||||
pVarResult, pExcepInfo, puArgErr);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLTable_put_cols(IHTMLTable *iface, long v)
|
||||
@@ -278,8 +274,21 @@ static HRESULT WINAPI HTMLTable_refresh(IHTMLTable *iface)
|
||||
static HRESULT WINAPI HTMLTable_get_rows(IHTMLTable *iface, IHTMLElementCollection **p)
|
||||
{
|
||||
HTMLTable *This = HTMLTABLE_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
nsIDOMHTMLCollection *nscol;
|
||||
nsresult nsres;
|
||||
|
||||
TRACE("(%p)->(%p)\n", This, p);
|
||||
|
||||
nsres = nsIDOMHTMLTableElement_GetRows(This->nstable, &nscol);
|
||||
if(NS_FAILED(nsres)) {
|
||||
ERR("GetRows failed: %08x\n", nsres);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
*p = create_collection_from_htmlcol(This->element.node.doc, (IUnknown*)HTMLTABLE(This), nscol);
|
||||
|
||||
nsIDOMHTMLCollection_Release(nscol);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLTable_put_width(IHTMLTable *iface, VARIANT v)
|
||||
@@ -534,6 +543,10 @@ static HRESULT HTMLTable_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
|
||||
static void HTMLTable_destructor(HTMLDOMNode *iface)
|
||||
{
|
||||
HTMLTable *This = HTMLTABLE_NODE_THIS(iface);
|
||||
|
||||
if(This->nstable)
|
||||
nsIDOMHTMLTableElement_Release(This->nstable);
|
||||
|
||||
HTMLElement_destructor(&This->element.node);
|
||||
}
|
||||
|
||||
@@ -544,16 +557,39 @@ static const NodeImplVtbl HTMLTableImplVtbl = {
|
||||
HTMLTable_destructor
|
||||
};
|
||||
|
||||
static const tid_t HTMLTable_iface_tids[] = {
|
||||
IHTMLDOMNode_tid,
|
||||
IHTMLDOMNode2_tid,
|
||||
IHTMLElement_tid,
|
||||
IHTMLElement2_tid,
|
||||
IHTMLElement3_tid,
|
||||
IHTMLTable_tid,
|
||||
0
|
||||
};
|
||||
|
||||
static dispex_static_data_t HTMLTable_dispex = {
|
||||
NULL,
|
||||
DispHTMLTable_tid,
|
||||
NULL,
|
||||
HTMLTable_iface_tids
|
||||
};
|
||||
|
||||
HTMLElement *HTMLTable_Create(nsIDOMHTMLElement *nselem)
|
||||
{
|
||||
HTMLTable *ret = heap_alloc_zero(sizeof(HTMLTable));
|
||||
|
||||
HTMLElement_Init(&ret->element);
|
||||
nsresult nsres;
|
||||
|
||||
ret->element.node.vtbl = &HTMLTableImplVtbl;
|
||||
ret->lpHTMLTableVtbl = &HTMLTableVtbl;
|
||||
|
||||
init_dispex(&ret->element.node.dispex, (IUnknown*)HTMLTABLE(ret), &HTMLTable_dispex);
|
||||
HTMLElement_Init(&ret->element);
|
||||
|
||||
ConnectionPoint_Init(&ret->cp, &ret->element.cp_container, &DIID_HTMLTableEvents);
|
||||
|
||||
nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLTableElement, (void**)&ret->nstable);
|
||||
if(NS_FAILED(nsres))
|
||||
ERR("Could not get nsIDOMHTMLTableElement iface: %08x\n", nsres);
|
||||
|
||||
return &ret->element;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,336 @@
|
||||
/*
|
||||
* Copyright 2008 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 <stdarg.h>
|
||||
|
||||
#define COBJMACROS
|
||||
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#include "winuser.h"
|
||||
#include "ole2.h"
|
||||
|
||||
#include "wine/debug.h"
|
||||
|
||||
#include "mshtml_private.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
|
||||
|
||||
typedef struct {
|
||||
HTMLElement element;
|
||||
|
||||
const IHTMLTableRowVtbl *lpHTMLTableRowVtbl;
|
||||
|
||||
nsIDOMHTMLTableRowElement *nsrow;
|
||||
} HTMLTableRow;
|
||||
|
||||
#define HTMLTABLEROW(x) ((IHTMLTableRow*) &(x)->lpHTMLTableRowVtbl)
|
||||
|
||||
#define HTMLTABLEROW_THIS(iface) DEFINE_THIS(HTMLTableRow, HTMLTableRow, iface)
|
||||
|
||||
static HRESULT WINAPI HTMLTableRow_QueryInterface(IHTMLTableRow *iface,
|
||||
REFIID riid, void **ppv)
|
||||
{
|
||||
HTMLTableRow *This = HTMLTABLEROW_THIS(iface);
|
||||
|
||||
return IHTMLDOMNode_QueryInterface(HTMLDOMNODE(&This->element.node), riid, ppv);
|
||||
}
|
||||
|
||||
static ULONG WINAPI HTMLTableRow_AddRef(IHTMLTableRow *iface)
|
||||
{
|
||||
HTMLTableRow *This = HTMLTABLEROW_THIS(iface);
|
||||
|
||||
return IHTMLDOMNode_AddRef(HTMLDOMNODE(&This->element.node));
|
||||
}
|
||||
|
||||
static ULONG WINAPI HTMLTableRow_Release(IHTMLTableRow *iface)
|
||||
{
|
||||
HTMLTableRow *This = HTMLTABLEROW_THIS(iface);
|
||||
|
||||
return IHTMLDOMNode_Release(HTMLDOMNODE(&This->element.node));
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLTableRow_GetTypeInfoCount(IHTMLTableRow *iface, UINT *pctinfo)
|
||||
{
|
||||
HTMLTableRow *This = HTMLTABLEROW_THIS(iface);
|
||||
return IDispatchEx_GetTypeInfoCount(DISPATCHEX(&This->element.node.dispex), pctinfo);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLTableRow_GetTypeInfo(IHTMLTableRow *iface, UINT iTInfo,
|
||||
LCID lcid, ITypeInfo **ppTInfo)
|
||||
{
|
||||
HTMLTableRow *This = HTMLTABLEROW_THIS(iface);
|
||||
return IDispatchEx_GetTypeInfo(DISPATCHEX(&This->element.node.dispex), iTInfo, lcid, ppTInfo);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLTableRow_GetIDsOfNames(IHTMLTableRow *iface, REFIID riid,
|
||||
LPOLESTR *rgszNames, UINT cNames,
|
||||
LCID lcid, DISPID *rgDispId)
|
||||
{
|
||||
HTMLTableRow *This = HTMLTABLEROW_THIS(iface);
|
||||
return IDispatchEx_GetIDsOfNames(DISPATCHEX(&This->element.node.dispex), riid, rgszNames, cNames, lcid, rgDispId);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLTableRow_Invoke(IHTMLTableRow *iface, DISPID dispIdMember,
|
||||
REFIID riid, LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
|
||||
VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
|
||||
{
|
||||
HTMLTableRow *This = HTMLTABLEROW_THIS(iface);
|
||||
return IDispatchEx_Invoke(DISPATCHEX(&This->element.node.dispex), dispIdMember, riid, lcid, wFlags, pDispParams,
|
||||
pVarResult, pExcepInfo, puArgErr);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLTableRow_put_align(IHTMLTableRow *iface, BSTR v)
|
||||
{
|
||||
HTMLTableRow *This = HTMLTABLEROW_THIS(iface);
|
||||
FIXME("(%p)->(%s)\n", This, debugstr_w(v));
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLTableRow_get_align(IHTMLTableRow *iface, BSTR *p)
|
||||
{
|
||||
HTMLTableRow *This = HTMLTABLEROW_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLTableRow_put_vAlign(IHTMLTableRow *iface, BSTR v)
|
||||
{
|
||||
HTMLTableRow *This = HTMLTABLEROW_THIS(iface);
|
||||
FIXME("(%p)->(%s)\n", This, debugstr_w(v));
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLTableRow_get_vAlign(IHTMLTableRow *iface, BSTR *p)
|
||||
{
|
||||
HTMLTableRow *This = HTMLTABLEROW_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLTableRow_put_bgColor(IHTMLTableRow *iface, VARIANT v)
|
||||
{
|
||||
HTMLTableRow *This = HTMLTABLEROW_THIS(iface);
|
||||
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLTableRow_get_bgColor(IHTMLTableRow *iface, VARIANT *p)
|
||||
{
|
||||
HTMLTableRow *This = HTMLTABLEROW_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLTableRow_put_borderColor(IHTMLTableRow *iface, VARIANT v)
|
||||
{
|
||||
HTMLTableRow *This = HTMLTABLEROW_THIS(iface);
|
||||
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLTableRow_get_borderColor(IHTMLTableRow *iface, VARIANT *p)
|
||||
{
|
||||
HTMLTableRow *This = HTMLTABLEROW_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLTableRow_put_borderColorLight(IHTMLTableRow *iface, VARIANT v)
|
||||
{
|
||||
HTMLTableRow *This = HTMLTABLEROW_THIS(iface);
|
||||
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLTableRow_get_borderColorLight(IHTMLTableRow *iface, VARIANT *p)
|
||||
{
|
||||
HTMLTableRow *This = HTMLTABLEROW_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLTableRow_put_borderColorDark(IHTMLTableRow *iface, VARIANT v)
|
||||
{
|
||||
HTMLTableRow *This = HTMLTABLEROW_THIS(iface);
|
||||
FIXME("(%p)->(%s)\n", This, debugstr_variant(&v));
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLTableRow_get_borderColorDark(IHTMLTableRow *iface, VARIANT *p)
|
||||
{
|
||||
HTMLTableRow *This = HTMLTABLEROW_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLTableRow_get_rowIndex(IHTMLTableRow *iface, long *p)
|
||||
{
|
||||
HTMLTableRow *This = HTMLTABLEROW_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLTableRow_get_selectionRowIndex(IHTMLTableRow *iface, long *p)
|
||||
{
|
||||
HTMLTableRow *This = HTMLTABLEROW_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLTableRow_get_cells(IHTMLTableRow *iface, IHTMLElementCollection **p)
|
||||
{
|
||||
HTMLTableRow *This = HTMLTABLEROW_THIS(iface);
|
||||
nsIDOMHTMLCollection *nscol;
|
||||
nsresult nsres;
|
||||
|
||||
TRACE("(%p)->(%p)\n", This, p);
|
||||
|
||||
nsres = nsIDOMHTMLTableRowElement_GetCells(This->nsrow, &nscol);
|
||||
if(NS_FAILED(nsres)) {
|
||||
ERR("GetCells failed: %08x\n", nsres);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
*p = create_collection_from_htmlcol(This->element.node.doc, (IUnknown*)HTMLTABLEROW(This), nscol);
|
||||
|
||||
nsIDOMHTMLCollection_Release(nscol);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLTableRow_insertCell(IHTMLTableRow *iface, long index, IDispatch **row)
|
||||
{
|
||||
HTMLTableRow *This = HTMLTABLEROW_THIS(iface);
|
||||
FIXME("(%p)->(%ld %p)\n", This, index, row);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLTableRow_deleteCell(IHTMLTableRow *iface, long index)
|
||||
{
|
||||
HTMLTableRow *This = HTMLTABLEROW_THIS(iface);
|
||||
FIXME("(%p)->(%ld)\n", This, index);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
#undef HTMLTABLEROW_THIS
|
||||
|
||||
static const IHTMLTableRowVtbl HTMLTableRowVtbl = {
|
||||
HTMLTableRow_QueryInterface,
|
||||
HTMLTableRow_AddRef,
|
||||
HTMLTableRow_Release,
|
||||
HTMLTableRow_GetTypeInfoCount,
|
||||
HTMLTableRow_GetTypeInfo,
|
||||
HTMLTableRow_GetIDsOfNames,
|
||||
HTMLTableRow_Invoke,
|
||||
HTMLTableRow_put_align,
|
||||
HTMLTableRow_get_align,
|
||||
HTMLTableRow_put_vAlign,
|
||||
HTMLTableRow_get_vAlign,
|
||||
HTMLTableRow_put_bgColor,
|
||||
HTMLTableRow_get_bgColor,
|
||||
HTMLTableRow_put_borderColor,
|
||||
HTMLTableRow_get_borderColor,
|
||||
HTMLTableRow_put_borderColorLight,
|
||||
HTMLTableRow_get_borderColorLight,
|
||||
HTMLTableRow_put_borderColorDark,
|
||||
HTMLTableRow_get_borderColorDark,
|
||||
HTMLTableRow_get_rowIndex,
|
||||
HTMLTableRow_get_selectionRowIndex,
|
||||
HTMLTableRow_get_cells,
|
||||
HTMLTableRow_insertCell,
|
||||
HTMLTableRow_deleteCell
|
||||
};
|
||||
|
||||
#define HTMLTABLEROW_NODE_THIS(iface) DEFINE_THIS2(HTMLTableRow, element.node, iface)
|
||||
|
||||
static HRESULT HTMLTableRow_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
|
||||
{
|
||||
HTMLTableRow *This = HTMLTABLEROW_NODE_THIS(iface);
|
||||
|
||||
*ppv = NULL;
|
||||
|
||||
if(IsEqualGUID(&IID_IUnknown, riid)) {
|
||||
TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
|
||||
*ppv = HTMLTABLEROW(This);
|
||||
}else if(IsEqualGUID(&IID_IDispatch, riid)) {
|
||||
TRACE("(%p)->(IID_IDispatch %p)\n", This, ppv);
|
||||
*ppv = HTMLTABLEROW(This);
|
||||
}else if(IsEqualGUID(&IID_IHTMLTableRow, riid)) {
|
||||
TRACE("(%p)->(IID_IHTMLTableRow %p)\n", This, ppv);
|
||||
*ppv = HTMLTABLEROW(This);
|
||||
}
|
||||
|
||||
if(*ppv) {
|
||||
IUnknown_AddRef((IUnknown*)*ppv);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
return HTMLElement_QI(&This->element.node, riid, ppv);
|
||||
}
|
||||
|
||||
static void HTMLTableRow_destructor(HTMLDOMNode *iface)
|
||||
{
|
||||
HTMLTableRow *This = HTMLTABLEROW_NODE_THIS(iface);
|
||||
|
||||
if(This->nsrow)
|
||||
nsIDOMHTMLTableRowElement_Release(This->nsrow);
|
||||
|
||||
HTMLElement_destructor(&This->element.node);
|
||||
}
|
||||
|
||||
#undef HTMLTABLEROW_NODE_THIS
|
||||
|
||||
static const NodeImplVtbl HTMLTableRowImplVtbl = {
|
||||
HTMLTableRow_QI,
|
||||
HTMLTableRow_destructor
|
||||
};
|
||||
|
||||
static const tid_t HTMLTableRow_iface_tids[] = {
|
||||
IHTMLDOMNode_tid,
|
||||
IHTMLDOMNode2_tid,
|
||||
IHTMLElement_tid,
|
||||
IHTMLElement2_tid,
|
||||
IHTMLElement3_tid,
|
||||
IHTMLTableRow_tid,
|
||||
0
|
||||
};
|
||||
|
||||
static dispex_static_data_t HTMLTableRow_dispex = {
|
||||
NULL,
|
||||
DispHTMLTableRow_tid,
|
||||
NULL,
|
||||
HTMLTableRow_iface_tids
|
||||
};
|
||||
|
||||
HTMLElement *HTMLTableRow_Create(nsIDOMHTMLElement *nselem)
|
||||
{
|
||||
HTMLTableRow *ret = heap_alloc_zero(sizeof(HTMLTableRow));
|
||||
nsresult nsres;
|
||||
|
||||
ret->lpHTMLTableRowVtbl = &HTMLTableRowVtbl;
|
||||
ret->element.node.vtbl = &HTMLTableRowImplVtbl;
|
||||
|
||||
init_dispex(&ret->element.node.dispex, (IUnknown*)HTMLTABLEROW(ret), &HTMLTableRow_dispex);
|
||||
HTMLElement_Init(&ret->element);
|
||||
|
||||
nsres = nsIDOMHTMLElement_QueryInterface(nselem, &IID_nsIDOMHTMLTableRowElement, (void**)&ret->nsrow);
|
||||
if(NS_FAILED(nsres))
|
||||
ERR("Could not get nsIDOMHTMLTableRowElement iface: %08x\n", nsres);
|
||||
|
||||
return &ret->element;
|
||||
}
|
||||
@@ -68,16 +68,14 @@ static ULONG WINAPI HTMLTextAreaElement_Release(IHTMLTextAreaElement *iface)
|
||||
static HRESULT WINAPI HTMLTextAreaElement_GetTypeInfoCount(IHTMLTextAreaElement *iface, UINT *pctinfo)
|
||||
{
|
||||
HTMLTextAreaElement *This = HTMLTXTAREA_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, pctinfo);
|
||||
return E_NOTIMPL;
|
||||
return IDispatchEx_GetTypeInfoCount(DISPATCHEX(&This->element.node.dispex), pctinfo);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLTextAreaElement_GetTypeInfo(IHTMLTextAreaElement *iface, UINT iTInfo,
|
||||
LCID lcid, ITypeInfo **ppTInfo)
|
||||
{
|
||||
HTMLTextAreaElement *This = HTMLTXTAREA_THIS(iface);
|
||||
FIXME("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo);
|
||||
return E_NOTIMPL;
|
||||
return IDispatchEx_GetTypeInfo(DISPATCHEX(&This->element.node.dispex), iTInfo, lcid, ppTInfo);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLTextAreaElement_GetIDsOfNames(IHTMLTextAreaElement *iface, REFIID riid,
|
||||
@@ -85,9 +83,7 @@ static HRESULT WINAPI HTMLTextAreaElement_GetIDsOfNames(IHTMLTextAreaElement *if
|
||||
LCID lcid, DISPID *rgDispId)
|
||||
{
|
||||
HTMLTextAreaElement *This = HTMLTXTAREA_THIS(iface);
|
||||
FIXME("(%p)->(%s %p %u %u %p)\n", This, debugstr_guid(riid), rgszNames, cNames,
|
||||
lcid, rgDispId);
|
||||
return E_NOTIMPL;
|
||||
return IDispatchEx_GetIDsOfNames(DISPATCHEX(&This->element.node.dispex), riid, rgszNames, cNames, lcid, rgDispId);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLTextAreaElement_Invoke(IHTMLTextAreaElement *iface, DISPID dispIdMember,
|
||||
@@ -95,9 +91,8 @@ static HRESULT WINAPI HTMLTextAreaElement_Invoke(IHTMLTextAreaElement *iface, DI
|
||||
VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
|
||||
{
|
||||
HTMLTextAreaElement *This = HTMLTXTAREA_THIS(iface);
|
||||
FIXME("(%p)->(%d %s %d %d %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid),
|
||||
lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
|
||||
return E_NOTIMPL;
|
||||
return IDispatchEx_Invoke(DISPATCHEX(&This->element.node.dispex), dispIdMember, riid, lcid, wFlags, pDispParams,
|
||||
pVarResult, pExcepInfo, puArgErr);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLTextAreaElement_get_type(IHTMLTextAreaElement *iface, BSTR *p)
|
||||
@@ -393,11 +388,25 @@ static void HTMLTextAreaElement_destructor(HTMLDOMNode *iface)
|
||||
HTMLElement_destructor(&This->element.node);
|
||||
}
|
||||
|
||||
static HRESULT HTMLTextAreaElementImpl_put_disabled(HTMLDOMNode *iface, VARIANT_BOOL v)
|
||||
{
|
||||
HTMLTextAreaElement *This = HTMLTXTAREA_NODE_THIS(iface);
|
||||
return IHTMLTextAreaElement_put_disabled(HTMLTXTAREA(This), v);
|
||||
}
|
||||
|
||||
static HRESULT HTMLTextAreaElementImpl_get_disabled(HTMLDOMNode *iface, VARIANT_BOOL *p)
|
||||
{
|
||||
HTMLTextAreaElement *This = HTMLTXTAREA_NODE_THIS(iface);
|
||||
return IHTMLTextAreaElement_get_disabled(HTMLTXTAREA(This), p);
|
||||
}
|
||||
|
||||
#undef HTMLTXTAREA_NODE_THIS
|
||||
|
||||
static const NodeImplVtbl HTMLTextAreaElementImplVtbl = {
|
||||
HTMLTextAreaElement_QI,
|
||||
HTMLTextAreaElement_destructor
|
||||
HTMLTextAreaElement_destructor,
|
||||
HTMLTextAreaElementImpl_put_disabled,
|
||||
HTMLTextAreaElementImpl_get_disabled
|
||||
};
|
||||
|
||||
HTMLElement *HTMLTextAreaElement_Create(nsIDOMHTMLElement *nselem)
|
||||
|
||||
@@ -58,16 +58,14 @@ static ULONG WINAPI HTMLTextContainer_Release(IHTMLTextContainer *iface)
|
||||
static HRESULT WINAPI HTMLTextContainer_GetTypeInfoCount(IHTMLTextContainer *iface, UINT *pctinfo)
|
||||
{
|
||||
HTMLTextContainer *This = HTMLTEXTCONT_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, pctinfo);
|
||||
return E_NOTIMPL;
|
||||
return IDispatchEx_GetTypeInfoCount(DISPATCHEX(&This->element.node.dispex), pctinfo);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLTextContainer_GetTypeInfo(IHTMLTextContainer *iface, UINT iTInfo,
|
||||
LCID lcid, ITypeInfo **ppTInfo)
|
||||
{
|
||||
HTMLTextContainer *This = HTMLTEXTCONT_THIS(iface);
|
||||
FIXME("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo);
|
||||
return E_NOTIMPL;
|
||||
return IDispatchEx_GetTypeInfo(DISPATCHEX(&This->element.node.dispex), iTInfo, lcid, ppTInfo);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLTextContainer_GetIDsOfNames(IHTMLTextContainer *iface, REFIID riid,
|
||||
@@ -75,9 +73,7 @@ static HRESULT WINAPI HTMLTextContainer_GetIDsOfNames(IHTMLTextContainer *iface,
|
||||
LCID lcid, DISPID *rgDispId)
|
||||
{
|
||||
HTMLTextContainer *This = HTMLTEXTCONT_THIS(iface);
|
||||
FIXME("(%p)->(%s %p %u %u %p)\n", This, debugstr_guid(riid), rgszNames, cNames,
|
||||
lcid, rgDispId);
|
||||
return E_NOTIMPL;
|
||||
return IDispatchEx_GetIDsOfNames(DISPATCHEX(&This->element.node.dispex), riid, rgszNames, cNames, lcid, rgDispId);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLTextContainer_Invoke(IHTMLTextContainer *iface, DISPID dispIdMember,
|
||||
@@ -85,9 +81,8 @@ static HRESULT WINAPI HTMLTextContainer_Invoke(IHTMLTextContainer *iface, DISPID
|
||||
VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
|
||||
{
|
||||
HTMLTextContainer *This = HTMLTEXTCONT_THIS(iface);
|
||||
FIXME("(%p)->(%d %s %d %d %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid),
|
||||
lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
|
||||
return E_NOTIMPL;
|
||||
return IDispatchEx_Invoke(DISPATCHEX(&This->element.node.dispex), dispIdMember, riid, lcid, wFlags, pDispParams,
|
||||
pVarResult, pExcepInfo, puArgErr);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLTextContainer_createControlRange(IHTMLTextContainer *iface,
|
||||
@@ -146,8 +141,10 @@ static HRESULT WINAPI HTMLTextContainer_put_scrollLeft(IHTMLTextContainer *iface
|
||||
static HRESULT WINAPI HTMLTextContainer_get_scrollLeft(IHTMLTextContainer *iface, long *p)
|
||||
{
|
||||
HTMLTextContainer *This = HTMLTEXTCONT_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
|
||||
TRACE("(%p)->(%p)\n", This, p);
|
||||
|
||||
return IHTMLElement2_get_scrollLeft(HTMLELEM2(&This->element), p);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLTextContainer_put_onscroll(IHTMLTextContainer *iface, VARIANT v)
|
||||
|
||||
@@ -32,10 +32,10 @@
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
|
||||
|
||||
typedef struct {
|
||||
struct HTMLDOMTextNode {
|
||||
HTMLDOMNode node;
|
||||
const IHTMLDOMTextNodeVtbl *lpIHTMLDOMTextNodeVtbl;
|
||||
} HTMLDOMTextNode;
|
||||
};
|
||||
|
||||
#define HTMLTEXT(x) ((IHTMLDOMTextNode*) &(x)->lpIHTMLDOMTextNodeVtbl)
|
||||
|
||||
@@ -68,16 +68,14 @@ static ULONG WINAPI HTMLDOMTextNode_Release(IHTMLDOMTextNode *iface)
|
||||
static HRESULT WINAPI HTMLDOMTextNode_GetTypeInfoCount(IHTMLDOMTextNode *iface, UINT *pctinfo)
|
||||
{
|
||||
HTMLDOMTextNode *This = HTMLTEXT_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, pctinfo);
|
||||
return E_NOTIMPL;
|
||||
return IDispatchEx_GetTypeInfoCount(DISPATCHEX(&This->node.dispex), pctinfo);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLDOMTextNode_GetTypeInfo(IHTMLDOMTextNode *iface, UINT iTInfo,
|
||||
LCID lcid, ITypeInfo **ppTInfo)
|
||||
{
|
||||
HTMLDOMTextNode *This = HTMLTEXT_THIS(iface);
|
||||
FIXME("(%p)->(%u %u %p)\n", This, iTInfo, lcid, ppTInfo);
|
||||
return E_NOTIMPL;
|
||||
return IDispatchEx_GetTypeInfo(DISPATCHEX(&This->node.dispex), iTInfo, lcid, ppTInfo);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLDOMTextNode_GetIDsOfNames(IHTMLDOMTextNode *iface, REFIID riid,
|
||||
@@ -85,9 +83,7 @@ static HRESULT WINAPI HTMLDOMTextNode_GetIDsOfNames(IHTMLDOMTextNode *iface, REF
|
||||
LCID lcid, DISPID *rgDispId)
|
||||
{
|
||||
HTMLDOMTextNode *This = HTMLTEXT_THIS(iface);
|
||||
FIXME("(%p)->(%s %p %u %u %p)\n", This, debugstr_guid(riid), rgszNames, cNames,
|
||||
lcid, rgDispId);
|
||||
return E_NOTIMPL;
|
||||
return IDispatchEx_GetIDsOfNames(DISPATCHEX(&This->node.dispex), riid, rgszNames, cNames, lcid, rgDispId);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLDOMTextNode_Invoke(IHTMLDOMTextNode *iface, DISPID dispIdMember,
|
||||
@@ -95,9 +91,8 @@ static HRESULT WINAPI HTMLDOMTextNode_Invoke(IHTMLDOMTextNode *iface, DISPID dis
|
||||
VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
|
||||
{
|
||||
HTMLDOMTextNode *This = HTMLTEXT_THIS(iface);
|
||||
FIXME("(%p)->(%d %s %d %d %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid),
|
||||
lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
|
||||
return E_NOTIMPL;
|
||||
return IDispatchEx_Invoke(DISPATCHEX(&This->node.dispex), dispIdMember, riid, lcid, wFlags, pDispParams,
|
||||
pVarResult, pExcepInfo, puArgErr);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLDOMTextNode_put_data(IHTMLDOMTextNode *iface, BSTR v)
|
||||
@@ -154,7 +149,7 @@ static const IHTMLDOMTextNodeVtbl HTMLDOMTextNodeVtbl = {
|
||||
|
||||
#define HTMLTEXT_NODE_THIS(iface) DEFINE_THIS2(HTMLDOMTextNode, node, iface)
|
||||
|
||||
HRESULT HTMLDOMTextNode_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
|
||||
static HRESULT HTMLDOMTextNode_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
|
||||
{
|
||||
HTMLDOMTextNode *This = HTMLTEXT_NODE_THIS(iface);
|
||||
|
||||
@@ -171,7 +166,7 @@ HRESULT HTMLDOMTextNode_QI(HTMLDOMNode *iface, REFIID riid, void **ppv)
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
void HTMLDOMTextNode_destructor(HTMLDOMNode *iface)
|
||||
static void HTMLDOMTextNode_destructor(HTMLDOMNode *iface)
|
||||
{
|
||||
HTMLDOMTextNode *This = HTMLTEXT_NODE_THIS(iface);
|
||||
|
||||
|
||||
@@ -248,8 +248,15 @@ static HRESULT WINAPI HTMLWindow2_get_Image(IHTMLWindow2 *iface, IHTMLImageEleme
|
||||
static HRESULT WINAPI HTMLWindow2_get_location(IHTMLWindow2 *iface, IHTMLLocation **p)
|
||||
{
|
||||
HTMLWindow *This = HTMLWINDOW2_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
|
||||
TRACE("(%p)->(%p)\n", This, p);
|
||||
|
||||
if(!This->doc) {
|
||||
FIXME("This->doc is NULL\n");
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
return IHTMLDocument2_get_location(HTMLDOC(This->doc), p);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLWindow2_get_history(IHTMLWindow2 *iface, IOmHistory **p)
|
||||
@@ -504,8 +511,13 @@ static HRESULT WINAPI HTMLWindow2_get_document(IHTMLWindow2 *iface, IHTMLDocumen
|
||||
static HRESULT WINAPI HTMLWindow2_get_event(IHTMLWindow2 *iface, IHTMLEventObj **p)
|
||||
{
|
||||
HTMLWindow *This = HTMLWINDOW2_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
|
||||
TRACE("(%p)->(%p)\n", This, p);
|
||||
|
||||
if(This->event)
|
||||
IHTMLEventObj_AddRef(This->event);
|
||||
*p = This->event;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI HTMLWindow2_get__newEnum(IHTMLWindow2 *iface, IUnknown **p)
|
||||
@@ -1177,131 +1189,31 @@ static dispex_static_data_t HTMLWindow_dispex = {
|
||||
HTMLWindow_iface_tids
|
||||
};
|
||||
|
||||
static const char wineConfig_func[] =
|
||||
"window.__defineGetter__(\"external\",function() {\n"
|
||||
" return window.__wineWindow__.external;\n"
|
||||
"});\n"
|
||||
"window.__wineWindow__ = wineWindow;\n";
|
||||
|
||||
static void astr_to_nswstr(const char *str, nsAString *nsstr)
|
||||
HRESULT HTMLWindow_Create(HTMLDocument *doc, nsIDOMWindow *nswindow, HTMLWindow **ret)
|
||||
{
|
||||
LPWSTR wstr;
|
||||
int len;
|
||||
HTMLWindow *window;
|
||||
|
||||
len = MultiByteToWideChar(CP_ACP, 0, str, -1, NULL, 0);
|
||||
wstr = heap_alloc(len*sizeof(WCHAR));
|
||||
MultiByteToWideChar(CP_ACP, 0, str, -1, wstr, len);
|
||||
window = heap_alloc_zero(sizeof(HTMLWindow));
|
||||
if(!window)
|
||||
return E_OUTOFMEMORY;
|
||||
|
||||
nsAString_Init(nsstr, wstr);
|
||||
window->lpHTMLWindow2Vtbl = &HTMLWindow2Vtbl;
|
||||
window->lpHTMLWindow3Vtbl = &HTMLWindow3Vtbl;
|
||||
window->lpIDispatchExVtbl = &WindowDispExVtbl;
|
||||
window->ref = 1;
|
||||
window->doc = doc;
|
||||
|
||||
heap_free(wstr);
|
||||
}
|
||||
init_dispex(&window->dispex, (IUnknown*)HTMLWINDOW2(window), &HTMLWindow_dispex);
|
||||
|
||||
static nsresult call_js_func(nsIScriptContainer *script_container, nsISupports *target,
|
||||
const char *name, const char *body,
|
||||
PRUint32 argc, const char **arg_names, nsIArray *argv)
|
||||
{
|
||||
nsACString name_str;
|
||||
nsAString body_str;
|
||||
JSObject func_obj, jsglobal;
|
||||
nsIVariant *jsret;
|
||||
nsresult nsres;
|
||||
|
||||
nsres = nsIScriptContainer_GetGlobalObject(script_container, &jsglobal);
|
||||
if(NS_FAILED(nsres))
|
||||
ERR("GetGlobalObject: %08x\n", nsres);
|
||||
|
||||
nsACString_Init(&name_str, name);
|
||||
astr_to_nswstr(body, &body_str);
|
||||
|
||||
nsres = nsIScriptContainer_CompileFunction(script_container, jsglobal, &name_str, argc, arg_names,
|
||||
&body_str, NULL, 1, FALSE, &func_obj);
|
||||
|
||||
nsACString_Finish(&name_str);
|
||||
nsAString_Finish(&body_str);
|
||||
|
||||
if(NS_FAILED(nsres)) {
|
||||
ERR("CompileFunction failed: %08x\n", nsres);
|
||||
return nsres;
|
||||
if(nswindow) {
|
||||
nsIDOMWindow_AddRef(nswindow);
|
||||
window->nswindow = nswindow;
|
||||
}
|
||||
|
||||
nsres = nsIScriptContainer_CallFunction(script_container, target, jsglobal, func_obj, argv, &jsret);
|
||||
list_add_head(&window_list, &window->entry);
|
||||
|
||||
nsIScriptContainer_DropScriptObject(script_container, func_obj);
|
||||
nsIScriptContainer_DropScriptObject(script_container, jsglobal);
|
||||
if(NS_FAILED(nsres)) {
|
||||
ERR("CallFunction failed: %08x\n", nsres);
|
||||
return nsres;
|
||||
}
|
||||
|
||||
nsIVariant_Release(jsret);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
void setup_nswindow(HTMLWindow *This)
|
||||
{
|
||||
nsIScriptContainer *script_container;
|
||||
nsIDOMWindow *nswindow;
|
||||
nsIDOMDocument *domdoc;
|
||||
nsIWritableVariant *nsvar;
|
||||
nsIMutableArray *argv;
|
||||
nsresult nsres;
|
||||
|
||||
static const char *args[] = {"wineWindow"};
|
||||
|
||||
TRACE("(%p)\n", This);
|
||||
|
||||
nsIWebNavigation_GetDocument(This->doc->nscontainer->navigation, &domdoc);
|
||||
nsres = nsIDOMDocument_QueryInterface(domdoc, &IID_nsIScriptContainer, (void**)&script_container);
|
||||
nsIDOMDocument_Release(domdoc);
|
||||
if(NS_FAILED(nsres)) {
|
||||
TRACE("Could not get nsIDOMScriptContainer: %08x\n", nsres);
|
||||
return;
|
||||
}
|
||||
|
||||
nsIWebBrowser_GetContentDOMWindow(This->doc->nscontainer->webbrowser, &nswindow);
|
||||
|
||||
nsvar = create_nsvariant();
|
||||
nsres = nsIWritableVariant_SetAsInterface(nsvar, &IID_IDispatch, HTMLWINDOW2(This));
|
||||
if(NS_FAILED(nsres))
|
||||
ERR("SetAsInterface failed: %08x\n", nsres);
|
||||
|
||||
argv = create_nsarray();
|
||||
nsres = nsIMutableArray_AppendElement(argv, (nsISupports*)nsvar, FALSE);
|
||||
nsIWritableVariant_Release(nsvar);
|
||||
if(NS_FAILED(nsres))
|
||||
ERR("AppendElement failed: %08x\n", nsres);
|
||||
|
||||
call_js_func(script_container, (nsISupports*)nswindow/*HTMLWINDOW2(This)*/, "wineConfig",
|
||||
wineConfig_func, 1, args, (nsIArray*)argv);
|
||||
|
||||
nsIMutableArray_Release(argv);
|
||||
nsIScriptContainer_Release(script_container);
|
||||
}
|
||||
|
||||
HTMLWindow *HTMLWindow_Create(HTMLDocument *doc)
|
||||
{
|
||||
HTMLWindow *ret = heap_alloc_zero(sizeof(HTMLWindow));
|
||||
|
||||
ret->lpHTMLWindow2Vtbl = &HTMLWindow2Vtbl;
|
||||
ret->lpHTMLWindow3Vtbl = &HTMLWindow3Vtbl;
|
||||
ret->lpIDispatchExVtbl = &WindowDispExVtbl;
|
||||
ret->ref = 1;
|
||||
ret->doc = doc;
|
||||
|
||||
init_dispex(&ret->dispex, (IUnknown*)HTMLWINDOW2(ret), &HTMLWindow_dispex);
|
||||
|
||||
if(doc->nscontainer) {
|
||||
nsresult nsres;
|
||||
|
||||
nsres = nsIWebBrowser_GetContentDOMWindow(doc->nscontainer->webbrowser, &ret->nswindow);
|
||||
if(NS_FAILED(nsres))
|
||||
ERR("GetContentDOMWindow failed: %08x\n", nsres);
|
||||
}
|
||||
|
||||
list_add_head(&window_list, &ret->entry);
|
||||
|
||||
return ret;
|
||||
*ret = window;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
HTMLWindow *nswindow_to_window(const nsIDOMWindow *nswindow)
|
||||
|
||||
@@ -381,12 +381,13 @@ static HRESULT WINAPI InstallCallback_OnDataAvailable(IBindStatusCallback *iface
|
||||
BYTE buf[1024];
|
||||
DWORD size;
|
||||
HRESULT hres;
|
||||
DWORD dwBytesWritten;
|
||||
|
||||
do {
|
||||
size = 0;
|
||||
hres = IStream_Read(str, buf, sizeof(buf), &size);
|
||||
if(size)
|
||||
WriteFile(tmp_file, buf, size, NULL, NULL);
|
||||
WriteFile(tmp_file, buf, size, &dwBytesWritten, NULL);
|
||||
}while(hres == S_OK);
|
||||
|
||||
return S_OK;
|
||||
|
||||
@@ -44,7 +44,6 @@
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
|
||||
|
||||
HINSTANCE hInst;
|
||||
LONG module_ref = 0;
|
||||
DWORD mshtml_tls = 0;
|
||||
|
||||
static HINSTANCE shdoclc = NULL;
|
||||
@@ -141,7 +140,6 @@ static ULONG WINAPI ClassFactory_Release(IClassFactory *iface)
|
||||
|
||||
if(!ref) {
|
||||
heap_free(This);
|
||||
UNLOCK_MODULE();
|
||||
}
|
||||
|
||||
return ref;
|
||||
@@ -158,11 +156,7 @@ static HRESULT WINAPI ClassFactory_LockServer(IClassFactory *iface, BOOL dolock)
|
||||
{
|
||||
TRACE("(%p)->(%x)\n", iface, dolock);
|
||||
|
||||
if(dolock)
|
||||
LOCK_MODULE();
|
||||
else
|
||||
UNLOCK_MODULE();
|
||||
|
||||
/* We never unload the DLL. See DllCanUnloadNow(). */
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -184,9 +178,7 @@ static HRESULT ClassFactory_Create(REFIID riid, void **ppv, CreateInstanceFunc f
|
||||
ret->fnCreateInstance = fnCreateInstance;
|
||||
|
||||
hres = IClassFactory_QueryInterface((IClassFactory*)ret, riid, ppv);
|
||||
if(SUCCEEDED(hres)) {
|
||||
LOCK_MODULE();
|
||||
}else {
|
||||
if(FAILED(hres)) {
|
||||
heap_free(ret);
|
||||
*ppv = NULL;
|
||||
}
|
||||
@@ -230,8 +222,9 @@ HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, LPVOID *ppv)
|
||||
*/
|
||||
HRESULT WINAPI DllCanUnloadNow(void)
|
||||
{
|
||||
TRACE("() ref=%d\n", module_ref);
|
||||
return module_ref ? S_FALSE : S_OK;
|
||||
TRACE("()\n");
|
||||
/* The cost of keeping this DLL in memory is small. */
|
||||
return S_FALSE;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
@@ -318,7 +311,7 @@ static HRESULT register_server(BOOL do_register)
|
||||
STRTABLEA strtable;
|
||||
STRENTRYA pse[35];
|
||||
static CLSID const *clsids[35];
|
||||
int i = 0;
|
||||
unsigned int i = 0;
|
||||
|
||||
static const WCHAR wszAdvpack[] = {'a','d','v','p','a','c','k','.','d','l','l',0};
|
||||
|
||||
@@ -423,3 +416,25 @@ HRESULT WINAPI DllUnregisterServer(void)
|
||||
{
|
||||
return register_server(FALSE);
|
||||
}
|
||||
|
||||
const char *debugstr_variant(const VARIANT *v)
|
||||
{
|
||||
switch(V_VT(v)) {
|
||||
case VT_EMPTY:
|
||||
return wine_dbg_sprintf("{VT_EMPTY}");
|
||||
case VT_NULL:
|
||||
return wine_dbg_sprintf("{VT_NULL}");
|
||||
case VT_I4:
|
||||
return wine_dbg_sprintf("{VT_I4: %d}", V_I4(v));
|
||||
case VT_R8:
|
||||
return wine_dbg_sprintf("{VT_R8: %lf}", V_R8(v));
|
||||
case VT_BSTR:
|
||||
return wine_dbg_sprintf("{VT_BSTR: %s}", debugstr_w(V_BSTR(v)));
|
||||
case VT_DISPATCH:
|
||||
return wine_dbg_sprintf("{VT_DISPATCH: %p}", V_DISPATCH(v));
|
||||
case VT_BOOL:
|
||||
return wine_dbg_sprintf("{VT_BOOL: %x}", V_BOOL(v));
|
||||
default:
|
||||
return wine_dbg_sprintf("{vt %d}", V_VT(v));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,13 +14,17 @@
|
||||
<file>htmlanchor.c</file>
|
||||
<file>htmlbody.c</file>
|
||||
<file>htmlcomment.c</file>
|
||||
<file>htmlcurstyle.c</file>
|
||||
<file>htmldoc.c</file>
|
||||
<file>htmldoc3.c</file>
|
||||
<file>htmldoc5.c</file>
|
||||
<file>htmlelem.c</file>
|
||||
<file>htmlelem2.c</file>
|
||||
<file>htmlelem3.c</file>
|
||||
<file>htmlelemcol.c</file>
|
||||
<file>htmlevent.c</file>
|
||||
<file>htmlgeneric.c</file>
|
||||
<file>htmliframe.c</file>
|
||||
<file>htmlimg.c</file>
|
||||
<file>htmlinput.c</file>
|
||||
<file>htmllocation.c</file>
|
||||
@@ -29,8 +33,10 @@
|
||||
<file>htmlscript.c</file>
|
||||
<file>htmlselect.c</file>
|
||||
<file>htmlstyle.c</file>
|
||||
<file>htmlstyle2.c</file>
|
||||
<file>htmlstylesheet.c</file>
|
||||
<file>htmltable.c</file>
|
||||
<file>htmltablerow.c</file>
|
||||
<file>htmltextarea.c</file>
|
||||
<file>htmltextcont.c</file>
|
||||
<file>htmltextnode.c</file>
|
||||
@@ -38,6 +44,7 @@
|
||||
<file>install.c</file>
|
||||
<file>loadopts.c</file>
|
||||
<file>main.c</file>
|
||||
<file>mutation.c</file>
|
||||
<file>navigate.c</file>
|
||||
<file>nsembed.c</file>
|
||||
<file>nsevents.c</file>
|
||||
|
||||
@@ -61,24 +61,29 @@ typedef struct event_target_t event_target_t;
|
||||
/* NOTE: make sure to keep in sync with dispex.c */
|
||||
typedef enum {
|
||||
NULL_tid,
|
||||
DispCEventObj_tid,
|
||||
DispDOMChildrenCollection_tid,
|
||||
DispHTMLBody_tid,
|
||||
DispHTMLCommentElement_tid,
|
||||
DispHTMLCurrentStyle_tid,
|
||||
DispHTMLDocument_tid,
|
||||
DispHTMLDOMTextNode_tid,
|
||||
DispHTMLElementCollection_tid,
|
||||
DispHTMLGenericElement_tid,
|
||||
DispHTMLIFrame_tid,
|
||||
DispHTMLImg_tid,
|
||||
DispHTMLInputElement_tid,
|
||||
DispHTMLOptionElement_tid,
|
||||
DispHTMLSelectElement_tid,
|
||||
DispHTMLStyle_tid,
|
||||
DispHTMLTable_tid,
|
||||
DispHTMLTableRow_tid,
|
||||
DispHTMLUnknownElement_tid,
|
||||
DispHTMLWindow2_tid,
|
||||
IHTMLBodyElement_tid,
|
||||
IHTMLBodyElement2_tid,
|
||||
IHTMLCommentElement_tid,
|
||||
IHTMLControlElement_tid,
|
||||
IHTMLCurrentStyle_tid,
|
||||
IHTMLDocument2_tid,
|
||||
IHTMLDocument3_tid,
|
||||
IHTMLDocument4_tid,
|
||||
@@ -92,12 +97,18 @@ typedef enum {
|
||||
IHTMLElement3_tid,
|
||||
IHTMLElement4_tid,
|
||||
IHTMLElementCollection_tid,
|
||||
IHTMLEventObj_tid,
|
||||
IHTMLFrameBase2_tid,
|
||||
IHTMLGenericElement_tid,
|
||||
IHTMLImgElement_tid,
|
||||
IHTMLInputElement_tid,
|
||||
IHTMLLocation_tid,
|
||||
IHTMLOptionElement_tid,
|
||||
IHTMLSelectElement_tid,
|
||||
IHTMLStyle_tid,
|
||||
IHTMLStyle2_tid,
|
||||
IHTMLTable_tid,
|
||||
IHTMLTableRow_tid,
|
||||
IHTMLTextContainer_tid,
|
||||
IHTMLUniqueName_tid,
|
||||
IHTMLWindow2_tid,
|
||||
@@ -106,14 +117,6 @@ typedef enum {
|
||||
LAST_tid
|
||||
} tid_t;
|
||||
|
||||
typedef enum {
|
||||
EVENTID_CHANGE,
|
||||
EVENTID_CLICK,
|
||||
EVENTID_KEYUP,
|
||||
EVENTID_LOAD,
|
||||
EVENTID_LAST
|
||||
} eventid_t;
|
||||
|
||||
typedef struct dispex_data_t dispex_data_t;
|
||||
typedef struct dispex_dynamic_data_t dispex_dynamic_data_t;
|
||||
|
||||
@@ -143,6 +146,7 @@ typedef struct {
|
||||
|
||||
void init_dispex(DispatchEx*,IUnknown*,dispex_static_data_t*);
|
||||
BOOL dispex_query_interface(DispatchEx*,REFIID,void**);
|
||||
HRESULT dispex_get_dprop_ref(DispatchEx*,const WCHAR*,BOOL,VARIANT**);
|
||||
|
||||
typedef struct {
|
||||
DispatchEx dispex;
|
||||
@@ -166,6 +170,11 @@ typedef enum {
|
||||
EDITMODE
|
||||
} USERMODE;
|
||||
|
||||
typedef enum {
|
||||
SCRIPTMODE_GECKO,
|
||||
SCRIPTMODE_ACTIVESCRIPT
|
||||
} SCRIPTMODE;
|
||||
|
||||
typedef struct {
|
||||
const IConnectionPointContainerVtbl *lpConnectionPointContainerVtbl;
|
||||
|
||||
@@ -191,6 +200,7 @@ struct ConnectionPoint {
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
DispatchEx dispex;
|
||||
const IHTMLLocationVtbl *lpHTMLLocationVtbl;
|
||||
|
||||
LONG ref;
|
||||
@@ -228,11 +238,12 @@ struct HTMLDocument {
|
||||
const IPersistStreamInitVtbl *lpPersistStreamInitVtbl;
|
||||
const ICustomDocVtbl *lpCustomDocVtbl;
|
||||
const IDispatchExVtbl *lpIDispatchExVtbl;
|
||||
|
||||
const ISupportErrorInfoVtbl *lpSupportErrorInfoVtbl;
|
||||
LONG ref;
|
||||
|
||||
NSContainer *nscontainer;
|
||||
HTMLWindow *window;
|
||||
nsIDOMHTMLDocument *nsdoc;
|
||||
|
||||
IOleClientSite *client;
|
||||
IDocHostUIHandler *hostui;
|
||||
@@ -255,6 +266,7 @@ struct HTMLDocument {
|
||||
DOCHOSTUIINFO hostinfo;
|
||||
|
||||
USERMODE usermode;
|
||||
SCRIPTMODE scriptmode;
|
||||
READYSTATE readystate;
|
||||
BOOL in_place_active;
|
||||
BOOL ui_active;
|
||||
@@ -266,6 +278,7 @@ struct HTMLDocument {
|
||||
|
||||
DWORD update;
|
||||
|
||||
event_target_t *event_target;
|
||||
ConnectionPointContainer cp_container;
|
||||
ConnectionPoint cp_htmldocevents;
|
||||
ConnectionPoint cp_htmldocevents2;
|
||||
@@ -285,6 +298,13 @@ typedef struct {
|
||||
NSContainer *This;
|
||||
} nsEventListener;
|
||||
|
||||
typedef struct _mutation_queue_t {
|
||||
DWORD type;
|
||||
nsISupports *nsiface;
|
||||
|
||||
struct _mutation_queue_t *next;
|
||||
} mutation_queue_t;
|
||||
|
||||
struct NSContainer {
|
||||
const nsIWebBrowserChromeVtbl *lpWebBrowserChromeVtbl;
|
||||
const nsIContextMenuListenerVtbl *lpContextMenuListenerVtbl;
|
||||
@@ -295,11 +315,14 @@ struct NSContainer {
|
||||
const nsIWeakReferenceVtbl *lpWeakReferenceVtbl;
|
||||
const nsISupportsWeakReferenceVtbl *lpSupportsWeakReferenceVtbl;
|
||||
|
||||
const nsIDocumentObserverVtbl *lpDocumentObserverVtbl;
|
||||
|
||||
const nsIRunnableVtbl *lpRunnableVtbl;
|
||||
|
||||
nsEventListener blur_listener;
|
||||
nsEventListener focus_listener;
|
||||
nsEventListener keypress_listener;
|
||||
nsEventListener load_listener;
|
||||
nsEventListener node_insert_listener;
|
||||
nsEventListener htmlevent_listener;
|
||||
|
||||
nsIWebBrowser *webbrowser;
|
||||
@@ -319,10 +342,13 @@ struct NSContainer {
|
||||
|
||||
HWND hwnd;
|
||||
|
||||
mutation_queue_t *mutation_queue;
|
||||
mutation_queue_t *mutation_queue_tail;
|
||||
|
||||
nsChannelBSC *bscallback; /* hack */
|
||||
HWND reset_focus; /* hack */
|
||||
|
||||
BOOL event_vector[EVENTID_LAST];
|
||||
BOOL *event_vector;
|
||||
};
|
||||
|
||||
typedef struct {
|
||||
@@ -337,6 +363,7 @@ typedef struct {
|
||||
nsIInputStream *post_data_stream;
|
||||
nsILoadGroup *load_group;
|
||||
nsIInterfaceRequestor *notif_callback;
|
||||
nsISupports *owner;
|
||||
nsLoadFlags load_flags;
|
||||
nsIURI *original_uri;
|
||||
char *content_type;
|
||||
@@ -346,6 +373,8 @@ typedef struct {
|
||||
typedef struct {
|
||||
HRESULT (*qi)(HTMLDOMNode*,REFIID,void**);
|
||||
void (*destructor)(HTMLDOMNode*);
|
||||
HRESULT (*put_disabled)(HTMLDOMNode*,VARIANT_BOOL);
|
||||
HRESULT (*get_disabled)(HTMLDOMNode*,VARIANT_BOOL*);
|
||||
} NodeImplVtbl;
|
||||
|
||||
struct HTMLDOMNode {
|
||||
@@ -369,6 +398,7 @@ typedef struct {
|
||||
|
||||
const IHTMLElementVtbl *lpHTMLElementVtbl;
|
||||
const IHTMLElement2Vtbl *lpHTMLElement2Vtbl;
|
||||
const IHTMLElement3Vtbl *lpHTMLElement3Vtbl;
|
||||
|
||||
nsIDOMHTMLElement *nselem;
|
||||
} HTMLElement;
|
||||
@@ -419,6 +449,10 @@ typedef struct {
|
||||
#define NSWEAKREF(x) ((nsIWeakReference*) &(x)->lpWeakReferenceVtbl)
|
||||
#define NSSUPWEAKREF(x) ((nsISupportsWeakReference*) &(x)->lpSupportsWeakReferenceVtbl)
|
||||
|
||||
#define NSDOCOBS(x) ((nsIDocumentObserver*) &(x)->lpDocumentObserverVtbl)
|
||||
|
||||
#define NSRUNNABLE(x) ((nsIRunnable*) &(x)->lpRunnableVtbl)
|
||||
|
||||
#define NSCHANNEL(x) ((nsIChannel*) &(x)->lpHttpChannelVtbl)
|
||||
#define NSHTTPCHANNEL(x) ((nsIHttpChannel*) &(x)->lpHttpChannelVtbl)
|
||||
#define NSUPCHANNEL(x) ((nsIUploadChannel*) &(x)->lpUploadChannelVtbl)
|
||||
@@ -429,6 +463,7 @@ typedef struct {
|
||||
|
||||
#define HTMLELEM(x) ((IHTMLElement*) &(x)->lpHTMLElementVtbl)
|
||||
#define HTMLELEM2(x) ((IHTMLElement2*) &(x)->lpHTMLElement2Vtbl)
|
||||
#define HTMLELEM3(x) ((IHTMLElement3*) &(x)->lpHTMLElement3Vtbl)
|
||||
#define HTMLDOMNODE(x) ((IHTMLDOMNode*) &(x)->lpHTMLDOMNodeVtbl)
|
||||
#define HTMLDOMNODE2(x) ((IHTMLDOMNode2*) &(x)->lpHTMLDOMNode2Vtbl)
|
||||
|
||||
@@ -439,18 +474,20 @@ typedef struct {
|
||||
|
||||
#define DISPATCHEX(x) ((IDispatchEx*) &(x)->lpIDispatchExVtbl)
|
||||
|
||||
#define SUPPERRINFO(x) ((ISupportErrorInfo*) &(x)->lpSupportErrorInfoVtbl)
|
||||
|
||||
#define DEFINE_THIS2(cls,ifc,iface) ((cls*)((BYTE*)(iface)-offsetof(cls,ifc)))
|
||||
#define DEFINE_THIS(cls,ifc,iface) DEFINE_THIS2(cls,lp ## ifc ## Vtbl,iface)
|
||||
|
||||
HRESULT HTMLDocument_Create(IUnknown*,REFIID,void**);
|
||||
HRESULT HTMLLoadOptions_Create(IUnknown*,REFIID,void**);
|
||||
HRESULT create_doc_from_nsdoc(nsIDOMHTMLDocument*,HTMLDocument**);
|
||||
|
||||
HTMLWindow *HTMLWindow_Create(HTMLDocument*);
|
||||
HRESULT HTMLWindow_Create(HTMLDocument*,nsIDOMWindow*,HTMLWindow**);
|
||||
HTMLWindow *nswindow_to_window(const nsIDOMWindow*);
|
||||
HTMLOptionElementFactory *HTMLOptionElementFactory_Create(HTMLDocument*);
|
||||
HTMLLocation *HTMLLocation_Create(HTMLDocument*);
|
||||
IOmNavigator *OmNavigator_Create(void);
|
||||
void setup_nswindow(HTMLWindow*);
|
||||
|
||||
void HTMLDocument_HTMLDocument3_Init(HTMLDocument*);
|
||||
void HTMLDocument_HTMLDocument5_Init(HTMLDocument*);
|
||||
@@ -462,6 +499,8 @@ void HTMLDocument_Window_Init(HTMLDocument*);
|
||||
void HTMLDocument_Service_Init(HTMLDocument*);
|
||||
void HTMLDocument_Hlink_Init(HTMLDocument*);
|
||||
|
||||
HRESULT HTMLCurrentStyle_Create(HTMLElement*,IHTMLCurrentStyle**);
|
||||
|
||||
void ConnectionPoint_Init(ConnectionPoint*,ConnectionPointContainer*,REFIID);
|
||||
void ConnectionPointContainer_Init(ConnectionPointContainer*,IUnknown*);
|
||||
void ConnectionPointContainer_Destroy(ConnectionPointContainer*);
|
||||
@@ -469,6 +508,9 @@ void ConnectionPointContainer_Destroy(ConnectionPointContainer*);
|
||||
NSContainer *NSContainer_Create(HTMLDocument*,NSContainer*);
|
||||
void NSContainer_Release(NSContainer*);
|
||||
|
||||
void init_mutation(NSContainer*);
|
||||
void set_mutation_observer(NSContainer*,nsIDOMHTMLDocument*);
|
||||
|
||||
void HTMLDocument_LockContainer(HTMLDocument*,BOOL);
|
||||
void show_context_menu(HTMLDocument*,DWORD,POINT*,IDispatch*);
|
||||
void notif_focus(HTMLDocument*);
|
||||
@@ -483,8 +525,11 @@ BOOL load_gecko(BOOL);
|
||||
void close_gecko(void);
|
||||
void register_nsservice(nsIComponentRegistrar*,nsIServiceManager*);
|
||||
void init_nsio(nsIComponentManager*,nsIComponentRegistrar*);
|
||||
void release_nsio(void);
|
||||
BOOL install_wine_gecko(BOOL);
|
||||
|
||||
HRESULT nsuri_to_url(LPCWSTR,BSTR*);
|
||||
|
||||
void hlink_frame_navigate(HTMLDocument*,IHlinkFrame*,LPCWSTR,nsIInputStream*,DWORD);
|
||||
|
||||
void call_property_onchanged(ConnectionPoint*,DISPID);
|
||||
@@ -505,19 +550,12 @@ void nsAString_Finish(nsAString*);
|
||||
|
||||
nsIInputStream *create_nsstream(const char*,PRInt32);
|
||||
nsICommandParams *create_nscommand_params(void);
|
||||
nsIMutableArray *create_nsarray(void);
|
||||
nsIWritableVariant *create_nsvariant(void);
|
||||
void nsnode_to_nsstring(nsIDOMNode*,nsAString*);
|
||||
void get_editor_controller(NSContainer*);
|
||||
void init_nsevents(NSContainer*);
|
||||
void add_nsevent_listener(NSContainer*,LPCWSTR);
|
||||
nsresult get_nsinterface(nsISupports*,REFIID,void**);
|
||||
|
||||
void check_event_attr(HTMLDocument*,nsIDOMElement*);
|
||||
void release_event_target(event_target_t*);
|
||||
void fire_event(HTMLDocument*,eventid_t,nsIDOMNode*);
|
||||
HRESULT set_node_event(HTMLDOMNode*,eventid_t,VARIANT*);
|
||||
eventid_t str_to_eid(LPCWSTR);
|
||||
void update_nsdocument(HTMLDocument*);
|
||||
|
||||
void set_document_bscallback(HTMLDocument*,nsChannelBSC*);
|
||||
void set_current_mon(HTMLDocument*,IMoniker*);
|
||||
@@ -538,6 +576,7 @@ IHTMLStyleSheetsCollection *HTMLStyleSheetsCollection_Create(nsIDOMStyleSheetLis
|
||||
|
||||
void detach_selection(HTMLDocument*);
|
||||
void detach_ranges(HTMLDocument*);
|
||||
HRESULT get_node_text(HTMLDOMNode*,BSTR*);
|
||||
|
||||
HTMLDOMNode *HTMLDOMTextNode_Create(HTMLDocument*,nsIDOMNode*);
|
||||
|
||||
@@ -545,18 +584,21 @@ HTMLElement *HTMLElement_Create(HTMLDocument*,nsIDOMNode*,BOOL);
|
||||
HTMLElement *HTMLCommentElement_Create(HTMLDocument*,nsIDOMNode*);
|
||||
HTMLElement *HTMLAnchorElement_Create(nsIDOMHTMLElement*);
|
||||
HTMLElement *HTMLBodyElement_Create(nsIDOMHTMLElement*);
|
||||
HTMLElement *HTMLIFrame_Create(nsIDOMHTMLElement*);
|
||||
HTMLElement *HTMLImgElement_Create(nsIDOMHTMLElement*);
|
||||
HTMLElement *HTMLInputElement_Create(nsIDOMHTMLElement*);
|
||||
HTMLElement *HTMLOptionElement_Create(nsIDOMHTMLElement*);
|
||||
HTMLElement *HTMLScriptElement_Create(nsIDOMHTMLElement*);
|
||||
HTMLElement *HTMLSelectElement_Create(nsIDOMHTMLElement*);
|
||||
HTMLElement *HTMLTable_Create(nsIDOMHTMLElement*);
|
||||
HTMLElement *HTMLTableRow_Create(nsIDOMHTMLElement*);
|
||||
HTMLElement *HTMLTextAreaElement_Create(nsIDOMHTMLElement*);
|
||||
HTMLElement *HTMLGenericElement_Create(nsIDOMHTMLElement*);
|
||||
|
||||
void HTMLDOMNode_Init(HTMLDocument*,HTMLDOMNode*,nsIDOMNode*);
|
||||
void HTMLElement_Init(HTMLElement*);
|
||||
void HTMLElement2_Init(HTMLElement*);
|
||||
void HTMLElement3_Init(HTMLElement*);
|
||||
void HTMLTextContainer_Init(HTMLTextContainer*);
|
||||
|
||||
HRESULT HTMLDOMNode_QI(HTMLDOMNode*,REFIID,void**);
|
||||
@@ -572,9 +614,11 @@ void release_script_hosts(HTMLDocument*);
|
||||
void connect_scripts(HTMLDocument*);
|
||||
void doc_insert_script(HTMLDocument*,nsIDOMHTMLScriptElement*);
|
||||
IDispatch *script_parse_event(HTMLDocument*,LPCWSTR);
|
||||
void set_script_mode(HTMLDocument*,SCRIPTMODE);
|
||||
|
||||
IHTMLElementCollection *create_all_collection(HTMLDOMNode*);
|
||||
IHTMLElementCollection *create_all_collection(HTMLDOMNode*,BOOL);
|
||||
IHTMLElementCollection *create_collection_from_nodelist(HTMLDocument*,IUnknown*,nsIDOMNodeList*);
|
||||
IHTMLElementCollection *create_collection_from_htmlcol(HTMLDocument*,IUnknown*,nsIDOMHTMLCollection*);
|
||||
|
||||
/* commands */
|
||||
typedef struct {
|
||||
@@ -636,9 +680,10 @@ void remove_doc_tasks(const HTMLDocument*);
|
||||
DWORD set_task_timer(HTMLDocument*,DWORD,BOOL,IDispatch*);
|
||||
HRESULT clear_task_timer(HTMLDocument*,BOOL,DWORD);
|
||||
|
||||
HRESULT get_typeinfo(tid_t,ITypeInfo**);
|
||||
void release_typelib(void);
|
||||
void call_disp_func(HTMLDocument*,IDispatch*);
|
||||
void call_disp_func(HTMLDocument*,IDispatch*,IDispatch*);
|
||||
|
||||
const char *debugstr_variant(const VARIANT*);
|
||||
|
||||
DEFINE_GUID(CLSID_AboutProtocol, 0x3050F406, 0x98B5, 0x11CF, 0xBB,0x82, 0x00,0xAA,0x00,0xBD,0xCE,0x0B);
|
||||
DEFINE_GUID(CLSID_JSProtocol, 0x3050F3B2, 0x98B5, 0x11CF, 0xBB,0x82, 0x00,0xAA,0x00,0xBD,0xCE,0x0B);
|
||||
@@ -648,23 +693,19 @@ DEFINE_GUID(CLSID_SysimageProtocol, 0x76E67A63, 0x06E9, 0x11D2, 0xA8,0x40, 0x00,
|
||||
|
||||
DEFINE_GUID(CLSID_CMarkup,0x3050f4fb,0x98b5,0x11cf,0xbb,0x82,0x00,0xaa,0x00,0xbd,0xce,0x0b);
|
||||
|
||||
extern LONG module_ref;
|
||||
#define LOCK_MODULE() InterlockedIncrement(&module_ref)
|
||||
#define UNLOCK_MODULE() InterlockedDecrement(&module_ref)
|
||||
|
||||
/* memory allocation functions */
|
||||
|
||||
static inline void __WINE_ALLOC_SIZE(1) *heap_alloc(size_t len)
|
||||
static inline void * __WINE_ALLOC_SIZE(1) heap_alloc(size_t len)
|
||||
{
|
||||
return HeapAlloc(GetProcessHeap(), 0, len);
|
||||
}
|
||||
|
||||
static inline void __WINE_ALLOC_SIZE(1) *heap_alloc_zero(size_t len)
|
||||
static inline void * __WINE_ALLOC_SIZE(1) heap_alloc_zero(size_t len)
|
||||
{
|
||||
return HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len);
|
||||
}
|
||||
|
||||
static inline void __WINE_ALLOC_SIZE(2) *heap_realloc(void *mem, size_t len)
|
||||
static inline void * __WINE_ALLOC_SIZE(2) heap_realloc(void *mem, size_t len)
|
||||
{
|
||||
return HeapReAlloc(GetProcessHeap(), 0, mem, len);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,576 @@
|
||||
/*
|
||||
* Copyright 2008 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>
|
||||
|
||||
#define COBJMACROS
|
||||
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#include "winuser.h"
|
||||
#include "winreg.h"
|
||||
#include "ole2.h"
|
||||
|
||||
#include "mshtml_private.h"
|
||||
#include "htmlevent.h"
|
||||
|
||||
#include "wine/debug.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
|
||||
|
||||
enum {
|
||||
MUTATION_COMMENT,
|
||||
MUTATION_SCRIPT
|
||||
};
|
||||
|
||||
void set_mutation_observer(NSContainer *nscontainer, nsIDOMHTMLDocument *nshtmldoc)
|
||||
{
|
||||
nsIDOMNSDocument *nsdoc;
|
||||
nsresult nsres;
|
||||
|
||||
nsres = nsIDOMHTMLDocument_QueryInterface(nshtmldoc, &IID_nsIDOMNSDocument, (void**)&nsdoc);
|
||||
if(NS_FAILED(nsres)) {
|
||||
ERR("Could not get nsIDOMNSDocument: %08x\n", nsres);
|
||||
return;
|
||||
}
|
||||
|
||||
nsIDOMNSDocument_WineAddObserver(nsdoc, NSDOCOBS(nscontainer));
|
||||
nsIDOMNSDocument_Release(nsdoc);
|
||||
}
|
||||
|
||||
#define IE_MAJOR_VERSION 7
|
||||
#define IE_MINOR_VERSION 0
|
||||
|
||||
static BOOL handle_insert_comment(HTMLDocument *doc, const PRUnichar *comment)
|
||||
{
|
||||
DWORD len;
|
||||
int majorv = 0, minorv = 0;
|
||||
const PRUnichar *ptr, *end;
|
||||
nsAString nsstr;
|
||||
PRUnichar *buf;
|
||||
nsresult nsres;
|
||||
|
||||
enum {
|
||||
CMP_EQ,
|
||||
CMP_LT,
|
||||
CMP_LTE,
|
||||
CMP_GT,
|
||||
CMP_GTE
|
||||
} cmpt = CMP_EQ;
|
||||
|
||||
static const PRUnichar endifW[] = {'<','!','[','e','n','d','i','f',']'};
|
||||
|
||||
if(comment[0] != '[' || comment[1] != 'i' || comment[2] != 'f')
|
||||
return FALSE;
|
||||
|
||||
ptr = comment+3;
|
||||
while(isspaceW(*ptr))
|
||||
ptr++;
|
||||
|
||||
if(ptr[0] == 'l' && ptr[1] == 't') {
|
||||
ptr += 2;
|
||||
if(*ptr == 'e') {
|
||||
cmpt = CMP_LTE;
|
||||
ptr++;
|
||||
}else {
|
||||
cmpt = CMP_LT;
|
||||
}
|
||||
}else if(ptr[0] == 'g' && ptr[1] == 't') {
|
||||
ptr += 2;
|
||||
if(*ptr == 'e') {
|
||||
cmpt = CMP_GTE;
|
||||
ptr++;
|
||||
}else {
|
||||
cmpt = CMP_GT;
|
||||
}
|
||||
}
|
||||
|
||||
if(!isspaceW(*ptr++))
|
||||
return FALSE;
|
||||
while(isspaceW(*ptr))
|
||||
ptr++;
|
||||
|
||||
if(ptr[0] != 'I' || ptr[1] != 'E')
|
||||
return FALSE;
|
||||
|
||||
ptr +=2;
|
||||
if(!isspaceW(*ptr++))
|
||||
return FALSE;
|
||||
while(isspaceW(*ptr))
|
||||
ptr++;
|
||||
|
||||
if(!isdigitW(*ptr))
|
||||
return FALSE;
|
||||
while(isdigitW(*ptr))
|
||||
majorv = majorv*10 + (*ptr++ - '0');
|
||||
|
||||
if(*ptr == '.') {
|
||||
ptr++;
|
||||
if(!isdigitW(*ptr))
|
||||
return FALSE;
|
||||
while(isdigitW(*ptr))
|
||||
minorv = minorv*10 + (*ptr++ - '0');
|
||||
}
|
||||
|
||||
while(isspaceW(*ptr))
|
||||
ptr++;
|
||||
if(ptr[0] != ']' || ptr[1] != '>')
|
||||
return FALSE;
|
||||
ptr += 2;
|
||||
|
||||
len = strlenW(ptr);
|
||||
if(len < sizeof(endifW)/sizeof(WCHAR))
|
||||
return FALSE;
|
||||
|
||||
end = ptr + len-sizeof(endifW)/sizeof(WCHAR);
|
||||
if(memcmp(end, endifW, sizeof(endifW)))
|
||||
return FALSE;
|
||||
|
||||
switch(cmpt) {
|
||||
case CMP_EQ:
|
||||
if(majorv == IE_MAJOR_VERSION && minorv == IE_MINOR_VERSION)
|
||||
break;
|
||||
return FALSE;
|
||||
case CMP_LT:
|
||||
if(majorv > IE_MAJOR_VERSION)
|
||||
break;
|
||||
if(majorv == IE_MAJOR_VERSION && minorv > IE_MINOR_VERSION)
|
||||
break;
|
||||
return FALSE;
|
||||
case CMP_LTE:
|
||||
if(majorv > IE_MAJOR_VERSION)
|
||||
break;
|
||||
if(majorv == IE_MAJOR_VERSION && minorv >= IE_MINOR_VERSION)
|
||||
break;
|
||||
return FALSE;
|
||||
case CMP_GT:
|
||||
if(majorv < IE_MAJOR_VERSION)
|
||||
break;
|
||||
if(majorv == IE_MAJOR_VERSION && minorv < IE_MINOR_VERSION)
|
||||
break;
|
||||
return FALSE;
|
||||
case CMP_GTE:
|
||||
if(majorv < IE_MAJOR_VERSION)
|
||||
break;
|
||||
if(majorv == IE_MAJOR_VERSION && minorv <= IE_MINOR_VERSION)
|
||||
break;
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
buf = heap_alloc((end-ptr+1)*sizeof(WCHAR));
|
||||
if(!buf)
|
||||
return FALSE;
|
||||
|
||||
memcpy(buf, ptr, (end-ptr)*sizeof(WCHAR));
|
||||
buf[end-ptr] = 0;
|
||||
nsAString_Init(&nsstr, buf);
|
||||
heap_free(buf);
|
||||
|
||||
/* FIXME: Find better way to insert HTML to document. */
|
||||
nsres = nsIDOMHTMLDocument_Write(doc->nsdoc, &nsstr);
|
||||
nsAString_Finish(&nsstr);
|
||||
if(NS_FAILED(nsres)) {
|
||||
ERR("Write failed: %08x\n", nsres);
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
static void add_script_runner(NSContainer *This)
|
||||
{
|
||||
nsIDOMNSDocument *nsdoc;
|
||||
nsresult nsres;
|
||||
|
||||
nsres = nsIDOMHTMLDocument_QueryInterface(This->doc->nsdoc, &IID_nsIDOMNSDocument, (void**)&nsdoc);
|
||||
if(NS_FAILED(nsres)) {
|
||||
ERR("Could not get nsIDOMNSDocument: %08x\n", nsres);
|
||||
return;
|
||||
}
|
||||
|
||||
nsIDOMNSDocument_WineAddScriptRunner(nsdoc, NSRUNNABLE(This));
|
||||
nsIDOMNSDocument_Release(nsdoc);
|
||||
}
|
||||
|
||||
#define NSRUNNABLE_THIS(iface) DEFINE_THIS(NSContainer, Runnable, iface)
|
||||
|
||||
static nsresult NSAPI nsRunnable_QueryInterface(nsIRunnable *iface,
|
||||
nsIIDRef riid, nsQIResult result)
|
||||
{
|
||||
NSContainer *This = NSRUNNABLE_THIS(iface);
|
||||
|
||||
if(IsEqualGUID(riid, &IID_nsISupports)) {
|
||||
TRACE("(%p)->(IID_nsISupports %p)\n", This, result);
|
||||
*result = NSRUNNABLE(This);
|
||||
}else if(IsEqualGUID(riid, &IID_nsIRunnable)) {
|
||||
TRACE("(%p)->(IID_nsIRunnable %p)\n", This, result);
|
||||
*result = NSRUNNABLE(This);
|
||||
}else {
|
||||
*result = NULL;
|
||||
WARN("(%p)->(%s %p)\n", This, debugstr_guid(riid), result);
|
||||
return NS_NOINTERFACE;
|
||||
}
|
||||
|
||||
nsISupports_AddRef((nsISupports*)*result);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
static nsrefcnt NSAPI nsRunnable_AddRef(nsIRunnable *iface)
|
||||
{
|
||||
NSContainer *This = NSRUNNABLE_THIS(iface);
|
||||
return nsIWebBrowserChrome_AddRef(NSWBCHROME(This));
|
||||
}
|
||||
|
||||
static nsrefcnt NSAPI nsRunnable_Release(nsIRunnable *iface)
|
||||
{
|
||||
NSContainer *This = NSRUNNABLE_THIS(iface);
|
||||
return nsIWebBrowserChrome_Release(NSWBCHROME(This));
|
||||
}
|
||||
|
||||
static void pop_mutation_queue(NSContainer *nscontainer)
|
||||
{
|
||||
mutation_queue_t *tmp = nscontainer->mutation_queue;
|
||||
|
||||
if(!tmp)
|
||||
return;
|
||||
|
||||
nscontainer->mutation_queue = tmp->next;
|
||||
if(!tmp->next)
|
||||
nscontainer->mutation_queue_tail = NULL;
|
||||
|
||||
nsISupports_Release(tmp->nsiface);
|
||||
heap_free(tmp);
|
||||
}
|
||||
|
||||
static nsresult NSAPI nsRunnable_Run(nsIRunnable *iface)
|
||||
{
|
||||
NSContainer *This = NSRUNNABLE_THIS(iface);
|
||||
nsresult nsres;
|
||||
|
||||
TRACE("(%p)\n", This);
|
||||
|
||||
while(This->mutation_queue) {
|
||||
switch(This->mutation_queue->type) {
|
||||
case MUTATION_COMMENT: {
|
||||
nsIDOMComment *nscomment;
|
||||
nsAString comment_str;
|
||||
BOOL remove_comment = FALSE;
|
||||
|
||||
nsres = nsISupports_QueryInterface(This->mutation_queue->nsiface, &IID_nsIDOMComment, (void**)&nscomment);
|
||||
if(NS_FAILED(nsres)) {
|
||||
ERR("Could not get nsIDOMComment iface:%08x\n", nsres);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsAString_Init(&comment_str, NULL);
|
||||
nsres = nsIDOMComment_GetData(nscomment, &comment_str);
|
||||
if(NS_SUCCEEDED(nsres)) {
|
||||
const PRUnichar *comment;
|
||||
|
||||
nsAString_GetData(&comment_str, &comment);
|
||||
remove_comment = handle_insert_comment(This->doc, comment);
|
||||
}
|
||||
|
||||
nsAString_Finish(&comment_str);
|
||||
|
||||
if(remove_comment) {
|
||||
nsIDOMNode *nsparent, *tmp;
|
||||
nsAString magic_str;
|
||||
|
||||
static const PRUnichar remove_comment_magicW[] =
|
||||
{'#','!','w','i','n','e', 'r','e','m','o','v','e','!','#',0};
|
||||
|
||||
nsAString_Init(&magic_str, remove_comment_magicW);
|
||||
nsres = nsIDOMComment_SetData(nscomment, &magic_str);
|
||||
nsAString_Finish(&magic_str);
|
||||
if(NS_FAILED(nsres))
|
||||
ERR("SetData failed: %08x\n", nsres);
|
||||
|
||||
nsIDOMComment_GetParentNode(nscomment, &nsparent);
|
||||
if(nsparent) {
|
||||
nsIDOMNode_RemoveChild(nsparent, (nsIDOMNode*)nscomment, &tmp);
|
||||
nsIDOMNode_Release(nsparent);
|
||||
nsIDOMNode_Release(tmp);
|
||||
}
|
||||
}
|
||||
|
||||
nsIDOMComment_Release(nscomment);
|
||||
break;
|
||||
}
|
||||
|
||||
case MUTATION_SCRIPT: {
|
||||
nsIDOMHTMLScriptElement *nsscript;
|
||||
|
||||
nsres = nsISupports_QueryInterface(This->mutation_queue->nsiface, &IID_nsIDOMHTMLScriptElement,
|
||||
(void**)&nsscript);
|
||||
if(NS_FAILED(nsres)) {
|
||||
ERR("Could not get nsIDOMHTMLScriptElement: %08x\n", nsres);
|
||||
break;
|
||||
}
|
||||
|
||||
doc_insert_script(This->doc, nsscript);
|
||||
nsIDOMHTMLScriptElement_Release(nsscript);
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
ERR("invalid type %d\n", This->mutation_queue->type);
|
||||
}
|
||||
|
||||
pop_mutation_queue(This);
|
||||
}
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
#undef NSRUNNABLE_THIS
|
||||
|
||||
static const nsIRunnableVtbl nsRunnableVtbl = {
|
||||
nsRunnable_QueryInterface,
|
||||
nsRunnable_AddRef,
|
||||
nsRunnable_Release,
|
||||
nsRunnable_Run
|
||||
};
|
||||
|
||||
#define NSDOCOBS_THIS(iface) DEFINE_THIS(NSContainer, DocumentObserver, iface)
|
||||
|
||||
static nsresult NSAPI nsDocumentObserver_QueryInterface(nsIDocumentObserver *iface,
|
||||
nsIIDRef riid, nsQIResult result)
|
||||
{
|
||||
NSContainer *This = NSDOCOBS_THIS(iface);
|
||||
|
||||
if(IsEqualGUID(&IID_nsISupports, riid)) {
|
||||
TRACE("(%p)->(IID_nsISupports, %p)\n", This, result);
|
||||
*result = NSWBCHROME(This);
|
||||
}else if(IsEqualGUID(&IID_nsIMutationObserver, riid)) {
|
||||
TRACE("(%p)->(IID_nsIMutationObserver %p)\n", This, result);
|
||||
*result = NSDOCOBS(This);
|
||||
}else if(IsEqualGUID(&IID_nsIDocumentObserver, riid)) {
|
||||
TRACE("(%p)->(IID_nsIDocumentObserver %p)\n", This, result);
|
||||
*result = NSDOCOBS(This);
|
||||
}else {
|
||||
*result = NULL;
|
||||
TRACE("(%p)->(%s %p)\n", This, debugstr_guid(riid), result);
|
||||
return NS_NOINTERFACE;
|
||||
}
|
||||
|
||||
nsIWebBrowserChrome_AddRef(NSWBCHROME(This));
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
static nsrefcnt NSAPI nsDocumentObserver_AddRef(nsIDocumentObserver *iface)
|
||||
{
|
||||
NSContainer *This = NSDOCOBS_THIS(iface);
|
||||
return nsIWebBrowserChrome_AddRef(NSWBCHROME(This));
|
||||
}
|
||||
|
||||
static nsrefcnt NSAPI nsDocumentObserver_Release(nsIDocumentObserver *iface)
|
||||
{
|
||||
NSContainer *This = NSDOCOBS_THIS(iface);
|
||||
return nsIWebBrowserChrome_Release(NSWBCHROME(This));
|
||||
}
|
||||
|
||||
static void NSAPI nsDocumentObserver_CharacterDataWillChange(nsIDocumentObserver *iface,
|
||||
nsIDocument *aDocument, nsIContent *aContent, void /*CharacterDataChangeInfo*/ *aInfo)
|
||||
{
|
||||
}
|
||||
|
||||
static void NSAPI nsDocumentObserver_CharacterDataChanged(nsIDocumentObserver *iface,
|
||||
nsIDocument *aDocument, nsIContent *aContent, void /*CharacterDataChangeInfo*/ *aInfo)
|
||||
{
|
||||
}
|
||||
|
||||
static void NSAPI nsDocumentObserver_AttributeChanged(nsIDocumentObserver *iface, nsIDocument *aDocument,
|
||||
nsIContent *aContent, PRInt32 aNameSpaceID, nsIAtom *aAttribute, PRInt32 aModType, PRUint32 aStateMask)
|
||||
{
|
||||
}
|
||||
|
||||
static void NSAPI nsDocumentObserver_ContentAppended(nsIDocumentObserver *iface, nsIDocument *aDocument,
|
||||
nsIContent *aContainer, PRInt32 aNewIndexInContainer)
|
||||
{
|
||||
}
|
||||
|
||||
static void NSAPI nsDocumentObserver_ContentInserted(nsIDocumentObserver *iface, nsIDocument *aDocument,
|
||||
nsIContent *aContainer, nsIContent *aChild, PRInt32 aIndexInContainer)
|
||||
{
|
||||
}
|
||||
|
||||
static void NSAPI nsDocumentObserver_ContentRemoved(nsIDocumentObserver *iface, nsIDocument *aDocument,
|
||||
nsIContent *aContainer, nsIContent *aChild, PRInt32 aIndexInContainer)
|
||||
{
|
||||
}
|
||||
|
||||
static void NSAPI nsDocumentObserver_NodeWillBeDestroyed(nsIDocumentObserver *iface, const nsINode *aNode)
|
||||
{
|
||||
}
|
||||
|
||||
static void NSAPI nsDocumentObserver_ParentChainChanged(nsIDocumentObserver *iface, nsIContent *aContent)
|
||||
{
|
||||
}
|
||||
|
||||
static void NSAPI nsDocumentObserver_BeginUpdate(nsIDocumentObserver *iface, nsIDocument *aDocument,
|
||||
nsUpdateType aUpdateType)
|
||||
{
|
||||
}
|
||||
|
||||
static void NSAPI nsDocumentObserver_EndUpdate(nsIDocumentObserver *iface, nsIDocument *aDocument,
|
||||
nsUpdateType aUpdateType)
|
||||
{
|
||||
}
|
||||
|
||||
static void NSAPI nsDocumentObserver_BeginLoad(nsIDocumentObserver *iface, nsIDocument *aDocument)
|
||||
{
|
||||
}
|
||||
|
||||
static void NSAPI nsDocumentObserver_EndLoad(nsIDocumentObserver *iface, nsIDocument *aDocument)
|
||||
{
|
||||
}
|
||||
|
||||
static void NSAPI nsDocumentObserver_ContentStatesChanged(nsIDocumentObserver *iface, nsIDocument *aDocument,
|
||||
nsIContent *aContent1, nsIContent *aContent2, PRInt32 aStateMask)
|
||||
{
|
||||
}
|
||||
|
||||
static void NSAPI nsDocumentObserver_StyleSheetAdded(nsIDocumentObserver *iface, nsIDocument *aDocument,
|
||||
nsIStyleSheet *aStyleSheet, PRBool aDocumentSheet)
|
||||
{
|
||||
}
|
||||
|
||||
static void NSAPI nsDocumentObserver_StyleSheetRemoved(nsIDocumentObserver *iface, nsIDocument *aDocument,
|
||||
nsIStyleSheet *aStyleSheet, PRBool aDocumentSheet)
|
||||
{
|
||||
}
|
||||
|
||||
static void NSAPI nsDocumentObserver_StyleSheetApplicableStateChanged(nsIDocumentObserver *iface,
|
||||
nsIDocument *aDocument, nsIStyleSheet *aStyleSheet, PRBool aApplicable)
|
||||
{
|
||||
}
|
||||
|
||||
static void NSAPI nsDocumentObserver_StyleRuleChanged(nsIDocumentObserver *iface, nsIDocument *aDocument,
|
||||
nsIStyleSheet *aStyleSheet, nsIStyleRule *aOldStyleRule, nsIStyleSheet *aNewStyleRule)
|
||||
{
|
||||
}
|
||||
|
||||
static void NSAPI nsDocumentObserver_StyleRuleAdded(nsIDocumentObserver *iface, nsIDocument *aDocument,
|
||||
nsIStyleSheet *aStyleSheet, nsIStyleRule *aStyleRule)
|
||||
{
|
||||
}
|
||||
|
||||
static void NSAPI nsDocumentObserver_StyleRuleRemoved(nsIDocumentObserver *iface, nsIDocument *aDocument,
|
||||
nsIStyleSheet *aStyleSheet, nsIStyleRule *aStyleRule)
|
||||
{
|
||||
}
|
||||
|
||||
static void push_mutation_queue(NSContainer *nscontainer, DWORD type, nsISupports *nsiface)
|
||||
{
|
||||
mutation_queue_t *elem;
|
||||
|
||||
elem = heap_alloc(sizeof(mutation_queue_t));
|
||||
if(!elem)
|
||||
return;
|
||||
|
||||
elem->next = NULL;
|
||||
elem->type = type;
|
||||
elem->nsiface = nsiface;
|
||||
nsISupports_AddRef(nsiface);
|
||||
|
||||
if(nscontainer->mutation_queue_tail)
|
||||
nscontainer->mutation_queue_tail = nscontainer->mutation_queue_tail->next = elem;
|
||||
else
|
||||
nscontainer->mutation_queue = nscontainer->mutation_queue_tail = elem;
|
||||
}
|
||||
|
||||
static void NSAPI nsDocumentObserver_BindToDocument(nsIDocumentObserver *iface, nsIDocument *aDocument,
|
||||
nsIContent *aContent)
|
||||
{
|
||||
NSContainer *This = NSDOCOBS_THIS(iface);
|
||||
nsIDOMComment *nscomment;
|
||||
nsIDOMElement *nselem;
|
||||
nsresult nsres;
|
||||
|
||||
TRACE("(%p)\n", This);
|
||||
|
||||
nsres = nsISupports_QueryInterface(aContent, &IID_nsIDOMElement, (void**)&nselem);
|
||||
if(NS_SUCCEEDED(nsres)) {
|
||||
check_event_attr(This->doc, nselem);
|
||||
nsIDOMElement_Release(nselem);
|
||||
}
|
||||
|
||||
nsres = nsISupports_QueryInterface(aContent, &IID_nsIDOMComment, (void**)&nscomment);
|
||||
if(NS_SUCCEEDED(nsres)) {
|
||||
TRACE("comment node\n");
|
||||
|
||||
push_mutation_queue(This, MUTATION_COMMENT, (nsISupports*)nscomment);
|
||||
nsIDOMComment_Release(nscomment);
|
||||
add_script_runner(This);
|
||||
}
|
||||
}
|
||||
|
||||
static void NSAPI nsDocumentObserver_DoneAddingChildren(nsIDocumentObserver *iface, nsIContent *aContent,
|
||||
PRBool aHaveNotified)
|
||||
{
|
||||
NSContainer *This = NSDOCOBS_THIS(iface);
|
||||
nsIDOMHTMLScriptElement *nsscript;
|
||||
nsresult nsres;
|
||||
|
||||
TRACE("(%p)->(%p %x)\n", This, aContent, aHaveNotified);
|
||||
|
||||
nsres = nsISupports_QueryInterface(aContent, &IID_nsIDOMHTMLScriptElement, (void**)&nsscript);
|
||||
if(NS_SUCCEEDED(nsres)) {
|
||||
push_mutation_queue(This, MUTATION_SCRIPT, (nsISupports*)nsscript);
|
||||
nsIDOMHTMLScriptElement_Release(nsscript);
|
||||
add_script_runner(This);
|
||||
}
|
||||
}
|
||||
|
||||
#undef NSMUTATIONOBS_THIS
|
||||
|
||||
static const nsIDocumentObserverVtbl nsDocumentObserverVtbl = {
|
||||
nsDocumentObserver_QueryInterface,
|
||||
nsDocumentObserver_AddRef,
|
||||
nsDocumentObserver_Release,
|
||||
nsDocumentObserver_CharacterDataWillChange,
|
||||
nsDocumentObserver_CharacterDataChanged,
|
||||
nsDocumentObserver_AttributeChanged,
|
||||
nsDocumentObserver_ContentAppended,
|
||||
nsDocumentObserver_ContentInserted,
|
||||
nsDocumentObserver_ContentRemoved,
|
||||
nsDocumentObserver_NodeWillBeDestroyed,
|
||||
nsDocumentObserver_ParentChainChanged,
|
||||
nsDocumentObserver_BeginUpdate,
|
||||
nsDocumentObserver_EndUpdate,
|
||||
nsDocumentObserver_BeginLoad,
|
||||
nsDocumentObserver_EndLoad,
|
||||
nsDocumentObserver_ContentStatesChanged,
|
||||
nsDocumentObserver_StyleSheetAdded,
|
||||
nsDocumentObserver_StyleSheetRemoved,
|
||||
nsDocumentObserver_StyleSheetApplicableStateChanged,
|
||||
nsDocumentObserver_StyleRuleChanged,
|
||||
nsDocumentObserver_StyleRuleAdded,
|
||||
nsDocumentObserver_StyleRuleRemoved,
|
||||
nsDocumentObserver_BindToDocument,
|
||||
nsDocumentObserver_DoneAddingChildren
|
||||
};
|
||||
|
||||
void init_mutation(NSContainer *nscontainer)
|
||||
{
|
||||
nscontainer->lpDocumentObserverVtbl = &nsDocumentObserverVtbl;
|
||||
nscontainer->lpRunnableVtbl = &nsRunnableVtbl;
|
||||
}
|
||||
@@ -180,10 +180,10 @@ static nsresult NSAPI nsInputStream_ReadSegments(nsIInputStream *iface,
|
||||
if(!This->buf_size)
|
||||
return S_OK;
|
||||
|
||||
if(This->buf_size > aCount)
|
||||
FIXME("buf_size > aCount\n");
|
||||
if(aCount > This->buf_size)
|
||||
aCount = This->buf_size;
|
||||
|
||||
nsres = aWriter(NSINSTREAM(This), aClousure, This->buf, 0, This->buf_size, &written);
|
||||
nsres = aWriter(NSINSTREAM(This), aClousure, This->buf, 0, aCount, &written);
|
||||
if(NS_FAILED(nsres))
|
||||
TRACE("aWritter failed: %08x\n", nsres);
|
||||
else if(written != This->buf_size)
|
||||
@@ -344,6 +344,8 @@ static HRESULT WINAPI BindStatusCallback_OnStopBinding(IBindStatusCallback *ifac
|
||||
|
||||
TRACE("(%p)->(%08x %s)\n", This, hresult, debugstr_w(szError));
|
||||
|
||||
/* NOTE: IE7 calls GetBindResult here */
|
||||
|
||||
if(This->binding) {
|
||||
IBinding_Release(This->binding);
|
||||
This->binding = NULL;
|
||||
@@ -687,6 +689,9 @@ HRESULT start_binding(HTMLDocument *doc, BSCallback *bscallback, IBindCtx *bctx)
|
||||
HRESULT hres;
|
||||
|
||||
bscallback->doc = doc;
|
||||
|
||||
/* NOTE: IE7 calls IsSystemMoniker here*/
|
||||
|
||||
call_docview_84(doc);
|
||||
|
||||
if(bctx) {
|
||||
@@ -878,8 +883,10 @@ static HRESULT read_stream_data(nsChannelBSC *This, IStream *stream)
|
||||
FIXME("OnStartRequest failed: %08x\n", nsres);
|
||||
|
||||
/* events are reset when a new document URI is loaded, so re-initialise them here */
|
||||
if(This->bsc.doc && This->bsc.doc->bscallback == This && This->bsc.doc->nscontainer)
|
||||
if(This->bsc.doc && This->bsc.doc->bscallback == This && This->bsc.doc->nscontainer) {
|
||||
update_nsdocument(This->bsc.doc);
|
||||
init_nsevents(This->bsc.doc->nscontainer);
|
||||
}
|
||||
}
|
||||
|
||||
This->bsc.readed += This->nsstream->buf_size;
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
#include "mshtml_private.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
|
||||
WINE_DECLARE_DEBUG_CHANNEL(gecko);
|
||||
|
||||
#define NS_APPSTARTUPNOTIFIER_CONTRACTID "@mozilla.org/embedcomp/appstartup-notifier;1"
|
||||
#define NS_WEBBROWSER_CONTRACTID "@mozilla.org/embedding/browser/nsWebBrowser;1"
|
||||
@@ -94,7 +95,7 @@ static LRESULT WINAPI nsembed_proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lP
|
||||
This = *(NSContainer**)lParam;
|
||||
SetPropW(hwnd, wszTHIS, This);
|
||||
}else {
|
||||
This = (NSContainer*)GetPropW(hwnd, wszTHIS);
|
||||
This = GetPropW(hwnd, wszTHIS);
|
||||
}
|
||||
|
||||
switch(msg) {
|
||||
@@ -142,22 +143,46 @@ static void register_nscontainer_class(void)
|
||||
nscontainer_class = RegisterClassExW(&wndclass);
|
||||
}
|
||||
|
||||
static void set_environment(LPCWSTR gre_path)
|
||||
{
|
||||
WCHAR path_env[MAX_PATH], buf[20];
|
||||
int len, debug_level = 0;
|
||||
|
||||
static const WCHAR pathW[] = {'P','A','T','H',0};
|
||||
static const WCHAR warnW[] = {'w','a','r','n',0};
|
||||
static const WCHAR xpcom_debug_breakW[] =
|
||||
{'X','P','C','O','M','_','D','E','B','U','G','_','B','R','E','A','K',0};
|
||||
static const WCHAR nspr_log_modulesW[] =
|
||||
{'N','S','P','R','_','L','O','G','_','M','O','D','U','L','E','S',0};
|
||||
static const WCHAR debug_formatW[] = {'a','l','l',':','%','d',0};
|
||||
|
||||
/* We have to modify PATH as XPCOM loads other DLLs from this directory. */
|
||||
GetEnvironmentVariableW(pathW, path_env, sizeof(path_env)/sizeof(WCHAR));
|
||||
len = strlenW(path_env);
|
||||
path_env[len++] = ';';
|
||||
strcpyW(path_env+len, gre_path);
|
||||
SetEnvironmentVariableW(pathW, path_env);
|
||||
|
||||
SetEnvironmentVariableW(xpcom_debug_breakW, warnW);
|
||||
|
||||
if(TRACE_ON(gecko))
|
||||
debug_level = 5;
|
||||
else if(WARN_ON(gecko))
|
||||
debug_level = 3;
|
||||
else if(ERR_ON(gecko))
|
||||
debug_level = 2;
|
||||
|
||||
sprintfW(buf, debug_formatW, debug_level);
|
||||
SetEnvironmentVariableW(nspr_log_modulesW, buf);
|
||||
}
|
||||
|
||||
static BOOL load_xpcom(const PRUnichar *gre_path)
|
||||
{
|
||||
WCHAR path_env[MAX_PATH];
|
||||
int len;
|
||||
|
||||
static const WCHAR wszPATH[] = {'P','A','T','H',0};
|
||||
static const WCHAR strXPCOM[] = {'x','p','c','o','m','.','d','l','l',0};
|
||||
|
||||
TRACE("(%s)\n", debugstr_w(gre_path));
|
||||
|
||||
/* We have to modify PATH as XPCOM loads other DLLs from this directory. */
|
||||
GetEnvironmentVariableW(wszPATH, path_env, sizeof(path_env)/sizeof(WCHAR));
|
||||
len = strlenW(path_env);
|
||||
path_env[len++] = ';';
|
||||
strcpyW(path_env+len, gre_path);
|
||||
SetEnvironmentVariableW(wszPATH, path_env);
|
||||
set_environment(gre_path);
|
||||
|
||||
hXPCOM = LoadLibraryW(strXPCOM);
|
||||
if(!hXPCOM) {
|
||||
@@ -369,35 +394,11 @@ static void set_bool_pref(nsIPrefBranch *pref, const char *pref_name, BOOL val)
|
||||
ERR("Could not set pref %s\n", debugstr_a(pref_name));
|
||||
}
|
||||
|
||||
static void set_profile(void)
|
||||
static void set_preferences(void)
|
||||
{
|
||||
nsIPrefBranch *pref;
|
||||
nsIProfile *profile;
|
||||
PRBool exists = FALSE;
|
||||
nsresult nsres;
|
||||
|
||||
static const WCHAR wszMSHTML[] = {'M','S','H','T','M','L',0};
|
||||
|
||||
nsres = nsIServiceManager_GetServiceByContractID(pServMgr, NS_PROFILE_CONTRACTID,
|
||||
&IID_nsIProfile, (void**)&profile);
|
||||
if(NS_FAILED(nsres)) {
|
||||
ERR("Could not get profile service: %08x\n", nsres);
|
||||
return;
|
||||
}
|
||||
|
||||
nsres = nsIProfile_ProfileExists(profile, wszMSHTML, &exists);
|
||||
if(!exists) {
|
||||
nsres = nsIProfile_CreateNewProfile(profile, wszMSHTML, NULL, NULL, FALSE);
|
||||
if(NS_FAILED(nsres))
|
||||
ERR("CreateNewProfile failed: %08x\n", nsres);
|
||||
}
|
||||
|
||||
nsres = nsIProfile_SetCurrentProfile(profile, wszMSHTML);
|
||||
if(NS_FAILED(nsres))
|
||||
ERR("SetCurrentProfile failed: %08x\n", nsres);
|
||||
|
||||
nsIProfile_Release(profile);
|
||||
|
||||
nsres = nsIServiceManager_GetServiceByContractID(pServMgr, NS_PREFERENCES_CONTRACTID,
|
||||
&IID_nsIPrefBranch, (void**)&pref);
|
||||
if(NS_FAILED(nsres)) {
|
||||
@@ -468,7 +469,7 @@ static BOOL init_xpcom(const PRUnichar *gre_path)
|
||||
ERR("could not get appstartup-notifier: %08x\n", nsres);
|
||||
}
|
||||
|
||||
set_profile();
|
||||
set_preferences();
|
||||
|
||||
nsres = nsIComponentManager_CreateInstanceByContractID(pCompMgr, NS_MEMORY_CONTRACTID,
|
||||
NULL, &IID_nsIMemory, (void**)&nsmem);
|
||||
@@ -497,7 +498,7 @@ BOOL load_gecko(BOOL silent)
|
||||
PRUnichar gre_path[MAX_PATH];
|
||||
BOOL ret = FALSE;
|
||||
|
||||
static LONG loading_thread;
|
||||
static DWORD loading_thread;
|
||||
|
||||
TRACE("()\n");
|
||||
|
||||
@@ -604,44 +605,6 @@ nsIInputStream *create_nsstream(const char *data, PRInt32 data_len)
|
||||
return (nsIInputStream*)ret;
|
||||
}
|
||||
|
||||
nsIMutableArray *create_nsarray(void)
|
||||
{
|
||||
nsIMutableArray *ret;
|
||||
nsresult nsres;
|
||||
|
||||
if(!pCompMgr)
|
||||
return NULL;
|
||||
|
||||
nsres = nsIComponentManager_CreateInstanceByContractID(pCompMgr,
|
||||
NS_ARRAY_CONTRACTID, NULL, &IID_nsIMutableArray,
|
||||
(void**)&ret);
|
||||
if(NS_FAILED(nsres)) {
|
||||
ERR("Could not get nsIArray: %08x\n", nsres);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
nsIWritableVariant *create_nsvariant(void)
|
||||
{
|
||||
nsIWritableVariant *ret;
|
||||
nsresult nsres;
|
||||
|
||||
if(!pCompMgr)
|
||||
return NULL;
|
||||
|
||||
nsres = nsIComponentManager_CreateInstanceByContractID(pCompMgr,
|
||||
NS_VARIANT_CONTRACTID, NULL, &IID_nsIWritableVariant,
|
||||
(void**)&ret);
|
||||
if(NS_FAILED(nsres)) {
|
||||
ERR("Could not get nsIWritableVariant: %08x\n", nsres);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
nsICommandParams *create_nscommand_params(void)
|
||||
{
|
||||
nsICommandParams *ret = NULL;
|
||||
@@ -693,7 +656,7 @@ static void nsnode_to_nsstring_rec(nsIContentSerializer *serializer, nsIDOMNode
|
||||
case ELEMENT_NODE: {
|
||||
nsIDOMElement *nselem;
|
||||
nsIDOMNode_QueryInterface(nsnode, &IID_nsIDOMElement, (void**)&nselem);
|
||||
nsIContentSerializer_AppendElementStart(serializer, nselem, has_children, str);
|
||||
nsIContentSerializer_AppendElementStart(serializer, nselem, nselem, str);
|
||||
nsIDOMElement_Release(nselem);
|
||||
break;
|
||||
}
|
||||
@@ -765,7 +728,7 @@ void nsnode_to_nsstring(nsIDOMNode *nsdoc, nsAString *str)
|
||||
return;
|
||||
}
|
||||
|
||||
nsres = nsIContentSerializer_Init(serializer, 0, 100, NULL, FALSE);
|
||||
nsres = nsIContentSerializer_Init(serializer, 0, 100, NULL, FALSE, FALSE /* FIXME */);
|
||||
if(NS_FAILED(nsres))
|
||||
ERR("Init failed: %08x\n", nsres);
|
||||
|
||||
@@ -848,7 +811,8 @@ void set_ns_editmode(NSContainer *This)
|
||||
return;
|
||||
}
|
||||
|
||||
nsres = nsIEditingSession_MakeWindowEditable(editing_session, dom_window, NULL, FALSE);
|
||||
nsres = nsIEditingSession_MakeWindowEditable(editing_session, dom_window,
|
||||
NULL, FALSE, TRUE, TRUE);
|
||||
nsIEditingSession_Release(editing_session);
|
||||
nsIDOMWindow_Release(dom_window);
|
||||
if(NS_FAILED(nsres)) {
|
||||
@@ -866,10 +830,48 @@ void set_ns_editmode(NSContainer *This)
|
||||
nsIWebBrowser_SetParentURIContentListener(This->webbrowser, NSURICL(This));
|
||||
}
|
||||
|
||||
void update_nsdocument(HTMLDocument *doc)
|
||||
{
|
||||
nsIDOMHTMLDocument *nsdoc;
|
||||
nsIDOMDocument *nsdomdoc;
|
||||
nsresult nsres;
|
||||
|
||||
if(!doc->nscontainer || !doc->nscontainer->navigation)
|
||||
return;
|
||||
|
||||
nsres = nsIWebNavigation_GetDocument(doc->nscontainer->navigation, &nsdomdoc);
|
||||
if(NS_FAILED(nsres) || !nsdomdoc) {
|
||||
ERR("GetDocument failed: %08x\n", nsres);
|
||||
return;
|
||||
}
|
||||
|
||||
nsres = nsIDOMDocument_QueryInterface(nsdomdoc, &IID_nsIDOMHTMLDocument, (void**)&nsdoc);
|
||||
nsIDOMDocument_Release(nsdomdoc);
|
||||
if(NS_FAILED(nsres)) {
|
||||
ERR("Could not get nsIDOMHTMLDocument iface: %08x\n", nsres);
|
||||
return;
|
||||
}
|
||||
|
||||
if(nsdoc == doc->nsdoc) {
|
||||
nsIDOMHTMLDocument_Release(nsdoc);
|
||||
return;
|
||||
}
|
||||
|
||||
if(doc->nsdoc)
|
||||
nsIDOMHTMLDocument_Release(doc->nsdoc);
|
||||
|
||||
doc->nsdoc = nsdoc;
|
||||
|
||||
if(nsdoc)
|
||||
set_mutation_observer(doc->nscontainer, nsdoc);
|
||||
}
|
||||
|
||||
void close_gecko(void)
|
||||
{
|
||||
TRACE("()\n");
|
||||
|
||||
release_nsio();
|
||||
|
||||
if(pCompMgr)
|
||||
nsIComponentManager_Release(pCompMgr);
|
||||
|
||||
@@ -951,6 +953,7 @@ static nsrefcnt NSAPI nsWebBrowserChrome_Release(nsIWebBrowserChrome *iface)
|
||||
TRACE("(%p) ref=%d\n", This, ref);
|
||||
|
||||
if(!ref) {
|
||||
heap_free(This->event_vector);
|
||||
if(This->parent)
|
||||
nsIWebBrowserChrome_Release(NSWBCHROME(This->parent));
|
||||
heap_free(This);
|
||||
@@ -963,8 +966,14 @@ static nsresult NSAPI nsWebBrowserChrome_SetStatus(nsIWebBrowserChrome *iface,
|
||||
PRUint32 statusType, const PRUnichar *status)
|
||||
{
|
||||
NSContainer *This = NSWBCHROME_THIS(iface);
|
||||
|
||||
TRACE("(%p)->(%d %s)\n", This, statusType, debugstr_w(status));
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
|
||||
/* FIXME: This hack should be removed when we'll load all pages by URLMoniker */
|
||||
if(This->doc)
|
||||
update_nsdocument(This->doc);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
static nsresult NSAPI nsWebBrowserChrome_GetWebBrowser(nsIWebBrowserChrome *iface,
|
||||
@@ -1486,7 +1495,8 @@ static nsresult NSAPI nsTooltipListener_OnShowTooltip(nsITooltipListener *iface,
|
||||
{
|
||||
NSContainer *This = NSTOOLTIP_THIS(iface);
|
||||
|
||||
show_tooltip(This->doc, aXCoord, aYCoord, aTipText);
|
||||
if (This->doc)
|
||||
show_tooltip(This->doc, aXCoord, aYCoord, aTipText);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
@@ -1495,7 +1505,8 @@ static nsresult NSAPI nsTooltipListener_OnHideTooltip(nsITooltipListener *iface)
|
||||
{
|
||||
NSContainer *This = NSTOOLTIP_THIS(iface);
|
||||
|
||||
hide_tooltip(This->doc);
|
||||
if (This->doc)
|
||||
hide_tooltip(This->doc);
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
@@ -1656,6 +1667,7 @@ NSContainer *NSContainer_Create(HTMLDocument *doc, NSContainer *parent)
|
||||
|
||||
ret->doc = doc;
|
||||
ret->ref = 1;
|
||||
init_mutation(ret);
|
||||
|
||||
nsres = nsIComponentManager_CreateInstanceByContractID(pCompMgr, NS_WEBBROWSER_CONTRACTID,
|
||||
NULL, &IID_nsIWebBrowser, (void**)&ret->webbrowser);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2007 Jacek Caban for CodeWeavers
|
||||
* Copyright 2007-2008 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
|
||||
@@ -31,6 +31,7 @@
|
||||
#include "wine/unicode.h"
|
||||
|
||||
#include "mshtml_private.h"
|
||||
#include "htmlevent.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(mshtml);
|
||||
|
||||
@@ -129,9 +130,7 @@ static nsresult NSAPI handle_keypress(nsIDOMEventListener *iface,
|
||||
static nsresult NSAPI handle_load(nsIDOMEventListener *iface, nsIDOMEvent *event)
|
||||
{
|
||||
NSContainer *This = NSEVENTLIST_THIS(iface)->This;
|
||||
nsIDOMHTMLDocument *nshtmldoc;
|
||||
nsIDOMHTMLElement *nsbody = NULL;
|
||||
nsIDOMDocument *nsdoc;
|
||||
task_t *task;
|
||||
|
||||
TRACE("(%p)\n", This);
|
||||
@@ -139,8 +138,8 @@ static nsresult NSAPI handle_load(nsIDOMEventListener *iface, nsIDOMEvent *event
|
||||
if(!This->doc)
|
||||
return NS_OK;
|
||||
|
||||
update_nsdocument(This->doc);
|
||||
connect_scripts(This->doc);
|
||||
setup_nswindow(This->doc->window);
|
||||
|
||||
if(This->editor_controller) {
|
||||
nsIController_Release(This->editor_controller);
|
||||
@@ -162,14 +161,12 @@ static nsresult NSAPI handle_load(nsIDOMEventListener *iface, nsIDOMEvent *event
|
||||
*/
|
||||
push_task(task);
|
||||
|
||||
if(!This->doc->nsdoc) {
|
||||
ERR("NULL nsdoc\n");
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
nsIWebNavigation_GetDocument(This->navigation, &nsdoc);
|
||||
nsIDOMDocument_QueryInterface(nsdoc, &IID_nsIDOMHTMLDocument, (void**)&nshtmldoc);
|
||||
nsIDOMDocument_Release(nsdoc);
|
||||
|
||||
nsIDOMHTMLDocument_GetBody(nshtmldoc, &nsbody);
|
||||
nsIDOMHTMLDocument_Release(nshtmldoc);
|
||||
|
||||
nsIDOMHTMLDocument_GetBody(This->doc->nsdoc, &nsbody);
|
||||
if(nsbody) {
|
||||
fire_event(This->doc, EVENTID_LOAD, (nsIDOMNode*)nsbody);
|
||||
nsIDOMHTMLElement_Release(nsbody);
|
||||
@@ -178,39 +175,6 @@ static nsresult NSAPI handle_load(nsIDOMEventListener *iface, nsIDOMEvent *event
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
static nsresult NSAPI handle_node_insert(nsIDOMEventListener *iface, nsIDOMEvent *event)
|
||||
{
|
||||
NSContainer *This = NSEVENTLIST_THIS(iface)->This;
|
||||
nsIDOMHTMLScriptElement *script;
|
||||
nsIDOMEventTarget *target;
|
||||
nsIDOMElement *elem;
|
||||
nsresult nsres;
|
||||
|
||||
TRACE("(%p %p)\n", This, event);
|
||||
|
||||
nsres = nsIDOMEvent_GetTarget(event, &target);
|
||||
if(NS_FAILED(nsres)) {
|
||||
ERR("GetTarget failed: %08x\n", nsres);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsres = nsIDOMEventTarget_QueryInterface(target, &IID_nsIDOMElement, (void**)&elem);
|
||||
nsIDOMEventTarget_Release(target);
|
||||
if(NS_FAILED(nsres))
|
||||
return NS_OK;
|
||||
|
||||
nsres = nsIDOMElement_QueryInterface(elem, &IID_nsIDOMHTMLScriptElement, (void**)&script);
|
||||
if(SUCCEEDED(nsres)) {
|
||||
doc_insert_script(This->doc, script);
|
||||
nsIDOMHTMLScriptElement_Release(script);
|
||||
}
|
||||
|
||||
check_event_attr(This->doc, elem);
|
||||
|
||||
nsIDOMNode_Release(elem);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
static nsresult NSAPI handle_htmlevent(nsIDOMEventListener *iface, nsIDOMEvent *event)
|
||||
{
|
||||
NSContainer *This = NSEVENTLIST_THIS(iface)->This;
|
||||
@@ -261,7 +225,6 @@ static const nsIDOMEventListenerVtbl blur_vtbl = EVENTLISTENER_VTBL(handle_
|
||||
static const nsIDOMEventListenerVtbl focus_vtbl = EVENTLISTENER_VTBL(handle_focus);
|
||||
static const nsIDOMEventListenerVtbl keypress_vtbl = EVENTLISTENER_VTBL(handle_keypress);
|
||||
static const nsIDOMEventListenerVtbl load_vtbl = EVENTLISTENER_VTBL(handle_load);
|
||||
static const nsIDOMEventListenerVtbl node_insert_vtbl = EVENTLISTENER_VTBL(handle_node_insert);
|
||||
static const nsIDOMEventListenerVtbl htmlevent_vtbl = EVENTLISTENER_VTBL(handle_htmlevent);
|
||||
|
||||
static void init_event(nsIDOMEventTarget *target, const PRUnichar *type,
|
||||
@@ -318,14 +281,11 @@ void init_nsevents(NSContainer *This)
|
||||
static const PRUnichar wsz_focus[] = {'f','o','c','u','s',0};
|
||||
static const PRUnichar wsz_keypress[] = {'k','e','y','p','r','e','s','s',0};
|
||||
static const PRUnichar wsz_load[] = {'l','o','a','d',0};
|
||||
static const PRUnichar DOMNodeInsertedW[] =
|
||||
{'D','O','M','N','o','d','e','I','n','s','e','r','t','e','d',0};
|
||||
|
||||
init_listener(&This->blur_listener, This, &blur_vtbl);
|
||||
init_listener(&This->focus_listener, This, &focus_vtbl);
|
||||
init_listener(&This->keypress_listener, This, &keypress_vtbl);
|
||||
init_listener(&This->load_listener, This, &load_vtbl);
|
||||
init_listener(&This->node_insert_listener, This, &node_insert_vtbl);
|
||||
init_listener(&This->htmlevent_listener, This, &htmlevent_vtbl);
|
||||
|
||||
nsres = nsIWebBrowser_GetContentDOMWindow(This->webbrowser, &dom_window);
|
||||
@@ -345,7 +305,6 @@ void init_nsevents(NSContainer *This)
|
||||
init_event(target, wsz_focus, NSEVENTLIST(&This->focus_listener), TRUE);
|
||||
init_event(target, wsz_keypress, NSEVENTLIST(&This->keypress_listener), FALSE);
|
||||
init_event(target, wsz_load, NSEVENTLIST(&This->load_listener), TRUE);
|
||||
init_event(target, DOMNodeInsertedW,NSEVENTLIST(&This->node_insert_listener),TRUE);
|
||||
|
||||
nsIDOMEventTarget_Release(target);
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
* compatible with XPCOM, usable in C code.
|
||||
*/
|
||||
|
||||
cpp_quote("#define GECKO_VERSION \"0.1.0\"")
|
||||
cpp_quote("#define GECKO_VERSION \"0.9.0\"")
|
||||
cpp_quote("#define GECKO_VERSION_STRING \"Wine Gecko \" GECKO_VERSION")
|
||||
|
||||
import "wtypes.idl";
|
||||
@@ -82,6 +82,8 @@ interface nsIEditorObserver;
|
||||
interface nsIEditActionListener;
|
||||
interface nsIDocumentStateListener;
|
||||
interface nsIDOMCSSStyleSheet;
|
||||
interface nsIDOMDocumentView;
|
||||
interface nsIDocumentObserver;
|
||||
|
||||
interface IMoniker;
|
||||
|
||||
@@ -100,7 +102,6 @@ interface nsISupports
|
||||
/* Currently we don't need a full declaration of these interfaces */
|
||||
typedef nsISupports nsISHistory;
|
||||
typedef nsISupports nsIWidget;
|
||||
typedef nsISupports nsIDOMAbstractView;
|
||||
typedef nsISupports nsIHttpHeaderVisitor;
|
||||
typedef nsISupports nsIDOMBarProp;
|
||||
typedef nsISupports nsIDOMWindowCollection;
|
||||
@@ -115,7 +116,6 @@ typedef nsISupports nsIDOMProcessingInstruction;
|
||||
typedef nsISupports nsIDOMEntityReference;
|
||||
typedef nsISupports nsIDOMHTMLFormElement;
|
||||
typedef nsISupports nsIDOMHTMLOptionsCollection;
|
||||
typedef nsISupports nsIDOMHTMLCollection;
|
||||
typedef nsISupports nsIWebProgressListener;
|
||||
typedef nsISupports nsIDOMCSSValue;
|
||||
typedef nsISupports nsIPrintSession;
|
||||
@@ -125,6 +125,17 @@ typedef nsISupports nsIAtom;
|
||||
typedef nsISupports nsISupportsArray;
|
||||
typedef nsISupports nsIContentFilter;
|
||||
typedef nsISupports nsIDOMMediaList;
|
||||
typedef nsISupports nsIDOMHTMLTableCaptionElement;
|
||||
typedef nsISupports nsIDOMHTMLTableSectionElement;
|
||||
typedef nsISupports nsIDOMClientRectList;
|
||||
typedef nsISupports nsIDOMClientRect;
|
||||
typedef nsISupports nsIDOMLocation;
|
||||
typedef nsISupports nsIBoxObject;
|
||||
typedef nsISupports nsIDocument;
|
||||
typedef nsISupports nsIContent;
|
||||
typedef nsISupports nsINode;
|
||||
typedef nsISupports nsIStyleSheet;
|
||||
typedef nsISupports nsIStyleRule;
|
||||
|
||||
[
|
||||
object,
|
||||
@@ -227,6 +238,17 @@ interface nsIInterfaceRequestor : nsISupports
|
||||
nsresult GetInterface(const nsIID *riid, void **result);
|
||||
}
|
||||
|
||||
[
|
||||
object,
|
||||
uuid(4a2abaf0-6886-11d3-9382-00104ba0fd40),
|
||||
local
|
||||
/* NOT_FROZEN */
|
||||
]
|
||||
interface nsIRunnable : nsISupports
|
||||
{
|
||||
nsresult Run();
|
||||
}
|
||||
|
||||
[
|
||||
object,
|
||||
uuid(d1899240-f9d2-11d2-bdd6-000064657374),
|
||||
@@ -239,142 +261,6 @@ interface nsISimpleEnumerator : nsISupports
|
||||
nsresult GetNext(nsISupports **_retval);
|
||||
}
|
||||
|
||||
[
|
||||
object,
|
||||
uuid(114744d9-c369-456e-b55a-52fe52880d2d),
|
||||
local
|
||||
/* NOT_FROZEN */
|
||||
]
|
||||
interface nsIArray : nsISupports
|
||||
{
|
||||
nsresult GetLength(PRUint32 *aLength);
|
||||
nsresult QueryElementAt(PRUint32 index, const nsIID *uuid, void **result);
|
||||
nsresult IndexOf(PRUint32 startIndex, nsISupports *element, PRUint32 *_retval);
|
||||
nsresult Enumerate(nsISimpleEnumerator **_retval);
|
||||
}
|
||||
|
||||
[
|
||||
object,
|
||||
uuid(af059da0-c85b-40ec-af07-ae4bfdc192cc),
|
||||
local
|
||||
/* NOT_FROZEN */
|
||||
]
|
||||
interface nsIMutableArray : nsIArray
|
||||
{
|
||||
nsresult AppendElement(nsISupports *element, PRBool weak);
|
||||
nsresult RemoveElementAt(PRUint32 index);
|
||||
nsresult InsertElementAt(nsISupports *element, PRUint32 index, PRBool weak);
|
||||
nsresult Clear();
|
||||
}
|
||||
|
||||
[
|
||||
object,
|
||||
uuid(4d12e540-83d7-11d5-90ed-0010a4e73d9a),
|
||||
local
|
||||
/* NOT_FROZEN */
|
||||
]
|
||||
interface nsIVariant : nsISupports
|
||||
{
|
||||
enum nsDataType {
|
||||
TYPE_INT8,
|
||||
TYPE_INT16,
|
||||
TYPE_INT32,
|
||||
TYPE_INT64,
|
||||
TYPE_UINT8,
|
||||
TYPE_UINT16,
|
||||
TYPE_UINT32,
|
||||
TYPE_UINT64,
|
||||
TYPE_FLOAT,
|
||||
TYPE_DOUBLE,
|
||||
TYPE_BOOL,
|
||||
TYPE_CHAR,
|
||||
TYPE_WCHAR,
|
||||
TYPE_VOID,
|
||||
TYPE_ID,
|
||||
TYPE_DOMSTRING,
|
||||
TYPE_CHAR_STR,
|
||||
TYPE_WCHAR_STR,
|
||||
TYPE_INTERFACE,
|
||||
TYPE_INTERFACE_IS,
|
||||
TYPE_ARRAY,
|
||||
TYPE_STRING_SIZE_IS,
|
||||
TYPE_WSTRING_SIZE_IS,
|
||||
TYPE_UTF8STRING,
|
||||
TYPE_CSTRING,
|
||||
TYPE_ASTRING,
|
||||
TYPE_AMPTY_ARRAY,
|
||||
TYPE_EMPTY
|
||||
};
|
||||
|
||||
nsresult GetDataType(PRUint16 *aDataType);
|
||||
nsresult GetAsInt8(PRUint8 *_retval);
|
||||
nsresult GetAsInt16(PRInt16 *_retval);
|
||||
nsresult GetAsInt32(PRInt32 *_retval);
|
||||
nsresult GetAsInt64(PRInt64 *_retval);
|
||||
nsresult GetAsUint8(PRUint8 *_retval);
|
||||
nsresult GetAsUint16(PRUint16 *_retval);
|
||||
nsresult GetAsUint32(PRUint32 *_retval);
|
||||
nsresult GetAsUint64(PRUint64 *_retval);
|
||||
nsresult GetAsFloat(float *_retval);
|
||||
nsresult GetAsDouble(double *_retval);
|
||||
nsresult GetAsBool(PRBool *_retval);
|
||||
nsresult GetAsChar(char *_retval);
|
||||
nsresult GetAsWChar(PRUnichar *_retval);
|
||||
nsresult GetAsID(nsID *retval);
|
||||
nsresult GetAsAString(nsAString *_retval);
|
||||
nsresult GetAsDOMString(nsAString *_retval);
|
||||
nsresult GetAsACString(nsACString *_retval);
|
||||
nsresult GetAsAUTF8String(nsACString *_retval);
|
||||
nsresult GetAsString(char **_retval);
|
||||
nsresult GetAsWString(PRUnichar **_retval);
|
||||
nsresult GetAsISupports(nsISupports **_retval);
|
||||
nsresult GetAsInterface(nsIID * *iid, void **iface);
|
||||
nsresult GetAsArray(PRUint16 *type, nsIID *iid, PRUint32 *count, void **ptr);
|
||||
nsresult GetAsStringWithSize(PRUint32 *size, char **str);
|
||||
nsresult GetAsWStringWithSize(PRUint32 *size, PRUnichar **str);
|
||||
}
|
||||
|
||||
[
|
||||
object,
|
||||
uuid(5586a590-8c82-11d5-90f3-0010a4e73d9a),
|
||||
local
|
||||
/* NOT_FROZEN */
|
||||
]
|
||||
interface nsIWritableVariant : nsIVariant
|
||||
{
|
||||
nsresult GetWritable(PRBool *aWritable);
|
||||
nsresult SetWritable(PRBool aWritable);
|
||||
nsresult SetAsInt8(PRUint8 aValue);
|
||||
nsresult SetAsInt16(PRInt16 aValue);
|
||||
nsresult SetAsInt32(PRInt32 aValue);
|
||||
nsresult SetAsInt64(PRInt64 aValue);
|
||||
nsresult SetAsUint8(PRUint8 aValue);
|
||||
nsresult SetAsUint16(PRUint16 aValue);
|
||||
nsresult SetAsUint32(PRUint32 aValue);
|
||||
nsresult SetAsUint64(PRUint64 aValue);
|
||||
nsresult SetAsFloat(float aValue);
|
||||
nsresult SetAsDouble(double aValue);
|
||||
nsresult SetAsBool(PRBool aValue);
|
||||
nsresult SetAsChar(char aValue);
|
||||
nsresult SetAsWChar(PRUnichar aValue);
|
||||
nsresult SetAsID(const nsID *aValue);
|
||||
nsresult SetAsAString(const nsAString *aValue);
|
||||
nsresult SetAsDOMString(const nsAString *aValue);
|
||||
nsresult SetAsACString(const nsACString *aValue);
|
||||
nsresult SetAsAUTF8String(const nsACString *aValue);
|
||||
nsresult SetAsString(const char *aValue);
|
||||
nsresult SetAsWString(const PRUnichar *aValue);
|
||||
nsresult SetAsISupports(nsISupports *aValue);
|
||||
nsresult SetAsInterface(const nsIID *iid, void *iface);
|
||||
nsresult SetAsArray(PRUint16 type, const nsIID *iid, PRUint32 count, void *ptr);
|
||||
nsresult SetAsStringWithSize(PRUint32 size, const char *str);
|
||||
nsresult SetAsWStringWithSize(PRUint32 size, const PRUnichar *str);
|
||||
nsresult SetAsVoid();
|
||||
nsresult SetAsEmpty();
|
||||
nsresult SetAsEmptyArray();
|
||||
nsresult SetFromVariant(nsIVariant *aValue);
|
||||
}
|
||||
|
||||
[
|
||||
object,
|
||||
uuid(fa9c7f6c-61b3-11d4-9877-00c04fa0cf4a),
|
||||
@@ -770,6 +656,35 @@ interface nsIDOMElementCSSInlineStyle : nsISupports
|
||||
nsresult GetStyle(nsIDOMCSSStyleDeclaration **aStyle);
|
||||
}
|
||||
|
||||
[
|
||||
object,
|
||||
uuid(f0aef489-18c5-4de6-99d5-58b3758b098c),
|
||||
local
|
||||
/* NOT_FROZEN */
|
||||
]
|
||||
interface nsIDOMNSElement : nsISupports
|
||||
{
|
||||
nsresult GetElementsByClassName(const nsAString *classes, nsIDOMNodeList **_retval);
|
||||
nsresult GetClientRects(nsIDOMClientRectList **_retval);
|
||||
nsresult GetBoundingClientRect(nsIDOMClientRect **_retval);
|
||||
nsresult GetScrollTop(PRInt32 *aScrollTop);
|
||||
nsresult SetScrollTop(PRInt32 aScrollTop);
|
||||
nsresult GetScrollLeft(PRInt32 *aScrollLeft);
|
||||
nsresult SetScrollLeft(PRInt32 aScrollLeft);
|
||||
nsresult GetScrollHeight(PRInt32 *aScrollHeight);
|
||||
nsresult GetScrollWidth(PRInt32 *aScrollWidth);
|
||||
nsresult GetClientTop(PRInt32 *aClientTop);
|
||||
nsresult GetClientLeft(PRInt32 *aClientLeft);
|
||||
nsresult GetClientHeight(PRInt32 *aClientHeight);
|
||||
nsresult GetClientWidth(PRInt32 *aClientWidth);
|
||||
nsresult GetFirstElementChild(nsIDOMElement **aFirstElementChild);
|
||||
nsresult GetLastElementChild(nsIDOMElement **aLastElementChild);
|
||||
nsresult GetPreviousElementSibling(nsIDOMElement **aPreviousElementSibling);
|
||||
nsresult GetNextElementSibling(nsIDOMElement **aNextElementSibling);
|
||||
nsresult GetChildElementCount(PRUint32 *aChildElementCount);
|
||||
nsresult GetChildren(nsIDOMNodeList **aChildren);
|
||||
}
|
||||
|
||||
cpp_quote("#undef GetClassName")
|
||||
|
||||
[
|
||||
@@ -794,7 +709,7 @@ interface nsIDOMHTMLElement : nsIDOMElement
|
||||
|
||||
[
|
||||
object,
|
||||
uuid(da83b2ec-8264-4410-8496-ada3acd2ae42),
|
||||
uuid(7f142f9a-fba7-4949-93d6-cf08a974ac51),
|
||||
local
|
||||
/* NOT_FROZEN */
|
||||
]
|
||||
@@ -807,19 +722,28 @@ interface nsIDOMNSHTMLElement : nsISupports
|
||||
nsresult GetOffsetParent(nsIDOMElement **aOffsetParent);
|
||||
nsresult GetInnerHTML(nsAString *aInnerHTML);
|
||||
nsresult SetInnerHTML(const nsAString *aInnerHTML);
|
||||
nsresult GetScrollTop(PRInt32 *aScrollTop);
|
||||
nsresult SetScrollTop(PRInt32 aScrollTop);
|
||||
nsresult GetScrollLeft(PRInt32 *aScrollLeft);
|
||||
nsresult SetScrollLeft(PRInt32 aScrollLeft);
|
||||
nsresult GetScrollHeight(PRInt32 *aScrollHeight);
|
||||
nsresult GetScrollWidth(PRInt32 *aScrollWidth);
|
||||
nsresult GetClientHeight(PRInt32 *aClientHeight);
|
||||
nsresult GetClientWidth(PRInt32 *aClientWidth);
|
||||
nsresult GetTabIndex(PRInt32 *aTabIndex);
|
||||
nsresult SetTabIndex(PRInt32 aTabIndex);
|
||||
nsresult GetContentEditable(nsAString *aContentEditable);
|
||||
nsresult SetContentEditable(const nsAString *aContentEditable);
|
||||
nsresult blur();
|
||||
nsresult focus();
|
||||
nsresult ScrollIntoView(PRBool top);
|
||||
nsresult GetSpellcheck(PRBool *aSpellcheck);
|
||||
nsresult SetSpellcheck(PRBool aSpellcheck);
|
||||
}
|
||||
|
||||
[
|
||||
object,
|
||||
uuid(a6cf9083-15b3-11d2-932e-00805f8add32),
|
||||
local
|
||||
/* FROZEN */
|
||||
]
|
||||
interface nsIDOMHTMLCollection : nsISupports
|
||||
{
|
||||
nsresult GetLength(PRUint32 *aLength);
|
||||
nsresult Item(PRUint32 index, nsIDOMNode **_retval);
|
||||
nsresult NamedItem(const nsAString *name, nsIDOMNode **_retval);
|
||||
}
|
||||
|
||||
[
|
||||
@@ -871,6 +795,28 @@ interface nsIDOMDocumentFragment : nsIDOMNode
|
||||
{
|
||||
}
|
||||
|
||||
[
|
||||
object,
|
||||
uuid(f51ebade-8b1a-11d3-aae7-0010830123b4),
|
||||
local
|
||||
/* FROZEN */
|
||||
]
|
||||
interface nsIDOMAbstractView : nsISupports
|
||||
{
|
||||
nsresult GetDocument(nsIDOMDocumentView **aDocument);
|
||||
}
|
||||
|
||||
[
|
||||
object,
|
||||
uuid(0b9341f3-95d4-4fa4-adcd-e119e0db2889),
|
||||
local
|
||||
/* NOT_FROZEN */
|
||||
]
|
||||
interface nsIDOMViewCSS : nsIDOMAbstractView
|
||||
{
|
||||
nsresult GetComputedStyle(nsIDOMElement *elt, const nsAString *pseudoElt, nsIDOMCSSStyleDeclaration **_retval);
|
||||
}
|
||||
|
||||
[
|
||||
object,
|
||||
uuid(a6cf9075-15b3-11d2-932e-00805f8add32),
|
||||
@@ -902,6 +848,34 @@ interface nsIDOMDocument : nsIDOMNode
|
||||
nsresult GetElementById(const nsAString *elementId, nsIDOMElement **_retval);
|
||||
}
|
||||
|
||||
[
|
||||
object,
|
||||
uuid(533a8131-8d0c-4ebf-990b-7fad7cd51466),
|
||||
local
|
||||
/* NOT_FROZEN */
|
||||
]
|
||||
interface nsIDOMNSDocument : nsISupports
|
||||
{
|
||||
nsresult GetCharacterSet(nsAString *aCharacterSet);
|
||||
nsresult GetDir(nsAString *aDir);
|
||||
nsresult SetDir(const nsAString *aDir);
|
||||
nsresult GetLocation(nsIDOMLocation **aLocation);
|
||||
nsresult GetTitle(nsAString *aTitle);
|
||||
nsresult SetTitle(const nsAString *aTitle);
|
||||
nsresult GetContentType(nsAString *aContentType);
|
||||
nsresult GetLastModified(nsAString *aLastModified);
|
||||
nsresult GetReferrer(nsAString *aReferrer);
|
||||
nsresult GetBoxObjectFor(nsIDOMElement *elt, nsIBoxObject **_retval);
|
||||
nsresult HasFocus(PRBool *_retval);
|
||||
nsresult GetActiveElement(nsIDOMElement **aActiveElement);
|
||||
nsresult GetElementsByClassName(const nsAString *classes, nsIDOMNodeList **_retval);
|
||||
nsresult ElementFromPoint(PRInt32 x, PRInt32 y, nsIDOMElement **_retval);
|
||||
|
||||
/* Wine extensions */
|
||||
nsresult WineAddObserver(nsIDocumentObserver *aObserver);
|
||||
nsresult WineAddScriptRunner(nsIRunnable *aRunnable);
|
||||
}
|
||||
|
||||
[
|
||||
object,
|
||||
uuid(a6cf9084-15b3-11d2-932e-00805f8add32),
|
||||
@@ -955,7 +929,7 @@ interface nsIDOMNSHTMLDocument : nsISupports
|
||||
nsresult SetDomain(const nsAString *aDomain);
|
||||
nsresult GetEmbeds(nsIDOMHTMLCollection **aEmbeds);
|
||||
nsresult GetSelection(nsAString *_retval);
|
||||
nsresult Open(nsIDOMDocument **_retval);
|
||||
nsresult Open(nsACString *aContentType, PRBool aReplace, nsIDOMDocument **_retval);
|
||||
nsresult Write();
|
||||
nsresult Writeln();
|
||||
nsresult Clear();
|
||||
@@ -987,6 +961,17 @@ interface nsIDOMDocumentStyle : nsISupports
|
||||
nsresult GetStyleSheets(nsIDOMStyleSheetList **aStyleSheets);
|
||||
}
|
||||
|
||||
[
|
||||
object,
|
||||
uuid(1acdb2ba-1dd2-11b2-95bc-9542495d2569),
|
||||
local
|
||||
/* FROZEN */
|
||||
]
|
||||
interface nsIDOMDocumentView : nsISupports
|
||||
{
|
||||
nsresult GetDefaultView(nsIDOMAbstractView **aDefaultView);
|
||||
}
|
||||
|
||||
[
|
||||
object,
|
||||
uuid(a6cf90ce-15b3-11d2-932e-00805f8add32),
|
||||
@@ -1030,17 +1015,15 @@ interface nsIDOMRange : nsISupports
|
||||
|
||||
[
|
||||
object,
|
||||
uuid(a6cf90f2-15b3-11d2-932e-00805f8add32),
|
||||
uuid(59188642-23b4-41d6-bde1-302c3906d1f0),
|
||||
local
|
||||
/* NOT_FROZEN */
|
||||
]
|
||||
interface nsIDOMNSRange : nsISupports
|
||||
{
|
||||
nsresult CreateContextualFragment([in] const nsAString *fragment, [out] nsIDOMDocumentFragment **_retval);
|
||||
nsresult IsPointInRange([in] nsIDOMNode *parent, [in] PRInt32 offset, [out] PRBool *_retval);
|
||||
nsresult ComparePoint([in] nsIDOMNode *parent, [in] PRInt32 offset, [out] PRInt16 *_retval);
|
||||
nsresult IntersectsNode([in] nsIDOMNode *n, [out] PRBool *_retval);
|
||||
nsresult CompareNode([in] nsIDOMNode *n, [out] PRUint16 *_retval);
|
||||
nsresult nSDetach();
|
||||
}
|
||||
|
||||
|
||||
@@ -1299,6 +1282,7 @@ interface nsIDOMHTMLScriptElement : nsIDOMHTMLElement
|
||||
object,
|
||||
uuid(a6cf90ab-15b3-11d2-932e-00805f8add32),
|
||||
local
|
||||
/* FROZEN */
|
||||
]
|
||||
interface nsIDOMHTMLImageElement : nsIDOMHTMLElement
|
||||
{
|
||||
@@ -1328,6 +1312,106 @@ interface nsIDOMHTMLImageElement : nsIDOMHTMLElement
|
||||
nsresult SetWidth(PRInt32 aWidth);
|
||||
}
|
||||
|
||||
[
|
||||
object,
|
||||
uuid(a6cf90b2-15b3-11d2-932e-00805f8add32),
|
||||
local
|
||||
/* FROZEN */
|
||||
]
|
||||
interface nsIDOMHTMLTableElement : nsIDOMHTMLElement
|
||||
{
|
||||
nsresult GetCaption(nsIDOMHTMLTableCaptionElement **aCaption);
|
||||
nsresult SetCaption(nsIDOMHTMLTableCaptionElement *aCaption);
|
||||
nsresult GetTHead(nsIDOMHTMLTableSectionElement **aTHead);
|
||||
nsresult SetTHead(nsIDOMHTMLTableSectionElement *aTHead);
|
||||
nsresult GetTFoot(nsIDOMHTMLTableSectionElement **aTFoot);
|
||||
nsresult SetTFoot(nsIDOMHTMLTableSectionElement *aTFoot);
|
||||
nsresult GetRows(nsIDOMHTMLCollection **aRows);
|
||||
nsresult GetTBodies(nsIDOMHTMLCollection **aTBodies);
|
||||
nsresult GetAlign(nsAString *aAlign);
|
||||
nsresult SetAlign(const nsAString *aAlign);
|
||||
nsresult GetBgColor(nsAString *aBgColor);
|
||||
nsresult SetBgColor(const nsAString *aBgColor);
|
||||
nsresult GetBorder(nsAString *aBorder);
|
||||
nsresult SetBorder(const nsAString *aBorder);
|
||||
nsresult GetCellPadding(nsAString *aCellPadding);
|
||||
nsresult SetCellPadding(const nsAString *aCellPadding);
|
||||
nsresult GetCellSpacing(nsAString *aCellSpacing);
|
||||
nsresult SetCellSpacing(const nsAString *aCellSpacing);
|
||||
nsresult GetFrame(nsAString *aFrame);
|
||||
nsresult SetFrame(const nsAString *aFrame);
|
||||
nsresult GetRules(nsAString *aRules);
|
||||
nsresult SetRules(const nsAString *aRules);
|
||||
nsresult GetSummary(nsAString *aSummary);
|
||||
nsresult SetSummary(const nsAString *aSummary);
|
||||
nsresult GetWidth(nsAString *aWidth);
|
||||
nsresult SetWidth(const nsAString *aWidth);
|
||||
nsresult CreateTHead(nsIDOMHTMLElement **_retval);
|
||||
nsresult DeleteTHead();
|
||||
nsresult CreateTFoot(nsIDOMHTMLElement **_retval);
|
||||
nsresult DeleteTFoot();
|
||||
nsresult CreateCaption(nsIDOMHTMLElement **_retval);
|
||||
nsresult DeleteCaption();
|
||||
nsresult InsertRow(PRInt32 index, nsIDOMHTMLElement **_retval);
|
||||
nsresult DeleteRow(PRInt32 index);
|
||||
}
|
||||
|
||||
[
|
||||
object,
|
||||
uuid(a6cf90b6-15b3-11d2-932e-00805f8add32),
|
||||
local
|
||||
/* FROZEN */
|
||||
]
|
||||
interface nsIDOMHTMLTableRowElement : nsIDOMHTMLElement
|
||||
{
|
||||
nsresult GetRowIndex(PRInt32 *aRowIndex);
|
||||
nsresult GetSectionRowIndex(PRInt32 *aSectionRowIndex);
|
||||
nsresult GetCells(nsIDOMHTMLCollection **aCells);
|
||||
nsresult GetAlign(nsAString *aAlign);
|
||||
nsresult SetAlign(const nsAString *aAlign);
|
||||
nsresult GetBgColor(nsAString *aBgColor);
|
||||
nsresult SetBgColor(const nsAString *aBgColor);
|
||||
nsresult GetCh(nsAString *aCh);
|
||||
nsresult SetCh(const nsAString *aCh);
|
||||
nsresult GetChOff(nsAString *aChOff);
|
||||
nsresult SetChOff(const nsAString *aChOff);
|
||||
nsresult GetVAlign(nsAString *aVAlign);
|
||||
nsresult SetVAlign(const nsAString *aVAlign);
|
||||
nsresult InsertCell(PRInt32 index, nsIDOMHTMLElement **_retval);
|
||||
nsresult DeleteCell(PRInt32 index);
|
||||
}
|
||||
|
||||
[
|
||||
object,
|
||||
uuid(a6cf90ba-15b3-11d2-932e-00805f8add32),
|
||||
local
|
||||
/* FROZEN */
|
||||
]
|
||||
interface nsIDOMHTMLIFrameElement : nsIDOMHTMLElement
|
||||
{
|
||||
nsresult GetAlign(nsAString *aAlign);
|
||||
nsresult SetAlign(const nsAString *aAlign);
|
||||
nsresult GetFrameBorder(nsAString *aFrameBorder);
|
||||
nsresult SetFrameBorder(const nsAString *aFrameBorder);
|
||||
nsresult GetHeight(nsAString *aHeight);
|
||||
nsresult SetHeight(const nsAString *aHeight);
|
||||
nsresult GetLongDesc(nsAString *aLongDesc);
|
||||
nsresult SetLongDesc(const nsAString *aLongDesc);
|
||||
nsresult GetMarginHeight(nsAString *aMarginHeight);
|
||||
nsresult SetMarginHeight(const nsAString *aMarginHeight);
|
||||
nsresult GetMarginWidth(nsAString *aMarginWidth);
|
||||
nsresult SetMarginWidth(const nsAString *aMarginWidth);
|
||||
nsresult GetName(nsAString *aName);
|
||||
nsresult SetName(const nsAString *aName);
|
||||
nsresult GetScrolling(nsAString *aScrolling);
|
||||
nsresult SetScrolling(const nsAString *aScrolling);
|
||||
nsresult GetSrc(nsAString *aSrc);
|
||||
nsresult SetSrc(const nsAString *aSrc);
|
||||
nsresult GetWidth(nsAString *aWidth);
|
||||
nsresult SetWidth(const nsAString *aWidth);
|
||||
nsresult GetContentDocument(nsIDOMDocument **aContentDocument);
|
||||
}
|
||||
|
||||
[
|
||||
object,
|
||||
uuid(94928ab3-8b63-11d3-989d-001083010e9b),
|
||||
@@ -1377,6 +1461,7 @@ interface nsIWebBrowser : nsISupports
|
||||
nsresult GetContentDOMWindow(nsIDOMWindow **aContentDOMWindow);
|
||||
}
|
||||
|
||||
cpp_quote("#define SETUP_ALLOW_JAVASCRIPT 2")
|
||||
cpp_quote("#define SETUP_IS_CHROME_WRAPPER 7")
|
||||
|
||||
[
|
||||
@@ -1455,7 +1540,7 @@ interface nsIWebNavigation : nsISupports
|
||||
|
||||
[
|
||||
object,
|
||||
uuid(f1094df6-ce0e-42c9-9847-2f663172c38d),
|
||||
uuid(5af07661-6477-4235-8814-4a45215855b8),
|
||||
local
|
||||
/* NOT_FROZEN */
|
||||
]
|
||||
@@ -1466,7 +1551,7 @@ interface nsIPrintSettings : nsISupports
|
||||
nsresult SetPrintOptions(PRInt32 aType, PRBool aTurnOnOff);
|
||||
nsresult GetPrintOptions(PRInt32 aType, PRBool *_retval);
|
||||
nsresult GetPrintOptionsBits(PRInt32 *_retval);
|
||||
nsresult GetPageSizeInTwips(PRInt32 *aWidth, PRInt32 *aHeight);
|
||||
nsresult GetEffectivePageSize(double *aWidth, double *aHeight);
|
||||
nsresult Clone(nsIPrintSettings **_retval);
|
||||
nsresult Assign(nsIPrintSettings *aPS);
|
||||
nsresult GetPrintSession(nsIPrintSession **aPrintSession);
|
||||
@@ -1475,6 +1560,14 @@ interface nsIPrintSettings : nsISupports
|
||||
nsresult SetStartPageRange(PRInt32 aStartPageRange);
|
||||
nsresult GetEndPageRange(PRInt32 *aEndPageRange);
|
||||
nsresult SetEndPageRange(PRInt32 aEndPageRange);
|
||||
nsresult GetEdgeTop(double *aEdgeTop);
|
||||
nsresult SetEdgeTop(double aEdgeTop);
|
||||
nsresult GetEdgeLeft(double *aEdgeLeft);
|
||||
nsresult SetEdgeLeft(double aEdgeLeft);
|
||||
nsresult GetEdgeBottom(double *aEdgeBottom);
|
||||
nsresult SetEdgeBottom(double aEdgeBottom);
|
||||
nsresult GetEdgeRight(double *aEdgeRight);
|
||||
nsresult SetEdgeRight(double aEdgeRight);
|
||||
nsresult GetMarginTop(double *aMarginTop);
|
||||
nsresult SetMarginTop(double aMarginTop);
|
||||
nsresult GetMarginLeft(double *aMarginLeft);
|
||||
@@ -1483,6 +1576,14 @@ interface nsIPrintSettings : nsISupports
|
||||
nsresult SetMarginBottom(double aMarginBottom);
|
||||
nsresult GetMarginRight(double *aMarginRight);
|
||||
nsresult SetMarginRight(double aMarginRight);
|
||||
nsresult GetUnwriteableMarginTop(double *aUnwriteableMarginTop);
|
||||
nsresult SetUnwriteableMarginTop(double aUnwriteableMarginTop);
|
||||
nsresult GetUnwriteableMarginLeft(double *aUnwriteableMarginLeft);
|
||||
nsresult SetUnwriteableMarginLeft(double aUnwriteableMarginLeft);
|
||||
nsresult GetUnwriteableMarginBottom(double *aUnwriteableMarginBottom);
|
||||
nsresult SetUnwriteableMarginBottom(double aUnwriteableMarginBottom);
|
||||
nsresult GetUnwriteableMarginRight(double *aUnwriteableMarginRight);
|
||||
nsresult SetUnwriteableMarginRight(double aUnwriteableMarginRight);
|
||||
nsresult GetScaling(double *aScaling);
|
||||
nsresult SetScaling(double aScaling);
|
||||
nsresult GetPrintBGColors(PRBool *aPrintBGColors);
|
||||
@@ -1545,8 +1646,6 @@ interface nsIPrintSettings : nsISupports
|
||||
nsresult SetPrintReversed(PRBool aPrintReversed);
|
||||
nsresult GetPrintInColor(PRBool *aPrintInColor);
|
||||
nsresult SetPrintInColor(PRBool aPrintInColor);
|
||||
nsresult GetPaperSize(PRInt32 *aPaperSize);
|
||||
nsresult SetPaperSize(PRInt32 aPaperSize);
|
||||
nsresult GetOrientation(PRInt32 *aOrientation);
|
||||
nsresult SetOrientation(PRInt32 aOrientation);
|
||||
nsresult GetPrintCommand(PRUnichar **aPrintCommand);
|
||||
@@ -1559,6 +1658,8 @@ interface nsIPrintSettings : nsISupports
|
||||
nsresult SetPrintToFile(PRBool aPrintToFile);
|
||||
nsresult GetToFileName(PRUnichar **aToFileName);
|
||||
nsresult SetToFileName(const PRUnichar *aToFileName);
|
||||
nsresult GetOutputFormat(PRInt16 *aOutputFormat);
|
||||
nsresult SetOutputFormat(PRInt16 aOutputFormat);
|
||||
nsresult GetPrintPageDelay(PRInt32 *aPrintPageDelay);
|
||||
nsresult SetPrintPageDelay(PRInt32 aPrintPageDelay);
|
||||
nsresult GetIsInitializedFromPrinter(PRBool *aIsInitializedFromPrinter);
|
||||
@@ -1566,7 +1667,12 @@ interface nsIPrintSettings : nsISupports
|
||||
nsresult GetIsInitializedFromPrefs(PRBool *aIsInitializedFromPrefs);
|
||||
nsresult SetIsInitializedFromPrefs(PRBool aIsInitializedFromPrefs);
|
||||
nsresult SetMarginInTwips(nsMargin *aMargin);
|
||||
nsresult SetEdgeInTwips(nsMargin *aEdge);
|
||||
nsresult GetMarginInTwips(nsMargin *aMargin);
|
||||
nsresult GetEdgeInTwips(nsMargin *aEdge);
|
||||
nsresult SetupSilentPrinting();
|
||||
nsresult SetUnwriteableMarginInTwips(nsMargin *aEdge);
|
||||
nsresult GetUnwriteableMarginInTwips(nsMargin *aEdge);
|
||||
}
|
||||
|
||||
[
|
||||
@@ -1760,14 +1866,22 @@ interface nsIIOService : nsISupports
|
||||
|
||||
[
|
||||
object,
|
||||
uuid(f0c5dddb-4713-4603-af2d-bf671838996b),
|
||||
uuid(57322c6f-f4ec-4e46-8253-b74be220de16),
|
||||
local,
|
||||
/* NOT_FROZEN */
|
||||
]
|
||||
interface nsINetUtil : nsISupports
|
||||
{
|
||||
nsresult ParseContentType(const nsACString *aTypeHeader, nsACString *aCharset,
|
||||
PRBool *aHadCharset, nsACString *aContentType);
|
||||
PRBool *aHadCharset, nsACString *_retval);
|
||||
nsresult ProtocolHasFlags(nsIURI *aURI, PRUint32 aFlag, PRBool *_retval);
|
||||
nsresult URIChainHasFlags(nsIURI *aURI, PRUint32 aFlags, PRBool *_retval);
|
||||
nsresult ToImmutableURI(nsIURI *aURI, nsIURI **_retval);
|
||||
nsresult EscapeString(const nsACString *aString, PRUint32 aEscapeType, nsACString *_retval);
|
||||
nsresult EscapeURL(const nsACString *aStr, PRUint32 aFlags, nsACString *_retval);
|
||||
nsresult UnescapeString(const nsACString *aStr, PRUint32 aFlags, nsACString *_retval);
|
||||
nsresult ExtractCharsetFromContentType(const nsACString *aTypeHeader, nsACString *aCharset,
|
||||
PRInt32 *aCharsetStart, PRInt32 *aCharsetEnd, PRBool *_retval);
|
||||
}
|
||||
|
||||
[
|
||||
@@ -2091,7 +2205,7 @@ interface nsIWindowWatcher : nsISupports
|
||||
|
||||
[
|
||||
object,
|
||||
uuid(d39fd2b4-3978-45d2-a4be-ba448171b61b),
|
||||
uuid(274cd32e-3675-47e1-9d8a-fc6504ded9ce),
|
||||
local
|
||||
/* NOT_FROZEN */
|
||||
]
|
||||
@@ -2099,12 +2213,16 @@ interface nsIEditingSession : nsISupports
|
||||
{
|
||||
nsresult GetEditorStatus(PRUint32 *aEditorStatus);
|
||||
nsresult MakeWindowEditable(nsIDOMWindow *window, const char *aEditorType,
|
||||
PRBool doAfterUriLoad);
|
||||
PRBool doAfterUriLoad, PRBool aMakeWholeDocumentEditable, PRBool aInteractive);
|
||||
nsresult WindowIsEditable(nsIDOMWindow *window, PRBool *_retval);
|
||||
nsresult GetEditorForWindow(nsIDOMWindow *window, nsIEditor **_retval);
|
||||
nsresult SetupEditorOnWindow(nsIDOMWindow *window);
|
||||
nsresult TearDownEditorOnWindow(nsIDOMWindow *window);
|
||||
nsresult SetEditorOnControllers(nsIDOMWindow *aWindow, nsIEditor *aEditor);
|
||||
nsresult DisableJSAndPlugins(nsIDOMWindow *aWindow);
|
||||
nsresult RestoreJSAndPlugins(nsIDOMWindow *aWindow);
|
||||
nsresult DetachFromWindow(nsIDOMWindow *aWindow);
|
||||
nsresult ReattachToWindow(nsIDOMWindow *aWindow);
|
||||
}
|
||||
|
||||
[
|
||||
@@ -2180,13 +2298,14 @@ interface nsIController : nsISupports
|
||||
|
||||
[
|
||||
object,
|
||||
uuid(d650439a-ca29-410d-a906-b0557fb62fcd),
|
||||
uuid(34769de0-30d0-4cef-894a-fcd8bb27c4b4),
|
||||
local
|
||||
/* NOT_FROZEN */
|
||||
]
|
||||
interface nsIContentSerializer : nsISupports
|
||||
{
|
||||
nsresult Init(PRUint32 flags, PRUint32 aWrapColumn, const char* aCharSet, PRBool aIsCopying);
|
||||
nsresult Init(PRUint32 flags, PRUint32 aWrapColumn, const char* aCharSet, PRBool aIsCopying,
|
||||
PRBool aIsWholeDocument);
|
||||
nsresult AppendText(nsIDOMText *aText, PRInt32 aStartOffset, PRInt32 aEndOffset, nsAString *aStr);
|
||||
nsresult AppendCDATASection(nsIDOMCDATASection *aCDATASection, PRInt32 aStartOffset,
|
||||
PRInt32 aEndOffset, nsAString *aStr);
|
||||
@@ -2195,7 +2314,8 @@ interface nsIContentSerializer : nsISupports
|
||||
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 AppendElementStart(nsIDOMElement *aElement, nsIDOMElement *aOriginalElement,
|
||||
nsAString *aStr);
|
||||
nsresult AppendElementEnd(nsIDOMElement *aElement, nsAString *aStr);
|
||||
nsresult Flush(nsAString *aStr);
|
||||
nsresult AppendDocumentStart(nsIDOMDocument *aDocument, nsAString *aStr);
|
||||
@@ -2203,32 +2323,9 @@ interface nsIContentSerializer : nsISupports
|
||||
|
||||
[
|
||||
object,
|
||||
uuid(68b97c56-2289-48ac-a9e1-72c30fd3dba2),
|
||||
local
|
||||
]
|
||||
interface nsIScriptContainer : nsISupports
|
||||
{
|
||||
typedef void *JSObject;
|
||||
|
||||
nsresult GetContext(void **aContext);
|
||||
nsresult GetGlobalObject(void **aGlobalObject);
|
||||
nsresult CompileScript(const PRUnichar *aText, PRInt32 aTextLength, void *aScopeObject,
|
||||
nsIPrincipal *aPrincipal, const char *aURL, PRUint32 aLineNo, PRUint32 aVersion, void **_retval);
|
||||
nsresult ExecuteScript(void *aScriptObject, void *aScopeObject, nsAString *aRetVal, PRBool *aIsUndefined);
|
||||
nsresult CompileFunction(void *aTarget, const nsACString *aName, PRUint32 aArgCount,
|
||||
const char **aArgArray, const nsAString *aBody, const char *aURL, PRInt32 aLineNo,
|
||||
PRBool aShared, void* *_retval);
|
||||
nsresult CallFunction(nsISupports *aTarget, void *aScope, void *aHandler, nsIArray *argv,
|
||||
nsIVariant **_retval);
|
||||
nsresult BindEventHandler(nsISupports *aTarget, void *aScope, nsIAtom *aName, void *aHandler);
|
||||
nsresult HoldScriptObject(void *aObject);
|
||||
nsresult DropScriptObject(void *aObject);
|
||||
}
|
||||
|
||||
[
|
||||
object,
|
||||
uuid(D4882FFB-E927-408b-96BE-D4391B456FA9),
|
||||
uuid(96b60ba0-634a-41e4-928e-78ab0b3c4b46),
|
||||
local
|
||||
/* NOT_FROZEN */
|
||||
]
|
||||
interface nsIEditor : nsISupports
|
||||
{
|
||||
@@ -2256,8 +2353,9 @@ interface nsIEditor : nsISupports
|
||||
nsresult SetDocumentCharacterSet([in] const nsACString *val);
|
||||
nsresult ResetModificationCount();
|
||||
nsresult GetModificationCount([out] PRInt32 *_retval);
|
||||
nsresult IncrementModificationCount([in] long aModCount);
|
||||
nsresult IncrementModificationCount([in] PRInt32 aModCount);
|
||||
nsresult GetTransactionManager([out] nsITransactionManager **_retval);
|
||||
nsresult SetTransactionManager(nsITransactionManager *aTransactionManager);
|
||||
nsresult DoTransaction([in] nsITransaction *txn);
|
||||
nsresult EnableUndo([in] PRBool enable);
|
||||
nsresult Undo([in] PRUint32 count);
|
||||
@@ -2271,6 +2369,8 @@ interface nsIEditor : nsISupports
|
||||
nsresult ShouldTxnSetSelection([out] PRBool *_retval);
|
||||
nsresult SetShouldTxnSetSelection([in] PRBool should);
|
||||
nsresult GetInlineSpellChecker([out] nsIInlineSpellChecker **_retval);
|
||||
nsresult SyncRealTimeSpell();
|
||||
nsresult SetSpellcheckUserOverride(PRBool enable);
|
||||
nsresult Cut();
|
||||
nsresult CanCut([out] PRBool *_retval);
|
||||
nsresult Copy();
|
||||
@@ -2306,12 +2406,14 @@ interface nsIEditor : nsISupports
|
||||
nsresult DumpContentTree();
|
||||
nsresult DebugDumpContent();
|
||||
nsresult DebugUnitTests([out] PRInt32 *outNumTests, [out] PRInt32 *outNumTestsFailed);
|
||||
PRBool IsModifiableNode(nsIDOMNode *aNode);
|
||||
}
|
||||
|
||||
[
|
||||
object,
|
||||
uuid(afc36593-5787-4420-93d9-b2c0ccbf0cad),
|
||||
local
|
||||
/* NOT_FROZEN */
|
||||
]
|
||||
interface nsIHTMLEditor : nsISupports
|
||||
{
|
||||
@@ -2375,6 +2477,57 @@ interface nsIHTMLEditor : nsISupports
|
||||
nsresult SetReturnInParagraphCreatesNewParagraph([in] PRBool prb);
|
||||
}
|
||||
|
||||
[
|
||||
object,
|
||||
uuid(32e68316-67d4-44a5-8d35-0d390fa9df11),
|
||||
local
|
||||
/* NOT_FROZEN */
|
||||
]
|
||||
interface nsIMutationObserver : nsISupports
|
||||
{
|
||||
void CharacterDataWillChange(nsIDocument *aDocument, nsIContent *aContent,
|
||||
void /*CharacterDataChangeInfo*/ *aInfo);
|
||||
void CharacterDataChanged(nsIDocument *aDocument, nsIContent *aContent,
|
||||
void /*CharacterDataChangeInfo*/ *aInfo);
|
||||
void AttributeChanged(nsIDocument *aDocument, nsIContent *aContent, PRInt32 aNameSpaceID,
|
||||
nsIAtom *aAttribute, PRInt32 aModType, PRUint32 aStateMask);
|
||||
void ContentAppended(nsIDocument *aDocument, nsIContent *aContainer, PRInt32 aNewIndexInContainer);
|
||||
void ContentInserted(nsIDocument *aDocument, nsIContent *aContainer, nsIContent *aChild,
|
||||
PRInt32 aIndexInContainer);
|
||||
void ContentRemoved(nsIDocument *aDocument, nsIContent *aContainer, nsIContent *aChild,
|
||||
PRInt32 aIndexInContainer);
|
||||
void NodeWillBeDestroyed(const nsINode *aNode);
|
||||
void ParentChainChanged(nsIContent *aContent);
|
||||
}
|
||||
|
||||
[
|
||||
object,
|
||||
uuid(4e14e321-a4bb-49f8-a57a-2363668d14d0),
|
||||
local
|
||||
/* NOT_FROZEN */
|
||||
]
|
||||
interface nsIDocumentObserver : nsIMutationObserver
|
||||
{
|
||||
typedef int nsUpdateType;
|
||||
|
||||
void BeginUpdate(nsIDocument *aDocument, nsUpdateType aUpdateType);
|
||||
void EndUpdate(nsIDocument *aDocument, nsUpdateType aUpdateType);
|
||||
void BeginLoad(nsIDocument *aDocument);
|
||||
void EndLoad(nsIDocument *aDocument);
|
||||
void ContentStatesChanged(nsIDocument *aDocument, nsIContent *aContent1, nsIContent *aContent2,
|
||||
PRInt32 aStateMask);
|
||||
void StyleSheetAdded(nsIDocument *aDocument, nsIStyleSheet *aStyleSheet, PRBool aDocumentSheet);
|
||||
void StyleSheetRemoved(nsIDocument *aDocument, nsIStyleSheet *aStyleSheet, PRBool aDocumentSheet);
|
||||
void StyleSheetApplicableStateChanged(nsIDocument *aDocument, nsIStyleSheet *aStyleSheet,
|
||||
PRBool aApplicable);
|
||||
void StyleRuleChanged(nsIDocument *aDocument, nsIStyleSheet *aStyleSheet, nsIStyleRule *aOldStyleRule,
|
||||
nsIStyleRule *aNewStyleRule);
|
||||
void StyleRuleAdded(nsIDocument *aDocument, nsIStyleSheet *aStyleSheet, nsIStyleRule *aStyleRule);
|
||||
void StyleRuleRemoved(nsIDocument *aDocument, nsIStyleSheet *aStyleSheet, nsIStyleRule *aStyleRule);
|
||||
void BindToDocument(nsIDocument *aDocument, nsIContent *aContent);
|
||||
void DoneAddingContent(nsIContent *aContent, PRBool aHaveNotified);
|
||||
}
|
||||
|
||||
/*
|
||||
* NOTE:
|
||||
* This is a private Wine interface that is implemented by our implementation
|
||||
|
||||
+135
-36
@@ -47,6 +47,7 @@ static const IID NS_IOSERVICE_CID =
|
||||
{0x9ac9e770, 0x18bc, 0x11d3, {0x93, 0x37, 0x00, 0x10, 0x4b, 0xa0, 0xfd, 0x40}};
|
||||
|
||||
static nsIIOService *nsio = NULL;
|
||||
static nsINetUtil *net_util;
|
||||
|
||||
static const WCHAR about_blankW[] = {'a','b','o','u','t',':','b','l','a','n','k',0};
|
||||
|
||||
@@ -67,6 +68,23 @@ typedef struct {
|
||||
|
||||
static nsresult create_uri(nsIURI*,NSContainer*,nsIWineURI**);
|
||||
|
||||
HRESULT nsuri_to_url(LPCWSTR nsuri, BSTR *ret)
|
||||
{
|
||||
const WCHAR *ptr = nsuri;
|
||||
|
||||
static const WCHAR wine_prefixW[] = {'w','i','n','e',':'};
|
||||
|
||||
if(!strncmpW(nsuri, wine_prefixW, sizeof(wine_prefixW)/sizeof(WCHAR)))
|
||||
ptr += sizeof(wine_prefixW)/sizeof(WCHAR);
|
||||
|
||||
*ret = SysAllocString(ptr);
|
||||
if(!*ret)
|
||||
return E_OUTOFMEMORY;
|
||||
|
||||
TRACE("%s -> %s\n", debugstr_w(nsuri), debugstr_w(*ret));
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static BOOL exec_shldocvw_67(HTMLDocument *doc, LPCWSTR url)
|
||||
{
|
||||
IOleCommandTarget *cmdtrg = NULL;
|
||||
@@ -201,6 +219,8 @@ static nsrefcnt NSAPI nsChannel_Release(nsIHttpChannel *iface)
|
||||
nsIChannel_Release(This->channel);
|
||||
if(This->http_channel)
|
||||
nsIHttpChannel_Release(This->http_channel);
|
||||
if(This->owner)
|
||||
nsISupports_Release(This->owner);
|
||||
if(This->post_data_stream)
|
||||
nsIInputStream_Release(This->post_data_stream);
|
||||
if(This->load_group)
|
||||
@@ -399,8 +419,11 @@ static nsresult NSAPI nsChannel_GetOwner(nsIHttpChannel *iface, nsISupports **aO
|
||||
if(This->channel)
|
||||
return nsIChannel_GetOwner(This->channel, aOwner);
|
||||
|
||||
FIXME("default action not implemented\n");
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
if(This->owner)
|
||||
nsISupports_AddRef(This->owner);
|
||||
*aOwner = This->owner;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
static nsresult NSAPI nsChannel_SetOwner(nsIHttpChannel *iface, nsISupports *aOwner)
|
||||
@@ -412,8 +435,13 @@ static nsresult NSAPI nsChannel_SetOwner(nsIHttpChannel *iface, nsISupports *aOw
|
||||
if(This->channel)
|
||||
return nsIChannel_SetOwner(This->channel, aOwner);
|
||||
|
||||
FIXME("default action not implemented\n");
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
if(aOwner)
|
||||
nsISupports_AddRef(aOwner);
|
||||
if(This->owner)
|
||||
nsISupports_Release(This->owner);
|
||||
This->owner = aOwner;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
static nsresult NSAPI nsChannel_GetNotificationCallbacks(nsIHttpChannel *iface,
|
||||
@@ -739,25 +767,6 @@ static nsresult async_open(nsChannel *This, NSContainer *container, nsIStreamLis
|
||||
HRESULT hres;
|
||||
|
||||
if(This->channel) {
|
||||
if(This->post_data_stream) {
|
||||
nsIUploadChannel *upload_channel;
|
||||
|
||||
nsres = nsIChannel_QueryInterface(This->channel, &IID_nsIUploadChannel,
|
||||
(void**)&upload_channel);
|
||||
if(NS_SUCCEEDED(nsres)) {
|
||||
nsACString empty_string;
|
||||
nsACString_Init(&empty_string, "");
|
||||
|
||||
nsres = nsIUploadChannel_SetUploadStream(upload_channel, This->post_data_stream,
|
||||
&empty_string, -1);
|
||||
nsIUploadChannel_Release(upload_channel);
|
||||
if(NS_FAILED(nsres))
|
||||
WARN("SetUploadStream failed: %08x\n", nsres);
|
||||
|
||||
nsACString_Finish(&empty_string);
|
||||
}
|
||||
}
|
||||
|
||||
nsres = nsIChannel_AsyncOpen(This->channel, listener, context);
|
||||
|
||||
if(mon)
|
||||
@@ -1145,6 +1154,7 @@ static nsresult NSAPI nsUploadChannel_SetUploadStream(nsIUploadChannel *iface,
|
||||
{
|
||||
nsChannel *This = NSUPCHANNEL_THIS(iface);
|
||||
const char *content_type;
|
||||
nsresult nsres;
|
||||
|
||||
TRACE("(%p)->(%p %p %d)\n", This, aStream, aContentType, aContentLength);
|
||||
|
||||
@@ -1160,9 +1170,25 @@ static nsresult NSAPI nsUploadChannel_SetUploadStream(nsIUploadChannel *iface,
|
||||
if(aContentLength != -1)
|
||||
FIXME("Unsupported acontentLength = %d\n", aContentLength);
|
||||
|
||||
if(This->post_data_stream)
|
||||
nsIInputStream_Release(This->post_data_stream);
|
||||
This->post_data_stream = aStream;
|
||||
if(aStream)
|
||||
nsIInputStream_AddRef(aStream);
|
||||
This->post_data_stream = aStream;
|
||||
|
||||
if(This->post_data_stream) {
|
||||
nsIUploadChannel *upload_channel;
|
||||
|
||||
nsres = nsIChannel_QueryInterface(This->channel, &IID_nsIUploadChannel,
|
||||
(void**)&upload_channel);
|
||||
if(NS_SUCCEEDED(nsres)) {
|
||||
nsres = nsIUploadChannel_SetUploadStream(upload_channel, aStream, aContentType, aContentLength);
|
||||
nsIUploadChannel_Release(upload_channel);
|
||||
if(NS_FAILED(nsres))
|
||||
WARN("SetUploadStream failed: %08x\n", nsres);
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
@@ -1566,7 +1592,7 @@ static nsresult NSAPI nsURI_SchemeIs(nsIWineURI *iface, const char *scheme, PRBo
|
||||
WCHAR buf[INTERNET_MAX_SCHEME_LENGTH];
|
||||
int len = MultiByteToWideChar(CP_ACP, 0, scheme, -1, buf, sizeof(buf)/sizeof(WCHAR))-1;
|
||||
|
||||
*_retval = strlenW(This->wine_url) > len
|
||||
*_retval = lstrlenW(This->wine_url) > len
|
||||
&& This->wine_url[len] == ':'
|
||||
&& !memcmp(buf, This->wine_url, len*sizeof(WCHAR));
|
||||
return NS_OK;
|
||||
@@ -2245,28 +2271,81 @@ static nsrefcnt NSAPI nsNetUtil_Release(nsINetUtil *iface)
|
||||
static nsresult NSAPI nsNetUtil_ParseContentType(nsINetUtil *iface, const nsACString *aTypeHeader,
|
||||
nsACString *aCharset, PRBool *aHadCharset, nsACString *aContentType)
|
||||
{
|
||||
nsINetUtil *net_util;
|
||||
nsresult nsres;
|
||||
|
||||
TRACE("(%p %p %p %p)\n", aTypeHeader, aCharset, aHadCharset, aContentType);
|
||||
|
||||
nsres = nsIIOService_QueryInterface(nsio, &IID_nsINetUtil, (void**)&net_util);
|
||||
if(NS_FAILED(nsres)) {
|
||||
WARN("Could not get nsINetUtil interface: %08x\n", nsres);
|
||||
return nsres;
|
||||
return nsINetUtil_ParseContentType(net_util, aTypeHeader, aCharset, aHadCharset, aContentType);
|
||||
}
|
||||
|
||||
static nsresult NSAPI nsNetUtil_ProtocolHasFlags(nsINetUtil *iface, nsIURI *aURI, PRUint32 aFlags, PRBool *_retval)
|
||||
{
|
||||
TRACE("()\n");
|
||||
|
||||
return nsINetUtil_ProtocolHasFlags(net_util, aURI, aFlags, _retval);
|
||||
}
|
||||
|
||||
static nsresult NSAPI nsNetUtil_URIChainHasFlags(nsINetUtil *iface, nsIURI *aURI, PRUint32 aFlags, PRBool *_retval)
|
||||
{
|
||||
TRACE("(%p %08x %p)\n", aURI, aFlags, _retval);
|
||||
|
||||
if(aFlags == (1<<11)) {
|
||||
*_retval = FALSE;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsres = nsINetUtil_ParseContentType(net_util, aTypeHeader, aCharset, aHadCharset, aContentType);
|
||||
return nsINetUtil_URIChainHasFlags(net_util, aURI, aFlags, _retval);
|
||||
}
|
||||
|
||||
nsINetUtil_Release(net_util);
|
||||
return nsres;
|
||||
static nsresult NSAPI nsNetUtil_ToImmutableURI(nsINetUtil *iface, nsIURI *aURI, nsIURI **_retval)
|
||||
{
|
||||
TRACE("(%p %p)\n", aURI, _retval);
|
||||
|
||||
return nsINetUtil_ToImmutableURI(net_util, aURI, _retval);
|
||||
}
|
||||
|
||||
static nsresult NSAPI nsNetUtil_EscapeString(nsINetUtil *iface, const nsACString *aString,
|
||||
PRUint32 aEscapeType, nsACString *_retval)
|
||||
{
|
||||
TRACE("(%p %x %p)\n", aString, aEscapeType, _retval);
|
||||
|
||||
return nsINetUtil_EscapeString(net_util, aString, aEscapeType, _retval);
|
||||
}
|
||||
|
||||
static nsresult NSAPI nsNetUtil_EscapeURL(nsINetUtil *iface, const nsACString *aStr, PRUint32 aFlags,
|
||||
nsACString *_retval)
|
||||
{
|
||||
TRACE("(%p %08x %p)\n", aStr, aFlags, _retval);
|
||||
|
||||
return nsINetUtil_EscapeURL(net_util, aStr, aFlags, _retval);
|
||||
}
|
||||
|
||||
static nsresult NSAPI nsNetUtil_UnescapeString(nsINetUtil *iface, const nsACString *aStr,
|
||||
PRUint32 aFlags, nsACString *_retval)
|
||||
{
|
||||
TRACE("(%p %08x %p)\n", aStr, aFlags, _retval);
|
||||
|
||||
return nsINetUtil_UnescapeString(net_util, aStr, aFlags, _retval);
|
||||
}
|
||||
|
||||
static nsresult NSAPI nsNetUtil_ExtractCharsetFromContentType(nsINetUtil *iface, const nsACString *aTypeHeader,
|
||||
nsACString *aCharset, PRInt32 *aCharsetStart, PRInt32 *aCharsetEnd, PRBool *_retval)
|
||||
{
|
||||
TRACE("(%p %p %p %p %p)\n", aTypeHeader, aCharset, aCharsetStart, aCharsetEnd, _retval);
|
||||
|
||||
return nsINetUtil_ExtractCharsetFromContentType(net_util, aTypeHeader, aCharset, aCharsetStart, aCharsetEnd, _retval);
|
||||
}
|
||||
|
||||
static const nsINetUtilVtbl nsNetUtilVtbl = {
|
||||
nsNetUtil_QueryInterface,
|
||||
nsNetUtil_AddRef,
|
||||
nsNetUtil_Release,
|
||||
nsNetUtil_ParseContentType
|
||||
nsNetUtil_ParseContentType,
|
||||
nsNetUtil_ProtocolHasFlags,
|
||||
nsNetUtil_URIChainHasFlags,
|
||||
nsNetUtil_ToImmutableURI,
|
||||
nsNetUtil_EscapeString,
|
||||
nsNetUtil_EscapeURL,
|
||||
nsNetUtil_UnescapeString,
|
||||
nsNetUtil_ExtractCharsetFromContentType
|
||||
};
|
||||
|
||||
static nsINetUtil nsNetUtil = { &nsNetUtilVtbl };
|
||||
@@ -2365,6 +2444,13 @@ void init_nsio(nsIComponentManager *component_manager, nsIComponentRegistrar *re
|
||||
return;
|
||||
}
|
||||
|
||||
nsres = nsIIOService_QueryInterface(nsio, &IID_nsINetUtil, (void**)&net_util);
|
||||
if(NS_FAILED(nsres)) {
|
||||
WARN("Could not get nsINetUtil interface: %08x\n", nsres);
|
||||
nsIIOService_Release(nsio);
|
||||
return;
|
||||
}
|
||||
|
||||
nsres = nsIComponentRegistrar_UnregisterFactory(registrar, &NS_IOSERVICE_CID, old_factory);
|
||||
nsIFactory_Release(old_factory);
|
||||
if(NS_FAILED(nsres))
|
||||
@@ -2375,3 +2461,16 @@ void init_nsio(nsIComponentManager *component_manager, nsIComponentRegistrar *re
|
||||
if(NS_FAILED(nsres))
|
||||
ERR("RegisterFactory failed: %08x\n", nsres);
|
||||
}
|
||||
|
||||
void release_nsio(void)
|
||||
{
|
||||
if(net_util) {
|
||||
nsINetUtil_Release(net_util);
|
||||
net_util = NULL;
|
||||
}
|
||||
|
||||
if(nsio) {
|
||||
nsIIOService_Release(nsio);
|
||||
nsio = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,7 +52,7 @@ void do_ns_command(NSContainer *This, const char *cmd, nsICommandParams *nsparam
|
||||
return;
|
||||
}
|
||||
|
||||
nsres = nsICommandManager_DoCommand(cmdmgr, cmd, nsparam, NULL);
|
||||
nsres = nsICommandManager_DoCommand(cmdmgr, cmd, nsparam, This->doc->window->nswindow);
|
||||
if(NS_FAILED(nsres))
|
||||
ERR("DoCommand(%s) failed: %08x\n", debugstr_a(cmd), nsres);
|
||||
|
||||
|
||||
@@ -146,8 +146,21 @@ static HRESULT WINAPI OmNavigator_get_appName(IOmNavigator *iface, BSTR *p)
|
||||
static HRESULT WINAPI OmNavigator_get_appVersion(IOmNavigator *iface, BSTR *p)
|
||||
{
|
||||
OmNavigator *This = OMNAVIGATOR_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, p);
|
||||
return E_NOTIMPL;
|
||||
|
||||
/* FIXME: Should we return something smarter? */
|
||||
static const WCHAR app_verW[] =
|
||||
{'4','.','0',' ','(','c','o','m','p','a','t','i','b','l','e',';',
|
||||
' ','M','S','I','E',' ','7','.','0',';',
|
||||
' ','W','i','n','d','o','w','s',' ','N','T',' ','5','.','1',';',
|
||||
' ','M','o','z','i','l','l','a','/','4','.','0',')',0};
|
||||
|
||||
TRACE("(%p)->(%p)\n", This, p);
|
||||
|
||||
*p = SysAllocString(app_verW);
|
||||
if(!*p)
|
||||
return E_OUTOFMEMORY;
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI OmNavigator_get_userAgent(IOmNavigator *iface, BSTR *p)
|
||||
@@ -238,11 +251,15 @@ static HRESULT WINAPI OmNavigator_get_platform(IOmNavigator *iface, BSTR *p)
|
||||
{
|
||||
OmNavigator *This = OMNAVIGATOR_THIS(iface);
|
||||
|
||||
static const WCHAR win32W[] = {'W','i','n','3','2',0};
|
||||
#ifdef _WIN64
|
||||
static const WCHAR platformW[] = {'W','i','n','6','4',0};
|
||||
#else
|
||||
static const WCHAR platformW[] = {'W','i','n','3','2',0};
|
||||
#endif
|
||||
|
||||
TRACE("(%p)->(%p)\n", This, p);
|
||||
|
||||
*p = SysAllocString(win32W);
|
||||
*p = SysAllocString(platformW);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
||||
@@ -158,6 +158,12 @@ static nsIInputStream *get_post_data_stream(IBindCtx *bctx)
|
||||
return ret;
|
||||
}
|
||||
|
||||
static BOOL use_gecko_script(LPCWSTR url)
|
||||
{
|
||||
static const WCHAR fileW[] = {'f','i','l','e',':'};
|
||||
return strncmpiW(fileW, url, sizeof(fileW)/sizeof(WCHAR));
|
||||
}
|
||||
|
||||
void set_current_mon(HTMLDocument *This, IMoniker *mon)
|
||||
{
|
||||
HRESULT hres;
|
||||
@@ -181,6 +187,8 @@ void set_current_mon(HTMLDocument *This, IMoniker *mon)
|
||||
hres = IMoniker_GetDisplayName(mon, NULL, NULL, &This->url);
|
||||
if(FAILED(hres))
|
||||
WARN("GetDisplayName failed: %08x\n", hres);
|
||||
|
||||
set_script_mode(This, use_gecko_script(This->url) ? SCRIPTMODE_GECKO : SCRIPTMODE_ACTIVESCRIPT);
|
||||
}
|
||||
|
||||
static HRESULT set_moniker(HTMLDocument *This, IMoniker *mon, IBindCtx *pibc, BOOL *bind_complete)
|
||||
@@ -327,25 +335,17 @@ static HRESULT set_moniker(HTMLDocument *This, IMoniker *mon, IBindCtx *pibc, BO
|
||||
|
||||
static HRESULT get_doc_string(HTMLDocument *This, char **str, DWORD *len)
|
||||
{
|
||||
nsIDOMDocument *nsdoc;
|
||||
nsIDOMNode *nsnode;
|
||||
LPCWSTR strw;
|
||||
nsAString nsstr;
|
||||
nsresult nsres;
|
||||
|
||||
if(!This->nscontainer) {
|
||||
WARN("no nscontainer, returning NULL\n");
|
||||
return S_OK;
|
||||
if(!This->nsdoc) {
|
||||
WARN("NULL nsdoc\n");
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
nsres = nsIWebNavigation_GetDocument(This->nscontainer->navigation, &nsdoc);
|
||||
if(NS_FAILED(nsres)) {
|
||||
ERR("GetDocument failed: %08x\n", nsres);
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
nsres = nsIDOMDocument_QueryInterface(nsdoc, &IID_nsIDOMNode, (void**)&nsnode);
|
||||
nsIDOMDocument_Release(nsdoc);
|
||||
nsres = nsIDOMHTMLDocument_QueryInterface(This->nsdoc, &IID_nsIDOMNode, (void**)&nsnode);
|
||||
if(NS_FAILED(nsres)) {
|
||||
ERR("Could not get nsIDOMNode failed: %08x\n", nsres);
|
||||
return E_FAIL;
|
||||
@@ -593,12 +593,11 @@ static HRESULT WINAPI PersistFile_Save(IPersistFile *iface, LPCOLESTR pszFileNam
|
||||
}
|
||||
|
||||
hres = get_doc_string(This, &str, &len);
|
||||
if(FAILED(hres))
|
||||
return hres;
|
||||
if(SUCCEEDED(hres))
|
||||
WriteFile(file, str, len, &written, NULL);
|
||||
|
||||
WriteFile(file, str, len, &written, NULL);
|
||||
CloseHandle(file);
|
||||
return S_OK;
|
||||
return hres;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI PersistFile_SaveCompleted(IPersistFile *iface, LPCOLESTR pszFileName)
|
||||
|
||||
@@ -77,17 +77,13 @@ static HRESULT WINAPI InternetProtocolInfo_QueryInterface(IInternetProtocolInfo
|
||||
|
||||
static ULONG WINAPI InternetProtocolInfo_AddRef(IInternetProtocolInfo *iface)
|
||||
{
|
||||
ProtocolFactory *This = PROTOCOLINFO_THIS(iface);
|
||||
TRACE("(%p)\n", This);
|
||||
LOCK_MODULE();
|
||||
TRACE("(%p)\n", iface);
|
||||
return 2;
|
||||
}
|
||||
|
||||
static ULONG WINAPI InternetProtocolInfo_Release(IInternetProtocolInfo *iface)
|
||||
{
|
||||
ProtocolFactory *This = PROTOCOLINFO_THIS(iface);
|
||||
TRACE("(%p)\n", This);
|
||||
UNLOCK_MODULE();
|
||||
TRACE("(%p)\n", iface);
|
||||
return 1;
|
||||
}
|
||||
|
||||
@@ -133,15 +129,7 @@ static ULONG WINAPI ClassFactory_Release(IClassFactory *iface)
|
||||
|
||||
static HRESULT WINAPI ClassFactory_LockServer(IClassFactory *iface, BOOL dolock)
|
||||
{
|
||||
ProtocolFactory *This = CLASSFACTORY_THIS(iface);
|
||||
|
||||
TRACE("(%p)->(%x)\n", This, dolock);
|
||||
|
||||
if(dolock)
|
||||
LOCK_MODULE();
|
||||
else
|
||||
UNLOCK_MODULE();
|
||||
|
||||
TRACE("(%p)->(%x)\n", iface, dolock);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -215,7 +203,6 @@ static ULONG WINAPI AboutProtocol_Release(IInternetProtocol *iface)
|
||||
if(!ref) {
|
||||
heap_free(This->data);
|
||||
heap_free(This);
|
||||
UNLOCK_MODULE();
|
||||
}
|
||||
|
||||
return pUnkOuter ? IUnknown_Release(pUnkOuter) : ref;
|
||||
@@ -408,9 +395,7 @@ static HRESULT WINAPI AboutProtocolFactory_CreateInstance(IClassFactory *iface,
|
||||
hres = IInternetProtocol_QueryInterface(PROTOCOL(ret), riid, ppv);
|
||||
}
|
||||
|
||||
if(SUCCEEDED(hres))
|
||||
LOCK_MODULE();
|
||||
else
|
||||
if(FAILED(hres))
|
||||
heap_free(ret);
|
||||
|
||||
return hres;
|
||||
@@ -424,7 +409,7 @@ static HRESULT WINAPI AboutProtocolInfo_ParseUrl(IInternetProtocolInfo *iface, L
|
||||
dwParseFlags, pwzResult, cchResult, pcchResult, dwReserved);
|
||||
|
||||
if(ParseAction == PARSE_SECURITY_URL) {
|
||||
int len = lstrlenW(pwzUrl);
|
||||
unsigned int len = strlenW(pwzUrl);
|
||||
|
||||
if(len >= cchResult)
|
||||
return S_FALSE;
|
||||
@@ -583,7 +568,6 @@ static ULONG WINAPI ResProtocol_Release(IInternetProtocol *iface)
|
||||
if(!ref) {
|
||||
heap_free(This->data);
|
||||
heap_free(This);
|
||||
UNLOCK_MODULE();
|
||||
}
|
||||
|
||||
return pUnkOuter ? IUnknown_Release(pUnkOuter) : ref;
|
||||
@@ -663,7 +647,7 @@ static HRESULT WINAPI ResProtocol_Start(IInternetProtocol *iface, LPCWSTR szUrl,
|
||||
LPWSTR endpoint = NULL;
|
||||
DWORD file_id = strtolW(url_file, &endpoint, 10);
|
||||
if(endpoint == url_file+strlenW(url_file))
|
||||
src = FindResourceW(hdll, (LPCWSTR)file_id, (LPCWSTR)RT_HTML);
|
||||
src = FindResourceW(hdll, MAKEINTRESOURCEW(file_id), MAKEINTRESOURCEW(RT_HTML));
|
||||
|
||||
if(!src) {
|
||||
WARN("Could not find resource\n");
|
||||
@@ -833,9 +817,7 @@ static HRESULT WINAPI ResProtocolFactory_CreateInstance(IClassFactory *iface, IU
|
||||
hres = IInternetProtocol_QueryInterface(PROTOCOL(ret), riid, ppv);
|
||||
}
|
||||
|
||||
if(SUCCEEDED(hres))
|
||||
LOCK_MODULE();
|
||||
else
|
||||
if(FAILED(hres))
|
||||
heap_free(ret);
|
||||
|
||||
return hres;
|
||||
|
||||
@@ -52,6 +52,5 @@
|
||||
|
||||
#define IDD_HYPERLINK 8000
|
||||
|
||||
#define IDC_STATIC 9000
|
||||
#define IDC_URL 9001
|
||||
#define IDC_TYPE 9002
|
||||
|
||||
@@ -41,10 +41,13 @@
|
||||
#include "Fi.rc"
|
||||
#include "Fr.rc"
|
||||
#include "Hu.rc"
|
||||
#include "Ja.rc"
|
||||
#include "Ko.rc"
|
||||
#include "Nl.rc"
|
||||
#include "No.rc"
|
||||
#include "Pl.rc"
|
||||
#include "Pt.rc"
|
||||
#include "Ro.rc"
|
||||
#include "Ru.rc"
|
||||
#include "Si.rc"
|
||||
#include "Sv.rc"
|
||||
|
||||
@@ -223,6 +223,9 @@ static HRESULT WINAPI ActiveScriptSite_QueryInterface(IActiveScriptSite *iface,
|
||||
}else if(IsEqualGUID(&IID_IActiveScriptSiteDebug32, riid)) {
|
||||
TRACE("(%p)->(IID_IActiveScriptSiteDebug32 %p)\n", This, ppv);
|
||||
*ppv = ACTSCPDBG32(This);
|
||||
}else if(IsEqualGUID(&IID_ICanHandleException, riid)) {
|
||||
TRACE("(%p)->(IID_ICanHandleException not supported %p)\n", This, ppv);
|
||||
return E_NOINTERFACE;
|
||||
}else {
|
||||
FIXME("(%p)->(%s %p)\n", This, debugstr_guid(riid), ppv);
|
||||
return E_NOINTERFACE;
|
||||
@@ -712,8 +715,8 @@ static ScriptHost *get_script_host(HTMLDocument *doc, const GUID *guid)
|
||||
{
|
||||
ScriptHost *iter;
|
||||
|
||||
if(IsEqualGUID(&CLSID_JScript, guid)) {
|
||||
FIXME("Ignoring JScript\n");
|
||||
if(IsEqualGUID(&CLSID_JScript, guid) && doc->scriptmode != SCRIPTMODE_ACTIVESCRIPT) {
|
||||
TRACE("Ignoring JScript\n");
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -792,6 +795,54 @@ IDispatch *script_parse_event(HTMLDocument *doc, LPCWSTR text)
|
||||
return disp;
|
||||
}
|
||||
|
||||
static BOOL is_jscript_available(void)
|
||||
{
|
||||
static BOOL available, checked;
|
||||
|
||||
if(!checked) {
|
||||
IUnknown *unk;
|
||||
HRESULT hres = CoGetClassObject(&CLSID_JScript, CLSCTX_INPROC_SERVER, NULL, &IID_IUnknown, (void**)&unk);
|
||||
|
||||
if(SUCCEEDED(hres)) {
|
||||
available = TRUE;
|
||||
IUnknown_Release(unk);
|
||||
}else {
|
||||
available = FALSE;
|
||||
}
|
||||
checked = TRUE;
|
||||
}
|
||||
|
||||
return available;
|
||||
}
|
||||
|
||||
void set_script_mode(HTMLDocument *doc, SCRIPTMODE mode)
|
||||
{
|
||||
nsIWebBrowserSetup *setup;
|
||||
nsresult nsres;
|
||||
|
||||
if(mode == SCRIPTMODE_ACTIVESCRIPT && !is_jscript_available()) {
|
||||
TRACE("jscript.dll not available\n");
|
||||
doc->scriptmode = SCRIPTMODE_GECKO;
|
||||
return;
|
||||
}
|
||||
|
||||
doc->scriptmode = mode;
|
||||
|
||||
if(!doc->nscontainer || !doc->nscontainer->webbrowser)
|
||||
return;
|
||||
|
||||
nsres = nsIWebBrowser_QueryInterface(doc->nscontainer->webbrowser,
|
||||
&IID_nsIWebBrowserSetup, (void**)&setup);
|
||||
if(NS_SUCCEEDED(nsres)) {
|
||||
nsres = nsIWebBrowserSetup_SetProperty(setup, SETUP_ALLOW_JAVASCRIPT,
|
||||
doc->scriptmode == SCRIPTMODE_GECKO);
|
||||
nsIWebBrowserSetup_Release(setup);
|
||||
}
|
||||
|
||||
if(NS_FAILED(nsres))
|
||||
ERR("JavaScript setup failed: %08x\n", nsres);
|
||||
}
|
||||
|
||||
void release_script_hosts(HTMLDocument *doc)
|
||||
{
|
||||
ScriptHost *iter;
|
||||
|
||||
@@ -150,23 +150,16 @@ static HRESULT WINAPI HTMLSelectionObject_createRange(IHTMLSelectionObject *ifac
|
||||
|
||||
nsISelection_GetRangeCount(This->nsselection, &nsrange_cnt);
|
||||
if(!nsrange_cnt) {
|
||||
nsIDOMDocument *nsdoc;
|
||||
nsIDOMHTMLDocument *nshtmldoc;
|
||||
nsIDOMHTMLElement *nsbody = NULL;
|
||||
|
||||
TRACE("nsrange_cnt = 0\n");
|
||||
|
||||
nsres = nsIWebNavigation_GetDocument(This->doc->nscontainer->navigation, &nsdoc);
|
||||
if(NS_FAILED(nsres) || !nsdoc) {
|
||||
ERR("GetDocument failed: %08x\n", nsres);
|
||||
return E_FAIL;
|
||||
if(!This->doc->nsdoc) {
|
||||
WARN("nsdoc is NULL\n");
|
||||
return E_UNEXPECTED;
|
||||
}
|
||||
|
||||
nsIDOMDocument_QueryInterface(nsdoc, &IID_nsIDOMHTMLDocument, (void**)&nshtmldoc);
|
||||
nsIDOMDocument_Release(nsdoc);
|
||||
|
||||
nsres = nsIDOMHTMLDocument_GetBody(nshtmldoc, &nsbody);
|
||||
nsIDOMHTMLDocument_Release(nshtmldoc);
|
||||
nsres = nsIDOMHTMLDocument_GetBody(This->doc->nsdoc, &nsbody);
|
||||
if(NS_FAILED(nsres) || !nsbody) {
|
||||
ERR("Could not get body: %08x\n", nsres);
|
||||
return E_FAIL;
|
||||
|
||||
@@ -261,6 +261,8 @@ static void set_parsecomplete(HTMLDocument *doc)
|
||||
call_property_onchanged(&doc->cp_propnotif, 1005);
|
||||
call_explorer_69(doc);
|
||||
|
||||
/* FIXME: IE7 calls EnableModelless(TRUE), EnableModelless(FALSE) and sets interactive state here */
|
||||
|
||||
doc->readystate = READYSTATE_INTERACTIVE;
|
||||
call_property_onchanged(&doc->cp_propnotif, DISPID_READYSTATE);
|
||||
|
||||
@@ -363,6 +365,20 @@ static void process_task(task_t *task)
|
||||
}
|
||||
}
|
||||
|
||||
static void call_timer_disp(IDispatch *disp)
|
||||
{
|
||||
DISPPARAMS dp = {NULL, NULL, 0, 0};
|
||||
EXCEPINFO ei;
|
||||
VARIANT res;
|
||||
HRESULT hres;
|
||||
|
||||
V_VT(&res) = VT_EMPTY;
|
||||
memset(&ei, 0, sizeof(ei));
|
||||
hres = IDispatch_Invoke(disp, DISPID_VALUE, &IID_NULL, 0, DISPATCH_METHOD, &dp, &res, &ei, NULL);
|
||||
TRACE("ret %08x %s\n", hres, debugstr_variant(&res));
|
||||
VariantClear(&res);
|
||||
}
|
||||
|
||||
static LRESULT process_timer(void)
|
||||
{
|
||||
thread_data_t *thread_data = get_thread_data(TRUE);
|
||||
@@ -393,7 +409,7 @@ static LRESULT process_timer(void)
|
||||
release_task_timer(thread_data->thread_hwnd, timer);
|
||||
}
|
||||
|
||||
call_disp_func(doc, disp);
|
||||
call_timer_disp(disp);
|
||||
|
||||
IDispatch_Release(disp);
|
||||
}
|
||||
|
||||
@@ -193,7 +193,7 @@ static inline void wstrbuf_finish(wstrbuf_t *buf)
|
||||
static void wstrbuf_append_len(wstrbuf_t *buf, LPCWSTR str, int len)
|
||||
{
|
||||
if(buf->len+len >= buf->size) {
|
||||
buf->size = 2*buf->len+len;
|
||||
buf->size = 2*buf->size+len;
|
||||
buf->buf = heap_realloc(buf->buf, buf->size * sizeof(WCHAR));
|
||||
}
|
||||
|
||||
@@ -210,7 +210,7 @@ static void wstrbuf_append_nodetxt(wstrbuf_t *buf, LPCWSTR str, int len)
|
||||
TRACE("%s\n", debugstr_wn(str, len));
|
||||
|
||||
if(buf->len+len >= buf->size) {
|
||||
buf->size = 2*buf->len+len;
|
||||
buf->size = 2*buf->size+len;
|
||||
buf->buf = heap_realloc(buf->buf, buf->size * sizeof(WCHAR));
|
||||
}
|
||||
|
||||
@@ -252,7 +252,7 @@ static void wstrbuf_append_node(wstrbuf_t *buf, nsIDOMNode *node)
|
||||
wstrbuf_append_nodetxt(buf, data, strlenW(data));
|
||||
nsAString_Finish(&data_str);
|
||||
|
||||
nsIDOMText_Release(nstext);
|
||||
nsIDOMText_Release(nstext);
|
||||
|
||||
break;
|
||||
}
|
||||
@@ -267,6 +267,21 @@ static void wstrbuf_append_node(wstrbuf_t *buf, nsIDOMNode *node)
|
||||
}
|
||||
}
|
||||
|
||||
static void wstrbuf_append_node_rec(wstrbuf_t *buf, nsIDOMNode *node)
|
||||
{
|
||||
nsIDOMNode *iter, *tmp;
|
||||
|
||||
wstrbuf_append_node(buf, node);
|
||||
|
||||
nsIDOMNode_GetFirstChild(node, &iter);
|
||||
while(iter) {
|
||||
wstrbuf_append_node_rec(buf, iter);
|
||||
nsIDOMNode_GetNextSibling(iter, &tmp);
|
||||
nsIDOMNode_Release(iter);
|
||||
iter = tmp;
|
||||
}
|
||||
}
|
||||
|
||||
static BOOL fill_nodestr(dompos_t *pos)
|
||||
{
|
||||
nsIDOMText *text;
|
||||
@@ -325,16 +340,9 @@ static nsIDOMNode *prev_node(HTMLTxtRange *This, nsIDOMNode *iter)
|
||||
nsresult nsres;
|
||||
|
||||
if(!iter) {
|
||||
nsIDOMHTMLDocument *nshtmldoc;
|
||||
nsIDOMHTMLElement *nselem;
|
||||
nsIDOMDocument *nsdoc;
|
||||
|
||||
nsIWebNavigation_GetDocument(This->doc->nscontainer->navigation, &nsdoc);
|
||||
nsIDOMDocument_QueryInterface(nsdoc, &IID_nsIDOMHTMLDocument, (void**)&nshtmldoc);
|
||||
nsIDOMDocument_Release(nsdoc);
|
||||
nsIDOMHTMLDocument_GetBody(nshtmldoc, &nselem);
|
||||
nsIDOMHTMLDocument_Release(nshtmldoc);
|
||||
|
||||
nsIDOMHTMLDocument_GetBody(This->doc->nsdoc, &nselem);
|
||||
nsIDOMElement_GetLastChild(nselem, &tmp);
|
||||
if(!tmp)
|
||||
return (nsIDOMNode*)nselem;
|
||||
@@ -536,6 +544,27 @@ static void range_to_string(HTMLTxtRange *This, wstrbuf_t *buf)
|
||||
}
|
||||
}
|
||||
|
||||
HRESULT get_node_text(HTMLDOMNode *node, BSTR *ret)
|
||||
{
|
||||
wstrbuf_t buf;
|
||||
HRESULT hres = S_OK;
|
||||
|
||||
wstrbuf_init(&buf);
|
||||
wstrbuf_append_node_rec(&buf, node->nsnode);
|
||||
if(buf.buf) {
|
||||
*ret = SysAllocString(buf.buf);
|
||||
if(!*ret)
|
||||
hres = E_OUTOFMEMORY;
|
||||
}else {
|
||||
*ret = NULL;
|
||||
}
|
||||
wstrbuf_finish(&buf);
|
||||
|
||||
if(SUCCEEDED(hres))
|
||||
TRACE("ret %s\n", debugstr_w(*ret));
|
||||
return hres;
|
||||
}
|
||||
|
||||
static WCHAR get_pos_char(const dompos_t *pos)
|
||||
{
|
||||
switch(pos->type) {
|
||||
@@ -1100,7 +1129,6 @@ static HRESULT WINAPI HTMLTxtRange_get_htmlText(IHTMLTxtRange *iface, BSTR *p)
|
||||
static HRESULT WINAPI HTMLTxtRange_put_text(IHTMLTxtRange *iface, BSTR v)
|
||||
{
|
||||
HTMLTxtRange *This = HTMLTXTRANGE_THIS(iface);
|
||||
nsIDOMDocument *nsdoc;
|
||||
nsIDOMText *text_node;
|
||||
nsAString text_str;
|
||||
nsresult nsres;
|
||||
@@ -1110,15 +1138,8 @@ static HRESULT WINAPI HTMLTxtRange_put_text(IHTMLTxtRange *iface, BSTR v)
|
||||
if(!This->doc)
|
||||
return MSHTML_E_NODOC;
|
||||
|
||||
nsres = nsIWebNavigation_GetDocument(This->doc->nscontainer->navigation, &nsdoc);
|
||||
if(NS_FAILED(nsres)) {
|
||||
ERR("GetDocument failed: %08x\n", nsres);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
nsAString_Init(&text_str, v);
|
||||
nsres = nsIDOMDocument_CreateTextNode(nsdoc, &text_str, &text_node);
|
||||
nsIDOMDocument_Release(nsdoc);
|
||||
nsres = nsIDOMHTMLDocument_CreateTextNode(This->doc->nsdoc, &text_str, &text_node);
|
||||
nsAString_Finish(&text_str);
|
||||
if(NS_FAILED(nsres)) {
|
||||
ERR("CreateTextNode failed: %08x\n", nsres);
|
||||
@@ -1323,22 +1344,10 @@ static HRESULT WINAPI HTMLTxtRange_expand(IHTMLTxtRange *iface, BSTR Unit, VARIA
|
||||
}
|
||||
|
||||
case RU_TEXTEDIT: {
|
||||
nsIDOMDocument *nsdoc;
|
||||
nsIDOMHTMLDocument *nshtmldoc;
|
||||
nsIDOMHTMLElement *nsbody = NULL;
|
||||
nsresult nsres;
|
||||
|
||||
nsres = nsIWebNavigation_GetDocument(This->doc->nscontainer->navigation, &nsdoc);
|
||||
if(NS_FAILED(nsres) || !nsdoc) {
|
||||
ERR("GetDocument failed: %08x\n", nsres);
|
||||
break;
|
||||
}
|
||||
|
||||
nsIDOMDocument_QueryInterface(nsdoc, &IID_nsIDOMHTMLDocument, (void**)&nshtmldoc);
|
||||
nsIDOMDocument_Release(nsdoc);
|
||||
|
||||
nsres = nsIDOMHTMLDocument_GetBody(nshtmldoc, &nsbody);
|
||||
nsIDOMHTMLDocument_Release(nshtmldoc);
|
||||
nsres = nsIDOMHTMLDocument_GetBody(This->doc->nsdoc, &nsbody);
|
||||
if(NS_FAILED(nsres) || !nsbody) {
|
||||
ERR("Could not get body: %08x\n", nsres);
|
||||
break;
|
||||
@@ -1773,7 +1782,6 @@ static HRESULT exec_indent(HTMLTxtRange *This, VARIANT *in, VARIANT *out)
|
||||
{
|
||||
nsIDOMDocumentFragment *fragment;
|
||||
nsIDOMElement *blockquote_elem, *p_elem;
|
||||
nsIDOMDocument *nsdoc;
|
||||
nsIDOMNode *tmp;
|
||||
nsAString tag_str;
|
||||
|
||||
@@ -1782,18 +1790,19 @@ static HRESULT exec_indent(HTMLTxtRange *This, VARIANT *in, VARIANT *out)
|
||||
|
||||
TRACE("(%p)->(%p %p)\n", This, in, out);
|
||||
|
||||
nsIWebNavigation_GetDocument(This->doc->nscontainer->navigation, &nsdoc);
|
||||
if(!This->doc->nsdoc) {
|
||||
WARN("NULL nsdoc\n");
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
nsAString_Init(&tag_str, blockquoteW);
|
||||
nsIDOMDocument_CreateElement(nsdoc, &tag_str, &blockquote_elem);
|
||||
nsIDOMHTMLDocument_CreateElement(This->doc->nsdoc, &tag_str, &blockquote_elem);
|
||||
nsAString_Finish(&tag_str);
|
||||
|
||||
nsAString_Init(&tag_str, pW);
|
||||
nsIDOMDocument_CreateElement(nsdoc, &tag_str, &p_elem);
|
||||
nsIDOMDocument_CreateElement(This->doc->nsdoc, &tag_str, &p_elem);
|
||||
nsAString_Finish(&tag_str);
|
||||
|
||||
nsIDOMDocument_Release(nsdoc);
|
||||
|
||||
nsIDOMRange_ExtractContents(This->nsrange, &fragment);
|
||||
nsIDOMElement_AppendChild(p_elem, (nsIDOMNode*)fragment, &tmp);
|
||||
nsIDOMDocumentFragment_Release(fragment);
|
||||
|
||||
@@ -168,6 +168,9 @@ void notif_focus(HTMLDocument *This)
|
||||
IOleControlSite *site;
|
||||
HRESULT hres;
|
||||
|
||||
if(!This->client)
|
||||
return;
|
||||
|
||||
hres = IOleClientSite_QueryInterface(This->client, &IID_IOleControlSite, (void**)&site);
|
||||
if(FAILED(hres))
|
||||
return;
|
||||
@@ -186,7 +189,7 @@ static LRESULT WINAPI serverwnd_proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM
|
||||
This = *(HTMLDocument**)lParam;
|
||||
SetPropW(hwnd, wszTHIS, This);
|
||||
}else {
|
||||
This = (HTMLDocument*)GetPropW(hwnd, wszTHIS);
|
||||
This = GetPropW(hwnd, wszTHIS);
|
||||
}
|
||||
|
||||
switch(msg) {
|
||||
@@ -605,11 +608,13 @@ static HRESULT WINAPI OleDocumentView_UIActivate(IOleDocumentView *iface, BOOL f
|
||||
return hres;
|
||||
}
|
||||
|
||||
hres = IDocHostUIHandler_ShowUI(This->hostui,
|
||||
This->usermode == EDITMODE ? DOCHOSTUITYPE_AUTHOR : DOCHOSTUITYPE_BROWSE,
|
||||
ACTOBJ(This), CMDTARGET(This), This->frame, This->ip_window);
|
||||
if(FAILED(hres))
|
||||
IDocHostUIHandler_HideUI(This->hostui);
|
||||
if(This->hostui) {
|
||||
hres = IDocHostUIHandler_ShowUI(This->hostui,
|
||||
This->usermode == EDITMODE ? DOCHOSTUITYPE_AUTHOR : DOCHOSTUITYPE_BROWSE,
|
||||
ACTOBJ(This), CMDTARGET(This), This->frame, This->ip_window);
|
||||
if(FAILED(hres))
|
||||
IDocHostUIHandler_HideUI(This->hostui);
|
||||
}
|
||||
|
||||
if(This->ip_window)
|
||||
call_set_active_object(This->ip_window, ACTOBJ(This));
|
||||
|
||||
@@ -1,36 +0,0 @@
|
||||
/*
|
||||
* Copyright 2004 Mike McCormack 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
LANGUAGE LANG_BULGARIAN, SUBLANG_DEFAULT
|
||||
|
||||
100 DIALOG LOADONCALL MOVEABLE DISCARDABLE 0, 0, 220, 62
|
||||
STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Ñâàëÿíå íà ActiveX äæàäæàòà çà Mozilla"
|
||||
FONT 8, "MS Shell Dlg"
|
||||
{
|
||||
CONTROL "Progress1",1000,"msctls_progress32",WS_BORDER|PBS_SMOOTH,10,10,200,12
|
||||
LTEXT "", 104, 10, 30, 200, 10, SS_CENTER
|
||||
PUSHBUTTON "Îòêàç", IDCANCEL, 85, 44, 50, 15, WS_GROUP | WS_TABSTOP
|
||||
}
|
||||
|
||||
STRINGTABLE
|
||||
BEGIN
|
||||
1001 "Ïðèëîæåíèåòî èçèñêâà ActiveX îáåêò íà îáçîðíèêà\n" \
|
||||
"íî äæàäæàòà Mozilla Active X íå å ñëîæåíà.\n" \
|
||||
"Èñêàòå ëè äà ÿ ñâàëèòå è äà ÿ ñëîæèòå?"
|
||||
END
|
||||
@@ -1,23 +0,0 @@
|
||||
/* FILE: dll/win32/shdocvw/Cs.rc
|
||||
* TRANSLATOR: Radek Liska aka Black_Fox (radekliska at gmail dot com)
|
||||
* UPDATED: 2008-06-27
|
||||
*/
|
||||
|
||||
LANGUAGE LANG_CZECH, SUBLANG_DEFAULT
|
||||
|
||||
100 DIALOG LOADONCALL MOVEABLE DISCARDABLE 0, 0, 220, 62
|
||||
STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Stahuji objekt Mozilla ActiveX"
|
||||
FONT 8, "MS Shell Dlg"
|
||||
{
|
||||
CONTROL "Progress1",1000,"msctls_progress32",WS_BORDER|PBS_SMOOTH,10,10,200,12
|
||||
LTEXT "", 104, 10, 30, 200, 10, SS_CENTER
|
||||
PUSHBUTTON "Storno", IDCANCEL, 85, 44, 50, 15, WS_GROUP | WS_TABSTOP
|
||||
}
|
||||
|
||||
STRINGTABLE
|
||||
BEGIN
|
||||
1001 "Tato aplikace požaduje objekt prohlížeèe ActiveX,\n" \
|
||||
"ale objekt Mozilla ActiveX momentálnì není nainstalovaný.\n" \
|
||||
"Stáhnout a nainstalovat jej?"
|
||||
END
|
||||
@@ -1,36 +0,0 @@
|
||||
/*
|
||||
* Copyright 2005 Henning Gerhardt
|
||||
*
|
||||
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
LANGUAGE LANG_GERMAN, SUBLANG_NEUTRAL
|
||||
|
||||
100 DIALOG LOADONCALL MOVEABLE DISCARDABLE 0, 0, 220, 62
|
||||
STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Lade die Mozilla Active X Steuerung"
|
||||
FONT 8, "MS Shell Dlg"
|
||||
{
|
||||
CONTROL "Progress1",1000,"msctls_progress32",WS_BORDER|PBS_SMOOTH,10,10,200,12
|
||||
LTEXT "", 104, 10, 30, 200, 10, SS_CENTER
|
||||
PUSHBUTTON "Abbrechen", IDCANCEL, 85, 44, 50, 15, WS_GROUP | WS_TABSTOP
|
||||
}
|
||||
|
||||
STRINGTABLE
|
||||
BEGIN
|
||||
1001 "Diese Anwendung fordert ein ActiveX Browser Objekt an,\n" \
|
||||
"aber die Mozilla Active X Steuerung ist nicht installiert.\n" \
|
||||
"Möchten Sie, dass es aus dem Internet geladen und installiert wird ?"
|
||||
END
|
||||
@@ -1,36 +0,0 @@
|
||||
/*
|
||||
* Copyright 2004 Mike McCormack 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
|
||||
|
||||
100 DIALOG LOADONCALL MOVEABLE DISCARDABLE 0, 0, 220, 62
|
||||
STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Downloading the Mozilla Active X control"
|
||||
FONT 8, "MS Shell Dlg"
|
||||
{
|
||||
CONTROL "Progress1",1000,"msctls_progress32",WS_BORDER|PBS_SMOOTH,10,10,200,12
|
||||
LTEXT "", 104, 10, 30, 200, 10, SS_CENTER
|
||||
PUSHBUTTON "Cancel", IDCANCEL, 85, 44, 50, 15, WS_GROUP | WS_TABSTOP
|
||||
}
|
||||
|
||||
STRINGTABLE
|
||||
BEGIN
|
||||
1001 "This application is requesting an ActiveX browser object\n" \
|
||||
"but the Mozilla Active X control is currently not installed.\n" \
|
||||
"Do you wish to download and install it?"
|
||||
END
|
||||
@@ -1,36 +0,0 @@
|
||||
/*
|
||||
* Copyright 2005 José Manuel Ferrer Ortiz
|
||||
*
|
||||
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
LANGUAGE LANG_SPANISH, SUBLANG_NEUTRAL
|
||||
|
||||
100 DIALOG LOADONCALL MOVEABLE DISCARDABLE 0, 0, 220, 62
|
||||
STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Descargando el control Active X de Mozilla"
|
||||
FONT 8, "MS Shell Dlg"
|
||||
{
|
||||
CONTROL "Progress1",1000,"msctls_progress32",WS_BORDER|PBS_SMOOTH,10,10,200,12
|
||||
LTEXT "", 104, 10, 30, 200, 10, SS_CENTER
|
||||
PUSHBUTTON "Cancelar", IDCANCEL, 85, 44, 50, 15, WS_GROUP | WS_TABSTOP
|
||||
}
|
||||
|
||||
STRINGTABLE
|
||||
BEGIN
|
||||
1001 "Esta aplicación está solicitando un objeto Active X de navegador\n" \
|
||||
"pero el control Active X de Mozilla no está instalado actualmente.\n" \
|
||||
"¿Desea descargarlo e instalarlo?"
|
||||
END
|
||||
@@ -1,36 +0,0 @@
|
||||
/*
|
||||
* Copyright 2005 Kimmo Myllyvirta
|
||||
*
|
||||
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
LANGUAGE LANG_FINNISH, SUBLANG_DEFAULT
|
||||
|
||||
100 DIALOG LOADONCALL MOVEABLE DISCARDABLE 0, 0, 220, 62
|
||||
STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Ladataan Mozilla Active X -komponenttia"
|
||||
FONT 8, "MS Shell Dlg"
|
||||
{
|
||||
CONTROL "Progress1",1000,"msctls_progress32",WS_BORDER|PBS_SMOOTH,10,10,200,12
|
||||
LTEXT "", 104, 10, 30, 200, 10, SS_CENTER
|
||||
PUSHBUTTON "Peruuta", IDCANCEL, 85, 44, 50, 15, WS_GROUP | WS_TABSTOP
|
||||
}
|
||||
|
||||
STRINGTABLE
|
||||
BEGIN
|
||||
1001 "Tämä sovellus vaatii ActiveX selainkomponentin,\n" \
|
||||
"mutta Mozilla Active X -komponenttia ei ole vielä asennettu.\n" \
|
||||
"Haluatko ladata ja asentaa sen?"
|
||||
END
|
||||
@@ -1,36 +0,0 @@
|
||||
/*
|
||||
* Copyright 2004 Jonathan Ernst
|
||||
*
|
||||
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
LANGUAGE LANG_FRENCH, SUBLANG_NEUTRAL
|
||||
|
||||
100 DIALOG LOADONCALL MOVEABLE DISCARDABLE 0, 0, 220, 62
|
||||
STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Téléchargement du contrôle ActiveX de Mozilla"
|
||||
FONT 8, "MS Shell Dlg"
|
||||
{
|
||||
CONTROL "Progress1",1000,"msctls_progress32",WS_BORDER|PBS_SMOOTH,10,10,200,12
|
||||
LTEXT "", 104, 10, 30, 200, 10, SS_CENTER
|
||||
PUSHBUTTON "Annuler", IDCANCEL, 85, 44, 50, 15, WS_GROUP | WS_TABSTOP
|
||||
}
|
||||
|
||||
STRINGTABLE
|
||||
BEGIN
|
||||
1001 "Cette application requiert un object navigateur ActiveX\n" \
|
||||
"mais le contrôle Active X de Mozilla n'est pas installé.\n" \
|
||||
"Souhaitez-vous le télécharger et l'installer ?"
|
||||
END
|
||||
@@ -1,37 +0,0 @@
|
||||
/*
|
||||
* Copyright 2004 Mike McCormack for CodeWeavers
|
||||
* Copyright 2005 Risko Gergely
|
||||
*
|
||||
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
LANGUAGE LANG_HUNGARIAN, SUBLANG_DEFAULT
|
||||
|
||||
100 DIALOG LOADONCALL MOVEABLE DISCARDABLE 0, 0, 220, 62
|
||||
STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "A Mozilla Active X vezérlõ letöltése"
|
||||
FONT 8, "MS Shell Dlg"
|
||||
{
|
||||
CONTROL "Progress1",1000,"msctls_progress32",WS_BORDER|PBS_SMOOTH,10,10,200,12
|
||||
LTEXT "", 104, 10, 30, 200, 10, SS_CENTER
|
||||
PUSHBUTTON "Mégse", IDCANCEL, 85, 44, 50, 15, WS_GROUP | WS_TABSTOP
|
||||
}
|
||||
|
||||
STRINGTABLE
|
||||
BEGIN
|
||||
1001 "Ez az alkalmazás ActiveX támogatást igényel, de nincs \n" \
|
||||
"feltelepítve a Mozilla Active X vezérlõ.\n" \
|
||||
"Szeretnéd letölteni és telepíteni?"
|
||||
END
|
||||
@@ -1,18 +0,0 @@
|
||||
LANGUAGE LANG_JAPANESE, SUBLANG_DEFAULT
|
||||
|
||||
100 DIALOG LOADONCALL MOVEABLE DISCARDABLE 0, 0, 220, 62
|
||||
STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Mozilla ActiveX Control のダウンロード"
|
||||
FONT 9, "MS UI Gothic"
|
||||
{
|
||||
CONTROL "Progress1",1000,"msctls_progress32",WS_BORDER|PBS_SMOOTH,10,10,200,12
|
||||
LTEXT "", 104, 10, 30, 200, 10, SS_CENTER
|
||||
PUSHBUTTON "キャンセル", IDCANCEL, 85, 44, 50, 15, WS_GROUP | WS_TABSTOP
|
||||
}
|
||||
|
||||
STRINGTABLE
|
||||
BEGIN
|
||||
1001 "このアプリケーションは ActiveX browser object を要求しています\n" \
|
||||
"が、Mozilla ActiveX control は現在インストールされていません。\n" \
|
||||
"Mozilla ActiveX Control をダウンロードし、インストールしますか?"
|
||||
END
|
||||
@@ -1,22 +0,0 @@
|
||||
/*
|
||||
*Korean Translation by manatails007(www.manatails007.org) Seungju Kim
|
||||
*/
|
||||
|
||||
LANGUAGE LANG_KOREAN, SUBLANG_DEFAULT
|
||||
|
||||
100 DIALOG LOADONCALL MOVEABLE DISCARDABLE 0, 0, 220, 62
|
||||
STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Mozilla ActiveX 컨트롤 다운로드 중"
|
||||
FONT 8, "MS Shell Dlg"
|
||||
{
|
||||
CONTROL "Progress1",1000,"msctls_progress32",WS_BORDER|PBS_SMOOTH,10,10,200,12
|
||||
LTEXT "", 104, 10, 30, 200, 10, SS_CENTER
|
||||
PUSHBUTTON "취소", IDCANCEL, 85, 44, 50, 15, WS_GROUP | WS_TABSTOP
|
||||
}
|
||||
|
||||
STRINGTABLE
|
||||
BEGIN
|
||||
1001 "이 프로그램은 Mozilla ActiveX 브라우저 객체를 요구합니다.\n" \
|
||||
"그러나 Mozilla ActiveX 컨트롤이 현재 설치되어 있지 않습니다.\n" \
|
||||
"다운로드해서 설치하시겠습니까?"
|
||||
END
|
||||
@@ -1,36 +0,0 @@
|
||||
/*
|
||||
* Copyright 2005 Hans Leidekker
|
||||
*
|
||||
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
LANGUAGE LANG_DUTCH, SUBLANG_NEUTRAL
|
||||
|
||||
100 DIALOG LOADONCALL MOVEABLE DISCARDABLE 0, 0, 220, 62
|
||||
STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "De Mozilla ActiveX control wordt gedownload"
|
||||
FONT 8, "MS Shell Dlg"
|
||||
{
|
||||
CONTROL "Progress1",1000,"msctls_progress32",WS_BORDER|PBS_SMOOTH,10,10,200,12
|
||||
LTEXT "", 104, 10, 30, 200, 10, SS_CENTER
|
||||
PUSHBUTTON "Annuleren", IDCANCEL, 85, 44, 50, 15, WS_GROUP | WS_TABSTOP
|
||||
}
|
||||
|
||||
STRINGTABLE
|
||||
BEGIN
|
||||
1001 "Deze applicatie heeft een ActiveX browserobject nodig\n" \
|
||||
"maar de Mozilla ActiveX control is niet geïnstalleerd.\n" \
|
||||
"Wilt u deze downloaden en installeren?"
|
||||
END
|
||||
@@ -1,36 +0,0 @@
|
||||
/*
|
||||
* Copyright 2005 Alexander N. Sørnes <[email protected]>
|
||||
*
|
||||
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
LANGUAGE LANG_NORWEGIAN, SUBLANG_NEUTRAL
|
||||
|
||||
100 DIALOG LOADONCALL MOVEABLE DISCARDABLE 0, 0, 220, 62
|
||||
STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Last ned Mozilla Active X-kontrolleren"
|
||||
FONT 8, "MS Shell Dlg"
|
||||
{
|
||||
CONTROL "Progress1",1000,"msctls_progress32",WS_BORDER|PBS_SMOOTH,10,10,200,12
|
||||
LTEXT "", 104, 10, 30, 200, 10, SS_CENTER
|
||||
PUSHBUTTON "Avbryt", IDCANCEL, 85, 44, 50, 15, WS_GROUP | WS_TABSTOP
|
||||
}
|
||||
|
||||
STRINGTABLE
|
||||
BEGIN
|
||||
1001 "Dette programmet ber om et Active X-nettleserobjekt,\n" \
|
||||
"men Mozilla Active X-kontrolleren er ikke installert.\n" \
|
||||
"Vil du laste den ned og installere den?"
|
||||
END
|
||||
@@ -1,36 +0,0 @@
|
||||
/*
|
||||
* Copyright 2005 Sebastian Gasiorek
|
||||
*
|
||||
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
LANGUAGE LANG_POLISH, SUBLANG_DEFAULT
|
||||
|
||||
100 DIALOG LOADONCALL MOVEABLE DISCARDABLE 0, 0, 220, 62
|
||||
STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Pobierz kontrolkê ActiveX Mozilli"
|
||||
FONT 8, "MS Shell Dlg"
|
||||
{
|
||||
CONTROL "Progress1",1000,"msctls_progress32",WS_BORDER|PBS_SMOOTH,10,10,200,12
|
||||
LTEXT "", 104, 10, 30, 200, 10, SS_CENTER
|
||||
PUSHBUTTON "Anuluj", IDCANCEL, 85, 44, 50, 15, WS_GROUP | WS_TABSTOP
|
||||
}
|
||||
|
||||
STRINGTABLE
|
||||
BEGIN
|
||||
1001 "Ta aplikacja wywo³uje obiekt ActiveX przegl¹darki,\n" \
|
||||
"ale kontrolka Mozilla Active X nie jest zainstalowana.\n" \
|
||||
"Czy chcesz j¹ pobraæ i zainstalowaæ?"
|
||||
END
|
||||
@@ -1,36 +0,0 @@
|
||||
/*
|
||||
* Copyright 2005 Marcelo Duarte
|
||||
*
|
||||
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
LANGUAGE LANG_PORTUGUESE, SUBLANG_NEUTRAL
|
||||
|
||||
100 DIALOG LOADONCALL MOVEABLE DISCARDABLE 0, 0, 220, 62
|
||||
STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Baixando o controle Mozilla ActiveX"
|
||||
FONT 8, "MS Shell Dlg"
|
||||
{
|
||||
CONTROL "Progress1",1000,"msctls_progress32",WS_BORDER|PBS_SMOOTH,10,10,200,12
|
||||
LTEXT "", 104, 10, 30, 200, 10, SS_CENTER
|
||||
PUSHBUTTON "Cancelar", IDCANCEL, 85, 44, 50, 15, WS_GROUP | WS_TABSTOP
|
||||
}
|
||||
|
||||
STRINGTABLE
|
||||
BEGIN
|
||||
1001 "Esta aplicação requer um objecto ActiveX do navegador\n" \
|
||||
"mas o controle Mozilla ActiveX atualmente não está instalado.\n" \
|
||||
"Você deseja baixá-lo e instalá-lo?"
|
||||
END
|
||||
@@ -1,38 +0,0 @@
|
||||
/*
|
||||
* Copyright 2005 Mikhail Y. Zvyozdochkin
|
||||
*
|
||||
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT
|
||||
|
||||
100 DIALOG LOADONCALL MOVEABLE DISCARDABLE 0, 0, 220, 62
|
||||
STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Çàãðóçêà ýëåìåíòà óïðàâëåíèÿ Mozilla Active X"
|
||||
FONT 8, "MS Shell Dlg"
|
||||
{
|
||||
CONTROL "Progress1",1000,"msctls_progress32",WS_BORDER|PBS_SMOOTH,10,10,200,12
|
||||
LTEXT "", 104, 10, 30, 200, 10, SS_CENTER
|
||||
PUSHBUTTON "Îòìåíà", IDCANCEL, 85, 44, 50, 15, WS_GROUP | WS_TABSTOP
|
||||
}
|
||||
|
||||
STRINGTABLE
|
||||
BEGIN
|
||||
1001 "Ïðèëîæåíèå çàïðàøèâàåò ActiveX-îáúåêò îáîçðåâàòåëÿ,\n" \
|
||||
"îäíàêî ýëåìåíò óïðàâëåíèÿ Mozilla ActiveX íåóñòàíîâëåí.\n" \
|
||||
"Õîòèòå çàãðóçèòü è óñòàíîâèòü åãî?"
|
||||
END
|
||||
|
||||
|
||||
@@ -1,22 +0,0 @@
|
||||
/* TRANSLATOR: Mário Kaèmár /Mario Kacmar/ aka Kario ([email protected])
|
||||
* DATE OF TR: 15-02-2008
|
||||
*/
|
||||
|
||||
LANGUAGE LANG_SLOVAK, SUBLANG_DEFAULT
|
||||
|
||||
100 DIALOG LOADONCALL MOVEABLE DISCARDABLE 0, 0, 220, 62
|
||||
STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "S�ahujem ovládanie Mozilla Active X"
|
||||
FONT 8, "MS Shell Dlg"
|
||||
{
|
||||
CONTROL "Progress1",1000,"msctls_progress32",WS_BORDER|PBS_SMOOTH,10,10,200,12
|
||||
LTEXT "", 104, 10, 30, 200, 10, SS_CENTER
|
||||
PUSHBUTTON "Zruši�", IDCANCEL, 85, 44, 50, 15, WS_GROUP | WS_TABSTOP
|
||||
}
|
||||
|
||||
STRINGTABLE
|
||||
BEGIN
|
||||
1001 "Táto aplikácia sa dožaduje prehliadania objektu ActiveX\n" \
|
||||
"ale ovládanie Mozilla Active X nie je v súèasnosti nainštalované.\n" \
|
||||
"Želáte si ho stiahnu� a nainštalova�?"
|
||||
END
|
||||
@@ -1,34 +0,0 @@
|
||||
/*
|
||||
* Copyright 2005 Anders Bergh
|
||||
*
|
||||
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
LANGUAGE LANG_SWEDISH, SUBLANG_NEUTRAL
|
||||
|
||||
100 DIALOG LOADONCALL MOVEABLE DISCARDABLE 0, 0, 220, 62
|
||||
STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Laddar ner Mozilla ActiveX-komponent"
|
||||
FONT 8, "MS Shell Dlg"
|
||||
{
|
||||
CONTROL "Progress1",1000,"msctls_progress32",WS_BORDER|PBS_SMOOTH,10,10,200,12
|
||||
LTEXT "", 104, 10, 30, 200, 10, SS_CENTER
|
||||
PUSHBUTTON "Avbryt", IDCANCEL, 85, 44, 50, 15, WS_GROUP | WS_TABSTOP
|
||||
}
|
||||
|
||||
STRINGTABLE
|
||||
BEGIN
|
||||
1001 "Programmet kräver en ActiveX-komponent som inte är tillgänglig.\nVill du ladda ner och installera Mozillas ActiveX-komponent?"
|
||||
END
|
||||
@@ -1,26 +0,0 @@
|
||||
/*
|
||||
* PROJECT: Shell Doc Object and Control Library
|
||||
* LICENSE: GPL - See COPYING in the top level directory
|
||||
* FILE: dll/win32/shdocvw/Uk.rc
|
||||
* PURPOSE: Ukraianian Language File for shdocvw
|
||||
* TRANSLATOR: Artem Reznikov
|
||||
*/
|
||||
|
||||
LANGUAGE LANG_UKRAINIAN, SUBLANG_DEFAULT
|
||||
|
||||
100 DIALOG LOADONCALL MOVEABLE DISCARDABLE 0, 0, 220, 62
|
||||
STYLE DS_MODALFRAME | DS_CENTER | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
|
||||
CAPTION "Çàâàíòàæåííÿ åëåìåíòó óïðàâë³ííÿ Mozilla Active X"
|
||||
FONT 8, "MS Shell Dlg"
|
||||
{
|
||||
CONTROL "Progress1",1000,"msctls_progress32",WS_BORDER|PBS_SMOOTH,10,10,200,12
|
||||
LTEXT "", 104, 10, 30, 200, 10, SS_CENTER
|
||||
PUSHBUTTON "Ñêàñóâàòè", IDCANCEL, 85, 44, 50, 15, WS_GROUP | WS_TABSTOP
|
||||
}
|
||||
|
||||
STRINGTABLE
|
||||
BEGIN
|
||||
1001 "Öåé äîäàòîê ïîòðåáóº îá'ºêò ActiveX îãëÿäà÷à,\n" \
|
||||
"àëå åëåìåíò óïðàâë³ííÿ Mozilla Active X íå âñòàíîâëåíèé.\n" \
|
||||
"Âè áàæàºòå çàâàíòàæèòè ³ âñòàíîâèòè éîãî??"
|
||||
END
|
||||
@@ -15,7 +15,7 @@
|
||||
*
|
||||
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include <stdarg.h>
|
||||
@@ -60,34 +60,24 @@ static HRESULT WINAPI ProvideClassInfo_GetClassInfo(IProvideClassInfo2 *iface, L
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
/* Get the IID for generic default event callbacks. This IID will
|
||||
* in theory be used to later query for an IConnectionPoint to connect
|
||||
* an event sink (callback implementation in the OLE control site)
|
||||
* to this control.
|
||||
*/
|
||||
static HRESULT WINAPI ProvideClassInfo_GetGUID(IProvideClassInfo2 *iface,
|
||||
DWORD dwGuidKind, GUID *pGUID)
|
||||
{
|
||||
WebBrowser *This = CLASSINFO_THIS(iface);
|
||||
|
||||
FIXME("(%p)->(%ld %p)\n", This, dwGuidKind, pGUID);
|
||||
TRACE("(%p)->(%d %p)\n", This, dwGuidKind, pGUID);
|
||||
|
||||
if (dwGuidKind != GUIDKIND_DEFAULT_SOURCE_DISP_IID)
|
||||
{
|
||||
FIXME ("Requested unsupported GUID type: %ld\n", dwGuidKind);
|
||||
return E_FAIL; /* Is there a better return type here? */
|
||||
if(!pGUID)
|
||||
return E_POINTER;
|
||||
|
||||
if (dwGuidKind != GUIDKIND_DEFAULT_SOURCE_DISP_IID) {
|
||||
WARN("Wrong GUID type: %d\n", dwGuidKind);
|
||||
*pGUID = IID_NULL;
|
||||
return E_FAIL;
|
||||
}
|
||||
|
||||
/* FIXME: Returning IPropertyNotifySink interface, but should really
|
||||
* return a more generic event set (???) dispinterface.
|
||||
* However, this hack, allows a control site to return with success
|
||||
* (MFC's COleControlSite falls back to older IProvideClassInfo interface
|
||||
* if GetGUID() fails to return a non-NULL GUID).
|
||||
*/
|
||||
memcpy(pGUID, &IID_IPropertyNotifySink, sizeof(GUID));
|
||||
FIXME("Wrongly returning IPropertyNotifySink interface %s\n",
|
||||
debugstr_guid(pGUID));
|
||||
|
||||
memcpy(pGUID, This->version == 1 ? &DIID_DWebBrowserEvents : &DIID_DWebBrowserEvents2,
|
||||
sizeof(GUID));
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
|
||||
@@ -13,19 +13,23 @@
|
||||
*
|
||||
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#include "wine/debug.h"
|
||||
#include "shdocvw.h"
|
||||
#include "mshtmdid.h"
|
||||
#include "idispids.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(shdocvw);
|
||||
|
||||
#define CLIENTSITE_THIS(iface) DEFINE_THIS(WebBrowser, OleClientSite, iface)
|
||||
#define CLIENTSITE_THIS(iface) DEFINE_THIS(DocHost, OleClientSite, iface)
|
||||
|
||||
static HRESULT WINAPI ClientSite_QueryInterface(IOleClientSite *iface, REFIID riid, void **ppv)
|
||||
{
|
||||
WebBrowser *This = CLIENTSITE_THIS(iface);
|
||||
DocHost *This = CLIENTSITE_THIS(iface);
|
||||
|
||||
*ppv = NULL;
|
||||
|
||||
@@ -50,10 +54,19 @@ static HRESULT WINAPI ClientSite_QueryInterface(IOleClientSite *iface, REFIID ri
|
||||
}else if(IsEqualGUID(&IID_IOleDocumentSite, riid)) {
|
||||
TRACE("(%p)->(IID_IOleDocumentSite %p)\n", This, ppv);
|
||||
*ppv = DOCSITE(This);
|
||||
}else if(IsEqualGUID(&IID_IOleCommandTarget, riid)) {
|
||||
TRACE("(%p)->(IID_IOleCommandTarget %p)\n", This, ppv);
|
||||
*ppv = OLECMD(This);
|
||||
}else if(IsEqualGUID(&IID_IDispatch, riid)) {
|
||||
TRACE("(%p)->(IID_IDispatch %p)\n", This, ppv);
|
||||
*ppv = CLDISP(This);
|
||||
}else if(IsEqualGUID(&IID_IServiceProvider, riid)) {
|
||||
TRACE("(%p)->(IID_IServiceProvider %p)\n", This, ppv);
|
||||
*ppv = SERVPROV(This);
|
||||
}
|
||||
|
||||
if(*ppv) {
|
||||
IWebBrowser2_AddRef(WEBBROWSER(This));
|
||||
IOleClientSite_AddRef(CLIENTSITE(This));
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -64,19 +77,19 @@ static HRESULT WINAPI ClientSite_QueryInterface(IOleClientSite *iface, REFIID ri
|
||||
|
||||
static ULONG WINAPI ClientSite_AddRef(IOleClientSite *iface)
|
||||
{
|
||||
WebBrowser *This = CLIENTSITE_THIS(iface);
|
||||
return IWebBrowser2_AddRef(WEBBROWSER(This));
|
||||
DocHost *This = CLIENTSITE_THIS(iface);
|
||||
return IDispatch_AddRef(This->disp);
|
||||
}
|
||||
|
||||
static ULONG WINAPI ClientSite_Release(IOleClientSite *iface)
|
||||
{
|
||||
WebBrowser *This = CLIENTSITE_THIS(iface);
|
||||
return IWebBrowser2_Release(WEBBROWSER(This));
|
||||
DocHost *This = CLIENTSITE_THIS(iface);
|
||||
return IDispatch_Release(This->disp);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI ClientSite_SaveObject(IOleClientSite *iface)
|
||||
{
|
||||
WebBrowser *This = CLIENTSITE_THIS(iface);
|
||||
DocHost *This = CLIENTSITE_THIS(iface);
|
||||
FIXME("(%p)\n", This);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
@@ -84,35 +97,35 @@ static HRESULT WINAPI ClientSite_SaveObject(IOleClientSite *iface)
|
||||
static HRESULT WINAPI ClientSite_GetMoniker(IOleClientSite *iface, DWORD dwAssign,
|
||||
DWORD dwWhichMoniker, IMoniker **ppmk)
|
||||
{
|
||||
WebBrowser *This = CLIENTSITE_THIS(iface);
|
||||
FIXME("(%p)->(%ld %ld %p)\n", This, dwAssign, dwWhichMoniker, ppmk);
|
||||
DocHost *This = CLIENTSITE_THIS(iface);
|
||||
FIXME("(%p)->(%d %d %p)\n", This, dwAssign, dwWhichMoniker, ppmk);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI ClientSite_GetContainer(IOleClientSite *iface, IOleContainer **ppContainer)
|
||||
{
|
||||
WebBrowser *This = CLIENTSITE_THIS(iface);
|
||||
DocHost *This = CLIENTSITE_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, ppContainer);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI ClientSite_ShowObject(IOleClientSite *iface)
|
||||
{
|
||||
WebBrowser *This = CLIENTSITE_THIS(iface);
|
||||
DocHost *This = CLIENTSITE_THIS(iface);
|
||||
FIXME("(%p)\n", This);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI ClientSite_OnShowWindow(IOleClientSite *iface, BOOL fShow)
|
||||
{
|
||||
WebBrowser *This = CLIENTSITE_THIS(iface);
|
||||
DocHost *This = CLIENTSITE_THIS(iface);
|
||||
FIXME("(%p)->(%x)\n", This, fShow);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI ClientSite_RequestNewObjectLayout(IOleClientSite *iface)
|
||||
{
|
||||
WebBrowser *This = CLIENTSITE_THIS(iface);
|
||||
DocHost *This = CLIENTSITE_THIS(iface);
|
||||
FIXME("(%p)\n", This);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
@@ -131,46 +144,46 @@ static const IOleClientSiteVtbl OleClientSiteVtbl = {
|
||||
ClientSite_RequestNewObjectLayout
|
||||
};
|
||||
|
||||
#define INPLACESITE_THIS(iface) DEFINE_THIS(WebBrowser, OleInPlaceSite, iface)
|
||||
#define INPLACESITE_THIS(iface) DEFINE_THIS(DocHost, OleInPlaceSite, iface)
|
||||
|
||||
static HRESULT WINAPI InPlaceSite_QueryInterface(IOleInPlaceSite *iface, REFIID riid, void **ppv)
|
||||
{
|
||||
WebBrowser *This = INPLACESITE_THIS(iface);
|
||||
DocHost *This = INPLACESITE_THIS(iface);
|
||||
return IOleClientSite_QueryInterface(CLIENTSITE(This), riid, ppv);
|
||||
}
|
||||
|
||||
static ULONG WINAPI InPlaceSite_AddRef(IOleInPlaceSite *iface)
|
||||
{
|
||||
WebBrowser *This = INPLACESITE_THIS(iface);
|
||||
DocHost *This = INPLACESITE_THIS(iface);
|
||||
return IOleClientSite_AddRef(CLIENTSITE(This));
|
||||
}
|
||||
|
||||
static ULONG WINAPI InPlaceSite_Release(IOleInPlaceSite *iface)
|
||||
{
|
||||
WebBrowser *This = INPLACESITE_THIS(iface);
|
||||
DocHost *This = INPLACESITE_THIS(iface);
|
||||
return IOleClientSite_Release(CLIENTSITE(This));
|
||||
}
|
||||
|
||||
static HRESULT WINAPI InPlaceSite_GetWindow(IOleInPlaceSite *iface, HWND *phwnd)
|
||||
{
|
||||
WebBrowser *This = INPLACESITE_THIS(iface);
|
||||
DocHost *This = INPLACESITE_THIS(iface);
|
||||
|
||||
TRACE("(%p)->(%p)\n", This, phwnd);
|
||||
|
||||
*phwnd = This->doc_view_hwnd;
|
||||
*phwnd = This->hwnd;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI InPlaceSite_ContextSensitiveHelp(IOleInPlaceSite *iface, BOOL fEnterMode)
|
||||
{
|
||||
WebBrowser *This = INPLACESITE_THIS(iface);
|
||||
DocHost *This = INPLACESITE_THIS(iface);
|
||||
FIXME("(%p)->(%x)\n", This, fEnterMode);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI InPlaceSite_CanInPlaceActivate(IOleInPlaceSite *iface)
|
||||
{
|
||||
WebBrowser *This = INPLACESITE_THIS(iface);
|
||||
DocHost *This = INPLACESITE_THIS(iface);
|
||||
|
||||
TRACE("(%p)\n", This);
|
||||
|
||||
@@ -180,7 +193,7 @@ static HRESULT WINAPI InPlaceSite_CanInPlaceActivate(IOleInPlaceSite *iface)
|
||||
|
||||
static HRESULT WINAPI InPlaceSite_OnInPlaceActivate(IOleInPlaceSite *iface)
|
||||
{
|
||||
WebBrowser *This = INPLACESITE_THIS(iface);
|
||||
DocHost *This = INPLACESITE_THIS(iface);
|
||||
|
||||
TRACE("(%p)\n", This);
|
||||
|
||||
@@ -190,7 +203,7 @@ static HRESULT WINAPI InPlaceSite_OnInPlaceActivate(IOleInPlaceSite *iface)
|
||||
|
||||
static HRESULT WINAPI InPlaceSite_OnUIActivate(IOleInPlaceSite *iface)
|
||||
{
|
||||
WebBrowser *This = INPLACESITE_THIS(iface);
|
||||
DocHost *This = INPLACESITE_THIS(iface);
|
||||
FIXME("(%p)\n", This);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
@@ -199,20 +212,21 @@ static HRESULT WINAPI InPlaceSite_GetWindowContext(IOleInPlaceSite *iface,
|
||||
IOleInPlaceFrame **ppFrame, IOleInPlaceUIWindow **ppDoc, LPRECT lprcPosRect,
|
||||
LPRECT lprcClipRect, LPOLEINPLACEFRAMEINFO lpFrameInfo)
|
||||
{
|
||||
WebBrowser *This = INPLACESITE_THIS(iface);
|
||||
DocHost *This = INPLACESITE_THIS(iface);
|
||||
|
||||
TRACE("(%p)->(%p %p %p %p %p)\n", This, ppFrame, ppDoc, lprcPosRect,
|
||||
lprcClipRect, lpFrameInfo);
|
||||
|
||||
IOleInPlaceFrame_AddRef(INPLACEFRAME(This));
|
||||
*ppFrame = INPLACEFRAME(This);
|
||||
*ppDoc = NULL;
|
||||
|
||||
GetClientRect(This->doc_view_hwnd, lprcPosRect);
|
||||
memcpy(lprcClipRect, lprcPosRect, sizeof(RECT));
|
||||
GetClientRect(This->hwnd, lprcPosRect);
|
||||
*lprcClipRect = *lprcPosRect;
|
||||
|
||||
lpFrameInfo->cb = sizeof(*lpFrameInfo);
|
||||
lpFrameInfo->fMDIApp = FALSE;
|
||||
lpFrameInfo->hwndFrame = This->shell_embedding_hwnd;
|
||||
lpFrameInfo->hwndFrame = This->frame_hwnd;
|
||||
lpFrameInfo->haccel = NULL;
|
||||
lpFrameInfo->cAccelEntries = 0; /* FIXME: should be 5 */
|
||||
|
||||
@@ -221,35 +235,38 @@ static HRESULT WINAPI InPlaceSite_GetWindowContext(IOleInPlaceSite *iface,
|
||||
|
||||
static HRESULT WINAPI InPlaceSite_Scroll(IOleInPlaceSite *iface, SIZE scrollExtent)
|
||||
{
|
||||
WebBrowser *This = INPLACESITE_THIS(iface);
|
||||
FIXME("(%p)->({%ld %ld})\n", This, scrollExtent.cx, scrollExtent.cy);
|
||||
DocHost *This = INPLACESITE_THIS(iface);
|
||||
FIXME("(%p)->({%d %d})\n", This, scrollExtent.cx, scrollExtent.cy);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI InPlaceSite_OnUIDeactivate(IOleInPlaceSite *iface, BOOL fUndoable)
|
||||
{
|
||||
WebBrowser *This = INPLACESITE_THIS(iface);
|
||||
DocHost *This = INPLACESITE_THIS(iface);
|
||||
FIXME("(%p)->(%x)\n", This, fUndoable);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI InPlaceSite_OnInPlaceDeactivate(IOleInPlaceSite *iface)
|
||||
{
|
||||
WebBrowser *This = INPLACESITE_THIS(iface);
|
||||
FIXME("(%p)\n", This);
|
||||
return E_NOTIMPL;
|
||||
DocHost *This = INPLACESITE_THIS(iface);
|
||||
|
||||
TRACE("(%p)\n", This);
|
||||
|
||||
/* Nothing to do here */
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI InPlaceSite_DiscardUndoState(IOleInPlaceSite *iface)
|
||||
{
|
||||
WebBrowser *This = INPLACESITE_THIS(iface);
|
||||
DocHost *This = INPLACESITE_THIS(iface);
|
||||
FIXME("(%p)\n", This);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI InPlaceSite_DeactivateAndUndo(IOleInPlaceSite *iface)
|
||||
{
|
||||
WebBrowser *This = INPLACESITE_THIS(iface);
|
||||
DocHost *This = INPLACESITE_THIS(iface);
|
||||
FIXME("(%p)\n", This);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
@@ -257,7 +274,7 @@ static HRESULT WINAPI InPlaceSite_DeactivateAndUndo(IOleInPlaceSite *iface)
|
||||
static HRESULT WINAPI InPlaceSite_OnPosRectChange(IOleInPlaceSite *iface,
|
||||
LPCRECT lprcPosRect)
|
||||
{
|
||||
WebBrowser *This = INPLACESITE_THIS(iface);
|
||||
DocHost *This = INPLACESITE_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, lprcPosRect);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
@@ -282,31 +299,31 @@ static const IOleInPlaceSiteVtbl OleInPlaceSiteVtbl = {
|
||||
InPlaceSite_OnPosRectChange
|
||||
};
|
||||
|
||||
#define DOCSITE_THIS(iface) DEFINE_THIS(WebBrowser, OleDocumentSite, iface)
|
||||
#define DOCSITE_THIS(iface) DEFINE_THIS(DocHost, OleDocumentSite, iface)
|
||||
|
||||
static HRESULT WINAPI OleDocumentSite_QueryInterface(IOleDocumentSite *iface,
|
||||
REFIID riid, void **ppv)
|
||||
{
|
||||
WebBrowser *This = DOCSITE_THIS(iface);
|
||||
DocHost *This = DOCSITE_THIS(iface);
|
||||
return IOleClientSite_QueryInterface(CLIENTSITE(This), riid, ppv);
|
||||
}
|
||||
|
||||
static ULONG WINAPI OleDocumentSite_AddRef(IOleDocumentSite *iface)
|
||||
{
|
||||
WebBrowser *This = DOCSITE_THIS(iface);
|
||||
DocHost *This = DOCSITE_THIS(iface);
|
||||
return IOleClientSite_AddRef(CLIENTSITE(This));
|
||||
}
|
||||
|
||||
static ULONG WINAPI OleDocumentSite_Release(IOleDocumentSite *iface)
|
||||
{
|
||||
WebBrowser *This = DOCSITE_THIS(iface);
|
||||
DocHost *This = DOCSITE_THIS(iface);
|
||||
return IOleClientSite_Release(CLIENTSITE(This));
|
||||
}
|
||||
|
||||
static HRESULT WINAPI OleDocumentSite_ActivateMe(IOleDocumentSite *iface,
|
||||
IOleDocumentView *pViewToActivate)
|
||||
{
|
||||
WebBrowser *This = DOCSITE_THIS(iface);
|
||||
DocHost *This = DOCSITE_THIS(iface);
|
||||
IOleDocument *oledoc;
|
||||
RECT rect;
|
||||
HRESULT hres;
|
||||
@@ -320,7 +337,7 @@ static HRESULT WINAPI OleDocumentSite_ActivateMe(IOleDocumentSite *iface,
|
||||
IOleDocument_CreateView(oledoc, INPLACESITE(This), NULL, 0, &This->view);
|
||||
IOleDocument_Release(oledoc);
|
||||
|
||||
GetClientRect(This->doc_view_hwnd, &rect);
|
||||
GetClientRect(This->hwnd, &rect);
|
||||
IOleDocumentView_SetRect(This->view, &rect);
|
||||
|
||||
hres = IOleDocumentView_Show(This->view, TRUE);
|
||||
@@ -337,16 +354,176 @@ static const IOleDocumentSiteVtbl OleDocumentSiteVtbl = {
|
||||
OleDocumentSite_ActivateMe
|
||||
};
|
||||
|
||||
void WebBrowser_ClientSite_Init(WebBrowser *This)
|
||||
#define DISP_THIS(iface) DEFINE_THIS(DocHost, Dispatch, iface)
|
||||
|
||||
static HRESULT WINAPI ClDispatch_QueryInterface(IDispatch *iface, REFIID riid, void **ppv)
|
||||
{
|
||||
DocHost *This = DISP_THIS(iface);
|
||||
return IOleClientSite_QueryInterface(CLIENTSITE(This), riid, ppv);
|
||||
}
|
||||
|
||||
static ULONG WINAPI ClDispatch_AddRef(IDispatch *iface)
|
||||
{
|
||||
DocHost *This = DISP_THIS(iface);
|
||||
return IOleClientSite_AddRef(CLIENTSITE(This));
|
||||
}
|
||||
|
||||
static ULONG WINAPI ClDispatch_Release(IDispatch *iface)
|
||||
{
|
||||
DocHost *This = DISP_THIS(iface);
|
||||
return IOleClientSite_Release(CLIENTSITE(This));
|
||||
}
|
||||
|
||||
static HRESULT WINAPI ClDispatch_GetTypeInfoCount(IDispatch *iface, UINT *pctinfo)
|
||||
{
|
||||
DocHost *This = DISP_THIS(iface);
|
||||
|
||||
TRACE("(%p)->(%p)\n", This, pctinfo);
|
||||
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI ClDispatch_GetTypeInfo(IDispatch *iface, UINT iTInfo, LCID lcid,
|
||||
ITypeInfo **ppTInfo)
|
||||
{
|
||||
DocHost *This = DISP_THIS(iface);
|
||||
|
||||
TRACE("(%p)->(%u %d %p)\n", This, iTInfo, lcid, ppTInfo);
|
||||
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI ClDispatch_GetIDsOfNames(IDispatch *iface, REFIID riid, LPOLESTR *rgszNames,
|
||||
UINT cNames, LCID lcid, DISPID *rgDispId)
|
||||
{
|
||||
DocHost *This = DISP_THIS(iface);
|
||||
|
||||
TRACE("(%p)->(%s %p %u %d %p)\n", This, debugstr_guid(riid), rgszNames, cNames,
|
||||
lcid, rgDispId);
|
||||
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static const char *debugstr_dispid(DISPID dispid)
|
||||
{
|
||||
static char buf[16];
|
||||
|
||||
#define CASE_DISPID(did) case did: return #did
|
||||
switch(dispid) {
|
||||
CASE_DISPID(DISPID_AMBIENT_USERMODE);
|
||||
CASE_DISPID(DISPID_AMBIENT_DLCONTROL);
|
||||
CASE_DISPID(DISPID_AMBIENT_USERAGENT);
|
||||
CASE_DISPID(DISPID_AMBIENT_PALETTE);
|
||||
CASE_DISPID(DISPID_AMBIENT_OFFLINEIFNOTCONNECTED);
|
||||
CASE_DISPID(DISPID_AMBIENT_SILENT);
|
||||
}
|
||||
#undef CASE_DISPID
|
||||
|
||||
sprintf(buf, "%d", dispid);
|
||||
return buf;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI ClDispatch_Invoke(IDispatch *iface, DISPID dispIdMember, REFIID riid,
|
||||
LCID lcid, WORD wFlags, DISPPARAMS *pDispParams,
|
||||
VARIANT *pVarResult, EXCEPINFO *pExcepInfo, UINT *puArgErr)
|
||||
{
|
||||
DocHost *This = DISP_THIS(iface);
|
||||
|
||||
TRACE("(%p)->(%s %s %d %04x %p %p %p %p)\n", This, debugstr_dispid(dispIdMember),
|
||||
debugstr_guid(riid), lcid, wFlags, pDispParams, pVarResult, pExcepInfo, puArgErr);
|
||||
|
||||
switch(dispIdMember) {
|
||||
case DISPID_AMBIENT_USERMODE:
|
||||
case DISPID_AMBIENT_DLCONTROL:
|
||||
case DISPID_AMBIENT_USERAGENT:
|
||||
case DISPID_AMBIENT_PALETTE:
|
||||
if(!This->client_disp)
|
||||
return E_FAIL;
|
||||
return IDispatch_Invoke(This->client_disp, dispIdMember, riid, lcid, wFlags,
|
||||
pDispParams, pVarResult, pExcepInfo, puArgErr);
|
||||
case DISPID_AMBIENT_OFFLINEIFNOTCONNECTED:
|
||||
V_VT(pVarResult) = VT_BOOL;
|
||||
V_BOOL(pVarResult) = This->offline;
|
||||
return S_OK;
|
||||
case DISPID_AMBIENT_SILENT:
|
||||
V_VT(pVarResult) = VT_BOOL;
|
||||
V_BOOL(pVarResult) = This->offline;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
FIXME("unhandled dispid %d\n", dispIdMember);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
#undef DISP_THIS
|
||||
|
||||
static const IDispatchVtbl DispatchVtbl = {
|
||||
ClDispatch_QueryInterface,
|
||||
ClDispatch_AddRef,
|
||||
ClDispatch_Release,
|
||||
ClDispatch_GetTypeInfoCount,
|
||||
ClDispatch_GetTypeInfo,
|
||||
ClDispatch_GetIDsOfNames,
|
||||
ClDispatch_Invoke
|
||||
};
|
||||
|
||||
#define SERVPROV_THIS(iface) DEFINE_THIS(DocHost, ServiceProvider, iface)
|
||||
|
||||
static HRESULT WINAPI ClServiceProvider_QueryInterface(IServiceProvider *iface, REFIID riid,
|
||||
void **ppv)
|
||||
{
|
||||
DocHost *This = SERVPROV_THIS(iface);
|
||||
return IOleClientSite_QueryInterface(CLIENTSITE(This), riid, ppv);
|
||||
}
|
||||
|
||||
static ULONG WINAPI ClServiceProvider_AddRef(IServiceProvider *iface)
|
||||
{
|
||||
DocHost *This = SERVPROV_THIS(iface);
|
||||
return IOleClientSite_AddRef(CLIENTSITE(This));
|
||||
}
|
||||
|
||||
static ULONG WINAPI ClServiceProvider_Release(IServiceProvider *iface)
|
||||
{
|
||||
DocHost *This = SERVPROV_THIS(iface);
|
||||
return IOleClientSite_Release(CLIENTSITE(This));
|
||||
}
|
||||
|
||||
static HRESULT WINAPI ClServiceProvider_QueryService(IServiceProvider *iface, REFGUID guidService,
|
||||
REFIID riid, void **ppv)
|
||||
{
|
||||
DocHost *This = SERVPROV_THIS(iface);
|
||||
|
||||
if(IsEqualGUID(&IID_IHlinkFrame, guidService)) {
|
||||
TRACE("(%p)->(IID_IHlinkFrame %s %p)\n", This, debugstr_guid(riid), ppv);
|
||||
return IDispatch_QueryInterface(This->disp, riid, ppv);
|
||||
}
|
||||
|
||||
FIXME("(%p)->(%s %s %p)\n", This, debugstr_guid(guidService), debugstr_guid(riid), ppv);
|
||||
|
||||
return E_NOINTERFACE;
|
||||
}
|
||||
|
||||
#undef SERVPROV_THIS
|
||||
|
||||
static const IServiceProviderVtbl ServiceProviderVtbl = {
|
||||
ClServiceProvider_QueryInterface,
|
||||
ClServiceProvider_AddRef,
|
||||
ClServiceProvider_Release,
|
||||
ClServiceProvider_QueryService
|
||||
};
|
||||
|
||||
void DocHost_ClientSite_Init(DocHost *This)
|
||||
{
|
||||
This->lpOleClientSiteVtbl = &OleClientSiteVtbl;
|
||||
This->lpOleInPlaceSiteVtbl = &OleInPlaceSiteVtbl;
|
||||
This->lpOleDocumentSiteVtbl = &OleDocumentSiteVtbl;
|
||||
This->lpDispatchVtbl = &DispatchVtbl;
|
||||
This->lpServiceProviderVtbl = &ServiceProviderVtbl;
|
||||
|
||||
This->view = NULL;
|
||||
}
|
||||
|
||||
void WebBrowser_ClientSite_Destroy(WebBrowser *This)
|
||||
void DocHost_ClientSite_Release(DocHost *This)
|
||||
{
|
||||
if(This->view)
|
||||
IOleDocumentView_Release(This->view);
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2005 Jacek Caban for CodeWeavers
|
||||
* 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
|
||||
@@ -13,7 +13,7 @@
|
||||
*
|
||||
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include "wine/debug.h"
|
||||
@@ -25,17 +25,32 @@ WINE_DEFAULT_DEBUG_CHANNEL(shdocvw);
|
||||
|
||||
static ATOM doc_view_atom = 0;
|
||||
|
||||
static void navigate_complete(WebBrowser *This)
|
||||
void push_dochost_task(DocHost *This, task_header_t *task, task_proc_t proc, BOOL send)
|
||||
{
|
||||
task->proc = proc;
|
||||
|
||||
/* FIXME: Don't use lParam */
|
||||
if(send)
|
||||
SendMessageW(This->frame_hwnd, WM_DOCHOSTTASK, 0, (LPARAM)task);
|
||||
else
|
||||
PostMessageW(This->frame_hwnd, WM_DOCHOSTTASK, 0, (LPARAM)task);
|
||||
}
|
||||
|
||||
LRESULT process_dochost_task(DocHost *This, LPARAM lparam)
|
||||
{
|
||||
task_header_t *task = (task_header_t*)lparam;
|
||||
|
||||
task->proc(This, task);
|
||||
|
||||
heap_free(task);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void navigate_complete(DocHost *This)
|
||||
{
|
||||
IDispatch *disp = NULL;
|
||||
DISPPARAMS dispparams;
|
||||
VARIANTARG params[2];
|
||||
VARIANT url;
|
||||
HRESULT hres;
|
||||
|
||||
hres = IUnknown_QueryInterface(This->document, &IID_IDispatch, (void**)&disp);
|
||||
if(FAILED(hres))
|
||||
FIXME("Could not get IDispatch interface\n");
|
||||
|
||||
dispparams.cArgs = 2;
|
||||
dispparams.cNamedArgs = 0;
|
||||
@@ -46,19 +61,19 @@ static void navigate_complete(WebBrowser *This)
|
||||
V_BYREF(params) = &url;
|
||||
|
||||
V_VT(params+1) = VT_DISPATCH;
|
||||
V_DISPATCH(params+1) = disp;
|
||||
V_DISPATCH(params+1) = This->disp;
|
||||
|
||||
V_VT(&url) = VT_BSTR;
|
||||
V_BSTR(&url) = This->url;
|
||||
V_BSTR(&url) = SysAllocString(This->url);
|
||||
|
||||
call_sink(This->cp_wbe2, DISPID_NAVIGATECOMPLETE2, &dispparams);
|
||||
call_sink(This->cp_wbe2, DISPID_DOCUMENTCOMPLETE, &dispparams);
|
||||
call_sink(This->cps.wbe2, DISPID_NAVIGATECOMPLETE2, &dispparams);
|
||||
call_sink(This->cps.wbe2, DISPID_DOCUMENTCOMPLETE, &dispparams);
|
||||
|
||||
if(disp)
|
||||
IDispatch_Release(disp);
|
||||
SysFreeString(V_BSTR(&url));
|
||||
This->busy = VARIANT_FALSE;
|
||||
}
|
||||
|
||||
static LRESULT navigate2(WebBrowser *This)
|
||||
void object_available(DocHost *This)
|
||||
{
|
||||
IHlinkTarget *hlink;
|
||||
HRESULT hres;
|
||||
@@ -67,32 +82,32 @@ static LRESULT navigate2(WebBrowser *This)
|
||||
|
||||
if(!This->document) {
|
||||
WARN("document == NULL\n");
|
||||
return 0;
|
||||
return;
|
||||
}
|
||||
|
||||
hres = IUnknown_QueryInterface(This->document, &IID_IHlinkTarget, (void**)&hlink);
|
||||
if(FAILED(hres)) {
|
||||
FIXME("Could not get IHlinkTarget interface\n");
|
||||
return 0;
|
||||
return;
|
||||
}
|
||||
|
||||
hres = IHlinkTarget_Navigate(hlink, 0, NULL);
|
||||
IHlinkTarget_Release(hlink);
|
||||
if(FAILED(hres)) {
|
||||
FIXME("Navigate failed\n");
|
||||
return 0;
|
||||
return;
|
||||
}
|
||||
|
||||
navigate_complete(This);
|
||||
|
||||
return 0;
|
||||
return;
|
||||
}
|
||||
|
||||
static LRESULT resize_document(WebBrowser *This, LONG width, LONG height)
|
||||
static LRESULT resize_document(DocHost *This, LONG width, LONG height)
|
||||
{
|
||||
RECT rect = {0, 0, width, height};
|
||||
|
||||
TRACE("(%p)->(%ld %ld)\n", This, width, height);
|
||||
TRACE("(%p)->(%d %d)\n", This, width, height);
|
||||
|
||||
if(This->view)
|
||||
IOleDocumentView_SetRect(This->view, &rect);
|
||||
@@ -102,12 +117,12 @@ static LRESULT resize_document(WebBrowser *This, LONG width, LONG height)
|
||||
|
||||
static LRESULT WINAPI doc_view_proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
WebBrowser *This;
|
||||
DocHost *This;
|
||||
|
||||
static const WCHAR wszTHIS[] = {'T','H','I','S',0};
|
||||
|
||||
if(msg == WM_CREATE) {
|
||||
This = *(WebBrowser**)lParam;
|
||||
This = *(DocHost**)lParam;
|
||||
SetPropW(hwnd, wszTHIS, This);
|
||||
}else {
|
||||
This = GetPropW(hwnd, wszTHIS);
|
||||
@@ -116,14 +131,12 @@ static LRESULT WINAPI doc_view_proc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM l
|
||||
switch(msg) {
|
||||
case WM_SIZE:
|
||||
return resize_document(This, LOWORD(lParam), HIWORD(lParam));
|
||||
case WB_WM_NAVIGATE2:
|
||||
return navigate2(This);
|
||||
}
|
||||
|
||||
return DefWindowProcA(hwnd, msg, wParam, lParam);
|
||||
return DefWindowProcW(hwnd, msg, wParam, lParam);
|
||||
}
|
||||
|
||||
void create_doc_view_hwnd(WebBrowser *This)
|
||||
void create_doc_view_hwnd(DocHost *This)
|
||||
{
|
||||
RECT rect;
|
||||
|
||||
@@ -136,7 +149,7 @@ void create_doc_view_hwnd(WebBrowser *This)
|
||||
CS_PARENTDC,
|
||||
doc_view_proc,
|
||||
0, 0 /* native uses 4*/, NULL, NULL, NULL,
|
||||
(HBRUSH)COLOR_WINDOWFRAME, NULL,
|
||||
(HBRUSH)(COLOR_WINDOW + 1), NULL,
|
||||
wszShell_DocObject_View,
|
||||
NULL
|
||||
};
|
||||
@@ -146,60 +159,168 @@ void create_doc_view_hwnd(WebBrowser *This)
|
||||
doc_view_atom = RegisterClassExW(&wndclass);
|
||||
}
|
||||
|
||||
GetWindowRect(This->shell_embedding_hwnd, &rect);
|
||||
This->doc_view_hwnd = CreateWindowExW(0, wszShell_DocObject_View,
|
||||
GetClientRect(This->frame_hwnd, &rect); /* FIXME */
|
||||
This->hwnd = CreateWindowExW(0, wszShell_DocObject_View,
|
||||
wszShell_DocObject_View,
|
||||
WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_TABSTOP | WS_MAXIMIZEBOX,
|
||||
rect.left, rect.top, rect.right, rect.bottom, This->shell_embedding_hwnd,
|
||||
WS_CHILD | WS_VISIBLE | WS_CLIPSIBLINGS | WS_CLIPCHILDREN | WS_TABSTOP,
|
||||
rect.left, rect.top, rect.right, rect.bottom, This->frame_hwnd,
|
||||
NULL, shdocvw_hinstance, This);
|
||||
}
|
||||
|
||||
#define DOCHOSTUI_THIS(iface) DEFINE_THIS(WebBrowser, DocHostUIHandler, iface)
|
||||
void deactivate_document(DocHost *This)
|
||||
{
|
||||
IOleInPlaceObjectWindowless *winobj;
|
||||
IOleObject *oleobj = NULL;
|
||||
IHlinkTarget *hlink = NULL;
|
||||
HRESULT hres;
|
||||
|
||||
if(This->view)
|
||||
IOleDocumentView_UIActivate(This->view, FALSE);
|
||||
|
||||
hres = IUnknown_QueryInterface(This->document, &IID_IOleInPlaceObjectWindowless,
|
||||
(void**)&winobj);
|
||||
if(SUCCEEDED(hres)) {
|
||||
IOleInPlaceObjectWindowless_InPlaceDeactivate(winobj);
|
||||
IOleInPlaceObjectWindowless_Release(winobj);
|
||||
}
|
||||
|
||||
if(This->view) {
|
||||
IOleDocumentView_Show(This->view, FALSE);
|
||||
IOleDocumentView_CloseView(This->view, 0);
|
||||
IOleDocumentView_SetInPlaceSite(This->view, NULL);
|
||||
IOleDocumentView_Release(This->view);
|
||||
This->view = NULL;
|
||||
}
|
||||
|
||||
hres = IUnknown_QueryInterface(This->document, &IID_IOleObject, (void**)&oleobj);
|
||||
if(SUCCEEDED(hres))
|
||||
IOleObject_Close(oleobj, OLECLOSE_NOSAVE);
|
||||
|
||||
hres = IUnknown_QueryInterface(This->document, &IID_IHlinkTarget, (void**)&hlink);
|
||||
if(SUCCEEDED(hres)) {
|
||||
IHlinkTarget_SetBrowseContext(hlink, NULL);
|
||||
IHlinkTarget_Release(hlink);
|
||||
}
|
||||
|
||||
if(oleobj) {
|
||||
IOleClientSite *client_site = NULL;
|
||||
|
||||
IOleObject_GetClientSite(oleobj, &client_site);
|
||||
if(client_site) {
|
||||
if(client_site == CLIENTSITE(This))
|
||||
IOleObject_SetClientSite(oleobj, NULL);
|
||||
IOleClientSite_Release(client_site);
|
||||
}
|
||||
|
||||
IOleObject_Release(oleobj);
|
||||
}
|
||||
|
||||
IUnknown_Release(This->document);
|
||||
This->document = NULL;
|
||||
}
|
||||
|
||||
#define OLECMD_THIS(iface) DEFINE_THIS(DocHost, OleCommandTarget, iface)
|
||||
|
||||
static HRESULT WINAPI ClOleCommandTarget_QueryInterface(IOleCommandTarget *iface,
|
||||
REFIID riid, void **ppv)
|
||||
{
|
||||
DocHost *This = OLECMD_THIS(iface);
|
||||
return IOleClientSite_QueryInterface(CLIENTSITE(This), riid, ppv);
|
||||
}
|
||||
|
||||
static ULONG WINAPI ClOleCommandTarget_AddRef(IOleCommandTarget *iface)
|
||||
{
|
||||
DocHost *This = OLECMD_THIS(iface);
|
||||
return IOleClientSite_AddRef(CLIENTSITE(This));
|
||||
}
|
||||
|
||||
static ULONG WINAPI ClOleCommandTarget_Release(IOleCommandTarget *iface)
|
||||
{
|
||||
DocHost *This = OLECMD_THIS(iface);
|
||||
return IOleClientSite_Release(CLIENTSITE(This));
|
||||
}
|
||||
|
||||
static HRESULT WINAPI ClOleCommandTarget_QueryStatus(IOleCommandTarget *iface,
|
||||
const GUID *pguidCmdGroup, ULONG cCmds, OLECMD prgCmds[], OLECMDTEXT *pCmdText)
|
||||
{
|
||||
DocHost *This = OLECMD_THIS(iface);
|
||||
FIXME("(%p)->(%s %u %p %p)\n", This, debugstr_guid(pguidCmdGroup), cCmds, prgCmds,
|
||||
pCmdText);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI ClOleCommandTarget_Exec(IOleCommandTarget *iface,
|
||||
const GUID *pguidCmdGroup, DWORD nCmdID, DWORD nCmdexecopt, VARIANT *pvaIn,
|
||||
VARIANT *pvaOut)
|
||||
{
|
||||
DocHost *This = OLECMD_THIS(iface);
|
||||
FIXME("(%p)->(%s %d %d %p %p)\n", This, debugstr_guid(pguidCmdGroup), nCmdID,
|
||||
nCmdexecopt, pvaIn, pvaOut);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
#undef OLECMD_THIS
|
||||
|
||||
static const IOleCommandTargetVtbl OleCommandTargetVtbl = {
|
||||
ClOleCommandTarget_QueryInterface,
|
||||
ClOleCommandTarget_AddRef,
|
||||
ClOleCommandTarget_Release,
|
||||
ClOleCommandTarget_QueryStatus,
|
||||
ClOleCommandTarget_Exec
|
||||
};
|
||||
|
||||
#define DOCHOSTUI_THIS(iface) DEFINE_THIS(DocHost, DocHostUIHandler, iface)
|
||||
|
||||
static HRESULT WINAPI DocHostUIHandler_QueryInterface(IDocHostUIHandler2 *iface,
|
||||
REFIID riid, void **ppv)
|
||||
{
|
||||
WebBrowser *This = DOCHOSTUI_THIS(iface);
|
||||
DocHost *This = DOCHOSTUI_THIS(iface);
|
||||
return IOleClientSite_QueryInterface(CLIENTSITE(This), riid, ppv);
|
||||
}
|
||||
|
||||
static ULONG WINAPI DocHostUIHandler_AddRef(IDocHostUIHandler2 *iface)
|
||||
{
|
||||
WebBrowser *This = DOCHOSTUI_THIS(iface);
|
||||
DocHost *This = DOCHOSTUI_THIS(iface);
|
||||
return IOleClientSite_AddRef(CLIENTSITE(This));
|
||||
}
|
||||
|
||||
static ULONG WINAPI DocHostUIHandler_Release(IDocHostUIHandler2 *iface)
|
||||
{
|
||||
WebBrowser *This = DOCHOSTUI_THIS(iface);
|
||||
DocHost *This = DOCHOSTUI_THIS(iface);
|
||||
return IOleClientSite_Release(CLIENTSITE(This));
|
||||
}
|
||||
|
||||
static HRESULT WINAPI DocHostUIHandler_ShowContextMenu(IDocHostUIHandler2 *iface,
|
||||
DWORD dwID, POINT *ppt, IUnknown *pcmdtReserved, IDispatch *pdispReserved)
|
||||
{
|
||||
WebBrowser *This = DOCHOSTUI_THIS(iface);
|
||||
FIXME("(%p)->(%ld %p %p %p)\n", This, dwID, ppt, pcmdtReserved, pdispReserved);
|
||||
DocHost *This = DOCHOSTUI_THIS(iface);
|
||||
HRESULT hres;
|
||||
|
||||
TRACE("(%p)->(%d %p %p %p)\n", This, dwID, ppt, pcmdtReserved, pdispReserved);
|
||||
|
||||
if(This->hostui) {
|
||||
hres = IDocHostUIHandler_ShowContextMenu(This->hostui, dwID, ppt, pcmdtReserved,
|
||||
pdispReserved);
|
||||
if(hres == S_OK)
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
FIXME("default action not implemented\n");
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI DocHostUIHandler_GetHostInfo(IDocHostUIHandler2 *iface,
|
||||
DOCHOSTUIINFO *pInfo)
|
||||
{
|
||||
WebBrowser *This = DOCHOSTUI_THIS(iface);
|
||||
IDocHostUIHandler *handler;
|
||||
DocHost *This = DOCHOSTUI_THIS(iface);
|
||||
HRESULT hres;
|
||||
|
||||
TRACE("(%p)->(%p)\n", This, pInfo);
|
||||
|
||||
if(This->client) {
|
||||
hres = IOleClientSite_QueryInterface(This->client, &IID_IDocHostUIHandler, (void**)&handler);
|
||||
if(SUCCEEDED(hres)) {
|
||||
hres = IDocHostUIHandler_GetHostInfo(handler, pInfo);
|
||||
IDocHostUIHandler_Release(handler);
|
||||
if(SUCCEEDED(hres))
|
||||
return hres;
|
||||
}
|
||||
if(This->hostui) {
|
||||
hres = IDocHostUIHandler_GetHostInfo(This->hostui, pInfo);
|
||||
if(SUCCEEDED(hres))
|
||||
return hres;
|
||||
}
|
||||
|
||||
pInfo->dwFlags = DOCHOSTUIFLAG_DISABLE_HELP_MENU | DOCHOSTUIFLAG_OPENNEWWIN
|
||||
@@ -212,30 +333,35 @@ static HRESULT WINAPI DocHostUIHandler_ShowUI(IDocHostUIHandler2 *iface, DWORD d
|
||||
IOleInPlaceActiveObject *pActiveObject, IOleCommandTarget *pCommandTarget,
|
||||
IOleInPlaceFrame *pFrame, IOleInPlaceUIWindow *pDoc)
|
||||
{
|
||||
WebBrowser *This = DOCHOSTUI_THIS(iface);
|
||||
FIXME("(%p)->(%ld %p %p %p %p)\n", This, dwID, pActiveObject, pCommandTarget,
|
||||
DocHost *This = DOCHOSTUI_THIS(iface);
|
||||
FIXME("(%p)->(%d %p %p %p %p)\n", This, dwID, pActiveObject, pCommandTarget,
|
||||
pFrame, pDoc);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI DocHostUIHandler_HideUI(IDocHostUIHandler2 *iface)
|
||||
{
|
||||
WebBrowser *This = DOCHOSTUI_THIS(iface);
|
||||
DocHost *This = DOCHOSTUI_THIS(iface);
|
||||
FIXME("(%p)\n", This);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI DocHostUIHandler_UpdateUI(IDocHostUIHandler2 *iface)
|
||||
{
|
||||
WebBrowser *This = DOCHOSTUI_THIS(iface);
|
||||
FIXME("(%p)\n", This);
|
||||
return E_NOTIMPL;
|
||||
DocHost *This = DOCHOSTUI_THIS(iface);
|
||||
|
||||
TRACE("(%p)\n", This);
|
||||
|
||||
if(!This->hostui)
|
||||
return S_FALSE;
|
||||
|
||||
return IDocHostUIHandler_UpdateUI(This->hostui);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI DocHostUIHandler_EnableModeless(IDocHostUIHandler2 *iface,
|
||||
BOOL fEnable)
|
||||
{
|
||||
WebBrowser *This = DOCHOSTUI_THIS(iface);
|
||||
DocHost *This = DOCHOSTUI_THIS(iface);
|
||||
FIXME("(%p)->(%x)\n", This, fEnable);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
@@ -243,7 +369,7 @@ static HRESULT WINAPI DocHostUIHandler_EnableModeless(IDocHostUIHandler2 *iface,
|
||||
static HRESULT WINAPI DocHostUIHandler_OnDocWindowActivate(IDocHostUIHandler2 *iface,
|
||||
BOOL fActivate)
|
||||
{
|
||||
WebBrowser *This = DOCHOSTUI_THIS(iface);
|
||||
DocHost *This = DOCHOSTUI_THIS(iface);
|
||||
FIXME("(%p)->(%x)\n", This, fActivate);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
@@ -251,7 +377,7 @@ static HRESULT WINAPI DocHostUIHandler_OnDocWindowActivate(IDocHostUIHandler2 *i
|
||||
static HRESULT WINAPI DocHostUIHandler_OnFrameWindowActivate(IDocHostUIHandler2 *iface,
|
||||
BOOL fActivate)
|
||||
{
|
||||
WebBrowser *This = DOCHOSTUI_THIS(iface);
|
||||
DocHost *This = DOCHOSTUI_THIS(iface);
|
||||
FIXME("(%p)->(%x)\n", This, fActivate);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
@@ -259,7 +385,7 @@ static HRESULT WINAPI DocHostUIHandler_OnFrameWindowActivate(IDocHostUIHandler2
|
||||
static HRESULT WINAPI DocHostUIHandler_ResizeBorder(IDocHostUIHandler2 *iface,
|
||||
LPCRECT prcBorder, IOleInPlaceUIWindow *pUIWindow, BOOL fRameWindow)
|
||||
{
|
||||
WebBrowser *This = DOCHOSTUI_THIS(iface);
|
||||
DocHost *This = DOCHOSTUI_THIS(iface);
|
||||
FIXME("(%p)->(%p %p %X)\n", This, prcBorder, pUIWindow, fRameWindow);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
@@ -267,30 +393,20 @@ static HRESULT WINAPI DocHostUIHandler_ResizeBorder(IDocHostUIHandler2 *iface,
|
||||
static HRESULT WINAPI DocHostUIHandler_TranslateAccelerator(IDocHostUIHandler2 *iface,
|
||||
LPMSG lpMsg, const GUID *pguidCmdGroup, DWORD nCmdID)
|
||||
{
|
||||
WebBrowser *This = DOCHOSTUI_THIS(iface);
|
||||
FIXME("(%p)->(%p %p %ld)\n", This, lpMsg, pguidCmdGroup, nCmdID);
|
||||
DocHost *This = DOCHOSTUI_THIS(iface);
|
||||
FIXME("(%p)->(%p %p %d)\n", This, lpMsg, pguidCmdGroup, nCmdID);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI DocHostUIHandler_GetOptionKeyPath(IDocHostUIHandler2 *iface,
|
||||
LPOLESTR *pchKey, DWORD dw)
|
||||
{
|
||||
WebBrowser *This = DOCHOSTUI_THIS(iface);
|
||||
IDocHostUIHandler *handler;
|
||||
HRESULT hres;
|
||||
DocHost *This = DOCHOSTUI_THIS(iface);
|
||||
|
||||
TRACE("(%p)->(%p %ld)\n", This, pchKey, dw);
|
||||
TRACE("(%p)->(%p %d)\n", This, pchKey, dw);
|
||||
|
||||
if(!This->client)
|
||||
return S_OK;
|
||||
|
||||
hres = IOleClientSite_QueryInterface(This->client, &IID_IDocHostUIHandler,
|
||||
(void**)&handler);
|
||||
if(SUCCEEDED(hres)) {
|
||||
hres = IDocHostUIHandler_GetOptionKeyPath(handler, pchKey, dw);
|
||||
IDocHostUIHandler_Release(handler);
|
||||
return hres;
|
||||
}
|
||||
if(This->hostui)
|
||||
return IDocHostUIHandler_GetOptionKeyPath(This->hostui, pchKey, dw);
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
@@ -298,7 +414,7 @@ static HRESULT WINAPI DocHostUIHandler_GetOptionKeyPath(IDocHostUIHandler2 *ifac
|
||||
static HRESULT WINAPI DocHostUIHandler_GetDropTarget(IDocHostUIHandler2 *iface,
|
||||
IDropTarget *pDropTarget, IDropTarget **ppDropTarget)
|
||||
{
|
||||
WebBrowser *This = DOCHOSTUI_THIS(iface);
|
||||
DocHost *This = DOCHOSTUI_THIS(iface);
|
||||
FIXME("(%p)\n", This);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
@@ -306,23 +422,35 @@ static HRESULT WINAPI DocHostUIHandler_GetDropTarget(IDocHostUIHandler2 *iface,
|
||||
static HRESULT WINAPI DocHostUIHandler_GetExternal(IDocHostUIHandler2 *iface,
|
||||
IDispatch **ppDispatch)
|
||||
{
|
||||
WebBrowser *This = DOCHOSTUI_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, ppDispatch);
|
||||
DocHost *This = DOCHOSTUI_THIS(iface);
|
||||
|
||||
TRACE("(%p)->(%p)\n", This, ppDispatch);
|
||||
|
||||
if(This->hostui)
|
||||
return IDocHostUIHandler_GetExternal(This->hostui, ppDispatch);
|
||||
|
||||
FIXME("default action not implemented\n");
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI DocHostUIHandler_TranslateUrl(IDocHostUIHandler2 *iface,
|
||||
DWORD dwTranslate, OLECHAR *pchURLIn, OLECHAR **ppchURLOut)
|
||||
{
|
||||
WebBrowser *This = DOCHOSTUI_THIS(iface);
|
||||
FIXME("(%p)->(%ld %s %p)\n", This, dwTranslate, debugstr_w(pchURLIn), ppchURLOut);
|
||||
return E_NOTIMPL;
|
||||
DocHost *This = DOCHOSTUI_THIS(iface);
|
||||
|
||||
TRACE("(%p)->(%d %s %p)\n", This, dwTranslate, debugstr_w(pchURLIn), ppchURLOut);
|
||||
|
||||
if(This->hostui)
|
||||
return IDocHostUIHandler_TranslateUrl(This->hostui, dwTranslate,
|
||||
pchURLIn, ppchURLOut);
|
||||
|
||||
return S_FALSE;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI DocHostUIHandler_FilterDataObject(IDocHostUIHandler2 *iface,
|
||||
IDataObject *pDO, IDataObject **ppDORet)
|
||||
{
|
||||
WebBrowser *This = DOCHOSTUI_THIS(iface);
|
||||
DocHost *This = DOCHOSTUI_THIS(iface);
|
||||
FIXME("(%p)->(%p %p)\n", This, pDO, ppDORet);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
@@ -330,17 +458,17 @@ static HRESULT WINAPI DocHostUIHandler_FilterDataObject(IDocHostUIHandler2 *ifac
|
||||
static HRESULT WINAPI DocHostUIHandler_GetOverrideKeyPath(IDocHostUIHandler2 *iface,
|
||||
LPOLESTR *pchKey, DWORD dw)
|
||||
{
|
||||
WebBrowser *This = DOCHOSTUI_THIS(iface);
|
||||
DocHost *This = DOCHOSTUI_THIS(iface);
|
||||
IDocHostUIHandler2 *handler;
|
||||
HRESULT hres;
|
||||
|
||||
TRACE("(%p)->(%p %ld)\n", This, pchKey, dw);
|
||||
TRACE("(%p)->(%p %d)\n", This, pchKey, dw);
|
||||
|
||||
if(!This->client)
|
||||
if(!This->hostui)
|
||||
return S_OK;
|
||||
|
||||
hres = IOleClientSite_QueryInterface(This->client, &IID_IDocHostUIHandler2,
|
||||
(void**)&handler);
|
||||
hres = IDocHostUIHandler_QueryInterface(This->hostui, &IID_IDocHostUIHandler2,
|
||||
(void**)&handler);
|
||||
if(SUCCEEDED(hres)) {
|
||||
hres = IDocHostUIHandler2_GetOverrideKeyPath(handler, pchKey, dw);
|
||||
IDocHostUIHandler2_Release(handler);
|
||||
@@ -374,9 +502,42 @@ static const IDocHostUIHandler2Vtbl DocHostUIHandler2Vtbl = {
|
||||
DocHostUIHandler_GetOverrideKeyPath
|
||||
};
|
||||
|
||||
void WebBrowser_DocHost_Init(WebBrowser *This)
|
||||
void DocHost_Init(DocHost *This, IDispatch *disp)
|
||||
{
|
||||
This->lpDocHostUIHandlerVtbl = &DocHostUIHandler2Vtbl;
|
||||
This->lpOleCommandTargetVtbl = &OleCommandTargetVtbl;
|
||||
|
||||
This->doc_view_hwnd = NULL;
|
||||
This->disp = disp;
|
||||
|
||||
This->client_disp = NULL;
|
||||
|
||||
This->document = NULL;
|
||||
This->hostui = NULL;
|
||||
This->frame = NULL;
|
||||
|
||||
This->hwnd = NULL;
|
||||
This->frame_hwnd = NULL;
|
||||
This->url = NULL;
|
||||
|
||||
This->silent = VARIANT_FALSE;
|
||||
This->offline = VARIANT_FALSE;
|
||||
|
||||
DocHost_ClientSite_Init(This);
|
||||
DocHost_Frame_Init(This);
|
||||
|
||||
ConnectionPointContainer_Init(&This->cps, (IUnknown*)disp);
|
||||
}
|
||||
|
||||
void DocHost_Release(DocHost *This)
|
||||
{
|
||||
if(This->client_disp)
|
||||
IDispatch_Release(This->client_disp);
|
||||
if(This->frame)
|
||||
IOleInPlaceFrame_Release(This->frame);
|
||||
|
||||
DocHost_ClientSite_Release(This);
|
||||
|
||||
ConnectionPointContainer_Destroy(&This->cps);
|
||||
|
||||
SysFreeString(This->url);
|
||||
}
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
* - IConnectionPoint
|
||||
*
|
||||
* Copyright 2001 John R. Sheets (for CodeWeavers)
|
||||
* 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
|
||||
@@ -18,7 +19,7 @@
|
||||
*
|
||||
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
@@ -30,7 +31,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(shdocvw);
|
||||
struct ConnectionPoint {
|
||||
const IConnectionPointVtbl *lpConnectionPointVtbl;
|
||||
|
||||
WebBrowser *webbrowser;
|
||||
IConnectionPointContainer *container;
|
||||
|
||||
IDispatch **sinks;
|
||||
DWORD sinks_size;
|
||||
@@ -44,31 +45,31 @@ struct ConnectionPoint {
|
||||
* Implement the IConnectionPointContainer interface
|
||||
*/
|
||||
|
||||
#define CONPTCONT_THIS(iface) DEFINE_THIS(WebBrowser, ConnectionPointContainer, iface)
|
||||
#define CONPTCONT_THIS(iface) DEFINE_THIS(ConnectionPointContainer, ConnectionPointContainer, iface)
|
||||
|
||||
static HRESULT WINAPI ConnectionPointContainer_QueryInterface(IConnectionPointContainer *iface,
|
||||
REFIID riid, LPVOID *ppobj)
|
||||
REFIID riid, LPVOID *ppv)
|
||||
{
|
||||
WebBrowser *This = CONPTCONT_THIS(iface);
|
||||
return IWebBrowser_QueryInterface(WEBBROWSER(This), riid, ppobj);
|
||||
ConnectionPointContainer *This = CONPTCONT_THIS(iface);
|
||||
return IUnknown_QueryInterface(This->impl, riid, ppv);
|
||||
}
|
||||
|
||||
static ULONG WINAPI ConnectionPointContainer_AddRef(IConnectionPointContainer *iface)
|
||||
{
|
||||
WebBrowser *This = CONPTCONT_THIS(iface);
|
||||
return IWebBrowser_AddRef(WEBBROWSER(This));
|
||||
ConnectionPointContainer *This = CONPTCONT_THIS(iface);
|
||||
return IUnknown_AddRef(This->impl);
|
||||
}
|
||||
|
||||
static ULONG WINAPI ConnectionPointContainer_Release(IConnectionPointContainer *iface)
|
||||
{
|
||||
WebBrowser *This = CONPTCONT_THIS(iface);
|
||||
return IWebBrowser_Release(WEBBROWSER(This));
|
||||
ConnectionPointContainer *This = CONPTCONT_THIS(iface);
|
||||
return IUnknown_Release(This->impl);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI ConnectionPointContainer_EnumConnectionPoints(IConnectionPointContainer *iface,
|
||||
LPENUMCONNECTIONPOINTS *ppEnum)
|
||||
{
|
||||
WebBrowser *This = CONPTCONT_THIS(iface);
|
||||
ConnectionPointContainer *This = CONPTCONT_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, ppEnum);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
@@ -76,7 +77,7 @@ static HRESULT WINAPI ConnectionPointContainer_EnumConnectionPoints(IConnectionP
|
||||
static HRESULT WINAPI ConnectionPointContainer_FindConnectionPoint(IConnectionPointContainer *iface,
|
||||
REFIID riid, LPCONNECTIONPOINT *ppCP)
|
||||
{
|
||||
WebBrowser *This = CONPTCONT_THIS(iface);
|
||||
ConnectionPointContainer *This = CONPTCONT_THIS(iface);
|
||||
|
||||
if(!ppCP) {
|
||||
WARN("ppCP == NULL\n");
|
||||
@@ -87,13 +88,13 @@ static HRESULT WINAPI ConnectionPointContainer_FindConnectionPoint(IConnectionPo
|
||||
|
||||
if(IsEqualGUID(&DIID_DWebBrowserEvents2, riid)) {
|
||||
TRACE("(%p)->(DIID_DWebBrowserEvents2 %p)\n", This, ppCP);
|
||||
*ppCP = CONPOINT(This->cp_wbe2);
|
||||
*ppCP = CONPOINT(This->wbe2);
|
||||
}else if(IsEqualGUID(&DIID_DWebBrowserEvents, riid)) {
|
||||
TRACE("(%p)->(DIID_DWebBrowserEvents %p)\n", This, ppCP);
|
||||
*ppCP = CONPOINT(This->cp_wbe);
|
||||
*ppCP = CONPOINT(This->wbe);
|
||||
}else if(IsEqualGUID(&IID_IPropertyNotifySink, riid)) {
|
||||
TRACE("(%p)->(IID_IPropertyNotifySink %p)\n", This, ppCP);
|
||||
*ppCP = CONPOINT(This->cp_pns);
|
||||
*ppCP = CONPOINT(This->pns);
|
||||
}
|
||||
|
||||
if(*ppCP) {
|
||||
@@ -102,7 +103,7 @@ static HRESULT WINAPI ConnectionPointContainer_FindConnectionPoint(IConnectionPo
|
||||
}
|
||||
|
||||
WARN("Unsupported IID %s\n", debugstr_guid(riid));
|
||||
return E_NOINTERFACE;
|
||||
return CONNECT_E_NOCONNECTION;
|
||||
}
|
||||
|
||||
#undef CONPTCONT_THIS
|
||||
@@ -139,7 +140,7 @@ static HRESULT WINAPI ConnectionPoint_QueryInterface(IConnectionPoint *iface,
|
||||
}
|
||||
|
||||
if(*ppv) {
|
||||
IWebBrowser2_AddRef(WEBBROWSER(This->webbrowser));
|
||||
IConnectionPointContainer_AddRef(This->container);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -150,13 +151,13 @@ static HRESULT WINAPI ConnectionPoint_QueryInterface(IConnectionPoint *iface,
|
||||
static ULONG WINAPI ConnectionPoint_AddRef(IConnectionPoint *iface)
|
||||
{
|
||||
ConnectionPoint *This = CONPOINT_THIS(iface);
|
||||
return IWebBrowser2_AddRef(WEBBROWSER(This->webbrowser));
|
||||
return IConnectionPointContainer_AddRef(This->container);
|
||||
}
|
||||
|
||||
static ULONG WINAPI ConnectionPoint_Release(IConnectionPoint *iface)
|
||||
{
|
||||
ConnectionPoint *This = CONPOINT_THIS(iface);
|
||||
return IWebBrowser2_Release(WEBBROWSER(This->webbrowser));
|
||||
return IConnectionPointContainer_Release(This->container);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI ConnectionPoint_GetConnectionInterface(IConnectionPoint *iface, IID *pIID)
|
||||
@@ -165,7 +166,7 @@ static HRESULT WINAPI ConnectionPoint_GetConnectionInterface(IConnectionPoint *i
|
||||
|
||||
TRACE("(%p)->(%p)\n", This, pIID);
|
||||
|
||||
memcpy(pIID, &This->iid, sizeof(IID));
|
||||
*pIID = This->iid;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -176,7 +177,8 @@ static HRESULT WINAPI ConnectionPoint_GetConnectionPointContainer(IConnectionPoi
|
||||
|
||||
TRACE("(%p)->(%p)\n", This, ppCPC);
|
||||
|
||||
*ppCPC = CONPTCONT(This->webbrowser);
|
||||
*ppCPC = This->container;
|
||||
IConnectionPointContainer_AddRef(This->container);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -204,10 +206,10 @@ static HRESULT WINAPI ConnectionPoint_Advise(IConnectionPoint *iface, IUnknown *
|
||||
}
|
||||
|
||||
if(i == This->sinks_size)
|
||||
This->sinks = HeapReAlloc(GetProcessHeap(), 0, This->sinks,
|
||||
(++This->sinks_size)*sizeof(*This->sinks));
|
||||
This->sinks = heap_realloc(This->sinks,
|
||||
(++This->sinks_size)*sizeof(*This->sinks));
|
||||
}else {
|
||||
This->sinks = HeapAlloc(GetProcessHeap(), 0, sizeof(*This->sinks));
|
||||
This->sinks = heap_alloc(sizeof(*This->sinks));
|
||||
This->sinks_size = 1;
|
||||
i = 0;
|
||||
}
|
||||
@@ -222,7 +224,7 @@ static HRESULT WINAPI ConnectionPoint_Unadvise(IConnectionPoint *iface, DWORD dw
|
||||
{
|
||||
ConnectionPoint *This = CONPOINT_THIS(iface);
|
||||
|
||||
TRACE("(%p)->(%ld)\n", This, dwCookie);
|
||||
TRACE("(%p)->(%d)\n", This, dwCookie);
|
||||
|
||||
if(!dwCookie || dwCookie > This->sinks_size || !This->sinks[dwCookie-1])
|
||||
return CONNECT_E_NOCONNECTION;
|
||||
@@ -266,46 +268,49 @@ void call_sink(ConnectionPoint *This, DISPID dispid, DISPPARAMS *dispparams)
|
||||
}
|
||||
}
|
||||
|
||||
static void ConnectionPoint_Create(WebBrowser *wb, REFIID riid, ConnectionPoint **cp)
|
||||
static void ConnectionPoint_Create(REFIID riid, ConnectionPoint **cp,
|
||||
IConnectionPointContainer *container)
|
||||
{
|
||||
ConnectionPoint *ret = HeapAlloc(GetProcessHeap(), 0, sizeof(ConnectionPoint));
|
||||
ConnectionPoint *ret = heap_alloc(sizeof(ConnectionPoint));
|
||||
|
||||
ret->lpConnectionPointVtbl = &ConnectionPointVtbl;
|
||||
ret->webbrowser = wb;
|
||||
|
||||
ret->sinks = NULL;
|
||||
ret->sinks_size = 0;
|
||||
ret->container = container;
|
||||
|
||||
memcpy(&ret->iid, riid, sizeof(IID));
|
||||
ret->iid = *riid;
|
||||
|
||||
*cp = ret;
|
||||
}
|
||||
|
||||
static void ConnectionPoint_Destroy(ConnectionPoint *This)
|
||||
{
|
||||
int i;
|
||||
DWORD i;
|
||||
|
||||
for(i=0; i<This->sinks_size; i++) {
|
||||
if(This->sinks[i])
|
||||
IDispatch_Release(This->sinks[i]);
|
||||
}
|
||||
|
||||
HeapFree(GetProcessHeap(), 0, This->sinks);
|
||||
HeapFree(GetProcessHeap(), 0, This);
|
||||
heap_free(This->sinks);
|
||||
heap_free(This);
|
||||
}
|
||||
|
||||
void WebBrowser_Events_Init(WebBrowser *This)
|
||||
void ConnectionPointContainer_Init(ConnectionPointContainer *This, IUnknown *impl)
|
||||
{
|
||||
This->lpConnectionPointContainerVtbl = &ConnectionPointContainerVtbl;
|
||||
|
||||
ConnectionPoint_Create(This, &DIID_DWebBrowserEvents2, &This->cp_wbe2);
|
||||
ConnectionPoint_Create(This, &DIID_DWebBrowserEvents, &This->cp_wbe);
|
||||
ConnectionPoint_Create(This, &IID_IPropertyNotifySink, &This->cp_pns);
|
||||
ConnectionPoint_Create(&DIID_DWebBrowserEvents2, &This->wbe2, CONPTCONT(This));
|
||||
ConnectionPoint_Create(&DIID_DWebBrowserEvents, &This->wbe, CONPTCONT(This));
|
||||
ConnectionPoint_Create(&IID_IPropertyNotifySink, &This->pns, CONPTCONT(This));
|
||||
|
||||
This->impl = impl;
|
||||
}
|
||||
|
||||
void WebBrowser_Events_Destroy(WebBrowser *This)
|
||||
void ConnectionPointContainer_Destroy(ConnectionPointContainer *This)
|
||||
{
|
||||
ConnectionPoint_Destroy(This->cp_wbe2);
|
||||
ConnectionPoint_Destroy(This->cp_wbe);
|
||||
ConnectionPoint_Destroy(This->cp_pns);
|
||||
ConnectionPoint_Destroy(This->wbe2);
|
||||
ConnectionPoint_Destroy(This->wbe);
|
||||
ConnectionPoint_Destroy(This->pns);
|
||||
}
|
||||
|
||||
@@ -15,12 +15,20 @@
|
||||
*
|
||||
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include <string.h>
|
||||
#include "wine/debug.h"
|
||||
#include <stdio.h>
|
||||
|
||||
#include "shdocvw.h"
|
||||
#include "winreg.h"
|
||||
#include "advpub.h"
|
||||
#include "isguids.h"
|
||||
|
||||
#include "winver.h"
|
||||
|
||||
#include "wine/debug.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(shdocvw);
|
||||
|
||||
@@ -30,6 +38,17 @@ WINE_DEFAULT_DEBUG_CHANNEL(shdocvw);
|
||||
* (Based on implementation in ddraw/main.c)
|
||||
*/
|
||||
|
||||
#define FACTORY(x) ((IClassFactory*) &(x)->lpClassFactoryVtbl)
|
||||
|
||||
typedef struct
|
||||
{
|
||||
/* IUnknown fields */
|
||||
const IClassFactoryVtbl *lpClassFactoryVtbl;
|
||||
HRESULT (*cf)(LPUNKNOWN, REFIID, LPVOID *);
|
||||
LONG ref;
|
||||
} IClassFactoryImpl;
|
||||
|
||||
|
||||
/**********************************************************************
|
||||
* WBCF_QueryInterface (IUnknown)
|
||||
*/
|
||||
@@ -43,6 +62,7 @@ static HRESULT WINAPI WBCF_QueryInterface(LPCLASSFACTORY iface,
|
||||
|
||||
if(IsEqualGUID(&IID_IUnknown, riid) || IsEqualGUID(&IID_IClassFactory, riid)) {
|
||||
*ppobj = iface;
|
||||
IClassFactory_AddRef(iface);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -78,7 +98,8 @@ static ULONG WINAPI WBCF_Release(LPCLASSFACTORY iface)
|
||||
static HRESULT WINAPI WBCF_CreateInstance(LPCLASSFACTORY iface, LPUNKNOWN pOuter,
|
||||
REFIID riid, LPVOID *ppobj)
|
||||
{
|
||||
return WebBrowser_Create(pOuter, riid, ppobj);
|
||||
IClassFactoryImpl *This = (IClassFactoryImpl *) iface;
|
||||
return This->cf(pOuter, riid, ppobj);
|
||||
}
|
||||
|
||||
/************************************************************************
|
||||
@@ -92,7 +113,7 @@ static HRESULT WINAPI WBCF_LockServer(LPCLASSFACTORY iface, BOOL dolock)
|
||||
SHDOCVW_LockModule();
|
||||
else
|
||||
SHDOCVW_UnlockModule();
|
||||
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
@@ -105,4 +126,209 @@ static const IClassFactoryVtbl WBCF_Vtbl =
|
||||
WBCF_LockServer
|
||||
};
|
||||
|
||||
IClassFactoryImpl SHDOCVW_ClassFactory = {&WBCF_Vtbl};
|
||||
/*************************************************************************
|
||||
* DllGetClassObject (SHDOCVW.@)
|
||||
*/
|
||||
HRESULT WINAPI DllGetClassObject(REFCLSID rclsid, REFIID riid, void **ppv)
|
||||
{
|
||||
static IClassFactoryImpl WB1ClassFactory = {&WBCF_Vtbl, WebBrowserV1_Create};
|
||||
static IClassFactoryImpl WB2ClassFactory = {&WBCF_Vtbl, WebBrowserV2_Create};
|
||||
static IClassFactoryImpl CUHClassFactory = {&WBCF_Vtbl, CUrlHistory_Create};
|
||||
static IClassFactoryImpl ISCClassFactory = {&WBCF_Vtbl, InternetShortcut_Create};
|
||||
|
||||
TRACE("\n");
|
||||
|
||||
if(IsEqualGUID(&CLSID_WebBrowser, rclsid))
|
||||
return IClassFactory_QueryInterface(FACTORY(&WB2ClassFactory), riid, ppv);
|
||||
|
||||
if(IsEqualGUID(&CLSID_WebBrowser_V1, rclsid))
|
||||
return IClassFactory_QueryInterface(FACTORY(&WB1ClassFactory), riid, ppv);
|
||||
|
||||
if(IsEqualGUID(&CLSID_CUrlHistory, rclsid))
|
||||
return IClassFactory_QueryInterface(FACTORY(&CUHClassFactory), riid, ppv);
|
||||
|
||||
if(IsEqualGUID(&CLSID_InternetShortcut, rclsid))
|
||||
return IClassFactory_QueryInterface(FACTORY(&ISCClassFactory), riid, ppv);
|
||||
|
||||
/* As a last resort, figure if the CLSID belongs to a 'Shell Instance Object' */
|
||||
return SHDOCVW_GetShellInstanceObjectClassObject(rclsid, riid, ppv);
|
||||
}
|
||||
|
||||
HRESULT register_class_object(BOOL do_reg)
|
||||
{
|
||||
HRESULT hres;
|
||||
|
||||
static DWORD cookie;
|
||||
static IClassFactoryImpl IEClassFactory = {&WBCF_Vtbl, InternetExplorer_Create};
|
||||
|
||||
if(do_reg) {
|
||||
hres = CoRegisterClassObject(&CLSID_InternetExplorer, (IUnknown*)FACTORY(&IEClassFactory),
|
||||
CLSCTX_SERVER, REGCLS_MULTIPLEUSE|REGCLS_SUSPENDED, &cookie);
|
||||
if (FAILED(hres)) {
|
||||
ERR("failed to register object %08x\n", hres);
|
||||
return hres;
|
||||
}
|
||||
|
||||
hres = CoResumeClassObjects();
|
||||
if(SUCCEEDED(hres))
|
||||
return hres;
|
||||
|
||||
ERR("failed to resume object %08x\n", hres);
|
||||
}
|
||||
|
||||
return CoRevokeClassObject(cookie);
|
||||
}
|
||||
|
||||
static HRESULT reg_install(LPCSTR section, STRTABLEA *strtable)
|
||||
{
|
||||
HRESULT (WINAPI *pRegInstall)(HMODULE hm, LPCSTR pszSection, const STRTABLEA* pstTable);
|
||||
HMODULE hadvpack;
|
||||
HRESULT hres;
|
||||
|
||||
static const WCHAR advpackW[] = {'a','d','v','p','a','c','k','.','d','l','l',0};
|
||||
|
||||
hadvpack = LoadLibraryW(advpackW);
|
||||
pRegInstall = (void *)GetProcAddress(hadvpack, "RegInstall");
|
||||
|
||||
hres = pRegInstall(shdocvw_hinstance, section, strtable);
|
||||
|
||||
FreeLibrary(hadvpack);
|
||||
return hres;
|
||||
}
|
||||
|
||||
static const GUID CLSID_MicrosoftBrowserArchitecture =
|
||||
{0xa5e46e3a, 0x8849, 0x11d1, {0x9d, 0x8c, 0x00, 0xc0, 0x4f, 0xc9, 0x9d, 0x61}};
|
||||
static const GUID CLSID_MruLongList =
|
||||
{0x53bd6b4e, 0x3780, 0x4693, {0xaf, 0xc3, 0x71, 0x61, 0xc2, 0xf3, 0xee, 0x9c}};
|
||||
|
||||
#define INF_SET_CLSID(clsid) \
|
||||
do \
|
||||
{ \
|
||||
static CHAR name[] = "CLSID_" #clsid; \
|
||||
\
|
||||
pse[i].pszName = name; \
|
||||
clsids[i++] = &CLSID_ ## clsid; \
|
||||
} while (0)
|
||||
|
||||
static HRESULT register_server(BOOL doregister)
|
||||
{
|
||||
STRTABLEA strtable;
|
||||
STRENTRYA pse[14];
|
||||
static CLSID const *clsids[14];
|
||||
unsigned int i = 0;
|
||||
HRESULT hres;
|
||||
|
||||
INF_SET_CLSID(CUrlHistory);
|
||||
INF_SET_CLSID(Internet);
|
||||
INF_SET_CLSID(InternetExplorer);
|
||||
INF_SET_CLSID(InternetShortcut);
|
||||
INF_SET_CLSID(MicrosoftBrowserArchitecture);
|
||||
INF_SET_CLSID(MruLongList);
|
||||
INF_SET_CLSID(SearchAssistantOC);
|
||||
INF_SET_CLSID(ShellNameSpace);
|
||||
INF_SET_CLSID(ShellSearchAssistantOC);
|
||||
INF_SET_CLSID(ShellShellNameSpace);
|
||||
INF_SET_CLSID(ShellUIHelper);
|
||||
INF_SET_CLSID(ShellWindows);
|
||||
INF_SET_CLSID(WebBrowser);
|
||||
INF_SET_CLSID(WebBrowser_V1);
|
||||
|
||||
for(i = 0; i < sizeof(pse)/sizeof(pse[0]); i++) {
|
||||
pse[i].pszValue = HeapAlloc(GetProcessHeap(), 0, 39);
|
||||
sprintf(pse[i].pszValue, "{%08X-%04X-%04X-%02X%02X-%02X%02X%02X%02X%02X%02X}",
|
||||
clsids[i]->Data1, clsids[i]->Data2, clsids[i]->Data3, clsids[i]->Data4[0],
|
||||
clsids[i]->Data4[1], clsids[i]->Data4[2], clsids[i]->Data4[3], clsids[i]->Data4[4],
|
||||
clsids[i]->Data4[5], clsids[i]->Data4[6], clsids[i]->Data4[7]);
|
||||
}
|
||||
|
||||
strtable.cEntries = sizeof(pse)/sizeof(pse[0]);
|
||||
strtable.pse = pse;
|
||||
|
||||
hres = reg_install(doregister ? "RegisterDll" : "UnregisterDll", &strtable);
|
||||
|
||||
for(i=0; i < sizeof(pse)/sizeof(pse[0]); i++)
|
||||
HeapFree(GetProcessHeap(), 0, pse[i].pszValue);
|
||||
|
||||
return hres;
|
||||
}
|
||||
|
||||
#undef INF_SET_CLSID
|
||||
|
||||
/***********************************************************************
|
||||
* DllRegisterServer (shdocvw.@)
|
||||
*/
|
||||
HRESULT WINAPI DllRegisterServer(void)
|
||||
{
|
||||
ITypeLib *typelib;
|
||||
HRESULT hres;
|
||||
|
||||
static const WCHAR shdocvwW[] = {'s','h','d','o','c','v','w','.','d','l','l',0};
|
||||
|
||||
hres = register_server(TRUE);
|
||||
if(FAILED(hres))
|
||||
return hres;
|
||||
|
||||
hres = LoadTypeLibEx(shdocvwW, REGKIND_REGISTER, &typelib);
|
||||
if(FAILED(hres)) {
|
||||
ERR("Could not load typelib: %08x\n", hres);
|
||||
return hres;
|
||||
}
|
||||
|
||||
ITypeLib_Release(typelib);
|
||||
|
||||
return hres;
|
||||
}
|
||||
|
||||
/***********************************************************************
|
||||
* DllUnregisterServer (shdocvw.@)
|
||||
*/
|
||||
HRESULT WINAPI DllUnregisterServer(void)
|
||||
{
|
||||
HRESULT hres;
|
||||
|
||||
hres = register_server(FALSE);
|
||||
if(FAILED(hres))
|
||||
return hres;
|
||||
|
||||
return UnRegisterTypeLib(&LIBID_SHDocVw, 1, 1, LOCALE_SYSTEM_DEFAULT, SYS_WIN32);
|
||||
}
|
||||
|
||||
static BOOL check_native_ie(void)
|
||||
{
|
||||
static const WCHAR cszPath[] = {'b','r','o','w','s','e','u','i','.','d','l','l',0};
|
||||
DWORD handle,size;
|
||||
BOOL ret = TRUE;
|
||||
|
||||
size = GetFileVersionInfoSizeW(cszPath,&handle);
|
||||
if (size)
|
||||
{
|
||||
LPVOID buf;
|
||||
LPWSTR lpFileDescription;
|
||||
UINT dwBytes;
|
||||
static const WCHAR cszFD[] = {'\\','S','t','r','i','n','g','F','i','l','e','I','n','f','o','\\','0','4','0','9','0','4','e','4','\\','F','i','l','e','D','e','s','c','r','i','p','t','i','o','n',0};
|
||||
static const WCHAR cszWine[] = {'W','i','n','e',0};
|
||||
|
||||
buf = HeapAlloc(GetProcessHeap(),0,size);
|
||||
GetFileVersionInfoW(cszPath,0,size,buf);
|
||||
|
||||
if (VerQueryValueW(buf, cszFD, (LPVOID*)&lpFileDescription, &dwBytes) &&
|
||||
strstrW(lpFileDescription,cszWine))
|
||||
ret = FALSE;
|
||||
|
||||
HeapFree(GetProcessHeap(), 0, buf);
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
DWORD register_iexplore(BOOL doregister)
|
||||
{
|
||||
HRESULT hres;
|
||||
if (check_native_ie())
|
||||
{
|
||||
TRACE("Native IE detected, not doing registration\n");
|
||||
return S_OK;
|
||||
}
|
||||
hres = reg_install(doregister ? "RegisterIE" : "UnregisterIE", NULL);
|
||||
return FAILED(hres);
|
||||
}
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
*
|
||||
* 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
#include "wine/debug.h"
|
||||
@@ -21,12 +21,12 @@
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(shdocvw);
|
||||
|
||||
#define INPLACEFRAME_THIS(iface) DEFINE_THIS(WebBrowser, OleInPlaceFrame, iface)
|
||||
#define INPLACEFRAME_THIS(iface) DEFINE_THIS(DocHost, OleInPlaceFrame, iface)
|
||||
|
||||
static HRESULT WINAPI InPlaceFrame_QueryInterface(IOleInPlaceFrame *iface,
|
||||
REFIID riid, void **ppv)
|
||||
{
|
||||
WebBrowser *This = INPLACEFRAME_THIS(iface);
|
||||
DocHost *This = INPLACEFRAME_THIS(iface);
|
||||
|
||||
*ppv = NULL;
|
||||
|
||||
@@ -52,19 +52,19 @@ static HRESULT WINAPI InPlaceFrame_QueryInterface(IOleInPlaceFrame *iface,
|
||||
|
||||
static ULONG WINAPI InPlaceFrame_AddRef(IOleInPlaceFrame *iface)
|
||||
{
|
||||
WebBrowser *This = INPLACEFRAME_THIS(iface);
|
||||
return IWebBrowser2_AddRef(WEBBROWSER(This));
|
||||
DocHost *This = INPLACEFRAME_THIS(iface);
|
||||
return IOleClientSite_AddRef(CLIENTSITE(This));
|
||||
}
|
||||
|
||||
static ULONG WINAPI InPlaceFrame_Release(IOleInPlaceFrame *iface)
|
||||
{
|
||||
WebBrowser *This = INPLACEFRAME_THIS(iface);
|
||||
return IWebBrowser2_Release(WEBBROWSER(This));
|
||||
DocHost *This = INPLACEFRAME_THIS(iface);
|
||||
return IOleClientSite_Release(CLIENTSITE(This));
|
||||
}
|
||||
|
||||
static HRESULT WINAPI InPlaceFrame_GetWindow(IOleInPlaceFrame *iface, HWND *phwnd)
|
||||
{
|
||||
WebBrowser *This = INPLACEFRAME_THIS(iface);
|
||||
DocHost *This = INPLACEFRAME_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, phwnd);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
@@ -72,14 +72,14 @@ static HRESULT WINAPI InPlaceFrame_GetWindow(IOleInPlaceFrame *iface, HWND *phwn
|
||||
static HRESULT WINAPI InPlaceFrame_ContextSensitiveHelp(IOleInPlaceFrame *iface,
|
||||
BOOL fEnterMode)
|
||||
{
|
||||
WebBrowser *This = INPLACEFRAME_THIS(iface);
|
||||
DocHost *This = INPLACEFRAME_THIS(iface);
|
||||
FIXME("(%p)->(%x)\n", This, fEnterMode);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI InPlaceFrame_GetBorder(IOleInPlaceFrame *iface, LPRECT lprectBorder)
|
||||
{
|
||||
WebBrowser *This = INPLACEFRAME_THIS(iface);
|
||||
DocHost *This = INPLACEFRAME_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, lprectBorder);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
@@ -87,7 +87,7 @@ static HRESULT WINAPI InPlaceFrame_GetBorder(IOleInPlaceFrame *iface, LPRECT lpr
|
||||
static HRESULT WINAPI InPlaceFrame_RequestBorderSpace(IOleInPlaceFrame *iface,
|
||||
LPCBORDERWIDTHS pborderwidths)
|
||||
{
|
||||
WebBrowser *This = INPLACEFRAME_THIS(iface);
|
||||
DocHost *This = INPLACEFRAME_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, pborderwidths);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
@@ -95,7 +95,7 @@ static HRESULT WINAPI InPlaceFrame_RequestBorderSpace(IOleInPlaceFrame *iface,
|
||||
static HRESULT WINAPI InPlaceFrame_SetBorderSpace(IOleInPlaceFrame *iface,
|
||||
LPCBORDERWIDTHS pborderwidths)
|
||||
{
|
||||
WebBrowser *This = INPLACEFRAME_THIS(iface);
|
||||
DocHost *This = INPLACEFRAME_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, pborderwidths);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
@@ -103,7 +103,7 @@ static HRESULT WINAPI InPlaceFrame_SetBorderSpace(IOleInPlaceFrame *iface,
|
||||
static HRESULT WINAPI InPlaceFrame_SetActiveObject(IOleInPlaceFrame *iface,
|
||||
IOleInPlaceActiveObject *pActiveObject, LPCOLESTR pszObjName)
|
||||
{
|
||||
WebBrowser *This = INPLACEFRAME_THIS(iface);
|
||||
DocHost *This = INPLACEFRAME_THIS(iface);
|
||||
FIXME("(%p)->(%p %s)\n", This, pActiveObject, debugstr_w(pszObjName));
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
@@ -111,7 +111,7 @@ static HRESULT WINAPI InPlaceFrame_SetActiveObject(IOleInPlaceFrame *iface,
|
||||
static HRESULT WINAPI InPlaceFrame_InsertMenus(IOleInPlaceFrame *iface, HMENU hmenuShared,
|
||||
LPOLEMENUGROUPWIDTHS lpMenuWidths)
|
||||
{
|
||||
WebBrowser *This = INPLACEFRAME_THIS(iface);
|
||||
DocHost *This = INPLACEFRAME_THIS(iface);
|
||||
FIXME("(%p)->(%p %p)\n", This, hmenuShared, lpMenuWidths);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
@@ -119,14 +119,14 @@ static HRESULT WINAPI InPlaceFrame_InsertMenus(IOleInPlaceFrame *iface, HMENU hm
|
||||
static HRESULT WINAPI InPlaceFrame_SetMenu(IOleInPlaceFrame *iface, HMENU hmenuShared,
|
||||
HOLEMENU holemenu, HWND hwndActiveObject)
|
||||
{
|
||||
WebBrowser *This = INPLACEFRAME_THIS(iface);
|
||||
DocHost *This = INPLACEFRAME_THIS(iface);
|
||||
FIXME("(%p)->(%p %p %p)\n", This, hmenuShared, holemenu, hwndActiveObject);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI InPlaceFrame_RemoveMenus(IOleInPlaceFrame *iface, HMENU hmenuShared)
|
||||
{
|
||||
WebBrowser *This = INPLACEFRAME_THIS(iface);
|
||||
DocHost *This = INPLACEFRAME_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, hmenuShared);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
@@ -134,14 +134,14 @@ static HRESULT WINAPI InPlaceFrame_RemoveMenus(IOleInPlaceFrame *iface, HMENU hm
|
||||
static HRESULT WINAPI InPlaceFrame_SetStatusText(IOleInPlaceFrame *iface,
|
||||
LPCOLESTR pszStatusText)
|
||||
{
|
||||
WebBrowser *This = INPLACEFRAME_THIS(iface);
|
||||
DocHost *This = INPLACEFRAME_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, debugstr_w(pszStatusText));
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI InPlaceFrame_EnableModeless(IOleInPlaceFrame *iface, BOOL fEnable)
|
||||
{
|
||||
WebBrowser *This = INPLACEFRAME_THIS(iface);
|
||||
DocHost *This = INPLACEFRAME_THIS(iface);
|
||||
FIXME("(%p)->(%x)\n", This, fEnable);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
@@ -149,7 +149,7 @@ static HRESULT WINAPI InPlaceFrame_EnableModeless(IOleInPlaceFrame *iface, BOOL
|
||||
static HRESULT WINAPI InPlaceFrame_TranslateAccelerator(IOleInPlaceFrame *iface, LPMSG lpmsg,
|
||||
WORD wID)
|
||||
{
|
||||
WebBrowser *This = INPLACEFRAME_THIS(iface);
|
||||
DocHost *This = INPLACEFRAME_THIS(iface);
|
||||
FIXME("(%p)->(%p %d)\n", This, lpmsg, wID);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
@@ -174,7 +174,7 @@ static const IOleInPlaceFrameVtbl OleInPlaceFrameVtbl = {
|
||||
InPlaceFrame_TranslateAccelerator
|
||||
};
|
||||
|
||||
void WebBrowser_Frame_Init(WebBrowser *This)
|
||||
void DocHost_Frame_Init(DocHost *This)
|
||||
{
|
||||
This->lpOleInPlaceFrameVtbl = &OleInPlaceFrameVtbl;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,673 @@
|
||||
/*
|
||||
* 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 "wine/debug.h"
|
||||
#include "shdocvw.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(shdocvw);
|
||||
|
||||
#define WEBBROWSER_THIS(iface) DEFINE_THIS(InternetExplorer, WebBrowser2, iface)
|
||||
|
||||
static HRESULT WINAPI InternetExplorer_QueryInterface(IWebBrowser2 *iface, REFIID riid, LPVOID *ppv)
|
||||
{
|
||||
InternetExplorer *This = WEBBROWSER_THIS(iface);
|
||||
|
||||
*ppv = NULL;
|
||||
|
||||
if(IsEqualGUID(&IID_IUnknown, riid)) {
|
||||
TRACE("(%p)->(IID_IUnknown %p)\n", This, ppv);
|
||||
*ppv = WEBBROWSER(This);
|
||||
}else if(IsEqualGUID(&IID_IDispatch, riid)) {
|
||||
TRACE("(%p)->(IID_IDispatch %p)\n", This, ppv);
|
||||
*ppv = WEBBROWSER(This);
|
||||
}else if(IsEqualGUID(&IID_IWebBrowser, riid)) {
|
||||
TRACE("(%p)->(IID_IWebBrowser %p)\n", This, ppv);
|
||||
*ppv = WEBBROWSER(This);
|
||||
}else if(IsEqualGUID(&IID_IWebBrowserApp, riid)) {
|
||||
TRACE("(%p)->(IID_IWebBrowserApp %p)\n", This, ppv);
|
||||
*ppv = WEBBROWSER(This);
|
||||
}else if(IsEqualGUID(&IID_IWebBrowser2, riid)) {
|
||||
TRACE("(%p)->(IID_IWebBrowser2 %p)\n", This, ppv);
|
||||
*ppv = WEBBROWSER(This);
|
||||
}else if(IsEqualGUID(&IID_IConnectionPointContainer, riid)) {
|
||||
TRACE("(%p)->(IID_IConnectionPointContainer %p)\n", This, ppv);
|
||||
*ppv = CONPTCONT(&This->doc_host.cps);
|
||||
}
|
||||
|
||||
if(*ppv) {
|
||||
IUnknown_AddRef((IUnknown*)*ppv);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
WARN("(%p)->(%s %p) interface not supported\n", This, debugstr_guid(riid), ppv);
|
||||
return E_NOINTERFACE;
|
||||
}
|
||||
|
||||
static ULONG WINAPI InternetExplorer_AddRef(IWebBrowser2 *iface)
|
||||
{
|
||||
InternetExplorer *This = WEBBROWSER_THIS(iface);
|
||||
LONG ref = InterlockedIncrement(&This->ref);
|
||||
TRACE("(%p) ref=%d\n", This, ref);
|
||||
return ref;
|
||||
}
|
||||
|
||||
static ULONG WINAPI InternetExplorer_Release(IWebBrowser2 *iface)
|
||||
{
|
||||
InternetExplorer *This = WEBBROWSER_THIS(iface);
|
||||
LONG ref = InterlockedDecrement(&This->ref);
|
||||
|
||||
TRACE("(%p) ref=%d\n", This, ref);
|
||||
|
||||
if(!ref) {
|
||||
DocHost_Release(&This->doc_host);
|
||||
heap_free(This);
|
||||
}
|
||||
|
||||
return ref;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI InternetExplorer_GetTypeInfoCount(IWebBrowser2 *iface, UINT *pctinfo)
|
||||
{
|
||||
InternetExplorer *This = WEBBROWSER_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, pctinfo);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI InternetExplorer_GetTypeInfo(IWebBrowser2 *iface, UINT iTInfo, LCID lcid,
|
||||
LPTYPEINFO *ppTInfo)
|
||||
{
|
||||
InternetExplorer *This = WEBBROWSER_THIS(iface);
|
||||
FIXME("(%p)->(%d %d %p)\n", This, iTInfo, lcid, ppTInfo);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI InternetExplorer_GetIDsOfNames(IWebBrowser2 *iface, REFIID riid,
|
||||
LPOLESTR *rgszNames, UINT cNames,
|
||||
LCID lcid, DISPID *rgDispId)
|
||||
{
|
||||
InternetExplorer *This = WEBBROWSER_THIS(iface);
|
||||
FIXME("(%p)->(%s %p %d %d %p)\n", This, debugstr_guid(riid), rgszNames, cNames,
|
||||
lcid, rgDispId);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI InternetExplorer_Invoke(IWebBrowser2 *iface, DISPID dispIdMember,
|
||||
REFIID riid, LCID lcid, WORD wFlags,
|
||||
DISPPARAMS *pDispParams, VARIANT *pVarResult,
|
||||
EXCEPINFO *pExepInfo, UINT *puArgErr)
|
||||
{
|
||||
InternetExplorer *This = WEBBROWSER_THIS(iface);
|
||||
FIXME("(%p)->(%d %s %d %08x %p %p %p %p)\n", This, dispIdMember, debugstr_guid(riid),
|
||||
lcid, wFlags, pDispParams, pVarResult, pExepInfo, puArgErr);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI InternetExplorer_GoBack(IWebBrowser2 *iface)
|
||||
{
|
||||
InternetExplorer *This = WEBBROWSER_THIS(iface);
|
||||
FIXME("(%p)\n", This);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI InternetExplorer_GoForward(IWebBrowser2 *iface)
|
||||
{
|
||||
InternetExplorer *This = WEBBROWSER_THIS(iface);
|
||||
FIXME("(%p)\n", This);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI InternetExplorer_GoHome(IWebBrowser2 *iface)
|
||||
{
|
||||
InternetExplorer *This = WEBBROWSER_THIS(iface);
|
||||
TRACE("(%p)\n", This);
|
||||
return go_home(&This->doc_host);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI InternetExplorer_GoSearch(IWebBrowser2 *iface)
|
||||
{
|
||||
InternetExplorer *This = WEBBROWSER_THIS(iface);
|
||||
FIXME("(%p)\n", This);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI InternetExplorer_Navigate(IWebBrowser2 *iface, BSTR szUrl,
|
||||
VARIANT *Flags, VARIANT *TargetFrameName,
|
||||
VARIANT *PostData, VARIANT *Headers)
|
||||
{
|
||||
InternetExplorer *This = WEBBROWSER_THIS(iface);
|
||||
|
||||
TRACE("(%p)->(%s %p %p %p %p)\n", This, debugstr_w(szUrl), Flags, TargetFrameName,
|
||||
PostData, Headers);
|
||||
|
||||
return navigate_url(&This->doc_host, szUrl, Flags, TargetFrameName, PostData, Headers);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI InternetExplorer_Refresh(IWebBrowser2 *iface)
|
||||
{
|
||||
InternetExplorer *This = WEBBROWSER_THIS(iface);
|
||||
FIXME("(%p)\n", This);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI InternetExplorer_Refresh2(IWebBrowser2 *iface, VARIANT *Level)
|
||||
{
|
||||
InternetExplorer *This = WEBBROWSER_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, Level);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI InternetExplorer_Stop(IWebBrowser2 *iface)
|
||||
{
|
||||
InternetExplorer *This = WEBBROWSER_THIS(iface);
|
||||
FIXME("(%p)\n", This);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI InternetExplorer_get_Application(IWebBrowser2 *iface, IDispatch **ppDisp)
|
||||
{
|
||||
InternetExplorer *This = WEBBROWSER_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, ppDisp);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI InternetExplorer_get_Parent(IWebBrowser2 *iface, IDispatch **ppDisp)
|
||||
{
|
||||
InternetExplorer *This = WEBBROWSER_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, ppDisp);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI InternetExplorer_get_Container(IWebBrowser2 *iface, IDispatch **ppDisp)
|
||||
{
|
||||
InternetExplorer *This = WEBBROWSER_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, ppDisp);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI InternetExplorer_get_Document(IWebBrowser2 *iface, IDispatch **ppDisp)
|
||||
{
|
||||
InternetExplorer *This = WEBBROWSER_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, ppDisp);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI InternetExplorer_get_TopLevelContainer(IWebBrowser2 *iface, VARIANT_BOOL *pBool)
|
||||
{
|
||||
InternetExplorer *This = WEBBROWSER_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, pBool);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI InternetExplorer_get_Type(IWebBrowser2 *iface, BSTR *Type)
|
||||
{
|
||||
InternetExplorer *This = WEBBROWSER_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, Type);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI InternetExplorer_get_Left(IWebBrowser2 *iface, long *pl)
|
||||
{
|
||||
InternetExplorer *This = WEBBROWSER_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, pl);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI InternetExplorer_put_Left(IWebBrowser2 *iface, long Left)
|
||||
{
|
||||
InternetExplorer *This = WEBBROWSER_THIS(iface);
|
||||
FIXME("(%p)->(%ld)\n", This, Left);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI InternetExplorer_get_Top(IWebBrowser2 *iface, long *pl)
|
||||
{
|
||||
InternetExplorer *This = WEBBROWSER_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, pl);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI InternetExplorer_put_Top(IWebBrowser2 *iface, long Top)
|
||||
{
|
||||
InternetExplorer *This = WEBBROWSER_THIS(iface);
|
||||
FIXME("(%p)->(%ld)\n", This, Top);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI InternetExplorer_get_Width(IWebBrowser2 *iface, long *pl)
|
||||
{
|
||||
InternetExplorer *This = WEBBROWSER_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, pl);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI InternetExplorer_put_Width(IWebBrowser2 *iface, long Width)
|
||||
{
|
||||
InternetExplorer *This = WEBBROWSER_THIS(iface);
|
||||
FIXME("(%p)->(%ld)\n", This, Width);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI InternetExplorer_get_Height(IWebBrowser2 *iface, long *pl)
|
||||
{
|
||||
InternetExplorer *This = WEBBROWSER_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, pl);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI InternetExplorer_put_Height(IWebBrowser2 *iface, long Height)
|
||||
{
|
||||
InternetExplorer *This = WEBBROWSER_THIS(iface);
|
||||
FIXME("(%p)->(%ld)\n", This, Height);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI InternetExplorer_get_LocationName(IWebBrowser2 *iface, BSTR *LocationName)
|
||||
{
|
||||
InternetExplorer *This = WEBBROWSER_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, LocationName);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI InternetExplorer_get_LocationURL(IWebBrowser2 *iface, BSTR *LocationURL)
|
||||
{
|
||||
InternetExplorer *This = WEBBROWSER_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, LocationURL);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI InternetExplorer_get_Busy(IWebBrowser2 *iface, VARIANT_BOOL *pBool)
|
||||
{
|
||||
InternetExplorer *This = WEBBROWSER_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, pBool);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI InternetExplorer_Quit(IWebBrowser2 *iface)
|
||||
{
|
||||
InternetExplorer *This = WEBBROWSER_THIS(iface);
|
||||
FIXME("(%p)\n", This);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI InternetExplorer_ClientToWindow(IWebBrowser2 *iface, int *pcx, int *pcy)
|
||||
{
|
||||
InternetExplorer *This = WEBBROWSER_THIS(iface);
|
||||
FIXME("(%p)->(%p %p)\n", This, pcx, pcy);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI InternetExplorer_PutProperty(IWebBrowser2 *iface, BSTR szProperty, VARIANT vtValue)
|
||||
{
|
||||
InternetExplorer *This = WEBBROWSER_THIS(iface);
|
||||
FIXME("(%p)->(%s)\n", This, debugstr_w(szProperty));
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI InternetExplorer_GetProperty(IWebBrowser2 *iface, BSTR szProperty, VARIANT *pvtValue)
|
||||
{
|
||||
InternetExplorer *This = WEBBROWSER_THIS(iface);
|
||||
FIXME("(%p)->(%s %p)\n", This, debugstr_w(szProperty), pvtValue);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI InternetExplorer_get_Name(IWebBrowser2 *iface, BSTR *Name)
|
||||
{
|
||||
InternetExplorer *This = WEBBROWSER_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, Name);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI InternetExplorer_get_HWND(IWebBrowser2 *iface, long *pHWND)
|
||||
{
|
||||
InternetExplorer *This = WEBBROWSER_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, pHWND);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI InternetExplorer_get_FullName(IWebBrowser2 *iface, BSTR *FullName)
|
||||
{
|
||||
InternetExplorer *This = WEBBROWSER_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, FullName);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI InternetExplorer_get_Path(IWebBrowser2 *iface, BSTR *Path)
|
||||
{
|
||||
InternetExplorer *This = WEBBROWSER_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, Path);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI InternetExplorer_get_Visible(IWebBrowser2 *iface, VARIANT_BOOL *pBool)
|
||||
{
|
||||
InternetExplorer *This = WEBBROWSER_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, pBool);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI InternetExplorer_put_Visible(IWebBrowser2 *iface, VARIANT_BOOL Value)
|
||||
{
|
||||
InternetExplorer *This = WEBBROWSER_THIS(iface);
|
||||
TRACE("(%p)->(%x)\n", This, Value);
|
||||
|
||||
ShowWindow(This->frame_hwnd, Value ? SW_SHOW : SW_HIDE);
|
||||
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI InternetExplorer_get_StatusBar(IWebBrowser2 *iface, VARIANT_BOOL *pBool)
|
||||
{
|
||||
InternetExplorer *This = WEBBROWSER_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, pBool);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI InternetExplorer_put_StatusBar(IWebBrowser2 *iface, VARIANT_BOOL Value)
|
||||
{
|
||||
InternetExplorer *This = WEBBROWSER_THIS(iface);
|
||||
FIXME("(%p)->(%x)\n", This, Value);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI InternetExplorer_get_StatusText(IWebBrowser2 *iface, BSTR *StatusText)
|
||||
{
|
||||
InternetExplorer *This = WEBBROWSER_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, StatusText);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI InternetExplorer_put_StatusText(IWebBrowser2 *iface, BSTR StatusText)
|
||||
{
|
||||
InternetExplorer *This = WEBBROWSER_THIS(iface);
|
||||
FIXME("(%p)->(%s)\n", This, debugstr_w(StatusText));
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI InternetExplorer_get_ToolBar(IWebBrowser2 *iface, int *Value)
|
||||
{
|
||||
InternetExplorer *This = WEBBROWSER_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, Value);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI InternetExplorer_put_ToolBar(IWebBrowser2 *iface, int Value)
|
||||
{
|
||||
InternetExplorer *This = WEBBROWSER_THIS(iface);
|
||||
FIXME("(%p)->(%d)\n", This, Value);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI InternetExplorer_get_MenuBar(IWebBrowser2 *iface, VARIANT_BOOL *Value)
|
||||
{
|
||||
InternetExplorer *This = WEBBROWSER_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, Value);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI InternetExplorer_put_MenuBar(IWebBrowser2 *iface, VARIANT_BOOL Value)
|
||||
{
|
||||
InternetExplorer *This = WEBBROWSER_THIS(iface);
|
||||
FIXME("(%p)->(%x)\n", This, Value);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI InternetExplorer_get_FullScreen(IWebBrowser2 *iface, VARIANT_BOOL *pbFullScreen)
|
||||
{
|
||||
InternetExplorer *This = WEBBROWSER_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, pbFullScreen);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI InternetExplorer_put_FullScreen(IWebBrowser2 *iface, VARIANT_BOOL bFullScreen)
|
||||
{
|
||||
InternetExplorer *This = WEBBROWSER_THIS(iface);
|
||||
FIXME("(%p)->(%x)\n", This, bFullScreen);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI InternetExplorer_Navigate2(IWebBrowser2 *iface, VARIANT *URL, VARIANT *Flags,
|
||||
VARIANT *TargetFrameName, VARIANT *PostData, VARIANT *Headers)
|
||||
{
|
||||
InternetExplorer *This = WEBBROWSER_THIS(iface);
|
||||
|
||||
TRACE("(%p)->(%p %p %p %p %p)\n", This, URL, Flags, TargetFrameName, PostData, Headers);
|
||||
|
||||
if(!URL)
|
||||
return S_OK;
|
||||
|
||||
if(V_VT(URL) != VT_BSTR) {
|
||||
FIXME("Unsupported V_VT(URL) %d\n", V_VT(URL));
|
||||
return E_INVALIDARG;
|
||||
}
|
||||
|
||||
return navigate_url(&This->doc_host, V_BSTR(URL), Flags, TargetFrameName, PostData, Headers);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI InternetExplorer_QueryStatusWB(IWebBrowser2 *iface, OLECMDID cmdID, OLECMDF *pcmdf)
|
||||
{
|
||||
InternetExplorer *This = WEBBROWSER_THIS(iface);
|
||||
FIXME("(%p)->(%d %p)\n", This, cmdID, pcmdf);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI InternetExplorer_ExecWB(IWebBrowser2 *iface, OLECMDID cmdID,
|
||||
OLECMDEXECOPT cmdexecopt, VARIANT *pvaIn, VARIANT *pvaOut)
|
||||
{
|
||||
InternetExplorer *This = WEBBROWSER_THIS(iface);
|
||||
FIXME("(%p)->(%d %d %p %p)\n", This, cmdID, cmdexecopt, pvaIn, pvaOut);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI InternetExplorer_ShowBrowserBar(IWebBrowser2 *iface, VARIANT *pvaClsid,
|
||||
VARIANT *pvarShow, VARIANT *pvarSize)
|
||||
{
|
||||
InternetExplorer *This = WEBBROWSER_THIS(iface);
|
||||
FIXME("(%p)->(%p %p %p)\n", This, pvaClsid, pvarShow, pvarSize);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI InternetExplorer_get_ReadyState(IWebBrowser2 *iface, READYSTATE *lpReadyState)
|
||||
{
|
||||
InternetExplorer *This = WEBBROWSER_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, lpReadyState);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI InternetExplorer_get_Offline(IWebBrowser2 *iface, VARIANT_BOOL *pbOffline)
|
||||
{
|
||||
InternetExplorer *This = WEBBROWSER_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, pbOffline);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI InternetExplorer_put_Offline(IWebBrowser2 *iface, VARIANT_BOOL bOffline)
|
||||
{
|
||||
InternetExplorer *This = WEBBROWSER_THIS(iface);
|
||||
FIXME("(%p)->(%x)\n", This, bOffline);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI InternetExplorer_get_Silent(IWebBrowser2 *iface, VARIANT_BOOL *pbSilent)
|
||||
{
|
||||
InternetExplorer *This = WEBBROWSER_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, pbSilent);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI InternetExplorer_put_Silent(IWebBrowser2 *iface, VARIANT_BOOL bSilent)
|
||||
{
|
||||
InternetExplorer *This = WEBBROWSER_THIS(iface);
|
||||
FIXME("(%p)->(%x)\n", This, bSilent);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI InternetExplorer_get_RegisterAsBrowser(IWebBrowser2 *iface,
|
||||
VARIANT_BOOL *pbRegister)
|
||||
{
|
||||
InternetExplorer *This = WEBBROWSER_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, pbRegister);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI InternetExplorer_put_RegisterAsBrowser(IWebBrowser2 *iface,
|
||||
VARIANT_BOOL bRegister)
|
||||
{
|
||||
InternetExplorer *This = WEBBROWSER_THIS(iface);
|
||||
FIXME("(%p)->(%x)\n", This, bRegister);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI InternetExplorer_get_RegisterAsDropTarget(IWebBrowser2 *iface,
|
||||
VARIANT_BOOL *pbRegister)
|
||||
{
|
||||
InternetExplorer *This = WEBBROWSER_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, pbRegister);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI InternetExplorer_put_RegisterAsDropTarget(IWebBrowser2 *iface,
|
||||
VARIANT_BOOL bRegister)
|
||||
{
|
||||
InternetExplorer *This = WEBBROWSER_THIS(iface);
|
||||
FIXME("(%p)->(%x)\n", This, bRegister);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI InternetExplorer_get_TheaterMode(IWebBrowser2 *iface, VARIANT_BOOL *pbRegister)
|
||||
{
|
||||
InternetExplorer *This = WEBBROWSER_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, pbRegister);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI InternetExplorer_put_TheaterMode(IWebBrowser2 *iface, VARIANT_BOOL bRegister)
|
||||
{
|
||||
InternetExplorer *This = WEBBROWSER_THIS(iface);
|
||||
FIXME("(%p)->(%x)\n", This, bRegister);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI InternetExplorer_get_AddressBar(IWebBrowser2 *iface, VARIANT_BOOL *Value)
|
||||
{
|
||||
InternetExplorer *This = WEBBROWSER_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, Value);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI InternetExplorer_put_AddressBar(IWebBrowser2 *iface, VARIANT_BOOL Value)
|
||||
{
|
||||
InternetExplorer *This = WEBBROWSER_THIS(iface);
|
||||
FIXME("(%p)->(%x)\n", This, Value);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI InternetExplorer_get_Resizable(IWebBrowser2 *iface, VARIANT_BOOL *Value)
|
||||
{
|
||||
InternetExplorer *This = WEBBROWSER_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, Value);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI InternetExplorer_put_Resizable(IWebBrowser2 *iface, VARIANT_BOOL Value)
|
||||
{
|
||||
InternetExplorer *This = WEBBROWSER_THIS(iface);
|
||||
FIXME("(%p)->(%x)\n", This, Value);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
#undef WEBBROWSER_THIS
|
||||
|
||||
static const IWebBrowser2Vtbl InternetExplorerVtbl =
|
||||
{
|
||||
InternetExplorer_QueryInterface,
|
||||
InternetExplorer_AddRef,
|
||||
InternetExplorer_Release,
|
||||
InternetExplorer_GetTypeInfoCount,
|
||||
InternetExplorer_GetTypeInfo,
|
||||
InternetExplorer_GetIDsOfNames,
|
||||
InternetExplorer_Invoke,
|
||||
InternetExplorer_GoBack,
|
||||
InternetExplorer_GoForward,
|
||||
InternetExplorer_GoHome,
|
||||
InternetExplorer_GoSearch,
|
||||
InternetExplorer_Navigate,
|
||||
InternetExplorer_Refresh,
|
||||
InternetExplorer_Refresh2,
|
||||
InternetExplorer_Stop,
|
||||
InternetExplorer_get_Application,
|
||||
InternetExplorer_get_Parent,
|
||||
InternetExplorer_get_Container,
|
||||
InternetExplorer_get_Document,
|
||||
InternetExplorer_get_TopLevelContainer,
|
||||
InternetExplorer_get_Type,
|
||||
InternetExplorer_get_Left,
|
||||
InternetExplorer_put_Left,
|
||||
InternetExplorer_get_Top,
|
||||
InternetExplorer_put_Top,
|
||||
InternetExplorer_get_Width,
|
||||
InternetExplorer_put_Width,
|
||||
InternetExplorer_get_Height,
|
||||
InternetExplorer_put_Height,
|
||||
InternetExplorer_get_LocationName,
|
||||
InternetExplorer_get_LocationURL,
|
||||
InternetExplorer_get_Busy,
|
||||
InternetExplorer_Quit,
|
||||
InternetExplorer_ClientToWindow,
|
||||
InternetExplorer_PutProperty,
|
||||
InternetExplorer_GetProperty,
|
||||
InternetExplorer_get_Name,
|
||||
InternetExplorer_get_HWND,
|
||||
InternetExplorer_get_FullName,
|
||||
InternetExplorer_get_Path,
|
||||
InternetExplorer_get_Visible,
|
||||
InternetExplorer_put_Visible,
|
||||
InternetExplorer_get_StatusBar,
|
||||
InternetExplorer_put_StatusBar,
|
||||
InternetExplorer_get_StatusText,
|
||||
InternetExplorer_put_StatusText,
|
||||
InternetExplorer_get_ToolBar,
|
||||
InternetExplorer_put_ToolBar,
|
||||
InternetExplorer_get_MenuBar,
|
||||
InternetExplorer_put_MenuBar,
|
||||
InternetExplorer_get_FullScreen,
|
||||
InternetExplorer_put_FullScreen,
|
||||
InternetExplorer_Navigate2,
|
||||
InternetExplorer_QueryStatusWB,
|
||||
InternetExplorer_ExecWB,
|
||||
InternetExplorer_ShowBrowserBar,
|
||||
InternetExplorer_get_ReadyState,
|
||||
InternetExplorer_get_Offline,
|
||||
InternetExplorer_put_Offline,
|
||||
InternetExplorer_get_Silent,
|
||||
InternetExplorer_put_Silent,
|
||||
InternetExplorer_get_RegisterAsBrowser,
|
||||
InternetExplorer_put_RegisterAsBrowser,
|
||||
InternetExplorer_get_RegisterAsDropTarget,
|
||||
InternetExplorer_put_RegisterAsDropTarget,
|
||||
InternetExplorer_get_TheaterMode,
|
||||
InternetExplorer_put_TheaterMode,
|
||||
InternetExplorer_get_AddressBar,
|
||||
InternetExplorer_put_AddressBar,
|
||||
InternetExplorer_get_Resizable,
|
||||
InternetExplorer_put_Resizable
|
||||
};
|
||||
|
||||
void InternetExplorer_WebBrowser_Init(InternetExplorer *This)
|
||||
{
|
||||
This->lpWebBrowser2Vtbl = &InternetExplorerVtbl;
|
||||
}
|
||||
@@ -0,0 +1,233 @@
|
||||
/*
|
||||
* SHDOCVW - Internet Explorer main frame window
|
||||
*
|
||||
* Copyright 2006 Mike McCormack (for CodeWeavers)
|
||||
* 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
|
||||
*/
|
||||
|
||||
#define COBJMACROS
|
||||
|
||||
#include <stdarg.h>
|
||||
#include "windef.h"
|
||||
#include "winbase.h"
|
||||
#include "winuser.h"
|
||||
#include "wingdi.h"
|
||||
#include "winnls.h"
|
||||
#include "ole2.h"
|
||||
#include "exdisp.h"
|
||||
#include "oleidl.h"
|
||||
|
||||
#include "shdocvw.h"
|
||||
|
||||
#include "wine/debug.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(shdocvw);
|
||||
|
||||
static const WCHAR szIEWinFrame[] = { 'I','E','F','r','a','m','e',0 };
|
||||
|
||||
static LRESULT iewnd_OnCreate(HWND hwnd, LPCREATESTRUCTW lpcs)
|
||||
{
|
||||
SetWindowLongPtrW(hwnd, 0, (LONG_PTR) lpcs->lpCreateParams);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static LRESULT iewnd_OnSize(InternetExplorer *This, INT width, INT height)
|
||||
{
|
||||
if(This->doc_host.hwnd)
|
||||
SetWindowPos(This->doc_host.hwnd, NULL, 0, 0, width, height,
|
||||
SWP_NOZORDER | SWP_NOACTIVATE);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static LRESULT iewnd_OnDestroy(InternetExplorer *This)
|
||||
{
|
||||
TRACE("%p\n", This);
|
||||
|
||||
This->frame_hwnd = NULL;
|
||||
PostQuitMessage(0); /* FIXME */
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static LRESULT CALLBACK
|
||||
ie_window_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARAM lparam)
|
||||
{
|
||||
InternetExplorer *This = (InternetExplorer*) GetWindowLongPtrW(hwnd, 0);
|
||||
|
||||
switch (msg)
|
||||
{
|
||||
case WM_CREATE:
|
||||
return iewnd_OnCreate(hwnd, (LPCREATESTRUCTW)lparam);
|
||||
case WM_DESTROY:
|
||||
return iewnd_OnDestroy(This);
|
||||
case WM_SIZE:
|
||||
return iewnd_OnSize(This, LOWORD(lparam), HIWORD(lparam));
|
||||
case WM_DOCHOSTTASK:
|
||||
return process_dochost_task(&This->doc_host, lparam);
|
||||
}
|
||||
return DefWindowProcW(hwnd, msg, wparam, lparam);
|
||||
}
|
||||
|
||||
void register_iewindow_class(void)
|
||||
{
|
||||
WNDCLASSW wc;
|
||||
|
||||
memset(&wc, 0, sizeof wc);
|
||||
wc.style = 0;
|
||||
wc.lpfnWndProc = ie_window_proc;
|
||||
wc.cbClsExtra = 0;
|
||||
wc.cbWndExtra = sizeof(InternetExplorer*);
|
||||
wc.hInstance = shdocvw_hinstance;
|
||||
wc.hIcon = 0;
|
||||
wc.hCursor = LoadCursorW(0, MAKEINTRESOURCEW(IDI_APPLICATION));
|
||||
wc.hbrBackground = 0;
|
||||
wc.lpszClassName = szIEWinFrame;
|
||||
wc.lpszMenuName = NULL;
|
||||
|
||||
RegisterClassW(&wc);
|
||||
}
|
||||
|
||||
void unregister_iewindow_class(void)
|
||||
{
|
||||
UnregisterClassW(szIEWinFrame, shdocvw_hinstance);
|
||||
}
|
||||
|
||||
static void create_frame_hwnd(InternetExplorer *This)
|
||||
{
|
||||
/* Windows uses "Microsoft Internet Explorer" */
|
||||
static const WCHAR wszWineInternetExplorer[] =
|
||||
{'W','i','n','e',' ','I','n','t','e','r','n','e','t',' ','E','x','p','l','o','r','e','r',0};
|
||||
|
||||
This->frame_hwnd = CreateWindowExW(
|
||||
WS_EX_WINDOWEDGE,
|
||||
szIEWinFrame, wszWineInternetExplorer,
|
||||
WS_CLIPCHILDREN | WS_CAPTION | WS_SYSMENU | WS_THICKFRAME
|
||||
| WS_MINIMIZEBOX | WS_MAXIMIZEBOX,
|
||||
CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT,
|
||||
NULL, NULL /* FIXME */, shdocvw_hinstance, This);
|
||||
}
|
||||
|
||||
static IWebBrowser2 *create_ie_window(LPCSTR cmdline)
|
||||
{
|
||||
IWebBrowser2 *wb = NULL;
|
||||
|
||||
InternetExplorer_Create(NULL, &IID_IWebBrowser2, (void**)&wb);
|
||||
if(!wb)
|
||||
return NULL;
|
||||
|
||||
IWebBrowser2_put_Visible(wb, VARIANT_TRUE);
|
||||
|
||||
if(!*cmdline) {
|
||||
IWebBrowser2_GoHome(wb);
|
||||
}else {
|
||||
VARIANT var_url;
|
||||
DWORD len;
|
||||
|
||||
if(!strncasecmp(cmdline, "-nohome", 7))
|
||||
cmdline += 7;
|
||||
|
||||
V_VT(&var_url) = VT_BSTR;
|
||||
|
||||
len = MultiByteToWideChar(CP_ACP, 0, cmdline, -1, NULL, 0);
|
||||
V_BSTR(&var_url) = SysAllocStringLen(NULL, len);
|
||||
MultiByteToWideChar(CP_ACP, 0, cmdline, -1, V_BSTR(&var_url), len);
|
||||
|
||||
/* navigate to the first page */
|
||||
IWebBrowser2_Navigate2(wb, &var_url, NULL, NULL, NULL, NULL);
|
||||
|
||||
SysFreeString(V_BSTR(&var_url));
|
||||
}
|
||||
|
||||
return wb;
|
||||
}
|
||||
|
||||
HRESULT InternetExplorer_Create(IUnknown *pOuter, REFIID riid, void **ppv)
|
||||
{
|
||||
InternetExplorer *ret;
|
||||
HRESULT hres;
|
||||
|
||||
TRACE("(%p %s %p)\n", pOuter, debugstr_guid(riid), ppv);
|
||||
|
||||
ret = heap_alloc(sizeof(InternetExplorer));
|
||||
ret->ref = 0;
|
||||
|
||||
ret->doc_host.disp = (IDispatch*)WEBBROWSER2(ret);
|
||||
DocHost_Init(&ret->doc_host, (IDispatch*)WEBBROWSER2(ret));
|
||||
|
||||
InternetExplorer_WebBrowser_Init(ret);
|
||||
|
||||
create_frame_hwnd(ret);
|
||||
ret->doc_host.frame_hwnd = ret->frame_hwnd;
|
||||
|
||||
hres = IWebBrowser2_QueryInterface(WEBBROWSER2(ret), riid, ppv);
|
||||
if(FAILED(hres)) {
|
||||
heap_free(ret);
|
||||
return hres;
|
||||
}
|
||||
|
||||
return hres;
|
||||
}
|
||||
|
||||
/******************************************************************
|
||||
* IEWinMain (SHDOCVW.101)
|
||||
*
|
||||
* Only returns on error.
|
||||
*/
|
||||
DWORD WINAPI IEWinMain(LPSTR szCommandLine, int nShowWindow)
|
||||
{
|
||||
IWebBrowser2 *wb = NULL;
|
||||
MSG msg;
|
||||
HRESULT hres;
|
||||
|
||||
TRACE("%s %d\n", debugstr_a(szCommandLine), nShowWindow);
|
||||
|
||||
if(*szCommandLine == '-' || *szCommandLine == '/') {
|
||||
if(!strcasecmp(szCommandLine+1, "regserver"))
|
||||
return register_iexplore(TRUE);
|
||||
if(!strcasecmp(szCommandLine+1, "unregserver"))
|
||||
return register_iexplore(FALSE);
|
||||
}
|
||||
|
||||
CoInitialize(NULL);
|
||||
|
||||
hres = register_class_object(TRUE);
|
||||
if(FAILED(hres)) {
|
||||
CoUninitialize();
|
||||
ExitProcess(1);
|
||||
}
|
||||
|
||||
if(strcasecmp(szCommandLine, "-embedding"))
|
||||
wb = create_ie_window(szCommandLine);
|
||||
|
||||
/* run the message loop for this thread */
|
||||
while (GetMessageW(&msg, 0, 0, 0))
|
||||
{
|
||||
TranslateMessage(&msg);
|
||||
DispatchMessageW(&msg);
|
||||
}
|
||||
|
||||
if(wb)
|
||||
IWebBrowser2_Release(wb);
|
||||
|
||||
register_class_object(FALSE);
|
||||
|
||||
CoUninitialize();
|
||||
|
||||
ExitProcess(0);
|
||||
return 0;
|
||||
}
|
||||
@@ -0,0 +1,513 @@
|
||||
/*
|
||||
* Copyright 2008 Damjan Jovanovic
|
||||
*
|
||||
* ShellLink's barely documented cousin that handles URLs.
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
/*
|
||||
* TODO:
|
||||
* Implement the IShellLinkA/W interfaces
|
||||
* Handle the SetURL flags
|
||||
* Implement any other interfaces? Does any software actually use them?
|
||||
*
|
||||
* The installer for the Zuma Deluxe Popcap game is good for testing.
|
||||
*/
|
||||
|
||||
#include "wine/debug.h"
|
||||
#include "shdocvw.h"
|
||||
#include "objidl.h"
|
||||
#include "shobjidl.h"
|
||||
#include "intshcut.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(shdocvw);
|
||||
|
||||
typedef struct
|
||||
{
|
||||
IUniformResourceLocatorA uniformResourceLocatorA;
|
||||
IUniformResourceLocatorW uniformResourceLocatorW;
|
||||
IPersistFile persistFile;
|
||||
|
||||
LONG refCount;
|
||||
|
||||
WCHAR *url;
|
||||
BOOLEAN isDirty;
|
||||
LPOLESTR currentFile;
|
||||
} InternetShortcut;
|
||||
|
||||
/* utility functions */
|
||||
|
||||
static inline InternetShortcut* impl_from_IUniformResourceLocatorA(IUniformResourceLocatorA *iface)
|
||||
{
|
||||
return (InternetShortcut*)((char*)iface - FIELD_OFFSET(InternetShortcut, uniformResourceLocatorA));
|
||||
}
|
||||
|
||||
static inline InternetShortcut* impl_from_IUniformResourceLocatorW(IUniformResourceLocatorW *iface)
|
||||
{
|
||||
return (InternetShortcut*)((char*)iface - FIELD_OFFSET(InternetShortcut, uniformResourceLocatorW));
|
||||
}
|
||||
|
||||
static inline InternetShortcut* impl_from_IPersistFile(IPersistFile *iface)
|
||||
{
|
||||
return (InternetShortcut*)((char*)iface - FIELD_OFFSET(InternetShortcut, persistFile));
|
||||
}
|
||||
|
||||
static BOOL StartLinkProcessor(LPCOLESTR szLink)
|
||||
{
|
||||
static const WCHAR szFormat[] = {
|
||||
'w','i','n','e','m','e','n','u','b','u','i','l','d','e','r','.','e','x','e',
|
||||
' ','-','w',' ','-','u',' ','"','%','s','"',0 };
|
||||
LONG len;
|
||||
LPWSTR buffer;
|
||||
STARTUPINFOW si;
|
||||
PROCESS_INFORMATION pi;
|
||||
BOOL ret;
|
||||
|
||||
len = sizeof(szFormat) + lstrlenW( szLink ) * sizeof(WCHAR);
|
||||
buffer = heap_alloc( len );
|
||||
if( !buffer )
|
||||
return FALSE;
|
||||
|
||||
wsprintfW( buffer, szFormat, szLink );
|
||||
|
||||
TRACE("starting %s\n",debugstr_w(buffer));
|
||||
|
||||
memset(&si, 0, sizeof(si));
|
||||
si.cb = sizeof(si);
|
||||
|
||||
ret = CreateProcessW( NULL, buffer, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi );
|
||||
|
||||
HeapFree( GetProcessHeap(), 0, buffer );
|
||||
|
||||
if (ret)
|
||||
{
|
||||
CloseHandle( pi.hProcess );
|
||||
CloseHandle( pi.hThread );
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
/* interface functions */
|
||||
|
||||
static HRESULT Unknown_QueryInterface(InternetShortcut *This, REFIID riid, PVOID *ppvObject)
|
||||
{
|
||||
TRACE("(%p, %s, %p)\n", This, debugstr_guid(riid), ppvObject);
|
||||
*ppvObject = NULL;
|
||||
if (IsEqualGUID(&IID_IUnknown, riid))
|
||||
*ppvObject = &This->uniformResourceLocatorA;
|
||||
else if (IsEqualGUID(&IID_IUniformResourceLocatorA, riid))
|
||||
*ppvObject = &This->uniformResourceLocatorA;
|
||||
else if (IsEqualGUID(&IID_IUniformResourceLocatorW, riid))
|
||||
*ppvObject = &This->uniformResourceLocatorW;
|
||||
else if (IsEqualGUID(&IID_IPersistFile, riid))
|
||||
*ppvObject = &This->persistFile;
|
||||
else if (IsEqualGUID(&IID_IShellLinkA, riid))
|
||||
{
|
||||
FIXME("The IShellLinkA interface is not yet supported by InternetShortcut\n");
|
||||
return E_NOINTERFACE;
|
||||
}
|
||||
else if (IsEqualGUID(&IID_IShellLinkW, riid))
|
||||
{
|
||||
FIXME("The IShellLinkW interface is not yet supported by InternetShortcut\n");
|
||||
return E_NOINTERFACE;
|
||||
}
|
||||
else
|
||||
{
|
||||
FIXME("Interface with GUID %s not yet implemented by InternetShortcut\n", debugstr_guid(riid));
|
||||
return E_NOINTERFACE;
|
||||
}
|
||||
IUnknown_AddRef((IUnknown*)*ppvObject);
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static ULONG Unknown_AddRef(InternetShortcut *This)
|
||||
{
|
||||
TRACE("(%p)\n", This);
|
||||
return InterlockedIncrement(&This->refCount);
|
||||
}
|
||||
|
||||
static ULONG Unknown_Release(InternetShortcut *This)
|
||||
{
|
||||
ULONG count;
|
||||
TRACE("(%p)\n", This);
|
||||
count = InterlockedDecrement(&This->refCount);
|
||||
if (count == 0)
|
||||
{
|
||||
CoTaskMemFree(This->url);
|
||||
CoTaskMemFree(This->currentFile);
|
||||
heap_free(This);
|
||||
SHDOCVW_UnlockModule();
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI UniformResourceLocatorW_QueryInterface(IUniformResourceLocatorW *url, REFIID riid, PVOID *ppvObject)
|
||||
{
|
||||
InternetShortcut *This = impl_from_IUniformResourceLocatorW(url);
|
||||
TRACE("(%p, %s, %p)\n", url, debugstr_guid(riid), ppvObject);
|
||||
return Unknown_QueryInterface(This, riid, ppvObject);
|
||||
}
|
||||
|
||||
static ULONG WINAPI UniformResourceLocatorW_AddRef(IUniformResourceLocatorW *url)
|
||||
{
|
||||
InternetShortcut *This = impl_from_IUniformResourceLocatorW(url);
|
||||
TRACE("(%p)\n", url);
|
||||
return Unknown_AddRef(This);
|
||||
}
|
||||
|
||||
static ULONG WINAPI UniformResourceLocatorW_Release(IUniformResourceLocatorW *url)
|
||||
{
|
||||
InternetShortcut *This = impl_from_IUniformResourceLocatorW(url);
|
||||
TRACE("(%p)\n", url);
|
||||
return Unknown_Release(This);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI UniformResourceLocatorW_SetUrl(IUniformResourceLocatorW *url, LPCWSTR pcszURL, DWORD dwInFlags)
|
||||
{
|
||||
WCHAR *newURL = NULL;
|
||||
InternetShortcut *This = impl_from_IUniformResourceLocatorW(url);
|
||||
TRACE("(%p, %s, 0x%x)\n", url, debugstr_w(pcszURL), dwInFlags);
|
||||
if (dwInFlags != 0)
|
||||
FIXME("ignoring unsupported flags 0x%x\n", dwInFlags);
|
||||
if (pcszURL != NULL)
|
||||
{
|
||||
newURL = co_strdupW(pcszURL);
|
||||
if (newURL == NULL)
|
||||
return E_OUTOFMEMORY;
|
||||
}
|
||||
CoTaskMemFree(This->url);
|
||||
This->url = newURL;
|
||||
This->isDirty = TRUE;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI UniformResourceLocatorW_GetUrl(IUniformResourceLocatorW *url, LPWSTR *ppszURL)
|
||||
{
|
||||
HRESULT hr = S_OK;
|
||||
InternetShortcut *This = impl_from_IUniformResourceLocatorW(url);
|
||||
TRACE("(%p, %p)\n", url, ppszURL);
|
||||
if (This->url == NULL)
|
||||
*ppszURL = NULL;
|
||||
else
|
||||
{
|
||||
*ppszURL = co_strdupW(This->url);
|
||||
if (*ppszURL == NULL)
|
||||
hr = E_OUTOFMEMORY;
|
||||
}
|
||||
return hr;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI UniformResourceLocatorW_InvokeCommand(IUniformResourceLocatorW *url, PURLINVOKECOMMANDINFOW pCommandInfo)
|
||||
{
|
||||
FIXME("(%p, %p): stub\n", url, pCommandInfo);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI UniformResourceLocatorA_QueryInterface(IUniformResourceLocatorA *url, REFIID riid, PVOID *ppvObject)
|
||||
{
|
||||
InternetShortcut *This = impl_from_IUniformResourceLocatorA(url);
|
||||
TRACE("(%p, %s, %p)\n", url, debugstr_guid(riid), ppvObject);
|
||||
return Unknown_QueryInterface(This, riid, ppvObject);
|
||||
}
|
||||
|
||||
static ULONG WINAPI UniformResourceLocatorA_AddRef(IUniformResourceLocatorA *url)
|
||||
{
|
||||
InternetShortcut *This = impl_from_IUniformResourceLocatorA(url);
|
||||
TRACE("(%p)\n", url);
|
||||
return Unknown_AddRef(This);
|
||||
}
|
||||
|
||||
static ULONG WINAPI UniformResourceLocatorA_Release(IUniformResourceLocatorA *url)
|
||||
{
|
||||
InternetShortcut *This = impl_from_IUniformResourceLocatorA(url);
|
||||
TRACE("(%p)\n", url);
|
||||
return Unknown_Release(This);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI UniformResourceLocatorA_SetUrl(IUniformResourceLocatorA *url, LPCSTR pcszURL, DWORD dwInFlags)
|
||||
{
|
||||
WCHAR *newURL = NULL;
|
||||
InternetShortcut *This = impl_from_IUniformResourceLocatorA(url);
|
||||
TRACE("(%p, %s, 0x%x)\n", url, debugstr_a(pcszURL), dwInFlags);
|
||||
if (dwInFlags != 0)
|
||||
FIXME("ignoring unsupported flags 0x%x\n", dwInFlags);
|
||||
if (pcszURL != NULL)
|
||||
{
|
||||
newURL = co_strdupAtoW(pcszURL);
|
||||
if (newURL == NULL)
|
||||
return E_OUTOFMEMORY;
|
||||
}
|
||||
CoTaskMemFree(This->url);
|
||||
This->url = newURL;
|
||||
This->isDirty = TRUE;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI UniformResourceLocatorA_GetUrl(IUniformResourceLocatorA *url, LPSTR *ppszURL)
|
||||
{
|
||||
HRESULT hr = S_OK;
|
||||
InternetShortcut *This = impl_from_IUniformResourceLocatorA(url);
|
||||
TRACE("(%p, %p)\n", url, ppszURL);
|
||||
if (This->url == NULL)
|
||||
*ppszURL = NULL;
|
||||
else
|
||||
{
|
||||
*ppszURL = co_strdupWtoA(This->url);
|
||||
if (*ppszURL == NULL)
|
||||
hr = E_OUTOFMEMORY;
|
||||
}
|
||||
return hr;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI UniformResourceLocatorA_InvokeCommand(IUniformResourceLocatorA *url, PURLINVOKECOMMANDINFOA pCommandInfo)
|
||||
{
|
||||
FIXME("(%p, %p): stub\n", url, pCommandInfo);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI PersistFile_QueryInterface(IPersistFile *pFile, REFIID riid, PVOID *ppvObject)
|
||||
{
|
||||
InternetShortcut *This = impl_from_IPersistFile(pFile);
|
||||
TRACE("(%p, %s, %p)\n", pFile, debugstr_guid(riid), ppvObject);
|
||||
return Unknown_QueryInterface(This, riid, ppvObject);
|
||||
}
|
||||
|
||||
static ULONG WINAPI PersistFile_AddRef(IPersistFile *pFile)
|
||||
{
|
||||
InternetShortcut *This = impl_from_IPersistFile(pFile);
|
||||
TRACE("(%p)\n", pFile);
|
||||
return Unknown_AddRef(This);
|
||||
}
|
||||
|
||||
static ULONG WINAPI PersistFile_Release(IPersistFile *pFile)
|
||||
{
|
||||
InternetShortcut *This = impl_from_IPersistFile(pFile);
|
||||
TRACE("(%p)\n", pFile);
|
||||
return Unknown_Release(This);
|
||||
}
|
||||
|
||||
static HRESULT WINAPI PersistFile_GetClassID(IPersistFile *pFile, CLSID *pClassID)
|
||||
{
|
||||
TRACE("(%p, %p)\n", pFile, pClassID);
|
||||
*pClassID = CLSID_InternetShortcut;
|
||||
return S_OK;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI PersistFile_IsDirty(IPersistFile *pFile)
|
||||
{
|
||||
InternetShortcut *This = impl_from_IPersistFile(pFile);
|
||||
TRACE("(%p)\n", pFile);
|
||||
return This->isDirty ? S_OK : S_FALSE;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI PersistFile_Load(IPersistFile *pFile, LPCOLESTR pszFileName, DWORD dwMode)
|
||||
{
|
||||
WCHAR str_header[] = {'I','n','t','e','r','n','e','t','S','h','o','r','t','c','u','t',0};
|
||||
WCHAR str_URL[] = {'U','R','L',0};
|
||||
WCHAR *filename = NULL;
|
||||
HRESULT hr;
|
||||
InternetShortcut *This = impl_from_IPersistFile(pFile);
|
||||
TRACE("(%p, %s, 0x%x)\n", pFile, debugstr_w(pszFileName), dwMode);
|
||||
if (dwMode != 0)
|
||||
FIXME("ignoring unimplemented mode 0x%x\n", dwMode);
|
||||
filename = co_strdupW(pszFileName);
|
||||
if (filename != NULL)
|
||||
{
|
||||
DWORD len = 128;
|
||||
DWORD r;
|
||||
WCHAR *url = CoTaskMemAlloc(len*sizeof(WCHAR));
|
||||
if (url != NULL)
|
||||
{
|
||||
r = GetPrivateProfileStringW(str_header, str_URL, NULL, url, len, pszFileName);
|
||||
while (r == len-1)
|
||||
{
|
||||
CoTaskMemFree(url);
|
||||
len *= 2;
|
||||
url = CoTaskMemAlloc(len);
|
||||
if (url == NULL)
|
||||
break;
|
||||
r = GetPrivateProfileStringW(str_header, str_URL, NULL, url, len, pszFileName);
|
||||
}
|
||||
if (r == 0)
|
||||
hr = E_FAIL;
|
||||
else if (url != NULL)
|
||||
{
|
||||
CoTaskMemFree(This->currentFile);
|
||||
This->currentFile = filename;
|
||||
CoTaskMemFree(This->url);
|
||||
This->url = url;
|
||||
This->isDirty = FALSE;
|
||||
return S_OK;
|
||||
}
|
||||
else
|
||||
hr = E_OUTOFMEMORY;
|
||||
CoTaskMemFree(url);
|
||||
}
|
||||
else
|
||||
hr = E_OUTOFMEMORY;
|
||||
CoTaskMemFree(filename);
|
||||
}
|
||||
else
|
||||
hr = E_OUTOFMEMORY;
|
||||
return hr;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI PersistFile_Save(IPersistFile *pFile, LPCOLESTR pszFileName, BOOL fRemember)
|
||||
{
|
||||
HRESULT hr = S_OK;
|
||||
INT len;
|
||||
CHAR *url;
|
||||
InternetShortcut *This = impl_from_IPersistFile(pFile);
|
||||
|
||||
TRACE("(%p, %s, %d)\n", pFile, debugstr_w(pszFileName), fRemember);
|
||||
|
||||
if (pszFileName != NULL && fRemember)
|
||||
{
|
||||
LPOLESTR oldFile = This->currentFile;
|
||||
This->currentFile = co_strdupW(pszFileName);
|
||||
if (This->currentFile == NULL)
|
||||
{
|
||||
This->currentFile = oldFile;
|
||||
return E_OUTOFMEMORY;
|
||||
}
|
||||
CoTaskMemFree(oldFile);
|
||||
}
|
||||
if (This->url == NULL)
|
||||
return E_FAIL;
|
||||
|
||||
/* Windows seems to always write:
|
||||
* ASCII "[InternetShortcut]" headers
|
||||
* ASCII names in "name=value" pairs
|
||||
* An ASCII (probably UTF8?) value in "URL=..."
|
||||
*/
|
||||
len = WideCharToMultiByte(CP_UTF8, 0, This->url, -1, NULL, 0, 0, 0);
|
||||
url = heap_alloc(len);
|
||||
if (url != NULL)
|
||||
{
|
||||
HANDLE file;
|
||||
WideCharToMultiByte(CP_UTF8, 0, This->url, -1, url, len, 0, 0);
|
||||
file = CreateFileW(pszFileName, GENERIC_WRITE, FILE_SHARE_READ, NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
|
||||
if (file != INVALID_HANDLE_VALUE)
|
||||
{
|
||||
DWORD bytesWritten;
|
||||
char str_header[] = "[InternetShortcut]";
|
||||
char str_URL[] = "URL=";
|
||||
char str_eol[] = "\r\n";
|
||||
|
||||
WriteFile(file, str_header, lstrlenA(str_header), &bytesWritten, NULL);
|
||||
WriteFile(file, str_eol, lstrlenA(str_eol), &bytesWritten, NULL);
|
||||
WriteFile(file, str_URL, lstrlenA(str_URL), &bytesWritten, NULL);
|
||||
WriteFile(file, url, lstrlenA(url), &bytesWritten, NULL);
|
||||
WriteFile(file, str_eol, lstrlenA(str_eol), &bytesWritten, NULL);
|
||||
CloseHandle(file);
|
||||
if (pszFileName == NULL || fRemember)
|
||||
This->isDirty = FALSE;
|
||||
StartLinkProcessor(pszFileName);
|
||||
}
|
||||
else
|
||||
hr = E_FAIL;
|
||||
heap_free(url);
|
||||
}
|
||||
else
|
||||
hr = E_OUTOFMEMORY;
|
||||
|
||||
return hr;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI PersistFile_SaveCompleted(IPersistFile *pFile, LPCOLESTR pszFileName)
|
||||
{
|
||||
FIXME("(%p, %p): stub\n", pFile, pszFileName);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI PersistFile_GetCurFile(IPersistFile *pFile, LPOLESTR *ppszFileName)
|
||||
{
|
||||
HRESULT hr = S_OK;
|
||||
InternetShortcut *This = impl_from_IPersistFile(pFile);
|
||||
TRACE("(%p, %p)\n", pFile, ppszFileName);
|
||||
if (This->currentFile == NULL)
|
||||
*ppszFileName = NULL;
|
||||
else
|
||||
{
|
||||
*ppszFileName = co_strdupW(This->currentFile);
|
||||
if (*ppszFileName == NULL)
|
||||
hr = E_OUTOFMEMORY;
|
||||
}
|
||||
return hr;
|
||||
}
|
||||
|
||||
|
||||
|
||||
static const IUniformResourceLocatorWVtbl uniformResourceLocatorWVtbl = {
|
||||
UniformResourceLocatorW_QueryInterface,
|
||||
UniformResourceLocatorW_AddRef,
|
||||
UniformResourceLocatorW_Release,
|
||||
UniformResourceLocatorW_SetUrl,
|
||||
UniformResourceLocatorW_GetUrl,
|
||||
UniformResourceLocatorW_InvokeCommand
|
||||
};
|
||||
|
||||
static const IUniformResourceLocatorAVtbl uniformResourceLocatorAVtbl = {
|
||||
UniformResourceLocatorA_QueryInterface,
|
||||
UniformResourceLocatorA_AddRef,
|
||||
UniformResourceLocatorA_Release,
|
||||
UniformResourceLocatorA_SetUrl,
|
||||
UniformResourceLocatorA_GetUrl,
|
||||
UniformResourceLocatorA_InvokeCommand
|
||||
};
|
||||
|
||||
static const IPersistFileVtbl persistFileVtbl = {
|
||||
PersistFile_QueryInterface,
|
||||
PersistFile_AddRef,
|
||||
PersistFile_Release,
|
||||
PersistFile_GetClassID,
|
||||
PersistFile_IsDirty,
|
||||
PersistFile_Load,
|
||||
PersistFile_Save,
|
||||
PersistFile_SaveCompleted,
|
||||
PersistFile_GetCurFile
|
||||
};
|
||||
|
||||
HRESULT InternetShortcut_Create(IUnknown *pOuter, REFIID riid, void **ppv)
|
||||
{
|
||||
InternetShortcut *This;
|
||||
HRESULT hr;
|
||||
|
||||
TRACE("(%p, %s, %p)\n", pOuter, debugstr_guid(riid), ppv);
|
||||
|
||||
*ppv = NULL;
|
||||
|
||||
if(pOuter)
|
||||
return CLASS_E_NOAGGREGATION;
|
||||
|
||||
This = HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, sizeof(InternetShortcut));
|
||||
if (This)
|
||||
{
|
||||
This->uniformResourceLocatorA.lpVtbl = &uniformResourceLocatorAVtbl;
|
||||
This->uniformResourceLocatorW.lpVtbl = &uniformResourceLocatorWVtbl;
|
||||
This->persistFile.lpVtbl = &persistFileVtbl;
|
||||
This->refCount = 0;
|
||||
hr = Unknown_QueryInterface(This, riid, ppv);
|
||||
if (SUCCEEDED(hr))
|
||||
SHDOCVW_LockModule();
|
||||
else
|
||||
heap_free(This);
|
||||
return hr;
|
||||
}
|
||||
else
|
||||
return E_OUTOFMEMORY;
|
||||
}
|
||||
@@ -1,98 +0,0 @@
|
||||
/*
|
||||
* Implementation of miscellaneous interfaces for WebBrowser control:
|
||||
*
|
||||
* - IQuickActivate
|
||||
*
|
||||
* Copyright 2001 John R. Sheets (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., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
*/
|
||||
|
||||
#include "wine/debug.h"
|
||||
#include "shdocvw.h"
|
||||
|
||||
WINE_DEFAULT_DEBUG_CHANNEL(shdocvw);
|
||||
|
||||
/**********************************************************************
|
||||
* Implement the IQuickActivate interface
|
||||
*/
|
||||
|
||||
#define QUICKACT_THIS(iface) DEFINE_THIS(WebBrowser, QuickActivate, iface)
|
||||
|
||||
static HRESULT WINAPI QuickActivate_QueryInterface(IQuickActivate *iface,
|
||||
REFIID riid, LPVOID *ppobj)
|
||||
{
|
||||
WebBrowser *This = QUICKACT_THIS(iface);
|
||||
return IWebBrowser_QueryInterface(WEBBROWSER(This), riid, ppobj);
|
||||
}
|
||||
|
||||
static ULONG WINAPI QuickActivate_AddRef(IQuickActivate *iface)
|
||||
{
|
||||
WebBrowser *This = QUICKACT_THIS(iface);
|
||||
return IWebBrowser_AddRef(WEBBROWSER(This));
|
||||
}
|
||||
|
||||
static ULONG WINAPI QuickActivate_Release(IQuickActivate *iface)
|
||||
{
|
||||
WebBrowser *This = QUICKACT_THIS(iface);
|
||||
return IWebBrowser_Release(WEBBROWSER(This));
|
||||
}
|
||||
|
||||
static HRESULT WINAPI QuickActivate_QuickActivate(IQuickActivate *iface,
|
||||
QACONTAINER *pQaContainer, QACONTROL *pQaControl)
|
||||
{
|
||||
WebBrowser *This = QUICKACT_THIS(iface);
|
||||
FIXME("(%p)->(%p %p)\n", This, pQaContainer, pQaControl);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI QuickActivate_SetContentExtent(IQuickActivate *iface, LPSIZEL pSizel)
|
||||
{
|
||||
WebBrowser *This = QUICKACT_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, pSizel);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
static HRESULT WINAPI QuickActivate_GetContentExtent(IQuickActivate *iface, LPSIZEL pSizel)
|
||||
{
|
||||
WebBrowser *This = QUICKACT_THIS(iface);
|
||||
FIXME("(%p)->(%p)\n", This, pSizel);
|
||||
return E_NOTIMPL;
|
||||
}
|
||||
|
||||
#undef QUICKACT_THIS
|
||||
|
||||
static const IQuickActivateVtbl QuickActivateVtbl =
|
||||
{
|
||||
QuickActivate_QueryInterface,
|
||||
QuickActivate_AddRef,
|
||||
QuickActivate_Release,
|
||||
QuickActivate_QuickActivate,
|
||||
QuickActivate_SetContentExtent,
|
||||
QuickActivate_GetContentExtent
|
||||
};
|
||||
|
||||
void WebBrowser_Misc_Init(WebBrowser *This)
|
||||
{
|
||||
This->lpQuickActivateVtbl = &QuickActivateVtbl;
|
||||
}
|
||||
|
||||
/**********************************************************************
|
||||
* OpenURL (SHDOCVW.@)
|
||||
*/
|
||||
void WINAPI OpenURL(HWND hWnd, HINSTANCE hInst, LPCSTR lpcstrUrl, int nShowCmd)
|
||||
{
|
||||
FIXME("%p %p %s %d\n", hWnd, hInst, debugstr_a(lpcstrUrl), nShowCmd);
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user