Sophie

Sophie

distrib > Mandriva > 2010.0 > i586 > media > contrib-release > by-pkgid > a6711891ce757817bba854bf3f25205a > files > 2422

qtjambi-doc-4.3.3-3mdv2008.1.i586.rpm

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<!-- /home/gvatteka/dev/qt-4.3/doc/src/emb-porting.qdoc -->
<head>
  <title>Porting Qtopia Core to Another Operating System</title>
  <link href="classic.css" rel="stylesheet" type="text/css" />
</head>
<body>
<h1 align="center">Porting Qtopia Core to Another Operating System<br /><small></small></h1>
<p>Qtopia Core</tt> is reasonably platform-independent, making use of the standard C library and some POSIX functions, but only a Linux implementation is publically available. If you are looking for a non-Linux commercial implementation, it is worth contacting <a href="mailto:sales@trolltech.com">sales@trolltech.com</tt></a> to see if we can help.</p>
<p>There are several issues to be aware of if you plan to do your own port to another operating system. In particular you must resolve Qtopia Core</tt>'s shared memory and semaphores (used to share window regions), and you must provide something similar to Unix-domain sockets for inter-application communication. You must also provide a screen driver, and if you want to implement sound you must provide your own sound server. Finally you must modify Qtopia Core</tt>'s event dispatcher.</p>
<p>Contents:</p>
<ul><li><a href="#shared-memory-and-semaphores">Shared Memory and Semaphores</a></li>
<li><a href="#inter-application-communication">Inter-Application Communication</a></li>
<li><a href="#screen-management">Screen Management</a></li>
<li><a href="#sound-management">Sound Management</a></li>
<li><a href="#event-dispatching">Event Dispatching</a></li>
</ul>
<a name="shared-memory-and-semaphores"></a>
<h2>Shared Memory and Semaphores</h2>
<p>Qtopia Core</tt> uses System V IPC (shared memory and semaphores) to share window regions between client and server. When porting, something similar must be provided; otherwise it will not be possible to run multiple applications.</p>
<p>System V semaphores are also used for synchronizing access to the framebuffer.</p>
<ul>
<li>Modify <tt>qsharedmemory_p.cpp</tt></li>
<li>Modify <tt>qlock_qws.cpp</tt></li>
<li>Modify <tt>qwslock.cpp</tt></li>
</ul>
<a name="inter-application-communication"></a>
<h2>Inter-Application Communication</h2>
<p>To communicate between applications, Qtopia Core</tt> uses the Unix-domain sockets. When porting, something similar must be provided; otherwise it will not be possible to run multiple applications.</p>
<p>It should be possible to use message queues or similar mechanisms to achieve this. With the exception of QCOP messages, individual messages should be no more than a few bytes in length (QCOP messages are generated by the client applications and not Qtopia Core).</p>
<ul>
<li>Modify <tt>qwssocket_qws.cpp</tt></li>
</ul>
<a name="screen-management"></a>
<h2>Screen Management</h2>
<p>When rendering, Qtopia Core</tt>'s default behavior is for each client to render its widgets into memory while the server is responsible for putting the contents of the memory onto the screen using the screen driver.</p>
<p>When porting, a new screen driver must be implemented, providing a byte pointer to a memory-mapped framebuffer and information about width, height and bit depth (the latter information can most likely be hard-coded).</p>
<ul>
<li>Reimplement <tt>qscreen_qws.cpp</tt></li>
</ul>
<a name="sound-management"></a>
<h2>Sound Management</h2>
<p>To implement sound, Qtopia Core</tt> uses a Linux style device (<tt>/dev/dsp</tt>). If you want to use the Qtopia Core</tt> sound server on another platform you must reimplement it.</p>
<ul>
<li>Reimplement <tt>qsoundqss_qws.cpp</tt></li>
</ul>
<a name="event-dispatching"></a>
<h2>Event Dispatching</h2>
<p>Qtopia Core</tt> uses an event dispatcher to pass events to and from the Qtopia Core</tt> server application. Reimplement the <tt>select()</tt> function to enable Qtopia Core</tt> to dispatch events on your platform.</p>
<ul>
<li>Modify <tt>qeventdispatcher_qws.cpp</tt></li>
</ul>
<p /><address><hr /><div align="center">
<table width="100%" cellspacing="0" border="0"><tr class="address">
<td width="30%">Copyright &copy; 2007 <a href="trolltech.html">Trolltech</a></td>
<td width="40%" align="center"><a href="trademarks.html">Trademarks</a></td>
<td width="30%" align="right"><div align="right">Qt Jambi </div></td>
</tr></table></div></address></body>
</html>