60 static const WCHAR var_pagemargin[] = {
'P',
'a',
'g',
'e',
'M',
'a',
'r',
'g',
'i',
'n',0};
61 static 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;
HGDIOBJ WINAPI GetStockObject(_In_ int)
int WINAPIV wsprintfW(_Out_ LPWSTR, _In_ _Printf_format_string_ LPCWSTR,...)
static void char_from_pagenum(HWND hEditorWnd, FORMATRANGE *fr, int page)
void redraw_ruler(HWND hRulerWnd)
int WINAPI CombineRgn(_In_opt_ HRGN hrgnDest, _In_opt_ HRGN hrgnSrc1, _In_opt_ HRGN hrgnSrc2, _In_ int fnCombineMode)
#define ID_WORDWRAP_MARGIN
static WCHAR wszFileName[MAX_PATH]
struct _previewinfo * ppreviewinfo
GLint GLint GLsizei width
static void preview_bar_show(HWND hMainWnd, BOOL show)
BOOL WINAPI InflateRect(_Inout_ LPRECT, _In_ int, _In_ int)
HPEN WINAPI CreatePen(_In_ int, _In_ int, _In_ COLORREF)
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)
static void draw_preview(HWND hEditorWnd, FORMATRANGE *lpFr, RECT *paper, int page)
int WINAPI FillRgn(_In_ HDC, _In_ HRGN, _In_ HBRUSH)
static LONG twips_to_centmm(int twips)
void dialog_print(HWND hMainWnd, LPWSTR wszFileName)
#define BANDID_PREVIEW_BTN7
#define PSD_INHUNDREDTHSOFMILLIMETERS
static RECT get_print_rect(HDC hdc)
BOOL WINAPI OffsetRect(_Inout_ LPRECT, _In_ int, _In_ int)
#define STRING_PREVIEW_PREVPAGE
BOOL WINAPI Rectangle(_In_ HDC, _In_ int, _In_ int, _In_ int, _In_ int)
HDC WINAPI GetDC(_In_opt_ HWND)
HBITMAP WINAPI CreateCompatibleBitmap(_In_ HDC hdc, _In_ INT cx, _In_ INT cy)
void dialog_printsetup(HWND hMainWnd)
#define BANDID_PREVIEW_BTN3
#define STRING_PRINTER_FILES_PRN
HRGN WINAPI CreateRectRgnIndirect(_In_ LPCRECT)
static LONG devunits_to_twips(int units, int dpi)
#define STRING_PREVIEW_PAGE
HGDIOBJ WINAPI SelectObject(_In_ HDC, _In_ HGDIOBJ)
BOOL WINAPI DeleteObject(_In_ HGDIOBJ)
BOOL WINAPI LineTo(_In_ HDC, _In_ int, _In_ int)
GLint GLint GLint GLint GLint x
#define STRING_PREVIEW_PAGES
HDC WINAPI CreateCompatibleDC(_In_opt_ HDC hdc)
BOOL WINAPI SetWindowTextW(_In_ HWND, _In_opt_ LPCWSTR)
void close_preview(HWND hMainWnd)
DWORD WINAPI GetMessagePos(void)
BOOL WINAPI EndPaint(_In_ HWND, _In_ const PAINTSTRUCT *)
UINT WINAPI SetTextAlign(_In_ HDC, _In_ UINT)
INT WINAPI MulDiv(INT nNumber, INT nNumerator, INT nDenominator)
BOOL WINAPI DestroyWindow(_In_ HWND)
int WINAPI LoadStringW(_In_opt_ HINSTANCE hInstance, _In_ UINT uID, _Out_writes_to_(cchBufferMax, return+1) LPWSTR lpBuffer, _In_ int cchBufferMax)
#define CreateWindowW(a, b, c, d, e, f, g, h, i, j, k)
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 EndPage(_In_ HDC)
GLint GLint GLsizei GLsizei GLsizei GLint GLenum format
BOOL WINAPI GetSaveFileNameW(LPOPENFILENAMEW ofn)
LRESULT WINAPI DefWindowProcW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define BANDID_PREVIEW_BTN1
BOOL WINAPI ScrollWindow(_In_ HWND, _In_ int, _In_ int, _In_opt_ LPCRECT, _In_opt_ LPCRECT)
int WINAPI StartPage(_In_ HDC)
#define REBARBANDINFOW_V6_SIZE
BOOL WINAPI MoveToEx(_In_ HDC, _In_ int, _In_ int, _Out_opt_ LPPOINT)
#define STRING_PREVIEW_ONEPAGE
unsigned short(__cdecl typeof(TIFFCurrentDirectory))(struct tiff *)
int WINAPI SetBkMode(_In_ HDC, _In_ int)
static void AddTextButton(HWND hRebarWnd, UINT string, UINT command, UINT id)
#define PD_USEDEVMODECOPIESANDCOLLATE
static BOOL is_last_preview_page(int page)
#define BANDID_PREVIEW_BUFFER
static const int min_spacing
void registry_set_previewpages(HKEY hKey)
HDC WINAPI BeginPaint(_In_ HWND, _Out_ LPPAINTSTRUCT)
BOOL WINAPI DrawEdge(_In_ HDC, _Inout_ LPRECT, _In_ UINT, _In_ UINT)
static void draw_margin_lines(HDC hdc, int x, int y, float ratio)
static void add_ruler_units(HDC hdcRuler, RECT *drawRect, BOOL NewMetrics, LONG EditLeftmost)
int WINAPI ReleaseDC(_In_opt_ HWND, _In_ HDC)
BOOL WINAPI PrintDlgW(LPPRINTDLGW lppd)
LRESULT CALLBACK ruler_proc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
static LPWSTR dialog_print_to_file(HWND hMainWnd)
const WCHAR wszPreviewWndClass[]
BOOL preview_isactive(void)
#define ID_PREVIEW_NUMPAGES
#define RBBS_VARIABLEHEIGHT
#define OFN_PATHMUSTEXIST
static void update_preview(HWND hMainWnd)
#define BANDID_PREVIEW_BTN4
static LONG centmm_to_twips(int mm)
BOOL WINAPI SetRectRgn(_In_ HRGN, _In_ int, _In_ int, _In_ int, _In_ int)
LONG WINAPI RegSetValueExW(_In_ HKEY hKey, _In_ LPCWSTR lpValueName, _In_ DWORD Reserved, _In_ DWORD dwType, _In_ CONST BYTE *lpData, _In_ DWORD cbData)
BOOL WINAPI PageSetupDlgW(LPPAGESETUPDLGW setupdlg)
static void update_ruler(HWND hRulerWnd)
#define EM_SETTARGETDEVICE
PVOID WINAPI HeapAlloc(HANDLE, DWORD, SIZE_T)
int WINAPI StartDocW(_In_ HDC, _In_ const DOCINFOW *)
LONG WINAPI RegQueryValueExW(_In_ HKEY hkeyorg, _In_ LPCWSTR name, _In_ LPDWORD reserved, _In_ LPDWORD type, _In_ LPBYTE data, _In_ LPDWORD count)
#define STRING_PREVIEW_CLOSE
HWND WINAPI GetDlgItem(_In_opt_ HWND, _In_ int)
void registry_read_previewpages(HKEY hKey)
static const WCHAR var_previewpages[]
int WINAPI GetScrollPos(_In_ HWND, _In_ int)
BOOL WINAPI InvalidateRect(_In_opt_ HWND, _In_opt_ LPCRECT, _In_ BOOL)
#define BANDID_PREVIEW_BTN5
static LONG twips_to_pixels(int twips, int dpi)
static void paint_ruler(HWND hWnd, LONG EditLeftmost, BOOL NewMetrics)
HCURSOR WINAPI LoadCursorW(_In_opt_ HINSTANCE, _In_ LPCWSTR)
#define STRING_PREVIEW_ZOOMIN
void init_preview(HWND hMainWnd, LPWSTR wszFileName)
BOOL WINAPI GetScrollInfo(_In_ HWND, _In_ int, _Inout_ LPSCROLLINFO)
void registry_read_pagemargins(HKEY hKey)
#define STRING_PREVIEW_NEXTPAGE
LPVOID NTAPI GlobalLock(HGLOBAL hMem)
LRESULT CALLBACK preview_proc(HWND hWnd, UINT msg, WPARAM wParam, LPARAM lParam)
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)
int WINAPI GetDeviceCaps(_In_opt_ HDC, _In_ int)
#define STRING_PREVIEW_PRINT
static IHTMLWindow2 * window
#define STRING_PREVIEW_ZOOMOUT
#define BANDID_PREVIEW_BTN6
BOOL WINAPI TextOutW(_In_ HDC hdc, _In_ int x, _In_ int y, _In_reads_(c) LPCWSTR lpString, _In_ int c)
static LPWSTR get_print_file_filter(HWND hMainWnd)
GLint GLint GLsizei GLsizei height
static void toggle_num_pages(HWND hMainWnd)
BOOL WINAPI EnableWindow(_In_ HWND, _In_ BOOL)
LRESULT(CALLBACK * WNDPROC)(HWND, UINT, WPARAM, LPARAM)
BOOL WINAPI GetClientRect(_In_ HWND, _Out_ LPRECT)
HWND WINAPI GetParent(_In_ HWND)
BOOL WINAPI SetRect(_Out_ LPRECT, _In_ int, _In_ int, _In_ int, _In_ int)
static void print(LPPRINTDLGW pd, LPWSTR wszFileName)
#define ID_PREVIEW_ZOOMOUT
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
void target_device(HWND hMainWnd, DWORD wordWrap)
BOOL WINAPI DeleteDC(_In_ HDC)
static previewinfo preview
HCURSOR WINAPI SetCursor(_In_opt_ HCURSOR)
static float(__cdecl *square_half_float)(float x
void print_quick(HWND hMainWnd, LPWSTR wszFileName)
#define STRING_PREVIEW_TWOPAGES
LRESULT WINAPI SendMessageW(_In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
#define OFN_OVERWRITEPROMPT
#define ID_PREVIEW_ZOOMIN
LRESULT preview_command(HWND hWnd, WPARAM wParam)
#define ID_PREVIEW_NEXTPAGE
BOOL NTAPI GlobalUnlock(HGLOBAL hMem)
GLint GLint GLint GLint GLint GLint y
void get_default_printer_opts(void)
_In_ CLIPOBJ _In_ BRUSHOBJ _In_ LONG _In_ LONG _In_ LONG x2
HDC WINAPI CreateDCW(_In_opt_ LPCWSTR pszDriver, _In_opt_ LPCWSTR pszDevice, _In_opt_ LPCWSTR psz, _In_opt_ const DEVMODEW *pdmInit)
static DWORD *static HFONT(WINAPI *pCreateFontIndirectExA)(const ENUMLOGFONTEXDVA *)
BOOL WINAPI PtInRect(_In_ LPCRECT, _In_ POINT)
#define ID_PREVIEW_PREVPAGE
BOOL WINAPI PostMessageW(_In_opt_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
static int preview_page_hittest(POINT pt)
LRESULT WINAPI CallWindowProcW(_In_ WNDPROC, _In_ HWND, _In_ UINT, _In_ WPARAM, _In_ LPARAM)
HMODULE WINAPI GetModuleHandleW(LPCWSTR lpModuleName)
static void update_preview_buttons(HWND hMainWnd)
#define BANDID_PREVIEW_BTN2
static const WCHAR var_pagemargin[]
void registry_set_pagemargins(HKEY hKey)
#define MAKEINTRESOURCEW(i)
static void update_preview_statusbar(HWND hMainWnd)
static void update_preview_scrollbars(HWND hwndPreview, RECT *window)
#define EM_GETTEXTLENGTHEX
BOOL WINAPI ScreenToClient(_In_ HWND, _Inout_ LPPOINT)
int WINAPI FillRect(HDC, LPCRECT, HBRUSH)
HBRUSH WINAPI GetSysColorBrush(_In_ int)
static void update_preview_sizes(HWND hwndPreview, BOOL zoomLevelUpdated)
static LRESULT print_preview(HWND hwndPreview)
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
int WINAPI SetScrollPos(_In_ HWND, _In_ int, _In_ int, _In_ BOOL)
struct _previewinfo previewinfo
int WINAPI SetScrollInfo(_In_ HWND, _In_ int, _In_ LPCSCROLLINFO, _In_ BOOL)
#define HeapFree(x, y, z)
static HWND get_ruler_wnd(HWND hMainWnd)
HGDIOBJ WINAPI GetCurrentObject(_In_ HDC, _In_ UINT)
static VOID NTAPI 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)
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
int WINAPI EndDoc(_In_ HDC)