Re: printkit source related reorganization
"Jovan Ivankovic" <[email protected]> Tue, 22 Jul 2008 22:38:31 +0200
| Newsgroups | gmane.os.openbeos.printing |
|---|---|
| Message-ID | <[email protected]> |
------=_Part_75757_17105785.1216759111495 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Great, I'll take your advice for settings, it seams easy and logical. Thanks for the help! On Tue, Jul 22, 2008 at 10:28 PM, Michael Pfeiffer < [email protected]> wrote: > > Am 22.07.2008 um 21:17 schrieb Jovan Ivankovic: > > I have one dilemma, how should user preferred configuration of each >> installed printer be saved, I mean in which format. >> > > Do you mean job and page settings? These are stored in a BMessage and the > print_server persists it already for each pair of installed printer and > printing application. > > In printer driver hook functions (see > http://www.haiku-os.org/documents/dev/how_to_write_a_printer_driver) > BMessage* config_page(BNode* spool_folder, BMessage* settings); > BMessage* config_job(BNode* spool_folder, BMessage* settings); > you receive a previous BMessage settings (can be empty at first) and return > the new settings. > > You could add PPD related settings into a new BMessage ppdSettings and add > that to the provided settings, like (from memory): > BMessage ppdSettings; > ppdSettings.AddString("key", "value"); > ... > currentSettings.AddMessage("ppd", ppdSettings); > > > Should we use XML for that? If it is so, is there some kind of library >> that already works on beos/haiku, I should i write a simple parser for those >> files too? >> > > If you mean other settings I would prefer to also use a BMessage and > de/serialize that from/to a file or into an attribute of the spool_folder. > For XML there is a parser in src/libs/expat, you can find other libraries > too at www.bebits.com, don't know if there is more in the Haiku tree. > > Also, I could use some help with UI Design, I mean some kind of sketches >> or mockups. >> > > I think at first it suffices to add the current contents of the job > settings dialog into a new tab and add another tab for the PPD related > settings. > The UI of libprint has to be reworked later anyway, this should not be your > primary focus. > > I think I almost dealt with all the JCL keywords problems. I'm using your >> TODO.txt list as reference of things that needs to be done for PPD. >> > > Great. Maybe I can try to build CUPS on Haiku sometime in the next three > weeks. > > - Michael > PS: Please avoid top-posting. > A: Because it messes up the order in which people normally read text. > Q: Why is top-posting such a bad thing? > A: Top-posting. > Q: What is the most annoying thing in e-mail? > > > ------=_Part_75757_17105785.1216759111495 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline <div dir="ltr">Great, I'll take your advice for settings, it seams easy and logical. Thanks for the help!<br><br><div class="gmail_quote">On Tue, Jul 22, 2008 at 10:28 PM, Michael Pfeiffer <<a href="mailto:[email protected]">[email protected]</a>> wrote:<br> <blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"><br> Am 22.07.2008 um 21:17 schrieb Jovan Ivankovic:<div class="Ih2E3d"><br> <br> <blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> I have one dilemma, how should user preferred configuration of each installed printer be saved, I mean in which format.<br> </blockquote> <br></div> Do you mean job and page settings? These are stored in a BMessage and the print_server persists it already for each pair of installed printer and printing application.<br> <br> In printer driver hook functions (see <a href="http://www.haiku-os.org/documents/dev/how_to_write_a_printer_driver" target="_blank">http://www.haiku-os.org/documents/dev/how_to_write_a_printer_driver</a>)<br> BMessage* config_page(BNode* spool_folder, BMessage* settings);<br> BMessage* config_job(BNode* spool_folder, BMessage* settings);<br> you receive a previous BMessage settings (can be empty at first) and return the new settings.<br> <br> You could add PPD related settings into a new BMessage ppdSettings and add that to the provided settings, like (from memory):<br> BMessage ppdSettings;<br> ppdSettings.AddString("key", "value");<br> ...<br> currentSettings.AddMessage("ppd", ppdSettings);<div class="Ih2E3d"><br> <br> <br> <blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> Should we use XML for that? If it is so, is there some kind of library that already works on beos/haiku, I should i write a simple parser for those files too?<br> </blockquote> <br></div> If you mean other settings I would prefer to also use a BMessage and de/serialize that from/to a file or into an attribute of the spool_folder.<br> For XML there is a parser in src/libs/expat, you can find other libraries too at <a href="http://www.bebits.com" target="_blank">www.bebits.com</a>, don't know if there is more in the Haiku tree.<div class="Ih2E3d"><br> <br> <blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> Also, I could use some help with UI Design, I mean some kind of sketches or mockups.<br> </blockquote> <br></div> I think at first it suffices to add the current contents of the job settings dialog into a new tab and add another tab for the PPD related settings.<br> The UI of libprint has to be reworked later anyway, this should not be your primary focus.<div class="Ih2E3d"><br> <br> <blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;"> I think I almost dealt with all the JCL keywords problems. I'm using your TODO.txt list as reference of things that needs to be done for PPD.<br> </blockquote> <br></div> Great. Maybe I can try to build CUPS on Haiku sometime in the next three weeks.<br> <br> - Michael<br> PS: Please avoid top-posting.<br> A: Because it messes up the order in which people normally read text.<br> Q: Why is top-posting such a bad thing?<br> A: Top-posting.<br> Q: What is the most annoying thing in e-mail?<br> <br> <br> </blockquote></div><br></div> ------=_Part_75757_17105785.1216759111495--