Initial
This commit is contained in:
82
printman/ABORTDLG.CPP
Normal file
82
printman/ABORTDLG.CPP
Normal file
@@ -0,0 +1,82 @@
|
||||
#include <printman/abortdlg.hpp>
|
||||
#include <common/keydata.hpp>
|
||||
|
||||
AbortDlg::AbortDlg(void)
|
||||
: mIsDestroyed(FALSE), mIsCancelled(FALSE)
|
||||
{
|
||||
}
|
||||
|
||||
AbortDlg::AbortDlg(const AbortDlg &someAbortDlg)
|
||||
{ // private implementation
|
||||
*this=someAbortDlg;
|
||||
}
|
||||
|
||||
AbortDlg::~AbortDlg()
|
||||
{
|
||||
destroy();
|
||||
}
|
||||
|
||||
AbortDlg &AbortDlg::operator=(const AbortDlg &someAbortDlg)
|
||||
{ // private implementation
|
||||
return *this;
|
||||
}
|
||||
|
||||
void AbortDlg::perform(GUIWindow &parentWindow)
|
||||
{
|
||||
mIsDestroyed=FALSE;
|
||||
mIsCancelled=FALSE;
|
||||
create(parentWindow);
|
||||
}
|
||||
|
||||
void AbortDlg::create(GUIWindow &parentWindow)
|
||||
{
|
||||
String buttonName("BUTTON");
|
||||
|
||||
DialogTemplate dlgTemplate;
|
||||
DialogItemTemplate cancelButton;
|
||||
|
||||
dlgTemplate.titleText("Printing...");
|
||||
dlgTemplate.posRect(Rect(10,73,220,42));
|
||||
dlgTemplate.pointSize(8);
|
||||
dlgTemplate.typeFace("Helv");
|
||||
dlgTemplate.style(WS_VISIBLE|WS_CAPTION|DS_3DLOOK|WS_SYSMENU|DS_SETFONT|WS_POPUP);
|
||||
|
||||
cancelButton.className(buttonName);
|
||||
cancelButton.titleText("Cancel");
|
||||
cancelButton.style(WS_VISIBLE|WS_CHILD|WS_TABSTOP|WS_GROUP);
|
||||
cancelButton.posRect(Rect(85,22,50,14));
|
||||
cancelButton.itemID(IDCANCEL);
|
||||
|
||||
dlgTemplate+=cancelButton;
|
||||
createDialog(parentWindow,dlgTemplate,DynamicDialog::ModelessDialog);
|
||||
}
|
||||
|
||||
WORD AbortDlg::dlgCommand(DWORD commandID,CallbackData &someCallbackData)
|
||||
{
|
||||
switch(commandID)
|
||||
{
|
||||
case IDCANCEL :
|
||||
mIsCancelled=TRUE;
|
||||
destroy();
|
||||
break;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
BOOL AbortDlg::dlgInitDialog(CallbackData &/*someCallbackData*/)
|
||||
{
|
||||
init();
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void AbortDlg::dlgDestroyDialog(CallbackData &/*someCallbackData*/)
|
||||
{
|
||||
mIsDestroyed=TRUE;
|
||||
return;
|
||||
}
|
||||
|
||||
// virtuals
|
||||
|
||||
void AbortDlg::init(void)
|
||||
{
|
||||
}
|
||||
57
printman/ABORTDLG.HPP
Normal file
57
printman/ABORTDLG.HPP
Normal file
@@ -0,0 +1,57 @@
|
||||
#ifndef _PRINTMAN_ABORTDLG_HPP_
|
||||
#define _PRINTMAN_ABORTDLG_HPP_
|
||||
#ifndef _COMMON_WINDOWS_HPP_
|
||||
#include <common/windows.hpp>
|
||||
#endif
|
||||
#ifndef _DIALOG_DYNAMICDIALOG_HPP_
|
||||
#include <dialog/dyndlg.hpp>
|
||||
#endif
|
||||
|
||||
class AbortDlg : private DynamicDialog
|
||||
{
|
||||
public:
|
||||
AbortDlg(void);
|
||||
virtual ~AbortDlg();
|
||||
void perform(GUIWindow &parentWindow);
|
||||
BOOL isDestroyed(void)const;
|
||||
BOOL isCancelled(void)const;
|
||||
void destroy(void);
|
||||
void yieldTask(void);
|
||||
protected:
|
||||
virtual void init(void);
|
||||
private:
|
||||
AbortDlg(const AbortDlg &AbortDlg);
|
||||
AbortDlg &operator=(const AbortDlg &AbortDlg);
|
||||
void create(GUIWindow &parentWindow);
|
||||
WORD dlgCommand(DWORD commandID,CallbackData &someCallbackData);
|
||||
BOOL dlgInitDialog(CallbackData &someCallbackData);
|
||||
void dlgDestroyDialog(CallbackData &someCallbackData);
|
||||
|
||||
BOOL mIsDestroyed;
|
||||
BOOL mIsCancelled;
|
||||
};
|
||||
|
||||
inline
|
||||
BOOL AbortDlg::isDestroyed(void)const
|
||||
{
|
||||
return mIsDestroyed;
|
||||
}
|
||||
|
||||
inline
|
||||
BOOL AbortDlg::isCancelled(void)const
|
||||
{
|
||||
return mIsCancelled;
|
||||
}
|
||||
|
||||
inline
|
||||
void AbortDlg::destroy(void)
|
||||
{
|
||||
GUIWindow::destroy();
|
||||
}
|
||||
|
||||
inline
|
||||
void AbortDlg::yieldTask(void)
|
||||
{
|
||||
GUIWindow::yieldTask();
|
||||
}
|
||||
#endif
|
||||
112
printman/PICKDLG.CPP
Normal file
112
printman/PICKDLG.CPP
Normal file
@@ -0,0 +1,112 @@
|
||||
#include <printman/pickdlg.hpp>
|
||||
#include <common/keydata.hpp>
|
||||
|
||||
PickDlg::PickDlg(void)
|
||||
{
|
||||
}
|
||||
|
||||
PickDlg::PickDlg(const PickDlg &somePickDlg)
|
||||
{ // private implementation
|
||||
*this=somePickDlg;
|
||||
}
|
||||
|
||||
PickDlg::~PickDlg()
|
||||
{
|
||||
destroy();
|
||||
}
|
||||
|
||||
PickDlg &PickDlg::operator=(const PickDlg &somePickDlg)
|
||||
{ // private implementation
|
||||
return *this;
|
||||
}
|
||||
|
||||
BOOL PickDlg::perform(GUIWindow &parentWindow,Block<Printer> &printers,String &strPrinter)
|
||||
{
|
||||
mParent=&parentWindow;
|
||||
mPrinters=printers;
|
||||
mPrinter=strPrinter;
|
||||
mCancel=FALSE;
|
||||
create(parentWindow);
|
||||
if(!mCancel)strPrinter=mPrinter;
|
||||
return !mCancel;
|
||||
}
|
||||
|
||||
void PickDlg::create(GUIWindow &parentWindow)
|
||||
{
|
||||
DialogTemplate dlgTemplate;
|
||||
DialogItemTemplate comboBox;
|
||||
DialogItemTemplate okButton;
|
||||
DialogItemTemplate cancelButton;
|
||||
|
||||
dlgTemplate.titleText("Choose Printer");
|
||||
dlgTemplate.posRect(Rect(10,73,269,39));
|
||||
dlgTemplate.pointSize(8);
|
||||
dlgTemplate.typeFace("Helv");
|
||||
dlgTemplate.style(WS_VISIBLE|WS_CAPTION|DS_SETFONT|WS_POPUP); // WS_SYSMENU|DS_SETFONT| DS_3DLOOK| WS_SYSMENU|
|
||||
dlgTemplate.extendedStyle(WS_EX_TOPMOST);
|
||||
|
||||
okButton.className("BUTTON");
|
||||
okButton.titleText("&Ok");
|
||||
okButton.style(WS_VISIBLE|WS_CHILD|WS_TABSTOP|WS_GROUP|BS_DEFPUSHBUTTON);
|
||||
okButton.posRect(Rect(216,3,50,14));
|
||||
okButton.itemID(IDOK);
|
||||
|
||||
cancelButton.className("BUTTON");
|
||||
cancelButton.titleText("Ca&ncel");
|
||||
cancelButton.style(WS_VISIBLE|WS_CHILD|WS_TABSTOP|WS_GROUP);
|
||||
cancelButton.posRect(Rect(216,17,50,14));
|
||||
cancelButton.itemID(IDCANCEL);
|
||||
|
||||
comboBox.className("COMBOBOX");
|
||||
comboBox.titleText("");
|
||||
comboBox.style(WS_VISIBLE|WS_CHILD|WS_TABSTOP|WS_GROUP|CBS_DROPDOWNLIST);
|
||||
comboBox.posRect(Rect(10,11,199,44));
|
||||
comboBox.itemID(ComboBoxID);
|
||||
|
||||
dlgTemplate+=comboBox;
|
||||
dlgTemplate+=okButton;
|
||||
dlgTemplate+=cancelButton;
|
||||
createDialog(parentWindow,dlgTemplate,DynamicDialog::ModalDialog);
|
||||
parentWindow.enable(TRUE);
|
||||
parentWindow.top();
|
||||
}
|
||||
|
||||
WORD PickDlg::dlgCommand(DWORD commandID,CallbackData &someCallbackData)
|
||||
{
|
||||
switch(commandID)
|
||||
{
|
||||
case IDCANCEL :
|
||||
mCancel=TRUE;
|
||||
endDialog(false);
|
||||
// destroy();
|
||||
break;
|
||||
case IDOK :
|
||||
mCancel=FALSE;
|
||||
sendMessage(ComboBoxID,WM_GETTEXT,String::MaxString,(LPARAM)(LPSTR)mPrinter);
|
||||
endDialog(true);
|
||||
// destroy();
|
||||
break;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
BOOL PickDlg::dlgInitDialog(CallbackData &/*someCallbackData*/)
|
||||
{
|
||||
// ::SetParent(*this,*mParent);
|
||||
for(int index=0;index<mPrinters.size();index++)sendMessage(ComboBoxID,CB_INSERTSTRING,-1,(LPARAM)(LPSTR)mPrinters[index].printerName());
|
||||
if(!mPrinter.isNull())sendMessage(ComboBoxID,CB_SELECTSTRING,-1,(LPARAM)(LPSTR)mPrinter);
|
||||
else sendMessage(ComboBoxID,CB_SETCURSEL,0,0L);
|
||||
init();
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void PickDlg::dlgDestroyDialog(CallbackData &/*someCallbackData*/)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
// virtuals
|
||||
|
||||
void PickDlg::init(void)
|
||||
{
|
||||
}
|
||||
41
printman/PICKDLG.HPP
Normal file
41
printman/PICKDLG.HPP
Normal file
@@ -0,0 +1,41 @@
|
||||
#ifndef _PRINTMAN_PICKDLG_HPP_
|
||||
#define _PRINTMAN_PICKDLG_HPP_
|
||||
#ifndef _COMMON_WINDOWS_HPP_
|
||||
#include <common/windows.hpp>
|
||||
#endif
|
||||
#ifndef _COMMON_BLOCK_HPP_
|
||||
#include <common/block.hpp>
|
||||
#endif
|
||||
#ifndef _COMMON_SMARTPOINTER_HPP_
|
||||
#include <common/pointer.hpp>
|
||||
#endif
|
||||
#ifndef _DIALOG_DYNAMICDIALOG_HPP_
|
||||
#include <dialog/dyndlg.hpp>
|
||||
#endif
|
||||
#ifndef _PRINTMAN_PRINTER_HPP_
|
||||
#include <printman/printer.hpp>
|
||||
#endif
|
||||
|
||||
class PickDlg : private DynamicDialog
|
||||
{
|
||||
public:
|
||||
PickDlg(void);
|
||||
virtual ~PickDlg();
|
||||
BOOL perform(GUIWindow &parentWindow,Block<Printer> &printers,String &strPrinter);
|
||||
protected:
|
||||
virtual void init(void);
|
||||
private:
|
||||
enum{ComboBoxID=200};
|
||||
PickDlg(const PickDlg &PickDlg);
|
||||
PickDlg &operator=(const PickDlg &PickDlg);
|
||||
void create(GUIWindow &parentWindow);
|
||||
WORD dlgCommand(DWORD commandID,CallbackData &someCallbackData);
|
||||
BOOL dlgInitDialog(CallbackData &someCallbackData);
|
||||
void dlgDestroyDialog(CallbackData &someCallbackData);
|
||||
|
||||
String mPrinter;
|
||||
SmartPointer<GUIWindow> mParent;
|
||||
Block<Printer> mPrinters;
|
||||
BOOL mCancel;
|
||||
};
|
||||
#endif
|
||||
98
printman/PRINTER.HPP
Normal file
98
printman/PRINTER.HPP
Normal file
@@ -0,0 +1,98 @@
|
||||
#ifndef _PRINTMAN_PRINTER_HPP_
|
||||
#define _PRINTMAN_PRINTER_HPP_
|
||||
#ifndef _COMMON_WINDOWS_HPP_
|
||||
#include <common/windows.hpp>
|
||||
#endif
|
||||
#ifndef _COMMON_STRING_HPP_
|
||||
#include <common/string.hpp>
|
||||
#endif
|
||||
|
||||
class Printer
|
||||
{
|
||||
public:
|
||||
Printer(void);
|
||||
Printer(const Printer &somePrinter);
|
||||
virtual ~Printer();
|
||||
Printer &operator=(const Printer &somePrinter);
|
||||
BOOL operator==(const Printer &somePrinter);
|
||||
const String &printerName(void)const;
|
||||
void printerName(const String &printerName);
|
||||
const String &driverName(void)const;
|
||||
void driverName(const String &driverName);
|
||||
const String &portName(void)const;
|
||||
void portName(const String &portName);
|
||||
private:
|
||||
String mPrinterName;
|
||||
String mDriverName;
|
||||
String mPortName;
|
||||
};
|
||||
|
||||
inline
|
||||
Printer::Printer(void)
|
||||
{
|
||||
}
|
||||
|
||||
inline
|
||||
Printer::Printer(const Printer &somePrinter)
|
||||
{
|
||||
*this=somePrinter;
|
||||
}
|
||||
|
||||
inline
|
||||
Printer::~Printer()
|
||||
{
|
||||
}
|
||||
|
||||
inline
|
||||
Printer &Printer::operator=(const Printer &somePrinter)
|
||||
{
|
||||
printerName(somePrinter.printerName());
|
||||
driverName(somePrinter.driverName());
|
||||
portName(somePrinter.portName());
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline
|
||||
BOOL Printer::operator==(const Printer &somePrinter)
|
||||
{
|
||||
return (printerName()==somePrinter.printerName()&&
|
||||
driverName()==somePrinter.driverName()&&
|
||||
portName()==somePrinter.portName());
|
||||
}
|
||||
|
||||
inline
|
||||
const String &Printer::printerName(void)const
|
||||
{
|
||||
return mPrinterName;
|
||||
}
|
||||
|
||||
inline
|
||||
void Printer::printerName(const String &printerName)
|
||||
{
|
||||
mPrinterName=printerName;
|
||||
}
|
||||
|
||||
inline
|
||||
const String &Printer::driverName(void)const
|
||||
{
|
||||
return mDriverName;
|
||||
}
|
||||
|
||||
inline
|
||||
void Printer::driverName(const String &driverName)
|
||||
{
|
||||
mDriverName=driverName;
|
||||
}
|
||||
|
||||
inline
|
||||
const String &Printer::portName(void)const
|
||||
{
|
||||
return mPortName;
|
||||
}
|
||||
|
||||
inline
|
||||
void Printer::portName(const String &portName)
|
||||
{
|
||||
mPortName=portName;
|
||||
}
|
||||
#endif
|
||||
29
printman/PRINTMAN.DSW
Normal file
29
printman/PRINTMAN.DSW
Normal file
@@ -0,0 +1,29 @@
|
||||
Microsoft Developer Studio Workspace File, Format Version 5.00
|
||||
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
|
||||
|
||||
###############################################################################
|
||||
|
||||
Project: "printman"=.\printman.dsp - Package Owner=<4>
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<4>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
Global:
|
||||
|
||||
Package=<5>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
Package=<3>
|
||||
{{{
|
||||
}}}
|
||||
|
||||
###############################################################################
|
||||
|
||||
212
printman/PRINTMAN.HPP
Normal file
212
printman/PRINTMAN.HPP
Normal file
@@ -0,0 +1,212 @@
|
||||
#ifndef _PRINTMAN_PRINTMANAGER_HPP_
|
||||
#define _PRINTMAN_PRINMANAGER_HPP_
|
||||
#ifndef _COMMON_WINDOWS_HPP_
|
||||
#include <common/windows.hpp>
|
||||
#endif
|
||||
#ifndef _COMMON_BLOCK_HPP_
|
||||
#include <common/block.hpp>
|
||||
#endif
|
||||
#ifndef _COMMON_PUREDEVICE_HPP_
|
||||
#include <common/purehdc.hpp>
|
||||
#endif
|
||||
#ifndef _COMMON_FONT_HPP_
|
||||
#include <common/font.hpp>
|
||||
#endif
|
||||
#ifndef _COMMON_SMARTPOINTER_HPP_
|
||||
#include <common/pointer.hpp>
|
||||
#endif
|
||||
#ifndef _COMMON_ASSERT_HPP_
|
||||
#include <common/assert.hpp>
|
||||
#endif
|
||||
#ifndef _PRINTMAN_PRINTER_HPP_
|
||||
#include <printman/printer.hpp>
|
||||
#endif
|
||||
#ifndef _PRINTMAN_ABORTDLG_HPP_
|
||||
#include <printman/abortdlg.hpp>
|
||||
#endif
|
||||
|
||||
class GUIWindow;
|
||||
class Bitmap;
|
||||
class ResBitmap;
|
||||
class PureBitmap;
|
||||
class RegKey;
|
||||
|
||||
class PrintManager
|
||||
{
|
||||
public:
|
||||
PrintManager(void);
|
||||
virtual ~PrintManager();
|
||||
const String &strDefaultPrinter(void)const;
|
||||
bool choosePrinter(GUIWindow &parentWindow,String &strPrinter);
|
||||
bool choosePrinter(GUIWindow &parentWindow,Printer &printer);
|
||||
bool openPrinter(const Printer &printer,GUIWindow &parentWindow,const String &strPrintDocName);
|
||||
bool openPrinter(const String &strPrinterName,GUIWindow &parentWindow,const String &strPrintDocName=String());
|
||||
bool openPrinter(const String &strPrinterName,const String &strPrintDocName=String());
|
||||
void closePrinter(void);
|
||||
PureDevice &printerDevice(void);
|
||||
bool startPage(void);
|
||||
bool endPage(void);
|
||||
bool endDoc(void);
|
||||
bool abortDoc(void);
|
||||
bool printLines(Block<String> &strLines,Font &pageFont,Point xyPoint,bool advancePage=TRUE);
|
||||
bool printBitmap(Bitmap &bitmap,bool advancePage=true,int width=0,int height=0);
|
||||
bool printBitmap(ResBitmap &resBitmap,bool advancePage=true,int width=0,int height=0);
|
||||
bool printBitmap(PureBitmap &pureBitmap,bool advancePage=true,int width=0,int height=0);
|
||||
bool printBitmap(PureBitmap &pureBitmap,bool advancePage=true,WORD scale=100);
|
||||
bool printDevice(PureBitmap &pureBitmap,bool advancePage=true);
|
||||
WORD getCount(void)const;
|
||||
const Printer &getDefaultPrinter(void)const;
|
||||
bool getFirstPrinter(Printer &printer);
|
||||
bool getNextPrinter(Printer &printer);
|
||||
private:
|
||||
void scaleImage(float factor,WORD &width,WORD &height)const;
|
||||
bool getPrinters(RegKey ®Key,const String &strPrinterKey);
|
||||
bool getPrinters(void);
|
||||
bool getPrinter(String &strPrinterKey,Printer &printer);
|
||||
PrintManager(const PrintManager &somePrintmanager);
|
||||
PrintManager &operator=(const PrintManager &somePrintManager);
|
||||
bool operator==(const PrintManager &somePrintManager);
|
||||
bool isInPage(void)const;
|
||||
void isInPage(bool isInPage);
|
||||
bool isInDoc(void)const;
|
||||
void isInDoc(bool isInDoc);
|
||||
bool startDoc(const String &strPrintDocName);
|
||||
bool createAbortDlg(void);
|
||||
static BOOL CALLBACK abortProc(HDC hDC,int nCode);
|
||||
|
||||
SmartPointer<GUIWindow> mParentWindow;
|
||||
SmartPointer<AbortDlg> mAbortDlg;
|
||||
Block<Printer> mPrinters;
|
||||
Printer mDefaultPrinter;
|
||||
String mPrinterKey;
|
||||
PureDevice mPrinterDevice;
|
||||
WORD mIndexPrinter;
|
||||
bool mIsInDoc;
|
||||
bool mIsInPage;
|
||||
};
|
||||
|
||||
inline
|
||||
PrintManager &PrintManager::operator=(const PrintManager &/*somePrintManager*/)
|
||||
{ // private implementation
|
||||
return *this;
|
||||
}
|
||||
|
||||
inline
|
||||
bool PrintManager::operator==(const PrintManager &somePrintManager)
|
||||
{ // private implementation
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
inline
|
||||
WORD PrintManager::getCount(void)const
|
||||
{
|
||||
return mPrinters.size();
|
||||
}
|
||||
|
||||
inline
|
||||
const Printer &PrintManager::getDefaultPrinter(void)const
|
||||
{
|
||||
return mDefaultPrinter;
|
||||
}
|
||||
|
||||
inline
|
||||
bool PrintManager::getFirstPrinter(Printer &printer)
|
||||
{
|
||||
if(!mPrinters.size())return FALSE;
|
||||
printer=mPrinters[(mIndexPrinter=0)];
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
inline
|
||||
bool PrintManager::getNextPrinter(Printer &printer)
|
||||
{
|
||||
if(++mIndexPrinter>=mPrinters.size())return FALSE;
|
||||
printer=mPrinters[mIndexPrinter];
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
inline
|
||||
void PrintManager::closePrinter(void)
|
||||
{
|
||||
if(isInPage())endPage();
|
||||
if(isInDoc())endDoc();
|
||||
mPrinterDevice.destroyDevice();
|
||||
}
|
||||
|
||||
inline
|
||||
bool PrintManager::startPage(void)
|
||||
{
|
||||
int returnCode;
|
||||
if(!isInDoc()||!mPrinterDevice.isOkay())return FALSE;
|
||||
if(isInPage())endPage();
|
||||
returnCode=::StartPage(mPrinterDevice);
|
||||
if(returnCode>0)isInPage(TRUE);
|
||||
return isInPage();
|
||||
}
|
||||
|
||||
inline
|
||||
bool PrintManager::endPage(void)
|
||||
{
|
||||
bool returnCode(FALSE);
|
||||
|
||||
if(!isInPage()||!isInDoc()||!mPrinterDevice.isOkay())return returnCode;
|
||||
returnCode=::EndPage(mPrinterDevice)?TRUE:FALSE;
|
||||
isInPage(FALSE);
|
||||
return returnCode;
|
||||
}
|
||||
|
||||
inline
|
||||
bool PrintManager::endDoc(void)
|
||||
{
|
||||
bool returnCode(FALSE);
|
||||
|
||||
if(!isInDoc()||!mPrinterDevice.isOkay())return returnCode;
|
||||
if(isInPage())endPage();
|
||||
if(mAbortDlg.isOkay()){mAbortDlg->destroy();mAbortDlg.destroy();}
|
||||
returnCode=::EndDoc(mPrinterDevice)?TRUE:FALSE;
|
||||
isInDoc(FALSE);
|
||||
return returnCode;
|
||||
}
|
||||
|
||||
inline
|
||||
bool PrintManager::abortDoc(void)
|
||||
{
|
||||
bool returnCode(FALSE);
|
||||
|
||||
if(!isInDoc()||!mPrinterDevice.isOkay())return returnCode;
|
||||
returnCode=::AbortDoc(mPrinterDevice)?TRUE:FALSE;
|
||||
isInPage(FALSE);
|
||||
return returnCode;
|
||||
}
|
||||
|
||||
inline
|
||||
PureDevice &PrintManager::printerDevice(void)
|
||||
{
|
||||
assert(FALSE!=mPrinterDevice.isOkay());
|
||||
return mPrinterDevice;
|
||||
}
|
||||
|
||||
inline
|
||||
bool PrintManager::isInDoc(void)const
|
||||
{
|
||||
return mIsInDoc;
|
||||
}
|
||||
|
||||
inline
|
||||
void PrintManager::isInDoc(bool isInDoc)
|
||||
{
|
||||
mIsInDoc=isInDoc;
|
||||
}
|
||||
|
||||
inline
|
||||
bool PrintManager::isInPage(void)const
|
||||
{
|
||||
return mIsInPage;
|
||||
}
|
||||
|
||||
inline
|
||||
void PrintManager::isInPage(bool isInPage)
|
||||
{
|
||||
mIsInPage=isInPage;
|
||||
}
|
||||
#endif
|
||||
25
printman/PRINTMAN.PLG
Normal file
25
printman/PRINTMAN.PLG
Normal file
@@ -0,0 +1,25 @@
|
||||
<html>
|
||||
<body>
|
||||
<pre>
|
||||
<h1>Build Log</h1>
|
||||
<h3>
|
||||
--------------------Configuration: printman - Win32 Debug--------------------
|
||||
</h3>
|
||||
<h3>Command Lines</h3>
|
||||
Creating temporary file "C:\WINNT\Profiles\sean\LOCALS~1\Temp\RSP9B.tmp" with contents
|
||||
[
|
||||
/nologo /MTd /GX /Z7 /Od /D "_DEBUG" /D "STRICT" /D "__FLAT__" /D "WIN32" /D "_WINDOWS" /Fp"msvcobj/Printman.pch" /YX /Fo"msvcobj/" /Fd"msvcobj/" /FD /c
|
||||
"D:\work\printman\Printman.cpp"
|
||||
]
|
||||
Creating command line "cl.exe @C:\WINNT\Profiles\sean\LOCALS~1\Temp\RSP9B.tmp"
|
||||
<h3>Output Window</h3>
|
||||
Compiling...
|
||||
Printman.cpp
|
||||
|
||||
|
||||
|
||||
<h3>Results</h3>
|
||||
Printman.obj - 0 error(s), 0 warning(s)
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
||||
90
printman/Printman.001
Normal file
90
printman/Printman.001
Normal file
@@ -0,0 +1,90 @@
|
||||
# Microsoft Developer Studio Project File - Name="printman" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 5.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Static Library" 0x0104
|
||||
|
||||
CFG=printman - Win32 Debug
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "printman.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "printman.mak" CFG="printman - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "printman - Win32 Release" (based on "Win32 (x86) Static Library")
|
||||
!MESSAGE "printman - Win32 Debug" (based on "Win32 (x86) Static Library")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP Scc_ProjName ""
|
||||
# PROP Scc_LocalPath ""
|
||||
CPP=cl.exe
|
||||
|
||||
!IF "$(CFG)" == "printman - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release"
|
||||
# PROP BASE Intermediate_Dir "Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "Release"
|
||||
# PROP Intermediate_Dir "Release"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
|
||||
# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LIB32=link.exe -lib
|
||||
# ADD BASE LIB32 /nologo
|
||||
# ADD LIB32 /nologo
|
||||
|
||||
!ELSEIF "$(CFG)" == "printman - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "Debug"
|
||||
# PROP BASE Intermediate_Dir "Debug"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "msvcobj"
|
||||
# PROP Intermediate_Dir "msvcobj"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /Z7 /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
|
||||
# ADD CPP /nologo /Zp1 /MTd /GX /Z7 /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "STRICT" /D "__FLAT__" /YX /FD /c
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LIB32=link.exe -lib
|
||||
# ADD BASE LIB32 /nologo
|
||||
# ADD LIB32 /nologo /out:"..\exe\printman.lib"
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "printman - Win32 Release"
|
||||
# Name "printman - Win32 Debug"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Abortdlg.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\pickdlg.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Printman.cpp
|
||||
# End Source File
|
||||
# End Target
|
||||
# End Project
|
||||
306
printman/Printman.cpp
Normal file
306
printman/Printman.cpp
Normal file
@@ -0,0 +1,306 @@
|
||||
#include <printman/printman.hpp>
|
||||
#include <printman/abortdlg.hpp>
|
||||
#include <printman/pickdlg.hpp>
|
||||
#include <common/regkey.hpp>
|
||||
#include <common/guiwnd.hpp>
|
||||
#include <common/bitmap.hpp>
|
||||
#include <common/resbmp.hpp>
|
||||
#include <common/bminfo.hpp>
|
||||
#include <common/purebmp.hpp>
|
||||
#include <common/version.hpp>
|
||||
#include <common/commdlg.hpp>
|
||||
|
||||
PrintManager::PrintManager(void)
|
||||
: mIndexPrinter(0), mIsInDoc(FALSE), mIsInPage(FALSE),
|
||||
mPrinterKey("System\\CurrentControlSet\\Control\\Print\\Printers")
|
||||
{
|
||||
getPrinters();
|
||||
}
|
||||
|
||||
PrintManager::PrintManager(const PrintManager &somePrintManager)
|
||||
{ // private implementation
|
||||
*this=somePrintManager;
|
||||
}
|
||||
|
||||
PrintManager::~PrintManager()
|
||||
{
|
||||
closePrinter();
|
||||
}
|
||||
|
||||
bool PrintManager::choosePrinter(GUIWindow &parentWindow,String &strPrinter)
|
||||
{
|
||||
PickDlg pickDlg;
|
||||
strPrinter=mDefaultPrinter.printerName();
|
||||
return pickDlg.perform(parentWindow,mPrinters,strPrinter);
|
||||
}
|
||||
|
||||
bool PrintManager::choosePrinter(GUIWindow &parentWindow,Printer &printer)
|
||||
{
|
||||
PRINTDLG printDlg;
|
||||
GlobalData<BYTE> devNames;
|
||||
DEVNAMES *pDevNames=0;
|
||||
|
||||
::memset(&printDlg,0,sizeof(PRINTDLG));
|
||||
printDlg.lStructSize=sizeof(PRINTDLG);
|
||||
if(!PrintDlg(&printDlg))return false;
|
||||
pDevNames=(DEVNAMES*)::GlobalLock(printDlg.hDevNames);
|
||||
printer.printerName((char*)((char*)pDevNames+pDevNames->wDriverOffset));
|
||||
printer.driverName((char*)((char*)pDevNames+pDevNames->wDeviceOffset));
|
||||
printer.portName((char*)((char*)pDevNames+pDevNames->wOutputOffset));
|
||||
::GlobalUnlock(printDlg.hDevNames);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool PrintManager::getPrinters(void)
|
||||
{
|
||||
mPrinters.remove();
|
||||
RegKey regKey(RegKey::CurrentConfig);
|
||||
if(regKey.openKey(mPrinterKey))
|
||||
{
|
||||
getPrinters(regKey,mPrinterKey);
|
||||
regKey.closeKey();
|
||||
}
|
||||
if(regKey.openKey(RegKey::LocalMachine,mPrinterKey))
|
||||
{
|
||||
getPrinters(regKey,mPrinterKey);
|
||||
regKey.closeKey();
|
||||
}
|
||||
if(mPrinters.size()&&mDefaultPrinter.printerName().isNull())
|
||||
{
|
||||
mDefaultPrinter=mPrinters[0];
|
||||
}
|
||||
return mPrinters.size()?true:false;
|
||||
}
|
||||
|
||||
bool PrintManager::getPrinters(RegKey ®Key,const String &strPrinterKey)
|
||||
{
|
||||
String strDefaultPrinter;
|
||||
Printer printer;
|
||||
String strPrinter;
|
||||
int enumKey(0);
|
||||
|
||||
regKey.queryValue("Default",strDefaultPrinter);
|
||||
if(getPrinter(strPrinterKey+String("\\")+strDefaultPrinter,printer))mDefaultPrinter=printer;
|
||||
while(true)
|
||||
{
|
||||
if(!regKey.enumKey(enumKey++,strPrinter))break;
|
||||
if(getPrinter(strPrinterKey+String("\\")+strPrinter,printer))mPrinters.insert(&printer);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
bool PrintManager::getPrinter(String &strPrinterKey,Printer &printer)
|
||||
{
|
||||
RegKey mchKey(RegKey::LocalMachine);
|
||||
String strPrinterNameKey("Name");
|
||||
String strPrinterDriverKey("Printer Driver");
|
||||
String strPrinterPortKey("Port");
|
||||
String strQuery;
|
||||
|
||||
if(!mchKey.openKey(strPrinterKey))return false;
|
||||
mchKey.queryValue(strPrinterNameKey,strQuery);
|
||||
printer.printerName(strQuery);
|
||||
mchKey.queryValue(strPrinterDriverKey,strQuery);
|
||||
printer.driverName(strQuery);
|
||||
mchKey.queryValue(strPrinterPortKey,strQuery);
|
||||
printer.portName(strQuery);
|
||||
mchKey.closeKey();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool PrintManager::openPrinter(const Printer &printer,GUIWindow &parentWindow,const String &strPrintDocName)
|
||||
{
|
||||
mParentWindow=&parentWindow;
|
||||
WinVersionInfo winVersion;
|
||||
|
||||
closePrinter();
|
||||
mPrinterDevice=::CreateDC(printer.printerName(),printer.driverName(),printer.portName(),0);
|
||||
mPrinterDevice.disposition(PureDevice::DeleteDC);
|
||||
if(!mPrinterDevice.isOkay())return false;
|
||||
startDoc(strPrintDocName);
|
||||
::SetAbortProc(mPrinterDevice,&abortProc);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool PrintManager::openPrinter(const String &strPrinterName,GUIWindow &parentWindow,const String &strPrintDocName)
|
||||
{
|
||||
mParentWindow=&parentWindow;
|
||||
return openPrinter(strPrinterName,strPrintDocName);
|
||||
}
|
||||
|
||||
bool PrintManager::openPrinter(const String &strPrinterName,const String &strPrintDocName)
|
||||
{
|
||||
Printer printer;
|
||||
WinVersionInfo winVersion;
|
||||
int index;
|
||||
|
||||
closePrinter();
|
||||
if(strPrinterName==mDefaultPrinter.printerName())printer=mDefaultPrinter;
|
||||
else for(index=0;index<mPrinters.size();index++)if(strPrinterName==mPrinters[index].printerName()){printer=mPrinters[index];break;}
|
||||
if(index==mPrinters.size())return false;
|
||||
if(winVersion.isWin95())
|
||||
{
|
||||
mPrinterDevice=::CreateDC(0,printer.driverName(),0,0);
|
||||
}
|
||||
else
|
||||
{
|
||||
mPrinterDevice=::CreateDC("WINSPOOL",printer.driverName(),0,0);
|
||||
::OutputDebugString(String(String("Driver:")+String("WINSPOOL")+String("\n")).str());
|
||||
::OutputDebugString(String(String("Device:")+printer.driverName()+String("\n")).str());
|
||||
::OutputDebugString(String(String("Output:")+String("")+String("\n")).str());
|
||||
::OutputDebugString(String(String("DevMode:")+String("")+String("\n")).str());
|
||||
}
|
||||
mPrinterDevice.disposition(PureDevice::DeleteDC);
|
||||
if(!mPrinterDevice.isOkay())return false;
|
||||
startDoc(strPrintDocName);
|
||||
::SetAbortProc(mPrinterDevice,&abortProc);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool PrintManager::startDoc(const String &strPrintDocName)
|
||||
{
|
||||
DOCINFO printDocInfo;
|
||||
|
||||
::memset(&printDocInfo,0,sizeof(printDocInfo));
|
||||
printDocInfo.cbSize=sizeof(printDocInfo);
|
||||
printDocInfo.lpszDocName=(char*)(String&)strPrintDocName;
|
||||
::StartDoc(mPrinterDevice,&printDocInfo);
|
||||
isInDoc(true);
|
||||
createAbortDlg();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool PrintManager::printDevice(PureBitmap &pureBitmap,bool advancePage)
|
||||
{
|
||||
PureDevice cDev;
|
||||
cDev.compatibleDevice(mPrinterDevice);
|
||||
cDev.select(pureBitmap);
|
||||
if(!isInDoc()||!mPrinterDevice.isOkay())return false;
|
||||
if(!(::GetDeviceCaps(mPrinterDevice,RASTERCAPS)&RC_BITBLT))return false;
|
||||
if(advancePage&&isInPage())endPage();
|
||||
if(!isInPage()&&!startPage())return false;
|
||||
mPrinterDevice.bitBlt(Rect(0,0,pureBitmap.width(),pureBitmap.height()),cDev,Point(0,0));
|
||||
// mPrinterDevice.stretchBlt(Rect(0,0,pureBitmap.width(),pureBitmap.height()),cDev,Rect(0,0,pureBitmap.width(),pureBitmap.height()));
|
||||
// winDev.bitBlt(Rect(0,0,pureBitmap.width(),pureBitmap.height()),cDev,Point(0,0));
|
||||
if(advancePage)endPage();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool PrintManager::printBitmap(Bitmap &bitmap,bool advancePage,int width,int height)
|
||||
{
|
||||
if(!bitmap.isOkay())return false;
|
||||
if(!isInDoc()||!mPrinterDevice.isOkay())return false;
|
||||
if(!(::GetDeviceCaps(mPrinterDevice,RASTERCAPS)&RC_BITBLT))return false;
|
||||
if(advancePage&&isInPage())endPage();
|
||||
if(!isInPage())startPage();
|
||||
if(!width)width=bitmap.width();
|
||||
if(!height)height=bitmap.height();
|
||||
::StretchDIBits(mPrinterDevice,0,0,width,height,0,0,bitmap.width(),bitmap.height(),bitmap.getDataPtr(),(BITMAPINFO *)bitmap.getInfoPtr(),DIB_RGB_COLORS,SRCCOPY);
|
||||
if(advancePage)endPage();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool PrintManager::printBitmap(ResBitmap &resBitmap,bool advancePage,int width,int height)
|
||||
{
|
||||
if(!resBitmap.isOkay())return false;
|
||||
if(!isInDoc()||!mPrinterDevice.isOkay())return false;
|
||||
if(!(::GetDeviceCaps(mPrinterDevice,RASTERCAPS)&RC_BITBLT))return false;
|
||||
if(advancePage&&isInPage())endPage();
|
||||
if(!isInPage())startPage();
|
||||
if(!width)width=resBitmap.width();
|
||||
if(!height)height=resBitmap.height();
|
||||
::StretchDIBits(mPrinterDevice,0,0,width,height,0,0,resBitmap.width(),resBitmap.height(),resBitmap.ptrData(),(BITMAPINFO *)resBitmap,DIB_RGB_COLORS,SRCCOPY);
|
||||
if(advancePage)endPage();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool PrintManager::printBitmap(PureBitmap &pureBitmap,bool advancePage,WORD scale)
|
||||
{
|
||||
PurePalette purePalette;
|
||||
PureDevice compatibleDevice;
|
||||
BitmapInfo bmInfo;
|
||||
GlobalData<BYTE> bitmapBits;
|
||||
WORD scaleWidth;
|
||||
WORD scaleHeight;
|
||||
|
||||
if(!pureBitmap.isOkay())return false;
|
||||
if(!isInDoc()||!mPrinterDevice.isOkay())return false;
|
||||
if(!(::GetDeviceCaps(mPrinterDevice,RASTERCAPS)&RC_BITBLT))return false;
|
||||
if(advancePage&&isInPage())endPage();
|
||||
if(!isInPage()&&!startPage())return false;
|
||||
purePalette.systemPalette();
|
||||
pureBitmap.getBitmapInfo(bmInfo);
|
||||
if(bmInfo.bitCount()<=8)
|
||||
{
|
||||
purePalette.systemPalette();
|
||||
bmInfo=purePalette;
|
||||
}
|
||||
pureBitmap.getBitmapBits(bitmapBits,true);
|
||||
bmInfo.width(pureBitmap.width());
|
||||
bmInfo.height(pureBitmap.height());
|
||||
if(bmInfo.bitCount()<=8)mPrinterDevice.select(purePalette.getPalette(),true);
|
||||
scaleWidth=pureBitmap.width();
|
||||
scaleHeight=pureBitmap.height();
|
||||
scaleImage(scale,scaleWidth,scaleHeight);
|
||||
::StretchDIBits(mPrinterDevice,0,0,scaleWidth,scaleHeight,0,0,pureBitmap.width(),pureBitmap.height(),(BYTE*)&bitmapBits[0],(BITMAPINFO*)bmInfo,DIB_RGB_COLORS,SRCCOPY);
|
||||
if(advancePage)endPage();
|
||||
if(bmInfo.bitCount()<=8)mPrinterDevice.select(purePalette.getPalette(),false);
|
||||
return true;
|
||||
}
|
||||
|
||||
void PrintManager::scaleImage(float factor,WORD &width,WORD &height)const
|
||||
{
|
||||
float aspectRatio=((float)width/(float)height)-.05;
|
||||
|
||||
factor/=100.00;
|
||||
width=(float)width*factor;
|
||||
height=(float)width/aspectRatio;
|
||||
}
|
||||
|
||||
bool PrintManager::printLines(Block<String> &strLines,Font &pageFont,Point xyPoint,bool advancePage)
|
||||
{
|
||||
Point startPoint(xyPoint);
|
||||
SIZE sizeData;
|
||||
|
||||
if(!isInDoc()||!mPrinterDevice.isOkay())return false;
|
||||
if(advancePage&&isInPage())endPage();
|
||||
if(!isInPage())startPage();
|
||||
mPrinterDevice.select((GDIObj)pageFont,true);
|
||||
for(int index=0;index<strLines.size();index++)
|
||||
{
|
||||
String &strLine=strLines[index];
|
||||
if(xyPoint.y()>mPrinterDevice.verticalResolution()+5){endPage();startPage();xyPoint=startPoint;}
|
||||
mPrinterDevice.getTextExtentPoint32(strLine,&sizeData);
|
||||
mPrinterDevice.textOut(xyPoint.x(),xyPoint.y(),strLine);
|
||||
xyPoint.y(xyPoint.y()+sizeData.cy+5);
|
||||
if(mAbortDlg.isOkay())
|
||||
{
|
||||
mAbortDlg->yieldTask();
|
||||
if(mAbortDlg->isCancelled()){abortDoc();return false;}
|
||||
}
|
||||
}
|
||||
endPage();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool PrintManager::createAbortDlg(void)
|
||||
{
|
||||
if(!mParentWindow.isOkay())return true;
|
||||
if(mAbortDlg.isOkay()){mAbortDlg->destroy();mAbortDlg.destroy();}
|
||||
mAbortDlg=::new AbortDlg;
|
||||
mAbortDlg.disposition(PointerDisposition::Delete);
|
||||
mAbortDlg->perform(*mParentWindow);
|
||||
return true;
|
||||
}
|
||||
|
||||
BOOL CALLBACK PrintManager::abortProc(HDC hDC,int nCode)
|
||||
{
|
||||
MSG msg;
|
||||
if(!nCode)return true;
|
||||
while(::PeekMessage(&msg,NULL,0,0,PM_NOREMOVE))
|
||||
{
|
||||
::TranslateMessage(&msg);
|
||||
::DispatchMessage(&msg);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
96
printman/Printman.dsp
Normal file
96
printman/Printman.dsp
Normal file
@@ -0,0 +1,96 @@
|
||||
# Microsoft Developer Studio Project File - Name="printman" - Package Owner=<4>
|
||||
# Microsoft Developer Studio Generated Build File, Format Version 6.00
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Static Library" 0x0104
|
||||
|
||||
CFG=printman - Win32 Debug
|
||||
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
|
||||
!MESSAGE use the Export Makefile command and run
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "Printman.mak".
|
||||
!MESSAGE
|
||||
!MESSAGE You can specify a configuration when running NMAKE
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "Printman.mak" CFG="printman - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "printman - Win32 Release" (based on "Win32 (x86) Static Library")
|
||||
!MESSAGE "printman - Win32 Debug" (based on "Win32 (x86) Static Library")
|
||||
!MESSAGE
|
||||
|
||||
# Begin Project
|
||||
# PROP AllowPerConfigDependencies 0
|
||||
# PROP Scc_ProjName ""
|
||||
# PROP Scc_LocalPath ""
|
||||
CPP=cl.exe
|
||||
RSC=rc.exe
|
||||
|
||||
!IF "$(CFG)" == "printman - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release"
|
||||
# PROP BASE Intermediate_Dir "Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "Release"
|
||||
# PROP Intermediate_Dir "Release"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
|
||||
# ADD CPP /nologo /MT /GX /O2 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "__FLAT__" /D "STRICT" /YX /FD /c
|
||||
# ADD BASE RSC /l 0x409
|
||||
# ADD RSC /l 0x409
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LIB32=link.exe -lib
|
||||
# ADD BASE LIB32 /nologo
|
||||
# ADD LIB32 /nologo
|
||||
|
||||
!ELSEIF "$(CFG)" == "printman - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "Debug"
|
||||
# PROP BASE Intermediate_Dir "Debug"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "msvcobj"
|
||||
# PROP Intermediate_Dir "msvcobj"
|
||||
# PROP Target_Dir ""
|
||||
# ADD BASE CPP /nologo /W3 /GX /Z7 /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
|
||||
# ADD CPP /nologo /Gz /MTd /GX /Z7 /Od /D "_DEBUG" /D "STRICT" /D "__FLAT__" /D "WIN32" /D "_WINDOWS" /YX /FD /c
|
||||
# ADD BASE RSC /l 0x409
|
||||
# ADD RSC /l 0x409
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
LIB32=link.exe -lib
|
||||
# ADD BASE LIB32 /nologo
|
||||
# ADD LIB32 /nologo /out:"..\exe\printman.lib"
|
||||
|
||||
!ENDIF
|
||||
|
||||
# Begin Target
|
||||
|
||||
# Name "printman - Win32 Release"
|
||||
# Name "printman - Win32 Debug"
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Abortdlg.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\pickdlg.cpp
|
||||
# End Source File
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Printman.cpp
|
||||
# End Source File
|
||||
# End Target
|
||||
# End Project
|
||||
373
printman/Printman.mak
Normal file
373
printman/Printman.mak
Normal file
@@ -0,0 +1,373 @@
|
||||
# Microsoft Developer Studio Generated NMAKE File, Format Version 4.20
|
||||
# ** DO NOT EDIT **
|
||||
|
||||
# TARGTYPE "Win32 (x86) Static Library" 0x0104
|
||||
|
||||
!IF "$(CFG)" == ""
|
||||
CFG=printman - Win32 Debug
|
||||
!MESSAGE No configuration specified. Defaulting to printman - Win32 Debug.
|
||||
!ENDIF
|
||||
|
||||
!IF "$(CFG)" != "printman - Win32 Release" && "$(CFG)" !=\
|
||||
"printman - Win32 Debug"
|
||||
!MESSAGE Invalid configuration "$(CFG)" specified.
|
||||
!MESSAGE You can specify a configuration when running NMAKE on this makefile
|
||||
!MESSAGE by defining the macro CFG on the command line. For example:
|
||||
!MESSAGE
|
||||
!MESSAGE NMAKE /f "printman.mak" CFG="printman - Win32 Debug"
|
||||
!MESSAGE
|
||||
!MESSAGE Possible choices for configuration are:
|
||||
!MESSAGE
|
||||
!MESSAGE "printman - Win32 Release" (based on "Win32 (x86) Static Library")
|
||||
!MESSAGE "printman - Win32 Debug" (based on "Win32 (x86) Static Library")
|
||||
!MESSAGE
|
||||
!ERROR An invalid configuration is specified.
|
||||
!ENDIF
|
||||
|
||||
!IF "$(OS)" == "Windows_NT"
|
||||
NULL=
|
||||
!ELSE
|
||||
NULL=nul
|
||||
!ENDIF
|
||||
################################################################################
|
||||
# Begin Project
|
||||
# PROP Target_Last_Scanned "printman - Win32 Debug"
|
||||
CPP=cl.exe
|
||||
|
||||
!IF "$(CFG)" == "printman - Win32 Release"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 0
|
||||
# PROP BASE Output_Dir "Release"
|
||||
# PROP BASE Intermediate_Dir "Release"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 0
|
||||
# PROP Output_Dir "Release"
|
||||
# PROP Intermediate_Dir "Release"
|
||||
# PROP Target_Dir ""
|
||||
OUTDIR=.\Release
|
||||
INTDIR=.\Release
|
||||
|
||||
ALL : "$(OUTDIR)\printman.lib"
|
||||
|
||||
CLEAN :
|
||||
-@erase "$(INTDIR)\Abortdlg.obj"
|
||||
-@erase "$(INTDIR)\Pickdlg.obj"
|
||||
-@erase "$(INTDIR)\Printman.obj"
|
||||
-@erase "$(OUTDIR)\printman.lib"
|
||||
|
||||
"$(OUTDIR)" :
|
||||
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
|
||||
|
||||
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /c
|
||||
# ADD CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /c
|
||||
CPP_PROJ=/nologo /ML /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS"\
|
||||
/Fp"$(INTDIR)/printman.pch" /YX /Fo"$(INTDIR)/" /c
|
||||
CPP_OBJS=.\Release/
|
||||
CPP_SBRS=.\.
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
BSC32_FLAGS=/nologo /o"$(OUTDIR)/printman.bsc"
|
||||
BSC32_SBRS= \
|
||||
|
||||
LIB32=link.exe -lib
|
||||
# ADD BASE LIB32 /nologo
|
||||
# ADD LIB32 /nologo
|
||||
LIB32_FLAGS=/nologo /out:"$(OUTDIR)/printman.lib"
|
||||
LIB32_OBJS= \
|
||||
"$(INTDIR)\Abortdlg.obj" \
|
||||
"$(INTDIR)\Pickdlg.obj" \
|
||||
"$(INTDIR)\Printman.obj"
|
||||
|
||||
"$(OUTDIR)\printman.lib" : "$(OUTDIR)" $(DEF_FILE) $(LIB32_OBJS)
|
||||
$(LIB32) @<<
|
||||
$(LIB32_FLAGS) $(DEF_FLAGS) $(LIB32_OBJS)
|
||||
<<
|
||||
|
||||
!ELSEIF "$(CFG)" == "printman - Win32 Debug"
|
||||
|
||||
# PROP BASE Use_MFC 0
|
||||
# PROP BASE Use_Debug_Libraries 1
|
||||
# PROP BASE Output_Dir "Debug"
|
||||
# PROP BASE Intermediate_Dir "Debug"
|
||||
# PROP BASE Target_Dir ""
|
||||
# PROP Use_MFC 0
|
||||
# PROP Use_Debug_Libraries 1
|
||||
# PROP Output_Dir "msvcobj"
|
||||
# PROP Intermediate_Dir "msvcobj"
|
||||
# PROP Target_Dir ""
|
||||
OUTDIR=.\msvcobj
|
||||
INTDIR=.\msvcobj
|
||||
|
||||
ALL : "..\exe\printman.lib"
|
||||
|
||||
CLEAN :
|
||||
-@erase "$(INTDIR)\Abortdlg.obj"
|
||||
-@erase "$(INTDIR)\Pickdlg.obj"
|
||||
-@erase "$(INTDIR)\Printman.obj"
|
||||
-@erase "..\exe\printman.lib"
|
||||
|
||||
"$(OUTDIR)" :
|
||||
if not exist "$(OUTDIR)/$(NULL)" mkdir "$(OUTDIR)"
|
||||
|
||||
# ADD BASE CPP /nologo /W3 /GX /Z7 /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /c
|
||||
# ADD CPP /nologo /Zp1 /MTd /GX /Z7 /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "STRICT" /D "__FLAT__" /YX /c
|
||||
CPP_PROJ=/nologo /Zp1 /MTd /GX /Z7 /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D\
|
||||
"STRICT" /D "__FLAT__" /Fp"$(INTDIR)/printman.pch" /YX /Fo"$(INTDIR)/" /c
|
||||
CPP_OBJS=.\msvcobj/
|
||||
CPP_SBRS=.\.
|
||||
BSC32=bscmake.exe
|
||||
# ADD BASE BSC32 /nologo
|
||||
# ADD BSC32 /nologo
|
||||
BSC32_FLAGS=/nologo /o"$(OUTDIR)/printman.bsc"
|
||||
BSC32_SBRS= \
|
||||
|
||||
LIB32=link.exe -lib
|
||||
# ADD BASE LIB32 /nologo
|
||||
# ADD LIB32 /nologo /out:"..\exe\printman.lib"
|
||||
LIB32_FLAGS=/nologo /out:"..\exe\printman.lib"
|
||||
LIB32_OBJS= \
|
||||
"$(INTDIR)\Abortdlg.obj" \
|
||||
"$(INTDIR)\Pickdlg.obj" \
|
||||
"$(INTDIR)\Printman.obj"
|
||||
|
||||
"..\exe\printman.lib" : "$(OUTDIR)" $(DEF_FILE) $(LIB32_OBJS)
|
||||
$(LIB32) @<<
|
||||
$(LIB32_FLAGS) $(DEF_FLAGS) $(LIB32_OBJS)
|
||||
<<
|
||||
|
||||
!ENDIF
|
||||
|
||||
.c{$(CPP_OBJS)}.obj:
|
||||
$(CPP) $(CPP_PROJ) $<
|
||||
|
||||
.cpp{$(CPP_OBJS)}.obj:
|
||||
$(CPP) $(CPP_PROJ) $<
|
||||
|
||||
.cxx{$(CPP_OBJS)}.obj:
|
||||
$(CPP) $(CPP_PROJ) $<
|
||||
|
||||
.c{$(CPP_SBRS)}.sbr:
|
||||
$(CPP) $(CPP_PROJ) $<
|
||||
|
||||
.cpp{$(CPP_SBRS)}.sbr:
|
||||
$(CPP) $(CPP_PROJ) $<
|
||||
|
||||
.cxx{$(CPP_SBRS)}.sbr:
|
||||
$(CPP) $(CPP_PROJ) $<
|
||||
|
||||
################################################################################
|
||||
# Begin Target
|
||||
|
||||
# Name "printman - Win32 Release"
|
||||
# Name "printman - Win32 Debug"
|
||||
|
||||
!IF "$(CFG)" == "printman - Win32 Release"
|
||||
|
||||
!ELSEIF "$(CFG)" == "printman - Win32 Debug"
|
||||
|
||||
!ENDIF
|
||||
|
||||
################################################################################
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Printman.cpp
|
||||
|
||||
!IF "$(CFG)" == "printman - Win32 Release"
|
||||
|
||||
DEP_CPP_PRINT=\
|
||||
{$(INCLUDE)}"\.\Abortdlg.hpp"\
|
||||
{$(INCLUDE)}"\.\Pickdlg.hpp"\
|
||||
{$(INCLUDE)}"\.\Printman.hpp"\
|
||||
{$(INCLUDE)}"\Common\array.hpp"\
|
||||
{$(INCLUDE)}"\Common\Assert.hpp"\
|
||||
{$(INCLUDE)}"\Common\Bitmap.hpp"\
|
||||
{$(INCLUDE)}"\Common\Block.hpp"\
|
||||
{$(INCLUDE)}"\Common\Block.tpp"\
|
||||
{$(INCLUDE)}"\Common\Bmdata.hpp"\
|
||||
{$(INCLUDE)}"\Common\Bminfo.hpp"\
|
||||
{$(INCLUDE)}"\Common\Boverlay.hpp"\
|
||||
{$(INCLUDE)}"\Common\Callback.hpp"\
|
||||
{$(INCLUDE)}"\Common\Callback.tpp"\
|
||||
{$(INCLUDE)}"\Common\Cbdata.hpp"\
|
||||
{$(INCLUDE)}"\Common\Cbptr.hpp"\
|
||||
{$(INCLUDE)}"\Common\except.hpp"\
|
||||
{$(INCLUDE)}"\Common\Fixup.hpp"\
|
||||
{$(INCLUDE)}"\Common\Gdata.hpp"\
|
||||
{$(INCLUDE)}"\Common\Gdata.tpp"\
|
||||
{$(INCLUDE)}"\Common\Gdiobj.hpp"\
|
||||
{$(INCLUDE)}"\Common\Gdipoint.hpp"\
|
||||
{$(INCLUDE)}"\Common\Guiwnd.hpp"\
|
||||
{$(INCLUDE)}"\Common\Palentry.hpp"\
|
||||
{$(INCLUDE)}"\Common\Pcallbck.hpp"\
|
||||
{$(INCLUDE)}"\Common\Pen.hpp"\
|
||||
{$(INCLUDE)}"\Common\Point.hpp"\
|
||||
{$(INCLUDE)}"\Common\Purebmp.hpp"\
|
||||
{$(INCLUDE)}"\Common\Purehdc.hpp"\
|
||||
{$(INCLUDE)}"\Common\Purepal.hpp"\
|
||||
{$(INCLUDE)}"\Common\Pvector.hpp"\
|
||||
{$(INCLUDE)}"\Common\Pvector.tpp"\
|
||||
{$(INCLUDE)}"\Common\Rect.hpp"\
|
||||
{$(INCLUDE)}"\Common\Regkey.hpp"\
|
||||
{$(INCLUDE)}"\Common\Regsam.hpp"\
|
||||
{$(INCLUDE)}"\Common\Resbmp.hpp"\
|
||||
{$(INCLUDE)}"\Common\Resdata.hpp"\
|
||||
{$(INCLUDE)}"\Common\Rgbcolor.hpp"\
|
||||
{$(INCLUDE)}"\Common\Rgbquad.hpp"\
|
||||
{$(INCLUDE)}"\Common\Shellapi.hpp"\
|
||||
{$(INCLUDE)}"\Common\Stdlib.hpp"\
|
||||
{$(INCLUDE)}"\Common\String.hpp"\
|
||||
{$(INCLUDE)}"\Common\Types.hpp"\
|
||||
{$(INCLUDE)}"\Common\Vhandler.hpp"\
|
||||
{$(INCLUDE)}"\Common\Windows.hpp"\
|
||||
{$(INCLUDE)}"\Common\Windowsx.hpp"\
|
||||
{$(INCLUDE)}"\Dialog\Dyndlg.hpp"\
|
||||
|
||||
|
||||
"$(INTDIR)\Printman.obj" : $(SOURCE) $(DEP_CPP_PRINT) "$(INTDIR)"
|
||||
|
||||
|
||||
!ELSEIF "$(CFG)" == "printman - Win32 Debug"
|
||||
|
||||
DEP_CPP_PRINT=\
|
||||
{$(INCLUDE)}"\.\Abortdlg.hpp"\
|
||||
{$(INCLUDE)}"\.\Pickdlg.hpp"\
|
||||
{$(INCLUDE)}"\.\Printer.hpp"\
|
||||
{$(INCLUDE)}"\.\Printman.hpp"\
|
||||
{$(INCLUDE)}"\Common\array.hpp"\
|
||||
{$(INCLUDE)}"\Common\Assert.hpp"\
|
||||
{$(INCLUDE)}"\Common\Bitmap.hpp"\
|
||||
{$(INCLUDE)}"\Common\Block.hpp"\
|
||||
{$(INCLUDE)}"\Common\Block.tpp"\
|
||||
{$(INCLUDE)}"\Common\Bmdata.hpp"\
|
||||
{$(INCLUDE)}"\Common\Bminfo.hpp"\
|
||||
{$(INCLUDE)}"\Common\Boverlay.hpp"\
|
||||
{$(INCLUDE)}"\Common\Callback.hpp"\
|
||||
{$(INCLUDE)}"\Common\Callback.tpp"\
|
||||
{$(INCLUDE)}"\Common\Cbdata.hpp"\
|
||||
{$(INCLUDE)}"\Common\Cbptr.hpp"\
|
||||
{$(INCLUDE)}"\Common\Dwindow.hpp"\
|
||||
{$(INCLUDE)}"\Common\except.hpp"\
|
||||
{$(INCLUDE)}"\Common\Fixup.hpp"\
|
||||
{$(INCLUDE)}"\Common\Font.hpp"\
|
||||
{$(INCLUDE)}"\Common\Gdata.hpp"\
|
||||
{$(INCLUDE)}"\Common\Gdata.tpp"\
|
||||
{$(INCLUDE)}"\Common\Gdiobj.hpp"\
|
||||
{$(INCLUDE)}"\Common\Gdipoint.hpp"\
|
||||
{$(INCLUDE)}"\Common\Guiwnd.hpp"\
|
||||
{$(INCLUDE)}"\Common\Palentry.hpp"\
|
||||
{$(INCLUDE)}"\Common\Pcallbck.hpp"\
|
||||
{$(INCLUDE)}"\Common\Pen.hpp"\
|
||||
{$(INCLUDE)}"\Common\Point.hpp"\
|
||||
{$(INCLUDE)}"\Common\Pointer.hpp"\
|
||||
{$(INCLUDE)}"\Common\Purebmp.hpp"\
|
||||
{$(INCLUDE)}"\Common\Purehdc.hpp"\
|
||||
{$(INCLUDE)}"\Common\Purepal.hpp"\
|
||||
{$(INCLUDE)}"\Common\Pvector.hpp"\
|
||||
{$(INCLUDE)}"\Common\Pvector.tpp"\
|
||||
{$(INCLUDE)}"\Common\Rect.hpp"\
|
||||
{$(INCLUDE)}"\Common\Regkey.hpp"\
|
||||
{$(INCLUDE)}"\Common\Regsam.hpp"\
|
||||
{$(INCLUDE)}"\Common\Resbmp.hpp"\
|
||||
{$(INCLUDE)}"\Common\Resdata.hpp"\
|
||||
{$(INCLUDE)}"\Common\Rgbcolor.hpp"\
|
||||
{$(INCLUDE)}"\Common\Rgbquad.hpp"\
|
||||
{$(INCLUDE)}"\Common\Shellapi.hpp"\
|
||||
{$(INCLUDE)}"\Common\Stdlib.hpp"\
|
||||
{$(INCLUDE)}"\Common\String.hpp"\
|
||||
{$(INCLUDE)}"\Common\Types.hpp"\
|
||||
{$(INCLUDE)}"\Common\Vhandler.hpp"\
|
||||
{$(INCLUDE)}"\Common\Windows.hpp"\
|
||||
{$(INCLUDE)}"\Common\Windowsx.hpp"\
|
||||
{$(INCLUDE)}"\Dialog\Dlgitem.hpp"\
|
||||
{$(INCLUDE)}"\Dialog\Dlgtmpl.hpp"\
|
||||
{$(INCLUDE)}"\Dialog\Dyndlg.hpp"\
|
||||
|
||||
|
||||
"$(INTDIR)\Printman.obj" : $(SOURCE) $(DEP_CPP_PRINT) "$(INTDIR)"
|
||||
|
||||
|
||||
!ENDIF
|
||||
|
||||
# End Source File
|
||||
################################################################################
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Pickdlg.cpp
|
||||
DEP_CPP_PICKD=\
|
||||
{$(INCLUDE)}"\.\Pickdlg.hpp"\
|
||||
{$(INCLUDE)}"\.\Printer.hpp"\
|
||||
{$(INCLUDE)}"\Common\Block.hpp"\
|
||||
{$(INCLUDE)}"\Common\Block.tpp"\
|
||||
{$(INCLUDE)}"\Common\Callback.hpp"\
|
||||
{$(INCLUDE)}"\Common\Callback.tpp"\
|
||||
{$(INCLUDE)}"\Common\Cbdata.hpp"\
|
||||
{$(INCLUDE)}"\Common\Cbptr.hpp"\
|
||||
{$(INCLUDE)}"\Common\Dwindow.hpp"\
|
||||
{$(INCLUDE)}"\Common\except.hpp"\
|
||||
{$(INCLUDE)}"\Common\Gdata.hpp"\
|
||||
{$(INCLUDE)}"\Common\Gdata.tpp"\
|
||||
{$(INCLUDE)}"\Common\Gdipoint.hpp"\
|
||||
{$(INCLUDE)}"\Common\Guiwnd.hpp"\
|
||||
{$(INCLUDE)}"\common\keydata.hpp"\
|
||||
{$(INCLUDE)}"\Common\Pcallbck.hpp"\
|
||||
{$(INCLUDE)}"\Common\Point.hpp"\
|
||||
{$(INCLUDE)}"\Common\Pointer.hpp"\
|
||||
{$(INCLUDE)}"\Common\Rect.hpp"\
|
||||
{$(INCLUDE)}"\Common\Stdlib.hpp"\
|
||||
{$(INCLUDE)}"\Common\String.hpp"\
|
||||
{$(INCLUDE)}"\Common\Types.hpp"\
|
||||
{$(INCLUDE)}"\Common\Vhandler.hpp"\
|
||||
{$(INCLUDE)}"\Common\Windows.hpp"\
|
||||
{$(INCLUDE)}"\Common\Windowsx.hpp"\
|
||||
{$(INCLUDE)}"\Dialog\Dlgitem.hpp"\
|
||||
{$(INCLUDE)}"\Dialog\Dlgtmpl.hpp"\
|
||||
{$(INCLUDE)}"\Dialog\Dyndlg.hpp"\
|
||||
|
||||
|
||||
"$(INTDIR)\Pickdlg.obj" : $(SOURCE) $(DEP_CPP_PICKD) "$(INTDIR)"
|
||||
|
||||
|
||||
# End Source File
|
||||
################################################################################
|
||||
# Begin Source File
|
||||
|
||||
SOURCE=.\Abortdlg.cpp
|
||||
DEP_CPP_ABORT=\
|
||||
{$(INCLUDE)}"\.\Abortdlg.hpp"\
|
||||
{$(INCLUDE)}"\Common\Block.hpp"\
|
||||
{$(INCLUDE)}"\Common\Block.tpp"\
|
||||
{$(INCLUDE)}"\Common\Callback.hpp"\
|
||||
{$(INCLUDE)}"\Common\Callback.tpp"\
|
||||
{$(INCLUDE)}"\Common\Cbdata.hpp"\
|
||||
{$(INCLUDE)}"\Common\Cbptr.hpp"\
|
||||
{$(INCLUDE)}"\Common\Dwindow.hpp"\
|
||||
{$(INCLUDE)}"\Common\except.hpp"\
|
||||
{$(INCLUDE)}"\Common\Gdata.hpp"\
|
||||
{$(INCLUDE)}"\Common\Gdata.tpp"\
|
||||
{$(INCLUDE)}"\Common\Gdipoint.hpp"\
|
||||
{$(INCLUDE)}"\Common\Guiwnd.hpp"\
|
||||
{$(INCLUDE)}"\common\keydata.hpp"\
|
||||
{$(INCLUDE)}"\Common\Pcallbck.hpp"\
|
||||
{$(INCLUDE)}"\Common\Point.hpp"\
|
||||
{$(INCLUDE)}"\Common\Rect.hpp"\
|
||||
{$(INCLUDE)}"\Common\Stdlib.hpp"\
|
||||
{$(INCLUDE)}"\Common\String.hpp"\
|
||||
{$(INCLUDE)}"\Common\Types.hpp"\
|
||||
{$(INCLUDE)}"\Common\Vhandler.hpp"\
|
||||
{$(INCLUDE)}"\Common\Windows.hpp"\
|
||||
{$(INCLUDE)}"\Common\Windowsx.hpp"\
|
||||
{$(INCLUDE)}"\Dialog\Dlgitem.hpp"\
|
||||
{$(INCLUDE)}"\Dialog\Dlgtmpl.hpp"\
|
||||
{$(INCLUDE)}"\Dialog\Dyndlg.hpp"\
|
||||
|
||||
|
||||
"$(INTDIR)\Abortdlg.obj" : $(SOURCE) $(DEP_CPP_ABORT) "$(INTDIR)"
|
||||
|
||||
|
||||
# End Source File
|
||||
# End Target
|
||||
# End Project
|
||||
################################################################################
|
||||
BIN
printman/Release/Printman.lib
Normal file
BIN
printman/Release/Printman.lib
Normal file
Binary file not shown.
BIN
printman/Release/vc60.idb
Normal file
BIN
printman/Release/vc60.idb
Normal file
Binary file not shown.
96
printman/SCRAPS.TXT
Normal file
96
printman/SCRAPS.TXT
Normal file
@@ -0,0 +1,96 @@
|
||||
BOOL PrintManager::printBitmap(PureBitmap &pureBitmap,BOOL advancePage,int width,int height)
|
||||
{
|
||||
BitmapInfo bmInfo;
|
||||
PurePalette systemPalette;
|
||||
GlobalData<BYTE> bitmapBits;
|
||||
WORD bmWidth;
|
||||
WORD bmHeight;
|
||||
|
||||
if(!pureBitmap.isOkay())return FALSE;
|
||||
if(!isInDoc()||!mPrinterDevice.isOkay())return FALSE;
|
||||
if(!(::GetDeviceCaps(mPrinterDevice,RASTERCAPS)&RC_BITBLT))return FALSE;
|
||||
if(advancePage&&isInPage())endPage();
|
||||
if(!isInPage())startPage();
|
||||
systemPalette.systemPalette();
|
||||
bmWidth=pureBitmap.width();
|
||||
bmHeight=pureBitmap.height();
|
||||
pureBitmap.bitmapBits(bmWidth,bmHeight,bitmapBits);
|
||||
if(!width)width=bmWidth;
|
||||
if(!height)height=bmHeight;
|
||||
bmInfo.width(bmWidth);
|
||||
bmInfo.height(bmHeight);
|
||||
bmInfo=systemPalette;
|
||||
::StretchDIBits(mPrinterDevice,0,0,width,height,0,0,bmInfo.width(),bmInfo.height(),(BYTE*)&bitmapBits[0],(BITMAPINFO*)bmInfo,DIB_RGB_COLORS,SRCCOPY);
|
||||
if(advancePage)endPage();
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/*
|
||||
BOOL PrintManager::getPrinters(void)
|
||||
{
|
||||
String strPrinterKey("System\\CurrentControlSet\\Control\\Print\\Printers");
|
||||
String strDefaultPrinter;
|
||||
RegKey cfgKey(RegKey::CurrentConfig);
|
||||
Printer printer;
|
||||
String strPrinter;
|
||||
int enumKey(0);
|
||||
|
||||
mPrinters.remove();
|
||||
if(!cfgKey.openKey(strPrinterKey))return FALSE;
|
||||
cfgKey.queryValue("Default",strDefaultPrinter);
|
||||
if(getPrinter(strPrinterKey+String("\\")+strDefaultPrinter,printer))mDefaultPrinter=printer;
|
||||
while(TRUE)
|
||||
{
|
||||
if(!cfgKey.enumKey(enumKey++,strPrinter))break;
|
||||
if(getPrinter(strPrinterKey+String("\\")+strPrinter,printer))mPrinters.insert(&printer);
|
||||
}
|
||||
cfgKey.closeKey();
|
||||
return TRUE;
|
||||
}
|
||||
*/
|
||||
|
||||
|
||||
::OutputDebugString(String(String("Driver:")+printer.printerName()+String("\n")).str());
|
||||
::OutputDebugString(String(String("Device:")+printer.driverName()+String("\n")).str());
|
||||
::OutputDebugString(String(String("Output:")+printer.portName()+String("\n")).str());
|
||||
::OutputDebugString(String(String("DevMode:")+String("")+String("\n")).str());
|
||||
|
||||
|
||||
// printDlg.Flags=PD_RETURNIC;
|
||||
getDefaultDevNames(devNames);
|
||||
// printer name (driver offset) "winspool"
|
||||
// drivername (device offset) "IO//"
|
||||
// portname (output offset) "LPT1:"
|
||||
|
||||
printDlg.hDevNames=devNames.getHandle();
|
||||
|
||||
|
||||
void PrintManager::getDefaultDevNames(GlobalData<BYTE> &devNames)
|
||||
{
|
||||
String printerName;
|
||||
String driverName;
|
||||
String portName;
|
||||
DEVNAMES *pDevNames;
|
||||
char *pChrDevNames;
|
||||
|
||||
printerName=mDefaultPrinter.printerName();
|
||||
driverName=mDefaultPrinter.driverName();
|
||||
portName=mDefaultPrinter.portName();
|
||||
devNames.size(sizeof(DEVNAMES)+printerName.length()+1+driverName.length()+1+portName.length()+1,GMEM_MOVEABLE);
|
||||
devNames.setZero();
|
||||
pDevNames=(DEVNAMES*)&devNames[0];
|
||||
pDevNames->wDriverOffset=sizeof(DEVNAMES);
|
||||
pDevNames->wDeviceOffset=sizeof(DEVNAMES)+printerName.length()+1;
|
||||
pDevNames->wOutputOffset=sizeof(DEVNAMES)+printerName.length()+1+driverName.length()+1;
|
||||
pDevNames->wDefault=true;
|
||||
pChrDevNames=((char*)pDevNames)+pDevNames->wDriverOffset;
|
||||
::strcpy(pChrDevNames,printerName.str());
|
||||
pChrDevNames=((char*)pDevNames)+pDevNames->wDeviceOffset;
|
||||
::strcpy(pChrDevNames,driverName.str());
|
||||
pChrDevNames=((char*)pDevNames)+pDevNames->wOutputOffset;
|
||||
::strcpy(pChrDevNames,portName.str());
|
||||
}
|
||||
|
||||
|
||||
BIN
printman/printman.mdp
Normal file
BIN
printman/printman.mdp
Normal file
Binary file not shown.
BIN
printman/printman.opt
Normal file
BIN
printman/printman.opt
Normal file
Binary file not shown.
Reference in New Issue
Block a user