xref: /haiku/src/add-ons/print/drivers/canon_lips/lips4/Lips4Entry.cpp (revision 7120e97489acbf17d86d3f33e3b2e68974fd4b23)
1 /*
2  * Lips4Entry.cpp
3  * Copyright 1999-2000 Y.Takagi. All Rights Reserved.
4  */
5 
6 #include <File.h>
7 #include <Message.h>
8 #include <Node.h>
9 
10 #include "Exports.h"
11 #include "Lips4.h"
12 #include "PrinterData.h"
13 #include "Lips4Cap.h"
14 #include "UIDriver.h"
15 #include "AboutBox.h"
16 #include "DbgMsg.h"
17 
18 char *add_printer(char *printer_name)
19 {
20 	DBGMSG((">LIPS4: add_printer\n"));
21 	DBGMSG(("\tprinter_name: %s\n", printer_name));
22 	DBGMSG(("<LIPS4: add_printer\n"));
23 	return printer_name;
24 }
25 
26 BMessage *config_page(BNode *node, BMessage *msg)
27 {
28 	DBGMSG((">LIPS4: config_page\n"));
29 	DUMP_BMESSAGE(msg);
30 	DUMP_BNODE(node);
31 
32 	PrinterData printer_data(node);
33 	Lips4Cap printer_cap(&printer_data);
34 	UIDriver drv(msg, &printer_data, &printer_cap);
35 	BMessage *result = drv.configPage();
36 
37 	DUMP_BMESSAGE(result);
38 	DBGMSG(("<LIPS4: config_page\n"));
39 	return result;
40 }
41 
42 BMessage *config_job(BNode *node, BMessage *msg)
43 {
44 	DBGMSG((">LIPS4: config_job\n"));
45 	DUMP_BMESSAGE(msg);
46 	DUMP_BNODE(node);
47 
48 	PrinterData printer_data(node);
49 	Lips4Cap printer_cap(&printer_data);
50 	UIDriver drv(msg, &printer_data, &printer_cap);
51 	BMessage *result = drv.configJob();
52 
53 	DUMP_BMESSAGE(result);
54 	DBGMSG(("<LIPS4: config_job\n"));
55 	return result;
56 }
57 
58 BMessage *take_job(BFile *spool, BNode *node, BMessage *msg)
59 {
60 	DBGMSG((">LIPS4: take_job\n"));
61 	DUMP_BMESSAGE(msg);
62 	DUMP_BNODE(node);
63 
64 	PrinterData printer_data(node);
65 	Lips4Cap printer_cap(&printer_data);
66 	LIPS4Driver drv(msg, &printer_data, &printer_cap);
67 	BMessage *result = drv.takeJob(spool);
68 
69 //	DUMP_BMESSAGE(result);
70 	DBGMSG(("<LIPS4: take_job\n"));
71 	return result;
72 }
73 
74 int main()
75 {
76 	AboutBox app("application/x-vnd.lips4-compatible", "Canon LIPS4 Compatible", "0.9.4", "Copyright © 1999-2000 Y.Takagi. All Rights Reserved.");
77 	app.Run();
78 	return 0;
79 }
80