FreeBASIC  0.91.0
io_printer.c File Reference
#include "../fb.h"
#include <ctype.h>
#include <windows.h>
#include <winspool.h>
Include dependency graph for io_printer.c:

Go to the source code of this file.

Data Structures

struct  _W32_PRINTER_INFO
 
struct  _DEV_PRINTER_DEVICE
 
struct  _DEV_PRINTER_EMU_MODE
 

Typedefs

typedef BOOL(WINAPI * FnGetDefaultPrinter )(LPTSTR pszBuffer, LPDWORD pcchBuffer)
 
typedef void(* FnEmuPrint )(struct _W32_PRINTER_INFO *pInfo, const void *pText, size_t uiLength, int isunicode)
 
typedef struct _W32_PRINTER_INFO W32_PRINTER_INFO
 
typedef struct _DEV_PRINTER_DEVICE DEV_PRINTER_DEVICE
 
typedef struct
_DEV_PRINTER_EMU_MODE 
DEV_PRINTER_EMU_MODE
 

Functions

static void EmuBuild_LOGFONT (LOGFONT *lf, W32_PRINTER_INFO *pInfo, unsigned uiCPI)
 
static void EmuUpdateInfo (W32_PRINTER_INFO *pInfo)
 
static void EmuPrint_RAW (W32_PRINTER_INFO *pInfo, const void *pText, size_t uiLength, int isunicode)
 
static void EmuPrint_TTY (W32_PRINTER_INFO *pInfo, const void *pText, size_t uiLength, int isunicode)
 
static void fb_hListDevInit (FB_LIST *list)
 Initialize the list of device info nodes. More...
 
static DEV_PRINTER_DEVICEfb_hListDevElemAlloc (FB_LIST *list, const char *device, const char *printer_name)
 Allocate a new device info node. More...
 
static void fb_hListDevElemFree (FB_LIST *list, DEV_PRINTER_DEVICE *node)
 Remove the device info node and release its memory. More...
 
static void fb_hListDevClear (FB_LIST *list)
 Clear the list of device info nodes. More...
 
static DEV_PRINTER_DEVICEfb_hListDevFindDevice (FB_LIST *list, const char *pszDevice)
 Find the node containing the requested device. More...
 
static DEV_PRINTER_DEVICEfb_hListDevFindName (FB_LIST *list, const char *pszPrinterName)
 Find the node containing the requested printer name. More...
 
static PRINTER_INFO_5 * GetDefaultPrinters (int *pCount)
 
static PRINTER_INFO_2 * GetPrinters (int *pCount)
 
static char * GetDefaultPrinterName (void)
 
static void fb_hPrinterBuildListLocal (FB_LIST *list)
 
static int fb_hPrinterBuildListDefault (FB_LIST *list, int iStartPort)
 
static int fb_hPrinterBuildListOther (FB_LIST *list, int iStartPort)
 
static void fb_hPrinterBuildList (FB_LIST *list)
 
int fb_PrinterOpen (DEV_LPT_INFO *devInfo, int iPort, const char *pszDevice)
 
static void EmuPageStart (W32_PRINTER_INFO *pInfo)
 
static void fb_hHookConPrinterScroll (struct _fb_ConHooks *handle, int x1, int y1, int x2, int y2, int rows)
 
static int fb_hHookConPrinterWrite (struct _fb_ConHooks *handle, const void *buffer, size_t length)
 
static int fb_hHookConPrinterWriteWstr (struct _fb_ConHooks *handle, const void *buffer, size_t length)
 
int fb_PrinterWrite (DEV_LPT_INFO *devInfo, const void *data, size_t length)
 
int fb_PrinterWriteWstr (DEV_LPT_INFO *devInfo, const FB_WCHAR *data, size_t length)
 
int fb_PrinterClose (DEV_LPT_INFO *devInfo)
 

Variables

static const DEV_PRINTER_EMU_MODE aEmulationModes []
 

Typedef Documentation

typedef void(* FnEmuPrint)(struct _W32_PRINTER_INFO *pInfo, const void *pText, size_t uiLength, int isunicode)

Definition at line 12 of file io_printer.c.

typedef BOOL(WINAPI * FnGetDefaultPrinter)(LPTSTR pszBuffer, LPDWORD pcchBuffer)

Definition at line 8 of file io_printer.c.

Function Documentation

static void EmuBuild_LOGFONT ( LOGFONT *  lf,
W32_PRINTER_INFO pInfo,
unsigned  uiCPI 
)
static

Definition at line 574 of file io_printer.c.

Here is the caller graph for this function:

static void EmuPageStart ( W32_PRINTER_INFO pInfo)
static

Definition at line 607 of file io_printer.c.

Here is the call graph for this function:

Here is the caller graph for this function:

static void EmuPrint_RAW ( W32_PRINTER_INFO pInfo,
const void *  pText,
size_t  uiLength,
int  isunicode 
)
static

Definition at line 621 of file io_printer.c.

Here is the call graph for this function:

Here is the caller graph for this function:

static void EmuPrint_TTY ( W32_PRINTER_INFO pInfo,
const void *  pText,
size_t  uiLength,
int  isunicode 
)
static

Definition at line 711 of file io_printer.c.

Here is the call graph for this function:

static void EmuUpdateInfo ( W32_PRINTER_INFO pInfo)
static

Definition at line 596 of file io_printer.c.

Here is the caller graph for this function:

static void fb_hHookConPrinterScroll ( struct _fb_ConHooks handle,
int  x1,
int  y1,
int  x2,
int  y2,
int  rows 
)
static

Definition at line 662 of file io_printer.c.

Here is the caller graph for this function:

static int fb_hHookConPrinterWrite ( struct _fb_ConHooks handle,
const void *  buffer,
size_t  length 
)
static

Definition at line 688 of file io_printer.c.

Here is the call graph for this function:

Here is the caller graph for this function:

static int fb_hHookConPrinterWriteWstr ( struct _fb_ConHooks handle,
const void *  buffer,
size_t  length 
)
static

Definition at line 700 of file io_printer.c.

Here is the call graph for this function:

Here is the caller graph for this function:

static void fb_hListDevClear ( FB_LIST list)
static

Clear the list of device info nodes.

Definition at line 117 of file io_printer.c.

Here is the call graph for this function:

Here is the caller graph for this function:

static DEV_PRINTER_DEVICE* fb_hListDevElemAlloc ( FB_LIST list,
const char *  device,
const char *  printer_name 
)
static

Allocate a new device info node.

Returns
pointer to the new node

Definition at line 94 of file io_printer.c.

Here is the call graph for this function:

Here is the caller graph for this function:

static void fb_hListDevElemFree ( FB_LIST list,
DEV_PRINTER_DEVICE node 
)
static

Remove the device info node and release its memory.

Definition at line 106 of file io_printer.c.

Here is the call graph for this function:

Here is the caller graph for this function:

static DEV_PRINTER_DEVICE* fb_hListDevFindDevice ( FB_LIST list,
const char *  pszDevice 
)
static

Find the node containing the requested device.

Definition at line 127 of file io_printer.c.

Here is the caller graph for this function:

static DEV_PRINTER_DEVICE* fb_hListDevFindName ( FB_LIST list,
const char *  pszPrinterName 
)
static

Find the node containing the requested printer name.

Definition at line 143 of file io_printer.c.

Here is the caller graph for this function:

static void fb_hListDevInit ( FB_LIST list)
static

Initialize the list of device info nodes.

Definition at line 84 of file io_printer.c.

Here is the call graph for this function:

Here is the caller graph for this function:

static void fb_hPrinterBuildList ( FB_LIST list)
static

Definition at line 366 of file io_printer.c.

Here is the call graph for this function:

Here is the caller graph for this function:

static int fb_hPrinterBuildListDefault ( FB_LIST list,
int  iStartPort 
)
static

Definition at line 316 of file io_printer.c.

Here is the call graph for this function:

Here is the caller graph for this function:

static void fb_hPrinterBuildListLocal ( FB_LIST list)
static

Definition at line 276 of file io_printer.c.

Here is the call graph for this function:

Here is the caller graph for this function:

static int fb_hPrinterBuildListOther ( FB_LIST list,
int  iStartPort 
)
static

Definition at line 341 of file io_printer.c.

Here is the call graph for this function:

Here is the caller graph for this function:

int fb_PrinterClose ( DEV_LPT_INFO devInfo)

Definition at line 878 of file io_printer.c.

Here is the call graph for this function:

int fb_PrinterOpen ( DEV_LPT_INFO devInfo,
int  iPort,
const char *  pszDevice 
)

Definition at line 379 of file io_printer.c.

Here is the call graph for this function:

int fb_PrinterWrite ( DEV_LPT_INFO devInfo,
const void *  data,
size_t  length 
)

Definition at line 833 of file io_printer.c.

Here is the call graph for this function:

int fb_PrinterWriteWstr ( DEV_LPT_INFO devInfo,
const FB_WCHAR data,
size_t  length 
)

Definition at line 856 of file io_printer.c.

Here is the call graph for this function:

static char* GetDefaultPrinterName ( void  )
static

Definition at line 236 of file io_printer.c.

Here is the call graph for this function:

Here is the caller graph for this function:

static PRINTER_INFO_5* GetDefaultPrinters ( int *  pCount)
static

Definition at line 156 of file io_printer.c.

Here is the caller graph for this function:

static PRINTER_INFO_2* GetPrinters ( int *  pCount)
static

Definition at line 196 of file io_printer.c.

Here is the caller graph for this function:

Variable Documentation

const DEV_PRINTER_EMU_MODE aEmulationModes[]
static
Initial value:
= {
{ "RAW", EmuPrint_RAW }
, { "TTY", EmuPrint_TTY }
}

Definition at line 73 of file io_printer.c.