Re: mshtml.dll:Add implementation of HTMLDocument_(Get|Set)Title

2008-07-09 Thread Ivan Sinitsin
В сообщении от Friday 04 July 2008 19:23:32 вы написали:
 Ivan Sinitsin wrote:
  Changelog:
  mshtml.dll:Add implementation of HTMLDocument_(Get|Set)Title

 First of all it would be nice if you could add a test case for these.

Hi, 

I make test for HTMLDocument_(Get|Set)Title.
What do you think about it? Is it right?

On IE it - ok, but Gecko - failed.


 Jacek

--
Sinitsin Ivan
From 1456122d0ec239b1e34bc409c560f0da4ce39f2a Mon Sep 17 00:00:00 2001
From: Sinitsin Ivan [EMAIL PROTECTED]
Date: Wed, 9 Jul 2008 17:16:38 +0400
Subject: [PATCH] add test for HTMLDocument_(Get|Put)Title

---
 dlls/mshtml/tests/htmldoc.c |   27 +++
 1 files changed, 27 insertions(+), 0 deletions(-)

diff --git a/dlls/mshtml/tests/htmldoc.c b/dlls/mshtml/tests/htmldoc.c
index 4de5286..1eecb59 100644
--- a/dlls/mshtml/tests/htmldoc.c
+++ b/dlls/mshtml/tests/htmldoc.c
@@ -3664,6 +3664,32 @@ static void test_external(IUnknown *unk, BOOL 
initialized)
 IHTMLWindow2_Release(htmlwin);
 }
 
+static void test_Title(IUnknown *unk)
+{
+IHTMLDocument2 *htmldoc;
+BSTR ptitle, gtitle;
+const WCHAR title[] = {
+'H','T','M','L',' ','T','i','t','l','e',0};
+HRESULT hres;
+
+hres = IUnknown_QueryInterface(unk, IID_IHTMLDocument2, (void**)htmldoc);
+ok(hres == S_OK, QueryInterface(IID_IHTMLWindow2) failed: %08x\n, hres);
+
+ptitle = SysAllocString(title);
+
+hres = IHTMLDocument2_put_title(htmldoc, ptitle);
+ok(hres == S_OK, put_Title failed: %08x\n, hres);
+
+hres = IHTMLDocument2_get_title(htmldoc, gtitle);
+ok(hres == S_OK, get_Title failed: %08x\n, hres);
+
+ok(!lstrcmpiW(ptitle, gtitle), title not equal \n);
+
+SysFreeString(ptitle);
+SysFreeString(gtitle);
+IHTMLDocument2_Release(htmldoc);
+}
+
 static void test_StreamLoad(IUnknown *unk)
 {
 IPersistStreamInit *init;
@@ -3785,6 +3811,7 @@ static void test_HTMLDocument(BOOL do_load)
 test_OnAmbientPropertyChange(unk);
 test_Window(unk, TRUE);
 test_external(unk, TRUE);
+if (do_load) test_Title(unk);
 
 test_UIDeactivate();
 test_OleCommandTarget(unk);
-- 
1.5.4.5.GIT




Question about openning html document in new window

2008-04-21 Thread Ivan Sinitsin
Hello, I have a question.

I make a patch, that fix problem with open html document in new window. I 
tested it on MyIE 2 and it works. But I am not assured, whether it is 
possible to solve a problem in this way.

What do you think about it?

-- 
Sinitsin Ivan
Index: dlls/shdocvw/navigate.c
===
RCS file: /home/wine/wine/dlls/shdocvw/navigate.c,v
retrieving revision 1.51
diff -u -p -u -r1.51 navigate.c
--- dlls/shdocvw/navigate.c	15 Mar 2008 10:55:26 -	1.51
+++ dlls/shdocvw/navigate.c	21 Apr 2008 06:45:56 -
@@ -844,8 +844,9 @@ static HRESULT WINAPI HlinkFrame_Navigat
 /* Windows calls GetHlinkSite here */
 
 if(grfHLNF  HLNF_OPENINNEWWINDOW) {
-FIXME(Not supported HLNF_OPENINNEWWINDOW\n);
-return E_NOTIMPL;
+static const WCHAR wszBlank[] = {'_','b','l','a','n','k',0};
+IHlink_SetTargetFrameName(pihlNavigate, wszBlank); 
+return IHlink_Navigate(pihlNavigate, grfHLNF, pbc, pibsc, phbc);
 }
 
 return navigate_hlink(This-doc_host, mon, pbc, pibsc);



Re: Question about function HTMLDocument_write

2008-03-13 Thread Ivan Sinitsin

 What do you mean by hyperlinks don't work?

I have such code which create html page:

htmlDoc2-lpVtbl-open(htmlDoc2, Lhtml/txt, vnull, vnull, vnull, pdisp);
bstr =SysAllocString(Lhtmlhead/headbodypSimple text/p);
if ((pVar-bstrVal = bstr)) {
 htmlDoc2-lpVtbl-write(htmlDoc2, sfArray);
}
SysFreeString(bstr);
bstr = SysAllocString(Lbra href='http://www.yandex.ru'Link to the 
Yandex);
if ((pVar-bstrVal = bstr)) {
  htmlDoc2-lpVtbl-write(htmlDoc2, sfArray);
}
SysFreeString(bstr);
bstr = SysAllocString(L/abrEnd of document/body/html);
if ((pVar-bstrVal = bstr)) {
  htmlDoc2-lpVtbl-write(htmlDoc2, sfArray);
}
SysFreeString(bstr);
htmlDoc2-lpVtbl-close(htmlDoc2);

After creation of page, I try to click on a hyperlink, but nothing occurs.

When I used my patch, hyperlink works good.


 As I've explained in comment to your patch, this implementation is wrong.

I do not speak, that my patch better than yours or my patch is right. I only 
want  to understand, why so occurs and where to look?


 Jacek

-- 
Sinitsin Ivan




Question about function HTMLDocument_write

2008-03-11 Thread Ivan Sinitsin
On Monday the patch realizing this function has been accepted. It works 
perfectly, but hyperlinks do not work.
If I makes this function that way:

static HRESULT WINAPI HTMLDocument_write(IHTMLDocument2 *iface, SAFEARRAY 
*psarray)
{
HRESULT hres;
VARIANT *pvar;
IHTMLElement *pbody;
BSTR vtext;
int i;

vtext = SysAllocString(L);

HTMLDocument_get_body(iface,pbody);

hres = IHTMLElement_get_innerHTML(pbody, vtext);
if (FAILED(hres)) {
vtext = SysAllocString(L);
}

hres=SafeArrayAccessData(psarray, (void **)pvar);
if (FAILED(hres)) return hres;
for (i=0; i  psarray-rgsabound[0].cElements; i++) {
hres = VarBstrCat(vtext, V_BSTR((pvar[i])), vtext);
if (FAILED(hres)) {
   break;
}
}

IHTMLElement_put_innerHTML(pbody,vtext);
SysFreeString(vtext);
hres = SafeArrayUnaccessData(psarray);

return S_OK;
}

hyperlinks works good.

Why so occurs?




problem with widl.

2008-01-18 Thread Ivan Sinitsin
I have a question about widl.

tools\widl\header.cfunction write_method_macro

  fprintf(header, #define %s_, name);
  write_name(header,def);
  fprintf(header, (p);
  for (c=0; cargc; c++)
fprintf(header, ,%c, c+'a');
  fprintf(header, ) );

  fprintf(header, (p)-lpVtbl-);
  write_name(header, def);
  fprintf(header, (p);
  for (c=0; cargc; c++)
fprintf(header, ,%c, c+'a');
  fprintf(header, )\n);

This code wrong, because if my function have more then 16 parameters I receive 
something like this:

 #define Imyinterface_Open(p,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q 
(p)-lpVtbl-Open(p,a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q)

and the compiler gives out a mistake 

 library.h:1296:63: duplicate macro parameter p

I think that this code should be like this:
Variant 1.
  int p=0;
  for (c=0; cargc; c++) {
if (p==15) p++;
fprintf(header, ,%c, p+'a');
p++;
  }
  fprintf(header, ) );

  fprintf(header, (p)-lpVtbl-);
  write_name(header, def);
  fprintf(header, (p);
  p=0;
  for (c=0; cargc; c++) {
if (p==15) p++;
fprintf(header, ,%c, p+'a');
p++;
  }
  fprintf(header, )\n);

or
Variant 2. (Without cycles)
 char str[] = 
{'p',',','a',',','b',',','c',',','d',',','e',',','f',',','g',',','h',',','i',',','j',',','k',',','l',',','m',',','o',',','q',',','r',',','s',',','t',',','u',',','v',',','w',',','x',',','y',',','z',',',0};

  str[2*argc+1] = 0;
  fprintf(header, #define %s_, name);
  write_name(header,def);
  fprintf(header,();
  fprintf(header,%s,str);
  fprintf(header, ) );

  fprintf(header, (p)-lpVtbl-);
  write_name(header, def);
  fprintf(header,();
  fprintf(header,%s,str);
  fprintf(header, )\n);

What do you think about that?

 
Sinitsin Ivan




Re: try2:winefile:Save font settings for registry

2007-12-20 Thread Ivan Sinitsin
В сообщении от Thursday 20 December 2007 15:28:32 вы написали:
 Ivan Sinitsin [EMAIL PROTECTED] wrote:
  + if( RegQueryValueExW( hKey, reg_logfont, NULL, type,
  +  (LPBYTE) logfont, size ) !=
  ERROR_SUCCESS ) { +  hFont=GetStockObject(DEFAULT_GUI_FONT);
  +  GetObject(hFont,sizeof(logfont),logfont);
  +}

 There is no need to introduce the hFont variable.

  + GetObject(Globals.hfont, sizeof(logfont), logfont);

 To make the code more readable this call should be moved where logfont
 is actually used.

  +RegSetValueExW( hKey, reg_logfont, 0, REG_DWORD,
  +(LPBYTE) logfont, sizeof(LOGFONT) );

 The type should be set to REG_BINARY.

I have corrected the mistakes.
Do I understand you right?

--
Sinitsin Ivan
Index: programs/winefile/winefile.c
===
RCS file: /home/wine/wine/programs/winefile/winefile.c,v
retrieving revision 1.81
diff -u -p -u -r1.81 winefile.c
--- programs/winefile/winefile.c	26 Jul 2007 11:38:42 -	1.81
+++ programs/winefile/winefile.c	20 Dec 2007 12:53:23 -
@@ -66,6 +66,7 @@ static const WCHAR reg_start_x[] = { 's'
 static const WCHAR reg_start_y[] = { 's','t','a','r','t','Y','\0'};
 static const WCHAR reg_width[] = { 'w','i','d','t','h','\0'};
 static const WCHAR reg_height[] = { 'h','e','i','g','h','t','\0'};
+static const WCHAR reg_logfont[] = { 'l','o','g','f','o','n','t','\0'};
 
 enum ENTRY_TYPE {
 	ET_WINDOWS,
@@ -1645,6 +1646,7 @@ static windowOptions load_registry_setti
 	DWORD type;
 	HKEY hKey;
 	windowOptions opts;
+	LOGFONT logfont;
 
 RegOpenKeyExW( HKEY_CURRENT_USER, registry_key,
0, KEY_QUERY_VALUE, hKey );
@@ -1666,9 +1668,14 @@ static windowOptions load_registry_setti
 if( RegQueryValueExW( hKey, reg_height, NULL, type,
   (LPBYTE) opts.height, size ) != ERROR_SUCCESS )
 		opts.height = CW_USEDEFAULT;
+	size=sizeof(logfont);
+	if( RegQueryValueExW( hKey, reg_logfont, NULL, type,
+  (LPBYTE) logfont, size ) != ERROR_SUCCESS )
+		GetObject(GetStockObject(DEFAULT_GUI_FONT),sizeof(logfont),logfont);
 
 	RegCloseKey( hKey );
 
+	Globals.hfont = CreateFontIndirect(logfont);
 	return opts;
 }
 
@@ -1677,6 +1684,7 @@ static void save_registry_settings(void)
 	WINDOWINFO wi;
 	HKEY hKey;
 	INT width, height;
+	LOGFONT logfont;
 
 	wi.cbSize = sizeof( WINDOWINFO );
 	GetWindowInfo(Globals.hMainWnd, wi);
@@ -1704,6 +1712,9 @@ static void save_registry_settings(void)
 (LPBYTE) width, sizeof(DWORD) );
 RegSetValueExW( hKey, reg_height, 0, REG_DWORD,
 (LPBYTE) height, sizeof(DWORD) );
+GetObject(Globals.hfont, sizeof(logfont), logfont);
+RegSetValueExW( hKey, reg_logfont, 0, REG_BINARY,
+(LPBYTE) logfont, sizeof(LOGFONT) );
 
 	/* TODO: Save more settings here (List vs. Detailed View, etc.) */
 	RegCloseKey( hKey );



Re: try2:patch for sysparams.c

2007-08-30 Thread Ivan Sinitsin
В сообщении от Thursday 30 August 2007 12:44:15 вы написали:

   Sorry, but purpose of your patch is unclear to me. In your changelog 
 field
 you tell that This patch does a font for the menu, statusbar and messages
 dependent from logpixels but as far as I know WINE already have correct
 behavior and respects the LogPixels value (it already sets correct size in
 menu, status bar and other GUI elements). This is why I'm asking you for an
 real-world example (with real-world application) of what you are trying to
 fix.

   P.S. Don't forget to reply to wine-devel so others can see the 
 discussion.

This is Screenshot of 1С programm under wine without my patch with option Too 
large. We can view that font menu and font of other GUI elements is 
diffrent.

Test case probably would be nice thing.
ok. I think about it.

attachment: 27.png


Re: comdlg32-colordlg fix bgcolor

2007-02-02 Thread Ivan Sinitsin
В сообщении от 1 февраля 2007 07:00 Dmitry Timoshkov написал(a):
 Ivan Sinitsin [EMAIL PROTECTED] wrote:
  The patch corrects background color of a dialogue window  Choose color 
  at copying a triangular marker, the user colors and the predetermined
  colors. Earlier the background about these elements was more dark than
  the basic background of a window.
 
  +   SetClassLongPtrW( hwnd, GCLP_HBRBACKGROUND, (LONG_PTR)
  GetSysColorBrush(COLOR_BTNFACE));

 This fix is not correct, think for instance about different color themes.
 Probably CC_PaintTriangle needs to specify the background color of a
 triangle explicitly.

This line obviously sets color (considering the current scheme), it transfers 
as a background current system color of the scheme for display of a 
background of elements of management. Has checked up, at change of color 
schemes - dialogue is displayed correctly.