Aggiunto metodo per device stampante e per riga corrente
git-svn-id: svn://10.65.10.50/trunk@2660 c028cbd2-c16b-5b4b-a496-9718f37d4682
This commit is contained in:
parent
8e1aa76c3b
commit
b365d2336d
@ -1,11 +1,14 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
|
|
||||||
#if XVT_OS==XVT_OS_WIN
|
#define STRICT
|
||||||
|
#define XVT_INCL_NATIVE
|
||||||
|
#include <xvt.h>
|
||||||
|
|
||||||
|
#if XVT_OS == XVT_OS_WIN || XVT_OS == XVT_OS_NT
|
||||||
#include <strstrea.h>
|
#include <strstrea.h>
|
||||||
#else
|
#else
|
||||||
#include <strstream.h>
|
#include <strstream.h>
|
||||||
#endif
|
#endif
|
||||||
#include <xvt.h>
|
|
||||||
|
|
||||||
#if XVT_OS==XVT_OS_SCOUNIX
|
#if XVT_OS==XVT_OS_SCOUNIX
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
@ -223,9 +226,7 @@ struct PrDesc
|
|||||||
}
|
}
|
||||||
PrintWhat;
|
PrintWhat;
|
||||||
|
|
||||||
#if XVT_OS == XVT_OS_WIN
|
#if XVT_OS == XVT_OS_WIN || XVT_OS == XVT_OS_NT
|
||||||
#define STRICT
|
|
||||||
#include <windows.h>
|
|
||||||
|
|
||||||
void TPrinter::_get_windows_printer_names (TToken_string & t)
|
void TPrinter::_get_windows_printer_names (TToken_string & t)
|
||||||
{
|
{
|
||||||
@ -891,7 +892,7 @@ PRINT_RCD* TPrinter::get_printrcd(int *size)
|
|||||||
return _print_rcd;
|
return _print_rcd;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if XVT_OS == XVT_OS_WIN
|
#if XVT_OS == XVT_OS_WIN || XVT_OS == XVT_OS_NT
|
||||||
|
|
||||||
// @doc EXTERNAL
|
// @doc EXTERNAL
|
||||||
|
|
||||||
@ -1035,7 +1036,7 @@ TPrinter::TPrinter()
|
|||||||
: _date (TODAY), _multiple_link (FALSE), _frozen (FALSE), _isgraphics (TRUE),
|
: _date (TODAY), _multiple_link (FALSE), _frozen (FALSE), _isgraphics (TRUE),
|
||||||
_lines_per_inch (6), _ch_size (12), _ncopies(1), _export_header(FALSE),
|
_lines_per_inch (6), _ch_size (12), _ncopies(1), _export_header(FALSE),
|
||||||
_export_header_len(0), _vf(NULL), _l_offset(0), _c_offset(0)
|
_export_header_len(0), _vf(NULL), _l_offset(0), _c_offset(0)
|
||||||
#if XVT_OS == XVT_OS_WIN
|
#if XVT_OS == XVT_OS_WIN || XVT_OS == XVT_OS_NT
|
||||||
, _print_rcd(NULL)
|
, _print_rcd(NULL)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@ -1061,7 +1062,7 @@ TPrinter::TPrinter()
|
|||||||
// read configuration file
|
// read configuration file
|
||||||
read_configuration ();
|
read_configuration ();
|
||||||
|
|
||||||
#if XVT_OS == XVT_OS_WIN
|
#if XVT_OS == XVT_OS_WIN || XVT_OS == XVT_OS_NT
|
||||||
// xvt_print_open ();
|
// xvt_print_open ();
|
||||||
set_win_formlen ();
|
set_win_formlen ();
|
||||||
|
|
||||||
@ -1092,7 +1093,7 @@ TPrinter::TPrinter()
|
|||||||
TToken_string& TPrinter::getprinternames ()
|
TToken_string& TPrinter::getprinternames ()
|
||||||
{
|
{
|
||||||
// per ora va solo in windows
|
// per ora va solo in windows
|
||||||
#if XVT_OS == XVT_OS_WIN
|
#if XVT_OS == XVT_OS_WIN || XVT_OS == XVT_OS_NT
|
||||||
if (_printer_names.empty())
|
if (_printer_names.empty())
|
||||||
_get_windows_printer_names(_printer_names);
|
_get_windows_printer_names(_printer_names);
|
||||||
#endif
|
#endif
|
||||||
@ -1202,7 +1203,7 @@ void TPrinter::read_configuration(
|
|||||||
{
|
{
|
||||||
case 0:
|
case 0:
|
||||||
case 5:
|
case 5:
|
||||||
#if XVT_OS == XVT_OS_WIN
|
#if XVT_OS == XVT_OS_WIN || XVT_OS == XVT_OS_NT
|
||||||
_printertype = winprinter;
|
_printertype = winprinter;
|
||||||
#else
|
#else
|
||||||
PrinterDef & def = (PrinterDef &) get_description (_curprn);
|
PrinterDef & def = (PrinterDef &) get_description (_curprn);
|
||||||
@ -1279,7 +1280,7 @@ void TPrinter::save_configuration()
|
|||||||
|
|
||||||
TPrinter::~TPrinter ()
|
TPrinter::~TPrinter ()
|
||||||
{
|
{
|
||||||
#if XVT_OS == XVT_OS_WIN
|
#if XVT_OS == XVT_OS_WIN || XVT_OS == XVT_OS_NT
|
||||||
if (_print_rcd != NULL)
|
if (_print_rcd != NULL)
|
||||||
{
|
{
|
||||||
xvt_print_destroy(_print_rcd);
|
xvt_print_destroy(_print_rcd);
|
||||||
@ -1437,7 +1438,7 @@ bool TPrinter::printrow(
|
|||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if XVT_OS != XVT_OS_SCOUNIX
|
#if XVT_OS == XVT_OS_WIN || XVT_OS == XVT_OS_NT
|
||||||
|
|
||||||
if (_printertype == fileprinter)
|
if (_printertype == fileprinter)
|
||||||
{
|
{
|
||||||
@ -1535,7 +1536,7 @@ bool TPrinter::printfooter()
|
|||||||
for (int i = 0; i < _footersize && ok; i++)
|
for (int i = 0; i < _footersize && ok; i++)
|
||||||
ok = printrow(getfooterline(i));
|
ok = printrow(getfooterline(i));
|
||||||
|
|
||||||
#if XVT_OS != XVT_OS_WIN
|
#if XVT_OS == XVT_OS_SCOUNIX
|
||||||
if (ok)
|
if (ok)
|
||||||
printformfeed();
|
printformfeed();
|
||||||
#endif
|
#endif
|
||||||
@ -1616,7 +1617,7 @@ void TPrinter::reset()
|
|||||||
|
|
||||||
bool TPrinter::printformfeed()
|
bool TPrinter::printformfeed()
|
||||||
{
|
{
|
||||||
#if XVT_OS != XVT_OS_WIN
|
#if XVT_OS == XVT_OS_SCOUNIX
|
||||||
const PrinterDef & pd = get_description(_curprn);
|
const PrinterDef & pd = get_description(_curprn);
|
||||||
|
|
||||||
if (_printertype != screenvis && _hwformfeed)
|
if (_printertype != screenvis && _hwformfeed)
|
||||||
@ -1678,7 +1679,7 @@ bool TPrinter::open()
|
|||||||
_vf->open_modal ();
|
_vf->open_modal ();
|
||||||
}
|
}
|
||||||
else if (_printertype == winprinter || _printertype == export
|
else if (_printertype == winprinter || _printertype == export
|
||||||
#if XVT_OS != XVT_OS_SCOUNIX
|
#if XVT_OS == XVT_OS_WIN || XVT_OS == XVT_OS_NT
|
||||||
|| _printertype == fileprinter
|
|| _printertype == fileprinter
|
||||||
#endif
|
#endif
|
||||||
)
|
)
|
||||||
@ -1848,7 +1849,7 @@ bool TPrinter::set()
|
|||||||
if (k == DLG_SETPRINT)
|
if (k == DLG_SETPRINT)
|
||||||
{
|
{
|
||||||
// l'handler setta default di windows a quella nel listbox e ribecca l'rcd
|
// l'handler setta default di windows a quella nel listbox e ribecca l'rcd
|
||||||
#if XVT_OS == XVT_OS_WIN
|
#if XVT_OS == XVT_OS_WIN || XVT_OS == XVT_OS_NT
|
||||||
if (xvt_dm_post_page_setup(get_printrcd()))
|
if (xvt_dm_post_page_setup(get_printrcd()))
|
||||||
{
|
{
|
||||||
// see if user has changed printer
|
// see if user has changed printer
|
||||||
@ -1973,7 +1974,7 @@ int TPrinter::set_bookmark(
|
|||||||
|
|
||||||
void TPrinter::print_txt(TTextfile& txt)
|
void TPrinter::print_txt(TTextfile& txt)
|
||||||
{
|
{
|
||||||
#if XVT_OS == XVT_OS_WIN
|
#if XVT_OS == XVT_OS_WIN || XVT_OS == XVT_OS_NT
|
||||||
PrintWhat._prcd = _print_rcd;
|
PrintWhat._prcd = _print_rcd;
|
||||||
PrintWhat._txt = &txt;
|
PrintWhat._txt = &txt;
|
||||||
PrintWhat._graphics = _isgraphics;
|
PrintWhat._graphics = _isgraphics;
|
||||||
@ -2028,7 +2029,7 @@ void TPrinter::close ()
|
|||||||
txt.close();
|
txt.close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#if XVT_OS == XVT_OS_WIN
|
#if XVT_OS == XVT_OS_WIN || XVT_OS == XVT_OS_NT
|
||||||
else if (_printertype == winprinter && _txt.lines() > 0L)
|
else if (_printertype == winprinter && _txt.lines() > 0L)
|
||||||
{
|
{
|
||||||
print_txt(_txt);
|
print_txt(_txt);
|
||||||
@ -2076,7 +2077,7 @@ _isopen = FALSE;
|
|||||||
|
|
||||||
#include <bagn004.h>
|
#include <bagn004.h>
|
||||||
|
|
||||||
#if XVT_OS == XVT_OS_WIN
|
#if XVT_OS == XVT_OS_WIN || XVT_OS == XVT_OS_NT
|
||||||
const char* const FORMAT_COMMAND = "FORMAT";
|
const char* const FORMAT_COMMAND = "FORMAT";
|
||||||
#else
|
#else
|
||||||
const char* const FORMAT_COMMAND = "dosformat -fq";
|
const char* const FORMAT_COMMAND = "dosformat -fq";
|
||||||
|
@ -384,7 +384,7 @@ public:
|
|||||||
virtual ~TPrinter();
|
virtual ~TPrinter();
|
||||||
|
|
||||||
|
|
||||||
#if XVT_OS == XVT_OS_WIN
|
#if XVT_OS == XVT_OS_WIN || XVT_OS == XVT_OS_NT
|
||||||
// @cmember Inizia una nuova sessione di stampa. Viene passata alla <mf TPrintwin::do_print>
|
// @cmember Inizia una nuova sessione di stampa. Viene passata alla <mf TPrintwin::do_print>
|
||||||
static BOOLEAN XVT_CALLCONV1 start_winprint(long);
|
static BOOLEAN XVT_CALLCONV1 start_winprint(long);
|
||||||
#endif
|
#endif
|
||||||
@ -427,6 +427,9 @@ public:
|
|||||||
// @cmember Ritorna il numero dell'ultima pagina da stampare
|
// @cmember Ritorna il numero dell'ultima pagina da stampare
|
||||||
word topage () const
|
word topage () const
|
||||||
{ return _topage; }
|
{ return _topage; }
|
||||||
|
// @cmember Ritorna la riga corrente all' interno della pagina
|
||||||
|
int current_row () const
|
||||||
|
{ return _currentrow; }
|
||||||
// @cmember Ritorna la dimensione dell'header
|
// @cmember Ritorna la dimensione dell'header
|
||||||
int headersize () const
|
int headersize () const
|
||||||
{ return _headersize; }
|
{ return _headersize; }
|
||||||
@ -616,7 +619,7 @@ public:
|
|||||||
void set_printrcd();
|
void set_printrcd();
|
||||||
// @cmember Ritorna il record per la descrizione dello stato dell stampante
|
// @cmember Ritorna il record per la descrizione dello stato dell stampante
|
||||||
PRINT_RCD* get_printrcd(int* size = NULL);
|
PRINT_RCD* get_printrcd(int* size = NULL);
|
||||||
#if XVT_OS == XVT_OS_WIN
|
#if XVT_OS == XVT_OS_WIN || XVT_OS == XVT_OS_NT
|
||||||
// @cmember Setta le caratteristiche della stampante leggendole da <p _print_rcd>
|
// @cmember Setta le caratteristiche della stampante leggendole da <p _print_rcd>
|
||||||
void set_win_formlen(WINDOW prwin = NULL_WIN);
|
void set_win_formlen(WINDOW prwin = NULL_WIN);
|
||||||
#endif
|
#endif
|
||||||
@ -656,6 +659,10 @@ public:
|
|||||||
char* fontname() const
|
char* fontname() const
|
||||||
{ return (char*)(const char*)_fontname; }
|
{ return (char*)(const char*)_fontname; }
|
||||||
|
|
||||||
|
// @cmember Ritorna il nome della stampante
|
||||||
|
const char* printername() const
|
||||||
|
{ return (const char*)get_description (_curprn)._devicename; }
|
||||||
|
|
||||||
// @cmember Setta la dimensione dei caratteri da stampare
|
// @cmember Setta la dimensione dei caratteri da stampare
|
||||||
void set_char_size(int size)
|
void set_char_size(int size)
|
||||||
{ _ch_size = size; }
|
{ _ch_size = size; }
|
||||||
|
Loading…
x
Reference in New Issue
Block a user