[gnome-print] GNOME/Gtk+ Print Flow explained for Windows programmer.
- From: "Richard L. Staff" <rstaff sprynet com>
- To: gnome-print ximian com
- Subject: [gnome-print] GNOME/Gtk+ Print Flow explained for Windows programmer.
- Date: Tue, 09 Jul 2002 02:23:14 -0400
I am really stuggling with getting formatted text output from my own
GNOME/Gtk+ programs. I am NOT a computer science major; I am just a
stupid Windows business application programmer who has managed to do
what I want on Windows 9x using Fujitsu Cobol and Microsoft Visual C++.
The lack of human understandable documentation for gnome-print is a
serious barrier. Let me present a work flow of printing in the MS
Windows world, and maybe someone can come back with the GNOME/Gtk+
equivalent.
What follows is a verbal description of printing for MS Windows 9x using the Microsoft
Foundation Class library:
01. OnPreparePrinting() - Call DoPreparePrinting() to display the Print dialolg
and create a printer DC (Device Context).
02. OnBeginPrinting() - Allocate GDI resources. If the maximum page number was
not set in OnPreparePrinting(), then set it now.
03. Set abort procedures, disable main window, and display print status dialog.
04. Call StartDoc().
05. OnPrepareDC() - Prepare the printer DC for drawing.
06. Update print status dialog, check m_bContinuePrinting, and intialize m_rectDraw.
07. Call StartPage().
08. Call OnPrepareDC() again (Windows 95 only).
09. OnPrint() - Print headers, footers, and other elements unique to the printed page.
Print the body of the page, or call OnDraw() to do it for you. The printer device
context has a TextOut(horz_offset, vert_offset, text_string) function which
makes printing a line of text straight forward.
10. Call EndPage() - Forces pagination (i.e., does a form feed).
11. Test to see if this was the final page. If not, then go back to step 05.
If it was the final page, then wrapup printing.
12. Call EndDoc().
13. Enable main window.
14. OnEndPrinting() - Deallocate GDI resources in OnBeginPrinting().
15. Destroy the print status dialog.
16. Done!!!
(The above was borrowed from "Programming Windows 95 with MFC" by Jeff Prosise,
pulisher Microsoft Press,(c) 1996, pg.682, fig.10-1.)
Now can someone provide a parallel print flow description with the related
GNOME/Gtk+ functions and the related API parameters.
If you can not, then GNOME is dead in the water for Windows business
application programmer adaption (someone like me).
BTW, C source code is only self-evident to computer science majors
(maybe not even them). So, clarifying explanations will be mucho
appreciated.
I am using gnome-print-0.35 lib.
Sincerely, Rick Staff
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]