blob: b690ef8532fdaf1f3cab6eb83c4034ba87f1d2fb [file] [log] [blame]
<?php require_once($_SERVER['DOCUMENT_ROOT'] . "/eclipse.org-common/system/app.class.php"); require_once($_SERVER['DOCUMENT_ROOT'] . "/eclipse.org-common/system/nav.class.php"); require_once($_SERVER['DOCUMENT_ROOT'] . "/eclipse.org-common/system/menu.class.php"); $App = new App(); $Nav = new Nav(); $Menu = new Menu(); include($App->getProjectCommon());
$pageTitle = "Generating the SWT PI Code for Cocoa";
ob_start();
?>
<div id="midcolumn">
<h1>Generating the SWT PI Code for Cocoa</h1>
<p>Most of the platform interface and C code used by SWT on the Mac/Cocoa port is generated by the <b>MacGeneratorUI</b>
class included in the SWT Tools plugin available on the <a href="updatesite.php">SWT Tools Update Sites</a>. This page
describes how to use this tool when fixing bugs or adding features to SWT for cocoa.</p>
<h3>Installing the plugin</h3>
<ol>
<li>Install the plugin using the <a href="updatesite.php">SWT Tools Update Site</a>.
<p></p>
<li>Restart Eclipse and show the view <b>Mac Generator</b> from the <b>SWT Tools</b> category.
<p></p>
</ol>
<h3>Using the tool</h3>
<ol>
<li>The tool shows a list of Mac frameworks on the left side.
<p></p>
<p></p>
<center><img src="images/macgen.jpg" alt="MacGeneratorUI"></center>
<p></p>
<li>Items from the list can be checked to be generated.
<p></p>
<li>Once the desired items are checked, press the generate tool bar button to generate
all the necessary JNI code. This includes the java binding for Cocoa classes,
the C source for the JNI Natives and also supporting files for the tool. All files are under
<tt>Eclipse SWT PI/cocoa</tt> directory and if appropriate should be released.
<p></p>
<li>Compile the new C code.
<p><b> On Eclipse 3.5.1 and newer releases:</b></p>
To compile the code, right-click on the <tt>build.xml</tt> file in the
<tt>tasks</tt> directory, and choose
<i>"Run As -> Ant Build..."</i>. Select the JRE tab, and check "Run in the same JRE as the workspace".
Select the Targets tab, and check <b>build_cocoa_x86_and_ppc</b> or <b>build_cocoa_x86_64</b> according to
platform you wish to target. See the instructions at the beginning of the build.xml file for more
information.
<center><img src="images/buildxml2.png" alt="build.xml"></center>
<p></p>
<p><b> On Eclipse 3.5 and older releases:</b></p>
To compile the code, right-click on the <tt>build.xml</tt> file in the
<tt>Eclipse SWT PI/cocoa/library</tt> directory, and choose
<i>"Run As -> Ant Build..."</i>. Select the JRE tab, and check "Run in the same JRE as the workspace".
Select the Refresh tab, and check "Refresh resources upon completion" to refresh your workspace
after running the build to ensure Eclipse picks up the fresh binaries. Now select the "Run" button.
<p></p>
<center><img src="images/buildxml.png" alt="build.xml"></center>
<p></p>
<p></p>
</ol>
</div>
<?php
$html = ob_get_clean();
# Generate the web page
$App->generatePage($theme, $Menu, $Nav, $pageAuthor, $pageKeywords, $pageTitle, $html);
?>