- Add Russian translation

- Fixed parameters functions
- Add debug functions
- Add stubs for some functions

svn path=/trunk/; revision=33756
This commit is contained in:
Dmitry Chapyshev 2008-05-29 14:30:26 +00:00
parent e5ec2becfb
commit fa06cb862b
4 changed files with 81 additions and 30 deletions

View file

@ -0,0 +1,17 @@
LANGUAGE LANG_RUSSIAN, SUBLANG_DEFAULT
STRINGTABLE
BEGIN
IDS_APPTITLE "Программа просмотра изображений и факсов"
IDS_SETASDESKBG "Установить как фон рабочего стола"
/* Tooltips */
IDS_TOOLTIP_NEXT_PIC "Следующее изображение"
IDS_TOOLTIP_PREV_PIC "Предыдущее изображение"
IDS_TOOLTIP_ZOOM_IN "Увеличить (+)"
IDS_TOOLTIP_ZOOM_OUT "Уменьшить (-)"
IDS_TOOLTIP_ROT_CLOCKW "Повернуть по часовой стрелке (Ctrl+K)"
IDS_TOOLTIP_ROT_COUNCW "Повернуть против часовой стрелки (Ctrl+L)"
IDS_TOOLTIP_PRINT "Печать (Ctrl+P)"
IDS_TOOLTIP_SAVEAS "Сохранить как... (Ctrl+S)"
END

View file

@ -2,3 +2,4 @@
#include "resource.h"
#include "lang/en-US.rc"
#include "lang/ru-RU.rc"

View file

@ -17,6 +17,7 @@
#include <commctrl.h>
#include <gdiplus.h>
#include <tchar.h>
#include <debug.h>
#include "shimgvw.h"
@ -55,12 +56,34 @@ ImageView_DrawImage(HWND hwnd)
HDC hdc;
if (GetFileAttributesW(szOpenFileName) == 0xFFFFFFFF)
{
DPRINT1("File %s not found!\n", szOpenFileName);
return;
}
hdc = BeginPaint(hwnd, &ps);
if (!hdc)
{
DPRINT1("BeginPaint() failed\n");
return;
}
GdipCreateFromHDC(hdc, &graphics);
if (!graphics)
{
DPRINT1("GdipCreateFromHDC() failed\n");
DeleteDC(hdc);
return;
}
GdipLoadImageFromFile(szOpenFileName, &image);
if (!image)
{
DPRINT1("GdipLoadImageFromFile() failed\n");
DeleteDC(hdc);
return;
}
GdipGetImageWidth(image, &uImgWidth);
GdipGetImageHeight(image, &uImgHeight);
@ -128,9 +151,7 @@ ImageView_DrawImage(HWND hwnd)
}
}
//TCHAR szBuf[MAX_PATH];
//wsprintf(szBuf, _T("x = %d\ny = %d\nWidth = %d\nHeight = %d\n\nrect.right = %d\nrect.bottom = %d\n\nuImgWidth = %d\nuImgHeight = %d"), x, y, width, height, rect.right, rect.bottom, uImgWidth, uImgHeight);
//MessageBox(0, szBuf, NULL, MB_OK);
DPRINT1("x = %d\ny = %d\nWidth = %d\nHeight = %d\n\nrect.right = %d\nrect.bottom = %d\n\nuImgWidth = %d\nuImgHeight = %d", x, y, width, height, rect.right, rect.bottom, uImgWidth, uImgHeight);
GdipDrawImageRect(graphics, image, x, y, width, height);
}
@ -443,39 +464,51 @@ ImageView_CreateWindow(HWND hwnd, LPWSTR szFileName)
return -1;
}
LONG
CALLBACK
ImageView_FullscreenW(HWND hwnd, UINT uMsg, LPARAM lParam1, LPARAM lParam2)
VOID
ImageView_FullscreenW(HWND hwnd, HINSTANCE hInst, LPCWSTR path, int nShow)
{
return ImageView_CreateWindow(hwnd, (LPWSTR)lParam1);
ImageView_CreateWindow(hwnd, (LPWSTR)path);
}
LONG
CALLBACK
ImageView_Fullscreen(HWND hwnd, UINT uMsg, LPARAM lParam1, LPARAM lParam2)
VOID
ImageView_Fullscreen(HWND hwnd, HINSTANCE hInst, LPCWSTR path, int nShow)
{
ImageView_CreateWindow(hwnd, (LPWSTR)path);
}
VOID
ImageView_FullscreenA(HWND hwnd, HINSTANCE hInst, LPCSTR path, int nShow)
{
WCHAR szFile[MAX_PATH];
if (MultiByteToWideChar(CP_ACP, 0, (char*)lParam1, strlen((char*)lParam1)+1, szFile, MAX_PATH))
if (MultiByteToWideChar(CP_ACP, 0, (char*)path, strlen((char*)path)+1, szFile, MAX_PATH))
{
return ImageView_CreateWindow(hwnd, (LPWSTR)szFile);
ImageView_CreateWindow(hwnd, (LPWSTR)szFile);
}
}
return -1;
VOID
ImageView_PrintTo(HWND hwnd, HINSTANCE hInst, LPCWSTR path, int nShow)
{
DPRINT("ImageView_PrintTo() not implemented\n");
}
LONG
CALLBACK
ImageView_FullscreenA(HWND hwnd, UINT uMsg, LPARAM lParam1, LPARAM lParam2)
VOID
ImageView_PrintToA(HWND hwnd, HINSTANCE hInst, LPCSTR path, int nShow)
{
WCHAR szFile[MAX_PATH];
if (MultiByteToWideChar(CP_ACP, 0, (char*)lParam1, strlen((char*)lParam1)+1, szFile, MAX_PATH))
{
return ImageView_CreateWindow(hwnd, (LPWSTR)szFile);
DPRINT("ImageView_PrintToA() not implemented\n");
}
return -1;
VOID
ImageView_PrintToW(HWND hwnd, HINSTANCE hInst, LPCWSTR path, int nShow)
{
DPRINT("ImageView_PrintToW() not implemented\n");
}
VOID
imageview_fullscreenW(HWND hwnd, HINSTANCE hInst, LPCWSTR path, int nShow)
{
DPRINT("ImageView_fullscreenW() not implemented\n");
}
BOOL WINAPI

View file

@ -1,11 +1,11 @@
@ stub ImageView_COMServer
@ stdcall ImageView_Fullscreen(ptr long ptr ptr)
@ stdcall ImageView_FullscreenA(ptr long ptr ptr)
@ stdcall ImageView_FullscreenW(ptr long ptr ptr)
@ stub ImageView_PrintTo
@ stub ImageView_PrintToA
@ stub ImageView_PrintToW
@ stub imageview_fullscreenW
@ stdcall ImageView_Fullscreen(ptr ptr wstr long)
@ stdcall ImageView_FullscreenA(ptr ptr str long)
@ stdcall ImageView_FullscreenW(ptr ptr wstr long)
@ stdcall ImageView_PrintTo(ptr ptr wstr long)
@ stdcall ImageView_PrintToA(ptr ptr str long)
@ stdcall ImageView_PrintToW(ptr ptr wstr long)
@ stdcall imageview_fullscreenW(ptr ptr wstr long)
@ stub ConvertDIBSECTIONToThumbnail
@ stub DllCanUnloadNow
@ stub DllGetClassObject