22#include <proto/utility.h>
23#include <proto/iffparse.h>
25#include <proto/intuition.h>
26#include <proto/Picasso96API.h>
27#include <devices/printer.h>
28#include <devices/prtbase.h>
30#include <prefs/prefhdr.h>
31#include <prefs/printertxt.h>
32#include <libraries/gadtools.h>
34#include <proto/window.h>
35#include <proto/layout.h>
36#include <proto/integer.h>
37#include <proto/label.h>
38#include <proto/chooser.h>
39#include <proto/fuelgauge.h>
40#include <classes/window.h>
41#include <gadgets/fuelgauge.h>
42#include <gadgets/layout.h>
43#include <gadgets/integer.h>
44#include <gadgets/chooser.h>
45#include <images/label.h>
47#include <reaction/reaction_macros.h>
101 struct PrinterData *
PD;
102 struct PrinterExtendedData *
PED;
121#define IFFPrefChunkCnt 2
157 for(i = 0; i < 10; i++) {
163 uint32 namesize,
int unitnum)
171 struct IFFHandle *iff;
172 struct ContextNode *cn;
173 struct PrefHeader phead;
174 struct PrinterDeviceUnitPrefs pdev;
176 SNPrintf(name,namesize,
"Unit %ld",unitnum);
177 fp = Open(filename, MODE_OLDFILE);
183 iff->iff_Stream = fp;
186 if (!OpenIFF(iff, IFFF_READ))
188 if (!ParseIFF(iff, IFFPARSE_STEP))
190 cn = CurrentChunk(iff);
191 if (cn->cn_ID == ID_FORM && cn->cn_Type == ID_PREF)
198 if (ParseIFF(iff, IFFPARSE_SCAN))
200 cn = CurrentChunk(iff);
201 if (cn->cn_Type == ID_PREF)
206 if (ReadChunkBytes(iff, &phead,
sizeof(
struct PrefHeader)) !=
sizeof(
struct PrefHeader))
211 if (phead.ph_Version != 0)
218 if (ReadChunkBytes(iff, &pdev,
sizeof(pdev)) ==
sizeof(pdev))
220 if (pdev.pd_UnitName[0])
221 strcpy(name,pdev.pd_UnitName);
255 strcpy(filename,
"ENV:Sys/printerN.prefs");
256 for (i = 1; i < 10; i++)
258 filename[15] =
'0' + i;
275 WA_DepthGadget, TRUE,
277 WA_CloseGadget, TRUE,
278 WA_SizeGadget, FALSE,
282 WINDOW_IconifyGadget, FALSE,
283 WINDOW_Position, WPOS_CENTERSCREEN,
285 LAYOUT_AddChild, ChooserObject,
292 CHILD_Label, LabelObject,
295 LAYOUT_AddChild, IntegerObject,
301 INTEGER_Maximum, 100,
302 INTEGER_Arrows, TRUE,
304 CHILD_Label, LabelObject,
307 LAYOUT_AddChild, HGroupObject,
308 LAYOUT_LabelColumn, PLACETEXT_RIGHT,
315 INTEGER_Maximum, 100,
316 INTEGER_Arrows, TRUE,
318 CHILD_WeightedWidth, 0,
319 CHILD_Label, LabelObject,
323 CHILD_Label, LabelObject,
326 LAYOUT_AddChild, HGroupObject,
333 CHILD_WeightedHeight,0,
341 CHILD_WeightedHeight,0,
370 switch(
result & WMHI_CLASSMASK)
373 switch(
result & WMHI_GADGETMASK)
381 (ULONG *)&printer_unit);
399 case WMHI_CLOSEWINDOW:
418 ASOIOR_Size,
sizeof(
struct IODRPTagsReq),
425 sizeof(
struct IODRPTagsReq))))
return;
428 if(OpenDevice(
"printer.device",
nsoption_int(printer_unit),
564 WA_DepthGadget, TRUE,
566 WA_CloseGadget, FALSE,
571 WINDOW_IconifyGadget, FALSE,
572 WINDOW_LockHeight,TRUE,
573 WINDOW_Position, WPOS_CENTERSCREEN,
581 FUELGAUGE_ShortTicks,TRUE,
582 FUELGAUGE_Percent,TRUE,
583 FUELGAUGE_Justification,FGJ_CENTER,
585 CHILD_NominalSize,TRUE,
586 CHILD_WeightedHeight,0,
struct Screen * ami_gui_get_screen(void)
Get a pointer to the screen NetSurf is running on.
nserror ami_gui_win_list_add(void *win, int type, const struct ami_win_event_table *table)
Add a window to the NetSurf window list (to enable event processing)
STRPTR ami_gui_get_screen_title(void)
Get the string for NetSurf's screen titlebar.
void ami_gui_win_list_remove(void *win)
Remove a window from the NetSurf window list.
struct MsgPort * ami_gui_get_shared_msgport(void)
Get shared message port.
nserror amiga_warn_user(const char *warning, const char *detail)
Warn the user of an event.
const struct plotter_table amiplot
void ami_plot_ra_free(struct gui_globals *gg)
Free a plotter render area.
struct RastPort * ami_plot_ra_get_rastport(struct gui_globals *gg)
Get RastPort associated with a render area.
struct gui_globals * ami_plot_ra_alloc(ULONG width, ULONG height, bool force32bit, bool alloc_pen_list)
Alloc a plotter render area.
struct print_settings * print_make_settings(print_configuration configuration, const char *filename, const struct gui_layout_table *font_func)
Generates one of the predefined print settings sets.
bool print_draw_next_page(const struct printer *printer, struct print_settings *settings)
This function draws one page, beginning with the height offset of done_height.
bool print_cleanup(hlcache_handle *content, const struct printer *printer, struct print_settings *settings)
Memory allocated during printing is being freed here.
bool print_set_up(hlcache_handle *content, const struct printer *printer, struct print_settings *settings, double *height)
This function prepares the content to be printed.
Conception: Generalized output-in-pages.
struct gui_layout_table * ami_layout_table
bool ami_print_begin(struct print_settings *ps)
static const struct ami_win_event_table ami_print_table
void ami_print_progress(void)
bool ami_print_cont(void)
void ami_print_close_device(void)
void ami_print(struct hlcache_handle *c, int copies)
static struct ami_printer_info ami_print_info
bool ami_print_dump(void)
bool ami_print_next_page(void)
const struct printer amiprinter
static void ami_print_close(struct ami_print_window *pw)
static void ami_print_ui_free(void)
struct MsgPort * ami_print_init(void)
static BOOL ami_print_readunit(CONST_STRPTR filename, char name[], uint32 namesize, int unitnum)
static CONST_STRPTR gadlab[PGID_LAST]
static void ami_print_ui_setup(void)
static BOOL ami_print_event(void *w)
void ami_print_ui(struct hlcache_handle *c)
void ami_print_free(void)
struct MsgPort * ami_print_get_msgport(void)
static LONG IFFPrefChunks[]
static STRPTR printers[11]
char * ami_utf8_easy(const char *string)
Public content interface.
struct nsurl * hlcache_handle_get_url(const struct hlcache_handle *handle)
Retrieve the URL associated with a high level cache handle.
Interface to platform-specific layout operation table.
Core mouse and pointer states.
Target independent plotting interface.
Interface to platform-specific graphical user interface window operations.
const char * messages_get(const char *key)
Fast lookup of a message by key from the standard Messages hash.
Localised message support (interface).
NetSurf URL handling (interface).
const char * nsurl_access(const nsurl *url)
Access a NetSurf URL object as a string.
void FreeSysObject(ULONG type, APTR obj)
ULONG RefreshSetGadgetAttrs(struct Gadget *g, struct Window *w, struct Requester *r, Tag tag1,...)
Minimal compatibility header for AmigaOS 3.
#define AllocSysObjectTags(A, B, C, D)
Interface to utility string handling.
Object * objects[POID_LAST]
struct hlcache_handle * c
Object * gadgets[PGID_LAST]
struct ami_generic_window w
struct hlcache_handle * c
Object * gadgets[PGID_LAST]
struct print_settings * ps
struct PrinterExtendedData * PED
Object * objects[POID_LAST]
struct IODRPTagsReq * PReq
Settings for a print - filled in by print_make_settings or 'manually' by the caller.
Option reading and saving interface.
#define nsoption_int(OPTION)
Get the value of an integer option.
#define nsoption_set_int(OPTION, VALUE)
set an integer option in the default table
Interface to a number of general purpose functionality.