shell32: Store the raw AUTHORS file in resources instead of trying to convert to a C array.

oldstable
Alexandre Julliard 2010-11-11 12:24:46 +01:00
parent f7c99379b2
commit 40977bf1d2
9 changed files with 40 additions and 21 deletions

1
.gitignore vendored
View File

@ -135,6 +135,7 @@ dlls/rpcrt4/tests/server.h
dlls/rpcrt4/tests/server_c.c
dlls/rpcrt4/tests/server_s.c
dlls/shdocvw/shdocvw_v1.tlb
dlls/shell32/AUTHORS
dlls/stdole2.tlb/std_ole_v2.tlb
dlls/stdole32.tlb/std_ole_v1.tlb
dlls/sti/sti_wia.h

View File

@ -73,6 +73,8 @@ tools/wmc tools/wrc: tools
tools tools/wmc tools/wrc: libs/wine
tools/widl tools/wmc tools/wrc: libs/wpp
dlls/shell32/Makefile dlls/shell32/__depend__: dlls/shell32/AUTHORS
$(MAKEDEP): include/config.h tools/Makefile
@cd $(TOOLSDIR)/tools && $(MAKE) makedep$(TOOLSEXT)

3
configure vendored
View File

@ -14569,6 +14569,8 @@ then
"crosstest:
@echo \"crosstest is not supported (mingw not installed?)\" && false"
fi
ac_config_links="$ac_config_links dlls/shell32/AUTHORS:AUTHORS"
wine_fn_config_symlink dlls/shell32/AUTHORS
ac_config_links="$ac_config_links dlls/wineps.drv/generic.ppd:dlls/wineps.drv/generic.ppd"
test "$srcdir" = "." || wine_fn_config_symlink dlls/wineps.drv/generic.ppd
if test "x$enable_fonts" != xno; then
@ -15962,6 +15964,7 @@ do
case $ac_config_target in
"include/config.h") CONFIG_HEADERS="$CONFIG_HEADERS include/config.h" ;;
"include/stamp-h") CONFIG_COMMANDS="$CONFIG_COMMANDS include/stamp-h" ;;
"dlls/shell32/AUTHORS") CONFIG_LINKS="$CONFIG_LINKS dlls/shell32/AUTHORS:AUTHORS" ;;
"dlls/wineps.drv/generic.ppd") CONFIG_LINKS="$CONFIG_LINKS dlls/wineps.drv/generic.ppd:dlls/wineps.drv/generic.ppd" ;;
"fonts/marlett.ttf") CONFIG_LINKS="$CONFIG_LINKS fonts/marlett.ttf:fonts/marlett.ttf" ;;
"fonts/symbol.ttf") CONFIG_LINKS="$CONFIG_LINKS fonts/symbol.ttf:fonts/symbol.ttf" ;;

View File

@ -2263,6 +2263,7 @@ AH_BOTTOM([#endif /* WINE_CROSSTEST */])
AC_CONFIG_COMMANDS([include/stamp-h], [echo timestamp > include/stamp-h])
WINE_CONFIG_SYMLINK(dlls/shell32/AUTHORS,AUTHORS)
WINE_CONFIG_SYMLINK(dlls/wineps.drv/generic.ppd)
WINE_CONFIG_SYMLINK(fonts/marlett.ttf,,enable_fonts)
WINE_CONFIG_SYMLINK(fonts/symbol.ttf,,enable_fonts)

View File

@ -1 +0,0 @@
/authors.c

View File

@ -106,14 +106,4 @@ SVG_SRCS = \
shortcut.svg \
trash_file.svg
EXTRA_OBJS = authors.o
@MAKE_DLL_RULES@
authors.c: $(top_srcdir)/AUTHORS
(LC_ALL=C; export LC_ALL; echo 'const char * const SHELL_Authors[] = {' && \
sed -e '1,2d' -e 's/\(.*\)/ \"\1\",/' $(top_srcdir)/AUTHORS && \
echo ' 0 };') >$@ || ($(RM) $@ && false)
clean::
$(RM) authors.c

View File

@ -51,8 +51,6 @@
WINE_DEFAULT_DEBUG_CHANNEL(shell);
extern const char * const SHELL_Authors[];
/*************************************************************************
* CommandLineToArgvW [SHELL32.@]
*
@ -932,6 +930,34 @@ HRESULT WINAPI SHLoadInProc (REFCLSID rclsid)
return DISP_E_MEMBERNOTFOUND;
}
static void add_authors( HWND list )
{
static const WCHAR eol[] = {'\r','\n',0};
static const WCHAR authors[] = {'A','U','T','H','O','R','S',0};
WCHAR *strW, *start, *end;
HRSRC rsrc = FindResourceW( shell32_hInstance, authors, (LPCWSTR)RT_RCDATA );
char *strA = LockResource( LoadResource( shell32_hInstance, rsrc ));
DWORD sizeW, sizeA = SizeofResource( shell32_hInstance, rsrc );
if (!strA) return;
sizeW = MultiByteToWideChar( CP_UTF8, 0, strA, sizeA, NULL, 0 ) + 1;
if (!(strW = HeapAlloc( GetProcessHeap(), 0, sizeW * sizeof(WCHAR) ))) return;
MultiByteToWideChar( CP_UTF8, 0, strA, sizeA, strW, sizeW );
strW[sizeW - 1] = 0;
start = strpbrkW( strW, eol ); /* skip the header line */
while (start)
{
while (*start && strchrW( eol, *start )) start++;
if (!*start) break;
end = strpbrkW( start, eol );
if (end) *end++ = 0;
SendMessageW( list, LB_ADDSTRING, -1, (LPARAM)start );
start = end;
}
HeapFree( GetProcessHeap(), 0, strW );
}
/*************************************************************************
* AboutDlgProc (internal)
*/
@ -952,7 +978,6 @@ static INT_PTR CALLBACK AboutDlgProc( HWND hWnd, UINT msg, WPARAM wParam,
if (info)
{
const char* const *pstr = SHELL_Authors;
SendDlgItemMessageW(hWnd, stc1, STM_SETICON,(WPARAM)info->hIcon, 0);
GetWindowTextW( hWnd, template, sizeof(template)/sizeof(WCHAR) );
sprintfW( buffer, template, info->szApp );
@ -968,13 +993,7 @@ static INT_PTR CALLBACK AboutDlgProc( HWND hWnd, UINT msg, WPARAM wParam,
hWndCtl = GetDlgItem(hWnd, IDC_ABOUT_LISTBOX);
SendMessageW( hWndCtl, WM_SETREDRAW, 0, 0 );
SendMessageW( hWndCtl, WM_SETFONT, (WPARAM)info->hFont, 0 );
while (*pstr)
{
/* authors list is in utf-8 format */
MultiByteToWideChar( CP_UTF8, 0, *pstr, -1, buffer, sizeof(buffer)/sizeof(WCHAR) );
SendMessageW( hWndCtl, LB_ADDSTRING, -1, (LPARAM)buffer );
pstr++;
}
add_authors( hWndCtl );
SendMessageW( hWndCtl, WM_SETREDRAW, 1, 0 );
}
}

View File

@ -125,3 +125,6 @@ IDR_AVI_FILENUKE AVI searching.avi
/* @makedep: searching.avi */
IDR_AVI_FILEDELETE AVI searching.avi
/* @makedep: AUTHORS */
AUTHORS RCDATA AUTHORS

View File

@ -90,6 +90,7 @@ my @ignores = (
"Makefile",
"dlldata.c",
"dlls/*/*.def",
"dlls/shell32/AUTHORS",
"*/*/tests/*crosstest.exe",
"*/*/tests/testlist.c",
"include/config.h",