[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Texmacs-dev] Printer widget questions and implementation proposal

From: Miguel de Benito Delgado
Subject: [Texmacs-dev] Printer widget questions and implementation proposal
Date: Thu, 11 Nov 2010 14:33:56 +0100


  now that I'm a trifle more familiar with the code (sorry for the shifting around of things, I hope it's worth it in the future), I'm trying the printing stuff. Please comment as extensively as you can on this:

In src/Edit/Editor/edit_main.cpp line 259 (edit_main_rep::print_buffer (string first, string last)) there's a comment stating that QT printing is supposed to be done from that point on and other related methods in edit_main_rep ignored. I would then more or less create my QTPrintDialog here, and do the actual printing.

However, if I were to follow the model of chooser_widget, I think I'd have to do the following:
  1. Add a method print_file to server_rep, then implement it in those classes inheriting from it.
  2. From within those implementations, proceed like in tm_frame_rep::choose_file, and instantiate a new generic printer_widget.
  3. Implement this printer_widget, at least a Qt version of it. It should print the current document or parts of it, etc.
  4. #ifdef my way around a bit to leave things as they were before, for other platforms.
If this is the right way to proceed, please confirm. And then comment on this issue, related to the third item:

src/Graphics/Gui/widget.hpp says the following:

widget printer_widget (url ps_pdf_file);

  // widget for printing a file, offering a way for selecting a page range,

  // changing the paper type and orientation, previewing, etc.

But it would be way more reasonable, from a QT point of view, to have the renderer passed as an argument to the printer. Then I could just patch its output to my QPrinter and have the printing done. Since there's not a single implementation of printer_widget that I can find in the code, may I change the prototype to something along the lines of widget printer_widget (renderer r) ?

Miguel de  Benito.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]