60static const WCHAR var_pagemargin[] = {
'P',
'a',
'g',
'e',
'M',
'a',
'r',
'g',
'i',
'n',0};
61static const WCHAR var_previewpages[] = {
'P',
'r',
'e',
'v',
'i',
'e',
'w',
'P',
'a',
'g',
'e',
's',0};
66 const WCHAR files_prn[] = {
'*',
'.',
'P',
'R',
'N',0};
67 const WCHAR files_all[] = {
'*',
'.',
'*',
'\0'};
82 return wszPrintFilter;
246 static WCHAR file[
MAX_PATH] = {
'O',
'U',
'T',
'P',
'U',
'T',
'.',
'P',
'R',
'N',0};
247 static const WCHAR defExt[] = {
'P',
'R',
'N',0};
248 static LPWSTR file_filter;
309 int i,
x,
y, RulerTextEnd;
313 WCHAR FontName[] = {
'M',
'S',
' ',
'S',
'a',
'n',
's',
' ',
'S',
'e',
'r',
'i',
'f',0};
324 QuarterCmPixels = (
int)((
float)CmPixels / 4.0);
330 hFont =
CreateFontW(10, 6, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, FontName);
335 y = (
int)(((
float)drawRect->
bottom - (
float)drawRect->
top) / 2.0) + 1;
336 RulerTextEnd = drawRect->
right - EditLeftmost + 1;
337 for(
i = 1,
x = EditLeftmost;
x < (drawRect->
right - EditLeftmost + 1);
i ++)
343 x2 += QuarterCmPixels;
344 if(
x2 > RulerTextEnd)
350 x2 += QuarterCmPixels;
351 if(
x2 > RulerTextEnd)
357 x2 += QuarterCmPixels;
358 if(
x2 > RulerTextEnd)
389 drawRect.
left = EditLeftmost;
413 static LONG EditLeftmost;
414 static BOOL NewMetrics;
443 int printedPages = 0;
658 float ratio, ratioHeight, ratioWidth;
669 if(ratioWidth > ratioHeight)
675 ratio += (1.0 - ratio) / 2;
798 if (!new_buffer)
return;
833 HRGN back_rgn, excl_rgn;
908 static const WCHAR fmt[] = {
' ',
'%',
'd',
'\0'};
912 static const WCHAR fmt[] = {
' ',
'%',
'd',
'-',
'%',
'd',
'\0'};
1103 if (si.
nPos != origPos)
1105 int amount = origPos - si.
nPos;
static void update_preview_sizes(HWND hwndPreview, BOOL zoomLevelUpdated)
static void preview_bar_show(HWND hMainWnd, BOOL show)
static LONG twips_to_pixels(int twips, int dpi)
void redraw_ruler(HWND hRulerWnd)
void print_quick(HWND hMainWnd, LPWSTR wszFileName)
static previewinfo preview
LRESULT CALLBACK ruler_proc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
static int preview_page_hittest(POINT pt)
void get_default_printer_opts(void)
static void update_preview(HWND hMainWnd)
static void char_from_pagenum(HWND hEditorWnd, FORMATRANGE *fr, int page)
void target_device(HWND hMainWnd, DWORD wordWrap)
static LPWSTR get_print_file_filter(HWND hMainWnd)
static LONG twips_to_centmm(int twips)
static void draw_margin_lines(HDC hdc, int x, int y, float ratio)
static void update_preview_scrollbars(HWND hwndPreview, RECT *window)
void dialog_printsetup(HWND hMainWnd)
static void print(LPPRINTDLGW pd, LPWSTR wszFileName)
struct _previewinfo * ppreviewinfo
void registry_read_previewpages(HKEY hKey)
static void draw_preview(HWND hEditorWnd, FORMATRANGE *lpFr, RECT *paper, int page)
static LRESULT print_preview(HWND hwndPreview)
struct _previewinfo previewinfo
void init_preview(HWND hMainWnd, LPWSTR wszFileName)
static BOOL is_last_preview_page(int page)
static LONG centmm_to_twips(int mm)
static void toggle_num_pages(HWND hMainWnd)
const WCHAR wszPreviewWndClass[]
void registry_read_pagemargins(HKEY hKey)
static void paint_ruler(HWND hWnd, LONG EditLeftmost, BOOL NewMetrics)
void registry_set_previewpages(HKEY hKey)
static void AddTextButton(HWND hRebarWnd, UINT string, UINT command, UINT id)
static void add_ruler_units(HDC hdcRuler, RECT *drawRect, BOOL NewMetrics, LONG EditLeftmost)
static RECT get_print_rect(HDC hdc)
static void update_preview_statusbar(HWND hMainWnd)
static const WCHAR var_pagemargin[]
BOOL preview_isactive(void)
void dialog_print(HWND hMainWnd, LPWSTR wszFileName)
static const int min_spacing
static void update_ruler(HWND hRulerWnd)
static void update_preview_buttons(HWND hMainWnd)
static HWND get_ruler_wnd(HWND hMainWnd)
static LONG devunits_to_twips(int units, int dpi)
LRESULT preview_command(HWND hWnd, WPARAM wParam)
void registry_set_pagemargins(HKEY hKey)
LRESULT CALLBACK preview_proc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
void close_preview(HWND hMainWnd)
static LPWSTR dialog_print_to_file(HWND hMainWnd)
static const WCHAR var_previewpages[]
static WCHAR wszFileName[MAX_PATH]
#define OFN_OVERWRITEPROMPT
#define PD_USEDEVMODECOPIESANDCOLLATE
#define PSD_INHUNDREDTHSOFMILLIMETERS
#define OFN_PATHMUSTEXIST
LONG WINAPI RegSetValueExW(_In_ HKEY hKey, _In_ LPCWSTR lpValueName, _In_ DWORD Reserved, _In_ DWORD dwType, _In_ CONST BYTE *lpData, _In_ DWORD cbData)
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
BOOL WINAPI GetSaveFileNameW(LPOPENFILENAMEW ofn)
BOOL WINAPI PrintDlgW(LPPRINTDLGW lppd)
BOOL WINAPI PageSetupDlgW(LPPAGESETUPDLGW setupdlg)
#define HeapFree(x, y, z)
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
unsigned short(__cdecl typeof(TIFFCurrentDirectory))(struct tiff *)
static VOID BitBlt(_In_ ULONG Left, _In_ ULONG Top, _In_ ULONG Width, _In_ ULONG Height, _In_reads_bytes_(Delta *Height) PUCHAR Buffer, _In_ ULONG BitsPerPixel, _In_ ULONG Delta)
GLint GLint GLint GLint GLint x
GLint GLint GLint GLint GLint GLint y
GLint GLint GLsizei GLsizei height
GLint GLint GLsizei width
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
LPVOID NTAPI GlobalLock(HGLOBAL hMem)
BOOL NTAPI GlobalUnlock(HGLOBAL hMem)
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
static IHTMLWindow2 * window
static float(__cdecl *square_half_float)(float x
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
INT WINAPI MulDiv(INT nNumber, INT nNumerator, INT nDenominator)
#define REBARBANDINFOW_V6_SIZE
#define RBBS_VARIABLEHEIGHT
#define EM_GETTEXTLENGTHEX
#define EM_SETTARGETDEVICE
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG _In_ LONG x2
HGDIOBJ WINAPI GetStockObject(_In_ int)
int WINAPI EndPage(_In_ HDC)
int WINAPI GetDeviceCaps(_In_opt_ HDC, _In_ int)
UINT WINAPI SetTextAlign(_In_ HDC, _In_ UINT)
HGDIOBJ WINAPI GetCurrentObject(_In_ HDC, _In_ UINT)
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
BOOL WINAPI MoveToEx(_In_ HDC, _In_ int, _In_ int, _Out_opt_ LPPOINT)
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
int WINAPI EndDoc(_In_ HDC)
int WINAPI CombineRgn(_In_opt_ HRGN hrgnDest, _In_opt_ HRGN hrgnSrc1, _In_opt_ HRGN hrgnSrc2, _In_ int fnCombineMode)
BOOL WINAPI StretchBlt(_In_ HDC, _In_ int, _In_ int, _In_ int, _In_ int, _In_opt_ HDC, _In_ int, _In_ int, _In_ int, _In_ int, _In_ DWORD)
int WINAPI StartPage(_In_ HDC)
int WINAPI StartDocW(_In_ HDC, _In_ const DOCINFOW *)
HFONT WINAPI CreateFontW(_In_ int, _In_ int, _In_ int, _In_ int, _In_ int, _In_ DWORD, _In_ DWORD, _In_ DWORD, _In_ DWORD, _In_ DWORD, _In_ DWORD, _In_ DWORD, _In_ DWORD, _In_opt_ LPCWSTR)
HBITMAP WINAPI CreateCompatibleBitmap(_In_ HDC hdc, _In_ INT cx, _In_ INT cy)
int WINAPI FillRgn(_In_ HDC, _In_ HRGN, _In_ HBRUSH)
BOOL WINAPI TextOutW(_In_ HDC hdc, _In_ int x, _In_ int y, _In_reads_(c) LPCWSTR lpString, _In_ int c)
int WINAPI FillRect(HDC, LPCRECT, HBRUSH)
BOOL WINAPI Rectangle(_In_ HDC, _In_ int, _In_ int, _In_ int, _In_ int)
int WINAPI SetBkMode(_In_ HDC, _In_ int)
HRGN WINAPI CreateRectRgnIndirect(_In_ LPCRECT)
BOOL WINAPI DeleteDC(_In_ HDC)
HPEN WINAPI CreatePen(_In_ int, _In_ int, _In_ COLORREF)
BOOL WINAPI SetRectRgn(_In_ HRGN, _In_ int, _In_ int, _In_ int, _In_ int)
BOOL WINAPI LineTo(_In_ HDC, _In_ int, _In_ int)
HDC WINAPI CreateDCW(_In_opt_ LPCWSTR pszDriver, _In_opt_ LPCWSTR pszDevice, _In_opt_ LPCWSTR psz, _In_opt_ const DEVMODEW *pdmInit)
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
DWORD WINAPI GetMessagePos(void)
LRESULT WINAPI DefWindowProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
BOOL WINAPI PostMessageW(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
int WINAPIV wsprintfW(_Out_ LPWSTR, _In_ _Printf_format_string_ LPCWSTR,...)
HBRUSH WINAPI GetSysColorBrush(_In_ int)
HCURSOR WINAPI SetCursor(_In_opt_ HCURSOR)
HCURSOR WINAPI LoadCursorW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
int WINAPI SetScrollPos(_In_ HWND, _In_ int, _In_ int, _In_ BOOL)
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
BOOL WINAPI SetWindowTextW(_In_ HWND, _In_opt_ LPCWSTR)
BOOL WINAPI PtInRect(_In_ LPCRECT, _In_ POINT)
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
BOOL WINAPI DrawEdge(_In_ HDC, _Inout_ LPRECT, _In_ UINT, _In_ UINT)
HWND WINAPI CreateWindowExW(_In_ DWORD dwExStyle, _In_opt_ LPCWSTR lpClassName, _In_opt_ LPCWSTR lpWindowName, _In_ DWORD dwStyle, _In_ int X, _In_ int Y, _In_ int nWidth, _In_ int nHeight, _In_opt_ HWND hWndParent, _In_opt_ HMENU hMenu, _In_opt_ HINSTANCE hInstance, _In_opt_ LPVOID lpParam)
BOOL WINAPI EndPaint(_In_ HWND, _In_ const PAINTSTRUCT *)
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
HDC WINAPI GetDC(_In_opt_ HWND)
#define CreateWindowW(a, b, c, d, e, f, g, h, i, j, k)
HWND WINAPI GetParent(_In_ HWND)
BOOL WINAPI OffsetRect(_Inout_ LPRECT, _In_ int, _In_ int)
int WINAPI SetScrollInfo(_In_ HWND, _In_ int, _In_ LPCSCROLLINFO, _In_ BOOL)
int WINAPI GetScrollPos(_In_ HWND, _In_ int)
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)
#define MAKEINTRESOURCEW(i)
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
HDC WINAPI BeginPaint(_In_ HWND, _Out_ LPPAINTSTRUCT)
BOOL WINAPI InflateRect(_Inout_ LPRECT, _In_ int, _In_ int)
LRESULT WINAPI CallWindowProcW(_In_ WNDPROC, _In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
BOOL WINAPI GetScrollInfo(_In_ HWND, _In_ int, _Inout_ LPSCROLLINFO)
BOOL WINAPI DestroyWindow(_In_ HWND)
BOOL WINAPI ScrollWindow(_In_ HWND, _In_ int, _In_ int, _In_opt_ LPCRECT, _In_opt_ LPCRECT)
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
BOOL WINAPI SetRect(_Out_ LPRECT, _In_ int, _In_ int, _In_ int, _In_ int)
BOOL WINAPI ScreenToClient(_In_ HWND, _Inout_ LPPOINT)
#define ID_PREVIEW_NEXTPAGE
#define STRING_PRINTER_FILES_PRN
#define STRING_PREVIEW_PRINT
#define BANDID_PREVIEW_BTN7
#define STRING_PREVIEW_PAGES
#define ID_PREVIEW_NUMPAGES
#define BANDID_PREVIEW_BUFFER
#define BANDID_PREVIEW_BTN4
#define STRING_PREVIEW_TWOPAGES
#define STRING_PREVIEW_NEXTPAGE
#define STRING_PREVIEW_CLOSE
#define BANDID_PREVIEW_BTN6
#define STRING_PREVIEW_PREVPAGE
#define STRING_PREVIEW_ONEPAGE
#define BANDID_PREVIEW_BTN3
#define ID_PREVIEW_ZOOMOUT
#define BANDID_PREVIEW_BTN5
#define STRING_PREVIEW_ZOOMOUT
#define ID_PREVIEW_ZOOMIN
#define ID_WORDWRAP_MARGIN
#define STRING_PREVIEW_ZOOMIN
#define BANDID_PREVIEW_BTN1
#define BANDID_PREVIEW_BTN2
#define STRING_PREVIEW_PAGE
#define ID_PREVIEW_PREVPAGE