<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://wiki.openoffice.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Ybart</id>
	<title>Apache OpenOffice Wiki - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="https://wiki.openoffice.org/w/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Ybart"/>
	<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/wiki/Special:Contributions/Ybart"/>
	<updated>2026-11-21T11:53:26Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.35.14</generator>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Mac_OS_X_Porting_-_Cursors&amp;diff=32701</id>
		<title>Mac OS X Porting - Cursors</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Mac_OS_X_Porting_-_Cursors&amp;diff=32701"/>
		<updated>2007-05-21T00:09:13Z</updated>

		<summary type="html">&lt;p&gt;Ybart: /* Simple cursor in  Writer */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Implementing custom cursors ==&lt;br /&gt;
&lt;br /&gt;
=== What do we need ? ===&lt;br /&gt;
&lt;br /&gt;
==== Simple cursor in  Writer ====&lt;br /&gt;
&lt;br /&gt;
kThemeArrowCursor&lt;br /&gt;
kThemeIBeamCursor&lt;br /&gt;
&lt;br /&gt;
Code location (inside OpenOffice.org sources) : [http://go-oo.org/lxr/source/gsl/vcl/aqua/source/window/salframe.cxx vcl/aqua/source/window/salframe.cxx] [http://go-oo.org/lxr/source/gsl/vcl/inc/vcl/salframe.hxx vcl/inc/vcl/salframe.hxx] [http://go-oo.org/lxr/source/gsl/vcl/inc/vcl/ptrstyle.hxx vcl/inc/vcl/ptrstyle.hxx] [http://go-oo.org/lxr/source/gsl/vcl/source/window/window.cxx vcl/source/window/window.cxx] [http://go-oo.org/lxr/source/gsl/vcl/inc/vcl/window.hxx vcl/inc/vcl/window.hxx]&lt;br /&gt;
&lt;br /&gt;
and Windows existing implementation will help.&lt;br /&gt;
&lt;br /&gt;
Of course, we need the standard cursors like arrow, i-beam cursor, that are defined in the Carbon with [http://developer.apple.com/documentation/Carbon/Reference/Appearance_Manager/index.html constants] like kThemeArrowCursor or kThemeIBeamCursor. We have no problem for these, then can simply be called in Carbon with the function SetThemeCursor.&lt;br /&gt;
&lt;br /&gt;
==== Specific cursors ====&lt;br /&gt;
But we also need more specific cursors for example : help cursor, draw cursors… For these cursors the only function availables to do this are deprecated, so we should not use them. The only choice left is to make a Cocoa wrapper and using NSCursor to build our own cursors.&lt;br /&gt;
&lt;br /&gt;
[http://api.openoffice.org/docs/common/ref/com/sun/star/awt/SystemPointer.html List of OOo pointer&amp;#039;s constants]&lt;br /&gt;
[http://go-oo.org/lxr/source/gsl/vcl/unx/source/inc/ X11 custom cursors definitions]&lt;br /&gt;
[http://go-oo.org/lxr/source/gsl/vcl/win/source/src/ Windows custom cursors definitions]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;To be continued&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
==== Cursors used in windows implementation ====&lt;br /&gt;
http://ybarthelemy.info/dev/openoffice/screenshots/win_cursors.png&lt;br /&gt;
&lt;br /&gt;
[[Category:Porting]]&lt;br /&gt;
[[Category:Aqua]]&lt;/div&gt;</summary>
		<author><name>Ybart</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Mac_OS_X_Porting_-_Cursors&amp;diff=32676</id>
		<title>Mac OS X Porting - Cursors</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Mac_OS_X_Porting_-_Cursors&amp;diff=32676"/>
		<updated>2007-05-20T22:34:32Z</updated>

		<summary type="html">&lt;p&gt;Ybart: /* Specific cursors */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Implementing custom cursors ==&lt;br /&gt;
&lt;br /&gt;
=== What do we need ? ===&lt;br /&gt;
&lt;br /&gt;
==== Simple cursor in  Writer ====&lt;br /&gt;
&lt;br /&gt;
kThemeArrowCursor&lt;br /&gt;
kThemeIBeamCursor&lt;br /&gt;
&lt;br /&gt;
Code location (inside OpenOffice.org sources) : [http://go-oo.org/lxr/source/gsl/vcl/aqua/source/window/salframe.cxx vcl/aqua/source/window/salframe.cxx] [http://go-oo.org/lxr/source/gsl/vcl/inc/vcl/salframe.hxx vcl/inc/vcl/salframe.hxx] [http://go-oo.org/lxr/source/gsl/vcl/inc/vcl/ptrstyle.hxx vcl/inc/vcl/ptrstyle.hxx] [http://go-oo.org/lxr/source/gsl/vcl/source/window/window.cxx vcl/source/window/window.cxx] [http://go-oo.org/lxr/source/gsl/vcl/inc/vcl/window.hxx vcl/inc/vcl/window.hxx]&lt;br /&gt;
&lt;br /&gt;
and Windows existing implementation will help.&lt;br /&gt;
&lt;br /&gt;
Of course, we need the standard cursors like arrow, i-beam cursor, that are defined in the Carbon with [http://developer.apple.com/documentation/macos8/HumanInterfaceToolbox/AppManager/ProgWithAppearanceMgr/Appearance.9d.html constants] like kThemeArrowCursor or kThemeIBeamCursor. We have no problem for these, then can simply be called in Carbon with the function SetThemeCursor.&lt;br /&gt;
&lt;br /&gt;
==== Specific cursors ====&lt;br /&gt;
But we also need more specific cursors for example : help cursor, draw cursors… For these cursors the only function availables to do this are deprecated, so we should not use them. The only choice left is to make a Cocoa wrapper and using NSCursor to build our own cursors.&lt;br /&gt;
&lt;br /&gt;
[http://api.openoffice.org/docs/common/ref/com/sun/star/awt/SystemPointer.html List of OOo pointer&amp;#039;s constants]&lt;br /&gt;
[http://go-oo.org/lxr/source/gsl/vcl/unx/source/inc/ X11 custom cursors definitions]&lt;br /&gt;
[http://go-oo.org/lxr/source/gsl/vcl/win/source/src/ Windows custom cursors definitions]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;To be continued&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
==== Cursors used in windows implementation ====&lt;br /&gt;
http://ybarthelemy.info/dev/openoffice/screenshots/win_cursors.png&lt;br /&gt;
&lt;br /&gt;
[[Category:Porting]]&lt;br /&gt;
[[Category:Aqua]]&lt;/div&gt;</summary>
		<author><name>Ybart</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Mac_OS_X_Porting_-_Cursors&amp;diff=32668</id>
		<title>Mac OS X Porting - Cursors</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Mac_OS_X_Porting_-_Cursors&amp;diff=32668"/>
		<updated>2007-05-20T22:08:07Z</updated>

		<summary type="html">&lt;p&gt;Ybart: /* Specific cursors */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Implementing custom cursors ==&lt;br /&gt;
&lt;br /&gt;
=== What do we need ? ===&lt;br /&gt;
&lt;br /&gt;
==== Simple cursor in  Writer ====&lt;br /&gt;
&lt;br /&gt;
kThemeArrowCursor&lt;br /&gt;
kThemeIBeamCursor&lt;br /&gt;
&lt;br /&gt;
Code location (inside OpenOffice.org sources) : [http://go-oo.org/lxr/source/gsl/vcl/aqua/source/window/salframe.cxx vcl/aqua/source/window/salframe.cxx] [http://go-oo.org/lxr/source/gsl/vcl/inc/vcl/salframe.hxx vcl/inc/vcl/salframe.hxx] [http://go-oo.org/lxr/source/gsl/vcl/inc/vcl/ptrstyle.hxx vcl/inc/vcl/ptrstyle.hxx] [http://go-oo.org/lxr/source/gsl/vcl/source/window/window.cxx vcl/source/window/window.cxx] [http://go-oo.org/lxr/source/gsl/vcl/inc/vcl/window.hxx vcl/inc/vcl/window.hxx]&lt;br /&gt;
&lt;br /&gt;
and Windows existing implementation will help.&lt;br /&gt;
&lt;br /&gt;
Of course, we need the standard cursors like arrow, i-beam cursor, that are defined in the Carbon with [http://developer.apple.com/documentation/macos8/HumanInterfaceToolbox/AppManager/ProgWithAppearanceMgr/Appearance.9d.html constants] like kThemeArrowCursor or kThemeIBeamCursor. We have no problem for these, then can simply be called in Carbon with the function SetThemeCursor.&lt;br /&gt;
&lt;br /&gt;
==== Specific cursors ====&lt;br /&gt;
But we also need more specific cursors for example : help cursor, draw cursors… For these cursors the only function availables to do this are deprecated, so we should not use them. The only choice left is to make a Cocoa wrapper and using NSCursor to build our own cursors.&lt;br /&gt;
&lt;br /&gt;
[http://api.openoffice.org/docs/common/ref/com/sun/star/awt/SystemPointer.html List of OOo pointer&amp;#039;s constants]&lt;br /&gt;
[http://go-oo.org/lxr/source/gsl/vcl/unx/source/inc/ X11 custom cursors definitions]&lt;br /&gt;
[http://go-oo.org/lxr/source/gsl/vcl/win/source/src/ Windows custom cursors definitions]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;To be continued&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
[[Category:Porting]]&lt;br /&gt;
[[Category:Aqua]]&lt;/div&gt;</summary>
		<author><name>Ybart</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Mac_OS_X_Porting_-_Cursors&amp;diff=32663</id>
		<title>Mac OS X Porting - Cursors</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Mac_OS_X_Porting_-_Cursors&amp;diff=32663"/>
		<updated>2007-05-20T21:38:05Z</updated>

		<summary type="html">&lt;p&gt;Ybart: /* Simple cursor in  Writer */ Despite coursor is used by Apple, OOo calls it pointer (For OOo cursor is the text cursor)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Implementing custom cursors ==&lt;br /&gt;
&lt;br /&gt;
=== What do we need ? ===&lt;br /&gt;
&lt;br /&gt;
==== Simple cursor in  Writer ====&lt;br /&gt;
&lt;br /&gt;
kThemeArrowCursor&lt;br /&gt;
kThemeIBeamCursor&lt;br /&gt;
&lt;br /&gt;
Code location (inside OpenOffice.org sources) : [http://go-oo.org/lxr/source/gsl/vcl/aqua/source/window/salframe.cxx vcl/aqua/source/window/salframe.cxx] [http://go-oo.org/lxr/source/gsl/vcl/inc/vcl/salframe.hxx vcl/inc/vcl/salframe.hxx] [http://go-oo.org/lxr/source/gsl/vcl/inc/vcl/ptrstyle.hxx vcl/inc/vcl/ptrstyle.hxx] [http://go-oo.org/lxr/source/gsl/vcl/source/window/window.cxx vcl/source/window/window.cxx] [http://go-oo.org/lxr/source/gsl/vcl/inc/vcl/window.hxx vcl/inc/vcl/window.hxx]&lt;br /&gt;
&lt;br /&gt;
and Windows existing implementation will help.&lt;br /&gt;
&lt;br /&gt;
Of course, we need the standard cursors like arrow, i-beam cursor, that are defined in the Carbon with [http://developer.apple.com/documentation/macos8/HumanInterfaceToolbox/AppManager/ProgWithAppearanceMgr/Appearance.9d.html constants] like kThemeArrowCursor or kThemeIBeamCursor. We have no problem for these, then can simply be called in Carbon with the function SetThemeCursor.&lt;br /&gt;
&lt;br /&gt;
==== Specific cursors ====&lt;br /&gt;
But we also need more specific cursors for example : help cursor, draw cursors… For these cursors the only function availables to do this are deprecated, so we should not use them. The only choice left is to make a Cocoa wrapper and using NSCursor to build our own cursors.&lt;br /&gt;
&lt;br /&gt;
[http://api.openoffice.org/docs/common/ref/com/sun/star/awt/SystemPointer.html List of OOo pointer&amp;#039;s constants]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;To be continued&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
[[Category:Porting]]&lt;br /&gt;
[[Category:Aqua]]&lt;/div&gt;</summary>
		<author><name>Ybart</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Mac_OS_X_Porting_-_Cursors&amp;diff=32662</id>
		<title>Mac OS X Porting - Cursors</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Mac_OS_X_Porting_-_Cursors&amp;diff=32662"/>
		<updated>2007-05-20T21:25:45Z</updated>

		<summary type="html">&lt;p&gt;Ybart: /* Specific cursors */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Implementing custom cursors ==&lt;br /&gt;
&lt;br /&gt;
=== What do we need ? ===&lt;br /&gt;
&lt;br /&gt;
==== Simple cursor in  Writer ====&lt;br /&gt;
&lt;br /&gt;
kThemeArrowCursor&lt;br /&gt;
kThemeIBeamCursor&lt;br /&gt;
&lt;br /&gt;
Code location (inside OpenOffice.org sources) : [http://go-oo.org/lxr/source/gsl/vcl/source/window/cursor.cxx vcl/source/window/cursor.cxx] + [http://go-oo.org/lxr/source/gsl/vcl/aqua/source/window/salframe.cxx vcl/aqua/source/window/salframe.cxx] &lt;br /&gt;
&lt;br /&gt;
and Windows existing implementation will help.&lt;br /&gt;
&lt;br /&gt;
Of course, we need the standard cursors like arrow, i-beam cursor, that are defined in the Carbon with [http://developer.apple.com/documentation/macos8/HumanInterfaceToolbox/AppManager/ProgWithAppearanceMgr/Appearance.9d.html constants] like kThemeArrowCursor or kThemeIBeamCursor. We have no problem for these, then can simply be called in Carbon with the function SetThemeCursor.&lt;br /&gt;
&lt;br /&gt;
==== Specific cursors ====&lt;br /&gt;
But we also need more specific cursors for example : help cursor, draw cursors… For these cursors the only function availables to do this are deprecated, so we should not use them. The only choice left is to make a Cocoa wrapper and using NSCursor to build our own cursors.&lt;br /&gt;
&lt;br /&gt;
[http://api.openoffice.org/docs/common/ref/com/sun/star/awt/SystemPointer.html List of OOo pointer&amp;#039;s constants]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;To be continued&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
[[Category:Porting]]&lt;br /&gt;
[[Category:Aqua]]&lt;/div&gt;</summary>
		<author><name>Ybart</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Mac_OS_X_Porting_-_Work_Areas/Todo%27s&amp;diff=32656</id>
		<title>Mac OS X Porting - Work Areas/Todo&#039;s</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Mac_OS_X_Porting_-_Work_Areas/Todo%27s&amp;diff=32656"/>
		<updated>2007-05-20T21:09:36Z</updated>

		<summary type="html">&lt;p&gt;Ybart: /* Areas and ToDos Aqua Version */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page is intended to serve as a living ToDo list for the OpenOffice.org Mac OS X port. To keep things simple it contains the ToDos for both the X11 version and the upcoming Aqua version of OpenOffice.org for Mac OS X. The page is divided into different work areas which either assigned to a person in charge or are unassigned yet. Below each area there is a detailed list of todos which has to be maintained by the respective people himself.&lt;br /&gt;
Persons who are in charge of a certain area are responsible for keeping their respective part of the page up-to-date.&lt;br /&gt;
&amp;lt;noinclude&amp;gt;[[Category:Porting]] [[Category:Aqua]] [[Category:MacOSX]] [[Category:To-Do]]&amp;lt;/noinclude&amp;gt;&lt;br /&gt;
&lt;br /&gt;
If you&amp;#039;re interested in contributing to the project please coordinate with [mailto:ericb@openoffice.org Eric Bachard]&lt;br /&gt;
&lt;br /&gt;
== Areas and ToDos Aqua Version ==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;vertical-align:top; text-align:left; background-color:#F0F0F0;&amp;quot;&lt;br /&gt;
|- style=&amp;quot;background-color:#99CCFF; font-weight:bold;&amp;quot; &lt;br /&gt;
| Messaging || [mailto:tra@openoffice.org Tino Rachui]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;vertical-align:top; text-align:left; background-color:#efefef;&amp;quot;&lt;br /&gt;
|- style=&amp;quot;background-color:#d6d6d6;font-weight:bold;&amp;quot; &lt;br /&gt;
| Todo || Status || Assigned to&lt;br /&gt;
|-&lt;br /&gt;
| Implement messaging infrastructure || New || Unassigned&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;vertical-align:top; text-align:left; background-color:#F0F0F0;&amp;quot;&lt;br /&gt;
|- style=&amp;quot;background-color:#99CCFF; font-weight:bold;&amp;quot; &lt;br /&gt;
| Windowing || [mailto:tra@openoffice.org Tino Rachui]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;vertical-align:top; text-align:left; background-color:#efefef;&amp;quot;&lt;br /&gt;
|- style=&amp;quot;background-color:#d6d6d6;font-weight:bold;&amp;quot; &lt;br /&gt;
| Todo || Status || Assigned to&lt;br /&gt;
|-&lt;br /&gt;
| Implement salframe.cxx || New || Unassigned&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;vertical-align:top; text-align:left; background-color:#F0F0F0;&amp;quot;&lt;br /&gt;
|- style=&amp;quot;background-color:#99CCFF; font-weight:bold;&amp;quot; &lt;br /&gt;
| Drawing || [mailto:ssa@openoffice.org Stephan Schaefer]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;vertical-align:top; text-align:left; background-color:#efefef;&amp;quot;&lt;br /&gt;
|- style=&amp;quot;background-color:#d6d6d6;font-weight:bold;&amp;quot; &lt;br /&gt;
| Todo || Status || Assigned to&lt;br /&gt;
|-&lt;br /&gt;
| Implement drawing support || In progress || [mailto:ssa@openoffice.org Stephan Schaefer]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;vertical-align:top; text-align:left; background-color:#F0F0F0;&amp;quot;&lt;br /&gt;
|- style=&amp;quot;background-color:#99CCFF; font-weight:bold;&amp;quot; &lt;br /&gt;
| Native Printing support || [mailto:ybart2@openoffice.org Yvan BARTHÉLEMY]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;vertical-align:top; text-align:left; background-color:#efefef;&amp;quot;&lt;br /&gt;
|- style=&amp;quot;background-color:#d6d6d6;font-weight:bold;&amp;quot; &lt;br /&gt;
| Todo || Status || Assigned to&lt;br /&gt;
|-&lt;br /&gt;
| Make some docs || Done || [mailto:ybart2@openoffice.org Yvan BARTHÉLEMY]&lt;br /&gt;
|-&lt;br /&gt;
| Native look &amp;amp; feel for Print and Print Setup || In progress || [mailto:ybart2@openoffice.org Yvan BARTHÉLEMY]&lt;br /&gt;
|-&lt;br /&gt;
| Panel for OpenOffice.org specific options || New || Unassigned&lt;br /&gt;
|-&lt;br /&gt;
| Implement native Print support || New || Unassigned&lt;br /&gt;
|-&lt;br /&gt;
| Implement native Print setup || New || Unassigned&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Work in progress, see: [[Mac OS X Porting - Native Printing]]&lt;br /&gt;
&lt;br /&gt;
Description:&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;OpenOffice.org side&amp;#039;&amp;#039;&amp;#039;: &lt;br /&gt;
&lt;br /&gt;
AquaSalPrinter class is located in aqua/source/gdi/salprn.cxx&lt;br /&gt;
&lt;br /&gt;
Headers are in:&lt;br /&gt;
 vcl/inc/salinst.hxx &lt;br /&gt;
 vcl/inc/salgdi.hxx  &lt;br /&gt;
 vcl/inc/salprn.hxx&lt;br /&gt;
&lt;br /&gt;
 Aqua implementation:&lt;br /&gt;
 aqua/inc/salprn.h (AquaSalPrinter class implementation, inherits from SalPrinter)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Mac OS X API side&amp;#039;&amp;#039;&amp;#039;:&lt;br /&gt;
&lt;br /&gt;
Todo: implement missing methods, using Carbon API&lt;br /&gt;
&lt;br /&gt;
Link for Mac OS X API documentation: &lt;br /&gt;
&lt;br /&gt;
http://developer.apple.com/documentation/Carbon/Reference/CarbonPrintingManager_Ref/index.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;vertical-align:top; text-align:left; background-color:#F0F0F0;&amp;quot;&lt;br /&gt;
|- style=&amp;quot;background-color:#99CCFF; font-weight:bold;&amp;quot; &lt;br /&gt;
| Key input || [mailto:???@openoffice.org Unassigned]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;vertical-align:top; text-align:left; background-color:#efefef;&amp;quot;&lt;br /&gt;
|- style=&amp;quot;background-color:#d6d6d6;font-weight:bold;&amp;quot; &lt;br /&gt;
| Todo || Status || Assigned to&lt;br /&gt;
|-&lt;br /&gt;
| accelerators for native menu || In progress || Ismael&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;vertical-align:top; text-align:left; background-color:#F0F0F0;&amp;quot;&lt;br /&gt;
|- style=&amp;quot;background-color:#99CCFF; font-weight:bold;&amp;quot; &lt;br /&gt;
| Native sound support || [mailto:mox@openoffice.org Mox Soini]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;vertical-align:top; text-align:left; background-color:#efefef;&amp;quot;&lt;br /&gt;
|- style=&amp;quot;background-color:#d6d6d6;font-weight:bold;&amp;quot; &lt;br /&gt;
| Todo || Status || Assigned to Mox Soini&lt;br /&gt;
|-&lt;br /&gt;
| Implement native sound support || Started || [mailto:mox@openoffice.org Mox Soini][mailto:ericb@openoffice.org Eric Bachard]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
New page has been updated.&lt;br /&gt;
&lt;br /&gt;
See: [[Native Sound Implementation on Mac OS X]]&lt;br /&gt;
&lt;br /&gt;
Estimation of code remaining to write: 40% (macosxplayer.cxx mainly)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;vertical-align:top; text-align:left; background-color:#F0F0F0;&amp;quot;&lt;br /&gt;
|- style=&amp;quot;background-color:#99CCFF; font-weight:bold;&amp;quot; &lt;br /&gt;
| Image Acquisition || [mailto:ericb@openoffice.org Eric Bachard]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;vertical-align:top; text-align:left; background-color:#efefef;&amp;quot;&lt;br /&gt;
|- style=&amp;quot;background-color:#d6d6d6;font-weight:bold;&amp;quot; &lt;br /&gt;
| Todo || Status || Assigned to&lt;br /&gt;
|-&lt;br /&gt;
| Implement Image Acquisition || In progress || [mailto:ericb@openoffice.org Eric Bachard]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;See&amp;#039;&amp;#039;&amp;#039;: [[Mac OS X Porting - Data Acquisition]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;vertical-align:top; text-align:left; background-color:#F0F0F0;&amp;quot;&lt;br /&gt;
|- style=&amp;quot;background-color:#99CCFF; font-weight:bold;&amp;quot; &lt;br /&gt;
| Native font support || [mailto:ericb@openoffice.org Eric Bachard]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;vertical-align:top; text-align:left; background-color:#efefef;&amp;quot;&lt;br /&gt;
|- style=&amp;quot;background-color:#d6d6d6;font-weight:bold;&amp;quot; &lt;br /&gt;
| Todo || Status || Assigned to&lt;br /&gt;
|-&lt;br /&gt;
| ATS || Started || [mailto:ericb@openoffice.org Eric Bachard]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
salatslayout.cxx License origin is justified here: http://qa.openoffice.org/issues/show_bug.cgi?id=23283]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;OpenOffice.org side&amp;#039;&amp;#039;&amp;#039;: &lt;br /&gt;
&lt;br /&gt;
See : [[Mac OS X Porting - Native Fonts]]&lt;br /&gt;
 &lt;br /&gt;
 Carbon API implementation (binding) is made in salatslayout.cxx&lt;br /&gt;
&lt;br /&gt;
ATS and ATSUI starting point: http://developer.apple.com/documentation/Carbon/Conceptual/ATS_Concepts/atsfonts_intro/chapter_1_section_1.html&lt;br /&gt;
&lt;br /&gt;
Apple&amp;#039;s starting page leading to deeper docs: http://developer.apple.com/documentation/TextFonts/Typography-date.html&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Todo-list for native font implementation:&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 &lt;br /&gt;
 - missing methods (to be implemented):&lt;br /&gt;
&lt;br /&gt;
 &amp;#039;&amp;#039;&amp;#039;bool ATSLayout::GetGlyphOutlines()&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 &amp;#039;&amp;#039;&amp;#039;ATSLayout::InitFont()&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 &amp;#039;&amp;#039;&amp;#039;ATSLayout::MoveGlyph()&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 &amp;#039;&amp;#039;&amp;#039;ATSLayout::DropGlyph()&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
 &amp;#039;&amp;#039;&amp;#039;ATSLayout::Simplify()&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
 - Fix known bugs:&lt;br /&gt;
  MultiLine does not work (writer cannot be used, because)&lt;br /&gt;
  Bad keyboard/charset ? (missig chars)&lt;br /&gt;
  When redrawing, everything is redrawn using the most little font size -&amp;gt; even the dialog boxes on menu bars&lt;br /&gt;
  Bad values returned &lt;br /&gt;
&lt;br /&gt;
 - Implement MultiSalLayout&lt;br /&gt;
 - Complete implementation  &lt;br /&gt;
 - read Apple API [ Work in progress]&lt;br /&gt;
 - describe current implementation: organisation / design [work in progress]&lt;br /&gt;
 - design of new implementation [FIXME] find examples&lt;br /&gt;
&lt;br /&gt;
Estimation of code remaining to write ~40 %&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Done&amp;#039;&amp;#039;&amp;#039; (mainly Stephan Schaefer, with initial salatslayout.cxx file written by Herbert Duerr)&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Work in progress&amp;#039;&amp;#039;&amp;#039; : understand MultiSalLayout&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Resources&amp;#039;&amp;#039;&amp;#039;: use sample code to test/initialize ATS server (using e.g. ATSUIDirectAccessDemo)&lt;br /&gt;
&lt;br /&gt;
For more informations, see: [[Mac OS X Porting - Native Fonts]]&lt;br /&gt;
&lt;br /&gt;
== Areas and ToDos X11 Version ==&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;vertical-align:top; text-align:left; background-color:#F0F0F0;&amp;quot;&lt;br /&gt;
|- style=&amp;quot;background-color:#99CCFF; font-weight:bold;&amp;quot; &lt;br /&gt;
| Packaging &amp;lt;br&amp;gt;Packaging related tasks || [mailto:obr@openoffice.org Oliver Braun]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;vertical-align:top; text-align:left; background-color:#efefef;&amp;quot;&lt;br /&gt;
|- style=&amp;quot;background-color:#d6d6d6;font-weight:bold;&amp;quot; &lt;br /&gt;
| Todo || Status || Assigned to&lt;br /&gt;
|-&lt;br /&gt;
| Improved packaging for OOo || Done || [mailto:obr@openoffice.org Oliver Braun]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;vertical-align:top; text-align:left; background-color:#F0F0F0;&amp;quot;&lt;br /&gt;
|- style=&amp;quot;background-color:#99CCFF; font-weight:bold;&amp;quot; &lt;br /&gt;
| Installation &amp;lt;br&amp;gt;Installation related tasks || [mailto:obr@openoffice.org Oliver Braun]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;vertical-align:top; text-align:left; background-color:#efefef;&amp;quot;&lt;br /&gt;
|- style=&amp;quot;background-color:#d6d6d6;font-weight:bold;&amp;quot; &lt;br /&gt;
| Todo || Status || Assigned to&lt;br /&gt;
|-&lt;br /&gt;
| Provide an improved installer for OOo || New || [mailto:obr@openoffice.org Oliver Braun]&lt;br /&gt;
|-&lt;br /&gt;
| Error messages during installation when no X11 is installed || Started (messages need to be localised and more info supplied) || Unassigned&lt;br /&gt;
|-&lt;br /&gt;
| Support language pack instalation || New || Unassigned&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;vertical-align:top; text-align:left; background-color:#F0F0F0;&amp;quot;&lt;br /&gt;
|- style=&amp;quot;background-color:#99CCFF; font-weight:bold;&amp;quot; &lt;br /&gt;
| Desktop Integration &amp;lt;br&amp;gt;Desktop integration related tasks || [mailto:obr@openoffice.org Oliver Braun]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;vertical-align:top; text-align:left; background-color:#efefef;&amp;quot;&lt;br /&gt;
|- style=&amp;quot;background-color:#d6d6d6;font-weight:bold;&amp;quot; &lt;br /&gt;
| Todo || Status || Assigned to&lt;br /&gt;
|-&lt;br /&gt;
|Allow opening of documents with path names that need to be escaped for shell scripts || Integrated for 2.1 see [http://www.openoffice.org/issues/show_bug.cgi?id=69143] || [mailto:smsm1@openoffice.org Shaun McDonald]&lt;br /&gt;
|-&lt;br /&gt;
| Save documents in ~/Documents by default || New || Unassigned&lt;br /&gt;
|-&lt;br /&gt;
| Use the Mac OS X key chain for document signing || New || Unassigned&lt;br /&gt;
|-&lt;br /&gt;
| Read proxy settings and user information from the system settings || New || Unassigned&lt;br /&gt;
|- &lt;br /&gt;
| Mac OS X address book integration || New || Unassigned &lt;br /&gt;
|- &lt;br /&gt;
| Make use of the Mac OS X spell checker || New || Unassigned&lt;br /&gt;
|-&lt;br /&gt;
| Improved clipboard support || New || Unassigned&lt;br /&gt;
|-&lt;br /&gt;
| Support for standard Mac OS X shortcuts according to HI guideline || New || Unassigned&lt;br /&gt;
|- &lt;br /&gt;
| Integrate native FileOpen/FileSave dialog into OOo || Started || [mailto:fheckl@openoffice.org Florian Heckl]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;vertical-align:top; text-align:left; background-color:#F0F0F0;&amp;quot;&lt;br /&gt;
|- style=&amp;quot;background-color:#99CCFF; font-weight:bold;&amp;quot; &lt;br /&gt;
| Printing || [mailto:???@openoffice.org Unassigned]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;vertical-align:top; text-align:left; background-color:#efefef;&amp;quot;&lt;br /&gt;
|- style=&amp;quot;background-color:#d6d6d6;font-weight:bold;&amp;quot; &lt;br /&gt;
| Todo || Status || Assigned to&lt;br /&gt;
|-&lt;br /&gt;
| Improved printing support (CUPS) || Done || Mox Soini, Oliver Braun &lt;br /&gt;
|-&lt;br /&gt;
| Use the native print dialog in OOo || New || Unassigned&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;vertical-align:top; text-align:left; background-color:#F0F0F0;&amp;quot;&lt;br /&gt;
|- style=&amp;quot;background-color:#99CCFF; font-weight:bold;&amp;quot; &lt;br /&gt;
| Ease of use || [mailto:???@openoffice.org Unassigned]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;vertical-align:top; text-align:left; background-color:#efefef;&amp;quot;&lt;br /&gt;
|- style=&amp;quot;background-color:#d6d6d6;font-weight:bold;&amp;quot; &lt;br /&gt;
| Todo || Status || Assigned to&lt;br /&gt;
|-&lt;br /&gt;
| Reduce visible toolbars || New || Unassgined&lt;br /&gt;
|-&lt;br /&gt;
| Suppress icons in OOo menus by default || New || Unassigned&lt;br /&gt;
|-&lt;br /&gt;
| Suppress xterm window when launching OOo || New || Unassigned&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;vertical-align:top; text-align:left; background-color:#F0F0F0;&amp;quot;&lt;br /&gt;
|- style=&amp;quot;background-color:#99CCFF; font-weight:bold;&amp;quot; &lt;br /&gt;
| Implement NeoLight plugin || [mailto:???@openoffice.org Unassigned]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;vertical-align:top; text-align:left; background-color:#efefef;&amp;quot;&lt;br /&gt;
|- style=&amp;quot;background-color:#d6d6d6;font-weight:bold;&amp;quot; &lt;br /&gt;
| Todo || Status || Assigned to&lt;br /&gt;
|-&lt;br /&gt;
| Implement NeoLight (spothlight plugin) in OpenOffice.org 2.0. For more informations, please have a look at [http://trinity.neooffice.org/modules.php?name=Forums&amp;amp;file=viewtopic&amp;amp;t=1328&amp;amp;sid=9fb65afa5ca4232a6f8fae420424a3fe]|| New || Unassigned&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Assurance Quality and Mac OS X port ==&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;vertical-align:top; text-align:left; background-color:#F0F0F0;&amp;quot;&lt;br /&gt;
|- style=&amp;quot;background-color:#99CCFF; font-weight:bold;&amp;quot; &lt;br /&gt;
| Mac OS X QA || [mailto:???@openoffice.org Unassigned]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;vertical-align:top; text-align:left; background-color:#efefef;&amp;quot;&lt;br /&gt;
|- style=&amp;quot;background-color:#d6d6d6;font-weight:bold;&amp;quot; &lt;br /&gt;
| Todo || Status || Assigned to&lt;br /&gt;
|-&lt;br /&gt;
| Collect informations and manage Mac OS X QA on the wiki || New || Unassigned&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;/div&gt;</summary>
		<author><name>Ybart</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Mac_OS_X_Porting_-_Cursors&amp;diff=32654</id>
		<title>Mac OS X Porting - Cursors</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Mac_OS_X_Porting_-_Cursors&amp;diff=32654"/>
		<updated>2007-05-20T20:58:03Z</updated>

		<summary type="html">&lt;p&gt;Ybart: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Implementing custom cursors ==&lt;br /&gt;
&lt;br /&gt;
=== What do we need ? ===&lt;br /&gt;
&lt;br /&gt;
==== Simple cursor in  Writer ====&lt;br /&gt;
&lt;br /&gt;
kThemeArrowCursor&lt;br /&gt;
kThemeIBeamCursor&lt;br /&gt;
&lt;br /&gt;
Code location (inside OpenOffice.org sources) : [http://go-oo.org/lxr/source/gsl/vcl/source/window/cursor.cxx vcl/source/window/cursor.cxx] + [http://go-oo.org/lxr/source/gsl/vcl/aqua/source/window/salframe.cxx vcl/aqua/source/window/salframe.cxx] &lt;br /&gt;
&lt;br /&gt;
and Windows existing implementation will help.&lt;br /&gt;
&lt;br /&gt;
Of course, we need the standard cursors like arrow, i-beam cursor, that are defined in the Carbon with [http://developer.apple.com/documentation/macos8/HumanInterfaceToolbox/AppManager/ProgWithAppearanceMgr/Appearance.9d.html constants] like kThemeArrowCursor or kThemeIBeamCursor. We have no problem for these, then can simply be called in Carbon with the function SetThemeCursor.&lt;br /&gt;
&lt;br /&gt;
==== Specific cursors ====&lt;br /&gt;
But we also need more specific cursors for example : help cursor, draw cursors… For these cursors the only function availables to do this are deprecated, so we should not use them. The only choice left is to make a Cocoa wrapper and using NSCursor to build our own cursors.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;To be continued&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
[[Category:Porting]]&lt;br /&gt;
[[Category:Aqua]]&lt;/div&gt;</summary>
		<author><name>Ybart</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Wish_list_for_Mac_OS_X_port&amp;diff=32647</id>
		<title>Wish list for Mac OS X port</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Wish_list_for_Mac_OS_X_port&amp;diff=32647"/>
		<updated>2007-05-20T20:12:15Z</updated>

		<summary type="html">&lt;p&gt;Ybart: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Please increment the vote counters and add our name in the list ( name1, name2 ..etc )&lt;br /&gt;
&lt;br /&gt;
== Use Native font Server ( ATS server) ==&lt;br /&gt;
&lt;br /&gt;
Vote YES :   [ 1 ]&lt;br /&gt;
&lt;br /&gt;
eric bachard, &lt;br /&gt;
&lt;br /&gt;
Vote NO : [ 0 ]&lt;br /&gt;
&lt;br /&gt;
== Use a new installer ( .pkg )== &lt;br /&gt;
&lt;br /&gt;
Vote YES :   [ 1 ]&lt;br /&gt;
&lt;br /&gt;
eric bachard, &lt;br /&gt;
&lt;br /&gt;
Vote NO : [ 2 ] :&lt;br /&gt;
&lt;br /&gt;
Damien Duportal, Yvan Barthélemy&lt;br /&gt;
&lt;br /&gt;
== Not use X11 ==&lt;br /&gt;
&lt;br /&gt;
Votes :   [ 4 ]&lt;br /&gt;
&lt;br /&gt;
eric bachard, robert devoe, Damien Duportal, Yvan Barthelemy&lt;br /&gt;
&lt;br /&gt;
== drag and drop ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Votes :   [ 4 ]&lt;br /&gt;
&lt;br /&gt;
eric bachard, rich antcliff, robert devoe, Yvan Barthelemy&lt;br /&gt;
&lt;br /&gt;
== native filepicker ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Votes :   [ 1 ]&lt;br /&gt;
&lt;br /&gt;
eric bachard,&lt;br /&gt;
&lt;br /&gt;
Note : Native FilePicker works fine, to be integrated&lt;br /&gt;
&lt;br /&gt;
== native sound ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Votes :   [ 1 ]&lt;br /&gt;
&lt;br /&gt;
eric bachard, &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Native printing box ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Votes :   [ 3 ]&lt;br /&gt;
&lt;br /&gt;
eric bachard, shaun mcdonald, Yvan Barthélemy&lt;br /&gt;
&lt;br /&gt;
== Aqua look ==&lt;br /&gt;
&lt;br /&gt;
Votes :   [ 2 ]&lt;br /&gt;
&lt;br /&gt;
eric bachard, Yvan Barthélemy&lt;br /&gt;
&lt;br /&gt;
 &lt;br /&gt;
== Use all Apple controls ==&lt;br /&gt;
&lt;br /&gt;
Votes :   [ 1 ]&lt;br /&gt;
&lt;br /&gt;
eric bachard, &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Use the Apple Remote ==&lt;br /&gt;
&lt;br /&gt;
Votes : [ 3 ]&lt;br /&gt;
&lt;br /&gt;
Shaun McDonald, robert devoe, Eric Bachard&lt;br /&gt;
&lt;br /&gt;
[[Category:Porting]]&lt;br /&gt;
[[Category:Aqua]]&lt;br /&gt;
[[Category:MacOSX]]&lt;/div&gt;</summary>
		<author><name>Ybart</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Automatic_Icon_Positioning_(Packaging)&amp;diff=32613</id>
		<title>Automatic Icon Positioning (Packaging)</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Automatic_Icon_Positioning_(Packaging)&amp;diff=32613"/>
		<updated>2007-05-20T01:11:57Z</updated>

		<summary type="html">&lt;p&gt;Ybart: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Here is an Apple Script allowing to automatically place correctly the icons in OpenOffice installation folder :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
on run argv&lt;br /&gt;
	try&lt;br /&gt;
		set argv to POSIX file (item 1 of argv)&lt;br /&gt;
	on error&lt;br /&gt;
		set argv to choose folder&lt;br /&gt;
	end try&lt;br /&gt;
	try&lt;br /&gt;
		tell application &amp;quot;Finder&amp;quot;&lt;br /&gt;
			set fichiers to items of folder argv&lt;br /&gt;
			set i to 0&lt;br /&gt;
			repeat with myItem in fichiers&lt;br /&gt;
				set i to i + 1&lt;br /&gt;
				&lt;br /&gt;
				set itemProperties to (properties of myItem)&lt;br /&gt;
				set itemPos to position of itemProperties&lt;br /&gt;
				set myName to name of itemProperties&lt;br /&gt;
				&lt;br /&gt;
				if i is 1 then set position of myItem to {332, 191} -- in alphabetic order &amp;quot;Applications&amp;quot;&lt;br /&gt;
				if i is 2 then set position of myItem to {97, 62} -- LICENSEs&lt;br /&gt;
				if i is 3 then set position of myItem to {101, 191} -- OpenOffice*&lt;br /&gt;
				if i is 4 then set position of myItem to {304, 61} -- READMEs&lt;br /&gt;
			end repeat&lt;br /&gt;
		end tell&lt;br /&gt;
	end try&lt;br /&gt;
	tell application &amp;quot;System Events&amp;quot; to quit application &amp;quot;Finder&amp;quot;&lt;br /&gt;
	return argv as string&lt;br /&gt;
end run&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To use it, assuming you called it &amp;#039;&amp;#039;ooo_pack_finalizer.scpt&amp;#039;&amp;#039;, just type :&lt;br /&gt;
&amp;lt;pre&amp;gt;$ osascript ooo_pack_finalizer.scpt &amp;#039;&amp;#039;path to install folder&amp;#039;&amp;#039;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To use it, from a remote host, you will need to sudo to access the WindowServer :&lt;br /&gt;
&amp;lt;pre&amp;gt;$ sudo osascript ooo_pack_finalizer.scpt &amp;#039;&amp;#039;path to install folder&amp;#039;&amp;#039;&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notice than executing that script will starts the Finder with root rights, and any user with physical access to the computer will be able to use Finder during the script execution (until quit request from System Events).&lt;br /&gt;
&lt;br /&gt;
For better security, it should be possible to lock the user interface during the execution of the script by developping a simple app which captures all mouse and keyboard events in order to disallow access to Finder.  &lt;br /&gt;
&lt;br /&gt;
[[Category: Aqua]]&lt;br /&gt;
[[Category: Porting]]&lt;br /&gt;
[[Category: MacOSX]]&lt;/div&gt;</summary>
		<author><name>Ybart</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Automatic_Icon_Positioning_(Packaging)&amp;diff=32612</id>
		<title>Automatic Icon Positioning (Packaging)</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Automatic_Icon_Positioning_(Packaging)&amp;diff=32612"/>
		<updated>2007-05-20T01:07:58Z</updated>

		<summary type="html">&lt;p&gt;Ybart: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Here is an Apple Script allowing to automatically place correctly the icons in OpenOffice installation folder :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
on run argv&lt;br /&gt;
	try&lt;br /&gt;
		set argv to POSIX file (item 1 of argv)&lt;br /&gt;
	on error&lt;br /&gt;
		set argv to choose folder&lt;br /&gt;
	end try&lt;br /&gt;
	try&lt;br /&gt;
		tell application &amp;quot;Finder&amp;quot;&lt;br /&gt;
			set fichiers to items of folder argv&lt;br /&gt;
			set i to 0&lt;br /&gt;
			repeat with myItem in fichiers&lt;br /&gt;
				set i to i + 1&lt;br /&gt;
				&lt;br /&gt;
				set itemProperties to (properties of myItem)&lt;br /&gt;
				set itemPos to position of itemProperties&lt;br /&gt;
				set myName to name of itemProperties&lt;br /&gt;
				&lt;br /&gt;
				if i is 1 then set position of myItem to {332, 191} -- in alphabetic order &amp;quot;Applications&amp;quot;&lt;br /&gt;
				if i is 2 then set position of myItem to {97, 62} -- LICENSEs&lt;br /&gt;
				if i is 3 then set position of myItem to {101, 191} -- OpenOffice*&lt;br /&gt;
				if i is 4 then set position of myItem to {304, 61} -- READMEs&lt;br /&gt;
			end repeat&lt;br /&gt;
		end tell&lt;br /&gt;
	end try&lt;br /&gt;
	tell application &amp;quot;System Events&amp;quot; to quit application &amp;quot;Finder&amp;quot;&lt;br /&gt;
	return argv as string&lt;br /&gt;
end run&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To use it, assuming you called it &amp;#039;&amp;#039;ooo_pack_finalizer.scpt&amp;#039;&amp;#039;, just type :&lt;br /&gt;
$ osascript ooo_pack_finalizer.scpt&lt;br /&gt;
&lt;br /&gt;
To use it, from a remote host, you will need to sudo to access the WindowServer :&lt;br /&gt;
$ sudo osascript ooo_pack_finalizer.scpt&lt;br /&gt;
&lt;br /&gt;
Notice than executing that script will starts the Finder with root rights, and any user with physical access to the computer will be able to use Finder during the script execution (until quit request from System Events).&lt;br /&gt;
&lt;br /&gt;
For better security, it should be possible to lock the user interface during the execution of the script by developping a simple app which captures all mouse and keyboard events in order to disallow access to Finder.  &lt;br /&gt;
&lt;br /&gt;
[[Category: Aqua]]&lt;br /&gt;
[[Category: Porting]]&lt;br /&gt;
[[Category: MacOSX]]&lt;/div&gt;</summary>
		<author><name>Ybart</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Automatic_Icon_Positioning_(Packaging)&amp;diff=32611</id>
		<title>Automatic Icon Positioning (Packaging)</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Automatic_Icon_Positioning_(Packaging)&amp;diff=32611"/>
		<updated>2007-05-20T01:04:58Z</updated>

		<summary type="html">&lt;p&gt;Ybart: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Here is an Apple Script allowing to automatically place correctly the icons in OpenOffice installation folder :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
on run argv&lt;br /&gt;
	set argv to POSIX file (item 1 of argv)&lt;br /&gt;
	try&lt;br /&gt;
		tell application &amp;quot;Finder&amp;quot;&lt;br /&gt;
			set fichiers to items of folder argv&lt;br /&gt;
			set i to 0&lt;br /&gt;
			repeat with myItem in fichiers&lt;br /&gt;
				set i to i + 1&lt;br /&gt;
				&lt;br /&gt;
				set itemProperties to (properties of myItem)&lt;br /&gt;
				set itemPos to position of itemProperties&lt;br /&gt;
				set myName to name of itemProperties&lt;br /&gt;
				&lt;br /&gt;
				if i is 1 then set position of myItem to {332, 191} -- in alphabetic order &amp;quot;Applications&amp;quot;&lt;br /&gt;
				if i is 2 then set position of myItem to {97, 62} -- LICENSEs&lt;br /&gt;
				if i is 3 then set position of myItem to {101, 191} -- OpenOffice*&lt;br /&gt;
				if i is 4 then set position of myItem to {304, 61} -- READMEs&lt;br /&gt;
			end repeat&lt;br /&gt;
		end tell&lt;br /&gt;
	end try&lt;br /&gt;
	tell application &amp;quot;System Events&amp;quot; to quit application &amp;quot;Finder&amp;quot;&lt;br /&gt;
	return argv as string&lt;br /&gt;
end run&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To use it, assuming you called it &amp;#039;&amp;#039;ooo_pack_finalizer.scpt&amp;#039;&amp;#039;, just type :&lt;br /&gt;
$ osascript ooo_pack_finalizer.scpt&lt;br /&gt;
&lt;br /&gt;
To use it, from a remote host, you will need to sudo to access the WindowServer :&lt;br /&gt;
$ sudo osascript ooo_pack_finalizer.scpt&lt;br /&gt;
&lt;br /&gt;
Notice than executing that script will starts the Finder with root rights, and any user with physical access to the computer will be able to use Finder during the script execution (until quit request from System Events).&lt;br /&gt;
&lt;br /&gt;
For better security, it should be possible to lock the user interface during the execution of the script by developping a simple app which captures all mouse and keyboard events in order to disallow access to Finder.  &lt;br /&gt;
&lt;br /&gt;
[[Category: Aqua]]&lt;br /&gt;
[[Category: Porting]]&lt;br /&gt;
[[Category: MacOSX]]&lt;/div&gt;</summary>
		<author><name>Ybart</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Automatic_Icon_Positioning_(Packaging)&amp;diff=32610</id>
		<title>Automatic Icon Positioning (Packaging)</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Automatic_Icon_Positioning_(Packaging)&amp;diff=32610"/>
		<updated>2007-05-20T00:56:39Z</updated>

		<summary type="html">&lt;p&gt;Ybart: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Here is an Apple Script allowing to automatically place correctly the icons in OpenOffice installation folder :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
on run argv&lt;br /&gt;
	set argv to POSIX file (item 1 of argv)&lt;br /&gt;
	tell application &amp;quot;Finder&amp;quot;&lt;br /&gt;
		set fichiers to items of folder argv&lt;br /&gt;
		set i to 0&lt;br /&gt;
		repeat with myItem in fichiers&lt;br /&gt;
			set i to i + 1&lt;br /&gt;
			&lt;br /&gt;
			set itemProperties to (properties of myItem)&lt;br /&gt;
			set itemPos to position of itemProperties&lt;br /&gt;
			set myName to name of itemProperties&lt;br /&gt;
			&lt;br /&gt;
			if i is 1 then set position of myItem to {332, 191} -- in alphabetic order &amp;quot;Applications&amp;quot;&lt;br /&gt;
			if i is 2 then set position of myItem to {97, 62} -- LICENSEs&lt;br /&gt;
			if i is 3 then set position of myItem to {101, 191} -- OpenOffice*&lt;br /&gt;
			if i is 4 then set position of myItem to {304, 61} -- READMEs&lt;br /&gt;
		end repeat&lt;br /&gt;
		quit&lt;br /&gt;
	end tell&lt;br /&gt;
	return argv as string&lt;br /&gt;
end run&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To use it, assuming you called it &amp;#039;&amp;#039;ooo_pack_finalizer.scpt&amp;#039;&amp;#039;, just type :&lt;br /&gt;
$ osascript ooo_pack_finalizer.scpt&lt;br /&gt;
&lt;br /&gt;
To use it, from a remote host, you will need to sudo to access the WindowServer :&lt;br /&gt;
$ sudo osascript ooo_pack_finalizer.scpt&lt;br /&gt;
&lt;br /&gt;
Notice than executing that script will starts the Finder with root rights, and any user with physical access to the computer will be able to use Finder during the script execution (until quit). In order to avoid security problem, make sure the Finder is really quit either by issuing &amp;#039;&amp;#039;$ sudo osascript -e &amp;quot;tell application \&amp;quot;Finder\&amp;quot; to quit&amp;quot;&amp;#039;&amp;#039; or using &amp;#039;&amp;#039;sudo kill&amp;#039;&amp;#039;. This way potential attackers will have access to Finder only few seconds.&lt;br /&gt;
&lt;br /&gt;
For better security, it should be possible to lock the user interface during the execution of the script by developping a simple app which captures all mouse and keyboard events in order to disallow access to Finder.  &lt;br /&gt;
&lt;br /&gt;
[[Category: Aqua]]&lt;br /&gt;
[[Category: Porting]]&lt;br /&gt;
[[Category: MacOSX]]&lt;/div&gt;</summary>
		<author><name>Ybart</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=DS_Store_generator&amp;diff=32584</id>
		<title>DS Store generator</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=DS_Store_generator&amp;diff=32584"/>
		<updated>2007-05-19T01:23:23Z</updated>

		<summary type="html">&lt;p&gt;Ybart: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Automatic Icon Positioning (Packaging)]]&lt;br /&gt;
&lt;br /&gt;
[[Category:Aqua]]&lt;/div&gt;</summary>
		<author><name>Ybart</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Automatic_Icon_Positioning&amp;diff=32583</id>
		<title>Automatic Icon Positioning</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Automatic_Icon_Positioning&amp;diff=32583"/>
		<updated>2007-05-19T01:20:26Z</updated>

		<summary type="html">&lt;p&gt;Ybart: Automatic Icon Positioning moved to Automatic Icon Positioning (Packaging)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;#REDIRECT [[Automatic Icon Positioning (Packaging)]]&lt;/div&gt;</summary>
		<author><name>Ybart</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Automatic_Icon_Positioning_(Packaging)&amp;diff=32582</id>
		<title>Automatic Icon Positioning (Packaging)</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Automatic_Icon_Positioning_(Packaging)&amp;diff=32582"/>
		<updated>2007-05-19T01:20:26Z</updated>

		<summary type="html">&lt;p&gt;Ybart: Automatic Icon Positioning moved to Automatic Icon Positioning (Packaging)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Here is an Apple Script allowing to automatically place correctly the icon of OpenOffice :&lt;br /&gt;
&lt;br /&gt;
Just need to replace &amp;quot;choose folder&amp;quot; with the path of the folder containing the OpenOffice packaging...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
tell application &amp;quot;Finder&amp;quot;&lt;br /&gt;
	choose folder&lt;br /&gt;
	set fichiers to items of result&lt;br /&gt;
	set myText to &amp;quot;&amp;quot;&lt;br /&gt;
	set i to 0&lt;br /&gt;
	repeat with myItem in fichiers&lt;br /&gt;
		set itemProperties to (properties of myItem)&lt;br /&gt;
		set itemPos to position of itemProperties&lt;br /&gt;
		set myName to name of itemProperties&lt;br /&gt;
		set myText to myText &amp;amp; myName &amp;amp; &amp;quot;: &amp;quot; &amp;amp; (item 1 of itemPos) &amp;amp; &amp;quot;, &amp;quot; &amp;amp; (item 2 of itemPos) &amp;amp; return&lt;br /&gt;
		set i to i + 1&lt;br /&gt;
		-- display dialog i&lt;br /&gt;
		if i is 1 then set position of myItem to {332, 191} -- in alphabetic order &amp;quot;Applications&amp;quot;&lt;br /&gt;
		if i is 2 then set position of myItem to {97, 62} -- LICENSEs&lt;br /&gt;
		if i is 3 then set position of myItem to {101, 191} -- OpenOffice*&lt;br /&gt;
		if i is 4 then set position of myItem to {304, 61} -- READMEs&lt;br /&gt;
	end repeat&lt;br /&gt;
	-- display dialog myText&lt;br /&gt;
	return myText&lt;br /&gt;
end tell&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To use it, assuming you called it &amp;#039;&amp;#039;ooo_pack_finalizer.scpt&amp;#039;&amp;#039;, just type :&lt;br /&gt;
$ osascript ooo_pack_finalizer.scpt&lt;br /&gt;
&lt;br /&gt;
[[Category: Aqua]]&lt;br /&gt;
[[Category: Porting]]&lt;br /&gt;
[[Category: MacOSX]]&lt;/div&gt;</summary>
		<author><name>Ybart</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Automatic_Icon_Positioning_(Packaging)&amp;diff=32581</id>
		<title>Automatic Icon Positioning (Packaging)</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Automatic_Icon_Positioning_(Packaging)&amp;diff=32581"/>
		<updated>2007-05-19T01:19:46Z</updated>

		<summary type="html">&lt;p&gt;Ybart: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Here is an Apple Script allowing to automatically place correctly the icon of OpenOffice :&lt;br /&gt;
&lt;br /&gt;
Just need to replace &amp;quot;choose folder&amp;quot; with the path of the folder containing the OpenOffice packaging...&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
tell application &amp;quot;Finder&amp;quot;&lt;br /&gt;
	choose folder&lt;br /&gt;
	set fichiers to items of result&lt;br /&gt;
	set myText to &amp;quot;&amp;quot;&lt;br /&gt;
	set i to 0&lt;br /&gt;
	repeat with myItem in fichiers&lt;br /&gt;
		set itemProperties to (properties of myItem)&lt;br /&gt;
		set itemPos to position of itemProperties&lt;br /&gt;
		set myName to name of itemProperties&lt;br /&gt;
		set myText to myText &amp;amp; myName &amp;amp; &amp;quot;: &amp;quot; &amp;amp; (item 1 of itemPos) &amp;amp; &amp;quot;, &amp;quot; &amp;amp; (item 2 of itemPos) &amp;amp; return&lt;br /&gt;
		set i to i + 1&lt;br /&gt;
		-- display dialog i&lt;br /&gt;
		if i is 1 then set position of myItem to {332, 191} -- in alphabetic order &amp;quot;Applications&amp;quot;&lt;br /&gt;
		if i is 2 then set position of myItem to {97, 62} -- LICENSEs&lt;br /&gt;
		if i is 3 then set position of myItem to {101, 191} -- OpenOffice*&lt;br /&gt;
		if i is 4 then set position of myItem to {304, 61} -- READMEs&lt;br /&gt;
	end repeat&lt;br /&gt;
	-- display dialog myText&lt;br /&gt;
	return myText&lt;br /&gt;
end tell&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To use it, assuming you called it &amp;#039;&amp;#039;ooo_pack_finalizer.scpt&amp;#039;&amp;#039;, just type :&lt;br /&gt;
$ osascript ooo_pack_finalizer.scpt&lt;br /&gt;
&lt;br /&gt;
[[Category: Aqua]]&lt;br /&gt;
[[Category: Porting]]&lt;br /&gt;
[[Category: MacOSX]]&lt;/div&gt;</summary>
		<author><name>Ybart</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Mac_OS_X_Porting_-_Native_Printing&amp;diff=32574</id>
		<title>Mac OS X Porting - Native Printing</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Mac_OS_X_Porting_-_Native_Printing&amp;diff=32574"/>
		<updated>2007-05-18T21:40:00Z</updated>

		<summary type="html">&lt;p&gt;Ybart: /* PrintDialog class */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page is dedicated to the native printing implementation in OpenOffice.org for Mac OS X&lt;br /&gt;
&lt;br /&gt;
== What we want to do ? ==&lt;br /&gt;
The final goal of this project is to have the native printing support on Mac OS X.&lt;br /&gt;
&lt;br /&gt;
=== What we have now and what we don&amp;#039;t ? ===&lt;br /&gt;
Currently we simply have a generic printing support which works with X11. There is also printing support implemented for Windows. This means that we have already a way to implement our printing support for Aqua without breaking OpenOffice.org as we have already environment plug-ins.&lt;br /&gt;
&lt;br /&gt;
However, we have only one Print Dialog and one Printer Setup dialog for all environments.&lt;br /&gt;
&lt;br /&gt;
Tu sum up : we have a starting point to implement low-level printing support using the native API. We only have to implement the native code. But &amp;#039;&amp;#039;&amp;#039;we have nothing for the dialogs&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
=== What the users want ? ===&lt;br /&gt;
The user wants to be able to print with OpenOffice.org the same way he does with its other natives applications. &lt;br /&gt;
&lt;br /&gt;
For us, this means using a native printing dialog. Then, we will also need to implement low-level printing using OS API because, without that the user might not be able to use every setting available in the native dialog. &lt;br /&gt;
&lt;br /&gt;
=== What will be even better ? ===&lt;br /&gt;
Using UNO. This will allow other platform developpers to use the same code to implement their native dialogs.&lt;br /&gt;
&lt;br /&gt;
== OpenOffice.org side ==&lt;br /&gt;
This part describes what can be found in the OOo APIs, how it is implemented and how it will be changed.&lt;br /&gt;
&lt;br /&gt;
=== OOo print process ===&lt;br /&gt;
I will try to share the few thing I understood about the way Writer prints document.&lt;br /&gt;
&lt;br /&gt;
First I need to locate the print menu item in the sw module (sw stands for Star Writer). For this, I need to know where in sw the menubar is built. I did found the menubar, but not how the menu item was linked to the print operation. Instead, I have found a method PrintPages implemented in sw module. The stack may look like that :&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;SwXTextDocument&amp;#039;&amp;#039;&amp;#039;::printPages()&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;ViewShell&amp;#039;&amp;#039;&amp;#039;::executeSlot(aReq)&lt;br /&gt;
* ...&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;SwView&amp;#039;&amp;#039;&amp;#039;::ExecutePrint()&lt;br /&gt;
* ...&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;SwXTextDocument&amp;#039;&amp;#039;&amp;#039;::render()&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;ViewShell&amp;#039;&amp;#039;&amp;#039;::Prt()&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;OutputDevice&amp;#039;&amp;#039;&amp;#039;:: ...&lt;br /&gt;
&lt;br /&gt;
TODO : Complete the stack trace&lt;br /&gt;
&lt;br /&gt;
There is many holes in the stack but we get the idea. The &amp;#039;&amp;#039;&amp;#039;OuputDevice&amp;#039;&amp;#039;&amp;#039; is in fact our &amp;#039;&amp;#039;&amp;#039;Printer.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
[[Image:Printing_model.png]]&lt;br /&gt;
&lt;br /&gt;
1. The user Application creates a print dialog or a print setup dialog. For this, it needs to call svtools. To be a bit more precise, it creates a new instance of &amp;#039;&amp;#039;&amp;#039;PrintDialog&amp;#039;&amp;#039;&amp;#039; or of &amp;#039;&amp;#039;&amp;#039;PrintDialogSetup&amp;#039;&amp;#039;&amp;#039;, it associates a Printer instance to it, then, it calls the Execute method from &amp;#039;&amp;#039;&amp;#039;PrintDialog&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;PrintSetupDialog&amp;#039;&amp;#039;&amp;#039;. This operation shows the dialog (using the &amp;#039;&amp;#039;Execute&amp;#039;&amp;#039; method from &amp;#039;&amp;#039;&amp;#039;ModalDialog&amp;#039;&amp;#039;&amp;#039;, which is in vcl) and sets the Printer Data correctly with the method &amp;#039;&amp;#039;setPrinterProps&amp;#039;&amp;#039;. Do do the real display of the dialog, it uses &amp;#039;&amp;#039;&amp;#039;SalFrame&amp;#039;&amp;#039;&amp;#039;&amp;#039;s &amp;#039;&amp;#039;Show()&amp;#039;&amp;#039; method, which can be X11SalFrame, &amp;#039;&amp;#039;&amp;#039;AquaSalFrame&amp;#039;&amp;#039;&amp;#039;, etc.&lt;br /&gt;
&lt;br /&gt;
2. Svtools is responsible for asking to the user the requested information about printing options. Then, it returns them ot the user application.&lt;br /&gt;
&lt;br /&gt;
3. The user application has now everything needed to print the document. So, it asks VCL to draw pixels, lines, characters, etc on an &amp;#039;&amp;#039;&amp;#039;OutputDevice&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
At this point, I don&amp;#039;t know exactly where the &amp;#039;&amp;#039;&amp;#039;OutputDevice&amp;#039;&amp;#039;&amp;#039; is instancied (who decides that it would be a screen, an Aqua printer or a PostScript printer. This is not really important since we understand the main idea of how printing works.&lt;br /&gt;
&lt;br /&gt;
[[Image:Printing_model_step_4.png]]&lt;br /&gt;
&lt;br /&gt;
4. After that VCL relies on its Graphic Context to really draws (i.e. make the OS really draws) the lines and pixels on the screen or on the print device.&lt;br /&gt;
&lt;br /&gt;
=== Concerned OOo modules ===&lt;br /&gt;
* psprint&lt;br /&gt;
* vcl&lt;br /&gt;
* svtools&lt;br /&gt;
&lt;br /&gt;
=== VCL ===&lt;br /&gt;
What we know about [[vcl]].&lt;br /&gt;
&lt;br /&gt;
==== SalPrinter class ====&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;SalPrinter&amp;#039;&amp;#039;&amp;#039; is a virtual class intended for managing print jobs. It is composed of virtual fonctions, and a dummy constructor.&lt;br /&gt;
This class is inherited by PspSalPrinter, WinSalPrinter, and of course by &amp;#039;&amp;#039;&amp;#039;AquaSalPrinter&amp;#039;&amp;#039;&amp;#039; (see [[#AquaSalPrinter class|AquaSalPrinter class]]).&lt;br /&gt;
&lt;br /&gt;
Its header is located in vcl/inc/salprn.hxx&lt;br /&gt;
It has no implementation file.&lt;br /&gt;
&lt;br /&gt;
[[Image:UML_class_SalPrinter.png]]&lt;br /&gt;
&lt;br /&gt;
==== PspSalPrinter class ====&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;PspSalPrinter&amp;#039;&amp;#039;&amp;#039; means PostScript Print System Abstraction Layer Printer. Its implementation is located in vcl/unx/source/gdi/salprnpsp.cxx. As the name suggests it relies on features psprint module.&lt;br /&gt;
&lt;br /&gt;
TODO : Discuss about &amp;#039;&amp;#039;&amp;#039;PspSalPrinter&amp;#039;&amp;#039;&amp;#039; implementation.&lt;br /&gt;
&lt;br /&gt;
==== Printer class ====&lt;br /&gt;
This is an abstraction class of a printer driver. You can entirely set up the printer there and start print jobs. What we need here is to make our native dialog access to this Printer. The we will need to make this class access to OS API rather than psprint. &lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;AquaSalPrinter&amp;#039;&amp;#039;&amp;#039; class is located in vcl/aqua/source/gdi/print.cxx&lt;br /&gt;
&lt;br /&gt;
[[Image:Printer_class_description.png]]&lt;br /&gt;
&lt;br /&gt;
This class inherits of &amp;#039;&amp;#039;&amp;#039;OutputDevice&amp;#039;&amp;#039;&amp;#039; and is derivated in &amp;#039;&amp;#039;&amp;#039;ImplQPrinter.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;QueueInfo&amp;#039;&amp;#039;&amp;#039; class - This class is related to the &amp;#039;&amp;#039;&amp;#039;Printer&amp;#039;&amp;#039;&amp;#039; class. It is used to store information about printers (name, driver, location, comment as strings, and number of Jobs, and a status code).&lt;br /&gt;
&lt;br /&gt;
==== OutputDevice class ====&lt;br /&gt;
This class allows applications such as Writer to draw graphics elements (pixels, lines, rects, characters, strings, etc...).&lt;br /&gt;
&lt;br /&gt;
This class is located in vcl/source/gdi/outdev.cxx, vcl/source/gdi/outdev[2-6].cxx&lt;br /&gt;
&lt;br /&gt;
At this time, we don&amp;#039;t need to know the details of this class. We will focus on it when we will use the Carbon Printing API.&lt;br /&gt;
&lt;br /&gt;
==== SalGraphics class ====&lt;br /&gt;
This class is responsible to translate the abstract drawing calls to concrete OS calls.&lt;br /&gt;
&lt;br /&gt;
==== PspGraphics ====&lt;br /&gt;
The class I need to reimplement using Aqua printing primitives...&lt;br /&gt;
It will probably called &amp;#039;&amp;#039;&amp;#039;AquaPrintGraphics&amp;#039;&amp;#039;&amp;#039;...&lt;br /&gt;
&lt;br /&gt;
==== AquaSalPrinter class ====&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;AquaSalPrinter&amp;#039;&amp;#039;&amp;#039; class is located in vcl/aqua/source/gdi/salprn.cxx&lt;br /&gt;
&lt;br /&gt;
Headers are in :&lt;br /&gt;
 vcl/inc/salinst.hxx  &lt;br /&gt;
 vcl/inc/salgdi.hxx    &lt;br /&gt;
 vcl/inc/salprn.hxx&lt;br /&gt;
&lt;br /&gt;
 Aqua implementation :&lt;br /&gt;
 vcl/aqua/inc/salprn.h  (AquaSalPrinter class implementation, inherits from &amp;#039;&amp;#039;&amp;#039;SalPrinter&amp;#039;&amp;#039;&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
=== psprint ===&lt;br /&gt;
What we know about psprint.&lt;br /&gt;
&lt;br /&gt;
=== svtools ===&lt;br /&gt;
What we need to know about svtools. Mostly it provides us the Print Dialog, and some other Print related dialogs.&lt;br /&gt;
&lt;br /&gt;
==== PrintDialog class ====&lt;br /&gt;
This class is responsible for drawing the print dialog we usually view when we choose the Print option of the File menu.&lt;br /&gt;
The current implementation uses this class to draw the print dialog. In our Aqua native implementation, we want to use the on provided by Carbon API. To achieve this, we want to know the functionality of this class, and let carbon manage the functionality maybe at this level or maybe in a other lever (higher or lower). We also need to know how this class provides information to the Printer instance.&lt;br /&gt;
&lt;br /&gt;
* The header of this class is located in [http://go-oo.org/lxr/source/util/svtools/inc/svtools/printdlg.hxx svtools/inc/svtools/printdlg.hxx]&lt;br /&gt;
* The implementation of this class is located in [http://go-oo.org/lxr/source/util/svtools/source/dialogs/printdlg.cxx svtools/source/dialogs/printdlg.cxx]&lt;br /&gt;
&lt;br /&gt;
This class is a child of &amp;#039;&amp;#039;&amp;#039;ModalDialog&amp;#039;&amp;#039;&amp;#039; class. &lt;br /&gt;
&lt;br /&gt;
It contains all the UI elements used by the dialog which are either :&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;FixedText&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;FixedInfo&amp;#039;&amp;#039;&amp;#039; : it is a child of &amp;#039;&amp;#039;&amp;#039;FixedText&amp;#039;&amp;#039;&amp;#039; and is defined in svtools/inc/stdctrl.hxx. It is nothing more than a &amp;#039;&amp;#039;&amp;#039;FixedText&amp;#039;&amp;#039;&amp;#039; with the info style applied (same behavior). It is used to store variables string since fixed text is for constant strings.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;ListBox&amp;#039;&amp;#039;&amp;#039; : maLbName - List-box used to store the available printers.&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Edit&amp;#039;&amp;#039;&amp;#039; : a text box&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;NumericField&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;CheckBox&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;PushButton&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;RadioButton&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;OKButton&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;CancelButton&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;HelpButton&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Useless in our case :&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;FixedImage&amp;#039;&amp;#039;&amp;#039; : draws an image on dialog&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;FixedLine&amp;#039;&amp;#039;&amp;#039; : draws a line on dialog&lt;br /&gt;
&lt;br /&gt;
These controls are used to allow the user to interact with the dialog. We only need to know the user-provided information. What is involved to display them, and how the look &amp;amp; feel is implemented is not interesting at this point, since we only want to know what the dialog actually does. So as &amp;#039;&amp;#039;&amp;#039;FixedImage&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;FixedLine&amp;#039;&amp;#039;&amp;#039;  provide no useful information, we don&amp;#039;t need them.&lt;br /&gt;
&lt;br /&gt;
There is also a timer intended to regulary update the current Printer status (ready, printing, paused, pending, waiting, offline, error…)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;AutoTimer&amp;#039;&amp;#039;&amp;#039; maStatusTimer&lt;br /&gt;
&lt;br /&gt;
TODO : List of all user-related information stored by this class and sent to the Printer and determine what work is involved when using Carbon equivalent.&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; style=&amp;quot;margin: 1em auto 1em auto; background: #f9f9f9; border: 1px #aaa solid;border-collapse: collapse; width: 600px;&amp;quot;&lt;br /&gt;
|+ &amp;#039;&amp;#039;&amp;#039;List of PrintDialog fields&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|-  &lt;br /&gt;
!  style=&amp;quot;background: #f2f2f2;&amp;quot; | PrinterDialog propery !! style=&amp;quot;background: #f2f2f2;&amp;quot; |  Work needed !! style=&amp;quot;background: #f2f2f2;&amp;quot; | Current status&lt;br /&gt;
|- &lt;br /&gt;
| maCbxFilePrint || Nothing, Aqua does PDF printing || Done&lt;br /&gt;
|- &lt;br /&gt;
| maEdtFaxNo || Nothing, Aqua does it || Done&lt;br /&gt;
|- &lt;br /&gt;
| maBtnBrowse_nomore || appears to be unused in current implementation || Done&lt;br /&gt;
|- &lt;br /&gt;
| maRbtAll || Fetch this information from Aqua dialog &amp;#039;&amp;#039;See below&amp;#039;&amp;#039; ||&lt;br /&gt;
|- &lt;br /&gt;
| maEbtPages || Fetch this with Carbon using [http://developer.apple.com/documentation/Carbon/Reference/CarbonPrintingManager_Ref/Reference/reference.html#//apple_ref/c/func/PMGetFirstPage PMGetFirstPage] and [http://developer.apple.com/documentation/Carbon/Reference/CarbonPrintingManager_Ref/Reference/reference.html#//apple_ref/c/func/PMGetLastPage PMGetLastPage] fields (Warning: custom panel needed or equivalent to have the same level of functionality) ||&lt;br /&gt;
|- &lt;br /&gt;
| maRbtSelection || Not natively provided, to do it we will need to [http://developer.apple.com/documentation/Printing/Reference/PrintingPlugin_Ref/Reference/reference.html#//apple_ref/c/tdef/PMPDEPrologueProcPtr override the default] copies and pages panel using &amp;#039;&amp;#039;kPMCopiesAndPagesPDEKindID&amp;#039;&amp;#039;  ||&lt;br /&gt;
|- &lt;br /&gt;
| maNumCopies || Fetch from Aqua using [http://developer.apple.com/documentation/Carbon/Reference/CarbonPrintingManager_Ref/Reference/reference.html#//apple_ref/c/func/PMGetCopies PMGetCopies] ||&lt;br /&gt;
|- &lt;br /&gt;
| maCbxCollate || Fetch from Aqua using [http://developer.apple.com/documentation/Carbon/Reference/CarbonPrintingManager_Ref/Reference/reference.html#//apple_ref/c/func/PMGetCollate PMGetCollate] ||&lt;br /&gt;
|- &lt;br /&gt;
| maBtnOptions || Detail in other dialog (some is provided by Aqua, some may need a custom panel)... See [http://developer.apple.com/documentation/Printing/Conceptual/ExtPrintingDialogs/index.html#//apple_ref/doc/uid/TP30000979 Extending Printing Dialogs]||&lt;br /&gt;
|- &lt;br /&gt;
| maBtnHelp || Nothing, Aqua do this || Done&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The class contains also fields used to store the real information provided by the controls (Mostly USHORT and BOOL). There is also a &amp;#039;&amp;#039;&amp;#039;XubString&amp;#039;&amp;#039;&amp;#039; instance and a &amp;#039;&amp;#039;&amp;#039;PrintDialogRange&amp;#039;&amp;#039;&amp;#039; instance used to store range information.&lt;br /&gt;
&lt;br /&gt;
Of course, this class contains an &amp;#039;&amp;#039;&amp;#039;Printer&amp;#039;&amp;#039;&amp;#039; instance and a &amp;#039;&amp;#039;&amp;#039;SvtPrinterImpl&amp;#039;&amp;#039;&amp;#039; instance in order to set the printer functionality.&lt;br /&gt;
&lt;br /&gt;
There is also internal methods, and links to the Option handler and the OK handler. You can find more information in the following file [http://go-oo.org/lxr/source/util/tools/inc/tools/link.hxx tools/inc/tools/link.hxx]&lt;br /&gt;
&lt;br /&gt;
The public methods are mostly getters and setters, I won&amp;#039;t detail it since I have already provided information about the private attributes, and they do nothing to the Printer instance.&lt;br /&gt;
&lt;br /&gt;
TODO : details the implementation of this class (interesting methods : &amp;#039;&amp;#039;ImplGetFileName&amp;#039;&amp;#039;, IMPL_LINK(PrintDialog, ImplModifyControlHdl, void*, p)&lt;br /&gt;
&lt;br /&gt;
For Aqua port, we need to re-implement this class in order to make it displays the native Aqua Print Dialog that will be provided by the Carbon API, and save information that was previously provided by children of &amp;#039;&amp;#039;&amp;#039;Control&amp;#039;&amp;#039;&amp;#039; class. We should also disable the Printing options provided by the Aqua dialog that are not provided by the Printer class (the information we cannot currently store). &amp;#039;&amp;#039;Update : Since we won&amp;#039;t use the current printing system and directly use CoreGraphics, we won&amp;#039;t have this problem (CoreGraphics will print correctly).&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
==== Print Setup file ====&lt;br /&gt;
* svtools/inc/prnsetup.hxx&lt;br /&gt;
* svtools/source/dialogs/prnsetup.hxx&lt;br /&gt;
&lt;br /&gt;
Utility functions : &lt;br /&gt;
* &amp;#039;&amp;#039;ImplFillPrnDlgListBox&amp;#039;&amp;#039;(const &amp;#039;&amp;#039;&amp;#039;Printer&amp;#039;&amp;#039;&amp;#039; *, &amp;#039;&amp;#039;&amp;#039;ListBox&amp;#039;&amp;#039;&amp;#039; *, &amp;#039;&amp;#039;&amp;#039;PushButton&amp;#039;&amp;#039;&amp;#039; *)&lt;br /&gt;
This method fills the &amp;#039;&amp;#039;&amp;#039;Printer&amp;#039;&amp;#039;&amp;#039; list-box with the QueueInfo provided by the &amp;#039;&amp;#039;&amp;#039;Printer&amp;#039;&amp;#039;&amp;#039; instance provided in argument. It then enables the OK button if the list is not empty.&lt;br /&gt;
&lt;br /&gt;
== Mac OS X API side ==&lt;br /&gt;
This part describes what can be used and how we intend to use it.&lt;br /&gt;
&lt;br /&gt;
The strategy is to first use the Carbon API to get Print Information and to provide an Aqua User Inerface for printing. Then, we will try to replace the current printing API to the native one, allowing to reduce dependencies, and the total package size.&lt;br /&gt;
&lt;br /&gt;
Carbon provides multiple way for us to print. We might consider every of different approaches :&lt;br /&gt;
* Printing using psprint. We only get settings from the Carbon Print Dialog and the Carbon Print Setup Dialog with the function PMGetPrintSettingsExtendedData (for example) and then we send the obtained parameters to our SalPrinter.&lt;br /&gt;
* Using the PMPrintToFile function (OpenOffice.org provides a postcript version of the document, and then, Carbon handles the print operation)&lt;br /&gt;
* Printing using a QuickDraw graphic context [http://developer.apple.com/documentation/Carbon/Conceptual/CPM_Concepts/cpm_chap3/chapter_3_section_4.html#//apple_ref/doc/uid/TP30000978-TP30000046-TPXREF12 See this link for an example] (As this is a legacy API, we are not enthusiast about using it in OpenOffice.org)&lt;br /&gt;
* Printing using a Quartz 2D graphic context [http://developer.apple.com/documentation/GraphicsImaging/Conceptual/drawingwithquartz2d/index.html More information about Quartz 2D]&lt;br /&gt;
&lt;br /&gt;
We may want to add some features to the Printing dialog provided by Carbon. [http://developer.apple.com/documentation/Printing/Conceptual/ExtPrintingDialogs/index.html This is documented here]&lt;br /&gt;
&lt;br /&gt;
Todo : implement missing methods, using Carbon API&lt;br /&gt;
&lt;br /&gt;
=== Using Aqua Printing Dialogs ===&lt;br /&gt;
&lt;br /&gt;
In a first a approach, we want to use Aqua dialogs and set the &amp;#039;&amp;#039;&amp;#039;SalPrinter&amp;#039;&amp;#039;&amp;#039; instance with the data provided by the dialog.&lt;br /&gt;
&lt;br /&gt;
Then, we want to get rid of the OpenOffice.org print dialog, for this, we need to add a custom print dialog addition to allow user to choose options not provided by Apple Print Dialog, however the behaviour might not be as the user except since we still use CUPS instead of Quartz.&lt;br /&gt;
&lt;br /&gt;
[http://developer.apple.com/documentation/Carbon/Conceptual/CPM_Concepts/index.html?http://developer.apple.com/documentation/Carbon/Conceptual/CPM_Concepts/cpm_chap3/chapter_3_section_1.html#//apple_ref/doc/uid/TP30000046-DontLinkElementID_22 Carbon calls for displaying Print Dialog and Print Setup Dialog]&lt;br /&gt;
&lt;br /&gt;
After this step, we should have a great native interface, now we want to print using Quartz instead of CUPS. To do this, we need to fill the Carbon Print object using the data provided by our Printer instance.&lt;br /&gt;
&lt;br /&gt;
[http://developer.apple.com/documentation/Carbon/Conceptual/CPM_Concepts/cpm_chap4/chapter_4_section_3.html Carbon Calls for retrieving Print Data and Page Setup data]&lt;br /&gt;
&lt;br /&gt;
We need then to hook Sal Graphic context primitives to the Quartz ones.&lt;br /&gt;
&lt;br /&gt;
=== Using Quartz Graphic Context to Print ===&lt;br /&gt;
&lt;br /&gt;
== Screenshots - Status ==&lt;br /&gt;
&lt;br /&gt;
http://eric.bachard.free.fr/mac/aquavcl/screenshots/printing/native_printing/native_printing_dialog.png&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
=== Link for Mac OS X API documentation  ===&lt;br /&gt;
http://developer.apple.com/documentation/Carbon/Reference/CarbonPrintingManager_Ref/index.html&lt;br /&gt;
&lt;br /&gt;
=== Starting point for documentation ===&lt;br /&gt;
http://developer.apple.com/documentation/Carbon/Printing-date.html#//apple_ref/doc/uid/TP30000440-TP30000420-TP30000455&lt;br /&gt;
http://developer.apple.com/documentation/Carbon/Conceptual/CPM_Concepts/cpm_chap4/chapter_4_section_1.html&lt;br /&gt;
http://developer.apple.com/samplecode/Carbon/idxPrinting-date.html&lt;br /&gt;
http://developer.apple.com/referencelibrary/Carbon/idxPrinting-date.html&lt;br /&gt;
&lt;br /&gt;
This work is part of http://wiki.services.openoffice.org/wiki/Mac_OS_X_Porting_-_Work_Areas/Todo%27s&lt;br /&gt;
&lt;br /&gt;
Created: [[User:Ericb|Ericb]] 19:33, 4 June 2006 (CEST)&lt;br /&gt;
&lt;br /&gt;
Last modification: [[User:Ybart|ybart]] 0:00, 16 October 2006 (CEST)&lt;br /&gt;
&lt;br /&gt;
[[Category:Porting]]&lt;br /&gt;
[[Category:Aqua]]&lt;br /&gt;
[[Category:MacOSX]]&lt;/div&gt;</summary>
		<author><name>Ybart</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Mac_OS_X_Porting_-_Native_Printing&amp;diff=32560</id>
		<title>Mac OS X Porting - Native Printing</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Mac_OS_X_Porting_-_Native_Printing&amp;diff=32560"/>
		<updated>2007-05-18T19:15:20Z</updated>

		<summary type="html">&lt;p&gt;Ybart: /* PrintDialog class */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page is dedicated to the native printing implementation in OpenOffice.org for Mac OS X&lt;br /&gt;
&lt;br /&gt;
== What we want to do ? ==&lt;br /&gt;
The final goal of this project is to have the native printing support on Mac OS X.&lt;br /&gt;
&lt;br /&gt;
=== What we have now and what we don&amp;#039;t ? ===&lt;br /&gt;
Currently we simply have a generic printing support which works with X11. There is also printing support implemented for Windows. This means that we have already a way to implement our printing support for Aqua without breaking OpenOffice.org as we have already environment plug-ins.&lt;br /&gt;
&lt;br /&gt;
However, we have only one Print Dialog and one Printer Setup dialog for all environments.&lt;br /&gt;
&lt;br /&gt;
Tu sum up : we have a starting point to implement low-level printing support using the native API. We only have to implement the native code. But &amp;#039;&amp;#039;&amp;#039;we have nothing for the dialogs&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
=== What the users want ? ===&lt;br /&gt;
The user wants to be able to print with OpenOffice.org the same way he does with its other natives applications. &lt;br /&gt;
&lt;br /&gt;
For us, this means using a native printing dialog. Then, we will also need to implement low-level printing using OS API because, without that the user might not be able to use every setting available in the native dialog. &lt;br /&gt;
&lt;br /&gt;
=== What will be even better ? ===&lt;br /&gt;
Using UNO. This will allow other platform developpers to use the same code to implement their native dialogs.&lt;br /&gt;
&lt;br /&gt;
== OpenOffice.org side ==&lt;br /&gt;
This part describes what can be found in the OOo APIs, how it is implemented and how it will be changed.&lt;br /&gt;
&lt;br /&gt;
=== OOo print process ===&lt;br /&gt;
I will try to share the few thing I understood about the way Writer prints document.&lt;br /&gt;
&lt;br /&gt;
First I need to locate the print menu item in the sw module (sw stands for Star Writer). For this, I need to know where in sw the menubar is built. I did found the menubar, but not how the menu item was linked to the print operation. Instead, I have found a method PrintPages implemented in sw module. The stack may look like that :&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;SwXTextDocument&amp;#039;&amp;#039;&amp;#039;::printPages()&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;ViewShell&amp;#039;&amp;#039;&amp;#039;::executeSlot(aReq)&lt;br /&gt;
* ...&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;SwView&amp;#039;&amp;#039;&amp;#039;::ExecutePrint()&lt;br /&gt;
* ...&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;SwXTextDocument&amp;#039;&amp;#039;&amp;#039;::render()&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;ViewShell&amp;#039;&amp;#039;&amp;#039;::Prt()&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;OutputDevice&amp;#039;&amp;#039;&amp;#039;:: ...&lt;br /&gt;
&lt;br /&gt;
TODO : Complete the stack trace&lt;br /&gt;
&lt;br /&gt;
There is many holes in the stack but we get the idea. The &amp;#039;&amp;#039;&amp;#039;OuputDevice&amp;#039;&amp;#039;&amp;#039; is in fact our &amp;#039;&amp;#039;&amp;#039;Printer.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
[[Image:Printing_model.png]]&lt;br /&gt;
&lt;br /&gt;
1. The user Application creates a print dialog or a print setup dialog. For this, it needs to call svtools. To be a bit more precise, it creates a new instance of &amp;#039;&amp;#039;&amp;#039;PrintDialog&amp;#039;&amp;#039;&amp;#039; or of &amp;#039;&amp;#039;&amp;#039;PrintDialogSetup&amp;#039;&amp;#039;&amp;#039;, it associates a Printer instance to it, then, it calls the Execute method from &amp;#039;&amp;#039;&amp;#039;PrintDialog&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;PrintSetupDialog&amp;#039;&amp;#039;&amp;#039;. This operation shows the dialog (using the &amp;#039;&amp;#039;Execute&amp;#039;&amp;#039; method from &amp;#039;&amp;#039;&amp;#039;ModalDialog&amp;#039;&amp;#039;&amp;#039;, which is in vcl) and sets the Printer Data correctly with the method &amp;#039;&amp;#039;setPrinterProps&amp;#039;&amp;#039;. Do do the real display of the dialog, it uses &amp;#039;&amp;#039;&amp;#039;SalFrame&amp;#039;&amp;#039;&amp;#039;&amp;#039;s &amp;#039;&amp;#039;Show()&amp;#039;&amp;#039; method, which can be X11SalFrame, &amp;#039;&amp;#039;&amp;#039;AquaSalFrame&amp;#039;&amp;#039;&amp;#039;, etc.&lt;br /&gt;
&lt;br /&gt;
2. Svtools is responsible for asking to the user the requested information about printing options. Then, it returns them ot the user application.&lt;br /&gt;
&lt;br /&gt;
3. The user application has now everything needed to print the document. So, it asks VCL to draw pixels, lines, characters, etc on an &amp;#039;&amp;#039;&amp;#039;OutputDevice&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
At this point, I don&amp;#039;t know exactly where the &amp;#039;&amp;#039;&amp;#039;OutputDevice&amp;#039;&amp;#039;&amp;#039; is instancied (who decides that it would be a screen, an Aqua printer or a PostScript printer. This is not really important since we understand the main idea of how printing works.&lt;br /&gt;
&lt;br /&gt;
[[Image:Printing_model_step_4.png]]&lt;br /&gt;
&lt;br /&gt;
4. After that VCL relies on its Graphic Context to really draws (i.e. make the OS really draws) the lines and pixels on the screen or on the print device.&lt;br /&gt;
&lt;br /&gt;
=== Concerned OOo modules ===&lt;br /&gt;
* psprint&lt;br /&gt;
* vcl&lt;br /&gt;
* svtools&lt;br /&gt;
&lt;br /&gt;
=== VCL ===&lt;br /&gt;
What we know about [[vcl]].&lt;br /&gt;
&lt;br /&gt;
==== SalPrinter class ====&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;SalPrinter&amp;#039;&amp;#039;&amp;#039; is a virtual class intended for managing print jobs. It is composed of virtual fonctions, and a dummy constructor.&lt;br /&gt;
This class is inherited by PspSalPrinter, WinSalPrinter, and of course by &amp;#039;&amp;#039;&amp;#039;AquaSalPrinter&amp;#039;&amp;#039;&amp;#039; (see [[#AquaSalPrinter class|AquaSalPrinter class]]).&lt;br /&gt;
&lt;br /&gt;
Its header is located in vcl/inc/salprn.hxx&lt;br /&gt;
It has no implementation file.&lt;br /&gt;
&lt;br /&gt;
[[Image:UML_class_SalPrinter.png]]&lt;br /&gt;
&lt;br /&gt;
==== PspSalPrinter class ====&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;PspSalPrinter&amp;#039;&amp;#039;&amp;#039; means PostScript Print System Abstraction Layer Printer. Its implementation is located in vcl/unx/source/gdi/salprnpsp.cxx. As the name suggests it relies on features psprint module.&lt;br /&gt;
&lt;br /&gt;
TODO : Discuss about &amp;#039;&amp;#039;&amp;#039;PspSalPrinter&amp;#039;&amp;#039;&amp;#039; implementation.&lt;br /&gt;
&lt;br /&gt;
==== Printer class ====&lt;br /&gt;
This is an abstraction class of a printer driver. You can entirely set up the printer there and start print jobs. What we need here is to make our native dialog access to this Printer. The we will need to make this class access to OS API rather than psprint. &lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;AquaSalPrinter&amp;#039;&amp;#039;&amp;#039; class is located in vcl/aqua/source/gdi/print.cxx&lt;br /&gt;
&lt;br /&gt;
[[Image:Printer_class_description.png]]&lt;br /&gt;
&lt;br /&gt;
This class inherits of &amp;#039;&amp;#039;&amp;#039;OutputDevice&amp;#039;&amp;#039;&amp;#039; and is derivated in &amp;#039;&amp;#039;&amp;#039;ImplQPrinter.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;QueueInfo&amp;#039;&amp;#039;&amp;#039; class - This class is related to the &amp;#039;&amp;#039;&amp;#039;Printer&amp;#039;&amp;#039;&amp;#039; class. It is used to store information about printers (name, driver, location, comment as strings, and number of Jobs, and a status code).&lt;br /&gt;
&lt;br /&gt;
==== OutputDevice class ====&lt;br /&gt;
This class allows applications such as Writer to draw graphics elements (pixels, lines, rects, characters, strings, etc...).&lt;br /&gt;
&lt;br /&gt;
This class is located in vcl/source/gdi/outdev.cxx, vcl/source/gdi/outdev[2-6].cxx&lt;br /&gt;
&lt;br /&gt;
At this time, we don&amp;#039;t need to know the details of this class. We will focus on it when we will use the Carbon Printing API.&lt;br /&gt;
&lt;br /&gt;
==== SalGraphics class ====&lt;br /&gt;
This class is responsible to translate the abstract drawing calls to concrete OS calls.&lt;br /&gt;
&lt;br /&gt;
==== PspGraphics ====&lt;br /&gt;
The class I need to reimplement using Aqua printing primitives...&lt;br /&gt;
It will probably called &amp;#039;&amp;#039;&amp;#039;AquaPrintGraphics&amp;#039;&amp;#039;&amp;#039;...&lt;br /&gt;
&lt;br /&gt;
==== AquaSalPrinter class ====&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;AquaSalPrinter&amp;#039;&amp;#039;&amp;#039; class is located in vcl/aqua/source/gdi/salprn.cxx&lt;br /&gt;
&lt;br /&gt;
Headers are in :&lt;br /&gt;
 vcl/inc/salinst.hxx  &lt;br /&gt;
 vcl/inc/salgdi.hxx    &lt;br /&gt;
 vcl/inc/salprn.hxx&lt;br /&gt;
&lt;br /&gt;
 Aqua implementation :&lt;br /&gt;
 vcl/aqua/inc/salprn.h  (AquaSalPrinter class implementation, inherits from &amp;#039;&amp;#039;&amp;#039;SalPrinter&amp;#039;&amp;#039;&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
=== psprint ===&lt;br /&gt;
What we know about psprint.&lt;br /&gt;
&lt;br /&gt;
=== svtools ===&lt;br /&gt;
What we need to know about svtools. Mostly it provides us the Print Dialog, and some other Print related dialogs.&lt;br /&gt;
&lt;br /&gt;
==== PrintDialog class ====&lt;br /&gt;
This class is responsible for drawing the print dialog we usually view when we choose the Print option of the File menu.&lt;br /&gt;
The current implementation uses this class to draw the print dialog. In our Aqua native implementation, we want to use the on provided by Carbon API. To achieve this, we want to know the functionality of this class, and let carbon manage the functionality maybe at this level or maybe in a other lever (higher or lower). We also need to know how this class provides information to the Printer instance.&lt;br /&gt;
&lt;br /&gt;
* The header of this class is located in [http://go-oo.org/lxr/source/util/svtools/inc/svtools/printdlg.hxx svtools/inc/svtools/printdlg.hxx]&lt;br /&gt;
* The implementation of this class is located in [http://go-oo.org/lxr/source/util/svtools/source/dialogs/printdlg.cxx svtools/source/dialogs/printdlg.cxx]&lt;br /&gt;
&lt;br /&gt;
This class is a child of &amp;#039;&amp;#039;&amp;#039;ModalDialog&amp;#039;&amp;#039;&amp;#039; class. &lt;br /&gt;
&lt;br /&gt;
It contains all the UI elements used by the dialog which are either :&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;FixedText&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;FixedInfo&amp;#039;&amp;#039;&amp;#039; : it is a child of &amp;#039;&amp;#039;&amp;#039;FixedText&amp;#039;&amp;#039;&amp;#039; and is defined in svtools/inc/stdctrl.hxx. It is nothing more than a &amp;#039;&amp;#039;&amp;#039;FixedText&amp;#039;&amp;#039;&amp;#039; with the info style applied (same behavior). It is used to store variables string since fixed text is for constant strings.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;ListBox&amp;#039;&amp;#039;&amp;#039; : maLbName - List-box used to store the available printers.&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Edit&amp;#039;&amp;#039;&amp;#039; : a text box&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;NumericField&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;CheckBox&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;PushButton&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;RadioButton&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;OKButton&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;CancelButton&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;HelpButton&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Useless in our case :&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;FixedImage&amp;#039;&amp;#039;&amp;#039; : draws an image on dialog&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;FixedLine&amp;#039;&amp;#039;&amp;#039; : draws a line on dialog&lt;br /&gt;
&lt;br /&gt;
These controls are used to allow the user to interact with the dialog. We only need to know the user-provided information. What is involved to display them, and how the look &amp;amp; feel is implemented is not interesting at this point, since we only want to know what the dialog actually does. So as &amp;#039;&amp;#039;&amp;#039;FixedImage&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;FixedLine&amp;#039;&amp;#039;&amp;#039;  provide no useful information, we don&amp;#039;t need them.&lt;br /&gt;
&lt;br /&gt;
There is also a timer intended to regulary update the current Printer status (ready, printing, paused, pending, waiting, offline, error…)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;AutoTimer&amp;#039;&amp;#039;&amp;#039; maStatusTimer&lt;br /&gt;
&lt;br /&gt;
TODO : List of all user-related information stored by this class and sent to the Printer and determine what work is involved when using Carbon equivalent.&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; style=&amp;quot;margin: 1em auto 1em auto; background: #f9f9f9; border: 1px #aaa solid;border-collapse: collapse; width: 600px;&amp;quot;&lt;br /&gt;
|+ &amp;#039;&amp;#039;&amp;#039;List of PrintDialog fields&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|-  &lt;br /&gt;
!  style=&amp;quot;background: #f2f2f2;&amp;quot; | PrinterDialog propery !! style=&amp;quot;background: #f2f2f2;&amp;quot; |  Work needed !! style=&amp;quot;background: #f2f2f2;&amp;quot; | Current status&lt;br /&gt;
|- &lt;br /&gt;
| maCbxFilePrint || Nothing, Aqua does PDF printing || Done&lt;br /&gt;
|- &lt;br /&gt;
| maEdtFaxNo || Nothing, Aqua does it || Done&lt;br /&gt;
|- &lt;br /&gt;
| maBtnBrowse_nomore || appears to be unused in current implementation || Done&lt;br /&gt;
|- &lt;br /&gt;
| maRbtAll || Fetch this information from Aqua dialog &amp;#039;&amp;#039;See below&amp;#039;&amp;#039; ||&lt;br /&gt;
|- &lt;br /&gt;
| maEbtPages || Fetch this with Carbon using [http://developer.apple.com/documentation/Carbon/Reference/CarbonPrintingManager_Ref/Reference/reference.html#//apple_ref/c/func/PMGetFirstPage PMGetFirstPage] and [http://developer.apple.com/documentation/Carbon/Reference/CarbonPrintingManager_Ref/Reference/reference.html#//apple_ref/c/func/PMGetLastPage PMGetLastPage] fields (Warning: custom panel needed or equivalent to have the same level of functionality) ||&lt;br /&gt;
|- &lt;br /&gt;
| maRbtSelection || Not natively provided, some more work (may need a custom panel) ||&lt;br /&gt;
|- &lt;br /&gt;
| maNumCopies || Fetch from Aqua using [http://developer.apple.com/documentation/Carbon/Reference/CarbonPrintingManager_Ref/Reference/reference.html#//apple_ref/c/func/PMGetCopies PMGetCopies] ||&lt;br /&gt;
|- &lt;br /&gt;
| maCbxCollate || Fetch from Aqua using [http://developer.apple.com/documentation/Carbon/Reference/CarbonPrintingManager_Ref/Reference/reference.html#//apple_ref/c/func/PMGetCollate PMGetCollate] ||&lt;br /&gt;
|- &lt;br /&gt;
| maBtnOptions || Detail in other dialog (some is provided by Aqua, some may need a custom panel)... See [http://developer.apple.com/documentation/Printing/Conceptual/ExtPrintingDialogs/index.html#//apple_ref/doc/uid/TP30000979 Extending Printing Dialogs]||&lt;br /&gt;
|- &lt;br /&gt;
| maBtnHelp || Nothing, Aqua do this || Done&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The class contains also fields used to store the real information provided by the controls (Mostly USHORT and BOOL). There is also a &amp;#039;&amp;#039;&amp;#039;XubString&amp;#039;&amp;#039;&amp;#039; instance and a &amp;#039;&amp;#039;&amp;#039;PrintDialogRange&amp;#039;&amp;#039;&amp;#039; instance used to store range information.&lt;br /&gt;
&lt;br /&gt;
Of course, this class contains an &amp;#039;&amp;#039;&amp;#039;Printer&amp;#039;&amp;#039;&amp;#039; instance and a &amp;#039;&amp;#039;&amp;#039;SvtPrinterImpl&amp;#039;&amp;#039;&amp;#039; instance in order to set the printer functionality.&lt;br /&gt;
&lt;br /&gt;
There is also internal methods, and links to the Option handler and the OK handler. You can find more information in the following file [http://go-oo.org/lxr/source/util/tools/inc/tools/link.hxx tools/inc/tools/link.hxx]&lt;br /&gt;
&lt;br /&gt;
The public methods are mostly getters and setters, I won&amp;#039;t detail it since I have already provided information about the private attributes, and they do nothing to the Printer instance.&lt;br /&gt;
&lt;br /&gt;
TODO : details the implementation of this class (interesting methods : &amp;#039;&amp;#039;ImplGetFileName&amp;#039;&amp;#039;, IMPL_LINK(PrintDialog, ImplModifyControlHdl, void*, p)&lt;br /&gt;
&lt;br /&gt;
For Aqua port, we need to re-implement this class in order to make it displays the native Aqua Print Dialog that will be provided by the Carbon API, and save information that was previously provided by children of &amp;#039;&amp;#039;&amp;#039;Control&amp;#039;&amp;#039;&amp;#039; class. We should also disable the Printing options provided by the Aqua dialog that are not provided by the Printer class (the information we cannot currently store). &amp;#039;&amp;#039;Update : Since we won&amp;#039;t use the current printing system and directly use CoreGraphics, we won&amp;#039;t have this problem (CoreGraphics will print correctly).&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
==== Print Setup file ====&lt;br /&gt;
* svtools/inc/prnsetup.hxx&lt;br /&gt;
* svtools/source/dialogs/prnsetup.hxx&lt;br /&gt;
&lt;br /&gt;
Utility functions : &lt;br /&gt;
* &amp;#039;&amp;#039;ImplFillPrnDlgListBox&amp;#039;&amp;#039;(const &amp;#039;&amp;#039;&amp;#039;Printer&amp;#039;&amp;#039;&amp;#039; *, &amp;#039;&amp;#039;&amp;#039;ListBox&amp;#039;&amp;#039;&amp;#039; *, &amp;#039;&amp;#039;&amp;#039;PushButton&amp;#039;&amp;#039;&amp;#039; *)&lt;br /&gt;
This method fills the &amp;#039;&amp;#039;&amp;#039;Printer&amp;#039;&amp;#039;&amp;#039; list-box with the QueueInfo provided by the &amp;#039;&amp;#039;&amp;#039;Printer&amp;#039;&amp;#039;&amp;#039; instance provided in argument. It then enables the OK button if the list is not empty.&lt;br /&gt;
&lt;br /&gt;
== Mac OS X API side ==&lt;br /&gt;
This part describes what can be used and how we intend to use it.&lt;br /&gt;
&lt;br /&gt;
The strategy is to first use the Carbon API to get Print Information and to provide an Aqua User Inerface for printing. Then, we will try to replace the current printing API to the native one, allowing to reduce dependencies, and the total package size.&lt;br /&gt;
&lt;br /&gt;
Carbon provides multiple way for us to print. We might consider every of different approaches :&lt;br /&gt;
* Printing using psprint. We only get settings from the Carbon Print Dialog and the Carbon Print Setup Dialog with the function PMGetPrintSettingsExtendedData (for example) and then we send the obtained parameters to our SalPrinter.&lt;br /&gt;
* Using the PMPrintToFile function (OpenOffice.org provides a postcript version of the document, and then, Carbon handles the print operation)&lt;br /&gt;
* Printing using a QuickDraw graphic context [http://developer.apple.com/documentation/Carbon/Conceptual/CPM_Concepts/cpm_chap3/chapter_3_section_4.html#//apple_ref/doc/uid/TP30000978-TP30000046-TPXREF12 See this link for an example] (As this is a legacy API, we are not enthusiast about using it in OpenOffice.org)&lt;br /&gt;
* Printing using a Quartz 2D graphic context [http://developer.apple.com/documentation/GraphicsImaging/Conceptual/drawingwithquartz2d/index.html More information about Quartz 2D]&lt;br /&gt;
&lt;br /&gt;
We may want to add some features to the Printing dialog provided by Carbon. [http://developer.apple.com/documentation/Printing/Conceptual/ExtPrintingDialogs/index.html This is documented here]&lt;br /&gt;
&lt;br /&gt;
Todo : implement missing methods, using Carbon API&lt;br /&gt;
&lt;br /&gt;
=== Using Aqua Printing Dialogs ===&lt;br /&gt;
&lt;br /&gt;
In a first a approach, we want to use Aqua dialogs and set the &amp;#039;&amp;#039;&amp;#039;SalPrinter&amp;#039;&amp;#039;&amp;#039; instance with the data provided by the dialog.&lt;br /&gt;
&lt;br /&gt;
Then, we want to get rid of the OpenOffice.org print dialog, for this, we need to add a custom print dialog addition to allow user to choose options not provided by Apple Print Dialog, however the behaviour might not be as the user except since we still use CUPS instead of Quartz.&lt;br /&gt;
&lt;br /&gt;
[http://developer.apple.com/documentation/Carbon/Conceptual/CPM_Concepts/index.html?http://developer.apple.com/documentation/Carbon/Conceptual/CPM_Concepts/cpm_chap3/chapter_3_section_1.html#//apple_ref/doc/uid/TP30000046-DontLinkElementID_22 Carbon calls for displaying Print Dialog and Print Setup Dialog]&lt;br /&gt;
&lt;br /&gt;
After this step, we should have a great native interface, now we want to print using Quartz instead of CUPS. To do this, we need to fill the Carbon Print object using the data provided by our Printer instance.&lt;br /&gt;
&lt;br /&gt;
[http://developer.apple.com/documentation/Carbon/Conceptual/CPM_Concepts/cpm_chap4/chapter_4_section_3.html Carbon Calls for retrieving Print Data and Page Setup data]&lt;br /&gt;
&lt;br /&gt;
We need then to hook Sal Graphic context primitives to the Quartz ones.&lt;br /&gt;
&lt;br /&gt;
=== Using Quartz Graphic Context to Print ===&lt;br /&gt;
&lt;br /&gt;
== Screenshots - Status ==&lt;br /&gt;
&lt;br /&gt;
http://eric.bachard.free.fr/mac/aquavcl/screenshots/printing/native_printing/native_printing_dialog.png&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
=== Link for Mac OS X API documentation  ===&lt;br /&gt;
http://developer.apple.com/documentation/Carbon/Reference/CarbonPrintingManager_Ref/index.html&lt;br /&gt;
&lt;br /&gt;
=== Starting point for documentation ===&lt;br /&gt;
http://developer.apple.com/documentation/Carbon/Printing-date.html#//apple_ref/doc/uid/TP30000440-TP30000420-TP30000455&lt;br /&gt;
http://developer.apple.com/documentation/Carbon/Conceptual/CPM_Concepts/cpm_chap4/chapter_4_section_1.html&lt;br /&gt;
http://developer.apple.com/samplecode/Carbon/idxPrinting-date.html&lt;br /&gt;
http://developer.apple.com/referencelibrary/Carbon/idxPrinting-date.html&lt;br /&gt;
&lt;br /&gt;
This work is part of http://wiki.services.openoffice.org/wiki/Mac_OS_X_Porting_-_Work_Areas/Todo%27s&lt;br /&gt;
&lt;br /&gt;
Created: [[User:Ericb|Ericb]] 19:33, 4 June 2006 (CEST)&lt;br /&gt;
&lt;br /&gt;
Last modification: [[User:Ybart|ybart]] 0:00, 16 October 2006 (CEST)&lt;br /&gt;
&lt;br /&gt;
[[Category:Porting]]&lt;br /&gt;
[[Category:Aqua]]&lt;br /&gt;
[[Category:MacOSX]]&lt;/div&gt;</summary>
		<author><name>Ybart</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Mac_OS_X_Porting_-_Native_Printing&amp;diff=32558</id>
		<title>Mac OS X Porting - Native Printing</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Mac_OS_X_Porting_-_Native_Printing&amp;diff=32558"/>
		<updated>2007-05-18T18:59:13Z</updated>

		<summary type="html">&lt;p&gt;Ybart: /* PrintDialog class */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page is dedicated to the native printing implementation in OpenOffice.org for Mac OS X&lt;br /&gt;
&lt;br /&gt;
== What we want to do ? ==&lt;br /&gt;
The final goal of this project is to have the native printing support on Mac OS X.&lt;br /&gt;
&lt;br /&gt;
=== What we have now and what we don&amp;#039;t ? ===&lt;br /&gt;
Currently we simply have a generic printing support which works with X11. There is also printing support implemented for Windows. This means that we have already a way to implement our printing support for Aqua without breaking OpenOffice.org as we have already environment plug-ins.&lt;br /&gt;
&lt;br /&gt;
However, we have only one Print Dialog and one Printer Setup dialog for all environments.&lt;br /&gt;
&lt;br /&gt;
Tu sum up : we have a starting point to implement low-level printing support using the native API. We only have to implement the native code. But &amp;#039;&amp;#039;&amp;#039;we have nothing for the dialogs&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
=== What the users want ? ===&lt;br /&gt;
The user wants to be able to print with OpenOffice.org the same way he does with its other natives applications. &lt;br /&gt;
&lt;br /&gt;
For us, this means using a native printing dialog. Then, we will also need to implement low-level printing using OS API because, without that the user might not be able to use every setting available in the native dialog. &lt;br /&gt;
&lt;br /&gt;
=== What will be even better ? ===&lt;br /&gt;
Using UNO. This will allow other platform developpers to use the same code to implement their native dialogs.&lt;br /&gt;
&lt;br /&gt;
== OpenOffice.org side ==&lt;br /&gt;
This part describes what can be found in the OOo APIs, how it is implemented and how it will be changed.&lt;br /&gt;
&lt;br /&gt;
=== OOo print process ===&lt;br /&gt;
I will try to share the few thing I understood about the way Writer prints document.&lt;br /&gt;
&lt;br /&gt;
First I need to locate the print menu item in the sw module (sw stands for Star Writer). For this, I need to know where in sw the menubar is built. I did found the menubar, but not how the menu item was linked to the print operation. Instead, I have found a method PrintPages implemented in sw module. The stack may look like that :&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;SwXTextDocument&amp;#039;&amp;#039;&amp;#039;::printPages()&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;ViewShell&amp;#039;&amp;#039;&amp;#039;::executeSlot(aReq)&lt;br /&gt;
* ...&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;SwView&amp;#039;&amp;#039;&amp;#039;::ExecutePrint()&lt;br /&gt;
* ...&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;SwXTextDocument&amp;#039;&amp;#039;&amp;#039;::render()&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;ViewShell&amp;#039;&amp;#039;&amp;#039;::Prt()&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;OutputDevice&amp;#039;&amp;#039;&amp;#039;:: ...&lt;br /&gt;
&lt;br /&gt;
TODO : Complete the stack trace&lt;br /&gt;
&lt;br /&gt;
There is many holes in the stack but we get the idea. The &amp;#039;&amp;#039;&amp;#039;OuputDevice&amp;#039;&amp;#039;&amp;#039; is in fact our &amp;#039;&amp;#039;&amp;#039;Printer.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
[[Image:Printing_model.png]]&lt;br /&gt;
&lt;br /&gt;
1. The user Application creates a print dialog or a print setup dialog. For this, it needs to call svtools. To be a bit more precise, it creates a new instance of &amp;#039;&amp;#039;&amp;#039;PrintDialog&amp;#039;&amp;#039;&amp;#039; or of &amp;#039;&amp;#039;&amp;#039;PrintDialogSetup&amp;#039;&amp;#039;&amp;#039;, it associates a Printer instance to it, then, it calls the Execute method from &amp;#039;&amp;#039;&amp;#039;PrintDialog&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;PrintSetupDialog&amp;#039;&amp;#039;&amp;#039;. This operation shows the dialog (using the &amp;#039;&amp;#039;Execute&amp;#039;&amp;#039; method from &amp;#039;&amp;#039;&amp;#039;ModalDialog&amp;#039;&amp;#039;&amp;#039;, which is in vcl) and sets the Printer Data correctly with the method &amp;#039;&amp;#039;setPrinterProps&amp;#039;&amp;#039;. Do do the real display of the dialog, it uses &amp;#039;&amp;#039;&amp;#039;SalFrame&amp;#039;&amp;#039;&amp;#039;&amp;#039;s &amp;#039;&amp;#039;Show()&amp;#039;&amp;#039; method, which can be X11SalFrame, &amp;#039;&amp;#039;&amp;#039;AquaSalFrame&amp;#039;&amp;#039;&amp;#039;, etc.&lt;br /&gt;
&lt;br /&gt;
2. Svtools is responsible for asking to the user the requested information about printing options. Then, it returns them ot the user application.&lt;br /&gt;
&lt;br /&gt;
3. The user application has now everything needed to print the document. So, it asks VCL to draw pixels, lines, characters, etc on an &amp;#039;&amp;#039;&amp;#039;OutputDevice&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
At this point, I don&amp;#039;t know exactly where the &amp;#039;&amp;#039;&amp;#039;OutputDevice&amp;#039;&amp;#039;&amp;#039; is instancied (who decides that it would be a screen, an Aqua printer or a PostScript printer. This is not really important since we understand the main idea of how printing works.&lt;br /&gt;
&lt;br /&gt;
[[Image:Printing_model_step_4.png]]&lt;br /&gt;
&lt;br /&gt;
4. After that VCL relies on its Graphic Context to really draws (i.e. make the OS really draws) the lines and pixels on the screen or on the print device.&lt;br /&gt;
&lt;br /&gt;
=== Concerned OOo modules ===&lt;br /&gt;
* psprint&lt;br /&gt;
* vcl&lt;br /&gt;
* svtools&lt;br /&gt;
&lt;br /&gt;
=== VCL ===&lt;br /&gt;
What we know about [[vcl]].&lt;br /&gt;
&lt;br /&gt;
==== SalPrinter class ====&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;SalPrinter&amp;#039;&amp;#039;&amp;#039; is a virtual class intended for managing print jobs. It is composed of virtual fonctions, and a dummy constructor.&lt;br /&gt;
This class is inherited by PspSalPrinter, WinSalPrinter, and of course by &amp;#039;&amp;#039;&amp;#039;AquaSalPrinter&amp;#039;&amp;#039;&amp;#039; (see [[#AquaSalPrinter class|AquaSalPrinter class]]).&lt;br /&gt;
&lt;br /&gt;
Its header is located in vcl/inc/salprn.hxx&lt;br /&gt;
It has no implementation file.&lt;br /&gt;
&lt;br /&gt;
[[Image:UML_class_SalPrinter.png]]&lt;br /&gt;
&lt;br /&gt;
==== PspSalPrinter class ====&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;PspSalPrinter&amp;#039;&amp;#039;&amp;#039; means PostScript Print System Abstraction Layer Printer. Its implementation is located in vcl/unx/source/gdi/salprnpsp.cxx. As the name suggests it relies on features psprint module.&lt;br /&gt;
&lt;br /&gt;
TODO : Discuss about &amp;#039;&amp;#039;&amp;#039;PspSalPrinter&amp;#039;&amp;#039;&amp;#039; implementation.&lt;br /&gt;
&lt;br /&gt;
==== Printer class ====&lt;br /&gt;
This is an abstraction class of a printer driver. You can entirely set up the printer there and start print jobs. What we need here is to make our native dialog access to this Printer. The we will need to make this class access to OS API rather than psprint. &lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;AquaSalPrinter&amp;#039;&amp;#039;&amp;#039; class is located in vcl/aqua/source/gdi/print.cxx&lt;br /&gt;
&lt;br /&gt;
[[Image:Printer_class_description.png]]&lt;br /&gt;
&lt;br /&gt;
This class inherits of &amp;#039;&amp;#039;&amp;#039;OutputDevice&amp;#039;&amp;#039;&amp;#039; and is derivated in &amp;#039;&amp;#039;&amp;#039;ImplQPrinter.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;QueueInfo&amp;#039;&amp;#039;&amp;#039; class - This class is related to the &amp;#039;&amp;#039;&amp;#039;Printer&amp;#039;&amp;#039;&amp;#039; class. It is used to store information about printers (name, driver, location, comment as strings, and number of Jobs, and a status code).&lt;br /&gt;
&lt;br /&gt;
==== OutputDevice class ====&lt;br /&gt;
This class allows applications such as Writer to draw graphics elements (pixels, lines, rects, characters, strings, etc...).&lt;br /&gt;
&lt;br /&gt;
This class is located in vcl/source/gdi/outdev.cxx, vcl/source/gdi/outdev[2-6].cxx&lt;br /&gt;
&lt;br /&gt;
At this time, we don&amp;#039;t need to know the details of this class. We will focus on it when we will use the Carbon Printing API.&lt;br /&gt;
&lt;br /&gt;
==== SalGraphics class ====&lt;br /&gt;
This class is responsible to translate the abstract drawing calls to concrete OS calls.&lt;br /&gt;
&lt;br /&gt;
==== PspGraphics ====&lt;br /&gt;
The class I need to reimplement using Aqua printing primitives...&lt;br /&gt;
It will probably called &amp;#039;&amp;#039;&amp;#039;AquaPrintGraphics&amp;#039;&amp;#039;&amp;#039;...&lt;br /&gt;
&lt;br /&gt;
==== AquaSalPrinter class ====&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;AquaSalPrinter&amp;#039;&amp;#039;&amp;#039; class is located in vcl/aqua/source/gdi/salprn.cxx&lt;br /&gt;
&lt;br /&gt;
Headers are in :&lt;br /&gt;
 vcl/inc/salinst.hxx  &lt;br /&gt;
 vcl/inc/salgdi.hxx    &lt;br /&gt;
 vcl/inc/salprn.hxx&lt;br /&gt;
&lt;br /&gt;
 Aqua implementation :&lt;br /&gt;
 vcl/aqua/inc/salprn.h  (AquaSalPrinter class implementation, inherits from &amp;#039;&amp;#039;&amp;#039;SalPrinter&amp;#039;&amp;#039;&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
=== psprint ===&lt;br /&gt;
What we know about psprint.&lt;br /&gt;
&lt;br /&gt;
=== svtools ===&lt;br /&gt;
What we need to know about svtools. Mostly it provides us the Print Dialog, and some other Print related dialogs.&lt;br /&gt;
&lt;br /&gt;
==== PrintDialog class ====&lt;br /&gt;
This class is responsible for drawing the print dialog we usually view when we choose the Print option of the File menu.&lt;br /&gt;
The current implementation uses this class to draw the print dialog. In our Aqua native implementation, we want to use the on provided by Carbon API. To achieve this, we want to know the functionality of this class, and let carbon manage the functionality maybe at this level or maybe in a other lever (higher or lower). We also need to know how this class provides information to the Printer instance.&lt;br /&gt;
&lt;br /&gt;
* The header of this class is located in [http://go-oo.org/lxr/source/util/svtools/inc/svtools/printdlg.hxx svtools/inc/svtools/printdlg.hxx]&lt;br /&gt;
* The implementation of this class is located in [http://go-oo.org/lxr/source/util/svtools/source/dialogs/printdlg.cxx svtools/source/dialogs/printdlg.cxx]&lt;br /&gt;
&lt;br /&gt;
This class is a child of &amp;#039;&amp;#039;&amp;#039;ModalDialog&amp;#039;&amp;#039;&amp;#039; class. &lt;br /&gt;
&lt;br /&gt;
It contains all the UI elements used by the dialog which are either :&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;FixedText&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;FixedInfo&amp;#039;&amp;#039;&amp;#039; : it is a child of &amp;#039;&amp;#039;&amp;#039;FixedText&amp;#039;&amp;#039;&amp;#039; and is defined in svtools/inc/stdctrl.hxx. It is nothing more than a &amp;#039;&amp;#039;&amp;#039;FixedText&amp;#039;&amp;#039;&amp;#039; with the info style applied (same behavior). It is used to store variables string since fixed text is for constant strings.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;ListBox&amp;#039;&amp;#039;&amp;#039; : maLbName - List-box used to store the available printers.&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Edit&amp;#039;&amp;#039;&amp;#039; : a text box&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;NumericField&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;CheckBox&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;PushButton&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;RadioButton&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;OKButton&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;CancelButton&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;HelpButton&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Useless in our case :&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;FixedImage&amp;#039;&amp;#039;&amp;#039; : draws an image on dialog&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;FixedLine&amp;#039;&amp;#039;&amp;#039; : draws a line on dialog&lt;br /&gt;
&lt;br /&gt;
These controls are used to allow the user to interact with the dialog. We only need to know the user-provided information. What is involved to display them, and how the look &amp;amp; feel is implemented is not interesting at this point, since we only want to know what the dialog actually does. So as &amp;#039;&amp;#039;&amp;#039;FixedImage&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;FixedLine&amp;#039;&amp;#039;&amp;#039;  provide no useful information, we don&amp;#039;t need them.&lt;br /&gt;
&lt;br /&gt;
There is also a timer intended to regulary update the current Printer status (ready, printing, paused, pending, waiting, offline, error…)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;AutoTimer&amp;#039;&amp;#039;&amp;#039; maStatusTimer&lt;br /&gt;
&lt;br /&gt;
TODO : List of all user-related information stored by this class and sent to the Printer and determine what work is involved when using Carbon equivalent.&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; style=&amp;quot;margin: 1em auto 1em auto; background: #f9f9f9; border: 1px #aaa solid;border-collapse: collapse; width: 600px;&amp;quot;&lt;br /&gt;
|+ &amp;#039;&amp;#039;&amp;#039;List of PrintDialog fields&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|-  &lt;br /&gt;
!  style=&amp;quot;background: #f2f2f2;&amp;quot; | PrinterDialog propery !! style=&amp;quot;background: #f2f2f2;&amp;quot; |  Work needed !! style=&amp;quot;background: #f2f2f2;&amp;quot; | Current status&lt;br /&gt;
|- &lt;br /&gt;
| maCbxFilePrint || Nothing, Aqua does PDF printing || Done&lt;br /&gt;
|- &lt;br /&gt;
| maEdtFaxNo || Nothing, Aqua does it || Done&lt;br /&gt;
|- &lt;br /&gt;
| maBtnBrowse_nomore || appears to be unused in current implementation || Done&lt;br /&gt;
|- &lt;br /&gt;
| maRbtAll || Fetch this information from Aqua dialog ||&lt;br /&gt;
|- &lt;br /&gt;
| maEbtPages || Fetch this with Carbon using [http://developer.apple.com/documentation/Carbon/Reference/CarbonPrintingManager_Ref/Reference/reference.html#//apple_ref/c/func/PMGetFirstPage PMGetFirstPage] and [http://developer.apple.com/documentation/Carbon/Reference/CarbonPrintingManager_Ref/Reference/reference.html#//apple_ref/c/func/PMGetLastPage PMGetLastPage] fields (Warning: custom panel needed or equivalent to have the same level of functionality) ||&lt;br /&gt;
|- &lt;br /&gt;
| maRbtSelection || Not natively provided, some more work (may need a custom panel) ||&lt;br /&gt;
|- &lt;br /&gt;
| maNumCopies || Fetch from Aqua using [http://developer.apple.com/documentation/Carbon/Reference/CarbonPrintingManager_Ref/Reference/reference.html#//apple_ref/c/func/PMGetCopies PMGetCopies] ||&lt;br /&gt;
|- &lt;br /&gt;
| maCbxCollate || Fetch from Aqua using [http://developer.apple.com/documentation/Carbon/Reference/CarbonPrintingManager_Ref/Reference/reference.html#//apple_ref/c/func/PMGetCollate PMGetCollate] ||&lt;br /&gt;
|- &lt;br /&gt;
| maBtnOptions || Detail in other dialog (some is provided by Aqua, some may need a custom panel)... ||&lt;br /&gt;
|- &lt;br /&gt;
| maBtnHelp || Nothing, Aqua do this || Done&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The class contains also fields used to store the real information provided by the controls (Mostly USHORT and BOOL). There is also a &amp;#039;&amp;#039;&amp;#039;XubString&amp;#039;&amp;#039;&amp;#039; instance and a &amp;#039;&amp;#039;&amp;#039;PrintDialogRange&amp;#039;&amp;#039;&amp;#039; instance used to store range information.&lt;br /&gt;
&lt;br /&gt;
Of course, this class contains an &amp;#039;&amp;#039;&amp;#039;Printer&amp;#039;&amp;#039;&amp;#039; instance and a &amp;#039;&amp;#039;&amp;#039;SvtPrinterImpl&amp;#039;&amp;#039;&amp;#039; instance in order to set the printer functionality.&lt;br /&gt;
&lt;br /&gt;
There is also internal methods, and links to the Option handler and the OK handler. You can find more information in the following file [http://go-oo.org/lxr/source/util/tools/inc/tools/link.hxx tools/inc/tools/link.hxx]&lt;br /&gt;
&lt;br /&gt;
The public methods are mostly getters and setters, I won&amp;#039;t detail it since I have already provided information about the private attributes, and they do nothing to the Printer instance.&lt;br /&gt;
&lt;br /&gt;
TODO : details the implementation of this class (interesting methods : &amp;#039;&amp;#039;ImplGetFileName&amp;#039;&amp;#039;, IMPL_LINK(PrintDialog, ImplModifyControlHdl, void*, p)&lt;br /&gt;
&lt;br /&gt;
For Aqua port, we need to re-implement this class in order to make it displays the native Aqua Print Dialog that will be provided by the Carbon API, and save information that was previously provided by children of &amp;#039;&amp;#039;&amp;#039;Control&amp;#039;&amp;#039;&amp;#039; class. We should also disable the Printing options provided by the Aqua dialog that are not provided by the Printer class (the information we cannot currently store).&lt;br /&gt;
&lt;br /&gt;
==== Print Setup file ====&lt;br /&gt;
* svtools/inc/prnsetup.hxx&lt;br /&gt;
* svtools/source/dialogs/prnsetup.hxx&lt;br /&gt;
&lt;br /&gt;
Utility functions : &lt;br /&gt;
* &amp;#039;&amp;#039;ImplFillPrnDlgListBox&amp;#039;&amp;#039;(const &amp;#039;&amp;#039;&amp;#039;Printer&amp;#039;&amp;#039;&amp;#039; *, &amp;#039;&amp;#039;&amp;#039;ListBox&amp;#039;&amp;#039;&amp;#039; *, &amp;#039;&amp;#039;&amp;#039;PushButton&amp;#039;&amp;#039;&amp;#039; *)&lt;br /&gt;
This method fills the &amp;#039;&amp;#039;&amp;#039;Printer&amp;#039;&amp;#039;&amp;#039; list-box with the QueueInfo provided by the &amp;#039;&amp;#039;&amp;#039;Printer&amp;#039;&amp;#039;&amp;#039; instance provided in argument. It then enables the OK button if the list is not empty.&lt;br /&gt;
&lt;br /&gt;
== Mac OS X API side ==&lt;br /&gt;
This part describes what can be used and how we intend to use it.&lt;br /&gt;
&lt;br /&gt;
The strategy is to first use the Carbon API to get Print Information and to provide an Aqua User Inerface for printing. Then, we will try to replace the current printing API to the native one, allowing to reduce dependencies, and the total package size.&lt;br /&gt;
&lt;br /&gt;
Carbon provides multiple way for us to print. We might consider every of different approaches :&lt;br /&gt;
* Printing using psprint. We only get settings from the Carbon Print Dialog and the Carbon Print Setup Dialog with the function PMGetPrintSettingsExtendedData (for example) and then we send the obtained parameters to our SalPrinter.&lt;br /&gt;
* Using the PMPrintToFile function (OpenOffice.org provides a postcript version of the document, and then, Carbon handles the print operation)&lt;br /&gt;
* Printing using a QuickDraw graphic context [http://developer.apple.com/documentation/Carbon/Conceptual/CPM_Concepts/cpm_chap3/chapter_3_section_4.html#//apple_ref/doc/uid/TP30000978-TP30000046-TPXREF12 See this link for an example] (As this is a legacy API, we are not enthusiast about using it in OpenOffice.org)&lt;br /&gt;
* Printing using a Quartz 2D graphic context [http://developer.apple.com/documentation/GraphicsImaging/Conceptual/drawingwithquartz2d/index.html More information about Quartz 2D]&lt;br /&gt;
&lt;br /&gt;
We may want to add some features to the Printing dialog provided by Carbon. [http://developer.apple.com/documentation/Printing/Conceptual/ExtPrintingDialogs/index.html This is documented here]&lt;br /&gt;
&lt;br /&gt;
Todo : implement missing methods, using Carbon API&lt;br /&gt;
&lt;br /&gt;
=== Using Aqua Printing Dialogs ===&lt;br /&gt;
&lt;br /&gt;
In a first a approach, we want to use Aqua dialogs and set the &amp;#039;&amp;#039;&amp;#039;SalPrinter&amp;#039;&amp;#039;&amp;#039; instance with the data provided by the dialog.&lt;br /&gt;
&lt;br /&gt;
Then, we want to get rid of the OpenOffice.org print dialog, for this, we need to add a custom print dialog addition to allow user to choose options not provided by Apple Print Dialog, however the behaviour might not be as the user except since we still use CUPS instead of Quartz.&lt;br /&gt;
&lt;br /&gt;
[http://developer.apple.com/documentation/Carbon/Conceptual/CPM_Concepts/index.html?http://developer.apple.com/documentation/Carbon/Conceptual/CPM_Concepts/cpm_chap3/chapter_3_section_1.html#//apple_ref/doc/uid/TP30000046-DontLinkElementID_22 Carbon calls for displaying Print Dialog and Print Setup Dialog]&lt;br /&gt;
&lt;br /&gt;
After this step, we should have a great native interface, now we want to print using Quartz instead of CUPS. To do this, we need to fill the Carbon Print object using the data provided by our Printer instance.&lt;br /&gt;
&lt;br /&gt;
[http://developer.apple.com/documentation/Carbon/Conceptual/CPM_Concepts/cpm_chap4/chapter_4_section_3.html Carbon Calls for retrieving Print Data and Page Setup data]&lt;br /&gt;
&lt;br /&gt;
We need then to hook Sal Graphic context primitives to the Quartz ones.&lt;br /&gt;
&lt;br /&gt;
=== Using Quartz Graphic Context to Print ===&lt;br /&gt;
&lt;br /&gt;
== Screenshots - Status ==&lt;br /&gt;
&lt;br /&gt;
http://eric.bachard.free.fr/mac/aquavcl/screenshots/printing/native_printing/native_printing_dialog.png&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
=== Link for Mac OS X API documentation  ===&lt;br /&gt;
http://developer.apple.com/documentation/Carbon/Reference/CarbonPrintingManager_Ref/index.html&lt;br /&gt;
&lt;br /&gt;
=== Starting point for documentation ===&lt;br /&gt;
http://developer.apple.com/documentation/Carbon/Printing-date.html#//apple_ref/doc/uid/TP30000440-TP30000420-TP30000455&lt;br /&gt;
http://developer.apple.com/documentation/Carbon/Conceptual/CPM_Concepts/cpm_chap4/chapter_4_section_1.html&lt;br /&gt;
http://developer.apple.com/samplecode/Carbon/idxPrinting-date.html&lt;br /&gt;
http://developer.apple.com/referencelibrary/Carbon/idxPrinting-date.html&lt;br /&gt;
&lt;br /&gt;
This work is part of http://wiki.services.openoffice.org/wiki/Mac_OS_X_Porting_-_Work_Areas/Todo%27s&lt;br /&gt;
&lt;br /&gt;
Created: [[User:Ericb|Ericb]] 19:33, 4 June 2006 (CEST)&lt;br /&gt;
&lt;br /&gt;
Last modification: [[User:Ybart|ybart]] 0:00, 16 October 2006 (CEST)&lt;br /&gt;
&lt;br /&gt;
[[Category:Porting]]&lt;br /&gt;
[[Category:Aqua]]&lt;br /&gt;
[[Category:MacOSX]]&lt;/div&gt;</summary>
		<author><name>Ybart</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Mac_OS_X_Porting_-_Native_Printing&amp;diff=32550</id>
		<title>Mac OS X Porting - Native Printing</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Mac_OS_X_Porting_-_Native_Printing&amp;diff=32550"/>
		<updated>2007-05-18T16:55:32Z</updated>

		<summary type="html">&lt;p&gt;Ybart: /* PrintDialog class */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page is dedicated to the native printing implementation in OpenOffice.org for Mac OS X&lt;br /&gt;
&lt;br /&gt;
== What we want to do ? ==&lt;br /&gt;
The final goal of this project is to have the native printing support on Mac OS X.&lt;br /&gt;
&lt;br /&gt;
=== What we have now and what we don&amp;#039;t ? ===&lt;br /&gt;
Currently we simply have a generic printing support which works with X11. There is also printing support implemented for Windows. This means that we have already a way to implement our printing support for Aqua without breaking OpenOffice.org as we have already environment plug-ins.&lt;br /&gt;
&lt;br /&gt;
However, we have only one Print Dialog and one Printer Setup dialog for all environments.&lt;br /&gt;
&lt;br /&gt;
Tu sum up : we have a starting point to implement low-level printing support using the native API. We only have to implement the native code. But &amp;#039;&amp;#039;&amp;#039;we have nothing for the dialogs&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
=== What the users want ? ===&lt;br /&gt;
The user wants to be able to print with OpenOffice.org the same way he does with its other natives applications. &lt;br /&gt;
&lt;br /&gt;
For us, this means using a native printing dialog. Then, we will also need to implement low-level printing using OS API because, without that the user might not be able to use every setting available in the native dialog. &lt;br /&gt;
&lt;br /&gt;
=== What will be even better ? ===&lt;br /&gt;
Using UNO. This will allow other platform developpers to use the same code to implement their native dialogs.&lt;br /&gt;
&lt;br /&gt;
== OpenOffice.org side ==&lt;br /&gt;
This part describes what can be found in the OOo APIs, how it is implemented and how it will be changed.&lt;br /&gt;
&lt;br /&gt;
=== OOo print process ===&lt;br /&gt;
I will try to share the few thing I understood about the way Writer prints document.&lt;br /&gt;
&lt;br /&gt;
First I need to locate the print menu item in the sw module (sw stands for Star Writer). For this, I need to know where in sw the menubar is built. I did found the menubar, but not how the menu item was linked to the print operation. Instead, I have found a method PrintPages implemented in sw module. The stack may look like that :&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;SwXTextDocument&amp;#039;&amp;#039;&amp;#039;::printPages()&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;ViewShell&amp;#039;&amp;#039;&amp;#039;::executeSlot(aReq)&lt;br /&gt;
* ...&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;SwView&amp;#039;&amp;#039;&amp;#039;::ExecutePrint()&lt;br /&gt;
* ...&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;SwXTextDocument&amp;#039;&amp;#039;&amp;#039;::render()&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;ViewShell&amp;#039;&amp;#039;&amp;#039;::Prt()&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;OutputDevice&amp;#039;&amp;#039;&amp;#039;:: ...&lt;br /&gt;
&lt;br /&gt;
TODO : Complete the stack trace&lt;br /&gt;
&lt;br /&gt;
There is many holes in the stack but we get the idea. The &amp;#039;&amp;#039;&amp;#039;OuputDevice&amp;#039;&amp;#039;&amp;#039; is in fact our &amp;#039;&amp;#039;&amp;#039;Printer.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
[[Image:Printing_model.png]]&lt;br /&gt;
&lt;br /&gt;
1. The user Application creates a print dialog or a print setup dialog. For this, it needs to call svtools. To be a bit more precise, it creates a new instance of &amp;#039;&amp;#039;&amp;#039;PrintDialog&amp;#039;&amp;#039;&amp;#039; or of &amp;#039;&amp;#039;&amp;#039;PrintDialogSetup&amp;#039;&amp;#039;&amp;#039;, it associates a Printer instance to it, then, it calls the Execute method from &amp;#039;&amp;#039;&amp;#039;PrintDialog&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;PrintSetupDialog&amp;#039;&amp;#039;&amp;#039;. This operation shows the dialog (using the &amp;#039;&amp;#039;Execute&amp;#039;&amp;#039; method from &amp;#039;&amp;#039;&amp;#039;ModalDialog&amp;#039;&amp;#039;&amp;#039;, which is in vcl) and sets the Printer Data correctly with the method &amp;#039;&amp;#039;setPrinterProps&amp;#039;&amp;#039;. Do do the real display of the dialog, it uses &amp;#039;&amp;#039;&amp;#039;SalFrame&amp;#039;&amp;#039;&amp;#039;&amp;#039;s &amp;#039;&amp;#039;Show()&amp;#039;&amp;#039; method, which can be X11SalFrame, &amp;#039;&amp;#039;&amp;#039;AquaSalFrame&amp;#039;&amp;#039;&amp;#039;, etc.&lt;br /&gt;
&lt;br /&gt;
2. Svtools is responsible for asking to the user the requested information about printing options. Then, it returns them ot the user application.&lt;br /&gt;
&lt;br /&gt;
3. The user application has now everything needed to print the document. So, it asks VCL to draw pixels, lines, characters, etc on an &amp;#039;&amp;#039;&amp;#039;OutputDevice&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
At this point, I don&amp;#039;t know exactly where the &amp;#039;&amp;#039;&amp;#039;OutputDevice&amp;#039;&amp;#039;&amp;#039; is instancied (who decides that it would be a screen, an Aqua printer or a PostScript printer. This is not really important since we understand the main idea of how printing works.&lt;br /&gt;
&lt;br /&gt;
[[Image:Printing_model_step_4.png]]&lt;br /&gt;
&lt;br /&gt;
4. After that VCL relies on its Graphic Context to really draws (i.e. make the OS really draws) the lines and pixels on the screen or on the print device.&lt;br /&gt;
&lt;br /&gt;
=== Concerned OOo modules ===&lt;br /&gt;
* psprint&lt;br /&gt;
* vcl&lt;br /&gt;
* svtools&lt;br /&gt;
&lt;br /&gt;
=== VCL ===&lt;br /&gt;
What we know about [[vcl]].&lt;br /&gt;
&lt;br /&gt;
==== SalPrinter class ====&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;SalPrinter&amp;#039;&amp;#039;&amp;#039; is a virtual class intended for managing print jobs. It is composed of virtual fonctions, and a dummy constructor.&lt;br /&gt;
This class is inherited by PspSalPrinter, WinSalPrinter, and of course by &amp;#039;&amp;#039;&amp;#039;AquaSalPrinter&amp;#039;&amp;#039;&amp;#039; (see [[#AquaSalPrinter class|AquaSalPrinter class]]).&lt;br /&gt;
&lt;br /&gt;
Its header is located in vcl/inc/salprn.hxx&lt;br /&gt;
It has no implementation file.&lt;br /&gt;
&lt;br /&gt;
[[Image:UML_class_SalPrinter.png]]&lt;br /&gt;
&lt;br /&gt;
==== PspSalPrinter class ====&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;PspSalPrinter&amp;#039;&amp;#039;&amp;#039; means PostScript Print System Abstraction Layer Printer. Its implementation is located in vcl/unx/source/gdi/salprnpsp.cxx. As the name suggests it relies on features psprint module.&lt;br /&gt;
&lt;br /&gt;
TODO : Discuss about &amp;#039;&amp;#039;&amp;#039;PspSalPrinter&amp;#039;&amp;#039;&amp;#039; implementation.&lt;br /&gt;
&lt;br /&gt;
==== Printer class ====&lt;br /&gt;
This is an abstraction class of a printer driver. You can entirely set up the printer there and start print jobs. What we need here is to make our native dialog access to this Printer. The we will need to make this class access to OS API rather than psprint. &lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;AquaSalPrinter&amp;#039;&amp;#039;&amp;#039; class is located in vcl/aqua/source/gdi/print.cxx&lt;br /&gt;
&lt;br /&gt;
[[Image:Printer_class_description.png]]&lt;br /&gt;
&lt;br /&gt;
This class inherits of &amp;#039;&amp;#039;&amp;#039;OutputDevice&amp;#039;&amp;#039;&amp;#039; and is derivated in &amp;#039;&amp;#039;&amp;#039;ImplQPrinter.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;QueueInfo&amp;#039;&amp;#039;&amp;#039; class - This class is related to the &amp;#039;&amp;#039;&amp;#039;Printer&amp;#039;&amp;#039;&amp;#039; class. It is used to store information about printers (name, driver, location, comment as strings, and number of Jobs, and a status code).&lt;br /&gt;
&lt;br /&gt;
==== OutputDevice class ====&lt;br /&gt;
This class allows applications such as Writer to draw graphics elements (pixels, lines, rects, characters, strings, etc...).&lt;br /&gt;
&lt;br /&gt;
This class is located in vcl/source/gdi/outdev.cxx, vcl/source/gdi/outdev[2-6].cxx&lt;br /&gt;
&lt;br /&gt;
At this time, we don&amp;#039;t need to know the details of this class. We will focus on it when we will use the Carbon Printing API.&lt;br /&gt;
&lt;br /&gt;
==== SalGraphics class ====&lt;br /&gt;
This class is responsible to translate the abstract drawing calls to concrete OS calls.&lt;br /&gt;
&lt;br /&gt;
==== PspGraphics ====&lt;br /&gt;
The class I need to reimplement using Aqua printing primitives...&lt;br /&gt;
It will probably called &amp;#039;&amp;#039;&amp;#039;AquaPrintGraphics&amp;#039;&amp;#039;&amp;#039;...&lt;br /&gt;
&lt;br /&gt;
==== AquaSalPrinter class ====&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;AquaSalPrinter&amp;#039;&amp;#039;&amp;#039; class is located in vcl/aqua/source/gdi/salprn.cxx&lt;br /&gt;
&lt;br /&gt;
Headers are in :&lt;br /&gt;
 vcl/inc/salinst.hxx  &lt;br /&gt;
 vcl/inc/salgdi.hxx    &lt;br /&gt;
 vcl/inc/salprn.hxx&lt;br /&gt;
&lt;br /&gt;
 Aqua implementation :&lt;br /&gt;
 vcl/aqua/inc/salprn.h  (AquaSalPrinter class implementation, inherits from &amp;#039;&amp;#039;&amp;#039;SalPrinter&amp;#039;&amp;#039;&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
=== psprint ===&lt;br /&gt;
What we know about psprint.&lt;br /&gt;
&lt;br /&gt;
=== svtools ===&lt;br /&gt;
What we need to know about svtools. Mostly it provides us the Print Dialog, and some other Print related dialogs.&lt;br /&gt;
&lt;br /&gt;
==== PrintDialog class ====&lt;br /&gt;
This class is responsible for drawing the print dialog we usually view when we choose the Print option of the File menu.&lt;br /&gt;
The current implementation uses this class to draw the print dialog. In our Aqua native implementation, we want to use the on provided by Carbon API. To achieve this, we want to know the functionality of this class, and let carbon manage the functionality maybe at this level or maybe in a other lever (higher or lower). We also need to know how this class provides information to the Printer instance.&lt;br /&gt;
&lt;br /&gt;
* The header of this class is located in [http://go-oo.org/lxr/source/util/svtools/inc/svtools/printdlg.hxx svtools/inc/svtools/printdlg.hxx]&lt;br /&gt;
* The implementation of this class is located in [http://go-oo.org/lxr/source/util/svtools/source/dialogs/printdlg.cxx svtools/source/dialogs/printdlg.cxx]&lt;br /&gt;
&lt;br /&gt;
This class is a child of &amp;#039;&amp;#039;&amp;#039;ModalDialog&amp;#039;&amp;#039;&amp;#039; class. &lt;br /&gt;
&lt;br /&gt;
It contains all the UI elements used by the dialog which are either :&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;FixedText&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;FixedInfo&amp;#039;&amp;#039;&amp;#039; : it is a child of &amp;#039;&amp;#039;&amp;#039;FixedText&amp;#039;&amp;#039;&amp;#039; and is defined in svtools/inc/stdctrl.hxx. It is nothing more than a &amp;#039;&amp;#039;&amp;#039;FixedText&amp;#039;&amp;#039;&amp;#039; with the info style applied (same behavior). It is used to store variables string since fixed text is for constant strings.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;ListBox&amp;#039;&amp;#039;&amp;#039; : maLbName - List-box used to store the available printers.&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Edit&amp;#039;&amp;#039;&amp;#039; : a text box&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;NumericField&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;CheckBox&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;PushButton&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;RadioButton&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;OKButton&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;CancelButton&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;HelpButton&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Useless in our case :&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;FixedImage&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;FixedLine&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
These controls are used to allow the user to interact with the dialog. We only need to know the user-provided information. What is involved to display them, and how the look &amp;amp; feel is implemented is not interesting at this point, since we only want to know what the dialog actually does. So as &amp;#039;&amp;#039;&amp;#039;FixedImage&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;FixedLine&amp;#039;&amp;#039;&amp;#039;  provide no useful information, we don&amp;#039;t need them.&lt;br /&gt;
&lt;br /&gt;
There is also a timer intended to regulary update the current Printer status (ready, printing, paused, pending, waiting, offline, error…)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;AutoTimer&amp;#039;&amp;#039;&amp;#039; maStatusTimer&lt;br /&gt;
&lt;br /&gt;
TODO : List of all user-related information stored by this class and sent to the Printer and determine what work is involved when using Carbon equivalent.&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; style=&amp;quot;margin: 1em auto 1em auto; background: #f9f9f9; border: 1px #aaa solid;border-collapse: collapse; width: 600px;&amp;quot;&lt;br /&gt;
|+ &amp;#039;&amp;#039;&amp;#039;List of PrintDialog fields&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
|-  &lt;br /&gt;
!  style=&amp;quot;background: #f2f2f2;&amp;quot; | PrinterDialog propery !! style=&amp;quot;background: #f2f2f2;&amp;quot; |  Work needed !! style=&amp;quot;background: #f2f2f2;&amp;quot; | Current status&lt;br /&gt;
|- &lt;br /&gt;
| maCbxFilePrint || Nothing, Aqua does PDF printing || Done&lt;br /&gt;
|- &lt;br /&gt;
| maEdtFaxNo || Nothing, Aqua does it || Done&lt;br /&gt;
|- &lt;br /&gt;
| maBtnBrowse_nomore || appears to be unused in current implementation || Done&lt;br /&gt;
|- &lt;br /&gt;
| maRbtAll || Fetch this information from Aqua dialog ||&lt;br /&gt;
|- &lt;br /&gt;
| maEbtPages || Fetch this with Carbon using from/to fields (Warning:  custom panel needed or equivalent to have the same level of functionality) ||&lt;br /&gt;
|- &lt;br /&gt;
| maRbtSelection || Not natively provided, some more work (may need a custom panel) ||&lt;br /&gt;
|- &lt;br /&gt;
| maNumCopies || Fetch from Aqua ||&lt;br /&gt;
|- &lt;br /&gt;
| maCbxCollate || Fetch from Aqua ||&lt;br /&gt;
|- &lt;br /&gt;
| maBtnOptions || Detail in other dialog (some is provided by Aqua, some may need a custom panel)... ||&lt;br /&gt;
|- &lt;br /&gt;
| maBtnHelp || Nothing, Aqua do this || Done&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The class contains also fields used to store the real information provided by the controls (Mostly USHORT and BOOL). There is also a &amp;#039;&amp;#039;&amp;#039;XubString&amp;#039;&amp;#039;&amp;#039; instance and a &amp;#039;&amp;#039;&amp;#039;PrintDialogRange&amp;#039;&amp;#039;&amp;#039; instance used to store range information.&lt;br /&gt;
&lt;br /&gt;
Of course, this class contains an &amp;#039;&amp;#039;&amp;#039;Printer&amp;#039;&amp;#039;&amp;#039; instance and a &amp;#039;&amp;#039;&amp;#039;SvtPrinterImpl&amp;#039;&amp;#039;&amp;#039; instance in order to set the printer functionality.&lt;br /&gt;
&lt;br /&gt;
There is also internal methods, and links to the Option handler and the OK handler. You can find more information in the following file [http://go-oo.org/lxr/source/util/tools/inc/tools/link.hxx tools/inc/tools/link.hxx]&lt;br /&gt;
&lt;br /&gt;
The public methods are mostly getters and setters, I won&amp;#039;t detail it since I have already provided information about the private attributes, and they do nothing to the Printer instance.&lt;br /&gt;
&lt;br /&gt;
TODO : details the implementation of this class (interesting methods : &amp;#039;&amp;#039;ImplGetFileName&amp;#039;&amp;#039;, IMPL_LINK(PrintDialog, ImplModifyControlHdl, void*, p)&lt;br /&gt;
&lt;br /&gt;
For Aqua port, we need to re-implement this class in order to make it displays the native Aqua Print Dialog that will be provided by the Carbon API, and save information that was previously provided by children of &amp;#039;&amp;#039;&amp;#039;Control&amp;#039;&amp;#039;&amp;#039; class. We should also disable the Printing options provided by the Aqua dialog that are not provided by the Printer class (the information we cannot currently store).&lt;br /&gt;
&lt;br /&gt;
==== Print Setup file ====&lt;br /&gt;
* svtools/inc/prnsetup.hxx&lt;br /&gt;
* svtools/source/dialogs/prnsetup.hxx&lt;br /&gt;
&lt;br /&gt;
Utility functions : &lt;br /&gt;
* &amp;#039;&amp;#039;ImplFillPrnDlgListBox&amp;#039;&amp;#039;(const &amp;#039;&amp;#039;&amp;#039;Printer&amp;#039;&amp;#039;&amp;#039; *, &amp;#039;&amp;#039;&amp;#039;ListBox&amp;#039;&amp;#039;&amp;#039; *, &amp;#039;&amp;#039;&amp;#039;PushButton&amp;#039;&amp;#039;&amp;#039; *)&lt;br /&gt;
This method fills the &amp;#039;&amp;#039;&amp;#039;Printer&amp;#039;&amp;#039;&amp;#039; list-box with the QueueInfo provided by the &amp;#039;&amp;#039;&amp;#039;Printer&amp;#039;&amp;#039;&amp;#039; instance provided in argument. It then enables the OK button if the list is not empty.&lt;br /&gt;
&lt;br /&gt;
== Mac OS X API side ==&lt;br /&gt;
This part describes what can be used and how we intend to use it.&lt;br /&gt;
&lt;br /&gt;
The strategy is to first use the Carbon API to get Print Information and to provide an Aqua User Inerface for printing. Then, we will try to replace the current printing API to the native one, allowing to reduce dependencies, and the total package size.&lt;br /&gt;
&lt;br /&gt;
Carbon provides multiple way for us to print. We might consider every of different approaches :&lt;br /&gt;
* Printing using psprint. We only get settings from the Carbon Print Dialog and the Carbon Print Setup Dialog with the function PMGetPrintSettingsExtendedData (for example) and then we send the obtained parameters to our SalPrinter.&lt;br /&gt;
* Using the PMPrintToFile function (OpenOffice.org provides a postcript version of the document, and then, Carbon handles the print operation)&lt;br /&gt;
* Printing using a QuickDraw graphic context [http://developer.apple.com/documentation/Carbon/Conceptual/CPM_Concepts/cpm_chap3/chapter_3_section_4.html#//apple_ref/doc/uid/TP30000978-TP30000046-TPXREF12 See this link for an example] (As this is a legacy API, we are not enthusiast about using it in OpenOffice.org)&lt;br /&gt;
* Printing using a Quartz 2D graphic context [http://developer.apple.com/documentation/GraphicsImaging/Conceptual/drawingwithquartz2d/index.html More information about Quartz 2D]&lt;br /&gt;
&lt;br /&gt;
We may want to add some features to the Printing dialog provided by Carbon. [http://developer.apple.com/documentation/Printing/Conceptual/ExtPrintingDialogs/index.html This is documented here]&lt;br /&gt;
&lt;br /&gt;
Todo : implement missing methods, using Carbon API&lt;br /&gt;
&lt;br /&gt;
=== Using Aqua Printing Dialogs ===&lt;br /&gt;
&lt;br /&gt;
In a first a approach, we want to use Aqua dialogs and set the &amp;#039;&amp;#039;&amp;#039;SalPrinter&amp;#039;&amp;#039;&amp;#039; instance with the data provided by the dialog.&lt;br /&gt;
&lt;br /&gt;
Then, we want to get rid of the OpenOffice.org print dialog, for this, we need to add a custom print dialog addition to allow user to choose options not provided by Apple Print Dialog, however the behaviour might not be as the user except since we still use CUPS instead of Quartz.&lt;br /&gt;
&lt;br /&gt;
[http://developer.apple.com/documentation/Carbon/Conceptual/CPM_Concepts/index.html?http://developer.apple.com/documentation/Carbon/Conceptual/CPM_Concepts/cpm_chap3/chapter_3_section_1.html#//apple_ref/doc/uid/TP30000046-DontLinkElementID_22 Carbon calls for displaying Print Dialog and Print Setup Dialog]&lt;br /&gt;
&lt;br /&gt;
After this step, we should have a great native interface, now we want to print using Quartz instead of CUPS. To do this, we need to fill the Carbon Print object using the data provided by our Printer instance.&lt;br /&gt;
&lt;br /&gt;
[http://developer.apple.com/documentation/Carbon/Conceptual/CPM_Concepts/cpm_chap4/chapter_4_section_3.html Carbon Calls for retrieving Print Data and Page Setup data]&lt;br /&gt;
&lt;br /&gt;
We need then to hook Sal Graphic context primitives to the Quartz ones.&lt;br /&gt;
&lt;br /&gt;
=== Using Quartz Graphic Context to Print ===&lt;br /&gt;
&lt;br /&gt;
== Screenshots - Status ==&lt;br /&gt;
&lt;br /&gt;
http://eric.bachard.free.fr/mac/aquavcl/screenshots/printing/native_printing/native_printing_dialog.png&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
=== Link for Mac OS X API documentation  ===&lt;br /&gt;
http://developer.apple.com/documentation/Carbon/Reference/CarbonPrintingManager_Ref/index.html&lt;br /&gt;
&lt;br /&gt;
=== Starting point for documentation ===&lt;br /&gt;
http://developer.apple.com/documentation/Carbon/Printing-date.html#//apple_ref/doc/uid/TP30000440-TP30000420-TP30000455&lt;br /&gt;
http://developer.apple.com/documentation/Carbon/Conceptual/CPM_Concepts/cpm_chap4/chapter_4_section_1.html&lt;br /&gt;
http://developer.apple.com/samplecode/Carbon/idxPrinting-date.html&lt;br /&gt;
http://developer.apple.com/referencelibrary/Carbon/idxPrinting-date.html&lt;br /&gt;
&lt;br /&gt;
This work is part of http://wiki.services.openoffice.org/wiki/Mac_OS_X_Porting_-_Work_Areas/Todo%27s&lt;br /&gt;
&lt;br /&gt;
Created: [[User:Ericb|Ericb]] 19:33, 4 June 2006 (CEST)&lt;br /&gt;
&lt;br /&gt;
Last modification: [[User:Ybart|ybart]] 0:00, 16 October 2006 (CEST)&lt;br /&gt;
&lt;br /&gt;
[[Category:Porting]]&lt;br /&gt;
[[Category:Aqua]]&lt;br /&gt;
[[Category:MacOSX]]&lt;/div&gt;</summary>
		<author><name>Ybart</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Mac_OS_X_Porting_-_Native_Printing&amp;diff=32549</id>
		<title>Mac OS X Porting - Native Printing</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Mac_OS_X_Porting_-_Native_Printing&amp;diff=32549"/>
		<updated>2007-05-18T16:42:26Z</updated>

		<summary type="html">&lt;p&gt;Ybart: /* PrintDialog class */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page is dedicated to the native printing implementation in OpenOffice.org for Mac OS X&lt;br /&gt;
&lt;br /&gt;
== What we want to do ? ==&lt;br /&gt;
The final goal of this project is to have the native printing support on Mac OS X.&lt;br /&gt;
&lt;br /&gt;
=== What we have now and what we don&amp;#039;t ? ===&lt;br /&gt;
Currently we simply have a generic printing support which works with X11. There is also printing support implemented for Windows. This means that we have already a way to implement our printing support for Aqua without breaking OpenOffice.org as we have already environment plug-ins.&lt;br /&gt;
&lt;br /&gt;
However, we have only one Print Dialog and one Printer Setup dialog for all environments.&lt;br /&gt;
&lt;br /&gt;
Tu sum up : we have a starting point to implement low-level printing support using the native API. We only have to implement the native code. But &amp;#039;&amp;#039;&amp;#039;we have nothing for the dialogs&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
=== What the users want ? ===&lt;br /&gt;
The user wants to be able to print with OpenOffice.org the same way he does with its other natives applications. &lt;br /&gt;
&lt;br /&gt;
For us, this means using a native printing dialog. Then, we will also need to implement low-level printing using OS API because, without that the user might not be able to use every setting available in the native dialog. &lt;br /&gt;
&lt;br /&gt;
=== What will be even better ? ===&lt;br /&gt;
Using UNO. This will allow other platform developpers to use the same code to implement their native dialogs.&lt;br /&gt;
&lt;br /&gt;
== OpenOffice.org side ==&lt;br /&gt;
This part describes what can be found in the OOo APIs, how it is implemented and how it will be changed.&lt;br /&gt;
&lt;br /&gt;
=== OOo print process ===&lt;br /&gt;
I will try to share the few thing I understood about the way Writer prints document.&lt;br /&gt;
&lt;br /&gt;
First I need to locate the print menu item in the sw module (sw stands for Star Writer). For this, I need to know where in sw the menubar is built. I did found the menubar, but not how the menu item was linked to the print operation. Instead, I have found a method PrintPages implemented in sw module. The stack may look like that :&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;SwXTextDocument&amp;#039;&amp;#039;&amp;#039;::printPages()&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;ViewShell&amp;#039;&amp;#039;&amp;#039;::executeSlot(aReq)&lt;br /&gt;
* ...&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;SwView&amp;#039;&amp;#039;&amp;#039;::ExecutePrint()&lt;br /&gt;
* ...&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;SwXTextDocument&amp;#039;&amp;#039;&amp;#039;::render()&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;ViewShell&amp;#039;&amp;#039;&amp;#039;::Prt()&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;OutputDevice&amp;#039;&amp;#039;&amp;#039;:: ...&lt;br /&gt;
&lt;br /&gt;
TODO : Complete the stack trace&lt;br /&gt;
&lt;br /&gt;
There is many holes in the stack but we get the idea. The &amp;#039;&amp;#039;&amp;#039;OuputDevice&amp;#039;&amp;#039;&amp;#039; is in fact our &amp;#039;&amp;#039;&amp;#039;Printer.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
[[Image:Printing_model.png]]&lt;br /&gt;
&lt;br /&gt;
1. The user Application creates a print dialog or a print setup dialog. For this, it needs to call svtools. To be a bit more precise, it creates a new instance of &amp;#039;&amp;#039;&amp;#039;PrintDialog&amp;#039;&amp;#039;&amp;#039; or of &amp;#039;&amp;#039;&amp;#039;PrintDialogSetup&amp;#039;&amp;#039;&amp;#039;, it associates a Printer instance to it, then, it calls the Execute method from &amp;#039;&amp;#039;&amp;#039;PrintDialog&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;PrintSetupDialog&amp;#039;&amp;#039;&amp;#039;. This operation shows the dialog (using the &amp;#039;&amp;#039;Execute&amp;#039;&amp;#039; method from &amp;#039;&amp;#039;&amp;#039;ModalDialog&amp;#039;&amp;#039;&amp;#039;, which is in vcl) and sets the Printer Data correctly with the method &amp;#039;&amp;#039;setPrinterProps&amp;#039;&amp;#039;. Do do the real display of the dialog, it uses &amp;#039;&amp;#039;&amp;#039;SalFrame&amp;#039;&amp;#039;&amp;#039;&amp;#039;s &amp;#039;&amp;#039;Show()&amp;#039;&amp;#039; method, which can be X11SalFrame, &amp;#039;&amp;#039;&amp;#039;AquaSalFrame&amp;#039;&amp;#039;&amp;#039;, etc.&lt;br /&gt;
&lt;br /&gt;
2. Svtools is responsible for asking to the user the requested information about printing options. Then, it returns them ot the user application.&lt;br /&gt;
&lt;br /&gt;
3. The user application has now everything needed to print the document. So, it asks VCL to draw pixels, lines, characters, etc on an &amp;#039;&amp;#039;&amp;#039;OutputDevice&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
At this point, I don&amp;#039;t know exactly where the &amp;#039;&amp;#039;&amp;#039;OutputDevice&amp;#039;&amp;#039;&amp;#039; is instancied (who decides that it would be a screen, an Aqua printer or a PostScript printer. This is not really important since we understand the main idea of how printing works.&lt;br /&gt;
&lt;br /&gt;
[[Image:Printing_model_step_4.png]]&lt;br /&gt;
&lt;br /&gt;
4. After that VCL relies on its Graphic Context to really draws (i.e. make the OS really draws) the lines and pixels on the screen or on the print device.&lt;br /&gt;
&lt;br /&gt;
=== Concerned OOo modules ===&lt;br /&gt;
* psprint&lt;br /&gt;
* vcl&lt;br /&gt;
* svtools&lt;br /&gt;
&lt;br /&gt;
=== VCL ===&lt;br /&gt;
What we know about [[vcl]].&lt;br /&gt;
&lt;br /&gt;
==== SalPrinter class ====&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;SalPrinter&amp;#039;&amp;#039;&amp;#039; is a virtual class intended for managing print jobs. It is composed of virtual fonctions, and a dummy constructor.&lt;br /&gt;
This class is inherited by PspSalPrinter, WinSalPrinter, and of course by &amp;#039;&amp;#039;&amp;#039;AquaSalPrinter&amp;#039;&amp;#039;&amp;#039; (see [[#AquaSalPrinter class|AquaSalPrinter class]]).&lt;br /&gt;
&lt;br /&gt;
Its header is located in vcl/inc/salprn.hxx&lt;br /&gt;
It has no implementation file.&lt;br /&gt;
&lt;br /&gt;
[[Image:UML_class_SalPrinter.png]]&lt;br /&gt;
&lt;br /&gt;
==== PspSalPrinter class ====&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;PspSalPrinter&amp;#039;&amp;#039;&amp;#039; means PostScript Print System Abstraction Layer Printer. Its implementation is located in vcl/unx/source/gdi/salprnpsp.cxx. As the name suggests it relies on features psprint module.&lt;br /&gt;
&lt;br /&gt;
TODO : Discuss about &amp;#039;&amp;#039;&amp;#039;PspSalPrinter&amp;#039;&amp;#039;&amp;#039; implementation.&lt;br /&gt;
&lt;br /&gt;
==== Printer class ====&lt;br /&gt;
This is an abstraction class of a printer driver. You can entirely set up the printer there and start print jobs. What we need here is to make our native dialog access to this Printer. The we will need to make this class access to OS API rather than psprint. &lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;AquaSalPrinter&amp;#039;&amp;#039;&amp;#039; class is located in vcl/aqua/source/gdi/print.cxx&lt;br /&gt;
&lt;br /&gt;
[[Image:Printer_class_description.png]]&lt;br /&gt;
&lt;br /&gt;
This class inherits of &amp;#039;&amp;#039;&amp;#039;OutputDevice&amp;#039;&amp;#039;&amp;#039; and is derivated in &amp;#039;&amp;#039;&amp;#039;ImplQPrinter.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;QueueInfo&amp;#039;&amp;#039;&amp;#039; class - This class is related to the &amp;#039;&amp;#039;&amp;#039;Printer&amp;#039;&amp;#039;&amp;#039; class. It is used to store information about printers (name, driver, location, comment as strings, and number of Jobs, and a status code).&lt;br /&gt;
&lt;br /&gt;
==== OutputDevice class ====&lt;br /&gt;
This class allows applications such as Writer to draw graphics elements (pixels, lines, rects, characters, strings, etc...).&lt;br /&gt;
&lt;br /&gt;
This class is located in vcl/source/gdi/outdev.cxx, vcl/source/gdi/outdev[2-6].cxx&lt;br /&gt;
&lt;br /&gt;
At this time, we don&amp;#039;t need to know the details of this class. We will focus on it when we will use the Carbon Printing API.&lt;br /&gt;
&lt;br /&gt;
==== SalGraphics class ====&lt;br /&gt;
This class is responsible to translate the abstract drawing calls to concrete OS calls.&lt;br /&gt;
&lt;br /&gt;
==== PspGraphics ====&lt;br /&gt;
The class I need to reimplement using Aqua printing primitives...&lt;br /&gt;
It will probably called &amp;#039;&amp;#039;&amp;#039;AquaPrintGraphics&amp;#039;&amp;#039;&amp;#039;...&lt;br /&gt;
&lt;br /&gt;
==== AquaSalPrinter class ====&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;AquaSalPrinter&amp;#039;&amp;#039;&amp;#039; class is located in vcl/aqua/source/gdi/salprn.cxx&lt;br /&gt;
&lt;br /&gt;
Headers are in :&lt;br /&gt;
 vcl/inc/salinst.hxx  &lt;br /&gt;
 vcl/inc/salgdi.hxx    &lt;br /&gt;
 vcl/inc/salprn.hxx&lt;br /&gt;
&lt;br /&gt;
 Aqua implementation :&lt;br /&gt;
 vcl/aqua/inc/salprn.h  (AquaSalPrinter class implementation, inherits from &amp;#039;&amp;#039;&amp;#039;SalPrinter&amp;#039;&amp;#039;&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
=== psprint ===&lt;br /&gt;
What we know about psprint.&lt;br /&gt;
&lt;br /&gt;
=== svtools ===&lt;br /&gt;
What we need to know about svtools. Mostly it provides us the Print Dialog, and some other Print related dialogs.&lt;br /&gt;
&lt;br /&gt;
==== PrintDialog class ====&lt;br /&gt;
This class is responsible for drawing the print dialog we usually view when we choose the Print option of the File menu.&lt;br /&gt;
The current implementation uses this class to draw the print dialog. In our Aqua native implementation, we want to use the on provided by Carbon API. To achieve this, we want to know the functionality of this class, and let carbon manage the functionality maybe at this level or maybe in a other lever (higher or lower). We also need to know how this class provides information to the Printer instance.&lt;br /&gt;
&lt;br /&gt;
* The header of this class is located in [http://go-oo.org/lxr/source/util/svtools/inc/svtools/printdlg.hxx svtools/inc/svtools/printdlg.hxx]&lt;br /&gt;
* The implementation of this class is located in [http://go-oo.org/lxr/source/util/svtools/source/dialogs/printdlg.cxx svtools/source/dialogs/printdlg.cxx]&lt;br /&gt;
&lt;br /&gt;
This class is a child of &amp;#039;&amp;#039;&amp;#039;ModalDialog&amp;#039;&amp;#039;&amp;#039; class. &lt;br /&gt;
&lt;br /&gt;
It contains all the UI elements used by the dialog which are either :&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;FixedText&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;FixedInfo&amp;#039;&amp;#039;&amp;#039; : it is a child of &amp;#039;&amp;#039;&amp;#039;FixedText&amp;#039;&amp;#039;&amp;#039; and is defined in svtools/inc/stdctrl.hxx. It is nothing more than a &amp;#039;&amp;#039;&amp;#039;FixedText&amp;#039;&amp;#039;&amp;#039; with the info style applied (same behavior). It is used to store variables string since fixed text is for constant strings.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;ListBox&amp;#039;&amp;#039;&amp;#039; : maLbName - List-box used to store the available printers.&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Edit&amp;#039;&amp;#039;&amp;#039; : a text box&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;NumericField&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;CheckBox&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;PushButton&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;RadioButton&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;OKButton&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;CancelButton&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;HelpButton&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Useless in our case :&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;FixedImage&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;FixedLine&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
These controls are used to allow the user to interact with the dialog. We only need to know the user-provided information. What is involved to display them, and how the look &amp;amp; feel is implemented is not interesting at this point, since we only want to know what the dialog actually does. So as &amp;#039;&amp;#039;&amp;#039;FixedImage&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;FixedLine&amp;#039;&amp;#039;&amp;#039;  provide no useful information, we don&amp;#039;t need them.&lt;br /&gt;
&lt;br /&gt;
There is also a timer intended to regulary update the current Printer status (ready, printing, paused, pending, waiting, offline, error…)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;AutoTimer&amp;#039;&amp;#039;&amp;#039; maStatusTimer&lt;br /&gt;
&lt;br /&gt;
TODO : List of all user-related information stored by this class and sent to the Printer and determine what work is involved when using Carbon equivalent.&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; style=&amp;quot;margin: 1em 1em 1em 0; background: #f9f9f9; border: 1px #aaa solid;border-collapse: collapse; width: 50%;&amp;quot;&lt;br /&gt;
|+ List of PrintDialog fields&lt;br /&gt;
|-  &lt;br /&gt;
!  style=&amp;quot;background: #f2f2f2;&amp;quot; | PrinterDialog propery !! style=&amp;quot;background: #f2f2f2;&amp;quot; |  Work needed&lt;br /&gt;
|- &lt;br /&gt;
| maCbxFilePrint || Nothing, Aqua does PDF printing&lt;br /&gt;
|- &lt;br /&gt;
| maEdtFaxNo || Nothing, Aqua does it&lt;br /&gt;
|- &lt;br /&gt;
| maBtnBrowse_nomore || appears to be unused in current implementation&lt;br /&gt;
|- &lt;br /&gt;
| maRbtAll || Fetch this information from Aqua dialog&lt;br /&gt;
|- &lt;br /&gt;
| maEbtPages || Fetch this with Carbon using from/to fields (Warning:  custom panel needed or equivalent to have the same level of functionality)&lt;br /&gt;
|- &lt;br /&gt;
| maRbtSelection || Not natively provided, some more work (may need a custom panel)&lt;br /&gt;
|- &lt;br /&gt;
| maNumCopies || Fetch from Aqua&lt;br /&gt;
|- &lt;br /&gt;
| maCbxCollate || Fetch from Aqua&lt;br /&gt;
|- &lt;br /&gt;
| maBtnOptions || Detail in other dialog (some is provided by Aqua, some may need a custom panel)...&lt;br /&gt;
|- &lt;br /&gt;
| maBtnHelp || Nothing, Aqua do this&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The class contains also fields used to store the real information provided by the controls (Mostly USHORT and BOOL). There is also a &amp;#039;&amp;#039;&amp;#039;XubString&amp;#039;&amp;#039;&amp;#039; instance and a &amp;#039;&amp;#039;&amp;#039;PrintDialogRange&amp;#039;&amp;#039;&amp;#039; instance used to store range information.&lt;br /&gt;
&lt;br /&gt;
Of course, this class contains an &amp;#039;&amp;#039;&amp;#039;Printer&amp;#039;&amp;#039;&amp;#039; instance and a &amp;#039;&amp;#039;&amp;#039;SvtPrinterImpl&amp;#039;&amp;#039;&amp;#039; instance in order to set the printer functionality.&lt;br /&gt;
&lt;br /&gt;
There is also internal methods, and links to the Option handler and the OK handler. You can find more information in the following file [http://go-oo.org/lxr/source/util/tools/inc/tools/link.hxx tools/inc/tools/link.hxx]&lt;br /&gt;
&lt;br /&gt;
The public methods are mostly getters and setters, I won&amp;#039;t detail it since I have already provided information about the private attributes, and they do nothing to the Printer instance.&lt;br /&gt;
&lt;br /&gt;
TODO : details the implementation of this class (interesting methods : &amp;#039;&amp;#039;ImplGetFileName&amp;#039;&amp;#039;, IMPL_LINK(PrintDialog, ImplModifyControlHdl, void*, p)&lt;br /&gt;
&lt;br /&gt;
For Aqua port, we need to re-implement this class in order to make it displays the native Aqua Print Dialog that will be provided by the Carbon API, and save information that was previously provided by children of &amp;#039;&amp;#039;&amp;#039;Control&amp;#039;&amp;#039;&amp;#039; class. We should also disable the Printing options provided by the Aqua dialog that are not provided by the Printer class (the information we cannot currently store).&lt;br /&gt;
&lt;br /&gt;
==== Print Setup file ====&lt;br /&gt;
* svtools/inc/prnsetup.hxx&lt;br /&gt;
* svtools/source/dialogs/prnsetup.hxx&lt;br /&gt;
&lt;br /&gt;
Utility functions : &lt;br /&gt;
* &amp;#039;&amp;#039;ImplFillPrnDlgListBox&amp;#039;&amp;#039;(const &amp;#039;&amp;#039;&amp;#039;Printer&amp;#039;&amp;#039;&amp;#039; *, &amp;#039;&amp;#039;&amp;#039;ListBox&amp;#039;&amp;#039;&amp;#039; *, &amp;#039;&amp;#039;&amp;#039;PushButton&amp;#039;&amp;#039;&amp;#039; *)&lt;br /&gt;
This method fills the &amp;#039;&amp;#039;&amp;#039;Printer&amp;#039;&amp;#039;&amp;#039; list-box with the QueueInfo provided by the &amp;#039;&amp;#039;&amp;#039;Printer&amp;#039;&amp;#039;&amp;#039; instance provided in argument. It then enables the OK button if the list is not empty.&lt;br /&gt;
&lt;br /&gt;
== Mac OS X API side ==&lt;br /&gt;
This part describes what can be used and how we intend to use it.&lt;br /&gt;
&lt;br /&gt;
The strategy is to first use the Carbon API to get Print Information and to provide an Aqua User Inerface for printing. Then, we will try to replace the current printing API to the native one, allowing to reduce dependencies, and the total package size.&lt;br /&gt;
&lt;br /&gt;
Carbon provides multiple way for us to print. We might consider every of different approaches :&lt;br /&gt;
* Printing using psprint. We only get settings from the Carbon Print Dialog and the Carbon Print Setup Dialog with the function PMGetPrintSettingsExtendedData (for example) and then we send the obtained parameters to our SalPrinter.&lt;br /&gt;
* Using the PMPrintToFile function (OpenOffice.org provides a postcript version of the document, and then, Carbon handles the print operation)&lt;br /&gt;
* Printing using a QuickDraw graphic context [http://developer.apple.com/documentation/Carbon/Conceptual/CPM_Concepts/cpm_chap3/chapter_3_section_4.html#//apple_ref/doc/uid/TP30000978-TP30000046-TPXREF12 See this link for an example] (As this is a legacy API, we are not enthusiast about using it in OpenOffice.org)&lt;br /&gt;
* Printing using a Quartz 2D graphic context [http://developer.apple.com/documentation/GraphicsImaging/Conceptual/drawingwithquartz2d/index.html More information about Quartz 2D]&lt;br /&gt;
&lt;br /&gt;
We may want to add some features to the Printing dialog provided by Carbon. [http://developer.apple.com/documentation/Printing/Conceptual/ExtPrintingDialogs/index.html This is documented here]&lt;br /&gt;
&lt;br /&gt;
Todo : implement missing methods, using Carbon API&lt;br /&gt;
&lt;br /&gt;
=== Using Aqua Printing Dialogs ===&lt;br /&gt;
&lt;br /&gt;
In a first a approach, we want to use Aqua dialogs and set the &amp;#039;&amp;#039;&amp;#039;SalPrinter&amp;#039;&amp;#039;&amp;#039; instance with the data provided by the dialog.&lt;br /&gt;
&lt;br /&gt;
Then, we want to get rid of the OpenOffice.org print dialog, for this, we need to add a custom print dialog addition to allow user to choose options not provided by Apple Print Dialog, however the behaviour might not be as the user except since we still use CUPS instead of Quartz.&lt;br /&gt;
&lt;br /&gt;
[http://developer.apple.com/documentation/Carbon/Conceptual/CPM_Concepts/index.html?http://developer.apple.com/documentation/Carbon/Conceptual/CPM_Concepts/cpm_chap3/chapter_3_section_1.html#//apple_ref/doc/uid/TP30000046-DontLinkElementID_22 Carbon calls for displaying Print Dialog and Print Setup Dialog]&lt;br /&gt;
&lt;br /&gt;
After this step, we should have a great native interface, now we want to print using Quartz instead of CUPS. To do this, we need to fill the Carbon Print object using the data provided by our Printer instance.&lt;br /&gt;
&lt;br /&gt;
[http://developer.apple.com/documentation/Carbon/Conceptual/CPM_Concepts/cpm_chap4/chapter_4_section_3.html Carbon Calls for retrieving Print Data and Page Setup data]&lt;br /&gt;
&lt;br /&gt;
We need then to hook Sal Graphic context primitives to the Quartz ones.&lt;br /&gt;
&lt;br /&gt;
=== Using Quartz Graphic Context to Print ===&lt;br /&gt;
&lt;br /&gt;
== Screenshots - Status ==&lt;br /&gt;
&lt;br /&gt;
http://eric.bachard.free.fr/mac/aquavcl/screenshots/printing/native_printing/native_printing_dialog.png&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
=== Link for Mac OS X API documentation  ===&lt;br /&gt;
http://developer.apple.com/documentation/Carbon/Reference/CarbonPrintingManager_Ref/index.html&lt;br /&gt;
&lt;br /&gt;
=== Starting point for documentation ===&lt;br /&gt;
http://developer.apple.com/documentation/Carbon/Printing-date.html#//apple_ref/doc/uid/TP30000440-TP30000420-TP30000455&lt;br /&gt;
http://developer.apple.com/documentation/Carbon/Conceptual/CPM_Concepts/cpm_chap4/chapter_4_section_1.html&lt;br /&gt;
http://developer.apple.com/samplecode/Carbon/idxPrinting-date.html&lt;br /&gt;
http://developer.apple.com/referencelibrary/Carbon/idxPrinting-date.html&lt;br /&gt;
&lt;br /&gt;
This work is part of http://wiki.services.openoffice.org/wiki/Mac_OS_X_Porting_-_Work_Areas/Todo%27s&lt;br /&gt;
&lt;br /&gt;
Created: [[User:Ericb|Ericb]] 19:33, 4 June 2006 (CEST)&lt;br /&gt;
&lt;br /&gt;
Last modification: [[User:Ybart|ybart]] 0:00, 16 October 2006 (CEST)&lt;br /&gt;
&lt;br /&gt;
[[Category:Porting]]&lt;br /&gt;
[[Category:Aqua]]&lt;br /&gt;
[[Category:MacOSX]]&lt;/div&gt;</summary>
		<author><name>Ybart</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Mac_OS_X_Porting_-_Native_Printing&amp;diff=32548</id>
		<title>Mac OS X Porting - Native Printing</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Mac_OS_X_Porting_-_Native_Printing&amp;diff=32548"/>
		<updated>2007-05-18T16:29:38Z</updated>

		<summary type="html">&lt;p&gt;Ybart: /* PrintDialog class */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page is dedicated to the native printing implementation in OpenOffice.org for Mac OS X&lt;br /&gt;
&lt;br /&gt;
== What we want to do ? ==&lt;br /&gt;
The final goal of this project is to have the native printing support on Mac OS X.&lt;br /&gt;
&lt;br /&gt;
=== What we have now and what we don&amp;#039;t ? ===&lt;br /&gt;
Currently we simply have a generic printing support which works with X11. There is also printing support implemented for Windows. This means that we have already a way to implement our printing support for Aqua without breaking OpenOffice.org as we have already environment plug-ins.&lt;br /&gt;
&lt;br /&gt;
However, we have only one Print Dialog and one Printer Setup dialog for all environments.&lt;br /&gt;
&lt;br /&gt;
Tu sum up : we have a starting point to implement low-level printing support using the native API. We only have to implement the native code. But &amp;#039;&amp;#039;&amp;#039;we have nothing for the dialogs&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
=== What the users want ? ===&lt;br /&gt;
The user wants to be able to print with OpenOffice.org the same way he does with its other natives applications. &lt;br /&gt;
&lt;br /&gt;
For us, this means using a native printing dialog. Then, we will also need to implement low-level printing using OS API because, without that the user might not be able to use every setting available in the native dialog. &lt;br /&gt;
&lt;br /&gt;
=== What will be even better ? ===&lt;br /&gt;
Using UNO. This will allow other platform developpers to use the same code to implement their native dialogs.&lt;br /&gt;
&lt;br /&gt;
== OpenOffice.org side ==&lt;br /&gt;
This part describes what can be found in the OOo APIs, how it is implemented and how it will be changed.&lt;br /&gt;
&lt;br /&gt;
=== OOo print process ===&lt;br /&gt;
I will try to share the few thing I understood about the way Writer prints document.&lt;br /&gt;
&lt;br /&gt;
First I need to locate the print menu item in the sw module (sw stands for Star Writer). For this, I need to know where in sw the menubar is built. I did found the menubar, but not how the menu item was linked to the print operation. Instead, I have found a method PrintPages implemented in sw module. The stack may look like that :&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;SwXTextDocument&amp;#039;&amp;#039;&amp;#039;::printPages()&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;ViewShell&amp;#039;&amp;#039;&amp;#039;::executeSlot(aReq)&lt;br /&gt;
* ...&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;SwView&amp;#039;&amp;#039;&amp;#039;::ExecutePrint()&lt;br /&gt;
* ...&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;SwXTextDocument&amp;#039;&amp;#039;&amp;#039;::render()&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;ViewShell&amp;#039;&amp;#039;&amp;#039;::Prt()&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;OutputDevice&amp;#039;&amp;#039;&amp;#039;:: ...&lt;br /&gt;
&lt;br /&gt;
TODO : Complete the stack trace&lt;br /&gt;
&lt;br /&gt;
There is many holes in the stack but we get the idea. The &amp;#039;&amp;#039;&amp;#039;OuputDevice&amp;#039;&amp;#039;&amp;#039; is in fact our &amp;#039;&amp;#039;&amp;#039;Printer.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
[[Image:Printing_model.png]]&lt;br /&gt;
&lt;br /&gt;
1. The user Application creates a print dialog or a print setup dialog. For this, it needs to call svtools. To be a bit more precise, it creates a new instance of &amp;#039;&amp;#039;&amp;#039;PrintDialog&amp;#039;&amp;#039;&amp;#039; or of &amp;#039;&amp;#039;&amp;#039;PrintDialogSetup&amp;#039;&amp;#039;&amp;#039;, it associates a Printer instance to it, then, it calls the Execute method from &amp;#039;&amp;#039;&amp;#039;PrintDialog&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;PrintSetupDialog&amp;#039;&amp;#039;&amp;#039;. This operation shows the dialog (using the &amp;#039;&amp;#039;Execute&amp;#039;&amp;#039; method from &amp;#039;&amp;#039;&amp;#039;ModalDialog&amp;#039;&amp;#039;&amp;#039;, which is in vcl) and sets the Printer Data correctly with the method &amp;#039;&amp;#039;setPrinterProps&amp;#039;&amp;#039;. Do do the real display of the dialog, it uses &amp;#039;&amp;#039;&amp;#039;SalFrame&amp;#039;&amp;#039;&amp;#039;&amp;#039;s &amp;#039;&amp;#039;Show()&amp;#039;&amp;#039; method, which can be X11SalFrame, &amp;#039;&amp;#039;&amp;#039;AquaSalFrame&amp;#039;&amp;#039;&amp;#039;, etc.&lt;br /&gt;
&lt;br /&gt;
2. Svtools is responsible for asking to the user the requested information about printing options. Then, it returns them ot the user application.&lt;br /&gt;
&lt;br /&gt;
3. The user application has now everything needed to print the document. So, it asks VCL to draw pixels, lines, characters, etc on an &amp;#039;&amp;#039;&amp;#039;OutputDevice&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
At this point, I don&amp;#039;t know exactly where the &amp;#039;&amp;#039;&amp;#039;OutputDevice&amp;#039;&amp;#039;&amp;#039; is instancied (who decides that it would be a screen, an Aqua printer or a PostScript printer. This is not really important since we understand the main idea of how printing works.&lt;br /&gt;
&lt;br /&gt;
[[Image:Printing_model_step_4.png]]&lt;br /&gt;
&lt;br /&gt;
4. After that VCL relies on its Graphic Context to really draws (i.e. make the OS really draws) the lines and pixels on the screen or on the print device.&lt;br /&gt;
&lt;br /&gt;
=== Concerned OOo modules ===&lt;br /&gt;
* psprint&lt;br /&gt;
* vcl&lt;br /&gt;
* svtools&lt;br /&gt;
&lt;br /&gt;
=== VCL ===&lt;br /&gt;
What we know about [[vcl]].&lt;br /&gt;
&lt;br /&gt;
==== SalPrinter class ====&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;SalPrinter&amp;#039;&amp;#039;&amp;#039; is a virtual class intended for managing print jobs. It is composed of virtual fonctions, and a dummy constructor.&lt;br /&gt;
This class is inherited by PspSalPrinter, WinSalPrinter, and of course by &amp;#039;&amp;#039;&amp;#039;AquaSalPrinter&amp;#039;&amp;#039;&amp;#039; (see [[#AquaSalPrinter class|AquaSalPrinter class]]).&lt;br /&gt;
&lt;br /&gt;
Its header is located in vcl/inc/salprn.hxx&lt;br /&gt;
It has no implementation file.&lt;br /&gt;
&lt;br /&gt;
[[Image:UML_class_SalPrinter.png]]&lt;br /&gt;
&lt;br /&gt;
==== PspSalPrinter class ====&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;PspSalPrinter&amp;#039;&amp;#039;&amp;#039; means PostScript Print System Abstraction Layer Printer. Its implementation is located in vcl/unx/source/gdi/salprnpsp.cxx. As the name suggests it relies on features psprint module.&lt;br /&gt;
&lt;br /&gt;
TODO : Discuss about &amp;#039;&amp;#039;&amp;#039;PspSalPrinter&amp;#039;&amp;#039;&amp;#039; implementation.&lt;br /&gt;
&lt;br /&gt;
==== Printer class ====&lt;br /&gt;
This is an abstraction class of a printer driver. You can entirely set up the printer there and start print jobs. What we need here is to make our native dialog access to this Printer. The we will need to make this class access to OS API rather than psprint. &lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;AquaSalPrinter&amp;#039;&amp;#039;&amp;#039; class is located in vcl/aqua/source/gdi/print.cxx&lt;br /&gt;
&lt;br /&gt;
[[Image:Printer_class_description.png]]&lt;br /&gt;
&lt;br /&gt;
This class inherits of &amp;#039;&amp;#039;&amp;#039;OutputDevice&amp;#039;&amp;#039;&amp;#039; and is derivated in &amp;#039;&amp;#039;&amp;#039;ImplQPrinter.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;QueueInfo&amp;#039;&amp;#039;&amp;#039; class - This class is related to the &amp;#039;&amp;#039;&amp;#039;Printer&amp;#039;&amp;#039;&amp;#039; class. It is used to store information about printers (name, driver, location, comment as strings, and number of Jobs, and a status code).&lt;br /&gt;
&lt;br /&gt;
==== OutputDevice class ====&lt;br /&gt;
This class allows applications such as Writer to draw graphics elements (pixels, lines, rects, characters, strings, etc...).&lt;br /&gt;
&lt;br /&gt;
This class is located in vcl/source/gdi/outdev.cxx, vcl/source/gdi/outdev[2-6].cxx&lt;br /&gt;
&lt;br /&gt;
At this time, we don&amp;#039;t need to know the details of this class. We will focus on it when we will use the Carbon Printing API.&lt;br /&gt;
&lt;br /&gt;
==== SalGraphics class ====&lt;br /&gt;
This class is responsible to translate the abstract drawing calls to concrete OS calls.&lt;br /&gt;
&lt;br /&gt;
==== PspGraphics ====&lt;br /&gt;
The class I need to reimplement using Aqua printing primitives...&lt;br /&gt;
It will probably called &amp;#039;&amp;#039;&amp;#039;AquaPrintGraphics&amp;#039;&amp;#039;&amp;#039;...&lt;br /&gt;
&lt;br /&gt;
==== AquaSalPrinter class ====&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;AquaSalPrinter&amp;#039;&amp;#039;&amp;#039; class is located in vcl/aqua/source/gdi/salprn.cxx&lt;br /&gt;
&lt;br /&gt;
Headers are in :&lt;br /&gt;
 vcl/inc/salinst.hxx  &lt;br /&gt;
 vcl/inc/salgdi.hxx    &lt;br /&gt;
 vcl/inc/salprn.hxx&lt;br /&gt;
&lt;br /&gt;
 Aqua implementation :&lt;br /&gt;
 vcl/aqua/inc/salprn.h  (AquaSalPrinter class implementation, inherits from &amp;#039;&amp;#039;&amp;#039;SalPrinter&amp;#039;&amp;#039;&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
=== psprint ===&lt;br /&gt;
What we know about psprint.&lt;br /&gt;
&lt;br /&gt;
=== svtools ===&lt;br /&gt;
What we need to know about svtools. Mostly it provides us the Print Dialog, and some other Print related dialogs.&lt;br /&gt;
&lt;br /&gt;
==== PrintDialog class ====&lt;br /&gt;
This class is responsible for drawing the print dialog we usually view when we choose the Print option of the File menu.&lt;br /&gt;
The current implementation uses this class to draw the print dialog. In our Aqua native implementation, we want to use the on provided by Carbon API. To achieve this, we want to know the functionality of this class, and let carbon manage the functionality maybe at this level or maybe in a other lever (higher or lower). We also need to know how this class provides information to the Printer instance.&lt;br /&gt;
&lt;br /&gt;
* The header of this class is located in [http://go-oo.org/lxr/source/util/svtools/inc/svtools/printdlg.hxx svtools/inc/svtools/printdlg.hxx]&lt;br /&gt;
* The implementation of this class is located in [http://go-oo.org/lxr/source/util/svtools/source/dialogs/printdlg.cxx svtools/source/dialogs/printdlg.cxx]&lt;br /&gt;
&lt;br /&gt;
This class is a child of &amp;#039;&amp;#039;&amp;#039;ModalDialog&amp;#039;&amp;#039;&amp;#039; class. &lt;br /&gt;
&lt;br /&gt;
It contains all the UI elements used by the dialog which are either :&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;FixedText&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;FixedInfo&amp;#039;&amp;#039;&amp;#039; : it is a child of &amp;#039;&amp;#039;&amp;#039;FixedText&amp;#039;&amp;#039;&amp;#039; and is defined in svtools/inc/stdctrl.hxx. It is nothing more than a &amp;#039;&amp;#039;&amp;#039;FixedText&amp;#039;&amp;#039;&amp;#039; with the info style applied (same behavior). It is used to store variables string since fixed text is for constant strings.&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;ListBox&amp;#039;&amp;#039;&amp;#039; : maLbName - List-box used to store the available printers.&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Edit&amp;#039;&amp;#039;&amp;#039; : a text box&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;NumericField&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;CheckBox&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;PushButton&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;RadioButton&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;OKButton&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;CancelButton&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;HelpButton&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Useless in our case :&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;FixedImage&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;FixedLine&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
These controls are used to allow the user to interact with the dialog. We only need to know the user-provided information. What is involved to display them, and how the look &amp;amp; feel is implemented is not interesting at this point, since we only want to know what the dialog actually does. So as &amp;#039;&amp;#039;&amp;#039;FixedImage&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;FixedLine&amp;#039;&amp;#039;&amp;#039;  provide no useful information, we don&amp;#039;t need them.&lt;br /&gt;
&lt;br /&gt;
There is also a timer intended to regulary update the current Printer status (ready, printing, paused, pending, waiting, offline, error…)&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;AutoTimer&amp;#039;&amp;#039;&amp;#039; maStatusTimer&lt;br /&gt;
&lt;br /&gt;
TODO : List of all user-related information stored by this class and sent to the Printer and determine what work is involved when using Carbon equivalent.&lt;br /&gt;
{| style=&amp;quot;margin: 1em 1em 1em 0; background: #f9f9f9; border: 1px #aaa solid;border-collapse: collapse; width: 50%;&amp;quot;&lt;br /&gt;
|+ List of PrintDialog fields&lt;br /&gt;
|-  style=&amp;#039;border: 1px #aaa solid; padding: 0.2em;&amp;#039;&lt;br /&gt;
! PrinterDialog propery !! Work needed&lt;br /&gt;
|- style=&amp;#039;border: 1px #aaa solid; padding: 0.2em;&amp;#039;&lt;br /&gt;
| maCbxFilePrint || Nothing, Aqua does PDF printing&lt;br /&gt;
|- style=&amp;#039;border: 1px #aaa solid; padding: 0.2em;&amp;#039;&lt;br /&gt;
| maEdtFaxNo || Nothing, Aqua does it&lt;br /&gt;
|- style=&amp;#039;border: 1px #aaa solid; padding: 0.2em;&amp;#039;&lt;br /&gt;
| maBtnBrowse_nomore || appears to be unused in current implementation&lt;br /&gt;
|- style=&amp;#039;border: 1px #aaa solid; padding: 0.2em;&amp;#039;&lt;br /&gt;
| maRbtAll || Fetch this information from Aqua dialog&lt;br /&gt;
|- style=&amp;#039;border: 1px #aaa solid; padding: 0.2em;&amp;#039;&lt;br /&gt;
| maEbtPages || Fetch this with Carbon using from/to fields (Warning:  custom panel needed or equivalent to have the same level of functionality)&lt;br /&gt;
|- style=&amp;#039;border: 1px #aaa solid; padding: 0.2em;&amp;#039;&lt;br /&gt;
| maRbtSelection || Not natively provided, some more work (may need a custom panel)&lt;br /&gt;
|- style=&amp;#039;border: 1px #aaa solid; padding: 0.2em;&amp;#039;&lt;br /&gt;
| maNumCopies || Fetch from Aqua&lt;br /&gt;
|- style=&amp;#039;border: 1px #aaa solid; padding: 0.2em;&amp;#039;&lt;br /&gt;
| maCbxCollate || Fetch from Aqua&lt;br /&gt;
|- style=&amp;#039;border: 1px #aaa solid; padding: 0.2em;&amp;#039;&lt;br /&gt;
| maBtnOptions || Detail in other dialog (some is provided by Aqua, some may need a custom panel)...&lt;br /&gt;
|- style=&amp;#039;border: 1px #aaa solid; padding: 0.2em;&amp;#039;&lt;br /&gt;
| maBtnHelp || Nothing, Aqua do this&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
The class contains also fields used to store the real information provided by the controls (Mostly USHORT and BOOL). There is also a &amp;#039;&amp;#039;&amp;#039;XubString&amp;#039;&amp;#039;&amp;#039; instance and a &amp;#039;&amp;#039;&amp;#039;PrintDialogRange&amp;#039;&amp;#039;&amp;#039; instance used to store range information.&lt;br /&gt;
&lt;br /&gt;
Of course, this class contains an &amp;#039;&amp;#039;&amp;#039;Printer&amp;#039;&amp;#039;&amp;#039; instance and a &amp;#039;&amp;#039;&amp;#039;SvtPrinterImpl&amp;#039;&amp;#039;&amp;#039; instance in order to set the printer functionality.&lt;br /&gt;
&lt;br /&gt;
There is also internal methods, and links to the Option handler and the OK handler. You can find more information in the following file [http://go-oo.org/lxr/source/util/tools/inc/tools/link.hxx tools/inc/tools/link.hxx]&lt;br /&gt;
&lt;br /&gt;
The public methods are mostly getters and setters, I won&amp;#039;t detail it since I have already provided information about the private attributes, and they do nothing to the Printer instance.&lt;br /&gt;
&lt;br /&gt;
TODO : details the implementation of this class (interesting methods : &amp;#039;&amp;#039;ImplGetFileName&amp;#039;&amp;#039;, IMPL_LINK(PrintDialog, ImplModifyControlHdl, void*, p)&lt;br /&gt;
&lt;br /&gt;
For Aqua port, we need to re-implement this class in order to make it displays the native Aqua Print Dialog that will be provided by the Carbon API, and save information that was previously provided by children of &amp;#039;&amp;#039;&amp;#039;Control&amp;#039;&amp;#039;&amp;#039; class. We should also disable the Printing options provided by the Aqua dialog that are not provided by the Printer class (the information we cannot currently store).&lt;br /&gt;
&lt;br /&gt;
==== Print Setup file ====&lt;br /&gt;
* svtools/inc/prnsetup.hxx&lt;br /&gt;
* svtools/source/dialogs/prnsetup.hxx&lt;br /&gt;
&lt;br /&gt;
Utility functions : &lt;br /&gt;
* &amp;#039;&amp;#039;ImplFillPrnDlgListBox&amp;#039;&amp;#039;(const &amp;#039;&amp;#039;&amp;#039;Printer&amp;#039;&amp;#039;&amp;#039; *, &amp;#039;&amp;#039;&amp;#039;ListBox&amp;#039;&amp;#039;&amp;#039; *, &amp;#039;&amp;#039;&amp;#039;PushButton&amp;#039;&amp;#039;&amp;#039; *)&lt;br /&gt;
This method fills the &amp;#039;&amp;#039;&amp;#039;Printer&amp;#039;&amp;#039;&amp;#039; list-box with the QueueInfo provided by the &amp;#039;&amp;#039;&amp;#039;Printer&amp;#039;&amp;#039;&amp;#039; instance provided in argument. It then enables the OK button if the list is not empty.&lt;br /&gt;
&lt;br /&gt;
== Mac OS X API side ==&lt;br /&gt;
This part describes what can be used and how we intend to use it.&lt;br /&gt;
&lt;br /&gt;
The strategy is to first use the Carbon API to get Print Information and to provide an Aqua User Inerface for printing. Then, we will try to replace the current printing API to the native one, allowing to reduce dependencies, and the total package size.&lt;br /&gt;
&lt;br /&gt;
Carbon provides multiple way for us to print. We might consider every of different approaches :&lt;br /&gt;
* Printing using psprint. We only get settings from the Carbon Print Dialog and the Carbon Print Setup Dialog with the function PMGetPrintSettingsExtendedData (for example) and then we send the obtained parameters to our SalPrinter.&lt;br /&gt;
* Using the PMPrintToFile function (OpenOffice.org provides a postcript version of the document, and then, Carbon handles the print operation)&lt;br /&gt;
* Printing using a QuickDraw graphic context [http://developer.apple.com/documentation/Carbon/Conceptual/CPM_Concepts/cpm_chap3/chapter_3_section_4.html#//apple_ref/doc/uid/TP30000978-TP30000046-TPXREF12 See this link for an example] (As this is a legacy API, we are not enthusiast about using it in OpenOffice.org)&lt;br /&gt;
* Printing using a Quartz 2D graphic context [http://developer.apple.com/documentation/GraphicsImaging/Conceptual/drawingwithquartz2d/index.html More information about Quartz 2D]&lt;br /&gt;
&lt;br /&gt;
We may want to add some features to the Printing dialog provided by Carbon. [http://developer.apple.com/documentation/Printing/Conceptual/ExtPrintingDialogs/index.html This is documented here]&lt;br /&gt;
&lt;br /&gt;
Todo : implement missing methods, using Carbon API&lt;br /&gt;
&lt;br /&gt;
=== Using Aqua Printing Dialogs ===&lt;br /&gt;
&lt;br /&gt;
In a first a approach, we want to use Aqua dialogs and set the &amp;#039;&amp;#039;&amp;#039;SalPrinter&amp;#039;&amp;#039;&amp;#039; instance with the data provided by the dialog.&lt;br /&gt;
&lt;br /&gt;
Then, we want to get rid of the OpenOffice.org print dialog, for this, we need to add a custom print dialog addition to allow user to choose options not provided by Apple Print Dialog, however the behaviour might not be as the user except since we still use CUPS instead of Quartz.&lt;br /&gt;
&lt;br /&gt;
[http://developer.apple.com/documentation/Carbon/Conceptual/CPM_Concepts/index.html?http://developer.apple.com/documentation/Carbon/Conceptual/CPM_Concepts/cpm_chap3/chapter_3_section_1.html#//apple_ref/doc/uid/TP30000046-DontLinkElementID_22 Carbon calls for displaying Print Dialog and Print Setup Dialog]&lt;br /&gt;
&lt;br /&gt;
After this step, we should have a great native interface, now we want to print using Quartz instead of CUPS. To do this, we need to fill the Carbon Print object using the data provided by our Printer instance.&lt;br /&gt;
&lt;br /&gt;
[http://developer.apple.com/documentation/Carbon/Conceptual/CPM_Concepts/cpm_chap4/chapter_4_section_3.html Carbon Calls for retrieving Print Data and Page Setup data]&lt;br /&gt;
&lt;br /&gt;
We need then to hook Sal Graphic context primitives to the Quartz ones.&lt;br /&gt;
&lt;br /&gt;
=== Using Quartz Graphic Context to Print ===&lt;br /&gt;
&lt;br /&gt;
== Screenshots - Status ==&lt;br /&gt;
&lt;br /&gt;
http://eric.bachard.free.fr/mac/aquavcl/screenshots/printing/native_printing/native_printing_dialog.png&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
=== Link for Mac OS X API documentation  ===&lt;br /&gt;
http://developer.apple.com/documentation/Carbon/Reference/CarbonPrintingManager_Ref/index.html&lt;br /&gt;
&lt;br /&gt;
=== Starting point for documentation ===&lt;br /&gt;
http://developer.apple.com/documentation/Carbon/Printing-date.html#//apple_ref/doc/uid/TP30000440-TP30000420-TP30000455&lt;br /&gt;
http://developer.apple.com/documentation/Carbon/Conceptual/CPM_Concepts/cpm_chap4/chapter_4_section_1.html&lt;br /&gt;
http://developer.apple.com/samplecode/Carbon/idxPrinting-date.html&lt;br /&gt;
http://developer.apple.com/referencelibrary/Carbon/idxPrinting-date.html&lt;br /&gt;
&lt;br /&gt;
This work is part of http://wiki.services.openoffice.org/wiki/Mac_OS_X_Porting_-_Work_Areas/Todo%27s&lt;br /&gt;
&lt;br /&gt;
Created: [[User:Ericb|Ericb]] 19:33, 4 June 2006 (CEST)&lt;br /&gt;
&lt;br /&gt;
Last modification: [[User:Ybart|ybart]] 0:00, 16 October 2006 (CEST)&lt;br /&gt;
&lt;br /&gt;
[[Category:Porting]]&lt;br /&gt;
[[Category:Aqua]]&lt;br /&gt;
[[Category:MacOSX]]&lt;/div&gt;</summary>
		<author><name>Ybart</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Mac_OS_X_Porting_-_Native_Printing&amp;diff=32538</id>
		<title>Mac OS X Porting - Native Printing</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Mac_OS_X_Porting_-_Native_Printing&amp;diff=32538"/>
		<updated>2007-05-18T14:59:09Z</updated>

		<summary type="html">&lt;p&gt;Ybart: /* PrintDialog class */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page is dedicated to the native printing implementation in OpenOffice.org for Mac OS X&lt;br /&gt;
&lt;br /&gt;
== What we want to do ? ==&lt;br /&gt;
The final goal of this project is to have the native printing support on Mac OS X.&lt;br /&gt;
&lt;br /&gt;
=== What we have now and what we don&amp;#039;t ? ===&lt;br /&gt;
Currently we simply have a generic printing support which works with X11. There is also printing support implemented for Windows. This means that we have already a way to implement our printing support for Aqua without breaking OpenOffice.org as we have already environment plug-ins.&lt;br /&gt;
&lt;br /&gt;
However, we have only one Print Dialog and one Printer Setup dialog for all environments.&lt;br /&gt;
&lt;br /&gt;
Tu sum up : we have a starting point to implement low-level printing support using the native API. We only have to implement the native code. But &amp;#039;&amp;#039;&amp;#039;we have nothing for the dialogs&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
=== What the users want ? ===&lt;br /&gt;
The user wants to be able to print with OpenOffice.org the same way he does with its other natives applications. &lt;br /&gt;
&lt;br /&gt;
For us, this means using a native printing dialog. Then, we will also need to implement low-level printing using OS API because, without that the user might not be able to use every setting available in the native dialog. &lt;br /&gt;
&lt;br /&gt;
=== What will be even better ? ===&lt;br /&gt;
Using UNO. This will allow other platform developpers to use the same code to implement their native dialogs.&lt;br /&gt;
&lt;br /&gt;
== OpenOffice.org side ==&lt;br /&gt;
This part describes what can be found in the OOo APIs, how it is implemented and how it will be changed.&lt;br /&gt;
&lt;br /&gt;
=== OOo print process ===&lt;br /&gt;
I will try to share the few thing I understood about the way Writer prints document.&lt;br /&gt;
&lt;br /&gt;
First I need to locate the print menu item in the sw module (sw stands for Star Writer). For this, I need to know where in sw the menubar is built. I did found the menubar, but not how the menu item was linked to the print operation. Instead, I have found a method PrintPages implemented in sw module. The stack may look like that :&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;SwXTextDocument&amp;#039;&amp;#039;&amp;#039;::printPages()&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;ViewShell&amp;#039;&amp;#039;&amp;#039;::executeSlot(aReq)&lt;br /&gt;
* ...&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;SwView&amp;#039;&amp;#039;&amp;#039;::ExecutePrint()&lt;br /&gt;
* ...&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;SwXTextDocument&amp;#039;&amp;#039;&amp;#039;::render()&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;ViewShell&amp;#039;&amp;#039;&amp;#039;::Prt()&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;OutputDevice&amp;#039;&amp;#039;&amp;#039;:: ...&lt;br /&gt;
&lt;br /&gt;
TODO : Complete the stack trace&lt;br /&gt;
&lt;br /&gt;
There is many holes in the stack but we get the idea. The &amp;#039;&amp;#039;&amp;#039;OuputDevice&amp;#039;&amp;#039;&amp;#039; is in fact our &amp;#039;&amp;#039;&amp;#039;Printer.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
[[Image:Printing_model.png]]&lt;br /&gt;
&lt;br /&gt;
1. The user Application creates a print dialog or a print setup dialog. For this, it needs to call svtools. To be a bit more precise, it creates a new instance of &amp;#039;&amp;#039;&amp;#039;PrintDialog&amp;#039;&amp;#039;&amp;#039; or of &amp;#039;&amp;#039;&amp;#039;PrintDialogSetup&amp;#039;&amp;#039;&amp;#039;, it associates a Printer instance to it, then, it calls the Execute method from &amp;#039;&amp;#039;&amp;#039;PrintDialog&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;PrintSetupDialog&amp;#039;&amp;#039;&amp;#039;. This operation shows the dialog (using the &amp;#039;&amp;#039;Execute&amp;#039;&amp;#039; method from &amp;#039;&amp;#039;&amp;#039;ModalDialog&amp;#039;&amp;#039;&amp;#039;, which is in vcl) and sets the Printer Data correctly with the method &amp;#039;&amp;#039;setPrinterProps&amp;#039;&amp;#039;. Do do the real display of the dialog, it uses &amp;#039;&amp;#039;&amp;#039;SalFrame&amp;#039;&amp;#039;&amp;#039;&amp;#039;s &amp;#039;&amp;#039;Show()&amp;#039;&amp;#039; method, which can be X11SalFrame, &amp;#039;&amp;#039;&amp;#039;AquaSalFrame&amp;#039;&amp;#039;&amp;#039;, etc.&lt;br /&gt;
&lt;br /&gt;
2. Svtools is responsible for asking to the user the requested information about printing options. Then, it returns them ot the user application.&lt;br /&gt;
&lt;br /&gt;
3. The user application has now everything needed to print the document. So, it asks VCL to draw pixels, lines, characters, etc on an &amp;#039;&amp;#039;&amp;#039;OutputDevice&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
At this point, I don&amp;#039;t know exactly where the &amp;#039;&amp;#039;&amp;#039;OutputDevice&amp;#039;&amp;#039;&amp;#039; is instancied (who decides that it would be a screen, an Aqua printer or a PostScript printer. This is not really important since we understand the main idea of how printing works.&lt;br /&gt;
&lt;br /&gt;
[[Image:Printing_model_step_4.png]]&lt;br /&gt;
&lt;br /&gt;
4. After that VCL relies on its Graphic Context to really draws (i.e. make the OS really draws) the lines and pixels on the screen or on the print device.&lt;br /&gt;
&lt;br /&gt;
=== Concerned OOo modules ===&lt;br /&gt;
* psprint&lt;br /&gt;
* vcl&lt;br /&gt;
* svtools&lt;br /&gt;
&lt;br /&gt;
=== VCL ===&lt;br /&gt;
What we know about [[vcl]].&lt;br /&gt;
&lt;br /&gt;
==== SalPrinter class ====&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;SalPrinter&amp;#039;&amp;#039;&amp;#039; is a virtual class intended for managing print jobs. It is composed of virtual fonctions, and a dummy constructor.&lt;br /&gt;
This class is inherited by PspSalPrinter, WinSalPrinter, and of course by &amp;#039;&amp;#039;&amp;#039;AquaSalPrinter&amp;#039;&amp;#039;&amp;#039; (see [[#AquaSalPrinter class|AquaSalPrinter class]]).&lt;br /&gt;
&lt;br /&gt;
Its header is located in vcl/inc/salprn.hxx&lt;br /&gt;
It has no implementation file.&lt;br /&gt;
&lt;br /&gt;
[[Image:UML_class_SalPrinter.png]]&lt;br /&gt;
&lt;br /&gt;
==== PspSalPrinter class ====&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;PspSalPrinter&amp;#039;&amp;#039;&amp;#039; means PostScript Print System Abstraction Layer Printer. Its implementation is located in vcl/unx/source/gdi/salprnpsp.cxx. As the name suggests it relies on features psprint module.&lt;br /&gt;
&lt;br /&gt;
TODO : Discuss about &amp;#039;&amp;#039;&amp;#039;PspSalPrinter&amp;#039;&amp;#039;&amp;#039; implementation.&lt;br /&gt;
&lt;br /&gt;
==== Printer class ====&lt;br /&gt;
This is an abstraction class of a printer driver. You can entirely set up the printer there and start print jobs. What we need here is to make our native dialog access to this Printer. The we will need to make this class access to OS API rather than psprint. &lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;AquaSalPrinter&amp;#039;&amp;#039;&amp;#039; class is located in vcl/aqua/source/gdi/print.cxx&lt;br /&gt;
&lt;br /&gt;
[[Image:Printer_class_description.png]]&lt;br /&gt;
&lt;br /&gt;
This class inherits of &amp;#039;&amp;#039;&amp;#039;OutputDevice&amp;#039;&amp;#039;&amp;#039; and is derivated in &amp;#039;&amp;#039;&amp;#039;ImplQPrinter.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;QueueInfo&amp;#039;&amp;#039;&amp;#039; class - This class is related to the &amp;#039;&amp;#039;&amp;#039;Printer&amp;#039;&amp;#039;&amp;#039; class. It is used to store information about printers (name, driver, location, comment as strings, and number of Jobs, and a status code).&lt;br /&gt;
&lt;br /&gt;
==== OutputDevice class ====&lt;br /&gt;
This class allows applications such as Writer to draw graphics elements (pixels, lines, rects, characters, strings, etc...).&lt;br /&gt;
&lt;br /&gt;
This class is located in vcl/source/gdi/outdev.cxx, vcl/source/gdi/outdev[2-6].cxx&lt;br /&gt;
&lt;br /&gt;
At this time, we don&amp;#039;t need to know the details of this class. We will focus on it when we will use the Carbon Printing API.&lt;br /&gt;
&lt;br /&gt;
==== SalGraphics class ====&lt;br /&gt;
This class is responsible to translate the abstract drawing calls to concrete OS calls.&lt;br /&gt;
&lt;br /&gt;
==== PspGraphics ====&lt;br /&gt;
The class I need to reimplement using Aqua printing primitives...&lt;br /&gt;
It will probably called &amp;#039;&amp;#039;&amp;#039;AquaPrintGraphics&amp;#039;&amp;#039;&amp;#039;...&lt;br /&gt;
&lt;br /&gt;
==== AquaSalPrinter class ====&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;AquaSalPrinter&amp;#039;&amp;#039;&amp;#039; class is located in vcl/aqua/source/gdi/salprn.cxx&lt;br /&gt;
&lt;br /&gt;
Headers are in :&lt;br /&gt;
 vcl/inc/salinst.hxx  &lt;br /&gt;
 vcl/inc/salgdi.hxx    &lt;br /&gt;
 vcl/inc/salprn.hxx&lt;br /&gt;
&lt;br /&gt;
 Aqua implementation :&lt;br /&gt;
 vcl/aqua/inc/salprn.h  (AquaSalPrinter class implementation, inherits from &amp;#039;&amp;#039;&amp;#039;SalPrinter&amp;#039;&amp;#039;&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
=== psprint ===&lt;br /&gt;
What we know about psprint.&lt;br /&gt;
&lt;br /&gt;
=== svtools ===&lt;br /&gt;
What we need to know about svtools. Mostly it provides us the Print Dialog, and some other Print related dialogs.&lt;br /&gt;
&lt;br /&gt;
==== PrintDialog class ====&lt;br /&gt;
This class is responsible for drawing the print dialog we usually view when we choose the Print option of the File menu.&lt;br /&gt;
The current implementation uses this class to draw the print dialog. In our Aqua native implementation, we want to use the on provided by Carbon API. To achieve this, we want to know the functionality of this class, and let carbon manage the functionality maybe at this level or maybe in a other lever (higher or lower). We also need to know how this class provides information to the Printer instance.&lt;br /&gt;
&lt;br /&gt;
* The header of this class is located in [http://go-oo.org/lxr/source/util/svtools/inc/svtools/printdlg.hxx svtools/inc/svtools/printdlg.hxx]&lt;br /&gt;
* The implementation of this class is located in [http://go-oo.org/lxr/source/util/svtools/source/dialogs/printdlg.cxx svtools/source/dialogs/printdlg.cxx]&lt;br /&gt;
&lt;br /&gt;
This class is a child of &amp;#039;&amp;#039;&amp;#039;ModalDialog&amp;#039;&amp;#039;&amp;#039; class. &lt;br /&gt;
&lt;br /&gt;
It contains all the UI elements used by the dialog which are either :&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;FixedText&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;FixedInfo&amp;#039;&amp;#039;&amp;#039; : it is a child of &amp;#039;&amp;#039;&amp;#039;FixedText&amp;#039;&amp;#039;&amp;#039; and is defined in svtools/inc/stdctrl.hxx. It is nothing more than a &amp;#039;&amp;#039;&amp;#039;FixedText&amp;#039;&amp;#039;&amp;#039; with the info style applied (same behavior).&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;ListBox&amp;#039;&amp;#039;&amp;#039; : maLbName - List-box used to store the available printers.&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Edit&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;NumericField&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;CheckBox&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;PushButton&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;RadioButton&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;OKButton&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;CancelButton&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;HelpButton&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Useless in our case :&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;FixedImage&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;FixedLine&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
These controls are used to allow the user to interact with the dialog. We only need to know the user-provided information. What is involved to display them, and how the look &amp;amp; feel is implemented is not interesting at this point, since we only want to know what the dialog actually does. So as &amp;#039;&amp;#039;&amp;#039;FixedImage&amp;#039;&amp;#039;&amp;#039;, &amp;#039;&amp;#039;&amp;#039;FixedLine&amp;#039;&amp;#039;&amp;#039;  provide no useful information, we don&amp;#039;t need them.&lt;br /&gt;
&lt;br /&gt;
Other weird things that are not child of control class and that I don&amp;#039;t currently know yet why it is useful :&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;AutoTimer&amp;#039;&amp;#039;&amp;#039; maStatusTimer&lt;br /&gt;
&lt;br /&gt;
TODO : List of all user-related information stored by this class and sent to the Printer and find Carbon equivalent.&lt;br /&gt;
&lt;br /&gt;
The class contains also fields used to store the real information provided by the controls (Mostly USHORT and BOOL). There is also a &amp;#039;&amp;#039;&amp;#039;XubString&amp;#039;&amp;#039;&amp;#039; instance and a &amp;#039;&amp;#039;&amp;#039;PrintDialogRange&amp;#039;&amp;#039;&amp;#039; instance used to store range information.&lt;br /&gt;
&lt;br /&gt;
Of course, this class contains an &amp;#039;&amp;#039;&amp;#039;Printer&amp;#039;&amp;#039;&amp;#039; instance and a &amp;#039;&amp;#039;&amp;#039;SvtPrinterImpl&amp;#039;&amp;#039;&amp;#039; instance in order to set the printer functionality.&lt;br /&gt;
&lt;br /&gt;
There is also internal methods, and links to the Option handler and the OK handler. You can find more information in the following file [http://go-oo.org/lxr/source/util/tools/inc/tools/link.hxx tools/inc/tools/link.hxx]&lt;br /&gt;
&lt;br /&gt;
The public methods are mostly getters and setters, I won&amp;#039;t detail it since I have already provided information about the private attributes, and they do nothing to the Printer instance.&lt;br /&gt;
&lt;br /&gt;
TODO : details the implementation of this class (interesting methods : &amp;#039;&amp;#039;ImplGetFileName&amp;#039;&amp;#039;, IMPL_LINK(PrintDialog, ImplModifyControlHdl, void*, p)&lt;br /&gt;
&lt;br /&gt;
For Aqua port, we need to re-implement this class in order to make it displays the native Aqua Print Dialog that will be provided by the Carbon API, and save information that was previously provided by children of &amp;#039;&amp;#039;&amp;#039;Control&amp;#039;&amp;#039;&amp;#039; class. We should also disable the Printing options provided by the Aqua dialog that are not provided by the Printer class (the information we cannot currently store).&lt;br /&gt;
&lt;br /&gt;
==== Print Setup file ====&lt;br /&gt;
* svtools/inc/prnsetup.hxx&lt;br /&gt;
* svtools/source/dialogs/prnsetup.hxx&lt;br /&gt;
&lt;br /&gt;
Utility functions : &lt;br /&gt;
* &amp;#039;&amp;#039;ImplFillPrnDlgListBox&amp;#039;&amp;#039;(const &amp;#039;&amp;#039;&amp;#039;Printer&amp;#039;&amp;#039;&amp;#039; *, &amp;#039;&amp;#039;&amp;#039;ListBox&amp;#039;&amp;#039;&amp;#039; *, &amp;#039;&amp;#039;&amp;#039;PushButton&amp;#039;&amp;#039;&amp;#039; *)&lt;br /&gt;
This method fills the &amp;#039;&amp;#039;&amp;#039;Printer&amp;#039;&amp;#039;&amp;#039; list-box with the QueueInfo provided by the &amp;#039;&amp;#039;&amp;#039;Printer&amp;#039;&amp;#039;&amp;#039; instance provided in argument. It then enables the OK button if the list is not empty.&lt;br /&gt;
&lt;br /&gt;
== Mac OS X API side ==&lt;br /&gt;
This part describes what can be used and how we intend to use it.&lt;br /&gt;
&lt;br /&gt;
The strategy is to first use the Carbon API to get Print Information and to provide an Aqua User Inerface for printing. Then, we will try to replace the current printing API to the native one, allowing to reduce dependencies, and the total package size.&lt;br /&gt;
&lt;br /&gt;
Carbon provides multiple way for us to print. We might consider every of different approaches :&lt;br /&gt;
* Printing using psprint. We only get settings from the Carbon Print Dialog and the Carbon Print Setup Dialog with the function PMGetPrintSettingsExtendedData (for example) and then we send the obtained parameters to our SalPrinter.&lt;br /&gt;
* Using the PMPrintToFile function (OpenOffice.org provides a postcript version of the document, and then, Carbon handles the print operation)&lt;br /&gt;
* Printing using a QuickDraw graphic context [http://developer.apple.com/documentation/Carbon/Conceptual/CPM_Concepts/cpm_chap3/chapter_3_section_4.html#//apple_ref/doc/uid/TP30000978-TP30000046-TPXREF12 See this link for an example] (As this is a legacy API, we are not enthusiast about using it in OpenOffice.org)&lt;br /&gt;
* Printing using a Quartz 2D graphic context [http://developer.apple.com/documentation/GraphicsImaging/Conceptual/drawingwithquartz2d/index.html More information about Quartz 2D]&lt;br /&gt;
&lt;br /&gt;
We may want to add some features to the Printing dialog provided by Carbon. [http://developer.apple.com/documentation/Printing/Conceptual/ExtPrintingDialogs/index.html This is documented here]&lt;br /&gt;
&lt;br /&gt;
Todo : implement missing methods, using Carbon API&lt;br /&gt;
&lt;br /&gt;
=== Using Aqua Printing Dialogs ===&lt;br /&gt;
&lt;br /&gt;
In a first a approach, we want to use Aqua dialogs and set the &amp;#039;&amp;#039;&amp;#039;SalPrinter&amp;#039;&amp;#039;&amp;#039; instance with the data provided by the dialog.&lt;br /&gt;
&lt;br /&gt;
Then, we want to get rid of the OpenOffice.org print dialog, for this, we need to add a custom print dialog addition to allow user to choose options not provided by Apple Print Dialog, however the behaviour might not be as the user except since we still use CUPS instead of Quartz.&lt;br /&gt;
&lt;br /&gt;
[http://developer.apple.com/documentation/Carbon/Conceptual/CPM_Concepts/index.html?http://developer.apple.com/documentation/Carbon/Conceptual/CPM_Concepts/cpm_chap3/chapter_3_section_1.html#//apple_ref/doc/uid/TP30000046-DontLinkElementID_22 Carbon calls for displaying Print Dialog and Print Setup Dialog]&lt;br /&gt;
&lt;br /&gt;
After this step, we should have a great native interface, now we want to print using Quartz instead of CUPS. To do this, we need to fill the Carbon Print object using the data provided by our Printer instance.&lt;br /&gt;
&lt;br /&gt;
[http://developer.apple.com/documentation/Carbon/Conceptual/CPM_Concepts/cpm_chap4/chapter_4_section_3.html Carbon Calls for retrieving Print Data and Page Setup data]&lt;br /&gt;
&lt;br /&gt;
We need then to hook Sal Graphic context primitives to the Quartz ones.&lt;br /&gt;
&lt;br /&gt;
=== Using Quartz Graphic Context to Print ===&lt;br /&gt;
&lt;br /&gt;
== Screenshots - Status ==&lt;br /&gt;
&lt;br /&gt;
http://eric.bachard.free.fr/mac/aquavcl/screenshots/printing/native_printing/native_printing_dialog.png&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
=== Link for Mac OS X API documentation  ===&lt;br /&gt;
http://developer.apple.com/documentation/Carbon/Reference/CarbonPrintingManager_Ref/index.html&lt;br /&gt;
&lt;br /&gt;
=== Starting point for documentation ===&lt;br /&gt;
http://developer.apple.com/documentation/Carbon/Printing-date.html#//apple_ref/doc/uid/TP30000440-TP30000420-TP30000455&lt;br /&gt;
http://developer.apple.com/documentation/Carbon/Conceptual/CPM_Concepts/cpm_chap4/chapter_4_section_1.html&lt;br /&gt;
http://developer.apple.com/samplecode/Carbon/idxPrinting-date.html&lt;br /&gt;
http://developer.apple.com/referencelibrary/Carbon/idxPrinting-date.html&lt;br /&gt;
&lt;br /&gt;
This work is part of http://wiki.services.openoffice.org/wiki/Mac_OS_X_Porting_-_Work_Areas/Todo%27s&lt;br /&gt;
&lt;br /&gt;
Created: [[User:Ericb|Ericb]] 19:33, 4 June 2006 (CEST)&lt;br /&gt;
&lt;br /&gt;
Last modification: [[User:Ybart|ybart]] 0:00, 16 October 2006 (CEST)&lt;br /&gt;
&lt;br /&gt;
[[Category:Porting]]&lt;br /&gt;
[[Category:Aqua]]&lt;br /&gt;
[[Category:MacOSX]]&lt;/div&gt;</summary>
		<author><name>Ybart</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=User:Ericb&amp;diff=32517</id>
		<title>User:Ericb</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=User:Ericb&amp;diff=32517"/>
		<updated>2007-05-18T11:04:46Z</updated>

		<summary type="html">&lt;p&gt;Ybart: /* Keyboard comparizon between OpenOffice.org / Mac OS X  application */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;==Public Documentation License Notice==&lt;br /&gt;
&lt;br /&gt;
The contents of this Documentation (excepted Native Port Roadmap),are subject to the Public Documentation License Version 1.0 (the &amp;quot;License&amp;quot;); you may only use this Documentation if you comply with the terms of this License. A copy of the License is available at http://www.openoffice.org/licenses/PDL.html.&lt;br /&gt;
The Original Documentation is &amp;quot;Mac OS X native port&amp;quot;. The Initial Writer of the Original Documentation is (JCA) Eric Bachard (C) 2005-2006. All Rights Reserved. (Initial Writer contact(s): ericb@openoffice.org.)&lt;br /&gt;
&lt;br /&gt;
==&amp;#039;&amp;#039;&amp;#039;Mac OS X Native port&amp;#039;&amp;#039;&amp;#039;==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;messagebox cleanup metadata&amp;quot; style=&amp;quot;border:1px solid blue;background-color:#B3FFF5;padding:7px;&amp;quot;&amp;gt;&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;The first Mac OS X native port objective is make OpenOffice.org run without X11 use, to make it a real Mac application.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;The second one is respect Aqua Human interface Guidelines&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039; This is a long term work, and every help and/or contributions, like donations** are welcome.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
 **see http://contributing.openoffice.org/index.html&lt;br /&gt;
&lt;br /&gt;
==&amp;#039;&amp;#039;&amp;#039;Native Port Roadmap&amp;#039;&amp;#039;&amp;#039;==&lt;br /&gt;
&lt;br /&gt;
===&amp;#039;&amp;#039;&amp;#039;2006&amp;#039;&amp;#039;&amp;#039;===&lt;br /&gt;
&lt;br /&gt;
* June 2006: work in progress &lt;br /&gt;
&lt;br /&gt;
- Basis: frame, instances, threads, drawing, painting, resizing (Stephan Schaefer, Tino Rachui)&lt;br /&gt;
&lt;br /&gt;
 Done: &lt;br /&gt;
 implement threads&lt;br /&gt;
 create, manage instance&lt;br /&gt;
 create, manage windows (including parents)&lt;br /&gt;
 create, manage events&lt;br /&gt;
 create manage drawing, resizing&lt;br /&gt;
 create, add menus (Pavel Janik)&lt;br /&gt;
 toggle window fullscreen (Pierre de Filippis)&lt;br /&gt;
 make font server work (Stephan Schaefer)&lt;br /&gt;
&lt;br /&gt;
* Current status font support (Stephan Schaefer, 2006/07/28): the following features are basically working now&lt;br /&gt;
** font selection&lt;br /&gt;
** font size&lt;br /&gt;
** simple font attributes (bold, italic)&lt;br /&gt;
&lt;br /&gt;
 Next step: document first part, and propose design&lt;br /&gt;
&lt;br /&gt;
- native filepicker (Pavel Janik, Florian Heckl)&lt;br /&gt;
&lt;br /&gt;
- native printing implementation (Oliver?)&lt;br /&gt;
&lt;br /&gt;
- native font implementation (Eric Bachard)&lt;br /&gt;
&lt;br /&gt;
* September 2006: &lt;br /&gt;
&lt;br /&gt;
- first proofs of concept: fonts, filepicker .. (more?)&lt;br /&gt;
- show the results (OOoCon 2006?)&lt;br /&gt;
&lt;br /&gt;
===&amp;#039;&amp;#039;&amp;#039;2007&amp;#039;&amp;#039;&amp;#039;===&lt;br /&gt;
&lt;br /&gt;
* January 2007: first alpha implementation&lt;br /&gt;
&lt;br /&gt;
==&amp;#039;&amp;#039;&amp;#039;Strategy for native port&amp;#039;&amp;#039;&amp;#039;==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Possible Actions&amp;#039;&amp;#039;&amp;#039;: &lt;br /&gt;
&lt;br /&gt;
Identify us:&lt;br /&gt;
&lt;br /&gt;
#Complete the arrays below&lt;br /&gt;
#Update photos on frapr.com?&lt;br /&gt;
&lt;br /&gt;
Share the work:&lt;br /&gt;
&lt;br /&gt;
#Divide the work between little Teams&lt;br /&gt;
#Update Todo list regularly -&amp;gt; needs some love these days ... [http://wiki.services.openoffice.org/wiki/Mac_OS_X_Porting_-_Work_Areas/Todo%27s]&lt;br /&gt;
&lt;br /&gt;
Help:&lt;br /&gt;
&lt;br /&gt;
#Teach tools between us&lt;br /&gt;
#Do a debug party on IRC&lt;br /&gt;
#write documentation&lt;br /&gt;
&lt;br /&gt;
Meet us:&lt;br /&gt;
&lt;br /&gt;
#IRC&lt;br /&gt;
#Mac Meeting (like nov2005 in Hamburg?)&lt;br /&gt;
&lt;br /&gt;
Inform:&lt;br /&gt;
&lt;br /&gt;
#Update website regularly&lt;br /&gt;
#Blogs&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;WHO&amp;#039;&amp;#039;&amp;#039;:&lt;br /&gt;
&lt;br /&gt;
Mac Team:&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;vertical-align:top; text-align:left; background-color:#efefef;&amp;quot;&lt;br /&gt;
|- style=&amp;quot;background-color:#d6d6d6;font-weight:bold;&amp;quot; &lt;br /&gt;
|Developer \ skills || build || write code || code review || debug/trace (higher is better) || contribute to documentation ||&lt;br /&gt;
|-&lt;br /&gt;
|ericb|| x || x || || 1 || x ||&lt;br /&gt;
|-&lt;br /&gt;
|pjanik|| || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|ssa|| || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|maho|| || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|tinor|| || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|schmidtm|| || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|ebischoff|| || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|obr|| || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|cl|| || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|aliscafo|| || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|fheckl|| || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|Fridrich|| || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|plipli|| || x || || || x ||&lt;br /&gt;
|-&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Other resources&amp;#039;&amp;#039;&amp;#039;:&lt;br /&gt;
&lt;br /&gt;
fonts: ?&lt;br /&gt;
&lt;br /&gt;
events: ?&lt;br /&gt;
&lt;br /&gt;
QA: James McKenzie leads QA for the Mac OS X port of OpenOffice.org and is looking for volunteers to spread this effort over several people and needs people from all over the world to test various languages.&lt;br /&gt;
&lt;br /&gt;
graphical: ?&lt;br /&gt;
&lt;br /&gt;
Communication: ?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;WHAT&amp;#039;&amp;#039;&amp;#039;: Status of most important tasks&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;vertical-align:top; text-align:left; background-color:#efefef;&amp;quot;&lt;br /&gt;
|- style=&amp;quot;background-color:#d6d6d6;font-weight:bold;&amp;quot; &lt;br /&gt;
| Task || Names|| Urgency (1=higher)|| Work in Progress || Done || Code review || Debug || Integration || &lt;br /&gt;
|-&lt;br /&gt;
|Get rid of X11||done || 1 || x || x || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|Bundle|| || 1 || x || || || || | ||&lt;br /&gt;
|-&lt;br /&gt;
|Drawing|| || 1 || x || || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|Fonts||plipli || 1 || x || || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|Events management|| || 2 || x || || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|Controls (see list) ||ericb, aliscafo || 2 || x || || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|Native FilePicker||Florian Heckl, Pavel Janik || 3 || x || x || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|Native Printing||Yvan Barthelemy || 3 || x || || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|Native SpellChecker|| || 4 || || || || || || ||&lt;br /&gt;
|-&lt;br /&gt;
|Player||Mox Soini || 4 || x || || || || || ||&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Other tasks:&lt;br /&gt;
&lt;br /&gt;
Help for writing bug lists, status of bugs ..etc&lt;br /&gt;
&lt;br /&gt;
Write howto use gdb, leaks, other tools&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;WHEN&amp;#039;&amp;#039;&amp;#039;:&lt;br /&gt;
&lt;br /&gt;
From Christian Lippka (last meeting, 25th of august 2006): &lt;br /&gt;
 Aug 26 00:21:38 ChristianL&lt;br /&gt;
 from my point of view what is missing for point 1:&lt;br /&gt;
 text layout, complete font support, keyboard support,&lt;br /&gt;
 fixing repaint issues, having aqua install and run out of the box&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;September 2006&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Present the current state of the project at the 2006 OpenOffice conference in Lyon and Paris&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Late 2006&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
fix OpenOffice.org launch&lt;br /&gt;
fix drawing (repainting)&lt;br /&gt;
Implement missing methods and fix most important bugs (mainly the one leading to crash) in:&lt;br /&gt;
ATS&lt;br /&gt;
Salgraphics&lt;br /&gt;
Salinstance&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;January or February 2007&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
make Java work (works partially)&lt;br /&gt;
make intensive debug&lt;br /&gt;
present something working as alpha&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;June 2007	&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Implementation of:&lt;br /&gt;
native filepicker&lt;br /&gt;
native printing&lt;br /&gt;
&lt;br /&gt;
== &amp;#039;&amp;#039;&amp;#039;Become a Domain Developer for Mac OS X port&amp;#039;&amp;#039;&amp;#039; ==&lt;br /&gt;
&lt;br /&gt;
People regularly contributing to Mac OS x port with regular and quality patches are, after proposal, invited to become a [[DomainDeveloper]].&lt;br /&gt;
&lt;br /&gt;
The purpose of this document is to clearly define all the steps to become a [[DomainDeveloper]]. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Preliminary :  step 1 in  [[Commit_Rights]] must be completed and checked, and you must be in the list of [[http://www.openoffice.org/FAQs/faq-licensing.html#jca1 JCA Licensed people]]&lt;br /&gt;
&lt;br /&gt;
=== Steps for ssh2 key to be uploaded ===&lt;br /&gt;
&lt;br /&gt;
==== Create the key ====&lt;br /&gt;
&lt;br /&gt;
Everything is described here : [[http://www.openoffice.org/scdocs/ddSSHGuide.html SSH Guide]] &lt;br /&gt;
&lt;br /&gt;
==== Upload the key ====&lt;br /&gt;
&lt;br /&gt;
You must create an issue, like described below  :&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Assign it to &amp;quot;ssh2key&amp;quot; in the &amp;quot;www&amp;quot; component&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Sub Component : openoffice.org cvs&lt;br /&gt;
&lt;br /&gt;
Title : CVS Commit access request&lt;br /&gt;
&lt;br /&gt;
Add louis ( Louis Suarez Potts) or st ( Stefan Taxhet ) on CC&lt;br /&gt;
&lt;br /&gt;
Upload your ssh2 public key respecting the process ( Attach a DSA key, not an RSA )&lt;br /&gt;
&lt;br /&gt;
A project lead will confirm your request &lt;br /&gt;
&lt;br /&gt;
Then the support will upload your key&lt;br /&gt;
&lt;br /&gt;
Once done the issue is set to Fixed , and the next step has to be verified before &amp;#039;&amp;#039;&amp;#039;you&amp;#039;&amp;#039;&amp;#039; close it.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;EXAMPLE&amp;#039;&amp;#039;&amp;#039; : [[http://www.openoffice.org/issues/show_bug.cgi?id=75291 Upload SSH2 Key for Etsushi Kato]]&lt;br /&gt;
&lt;br /&gt;
==== Verify it works ====&lt;br /&gt;
&lt;br /&gt;
You now can try to connect via tunnel, and follow instructions given [[http://www.openoffice.org/scdocs/ddSSHGuide.html SSH Guide]] &lt;br /&gt;
&lt;br /&gt;
If something goes wrong, ask for help to support, with a maximum of details, to solve the problem.&lt;br /&gt;
&lt;br /&gt;
Once it works, the issue can be closed, and you can e.g. test downloading a module from tunnel repository :&lt;br /&gt;
&lt;br /&gt;
First create a tunnel with the command:&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
ssh -2 -x -L 2401:localhost:2401 tunnel@openoffice.org&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then in a new window:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
export CVSROOT=&amp;quot;:pserver:your_login@localhost:/cvs&amp;quot;&lt;br /&gt;
&lt;br /&gt;
cvs login ( enter )&lt;br /&gt;
&lt;br /&gt;
(your password )&lt;br /&gt;
&lt;br /&gt;
mkdir TEST&lt;br /&gt;
&lt;br /&gt;
cd TEST&lt;br /&gt;
&lt;br /&gt;
cvs -z4 co -r SRC680_m205 vcl &lt;br /&gt;
&lt;br /&gt;
cd vcl &lt;br /&gt;
&lt;br /&gt;
cat CVS/Root  -&amp;gt; should indicate : your local repository&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== Ask for CVS access for all modules required ===&lt;br /&gt;
&lt;br /&gt;
Two steps : create an issue is mandatory because the concerned project is tools, and because people can have only ssh2 key without being [[DomainDeveloper]].&lt;br /&gt;
&lt;br /&gt;
==== Create an issue ====&lt;br /&gt;
&lt;br /&gt;
You must create an issue, described below  :&lt;br /&gt;
&lt;br /&gt;
Component : tools&lt;br /&gt;
&lt;br /&gt;
Sub Component : www&lt;br /&gt;
&lt;br /&gt;
Title : CVS access to all modules required&lt;br /&gt;
&lt;br /&gt;
Assigned to mh  +  CC for ericb and/or pjanik&lt;br /&gt;
&lt;br /&gt;
Present yourself quickly, and ask the access&lt;br /&gt;
&lt;br /&gt;
A project lead will confirm&lt;br /&gt;
&lt;br /&gt;
An admin will confirm this is ok, and set the issue to Fixed&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;EXAMPLE&amp;#039;&amp;#039;&amp;#039; : [[http://www.openoffice.org/issues/show_bug.cgi?id=75494 CVS Access all modules for Etsushi Kato]]&lt;br /&gt;
&lt;br /&gt;
==== Verify ====&lt;br /&gt;
&lt;br /&gt;
Create the tunnel :&lt;br /&gt;
&lt;br /&gt;
open a terminal and type :&lt;br /&gt;
&lt;br /&gt;
ssh -2 -x -L 2401:localhost:2401 tunnel@openoffice.org&lt;br /&gt;
&lt;br /&gt;
once logged in, open a new terminal, and do ( for example ):&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
cd $OOO_SRC_ROOT/&lt;br /&gt;
&lt;br /&gt;
source MacOSXPPCEnv.Set.sh  { source MacOSXX86Env.Set.sh for Mac Intel }&lt;br /&gt;
&lt;br /&gt;
cd vcl  ( for example )&lt;br /&gt;
&lt;br /&gt;
IMPORTANT : be sure vcl has been checked from tunnel, not from anoncvs ( cat CVS/Root will give you the answer )&lt;br /&gt;
&lt;br /&gt;
export CWS_WORK_STAMP=aquavcl01   # Only needed for working with [[EIS]], can change for a different CWS ;) &lt;br /&gt;
&lt;br /&gt;
cd aqua/source/gdi&lt;br /&gt;
&lt;br /&gt;
add your changes to your_file.cxx, then commit :&lt;br /&gt;
&lt;br /&gt;
cvs commit -m &amp;quot;#i75689# bla bla ... the reason of the modification(s)&amp;quot;  your_file.cxx  # The #i75689# is an issue number in the tracker&lt;br /&gt;
&lt;br /&gt;
cvs update&lt;br /&gt;
&lt;br /&gt;
If nothing is wrong, cvs update should not return M for your_file.cxx, means the commit is successfull.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
In case of problem, use the issue until it is fixed&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;#039;&amp;#039;&amp;#039;Welcome aboard :)&amp;#039;&amp;#039;&amp;#039;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== &amp;#039;&amp;#039;&amp;#039;Mac OS X porter Team at WWDC 2007&amp;#039;&amp;#039;&amp;#039; ==&lt;br /&gt;
&lt;br /&gt;
=== What is WWDC 2007 ? ===&lt;br /&gt;
&lt;br /&gt;
See [http://developer.apple.com/wwdc/ Apple WWDC 2007]&lt;br /&gt;
&lt;br /&gt;
====Labs Agenda====&lt;br /&gt;
&lt;br /&gt;
It is extremely important to organize us for Labs.&lt;br /&gt;
&lt;br /&gt;
The rule is extremely simple : bring your laptop, your code, and ask :)&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;10&amp;quot;&lt;br /&gt;
| Days&lt;br /&gt;
|monday&amp;lt;br&amp;gt;June 11&lt;br /&gt;
|tuesday&amp;lt;br&amp;gt;June 12&lt;br /&gt;
|wednesday&amp;lt;br&amp;gt;June 13&lt;br /&gt;
|thursday&amp;lt;br&amp;gt;June 14&lt;br /&gt;
|friday &amp;lt;br&amp;gt;June 15&lt;br /&gt;
|-&lt;br /&gt;
|Labs&lt;br /&gt;
|&amp;lt;br&amp;gt;Afternoon&lt;br /&gt;
|Morning&amp;lt;br&amp;gt;Afternoon&lt;br /&gt;
|Morning&amp;lt;br&amp;gt;Afternoon&lt;br /&gt;
|Morning&amp;lt;br&amp;gt;Afternoon&lt;br /&gt;
|Morning&amp;lt;br&amp;gt;Afternoon&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
====&amp;#039;&amp;#039;&amp;#039;Interesting Labs&amp;#039;&amp;#039;&amp;#039;====&lt;br /&gt;
&lt;br /&gt;
The complete list : [http://developer.apple.com/wwdc/tracks/macosx.html Mac OS X Essentials]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*Core Text Lab &lt;br /&gt;
Receive one-on-one technical assistance and troubleshooting advice from the Core Text engineering team. Learn how to use the advanced font handling and blazingly fast Unicode layout capabilities of Core Text. Bring your laptop, your code, and your questions.&lt;br /&gt;
&lt;br /&gt;
*HIToolbox Lab&lt;br /&gt;
Work on tuning and debugging HIToolbox code in your Carbon application. Receive one-on-one technical assistance and troubleshooting advice from the High Level Toolbox engineering team, Apple DTS engineers, and technology evangelists. Bring your laptop, your code, and your questions.&lt;br /&gt;
&lt;br /&gt;
=== Our Objectives at the WWDC 2007 ===&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;1) Connection OOo Mac team / Apple engineers&amp;#039;&amp;#039;&amp;#039; &lt;br /&gt;
&lt;br /&gt;
-Goal 1.1 : &amp;quot;Get infos, contacts, human to human conversation :-)&amp;quot;&lt;br /&gt;
&lt;br /&gt;
-&amp;gt; Present our current work, methods and team to Apple people :&lt;br /&gt;
&lt;br /&gt;
-&amp;gt; Meet them during WWDC : give us/them a face, keep contacts&lt;br /&gt;
&lt;br /&gt;
-&amp;gt; Get their impression about what we have already done and what is still ToDo&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;2) Improve from Apple&amp;#039;s engineers expertise&amp;#039;&amp;#039;&amp;#039; &lt;br /&gt;
&lt;br /&gt;
-Goal 2.1 : &amp;quot;Give MacOS X users the OOo suite they deserve&amp;quot; &lt;br /&gt;
&lt;br /&gt;
 =&amp;gt; As mac platform and apple&amp;#039;s product fans, we are proud to bring the quality and power of OOo to mac users community&lt;br /&gt;
&lt;br /&gt;
 =&amp;gt; Make OOo uses all the power of Mac OSX, including upcoming Leopard !&lt;br /&gt;
&lt;br /&gt;
-Goal 2.2 : &amp;quot;OO.org Mac port has to be as Apple HIG compliant as possible&amp;quot;&lt;br /&gt;
&lt;br /&gt;
 =&amp;gt; Define what is expected for User Interface of OpenOffice.org suite with people from Apple UI project&lt;br /&gt;
&lt;br /&gt;
 - FYI : Last year, Apple UI project proposed ericb to help us, once our native menus will be working. &lt;br /&gt;
   This is now done.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;3) Get code guidelines, tips, samples&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
-Goal 3.1 : &amp;quot;Ask for code review and find code snippets&amp;quot;&lt;br /&gt;
&lt;br /&gt;
  - HIView&lt;br /&gt;
  - Printing&lt;br /&gt;
  - Drag and Drop&lt;br /&gt;
  - as muc has possible&lt;br /&gt;
&lt;br /&gt;
=&amp;gt; More than 1000 Apple engineers are present, and can answer our questions regarding the code, during the whole week&lt;br /&gt;
&lt;br /&gt;
-Goal 3.2 : &amp;quot;Attend key Labs and Sessions to get full overview of Tiger/Leopard/Core&amp;#039;s and useful code&amp;quot;&lt;br /&gt;
&lt;br /&gt;
  - Core*&lt;br /&gt;
  - Tiger / Leopard&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;4) Social Contacts / Team emulation&amp;#039;&amp;#039;&amp;#039; &lt;br /&gt;
&lt;br /&gt;
-&amp;gt; Discuss and meet new developers and / or american people working for Mac OS X port (like Michael Sicotte, Vijay Venkatraman , other.. )&lt;br /&gt;
-&amp;gt; Share ideas, tips, conviviality !&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;5) Visibility&amp;#039;&amp;#039;&amp;#039; &lt;br /&gt;
&lt;br /&gt;
OpenOffice.org Native Mac port has to be recognized as the professionnal office suite for Mac users it is !&lt;br /&gt;
&lt;br /&gt;
=== Who ? ===&lt;br /&gt;
&lt;br /&gt;
* Sébastien Plisson&lt;br /&gt;
* Eric Bachard&lt;br /&gt;
&lt;br /&gt;
=== Todo list ===&lt;br /&gt;
&lt;br /&gt;
Please add topics, technical questions you would see asked by attendees to Apple engineers during WWDC&lt;br /&gt;
&lt;br /&gt;
====Suggestions for current issues to be fixed ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Timers : Current code is obsolete, and compatibility with Leopard won&amp;#039;t probably exist.  Pavel wrote a patch using recent code. Seems to work fine, excepted a thread issue ( crash not easy to be reproduced ) &lt;br /&gt;
&lt;br /&gt;
Salframe : &lt;br /&gt;
&lt;br /&gt;
Looot of things : &lt;br /&gt;
&lt;br /&gt;
*Find infos/code sample about parenting&lt;br /&gt;
&lt;br /&gt;
*Code review for HIFrameWork implementation &lt;br /&gt;
&lt;br /&gt;
*Menus :  every window creates it&amp;#039;s own menu. Redesign it ?&lt;br /&gt;
&lt;br /&gt;
*adapt native widget framework&lt;br /&gt;
&lt;br /&gt;
*Use XCode to build OpenOffice.org&lt;br /&gt;
&lt;br /&gt;
Events : code review, tips&lt;br /&gt;
&lt;br /&gt;
ATS : code review, ATS issues&lt;br /&gt;
&lt;br /&gt;
Mike Sicotte:  &lt;br /&gt;
I understood that implementing printing in aqua OOo was a topic that we didn&amp;#039;t get accepted into Google SOC - so remains on the ToDo list.  I notice that there are three Sessions specfically related to printing at WWDC:&lt;br /&gt;
    Leveraging the Common Unix Printing System (CUPS)&lt;br /&gt;
    Printing with Style in Mac OS X&lt;br /&gt;
    Printing Lab&lt;br /&gt;
If this is judged to be a good use of time at WWDC I would be willing to spend some time to help further develop the questions to be addressed with the Apple engineers.&lt;br /&gt;
&lt;br /&gt;
ericb-&amp;gt;Mike Sicotte&lt;br /&gt;
&lt;br /&gt;
Good idea. You are welcome :)&lt;br /&gt;
&lt;br /&gt;
==== Travel ====&lt;br /&gt;
&lt;br /&gt;
*describe the schedule of the travel&lt;br /&gt;
&lt;br /&gt;
ericb  : &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Mulhouse -&amp;gt; Paris -&amp;gt; SF :  9th of June    SF scheduled arrival : 7:13 pm&lt;br /&gt;
SF -&amp;gt; Paris -&amp;gt; Mulhouse :  16th of June ( arrival 17th )  SF departure for the return :  3:00 pm&lt;br /&gt;
&lt;br /&gt;
Hotel : King Georges ( close to Union Square )&lt;br /&gt;
&lt;br /&gt;
Airport to Hotel transportation : not included&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
sebastien (aka plipli) : &lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
Paris-&amp;gt;SF : 3rd June&lt;br /&gt;
SF-&amp;gt;Paris : 15th June in the evening&lt;br /&gt;
&lt;br /&gt;
Hotel : to be coompleted&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Misc ====&lt;br /&gt;
&lt;br /&gt;
*don&amp;#039;t forget sector adaptator for laptop : US connectors are &amp;#039;&amp;#039;&amp;#039;different&amp;#039;&amp;#039;&amp;#039; &lt;br /&gt;
&lt;br /&gt;
*don&amp;#039;t forget Cameras ( and chargers)&lt;br /&gt;
&lt;br /&gt;
*Prepare 50 to 100 business cards  :  the most simple is to use the model I can provide on demand , and print them with special paper ( pre-cut )&lt;br /&gt;
&lt;br /&gt;
== &amp;#039;&amp;#039;&amp;#039;Mac OS X porter Team at OOoCon 2007&amp;#039;&amp;#039;&amp;#039; ==&lt;br /&gt;
&lt;br /&gt;
=== Who ? ===&lt;br /&gt;
&lt;br /&gt;
* Shaun McDonald&lt;br /&gt;
* Eric Bachard&lt;br /&gt;
* (list to be completed)&lt;br /&gt;
&lt;br /&gt;
=== What ? ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
The conference is over 3 days. Presentations should last around 45 minutes. http://www.openoffice.org/servlets/ReadMsg?list=announce&amp;amp;msgNo=320 Papers have to be submitted by 1st June to be considered.&lt;br /&gt;
&lt;br /&gt;
Ideas :&lt;br /&gt;
&lt;br /&gt;
Mike Sicotte:  Perhaps the results of the Google SOC could be a presentation.&lt;br /&gt;
&lt;br /&gt;
*create a complete topic for Mac port (one stream for a day or half day)&lt;br /&gt;
*How to improve ooo usability though the use of floating palettes instead of modal dialogs&lt;br /&gt;
&lt;br /&gt;
- several presentations / BOF &lt;br /&gt;
&lt;br /&gt;
Eric Bachard : Aqua OpenOffice.org ( conf / 1 hour )&lt;br /&gt;
&lt;br /&gt;
Others ?&lt;br /&gt;
&lt;br /&gt;
*reserve rooms together ? Better rent a house? &lt;br /&gt;
&lt;br /&gt;
* [FIXME]&lt;br /&gt;
&lt;br /&gt;
==&amp;#039;&amp;#039;&amp;#039;2nd Mac porters meeting&amp;#039;&amp;#039;&amp;#039;==&lt;br /&gt;
&lt;br /&gt;
This section has been moved to [[2nd Mac porters meeting]]&lt;br /&gt;
&lt;br /&gt;
==&amp;#039;&amp;#039;&amp;#039;IRC Mac port meetings&amp;#039;&amp;#039;&amp;#039;==&lt;br /&gt;
&lt;br /&gt;
This section has been moved to [[MacOSXPortMeetings]].&lt;br /&gt;
&lt;br /&gt;
== &amp;#039;&amp;#039;&amp;#039;Mac OS X (X11) Quality Assurance&amp;#039;&amp;#039;&amp;#039;==&lt;br /&gt;
&lt;br /&gt;
This section has been moved to [[Mac OS X ( X11) Quality Assurance]]&lt;br /&gt;
&lt;br /&gt;
== &amp;#039;&amp;#039;&amp;#039;Mac OS X Implementing HIView and Carbon events&amp;#039;&amp;#039;&amp;#039;==&lt;br /&gt;
&lt;br /&gt;
This section has been moved to [[Mac OS X Implementing HIView ]]&lt;br /&gt;
&lt;br /&gt;
== &amp;#039;&amp;#039;&amp;#039;Debug OpenOffice.org using XCode &amp;#039;&amp;#039;&amp;#039;==&lt;br /&gt;
&lt;br /&gt;
[[ MacOSX Debug OpenOffice.org using XCode]]&lt;br /&gt;
&lt;br /&gt;
==&amp;#039;&amp;#039;&amp;#039;Description of the Native Port problem&amp;#039;&amp;#039;&amp;#039;==&lt;br /&gt;
&lt;br /&gt;
=== How does OpenOffice.org work on Mac OS X? ===&lt;br /&gt;
&lt;br /&gt;
Currently, on Mac OS X, OpenOffice.org uses X11, as &amp;quot;client&amp;quot;: X11 is a graphical server, coming from Unix world, and able to run under Linux, *BSD, Solaris, Mac OS X.&lt;br /&gt;
&lt;br /&gt;
 - X11 is run as an application, managed like other Apple applications.&lt;br /&gt;
 - All unix like applications are managed by X11, and from Aqua environment, only X11 is seen as only one applicatiion, &lt;br /&gt;
  even if other Unix/Linux (e.g.) applications are runing.&lt;br /&gt;
&lt;br /&gt;
OpenOffice.org asks X11 to display a window, waits for X11 acknowledgment, and OpenOffice.org displays the window. All transactions use the network, locally or not. the same mechanism is used for everything to be displayed.&lt;br /&gt;
&lt;br /&gt;
[[User:Ericb|Ericb]] 11:39, 3 June 2006 (CEST)&lt;br /&gt;
&lt;br /&gt;
=== Issues and known problems ===&lt;br /&gt;
&lt;br /&gt;
All events are managed by OpenOffice.org and X11, using the Xlib&lt;br /&gt;
&lt;br /&gt;
Only .ttf fonts type is currently available. Note: &amp;#039;&amp;#039;&amp;#039;system fonts are available &amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
The rendering is made by X11, not by Mac OS X rendering engine.&lt;br /&gt;
&lt;br /&gt;
X11 and all its clients are seen as one application only: drag and drop protocol does not work because of that (solution: Pasteboard Manager)&lt;br /&gt;
&lt;br /&gt;
==== Other links ====&lt;br /&gt;
&lt;br /&gt;
http://wiki.services.openoffice.org/wiki/List_of_OpenOffice.org_Mac_OS_X_issues_and_problems#&lt;br /&gt;
&lt;br /&gt;
http://wiki.services.openoffice.org/wiki/Printing_problems_with_OpenOffice.org_2.0_for_Mac_OS_X#Reporting_printing_problems&lt;br /&gt;
&lt;br /&gt;
[[User:Ericb|Ericb]] 11:39, 3 June 2006 (CEST)&lt;br /&gt;
&lt;br /&gt;
== What do we have to do?==&lt;br /&gt;
&lt;br /&gt;
* (in progress) : Implement direct access to Apple graphical engine, using Apple API: Quartz2D/CoreGraphics (and replacing Xlib use)&lt;br /&gt;
&lt;br /&gt;
like: instantiate, manage events and threads for a graphical instance + all needed objects, drawing: manage all drawing cases&lt;br /&gt;
&lt;br /&gt;
* (in progress) : Implement native events management, using CarbonEventManager (replacing Xlib management)&lt;br /&gt;
&lt;br /&gt;
* (in progress) : Implement native font use, using Apple Type Server and ATSUI (for Unicode Imagery) (replacing X11 management)&lt;br /&gt;
&lt;br /&gt;
Work in progress: [[Mac OS X Porting - Native Fonts]]&lt;br /&gt;
&lt;br /&gt;
* Implement native sound, using QuickTime (replacing Java Media Framework): [[Mac OS X Porting - Native Audio and Video]]&lt;br /&gt;
&lt;br /&gt;
* Implement native Drag and drop, Implementing Pasteboard Manager: [[Mac OS X Porting - Native Drag and drop]]&lt;br /&gt;
&lt;br /&gt;
* (done experimental) Implement Native Filepicker&lt;br /&gt;
&lt;br /&gt;
* Implement Native Printing: current uses cups, but native printing is mandatory: [[Mac OS X Porting - Native_Printing]]&lt;br /&gt;
&lt;br /&gt;
* Implement Apple Spellchecker&lt;br /&gt;
&lt;br /&gt;
--[[User:Plipli|Plipli]] 09:27, 25 March 2007 (CEST)&lt;br /&gt;
&lt;br /&gt;
==&amp;#039;&amp;#039;&amp;#039;Where is located the code to be modified?&amp;#039;&amp;#039;&amp;#039;==&lt;br /&gt;
&lt;br /&gt;
Most of the changes are located in vcl (Visual Class Layer), for everything graphical, events, fonts, rendering and printing.&lt;br /&gt;
&lt;br /&gt;
Other, for sound and movies will be in avmedia (where the player is implemented in OpenOffice.org sources).&lt;br /&gt;
&lt;br /&gt;
For drag and drop, dtrans is concerned (Pasteboard Manager implementation)&lt;br /&gt;
&lt;br /&gt;
[FIXME]: Filepicker? Apple Spellchecker?&lt;br /&gt;
&lt;br /&gt;
[[User:Ericb|Ericb]] 11:39, 3 June 2006 (CEST)&lt;br /&gt;
&lt;br /&gt;
==&amp;#039;&amp;#039;&amp;#039;How will the new implementation be tested?==&lt;br /&gt;
&lt;br /&gt;
Currently, all openOffice.org code can be compiled without using the Xlib. but of course, a lot of features are missing,&lt;br /&gt;
&lt;br /&gt;
and the final package simply won&amp;#039;t work&lt;br /&gt;
&lt;br /&gt;
In vcl module&amp;quot;, a &amp;#039;&amp;#039;&amp;#039;toy&amp;#039;&amp;#039;&amp;#039; called svdem is built at buildtime. This binary is linked to libvcl* and so all new stuff can be tested.&lt;br /&gt;
&lt;br /&gt;
e.g. : draw anti-aliased lines works well. &lt;br /&gt;
&lt;br /&gt;
Everything implemented in aqua vcl code will be included in libvclplug_aqua, and svdem source code will contain a specific part to proceed tests.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div class=&amp;quot;messagebox cleanup metadata&amp;quot; style=&amp;quot;border:1px solid blue;background-color:#B3FFF5;padding:7px;&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;The magic is: when all needed features will work with svdem, it will work in the new version of OpenOffice.org !!&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/div&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[FIXME]: add more complete list of features to implement and test.&lt;br /&gt;
&lt;br /&gt;
== AquaVCL 01 cws ==&lt;br /&gt;
&lt;br /&gt;
[[http://qa.openoffice.org/issues/buglist.cgi?keywords=aqua Top 10 of Aqua issues]]&lt;br /&gt;
&lt;br /&gt;
[[Aquavcl01 tasks]]&lt;br /&gt;
&lt;br /&gt;
===Changelog ===&lt;br /&gt;
&lt;br /&gt;
====Work in progresss : alpha 0.9 ====&lt;br /&gt;
&lt;br /&gt;
Important infos / WIP&lt;br /&gt;
&lt;br /&gt;
The main work in progress is about refresh not working in all situations. We isolated the cause : very probably the clipping is either missing, or buggy.&lt;br /&gt;
&lt;br /&gt;
Once fixed : pulse effect for buttons, text refresh ( blinking cursor, and bitmaps in menus will be ok.&lt;br /&gt;
&lt;br /&gt;
ericb add Aqua look for toolbars and tooltips ( 17th may )&lt;br /&gt;
&lt;br /&gt;
==== alpha 0.8 ====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;div align=&amp;quot;left&amp;quot; style=&amp;quot;color:grey; font-size:18px&amp;quot;&amp;gt;[[User:Ericb/Top10 of Issues | &amp;#039;&amp;#039;&amp;#039;Top 10 of Issues with alpha 0.8 (click me to know more) &amp;#039;&amp;#039;&amp;#039;]]&amp;lt;/div&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Christian Bernd Krippendorf joined the port ( 16th May)  &lt;br /&gt;
&lt;br /&gt;
hdu : memcpy sizeof(data) instead of sizeof(pointer) bytes  ( 16th May )&lt;br /&gt;
&lt;br /&gt;
hdu : fix ATSLayout::GetTextWidth() for multiple glyph-bound-trapezoids&lt;br /&gt;
&lt;br /&gt;
msicotte : added definition for makeCGptArray - helper for AquaSalGraphics::invert&lt;br /&gt;
&lt;br /&gt;
msicotte : added AquaSalGraphics::invert( ULONG nPoints...&lt;br /&gt;
&lt;br /&gt;
hdu : implement stretched/squeezed text&lt;br /&gt;
&lt;br /&gt;
hdu : prepare font rotation directly in ATSUI units&lt;br /&gt;
&lt;br /&gt;
hdu : simplify a little by removing dead code&lt;br /&gt;
&lt;br /&gt;
hdu : enable bold-/italic-emulation for fonts only if needed&lt;br /&gt;
&lt;br /&gt;
mikesic : #77317# - fix for wrong menu displayed when last Writer window closed&lt;br /&gt;
&lt;br /&gt;
ericb : add pulse effect (it will help to verify refresh issues are fixed) &lt;br /&gt;
&lt;br /&gt;
pl : safer yield mutex protection through guards&lt;br /&gt;
&lt;br /&gt;
hdu : default to standard font attributes&lt;br /&gt;
&lt;br /&gt;
pl : protect against dispatching to dead or dying AquaSalFrames&lt;br /&gt;
&lt;br /&gt;
ericb : #i77327# add alpha to user install dir until Aqua version is stabilized&lt;br /&gt;
&lt;br /&gt;
hdu :  rewrote ATSUFontID-based font enumeration&lt;br /&gt;
&lt;br /&gt;
mikesic : Workaround for issue 77262 - frames around selected items don&amp;#039;t disappear&lt;br /&gt;
&lt;br /&gt;
mikesic : Fix for issue 74392 - aquavcl01: tooltip crash&lt;br /&gt;
&lt;br /&gt;
mikesic : Fix for issue 77261 - Menu disappears when you hover over tooltip&lt;br /&gt;
&lt;br /&gt;
mikesic : Fix for issue 75889 - aquavcl01: Extended tooltips text truncated &lt;br /&gt;
&lt;br /&gt;
fheckl : adapting to changes since resync  (aquafilepicker01 )&lt;br /&gt;
&lt;br /&gt;
fheckl :  enabling fps_aqua lib only for aqua build&lt;br /&gt;
&lt;br /&gt;
pjanik : Reformat for easier reading (according to OOo C++ rules).&lt;br /&gt;
&lt;br /&gt;
Monday 15th May&lt;br /&gt;
&lt;br /&gt;
Changes : &lt;br /&gt;
&lt;br /&gt;
Yvan Barthelemy provided the first screenshot for printing :)&lt;br /&gt;
&lt;br /&gt;
http://wiki.services.openoffice.org/wiki/Mac_OS_X_Porting_-_Native_Printing&lt;br /&gt;
&lt;br /&gt;
http://eric.bachard.free.fr/mac/aquavcl/screenshots/printing/native_printing/native_printing_dialog.jpg&lt;br /&gt;
&lt;br /&gt;
F 73688 : use default font system  ( WIP, hdu )&lt;br /&gt;
&lt;br /&gt;
several fixes in salatsuifontutils  (hdu )&lt;br /&gt;
&lt;br /&gt;
several fixes in salframe ( pl )&lt;br /&gt;
&lt;br /&gt;
defaut user install dir is now ~/Library/Application Support/OpenOffice.org-aqua (ericb)&lt;br /&gt;
&lt;br /&gt;
added pulse effect to help for refresh&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Saturday 13th / Sunday 14th &lt;br /&gt;
&lt;br /&gt;
F 74392 : tooltip crash  (mikesic )&lt;br /&gt;
&lt;br /&gt;
( IMHO fixed with mikesic patch ) 72250 : toolbar icon click -&amp;gt; crash with aqua menus ( not fixed ? Worksforme )&lt;br /&gt;
&lt;br /&gt;
F 74392 : tooltip crash  (mikesic )&lt;br /&gt;
&lt;br /&gt;
==== alpha 0.7 ====&lt;br /&gt;
&lt;br /&gt;
Sun decided to officialy supports the Mac OS x port  ( 3rd May )&lt;br /&gt;
&lt;br /&gt;
Welcome to Philipp Lohmann and Herbert Duerr , who joined the Team  ( 3rd May )&lt;br /&gt;
&lt;br /&gt;
resync m211 ( 1st May )&lt;br /&gt;
&lt;br /&gt;
[Top 10 of issues] modify Bundle tree (issue 73693) : change committed 28th April ( ericb) &lt;br /&gt;
&lt;br /&gt;
Google SoC : welcome to Ismael Merzaq and Omer BarOr , our two selected candidates : ismael will work on aqua look ( NWF), and Omer will work on Mac OS X Address Book Integration.&lt;br /&gt;
&lt;br /&gt;
resync : m208 ( 11th April )&lt;br /&gt;
&lt;br /&gt;
(exp / not commited ) Ismael proposed a patch for Utility Windows more Aqua compliant + SetMin/MaxSize()  ( 9th April )&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Native menus are defaults (ericb)   ( 8th April ) &lt;br /&gt;
&lt;br /&gt;
Frederic Barbaise (alias boulifb) joined the port ( 3rd April )&lt;br /&gt;
&lt;br /&gt;
Work on saltimer.cxx started mikesic ( 27th March ) &lt;br /&gt;
&lt;br /&gt;
Pavel commited Michael patch for invert and drawAlphaRect()  (27th March )&lt;br /&gt;
&lt;br /&gt;
Started 27th March&lt;br /&gt;
&lt;br /&gt;
==== alpha 0.6 ====&lt;br /&gt;
&lt;br /&gt;
Damien started to work on drawEPS() &lt;br /&gt;
&lt;br /&gt;
plipli and ericb work on refresh&lt;br /&gt;
&lt;br /&gt;
Michael Sicotte proposed to investigate in timers, and continue [[http://www.openoffice.org/issues/show_bug.cgi?id=75228 Pavel&amp;#039;s work]] : objective is to replace obsolete code.  ( 23th March)&lt;br /&gt;
&lt;br /&gt;
[experimental] plipli proposed a patch for a new salframe implementation, using HIView + optionally compositing  (21th March )&lt;br /&gt;
&lt;br /&gt;
[commit scheduled] Michael Sicotte proposed a complete patch for invert() ( SAL_INVERT SAL_INVERT_50 and SAL_INVERT_TRACKFRAME )  (20th March )&lt;br /&gt;
&lt;br /&gt;
Tino proposed to work on code cleanup in salatsuifontutils.cxx, removing obsolete code &lt;br /&gt;
&lt;br /&gt;
ismael and michael work on invert() + drawAlphaRect() &lt;br /&gt;
&lt;br /&gt;
Started (19th March ) :&lt;br /&gt;
&lt;br /&gt;
==== alpha 0.5====&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Top 10 Summary :  7 issues over 10 are fixed or very close to be : &lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;time to code review, tracing, and search for memory leaks&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[done] Unicode input in salframe ( ekato ) ( 19th March )&lt;br /&gt;
&lt;br /&gt;
[experimental, works partially] beginning of HIView + HIComboxes works (text still missing)  (ericb + plipli)  ( 14th March ) &lt;br /&gt;
&lt;br /&gt;
[done] replace NewRgn() in salframe (ericb (11th March )&lt;br /&gt;
&lt;br /&gt;
[experimental, but very interesting] Improved native windows ( ismael ) ( 7th March )&lt;br /&gt;
&lt;br /&gt;
====alpha 0.4==== &lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;[Informative]&amp;#039;&amp;#039;&amp;#039; build runs with Leopard 9A377a ( fheckl ) ( 7th March ) &lt;br /&gt;
&lt;br /&gt;
Refresh screen issues  (plipli) (4th to 10th March )&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;[informative]&amp;#039;&amp;#039;&amp;#039;  plipli announced  progress with refresh screen issues  ( 28th February )&lt;br /&gt;
&lt;br /&gt;
[experimental, not yet commited] Proxy configuration from system ( pjanik)  ( 28th February )&lt;br /&gt;
&lt;br /&gt;
[done] highlighted native button ( pjanik)  ( 27th February ) &lt;br /&gt;
&lt;br /&gt;
Native File Picker works ( fheckl  / pjanik )  ( 23th February  )&lt;br /&gt;
&lt;br /&gt;
====alpha 0.3====&lt;br /&gt;
&lt;br /&gt;
Cursor does appear -&amp;gt; invert() + setting a setBlinkTime value in UpdateSettings()  (pjanik /ericb ) &lt;br /&gt;
&lt;br /&gt;
[done] mirroring negative images (ismael) + DrawAlphaBitmap() + CreateWithMask()&lt;br /&gt;
&lt;br /&gt;
pjanik patch for Focus Events &lt;br /&gt;
&lt;br /&gt;
[done] scrolling works ( pjanik ) (17th February )&lt;br /&gt;
&lt;br /&gt;
[done ] carret works ( plipli) (17th February )&lt;br /&gt;
&lt;br /&gt;
[done] checkbuttons fix for checkmarks  (ericb) ( 17th February )&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;[Informative]&amp;#039;&amp;#039;&amp;#039; Pavel Janik propose to solve offScreen buffer using HIView ( 17th February ) &lt;br /&gt;
&lt;br /&gt;
[experimental, never commited] patch for macosxrc.txt use + UpdateSettings() use in salframe.cxx ( ericb ( 16th February )&lt;br /&gt;
&lt;br /&gt;
Michael Sicotte joined the Team ( 15th February )&lt;br /&gt;
&lt;br /&gt;
invert() : first try  (ericb)   ( 13th february )&lt;br /&gt;
&lt;br /&gt;
====alpha 0.2====&lt;br /&gt;
&lt;br /&gt;
[12th February 2007 ]&lt;br /&gt;
&lt;br /&gt;
[done] calc does not start : bug identified by tino , first workaround (ericb)   [[http://www.openoffice.org/issues/show_bug.cgi?id=73691 issue 73691]]&lt;br /&gt;
&lt;br /&gt;
[done] bitmaps in native popup menus (ismael)  &lt;br /&gt;
&lt;br /&gt;
[done]  replace obsolete code for HandleWindowPaintEvent(), newRgn() .. etc  (ericb)  (12th February)&lt;br /&gt;
&lt;br /&gt;
correct salatslayout patch (plipli)  ( 11th February)&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;[Informative]&amp;#039;&amp;#039;&amp;#039;  Michel Renon proposed a summary about his work on fonts issues&lt;br /&gt;
&lt;br /&gt;
[patch] Pavel fixed several menu crashes (09th February )&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;[Informative]&amp;#039;&amp;#039;&amp;#039; : Pavel posted a mail about several crashes origin &lt;br /&gt;
 &lt;br /&gt;
patch for radioboxes and checkboxes ( ericb ) (9th February)&lt;br /&gt;
&lt;br /&gt;
first complete patch for salatslayout.cxx ( plipli) ( 9th February )&lt;br /&gt;
&lt;br /&gt;
[done] most important crashes fixed ( pjanik)  ( 09th february )&lt;br /&gt;
&lt;br /&gt;
Modified baseline for 2.2. : Mac OS X10.4 -&amp;gt; Aqua will be 10.4 and 10.5 compatible only ( ericb)&lt;br /&gt;
&lt;br /&gt;
first try with multi line sallayout (plipli )  ( 08th February )&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Damien Duportal joined the Team ( 7th February ) &lt;br /&gt;
&lt;br /&gt;
[done] scrollbar changes (ericb )   ( 4th February )&lt;br /&gt;
&lt;br /&gt;
====alpha 0.1====&lt;br /&gt;
&lt;br /&gt;
create Top 10 of issues before alpha  3rd February 2007 :  See : [[http://porting.openoffice.org/mac/news/2007/20070203toptenbeforealpha.html Top 10 of issues]]&lt;br /&gt;
&lt;br /&gt;
[experimental, not commited] patch for TPT() implementation (ericb)  ( 2nd February 2007 )&lt;br /&gt;
&lt;br /&gt;
Pavel Janik proposed to implement TransformProcessType() ( 2nd February 2007 )&lt;br /&gt;
&lt;br /&gt;
[not commited] implement UpdateSettings()   (ericb)  &lt;br /&gt;
&lt;br /&gt;
Pavel Janik resynchronized aquavel01 cws  with m202  ( 2nd February 2007 )&lt;br /&gt;
&lt;br /&gt;
====alpha 0.03====&lt;br /&gt;
&lt;br /&gt;
Michel Renon joined the Team (1st February )&lt;br /&gt;
&lt;br /&gt;
[done] fix checkbuttons and radiobuttons issues: offsets, redrawing of the check marks ( ericb) &lt;br /&gt;
&lt;br /&gt;
[done] fix scrollbar buttons (implement correct methods to retrieve dimensions)&lt;br /&gt;
&lt;br /&gt;
[done] implement mapfiles for Mac OS X (Stephan Bergmann, Daniel Boelzle, Tino Rachui , Pavel Janik)&lt;br /&gt;
&lt;br /&gt;
====alpha 0.02====&lt;br /&gt;
&lt;br /&gt;
[done] modify libsalsystools.dylib to be correctly loaded with the bundle  (ericb, + pjanik)&lt;br /&gt;
&lt;br /&gt;
[done] add mouse drag events  ( pjanik )&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
====alpha 0.01====&lt;br /&gt;
&lt;br /&gt;
[done] add new feature for Aqua windows, to allow QuickTime player use( mox )&lt;br /&gt;
&lt;br /&gt;
[done] replace obsolete code in salframe.cxx with (ericb)&lt;br /&gt;
&lt;br /&gt;
[done] fix correct size for main window (GetOptimaWindowSize()  ) (ericb)&lt;br /&gt;
&lt;br /&gt;
[done] fix alpha channel in pixmaps (ismael)&lt;br /&gt;
&lt;br /&gt;
====alpha 0.0====&lt;br /&gt;
&lt;br /&gt;
[done] pushbutton where not correctly drawn (ericb)&lt;br /&gt;
&lt;br /&gt;
[done] fix missing mouse events  (pjanik)&lt;br /&gt;
&lt;br /&gt;
[done] fix nRepeat in text entry  (ssa)&lt;br /&gt;
&lt;br /&gt;
2nd Mac porters Meeting&lt;br /&gt;
&lt;br /&gt;
===Work in progress ===&lt;br /&gt;
&lt;br /&gt;
URGENT :&lt;br /&gt;
&lt;br /&gt;
Top of issues causing crashes : event issue when tips is enabled causes crashes ( well known window / handler  / window desctructor / event loop bug )&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Salatsuifontutils :  replace old code, track leaks : tino&lt;br /&gt;
&lt;br /&gt;
[done] Bitmaps : ( isma87) &lt;br /&gt;
&lt;br /&gt;
[running]  Crashes : (tino, pjanik, ericb, isma87, plipli )&lt;br /&gt;
&lt;br /&gt;
[???] Drag and drop :   (vijay)&lt;br /&gt;
&lt;br /&gt;
[???] Printing   (ybart)  &lt;br /&gt;
&lt;br /&gt;
Florian Heckl proposed a subject for Google Summer of Code about native printing&lt;br /&gt;
&lt;br /&gt;
Drawing/ windowing ( plipli / ericb ) -&amp;gt; mainly refresh &lt;br /&gt;
&lt;br /&gt;
[done] Implement cursor &lt;br /&gt;
&lt;br /&gt;
[started] Native Controls   (ericb) &lt;br /&gt;
&lt;br /&gt;
[work in progress] partial multiline sallayout  (plipli )&lt;br /&gt;
&lt;br /&gt;
To do : &lt;br /&gt;
&lt;br /&gt;
(started, Oliver) - modify the tree to make the bundle start without hack ( issue fixed during buildtime) &lt;br /&gt;
&lt;br /&gt;
(started, Florian Heckl)  verify Native FilePicker implementation ( works , tested in Hamburg  )&lt;br /&gt;
&lt;br /&gt;
[done] Ismael Merzaq)  implement blit functions in salgdi  ( important fix:  probably apha version to be tested once done) &lt;br /&gt;
&lt;br /&gt;
[done] Sebastien Plisson- update the missing functions list ( fonts ... ask hdu &amp;amp; cl&lt;br /&gt;
&lt;br /&gt;
[started] ericb, Mox Soini, Sebastien Plisson, Tino Rachui, Pavel janik continue to replace obsolete code&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
fix crashes with menus  (started : tino )&lt;br /&gt;
&lt;br /&gt;
== &amp;#039;&amp;#039;&amp;#039;Sort of documentation about VCL around Native Mac OS X port&amp;#039;&amp;#039;&amp;#039; ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Do we really need to understand how it works? ;-)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
vcl content:&lt;br /&gt;
&lt;br /&gt;
ls -laR | wc -l&lt;br /&gt;
  1750&lt;br /&gt;
&lt;br /&gt;
-&amp;gt; Uff 1750 files to analyse :-/&lt;br /&gt;
&lt;br /&gt;
Our purpose is to describe the vcl organisation. The content of vcl is so important, that at the begining, the content will looks a bit confused. e.g. class names ..etc have nothing to do, only description with words and sense, but this will need some time before we can understand everything.&lt;br /&gt;
&lt;br /&gt;
How analyse with more efficiency? After some months to anlalyse &amp;#039;&amp;#039;&amp;#039;&amp;quot;horizontaly&amp;quot;&amp;#039;&amp;#039;&amp;#039;, it appears that list all the content of a directory is not the solution. Of course, we learned a lot, but we now have to complete with &amp;#039;&amp;#039;&amp;#039;&amp;quot;orthogonal&amp;quot;&amp;#039;&amp;#039;&amp;#039; method (compared to the previous one). The first method wasn&amp;#039;t obviously not the good/best way to describe vcl.&lt;br /&gt;
 &lt;br /&gt;
[FIXME] a different approach (will ask confirmation to Philipp Lohman), could be a description of how it work in runtime. First define what an instance is, a frame, and what exactly is concerned by such &amp;quot;objects&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
With that, we can write a list of different objects all using the same scheme: empty boxes (means pure virtual methods and classes in generic libvvcl), really implemented in the specific part, and finally, the API &amp;quot;encapsulated&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
The most difficult is to see where the API is used. But for all the parts, this is the same.&lt;br /&gt;
&lt;br /&gt;
Finally, &amp;#039;&amp;#039;&amp;#039;what is important is the design of vcl&amp;#039;&amp;#039;&amp;#039;. Which &amp;#039;&amp;#039;&amp;#039;patterns&amp;#039;&amp;#039;&amp;#039; are used? What are the dependencies, how works the stack for the events, how works the scheduler, the timers too is very important, even fundamental for Aqua implementation. Will have a look at gsl mailing list, and other resources. Probably everything is already (randomly) written somewhere.&lt;br /&gt;
&lt;br /&gt;
=== VCL organisation ===&lt;br /&gt;
&lt;br /&gt;
Thank&amp;#039;s to Philipp Lohmann for this short, but precise description:&lt;br /&gt;
&lt;br /&gt;
Basically vcl is divided in the system dependent and the system independent part. The interface between these two is mostly the Sal interface (every interface name Sal*: SalInstance, SalFrame, SalGraphics, SalPrinter, etc.).&lt;br /&gt;
&lt;br /&gt;
SalInstance is a factory that can create all the other abstracted interfaces of the system dependent part. It also provides the main loop SalInstance::Yield()&lt;br /&gt;
&lt;br /&gt;
SalFrame abstracts any kind of system window.&lt;br /&gt;
&lt;br /&gt;
SalVirtualDevice abstracts an offscreen window (e.g. a Pixmap on X11)&lt;br /&gt;
&lt;br /&gt;
SalPrinter and SalInfoPrinter abstract the system print queues where SalInfoPrinter is for querying and SalPrinter for actual printing.&lt;br /&gt;
&lt;br /&gt;
SalGraphics is an interface produced by either SalFrame, SalVirtualDevice or SalPrinter which is used for actual drawing operations (text, bitmaps, vector graphics)&lt;br /&gt;
&lt;br /&gt;
SalSound is for sound playing.&lt;br /&gt;
&lt;br /&gt;
SalBitmap provides memory for bitmap graphics as well as methods converting this memory to a system handle (e.g. a Pixmap on X11).&lt;br /&gt;
&lt;br /&gt;
SalOpenGL provides OpenGL functionality if available.&lt;br /&gt;
&lt;br /&gt;
SalTimer is an interface for periodically triggering the event queue (to timer implementation).&lt;br /&gt;
&lt;br /&gt;
SalI18NImeStatus handles how the status window of an Input Method Editor (IME) should display (this is mainly X11 specific).&lt;br /&gt;
&lt;br /&gt;
SalSystem has some system specific methods that did not belong anywhere else:-)&lt;br /&gt;
&lt;br /&gt;
Of all these there interfaces is at least one implementation per system (Windows, X11 or Mac). The Unix implementation also has a plugin concept to allow for integration of different native toolkits (currently gtk and Qt) which became necessary for the implementation of Native Widget Framework (NWF) to display controls like their normal desktop counterparts.&lt;br /&gt;
&lt;br /&gt;
Basically the independent part (what is beneath vcl/source directory) has generic methods for drawing, window handling and stuff which it brings into a suitable form and then delegates to the system specific implementation (located beneath vcl/win for Windows and vcl/unx for the X11 platforms).&lt;br /&gt;
&lt;br /&gt;
[[User:Ericb|Ericb]] 16:12, 1 July 2006 (CEST)&lt;br /&gt;
&lt;br /&gt;
===Sub-directories description ===&lt;br /&gt;
&lt;br /&gt;
==== &amp;#039;&amp;#039;&amp;#039;Organisation of vcl directories&amp;#039;&amp;#039;&amp;#039; ====&lt;br /&gt;
&lt;br /&gt;
[[Image:aquavcl_organisation_complete_02.jpg]]&lt;br /&gt;
&lt;br /&gt;
==== &amp;#039;&amp;#039;&amp;#039;Directories in vcl. Short description&amp;#039;&amp;#039;&amp;#039; ====&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039; aqua &amp;#039;&amp;#039;&amp;#039;: The name Aqua means Apple look and feel, and is well known as [http://developer.apple.com/documentation/UserExperience/Conceptual/OSXHIGuidelines/XHIGIntro/chapter_1_section_1.html Aqua Human Interface Guidelines]. This look and feel means Mac OS X. The work was begun by (probably) P. luby, Dan Williams Herbert Duerr (most of fonts stuff) and Ed Peterlin. Currently in ruin, this directory does contain a lot of ideas to investigate. The most important part of needed changes for native version (3.0) will be done inside aqua dir inc: does contain all vcl relative includes [PART1]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039; prj &amp;#039;&amp;#039;&amp;#039;: Does contain build.lst and d.lst build.lst give us dependencies: probably a lot for vcl, build 98th module over ~148. Everything graphical depends in vcl. &lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039; qa &amp;#039;&amp;#039;&amp;#039; does contain all quality assurancy stuff&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;source&amp;#039;&amp;#039;&amp;#039;: the most important:-) This directory contains common sources for all architectures and OS. Mainly: Windows, Unix: Linux , Mac OS X (X11), Solaris, including generic, kde and gtk plugins, and Aqua (Mac OS X without X11, work currently in progress). &lt;br /&gt;
&lt;br /&gt;
Depending on the OS and the architecture, binaries are built or not.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039; test &amp;#039;&amp;#039;&amp;#039;: This directory does contain all the needed stuff for tests. As example, in qa/testdocuments, you&amp;#039;ll find three documents (one writer, one calc and one impress) for tests purpose. &lt;br /&gt;
Other available tests are about memcheck and persistent window state. &lt;br /&gt;
 &lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039; unx &amp;#039;&amp;#039;&amp;#039;: this directory does contain all unixes stuff. We have to understand what is inside to implement aqua port. For example, a lot of classes/strutures and objects use Xlib calls we have to replace with Carbon/Cocoa call (at least at first time) for Mac OS X native port.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039; win &amp;#039;&amp;#039;&amp;#039;: Doing Mac OS X native port, I first believed this directory was not interesting for us, but I was wrong: OpenOffice.org roots are inside this directory, and a lot of comments and resources are inside. Mainly interesting if Carbon is used.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;workben&amp;#039;&amp;#039;&amp;#039;: Does contain a toy called &amp;quot;svdem&amp;quot;. svdem is a binary, used for new implementations. For example, actual aqua development uses svdem intensively, to verify all important properties we need: &lt;br /&gt;
&lt;br /&gt;
- display a window first (al least ...:)) &lt;br /&gt;
&lt;br /&gt;
- close cleanly this window&lt;br /&gt;
&lt;br /&gt;
- display a point&lt;br /&gt;
&lt;br /&gt;
- trace a line&lt;br /&gt;
&lt;br /&gt;
- trace an area &lt;br /&gt;
&lt;br /&gt;
- superpose two areas doing some important graphical operations, (like xor),&lt;br /&gt;
&lt;br /&gt;
- display a character&lt;br /&gt;
&lt;br /&gt;
- display a menu. &lt;br /&gt;
&lt;br /&gt;
- intercept events correctly.&lt;br /&gt;
&lt;br /&gt;
[FIXME] add more tests&lt;br /&gt;
&lt;br /&gt;
[[User:Ericb|Ericb]] 13:21, 3 June 2006 (CEST)&lt;br /&gt;
&lt;br /&gt;
==&amp;#039;&amp;#039;&amp;#039;Naming convention&amp;#039;&amp;#039;&amp;#039; ==&lt;br /&gt;
&lt;br /&gt;
* Class names start with upper case letters, to improve readability.&lt;br /&gt;
&lt;br /&gt;
* Implemented Class names are derived from the virtual classes but can of course take arbitrary names.&lt;br /&gt;
To increase readability, it&amp;#039;s recommended to closely follow the base class name.&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Impl prefix: means Implementation details&amp;#039;&amp;#039;&amp;#039;. The concerned class or method or function is not used outside of this module, so no external code (or other libraries) can see it.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;[[ Events types using Carbon API (Mac OS X): ]]&amp;#039;&amp;#039;&amp;#039; A lot of events have to be managed in runtime. Here is a short description&lt;br /&gt;
&lt;br /&gt;
- do not freeze because bad event loops&lt;br /&gt;
&lt;br /&gt;
- event types implementation: currently, they are defined in vcl/aqua/inc/aquavclevents.hxx&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Apart: exact sense of hedabu? -&amp;gt; [FIXME] as far as I understood it: it is like &amp;quot;copy&amp;quot; to deliver software into the solver, with extra magic. The header files for example are manipulated so paths need not be exact. &amp;quot;headabu&amp;quot; is supposed to disappear little by little.&lt;br /&gt;
&lt;br /&gt;
== &amp;#039;&amp;#039;&amp;#039;What do we have to build in vcl?&amp;#039;&amp;#039;&amp;#039;==&lt;br /&gt;
&lt;br /&gt;
Two libraries, corresponding ressources (localized) and a toy so called « svdem »&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Common part&amp;#039;&amp;#039;&amp;#039;: &lt;br /&gt;
&lt;br /&gt;
in grey on right. The result will be a non architecture dependant library, built in all cases: for instance, libvcl680mxi.dylib on Mac Intel.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Specific part  &amp;quot; a plugin &amp;quot; &amp;#039;&amp;#039;&amp;#039;: &lt;br /&gt;
&lt;br /&gt;
Light yellow: aqua part will only concern Mac OS X (non X11) the name will probably be libvcl_aqua680mxi.dylib &lt;br /&gt;
&lt;br /&gt;
As you can see, win means windows part, in blue&lt;br /&gt;
&lt;br /&gt;
For Unix build (Linux, Solaris or current Mac OS X X11), in purple.&lt;br /&gt;
&lt;br /&gt;
Result will be:&lt;br /&gt;
&lt;br /&gt;
libvclplug_PLUGIN680mxi.DLLSUFFIX , where PLUGIN can be iether gen (generic) or gtk (using gtk+) or kde (using qt), and DLLSUFFIX can be either .so (linux) or .dylib (Mac OS X) ...etc (I&amp;#039;m not sure for other cases).&lt;br /&gt;
&lt;br /&gt;
Example: libvcl680mxi.dylib and libvclplug_aqua680mxi.dylib&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;In runtime&amp;#039;&amp;#039;&amp;#039;, libvclplug_aqua will be linked to libvcl680. the first one will contain the real implementation (respecting the API, e.g. Carbon) while the generic libvcl will only contain pure virtual methods ...etc like &amp;quot;empty boxes&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
=== Current Aqua content ===&lt;br /&gt;
&lt;br /&gt;
A more complete description of aqua (Mac OS X / no X11 specific): [[Image:Vcl_aqua_organisation_02_tree.jpg]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==EXISTING objects to build in aqua==&lt;br /&gt;
&lt;br /&gt;
===Sal APP &amp;quot;everything application&amp;quot;===&lt;br /&gt;
&lt;br /&gt;
[FIXME] add all objects descriptions&lt;br /&gt;
&lt;br /&gt;
==== saldata ====&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Defined in plugin exclusively&amp;#039;&amp;#039;&amp;#039; (i.e. for headers)&lt;br /&gt;
&lt;br /&gt;
Unix: unx/source/app/saldata.cxx (header in unx/inc)&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Aqua: aqua/source/app/saldata.cxx (header in win/inc)&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Windows: win/source/app/saldata.cxx (header in aqua/inc)&lt;br /&gt;
&lt;br /&gt;
* Role: saldata contains various kind of data used by the implementation for the concerned platform. &amp;#039;&amp;#039;&amp;#039;It is a bunch of global data collections reserved for the platform&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
It is just completely platform dependent, and nobody except this plugin can see it.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Saldata is something like a &amp;quot;second sal&amp;quot;, but providing an abstraction regarding windowing and graphics&amp;#039;&amp;#039;&amp;#039;, while SAL module provides an abstraction more Operating System oriented) &lt;br /&gt;
&lt;br /&gt;
e.g. : have a look at XRequest array in vcl/unx/source/app/saldata.cxx =&amp;gt; all calls are for Xlib (X11).  Ok, useless there, but interesting:-)&lt;br /&gt;
&lt;br /&gt;
[FIXME]: use Windows implementation could be a good starting point. Nothing is the same, but the current aquavcl cws uses similar objects, and it works very correctly.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
saldatax.cxx uses classes SalInstance, SalObject, SalFrame, SalVirtualDevice, SalPrinter and fontList.&lt;br /&gt;
&lt;br /&gt;
Current list of possible objects who can be instantiated/released:&lt;br /&gt;
&lt;br /&gt;
structure SalData: does contain pointers on all kind of objects from other classes used in saldata.&lt;br /&gt;
&lt;br /&gt;
inline functions: [FIXME]: complete the description&lt;br /&gt;
&lt;br /&gt;
- SetSalData:&lt;br /&gt;
- GetSalData:&lt;br /&gt;
- GetAppSalData:&lt;br /&gt;
&lt;br /&gt;
==== salinst ====&lt;br /&gt;
&lt;br /&gt;
=&amp;gt; implemented in vcl/aqua/source/app/salinst.cxx&lt;br /&gt;
&lt;br /&gt;
Role: &lt;br /&gt;
&lt;br /&gt;
* get environment, mutexes, instantiate AquaSalInstance (Ctor, Dtor),&lt;br /&gt;
&lt;br /&gt;
* instantiates/releases a lot of other objects using Get() / CreateObject() / DestroyObject() methods.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Current list of possible objects who can be instantiated/released:&lt;br /&gt;
&lt;br /&gt;
 * VirtualDevice [FIXME]: exact role?&lt;br /&gt;
&lt;br /&gt;
 *Printer  &lt;br /&gt;
&lt;br /&gt;
- GetDefaultPrinter/ CreatePrinter() / DestroyPrinter - what a name ;-) -&lt;br /&gt;
&lt;br /&gt;
- InfoPrinter (Get/Create/Delete)&lt;br /&gt;
&lt;br /&gt;
- PrinterQueue (DeletePrinterQueueInfo / GetPrinterQueueInfo / GetPrinterQueueState)&lt;br /&gt;
&lt;br /&gt;
 * System (Create / Delete) [FIXME]: what means system here?&lt;br /&gt;
&lt;br /&gt;
 * Events: &lt;br /&gt;
&lt;br /&gt;
AquaSalInstance::SetEventCallback()&lt;br /&gt;
&lt;br /&gt;
AquaSalInstance::SetErrorEvenCallback()&lt;br /&gt;
&lt;br /&gt;
AquaSalInstance::GetConnectionIdentifier()&lt;br /&gt;
&lt;br /&gt;
 * Menu / MenuItem: &lt;br /&gt;
&lt;br /&gt;
AquaSalInstance::CreateMenu() / same for DestroyMenu()&lt;br /&gt;
&lt;br /&gt;
AquaSalInstance::CreateMenuItem / same DestroyMenuItem()&lt;br /&gt;
&lt;br /&gt;
 * Sound: &lt;br /&gt;
&lt;br /&gt;
AquaSalInstance::CreateSalSound()  =&amp;gt; object to a pointer of SalSound type&lt;br /&gt;
&lt;br /&gt;
Note: AquaSalInstance::DestroySalSound is not implemented (?)&lt;br /&gt;
&lt;br /&gt;
 * Timer: CreateTimer() /&lt;br /&gt;
&lt;br /&gt;
AquaSalInstance:: DestroyTimer() is not yet implemented (?)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Class MacImeStatus: inherits of SalI18NImeStatus&lt;br /&gt;
&lt;br /&gt;
-&amp;gt; only there to see if there is a window to toggle into menubar [FIXME]??&lt;br /&gt;
&lt;br /&gt;
AquaSalInstance::CreateI18NImeStatus(): instantiates MacImeStatus&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;For futher informations, see: &amp;#039;&amp;#039;&amp;#039; &amp;#039;&amp;#039;&amp;#039;[[Content of salinst.cxx]]&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
([[User:Ericb|Ericb]] 16:11, 20 May 2006 (CEST) )&lt;br /&gt;
&lt;br /&gt;
==== salmain ====&lt;br /&gt;
&lt;br /&gt;
Role: if possible, runs the standard vcl application code SVMain()&lt;br /&gt;
&lt;br /&gt;
([[User:Ericb|Ericb]] 16:15, 20 May 2006 (CEST))&lt;br /&gt;
&lt;br /&gt;
==== salsound ====&lt;br /&gt;
&lt;br /&gt;
==== salsys ====&lt;br /&gt;
&lt;br /&gt;
==== saltimer ====&lt;br /&gt;
&lt;br /&gt;
==== saltimer ====&lt;br /&gt;
&lt;br /&gt;
The main problem with SalTimer is the code we use is obsolete. To remove this deprecated code, sevarl work have been tried &lt;br /&gt;
&lt;br /&gt;
1) Pavel Janik, in issue 75228 &lt;br /&gt;
&lt;br /&gt;
works, but a serious problem is remaining (a thread issue, nothing anybody explained yet) &lt;br /&gt;
&lt;br /&gt;
2) eric bacahrd ( code will be attached soon )&lt;br /&gt;
&lt;br /&gt;
3) Michael Sicotte, who proposed to work on that, and continue Pavel implementation.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
SalTimer description&lt;br /&gt;
&lt;br /&gt;
AquaSalTimerproc&lt;br /&gt;
&lt;br /&gt;
AquaSalTimer::Start()&lt;br /&gt;
&lt;br /&gt;
AquaSalTimer::Stop()&lt;br /&gt;
&lt;br /&gt;
AquaSalTimer::Restart()&lt;br /&gt;
&lt;br /&gt;
AquaSalTimer::Installtask()   // yet needed ?&lt;br /&gt;
&lt;br /&gt;
=== Sal GDI (everything Graphical Display Interface) ===&lt;br /&gt;
&lt;br /&gt;
====salgdinativewidgets====&lt;br /&gt;
&lt;br /&gt;
[[native controls]]&lt;br /&gt;
&lt;br /&gt;
==== salatslayout ====&lt;br /&gt;
&lt;br /&gt;
==&amp;gt; implemented in vcl/aqua/source/gdi/salatslayout.cxx&lt;br /&gt;
&lt;br /&gt;
- Handle text layouting :&lt;br /&gt;
&lt;br /&gt;
    * Use ATSUI (ATSUCreateTextLayoutFromPtr) to layout the text unicode char buffer&lt;br /&gt;
    * Use ATSUI (ATSU..) to get informations about glyphs&lt;br /&gt;
    * Populate different arrays (mpGlyph2Chars, mpChars2Glyph, mpCharsWidths, mpGlyphAdvances)&lt;br /&gt;
      that are used in various methods.&lt;br /&gt;
&lt;br /&gt;
==== salatsuiutils ====&lt;br /&gt;
&lt;br /&gt;
==== salfontutils ====&lt;br /&gt;
&lt;br /&gt;
==== salmathutils ====&lt;br /&gt;
&lt;br /&gt;
==== sal bmp ====&lt;br /&gt;
&lt;br /&gt;
==== salvd ====&lt;br /&gt;
&lt;br /&gt;
==== salpixmaputils====&lt;br /&gt;
&lt;br /&gt;
==== salprn ====&lt;br /&gt;
&lt;br /&gt;
====salrectangle====&lt;br /&gt;
&lt;br /&gt;
==== salvd ====&lt;br /&gt;
&lt;br /&gt;
=== Sal Window===&lt;br /&gt;
&lt;br /&gt;
==== salframe ====&lt;br /&gt;
Documentation in progress, from damiend :&lt;br /&gt;
[[User:Damiend|Damiend page]]&lt;br /&gt;
&lt;br /&gt;
====salobj====&lt;br /&gt;
&lt;br /&gt;
== TO BE IMPLEMENTED (missing in Aqua)==&lt;br /&gt;
&lt;br /&gt;
===Audio===&lt;br /&gt;
&lt;br /&gt;
====audioconvert====&lt;br /&gt;
 (obsolete?) &lt;br /&gt;
&lt;br /&gt;
====devaudio====&lt;br /&gt;
(obsolete?)&lt;br /&gt;
&lt;br /&gt;
====native sound====&lt;br /&gt;
&lt;br /&gt;
====salimpsound====&lt;br /&gt;
&lt;br /&gt;
====vsound====&lt;br /&gt;
&lt;br /&gt;
===i18n===&lt;br /&gt;
&lt;br /&gt;
===keysymnames===&lt;br /&gt;
&lt;br /&gt;
===saldisp===&lt;br /&gt;
&lt;br /&gt;
===sm===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[FIXME]: is session manager usefull?&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==&amp;#039;&amp;#039;&amp;#039;Native Controls&amp;#039;&amp;#039;&amp;#039;==&lt;br /&gt;
&lt;br /&gt;
====Scrollbar====&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Works as expected&amp;#039;&amp;#039;&amp;#039;. The most important work is done&lt;br /&gt;
&lt;br /&gt;
See : [[Mac_OS_X_Porting_-_Native_Controls#ScrollBar]]&lt;br /&gt;
&lt;br /&gt;
====DrawThemeButton() documentation====&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Started&amp;#039;&amp;#039;&amp;#039; &lt;br /&gt;
&lt;br /&gt;
See : [[Mac_OS_X_Porting_-_Native_Controls#ComboBox]]&lt;br /&gt;
&lt;br /&gt;
Started&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
DrawThemeButton&lt;br /&gt;
Draws a button.&lt;br /&gt;
&lt;br /&gt;
OSStatus DrawThemeButton (&lt;br /&gt;
   const Rect * inBounds,&lt;br /&gt;
   ThemeButtonKind inKind,&lt;br /&gt;
   const ThemeButtonDrawInfo * inNewInfo,&lt;br /&gt;
   const ThemeButtonDrawInfo * inPrevInfo,&lt;br /&gt;
   ThemeEraseUPP inEraseProc,&lt;br /&gt;
   ThemeButtonDrawUPP inLabelProc,&lt;br /&gt;
   UInt32 inUserData&lt;br /&gt;
);&lt;br /&gt;
Parameters&lt;br /&gt;
inBounds&lt;br /&gt;
A pointer to a structure of type Rect. Pass a rectangle specifying the boundary of the button, in local coordinates.&lt;br /&gt;
&lt;br /&gt;
inKind&lt;br /&gt;
A value of type ThemeButtonKind. Pass a constant specifying the type of button to draw. &lt;br /&gt;
See “Theme Buttons” for descriptions of possible values.&lt;br /&gt;
&lt;br /&gt;
inNewInfo&lt;br /&gt;
A pointer to a structure of type ThemeButtonDrawInfo. Before calling DrawThemeButton, &lt;br /&gt;
set the structure to contain the new state, value, and adornment for the button. &lt;br /&gt;
DrawThemeButton uses the information passed in the inNewInfo and inPrevInfo parameters&lt;br /&gt;
to apply transitional animation or sound effects as the button state changes, if such are &lt;br /&gt;
specified under the current theme.&lt;br /&gt;
&lt;br /&gt;
inPrevInfo&lt;br /&gt;
A pointer to a structure of type ThemeButtonDrawInfo. If the button state is changing,&lt;br /&gt;
set the structure to contain the previous state, value, and adornment for the button, &lt;br /&gt;
to allow DrawThemeButton to apply any transitional effects. If the button state is not &lt;br /&gt;
changing, you can pass NULL.&lt;br /&gt;
&lt;br /&gt;
inEraseProc&lt;br /&gt;
A value of type ThemeEraseUPP. If you have a custom background, use this parameter to pass&lt;br /&gt;
a universal function pointer to an application-defined function such as that described in &lt;br /&gt;
ThemeEraseProcPtr. DrawThemeButton calls this function to erase the background before drawing&lt;br /&gt;
 the button. If you pass NULL, DrawThemeButton&amp;#039;s default behavior is to erase the background&lt;br /&gt;
 for you.&lt;br /&gt;
&lt;br /&gt;
inLabelProc&lt;br /&gt;
A value of type ThemeButtonDrawUPP. If you pass a universal function pointer to an &lt;br /&gt;
application-defined function such as that described in ThemeButtonDrawProcPtr, DrawThemeButton&lt;br /&gt;
 calls that function to draw the label of the button. If you pass NULL, no label is drawn.&lt;br /&gt;
&lt;br /&gt;
inUserData&lt;br /&gt;
An unsigned 32-bit integer. Provide any data to be passed in to the callback functions specified in &lt;br /&gt;
the inLabelProc and inEraseProc parameters. Pass NULL if you do not wish to provide any data.&lt;br /&gt;
&lt;br /&gt;
Return Value&lt;br /&gt;
A result code. See “Appearance Manager Result Codes”.&lt;br /&gt;
&lt;br /&gt;
Discussion&lt;br /&gt;
The DrawThemeButton function draws a theme-compliant button. If a ThemeEraseProcPtr is &lt;br /&gt;
specified in the inEraseProc parameter, DrawThemeButton uses that function to erase the &lt;br /&gt;
background of the button before drawing the button. After the button is drawn, if a&lt;br /&gt;
ThemeButtonDrawProcPtr is specified in the inLabelProc parameter, DrawThemeButton calls&lt;br /&gt;
that function to draw the button’s label.&lt;br /&gt;
&lt;br /&gt;
Note that DrawThemeButton also draws any appearance adornments for the button and that these&lt;br /&gt;
can extend beyond the button’s basic bounding rectangle, as specified in the inBounds parameter,&lt;br /&gt;
and may be of variable shape. You may therefore wish to call the function&lt;br /&gt;
GetThemeButtonBackgroundBounds to obtain the actual rectangle containing the pixels belonging&lt;br /&gt;
to a button under the current theme.&lt;br /&gt;
&lt;br /&gt;
Version Notes&lt;br /&gt;
This function is available with Appearance Manager 1.1 and later.&lt;br /&gt;
&lt;br /&gt;
Availability&lt;br /&gt;
Available in CarbonLib 1.0 and later when Appearance 1.1 or later is present.&lt;br /&gt;
Available in Mac OS X 10.0 and later.&lt;br /&gt;
Declared In&lt;br /&gt;
Appearance.h&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
====HIComboBoxCreate() documentation====&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
HIComboBoxCreate&lt;br /&gt;
Creates a combo box control.&lt;br /&gt;
&lt;br /&gt;
OSStatus HIComboBoxCreate (&lt;br /&gt;
   const HIRect* boundsRect,&lt;br /&gt;
   CFStringRef text,&lt;br /&gt;
   const ControlFontStyleRec* style,&lt;br /&gt;
   CFArrayRef list,&lt;br /&gt;
   OptionBits inAttributes,&lt;br /&gt;
   HIViewRef* outComboBox&lt;br /&gt;
);&lt;br /&gt;
Parameters&lt;br /&gt;
boundsRect&lt;br /&gt;
The bounding box of the control.&lt;br /&gt;
&lt;br /&gt;
text&lt;br /&gt;
The default text in the editable portion of the control. Can be NULL.&lt;br /&gt;
&lt;br /&gt;
style&lt;br /&gt;
The font style of the both editable text and the text in the disclosure list. Can be NULL.&lt;br /&gt;
&lt;br /&gt;
list&lt;br /&gt;
The default values available in the disclosure list. Can be NULL.&lt;br /&gt;
&lt;br /&gt;
inAttributes&lt;br /&gt;
The default attributes of the combo box. For possible values, see “Combo Box Attributes”.&lt;br /&gt;
&lt;br /&gt;
outComboBox&lt;br /&gt;
On exit, a pointer to a reference for the new control.&lt;br /&gt;
&lt;br /&gt;
Discussion&lt;br /&gt;
The combo box can be used in compositing mode, as well as traditional Control Manager mode.&lt;br /&gt;
When created, this view is invisible. To see the view, you must show the view by calling HIViewSetVisible.&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== What is used for Linux, Windows, Mac OS X ...build ? ==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;[[Description of the dependencies]]&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;[[Windows]]&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;[[MacOS X]]&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;[[Linux]]&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;[[Solaris]]&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
== Content of Aqua ==&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;[[Click here to see the complete list]]&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Content of vcl/inc&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Notes: &lt;br /&gt;
&lt;br /&gt;
1) Where to find includes&lt;br /&gt;
&lt;br /&gt;
&amp;lt;foo/bar.hxx&amp;gt; means you can find bar.hxx in the foo module. The new style file is foo/inc/foo/bar.hxx, old style is foo/inc/bar.hxx and sometimes the file is somewhere else in the tree or generated. The deliver process copies/generates the file into solver at solver/680/build_type/inc/foo. Good for fixing broken builds. ;-)&lt;br /&gt;
&lt;br /&gt;
2) &lt;br /&gt;
suffix .h (for C calls or first version?) or .hxx (C++) &lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;A) Family of includes&amp;#039;&amp;#039;&amp;#039;:&lt;br /&gt;
&lt;br /&gt;
Looking more closely at the list brings to the fore (expression from dictionary ;-) ) that include names are&lt;br /&gt;
informatives. Most of the time, the name gives the function/role.&lt;br /&gt;
What is interesting is the files with name begining with &amp;quot;sal&amp;quot;. sal means System Abstraction Layer + include&amp;#039;s function (or explicit name). &lt;br /&gt;
&lt;br /&gt;
Partial list, for example:&lt;br /&gt;
&lt;br /&gt;
salatype.hxx&lt;br /&gt;
&lt;br /&gt;
salbmp.hxx&lt;br /&gt;
&lt;br /&gt;
salctrlhandle.hxx&lt;br /&gt;
&lt;br /&gt;
salctype.hxx&lt;br /&gt;
&lt;br /&gt;
salframe.hxx&lt;br /&gt;
&lt;br /&gt;
salgdi.hxx&lt;br /&gt;
&lt;br /&gt;
salgeom.hxx&lt;br /&gt;
&lt;br /&gt;
sallayout.hxx (main header for fonts services)&lt;br /&gt;
...&lt;br /&gt;
salmenu&lt;br /&gt;
salnativewidgets&lt;br /&gt;
...etc&lt;br /&gt;
&lt;br /&gt;
Other important families are &amp;quot;sv&amp;quot; and &amp;quot;uno&amp;quot; or &amp;quot;win&amp;quot; (window) prefixed. sal family will be analysed apart.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;B) Includes of includes&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
Some includes are more important than other. To prove this, just have a look is sufficient: some are always needed, and some more rarely.&lt;br /&gt;
&lt;br /&gt;
To verify, a simple test to do in vcl/inc:&lt;br /&gt;
&lt;br /&gt;
egrep -H &amp;quot;#include&amp;quot; ./* | wc -l  gives me 681 lines ! And some of them are the same...&lt;br /&gt;
&lt;br /&gt;
To know more, the precedent command line can be modified to make appear the numerous call &lt;br /&gt;
to the same includes files.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
egrep -H &amp;quot;#include&amp;quot; ./* | cut -d&amp;quot;#&amp;quot; -f2 | sort &amp;gt; liste.txt&lt;br /&gt;
&lt;br /&gt;
The content of liste.txt is explicit: dllapi.h, sv.h and some other are very important, while some other includes are only one or two times used. We can see too that vos includes are numerous, even if vos is deprecated**&lt;br /&gt;
&lt;br /&gt;
 **see http://wiki.services.openoffice.org/wiki/Source_code_directories&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
I&amp;#039;m nearly sure that a complete analysis of just this result will give us a lot of information.&lt;br /&gt;
&lt;br /&gt;
I propose to change the order of analysis starting with dllapi.h and sv.h.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[to be continued]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;B1) &amp;quot;sal&amp;quot; includes family&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
[[salinst.hxx]] This seems to be the main include file&lt;br /&gt;
&lt;br /&gt;
[[salatype.hxx]]&lt;br /&gt;
&lt;br /&gt;
[[salctrlhandle.hxx]]&lt;br /&gt;
&lt;br /&gt;
[[salctype.hxx]]&lt;br /&gt;
&lt;br /&gt;
[[salframe.hxx]]&lt;br /&gt;
&lt;br /&gt;
[[salgdi.hxx]]&lt;br /&gt;
&lt;br /&gt;
[[salgeom.hxx]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;[[ sallayout.hxx ]]&amp;#039;&amp;#039;&amp;#039; &amp;lt;-- see Native Fonts implementation&lt;br /&gt;
&lt;br /&gt;
[[salgtype.hxx]]&lt;br /&gt;
&lt;br /&gt;
[[vcl/inc/salobj.hxx]]&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;B2) Classicals includes&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
file: abstdlg.hxx [ means abstract dialog ]&lt;br /&gt;
&lt;br /&gt;
This includes does contain the following classes definitions:&lt;br /&gt;
&lt;br /&gt;
[FIXME] : choose a precise presentation template for classes &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
VclAbstractDialog,&lt;br /&gt;
&lt;br /&gt;
VclAbstractTerminateDialog, &lt;br /&gt;
&lt;br /&gt;
VclAbstractRefreshableDialog,&lt;br /&gt;
 &lt;br /&gt;
VclAbstractDialogFactory, &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
uses &amp;lt;tools/solar.h&amp;gt; , &amp;lt;tools/string.hxx&amp;gt; + &lt;br /&gt;
&lt;br /&gt;
&amp;quot;dllapi.h&amp;quot;&lt;br /&gt;
&lt;br /&gt;
Note : dllapi.h is very interesting because when we have to find (for example) a library suffix, SAL_DLLEXTENSSION can replace all suffixes (every OS&amp;#039;s and archs). Just including sal/config.h does it ! &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Classes:&lt;br /&gt;
&lt;br /&gt;
Window -&amp;gt; what? [FIXME]&lt;br /&gt;
ResId -&amp;gt; what?&lt;br /&gt;
&lt;br /&gt;
Does contain the prototype of VclAbstractDialog, inherit of VCL_DLLPUBLIC&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
file: dllapi.h [ dll for dynamic linked library ]&lt;br /&gt;
Uses: &amp;lt;sal/config.h&amp;gt; and &amp;gt;sal/types/h&amp;gt;&lt;br /&gt;
includes: VCL_DLLPUBLIC macro&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
file: accel.h [ means accelerator ]&lt;br /&gt;
&lt;br /&gt;
Classes:&lt;br /&gt;
&lt;br /&gt;
Accelerator &lt;br /&gt;
{&lt;br /&gt;
}&lt;br /&gt;
ImplAccelEntry &lt;br /&gt;
{&lt;br /&gt;
public members: &lt;br /&gt;
&lt;br /&gt;
Names&lt;br /&gt;
&lt;br /&gt;
mnId&lt;br /&gt;
maKeyCode&lt;br /&gt;
mpAccel&lt;br /&gt;
mpAutoAccel&lt;br /&gt;
mbEnabled&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
function / returns / parameters&lt;br /&gt;
&lt;br /&gt;
ImplGetKeyCode / void / KeyFuncType eFunc, ref rCode1 , ref rCode2, ref rCode3&lt;br /&gt;
&lt;br /&gt;
file: accel.hxx &lt;br /&gt;
&lt;br /&gt;
Uses: &amp;lt;sv.h&amp;gt; , &amp;quot;dllapi.h&amp;quot; ,&amp;lt;tools/resid.hxx&amp;gt;, &amp;lt;&amp;lt;tools/rc.hxx&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Classes:&lt;br /&gt;
&lt;br /&gt;
ImplAccelData;&lt;br /&gt;
ImplAccelEntry;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Important Links ==&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;[[Progressive implementation]]&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Native Font server Implementation&amp;#039;&amp;#039;&amp;#039; &amp;#039;&amp;#039;&amp;#039;[[Mac OS X Porting - Native Fonts]]&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Native Sound Implementation&amp;#039;&amp;#039;&amp;#039;: [[Mac OS X Porting - Native Audio and Video]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Native Printing Implementation&amp;#039;&amp;#039;&amp;#039;: [[Mac OS X Porting - Native_Printing]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Drag and Drop implementation&amp;#039;&amp;#039;&amp;#039;: [[Mac OS X Porting - Native Drag and drop]]&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Data Acquisition&amp;#039;&amp;#039;&amp;#039; : [[Mac OS X Porting - Data Acquisition]]&lt;br /&gt;
&lt;br /&gt;
This work is part of http://wiki.services.openoffice.org/wiki/Mac_OS_X_Porting_-_Work_Areas/Todo%27s&lt;br /&gt;
&lt;br /&gt;
[to be continued:-) ]&lt;br /&gt;
&lt;br /&gt;
== Keyboard comparizon between OpenOffice.org / Mac OS X  application ==&lt;br /&gt;
&lt;br /&gt;
[FIXME] redo a cleanest array &lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;vertical-align:top; text-align:centered; background-color:#F0F0F0;&amp;quot;&lt;br /&gt;
|- style=&amp;quot;background-color:#99CCFF; font-weight:bold;&amp;quot; &lt;br /&gt;
| Modifier||+ key  || Result || TextEdit  returns&lt;br /&gt;
|-&lt;br /&gt;
|ALT|| a||æ ||æ &lt;br /&gt;
|-&lt;br /&gt;
|ALT||b||ß ||ß&lt;br /&gt;
|-&lt;br /&gt;
|ALT||c||© ||©&lt;br /&gt;
|-&lt;br /&gt;
|ALT||d||∂ ||∂&lt;br /&gt;
|-&lt;br /&gt;
|ALT||e||ê ||ê&lt;br /&gt;
|-&lt;br /&gt;
|ALT||f||ƒ ||ƒ&lt;br /&gt;
|-&lt;br /&gt;
|ALT||g ||ﬁ ||ﬁ&lt;br /&gt;
|-&lt;br /&gt;
|ALT||h ||Ì ||Ì&lt;br /&gt;
|-&lt;br /&gt;
|ALT||i ||î ||î&lt;br /&gt;
|-&lt;br /&gt;
|ALT||j ||Ï ||Ï&lt;br /&gt;
|-&lt;br /&gt;
|ALT||k ||È ||È&lt;br /&gt;
|-&lt;br /&gt;
|ALT||l ||¬ ||¬&lt;br /&gt;
|-&lt;br /&gt;
|ALT||m ||µ ||µ&lt;br /&gt;
|-&lt;br /&gt;
|ALT||n ||~ ||~&lt;br /&gt;
|-&lt;br /&gt;
|ALT||o ||œ ||œ&lt;br /&gt;
|-&lt;br /&gt;
|ALT||p ||π ||π&lt;br /&gt;
|-&lt;br /&gt;
|ALT||q ||‡ ||‡&lt;br /&gt;
|-&lt;br /&gt;
|ALT||r ||® ||®&lt;br /&gt;
|-&lt;br /&gt;
|ALT||s ||Ò ||Ò&lt;br /&gt;
|-&lt;br /&gt;
|ALT||t ||† ||†&lt;br /&gt;
|-&lt;br /&gt;
|ALT||u ||º ||º&lt;br /&gt;
|-&lt;br /&gt;
|ALT||v ||◊ ||◊&lt;br /&gt;
|-&lt;br /&gt;
|ALT||w ||‹ ||‹&lt;br /&gt;
|-&lt;br /&gt;
|ALT||x ||≈ ||≈&lt;br /&gt;
|-&lt;br /&gt;
|ALT||y ||Ú ||Ú&lt;br /&gt;
|-&lt;br /&gt;
|ALT||z ||Â ||Â&lt;br /&gt;
|-&lt;br /&gt;
|ALT||A ||Æ ||Æ&lt;br /&gt;
|-&lt;br /&gt;
|ALT||B ||∫ ||∫&lt;br /&gt;
|-&lt;br /&gt;
|ALT||C ||¢ ||¢&lt;br /&gt;
|-&lt;br /&gt;
|ALT||D||∆||∆&lt;br /&gt;
|-&lt;br /&gt;
|ALT||F ||· ||·&lt;br /&gt;
|-&lt;br /&gt;
|ALT||G ||ﬂ ||ﬂ&lt;br /&gt;
|-&lt;br /&gt;
|ALT||H ||Î ||Î&lt;br /&gt;
|-&lt;br /&gt;
|ALT||I ||Î ||Î&lt;br /&gt;
|-&lt;br /&gt;
|ALT||J ||Í ||Í&lt;br /&gt;
|-&lt;br /&gt;
|ALT||K ||Ë ||Ë&lt;br /&gt;
|-&lt;br /&gt;
|ALT||L || &amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt; ||&amp;lt;nowiki&amp;gt;|&amp;lt;/nowiki&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
|ALT||M ||Ó ||Ó&lt;br /&gt;
|-&lt;br /&gt;
|ALT||N ||ı ||ı&lt;br /&gt;
|-&lt;br /&gt;
|ALT||O ||Œ ||Œ&lt;br /&gt;
|-&lt;br /&gt;
|ALT||P ||∏ ||∏&lt;br /&gt;
|-&lt;br /&gt;
|ALT||Q ||Ω ||Ω&lt;br /&gt;
|-&lt;br /&gt;
|ALT||R ||‚ ||‚&lt;br /&gt;
|-&lt;br /&gt;
|ALT||S ||∑ ||∑&lt;br /&gt;
|-&lt;br /&gt;
|ALT||T ||™ ||™&lt;br /&gt;
|-&lt;br /&gt;
|ALT||U ||ª ||ª&lt;br /&gt;
|-&lt;br /&gt;
|ALT||V ||√ ||√&lt;br /&gt;
|-&lt;br /&gt;
|ALT||W ||› ||›&lt;br /&gt;
|-&lt;br /&gt;
|ALT||X ||⁄ ||⁄&lt;br /&gt;
|-&lt;br /&gt;
|ALT||Y ||Ÿ ||Ÿ&lt;br /&gt;
|-&lt;br /&gt;
|ALT||Z ||Å ||Å&lt;br /&gt;
|-&lt;br /&gt;
|ALT||$ ||€ ||€&lt;br /&gt;
|-&lt;br /&gt;
|ALT||` ||@ ||@&lt;br /&gt;
|-&lt;br /&gt;
|ALT||£ ||# ||#&lt;br /&gt;
|-&lt;br /&gt;
|ALT||* ||¥ ||¥&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Sous réserve d&amp;#039;erreur ou omission [[User:Ericb|Ericb]] 00:05, 14 January 2007 (CET)&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
--[[User:Ericb|Ericb]] 15:00, 22 Jul 2005 (EDT)&lt;br /&gt;
&lt;br /&gt;
[[Category:Porting]]&lt;br /&gt;
[[Category:MacOSX]]&lt;br /&gt;
[[Category:Aqua]]&lt;/div&gt;</summary>
		<author><name>Ybart</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Documentation/Building_Guide/Building_on_MacOSX&amp;diff=32468</id>
		<title>Documentation/Building Guide/Building on MacOSX</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Documentation/Building_Guide/Building_on_MacOSX&amp;diff=32468"/>
		<updated>2007-05-17T00:57:47Z</updated>

		<summary type="html">&lt;p&gt;Ybart: /* Use vcl menubar and / or vcl menus */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;!-- &lt;br /&gt;
&amp;lt;div align=&amp;quot;left&amp;quot; style=&amp;quot;color:red; font-size:20px&amp;quot;&amp;gt;&amp;#039;&amp;#039;&amp;#039;PLEASE WAIT:  RESYNC WITH  M211 IN PROGRESS&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;#039;&amp;#039;&amp;#039;This document tries to wrap-up the build process for [[OpenOffice.org]] on Mac OS X using the native windowing-toolkit of the platform named Aqua.&amp;#039;&amp;#039;&amp;#039; &amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To give a kickstart in the coding involved to get VCL ported to Carbon, please have a look at the excellent Pierre de Filippis [[Intro To Mac Porting]].&lt;br /&gt;
&lt;br /&gt;
We use the bash shell in all examples, since to our belief users of the C-shell are smart enough to figure out the differences anyway. If you want to dig deeper into the build process, please have a look at the description of the build environment here: [http://tools.openoffice.org/build_env.html OpenOffice.org Build Environment].&lt;br /&gt;
&lt;br /&gt;
== &amp;#039;&amp;#039;&amp;#039;Prerequisites&amp;#039;&amp;#039;&amp;#039; ==&lt;br /&gt;
&lt;br /&gt;
This document was derived from the description of the X11 build thanksworthy provided by Eric Hoch in this document: [[MacOSXBuildInstructions]].&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Here we would like to outline the things you need to build the Aqua Version&amp;#039;&amp;#039;&amp;#039; (besides the OS). &lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;div align=&amp;quot;left&amp;quot; style=&amp;quot;color:red; font-size:18px&amp;quot;&amp;gt;&amp;#039;&amp;#039;&amp;#039;Mandatory&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
==== Xcode ====&lt;br /&gt;
&lt;br /&gt;
This is the only mandatory part to be installed to build Aqua version of OpenOffice.org.&lt;br /&gt;
&lt;br /&gt;
Current verified working version is XCode 2.4.1&lt;br /&gt;
&lt;br /&gt;
If you really cannot use XCode 2.4.1 nor XCode 2.4:&lt;br /&gt;
&lt;br /&gt;
Xcode 2.2, 2.3 are known to work for Aqua development. If any earlier versions work as well, please add them here.&lt;br /&gt;
&lt;br /&gt;
==== X11SDK  (soon optional) ==== &lt;br /&gt;
&lt;br /&gt;
A dependency for Mozilla plugin needs some prototype defined in some Xlib.h header. &lt;br /&gt;
&lt;br /&gt;
Please note, this dependency is not needed in runtime, but only at buildtime. &lt;br /&gt;
&lt;br /&gt;
X11SDK.pkg archive is located in your Tiger&amp;#039;s DVD, and has to be installed in the case of you&amp;#039;re using Mozilla prebuild archives&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;This issue should be fixed soon.&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;div align=&amp;quot;left&amp;quot; style=&amp;quot;color:blue; font-size:18px&amp;quot;&amp;gt;&amp;#039;&amp;#039;&amp;#039; Strongly recommended&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
==== ccache ====&lt;br /&gt;
If you intend to build several times OpenOffice, you probably can benefit of ccache. ccache will speed up your future builds. The first time you make a build with ccache you won&amp;#039;t notice it, but then the build will go up to five times faster.&lt;br /&gt;
&lt;br /&gt;
You can install it using fink. It is simply named &amp;quot;ccache&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
If you don&amp;#039;t use fink, you can download it and build it yourself using the source provided at http://ccache.samba.org/&lt;br /&gt;
&lt;br /&gt;
Then, in order to use it, you need to change the following environment variables &amp;#039;&amp;#039;&amp;#039;using bash, and just before doing configure command line&amp;#039;&amp;#039;&amp;#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
export CC=&amp;quot;ccache gcc&amp;quot;&lt;br /&gt;
export CXX=&amp;quot;ccache g++&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div align=&amp;quot;left&amp;quot; style=&amp;quot;color:grey; font-size:18px&amp;quot;&amp;gt;[[AquaBuild/Some Background | &amp;#039;&amp;#039;&amp;#039;Some Background (what is aquavcl01, EIS) (click me to know more) &amp;#039;&amp;#039;&amp;#039;]]&amp;lt;/div&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== &amp;#039;&amp;#039;&amp;#039;Getting the code (checkout, merge and patch the puppy)&amp;#039;&amp;#039;&amp;#039; ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
aquavcl01 cws does use SRC680 master workspace, and is regularly resynchronized with recent milestones.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;The current milestone as of now (May 3rd 2007) is m211&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
All these milestone numbers below highly depend on the given point-in-time. You can find the current milestone of each cws in the EIS database.&lt;br /&gt;
&lt;br /&gt;
You also need to bear in mind that you have to access to the CVS-Server&amp;#039;s default port (2401). If a firewall stop&amp;#039;s you here you have to setup a CVS-Tunnel.&lt;br /&gt;
&lt;br /&gt;
==== Create a directory for a given milestone, setup CVS access: ==== &lt;br /&gt;
&amp;lt;code&amp;gt;[bash,N]&lt;br /&gt;
 mkdir src680-m211&lt;br /&gt;
 cd src680-m211&lt;br /&gt;
 &lt;br /&gt;
 export CVSROOT=:pserver:anoncvs@anoncvs.services.openoffice.org:/cvs&lt;br /&gt;
 cvs login&lt;br /&gt;
(password is &amp;#039;anoncvs&amp;#039; )  + Enter&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== checkout milestone m211 (1,5 GB): ==== &lt;br /&gt;
&amp;lt;code&amp;gt;[bash,N]&lt;br /&gt;
 cvs -z3 co -r SRC680_m211 OpenOffice2&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Once done, you&amp;#039;ll obtain milestone 211. this not exactly what we want, because all changes concerning aquavcl01 Child workspace are not included. To complete, we need to check aquavcl01 changes.&lt;br /&gt;
&lt;br /&gt;
==== checkout Aquavcl01 (50 MB): ==== &lt;br /&gt;
&lt;br /&gt;
1) First possibility: create a dedicated tree (cool backup)&lt;br /&gt;
&lt;br /&gt;
To check aquavcl01 Child workspace, the most simple is to create aquavcl01 directory, and go inside this dir&lt;br /&gt;
&amp;lt;code&amp;gt;[bash,N]&lt;br /&gt;
 mkdir aquavcl01-src &lt;br /&gt;
 &lt;br /&gt;
 cd aquavcl01-src&lt;br /&gt;
 &amp;lt;/code&amp;gt;&lt;br /&gt;
 (assuming you already did cvs login, and typing all the command line below in one line)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[bash,N]&lt;br /&gt;
&lt;br /&gt;
cvs -z3 co -r cws_src680_aquavcl01 canvas dtrans extensions fpicker \&lt;br /&gt;
freetype instsetoo_native padmin psprint sal scp2 sfx2 sj2 solenv toolkit vcl&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All the modules listed above will be present at the end ( everyone represents a new directory ) and they are the ones we modified to create the native version.&lt;br /&gt;
&lt;br /&gt;
To verify nothing&amp;#039;s wrong, all are tagged &amp;quot;aquavcl01&amp;quot; (see all CVS/Tag files in the tree) and all you have to do is either rename or delete the one located in src680-m211 and replace them with the one located in aquavcl01-src.&lt;br /&gt;
&lt;br /&gt;
e.g. : canvas in src680-m211 will become canvas_m211 , and then, cp canvas from aquavcl01-src into src-m211&lt;br /&gt;
&lt;br /&gt;
This applies for all the modules listed above.&lt;br /&gt;
&lt;br /&gt;
2) Second possibility: use a little script to extract changes: extract_aquavcl01.sh&lt;br /&gt;
&lt;br /&gt;
This shell script, located in src680-m211 will contain:&lt;br /&gt;
&amp;lt;code&amp;gt;[bash,N]&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
list=&amp;quot;canvas dtrans extensions fpicker freetype instsetoo_native padmin psprint sal scp2 sfx2 sj2  solenv toolkit vcl&amp;quot;&lt;br /&gt;
for i in $list ;  do &lt;br /&gt;
   mv $i $i-m211&lt;br /&gt;
   cvs -z3 co -r cws_src680_aquavcl01 $i&lt;br /&gt;
done&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then chmod +x extract_aquavcl01.sh&lt;br /&gt;
&lt;br /&gt;
and run it:&lt;br /&gt;
&lt;br /&gt;
./extract_aquavcl01.sh&lt;br /&gt;
&lt;br /&gt;
When finished, and if no problem occurs, you should have a complete tree.&lt;br /&gt;
&lt;br /&gt;
=== One-Time preparations and scripts ===&lt;br /&gt;
&lt;br /&gt;
OpenOffice building gets configured by the popular open-source configuration-management package &amp;#039;autoconf&amp;#039;. So you can do your beloved &amp;#039;./configure&amp;#039; command, but in our case this is done in the &amp;#039;config_office&amp;#039; subdirectory. To save the configure parameters and use them with different milestones I used to link-in my shellscript to fire up the ./configure line.&lt;br /&gt;
&lt;br /&gt;
My directory-structure looks like this:&lt;br /&gt;
&lt;br /&gt;
 bin/&lt;br /&gt;
 src680-m182/&lt;br /&gt;
 src680-m196/&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
Now I go to the &amp;#039;config_office&amp;#039; subdir and link in my startscript:&lt;br /&gt;
&amp;lt;code&amp;gt;[bash,N]&lt;br /&gt;
 cd src680-m211/config_office/&lt;br /&gt;
 ln -s ../../bin/build.sh&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
And this is how &amp;#039;build.sh&amp;#039; (to be written) looks like :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[bash,N]&lt;br /&gt;
 #!/bin/sh&lt;br /&gt;
 export BASE=`pwd|sed &amp;#039;s/\/config_office//&amp;#039;`&lt;br /&gt;
 export OOVERSION=`echo $BASE|sed &amp;#039;s/^\/.*\///&amp;#039;`&lt;br /&gt;
 echo Building from     : $BASE&lt;br /&gt;
 echo OpenOffice Version: $OOVERSION&lt;br /&gt;
 ./configure \&lt;br /&gt;
 --with-lang=&amp;quot;de en-US&amp;quot; \&lt;br /&gt;
 --with-jdk-home=/Library/Java/Home/ \&lt;br /&gt;
 --with-epm=internal \&lt;br /&gt;
 --disable-mozab \&lt;br /&gt;
 --disable-odk \&lt;br /&gt;
 --disable-pasf \&lt;br /&gt;
 --disable-gtk \&lt;br /&gt;
 --disable-mozilla \&lt;br /&gt;
 --with-build-version=$OOVERSION-`date +%d-%m-%y` \&lt;br /&gt;
 --disable-fontconfig \&lt;br /&gt;
 --disable-neon \&lt;br /&gt;
 --without-nas&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
--disable-odk : disables SDK build, and will avoid you to download some windows dll which is not needed for aqua-build.&lt;br /&gt;
&lt;br /&gt;
--disable-pasf : pasf stands for Portable Audio System file. As we want to use system library rather than portable ones, we disabled this. However, at this time not all functionality will be available with pasf disabled. You might willing to use --with-pasf if you want working audio in your build.&lt;br /&gt;
&lt;br /&gt;
--without-nas : nas stands for Network Audio System, it uses X11, if you want to use it in your build, just remove this flag. You will need to install the X11 package provided in your CDs/DVD Mac OS X installation. X11 SDK from xCode tools is not required for build this.&lt;br /&gt;
&lt;br /&gt;
This is allowedly a pretty much limited setup for now, but it will progressively change, with the progress we&amp;#039;ll do with Aqua port.&lt;br /&gt;
&lt;br /&gt;
== &amp;#039;&amp;#039;&amp;#039;List of Patches requiring testing before for integration&amp;#039;&amp;#039;&amp;#039; ==&lt;br /&gt;
&lt;br /&gt;
All patches that developers have that need testing or peer review should be added here.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;div align=&amp;quot;left&amp;quot; style=&amp;quot;color:grey; font-size:18px&amp;quot;&amp;gt;[[AquaBuild/Native FilePicker | &amp;#039;&amp;#039;&amp;#039;Native FilePicker (click me to know more) &amp;#039;&amp;#039;&amp;#039;]]&amp;lt;/div&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Soon : new salframe implementation ( using HIFramework )&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== &amp;#039;&amp;#039;&amp;#039;Known build issues &amp;#039;&amp;#039;&amp;#039;==&lt;br /&gt;
&lt;br /&gt;
Since latest resync, no build issues have been reported.&lt;br /&gt;
&lt;br /&gt;
== &amp;#039;&amp;#039;&amp;#039;Doing the build (about 4,5 GB)&amp;#039;&amp;#039;&amp;#039; ==&lt;br /&gt;
&lt;br /&gt;
Fine, now we have a (hopefully) working &amp;#039;build.sh&amp;#039; in the config_office subdir. We need to run it beforehand:&lt;br /&gt;
&lt;br /&gt;
 cd src680-m222/config_office/&lt;br /&gt;
 ./build.sh&lt;br /&gt;
&lt;br /&gt;
This will setup the necessary includefiles and create a couple of files in the &amp;#039;&amp;#039;&amp;#039;parent&amp;#039;&amp;#039;&amp;#039; directory (bootstrap, MacOSXPPCEnv.Set.sh, MacOSXPPCEnv.Set). If you are using the sh, ksh or bash you only need to take care for &amp;#039;MacOSXPPCEnv.Set.sh&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
Now we need to get back to our base-directory, run the bootstrap script, source our Enviroment (MacOSXPPCEnv.Set.sh) and finally start the build-process:&lt;br /&gt;
&lt;br /&gt;
On PowerPC:&lt;br /&gt;
&lt;br /&gt;
 cd ..&lt;br /&gt;
 ./bootstrap&lt;br /&gt;
 source MacOSXPPCEnv.Set.sh&lt;br /&gt;
 cd instsetoo_native&lt;br /&gt;
 build --all -P2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Or (on Mac Intel): &lt;br /&gt;
&lt;br /&gt;
 cd ..&lt;br /&gt;
 ./bootstrap&lt;br /&gt;
 source MacOSXX86Env.Set.sh&lt;br /&gt;
 cd instsetoo_native&lt;br /&gt;
 build --all -P4&lt;br /&gt;
&lt;br /&gt;
The main purpose of the &amp;#039;&amp;#039;&amp;#039;boostrap&amp;#039;&amp;#039;&amp;#039; script is to build (if necessary) the dmake utility used. Dmake once was a unix make-clone made by wticorp but got incorporated into OpenOffice since it was orphaned. For more information about dmake, it&amp;#039;s history and manpage have a look here: http://tools.openoffice.org/dmake/index.html&lt;br /&gt;
&lt;br /&gt;
Sourcing MacOSXPPCEnv.Set.sh is very important not only for building but also for &amp;#039;&amp;#039;&amp;#039;running&amp;#039;&amp;#039;&amp;#039; svdem later on. Here all the Environment-Variables for the Build will be set up. For a detailed description see [[Environment_Variables]]. Please note that on Intel machines, &amp;#039;MacOSXPPCEnv.Set&amp;#039; should be substituted with &amp;#039;MacOSXX86Env.Set&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
This Build process takes on my box (Dual 1.8 GHz G5, 1.5GB RAM) roughly 10 hours, and 3 to 6 hours on Mac Intel. Be patient.&lt;br /&gt;
&lt;br /&gt;
== &amp;#039;&amp;#039;&amp;#039;Installing, preparing and running OpenOffice.org&amp;#039;&amp;#039;&amp;#039; ==&lt;br /&gt;
&lt;br /&gt;
===&amp;#039;&amp;#039;&amp;#039; Find the Bundle&amp;#039;&amp;#039;&amp;#039; ===&lt;br /&gt;
&lt;br /&gt;
Once the build completed, the Final product ( en-US version ) is named :  OpenOffice.org-2.3.0_en-US.dmg ( for version 2.3.0 e.g.) &lt;br /&gt;
&lt;br /&gt;
And is located in instsetoo_native/unxmacxi.pro/OpenOffice/install/en-US  directory ( replace en-US with your locale )&lt;br /&gt;
&lt;br /&gt;
[[Image:Bundle_location.jpg]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;#039;&amp;#039;&amp;#039;Run the soffice.bin&amp;#039;&amp;#039;&amp;#039; ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In one line :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;#039;&amp;#039;&amp;#039;Double click the .dmg , drag the OpenOffice.org icon in the folder you want, and double click to run it !!&amp;#039;&amp;#039;&amp;#039;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note : soffice.bin leads XCode to not work (because of the dot in the name). The issue has been reported to xcode-users list.&lt;br /&gt;
 &lt;br /&gt;
We&amp;#039;re nearly through, let&amp;#039;s fire-off the binary:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
But a lot has to be done, and if you want to trace (using gdb e.g.), just do:&lt;br /&gt;
&lt;br /&gt;
cd &amp;lt;INSTALL_DIR&amp;gt;/OpenOffice.org\ 2.3.app/Contents/MacOS&lt;br /&gt;
&lt;br /&gt;
and run:&lt;br /&gt;
&lt;br /&gt;
gdb --args soffice.bin&lt;br /&gt;
&lt;br /&gt;
(add any breakpoint you want)&lt;br /&gt;
&lt;br /&gt;
r to run OpenOffice.org&lt;br /&gt;
&lt;br /&gt;
=== Use vcl menubar and / or vcl menus ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Native menus are defaults. If you want to use vcl menus, do:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
AQUA_NATIVE_MENUS=FALSE ./soffice.bin&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: options to not recover is  -norestore , and to bypass the user informations to fill in, use -nofirststartwizard&lt;br /&gt;
&lt;br /&gt;
AQUA_NATIVE_MENUS=FALSE ./soffice.bin -nofirststartwizard -norestore&lt;br /&gt;
&lt;br /&gt;
You can also insert environement variables in a Dictionary Class of Info.plist located in the Contents directory of OpenOffice.org bundle.&lt;br /&gt;
&lt;br /&gt;
For example, you can add the following XML in a text editor (or make it generated by Property List Editor) in your Info.plist :&lt;br /&gt;
&lt;br /&gt;
   &amp;lt;key&amp;gt;LSEnvironment&amp;lt;/key&amp;gt;&lt;br /&gt;
   &amp;lt;dict&amp;gt;&lt;br /&gt;
       &amp;lt;key&amp;gt;AQUA_NATIVE_MENUS&amp;lt;/key&amp;gt;&lt;br /&gt;
       &amp;lt;string&amp;gt;TRUE&amp;lt;/string&amp;gt;&lt;br /&gt;
       &amp;lt;key&amp;gt;OOO_DISABLE_RECOVERY&amp;lt;/key&amp;gt;&lt;br /&gt;
       &amp;lt;string&amp;gt;TRUE&amp;lt;/string&amp;gt;&lt;br /&gt;
       &amp;lt;key&amp;gt;SAL_NO_NWF&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;TRUE&amp;lt;/string&amp;gt;&lt;br /&gt;
   &amp;lt;dict&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notice that in order to work, the OOO_DISABLE_RECOVERY variable detection must be manually inserted in OOo code using the following patch :&lt;br /&gt;
http://www.go-oo.org/patches/src680/disable-recovery.diff&lt;br /&gt;
&lt;br /&gt;
This patch is outdated, but you can make the modifications yourself.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Notice the enviroment variable here. AQUA_NATIVE_MENUS is experimental stuff created by Pavel, SAL_NO_NWF was created some times ago, and is located in vcl/source/window/window.cxx . At the moment we have:&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;15&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Variable || Function&lt;br /&gt;
|-&lt;br /&gt;
| SAL_NO_NWF=TRUE  || disable native controls code&lt;br /&gt;
|-&lt;br /&gt;
| AQUA_NATIVE_MENUS=FALSE || disable native menus code&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Both changes are marked with comments in the source code, and when we remove them in the future, native controls and native menus will be enabled by default.&lt;br /&gt;
&lt;br /&gt;
== &amp;#039;&amp;#039;&amp;#039;Debug and contribute &amp;#039;&amp;#039;&amp;#039; ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div align=&amp;quot;left&amp;quot; style=&amp;quot;color:blue; font-size:18px&amp;quot;&amp;gt;&amp;#039;&amp;#039;&amp;#039;See [[MacOSX_Debug_OpenOffice.org_using_XCode]]&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div align=&amp;quot;left&amp;quot; style=&amp;quot;color:blue; font-size:18px&amp;quot;&amp;gt;You want to debug using Xemacs ?&amp;lt;/div&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Michael Sicotte wrote a very usefull blog entry about : &amp;#039;&amp;#039;&amp;#039;[http://www.mikesicotte.com/2007/02/21/debugging-ooo-with-xemacs-and-gdb debugging OOo with XEmacs and GDB on Mac OS X]&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
== &amp;#039;&amp;#039;&amp;#039;External links&amp;#039;&amp;#039;&amp;#039; ==&lt;br /&gt;
&lt;br /&gt;
# [http://www.openoffice.org/issues/query.cgi Bug Database]&lt;br /&gt;
# Mailinglist: [http://porting.openoffice.org/servlets/ProjectMailingListList mac@porting.openoffice.org]  (subscribe is mandatory )&lt;br /&gt;
# IRC Meeting-Logs (#ooo_macport@freenode.org): [[Previous_Mac_Meeting_logs]] [[MacOSXPortMeetings]]&lt;br /&gt;
# TX20: http://eric.bachard.free.fr/UTBM_TX20/reports/Carbon_vcl.pdf&lt;br /&gt;
# OpenOffice Source Directory Structure: http://wiki.services.openoffice.org/wiki/Source_code_directories&lt;br /&gt;
# Pavels Patch Wiki: http://blog.janik.cz/&lt;br /&gt;
# Eric Bachard Wiki: http://wiki.services.openoffice.org/wiki/User:Ericb&lt;br /&gt;
# Sebastien Plisson Wiki: http://splisson.blogspot.com/&lt;br /&gt;
# Christian Lippka Wiki: http://wiki.services.openoffice.org/wiki/User:CL&lt;br /&gt;
# Carbon: http://developer.apple.com/carbon&lt;br /&gt;
# EIS: http://eis.services.openoffice.org/EIS2/servlet/Logon&lt;br /&gt;
# Runtime Configuration: http://developer.apple.com/documentation/MacOSX/Conceptual/BPRuntimeConfig/index.html&lt;br /&gt;
# OpenOffice Domain Developer http://wiki.services.openoffice.org/wiki/DomainDeveloper&lt;br /&gt;
&lt;br /&gt;
== &amp;#039;&amp;#039;&amp;#039;Screenshots&amp;#039;&amp;#039;&amp;#039; ==&lt;br /&gt;
&lt;br /&gt;
# Eric Bachard screenshots (some are from Stephan Schaefer) http://eric.bachard.free.fr/mac/aquavcl/screenshots/&lt;br /&gt;
# Most recent: http://eric.bachard.free.fr/mac/aquavcl/screenshots/aqua_menus_05_nov_06/&lt;br /&gt;
# Pavel Janik screenshots http://blog.janik.cz/images/MacOSX/2006-08-10&lt;br /&gt;
# Important screenshot (eventloop issue): http://blog.janik.cz/images/MacOSX/  =&amp;gt; See: OOoMenus-separator-and-disabled_entries.png&lt;br /&gt;
# Aqua look (the begining): &lt;br /&gt;
http://eric.bachard.free.fr/mac/aquavcl/screenshots/mars2007/combobox_search_and_replace02_14mars07.jpg&lt;br /&gt;
&lt;br /&gt;
More menus: http://eric.bachard.free.fr/mac/aquavcl/screenshots/aqua_menus_05_nov_06/index.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:MacOSX]]&lt;br /&gt;
[[Category:Porting]]&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Aqua]]&lt;/div&gt;</summary>
		<author><name>Ybart</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Documentation/Building_Guide/Building_on_MacOSX&amp;diff=32467</id>
		<title>Documentation/Building Guide/Building on MacOSX</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Documentation/Building_Guide/Building_on_MacOSX&amp;diff=32467"/>
		<updated>2007-05-17T00:56:28Z</updated>

		<summary type="html">&lt;p&gt;Ybart: /* Use vcl menubar and / or vcl menus */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;&amp;lt;!-- &lt;br /&gt;
&amp;lt;div align=&amp;quot;left&amp;quot; style=&amp;quot;color:red; font-size:20px&amp;quot;&amp;gt;&amp;#039;&amp;#039;&amp;#039;PLEASE WAIT:  RESYNC WITH  M211 IN PROGRESS&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&lt;br /&gt;
--&amp;gt;&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;#039;&amp;#039;&amp;#039;This document tries to wrap-up the build process for [[OpenOffice.org]] on Mac OS X using the native windowing-toolkit of the platform named Aqua.&amp;#039;&amp;#039;&amp;#039; &amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
To give a kickstart in the coding involved to get VCL ported to Carbon, please have a look at the excellent Pierre de Filippis [[Intro To Mac Porting]].&lt;br /&gt;
&lt;br /&gt;
We use the bash shell in all examples, since to our belief users of the C-shell are smart enough to figure out the differences anyway. If you want to dig deeper into the build process, please have a look at the description of the build environment here: [http://tools.openoffice.org/build_env.html OpenOffice.org Build Environment].&lt;br /&gt;
&lt;br /&gt;
== &amp;#039;&amp;#039;&amp;#039;Prerequisites&amp;#039;&amp;#039;&amp;#039; ==&lt;br /&gt;
&lt;br /&gt;
This document was derived from the description of the X11 build thanksworthy provided by Eric Hoch in this document: [[MacOSXBuildInstructions]].&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;Here we would like to outline the things you need to build the Aqua Version&amp;#039;&amp;#039;&amp;#039; (besides the OS). &lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;div align=&amp;quot;left&amp;quot; style=&amp;quot;color:red; font-size:18px&amp;quot;&amp;gt;&amp;#039;&amp;#039;&amp;#039;Mandatory&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
==== Xcode ====&lt;br /&gt;
&lt;br /&gt;
This is the only mandatory part to be installed to build Aqua version of OpenOffice.org.&lt;br /&gt;
&lt;br /&gt;
Current verified working version is XCode 2.4.1&lt;br /&gt;
&lt;br /&gt;
If you really cannot use XCode 2.4.1 nor XCode 2.4:&lt;br /&gt;
&lt;br /&gt;
Xcode 2.2, 2.3 are known to work for Aqua development. If any earlier versions work as well, please add them here.&lt;br /&gt;
&lt;br /&gt;
==== X11SDK  (soon optional) ==== &lt;br /&gt;
&lt;br /&gt;
A dependency for Mozilla plugin needs some prototype defined in some Xlib.h header. &lt;br /&gt;
&lt;br /&gt;
Please note, this dependency is not needed in runtime, but only at buildtime. &lt;br /&gt;
&lt;br /&gt;
X11SDK.pkg archive is located in your Tiger&amp;#039;s DVD, and has to be installed in the case of you&amp;#039;re using Mozilla prebuild archives&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;This issue should be fixed soon.&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;lt;div align=&amp;quot;left&amp;quot; style=&amp;quot;color:blue; font-size:18px&amp;quot;&amp;gt;&amp;#039;&amp;#039;&amp;#039; Strongly recommended&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;===&lt;br /&gt;
&lt;br /&gt;
==== ccache ====&lt;br /&gt;
If you intend to build several times OpenOffice, you probably can benefit of ccache. ccache will speed up your future builds. The first time you make a build with ccache you won&amp;#039;t notice it, but then the build will go up to five times faster.&lt;br /&gt;
&lt;br /&gt;
You can install it using fink. It is simply named &amp;quot;ccache&amp;quot;. &lt;br /&gt;
&lt;br /&gt;
If you don&amp;#039;t use fink, you can download it and build it yourself using the source provided at http://ccache.samba.org/&lt;br /&gt;
&lt;br /&gt;
Then, in order to use it, you need to change the following environment variables &amp;#039;&amp;#039;&amp;#039;using bash, and just before doing configure command line&amp;#039;&amp;#039;&amp;#039;:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
export CC=&amp;quot;ccache gcc&amp;quot;&lt;br /&gt;
export CXX=&amp;quot;ccache g++&amp;quot;&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div align=&amp;quot;left&amp;quot; style=&amp;quot;color:grey; font-size:18px&amp;quot;&amp;gt;[[AquaBuild/Some Background | &amp;#039;&amp;#039;&amp;#039;Some Background (what is aquavcl01, EIS) (click me to know more) &amp;#039;&amp;#039;&amp;#039;]]&amp;lt;/div&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== &amp;#039;&amp;#039;&amp;#039;Getting the code (checkout, merge and patch the puppy)&amp;#039;&amp;#039;&amp;#039; ==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
aquavcl01 cws does use SRC680 master workspace, and is regularly resynchronized with recent milestones.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;The current milestone as of now (May 3rd 2007) is m211&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
All these milestone numbers below highly depend on the given point-in-time. You can find the current milestone of each cws in the EIS database.&lt;br /&gt;
&lt;br /&gt;
You also need to bear in mind that you have to access to the CVS-Server&amp;#039;s default port (2401). If a firewall stop&amp;#039;s you here you have to setup a CVS-Tunnel.&lt;br /&gt;
&lt;br /&gt;
==== Create a directory for a given milestone, setup CVS access: ==== &lt;br /&gt;
&amp;lt;code&amp;gt;[bash,N]&lt;br /&gt;
 mkdir src680-m211&lt;br /&gt;
 cd src680-m211&lt;br /&gt;
 &lt;br /&gt;
 export CVSROOT=:pserver:anoncvs@anoncvs.services.openoffice.org:/cvs&lt;br /&gt;
 cvs login&lt;br /&gt;
(password is &amp;#039;anoncvs&amp;#039; )  + Enter&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== checkout milestone m211 (1,5 GB): ==== &lt;br /&gt;
&amp;lt;code&amp;gt;[bash,N]&lt;br /&gt;
 cvs -z3 co -r SRC680_m211 OpenOffice2&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
Once done, you&amp;#039;ll obtain milestone 211. this not exactly what we want, because all changes concerning aquavcl01 Child workspace are not included. To complete, we need to check aquavcl01 changes.&lt;br /&gt;
&lt;br /&gt;
==== checkout Aquavcl01 (50 MB): ==== &lt;br /&gt;
&lt;br /&gt;
1) First possibility: create a dedicated tree (cool backup)&lt;br /&gt;
&lt;br /&gt;
To check aquavcl01 Child workspace, the most simple is to create aquavcl01 directory, and go inside this dir&lt;br /&gt;
&amp;lt;code&amp;gt;[bash,N]&lt;br /&gt;
 mkdir aquavcl01-src &lt;br /&gt;
 &lt;br /&gt;
 cd aquavcl01-src&lt;br /&gt;
 &amp;lt;/code&amp;gt;&lt;br /&gt;
 (assuming you already did cvs login, and typing all the command line below in one line)&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[bash,N]&lt;br /&gt;
&lt;br /&gt;
cvs -z3 co -r cws_src680_aquavcl01 canvas dtrans extensions fpicker \&lt;br /&gt;
freetype instsetoo_native padmin psprint sal scp2 sfx2 sj2 solenv toolkit vcl&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
All the modules listed above will be present at the end ( everyone represents a new directory ) and they are the ones we modified to create the native version.&lt;br /&gt;
&lt;br /&gt;
To verify nothing&amp;#039;s wrong, all are tagged &amp;quot;aquavcl01&amp;quot; (see all CVS/Tag files in the tree) and all you have to do is either rename or delete the one located in src680-m211 and replace them with the one located in aquavcl01-src.&lt;br /&gt;
&lt;br /&gt;
e.g. : canvas in src680-m211 will become canvas_m211 , and then, cp canvas from aquavcl01-src into src-m211&lt;br /&gt;
&lt;br /&gt;
This applies for all the modules listed above.&lt;br /&gt;
&lt;br /&gt;
2) Second possibility: use a little script to extract changes: extract_aquavcl01.sh&lt;br /&gt;
&lt;br /&gt;
This shell script, located in src680-m211 will contain:&lt;br /&gt;
&amp;lt;code&amp;gt;[bash,N]&lt;br /&gt;
#!/bin/bash&lt;br /&gt;
list=&amp;quot;canvas dtrans extensions fpicker freetype instsetoo_native padmin psprint sal scp2 sfx2 sj2  solenv toolkit vcl&amp;quot;&lt;br /&gt;
for i in $list ;  do &lt;br /&gt;
   mv $i $i-m211&lt;br /&gt;
   cvs -z3 co -r cws_src680_aquavcl01 $i&lt;br /&gt;
done&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Then chmod +x extract_aquavcl01.sh&lt;br /&gt;
&lt;br /&gt;
and run it:&lt;br /&gt;
&lt;br /&gt;
./extract_aquavcl01.sh&lt;br /&gt;
&lt;br /&gt;
When finished, and if no problem occurs, you should have a complete tree.&lt;br /&gt;
&lt;br /&gt;
=== One-Time preparations and scripts ===&lt;br /&gt;
&lt;br /&gt;
OpenOffice building gets configured by the popular open-source configuration-management package &amp;#039;autoconf&amp;#039;. So you can do your beloved &amp;#039;./configure&amp;#039; command, but in our case this is done in the &amp;#039;config_office&amp;#039; subdirectory. To save the configure parameters and use them with different milestones I used to link-in my shellscript to fire up the ./configure line.&lt;br /&gt;
&lt;br /&gt;
My directory-structure looks like this:&lt;br /&gt;
&lt;br /&gt;
 bin/&lt;br /&gt;
 src680-m182/&lt;br /&gt;
 src680-m196/&lt;br /&gt;
 ...&lt;br /&gt;
&lt;br /&gt;
Now I go to the &amp;#039;config_office&amp;#039; subdir and link in my startscript:&lt;br /&gt;
&amp;lt;code&amp;gt;[bash,N]&lt;br /&gt;
 cd src680-m211/config_office/&lt;br /&gt;
 ln -s ../../bin/build.sh&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
And this is how &amp;#039;build.sh&amp;#039; (to be written) looks like :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[bash,N]&lt;br /&gt;
 #!/bin/sh&lt;br /&gt;
 export BASE=`pwd|sed &amp;#039;s/\/config_office//&amp;#039;`&lt;br /&gt;
 export OOVERSION=`echo $BASE|sed &amp;#039;s/^\/.*\///&amp;#039;`&lt;br /&gt;
 echo Building from     : $BASE&lt;br /&gt;
 echo OpenOffice Version: $OOVERSION&lt;br /&gt;
 ./configure \&lt;br /&gt;
 --with-lang=&amp;quot;de en-US&amp;quot; \&lt;br /&gt;
 --with-jdk-home=/Library/Java/Home/ \&lt;br /&gt;
 --with-epm=internal \&lt;br /&gt;
 --disable-mozab \&lt;br /&gt;
 --disable-odk \&lt;br /&gt;
 --disable-pasf \&lt;br /&gt;
 --disable-gtk \&lt;br /&gt;
 --disable-mozilla \&lt;br /&gt;
 --with-build-version=$OOVERSION-`date +%d-%m-%y` \&lt;br /&gt;
 --disable-fontconfig \&lt;br /&gt;
 --disable-neon \&lt;br /&gt;
 --without-nas&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
--disable-odk : disables SDK build, and will avoid you to download some windows dll which is not needed for aqua-build.&lt;br /&gt;
&lt;br /&gt;
--disable-pasf : pasf stands for Portable Audio System file. As we want to use system library rather than portable ones, we disabled this. However, at this time not all functionality will be available with pasf disabled. You might willing to use --with-pasf if you want working audio in your build.&lt;br /&gt;
&lt;br /&gt;
--without-nas : nas stands for Network Audio System, it uses X11, if you want to use it in your build, just remove this flag. You will need to install the X11 package provided in your CDs/DVD Mac OS X installation. X11 SDK from xCode tools is not required for build this.&lt;br /&gt;
&lt;br /&gt;
This is allowedly a pretty much limited setup for now, but it will progressively change, with the progress we&amp;#039;ll do with Aqua port.&lt;br /&gt;
&lt;br /&gt;
== &amp;#039;&amp;#039;&amp;#039;List of Patches requiring testing before for integration&amp;#039;&amp;#039;&amp;#039; ==&lt;br /&gt;
&lt;br /&gt;
All patches that developers have that need testing or peer review should be added here.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;div align=&amp;quot;left&amp;quot; style=&amp;quot;color:grey; font-size:18px&amp;quot;&amp;gt;[[AquaBuild/Native FilePicker | &amp;#039;&amp;#039;&amp;#039;Native FilePicker (click me to know more) &amp;#039;&amp;#039;&amp;#039;]]&amp;lt;/div&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Soon : new salframe implementation ( using HIFramework )&lt;br /&gt;
&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== &amp;#039;&amp;#039;&amp;#039;Known build issues &amp;#039;&amp;#039;&amp;#039;==&lt;br /&gt;
&lt;br /&gt;
Since latest resync, no build issues have been reported.&lt;br /&gt;
&lt;br /&gt;
== &amp;#039;&amp;#039;&amp;#039;Doing the build (about 4,5 GB)&amp;#039;&amp;#039;&amp;#039; ==&lt;br /&gt;
&lt;br /&gt;
Fine, now we have a (hopefully) working &amp;#039;build.sh&amp;#039; in the config_office subdir. We need to run it beforehand:&lt;br /&gt;
&lt;br /&gt;
 cd src680-m222/config_office/&lt;br /&gt;
 ./build.sh&lt;br /&gt;
&lt;br /&gt;
This will setup the necessary includefiles and create a couple of files in the &amp;#039;&amp;#039;&amp;#039;parent&amp;#039;&amp;#039;&amp;#039; directory (bootstrap, MacOSXPPCEnv.Set.sh, MacOSXPPCEnv.Set). If you are using the sh, ksh or bash you only need to take care for &amp;#039;MacOSXPPCEnv.Set.sh&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
Now we need to get back to our base-directory, run the bootstrap script, source our Enviroment (MacOSXPPCEnv.Set.sh) and finally start the build-process:&lt;br /&gt;
&lt;br /&gt;
On PowerPC:&lt;br /&gt;
&lt;br /&gt;
 cd ..&lt;br /&gt;
 ./bootstrap&lt;br /&gt;
 source MacOSXPPCEnv.Set.sh&lt;br /&gt;
 cd instsetoo_native&lt;br /&gt;
 build --all -P2&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Or (on Mac Intel): &lt;br /&gt;
&lt;br /&gt;
 cd ..&lt;br /&gt;
 ./bootstrap&lt;br /&gt;
 source MacOSXX86Env.Set.sh&lt;br /&gt;
 cd instsetoo_native&lt;br /&gt;
 build --all -P4&lt;br /&gt;
&lt;br /&gt;
The main purpose of the &amp;#039;&amp;#039;&amp;#039;boostrap&amp;#039;&amp;#039;&amp;#039; script is to build (if necessary) the dmake utility used. Dmake once was a unix make-clone made by wticorp but got incorporated into OpenOffice since it was orphaned. For more information about dmake, it&amp;#039;s history and manpage have a look here: http://tools.openoffice.org/dmake/index.html&lt;br /&gt;
&lt;br /&gt;
Sourcing MacOSXPPCEnv.Set.sh is very important not only for building but also for &amp;#039;&amp;#039;&amp;#039;running&amp;#039;&amp;#039;&amp;#039; svdem later on. Here all the Environment-Variables for the Build will be set up. For a detailed description see [[Environment_Variables]]. Please note that on Intel machines, &amp;#039;MacOSXPPCEnv.Set&amp;#039; should be substituted with &amp;#039;MacOSXX86Env.Set&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
This Build process takes on my box (Dual 1.8 GHz G5, 1.5GB RAM) roughly 10 hours, and 3 to 6 hours on Mac Intel. Be patient.&lt;br /&gt;
&lt;br /&gt;
== &amp;#039;&amp;#039;&amp;#039;Installing, preparing and running OpenOffice.org&amp;#039;&amp;#039;&amp;#039; ==&lt;br /&gt;
&lt;br /&gt;
===&amp;#039;&amp;#039;&amp;#039; Find the Bundle&amp;#039;&amp;#039;&amp;#039; ===&lt;br /&gt;
&lt;br /&gt;
Once the build completed, the Final product ( en-US version ) is named :  OpenOffice.org-2.3.0_en-US.dmg ( for version 2.3.0 e.g.) &lt;br /&gt;
&lt;br /&gt;
And is located in instsetoo_native/unxmacxi.pro/OpenOffice/install/en-US  directory ( replace en-US with your locale )&lt;br /&gt;
&lt;br /&gt;
[[Image:Bundle_location.jpg]]&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
=== &amp;#039;&amp;#039;&amp;#039;Run the soffice.bin&amp;#039;&amp;#039;&amp;#039; ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
In one line :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;big&amp;gt;&amp;#039;&amp;#039;&amp;#039;Double click the .dmg , drag the OpenOffice.org icon in the folder you want, and double click to run it !!&amp;#039;&amp;#039;&amp;#039;&amp;lt;/big&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Note : soffice.bin leads XCode to not work (because of the dot in the name). The issue has been reported to xcode-users list.&lt;br /&gt;
 &lt;br /&gt;
We&amp;#039;re nearly through, let&amp;#039;s fire-off the binary:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
But a lot has to be done, and if you want to trace (using gdb e.g.), just do:&lt;br /&gt;
&lt;br /&gt;
cd &amp;lt;INSTALL_DIR&amp;gt;/OpenOffice.org\ 2.3.app/Contents/MacOS&lt;br /&gt;
&lt;br /&gt;
and run:&lt;br /&gt;
&lt;br /&gt;
gdb --args soffice.bin&lt;br /&gt;
&lt;br /&gt;
(add any breakpoint you want)&lt;br /&gt;
&lt;br /&gt;
r to run OpenOffice.org&lt;br /&gt;
&lt;br /&gt;
=== Use vcl menubar and / or vcl menus ===&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Native menus are defaults. If you want to use vcl menus, do:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
AQUA_NATIVE_MENUS=FALSE ./soffice.bin&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Note: options to not recover is  -norestore , and to bypass the user informations to fill in, use -nofirststartwizard&lt;br /&gt;
&lt;br /&gt;
AQUA_NATIVE_MENUS=FALSE ./soffice.bin -nofirststartwizard -norestore&lt;br /&gt;
&lt;br /&gt;
You can also insert environement variables in a Dictionary Class of Info.plist located in the Contents directory of OpenOffice.org bundle.&lt;br /&gt;
&lt;br /&gt;
For example, you can add the following XML in a text editor (or make it generated by Property List Editor) in your Info.plist :&lt;br /&gt;
&lt;br /&gt;
&amp;lt;key&amp;gt;LSEnvironment&amp;lt;/key&amp;gt;&lt;br /&gt;
&amp;lt;dict&amp;gt;&lt;br /&gt;
       &amp;lt;key&amp;gt;AQUA_NATIVE_MENUS&amp;lt;/key&amp;gt;&lt;br /&gt;
       &amp;lt;string&amp;gt;TRUE&amp;lt;/string&amp;gt;&lt;br /&gt;
       &amp;lt;key&amp;gt;OOO_DISABLE_RECOVERY&amp;lt;/key&amp;gt;&lt;br /&gt;
       &amp;lt;string&amp;gt;TRUE&amp;lt;/string&amp;gt;&lt;br /&gt;
       &amp;lt;key&amp;gt;SAL_NO_NWF&amp;lt;/key&amp;gt;&lt;br /&gt;
        &amp;lt;string&amp;gt;TRUE&amp;lt;/string&amp;gt;&lt;br /&gt;
&amp;lt;dict&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Notice that in order to work, the OOO_DISABLE_RECOVERY variable detection must be manually inserted in OOo code using the following patch :&lt;br /&gt;
http://www.go-oo.org/patches/src680/disable-recovery.diff&lt;br /&gt;
&lt;br /&gt;
This patch is outdated, but you can make the modifications yourself.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Notice the enviroment variable here. AQUA_NATIVE_MENUS is experimental stuff created by Pavel, SAL_NO_NWF was created some times ago, and is located in vcl/source/window/window.cxx . At the moment we have:&lt;br /&gt;
&lt;br /&gt;
{| border=&amp;quot;1&amp;quot; cellpadding=&amp;quot;15&amp;quot; cellspacing=&amp;quot;0&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
! Variable || Function&lt;br /&gt;
|-&lt;br /&gt;
| SAL_NO_NWF=TRUE  || disable native controls code&lt;br /&gt;
|-&lt;br /&gt;
| AQUA_NATIVE_MENUS=FALSE || disable native menus code&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
Both changes are marked with comments in the source code, and when we remove them in the future, native controls and native menus will be enabled by default.&lt;br /&gt;
&lt;br /&gt;
== &amp;#039;&amp;#039;&amp;#039;Debug and contribute &amp;#039;&amp;#039;&amp;#039; ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div align=&amp;quot;left&amp;quot; style=&amp;quot;color:blue; font-size:18px&amp;quot;&amp;gt;&amp;#039;&amp;#039;&amp;#039;See [[MacOSX_Debug_OpenOffice.org_using_XCode]]&amp;#039;&amp;#039;&amp;#039;&amp;lt;/div&amp;gt;&amp;lt;br&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;div align=&amp;quot;left&amp;quot; style=&amp;quot;color:blue; font-size:18px&amp;quot;&amp;gt;You want to debug using Xemacs ?&amp;lt;/div&amp;gt;&amp;lt;br&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Michael Sicotte wrote a very usefull blog entry about : &amp;#039;&amp;#039;&amp;#039;[http://www.mikesicotte.com/2007/02/21/debugging-ooo-with-xemacs-and-gdb debugging OOo with XEmacs and GDB on Mac OS X]&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
== &amp;#039;&amp;#039;&amp;#039;External links&amp;#039;&amp;#039;&amp;#039; ==&lt;br /&gt;
&lt;br /&gt;
# [http://www.openoffice.org/issues/query.cgi Bug Database]&lt;br /&gt;
# Mailinglist: [http://porting.openoffice.org/servlets/ProjectMailingListList mac@porting.openoffice.org]  (subscribe is mandatory )&lt;br /&gt;
# IRC Meeting-Logs (#ooo_macport@freenode.org): [[Previous_Mac_Meeting_logs]] [[MacOSXPortMeetings]]&lt;br /&gt;
# TX20: http://eric.bachard.free.fr/UTBM_TX20/reports/Carbon_vcl.pdf&lt;br /&gt;
# OpenOffice Source Directory Structure: http://wiki.services.openoffice.org/wiki/Source_code_directories&lt;br /&gt;
# Pavels Patch Wiki: http://blog.janik.cz/&lt;br /&gt;
# Eric Bachard Wiki: http://wiki.services.openoffice.org/wiki/User:Ericb&lt;br /&gt;
# Sebastien Plisson Wiki: http://splisson.blogspot.com/&lt;br /&gt;
# Christian Lippka Wiki: http://wiki.services.openoffice.org/wiki/User:CL&lt;br /&gt;
# Carbon: http://developer.apple.com/carbon&lt;br /&gt;
# EIS: http://eis.services.openoffice.org/EIS2/servlet/Logon&lt;br /&gt;
# Runtime Configuration: http://developer.apple.com/documentation/MacOSX/Conceptual/BPRuntimeConfig/index.html&lt;br /&gt;
# OpenOffice Domain Developer http://wiki.services.openoffice.org/wiki/DomainDeveloper&lt;br /&gt;
&lt;br /&gt;
== &amp;#039;&amp;#039;&amp;#039;Screenshots&amp;#039;&amp;#039;&amp;#039; ==&lt;br /&gt;
&lt;br /&gt;
# Eric Bachard screenshots (some are from Stephan Schaefer) http://eric.bachard.free.fr/mac/aquavcl/screenshots/&lt;br /&gt;
# Most recent: http://eric.bachard.free.fr/mac/aquavcl/screenshots/aqua_menus_05_nov_06/&lt;br /&gt;
# Pavel Janik screenshots http://blog.janik.cz/images/MacOSX/2006-08-10&lt;br /&gt;
# Important screenshot (eventloop issue): http://blog.janik.cz/images/MacOSX/  =&amp;gt; See: OOoMenus-separator-and-disabled_entries.png&lt;br /&gt;
# Aqua look (the begining): &lt;br /&gt;
http://eric.bachard.free.fr/mac/aquavcl/screenshots/mars2007/combobox_search_and_replace02_14mars07.jpg&lt;br /&gt;
&lt;br /&gt;
More menus: http://eric.bachard.free.fr/mac/aquavcl/screenshots/aqua_menus_05_nov_06/index.html&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
[[Category:MacOSX]]&lt;br /&gt;
[[Category:Porting]]&lt;br /&gt;
[[Category:Development]]&lt;br /&gt;
[[Category:Aqua]]&lt;/div&gt;</summary>
		<author><name>Ybart</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Mac_OS_X_Porting_-_Native_Printing&amp;diff=32258</id>
		<title>Mac OS X Porting - Native Printing</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Mac_OS_X_Porting_-_Native_Printing&amp;diff=32258"/>
		<updated>2007-05-14T20:42:17Z</updated>

		<summary type="html">&lt;p&gt;Ybart: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page is dedicated to the native printing implementation in OpenOffice.org for Mac OS X&lt;br /&gt;
&lt;br /&gt;
== What we want to do ? ==&lt;br /&gt;
The final goal of this project is to have the native printing support on Mac OS X.&lt;br /&gt;
&lt;br /&gt;
=== What we have now and what we don&amp;#039;t ? ===&lt;br /&gt;
Currently we simply have a generic printing support which works with X11. There is also printing support implemented for Windows. This means that we have already a way to implement our printing support for Aqua without breaking OpenOffice.org as we have already environment plug-ins.&lt;br /&gt;
&lt;br /&gt;
However, we have only one Print Dialog and one Printer Setup dialog for all environments.&lt;br /&gt;
&lt;br /&gt;
Tu sum up : we have a starting point to implement low-level printing support using the native API. We only have to implement the native code. But &amp;#039;&amp;#039;&amp;#039;we have nothing for the dialogs&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
=== What the users want ? ===&lt;br /&gt;
The user wants to be able to print with OpenOffice.org the same way he does with its other natives applications. &lt;br /&gt;
&lt;br /&gt;
For us, this means using a native printing dialog. Then, we will also need to implement low-level printing using OS API because, without that the user might not be able to use every setting available in the native dialog. &lt;br /&gt;
&lt;br /&gt;
=== What will be even better ? ===&lt;br /&gt;
Using UNO. This will allow other platform developpers to use the same code to implement their native dialogs.&lt;br /&gt;
&lt;br /&gt;
== OpenOffice.org side ==&lt;br /&gt;
This part describes what can be found in the OOo APIs, how it is implemented and how it will be changed.&lt;br /&gt;
&lt;br /&gt;
=== OOo print process ===&lt;br /&gt;
I will try to share the few thing I understood about the way Writer prints document.&lt;br /&gt;
&lt;br /&gt;
First I need to locate the print menu item in the sw module (sw stands for Star Writer). For this, I need to know where in sw the menubar is built. I did found the menubar, but not how the menu item was linked to the print operation. Instead, I have found a method PrintPages implemented in sw module. The stack may look like that :&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;SwXTextDocument&amp;#039;&amp;#039;&amp;#039;::printPages()&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;ViewShell&amp;#039;&amp;#039;&amp;#039;::executeSlot(aReq)&lt;br /&gt;
* ...&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;SwView&amp;#039;&amp;#039;&amp;#039;::ExecutePrint()&lt;br /&gt;
* ...&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;SwXTextDocument&amp;#039;&amp;#039;&amp;#039;::render()&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;ViewShell&amp;#039;&amp;#039;&amp;#039;::Prt()&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;OutputDevice&amp;#039;&amp;#039;&amp;#039;:: ...&lt;br /&gt;
&lt;br /&gt;
TODO : Complete the stack trace&lt;br /&gt;
&lt;br /&gt;
There is many holes in the stack but we get the idea. The &amp;#039;&amp;#039;&amp;#039;OuputDevice&amp;#039;&amp;#039;&amp;#039; is in fact our &amp;#039;&amp;#039;&amp;#039;Printer.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
[[Image:Printing_model.png]]&lt;br /&gt;
&lt;br /&gt;
1. The user Application creates a print dialog or a print setup dialog. For this, it needs to call svtools. To be a bit more precise, it creates a new instance of &amp;#039;&amp;#039;&amp;#039;PrintDialog&amp;#039;&amp;#039;&amp;#039; or of &amp;#039;&amp;#039;&amp;#039;PrintDialogSetup&amp;#039;&amp;#039;&amp;#039;, it associates a Printer instance to it, then, it calls the Execute method from &amp;#039;&amp;#039;&amp;#039;PrintDialog&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;PrintSetupDialog&amp;#039;&amp;#039;&amp;#039;. This operation shows the dialog (using the &amp;#039;&amp;#039;Execute&amp;#039;&amp;#039; method from &amp;#039;&amp;#039;&amp;#039;ModalDialog&amp;#039;&amp;#039;&amp;#039;, which is in vcl) and sets the Printer Data correctly with the method &amp;#039;&amp;#039;setPrinterProps&amp;#039;&amp;#039;. Do do the real display of the dialog, it uses &amp;#039;&amp;#039;&amp;#039;SalFrame&amp;#039;&amp;#039;&amp;#039;&amp;#039;s &amp;#039;&amp;#039;Show()&amp;#039;&amp;#039; method, which can be X11SalFrame, &amp;#039;&amp;#039;&amp;#039;AquaSalFrame&amp;#039;&amp;#039;&amp;#039;, etc.&lt;br /&gt;
&lt;br /&gt;
2. Svtools is responsible for asking to the user the requested information about printing options. Then, it returns them ot the user application.&lt;br /&gt;
&lt;br /&gt;
3. The user application has now everything needed to print the document. So, it asks VCL to draw pixels, lines, characters, etc on an &amp;#039;&amp;#039;&amp;#039;OutputDevice&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
At this point, I don&amp;#039;t know exactly where the &amp;#039;&amp;#039;&amp;#039;OutputDevice&amp;#039;&amp;#039;&amp;#039; is instancied (who decides that it would be a screen, an Aqua printer or a PostScript printer. This is not really important since we understand the main idea of how printing works.&lt;br /&gt;
&lt;br /&gt;
[[Image:Printing_model_step_4.png]]&lt;br /&gt;
&lt;br /&gt;
4. After that VCL relies on its Graphic Context to really draws (i.e. make the OS really draws) the lines and pixels on the screen or on the print device.&lt;br /&gt;
&lt;br /&gt;
=== Concerned OOo modules ===&lt;br /&gt;
* psprint&lt;br /&gt;
* vcl&lt;br /&gt;
* svtools&lt;br /&gt;
&lt;br /&gt;
=== VCL ===&lt;br /&gt;
What we know about [[vcl]].&lt;br /&gt;
&lt;br /&gt;
==== SalPrinter class ====&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;SalPrinter&amp;#039;&amp;#039;&amp;#039; is a virtual class intended for managing print jobs. It is composed of virtual fonctions, and a dummy constructor.&lt;br /&gt;
This class is inherited by PspSalPrinter, WinSalPrinter, and of course by &amp;#039;&amp;#039;&amp;#039;AquaSalPrinter&amp;#039;&amp;#039;&amp;#039; (see [[#AquaSalPrinter class|AquaSalPrinter class]]).&lt;br /&gt;
&lt;br /&gt;
Its header is located in vcl/inc/salprn.hxx&lt;br /&gt;
It has no implementation file.&lt;br /&gt;
&lt;br /&gt;
[[Image:UML_class_SalPrinter.png]]&lt;br /&gt;
&lt;br /&gt;
==== PspSalPrinter class ====&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;PspSalPrinter&amp;#039;&amp;#039;&amp;#039; means PostScript Print System Abstraction Layer Printer. Its implementation is located in vcl/unx/source/gdi/salprnpsp.cxx. As the name suggests it relies on features psprint module.&lt;br /&gt;
&lt;br /&gt;
TODO : Discuss about &amp;#039;&amp;#039;&amp;#039;PspSalPrinter&amp;#039;&amp;#039;&amp;#039; implementation.&lt;br /&gt;
&lt;br /&gt;
==== Printer class ====&lt;br /&gt;
This is an abstraction class of a printer driver. You can entirely set up the printer there and start print jobs. What we need here is to make our native dialog access to this Printer. The we will need to make this class access to OS API rather than psprint. &lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;AquaSalPrinter&amp;#039;&amp;#039;&amp;#039; class is located in vcl/aqua/source/gdi/print.cxx&lt;br /&gt;
&lt;br /&gt;
[[Image:Printer_class_description.png]]&lt;br /&gt;
&lt;br /&gt;
This class inherits of &amp;#039;&amp;#039;&amp;#039;OutputDevice&amp;#039;&amp;#039;&amp;#039; and is derivated in &amp;#039;&amp;#039;&amp;#039;ImplQPrinter.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;QueueInfo&amp;#039;&amp;#039;&amp;#039; class - This class is related to the &amp;#039;&amp;#039;&amp;#039;Printer&amp;#039;&amp;#039;&amp;#039; class. It is used to store information about printers (name, driver, location, comment as strings, and number of Jobs, and a status code).&lt;br /&gt;
&lt;br /&gt;
==== OutputDevice class ====&lt;br /&gt;
This class allows applications such as Writer to draw graphics elements (pixels, lines, rects, characters, strings, etc...).&lt;br /&gt;
&lt;br /&gt;
This class is located in vcl/source/gdi/outdev.cxx, vcl/source/gdi/outdev[2-6].cxx&lt;br /&gt;
&lt;br /&gt;
At this time, we don&amp;#039;t need to know the details of this class. We will focus on it when we will use the Carbon Printing API.&lt;br /&gt;
&lt;br /&gt;
==== SalGraphics class ====&lt;br /&gt;
This class is responsible to translate the abstract drawing calls to concrete OS calls.&lt;br /&gt;
&lt;br /&gt;
==== PspGraphics ====&lt;br /&gt;
The class I need to reimplement using Aqua printing primitives...&lt;br /&gt;
It will probably called &amp;#039;&amp;#039;&amp;#039;AquaPrintGraphics&amp;#039;&amp;#039;&amp;#039;...&lt;br /&gt;
&lt;br /&gt;
==== AquaSalPrinter class ====&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;AquaSalPrinter&amp;#039;&amp;#039;&amp;#039; class is located in vcl/aqua/source/gdi/salprn.cxx&lt;br /&gt;
&lt;br /&gt;
Headers are in :&lt;br /&gt;
 vcl/inc/salinst.hxx  &lt;br /&gt;
 vcl/inc/salgdi.hxx    &lt;br /&gt;
 vcl/inc/salprn.hxx&lt;br /&gt;
&lt;br /&gt;
 Aqua implementation :&lt;br /&gt;
 vcl/aqua/inc/salprn.h  (AquaSalPrinter class implementation, inherits from &amp;#039;&amp;#039;&amp;#039;SalPrinter&amp;#039;&amp;#039;&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
=== psprint ===&lt;br /&gt;
What we know about psprint.&lt;br /&gt;
&lt;br /&gt;
=== svtools ===&lt;br /&gt;
What we need to know about svtools. Mostly it provides us the Print Dialog, and some other Print related dialogs.&lt;br /&gt;
&lt;br /&gt;
==== PrintDialog class ====&lt;br /&gt;
This class is responsible for drawing the print dialog we usaually view when we choose the Print option of the File menu.&lt;br /&gt;
The current implementation uses this class to draw the print dialog. In our Aqua native implementation, we want to use the on provided by Carbon API. To achieve this, we want to know the functionality of this class, and let carbon manage the functionality maybe at this level or maybe in a other lever (higher or lower). We also need to know how this class provides information to the Printer instance.&lt;br /&gt;
&lt;br /&gt;
* The header of this class is located in svtools/inc/printdlg.hxx&lt;br /&gt;
* The implementation of this class is located in svtools/source/dialogs/printdlg.cxx&lt;br /&gt;
&lt;br /&gt;
This class is a derivate of &amp;#039;&amp;#039;&amp;#039;ModalDialog&amp;#039;&amp;#039;&amp;#039; class. &lt;br /&gt;
&lt;br /&gt;
It contains all the controls used by the dialog which are either :&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;FixedImage&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;FixedLine&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;FixedText&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;FixedInfo&amp;#039;&amp;#039;&amp;#039; : it is a child of &amp;#039;&amp;#039;&amp;#039;FixedText&amp;#039;&amp;#039;&amp;#039; and is defined in svtools/inc/stdctrl.hxx. It is nothing more than a &amp;#039;&amp;#039;&amp;#039;FixedText&amp;#039;&amp;#039;&amp;#039; with the info style applied (same behaviour).&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;ListBox&amp;#039;&amp;#039;&amp;#039; : maLbName - List-box used to store the available printers.&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Edit&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;NumericField&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;CheckBox&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;PushButton&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;RadioButton&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;OKButton&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;CancelButton&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;HelpButton&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
These controls are used to allow the user to interact with the dialog. We need to know how they are used by the dialog to retrieve the user-provided information. What is involved to display them, and how the look &amp;amp; feel is implemented is not interesting at this point, since we only want to know what the dialog actually does.&lt;br /&gt;
&lt;br /&gt;
Other weird things that are not child of control class and that I don&amp;#039;t currently know why it is usefull :&lt;br /&gt;
* AutoTimer&lt;br /&gt;
&lt;br /&gt;
TODO : List of all user-related information stored by this class and sent to the Printer. Add more details on the vcl controls involved (what they are, at least for the non obvious ones).&lt;br /&gt;
&lt;br /&gt;
The class contains also fields used to store the real information provided by the controls (Mostly USHORT and BOOL). There is also a &amp;#039;&amp;#039;&amp;#039;XubString&amp;#039;&amp;#039;&amp;#039; instance and a &amp;#039;&amp;#039;&amp;#039;PrintDialogRange&amp;#039;&amp;#039;&amp;#039; instance used to store range information.&lt;br /&gt;
&lt;br /&gt;
Of course, this class contains an &amp;#039;&amp;#039;&amp;#039;Printer&amp;#039;&amp;#039;&amp;#039; instance and a &amp;#039;&amp;#039;&amp;#039;SvtPtinterImpl&amp;#039;&amp;#039;&amp;#039; instance in order to set the printer functionality.&lt;br /&gt;
&lt;br /&gt;
There is also internal methods, and links to the Option handler and the OK handler.&lt;br /&gt;
&lt;br /&gt;
The public methods are mostly getters and setters, I won&amp;#039;t detail it since I have already provided information about the private attributes, and they do nothing to the Printer instance.&lt;br /&gt;
&lt;br /&gt;
TODO : details the implementation of this class (interesting methods : &amp;#039;&amp;#039;ImplGetFileName&amp;#039;&amp;#039;, IMPL_LINK(PrintDialog, ImplModifyControlHdl, void*, p)&lt;br /&gt;
&lt;br /&gt;
For Aqua port, we need to reimplement this class in order to make it displays the native Aqua Print Dialog that will be provided by the Carbon API, and save information that was previously provided by children of &amp;#039;&amp;#039;&amp;#039;Control&amp;#039;&amp;#039;&amp;#039; class. We should also disable the Printing options provided by the Aqua dialog that are not provided by the Printer class (the information we cannot currently store).&lt;br /&gt;
&lt;br /&gt;
==== Print Setup file ====&lt;br /&gt;
* svtools/inc/prnsetup.hxx&lt;br /&gt;
* svtools/source/dialogs/prnsetup.hxx&lt;br /&gt;
&lt;br /&gt;
Utility functions : &lt;br /&gt;
* &amp;#039;&amp;#039;ImplFillPrnDlgListBox&amp;#039;&amp;#039;(const &amp;#039;&amp;#039;&amp;#039;Printer&amp;#039;&amp;#039;&amp;#039; *, &amp;#039;&amp;#039;&amp;#039;ListBox&amp;#039;&amp;#039;&amp;#039; *, &amp;#039;&amp;#039;&amp;#039;PushButton&amp;#039;&amp;#039;&amp;#039; *)&lt;br /&gt;
This method fills the &amp;#039;&amp;#039;&amp;#039;Printer&amp;#039;&amp;#039;&amp;#039; list-box with the QueueInfo provided by the &amp;#039;&amp;#039;&amp;#039;Printer&amp;#039;&amp;#039;&amp;#039; instance provided in argument. It then enables the OK button if the list is not empty.&lt;br /&gt;
&lt;br /&gt;
== Mac OS X API side ==&lt;br /&gt;
This part describes what can be used and how we intend to use it.&lt;br /&gt;
&lt;br /&gt;
The strategy is to first use the Carbon API to get Print Information and to provide an Aqua User Inerface for printing. Then, we will try to replace the current printing API to the native one, allowing to reduce dependencies, and the total package size.&lt;br /&gt;
&lt;br /&gt;
Carbon provides multiple way for us to print. We might consider every of different approaches :&lt;br /&gt;
* Printing using psprint. We only get settings from the Carbon Print Dialog and the Carbon Print Setup Dialog with the function PMGetPrintSettingsExtendedData (for example) and then we send the obtained parameters to our SalPrinter.&lt;br /&gt;
* Using the PMPrintToFile function (OpenOffice.org provides a postcript version of the document, and then, Carbon handles the print operation)&lt;br /&gt;
* Printing using a QuickDraw graphic context [http://developer.apple.com/documentation/Carbon/Conceptual/CPM_Concepts/cpm_chap3/chapter_3_section_4.html#//apple_ref/doc/uid/TP30000978-TP30000046-TPXREF12 See this link for an example] (As this is a legacy API, we are not enthusiast about using it in OpenOffice.org)&lt;br /&gt;
* Printing using a Quartz 2D graphic context [http://developer.apple.com/documentation/GraphicsImaging/Conceptual/drawingwithquartz2d/index.html More information about Quartz 2D]&lt;br /&gt;
&lt;br /&gt;
We may want to add some features to the Printing dialog provided by Carbon. [http://developer.apple.com/documentation/Printing/Conceptual/ExtPrintingDialogs/index.html This is documented here]&lt;br /&gt;
&lt;br /&gt;
Todo : implement missing methods, using Carbon API&lt;br /&gt;
&lt;br /&gt;
=== Using Aqua Printing Dialogs ===&lt;br /&gt;
&lt;br /&gt;
In a first a approach, we want to use Aqua dialogs and set the &amp;#039;&amp;#039;&amp;#039;SalPrinter&amp;#039;&amp;#039;&amp;#039; instance with the data provided by the dialog.&lt;br /&gt;
&lt;br /&gt;
Then, we want to get rid of the OpenOffice.org print dialog, for this, we need to add a custom print dialog addition to allow user to choose options not provided by Apple Print Dialog, however the behaviour might not be as the user except since we still use CUPS instead of Quartz.&lt;br /&gt;
&lt;br /&gt;
[http://developer.apple.com/documentation/Carbon/Conceptual/CPM_Concepts/index.html?http://developer.apple.com/documentation/Carbon/Conceptual/CPM_Concepts/cpm_chap3/chapter_3_section_1.html#//apple_ref/doc/uid/TP30000046-DontLinkElementID_22 Carbon calls for displaying Print Dialog and Print Setup Dialog]&lt;br /&gt;
&lt;br /&gt;
After this step, we should have a great native interface, now we want to print using Quartz instead of CUPS. To do this, we need to fill the Carbon Print object using the data provided by our Printer instance.&lt;br /&gt;
&lt;br /&gt;
[http://developer.apple.com/documentation/Carbon/Conceptual/CPM_Concepts/cpm_chap4/chapter_4_section_3.html Carbon Calls for retrieving Print Data and Page Setup data]&lt;br /&gt;
&lt;br /&gt;
We need then to hook Sal Graphic context primitives to the Quartz ones.&lt;br /&gt;
&lt;br /&gt;
=== Using Quartz Graphic Context to Print ===&lt;br /&gt;
&lt;br /&gt;
== Screenshots - Status ==&lt;br /&gt;
&lt;br /&gt;
http://eric.bachard.free.fr/mac/aquavcl/screenshots/printing/native_printing/native_printing_dialog.png&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
=== Link for Mac OS X API documentation  ===&lt;br /&gt;
http://developer.apple.com/documentation/Carbon/Reference/CarbonPrintingManager_Ref/index.html&lt;br /&gt;
&lt;br /&gt;
=== Starting point for documentation ===&lt;br /&gt;
http://developer.apple.com/documentation/Carbon/Printing-date.html#//apple_ref/doc/uid/TP30000440-TP30000420-TP30000455&lt;br /&gt;
http://developer.apple.com/documentation/Carbon/Conceptual/CPM_Concepts/cpm_chap4/chapter_4_section_1.html&lt;br /&gt;
http://developer.apple.com/samplecode/Carbon/idxPrinting-date.html&lt;br /&gt;
http://developer.apple.com/referencelibrary/Carbon/idxPrinting-date.html&lt;br /&gt;
&lt;br /&gt;
This work is part of http://wiki.services.openoffice.org/wiki/Mac_OS_X_Porting_-_Work_Areas/Todo%27s&lt;br /&gt;
&lt;br /&gt;
Created: [[User:Ericb|Ericb]] 19:33, 4 June 2006 (CEST)&lt;br /&gt;
&lt;br /&gt;
Last modification: [[User:Ybart|ybart]] 0:00, 16 October 2006 (CEST)&lt;br /&gt;
&lt;br /&gt;
[[Category:Porting]]&lt;br /&gt;
[[Category:Aqua]]&lt;br /&gt;
[[Category:MacOSX]]&lt;/div&gt;</summary>
		<author><name>Ybart</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Mac_OS_X_Porting_-_Native_Printing&amp;diff=31936</id>
		<title>Mac OS X Porting - Native Printing</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Mac_OS_X_Porting_-_Native_Printing&amp;diff=31936"/>
		<updated>2007-05-10T09:57:52Z</updated>

		<summary type="html">&lt;p&gt;Ybart: /* Mac OS X API side */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page is dedicated to the native printing implementation in OpenOffice.org for Mac OS X&lt;br /&gt;
&lt;br /&gt;
== What we want to do ? ==&lt;br /&gt;
The final goal of this project is to have the native printing support on Mac OS X.&lt;br /&gt;
&lt;br /&gt;
=== What we have now and what we don&amp;#039;t ? ===&lt;br /&gt;
Currently we simply have a generic printing support which works with X11. There is also printing support implemented for Windows. This means that we have already a way to implement our printing support for Aqua without breaking OpenOffice.org as we have already environment plug-ins.&lt;br /&gt;
&lt;br /&gt;
However, we have only one Print Dialog and one Printer Setup dialog for all environments.&lt;br /&gt;
&lt;br /&gt;
Tu sum up : we have a starting point to implement low-level printing support using the native API. We only have to implement the native code. But &amp;#039;&amp;#039;&amp;#039;we have nothing for the dialogs&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
=== What the users want ? ===&lt;br /&gt;
The user wants to be able to print with OpenOffice.org the same way he does with its other natives applications. &lt;br /&gt;
&lt;br /&gt;
For us, this means using a native printing dialog. Then, we will also need to implement low-level printing using OS API because, without that the user might not be able to use every setting available in the native dialog. &lt;br /&gt;
&lt;br /&gt;
=== What will be even better ? ===&lt;br /&gt;
Using UNO. This will allow other platform developpers to use the same code to implement their native dialogs.&lt;br /&gt;
&lt;br /&gt;
== OpenOffice.org side ==&lt;br /&gt;
This part describes what can be found in the OOo APIs, how it is implemented and how it will be changed.&lt;br /&gt;
&lt;br /&gt;
=== OOo print process ===&lt;br /&gt;
I will try to share the few thing I understood about the way Writer prints document.&lt;br /&gt;
&lt;br /&gt;
First I need to locate the print menu item in the sw module (sw stands for Star Writer). For this, I need to know where in sw the menubar is built. I did found the menubar, but not how the menu item was linked to the print operation. Instead, I have found a method PrintPages implemented in sw module. The stack may look like that :&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;SwXTextDocument&amp;#039;&amp;#039;&amp;#039;::printPages()&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;ViewShell&amp;#039;&amp;#039;&amp;#039;::executeSlot(aReq)&lt;br /&gt;
* ...&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;SwView&amp;#039;&amp;#039;&amp;#039;::ExecutePrint()&lt;br /&gt;
* ...&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;SwXTextDocument&amp;#039;&amp;#039;&amp;#039;::render()&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;ViewShell&amp;#039;&amp;#039;&amp;#039;::Prt()&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;OutputDevice&amp;#039;&amp;#039;&amp;#039;:: ...&lt;br /&gt;
&lt;br /&gt;
TODO : Complete the stack trace&lt;br /&gt;
&lt;br /&gt;
There is many holes in the stack but we get the idea. The &amp;#039;&amp;#039;&amp;#039;OuputDevice&amp;#039;&amp;#039;&amp;#039; is in fact our &amp;#039;&amp;#039;&amp;#039;Printer.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
[[Image:Printing_model.png]]&lt;br /&gt;
&lt;br /&gt;
1. The user Application creates a print dialog or a print setup dialog. For this, it needs to call svtools. To be a bit more precise, it creates a new instance of &amp;#039;&amp;#039;&amp;#039;PrintDialog&amp;#039;&amp;#039;&amp;#039; or of &amp;#039;&amp;#039;&amp;#039;PrintDialogSetup&amp;#039;&amp;#039;&amp;#039;, it associates a Printer instance to it, then, it calls the Execute method from &amp;#039;&amp;#039;&amp;#039;PrintDialog&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;PrintSetupDialog&amp;#039;&amp;#039;&amp;#039;. This operation shows the dialog (using the &amp;#039;&amp;#039;Execute&amp;#039;&amp;#039; method from &amp;#039;&amp;#039;&amp;#039;ModalDialog&amp;#039;&amp;#039;&amp;#039;, which is in vcl) and sets the Printer Data correctly with the method &amp;#039;&amp;#039;setPrinterProps&amp;#039;&amp;#039;. Do do the real display of the dialog, it uses &amp;#039;&amp;#039;&amp;#039;SalFrame&amp;#039;&amp;#039;&amp;#039;&amp;#039;s &amp;#039;&amp;#039;Show()&amp;#039;&amp;#039; method, which can be X11SalFrame, &amp;#039;&amp;#039;&amp;#039;AquaSalFrame&amp;#039;&amp;#039;&amp;#039;, etc.&lt;br /&gt;
&lt;br /&gt;
2. Svtools is responsible for asking to the user the requested information about printing options. Then, it returns them ot the user application.&lt;br /&gt;
&lt;br /&gt;
3. The user application has now everything needed to print the document. So, it asks VCL to draw pixels, lines, characters, etc on an &amp;#039;&amp;#039;&amp;#039;OutputDevice&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
At this point, I don&amp;#039;t know exactly where the &amp;#039;&amp;#039;&amp;#039;OutputDevice&amp;#039;&amp;#039;&amp;#039; is instancied (who decides that it would be a screen, an Aqua printer or a PostScript printer. This is not really important since we understand the main idea of how printing works.&lt;br /&gt;
&lt;br /&gt;
[[Image:Printing_model_step_4.png]]&lt;br /&gt;
&lt;br /&gt;
4. After that VCL relies on its Graphic Context to really draws (i.e. make the OS really draws) the lines and pixels on the screen or on the print device.&lt;br /&gt;
&lt;br /&gt;
=== Concerned OOo modules ===&lt;br /&gt;
* psprint&lt;br /&gt;
* vcl&lt;br /&gt;
* svtools&lt;br /&gt;
&lt;br /&gt;
=== VCL ===&lt;br /&gt;
What we know about [[vcl]].&lt;br /&gt;
&lt;br /&gt;
==== SalPrinter class ====&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;SalPrinter&amp;#039;&amp;#039;&amp;#039; is a virtual class intended for managing print jobs. It is composed of virtual fonctions, and a dummy constructor.&lt;br /&gt;
This class is inherited by PspSalPrinter, WinSalPrinter, and of course by &amp;#039;&amp;#039;&amp;#039;AquaSalPrinter&amp;#039;&amp;#039;&amp;#039; (see [[#AquaSalPrinter class|AquaSalPrinter class]]).&lt;br /&gt;
&lt;br /&gt;
Its header is located in vcl/inc/salprn.hxx&lt;br /&gt;
It has no implementation file.&lt;br /&gt;
&lt;br /&gt;
[[Image:UML_class_SalPrinter.png]]&lt;br /&gt;
&lt;br /&gt;
==== PspSalPrinter class ====&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;PspSalPrinter&amp;#039;&amp;#039;&amp;#039; means PostScript Print System Abstraction Layer Printer. Its implementation is located in vcl/unx/source/gdi/salprnpsp.cxx. As the name suggests it relies on features psprint module.&lt;br /&gt;
&lt;br /&gt;
TODO : Discuss about &amp;#039;&amp;#039;&amp;#039;PspSalPrinter&amp;#039;&amp;#039;&amp;#039; implementation.&lt;br /&gt;
&lt;br /&gt;
==== Printer class ====&lt;br /&gt;
This is an abstraction class of a printer driver. You can entirely set up the printer there and start print jobs. What we need here is to make our native dialog access to this Printer. The we will need to make this class access to OS API rather than psprint. &lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;AquaSalPrinter&amp;#039;&amp;#039;&amp;#039; class is located in vcl/aqua/source/gdi/print.cxx&lt;br /&gt;
&lt;br /&gt;
[[Image:Printer_class_description.png]]&lt;br /&gt;
&lt;br /&gt;
This class inherits of &amp;#039;&amp;#039;&amp;#039;OutputDevice&amp;#039;&amp;#039;&amp;#039; and is derivated in &amp;#039;&amp;#039;&amp;#039;ImplQPrinter.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;QueueInfo&amp;#039;&amp;#039;&amp;#039; class - This class is related to the &amp;#039;&amp;#039;&amp;#039;Printer&amp;#039;&amp;#039;&amp;#039; class. It is used to store information about printers (name, driver, location, comment as strings, and number of Jobs, and a status code).&lt;br /&gt;
&lt;br /&gt;
==== OutputDevice class ====&lt;br /&gt;
This class allows applications such as Writer to draw graphics elements (pixels, lines, rects, characters, strings, etc...).&lt;br /&gt;
&lt;br /&gt;
This class is located in vcl/source/gdi/outdev.cxx, vcl/source/gdi/outdev[2-6].cxx&lt;br /&gt;
&lt;br /&gt;
At this time, we don&amp;#039;t need to know the details of this class. We will focus on it when we will use the Carbon Printing API.&lt;br /&gt;
&lt;br /&gt;
==== SalGraphics class ====&lt;br /&gt;
This class is responsible to translate the abstract drawing calls to concrete OS calls.&lt;br /&gt;
&lt;br /&gt;
==== PspGraphics ====&lt;br /&gt;
The class I need to reimplement using Aqua printing primitives...&lt;br /&gt;
It will probably called &amp;#039;&amp;#039;&amp;#039;AquaPrintGraphics&amp;#039;&amp;#039;&amp;#039;...&lt;br /&gt;
&lt;br /&gt;
==== AquaSalPrinter class ====&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;AquaSalPrinter&amp;#039;&amp;#039;&amp;#039; class is located in vcl/aqua/source/gdi/salprn.cxx&lt;br /&gt;
&lt;br /&gt;
Headers are in :&lt;br /&gt;
 vcl/inc/salinst.hxx  &lt;br /&gt;
 vcl/inc/salgdi.hxx    &lt;br /&gt;
 vcl/inc/salprn.hxx&lt;br /&gt;
&lt;br /&gt;
 Aqua implementation :&lt;br /&gt;
 vcl/aqua/inc/salprn.h  (AquaSalPrinter class implementation, inherits from &amp;#039;&amp;#039;&amp;#039;SalPrinter&amp;#039;&amp;#039;&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
=== psprint ===&lt;br /&gt;
What we know about psprint.&lt;br /&gt;
&lt;br /&gt;
=== svtools ===&lt;br /&gt;
What we need to know about svtools. Mostly it provides us the Print Dialog, and some other Print related dialogs.&lt;br /&gt;
&lt;br /&gt;
==== PrintDialog class ====&lt;br /&gt;
This class is responsible for drawing the print dialog we usaually view when we choose the Print option of the File menu.&lt;br /&gt;
The current implementation uses this class to draw the print dialog. In our Aqua native implementation, we want to use the on provided by Carbon API. To achieve this, we want to know the functionality of this class, and let carbon manage the functionality maybe at this level or maybe in a other lever (higher or lower). We also need to know how this class provides information to the Printer instance.&lt;br /&gt;
&lt;br /&gt;
* The header of this class is located in svtools/inc/printdlg.hxx&lt;br /&gt;
* The implementation of this class is located in svtools/source/dialogs/printdlg.cxx&lt;br /&gt;
&lt;br /&gt;
This class is a derivate of &amp;#039;&amp;#039;&amp;#039;ModalDialog&amp;#039;&amp;#039;&amp;#039; class. &lt;br /&gt;
&lt;br /&gt;
It contains all the controls used by the dialog which are either :&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;FixedImage&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;FixedLine&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;FixedText&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;FixedInfo&amp;#039;&amp;#039;&amp;#039; : it is a child of &amp;#039;&amp;#039;&amp;#039;FixedText&amp;#039;&amp;#039;&amp;#039; and is defined in svtools/inc/stdctrl.hxx. It is nothing more than a &amp;#039;&amp;#039;&amp;#039;FixedText&amp;#039;&amp;#039;&amp;#039; with the info style applied (same behaviour).&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;ListBox&amp;#039;&amp;#039;&amp;#039; : maLbName - List-box used to store the available printers.&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Edit&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;NumericField&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;CheckBox&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;PushButton&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;RadioButton&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;OKButton&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;CancelButton&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;HelpButton&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
These controls are used to allow the user to interact with the dialog. We need to know how they are used by the dialog to retrieve the user-provided information. What is involved to display them, and how the look &amp;amp; feel is implemented is not interesting at this point, since we only want to know what the dialog actually does.&lt;br /&gt;
&lt;br /&gt;
Other weird things that are not child of control class and that I don&amp;#039;t currently know why it is usefull :&lt;br /&gt;
* AutoTimer&lt;br /&gt;
&lt;br /&gt;
TODO : List of all user-related information stored by this class and sent to the Printer. Add more details on the vcl controls involved (what they are, at least for the non obvious ones).&lt;br /&gt;
&lt;br /&gt;
The class contains also fields used to store the real information provided by the controls (Mostly USHORT and BOOL). There is also a &amp;#039;&amp;#039;&amp;#039;XubString&amp;#039;&amp;#039;&amp;#039; instance and a &amp;#039;&amp;#039;&amp;#039;PrintDialogRange&amp;#039;&amp;#039;&amp;#039; instance used to store range information.&lt;br /&gt;
&lt;br /&gt;
Of course, this class contains an &amp;#039;&amp;#039;&amp;#039;Printer&amp;#039;&amp;#039;&amp;#039; instance and a &amp;#039;&amp;#039;&amp;#039;SvtPtinterImpl&amp;#039;&amp;#039;&amp;#039; instance in order to set the printer functionality.&lt;br /&gt;
&lt;br /&gt;
There is also internal methods, and links to the Option handler and the OK handler.&lt;br /&gt;
&lt;br /&gt;
The public methods are mostly getters and setters, I won&amp;#039;t detail it since I have already provided information about the private attributes, and they do nothing to the Printer instance.&lt;br /&gt;
&lt;br /&gt;
TODO : details the implementation of this class (interesting methods : &amp;#039;&amp;#039;ImplGetFileName&amp;#039;&amp;#039;, IMPL_LINK(PrintDialog, ImplModifyControlHdl, void*, p)&lt;br /&gt;
&lt;br /&gt;
For Aqua port, we need to reimplement this class in order to make it displays the native Aqua Print Dialog that will be provided by the Carbon API, and save information that was previously provided by children of &amp;#039;&amp;#039;&amp;#039;Control&amp;#039;&amp;#039;&amp;#039; class. We should also disable the Printing options provided by the Aqua dialog that are not provided by the Printer class (the information we cannot currently store).&lt;br /&gt;
&lt;br /&gt;
==== Print Setup file ====&lt;br /&gt;
* svtools/inc/prnsetup.hxx&lt;br /&gt;
* svtools/source/dialogs/prnsetup.hxx&lt;br /&gt;
&lt;br /&gt;
Utility functions : &lt;br /&gt;
* &amp;#039;&amp;#039;ImplFillPrnDlgListBox&amp;#039;&amp;#039;(const &amp;#039;&amp;#039;&amp;#039;Printer&amp;#039;&amp;#039;&amp;#039; *, &amp;#039;&amp;#039;&amp;#039;ListBox&amp;#039;&amp;#039;&amp;#039; *, &amp;#039;&amp;#039;&amp;#039;PushButton&amp;#039;&amp;#039;&amp;#039; *)&lt;br /&gt;
This method fills the &amp;#039;&amp;#039;&amp;#039;Printer&amp;#039;&amp;#039;&amp;#039; list-box with the QueueInfo provided by the &amp;#039;&amp;#039;&amp;#039;Printer&amp;#039;&amp;#039;&amp;#039; instance provided in argument. It then enables the OK button if the list is not empty.&lt;br /&gt;
&lt;br /&gt;
== Mac OS X API side ==&lt;br /&gt;
This part describes what can be used and how we intend to use it.&lt;br /&gt;
&lt;br /&gt;
The strategy is to first use the Carbon API to get Print Information and to provide an Aqua User Inerface for printing. Then, we will try to replace the current printing API to the native one, allowing to reduce dependencies, and the total package size.&lt;br /&gt;
&lt;br /&gt;
Carbon provides multiple way for us to print. We might consider every of different approaches :&lt;br /&gt;
* Printing using psprint. We only get settings from the Carbon Print Dialog and the Carbon Print Setup Dialog with the function PMGetPrintSettingsExtendedData (for example) and then we send the obtained parameters to our SalPrinter.&lt;br /&gt;
* Using the PMPrintToFile function (OpenOffice.org provides a postcript version of the document, and then, Carbon handles the print operation)&lt;br /&gt;
* Printing using a QuickDraw graphic context [http://developer.apple.com/documentation/Carbon/Conceptual/CPM_Concepts/cpm_chap3/chapter_3_section_4.html#//apple_ref/doc/uid/TP30000978-TP30000046-TPXREF12 See this link for an example] (As this is a legacy API, we are not enthusiast about using it in OpenOffice.org)&lt;br /&gt;
* Printing using a Quartz 2D graphic context [http://developer.apple.com/documentation/GraphicsImaging/Conceptual/drawingwithquartz2d/index.html More information about Quartz 2D]&lt;br /&gt;
&lt;br /&gt;
We may want to add some features to the Printing dialog provided by Carbon. [http://developer.apple.com/documentation/Printing/Conceptual/ExtPrintingDialogs/index.html This is documented here]&lt;br /&gt;
&lt;br /&gt;
Todo : implement missing methods, using Carbon API&lt;br /&gt;
&lt;br /&gt;
=== Using Aqua Printing Dialogs ===&lt;br /&gt;
&lt;br /&gt;
In a first a approach, we want to use Aqua dialogs and set the &amp;#039;&amp;#039;&amp;#039;SalPrinter&amp;#039;&amp;#039;&amp;#039; instance with the data provided by the dialog.&lt;br /&gt;
&lt;br /&gt;
Then, we want to get rid of the OpenOffice.org print dialog, for this, we need to add a custom print dialog addition to allow user to choose options not provided by Apple Print Dialog, however the behaviour might not be as the user except since we still use CUPS instead of Quartz.&lt;br /&gt;
&lt;br /&gt;
[http://developer.apple.com/documentation/Carbon/Conceptual/CPM_Concepts/index.html?http://developer.apple.com/documentation/Carbon/Conceptual/CPM_Concepts/cpm_chap3/chapter_3_section_1.html#//apple_ref/doc/uid/TP30000046-DontLinkElementID_22 Carbon calls for displaying Print Dialog and Print Setup Dialog]&lt;br /&gt;
&lt;br /&gt;
After this step, we should have a great native interface, now we want to print using Quartz instead of CUPS. To do this, we need to fill the Carbon Print object using the data provided by our Printer instance.&lt;br /&gt;
&lt;br /&gt;
[http://developer.apple.com/documentation/Carbon/Conceptual/CPM_Concepts/cpm_chap4/chapter_4_section_3.html Carbon Calls for retrieving Print Data and Page Setup data]&lt;br /&gt;
&lt;br /&gt;
We need then to hook Sal Graphic context primitives to the Quartz ones.&lt;br /&gt;
&lt;br /&gt;
=== Using Quartz Graphic Context to Print ===&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
=== Link for Mac OS X API documentation  ===&lt;br /&gt;
http://developer.apple.com/documentation/Carbon/Reference/CarbonPrintingManager_Ref/index.html&lt;br /&gt;
&lt;br /&gt;
=== Starting point for documentation ===&lt;br /&gt;
http://developer.apple.com/documentation/Carbon/Printing-date.html#//apple_ref/doc/uid/TP30000440-TP30000420-TP30000455&lt;br /&gt;
http://developer.apple.com/documentation/Carbon/Conceptual/CPM_Concepts/cpm_chap4/chapter_4_section_1.html&lt;br /&gt;
http://developer.apple.com/samplecode/Carbon/idxPrinting-date.html&lt;br /&gt;
http://developer.apple.com/referencelibrary/Carbon/idxPrinting-date.html&lt;br /&gt;
&lt;br /&gt;
This work is part of http://wiki.services.openoffice.org/wiki/Mac_OS_X_Porting_-_Work_Areas/Todo%27s&lt;br /&gt;
&lt;br /&gt;
Created: [[User:Ericb|Ericb]] 19:33, 4 June 2006 (CEST)&lt;br /&gt;
&lt;br /&gt;
Last modification: [[User:Ybart|ybart]] 0:00, 16 October 2006 (CEST)&lt;br /&gt;
&lt;br /&gt;
[[Category:Porting]]&lt;br /&gt;
[[Category:Aqua]]&lt;br /&gt;
[[Category:MacOSX]]&lt;/div&gt;</summary>
		<author><name>Ybart</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Mac_OS_X_Porting_-_Native_Printing&amp;diff=31935</id>
		<title>Mac OS X Porting - Native Printing</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Mac_OS_X_Porting_-_Native_Printing&amp;diff=31935"/>
		<updated>2007-05-10T09:54:56Z</updated>

		<summary type="html">&lt;p&gt;Ybart: /* Mac OS X API side */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page is dedicated to the native printing implementation in OpenOffice.org for Mac OS X&lt;br /&gt;
&lt;br /&gt;
== What we want to do ? ==&lt;br /&gt;
The final goal of this project is to have the native printing support on Mac OS X.&lt;br /&gt;
&lt;br /&gt;
=== What we have now and what we don&amp;#039;t ? ===&lt;br /&gt;
Currently we simply have a generic printing support which works with X11. There is also printing support implemented for Windows. This means that we have already a way to implement our printing support for Aqua without breaking OpenOffice.org as we have already environment plug-ins.&lt;br /&gt;
&lt;br /&gt;
However, we have only one Print Dialog and one Printer Setup dialog for all environments.&lt;br /&gt;
&lt;br /&gt;
Tu sum up : we have a starting point to implement low-level printing support using the native API. We only have to implement the native code. But &amp;#039;&amp;#039;&amp;#039;we have nothing for the dialogs&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
=== What the users want ? ===&lt;br /&gt;
The user wants to be able to print with OpenOffice.org the same way he does with its other natives applications. &lt;br /&gt;
&lt;br /&gt;
For us, this means using a native printing dialog. Then, we will also need to implement low-level printing using OS API because, without that the user might not be able to use every setting available in the native dialog. &lt;br /&gt;
&lt;br /&gt;
=== What will be even better ? ===&lt;br /&gt;
Using UNO. This will allow other platform developpers to use the same code to implement their native dialogs.&lt;br /&gt;
&lt;br /&gt;
== OpenOffice.org side ==&lt;br /&gt;
This part describes what can be found in the OOo APIs, how it is implemented and how it will be changed.&lt;br /&gt;
&lt;br /&gt;
=== OOo print process ===&lt;br /&gt;
I will try to share the few thing I understood about the way Writer prints document.&lt;br /&gt;
&lt;br /&gt;
First I need to locate the print menu item in the sw module (sw stands for Star Writer). For this, I need to know where in sw the menubar is built. I did found the menubar, but not how the menu item was linked to the print operation. Instead, I have found a method PrintPages implemented in sw module. The stack may look like that :&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;SwXTextDocument&amp;#039;&amp;#039;&amp;#039;::printPages()&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;ViewShell&amp;#039;&amp;#039;&amp;#039;::executeSlot(aReq)&lt;br /&gt;
* ...&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;SwView&amp;#039;&amp;#039;&amp;#039;::ExecutePrint()&lt;br /&gt;
* ...&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;SwXTextDocument&amp;#039;&amp;#039;&amp;#039;::render()&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;ViewShell&amp;#039;&amp;#039;&amp;#039;::Prt()&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;OutputDevice&amp;#039;&amp;#039;&amp;#039;:: ...&lt;br /&gt;
&lt;br /&gt;
TODO : Complete the stack trace&lt;br /&gt;
&lt;br /&gt;
There is many holes in the stack but we get the idea. The &amp;#039;&amp;#039;&amp;#039;OuputDevice&amp;#039;&amp;#039;&amp;#039; is in fact our &amp;#039;&amp;#039;&amp;#039;Printer.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
[[Image:Printing_model.png]]&lt;br /&gt;
&lt;br /&gt;
1. The user Application creates a print dialog or a print setup dialog. For this, it needs to call svtools. To be a bit more precise, it creates a new instance of &amp;#039;&amp;#039;&amp;#039;PrintDialog&amp;#039;&amp;#039;&amp;#039; or of &amp;#039;&amp;#039;&amp;#039;PrintDialogSetup&amp;#039;&amp;#039;&amp;#039;, it associates a Printer instance to it, then, it calls the Execute method from &amp;#039;&amp;#039;&amp;#039;PrintDialog&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;PrintSetupDialog&amp;#039;&amp;#039;&amp;#039;. This operation shows the dialog (using the &amp;#039;&amp;#039;Execute&amp;#039;&amp;#039; method from &amp;#039;&amp;#039;&amp;#039;ModalDialog&amp;#039;&amp;#039;&amp;#039;, which is in vcl) and sets the Printer Data correctly with the method &amp;#039;&amp;#039;setPrinterProps&amp;#039;&amp;#039;. Do do the real display of the dialog, it uses &amp;#039;&amp;#039;&amp;#039;SalFrame&amp;#039;&amp;#039;&amp;#039;&amp;#039;s &amp;#039;&amp;#039;Show()&amp;#039;&amp;#039; method, which can be X11SalFrame, &amp;#039;&amp;#039;&amp;#039;AquaSalFrame&amp;#039;&amp;#039;&amp;#039;, etc.&lt;br /&gt;
&lt;br /&gt;
2. Svtools is responsible for asking to the user the requested information about printing options. Then, it returns them ot the user application.&lt;br /&gt;
&lt;br /&gt;
3. The user application has now everything needed to print the document. So, it asks VCL to draw pixels, lines, characters, etc on an &amp;#039;&amp;#039;&amp;#039;OutputDevice&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
At this point, I don&amp;#039;t know exactly where the &amp;#039;&amp;#039;&amp;#039;OutputDevice&amp;#039;&amp;#039;&amp;#039; is instancied (who decides that it would be a screen, an Aqua printer or a PostScript printer. This is not really important since we understand the main idea of how printing works.&lt;br /&gt;
&lt;br /&gt;
[[Image:Printing_model_step_4.png]]&lt;br /&gt;
&lt;br /&gt;
4. After that VCL relies on its Graphic Context to really draws (i.e. make the OS really draws) the lines and pixels on the screen or on the print device.&lt;br /&gt;
&lt;br /&gt;
=== Concerned OOo modules ===&lt;br /&gt;
* psprint&lt;br /&gt;
* vcl&lt;br /&gt;
* svtools&lt;br /&gt;
&lt;br /&gt;
=== VCL ===&lt;br /&gt;
What we know about [[vcl]].&lt;br /&gt;
&lt;br /&gt;
==== SalPrinter class ====&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;SalPrinter&amp;#039;&amp;#039;&amp;#039; is a virtual class intended for managing print jobs. It is composed of virtual fonctions, and a dummy constructor.&lt;br /&gt;
This class is inherited by PspSalPrinter, WinSalPrinter, and of course by &amp;#039;&amp;#039;&amp;#039;AquaSalPrinter&amp;#039;&amp;#039;&amp;#039; (see [[#AquaSalPrinter class|AquaSalPrinter class]]).&lt;br /&gt;
&lt;br /&gt;
Its header is located in vcl/inc/salprn.hxx&lt;br /&gt;
It has no implementation file.&lt;br /&gt;
&lt;br /&gt;
[[Image:UML_class_SalPrinter.png]]&lt;br /&gt;
&lt;br /&gt;
==== PspSalPrinter class ====&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;PspSalPrinter&amp;#039;&amp;#039;&amp;#039; means PostScript Print System Abstraction Layer Printer. Its implementation is located in vcl/unx/source/gdi/salprnpsp.cxx. As the name suggests it relies on features psprint module.&lt;br /&gt;
&lt;br /&gt;
TODO : Discuss about &amp;#039;&amp;#039;&amp;#039;PspSalPrinter&amp;#039;&amp;#039;&amp;#039; implementation.&lt;br /&gt;
&lt;br /&gt;
==== Printer class ====&lt;br /&gt;
This is an abstraction class of a printer driver. You can entirely set up the printer there and start print jobs. What we need here is to make our native dialog access to this Printer. The we will need to make this class access to OS API rather than psprint. &lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;AquaSalPrinter&amp;#039;&amp;#039;&amp;#039; class is located in vcl/aqua/source/gdi/print.cxx&lt;br /&gt;
&lt;br /&gt;
[[Image:Printer_class_description.png]]&lt;br /&gt;
&lt;br /&gt;
This class inherits of &amp;#039;&amp;#039;&amp;#039;OutputDevice&amp;#039;&amp;#039;&amp;#039; and is derivated in &amp;#039;&amp;#039;&amp;#039;ImplQPrinter.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;QueueInfo&amp;#039;&amp;#039;&amp;#039; class - This class is related to the &amp;#039;&amp;#039;&amp;#039;Printer&amp;#039;&amp;#039;&amp;#039; class. It is used to store information about printers (name, driver, location, comment as strings, and number of Jobs, and a status code).&lt;br /&gt;
&lt;br /&gt;
==== OutputDevice class ====&lt;br /&gt;
This class allows applications such as Writer to draw graphics elements (pixels, lines, rects, characters, strings, etc...).&lt;br /&gt;
&lt;br /&gt;
This class is located in vcl/source/gdi/outdev.cxx, vcl/source/gdi/outdev[2-6].cxx&lt;br /&gt;
&lt;br /&gt;
At this time, we don&amp;#039;t need to know the details of this class. We will focus on it when we will use the Carbon Printing API.&lt;br /&gt;
&lt;br /&gt;
==== SalGraphics class ====&lt;br /&gt;
This class is responsible to translate the abstract drawing calls to concrete OS calls.&lt;br /&gt;
&lt;br /&gt;
==== PspGraphics ====&lt;br /&gt;
The class I need to reimplement using Aqua printing primitives...&lt;br /&gt;
It will probably called &amp;#039;&amp;#039;&amp;#039;AquaPrintGraphics&amp;#039;&amp;#039;&amp;#039;...&lt;br /&gt;
&lt;br /&gt;
==== AquaSalPrinter class ====&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;AquaSalPrinter&amp;#039;&amp;#039;&amp;#039; class is located in vcl/aqua/source/gdi/salprn.cxx&lt;br /&gt;
&lt;br /&gt;
Headers are in :&lt;br /&gt;
 vcl/inc/salinst.hxx  &lt;br /&gt;
 vcl/inc/salgdi.hxx    &lt;br /&gt;
 vcl/inc/salprn.hxx&lt;br /&gt;
&lt;br /&gt;
 Aqua implementation :&lt;br /&gt;
 vcl/aqua/inc/salprn.h  (AquaSalPrinter class implementation, inherits from &amp;#039;&amp;#039;&amp;#039;SalPrinter&amp;#039;&amp;#039;&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
=== psprint ===&lt;br /&gt;
What we know about psprint.&lt;br /&gt;
&lt;br /&gt;
=== svtools ===&lt;br /&gt;
What we need to know about svtools. Mostly it provides us the Print Dialog, and some other Print related dialogs.&lt;br /&gt;
&lt;br /&gt;
==== PrintDialog class ====&lt;br /&gt;
This class is responsible for drawing the print dialog we usaually view when we choose the Print option of the File menu.&lt;br /&gt;
The current implementation uses this class to draw the print dialog. In our Aqua native implementation, we want to use the on provided by Carbon API. To achieve this, we want to know the functionality of this class, and let carbon manage the functionality maybe at this level or maybe in a other lever (higher or lower). We also need to know how this class provides information to the Printer instance.&lt;br /&gt;
&lt;br /&gt;
* The header of this class is located in svtools/inc/printdlg.hxx&lt;br /&gt;
* The implementation of this class is located in svtools/source/dialogs/printdlg.cxx&lt;br /&gt;
&lt;br /&gt;
This class is a derivate of &amp;#039;&amp;#039;&amp;#039;ModalDialog&amp;#039;&amp;#039;&amp;#039; class. &lt;br /&gt;
&lt;br /&gt;
It contains all the controls used by the dialog which are either :&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;FixedImage&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;FixedLine&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;FixedText&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;FixedInfo&amp;#039;&amp;#039;&amp;#039; : it is a child of &amp;#039;&amp;#039;&amp;#039;FixedText&amp;#039;&amp;#039;&amp;#039; and is defined in svtools/inc/stdctrl.hxx. It is nothing more than a &amp;#039;&amp;#039;&amp;#039;FixedText&amp;#039;&amp;#039;&amp;#039; with the info style applied (same behaviour).&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;ListBox&amp;#039;&amp;#039;&amp;#039; : maLbName - List-box used to store the available printers.&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Edit&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;NumericField&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;CheckBox&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;PushButton&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;RadioButton&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;OKButton&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;CancelButton&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;HelpButton&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
These controls are used to allow the user to interact with the dialog. We need to know how they are used by the dialog to retrieve the user-provided information. What is involved to display them, and how the look &amp;amp; feel is implemented is not interesting at this point, since we only want to know what the dialog actually does.&lt;br /&gt;
&lt;br /&gt;
Other weird things that are not child of control class and that I don&amp;#039;t currently know why it is usefull :&lt;br /&gt;
* AutoTimer&lt;br /&gt;
&lt;br /&gt;
TODO : List of all user-related information stored by this class and sent to the Printer. Add more details on the vcl controls involved (what they are, at least for the non obvious ones).&lt;br /&gt;
&lt;br /&gt;
The class contains also fields used to store the real information provided by the controls (Mostly USHORT and BOOL). There is also a &amp;#039;&amp;#039;&amp;#039;XubString&amp;#039;&amp;#039;&amp;#039; instance and a &amp;#039;&amp;#039;&amp;#039;PrintDialogRange&amp;#039;&amp;#039;&amp;#039; instance used to store range information.&lt;br /&gt;
&lt;br /&gt;
Of course, this class contains an &amp;#039;&amp;#039;&amp;#039;Printer&amp;#039;&amp;#039;&amp;#039; instance and a &amp;#039;&amp;#039;&amp;#039;SvtPtinterImpl&amp;#039;&amp;#039;&amp;#039; instance in order to set the printer functionality.&lt;br /&gt;
&lt;br /&gt;
There is also internal methods, and links to the Option handler and the OK handler.&lt;br /&gt;
&lt;br /&gt;
The public methods are mostly getters and setters, I won&amp;#039;t detail it since I have already provided information about the private attributes, and they do nothing to the Printer instance.&lt;br /&gt;
&lt;br /&gt;
TODO : details the implementation of this class (interesting methods : &amp;#039;&amp;#039;ImplGetFileName&amp;#039;&amp;#039;, IMPL_LINK(PrintDialog, ImplModifyControlHdl, void*, p)&lt;br /&gt;
&lt;br /&gt;
For Aqua port, we need to reimplement this class in order to make it displays the native Aqua Print Dialog that will be provided by the Carbon API, and save information that was previously provided by children of &amp;#039;&amp;#039;&amp;#039;Control&amp;#039;&amp;#039;&amp;#039; class. We should also disable the Printing options provided by the Aqua dialog that are not provided by the Printer class (the information we cannot currently store).&lt;br /&gt;
&lt;br /&gt;
==== Print Setup file ====&lt;br /&gt;
* svtools/inc/prnsetup.hxx&lt;br /&gt;
* svtools/source/dialogs/prnsetup.hxx&lt;br /&gt;
&lt;br /&gt;
Utility functions : &lt;br /&gt;
* &amp;#039;&amp;#039;ImplFillPrnDlgListBox&amp;#039;&amp;#039;(const &amp;#039;&amp;#039;&amp;#039;Printer&amp;#039;&amp;#039;&amp;#039; *, &amp;#039;&amp;#039;&amp;#039;ListBox&amp;#039;&amp;#039;&amp;#039; *, &amp;#039;&amp;#039;&amp;#039;PushButton&amp;#039;&amp;#039;&amp;#039; *)&lt;br /&gt;
This method fills the &amp;#039;&amp;#039;&amp;#039;Printer&amp;#039;&amp;#039;&amp;#039; list-box with the QueueInfo provided by the &amp;#039;&amp;#039;&amp;#039;Printer&amp;#039;&amp;#039;&amp;#039; instance provided in argument. It then enables the OK button if the list is not empty.&lt;br /&gt;
&lt;br /&gt;
== Mac OS X API side ==&lt;br /&gt;
This part describes what can be used and how we intend to use it.&lt;br /&gt;
&lt;br /&gt;
The strategy is to first use the Carbon API to get Print Information and to provide an Aqua User Inerface for printing. Then, we will try to replace the current printing API to the native one, allowing to reduce dependencies, and the total package size.&lt;br /&gt;
&lt;br /&gt;
Carbon provides multiple way for us to print. We might consider every of different approaches :&lt;br /&gt;
* Printing using psprint. We only get settings from the Carbon Print Dialog and the Carbon Print Setup Dialog with the function PMGetPrintSettingsExtendedData (for example) and then we send the obtained parameters to our SalPrinter.&lt;br /&gt;
* Using the PMPrintToFile function (OpenOffice.org provides a postcript version of the document, and then, Carbon handles the print operation)&lt;br /&gt;
* Printing using a QuickDraw graphic context [http://developer.apple.com/documentation/Carbon/Conceptual/CPM_Concepts/cpm_chap3/chapter_3_section_4.html#//apple_ref/doc/uid/TP30000978-TP30000046-TPXREF12 See this link for an example] (As this is a legacy API, we are not enthusiast about using it in OpenOffice.org)&lt;br /&gt;
* Printing using a Quartz 2D graphic context [http://developer.apple.com/documentation/GraphicsImaging/Conceptual/drawingwithquartz2d/index.html More information about Quartz 2D]&lt;br /&gt;
&lt;br /&gt;
We may want to add some features to the Printing dialog provided by Carbon. [http://developer.apple.com/documentation/Printing/Conceptual/ExtPrintingDialogs/index.html This is documented here]&lt;br /&gt;
&lt;br /&gt;
Todo : implement missing methods, using Carbon API&lt;br /&gt;
&lt;br /&gt;
=== Using Aqua Printing Dialogs ===&lt;br /&gt;
&lt;br /&gt;
In a first a approach, we want to use Aqua dialogs and set the &amp;#039;&amp;#039;&amp;#039;SalPrinter&amp;#039;&amp;#039;&amp;#039; instance with the data provided by the dialog.&lt;br /&gt;
&lt;br /&gt;
Then, we want to get rid of the OpenOffice.org print dialog, for this, we need to add a custom print dialog addition to allow user to choose options not provided by Apple Print Dialog, however the behaviour might not be as the user except since we still use CUPS instead of Quartz.&lt;br /&gt;
&lt;br /&gt;
[http://developer.apple.com/documentation/Carbon/Conceptual/CPM_Concepts/index.html?http://developer.apple.com/documentation/Carbon/Conceptual/CPM_Concepts/cpm_chap3/chapter_3_section_1.html#//apple_ref/doc/uid/TP30000046-DontLinkElementID_22 Carbon calls for displaying Print Dialog and Print Setup Dialog]&lt;br /&gt;
&lt;br /&gt;
After this step, we should have a great native interface, now we want to print using Quartz instead of CUPS. To do this, we need to fill the Carbon Print object using the data provided by our Printer instance.&lt;br /&gt;
&lt;br /&gt;
[http://developer.apple.com/documentation/Carbon/Conceptual/CPM_Concepts/index.html?http://developer.apple.com/documentation/Carbon/Conceptual/CPM_Concepts/cpm_chap3/chapter_3_section_1.html#//apple_ref/doc/uid/TP30000046-DontLinkElementID_22 Carbon Calls for retrieving Print Data and Page Setup data]&lt;br /&gt;
&lt;br /&gt;
We need then to hook Sal Graphic context primitives to the Quartz ones.&lt;br /&gt;
&lt;br /&gt;
=== Using Quartz Graphic Context to Print ===&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
=== Link for Mac OS X API documentation  ===&lt;br /&gt;
http://developer.apple.com/documentation/Carbon/Reference/CarbonPrintingManager_Ref/index.html&lt;br /&gt;
&lt;br /&gt;
=== Starting point for documentation ===&lt;br /&gt;
http://developer.apple.com/documentation/Carbon/Printing-date.html#//apple_ref/doc/uid/TP30000440-TP30000420-TP30000455&lt;br /&gt;
http://developer.apple.com/documentation/Carbon/Conceptual/CPM_Concepts/cpm_chap4/chapter_4_section_1.html&lt;br /&gt;
http://developer.apple.com/samplecode/Carbon/idxPrinting-date.html&lt;br /&gt;
http://developer.apple.com/referencelibrary/Carbon/idxPrinting-date.html&lt;br /&gt;
&lt;br /&gt;
This work is part of http://wiki.services.openoffice.org/wiki/Mac_OS_X_Porting_-_Work_Areas/Todo%27s&lt;br /&gt;
&lt;br /&gt;
Created: [[User:Ericb|Ericb]] 19:33, 4 June 2006 (CEST)&lt;br /&gt;
&lt;br /&gt;
Last modification: [[User:Ybart|ybart]] 0:00, 16 October 2006 (CEST)&lt;br /&gt;
&lt;br /&gt;
[[Category:Porting]]&lt;br /&gt;
[[Category:Aqua]]&lt;br /&gt;
[[Category:MacOSX]]&lt;/div&gt;</summary>
		<author><name>Ybart</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Mac_OS_X_Porting_-_Native_Printing&amp;diff=31934</id>
		<title>Mac OS X Porting - Native Printing</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Mac_OS_X_Porting_-_Native_Printing&amp;diff=31934"/>
		<updated>2007-05-10T09:45:18Z</updated>

		<summary type="html">&lt;p&gt;Ybart: /* Using Aqua Printing Dialogs */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page is dedicated to the native printing implementation in OpenOffice.org for Mac OS X&lt;br /&gt;
&lt;br /&gt;
== What we want to do ? ==&lt;br /&gt;
The final goal of this project is to have the native printing support on Mac OS X.&lt;br /&gt;
&lt;br /&gt;
=== What we have now and what we don&amp;#039;t ? ===&lt;br /&gt;
Currently we simply have a generic printing support which works with X11. There is also printing support implemented for Windows. This means that we have already a way to implement our printing support for Aqua without breaking OpenOffice.org as we have already environment plug-ins.&lt;br /&gt;
&lt;br /&gt;
However, we have only one Print Dialog and one Printer Setup dialog for all environments.&lt;br /&gt;
&lt;br /&gt;
Tu sum up : we have a starting point to implement low-level printing support using the native API. We only have to implement the native code. But &amp;#039;&amp;#039;&amp;#039;we have nothing for the dialogs&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
=== What the users want ? ===&lt;br /&gt;
The user wants to be able to print with OpenOffice.org the same way he does with its other natives applications. &lt;br /&gt;
&lt;br /&gt;
For us, this means using a native printing dialog. Then, we will also need to implement low-level printing using OS API because, without that the user might not be able to use every setting available in the native dialog. &lt;br /&gt;
&lt;br /&gt;
=== What will be even better ? ===&lt;br /&gt;
Using UNO. This will allow other platform developpers to use the same code to implement their native dialogs.&lt;br /&gt;
&lt;br /&gt;
== OpenOffice.org side ==&lt;br /&gt;
This part describes what can be found in the OOo APIs, how it is implemented and how it will be changed.&lt;br /&gt;
&lt;br /&gt;
=== OOo print process ===&lt;br /&gt;
I will try to share the few thing I understood about the way Writer prints document.&lt;br /&gt;
&lt;br /&gt;
First I need to locate the print menu item in the sw module (sw stands for Star Writer). For this, I need to know where in sw the menubar is built. I did found the menubar, but not how the menu item was linked to the print operation. Instead, I have found a method PrintPages implemented in sw module. The stack may look like that :&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;SwXTextDocument&amp;#039;&amp;#039;&amp;#039;::printPages()&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;ViewShell&amp;#039;&amp;#039;&amp;#039;::executeSlot(aReq)&lt;br /&gt;
* ...&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;SwView&amp;#039;&amp;#039;&amp;#039;::ExecutePrint()&lt;br /&gt;
* ...&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;SwXTextDocument&amp;#039;&amp;#039;&amp;#039;::render()&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;ViewShell&amp;#039;&amp;#039;&amp;#039;::Prt()&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;OutputDevice&amp;#039;&amp;#039;&amp;#039;:: ...&lt;br /&gt;
&lt;br /&gt;
TODO : Complete the stack trace&lt;br /&gt;
&lt;br /&gt;
There is many holes in the stack but we get the idea. The &amp;#039;&amp;#039;&amp;#039;OuputDevice&amp;#039;&amp;#039;&amp;#039; is in fact our &amp;#039;&amp;#039;&amp;#039;Printer.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
[[Image:Printing_model.png]]&lt;br /&gt;
&lt;br /&gt;
1. The user Application creates a print dialog or a print setup dialog. For this, it needs to call svtools. To be a bit more precise, it creates a new instance of &amp;#039;&amp;#039;&amp;#039;PrintDialog&amp;#039;&amp;#039;&amp;#039; or of &amp;#039;&amp;#039;&amp;#039;PrintDialogSetup&amp;#039;&amp;#039;&amp;#039;, it associates a Printer instance to it, then, it calls the Execute method from &amp;#039;&amp;#039;&amp;#039;PrintDialog&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;PrintSetupDialog&amp;#039;&amp;#039;&amp;#039;. This operation shows the dialog (using the &amp;#039;&amp;#039;Execute&amp;#039;&amp;#039; method from &amp;#039;&amp;#039;&amp;#039;ModalDialog&amp;#039;&amp;#039;&amp;#039;, which is in vcl) and sets the Printer Data correctly with the method &amp;#039;&amp;#039;setPrinterProps&amp;#039;&amp;#039;. Do do the real display of the dialog, it uses &amp;#039;&amp;#039;&amp;#039;SalFrame&amp;#039;&amp;#039;&amp;#039;&amp;#039;s &amp;#039;&amp;#039;Show()&amp;#039;&amp;#039; method, which can be X11SalFrame, &amp;#039;&amp;#039;&amp;#039;AquaSalFrame&amp;#039;&amp;#039;&amp;#039;, etc.&lt;br /&gt;
&lt;br /&gt;
2. Svtools is responsible for asking to the user the requested information about printing options. Then, it returns them ot the user application.&lt;br /&gt;
&lt;br /&gt;
3. The user application has now everything needed to print the document. So, it asks VCL to draw pixels, lines, characters, etc on an &amp;#039;&amp;#039;&amp;#039;OutputDevice&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
At this point, I don&amp;#039;t know exactly where the &amp;#039;&amp;#039;&amp;#039;OutputDevice&amp;#039;&amp;#039;&amp;#039; is instancied (who decides that it would be a screen, an Aqua printer or a PostScript printer. This is not really important since we understand the main idea of how printing works.&lt;br /&gt;
&lt;br /&gt;
[[Image:Printing_model_step_4.png]]&lt;br /&gt;
&lt;br /&gt;
4. After that VCL relies on its Graphic Context to really draws (i.e. make the OS really draws) the lines and pixels on the screen or on the print device.&lt;br /&gt;
&lt;br /&gt;
=== Concerned OOo modules ===&lt;br /&gt;
* psprint&lt;br /&gt;
* vcl&lt;br /&gt;
* svtools&lt;br /&gt;
&lt;br /&gt;
=== VCL ===&lt;br /&gt;
What we know about [[vcl]].&lt;br /&gt;
&lt;br /&gt;
==== SalPrinter class ====&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;SalPrinter&amp;#039;&amp;#039;&amp;#039; is a virtual class intended for managing print jobs. It is composed of virtual fonctions, and a dummy constructor.&lt;br /&gt;
This class is inherited by PspSalPrinter, WinSalPrinter, and of course by &amp;#039;&amp;#039;&amp;#039;AquaSalPrinter&amp;#039;&amp;#039;&amp;#039; (see [[#AquaSalPrinter class|AquaSalPrinter class]]).&lt;br /&gt;
&lt;br /&gt;
Its header is located in vcl/inc/salprn.hxx&lt;br /&gt;
It has no implementation file.&lt;br /&gt;
&lt;br /&gt;
[[Image:UML_class_SalPrinter.png]]&lt;br /&gt;
&lt;br /&gt;
==== PspSalPrinter class ====&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;PspSalPrinter&amp;#039;&amp;#039;&amp;#039; means PostScript Print System Abstraction Layer Printer. Its implementation is located in vcl/unx/source/gdi/salprnpsp.cxx. As the name suggests it relies on features psprint module.&lt;br /&gt;
&lt;br /&gt;
TODO : Discuss about &amp;#039;&amp;#039;&amp;#039;PspSalPrinter&amp;#039;&amp;#039;&amp;#039; implementation.&lt;br /&gt;
&lt;br /&gt;
==== Printer class ====&lt;br /&gt;
This is an abstraction class of a printer driver. You can entirely set up the printer there and start print jobs. What we need here is to make our native dialog access to this Printer. The we will need to make this class access to OS API rather than psprint. &lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;AquaSalPrinter&amp;#039;&amp;#039;&amp;#039; class is located in vcl/aqua/source/gdi/print.cxx&lt;br /&gt;
&lt;br /&gt;
[[Image:Printer_class_description.png]]&lt;br /&gt;
&lt;br /&gt;
This class inherits of &amp;#039;&amp;#039;&amp;#039;OutputDevice&amp;#039;&amp;#039;&amp;#039; and is derivated in &amp;#039;&amp;#039;&amp;#039;ImplQPrinter.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;QueueInfo&amp;#039;&amp;#039;&amp;#039; class - This class is related to the &amp;#039;&amp;#039;&amp;#039;Printer&amp;#039;&amp;#039;&amp;#039; class. It is used to store information about printers (name, driver, location, comment as strings, and number of Jobs, and a status code).&lt;br /&gt;
&lt;br /&gt;
==== OutputDevice class ====&lt;br /&gt;
This class allows applications such as Writer to draw graphics elements (pixels, lines, rects, characters, strings, etc...).&lt;br /&gt;
&lt;br /&gt;
This class is located in vcl/source/gdi/outdev.cxx, vcl/source/gdi/outdev[2-6].cxx&lt;br /&gt;
&lt;br /&gt;
At this time, we don&amp;#039;t need to know the details of this class. We will focus on it when we will use the Carbon Printing API.&lt;br /&gt;
&lt;br /&gt;
==== SalGraphics class ====&lt;br /&gt;
This class is responsible to translate the abstract drawing calls to concrete OS calls.&lt;br /&gt;
&lt;br /&gt;
==== PspGraphics ====&lt;br /&gt;
The class I need to reimplement using Aqua printing primitives...&lt;br /&gt;
It will probably called &amp;#039;&amp;#039;&amp;#039;AquaPrintGraphics&amp;#039;&amp;#039;&amp;#039;...&lt;br /&gt;
&lt;br /&gt;
==== AquaSalPrinter class ====&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;AquaSalPrinter&amp;#039;&amp;#039;&amp;#039; class is located in vcl/aqua/source/gdi/salprn.cxx&lt;br /&gt;
&lt;br /&gt;
Headers are in :&lt;br /&gt;
 vcl/inc/salinst.hxx  &lt;br /&gt;
 vcl/inc/salgdi.hxx    &lt;br /&gt;
 vcl/inc/salprn.hxx&lt;br /&gt;
&lt;br /&gt;
 Aqua implementation :&lt;br /&gt;
 vcl/aqua/inc/salprn.h  (AquaSalPrinter class implementation, inherits from &amp;#039;&amp;#039;&amp;#039;SalPrinter&amp;#039;&amp;#039;&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
=== psprint ===&lt;br /&gt;
What we know about psprint.&lt;br /&gt;
&lt;br /&gt;
=== svtools ===&lt;br /&gt;
What we need to know about svtools. Mostly it provides us the Print Dialog, and some other Print related dialogs.&lt;br /&gt;
&lt;br /&gt;
==== PrintDialog class ====&lt;br /&gt;
This class is responsible for drawing the print dialog we usaually view when we choose the Print option of the File menu.&lt;br /&gt;
The current implementation uses this class to draw the print dialog. In our Aqua native implementation, we want to use the on provided by Carbon API. To achieve this, we want to know the functionality of this class, and let carbon manage the functionality maybe at this level or maybe in a other lever (higher or lower). We also need to know how this class provides information to the Printer instance.&lt;br /&gt;
&lt;br /&gt;
* The header of this class is located in svtools/inc/printdlg.hxx&lt;br /&gt;
* The implementation of this class is located in svtools/source/dialogs/printdlg.cxx&lt;br /&gt;
&lt;br /&gt;
This class is a derivate of &amp;#039;&amp;#039;&amp;#039;ModalDialog&amp;#039;&amp;#039;&amp;#039; class. &lt;br /&gt;
&lt;br /&gt;
It contains all the controls used by the dialog which are either :&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;FixedImage&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;FixedLine&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;FixedText&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;FixedInfo&amp;#039;&amp;#039;&amp;#039; : it is a child of &amp;#039;&amp;#039;&amp;#039;FixedText&amp;#039;&amp;#039;&amp;#039; and is defined in svtools/inc/stdctrl.hxx. It is nothing more than a &amp;#039;&amp;#039;&amp;#039;FixedText&amp;#039;&amp;#039;&amp;#039; with the info style applied (same behaviour).&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;ListBox&amp;#039;&amp;#039;&amp;#039; : maLbName - List-box used to store the available printers.&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Edit&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;NumericField&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;CheckBox&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;PushButton&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;RadioButton&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;OKButton&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;CancelButton&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;HelpButton&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
These controls are used to allow the user to interact with the dialog. We need to know how they are used by the dialog to retrieve the user-provided information. What is involved to display them, and how the look &amp;amp; feel is implemented is not interesting at this point, since we only want to know what the dialog actually does.&lt;br /&gt;
&lt;br /&gt;
Other weird things that are not child of control class and that I don&amp;#039;t currently know why it is usefull :&lt;br /&gt;
* AutoTimer&lt;br /&gt;
&lt;br /&gt;
TODO : List of all user-related information stored by this class and sent to the Printer. Add more details on the vcl controls involved (what they are, at least for the non obvious ones).&lt;br /&gt;
&lt;br /&gt;
The class contains also fields used to store the real information provided by the controls (Mostly USHORT and BOOL). There is also a &amp;#039;&amp;#039;&amp;#039;XubString&amp;#039;&amp;#039;&amp;#039; instance and a &amp;#039;&amp;#039;&amp;#039;PrintDialogRange&amp;#039;&amp;#039;&amp;#039; instance used to store range information.&lt;br /&gt;
&lt;br /&gt;
Of course, this class contains an &amp;#039;&amp;#039;&amp;#039;Printer&amp;#039;&amp;#039;&amp;#039; instance and a &amp;#039;&amp;#039;&amp;#039;SvtPtinterImpl&amp;#039;&amp;#039;&amp;#039; instance in order to set the printer functionality.&lt;br /&gt;
&lt;br /&gt;
There is also internal methods, and links to the Option handler and the OK handler.&lt;br /&gt;
&lt;br /&gt;
The public methods are mostly getters and setters, I won&amp;#039;t detail it since I have already provided information about the private attributes, and they do nothing to the Printer instance.&lt;br /&gt;
&lt;br /&gt;
TODO : details the implementation of this class (interesting methods : &amp;#039;&amp;#039;ImplGetFileName&amp;#039;&amp;#039;, IMPL_LINK(PrintDialog, ImplModifyControlHdl, void*, p)&lt;br /&gt;
&lt;br /&gt;
For Aqua port, we need to reimplement this class in order to make it displays the native Aqua Print Dialog that will be provided by the Carbon API, and save information that was previously provided by children of &amp;#039;&amp;#039;&amp;#039;Control&amp;#039;&amp;#039;&amp;#039; class. We should also disable the Printing options provided by the Aqua dialog that are not provided by the Printer class (the information we cannot currently store).&lt;br /&gt;
&lt;br /&gt;
==== Print Setup file ====&lt;br /&gt;
* svtools/inc/prnsetup.hxx&lt;br /&gt;
* svtools/source/dialogs/prnsetup.hxx&lt;br /&gt;
&lt;br /&gt;
Utility functions : &lt;br /&gt;
* &amp;#039;&amp;#039;ImplFillPrnDlgListBox&amp;#039;&amp;#039;(const &amp;#039;&amp;#039;&amp;#039;Printer&amp;#039;&amp;#039;&amp;#039; *, &amp;#039;&amp;#039;&amp;#039;ListBox&amp;#039;&amp;#039;&amp;#039; *, &amp;#039;&amp;#039;&amp;#039;PushButton&amp;#039;&amp;#039;&amp;#039; *)&lt;br /&gt;
This method fills the &amp;#039;&amp;#039;&amp;#039;Printer&amp;#039;&amp;#039;&amp;#039; list-box with the QueueInfo provided by the &amp;#039;&amp;#039;&amp;#039;Printer&amp;#039;&amp;#039;&amp;#039; instance provided in argument. It then enables the OK button if the list is not empty.&lt;br /&gt;
&lt;br /&gt;
== Mac OS X API side ==&lt;br /&gt;
This part describes what can be used and how we intend to use it.&lt;br /&gt;
&lt;br /&gt;
The strategy is to first use the Carbon API to get Print Information and to provide an Aqua User Inerface for printing. Then, we will try to replace the current printing API to the native one, allowing to reduce dependencies, and the total package size.&lt;br /&gt;
&lt;br /&gt;
Carbon provides multiple way for us to print. We might consider every of different approaches :&lt;br /&gt;
* Printing using psprint. We only get settings from the Carbon Print Dialog and the Carbon Print Setup Dialog with the function PMGetPrintSettingsExtendedData (for example) and then we send the obtained parameters to our SalPrinter.&lt;br /&gt;
* Using the PMPrintToFile function (OpenOffice.org provides a postcript version of the document, and then, Carbon handles the print operation)&lt;br /&gt;
* Printing using a QuickDraw graphic context [http://developer.apple.com/documentation/Carbon/Conceptual/CPM_Concepts/cpm_chap3/chapter_3_section_4.html#//apple_ref/doc/uid/TP30000978-TP30000046-TPXREF12 See this link for an example] (As this is a legacy API, we are not enthusiast about using it in OpenOffice.org)&lt;br /&gt;
* Printing using a Quartz 2D graphic context [http://developer.apple.com/documentation/GraphicsImaging/Conceptual/drawingwithquartz2d/index.html More information about Quartz 2D]&lt;br /&gt;
&lt;br /&gt;
We may want to add some features to the Printing dialog provided by Carbon. [http://developer.apple.com/documentation/Printing/Conceptual/ExtPrintingDialogs/index.html This is documented here]&lt;br /&gt;
&lt;br /&gt;
Todo : implement missing methods, using Carbon API&lt;br /&gt;
&lt;br /&gt;
=== Using Aqua Printing Dialogs ===&lt;br /&gt;
&lt;br /&gt;
In a first a approach, we want to use Aqua dialogs and set the &amp;#039;&amp;#039;&amp;#039;SalPrinter&amp;#039;&amp;#039;&amp;#039; instance with the data provided by the dialog.&lt;br /&gt;
&lt;br /&gt;
Then, we want to get rid of the OpenOffice.org print dialog, for this, we need to add a custom print dialog addition to allow user to choose options not provided by Apple Print Dialog, however the behaviour might not be as the user except since we still use CUPS instead of Quartz.&lt;br /&gt;
&lt;br /&gt;
After this step, we should have a great native interface, now we want to print using Quartz instead of CUPS. To do this, we need to fill the Carbon Print object using the data provided by our Printer instance.&lt;br /&gt;
&lt;br /&gt;
[http://developer.apple.com/documentation/Carbon/Conceptual/CPM_Concepts/index.html Supporting Printing in a Carbon Application]&lt;br /&gt;
&lt;br /&gt;
We need then to hook Sal Graphic context primitives to the Quartz ones.&lt;br /&gt;
&lt;br /&gt;
=== Using Quartz Graphic Context to Print ===&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
=== Link for Mac OS X API documentation  ===&lt;br /&gt;
http://developer.apple.com/documentation/Carbon/Reference/CarbonPrintingManager_Ref/index.html&lt;br /&gt;
&lt;br /&gt;
=== Starting point for documentation ===&lt;br /&gt;
http://developer.apple.com/documentation/Carbon/Printing-date.html#//apple_ref/doc/uid/TP30000440-TP30000420-TP30000455&lt;br /&gt;
http://developer.apple.com/documentation/Carbon/Conceptual/CPM_Concepts/cpm_chap4/chapter_4_section_1.html&lt;br /&gt;
http://developer.apple.com/samplecode/Carbon/idxPrinting-date.html&lt;br /&gt;
http://developer.apple.com/referencelibrary/Carbon/idxPrinting-date.html&lt;br /&gt;
&lt;br /&gt;
This work is part of http://wiki.services.openoffice.org/wiki/Mac_OS_X_Porting_-_Work_Areas/Todo%27s&lt;br /&gt;
&lt;br /&gt;
Created: [[User:Ericb|Ericb]] 19:33, 4 June 2006 (CEST)&lt;br /&gt;
&lt;br /&gt;
Last modification: [[User:Ybart|ybart]] 0:00, 16 October 2006 (CEST)&lt;br /&gt;
&lt;br /&gt;
[[Category:Porting]]&lt;br /&gt;
[[Category:Aqua]]&lt;br /&gt;
[[Category:MacOSX]]&lt;/div&gt;</summary>
		<author><name>Ybart</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Mac_OS_X_Porting_-_Native_Printing&amp;diff=31933</id>
		<title>Mac OS X Porting - Native Printing</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Mac_OS_X_Porting_-_Native_Printing&amp;diff=31933"/>
		<updated>2007-05-10T09:35:06Z</updated>

		<summary type="html">&lt;p&gt;Ybart: /* Mac OS X API side */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page is dedicated to the native printing implementation in OpenOffice.org for Mac OS X&lt;br /&gt;
&lt;br /&gt;
== What we want to do ? ==&lt;br /&gt;
The final goal of this project is to have the native printing support on Mac OS X.&lt;br /&gt;
&lt;br /&gt;
=== What we have now and what we don&amp;#039;t ? ===&lt;br /&gt;
Currently we simply have a generic printing support which works with X11. There is also printing support implemented for Windows. This means that we have already a way to implement our printing support for Aqua without breaking OpenOffice.org as we have already environment plug-ins.&lt;br /&gt;
&lt;br /&gt;
However, we have only one Print Dialog and one Printer Setup dialog for all environments.&lt;br /&gt;
&lt;br /&gt;
Tu sum up : we have a starting point to implement low-level printing support using the native API. We only have to implement the native code. But &amp;#039;&amp;#039;&amp;#039;we have nothing for the dialogs&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
=== What the users want ? ===&lt;br /&gt;
The user wants to be able to print with OpenOffice.org the same way he does with its other natives applications. &lt;br /&gt;
&lt;br /&gt;
For us, this means using a native printing dialog. Then, we will also need to implement low-level printing using OS API because, without that the user might not be able to use every setting available in the native dialog. &lt;br /&gt;
&lt;br /&gt;
=== What will be even better ? ===&lt;br /&gt;
Using UNO. This will allow other platform developpers to use the same code to implement their native dialogs.&lt;br /&gt;
&lt;br /&gt;
== OpenOffice.org side ==&lt;br /&gt;
This part describes what can be found in the OOo APIs, how it is implemented and how it will be changed.&lt;br /&gt;
&lt;br /&gt;
=== OOo print process ===&lt;br /&gt;
I will try to share the few thing I understood about the way Writer prints document.&lt;br /&gt;
&lt;br /&gt;
First I need to locate the print menu item in the sw module (sw stands for Star Writer). For this, I need to know where in sw the menubar is built. I did found the menubar, but not how the menu item was linked to the print operation. Instead, I have found a method PrintPages implemented in sw module. The stack may look like that :&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;SwXTextDocument&amp;#039;&amp;#039;&amp;#039;::printPages()&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;ViewShell&amp;#039;&amp;#039;&amp;#039;::executeSlot(aReq)&lt;br /&gt;
* ...&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;SwView&amp;#039;&amp;#039;&amp;#039;::ExecutePrint()&lt;br /&gt;
* ...&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;SwXTextDocument&amp;#039;&amp;#039;&amp;#039;::render()&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;ViewShell&amp;#039;&amp;#039;&amp;#039;::Prt()&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;OutputDevice&amp;#039;&amp;#039;&amp;#039;:: ...&lt;br /&gt;
&lt;br /&gt;
TODO : Complete the stack trace&lt;br /&gt;
&lt;br /&gt;
There is many holes in the stack but we get the idea. The &amp;#039;&amp;#039;&amp;#039;OuputDevice&amp;#039;&amp;#039;&amp;#039; is in fact our &amp;#039;&amp;#039;&amp;#039;Printer.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
[[Image:Printing_model.png]]&lt;br /&gt;
&lt;br /&gt;
1. The user Application creates a print dialog or a print setup dialog. For this, it needs to call svtools. To be a bit more precise, it creates a new instance of &amp;#039;&amp;#039;&amp;#039;PrintDialog&amp;#039;&amp;#039;&amp;#039; or of &amp;#039;&amp;#039;&amp;#039;PrintDialogSetup&amp;#039;&amp;#039;&amp;#039;, it associates a Printer instance to it, then, it calls the Execute method from &amp;#039;&amp;#039;&amp;#039;PrintDialog&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;PrintSetupDialog&amp;#039;&amp;#039;&amp;#039;. This operation shows the dialog (using the &amp;#039;&amp;#039;Execute&amp;#039;&amp;#039; method from &amp;#039;&amp;#039;&amp;#039;ModalDialog&amp;#039;&amp;#039;&amp;#039;, which is in vcl) and sets the Printer Data correctly with the method &amp;#039;&amp;#039;setPrinterProps&amp;#039;&amp;#039;. Do do the real display of the dialog, it uses &amp;#039;&amp;#039;&amp;#039;SalFrame&amp;#039;&amp;#039;&amp;#039;&amp;#039;s &amp;#039;&amp;#039;Show()&amp;#039;&amp;#039; method, which can be X11SalFrame, &amp;#039;&amp;#039;&amp;#039;AquaSalFrame&amp;#039;&amp;#039;&amp;#039;, etc.&lt;br /&gt;
&lt;br /&gt;
2. Svtools is responsible for asking to the user the requested information about printing options. Then, it returns them ot the user application.&lt;br /&gt;
&lt;br /&gt;
3. The user application has now everything needed to print the document. So, it asks VCL to draw pixels, lines, characters, etc on an &amp;#039;&amp;#039;&amp;#039;OutputDevice&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
At this point, I don&amp;#039;t know exactly where the &amp;#039;&amp;#039;&amp;#039;OutputDevice&amp;#039;&amp;#039;&amp;#039; is instancied (who decides that it would be a screen, an Aqua printer or a PostScript printer. This is not really important since we understand the main idea of how printing works.&lt;br /&gt;
&lt;br /&gt;
[[Image:Printing_model_step_4.png]]&lt;br /&gt;
&lt;br /&gt;
4. After that VCL relies on its Graphic Context to really draws (i.e. make the OS really draws) the lines and pixels on the screen or on the print device.&lt;br /&gt;
&lt;br /&gt;
=== Concerned OOo modules ===&lt;br /&gt;
* psprint&lt;br /&gt;
* vcl&lt;br /&gt;
* svtools&lt;br /&gt;
&lt;br /&gt;
=== VCL ===&lt;br /&gt;
What we know about [[vcl]].&lt;br /&gt;
&lt;br /&gt;
==== SalPrinter class ====&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;SalPrinter&amp;#039;&amp;#039;&amp;#039; is a virtual class intended for managing print jobs. It is composed of virtual fonctions, and a dummy constructor.&lt;br /&gt;
This class is inherited by PspSalPrinter, WinSalPrinter, and of course by &amp;#039;&amp;#039;&amp;#039;AquaSalPrinter&amp;#039;&amp;#039;&amp;#039; (see [[#AquaSalPrinter class|AquaSalPrinter class]]).&lt;br /&gt;
&lt;br /&gt;
Its header is located in vcl/inc/salprn.hxx&lt;br /&gt;
It has no implementation file.&lt;br /&gt;
&lt;br /&gt;
[[Image:UML_class_SalPrinter.png]]&lt;br /&gt;
&lt;br /&gt;
==== PspSalPrinter class ====&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;PspSalPrinter&amp;#039;&amp;#039;&amp;#039; means PostScript Print System Abstraction Layer Printer. Its implementation is located in vcl/unx/source/gdi/salprnpsp.cxx. As the name suggests it relies on features psprint module.&lt;br /&gt;
&lt;br /&gt;
TODO : Discuss about &amp;#039;&amp;#039;&amp;#039;PspSalPrinter&amp;#039;&amp;#039;&amp;#039; implementation.&lt;br /&gt;
&lt;br /&gt;
==== Printer class ====&lt;br /&gt;
This is an abstraction class of a printer driver. You can entirely set up the printer there and start print jobs. What we need here is to make our native dialog access to this Printer. The we will need to make this class access to OS API rather than psprint. &lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;AquaSalPrinter&amp;#039;&amp;#039;&amp;#039; class is located in vcl/aqua/source/gdi/print.cxx&lt;br /&gt;
&lt;br /&gt;
[[Image:Printer_class_description.png]]&lt;br /&gt;
&lt;br /&gt;
This class inherits of &amp;#039;&amp;#039;&amp;#039;OutputDevice&amp;#039;&amp;#039;&amp;#039; and is derivated in &amp;#039;&amp;#039;&amp;#039;ImplQPrinter.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;QueueInfo&amp;#039;&amp;#039;&amp;#039; class - This class is related to the &amp;#039;&amp;#039;&amp;#039;Printer&amp;#039;&amp;#039;&amp;#039; class. It is used to store information about printers (name, driver, location, comment as strings, and number of Jobs, and a status code).&lt;br /&gt;
&lt;br /&gt;
==== OutputDevice class ====&lt;br /&gt;
This class allows applications such as Writer to draw graphics elements (pixels, lines, rects, characters, strings, etc...).&lt;br /&gt;
&lt;br /&gt;
This class is located in vcl/source/gdi/outdev.cxx, vcl/source/gdi/outdev[2-6].cxx&lt;br /&gt;
&lt;br /&gt;
At this time, we don&amp;#039;t need to know the details of this class. We will focus on it when we will use the Carbon Printing API.&lt;br /&gt;
&lt;br /&gt;
==== SalGraphics class ====&lt;br /&gt;
This class is responsible to translate the abstract drawing calls to concrete OS calls.&lt;br /&gt;
&lt;br /&gt;
==== PspGraphics ====&lt;br /&gt;
The class I need to reimplement using Aqua printing primitives...&lt;br /&gt;
It will probably called &amp;#039;&amp;#039;&amp;#039;AquaPrintGraphics&amp;#039;&amp;#039;&amp;#039;...&lt;br /&gt;
&lt;br /&gt;
==== AquaSalPrinter class ====&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;AquaSalPrinter&amp;#039;&amp;#039;&amp;#039; class is located in vcl/aqua/source/gdi/salprn.cxx&lt;br /&gt;
&lt;br /&gt;
Headers are in :&lt;br /&gt;
 vcl/inc/salinst.hxx  &lt;br /&gt;
 vcl/inc/salgdi.hxx    &lt;br /&gt;
 vcl/inc/salprn.hxx&lt;br /&gt;
&lt;br /&gt;
 Aqua implementation :&lt;br /&gt;
 vcl/aqua/inc/salprn.h  (AquaSalPrinter class implementation, inherits from &amp;#039;&amp;#039;&amp;#039;SalPrinter&amp;#039;&amp;#039;&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
=== psprint ===&lt;br /&gt;
What we know about psprint.&lt;br /&gt;
&lt;br /&gt;
=== svtools ===&lt;br /&gt;
What we need to know about svtools. Mostly it provides us the Print Dialog, and some other Print related dialogs.&lt;br /&gt;
&lt;br /&gt;
==== PrintDialog class ====&lt;br /&gt;
This class is responsible for drawing the print dialog we usaually view when we choose the Print option of the File menu.&lt;br /&gt;
The current implementation uses this class to draw the print dialog. In our Aqua native implementation, we want to use the on provided by Carbon API. To achieve this, we want to know the functionality of this class, and let carbon manage the functionality maybe at this level or maybe in a other lever (higher or lower). We also need to know how this class provides information to the Printer instance.&lt;br /&gt;
&lt;br /&gt;
* The header of this class is located in svtools/inc/printdlg.hxx&lt;br /&gt;
* The implementation of this class is located in svtools/source/dialogs/printdlg.cxx&lt;br /&gt;
&lt;br /&gt;
This class is a derivate of &amp;#039;&amp;#039;&amp;#039;ModalDialog&amp;#039;&amp;#039;&amp;#039; class. &lt;br /&gt;
&lt;br /&gt;
It contains all the controls used by the dialog which are either :&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;FixedImage&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;FixedLine&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;FixedText&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;FixedInfo&amp;#039;&amp;#039;&amp;#039; : it is a child of &amp;#039;&amp;#039;&amp;#039;FixedText&amp;#039;&amp;#039;&amp;#039; and is defined in svtools/inc/stdctrl.hxx. It is nothing more than a &amp;#039;&amp;#039;&amp;#039;FixedText&amp;#039;&amp;#039;&amp;#039; with the info style applied (same behaviour).&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;ListBox&amp;#039;&amp;#039;&amp;#039; : maLbName - List-box used to store the available printers.&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Edit&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;NumericField&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;CheckBox&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;PushButton&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;RadioButton&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;OKButton&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;CancelButton&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;HelpButton&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
These controls are used to allow the user to interact with the dialog. We need to know how they are used by the dialog to retrieve the user-provided information. What is involved to display them, and how the look &amp;amp; feel is implemented is not interesting at this point, since we only want to know what the dialog actually does.&lt;br /&gt;
&lt;br /&gt;
Other weird things that are not child of control class and that I don&amp;#039;t currently know why it is usefull :&lt;br /&gt;
* AutoTimer&lt;br /&gt;
&lt;br /&gt;
TODO : List of all user-related information stored by this class and sent to the Printer. Add more details on the vcl controls involved (what they are, at least for the non obvious ones).&lt;br /&gt;
&lt;br /&gt;
The class contains also fields used to store the real information provided by the controls (Mostly USHORT and BOOL). There is also a &amp;#039;&amp;#039;&amp;#039;XubString&amp;#039;&amp;#039;&amp;#039; instance and a &amp;#039;&amp;#039;&amp;#039;PrintDialogRange&amp;#039;&amp;#039;&amp;#039; instance used to store range information.&lt;br /&gt;
&lt;br /&gt;
Of course, this class contains an &amp;#039;&amp;#039;&amp;#039;Printer&amp;#039;&amp;#039;&amp;#039; instance and a &amp;#039;&amp;#039;&amp;#039;SvtPtinterImpl&amp;#039;&amp;#039;&amp;#039; instance in order to set the printer functionality.&lt;br /&gt;
&lt;br /&gt;
There is also internal methods, and links to the Option handler and the OK handler.&lt;br /&gt;
&lt;br /&gt;
The public methods are mostly getters and setters, I won&amp;#039;t detail it since I have already provided information about the private attributes, and they do nothing to the Printer instance.&lt;br /&gt;
&lt;br /&gt;
TODO : details the implementation of this class (interesting methods : &amp;#039;&amp;#039;ImplGetFileName&amp;#039;&amp;#039;, IMPL_LINK(PrintDialog, ImplModifyControlHdl, void*, p)&lt;br /&gt;
&lt;br /&gt;
For Aqua port, we need to reimplement this class in order to make it displays the native Aqua Print Dialog that will be provided by the Carbon API, and save information that was previously provided by children of &amp;#039;&amp;#039;&amp;#039;Control&amp;#039;&amp;#039;&amp;#039; class. We should also disable the Printing options provided by the Aqua dialog that are not provided by the Printer class (the information we cannot currently store).&lt;br /&gt;
&lt;br /&gt;
==== Print Setup file ====&lt;br /&gt;
* svtools/inc/prnsetup.hxx&lt;br /&gt;
* svtools/source/dialogs/prnsetup.hxx&lt;br /&gt;
&lt;br /&gt;
Utility functions : &lt;br /&gt;
* &amp;#039;&amp;#039;ImplFillPrnDlgListBox&amp;#039;&amp;#039;(const &amp;#039;&amp;#039;&amp;#039;Printer&amp;#039;&amp;#039;&amp;#039; *, &amp;#039;&amp;#039;&amp;#039;ListBox&amp;#039;&amp;#039;&amp;#039; *, &amp;#039;&amp;#039;&amp;#039;PushButton&amp;#039;&amp;#039;&amp;#039; *)&lt;br /&gt;
This method fills the &amp;#039;&amp;#039;&amp;#039;Printer&amp;#039;&amp;#039;&amp;#039; list-box with the QueueInfo provided by the &amp;#039;&amp;#039;&amp;#039;Printer&amp;#039;&amp;#039;&amp;#039; instance provided in argument. It then enables the OK button if the list is not empty.&lt;br /&gt;
&lt;br /&gt;
== Mac OS X API side ==&lt;br /&gt;
This part describes what can be used and how we intend to use it.&lt;br /&gt;
&lt;br /&gt;
The strategy is to first use the Carbon API to get Print Information and to provide an Aqua User Inerface for printing. Then, we will try to replace the current printing API to the native one, allowing to reduce dependencies, and the total package size.&lt;br /&gt;
&lt;br /&gt;
Carbon provides multiple way for us to print. We might consider every of different approaches :&lt;br /&gt;
* Printing using psprint. We only get settings from the Carbon Print Dialog and the Carbon Print Setup Dialog with the function PMGetPrintSettingsExtendedData (for example) and then we send the obtained parameters to our SalPrinter.&lt;br /&gt;
* Using the PMPrintToFile function (OpenOffice.org provides a postcript version of the document, and then, Carbon handles the print operation)&lt;br /&gt;
* Printing using a QuickDraw graphic context [http://developer.apple.com/documentation/Carbon/Conceptual/CPM_Concepts/cpm_chap3/chapter_3_section_4.html#//apple_ref/doc/uid/TP30000978-TP30000046-TPXREF12 See this link for an example] (As this is a legacy API, we are not enthusiast about using it in OpenOffice.org)&lt;br /&gt;
* Printing using a Quartz 2D graphic context [http://developer.apple.com/documentation/GraphicsImaging/Conceptual/drawingwithquartz2d/index.html More information about Quartz 2D]&lt;br /&gt;
&lt;br /&gt;
We may want to add some features to the Printing dialog provided by Carbon. [http://developer.apple.com/documentation/Printing/Conceptual/ExtPrintingDialogs/index.html This is documented here]&lt;br /&gt;
&lt;br /&gt;
Todo : implement missing methods, using Carbon API&lt;br /&gt;
&lt;br /&gt;
=== Using Aqua Printing Dialogs ===&lt;br /&gt;
[http://developer.apple.com/documentation/Carbon/Conceptual/CPM_Concepts/index.html Supporting Printing in a Carbon Application]&lt;br /&gt;
&lt;br /&gt;
=== Using Quartz Graphic Context to Print ===&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
=== Link for Mac OS X API documentation  ===&lt;br /&gt;
http://developer.apple.com/documentation/Carbon/Reference/CarbonPrintingManager_Ref/index.html&lt;br /&gt;
&lt;br /&gt;
=== Starting point for documentation ===&lt;br /&gt;
http://developer.apple.com/documentation/Carbon/Printing-date.html#//apple_ref/doc/uid/TP30000440-TP30000420-TP30000455&lt;br /&gt;
http://developer.apple.com/documentation/Carbon/Conceptual/CPM_Concepts/cpm_chap4/chapter_4_section_1.html&lt;br /&gt;
http://developer.apple.com/samplecode/Carbon/idxPrinting-date.html&lt;br /&gt;
http://developer.apple.com/referencelibrary/Carbon/idxPrinting-date.html&lt;br /&gt;
&lt;br /&gt;
This work is part of http://wiki.services.openoffice.org/wiki/Mac_OS_X_Porting_-_Work_Areas/Todo%27s&lt;br /&gt;
&lt;br /&gt;
Created: [[User:Ericb|Ericb]] 19:33, 4 June 2006 (CEST)&lt;br /&gt;
&lt;br /&gt;
Last modification: [[User:Ybart|ybart]] 0:00, 16 October 2006 (CEST)&lt;br /&gt;
&lt;br /&gt;
[[Category:Porting]]&lt;br /&gt;
[[Category:Aqua]]&lt;br /&gt;
[[Category:MacOSX]]&lt;/div&gt;</summary>
		<author><name>Ybart</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Mac_OS_X_Porting_-_Native_Printing&amp;diff=31932</id>
		<title>Mac OS X Porting - Native Printing</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Mac_OS_X_Porting_-_Native_Printing&amp;diff=31932"/>
		<updated>2007-05-10T09:29:48Z</updated>

		<summary type="html">&lt;p&gt;Ybart: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page is dedicated to the native printing implementation in OpenOffice.org for Mac OS X&lt;br /&gt;
&lt;br /&gt;
== What we want to do ? ==&lt;br /&gt;
The final goal of this project is to have the native printing support on Mac OS X.&lt;br /&gt;
&lt;br /&gt;
=== What we have now and what we don&amp;#039;t ? ===&lt;br /&gt;
Currently we simply have a generic printing support which works with X11. There is also printing support implemented for Windows. This means that we have already a way to implement our printing support for Aqua without breaking OpenOffice.org as we have already environment plug-ins.&lt;br /&gt;
&lt;br /&gt;
However, we have only one Print Dialog and one Printer Setup dialog for all environments.&lt;br /&gt;
&lt;br /&gt;
Tu sum up : we have a starting point to implement low-level printing support using the native API. We only have to implement the native code. But &amp;#039;&amp;#039;&amp;#039;we have nothing for the dialogs&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
=== What the users want ? ===&lt;br /&gt;
The user wants to be able to print with OpenOffice.org the same way he does with its other natives applications. &lt;br /&gt;
&lt;br /&gt;
For us, this means using a native printing dialog. Then, we will also need to implement low-level printing using OS API because, without that the user might not be able to use every setting available in the native dialog. &lt;br /&gt;
&lt;br /&gt;
=== What will be even better ? ===&lt;br /&gt;
Using UNO. This will allow other platform developpers to use the same code to implement their native dialogs.&lt;br /&gt;
&lt;br /&gt;
== OpenOffice.org side ==&lt;br /&gt;
This part describes what can be found in the OOo APIs, how it is implemented and how it will be changed.&lt;br /&gt;
&lt;br /&gt;
=== OOo print process ===&lt;br /&gt;
I will try to share the few thing I understood about the way Writer prints document.&lt;br /&gt;
&lt;br /&gt;
First I need to locate the print menu item in the sw module (sw stands for Star Writer). For this, I need to know where in sw the menubar is built. I did found the menubar, but not how the menu item was linked to the print operation. Instead, I have found a method PrintPages implemented in sw module. The stack may look like that :&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;SwXTextDocument&amp;#039;&amp;#039;&amp;#039;::printPages()&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;ViewShell&amp;#039;&amp;#039;&amp;#039;::executeSlot(aReq)&lt;br /&gt;
* ...&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;SwView&amp;#039;&amp;#039;&amp;#039;::ExecutePrint()&lt;br /&gt;
* ...&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;SwXTextDocument&amp;#039;&amp;#039;&amp;#039;::render()&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;ViewShell&amp;#039;&amp;#039;&amp;#039;::Prt()&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;OutputDevice&amp;#039;&amp;#039;&amp;#039;:: ...&lt;br /&gt;
&lt;br /&gt;
TODO : Complete the stack trace&lt;br /&gt;
&lt;br /&gt;
There is many holes in the stack but we get the idea. The &amp;#039;&amp;#039;&amp;#039;OuputDevice&amp;#039;&amp;#039;&amp;#039; is in fact our &amp;#039;&amp;#039;&amp;#039;Printer.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
[[Image:Printing_model.png]]&lt;br /&gt;
&lt;br /&gt;
1. The user Application creates a print dialog or a print setup dialog. For this, it needs to call svtools. To be a bit more precise, it creates a new instance of &amp;#039;&amp;#039;&amp;#039;PrintDialog&amp;#039;&amp;#039;&amp;#039; or of &amp;#039;&amp;#039;&amp;#039;PrintDialogSetup&amp;#039;&amp;#039;&amp;#039;, it associates a Printer instance to it, then, it calls the Execute method from &amp;#039;&amp;#039;&amp;#039;PrintDialog&amp;#039;&amp;#039;&amp;#039; or &amp;#039;&amp;#039;&amp;#039;PrintSetupDialog&amp;#039;&amp;#039;&amp;#039;. This operation shows the dialog (using the &amp;#039;&amp;#039;Execute&amp;#039;&amp;#039; method from &amp;#039;&amp;#039;&amp;#039;ModalDialog&amp;#039;&amp;#039;&amp;#039;, which is in vcl) and sets the Printer Data correctly with the method &amp;#039;&amp;#039;setPrinterProps&amp;#039;&amp;#039;. Do do the real display of the dialog, it uses &amp;#039;&amp;#039;&amp;#039;SalFrame&amp;#039;&amp;#039;&amp;#039;&amp;#039;s &amp;#039;&amp;#039;Show()&amp;#039;&amp;#039; method, which can be X11SalFrame, &amp;#039;&amp;#039;&amp;#039;AquaSalFrame&amp;#039;&amp;#039;&amp;#039;, etc.&lt;br /&gt;
&lt;br /&gt;
2. Svtools is responsible for asking to the user the requested information about printing options. Then, it returns them ot the user application.&lt;br /&gt;
&lt;br /&gt;
3. The user application has now everything needed to print the document. So, it asks VCL to draw pixels, lines, characters, etc on an &amp;#039;&amp;#039;&amp;#039;OutputDevice&amp;#039;&amp;#039;&amp;#039;.&lt;br /&gt;
&lt;br /&gt;
At this point, I don&amp;#039;t know exactly where the &amp;#039;&amp;#039;&amp;#039;OutputDevice&amp;#039;&amp;#039;&amp;#039; is instancied (who decides that it would be a screen, an Aqua printer or a PostScript printer. This is not really important since we understand the main idea of how printing works.&lt;br /&gt;
&lt;br /&gt;
[[Image:Printing_model_step_4.png]]&lt;br /&gt;
&lt;br /&gt;
4. After that VCL relies on its Graphic Context to really draws (i.e. make the OS really draws) the lines and pixels on the screen or on the print device.&lt;br /&gt;
&lt;br /&gt;
=== Concerned OOo modules ===&lt;br /&gt;
* psprint&lt;br /&gt;
* vcl&lt;br /&gt;
* svtools&lt;br /&gt;
&lt;br /&gt;
=== VCL ===&lt;br /&gt;
What we know about [[vcl]].&lt;br /&gt;
&lt;br /&gt;
==== SalPrinter class ====&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;SalPrinter&amp;#039;&amp;#039;&amp;#039; is a virtual class intended for managing print jobs. It is composed of virtual fonctions, and a dummy constructor.&lt;br /&gt;
This class is inherited by PspSalPrinter, WinSalPrinter, and of course by &amp;#039;&amp;#039;&amp;#039;AquaSalPrinter&amp;#039;&amp;#039;&amp;#039; (see [[#AquaSalPrinter class|AquaSalPrinter class]]).&lt;br /&gt;
&lt;br /&gt;
Its header is located in vcl/inc/salprn.hxx&lt;br /&gt;
It has no implementation file.&lt;br /&gt;
&lt;br /&gt;
[[Image:UML_class_SalPrinter.png]]&lt;br /&gt;
&lt;br /&gt;
==== PspSalPrinter class ====&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;PspSalPrinter&amp;#039;&amp;#039;&amp;#039; means PostScript Print System Abstraction Layer Printer. Its implementation is located in vcl/unx/source/gdi/salprnpsp.cxx. As the name suggests it relies on features psprint module.&lt;br /&gt;
&lt;br /&gt;
TODO : Discuss about &amp;#039;&amp;#039;&amp;#039;PspSalPrinter&amp;#039;&amp;#039;&amp;#039; implementation.&lt;br /&gt;
&lt;br /&gt;
==== Printer class ====&lt;br /&gt;
This is an abstraction class of a printer driver. You can entirely set up the printer there and start print jobs. What we need here is to make our native dialog access to this Printer. The we will need to make this class access to OS API rather than psprint. &lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;AquaSalPrinter&amp;#039;&amp;#039;&amp;#039; class is located in vcl/aqua/source/gdi/print.cxx&lt;br /&gt;
&lt;br /&gt;
[[Image:Printer_class_description.png]]&lt;br /&gt;
&lt;br /&gt;
This class inherits of &amp;#039;&amp;#039;&amp;#039;OutputDevice&amp;#039;&amp;#039;&amp;#039; and is derivated in &amp;#039;&amp;#039;&amp;#039;ImplQPrinter.&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;QueueInfo&amp;#039;&amp;#039;&amp;#039; class - This class is related to the &amp;#039;&amp;#039;&amp;#039;Printer&amp;#039;&amp;#039;&amp;#039; class. It is used to store information about printers (name, driver, location, comment as strings, and number of Jobs, and a status code).&lt;br /&gt;
&lt;br /&gt;
==== OutputDevice class ====&lt;br /&gt;
This class allows applications such as Writer to draw graphics elements (pixels, lines, rects, characters, strings, etc...).&lt;br /&gt;
&lt;br /&gt;
This class is located in vcl/source/gdi/outdev.cxx, vcl/source/gdi/outdev[2-6].cxx&lt;br /&gt;
&lt;br /&gt;
At this time, we don&amp;#039;t need to know the details of this class. We will focus on it when we will use the Carbon Printing API.&lt;br /&gt;
&lt;br /&gt;
==== SalGraphics class ====&lt;br /&gt;
This class is responsible to translate the abstract drawing calls to concrete OS calls.&lt;br /&gt;
&lt;br /&gt;
==== PspGraphics ====&lt;br /&gt;
The class I need to reimplement using Aqua printing primitives...&lt;br /&gt;
It will probably called &amp;#039;&amp;#039;&amp;#039;AquaPrintGraphics&amp;#039;&amp;#039;&amp;#039;...&lt;br /&gt;
&lt;br /&gt;
==== AquaSalPrinter class ====&lt;br /&gt;
&amp;#039;&amp;#039;&amp;#039;AquaSalPrinter&amp;#039;&amp;#039;&amp;#039; class is located in vcl/aqua/source/gdi/salprn.cxx&lt;br /&gt;
&lt;br /&gt;
Headers are in :&lt;br /&gt;
 vcl/inc/salinst.hxx  &lt;br /&gt;
 vcl/inc/salgdi.hxx    &lt;br /&gt;
 vcl/inc/salprn.hxx&lt;br /&gt;
&lt;br /&gt;
 Aqua implementation :&lt;br /&gt;
 vcl/aqua/inc/salprn.h  (AquaSalPrinter class implementation, inherits from &amp;#039;&amp;#039;&amp;#039;SalPrinter&amp;#039;&amp;#039;&amp;#039;)&lt;br /&gt;
&lt;br /&gt;
=== psprint ===&lt;br /&gt;
What we know about psprint.&lt;br /&gt;
&lt;br /&gt;
=== svtools ===&lt;br /&gt;
What we need to know about svtools. Mostly it provides us the Print Dialog, and some other Print related dialogs.&lt;br /&gt;
&lt;br /&gt;
==== PrintDialog class ====&lt;br /&gt;
This class is responsible for drawing the print dialog we usaually view when we choose the Print option of the File menu.&lt;br /&gt;
The current implementation uses this class to draw the print dialog. In our Aqua native implementation, we want to use the on provided by Carbon API. To achieve this, we want to know the functionality of this class, and let carbon manage the functionality maybe at this level or maybe in a other lever (higher or lower). We also need to know how this class provides information to the Printer instance.&lt;br /&gt;
&lt;br /&gt;
* The header of this class is located in svtools/inc/printdlg.hxx&lt;br /&gt;
* The implementation of this class is located in svtools/source/dialogs/printdlg.cxx&lt;br /&gt;
&lt;br /&gt;
This class is a derivate of &amp;#039;&amp;#039;&amp;#039;ModalDialog&amp;#039;&amp;#039;&amp;#039; class. &lt;br /&gt;
&lt;br /&gt;
It contains all the controls used by the dialog which are either :&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;FixedImage&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;FixedLine&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;FixedText&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;FixedInfo&amp;#039;&amp;#039;&amp;#039; : it is a child of &amp;#039;&amp;#039;&amp;#039;FixedText&amp;#039;&amp;#039;&amp;#039; and is defined in svtools/inc/stdctrl.hxx. It is nothing more than a &amp;#039;&amp;#039;&amp;#039;FixedText&amp;#039;&amp;#039;&amp;#039; with the info style applied (same behaviour).&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;ListBox&amp;#039;&amp;#039;&amp;#039; : maLbName - List-box used to store the available printers.&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;Edit&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;NumericField&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;CheckBox&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;PushButton&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;RadioButton&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;OKButton&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;CancelButton&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
* &amp;#039;&amp;#039;&amp;#039;HelpButton&amp;#039;&amp;#039;&amp;#039;&lt;br /&gt;
&lt;br /&gt;
These controls are used to allow the user to interact with the dialog. We need to know how they are used by the dialog to retrieve the user-provided information. What is involved to display them, and how the look &amp;amp; feel is implemented is not interesting at this point, since we only want to know what the dialog actually does.&lt;br /&gt;
&lt;br /&gt;
Other weird things that are not child of control class and that I don&amp;#039;t currently know why it is usefull :&lt;br /&gt;
* AutoTimer&lt;br /&gt;
&lt;br /&gt;
TODO : List of all user-related information stored by this class and sent to the Printer. Add more details on the vcl controls involved (what they are, at least for the non obvious ones).&lt;br /&gt;
&lt;br /&gt;
The class contains also fields used to store the real information provided by the controls (Mostly USHORT and BOOL). There is also a &amp;#039;&amp;#039;&amp;#039;XubString&amp;#039;&amp;#039;&amp;#039; instance and a &amp;#039;&amp;#039;&amp;#039;PrintDialogRange&amp;#039;&amp;#039;&amp;#039; instance used to store range information.&lt;br /&gt;
&lt;br /&gt;
Of course, this class contains an &amp;#039;&amp;#039;&amp;#039;Printer&amp;#039;&amp;#039;&amp;#039; instance and a &amp;#039;&amp;#039;&amp;#039;SvtPtinterImpl&amp;#039;&amp;#039;&amp;#039; instance in order to set the printer functionality.&lt;br /&gt;
&lt;br /&gt;
There is also internal methods, and links to the Option handler and the OK handler.&lt;br /&gt;
&lt;br /&gt;
The public methods are mostly getters and setters, I won&amp;#039;t detail it since I have already provided information about the private attributes, and they do nothing to the Printer instance.&lt;br /&gt;
&lt;br /&gt;
TODO : details the implementation of this class (interesting methods : &amp;#039;&amp;#039;ImplGetFileName&amp;#039;&amp;#039;, IMPL_LINK(PrintDialog, ImplModifyControlHdl, void*, p)&lt;br /&gt;
&lt;br /&gt;
For Aqua port, we need to reimplement this class in order to make it displays the native Aqua Print Dialog that will be provided by the Carbon API, and save information that was previously provided by children of &amp;#039;&amp;#039;&amp;#039;Control&amp;#039;&amp;#039;&amp;#039; class. We should also disable the Printing options provided by the Aqua dialog that are not provided by the Printer class (the information we cannot currently store).&lt;br /&gt;
&lt;br /&gt;
==== Print Setup file ====&lt;br /&gt;
* svtools/inc/prnsetup.hxx&lt;br /&gt;
* svtools/source/dialogs/prnsetup.hxx&lt;br /&gt;
&lt;br /&gt;
Utility functions : &lt;br /&gt;
* &amp;#039;&amp;#039;ImplFillPrnDlgListBox&amp;#039;&amp;#039;(const &amp;#039;&amp;#039;&amp;#039;Printer&amp;#039;&amp;#039;&amp;#039; *, &amp;#039;&amp;#039;&amp;#039;ListBox&amp;#039;&amp;#039;&amp;#039; *, &amp;#039;&amp;#039;&amp;#039;PushButton&amp;#039;&amp;#039;&amp;#039; *)&lt;br /&gt;
This method fills the &amp;#039;&amp;#039;&amp;#039;Printer&amp;#039;&amp;#039;&amp;#039; list-box with the QueueInfo provided by the &amp;#039;&amp;#039;&amp;#039;Printer&amp;#039;&amp;#039;&amp;#039; instance provided in argument. It then enables the OK button if the list is not empty.&lt;br /&gt;
&lt;br /&gt;
== Mac OS X API side ==&lt;br /&gt;
This part describes what can be used and how we intend to use it.&lt;br /&gt;
&lt;br /&gt;
The strategy is to first use the Carbon API to get Print Information and to provide an Aqua User Inerface for printing. Then, we will try to replace the current printing API to the native one, allowing to reduce dependencies, and the total package size.&lt;br /&gt;
&lt;br /&gt;
Carbon provides multiple way for us to print. We might consider every of different approaches :&lt;br /&gt;
* Printing using psprint. We only get settings from the Carbon Print Dialog and the Carbon Print Setup Dialog with the function PMGetPrintSettingsExtendedData (for example) and then we send the obtained parameters to our SalPrinter.&lt;br /&gt;
* Using the PMPrintToFile function (OpenOffice.org provides a postcript version of the document, and then, Carbon handles the print operation)&lt;br /&gt;
* Printing using a QuickDraw graphic context [http://developer.apple.com/documentation/Carbon/Conceptual/CPM_Concepts/cpm_chap3/chapter_3_section_4.html#//apple_ref/doc/uid/TP30000978-TP30000046-TPXREF12 See this link for an example] (As this is a legacy API, we are not enthusiast about using it in OpenOffice.org)&lt;br /&gt;
* Printing using a Quartz 2D graphic context [http://developer.apple.com/documentation/GraphicsImaging/Conceptual/drawingwithquartz2d/index.html More information about Quartz 2D]&lt;br /&gt;
&lt;br /&gt;
We may want to add some features to the Printing dialog provided by Carbon. [http://developer.apple.com/documentation/Printing/Conceptual/ExtPrintingDialogs/index.html This is documented here]&lt;br /&gt;
&lt;br /&gt;
Todo : implement missing methods, using Carbon API&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
=== Link for Mac OS X API documentation  ===&lt;br /&gt;
http://developer.apple.com/documentation/Carbon/Reference/CarbonPrintingManager_Ref/index.html&lt;br /&gt;
&lt;br /&gt;
=== Starting point for documentation ===&lt;br /&gt;
http://developer.apple.com/documentation/Carbon/Printing-date.html#//apple_ref/doc/uid/TP30000440-TP30000420-TP30000455&lt;br /&gt;
http://developer.apple.com/documentation/Carbon/Conceptual/CPM_Concepts/cpm_chap4/chapter_4_section_1.html&lt;br /&gt;
http://developer.apple.com/samplecode/Carbon/idxPrinting-date.html&lt;br /&gt;
http://developer.apple.com/referencelibrary/Carbon/idxPrinting-date.html&lt;br /&gt;
&lt;br /&gt;
This work is part of http://wiki.services.openoffice.org/wiki/Mac_OS_X_Porting_-_Work_Areas/Todo%27s&lt;br /&gt;
&lt;br /&gt;
Created: [[User:Ericb|Ericb]] 19:33, 4 June 2006 (CEST)&lt;br /&gt;
&lt;br /&gt;
Last modification: [[User:Ybart|ybart]] 0:00, 16 October 2006 (CEST)&lt;br /&gt;
&lt;br /&gt;
[[Category:Porting]]&lt;br /&gt;
[[Category:Aqua]]&lt;br /&gt;
[[Category:MacOSX]]&lt;/div&gt;</summary>
		<author><name>Ybart</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Mac_OS_X_Porting_-_Cursors&amp;diff=23761</id>
		<title>Mac OS X Porting - Cursors</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Mac_OS_X_Porting_-_Cursors&amp;diff=23761"/>
		<updated>2007-01-22T22:12:16Z</updated>

		<summary type="html">&lt;p&gt;Ybart: /* What do we need ? */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Implementing custom cursors ==&lt;br /&gt;
&lt;br /&gt;
=== What do we need ? ===&lt;br /&gt;
Of course, we need the standard cursors like arrow, i-beam cursor, that are defined in the Carbon with constants like kThemeArrowCursor or kThemeIBeamCursor. We have no problem for these, then can simply be called in Carbon with the function SetThemeCursor.&lt;br /&gt;
&lt;br /&gt;
But we also need more specific cursors for example : help cursor, draw cursors… For these cursor the only function availables to to this are deprecated, so we should not use them. The only choice left is to make a Cocoa wrapper and using NSCursor to build our own cursors.&lt;br /&gt;
&lt;br /&gt;
[[Category:Porting]]&lt;br /&gt;
[[Category:Aqua]]&lt;/div&gt;</summary>
		<author><name>Ybart</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Mac_OS_X_Porting_-_Cursors&amp;diff=23760</id>
		<title>Mac OS X Porting - Cursors</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Mac_OS_X_Porting_-_Cursors&amp;diff=23760"/>
		<updated>2007-01-22T22:12:01Z</updated>

		<summary type="html">&lt;p&gt;Ybart: Adding categories&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Implementing custom cursors ==&lt;br /&gt;
&lt;br /&gt;
=== What do we need ? ===&lt;br /&gt;
Of course, we need the standard cursors like arrow, i-beam cursor, that are defined in the Carbon with constants like kThemeArrowCursor or kThemeIBeamCursor. We have no problem for these, then can simply be called in Carbon with the function SetThemeCursor.&lt;br /&gt;
&lt;br /&gt;
But we also need more specific cursors for example : help cursor, draw cursors… For these cursor the only function availables to to this are deprecated, so we should not use them. The only choice left is to make a Cocoa wrapper and using NSCursor to build our own cursors.&lt;br /&gt;
&lt;br /&gt;
[[Category:Porting]]&lt;br /&gt;
[[Category::Aqua]]&lt;/div&gt;</summary>
		<author><name>Ybart</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Mac_OS_X_Porting_-_Cursors&amp;diff=23759</id>
		<title>Mac OS X Porting - Cursors</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Mac_OS_X_Porting_-_Cursors&amp;diff=23759"/>
		<updated>2007-01-22T22:10:55Z</updated>

		<summary type="html">&lt;p&gt;Ybart: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;== Implementing custom cursors ==&lt;br /&gt;
&lt;br /&gt;
=== What do we need ? ===&lt;br /&gt;
Of course, we need the standard cursors like arrow, i-beam cursor, that are defined in the Carbon with constants like kThemeArrowCursor or kThemeIBeamCursor. We have no problem for these, then can simply be called in Carbon with the function SetThemeCursor.&lt;br /&gt;
&lt;br /&gt;
But we also need more specific cursors for example : help cursor, draw cursors… For these cursor the only function availables to to this are deprecated, so we should not use them. The only choice left is to make a Cocoa wrapper and using NSCursor to build our own cursors.&lt;/div&gt;</summary>
		<author><name>Ybart</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Mac_OS_X_Porting_-_Native_Printing&amp;diff=19262</id>
		<title>Mac OS X Porting - Native Printing</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Mac_OS_X_Porting_-_Native_Printing&amp;diff=19262"/>
		<updated>2006-10-22T22:54:58Z</updated>

		<summary type="html">&lt;p&gt;Ybart: /* Printer class */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page is dedicated to the native printing implementation in OpenOffice.org for Mac OS X&lt;br /&gt;
&lt;br /&gt;
== What we want to do ? ==&lt;br /&gt;
The final goal of this project is to have the native printing support on Mac OS X.&lt;br /&gt;
&lt;br /&gt;
=== What we have now and what we don&amp;#039;t ? ===&lt;br /&gt;
Currently we simply have a generic printing support which works with X11. There is also printing support implemented for Windows. This means that we have already a way to implement our printing support for Aqua without breaking OpenOffice.org as we have already environment plug-ins.&lt;br /&gt;
&lt;br /&gt;
However, we have only one Print Dialog and one PrinterSetup dialog for all environments.&lt;br /&gt;
&lt;br /&gt;
Tu sum up : we have a starting point to implement low-level printing support using the native API. We only have to implement the antive code. But we have nothing for the dialogs.&lt;br /&gt;
&lt;br /&gt;
=== What the users want ? ===&lt;br /&gt;
The user wants to be able to print with OpenOffice.org the same way he does with its other natives applications. &lt;br /&gt;
&lt;br /&gt;
For us, this means using a native printing dialog. Then, we will also need to implement low-level printing using OS API because, without that the user might not be able to use every setting available in the native dialog. &lt;br /&gt;
&lt;br /&gt;
=== What will be even better ? ===&lt;br /&gt;
Using UNO. This will allow other platform developpers to use the same code to implement their native dialogs.&lt;br /&gt;
&lt;br /&gt;
== OpenOffice.org side ==&lt;br /&gt;
This part describes what can be found in the OOo APIs, how it is implemented and how it will be changed.&lt;br /&gt;
&lt;br /&gt;
=== OOo print process ===&lt;br /&gt;
I will try to share the few thing I understood about the way Writer prints document.&lt;br /&gt;
&lt;br /&gt;
First I need to locate the print menu item in the sw module (sw stands for Star Writer). For this, I need to know where in sw the menubar is built. I did found the menubar, but not how the menu item was linked to the print operation. Instead, I have found a method PrintPages implemented in sw module. The stack may look like that :&lt;br /&gt;
* SwXTextDocument::printPages()&lt;br /&gt;
* ViewShell::executeSlot(aReq)&lt;br /&gt;
* ...&lt;br /&gt;
* SwView::ExecutePrint()&lt;br /&gt;
* ...&lt;br /&gt;
* SwXTextDocument::render()&lt;br /&gt;
* ViewShell::Prt()&lt;br /&gt;
* OutputDevice:: ...&lt;br /&gt;
&lt;br /&gt;
TODO : Complete the stack trace&lt;br /&gt;
&lt;br /&gt;
There is many holes in the stack but we get the idea. The OuputDevice is in fact our Printer.&lt;br /&gt;
&lt;br /&gt;
[[Image:Printing_model.png]]&lt;br /&gt;
&lt;br /&gt;
1. The user Application creates a print dialog or a print setup dialog. For this, it needs to call svtools. To be a bit more precise, it creates a new instance of PrintDialog or of PrintDialogSetup, it associates a Printer instace to it, then, it calls the Execute method from PrintDialog or PrintSetupDialog. This operation shows the dialog (using the Execute method from ModalDialog, which is in vcl) and sets the Printer Data correctly with the method setPrinterProps. Do do the real display of the dialog, it uses SalFrame&amp;#039;s Show() method, which can be X11SalFrame, AquaSalFrame, etc.&lt;br /&gt;
&lt;br /&gt;
2. Svtools is responsible for asking to the user the requested information about printing options. Then, it returns them ot the user application.&lt;br /&gt;
&lt;br /&gt;
3. The user application has now everything needed to print the document. So, it asks VCL to draw pixels, lines, characters, etc on an OutputDevice.&lt;br /&gt;
&lt;br /&gt;
At this point, I don&amp;#039;t know exactly how the OutputDevice is set (who decides that it would be a screen, an Aqua printer or a PostScript printer. This is not really important since we understant the main idea of how printing works.&lt;br /&gt;
&lt;br /&gt;
[[Image:Printing_model_step_4.png]]&lt;br /&gt;
&lt;br /&gt;
4. After that VCL relies on its Graphic Context to really draws (i.e. make the OS really draws) the lines and pixels on the screen or on the print device.&lt;br /&gt;
&lt;br /&gt;
=== Concerned OOo modules ===&lt;br /&gt;
* psprint&lt;br /&gt;
* vcl&lt;br /&gt;
* svtools&lt;br /&gt;
&lt;br /&gt;
=== VCL ===&lt;br /&gt;
What we know about [[vcl]].&lt;br /&gt;
&lt;br /&gt;
==== SalPrinter class ====&lt;br /&gt;
SalPrinter is a virtual class intended for managing print jobs. It is composed of virtual fonctions, and a dummy constructor.&lt;br /&gt;
This class is inherited by PspSalPrinter, WinSalPrinter, and of course by AquaSalPrinter (see [[#AquaSalPrinter class|AquaSalPrinter class]]).&lt;br /&gt;
&lt;br /&gt;
Its header is located in vcl/inc/salprn.hxx&lt;br /&gt;
It has no implementation file.&lt;br /&gt;
&lt;br /&gt;
[[Image:UML_class_SalPrinter.png]]&lt;br /&gt;
&lt;br /&gt;
==== PspSalPrinter class ====&lt;br /&gt;
PspSalPrinter means PostScript Print System Abstraction Layer Printer. Its implementation is located in vcl/unx/source/gdi/salprnpsp.cxx. As the name suggests it relies on features psprint module.&lt;br /&gt;
&lt;br /&gt;
TODO : Discuss about PspSalPrinter implementation.&lt;br /&gt;
&lt;br /&gt;
==== Printer class ====&lt;br /&gt;
This is an abstraction class of a printer driver. You can entirely set up the printer there and start print jobs. What we need here is to make our native dialog access to this Printer. The we will need to make this class access to OS API rather than psprint. &lt;br /&gt;
&lt;br /&gt;
AquaSalPrinter class is located in vcl/aqua/source/gdi/print.cxx&lt;br /&gt;
&lt;br /&gt;
[[Image:Printer_class_description.png]]&lt;br /&gt;
&lt;br /&gt;
This class inherits of OutputDevice and is derivated in ImplQPrinter.&lt;br /&gt;
&lt;br /&gt;
* QueueInfo class - This class is related to the Printer class. It is used to store information about printers (name, driver, location, comment as strings, and number of Jobs, and a status code).&lt;br /&gt;
&lt;br /&gt;
==== OutputDevice class ====&lt;br /&gt;
This class allows applications such as Writer to draw graphics elements (pixels, lines, rects, characters, strings, etc...).&lt;br /&gt;
&lt;br /&gt;
This class is located in vcl/source/gdi/outdev.cxx, vcl/source/gdi/outdev[2-6].cxx&lt;br /&gt;
&lt;br /&gt;
At this time, we don&amp;#039;t need to know the details of this class. We will focus on it when we will use the Carbon Printing API.&lt;br /&gt;
&lt;br /&gt;
==== SalGraphics class ====&lt;br /&gt;
This class is responsible to translate the abstract drawing calls to concrete OS calls.&lt;br /&gt;
&lt;br /&gt;
==== PspGraphics ====&lt;br /&gt;
The class I need to reimplement using Aqua printing primitives...&lt;br /&gt;
May be I will name it AquaPrintGraphics ?...&lt;br /&gt;
&lt;br /&gt;
==== AquaSalPrinter class ====&lt;br /&gt;
AquaSalPrinter class is located in vcl/aqua/source/gdi/salprn.cxx&lt;br /&gt;
&lt;br /&gt;
Headers are in :&lt;br /&gt;
 vcl/inc/salinst.hxx  &lt;br /&gt;
 vcl/inc/salgdi.hxx    &lt;br /&gt;
 vcl/inc/salprn.hxx&lt;br /&gt;
&lt;br /&gt;
 Aqua implementation :&lt;br /&gt;
 vcl/aqua/inc/salprn.h  (AquaSalPrinter class implementation, inherits from SalPrinter)&lt;br /&gt;
&lt;br /&gt;
=== psprint ===&lt;br /&gt;
What we know about psprint.&lt;br /&gt;
&lt;br /&gt;
=== svtools ===&lt;br /&gt;
What we need to know about svtools. Mostly it provides us the Print Dialog, and some other Print related dialogs.&lt;br /&gt;
&lt;br /&gt;
==== PrintDialog class ====&lt;br /&gt;
This class is responsible for drawing the print dialog we usaually view when we choose the Print option of the File menu.&lt;br /&gt;
The current implementation uses this class to draw the print dialog. In our Aqua native implementation, we want to use the on provided by Carbon API. To achieve this, we want to know the functionality of this class, and let carbon manage the functionality maybe at this level or maybe in a other lever (higher or lower). We also need to know how this class provides information to the Printer instance.&lt;br /&gt;
&lt;br /&gt;
* The header of this class is located in svtools/inc/printdlg.hxx&lt;br /&gt;
* The implementation of this class is located in svtools/source/dialogs/printdlg.cxx&lt;br /&gt;
&lt;br /&gt;
This class is a derivate of ModalDialog class. &lt;br /&gt;
&lt;br /&gt;
It contains all the controls used by the dialog which are either :&lt;br /&gt;
* FixedImage&lt;br /&gt;
* FixedLine&lt;br /&gt;
* FixedText&lt;br /&gt;
* FixedInfo : it is a child of FixedText and is defined in svtools/inc/stdctrl.hxx. It is nothing more than a FixedText with the info style applied (same behaviour).&lt;br /&gt;
* ListBox : maLbName - List-box used to store the available printers.&lt;br /&gt;
&lt;br /&gt;
* Edit&lt;br /&gt;
* NumericField&lt;br /&gt;
&lt;br /&gt;
* CheckBox&lt;br /&gt;
* PushButton&lt;br /&gt;
* RadioButton&lt;br /&gt;
* OKButton&lt;br /&gt;
* CancelButton&lt;br /&gt;
* HelpButton&lt;br /&gt;
&lt;br /&gt;
These controls are used to allow the user to interact with the dialog. We need to know how they are used by the dialog to retrieve the user-provided information. What is involved to display them, and how the look &amp;amp; feel is implemented is not interesting at this point, since we only want to know what the dialog actually does.&lt;br /&gt;
&lt;br /&gt;
Other weird things that are not child of control class and that I don&amp;#039;t currently know why it is usefull :&lt;br /&gt;
* AutoTimer&lt;br /&gt;
&lt;br /&gt;
TODO : List of all user-related information stored by this class and sent to the Printer. Add more details on the vcl controls involved (what they are, at least for the non obvious ones).&lt;br /&gt;
&lt;br /&gt;
The class contains also fields used to store the real information provided by the controls (Mostly USHORT and BOOL). There is also a XubString instance and a PrintDialogRange instance used to store range information.&lt;br /&gt;
&lt;br /&gt;
Of course, this class contains an Printer instance and a SvtPtinterImpl instance in order to set the printer functionality.&lt;br /&gt;
&lt;br /&gt;
There is also internal methods, and links to the Option handler and the OK handler.&lt;br /&gt;
&lt;br /&gt;
The public methods are mostly getters and setters, I won&amp;#039;t detail it since I have already provided information about the private attributes, and they do nothing to the Printer instance.&lt;br /&gt;
&lt;br /&gt;
TODO : details the implementation of this class (interesting methods : ImplGetFileName, IMPL_LINK(PrintDialog, ImplModifyControlHdl, void*, p)&lt;br /&gt;
&lt;br /&gt;
For Aqua port, we need to reimplement this class in order to make it displays the native Aqua Print Dialog that will be provided by the Carbon API, and save information that was previously provided by children of Control class. We should also disable the Printing options provided by the Aqua dialog that are not provided by the Printer class (the information we cannot currently store).&lt;br /&gt;
&lt;br /&gt;
==== Print Setup file ====&lt;br /&gt;
* svtools/inc/prnsetup.hxx&lt;br /&gt;
* svtools/source/dialogs/prnsetup.hxx&lt;br /&gt;
&lt;br /&gt;
Utility functions : &lt;br /&gt;
* ImplFillPrnDlgListBox(const Printer *, ListBox *, PushButton *)&lt;br /&gt;
This method fills the Printer list-box with the QueueInfo provided by the Printer instance provided in argument. It then enables the OK button if the list is not empty.&lt;br /&gt;
&lt;br /&gt;
== Mac OS X API side ==&lt;br /&gt;
This part describes what can be used and how we intend to use it.&lt;br /&gt;
&lt;br /&gt;
The strategy is to first use the Carbon API to get Print Information and to provide an Aqua User Inerface for printing. Then, we will try to replace the current printing API to the native one, allowing to reduce dependencies, and the total package size.&lt;br /&gt;
&lt;br /&gt;
Carbon provides multiple way for us to print. We might consider every of different approaches :&lt;br /&gt;
* Printing using psprint. We only get settings from the Carbon Print Dialog and the Carbon Print Setup Dialog with the function PMGetPrintSettingsExtendedData (for example) and then we send the obtained parameters to our SalPrinter.&lt;br /&gt;
* Using the PMPrintToFile function (OpenOffice.org provides a postcript version of the document, and then, Carbon handles the print operation)&lt;br /&gt;
* Printing using a QuickDraw graphic context [http://developer.apple.com/documentation/Carbon/Conceptual/CPM_Concepts/cpm_chap3/chapter_3_section_4.html#//apple_ref/doc/uid/TP30000978-TP30000046-TPXREF12 See this link for an example] (As this is a legacy API, we are not enthusiast about using it in OpenOffice.org)&lt;br /&gt;
* Printing using a Quartz 2D graphic context [http://developer.apple.com/documentation/GraphicsImaging/Conceptual/drawingwithquartz2d/index.html More information about Quartz 2D]&lt;br /&gt;
&lt;br /&gt;
We may want to add some features to the Printing dialog provided by Carbon. [http://developer.apple.com/documentation/Printing/Conceptual/ExtPrintingDialogs/index.html This is documented here]&lt;br /&gt;
&lt;br /&gt;
Todo : implement missing methods, using Carbon API&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
=== Link for Mac OS X API documentation  ===&lt;br /&gt;
http://developer.apple.com/documentation/Carbon/Reference/CarbonPrintingManager_Ref/index.html&lt;br /&gt;
&lt;br /&gt;
=== Starting point for documentation ===&lt;br /&gt;
http://developer.apple.com/documentation/Carbon/Printing-date.html#//apple_ref/doc/uid/TP30000440-TP30000420-TP30000455&lt;br /&gt;
http://developer.apple.com/documentation/Carbon/Conceptual/CPM_Concepts/cpm_chap4/chapter_4_section_1.html&lt;br /&gt;
http://developer.apple.com/samplecode/Carbon/idxPrinting-date.html&lt;br /&gt;
http://developer.apple.com/referencelibrary/Carbon/idxPrinting-date.html&lt;br /&gt;
&lt;br /&gt;
This work is part of http://wiki.services.openoffice.org/wiki/Mac_OS_X_Porting_-_Work_Areas/Todo%27s&lt;br /&gt;
&lt;br /&gt;
Created: [[User:Ericb|Ericb]] 19:33, 4 June 2006 (CEST)&lt;br /&gt;
&lt;br /&gt;
Last modification: [[User:Ybart|ybart]] 0:00, 16 October 2006 (CEST)&lt;br /&gt;
&lt;br /&gt;
[[Category:Porting]]&lt;br /&gt;
[[Category:Aqua]]&lt;br /&gt;
[[Category:MacOSX]]&lt;/div&gt;</summary>
		<author><name>Ybart</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=File:Printer_class_description.png&amp;diff=19261</id>
		<title>File:Printer class description.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=File:Printer_class_description.png&amp;diff=19261"/>
		<updated>2006-10-22T22:54:23Z</updated>

		<summary type="html">&lt;p&gt;Ybart: Printer class Methods and Attributes&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Printer class Methods and Attributes&lt;/div&gt;</summary>
		<author><name>Ybart</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Mac_OS_X_Porting_-_Native_Printing&amp;diff=19260</id>
		<title>Mac OS X Porting - Native Printing</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Mac_OS_X_Porting_-_Native_Printing&amp;diff=19260"/>
		<updated>2006-10-22T22:06:45Z</updated>

		<summary type="html">&lt;p&gt;Ybart: /* SalPrinter class */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page is dedicated to the native printing implementation in OpenOffice.org for Mac OS X&lt;br /&gt;
&lt;br /&gt;
== What we want to do ? ==&lt;br /&gt;
The final goal of this project is to have the native printing support on Mac OS X.&lt;br /&gt;
&lt;br /&gt;
=== What we have now and what we don&amp;#039;t ? ===&lt;br /&gt;
Currently we simply have a generic printing support which works with X11. There is also printing support implemented for Windows. This means that we have already a way to implement our printing support for Aqua without breaking OpenOffice.org as we have already environment plug-ins.&lt;br /&gt;
&lt;br /&gt;
However, we have only one Print Dialog and one PrinterSetup dialog for all environments.&lt;br /&gt;
&lt;br /&gt;
Tu sum up : we have a starting point to implement low-level printing support using the native API. We only have to implement the antive code. But we have nothing for the dialogs.&lt;br /&gt;
&lt;br /&gt;
=== What the users want ? ===&lt;br /&gt;
The user wants to be able to print with OpenOffice.org the same way he does with its other natives applications. &lt;br /&gt;
&lt;br /&gt;
For us, this means using a native printing dialog. Then, we will also need to implement low-level printing using OS API because, without that the user might not be able to use every setting available in the native dialog. &lt;br /&gt;
&lt;br /&gt;
=== What will be even better ? ===&lt;br /&gt;
Using UNO. This will allow other platform developpers to use the same code to implement their native dialogs.&lt;br /&gt;
&lt;br /&gt;
== OpenOffice.org side ==&lt;br /&gt;
This part describes what can be found in the OOo APIs, how it is implemented and how it will be changed.&lt;br /&gt;
&lt;br /&gt;
=== OOo print process ===&lt;br /&gt;
I will try to share the few thing I understood about the way Writer prints document.&lt;br /&gt;
&lt;br /&gt;
First I need to locate the print menu item in the sw module (sw stands for Star Writer). For this, I need to know where in sw the menubar is built. I did found the menubar, but not how the menu item was linked to the print operation. Instead, I have found a method PrintPages implemented in sw module. The stack may look like that :&lt;br /&gt;
* SwXTextDocument::printPages()&lt;br /&gt;
* ViewShell::executeSlot(aReq)&lt;br /&gt;
* ...&lt;br /&gt;
* SwView::ExecutePrint()&lt;br /&gt;
* ...&lt;br /&gt;
* SwXTextDocument::render()&lt;br /&gt;
* ViewShell::Prt()&lt;br /&gt;
* OutputDevice:: ...&lt;br /&gt;
&lt;br /&gt;
TODO : Complete the stack trace&lt;br /&gt;
&lt;br /&gt;
There is many holes in the stack but we get the idea. The OuputDevice is in fact our Printer.&lt;br /&gt;
&lt;br /&gt;
[[Image:Printing_model.png]]&lt;br /&gt;
&lt;br /&gt;
1. The user Application creates a print dialog or a print setup dialog. For this, it needs to call svtools. To be a bit more precise, it creates a new instance of PrintDialog or of PrintDialogSetup, it associates a Printer instace to it, then, it calls the Execute method from PrintDialog or PrintSetupDialog. This operation shows the dialog (using the Execute method from ModalDialog, which is in vcl) and sets the Printer Data correctly with the method setPrinterProps. Do do the real display of the dialog, it uses SalFrame&amp;#039;s Show() method, which can be X11SalFrame, AquaSalFrame, etc.&lt;br /&gt;
&lt;br /&gt;
2. Svtools is responsible for asking to the user the requested information about printing options. Then, it returns them ot the user application.&lt;br /&gt;
&lt;br /&gt;
3. The user application has now everything needed to print the document. So, it asks VCL to draw pixels, lines, characters, etc on an OutputDevice.&lt;br /&gt;
&lt;br /&gt;
At this point, I don&amp;#039;t know exactly how the OutputDevice is set (who decides that it would be a screen, an Aqua printer or a PostScript printer. This is not really important since we understant the main idea of how printing works.&lt;br /&gt;
&lt;br /&gt;
[[Image:Printing_model_step_4.png]]&lt;br /&gt;
&lt;br /&gt;
4. After that VCL relies on its Graphic Context to really draws (i.e. make the OS really draws) the lines and pixels on the screen or on the print device.&lt;br /&gt;
&lt;br /&gt;
=== Concerned OOo modules ===&lt;br /&gt;
* psprint&lt;br /&gt;
* vcl&lt;br /&gt;
* svtools&lt;br /&gt;
&lt;br /&gt;
=== VCL ===&lt;br /&gt;
What we know about [[vcl]].&lt;br /&gt;
&lt;br /&gt;
==== SalPrinter class ====&lt;br /&gt;
SalPrinter is a virtual class intended for managing print jobs. It is composed of virtual fonctions, and a dummy constructor.&lt;br /&gt;
This class is inherited by PspSalPrinter, WinSalPrinter, and of course by AquaSalPrinter (see [[#AquaSalPrinter class|AquaSalPrinter class]]).&lt;br /&gt;
&lt;br /&gt;
Its header is located in vcl/inc/salprn.hxx&lt;br /&gt;
It has no implementation file.&lt;br /&gt;
&lt;br /&gt;
[[Image:UML_class_SalPrinter.png]]&lt;br /&gt;
&lt;br /&gt;
==== PspSalPrinter class ====&lt;br /&gt;
PspSalPrinter means PostScript Print System Abstraction Layer Printer. Its implementation is located in vcl/unx/source/gdi/salprnpsp.cxx. As the name suggests it relies on features psprint module.&lt;br /&gt;
&lt;br /&gt;
TODO : Discuss about PspSalPrinter implementation.&lt;br /&gt;
&lt;br /&gt;
==== Printer class ====&lt;br /&gt;
This is an abstraction class of a printer driver. You can entirely set up the printer there and start print jobs. What we need here is to make our native dialog access to this Printer. The we will need to make this class access to OS API rather than psprint. &lt;br /&gt;
&lt;br /&gt;
AquaSalPrinter class is located in vcl/aqua/source/gdi/print.cxx&lt;br /&gt;
&lt;br /&gt;
This class inherits of OutputDevice and is derivated in ImplQPrinter.&lt;br /&gt;
&lt;br /&gt;
* QueueInfo class - This class is related to the Printer class. It is used to store information about printers (name, driver, location, comment as strings, and number of Jobs, and a status code).&lt;br /&gt;
&lt;br /&gt;
==== OutputDevice class ====&lt;br /&gt;
This class allows applications such as Writer to draw graphics elements (pixels, lines, rects, characters, strings, etc...).&lt;br /&gt;
&lt;br /&gt;
This class is located in vcl/source/gdi/outdev.cxx, vcl/source/gdi/outdev[2-6].cxx&lt;br /&gt;
&lt;br /&gt;
At this time, we don&amp;#039;t need to know the details of this class. We will focus on it when we will use the Carbon Printing API.&lt;br /&gt;
&lt;br /&gt;
==== SalGraphics class ====&lt;br /&gt;
This class is responsible to translate the abstract drawing calls to concrete OS calls.&lt;br /&gt;
&lt;br /&gt;
==== PspGraphics ====&lt;br /&gt;
The class I need to reimplement using Aqua printing primitives...&lt;br /&gt;
May be I will name it AquaPrintGraphics ?...&lt;br /&gt;
&lt;br /&gt;
==== AquaSalPrinter class ====&lt;br /&gt;
AquaSalPrinter class is located in vcl/aqua/source/gdi/salprn.cxx&lt;br /&gt;
&lt;br /&gt;
Headers are in :&lt;br /&gt;
 vcl/inc/salinst.hxx  &lt;br /&gt;
 vcl/inc/salgdi.hxx    &lt;br /&gt;
 vcl/inc/salprn.hxx&lt;br /&gt;
&lt;br /&gt;
 Aqua implementation :&lt;br /&gt;
 vcl/aqua/inc/salprn.h  (AquaSalPrinter class implementation, inherits from SalPrinter)&lt;br /&gt;
&lt;br /&gt;
=== psprint ===&lt;br /&gt;
What we know about psprint.&lt;br /&gt;
&lt;br /&gt;
=== svtools ===&lt;br /&gt;
What we need to know about svtools. Mostly it provides us the Print Dialog, and some other Print related dialogs.&lt;br /&gt;
&lt;br /&gt;
==== PrintDialog class ====&lt;br /&gt;
This class is responsible for drawing the print dialog we usaually view when we choose the Print option of the File menu.&lt;br /&gt;
The current implementation uses this class to draw the print dialog. In our Aqua native implementation, we want to use the on provided by Carbon API. To achieve this, we want to know the functionality of this class, and let carbon manage the functionality maybe at this level or maybe in a other lever (higher or lower). We also need to know how this class provides information to the Printer instance.&lt;br /&gt;
&lt;br /&gt;
* The header of this class is located in svtools/inc/printdlg.hxx&lt;br /&gt;
* The implementation of this class is located in svtools/source/dialogs/printdlg.cxx&lt;br /&gt;
&lt;br /&gt;
This class is a derivate of ModalDialog class. &lt;br /&gt;
&lt;br /&gt;
It contains all the controls used by the dialog which are either :&lt;br /&gt;
* FixedImage&lt;br /&gt;
* FixedLine&lt;br /&gt;
* FixedText&lt;br /&gt;
* FixedInfo : it is a child of FixedText and is defined in svtools/inc/stdctrl.hxx. It is nothing more than a FixedText with the info style applied (same behaviour).&lt;br /&gt;
* ListBox : maLbName - List-box used to store the available printers.&lt;br /&gt;
&lt;br /&gt;
* Edit&lt;br /&gt;
* NumericField&lt;br /&gt;
&lt;br /&gt;
* CheckBox&lt;br /&gt;
* PushButton&lt;br /&gt;
* RadioButton&lt;br /&gt;
* OKButton&lt;br /&gt;
* CancelButton&lt;br /&gt;
* HelpButton&lt;br /&gt;
&lt;br /&gt;
These controls are used to allow the user to interact with the dialog. We need to know how they are used by the dialog to retrieve the user-provided information. What is involved to display them, and how the look &amp;amp; feel is implemented is not interesting at this point, since we only want to know what the dialog actually does.&lt;br /&gt;
&lt;br /&gt;
Other weird things that are not child of control class and that I don&amp;#039;t currently know why it is usefull :&lt;br /&gt;
* AutoTimer&lt;br /&gt;
&lt;br /&gt;
TODO : List of all user-related information stored by this class and sent to the Printer. Add more details on the vcl controls involved (what they are, at least for the non obvious ones).&lt;br /&gt;
&lt;br /&gt;
The class contains also fields used to store the real information provided by the controls (Mostly USHORT and BOOL). There is also a XubString instance and a PrintDialogRange instance used to store range information.&lt;br /&gt;
&lt;br /&gt;
Of course, this class contains an Printer instance and a SvtPtinterImpl instance in order to set the printer functionality.&lt;br /&gt;
&lt;br /&gt;
There is also internal methods, and links to the Option handler and the OK handler.&lt;br /&gt;
&lt;br /&gt;
The public methods are mostly getters and setters, I won&amp;#039;t detail it since I have already provided information about the private attributes, and they do nothing to the Printer instance.&lt;br /&gt;
&lt;br /&gt;
TODO : details the implementation of this class (interesting methods : ImplGetFileName, IMPL_LINK(PrintDialog, ImplModifyControlHdl, void*, p)&lt;br /&gt;
&lt;br /&gt;
For Aqua port, we need to reimplement this class in order to make it displays the native Aqua Print Dialog that will be provided by the Carbon API, and save information that was previously provided by children of Control class. We should also disable the Printing options provided by the Aqua dialog that are not provided by the Printer class (the information we cannot currently store).&lt;br /&gt;
&lt;br /&gt;
==== Print Setup file ====&lt;br /&gt;
* svtools/inc/prnsetup.hxx&lt;br /&gt;
* svtools/source/dialogs/prnsetup.hxx&lt;br /&gt;
&lt;br /&gt;
Utility functions : &lt;br /&gt;
* ImplFillPrnDlgListBox(const Printer *, ListBox *, PushButton *)&lt;br /&gt;
This method fills the Printer list-box with the QueueInfo provided by the Printer instance provided in argument. It then enables the OK button if the list is not empty.&lt;br /&gt;
&lt;br /&gt;
== Mac OS X API side ==&lt;br /&gt;
This part describes what can be used and how we intend to use it.&lt;br /&gt;
&lt;br /&gt;
The strategy is to first use the Carbon API to get Print Information and to provide an Aqua User Inerface for printing. Then, we will try to replace the current printing API to the native one, allowing to reduce dependencies, and the total package size.&lt;br /&gt;
&lt;br /&gt;
Carbon provides multiple way for us to print. We might consider every of different approaches :&lt;br /&gt;
* Printing using psprint. We only get settings from the Carbon Print Dialog and the Carbon Print Setup Dialog with the function PMGetPrintSettingsExtendedData (for example) and then we send the obtained parameters to our SalPrinter.&lt;br /&gt;
* Using the PMPrintToFile function (OpenOffice.org provides a postcript version of the document, and then, Carbon handles the print operation)&lt;br /&gt;
* Printing using a QuickDraw graphic context [http://developer.apple.com/documentation/Carbon/Conceptual/CPM_Concepts/cpm_chap3/chapter_3_section_4.html#//apple_ref/doc/uid/TP30000978-TP30000046-TPXREF12 See this link for an example] (As this is a legacy API, we are not enthusiast about using it in OpenOffice.org)&lt;br /&gt;
* Printing using a Quartz 2D graphic context [http://developer.apple.com/documentation/GraphicsImaging/Conceptual/drawingwithquartz2d/index.html More information about Quartz 2D]&lt;br /&gt;
&lt;br /&gt;
We may want to add some features to the Printing dialog provided by Carbon. [http://developer.apple.com/documentation/Printing/Conceptual/ExtPrintingDialogs/index.html This is documented here]&lt;br /&gt;
&lt;br /&gt;
Todo : implement missing methods, using Carbon API&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
=== Link for Mac OS X API documentation  ===&lt;br /&gt;
http://developer.apple.com/documentation/Carbon/Reference/CarbonPrintingManager_Ref/index.html&lt;br /&gt;
&lt;br /&gt;
=== Starting point for documentation ===&lt;br /&gt;
http://developer.apple.com/documentation/Carbon/Printing-date.html#//apple_ref/doc/uid/TP30000440-TP30000420-TP30000455&lt;br /&gt;
http://developer.apple.com/documentation/Carbon/Conceptual/CPM_Concepts/cpm_chap4/chapter_4_section_1.html&lt;br /&gt;
http://developer.apple.com/samplecode/Carbon/idxPrinting-date.html&lt;br /&gt;
http://developer.apple.com/referencelibrary/Carbon/idxPrinting-date.html&lt;br /&gt;
&lt;br /&gt;
This work is part of http://wiki.services.openoffice.org/wiki/Mac_OS_X_Porting_-_Work_Areas/Todo%27s&lt;br /&gt;
&lt;br /&gt;
Created: [[User:Ericb|Ericb]] 19:33, 4 June 2006 (CEST)&lt;br /&gt;
&lt;br /&gt;
Last modification: [[User:Ybart|ybart]] 0:00, 16 October 2006 (CEST)&lt;br /&gt;
&lt;br /&gt;
[[Category:Porting]]&lt;br /&gt;
[[Category:Aqua]]&lt;br /&gt;
[[Category:MacOSX]]&lt;/div&gt;</summary>
		<author><name>Ybart</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Mac_OS_X_Porting_-_Native_Printing&amp;diff=19259</id>
		<title>Mac OS X Porting - Native Printing</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Mac_OS_X_Porting_-_Native_Printing&amp;diff=19259"/>
		<updated>2006-10-22T21:52:59Z</updated>

		<summary type="html">&lt;p&gt;Ybart: /* SalPrinter class */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page is dedicated to the native printing implementation in OpenOffice.org for Mac OS X&lt;br /&gt;
&lt;br /&gt;
== What we want to do ? ==&lt;br /&gt;
The final goal of this project is to have the native printing support on Mac OS X.&lt;br /&gt;
&lt;br /&gt;
=== What we have now and what we don&amp;#039;t ? ===&lt;br /&gt;
Currently we simply have a generic printing support which works with X11. There is also printing support implemented for Windows. This means that we have already a way to implement our printing support for Aqua without breaking OpenOffice.org as we have already environment plug-ins.&lt;br /&gt;
&lt;br /&gt;
However, we have only one Print Dialog and one PrinterSetup dialog for all environments.&lt;br /&gt;
&lt;br /&gt;
Tu sum up : we have a starting point to implement low-level printing support using the native API. We only have to implement the antive code. But we have nothing for the dialogs.&lt;br /&gt;
&lt;br /&gt;
=== What the users want ? ===&lt;br /&gt;
The user wants to be able to print with OpenOffice.org the same way he does with its other natives applications. &lt;br /&gt;
&lt;br /&gt;
For us, this means using a native printing dialog. Then, we will also need to implement low-level printing using OS API because, without that the user might not be able to use every setting available in the native dialog. &lt;br /&gt;
&lt;br /&gt;
=== What will be even better ? ===&lt;br /&gt;
Using UNO. This will allow other platform developpers to use the same code to implement their native dialogs.&lt;br /&gt;
&lt;br /&gt;
== OpenOffice.org side ==&lt;br /&gt;
This part describes what can be found in the OOo APIs, how it is implemented and how it will be changed.&lt;br /&gt;
&lt;br /&gt;
=== OOo print process ===&lt;br /&gt;
I will try to share the few thing I understood about the way Writer prints document.&lt;br /&gt;
&lt;br /&gt;
First I need to locate the print menu item in the sw module (sw stands for Star Writer). For this, I need to know where in sw the menubar is built. I did found the menubar, but not how the menu item was linked to the print operation. Instead, I have found a method PrintPages implemented in sw module. The stack may look like that :&lt;br /&gt;
* SwXTextDocument::printPages()&lt;br /&gt;
* ViewShell::executeSlot(aReq)&lt;br /&gt;
* ...&lt;br /&gt;
* SwView::ExecutePrint()&lt;br /&gt;
* ...&lt;br /&gt;
* SwXTextDocument::render()&lt;br /&gt;
* ViewShell::Prt()&lt;br /&gt;
* OutputDevice:: ...&lt;br /&gt;
&lt;br /&gt;
TODO : Complete the stack trace&lt;br /&gt;
&lt;br /&gt;
There is many holes in the stack but we get the idea. The OuputDevice is in fact our Printer.&lt;br /&gt;
&lt;br /&gt;
[[Image:Printing_model.png]]&lt;br /&gt;
&lt;br /&gt;
1. The user Application creates a print dialog or a print setup dialog. For this, it needs to call svtools. To be a bit more precise, it creates a new instance of PrintDialog or of PrintDialogSetup, it associates a Printer instace to it, then, it calls the Execute method from PrintDialog or PrintSetupDialog. This operation shows the dialog (using the Execute method from ModalDialog, which is in vcl) and sets the Printer Data correctly with the method setPrinterProps. Do do the real display of the dialog, it uses SalFrame&amp;#039;s Show() method, which can be X11SalFrame, AquaSalFrame, etc.&lt;br /&gt;
&lt;br /&gt;
2. Svtools is responsible for asking to the user the requested information about printing options. Then, it returns them ot the user application.&lt;br /&gt;
&lt;br /&gt;
3. The user application has now everything needed to print the document. So, it asks VCL to draw pixels, lines, characters, etc on an OutputDevice.&lt;br /&gt;
&lt;br /&gt;
At this point, I don&amp;#039;t know exactly how the OutputDevice is set (who decides that it would be a screen, an Aqua printer or a PostScript printer. This is not really important since we understant the main idea of how printing works.&lt;br /&gt;
&lt;br /&gt;
[[Image:Printing_model_step_4.png]]&lt;br /&gt;
&lt;br /&gt;
4. After that VCL relies on its Graphic Context to really draws (i.e. make the OS really draws) the lines and pixels on the screen or on the print device.&lt;br /&gt;
&lt;br /&gt;
=== Concerned OOo modules ===&lt;br /&gt;
* psprint&lt;br /&gt;
* vcl&lt;br /&gt;
* svtools&lt;br /&gt;
&lt;br /&gt;
=== VCL ===&lt;br /&gt;
What we know about [[vcl]].&lt;br /&gt;
&lt;br /&gt;
==== SalPrinter class ====&lt;br /&gt;
SalPrinter is a virtual class intended for managing print jobs. It is composed of virtual fonctions, and a dummy constructor.&lt;br /&gt;
This class is inherited by PspSalPrinter, WinSalPrinter, and of course by AquaSalPrinter (see [[#AquaSalPrinter class|AquaSalPrinter class]]).&lt;br /&gt;
&lt;br /&gt;
[[Image:UML_class_SalPrinter.png]]&lt;br /&gt;
&lt;br /&gt;
==== PspSalPrinter class ====&lt;br /&gt;
PspSalPrinter means PostScript Print System Abstraction Layer Printer. Its implementation is located in vcl/unx/source/gdi/salprnpsp.cxx. As the name suggests it relies on features psprint module.&lt;br /&gt;
&lt;br /&gt;
TODO : Discuss about PspSalPrinter implementation.&lt;br /&gt;
&lt;br /&gt;
==== Printer class ====&lt;br /&gt;
This is an abstraction class of a printer driver. You can entirely set up the printer there and start print jobs. What we need here is to make our native dialog access to this Printer. The we will need to make this class access to OS API rather than psprint. &lt;br /&gt;
&lt;br /&gt;
AquaSalPrinter class is located in vcl/aqua/source/gdi/print.cxx&lt;br /&gt;
&lt;br /&gt;
This class inherits of OutputDevice and is derivated in ImplQPrinter.&lt;br /&gt;
&lt;br /&gt;
* QueueInfo class - This class is related to the Printer class. It is used to store information about printers (name, driver, location, comment as strings, and number of Jobs, and a status code).&lt;br /&gt;
&lt;br /&gt;
==== OutputDevice class ====&lt;br /&gt;
This class allows applications such as Writer to draw graphics elements (pixels, lines, rects, characters, strings, etc...).&lt;br /&gt;
&lt;br /&gt;
This class is located in vcl/source/gdi/outdev.cxx, vcl/source/gdi/outdev[2-6].cxx&lt;br /&gt;
&lt;br /&gt;
At this time, we don&amp;#039;t need to know the details of this class. We will focus on it when we will use the Carbon Printing API.&lt;br /&gt;
&lt;br /&gt;
==== SalGraphics class ====&lt;br /&gt;
This class is responsible to translate the abstract drawing calls to concrete OS calls.&lt;br /&gt;
&lt;br /&gt;
==== PspGraphics ====&lt;br /&gt;
The class I need to reimplement using Aqua printing primitives...&lt;br /&gt;
May be I will name it AquaPrintGraphics ?...&lt;br /&gt;
&lt;br /&gt;
==== AquaSalPrinter class ====&lt;br /&gt;
AquaSalPrinter class is located in vcl/aqua/source/gdi/salprn.cxx&lt;br /&gt;
&lt;br /&gt;
Headers are in :&lt;br /&gt;
 vcl/inc/salinst.hxx  &lt;br /&gt;
 vcl/inc/salgdi.hxx    &lt;br /&gt;
 vcl/inc/salprn.hxx&lt;br /&gt;
&lt;br /&gt;
 Aqua implementation :&lt;br /&gt;
 vcl/aqua/inc/salprn.h  (AquaSalPrinter class implementation, inherits from SalPrinter)&lt;br /&gt;
&lt;br /&gt;
=== psprint ===&lt;br /&gt;
What we know about psprint.&lt;br /&gt;
&lt;br /&gt;
=== svtools ===&lt;br /&gt;
What we need to know about svtools. Mostly it provides us the Print Dialog, and some other Print related dialogs.&lt;br /&gt;
&lt;br /&gt;
==== PrintDialog class ====&lt;br /&gt;
This class is responsible for drawing the print dialog we usaually view when we choose the Print option of the File menu.&lt;br /&gt;
The current implementation uses this class to draw the print dialog. In our Aqua native implementation, we want to use the on provided by Carbon API. To achieve this, we want to know the functionality of this class, and let carbon manage the functionality maybe at this level or maybe in a other lever (higher or lower). We also need to know how this class provides information to the Printer instance.&lt;br /&gt;
&lt;br /&gt;
* The header of this class is located in svtools/inc/printdlg.hxx&lt;br /&gt;
* The implementation of this class is located in svtools/source/dialogs/printdlg.cxx&lt;br /&gt;
&lt;br /&gt;
This class is a derivate of ModalDialog class. &lt;br /&gt;
&lt;br /&gt;
It contains all the controls used by the dialog which are either :&lt;br /&gt;
* FixedImage&lt;br /&gt;
* FixedLine&lt;br /&gt;
* FixedText&lt;br /&gt;
* FixedInfo : it is a child of FixedText and is defined in svtools/inc/stdctrl.hxx. It is nothing more than a FixedText with the info style applied (same behaviour).&lt;br /&gt;
* ListBox : maLbName - List-box used to store the available printers.&lt;br /&gt;
&lt;br /&gt;
* Edit&lt;br /&gt;
* NumericField&lt;br /&gt;
&lt;br /&gt;
* CheckBox&lt;br /&gt;
* PushButton&lt;br /&gt;
* RadioButton&lt;br /&gt;
* OKButton&lt;br /&gt;
* CancelButton&lt;br /&gt;
* HelpButton&lt;br /&gt;
&lt;br /&gt;
These controls are used to allow the user to interact with the dialog. We need to know how they are used by the dialog to retrieve the user-provided information. What is involved to display them, and how the look &amp;amp; feel is implemented is not interesting at this point, since we only want to know what the dialog actually does.&lt;br /&gt;
&lt;br /&gt;
Other weird things that are not child of control class and that I don&amp;#039;t currently know why it is usefull :&lt;br /&gt;
* AutoTimer&lt;br /&gt;
&lt;br /&gt;
TODO : List of all user-related information stored by this class and sent to the Printer. Add more details on the vcl controls involved (what they are, at least for the non obvious ones).&lt;br /&gt;
&lt;br /&gt;
The class contains also fields used to store the real information provided by the controls (Mostly USHORT and BOOL). There is also a XubString instance and a PrintDialogRange instance used to store range information.&lt;br /&gt;
&lt;br /&gt;
Of course, this class contains an Printer instance and a SvtPtinterImpl instance in order to set the printer functionality.&lt;br /&gt;
&lt;br /&gt;
There is also internal methods, and links to the Option handler and the OK handler.&lt;br /&gt;
&lt;br /&gt;
The public methods are mostly getters and setters, I won&amp;#039;t detail it since I have already provided information about the private attributes, and they do nothing to the Printer instance.&lt;br /&gt;
&lt;br /&gt;
TODO : details the implementation of this class (interesting methods : ImplGetFileName, IMPL_LINK(PrintDialog, ImplModifyControlHdl, void*, p)&lt;br /&gt;
&lt;br /&gt;
For Aqua port, we need to reimplement this class in order to make it displays the native Aqua Print Dialog that will be provided by the Carbon API, and save information that was previously provided by children of Control class. We should also disable the Printing options provided by the Aqua dialog that are not provided by the Printer class (the information we cannot currently store).&lt;br /&gt;
&lt;br /&gt;
==== Print Setup file ====&lt;br /&gt;
* svtools/inc/prnsetup.hxx&lt;br /&gt;
* svtools/source/dialogs/prnsetup.hxx&lt;br /&gt;
&lt;br /&gt;
Utility functions : &lt;br /&gt;
* ImplFillPrnDlgListBox(const Printer *, ListBox *, PushButton *)&lt;br /&gt;
This method fills the Printer list-box with the QueueInfo provided by the Printer instance provided in argument. It then enables the OK button if the list is not empty.&lt;br /&gt;
&lt;br /&gt;
== Mac OS X API side ==&lt;br /&gt;
This part describes what can be used and how we intend to use it.&lt;br /&gt;
&lt;br /&gt;
The strategy is to first use the Carbon API to get Print Information and to provide an Aqua User Inerface for printing. Then, we will try to replace the current printing API to the native one, allowing to reduce dependencies, and the total package size.&lt;br /&gt;
&lt;br /&gt;
Carbon provides multiple way for us to print. We might consider every of different approaches :&lt;br /&gt;
* Printing using psprint. We only get settings from the Carbon Print Dialog and the Carbon Print Setup Dialog with the function PMGetPrintSettingsExtendedData (for example) and then we send the obtained parameters to our SalPrinter.&lt;br /&gt;
* Using the PMPrintToFile function (OpenOffice.org provides a postcript version of the document, and then, Carbon handles the print operation)&lt;br /&gt;
* Printing using a QuickDraw graphic context [http://developer.apple.com/documentation/Carbon/Conceptual/CPM_Concepts/cpm_chap3/chapter_3_section_4.html#//apple_ref/doc/uid/TP30000978-TP30000046-TPXREF12 See this link for an example] (As this is a legacy API, we are not enthusiast about using it in OpenOffice.org)&lt;br /&gt;
* Printing using a Quartz 2D graphic context [http://developer.apple.com/documentation/GraphicsImaging/Conceptual/drawingwithquartz2d/index.html More information about Quartz 2D]&lt;br /&gt;
&lt;br /&gt;
We may want to add some features to the Printing dialog provided by Carbon. [http://developer.apple.com/documentation/Printing/Conceptual/ExtPrintingDialogs/index.html This is documented here]&lt;br /&gt;
&lt;br /&gt;
Todo : implement missing methods, using Carbon API&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
=== Link for Mac OS X API documentation  ===&lt;br /&gt;
http://developer.apple.com/documentation/Carbon/Reference/CarbonPrintingManager_Ref/index.html&lt;br /&gt;
&lt;br /&gt;
=== Starting point for documentation ===&lt;br /&gt;
http://developer.apple.com/documentation/Carbon/Printing-date.html#//apple_ref/doc/uid/TP30000440-TP30000420-TP30000455&lt;br /&gt;
http://developer.apple.com/documentation/Carbon/Conceptual/CPM_Concepts/cpm_chap4/chapter_4_section_1.html&lt;br /&gt;
http://developer.apple.com/samplecode/Carbon/idxPrinting-date.html&lt;br /&gt;
http://developer.apple.com/referencelibrary/Carbon/idxPrinting-date.html&lt;br /&gt;
&lt;br /&gt;
This work is part of http://wiki.services.openoffice.org/wiki/Mac_OS_X_Porting_-_Work_Areas/Todo%27s&lt;br /&gt;
&lt;br /&gt;
Created: [[User:Ericb|Ericb]] 19:33, 4 June 2006 (CEST)&lt;br /&gt;
&lt;br /&gt;
Last modification: [[User:Ybart|ybart]] 0:00, 16 October 2006 (CEST)&lt;br /&gt;
&lt;br /&gt;
[[Category:Porting]]&lt;br /&gt;
[[Category:Aqua]]&lt;br /&gt;
[[Category:MacOSX]]&lt;/div&gt;</summary>
		<author><name>Ybart</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=File:UML_class_SalPrinter.png&amp;diff=19258</id>
		<title>File:UML class SalPrinter.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=File:UML_class_SalPrinter.png&amp;diff=19258"/>
		<updated>2006-10-22T21:51:30Z</updated>

		<summary type="html">&lt;p&gt;Ybart: Partiel UML class diagram of SalPrinter and its derivates&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Partiel UML class diagram of SalPrinter and its derivates&lt;/div&gt;</summary>
		<author><name>Ybart</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Mac_OS_X_Porting_-_Native_Printing&amp;diff=19256</id>
		<title>Mac OS X Porting - Native Printing</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Mac_OS_X_Porting_-_Native_Printing&amp;diff=19256"/>
		<updated>2006-10-22T17:15:53Z</updated>

		<summary type="html">&lt;p&gt;Ybart: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page is dedicated to the native printing implementation in OpenOffice.org for Mac OS X&lt;br /&gt;
&lt;br /&gt;
== What we want to do ? ==&lt;br /&gt;
The final goal of this project is to have the native printing support on Mac OS X.&lt;br /&gt;
&lt;br /&gt;
=== What we have now and what we don&amp;#039;t ? ===&lt;br /&gt;
Currently we simply have a generic printing support which works with X11. There is also printing support implemented for Windows. This means that we have already a way to implement our printing support for Aqua without breaking OpenOffice.org as we have already environment plug-ins.&lt;br /&gt;
&lt;br /&gt;
However, we have only one Print Dialog and one PrinterSetup dialog for all environments.&lt;br /&gt;
&lt;br /&gt;
Tu sum up : we have a starting point to implement low-level printing support using the native API. We only have to implement the antive code. But we have nothing for the dialogs.&lt;br /&gt;
&lt;br /&gt;
=== What the users want ? ===&lt;br /&gt;
The user wants to be able to print with OpenOffice.org the same way he does with its other natives applications. &lt;br /&gt;
&lt;br /&gt;
For us, this means using a native printing dialog. Then, we will also need to implement low-level printing using OS API because, without that the user might not be able to use every setting available in the native dialog. &lt;br /&gt;
&lt;br /&gt;
=== What will be even better ? ===&lt;br /&gt;
Using UNO. This will allow other platform developpers to use the same code to implement their native dialogs.&lt;br /&gt;
&lt;br /&gt;
== OpenOffice.org side ==&lt;br /&gt;
This part describes what can be found in the OOo APIs, how it is implemented and how it will be changed.&lt;br /&gt;
&lt;br /&gt;
=== OOo print process ===&lt;br /&gt;
I will try to share the few thing I understood about the way Writer prints document.&lt;br /&gt;
&lt;br /&gt;
First I need to locate the print menu item in the sw module (sw stands for Star Writer). For this, I need to know where in sw the menubar is built. I did found the menubar, but not how the menu item was linked to the print operation. Instead, I have found a method PrintPages implemented in sw module. The stack may look like that :&lt;br /&gt;
* SwXTextDocument::printPages()&lt;br /&gt;
* ViewShell::executeSlot(aReq)&lt;br /&gt;
* ...&lt;br /&gt;
* SwView::ExecutePrint()&lt;br /&gt;
* ...&lt;br /&gt;
* SwXTextDocument::render()&lt;br /&gt;
* ViewShell::Prt()&lt;br /&gt;
* OutputDevice:: ...&lt;br /&gt;
&lt;br /&gt;
TODO : Complete the stack trace&lt;br /&gt;
&lt;br /&gt;
There is many holes in the stack but we get the idea. The OuputDevice is in fact our Printer.&lt;br /&gt;
&lt;br /&gt;
[[Image:Printing_model.png]]&lt;br /&gt;
&lt;br /&gt;
1. The user Application creates a print dialog or a print setup dialog. For this, it needs to call svtools. To be a bit more precise, it creates a new instance of PrintDialog or of PrintDialogSetup, it associates a Printer instace to it, then, it calls the Execute method from PrintDialog or PrintSetupDialog. This operation shows the dialog (using the Execute method from ModalDialog, which is in vcl) and sets the Printer Data correctly with the method setPrinterProps. Do do the real display of the dialog, it uses SalFrame&amp;#039;s Show() method, which can be X11SalFrame, AquaSalFrame, etc.&lt;br /&gt;
&lt;br /&gt;
2. Svtools is responsible for asking to the user the requested information about printing options. Then, it returns them ot the user application.&lt;br /&gt;
&lt;br /&gt;
3. The user application has now everything needed to print the document. So, it asks VCL to draw pixels, lines, characters, etc on an OutputDevice.&lt;br /&gt;
&lt;br /&gt;
At this point, I don&amp;#039;t know exactly how the OutputDevice is set (who decides that it would be a screen, an Aqua printer or a PostScript printer. This is not really important since we understant the main idea of how printing works.&lt;br /&gt;
&lt;br /&gt;
[[Image:Printing_model_step_4.png]]&lt;br /&gt;
&lt;br /&gt;
4. After that VCL relies on its Graphic Context to really draws (i.e. make the OS really draws) the lines and pixels on the screen or on the print device.&lt;br /&gt;
&lt;br /&gt;
=== Concerned OOo modules ===&lt;br /&gt;
* psprint&lt;br /&gt;
* vcl&lt;br /&gt;
* svtools&lt;br /&gt;
&lt;br /&gt;
=== VCL ===&lt;br /&gt;
What we know about [[vcl]].&lt;br /&gt;
&lt;br /&gt;
==== SalPrinter class ====&lt;br /&gt;
SalPrinter is a virtual class intended for managing print jobs. It is composed of virtual fonctions, and a dummy constructor.&lt;br /&gt;
This class is inherited by PspSalPrinter, WinSalPrinter, and of course by AquaSalPrinter (see [[#AquaSalPrinter class|AquaSalPrinter class]]).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
    class VCL_DLLPUBLIC SalPrinter&lt;br /&gt;
    {&lt;br /&gt;
    public: // public for Sal Implementation&lt;br /&gt;
        SalPrinter() {}&lt;br /&gt;
        virtual ~SalPrinter();&lt;br /&gt;
        virtual BOOL StartJob( const XubString* pFileName,&lt;br /&gt;
                                        const XubString&amp;amp; rJobName,&lt;br /&gt;
                                        const XubString&amp;amp; rAppName,&lt;br /&gt;
                                        ULONG nCopies, BOOL bCollate,&lt;br /&gt;
                                        ImplJobSetup* pSetupData ) = 0;&lt;br /&gt;
        virtual BOOL EndJob() = 0;&lt;br /&gt;
        virtual BOOL AbortJob() = 0;&lt;br /&gt;
        virtual SalGraphics* StartPage( ImplJobSetup* pSetupData, BOOL bNewJobData ) = 0;&lt;br /&gt;
        virtual BOOL EndPage() = 0;&lt;br /&gt;
        virtual ULONG GetErrorCode() = 0;&lt;br /&gt;
    };&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== PspSalPrinter class ====&lt;br /&gt;
PspSalPrinter means PostScript Print System Abstraction Layer Printer. Its implementation is located in vcl/unx/source/gdi/salprnpsp.cxx. As the name suggests it relies on features psprint module.&lt;br /&gt;
&lt;br /&gt;
TODO : Discuss about PspSalPrinter implementation.&lt;br /&gt;
&lt;br /&gt;
==== Printer class ====&lt;br /&gt;
This is an abstraction class of a printer driver. You can entirely set up the printer there and start print jobs. What we need here is to make our native dialog access to this Printer. The we will need to make this class access to OS API rather than psprint. &lt;br /&gt;
&lt;br /&gt;
AquaSalPrinter class is located in vcl/aqua/source/gdi/print.cxx&lt;br /&gt;
&lt;br /&gt;
This class inherits of OutputDevice and is derivated in ImplQPrinter.&lt;br /&gt;
&lt;br /&gt;
* QueueInfo class - This class is related to the Printer class. It is used to store information about printers (name, driver, location, comment as strings, and number of Jobs, and a status code).&lt;br /&gt;
&lt;br /&gt;
==== OutputDevice class ====&lt;br /&gt;
This class allows applications such as Writer to draw graphics elements (pixels, lines, rects, characters, strings, etc...).&lt;br /&gt;
&lt;br /&gt;
This class is located in vcl/source/gdi/outdev.cxx, vcl/source/gdi/outdev[2-6].cxx&lt;br /&gt;
&lt;br /&gt;
At this time, we don&amp;#039;t need to know the details of this class. We will focus on it when we will use the Carbon Printing API.&lt;br /&gt;
&lt;br /&gt;
==== SalGraphics class ====&lt;br /&gt;
This class is responsible to translate the abstract drawing calls to concrete OS calls.&lt;br /&gt;
&lt;br /&gt;
==== PspGraphics ====&lt;br /&gt;
The class I need to reimplement using Aqua printing primitives...&lt;br /&gt;
May be I will name it AquaPrintGraphics ?...&lt;br /&gt;
&lt;br /&gt;
==== AquaSalPrinter class ====&lt;br /&gt;
AquaSalPrinter class is located in vcl/aqua/source/gdi/salprn.cxx&lt;br /&gt;
&lt;br /&gt;
Headers are in :&lt;br /&gt;
 vcl/inc/salinst.hxx  &lt;br /&gt;
 vcl/inc/salgdi.hxx    &lt;br /&gt;
 vcl/inc/salprn.hxx&lt;br /&gt;
&lt;br /&gt;
 Aqua implementation :&lt;br /&gt;
 vcl/aqua/inc/salprn.h  (AquaSalPrinter class implementation, inherits from SalPrinter)&lt;br /&gt;
&lt;br /&gt;
=== psprint ===&lt;br /&gt;
What we know about psprint.&lt;br /&gt;
&lt;br /&gt;
=== svtools ===&lt;br /&gt;
What we need to know about svtools. Mostly it provides us the Print Dialog, and some other Print related dialogs.&lt;br /&gt;
&lt;br /&gt;
==== PrintDialog class ====&lt;br /&gt;
This class is responsible for drawing the print dialog we usaually view when we choose the Print option of the File menu.&lt;br /&gt;
The current implementation uses this class to draw the print dialog. In our Aqua native implementation, we want to use the on provided by Carbon API. To achieve this, we want to know the functionality of this class, and let carbon manage the functionality maybe at this level or maybe in a other lever (higher or lower). We also need to know how this class provides information to the Printer instance.&lt;br /&gt;
&lt;br /&gt;
* The header of this class is located in svtools/inc/printdlg.hxx&lt;br /&gt;
* The implementation of this class is located in svtools/source/dialogs/printdlg.cxx&lt;br /&gt;
&lt;br /&gt;
This class is a derivate of ModalDialog class. &lt;br /&gt;
&lt;br /&gt;
It contains all the controls used by the dialog which are either :&lt;br /&gt;
* FixedImage&lt;br /&gt;
* FixedLine&lt;br /&gt;
* FixedText&lt;br /&gt;
* FixedInfo : it is a child of FixedText and is defined in svtools/inc/stdctrl.hxx. It is nothing more than a FixedText with the info style applied (same behaviour).&lt;br /&gt;
* ListBox : maLbName - List-box used to store the available printers.&lt;br /&gt;
&lt;br /&gt;
* Edit&lt;br /&gt;
* NumericField&lt;br /&gt;
&lt;br /&gt;
* CheckBox&lt;br /&gt;
* PushButton&lt;br /&gt;
* RadioButton&lt;br /&gt;
* OKButton&lt;br /&gt;
* CancelButton&lt;br /&gt;
* HelpButton&lt;br /&gt;
&lt;br /&gt;
These controls are used to allow the user to interact with the dialog. We need to know how they are used by the dialog to retrieve the user-provided information. What is involved to display them, and how the look &amp;amp; feel is implemented is not interesting at this point, since we only want to know what the dialog actually does.&lt;br /&gt;
&lt;br /&gt;
Other weird things that are not child of control class and that I don&amp;#039;t currently know why it is usefull :&lt;br /&gt;
* AutoTimer&lt;br /&gt;
&lt;br /&gt;
TODO : List of all user-related information stored by this class and sent to the Printer. Add more details on the vcl controls involved (what they are, at least for the non obvious ones).&lt;br /&gt;
&lt;br /&gt;
The class contains also fields used to store the real information provided by the controls (Mostly USHORT and BOOL). There is also a XubString instance and a PrintDialogRange instance used to store range information.&lt;br /&gt;
&lt;br /&gt;
Of course, this class contains an Printer instance and a SvtPtinterImpl instance in order to set the printer functionality.&lt;br /&gt;
&lt;br /&gt;
There is also internal methods, and links to the Option handler and the OK handler.&lt;br /&gt;
&lt;br /&gt;
The public methods are mostly getters and setters, I won&amp;#039;t detail it since I have already provided information about the private attributes, and they do nothing to the Printer instance.&lt;br /&gt;
&lt;br /&gt;
TODO : details the implementation of this class (interesting methods : ImplGetFileName, IMPL_LINK(PrintDialog, ImplModifyControlHdl, void*, p)&lt;br /&gt;
&lt;br /&gt;
For Aqua port, we need to reimplement this class in order to make it displays the native Aqua Print Dialog that will be provided by the Carbon API, and save information that was previously provided by children of Control class. We should also disable the Printing options provided by the Aqua dialog that are not provided by the Printer class (the information we cannot currently store).&lt;br /&gt;
&lt;br /&gt;
==== Print Setup file ====&lt;br /&gt;
* svtools/inc/prnsetup.hxx&lt;br /&gt;
* svtools/source/dialogs/prnsetup.hxx&lt;br /&gt;
&lt;br /&gt;
Utility functions : &lt;br /&gt;
* ImplFillPrnDlgListBox(const Printer *, ListBox *, PushButton *)&lt;br /&gt;
This method fills the Printer list-box with the QueueInfo provided by the Printer instance provided in argument. It then enables the OK button if the list is not empty.&lt;br /&gt;
&lt;br /&gt;
== Mac OS X API side ==&lt;br /&gt;
This part describes what can be used and how we intend to use it.&lt;br /&gt;
&lt;br /&gt;
The strategy is to first use the Carbon API to get Print Information and to provide an Aqua User Inerface for printing. Then, we will try to replace the current printing API to the native one, allowing to reduce dependencies, and the total package size.&lt;br /&gt;
&lt;br /&gt;
Carbon provides multiple way for us to print. We might consider every of different approaches :&lt;br /&gt;
* Printing using psprint. We only get settings from the Carbon Print Dialog and the Carbon Print Setup Dialog with the function PMGetPrintSettingsExtendedData (for example) and then we send the obtained parameters to our SalPrinter.&lt;br /&gt;
* Using the PMPrintToFile function (OpenOffice.org provides a postcript version of the document, and then, Carbon handles the print operation)&lt;br /&gt;
* Printing using a QuickDraw graphic context [http://developer.apple.com/documentation/Carbon/Conceptual/CPM_Concepts/cpm_chap3/chapter_3_section_4.html#//apple_ref/doc/uid/TP30000978-TP30000046-TPXREF12 See this link for an example] (As this is a legacy API, we are not enthusiast about using it in OpenOffice.org)&lt;br /&gt;
* Printing using a Quartz 2D graphic context [http://developer.apple.com/documentation/GraphicsImaging/Conceptual/drawingwithquartz2d/index.html More information about Quartz 2D]&lt;br /&gt;
&lt;br /&gt;
We may want to add some features to the Printing dialog provided by Carbon. [http://developer.apple.com/documentation/Printing/Conceptual/ExtPrintingDialogs/index.html This is documented here]&lt;br /&gt;
&lt;br /&gt;
Todo : implement missing methods, using Carbon API&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
=== Link for Mac OS X API documentation  ===&lt;br /&gt;
http://developer.apple.com/documentation/Carbon/Reference/CarbonPrintingManager_Ref/index.html&lt;br /&gt;
&lt;br /&gt;
=== Starting point for documentation ===&lt;br /&gt;
http://developer.apple.com/documentation/Carbon/Printing-date.html#//apple_ref/doc/uid/TP30000440-TP30000420-TP30000455&lt;br /&gt;
http://developer.apple.com/documentation/Carbon/Conceptual/CPM_Concepts/cpm_chap4/chapter_4_section_1.html&lt;br /&gt;
http://developer.apple.com/samplecode/Carbon/idxPrinting-date.html&lt;br /&gt;
http://developer.apple.com/referencelibrary/Carbon/idxPrinting-date.html&lt;br /&gt;
&lt;br /&gt;
This work is part of http://wiki.services.openoffice.org/wiki/Mac_OS_X_Porting_-_Work_Areas/Todo%27s&lt;br /&gt;
&lt;br /&gt;
Created: [[User:Ericb|Ericb]] 19:33, 4 June 2006 (CEST)&lt;br /&gt;
&lt;br /&gt;
Last modification: [[User:Ybart|ybart]] 0:00, 16 October 2006 (CEST)&lt;br /&gt;
&lt;br /&gt;
[[Category:Porting]]&lt;br /&gt;
[[Category:Aqua]]&lt;br /&gt;
[[Category:MacOSX]]&lt;/div&gt;</summary>
		<author><name>Ybart</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Mac_OS_X_Porting_-_Native_Printing&amp;diff=19187</id>
		<title>Mac OS X Porting - Native Printing</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Mac_OS_X_Porting_-_Native_Printing&amp;diff=19187"/>
		<updated>2006-10-21T20:02:39Z</updated>

		<summary type="html">&lt;p&gt;Ybart: /* OOo print process */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page is dedicated to the native printing implementation in OpenOffice.org for Mac OS X&lt;br /&gt;
&lt;br /&gt;
== OpenOffice.org side ==&lt;br /&gt;
This part describes what can be found in the OOo APIs, how it is implemented and how it will be changed.&lt;br /&gt;
&lt;br /&gt;
=== OOo print process ===&lt;br /&gt;
I will try to share the few thing I understood about the way Writer prints document.&lt;br /&gt;
&lt;br /&gt;
First I need to locate the print menu item in the sw module (sw stands for Star Writer). For this, I need to know where in sw the menubar is built. I did found the menubar, but not how the menu item was linked to the print operation. Instead, I have found a method PrintPages implemented in sw module. The stack may look like that :&lt;br /&gt;
* SwXTextDocument::printPages()&lt;br /&gt;
* ViewShell::executeSlot(aReq)&lt;br /&gt;
* ...&lt;br /&gt;
* SwView::ExecutePrint()&lt;br /&gt;
* ...&lt;br /&gt;
* SwXTextDocument::render()&lt;br /&gt;
* ViewShell::Prt()&lt;br /&gt;
* OutputDevice:: ...&lt;br /&gt;
&lt;br /&gt;
TODO : Complete the stack trace&lt;br /&gt;
&lt;br /&gt;
There is many holes in the stack but we get the idea. The OuputDevice is in fact our Printer.&lt;br /&gt;
&lt;br /&gt;
[[Image:Printing_model.png]]&lt;br /&gt;
&lt;br /&gt;
1. The user Application creates a print dialog or a print setup dialog. For this, it needs to call svtools. To be a bit more precise, it creates a new instance of PrintDialog or of PrintDialogSetup, it associates a Printer instace to it, then, it calls the Execute method from PrintDialog or PrintSetupDialog. This operation shows the dialog (using the Execute method from ModalDialog, which is in vcl) and sets the Printer Data correctly with the method setPrinterProps. Do do the real display of the dialog, it uses SalFrame&amp;#039;s Show() method, which can be X11SalFrame, AquaSalFrame, etc.&lt;br /&gt;
&lt;br /&gt;
2. Svtools is responsible for asking to the user the requested information about printing options. Then, it returns them ot the user application.&lt;br /&gt;
&lt;br /&gt;
3. The user application has now everything needed to print the document. So, it asks VCL to draw pixels, lines, characters, etc on an OutputDevice.&lt;br /&gt;
&lt;br /&gt;
At this point, I don&amp;#039;t know exactly how the OutputDevice is set (who decides that it would be a screen, an Aqua printer or a PostScript printer. This is not really important since we understant the main idea of how printing works.&lt;br /&gt;
&lt;br /&gt;
[[Image:Printing_model_step_4.png]]&lt;br /&gt;
&lt;br /&gt;
4. After that VCL relies on its Graphic Context to really draws (i.e. make the OS really draws) the lines and pixels on the screen or on the print device.&lt;br /&gt;
&lt;br /&gt;
=== Concerned OOo modules ===&lt;br /&gt;
* psprint&lt;br /&gt;
* vcl&lt;br /&gt;
* svtools&lt;br /&gt;
&lt;br /&gt;
=== VCL ===&lt;br /&gt;
What we know about [[vcl]].&lt;br /&gt;
&lt;br /&gt;
==== SalPrinter class ====&lt;br /&gt;
SalPrinter is a virtual class intended for managing print jobs. It is composed of virtual fonctions, and a dummy constructor.&lt;br /&gt;
This class is inherited by PspSalPrinter, WinSalPrinter, and of course by AquaSalPrinter (see [[#AquaSalPrinter class|AquaSalPrinter class]]).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
    class VCL_DLLPUBLIC SalPrinter&lt;br /&gt;
    {&lt;br /&gt;
    public: // public for Sal Implementation&lt;br /&gt;
        SalPrinter() {}&lt;br /&gt;
        virtual ~SalPrinter();&lt;br /&gt;
        virtual BOOL StartJob( const XubString* pFileName,&lt;br /&gt;
                                        const XubString&amp;amp; rJobName,&lt;br /&gt;
                                        const XubString&amp;amp; rAppName,&lt;br /&gt;
                                        ULONG nCopies, BOOL bCollate,&lt;br /&gt;
                                        ImplJobSetup* pSetupData ) = 0;&lt;br /&gt;
        virtual BOOL EndJob() = 0;&lt;br /&gt;
        virtual BOOL AbortJob() = 0;&lt;br /&gt;
        virtual SalGraphics* StartPage( ImplJobSetup* pSetupData, BOOL bNewJobData ) = 0;&lt;br /&gt;
        virtual BOOL EndPage() = 0;&lt;br /&gt;
        virtual ULONG GetErrorCode() = 0;&lt;br /&gt;
    };&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== PspSalPrinter class ====&lt;br /&gt;
PspSalPrinter means PostScript Print System Abstraction Layer Printer. Its implementation is located in vcl/unx/source/gdi/salprnpsp.cxx. As the name suggests it relies on features psprint module.&lt;br /&gt;
&lt;br /&gt;
TODO : Discuss about PspSalPrinter implementation.&lt;br /&gt;
&lt;br /&gt;
==== Printer class ====&lt;br /&gt;
This is an abstraction class of a printer driver. You can entirely set up the printer there and start print jobs. What we need here is to make our native dialog access to this Printer. The we will need to make this class access to OS API rather than psprint. &lt;br /&gt;
&lt;br /&gt;
AquaSalPrinter class is located in vcl/aqua/source/gdi/print.cxx&lt;br /&gt;
&lt;br /&gt;
This class inherits of OutputDevice and is derivated in ImplQPrinter.&lt;br /&gt;
&lt;br /&gt;
* QueueInfo class - This class is related to the Printer class. It is used to store information about printers (name, driver, location, comment as strings, and number of Jobs, and a status code).&lt;br /&gt;
&lt;br /&gt;
==== OutputDevice class ====&lt;br /&gt;
This class allows applications such as Writer to draw graphics elements (pixels, lines, rects, characters, strings, etc...).&lt;br /&gt;
&lt;br /&gt;
This class is located in vcl/source/gdi/outdev.cxx, vcl/source/gdi/outdev[2-6].cxx&lt;br /&gt;
&lt;br /&gt;
At this time, we don&amp;#039;t need to know the details of this class. We will focus on it when we will use the Carbon Printing API.&lt;br /&gt;
&lt;br /&gt;
==== SalGraphics class ====&lt;br /&gt;
This class is responsible to translate the abstract drawing calls to concrete OS calls.&lt;br /&gt;
&lt;br /&gt;
==== PspGraphics ====&lt;br /&gt;
The class I need to reimplement using Aqua printing primitives...&lt;br /&gt;
May be I will name it AquaPrintGraphics ?...&lt;br /&gt;
&lt;br /&gt;
==== AquaSalPrinter class ====&lt;br /&gt;
AquaSalPrinter class is located in vcl/aqua/source/gdi/salprn.cxx&lt;br /&gt;
&lt;br /&gt;
Headers are in :&lt;br /&gt;
 vcl/inc/salinst.hxx  &lt;br /&gt;
 vcl/inc/salgdi.hxx    &lt;br /&gt;
 vcl/inc/salprn.hxx&lt;br /&gt;
&lt;br /&gt;
 Aqua implementation :&lt;br /&gt;
 vcl/aqua/inc/salprn.h  (AquaSalPrinter class implementation, inherits from SalPrinter)&lt;br /&gt;
&lt;br /&gt;
=== psprint ===&lt;br /&gt;
What we know about psprint.&lt;br /&gt;
&lt;br /&gt;
=== svtools ===&lt;br /&gt;
What we need to know about svtools. Mostly it provides us the Print Dialog, and some other Print related dialogs.&lt;br /&gt;
&lt;br /&gt;
==== PrintDialog class ====&lt;br /&gt;
This class is responsible for drawing the print dialog we usaually view when we choose the Print option of the File menu.&lt;br /&gt;
The current implementation uses this class to draw the print dialog. In our Aqua native implementation, we want to use the on provided by Carbon API. To achieve this, we want to know the functionality of this class, and let carbon manage the functionality maybe at this level or maybe in a other lever (higher or lower). We also need to know how this class provides information to the Printer instance.&lt;br /&gt;
&lt;br /&gt;
* The header of this class is located in svtools/inc/printdlg.hxx&lt;br /&gt;
* The implementation of this class is located in svtools/source/dialogs/printdlg.cxx&lt;br /&gt;
&lt;br /&gt;
This class is a derivate of ModalDialog class. &lt;br /&gt;
&lt;br /&gt;
It contains all the controls used by the dialog which are either :&lt;br /&gt;
* FixedImage&lt;br /&gt;
* FixedLine&lt;br /&gt;
* FixedText&lt;br /&gt;
* FixedInfo : it is a child of FixedText and is defined in svtools/inc/stdctrl.hxx. It is nothing more than a FixedText with the info style applied (same behaviour).&lt;br /&gt;
* ListBox : maLbName - List-box used to store the available printers.&lt;br /&gt;
&lt;br /&gt;
* Edit&lt;br /&gt;
* NumericField&lt;br /&gt;
&lt;br /&gt;
* CheckBox&lt;br /&gt;
* PushButton&lt;br /&gt;
* RadioButton&lt;br /&gt;
* OKButton&lt;br /&gt;
* CancelButton&lt;br /&gt;
* HelpButton&lt;br /&gt;
&lt;br /&gt;
These controls are used to allow the user to interact with the dialog. We need to know how they are used by the dialog to retrieve the user-provided information. What is involved to display them, and how the look &amp;amp; feel is implemented is not interesting at this point, since we only want to know what the dialog actually does.&lt;br /&gt;
&lt;br /&gt;
Other weird things that are not child of control class and that I don&amp;#039;t currently know why it is usefull :&lt;br /&gt;
* AutoTimer&lt;br /&gt;
&lt;br /&gt;
TODO : List of all user-related information stored by this class and sent to the Printer. Add more details on the vcl controls involved (what they are, at least for the non obvious ones).&lt;br /&gt;
&lt;br /&gt;
The class contains also fields used to store the real information provided by the controls (Mostly USHORT and BOOL). There is also a XubString instance and a PrintDialogRange instance used to store range information.&lt;br /&gt;
&lt;br /&gt;
Of course, this class contains an Printer instance and a SvtPtinterImpl instance in order to set the printer functionality.&lt;br /&gt;
&lt;br /&gt;
There is also internal methods, and links to the Option handler and the OK handler.&lt;br /&gt;
&lt;br /&gt;
The public methods are mostly getters and setters, I won&amp;#039;t detail it since I have already provided information about the private attributes, and they do nothing to the Printer instance.&lt;br /&gt;
&lt;br /&gt;
TODO : details the implementation of this class (interesting methods : ImplGetFileName, IMPL_LINK(PrintDialog, ImplModifyControlHdl, void*, p)&lt;br /&gt;
&lt;br /&gt;
For Aqua port, we need to reimplement this class in order to make it displays the native Aqua Print Dialog that will be provided by the Carbon API, and save information that was previously provided by children of Control class. We should also disable the Printing options provided by the Aqua dialog that are not provided by the Printer class (the information we cannot currently store).&lt;br /&gt;
&lt;br /&gt;
==== Print Setup file ====&lt;br /&gt;
* svtools/inc/prnsetup.hxx&lt;br /&gt;
* svtools/source/dialogs/prnsetup.hxx&lt;br /&gt;
&lt;br /&gt;
Utility functions : &lt;br /&gt;
* ImplFillPrnDlgListBox(const Printer *, ListBox *, PushButton *)&lt;br /&gt;
This method fills the Printer list-box with the QueueInfo provided by the Printer instance provided in argument. It then enables the OK button if the list is not empty.&lt;br /&gt;
&lt;br /&gt;
== Mac OS X API side ==&lt;br /&gt;
This part describes what can be used and how we intend to use it.&lt;br /&gt;
&lt;br /&gt;
The strategy is to first use the Carbon API to get Print Information and to provide an Aqua User Inerface for printing. Then, we will try to replace the current printing API to the native one, allowing to reduce dependencies, and the total package size.&lt;br /&gt;
&lt;br /&gt;
Carbon provides multiple way for us to print. We might consider every of different approaches :&lt;br /&gt;
* Printing using psprint. We only get settings from the Carbon Print Dialog and the Carbon Print Setup Dialog with the function PMGetPrintSettingsExtendedData (for example) and then we send the obtained parameters to our SalPrinter.&lt;br /&gt;
* Using the PMPrintToFile function (OpenOffice.org provides a postcript version of the document, and then, Carbon handles the print operation)&lt;br /&gt;
* Printing using a QuickDraw graphic context [http://developer.apple.com/documentation/Carbon/Conceptual/CPM_Concepts/cpm_chap3/chapter_3_section_4.html#//apple_ref/doc/uid/TP30000978-TP30000046-TPXREF12 See this link for an example] (As this is a legacy API, we are not enthusiast about using it in OpenOffice.org)&lt;br /&gt;
* Printing using a Quartz 2D graphic context [http://developer.apple.com/documentation/GraphicsImaging/Conceptual/drawingwithquartz2d/index.html More information about Quartz 2D]&lt;br /&gt;
&lt;br /&gt;
We may want to add some features to the Printing dialog provided by Carbon. [http://developer.apple.com/documentation/Printing/Conceptual/ExtPrintingDialogs/index.html This is documented here]&lt;br /&gt;
&lt;br /&gt;
Todo : implement missing methods, using Carbon API&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
=== Link for Mac OS X API documentation  ===&lt;br /&gt;
http://developer.apple.com/documentation/Carbon/Reference/CarbonPrintingManager_Ref/index.html&lt;br /&gt;
&lt;br /&gt;
=== Starting point for documentation ===&lt;br /&gt;
http://developer.apple.com/documentation/Carbon/Printing-date.html#//apple_ref/doc/uid/TP30000440-TP30000420-TP30000455&lt;br /&gt;
http://developer.apple.com/documentation/Carbon/Conceptual/CPM_Concepts/cpm_chap4/chapter_4_section_1.html&lt;br /&gt;
http://developer.apple.com/samplecode/Carbon/idxPrinting-date.html&lt;br /&gt;
http://developer.apple.com/referencelibrary/Carbon/idxPrinting-date.html&lt;br /&gt;
&lt;br /&gt;
This work is part of http://wiki.services.openoffice.org/wiki/Mac_OS_X_Porting_-_Work_Areas/Todo%27s&lt;br /&gt;
&lt;br /&gt;
Created: [[User:Ericb|Ericb]] 19:33, 4 June 2006 (CEST)&lt;br /&gt;
&lt;br /&gt;
Last modification: [[User:Ybart|ybart]] 0:00, 16 October 2006 (CEST)&lt;br /&gt;
&lt;br /&gt;
[[Category:Porting]]&lt;br /&gt;
[[Category:Aqua]]&lt;br /&gt;
[[Category:MacOSX]]&lt;/div&gt;</summary>
		<author><name>Ybart</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Mac_OS_X_Porting_-_Native_Printing&amp;diff=19186</id>
		<title>Mac OS X Porting - Native Printing</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Mac_OS_X_Porting_-_Native_Printing&amp;diff=19186"/>
		<updated>2006-10-21T19:55:18Z</updated>

		<summary type="html">&lt;p&gt;Ybart: /* OOo print process */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page is dedicated to the native printing implementation in OpenOffice.org for Mac OS X&lt;br /&gt;
&lt;br /&gt;
== OpenOffice.org side ==&lt;br /&gt;
This part describes what can be found in the OOo APIs, how it is implemented and how it will be changed.&lt;br /&gt;
&lt;br /&gt;
=== OOo print process ===&lt;br /&gt;
I will try to share the few thing I understood about the way Writer prints document.&lt;br /&gt;
&lt;br /&gt;
First I need to locate the print menu item in the sw module (sw stands for Star Writer). For this, I need to know where in sw the menubar is built. I did found the menubar, but not how the menu item was linked to the print operation. Instead, I have found a method PrintPages implemented in sw module. The stack may look like that :&lt;br /&gt;
* SwXTextDocument::printPages()&lt;br /&gt;
* ViewShell::executeSlot(aReq)&lt;br /&gt;
* ...&lt;br /&gt;
* SwView::ExecutePrint()&lt;br /&gt;
* ...&lt;br /&gt;
* SwXTextDocument::render()&lt;br /&gt;
* ViewShell::Prt()&lt;br /&gt;
* OutputDevice:: ...&lt;br /&gt;
&lt;br /&gt;
TODO : Complete the stack trace&lt;br /&gt;
&lt;br /&gt;
There is many holes in the stack but we get the idea. The OuputDevice is in fact our Printer.&lt;br /&gt;
&lt;br /&gt;
[[Image:Printing_model.png]]&lt;br /&gt;
&lt;br /&gt;
1. The user Application creates a print dialog or a print setup dialog. For this, it needs to call svtools. To be a bit more precise, it creates a new instance of PrintDialog or of PrintDialogSetup, it associates a Printer instace to it, then, it calls the Execute method from PrintDialog or PrintSetupDialog. This operation shows the dialog (using the Execute method from ModalDialog, which is in vcl) and sets the Printer Data correctly with the method setPrinterProps.&lt;br /&gt;
&lt;br /&gt;
2. Svtools is responsible for asking to the user the requested information about printing options. Then, it returns them ot the user application.&lt;br /&gt;
&lt;br /&gt;
3. The user application has now everything needed to print the document. So, it asks VCL to draw pixels, lines, characters, etc on an OutputDevice.&lt;br /&gt;
&lt;br /&gt;
At this point, I don&amp;#039;t know exactly how the OutputDevice is set (who decides that it would be a screen, an Aqua printer or a PostScript printer. This is not really important since we understant the main idea of how printing works.&lt;br /&gt;
&lt;br /&gt;
[[Image:Printing_model_step_4.png]]&lt;br /&gt;
&lt;br /&gt;
4. After that VCL relies on its Graphic Context to really draws (i.e. make the OS really draws) the lines and pixels on the screen or on the print device.&lt;br /&gt;
&lt;br /&gt;
=== Concerned OOo modules ===&lt;br /&gt;
* psprint&lt;br /&gt;
* vcl&lt;br /&gt;
* svtools&lt;br /&gt;
&lt;br /&gt;
=== VCL ===&lt;br /&gt;
What we know about [[vcl]].&lt;br /&gt;
&lt;br /&gt;
==== SalPrinter class ====&lt;br /&gt;
SalPrinter is a virtual class intended for managing print jobs. It is composed of virtual fonctions, and a dummy constructor.&lt;br /&gt;
This class is inherited by PspSalPrinter, WinSalPrinter, and of course by AquaSalPrinter (see [[#AquaSalPrinter class|AquaSalPrinter class]]).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
    class VCL_DLLPUBLIC SalPrinter&lt;br /&gt;
    {&lt;br /&gt;
    public: // public for Sal Implementation&lt;br /&gt;
        SalPrinter() {}&lt;br /&gt;
        virtual ~SalPrinter();&lt;br /&gt;
        virtual BOOL StartJob( const XubString* pFileName,&lt;br /&gt;
                                        const XubString&amp;amp; rJobName,&lt;br /&gt;
                                        const XubString&amp;amp; rAppName,&lt;br /&gt;
                                        ULONG nCopies, BOOL bCollate,&lt;br /&gt;
                                        ImplJobSetup* pSetupData ) = 0;&lt;br /&gt;
        virtual BOOL EndJob() = 0;&lt;br /&gt;
        virtual BOOL AbortJob() = 0;&lt;br /&gt;
        virtual SalGraphics* StartPage( ImplJobSetup* pSetupData, BOOL bNewJobData ) = 0;&lt;br /&gt;
        virtual BOOL EndPage() = 0;&lt;br /&gt;
        virtual ULONG GetErrorCode() = 0;&lt;br /&gt;
    };&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== PspSalPrinter class ====&lt;br /&gt;
PspSalPrinter means PostScript Print System Abstraction Layer Printer. Its implementation is located in vcl/unx/source/gdi/salprnpsp.cxx. As the name suggests it relies on features psprint module.&lt;br /&gt;
&lt;br /&gt;
TODO : Discuss about PspSalPrinter implementation.&lt;br /&gt;
&lt;br /&gt;
==== Printer class ====&lt;br /&gt;
This is an abstraction class of a printer driver. You can entirely set up the printer there and start print jobs. What we need here is to make our native dialog access to this Printer. The we will need to make this class access to OS API rather than psprint. &lt;br /&gt;
&lt;br /&gt;
AquaSalPrinter class is located in vcl/aqua/source/gdi/print.cxx&lt;br /&gt;
&lt;br /&gt;
This class inherits of OutputDevice and is derivated in ImplQPrinter.&lt;br /&gt;
&lt;br /&gt;
* QueueInfo class - This class is related to the Printer class. It is used to store information about printers (name, driver, location, comment as strings, and number of Jobs, and a status code).&lt;br /&gt;
&lt;br /&gt;
==== OutputDevice class ====&lt;br /&gt;
This class allows applications such as Writer to draw graphics elements (pixels, lines, rects, characters, strings, etc...).&lt;br /&gt;
&lt;br /&gt;
This class is located in vcl/source/gdi/outdev.cxx, vcl/source/gdi/outdev[2-6].cxx&lt;br /&gt;
&lt;br /&gt;
At this time, we don&amp;#039;t need to know the details of this class. We will focus on it when we will use the Carbon Printing API.&lt;br /&gt;
&lt;br /&gt;
==== SalGraphics class ====&lt;br /&gt;
This class is responsible to translate the abstract drawing calls to concrete OS calls.&lt;br /&gt;
&lt;br /&gt;
==== PspGraphics ====&lt;br /&gt;
The class I need to reimplement using Aqua printing primitives...&lt;br /&gt;
May be I will name it AquaPrintGraphics ?...&lt;br /&gt;
&lt;br /&gt;
==== AquaSalPrinter class ====&lt;br /&gt;
AquaSalPrinter class is located in vcl/aqua/source/gdi/salprn.cxx&lt;br /&gt;
&lt;br /&gt;
Headers are in :&lt;br /&gt;
 vcl/inc/salinst.hxx  &lt;br /&gt;
 vcl/inc/salgdi.hxx    &lt;br /&gt;
 vcl/inc/salprn.hxx&lt;br /&gt;
&lt;br /&gt;
 Aqua implementation :&lt;br /&gt;
 vcl/aqua/inc/salprn.h  (AquaSalPrinter class implementation, inherits from SalPrinter)&lt;br /&gt;
&lt;br /&gt;
=== psprint ===&lt;br /&gt;
What we know about psprint.&lt;br /&gt;
&lt;br /&gt;
=== svtools ===&lt;br /&gt;
What we need to know about svtools. Mostly it provides us the Print Dialog, and some other Print related dialogs.&lt;br /&gt;
&lt;br /&gt;
==== PrintDialog class ====&lt;br /&gt;
This class is responsible for drawing the print dialog we usaually view when we choose the Print option of the File menu.&lt;br /&gt;
The current implementation uses this class to draw the print dialog. In our Aqua native implementation, we want to use the on provided by Carbon API. To achieve this, we want to know the functionality of this class, and let carbon manage the functionality maybe at this level or maybe in a other lever (higher or lower). We also need to know how this class provides information to the Printer instance.&lt;br /&gt;
&lt;br /&gt;
* The header of this class is located in svtools/inc/printdlg.hxx&lt;br /&gt;
* The implementation of this class is located in svtools/source/dialogs/printdlg.cxx&lt;br /&gt;
&lt;br /&gt;
This class is a derivate of ModalDialog class. &lt;br /&gt;
&lt;br /&gt;
It contains all the controls used by the dialog which are either :&lt;br /&gt;
* FixedImage&lt;br /&gt;
* FixedLine&lt;br /&gt;
* FixedText&lt;br /&gt;
* FixedInfo : it is a child of FixedText and is defined in svtools/inc/stdctrl.hxx. It is nothing more than a FixedText with the info style applied (same behaviour).&lt;br /&gt;
* ListBox : maLbName - List-box used to store the available printers.&lt;br /&gt;
&lt;br /&gt;
* Edit&lt;br /&gt;
* NumericField&lt;br /&gt;
&lt;br /&gt;
* CheckBox&lt;br /&gt;
* PushButton&lt;br /&gt;
* RadioButton&lt;br /&gt;
* OKButton&lt;br /&gt;
* CancelButton&lt;br /&gt;
* HelpButton&lt;br /&gt;
&lt;br /&gt;
These controls are used to allow the user to interact with the dialog. We need to know how they are used by the dialog to retrieve the user-provided information. What is involved to display them, and how the look &amp;amp; feel is implemented is not interesting at this point, since we only want to know what the dialog actually does.&lt;br /&gt;
&lt;br /&gt;
Other weird things that are not child of control class and that I don&amp;#039;t currently know why it is usefull :&lt;br /&gt;
* AutoTimer&lt;br /&gt;
&lt;br /&gt;
TODO : List of all user-related information stored by this class and sent to the Printer. Add more details on the vcl controls involved (what they are, at least for the non obvious ones).&lt;br /&gt;
&lt;br /&gt;
The class contains also fields used to store the real information provided by the controls (Mostly USHORT and BOOL). There is also a XubString instance and a PrintDialogRange instance used to store range information.&lt;br /&gt;
&lt;br /&gt;
Of course, this class contains an Printer instance and a SvtPtinterImpl instance in order to set the printer functionality.&lt;br /&gt;
&lt;br /&gt;
There is also internal methods, and links to the Option handler and the OK handler.&lt;br /&gt;
&lt;br /&gt;
The public methods are mostly getters and setters, I won&amp;#039;t detail it since I have already provided information about the private attributes, and they do nothing to the Printer instance.&lt;br /&gt;
&lt;br /&gt;
TODO : details the implementation of this class (interesting methods : ImplGetFileName, IMPL_LINK(PrintDialog, ImplModifyControlHdl, void*, p)&lt;br /&gt;
&lt;br /&gt;
For Aqua port, we need to reimplement this class in order to make it displays the native Aqua Print Dialog that will be provided by the Carbon API, and save information that was previously provided by children of Control class. We should also disable the Printing options provided by the Aqua dialog that are not provided by the Printer class (the information we cannot currently store).&lt;br /&gt;
&lt;br /&gt;
==== Print Setup file ====&lt;br /&gt;
* svtools/inc/prnsetup.hxx&lt;br /&gt;
* svtools/source/dialogs/prnsetup.hxx&lt;br /&gt;
&lt;br /&gt;
Utility functions : &lt;br /&gt;
* ImplFillPrnDlgListBox(const Printer *, ListBox *, PushButton *)&lt;br /&gt;
This method fills the Printer list-box with the QueueInfo provided by the Printer instance provided in argument. It then enables the OK button if the list is not empty.&lt;br /&gt;
&lt;br /&gt;
== Mac OS X API side ==&lt;br /&gt;
This part describes what can be used and how we intend to use it.&lt;br /&gt;
&lt;br /&gt;
The strategy is to first use the Carbon API to get Print Information and to provide an Aqua User Inerface for printing. Then, we will try to replace the current printing API to the native one, allowing to reduce dependencies, and the total package size.&lt;br /&gt;
&lt;br /&gt;
Carbon provides multiple way for us to print. We might consider every of different approaches :&lt;br /&gt;
* Printing using psprint. We only get settings from the Carbon Print Dialog and the Carbon Print Setup Dialog with the function PMGetPrintSettingsExtendedData (for example) and then we send the obtained parameters to our SalPrinter.&lt;br /&gt;
* Using the PMPrintToFile function (OpenOffice.org provides a postcript version of the document, and then, Carbon handles the print operation)&lt;br /&gt;
* Printing using a QuickDraw graphic context [http://developer.apple.com/documentation/Carbon/Conceptual/CPM_Concepts/cpm_chap3/chapter_3_section_4.html#//apple_ref/doc/uid/TP30000978-TP30000046-TPXREF12 See this link for an example] (As this is a legacy API, we are not enthusiast about using it in OpenOffice.org)&lt;br /&gt;
* Printing using a Quartz 2D graphic context [http://developer.apple.com/documentation/GraphicsImaging/Conceptual/drawingwithquartz2d/index.html More information about Quartz 2D]&lt;br /&gt;
&lt;br /&gt;
We may want to add some features to the Printing dialog provided by Carbon. [http://developer.apple.com/documentation/Printing/Conceptual/ExtPrintingDialogs/index.html This is documented here]&lt;br /&gt;
&lt;br /&gt;
Todo : implement missing methods, using Carbon API&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
=== Link for Mac OS X API documentation  ===&lt;br /&gt;
http://developer.apple.com/documentation/Carbon/Reference/CarbonPrintingManager_Ref/index.html&lt;br /&gt;
&lt;br /&gt;
=== Starting point for documentation ===&lt;br /&gt;
http://developer.apple.com/documentation/Carbon/Printing-date.html#//apple_ref/doc/uid/TP30000440-TP30000420-TP30000455&lt;br /&gt;
http://developer.apple.com/documentation/Carbon/Conceptual/CPM_Concepts/cpm_chap4/chapter_4_section_1.html&lt;br /&gt;
http://developer.apple.com/samplecode/Carbon/idxPrinting-date.html&lt;br /&gt;
http://developer.apple.com/referencelibrary/Carbon/idxPrinting-date.html&lt;br /&gt;
&lt;br /&gt;
This work is part of http://wiki.services.openoffice.org/wiki/Mac_OS_X_Porting_-_Work_Areas/Todo%27s&lt;br /&gt;
&lt;br /&gt;
Created: [[User:Ericb|Ericb]] 19:33, 4 June 2006 (CEST)&lt;br /&gt;
&lt;br /&gt;
Last modification: [[User:Ybart|ybart]] 0:00, 16 October 2006 (CEST)&lt;br /&gt;
&lt;br /&gt;
[[Category:Porting]]&lt;br /&gt;
[[Category:Aqua]]&lt;br /&gt;
[[Category:MacOSX]]&lt;/div&gt;</summary>
		<author><name>Ybart</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Mac_OS_X_Porting_-_Native_Printing&amp;diff=19038</id>
		<title>Mac OS X Porting - Native Printing</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Mac_OS_X_Porting_-_Native_Printing&amp;diff=19038"/>
		<updated>2006-10-18T21:42:53Z</updated>

		<summary type="html">&lt;p&gt;Ybart: /* SalGraphics class */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page is dedicated to the native printing implementation in OpenOffice.org for Mac OS X&lt;br /&gt;
&lt;br /&gt;
== OpenOffice.org side ==&lt;br /&gt;
This part describes what can be found in the OOo APIs, how it is implemented and how it will be changed.&lt;br /&gt;
&lt;br /&gt;
=== OOo print process ===&lt;br /&gt;
I will try to share the few thing I understood about the way Writer prints document.&lt;br /&gt;
&lt;br /&gt;
First I need to locate the print menu item in the sw module (sw stands for Star Writer). For this, I need to know where in sw the menubar is built. I did found the menubar, but not how the menu item was linked to the print operation. Instead, I have found a method PrintPages implemented in sw module. The stack may look like that :&lt;br /&gt;
* SwXTextDocument::printPages()&lt;br /&gt;
* ViewShell::executeSlot(aReq)&lt;br /&gt;
* ...&lt;br /&gt;
* SwView::ExecutePrint()&lt;br /&gt;
* ...&lt;br /&gt;
* SwXTextDocument::render()&lt;br /&gt;
* ViewShell::Prt()&lt;br /&gt;
* OutputDevice:: ...&lt;br /&gt;
&lt;br /&gt;
TODO : Complete the stack trace&lt;br /&gt;
&lt;br /&gt;
There is many holes in the stack but we get the idea. The OuputDevice is in fact our Printer.&lt;br /&gt;
&lt;br /&gt;
[[Image:Printing_model.png]]&lt;br /&gt;
&lt;br /&gt;
1. The user Application creates a print dialog or a print setup dialog. For this, it needs to call svtools.&lt;br /&gt;
&lt;br /&gt;
2. Svtools is responsible for asking to the user the requested information about printing options. Then, it returns them ot the user application.&lt;br /&gt;
&lt;br /&gt;
3. The user application has now everything needed to print the document. So, it asks VCL to draw pixels, lines, characters, etc on an OutputDevice.&lt;br /&gt;
&lt;br /&gt;
At this point, I don&amp;#039;t know exactly how the OutputDevice is set (who decides that it would be a screen, an Aqua printer or a PostScript printer. This is not really important since we understant the main idea of how printing works.&lt;br /&gt;
&lt;br /&gt;
[[Image:Printing_model_step_4.png]]&lt;br /&gt;
&lt;br /&gt;
4. After that VCL relies on its Graphic Context to really draws (i.e. make the OS really draws) the lines and pixels on the screen or on the print device.&lt;br /&gt;
&lt;br /&gt;
=== Concerned OOo modules ===&lt;br /&gt;
* psprint&lt;br /&gt;
* vcl&lt;br /&gt;
* svtools&lt;br /&gt;
&lt;br /&gt;
=== VCL ===&lt;br /&gt;
What we know about [[vcl]].&lt;br /&gt;
&lt;br /&gt;
==== SalPrinter class ====&lt;br /&gt;
SalPrinter is a virtual class intended for managing print jobs. It is composed of virtual fonctions, and a dummy constructor.&lt;br /&gt;
This class is inherited by PspSalPrinter, WinSalPrinter, and of course by AquaSalPrinter (see [[#AquaSalPrinter class|AquaSalPrinter class]]).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
    class VCL_DLLPUBLIC SalPrinter&lt;br /&gt;
    {&lt;br /&gt;
    public: // public for Sal Implementation&lt;br /&gt;
        SalPrinter() {}&lt;br /&gt;
        virtual ~SalPrinter();&lt;br /&gt;
        virtual BOOL StartJob( const XubString* pFileName,&lt;br /&gt;
                                        const XubString&amp;amp; rJobName,&lt;br /&gt;
                                        const XubString&amp;amp; rAppName,&lt;br /&gt;
                                        ULONG nCopies, BOOL bCollate,&lt;br /&gt;
                                        ImplJobSetup* pSetupData ) = 0;&lt;br /&gt;
        virtual BOOL EndJob() = 0;&lt;br /&gt;
        virtual BOOL AbortJob() = 0;&lt;br /&gt;
        virtual SalGraphics* StartPage( ImplJobSetup* pSetupData, BOOL bNewJobData ) = 0;&lt;br /&gt;
        virtual BOOL EndPage() = 0;&lt;br /&gt;
        virtual ULONG GetErrorCode() = 0;&lt;br /&gt;
    };&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== PspSalPrinter class ====&lt;br /&gt;
PspSalPrinter means PostScript Print System Abstraction Layer Printer. Its implementation is located in vcl/unx/source/gdi/salprnpsp.cxx. As the name suggests it relies on features psprint module.&lt;br /&gt;
&lt;br /&gt;
TODO : Discuss about PspSalPrinter implementation.&lt;br /&gt;
&lt;br /&gt;
==== Printer class ====&lt;br /&gt;
This is an abstraction class of a printer driver. You can entirely set up the printer there and start print jobs. What we need here is to make our native dialog access to this Printer. The we will need to make this class access to OS API rather than psprint. &lt;br /&gt;
&lt;br /&gt;
AquaSalPrinter class is located in vcl/aqua/source/gdi/print.cxx&lt;br /&gt;
&lt;br /&gt;
This class inherits of OutputDevice and is derivated in ImplQPrinter.&lt;br /&gt;
&lt;br /&gt;
* QueueInfo class - This class is related to the Printer class. It is used to store information about printers (name, driver, location, comment as strings, and number of Jobs, and a status code).&lt;br /&gt;
&lt;br /&gt;
==== OutputDevice class ====&lt;br /&gt;
This class allows applications such as Writer to draw graphics elements (pixels, lines, rects, characters, strings, etc...).&lt;br /&gt;
&lt;br /&gt;
This class is located in vcl/source/gdi/outdev.cxx, vcl/source/gdi/outdev[2-6].cxx&lt;br /&gt;
&lt;br /&gt;
At this time, we don&amp;#039;t need to know the details of this class. We will focus on it when we will use the Carbon Printing API.&lt;br /&gt;
&lt;br /&gt;
==== SalGraphics class ====&lt;br /&gt;
This class is responsible to translate the abstract drawing calls to concrete OS calls.&lt;br /&gt;
&lt;br /&gt;
==== PspGraphics ====&lt;br /&gt;
The class I need to reimplement using Aqua printing primitives...&lt;br /&gt;
May be I will name it AquaPrintGraphics ?...&lt;br /&gt;
&lt;br /&gt;
==== AquaSalPrinter class ====&lt;br /&gt;
AquaSalPrinter class is located in vcl/aqua/source/gdi/salprn.cxx&lt;br /&gt;
&lt;br /&gt;
Headers are in :&lt;br /&gt;
 vcl/inc/salinst.hxx  &lt;br /&gt;
 vcl/inc/salgdi.hxx    &lt;br /&gt;
 vcl/inc/salprn.hxx&lt;br /&gt;
&lt;br /&gt;
 Aqua implementation :&lt;br /&gt;
 vcl/aqua/inc/salprn.h  (AquaSalPrinter class implementation, inherits from SalPrinter)&lt;br /&gt;
&lt;br /&gt;
=== psprint ===&lt;br /&gt;
What we know about psprint.&lt;br /&gt;
&lt;br /&gt;
=== svtools ===&lt;br /&gt;
What we need to know about svtools. Mostly it provides us the Print Dialog, and some other Print related dialogs.&lt;br /&gt;
&lt;br /&gt;
==== PrintDialog class ====&lt;br /&gt;
This class is responsible for drawing the print dialog we usaually view when we choose the Print option of the File menu.&lt;br /&gt;
The current implementation uses this class to draw the print dialog. In our Aqua native implementation, we want to use the on provided by Carbon API. To achieve this, we want to know the functionality of this class, and let carbon manage the functionality maybe at this level or maybe in a other lever (higher or lower). We also need to know how this class provides information to the Printer instance.&lt;br /&gt;
&lt;br /&gt;
* The header of this class is located in svtools/inc/printdlg.hxx&lt;br /&gt;
* The implementation of this class is located in svtools/source/dialogs/printdlg.cxx&lt;br /&gt;
&lt;br /&gt;
This class is a derivate of ModalDialog class. &lt;br /&gt;
&lt;br /&gt;
It contains all the controls used by the dialog which are either :&lt;br /&gt;
* FixedImage&lt;br /&gt;
* FixedLine&lt;br /&gt;
* FixedText&lt;br /&gt;
* FixedInfo : it is a child of FixedText and is defined in svtools/inc/stdctrl.hxx. It is nothing more than a FixedText with the info style applied (same behaviour).&lt;br /&gt;
* ListBox : maLbName - List-box used to store the available printers.&lt;br /&gt;
&lt;br /&gt;
* Edit&lt;br /&gt;
* NumericField&lt;br /&gt;
&lt;br /&gt;
* CheckBox&lt;br /&gt;
* PushButton&lt;br /&gt;
* RadioButton&lt;br /&gt;
* OKButton&lt;br /&gt;
* CancelButton&lt;br /&gt;
* HelpButton&lt;br /&gt;
&lt;br /&gt;
These controls are used to allow the user to interact with the dialog. We need to know how they are used by the dialog to retrieve the user-provided information. What is involved to display them, and how the look &amp;amp; feel is implemented is not interesting at this point, since we only want to know what the dialog actually does.&lt;br /&gt;
&lt;br /&gt;
Other weird things that are not child of control class and that I don&amp;#039;t currently know why it is usefull :&lt;br /&gt;
* AutoTimer&lt;br /&gt;
&lt;br /&gt;
TODO : List of all user-related information stored by this class and sent to the Printer. Add more details on the vcl controls involved (what they are, at least for the non obvious ones).&lt;br /&gt;
&lt;br /&gt;
The class contains also fields used to store the real information provided by the controls (Mostly USHORT and BOOL). There is also a XubString instance and a PrintDialogRange instance used to store range information.&lt;br /&gt;
&lt;br /&gt;
Of course, this class contains an Printer instance and a SvtPtinterImpl instance in order to set the printer functionality.&lt;br /&gt;
&lt;br /&gt;
There is also internal methods, and links to the Option handler and the OK handler.&lt;br /&gt;
&lt;br /&gt;
The public methods are mostly getters and setters, I won&amp;#039;t detail it since I have already provided information about the private attributes, and they do nothing to the Printer instance.&lt;br /&gt;
&lt;br /&gt;
TODO : details the implementation of this class (interesting methods : ImplGetFileName, IMPL_LINK(PrintDialog, ImplModifyControlHdl, void*, p)&lt;br /&gt;
&lt;br /&gt;
For Aqua port, we need to reimplement this class in order to make it displays the native Aqua Print Dialog that will be provided by the Carbon API, and save information that was previously provided by children of Control class. We should also disable the Printing options provided by the Aqua dialog that are not provided by the Printer class (the information we cannot currently store).&lt;br /&gt;
&lt;br /&gt;
==== Print Setup file ====&lt;br /&gt;
* svtools/inc/prnsetup.hxx&lt;br /&gt;
* svtools/source/dialogs/prnsetup.hxx&lt;br /&gt;
&lt;br /&gt;
Utility functions : &lt;br /&gt;
* ImplFillPrnDlgListBox(const Printer *, ListBox *, PushButton *)&lt;br /&gt;
This method fills the Printer list-box with the QueueInfo provided by the Printer instance provided in argument. It then enables the OK button if the list is not empty.&lt;br /&gt;
&lt;br /&gt;
== Mac OS X API side ==&lt;br /&gt;
This part describes what can be used and how we intend to use it.&lt;br /&gt;
&lt;br /&gt;
The strategy is to first use the Carbon API to get Print Information and to provide an Aqua User Inerface for printing. Then, we will try to replace the current printing API to the native one, allowing to reduce dependencies, and the total package size.&lt;br /&gt;
&lt;br /&gt;
Carbon provides multiple way for us to print. We might consider every of different approaches :&lt;br /&gt;
* Printing using psprint. We only get settings from the Carbon Print Dialog and the Carbon Print Setup Dialog with the function PMGetPrintSettingsExtendedData (for example) and then we send the obtained parameters to our SalPrinter.&lt;br /&gt;
* Using the PMPrintToFile function (OpenOffice.org provides a postcript version of the document, and then, Carbon handles the print operation)&lt;br /&gt;
* Printing using a QuickDraw graphic context [http://developer.apple.com/documentation/Carbon/Conceptual/CPM_Concepts/cpm_chap3/chapter_3_section_4.html#//apple_ref/doc/uid/TP30000978-TP30000046-TPXREF12 See this link for an example] (As this is a legacy API, we are not enthusiast about using it in OpenOffice.org)&lt;br /&gt;
* Printing using a Quartz 2D graphic context [http://developer.apple.com/documentation/GraphicsImaging/Conceptual/drawingwithquartz2d/index.html More information about Quartz 2D]&lt;br /&gt;
&lt;br /&gt;
We may want to add some features to the Printing dialog provided by Carbon. [http://developer.apple.com/documentation/Printing/Conceptual/ExtPrintingDialogs/index.html This is documented here]&lt;br /&gt;
&lt;br /&gt;
Todo : implement missing methods, using Carbon API&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
=== Link for Mac OS X API documentation  ===&lt;br /&gt;
http://developer.apple.com/documentation/Carbon/Reference/CarbonPrintingManager_Ref/index.html&lt;br /&gt;
&lt;br /&gt;
=== Starting point for documentation ===&lt;br /&gt;
http://developer.apple.com/documentation/Carbon/Printing-date.html#//apple_ref/doc/uid/TP30000440-TP30000420-TP30000455&lt;br /&gt;
http://developer.apple.com/documentation/Carbon/Conceptual/CPM_Concepts/cpm_chap4/chapter_4_section_1.html&lt;br /&gt;
http://developer.apple.com/samplecode/Carbon/idxPrinting-date.html&lt;br /&gt;
http://developer.apple.com/referencelibrary/Carbon/idxPrinting-date.html&lt;br /&gt;
&lt;br /&gt;
This work is part of http://wiki.services.openoffice.org/wiki/Mac_OS_X_Porting_-_Work_Areas/Todo%27s&lt;br /&gt;
&lt;br /&gt;
Created: [[User:Ericb|Ericb]] 19:33, 4 June 2006 (CEST)&lt;br /&gt;
&lt;br /&gt;
Last modification: [[User:Ybart|ybart]] 0:00, 16 October 2006 (CEST)&lt;br /&gt;
&lt;br /&gt;
[[Category:Porting]]&lt;br /&gt;
[[Category:Aqua]]&lt;br /&gt;
[[Category:MacOSX]]&lt;/div&gt;</summary>
		<author><name>Ybart</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Mac_OS_X_Porting_-_Native_Printing&amp;diff=19037</id>
		<title>Mac OS X Porting - Native Printing</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Mac_OS_X_Porting_-_Native_Printing&amp;diff=19037"/>
		<updated>2006-10-18T21:39:37Z</updated>

		<summary type="html">&lt;p&gt;Ybart: /* OutputDevice class */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page is dedicated to the native printing implementation in OpenOffice.org for Mac OS X&lt;br /&gt;
&lt;br /&gt;
== OpenOffice.org side ==&lt;br /&gt;
This part describes what can be found in the OOo APIs, how it is implemented and how it will be changed.&lt;br /&gt;
&lt;br /&gt;
=== OOo print process ===&lt;br /&gt;
I will try to share the few thing I understood about the way Writer prints document.&lt;br /&gt;
&lt;br /&gt;
First I need to locate the print menu item in the sw module (sw stands for Star Writer). For this, I need to know where in sw the menubar is built. I did found the menubar, but not how the menu item was linked to the print operation. Instead, I have found a method PrintPages implemented in sw module. The stack may look like that :&lt;br /&gt;
* SwXTextDocument::printPages()&lt;br /&gt;
* ViewShell::executeSlot(aReq)&lt;br /&gt;
* ...&lt;br /&gt;
* SwView::ExecutePrint()&lt;br /&gt;
* ...&lt;br /&gt;
* SwXTextDocument::render()&lt;br /&gt;
* ViewShell::Prt()&lt;br /&gt;
* OutputDevice:: ...&lt;br /&gt;
&lt;br /&gt;
TODO : Complete the stack trace&lt;br /&gt;
&lt;br /&gt;
There is many holes in the stack but we get the idea. The OuputDevice is in fact our Printer.&lt;br /&gt;
&lt;br /&gt;
[[Image:Printing_model.png]]&lt;br /&gt;
&lt;br /&gt;
1. The user Application creates a print dialog or a print setup dialog. For this, it needs to call svtools.&lt;br /&gt;
&lt;br /&gt;
2. Svtools is responsible for asking to the user the requested information about printing options. Then, it returns them ot the user application.&lt;br /&gt;
&lt;br /&gt;
3. The user application has now everything needed to print the document. So, it asks VCL to draw pixels, lines, characters, etc on an OutputDevice.&lt;br /&gt;
&lt;br /&gt;
At this point, I don&amp;#039;t know exactly how the OutputDevice is set (who decides that it would be a screen, an Aqua printer or a PostScript printer. This is not really important since we understant the main idea of how printing works.&lt;br /&gt;
&lt;br /&gt;
[[Image:Printing_model_step_4.png]]&lt;br /&gt;
&lt;br /&gt;
4. After that VCL relies on its Graphic Context to really draws (i.e. make the OS really draws) the lines and pixels on the screen or on the print device.&lt;br /&gt;
&lt;br /&gt;
=== Concerned OOo modules ===&lt;br /&gt;
* psprint&lt;br /&gt;
* vcl&lt;br /&gt;
* svtools&lt;br /&gt;
&lt;br /&gt;
=== VCL ===&lt;br /&gt;
What we know about [[vcl]].&lt;br /&gt;
&lt;br /&gt;
==== SalPrinter class ====&lt;br /&gt;
SalPrinter is a virtual class intended for managing print jobs. It is composed of virtual fonctions, and a dummy constructor.&lt;br /&gt;
This class is inherited by PspSalPrinter, WinSalPrinter, and of course by AquaSalPrinter (see [[#AquaSalPrinter class|AquaSalPrinter class]]).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
    class VCL_DLLPUBLIC SalPrinter&lt;br /&gt;
    {&lt;br /&gt;
    public: // public for Sal Implementation&lt;br /&gt;
        SalPrinter() {}&lt;br /&gt;
        virtual ~SalPrinter();&lt;br /&gt;
        virtual BOOL StartJob( const XubString* pFileName,&lt;br /&gt;
                                        const XubString&amp;amp; rJobName,&lt;br /&gt;
                                        const XubString&amp;amp; rAppName,&lt;br /&gt;
                                        ULONG nCopies, BOOL bCollate,&lt;br /&gt;
                                        ImplJobSetup* pSetupData ) = 0;&lt;br /&gt;
        virtual BOOL EndJob() = 0;&lt;br /&gt;
        virtual BOOL AbortJob() = 0;&lt;br /&gt;
        virtual SalGraphics* StartPage( ImplJobSetup* pSetupData, BOOL bNewJobData ) = 0;&lt;br /&gt;
        virtual BOOL EndPage() = 0;&lt;br /&gt;
        virtual ULONG GetErrorCode() = 0;&lt;br /&gt;
    };&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== PspSalPrinter class ====&lt;br /&gt;
PspSalPrinter means PostScript Print System Abstraction Layer Printer. Its implementation is located in vcl/unx/source/gdi/salprnpsp.cxx. As the name suggests it relies on features psprint module.&lt;br /&gt;
&lt;br /&gt;
TODO : Discuss about PspSalPrinter implementation.&lt;br /&gt;
&lt;br /&gt;
==== Printer class ====&lt;br /&gt;
This is an abstraction class of a printer driver. You can entirely set up the printer there and start print jobs. What we need here is to make our native dialog access to this Printer. The we will need to make this class access to OS API rather than psprint. &lt;br /&gt;
&lt;br /&gt;
AquaSalPrinter class is located in vcl/aqua/source/gdi/print.cxx&lt;br /&gt;
&lt;br /&gt;
This class inherits of OutputDevice and is derivated in ImplQPrinter.&lt;br /&gt;
&lt;br /&gt;
* QueueInfo class - This class is related to the Printer class. It is used to store information about printers (name, driver, location, comment as strings, and number of Jobs, and a status code).&lt;br /&gt;
&lt;br /&gt;
==== OutputDevice class ====&lt;br /&gt;
This class allows applications such as Writer to draw graphics elements (pixels, lines, rects, characters, strings, etc...).&lt;br /&gt;
&lt;br /&gt;
This class is located in vcl/source/gdi/outdev.cxx, vcl/source/gdi/outdev[2-6].cxx&lt;br /&gt;
&lt;br /&gt;
At this time, we don&amp;#039;t need to know the details of this class. We will focus on it when we will use the Carbon Printing API.&lt;br /&gt;
&lt;br /&gt;
==== SalGraphics class ====&lt;br /&gt;
This class is responsible to translate the abstract drawing calls to concrete OS calls.&lt;br /&gt;
&lt;br /&gt;
==== AquaSalPrinter class ====&lt;br /&gt;
AquaSalPrinter class is located in vcl/aqua/source/gdi/salprn.cxx&lt;br /&gt;
&lt;br /&gt;
Headers are in :&lt;br /&gt;
 vcl/inc/salinst.hxx  &lt;br /&gt;
 vcl/inc/salgdi.hxx    &lt;br /&gt;
 vcl/inc/salprn.hxx&lt;br /&gt;
&lt;br /&gt;
 Aqua implementation :&lt;br /&gt;
 vcl/aqua/inc/salprn.h  (AquaSalPrinter class implementation, inherits from SalPrinter)&lt;br /&gt;
&lt;br /&gt;
=== psprint ===&lt;br /&gt;
What we know about psprint.&lt;br /&gt;
&lt;br /&gt;
=== svtools ===&lt;br /&gt;
What we need to know about svtools. Mostly it provides us the Print Dialog, and some other Print related dialogs.&lt;br /&gt;
&lt;br /&gt;
==== PrintDialog class ====&lt;br /&gt;
This class is responsible for drawing the print dialog we usaually view when we choose the Print option of the File menu.&lt;br /&gt;
The current implementation uses this class to draw the print dialog. In our Aqua native implementation, we want to use the on provided by Carbon API. To achieve this, we want to know the functionality of this class, and let carbon manage the functionality maybe at this level or maybe in a other lever (higher or lower). We also need to know how this class provides information to the Printer instance.&lt;br /&gt;
&lt;br /&gt;
* The header of this class is located in svtools/inc/printdlg.hxx&lt;br /&gt;
* The implementation of this class is located in svtools/source/dialogs/printdlg.cxx&lt;br /&gt;
&lt;br /&gt;
This class is a derivate of ModalDialog class. &lt;br /&gt;
&lt;br /&gt;
It contains all the controls used by the dialog which are either :&lt;br /&gt;
* FixedImage&lt;br /&gt;
* FixedLine&lt;br /&gt;
* FixedText&lt;br /&gt;
* FixedInfo : it is a child of FixedText and is defined in svtools/inc/stdctrl.hxx. It is nothing more than a FixedText with the info style applied (same behaviour).&lt;br /&gt;
* ListBox : maLbName - List-box used to store the available printers.&lt;br /&gt;
&lt;br /&gt;
* Edit&lt;br /&gt;
* NumericField&lt;br /&gt;
&lt;br /&gt;
* CheckBox&lt;br /&gt;
* PushButton&lt;br /&gt;
* RadioButton&lt;br /&gt;
* OKButton&lt;br /&gt;
* CancelButton&lt;br /&gt;
* HelpButton&lt;br /&gt;
&lt;br /&gt;
These controls are used to allow the user to interact with the dialog. We need to know how they are used by the dialog to retrieve the user-provided information. What is involved to display them, and how the look &amp;amp; feel is implemented is not interesting at this point, since we only want to know what the dialog actually does.&lt;br /&gt;
&lt;br /&gt;
Other weird things that are not child of control class and that I don&amp;#039;t currently know why it is usefull :&lt;br /&gt;
* AutoTimer&lt;br /&gt;
&lt;br /&gt;
TODO : List of all user-related information stored by this class and sent to the Printer. Add more details on the vcl controls involved (what they are, at least for the non obvious ones).&lt;br /&gt;
&lt;br /&gt;
The class contains also fields used to store the real information provided by the controls (Mostly USHORT and BOOL). There is also a XubString instance and a PrintDialogRange instance used to store range information.&lt;br /&gt;
&lt;br /&gt;
Of course, this class contains an Printer instance and a SvtPtinterImpl instance in order to set the printer functionality.&lt;br /&gt;
&lt;br /&gt;
There is also internal methods, and links to the Option handler and the OK handler.&lt;br /&gt;
&lt;br /&gt;
The public methods are mostly getters and setters, I won&amp;#039;t detail it since I have already provided information about the private attributes, and they do nothing to the Printer instance.&lt;br /&gt;
&lt;br /&gt;
TODO : details the implementation of this class (interesting methods : ImplGetFileName, IMPL_LINK(PrintDialog, ImplModifyControlHdl, void*, p)&lt;br /&gt;
&lt;br /&gt;
For Aqua port, we need to reimplement this class in order to make it displays the native Aqua Print Dialog that will be provided by the Carbon API, and save information that was previously provided by children of Control class. We should also disable the Printing options provided by the Aqua dialog that are not provided by the Printer class (the information we cannot currently store).&lt;br /&gt;
&lt;br /&gt;
==== Print Setup file ====&lt;br /&gt;
* svtools/inc/prnsetup.hxx&lt;br /&gt;
* svtools/source/dialogs/prnsetup.hxx&lt;br /&gt;
&lt;br /&gt;
Utility functions : &lt;br /&gt;
* ImplFillPrnDlgListBox(const Printer *, ListBox *, PushButton *)&lt;br /&gt;
This method fills the Printer list-box with the QueueInfo provided by the Printer instance provided in argument. It then enables the OK button if the list is not empty.&lt;br /&gt;
&lt;br /&gt;
== Mac OS X API side ==&lt;br /&gt;
This part describes what can be used and how we intend to use it.&lt;br /&gt;
&lt;br /&gt;
The strategy is to first use the Carbon API to get Print Information and to provide an Aqua User Inerface for printing. Then, we will try to replace the current printing API to the native one, allowing to reduce dependencies, and the total package size.&lt;br /&gt;
&lt;br /&gt;
Carbon provides multiple way for us to print. We might consider every of different approaches :&lt;br /&gt;
* Printing using psprint. We only get settings from the Carbon Print Dialog and the Carbon Print Setup Dialog with the function PMGetPrintSettingsExtendedData (for example) and then we send the obtained parameters to our SalPrinter.&lt;br /&gt;
* Using the PMPrintToFile function (OpenOffice.org provides a postcript version of the document, and then, Carbon handles the print operation)&lt;br /&gt;
* Printing using a QuickDraw graphic context [http://developer.apple.com/documentation/Carbon/Conceptual/CPM_Concepts/cpm_chap3/chapter_3_section_4.html#//apple_ref/doc/uid/TP30000978-TP30000046-TPXREF12 See this link for an example] (As this is a legacy API, we are not enthusiast about using it in OpenOffice.org)&lt;br /&gt;
* Printing using a Quartz 2D graphic context [http://developer.apple.com/documentation/GraphicsImaging/Conceptual/drawingwithquartz2d/index.html More information about Quartz 2D]&lt;br /&gt;
&lt;br /&gt;
We may want to add some features to the Printing dialog provided by Carbon. [http://developer.apple.com/documentation/Printing/Conceptual/ExtPrintingDialogs/index.html This is documented here]&lt;br /&gt;
&lt;br /&gt;
Todo : implement missing methods, using Carbon API&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
=== Link for Mac OS X API documentation  ===&lt;br /&gt;
http://developer.apple.com/documentation/Carbon/Reference/CarbonPrintingManager_Ref/index.html&lt;br /&gt;
&lt;br /&gt;
=== Starting point for documentation ===&lt;br /&gt;
http://developer.apple.com/documentation/Carbon/Printing-date.html#//apple_ref/doc/uid/TP30000440-TP30000420-TP30000455&lt;br /&gt;
http://developer.apple.com/documentation/Carbon/Conceptual/CPM_Concepts/cpm_chap4/chapter_4_section_1.html&lt;br /&gt;
http://developer.apple.com/samplecode/Carbon/idxPrinting-date.html&lt;br /&gt;
http://developer.apple.com/referencelibrary/Carbon/idxPrinting-date.html&lt;br /&gt;
&lt;br /&gt;
This work is part of http://wiki.services.openoffice.org/wiki/Mac_OS_X_Porting_-_Work_Areas/Todo%27s&lt;br /&gt;
&lt;br /&gt;
Created: [[User:Ericb|Ericb]] 19:33, 4 June 2006 (CEST)&lt;br /&gt;
&lt;br /&gt;
Last modification: [[User:Ybart|ybart]] 0:00, 16 October 2006 (CEST)&lt;br /&gt;
&lt;br /&gt;
[[Category:Porting]]&lt;br /&gt;
[[Category:Aqua]]&lt;br /&gt;
[[Category:MacOSX]]&lt;/div&gt;</summary>
		<author><name>Ybart</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Mac_OS_X_Porting_-_Native_Printing&amp;diff=19032</id>
		<title>Mac OS X Porting - Native Printing</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Mac_OS_X_Porting_-_Native_Printing&amp;diff=19032"/>
		<updated>2006-10-18T21:19:32Z</updated>

		<summary type="html">&lt;p&gt;Ybart: /* OOo print process */&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This page is dedicated to the native printing implementation in OpenOffice.org for Mac OS X&lt;br /&gt;
&lt;br /&gt;
== OpenOffice.org side ==&lt;br /&gt;
This part describes what can be found in the OOo APIs, how it is implemented and how it will be changed.&lt;br /&gt;
&lt;br /&gt;
=== OOo print process ===&lt;br /&gt;
I will try to share the few thing I understood about the way Writer prints document.&lt;br /&gt;
&lt;br /&gt;
First I need to locate the print menu item in the sw module (sw stands for Star Writer). For this, I need to know where in sw the menubar is built. I did found the menubar, but not how the menu item was linked to the print operation. Instead, I have found a method PrintPages implemented in sw module. The stack may look like that :&lt;br /&gt;
* SwXTextDocument::printPages()&lt;br /&gt;
* ViewShell::executeSlot(aReq)&lt;br /&gt;
* ...&lt;br /&gt;
* SwView::ExecutePrint()&lt;br /&gt;
* ...&lt;br /&gt;
* SwXTextDocument::render()&lt;br /&gt;
* ViewShell::Prt()&lt;br /&gt;
* OutputDevice:: ...&lt;br /&gt;
&lt;br /&gt;
TODO : Complete the stack trace&lt;br /&gt;
&lt;br /&gt;
There is many holes in the stack but we get the idea. The OuputDevice is in fact our Printer.&lt;br /&gt;
&lt;br /&gt;
[[Image:Printing_model.png]]&lt;br /&gt;
&lt;br /&gt;
1. The user Application creates a print dialog or a print setup dialog. For this, it needs to call svtools.&lt;br /&gt;
&lt;br /&gt;
2. Svtools is responsible for asking to the user the requested information about printing options. Then, it returns them ot the user application.&lt;br /&gt;
&lt;br /&gt;
3. The user application has now everything needed to print the document. So, it asks VCL to draw pixels, lines, characters, etc on an OutputDevice.&lt;br /&gt;
&lt;br /&gt;
At this point, I don&amp;#039;t know exactly how the OutputDevice is set (who decides that it would be a screen, an Aqua printer or a PostScript printer. This is not really important since we understant the main idea of how printing works.&lt;br /&gt;
&lt;br /&gt;
[[Image:Printing_model_step_4.png]]&lt;br /&gt;
&lt;br /&gt;
4. After that VCL relies on its Graphic Context to really draws (i.e. make the OS really draws) the lines and pixels on the screen or on the print device.&lt;br /&gt;
&lt;br /&gt;
=== Concerned OOo modules ===&lt;br /&gt;
* psprint&lt;br /&gt;
* vcl&lt;br /&gt;
* svtools&lt;br /&gt;
&lt;br /&gt;
=== VCL ===&lt;br /&gt;
What we know about [[vcl]].&lt;br /&gt;
&lt;br /&gt;
==== SalPrinter class ====&lt;br /&gt;
SalPrinter is a virtual class intended for managing print jobs. It is composed of virtual fonctions, and a dummy constructor.&lt;br /&gt;
This class is inherited by PspSalPrinter, WinSalPrinter, and of course by AquaSalPrinter (see [[#AquaSalPrinter class|AquaSalPrinter class]]).&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;&lt;br /&gt;
    class VCL_DLLPUBLIC SalPrinter&lt;br /&gt;
    {&lt;br /&gt;
    public: // public for Sal Implementation&lt;br /&gt;
        SalPrinter() {}&lt;br /&gt;
        virtual ~SalPrinter();&lt;br /&gt;
        virtual BOOL StartJob( const XubString* pFileName,&lt;br /&gt;
                                        const XubString&amp;amp; rJobName,&lt;br /&gt;
                                        const XubString&amp;amp; rAppName,&lt;br /&gt;
                                        ULONG nCopies, BOOL bCollate,&lt;br /&gt;
                                        ImplJobSetup* pSetupData ) = 0;&lt;br /&gt;
        virtual BOOL EndJob() = 0;&lt;br /&gt;
        virtual BOOL AbortJob() = 0;&lt;br /&gt;
        virtual SalGraphics* StartPage( ImplJobSetup* pSetupData, BOOL bNewJobData ) = 0;&lt;br /&gt;
        virtual BOOL EndPage() = 0;&lt;br /&gt;
        virtual ULONG GetErrorCode() = 0;&lt;br /&gt;
    };&lt;br /&gt;
&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== PspSalPrinter class ====&lt;br /&gt;
PspSalPrinter means PostScript Print System Abstraction Layer Printer. Its implementation is located in vcl/unx/source/gdi/salprnpsp.cxx. As the name suggests it relies on features psprint module.&lt;br /&gt;
&lt;br /&gt;
TODO : Discuss about PspSalPrinter implementation.&lt;br /&gt;
&lt;br /&gt;
==== Printer class ====&lt;br /&gt;
This is an abstraction class of a printer driver. You can entirely set up the printer there and start print jobs. What we need here is to make our native dialog access to this Printer. The we will need to make this class access to OS API rather than psprint. &lt;br /&gt;
&lt;br /&gt;
AquaSalPrinter class is located in vcl/aqua/source/gdi/print.cxx&lt;br /&gt;
&lt;br /&gt;
This class inherits of OutputDevice and is derivated in ImplQPrinter.&lt;br /&gt;
&lt;br /&gt;
* QueueInfo class - This class is related to the Printer class. It is used to store information about printers (name, driver, location, comment as strings, and number of Jobs, and a status code).&lt;br /&gt;
&lt;br /&gt;
==== OutputDevice class ====&lt;br /&gt;
This class allows applications such as Writer to draw graphics elements (pixels, lines, rects, characters, strings, etc...).&lt;br /&gt;
&lt;br /&gt;
This class is located in vcl/source/gdi/outdev.cxx, vcl/source/gdi/outdev[2-6].cxx&lt;br /&gt;
&lt;br /&gt;
At this time, we don&amp;#039;t need to know the details of this class. We will focus on it when we will use the Carbon Printing API.&lt;br /&gt;
&lt;br /&gt;
==== AquaSalPrinter class ====&lt;br /&gt;
AquaSalPrinter class is located in vcl/aqua/source/gdi/salprn.cxx&lt;br /&gt;
&lt;br /&gt;
Headers are in :&lt;br /&gt;
 vcl/inc/salinst.hxx  &lt;br /&gt;
 vcl/inc/salgdi.hxx    &lt;br /&gt;
 vcl/inc/salprn.hxx&lt;br /&gt;
&lt;br /&gt;
 Aqua implementation :&lt;br /&gt;
 vcl/aqua/inc/salprn.h  (AquaSalPrinter class implementation, inherits from SalPrinter)&lt;br /&gt;
&lt;br /&gt;
=== psprint ===&lt;br /&gt;
What we know about psprint.&lt;br /&gt;
&lt;br /&gt;
=== svtools ===&lt;br /&gt;
What we need to know about svtools. Mostly it provides us the Print Dialog, and some other Print related dialogs.&lt;br /&gt;
&lt;br /&gt;
==== PrintDialog class ====&lt;br /&gt;
This class is responsible for drawing the print dialog we usaually view when we choose the Print option of the File menu.&lt;br /&gt;
The current implementation uses this class to draw the print dialog. In our Aqua native implementation, we want to use the on provided by Carbon API. To achieve this, we want to know the functionality of this class, and let carbon manage the functionality maybe at this level or maybe in a other lever (higher or lower). We also need to know how this class provides information to the Printer instance.&lt;br /&gt;
&lt;br /&gt;
* The header of this class is located in svtools/inc/printdlg.hxx&lt;br /&gt;
* The implementation of this class is located in svtools/source/dialogs/printdlg.cxx&lt;br /&gt;
&lt;br /&gt;
This class is a derivate of ModalDialog class. &lt;br /&gt;
&lt;br /&gt;
It contains all the controls used by the dialog which are either :&lt;br /&gt;
* FixedImage&lt;br /&gt;
* FixedLine&lt;br /&gt;
* FixedText&lt;br /&gt;
* FixedInfo : it is a child of FixedText and is defined in svtools/inc/stdctrl.hxx. It is nothing more than a FixedText with the info style applied (same behaviour).&lt;br /&gt;
* ListBox : maLbName - List-box used to store the available printers.&lt;br /&gt;
&lt;br /&gt;
* Edit&lt;br /&gt;
* NumericField&lt;br /&gt;
&lt;br /&gt;
* CheckBox&lt;br /&gt;
* PushButton&lt;br /&gt;
* RadioButton&lt;br /&gt;
* OKButton&lt;br /&gt;
* CancelButton&lt;br /&gt;
* HelpButton&lt;br /&gt;
&lt;br /&gt;
These controls are used to allow the user to interact with the dialog. We need to know how they are used by the dialog to retrieve the user-provided information. What is involved to display them, and how the look &amp;amp; feel is implemented is not interesting at this point, since we only want to know what the dialog actually does.&lt;br /&gt;
&lt;br /&gt;
Other weird things that are not child of control class and that I don&amp;#039;t currently know why it is usefull :&lt;br /&gt;
* AutoTimer&lt;br /&gt;
&lt;br /&gt;
TODO : List of all user-related information stored by this class and sent to the Printer. Add more details on the vcl controls involved (what they are, at least for the non obvious ones).&lt;br /&gt;
&lt;br /&gt;
The class contains also fields used to store the real information provided by the controls (Mostly USHORT and BOOL). There is also a XubString instance and a PrintDialogRange instance used to store range information.&lt;br /&gt;
&lt;br /&gt;
Of course, this class contains an Printer instance and a SvtPtinterImpl instance in order to set the printer functionality.&lt;br /&gt;
&lt;br /&gt;
There is also internal methods, and links to the Option handler and the OK handler.&lt;br /&gt;
&lt;br /&gt;
The public methods are mostly getters and setters, I won&amp;#039;t detail it since I have already provided information about the private attributes, and they do nothing to the Printer instance.&lt;br /&gt;
&lt;br /&gt;
TODO : details the implementation of this class (interesting methods : ImplGetFileName, IMPL_LINK(PrintDialog, ImplModifyControlHdl, void*, p)&lt;br /&gt;
&lt;br /&gt;
For Aqua port, we need to reimplement this class in order to make it displays the native Aqua Print Dialog that will be provided by the Carbon API, and save information that was previously provided by children of Control class. We should also disable the Printing options provided by the Aqua dialog that are not provided by the Printer class (the information we cannot currently store).&lt;br /&gt;
&lt;br /&gt;
==== Print Setup file ====&lt;br /&gt;
* svtools/inc/prnsetup.hxx&lt;br /&gt;
* svtools/source/dialogs/prnsetup.hxx&lt;br /&gt;
&lt;br /&gt;
Utility functions : &lt;br /&gt;
* ImplFillPrnDlgListBox(const Printer *, ListBox *, PushButton *)&lt;br /&gt;
This method fills the Printer list-box with the QueueInfo provided by the Printer instance provided in argument. It then enables the OK button if the list is not empty.&lt;br /&gt;
&lt;br /&gt;
== Mac OS X API side ==&lt;br /&gt;
This part describes what can be used and how we intend to use it.&lt;br /&gt;
&lt;br /&gt;
The strategy is to first use the Carbon API to get Print Information and to provide an Aqua User Inerface for printing. Then, we will try to replace the current printing API to the native one, allowing to reduce dependencies, and the total package size.&lt;br /&gt;
&lt;br /&gt;
Carbon provides multiple way for us to print. We might consider every of different approaches :&lt;br /&gt;
* Printing using psprint. We only get settings from the Carbon Print Dialog and the Carbon Print Setup Dialog with the function PMGetPrintSettingsExtendedData (for example) and then we send the obtained parameters to our SalPrinter.&lt;br /&gt;
* Using the PMPrintToFile function (OpenOffice.org provides a postcript version of the document, and then, Carbon handles the print operation)&lt;br /&gt;
* Printing using a QuickDraw graphic context [http://developer.apple.com/documentation/Carbon/Conceptual/CPM_Concepts/cpm_chap3/chapter_3_section_4.html#//apple_ref/doc/uid/TP30000978-TP30000046-TPXREF12 See this link for an example] (As this is a legacy API, we are not enthusiast about using it in OpenOffice.org)&lt;br /&gt;
* Printing using a Quartz 2D graphic context [http://developer.apple.com/documentation/GraphicsImaging/Conceptual/drawingwithquartz2d/index.html More information about Quartz 2D]&lt;br /&gt;
&lt;br /&gt;
We may want to add some features to the Printing dialog provided by Carbon. [http://developer.apple.com/documentation/Printing/Conceptual/ExtPrintingDialogs/index.html This is documented here]&lt;br /&gt;
&lt;br /&gt;
Todo : implement missing methods, using Carbon API&lt;br /&gt;
&lt;br /&gt;
== Links ==&lt;br /&gt;
=== Link for Mac OS X API documentation  ===&lt;br /&gt;
http://developer.apple.com/documentation/Carbon/Reference/CarbonPrintingManager_Ref/index.html&lt;br /&gt;
&lt;br /&gt;
=== Starting point for documentation ===&lt;br /&gt;
http://developer.apple.com/documentation/Carbon/Printing-date.html#//apple_ref/doc/uid/TP30000440-TP30000420-TP30000455&lt;br /&gt;
http://developer.apple.com/documentation/Carbon/Conceptual/CPM_Concepts/cpm_chap4/chapter_4_section_1.html&lt;br /&gt;
http://developer.apple.com/samplecode/Carbon/idxPrinting-date.html&lt;br /&gt;
http://developer.apple.com/referencelibrary/Carbon/idxPrinting-date.html&lt;br /&gt;
&lt;br /&gt;
This work is part of http://wiki.services.openoffice.org/wiki/Mac_OS_X_Porting_-_Work_Areas/Todo%27s&lt;br /&gt;
&lt;br /&gt;
Created: [[User:Ericb|Ericb]] 19:33, 4 June 2006 (CEST)&lt;br /&gt;
&lt;br /&gt;
Last modification: [[User:Ybart|ybart]] 0:00, 16 October 2006 (CEST)&lt;br /&gt;
&lt;br /&gt;
[[Category:Porting]]&lt;br /&gt;
[[Category:Aqua]]&lt;br /&gt;
[[Category:MacOSX]]&lt;/div&gt;</summary>
		<author><name>Ybart</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=File:Printing_model_step_4.png&amp;diff=19031</id>
		<title>File:Printing model step 4.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=File:Printing_model_step_4.png&amp;diff=19031"/>
		<updated>2006-10-18T21:19:04Z</updated>

		<summary type="html">&lt;p&gt;Ybart: Printing step 4&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;Printing step 4&lt;/div&gt;</summary>
		<author><name>Ybart</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=File:Printing_model.png&amp;diff=19030</id>
		<title>File:Printing model.png</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=File:Printing_model.png&amp;diff=19030"/>
		<updated>2006-10-18T21:06:33Z</updated>

		<summary type="html">&lt;p&gt;Ybart: The printing workflow in OOo (simplified)&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;The printing workflow in OOo (simplified)&lt;/div&gt;</summary>
		<author><name>Ybart</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Talk:Mac_OS_X_Porting_-_Native_Printing&amp;diff=19029</id>
		<title>Talk:Mac OS X Porting - Native Printing</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Talk:Mac_OS_X_Porting_-_Native_Printing&amp;diff=19029"/>
		<updated>2006-10-18T20:11:19Z</updated>

		<summary type="html">&lt;p&gt;Ybart: &lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Notes on Printing pages =&lt;br /&gt;
These items might be useful but might not. I add them here just for further reference.&lt;br /&gt;
&lt;br /&gt;
== Star Writer printing related files  and class ==&lt;br /&gt;
=== SwDocShell class - docsh.hxx, docsh.cxx, docsh2.cxx ===&lt;br /&gt;
The UI-related class SwDocShell contains :&lt;br /&gt;
* Printer *SwDocShell::GetDocumentPrinter() which returns an instance of printer associated to the SwDocShell instance.&lt;br /&gt;
* void SwDocShell::OnDocumentPrinterChanged( Printer * pNewPrinter ) which sets the JobSetup or the Printer of the Document associated with the shell using GetDoc()&lt;br /&gt;
&lt;br /&gt;
=== SwDoc class - doc.hxx ===&lt;br /&gt;
* This class contains a SfxPrinter instance.&lt;br /&gt;
* void PrtDataChanged(); (used to update the class when modifying the print setup)&lt;br /&gt;
*    /** IDocumentDeviceAccess */&lt;br /&gt;
    virtual SfxPrinter* getPrinter(/*[in]*/ bool bCreate ) const;&lt;br /&gt;
    virtual void setPrinter(/*[in]*/ SfxPrinter* pP,/*[in]*/ bool bDeleteOld,/*[in]*/ bool bCallPrtDataChanged );&lt;br /&gt;
    virtual VirtualDevice* getVirtualDevice(/*[in]*/ bool bCreate ) const;&lt;br /&gt;
    virtual void setVirtualDevice(/*[in]*/ VirtualDevice* pVd,/*[in]*/ bool bDeleteOld, /*[in]*/ bool bCallVirDevDataChanged );&lt;br /&gt;
    virtual OutputDevice* getReferenceDevice(/*[in]*/ bool bCreate ) const;&lt;br /&gt;
    virtual void setReferenceDeviceType(/*[in]*/ bool bNewVirtual,/*[in]*/ bool bNewHiRes );&lt;br /&gt;
    virtual const JobSetup* getJobsetup() const;&lt;br /&gt;
    virtual void setJobsetup(/*[in]*/ const JobSetup&amp;amp; rJobSetup );&lt;br /&gt;
    virtual SwPrintData* getPrintData() const;&lt;br /&gt;
    virtual void setPrintData(/*[in]*/ const SwPrintData&amp;amp; rPrtData);&lt;br /&gt;
&lt;br /&gt;
=== SwPrtOptions class - prtopt.hxx ===&lt;br /&gt;
Herits of SwPrintData, utl::ConfigItem&lt;br /&gt;
Options set for OOo to know what to print.&lt;br /&gt;
&lt;br /&gt;
=== ViewShell class - viewsh.hxx, vprint.cxx ===&lt;br /&gt;
    // 1. GetRefDev:   Either the printer or the virtual device from the doc&lt;br /&gt;
    // 2. GetWin:      Available if we not printing&lt;br /&gt;
    // 3. GetOut:      Printer, Window or Virtual device&lt;br /&gt;
    OutputDevice&amp;amp; GetRefDev() const;&lt;br /&gt;
    inline Window* GetWin()    const { return pWin; }&lt;br /&gt;
    inline OutputDevice* GetOut()     const { return pOut; }&lt;br /&gt;
&lt;br /&gt;
* void InitPrt( SfxPrinter * , OutputDevice *pPDFOut = NULL );&lt;br /&gt;
* sal_Bool Prt( SwPrtOptions&amp;amp; rOptions, SfxProgress* pProgress, OutputDevice* pPDFOut = NULL );&lt;br /&gt;
* SwDoc * CreatePrtDoc( SfxPrinter* pPrt, SfxObjectShellRef&amp;amp; );&lt;br /&gt;
* SwDoc * FillPrtDoc( SwDoc* pPrtDoc, const SfxPrinter* pPrt );&lt;br /&gt;
* void PrintPreViewPage( SwPrtOptions&amp;amp; rOptions, sal_uInt16 nRowCol, SfxProgress&amp;amp; rProgress, const SwPagePreViewPrtData* = 0 ); NOT only for preview !!!&lt;br /&gt;
* void PrepareForPrint( const SwPrtOptions &amp;amp;rOptions );&lt;br /&gt;
&lt;br /&gt;
=== SwViewImp class - viewimp.hxx ===&lt;br /&gt;
Only for print preview.&lt;br /&gt;
&lt;br /&gt;
=== SwPagePreview - pview.hxx ===&lt;br /&gt;
Only for print preview.&lt;br /&gt;
&lt;br /&gt;
=== SwView ---&amp;gt; SfxViewShell - view.hxx ===&lt;br /&gt;
* SfxPrinter* 	GetPrinter( BOOL bCreate = FALSE );&lt;br /&gt;
* PrintDialog*	CreatePrintDialog( Window* pParent );&lt;br /&gt;
* SfxTabPage* 	CreatePrintOptionsPage( Window* pParent, const SfxItemSet&amp;amp; rSet);&lt;br /&gt;
* USHORT			SetPrinter(	SfxPrinter* pNew, USHORT nDiff = SFX_PRINTER_ALL);&lt;br /&gt;
* ErrCode			DoPrint( SfxPrinter *pPrinter, PrintDialog *pPrintDialog, BOOL bSilent );&lt;br /&gt;
* ExecutePrint(SfxRequest&amp;amp;);&lt;br /&gt;
* static void MakeOptions( PrintDialog* pDlg, SwPrtOptions&amp;amp; rOpts, BOOL* pPrtProspect, BOOL bWeb, SfxPrinter* pPrt, SwPrintData* pData );&lt;br /&gt;
&lt;br /&gt;
=== May be useful ===&lt;br /&gt;
* SwBaseShell - basesh.hxx&lt;br /&gt;
* SwDrawShell -&amp;gt; SwDrawBaseShell - drawsh.hxx&lt;br /&gt;
* SwDrawBaseShell - drwbassh.hxx&lt;br /&gt;
&lt;br /&gt;
TODO : See where the graphic context is used...&lt;/div&gt;</summary>
		<author><name>Ybart</name></author>
	</entry>
	<entry>
		<id>https://wiki.openoffice.org/w/index.php?title=Talk:Mac_OS_X_Porting_-_Native_Printing&amp;diff=19027</id>
		<title>Talk:Mac OS X Porting - Native Printing</title>
		<link rel="alternate" type="text/html" href="https://wiki.openoffice.org/w/index.php?title=Talk:Mac_OS_X_Porting_-_Native_Printing&amp;diff=19027"/>
		<updated>2006-10-18T20:04:13Z</updated>

		<summary type="html">&lt;p&gt;Ybart: Adding sw print information&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;= Notes on Printing pages =&lt;br /&gt;
These items might be useful but might not. I add them here just for further reference.&lt;br /&gt;
&lt;br /&gt;
== Star Writer printing related files  and class ==&lt;br /&gt;
=== SwDocShell class - docsh.hxx, docsh.cxx, docsh2.cxx ===&lt;br /&gt;
The UI-related class SwDocShell contains :&lt;br /&gt;
* Printer *SwDocShell::GetDocumentPrinter() which returns an instance of printer associated to the SwDocShell instance.&lt;br /&gt;
* void SwDocShell::OnDocumentPrinterChanged( Printer * pNewPrinter ) which sets the JobSetup or the Printer of the Document associated with the shell using GetDoc()&lt;br /&gt;
&lt;br /&gt;
=== SwDoc class - doc.hxx ===&lt;br /&gt;
* This class contains a SfxPrinter instance.&lt;br /&gt;
* void PrtDataChanged(); (used to update the class when modifying the print setup)&lt;br /&gt;
*    /** IDocumentDeviceAccess */&lt;br /&gt;
    virtual SfxPrinter* getPrinter(/*[in]*/ bool bCreate ) const;&lt;br /&gt;
    virtual void setPrinter(/*[in]*/ SfxPrinter* pP,/*[in]*/ bool bDeleteOld,/*[in]*/ bool bCallPrtDataChanged );&lt;br /&gt;
    virtual VirtualDevice* getVirtualDevice(/*[in]*/ bool bCreate ) const;&lt;br /&gt;
    virtual void setVirtualDevice(/*[in]*/ VirtualDevice* pVd,/*[in]*/ bool bDeleteOld, /*[in]*/ bool bCallVirDevDataChanged );&lt;br /&gt;
    virtual OutputDevice* getReferenceDevice(/*[in]*/ bool bCreate ) const;&lt;br /&gt;
    virtual void setReferenceDeviceType(/*[in]*/ bool bNewVirtual,/*[in]*/ bool bNewHiRes );&lt;br /&gt;
    virtual const JobSetup* getJobsetup() const;&lt;br /&gt;
    virtual void setJobsetup(/*[in]*/ const JobSetup&amp;amp; rJobSetup );&lt;br /&gt;
    virtual SwPrintData* getPrintData() const;&lt;br /&gt;
    virtual void setPrintData(/*[in]*/ const SwPrintData&amp;amp; rPrtData);&lt;br /&gt;
&lt;br /&gt;
=== SwPrtOptions class - prtopt.hxx ===&lt;br /&gt;
Herits of SwPrintData, utl::ConfigItem&lt;br /&gt;
Options set for OOo to know what to print.&lt;br /&gt;
&lt;br /&gt;
=== ViewShell class - viewsh.hxx, vprint.cxx ===&lt;br /&gt;
    // 1. GetRefDev:   Either the printer or the virtual device from the doc&lt;br /&gt;
    // 2. GetWin:      Available if we not printing&lt;br /&gt;
    // 3. GetOut:      Printer, Window or Virtual device&lt;br /&gt;
    OutputDevice&amp;amp; GetRefDev() const;&lt;br /&gt;
    inline Window* GetWin()    const { return pWin; }&lt;br /&gt;
    inline OutputDevice* GetOut()     const { return pOut; }&lt;br /&gt;
&lt;br /&gt;
* void InitPrt( SfxPrinter * , OutputDevice *pPDFOut = NULL );&lt;br /&gt;
* sal_Bool Prt( SwPrtOptions&amp;amp; rOptions, SfxProgress* pProgress, OutputDevice* pPDFOut = NULL );&lt;br /&gt;
* SwDoc * CreatePrtDoc( SfxPrinter* pPrt, SfxObjectShellRef&amp;amp; );&lt;br /&gt;
* SwDoc * FillPrtDoc( SwDoc* pPrtDoc, const SfxPrinter* pPrt );&lt;br /&gt;
* void PrintPreViewPage( SwPrtOptions&amp;amp; rOptions, sal_uInt16 nRowCol, SfxProgress&amp;amp; rProgress, const SwPagePreViewPrtData* = 0 ); NOT only for preview !!!&lt;br /&gt;
* void PrepareForPrint( const SwPrtOptions &amp;amp;rOptions );&lt;br /&gt;
&lt;br /&gt;
=== SwViewImp class - viewimp.hxx ===&lt;br /&gt;
Only for print preview.&lt;br /&gt;
&lt;br /&gt;
=== SwPagePreview - pview.hxx ===&lt;br /&gt;
Only for print preview.&lt;br /&gt;
&lt;br /&gt;
=== SwView ---&amp;gt; SfxViewShell - view.hxx ===&lt;br /&gt;
* SfxPrinter* 	GetPrinter( BOOL bCreate = FALSE );&lt;br /&gt;
* PrintDialog*	CreatePrintDialog( Window* pParent );&lt;br /&gt;
* SfxTabPage* 	CreatePrintOptionsPage( Window* pParent, const SfxItemSet&amp;amp; rSet);&lt;br /&gt;
* USHORT			SetPrinter(	SfxPrinter* pNew, USHORT nDiff = SFX_PRINTER_ALL);&lt;br /&gt;
* ErrCode			DoPrint( SfxPrinter *pPrinter, PrintDialog *pPrintDialog, BOOL bSilent );&lt;br /&gt;
* ExecutePrint(SfxRequest&amp;amp;);&lt;br /&gt;
* static void MakeOptions( PrintDialog* pDlg, SwPrtOptions&amp;amp; rOpts, BOOL* pPrtProspect, BOOL bWeb, SfxPrinter* pPrt, SwPrintData* pData );&lt;br /&gt;
&lt;br /&gt;
=== May be useful ===&lt;br /&gt;
* SwBaseShell - basesh.hxx&lt;br /&gt;
* SwDrawShell -&amp;gt; SwDrawBaseShell - drawsh.hxx&lt;br /&gt;
* SwDrawBaseShell - drwbassh.hxx&lt;/div&gt;</summary>
		<author><name>Ybart</name></author>
	</entry>
</feed>