Patch level : 2.1 nopatch
Files correlati : xvaga.dll Ricompilazione Demo : [ ] Commento : Risolti conflitti vari git-svn-id: svn://10.65.10.50/trunk@12007 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
f92a348dd0
commit
3509dfabbb
@ -684,6 +684,8 @@ bool OsWin32_GotoUrl(const char* url, const char* action)
|
|||||||
return error > 32;
|
return error > 32;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/*
|
||||||
// The function that prints one line without formfeed
|
// The function that prints one line without formfeed
|
||||||
BOOL OsWin32_SpoolRow(const char* pData,
|
BOOL OsWin32_SpoolRow(const char* pData,
|
||||||
unsigned int cbBytes,
|
unsigned int cbBytes,
|
||||||
@ -714,10 +716,6 @@ BOOL OsWin32_SpoolRow(const char* pData,
|
|||||||
if (!hPrnDC)
|
if (!hPrnDC)
|
||||||
return FALSE;
|
return FALSE;
|
||||||
|
|
||||||
/*
|
|
||||||
if (bLocalDC)
|
|
||||||
Escape (hPrnDC, SETABORTPROC, 0, (LPSTR) PrintAbortProc, NULL);
|
|
||||||
*/
|
|
||||||
// PASSTHROUGH is required. If driver doesn't support it, bail out.
|
// PASSTHROUGH is required. If driver doesn't support it, bail out.
|
||||||
|
|
||||||
bAbort = FALSE;
|
bAbort = FALSE;
|
||||||
@ -762,7 +760,31 @@ MPLCleanUp: // Done
|
|||||||
|
|
||||||
return !bAbort;
|
return !bAbort;
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
void OsWin32_SpoolNewLine(unsigned int hdc)
|
||||||
|
{
|
||||||
|
char output[4];
|
||||||
|
output[0] = 1; // Lunghezza: byte basso
|
||||||
|
output[1] = 0; // Lunghezza: byte alto
|
||||||
|
output[2] = '\n'; // A capo
|
||||||
|
output[3] = 0; // Shwarzenegger
|
||||||
|
::Escape((HDC)hdc, PASSTHROUGH, 0, output, NULL );
|
||||||
|
}
|
||||||
|
|
||||||
|
bool OsWin32_IsGenericTextOnly(void* data)
|
||||||
|
{
|
||||||
|
LPDEVMODE pdm = (LPDEVMODE)data;
|
||||||
|
|
||||||
|
if (pdm->dmYResolution == 6) // Win 9x only
|
||||||
|
return true;
|
||||||
|
|
||||||
|
if (strstr((const char*)pdm->dmDeviceName, "eneric") != NULL)
|
||||||
|
return true;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
#ifdef SPEECH_API
|
#ifdef SPEECH_API
|
||||||
|
|
||||||
|
@ -32,7 +32,10 @@ bool OsWin32_SL_Logout() ;
|
|||||||
bool OsWin32_SL_ReadBlock(unsigned short reg, unsigned short size, unsigned short* data);
|
bool OsWin32_SL_ReadBlock(unsigned short reg, unsigned short size, unsigned short* data);
|
||||||
bool OsWin32_SL_WriteBlock(unsigned short reg, unsigned short size, const unsigned short* data);
|
bool OsWin32_SL_WriteBlock(unsigned short reg, unsigned short size, const unsigned short* data);
|
||||||
|
|
||||||
BOOL OsWin32_SpoolRow(const char* pData, unsigned int cbBytes, unsigned int hPrnDC);
|
//BOOL OsWin32_SpoolRow(const char* pData, unsigned int cbBytes, unsigned int hPrnDC);
|
||||||
|
void OsWin32_SpoolNewLine(unsigned int hdc);
|
||||||
|
bool OsWin32_IsGenericTextOnly(void* devmode);
|
||||||
|
|
||||||
int OsWin32_GetSessionId();
|
int OsWin32_GetSessionId();
|
||||||
bool OsWin32_IsWindowsServer();
|
bool OsWin32_IsWindowsServer();
|
||||||
|
|
||||||
|
@ -612,13 +612,14 @@ bool TDCMapper::HasValidDC(WINDOW owner) const
|
|||||||
class TwxWindowBase : public wxWindow
|
class TwxWindowBase : public wxWindow
|
||||||
{
|
{
|
||||||
#ifdef LINUX
|
#ifdef LINUX
|
||||||
wxString Title;
|
|
||||||
#endif
|
|
||||||
public:
|
public:
|
||||||
#ifdef LINUX
|
wxString m_strTitle;
|
||||||
wxString & GetTitle() {return Title;}
|
virtual void SetTitle(const wxString& title) { wxWindow::SetTitle(m_strTitle = title); }
|
||||||
|
virtual wxString GetTitle() const { return m_strTitle; }
|
||||||
#endif
|
#endif
|
||||||
TwxWindowBase() { }
|
|
||||||
|
public:
|
||||||
|
TwxWindowBase() { }
|
||||||
TwxWindowBase(wxWindow *parent, wxWindowID id, const wxString &title,
|
TwxWindowBase(wxWindow *parent, wxWindowID id, const wxString &title,
|
||||||
const wxPoint & pos, const wxSize & size, long style);
|
const wxPoint & pos, const wxSize & size, long style);
|
||||||
|
|
||||||
@ -631,10 +632,7 @@ TwxWindowBase::TwxWindowBase(wxWindow *parent, wxWindowID id, const wxString &ti
|
|||||||
const wxPoint &pos, const wxSize &size, long style)
|
const wxPoint &pos, const wxSize &size, long style)
|
||||||
: wxWindow(parent, id, pos, size, style)
|
: wxWindow(parent, id, pos, size, style)
|
||||||
{
|
{
|
||||||
SetTitle(title);
|
SetTitle(title);
|
||||||
#ifdef LINUX
|
|
||||||
Title = title;
|
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
class TwxWindow : public TwxWindowBase
|
class TwxWindow : public TwxWindowBase
|
||||||
@ -1843,9 +1841,9 @@ class TXVT_IMAGE
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
const wxImage& Image() const { return m_image; }
|
const wxImage& Image() const { return m_image; }
|
||||||
wxImage& Image() { m_bDirty = TRUE; return m_image; }
|
wxImage& Image() { m_bDirty = true; return m_image; }
|
||||||
const wxBitmap& Bitmap();
|
const wxBitmap& Bitmap();
|
||||||
TXVT_IMAGE() : m_bDirty(FALSE) { }
|
TXVT_IMAGE() : m_bDirty(false) { }
|
||||||
};
|
};
|
||||||
|
|
||||||
const wxBitmap& TXVT_IMAGE::Bitmap()
|
const wxBitmap& TXVT_IMAGE::Bitmap()
|
||||||
@ -2209,7 +2207,7 @@ int xvt_dwin_get_text_width(WINDOW win, const char *s, int len)
|
|||||||
str.Truncate(len);
|
str.Truncate(len);
|
||||||
if (str.StartsWith("ABCDEFGH") || str.StartsWith("MMMMMMMM"))
|
if (str.StartsWith("ABCDEFGH") || str.StartsWith("MMMMMMMM"))
|
||||||
{
|
{
|
||||||
const wxString emme('n', str.Length());
|
const wxString emme('G', str.Length()); // Questa lettera cambia con le mode
|
||||||
str = emme;
|
str = emme;
|
||||||
}
|
}
|
||||||
dc.GetTextExtent(str, &width, &height);
|
dc.GetTextExtent(str, &width, &height);
|
||||||
@ -2915,7 +2913,6 @@ void xvt_image_set_clut(XVT_IMAGE image, short index, COLOR color)
|
|||||||
if (bmp.HasPalette())
|
if (bmp.HasPalette())
|
||||||
{
|
{
|
||||||
const wxPalette& pal = bmp.GetPalette();
|
const wxPalette& pal = bmp.GetPalette();
|
||||||
|
|
||||||
CAST_COLOR (color, c);
|
CAST_COLOR (color, c);
|
||||||
unsigned char ri, gi, bi;
|
unsigned char ri, gi, bi;
|
||||||
pal.GetRGB(index, &ri, &gi, &bi);
|
pal.GetRGB(index, &ri, &gi, &bi);
|
||||||
@ -4206,6 +4203,9 @@ long xvt_vobj_get_attr(WINDOW win, long data)
|
|||||||
ret = long(_task_win);
|
ret = long(_task_win);
|
||||||
break;
|
break;
|
||||||
case ATTR_WIN_INSTANCE:
|
case ATTR_WIN_INSTANCE:
|
||||||
|
ret = 0;
|
||||||
|
break;
|
||||||
|
case ATTR_WIN_OPENFILENAME_HOOK:
|
||||||
ret = 0;
|
ret = 0;
|
||||||
break;
|
break;
|
||||||
case ATTR_WIN_PM_DRAWABLE_TWIN:
|
case ATTR_WIN_PM_DRAWABLE_TWIN:
|
||||||
|
@ -19,7 +19,7 @@ IMPLEMENT_APP(TMainApp)
|
|||||||
bool TMainApp::OnInit()
|
bool TMainApp::OnInit()
|
||||||
{
|
{
|
||||||
xvt_main(argc, argv);
|
xvt_main(argc, argv);
|
||||||
return FALSE; // Prevents entering the Main Loop
|
return false; // Prevents entering the Main Loop
|
||||||
}
|
}
|
||||||
|
|
||||||
int TMainApp::OnExit()
|
int TMainApp::OnExit()
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
#define XVT_OS_LINUX 300
|
|
||||||
#define XVT_OS_WIN32 400
|
#define XVT_OS_WIN32 400
|
||||||
|
#define XVT_OS_LINUX 595
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
#define XVT_OS XVT_OS_WIN32
|
#define XVT_OS XVT_OS_WIN32
|
||||||
@ -7,15 +7,35 @@
|
|||||||
#define XVT_OS XVT_OS_LINUX
|
#define XVT_OS XVT_OS_LINUX
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define XVT_WS_LINUX 301
|
#define XVT_WS_LINUX 301
|
||||||
#define XVT_WS_WIN_95 401
|
#define XVT_WS_WIN_95 401
|
||||||
#define XVT_WS_WIN_98 402
|
#define XVT_WS_WIN_98 402
|
||||||
#define XVT_WS_WIN_ME 403
|
#define XVT_WS_WIN_ME 403
|
||||||
#define XVT_WS_WIN_NT 411
|
#define XVT_WS_WIN_NT 411
|
||||||
#define XVT_WS_WIN_2000 412
|
#define XVT_WS_WIN_2000 412
|
||||||
#define XVT_WS_WIN_XP 413
|
#define XVT_WS_WIN_XP 413
|
||||||
#define XVT_WS_WIN_SERVER 414
|
#define XVT_WS_WIN_SERVER 414
|
||||||
|
|
||||||
|
#define XVT_WS_UNKNOWN 0
|
||||||
|
#define MACWS 100 /* Apple Macintosh */
|
||||||
|
#define PMWS 200 /* IBM OS/2 PM */
|
||||||
|
#define WIN32WS 300 /* MS Windows 3.1 for NT */
|
||||||
|
#define WIN16WS 400 /* MS Windows 3.x for Win16 */
|
||||||
|
#define WMWS 450 /* Character */
|
||||||
|
#define MTFWS 500 /* Motif */
|
||||||
|
#define XOLWS 501 /* Open Look */
|
||||||
|
#define WXGTKWS 107
|
||||||
|
#define NTWS WIN32WS /* for compatibility with docs */
|
||||||
|
#define WINWS WIN16WS /* for compatibility with docs */
|
||||||
|
|
||||||
|
#if defined(WIN32)
|
||||||
|
#define XVTWS WIN32WS
|
||||||
|
#elif defined(LINUX)
|
||||||
|
#define XVTWS WXGTKWS
|
||||||
|
#else
|
||||||
|
#define XVTWS XVT_WS_UNKNOWN
|
||||||
|
#endif
|
||||||
|
|
||||||
#define ATTR_WIN_BASE 10000
|
#define ATTR_WIN_BASE 10000
|
||||||
#define ATTR_WIN_CMD_LINE (ATTR_WIN_BASE + 0)
|
#define ATTR_WIN_CMD_LINE (ATTR_WIN_BASE + 0)
|
||||||
#define ATTR_WIN_INSTANCE (ATTR_WIN_BASE + 1)
|
#define ATTR_WIN_INSTANCE (ATTR_WIN_BASE + 1)
|
||||||
@ -30,13 +50,6 @@
|
|||||||
#define ATTR_WIN_PM_TWIN_STARTUP_MASK (ATTR_WIN_BASE + 10)
|
#define ATTR_WIN_PM_TWIN_STARTUP_MASK (ATTR_WIN_BASE + 10)
|
||||||
#define ATTR_WIN_PM_TWIN_STARTUP_RCT (ATTR_WIN_BASE + 11)
|
#define ATTR_WIN_PM_TWIN_STARTUP_RCT (ATTR_WIN_BASE + 11)
|
||||||
#define ATTR_WIN_PM_TWIN_STARTUP_STYLE (ATTR_WIN_BASE + 12)
|
#define ATTR_WIN_PM_TWIN_STARTUP_STYLE (ATTR_WIN_BASE + 12)
|
||||||
|
#define ATTR_WIN_OPENFILENAME_HOOK (ATTR_WIN_BASE + 13)
|
||||||
#define WINWS 101
|
#define ATTR_WIN_POPUP_DETACHED (ATTR_WIN_BASE + 14)
|
||||||
#define MTFWS 102
|
|
||||||
#define MACWS 103
|
|
||||||
#define PMWS 104
|
|
||||||
#define WMWS 105
|
|
||||||
#define XOLWS 106
|
|
||||||
#define WXGTKWS 107
|
|
||||||
|
|
||||||
#define main xvt_main
|
#define main xvt_main
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
|
|
||||||
#include "xvt.h"
|
#include "xvt.h"
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
|
#include "wx/dcps.h"
|
||||||
#include "oswin32.h"
|
#include "oswin32.h"
|
||||||
#else
|
#else
|
||||||
#include "oslinux.h"
|
#include "oslinux.h"
|
||||||
@ -291,7 +292,7 @@ void TwxPrintOut::InitDC(TPRINT_RCD* prcd)
|
|||||||
{
|
{
|
||||||
wxPrinter printer;
|
wxPrinter printer;
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
dc = new wxPrinterDC(printer.GetPrintDialogData().GetPrintData());
|
dc = new wxPrinterDC(printer.GetPrintDialogData().GetPrintData());
|
||||||
#else
|
#else
|
||||||
dc = new wxPostScriptDC(printer.GetPrintDialogData().GetPrintData());
|
dc = new wxPostScriptDC(printer.GetPrintDialogData().GetPrintData());
|
||||||
#endif
|
#endif
|
||||||
@ -303,7 +304,7 @@ void TwxPrintOut::InitDC(TPRINT_RCD* prcd)
|
|||||||
|
|
||||||
data.SetNativeData(OsWin32_ConvertToNativePrinterInfo(prcd->m_data, prcd->m_size));
|
data.SetNativeData(OsWin32_ConvertToNativePrinterInfo(prcd->m_data, prcd->m_size));
|
||||||
data.ConvertFromNative();
|
data.ConvertFromNative();
|
||||||
dc = new wxPrinterDC(data);
|
dc = new wxPrinterDC(data);
|
||||||
#else
|
#else
|
||||||
prcd->GetData(data);
|
prcd->GetData(data);
|
||||||
dc = new wxPostScriptDC(data);
|
dc = new wxPostScriptDC(data);
|
||||||
@ -524,11 +525,19 @@ void xvt_print_close(void)
|
|||||||
// Nothing to do ?
|
// Nothing to do ?
|
||||||
}
|
}
|
||||||
|
|
||||||
BOOLEAN xvt_print_close_page(PRINT_RCD* /*precp*/)
|
BOOLEAN xvt_print_close_page(PRINT_RCD* precp)
|
||||||
{
|
{
|
||||||
BOOLEAN ok = m_po != NULL;
|
BOOLEAN ok = m_po != NULL;
|
||||||
if (ok)
|
if (ok)
|
||||||
m_po->GetDC()->EndPage();
|
{
|
||||||
|
wxDC* dc = m_po->GetDC();
|
||||||
|
dc->EndPage();
|
||||||
|
#ifdef WIN32
|
||||||
|
TPRINT_RCD* prcd = (TPRINT_RCD*)precp;
|
||||||
|
if (OsWin32_IsGenericTextOnly(prcd->m_data))
|
||||||
|
OsWin32_SpoolNewLine(dc->GetHDC());
|
||||||
|
#endif
|
||||||
|
}
|
||||||
return ok;
|
return ok;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -726,19 +735,6 @@ BOOLEAN xvt_print_start_thread(BOOLEAN(*print_fcn)(long), long data)
|
|||||||
const BOOLEAN aborted = print_fcn(data);
|
const BOOLEAN aborted = print_fcn(data);
|
||||||
DestroyAbortWindow();
|
DestroyAbortWindow();
|
||||||
|
|
||||||
#ifdef WIN32
|
|
||||||
// Stampa un line feed aggiuntivo nella stampa su generica solo testo in Win 98
|
|
||||||
int w, h;
|
|
||||||
m_po->GetPPIPrinter(&w, &h);
|
|
||||||
if (h == 6) // Solo Win 98 torna 6 pixel per pollice = 1 pixel per riga
|
|
||||||
{
|
|
||||||
wxDC* dc = m_po->GetDC();
|
|
||||||
dc->StartPage();
|
|
||||||
OsWin32_SpoolRow("\n\n", 1, dc->GetHDC()); // Probabilmente basta "\n" (visto che poi specifichiamo 1) ma non ci fidiamo
|
|
||||||
dc->EndPage();
|
|
||||||
}
|
|
||||||
#endif
|
|
||||||
|
|
||||||
m_po->OnEndDocument();
|
m_po->OnEndDocument();
|
||||||
m_po->OnEndPrinting();
|
m_po->OnEndPrinting();
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user