ch03.sgm 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289
  1. <!-- $XConsortium: ch03.sgm /main/9 1996/09/08 19:46:41 rws $ -->
  2. <!-- (c) Copyright 1995 Digital Equipment Corporation. -->
  3. <!-- (c) Copyright 1995 Hewlett-Packard Company. -->
  4. <!-- (c) Copyright 1995 International Business Machines Corp. -->
  5. <!-- (c) Copyright 1995 Sun Microsystems, Inc. -->
  6. <!-- (c) Copyright 1995 Novell, Inc. -->
  7. <!-- (c) Copyright 1995 FUJITSU LIMITED. -->
  8. <!-- (c) Copyright 1995 Hitachi. -->
  9. <chapter id="RDMAP.devap.div.1">
  10. <title id="RDMAP.devap.mkr.1">Developing an Application</title>
  11. <para>This chapter presents information specific to developing a Common Desktop
  12. Environment application, such as naming conventions and other guidelines.
  13. It introduces levels of integration, which are the guidelines for determining
  14. the desktop functionality to incorporate into your application to make it
  15. increasingly integrated with the desktop. It also provides an overview of
  16. the Application Builder, a tool to simplify Common Desktop Environment application
  17. development.</para>
  18. <informaltable id="RDMAP.devap.itbl.1" frame="All">
  19. <tgroup cols="1">
  20. <colspec colname="1" colwidth="4.0 in">
  21. <tbody>
  22. <row rowsep="1">
  23. <entry><para><!--Original XRef content: 'Levels of Desktop Integration32'--><xref
  24. role="JumpText" linkend="RDMAP.devap.mkr.2"></para></entry></row>
  25. <row rowsep="1">
  26. <entry><para><!--Original XRef content: 'Desktop Naming Conventions32'--><xref
  27. role="JumpText" linkend="RDMAP.devap.mkr.3"></para></entry></row>
  28. <row rowsep="1">
  29. <entry><para><!--Original XRef content: 'Public and Private Interfaces33'--><xref
  30. role="JumpText" linkend="RDMAP.devap.mkr.6"></para></entry></row>
  31. <row rowsep="1">
  32. <entry><para><!--Original XRef content: 'Guidelines for Common Desktop Environment
  33. Databases34'--><xref role="JumpText" linkend="RDMAP.devap.mkr.7"></para></entry>
  34. </row>
  35. <row rowsep="1">
  36. <entry><para><!--Original XRef content: 'Application Initialization and libDtSvc34'--><xref
  37. role="JumpText" linkend="RDMAP.devap.mkr.8"></para></entry></row>
  38. <row rowsep="1">
  39. <entry><para><!--Original XRef content: 'Application Builder34'--><xref role="JumpText"
  40. linkend="RDMAP.devap.mkr.9"></para></entry></row></tbody></tgroup></informaltable>
  41. <sect1 id="RDMAP.devap.div.2">
  42. <title id="RDMAP.devap.mkr.2">Levels of Desktop Integration<indexterm><primary>desktop</primary><secondary>integration, levels of</secondary></indexterm><indexterm>
  43. <primary>integration</primary><secondary>levels of</secondary></indexterm><indexterm>
  44. <primary>application development</primary><secondary>levels of integration</secondary></indexterm></title>
  45. <para>Users can run any<indexterm><primary>X-based applications</primary>
  46. </indexterm> X11-based application from a shell command line in the Common
  47. Desktop Environment. If you want to integrate your application into the desktop,
  48. however, there are guidelines for you to follow. The Common Desktop Environment
  49. defines three levels of integration to give you maximum flexibility in designing
  50. your application or porting an existing application:</para>
  51. <itemizedlist remap="Bullet1"><listitem><para><emphasis>Basic Integration</emphasis> &mdash;Enables your application to be launched from the desktop.
  52. You do <emphasis>not</emphasis> need to change your application code to perform
  53. basic integration. See <!--Original XRef content: 'Chapter&numsp;5, &xd2;Basic
  54. Application Integration'--><xref role="ChapNumAndTitle" linkend="RDMAP.BIntg.mkr.1">,
  55. for more information.<indexterm><primary>basic integration</primary></indexterm><indexterm>
  56. <primary>levels of integration</primary><secondary>basic</secondary></indexterm></para>
  57. </listitem><listitem><para><emphasis>Recommended Integration</emphasis>&mdash;Enables
  58. your application to enhance its level of consistency with the desktop. See
  59. <!--Original XRef content: 'Chapter&numsp;6, &xd2;Recommended Integration'--><xref
  60. role="ChapNumAndTitle" linkend="RDMAP.recin.mkr.1">, for more information.<indexterm>
  61. <primary>recommended integration</primary></indexterm><indexterm><primary>levels of integration</primary><secondary>recommended</secondary></indexterm></para>
  62. </listitem><listitem><para><emphasis>Optional Integration</emphasis>&mdash;Enables
  63. you to leverage services provided by the desktop for achieving specialized
  64. tasks. See <!--Original XRef content: 'Chapter&numsp;7, &xd2;Optional
  65. Integration'--><xref role="ChapNumAndTitle" linkend="RDMAP.optin.mkr.1">,
  66. for more information.<indexterm><primary>optional integration</primary></indexterm><indexterm>
  67. <primary>levels of integration</primary><secondary>optional</secondary>
  68. </indexterm></para>
  69. </listitem></itemizedlist>
  70. <para>For more information on all three levels of integration, see the <emphasis>Programmer's Guide.</emphasis> Basic Integration is also discussed in the <emphasis>Advanced User's and System Administrator's Guide</emphasis>.</para>
  71. </sect1>
  72. <sect1 id="RDMAP.devap.div.3">
  73. <title id="RDMAP.devap.mkr.3">Desktop Naming Conventions<indexterm><primary>desktop</primary><secondary>naming conventions</secondary></indexterm><indexterm>
  74. <primary>naming conventions</primary><secondary>desktop</secondary></indexterm><indexterm>
  75. <primary>conventions, desktop naming</primary></indexterm><indexterm><primary>application development</primary><secondary>desktop naming conventions &lt;$startrange></secondary></indexterm></title>
  76. <para>The Common Desktop Environment uses naming conventions similar to those
  77. used by X and Motif. Desktop clients, desktop libraries, and other desktop
  78. components share a common prefix for externally visible names: <command>dt</command>, <command>Dt</command>, or <command>DT</command>. Private desktop
  79. structures, functions, and defines (found in the Common Desktop Environment
  80. code; not for developer use) have an <filename>_dt</filename>, <filename>_Dt</filename>, or <filename>_DT</filename> prefix. <!--Original XRef content:
  81. 'Table&numsp;3&hyphen;1'--><xref role="CodeOrFigureOrTable" linkend="RDMAP.devap.mkr.4">
  82. lists the desktop naming conventions.</para>
  83. <table id="RDMAP.devap.tbl.1" frame="Topbot">
  84. <title id="RDMAP.devap.mkr.4">Desktop Naming Conventions</title>
  85. <tgroup cols="3" colsep="0" rowsep="0">
  86. <?PubTbl tgroup dispwid="6.69in">
  87. <colspec colwidth="207*">
  88. <colspec colwidth="83*">
  89. <colspec colwidth="262*">
  90. <thead>
  91. <row><entry align="left" valign="bottom"><para><literal>Name</literal></para></entry>
  92. <entry align="left" valign="bottom"><para><literal>Prefix</literal></para></entry>
  93. <entry align="left" valign="bottom"><para><literal>Example</literal></para></entry>
  94. </row></thead>
  95. <tbody>
  96. <row>
  97. <entry align="left" valign="top"><para>Desktop clients and utilities</para></entry>
  98. <entry align="left" valign="top"><para><command>dt</command></para></entry>
  99. <entry align="left" valign="top"><para><command>dthelpview</command></para></entry>
  100. </row>
  101. <row>
  102. <entry align="left" valign="top"><para>Resource names and classes</para></entry>
  103. <entry align="left" valign="top"><para><command>Dt</command></para></entry>
  104. <entry align="left" valign="top"><para><command>DtNhelpType, DtCHelpType</command></para></entry>
  105. </row>
  106. <row>
  107. <entry align="left" valign="top"><para>Library names</para></entry>
  108. <entry align="left" valign="top"><para><command>Dt</command></para></entry>
  109. <entry align="left" valign="top"><para><command>libDtHelp</command></para></entry>
  110. </row>
  111. <row>
  112. <entry align="left" valign="top"><para>Include references</para></entry>
  113. <entry align="left" valign="top"><para><command>Dt</command></para></entry>
  114. <entry align="left" valign="top"><para><command>#include &lt;Dt/Help.h></command>
  115. </para></entry></row>
  116. <row>
  117. <entry align="left" valign="top"><para>Public function names</para></entry>
  118. <entry align="left" valign="top"><para><command>Dt</command></para></entry>
  119. <entry align="left" valign="top"><para><command>DtCreateHelpDialog</command></para></entry>
  120. </row>
  121. <row>
  122. <entry align="left" valign="top"><para>Public data structure names</para></entry>
  123. <entry align="left" valign="top"><para><command>Dt</command></para></entry>
  124. <entry align="left" valign="top"><para><command>DtHelpDialogCallbackStruct</command></para></entry></row>
  125. <row>
  126. <entry align="left" valign="top"><para>Constant names</para></entry>
  127. <entry align="left" valign="top"><para><command>Dt</command></para></entry>
  128. <entry align="left" valign="top"><para><filename>DtHELP_NEW_WINDOW</filename></para></entry>
  129. </row>
  130. <row>
  131. <entry align="left" valign="top"><para>Environment variables</para></entry>
  132. <entry align="left" valign="top"><para><command>DT</command></para></entry>
  133. <entry align="left" valign="top"><para><command>DTHELPSEARCHPATH</command></para></entry>
  134. </row>
  135. <row>
  136. <entry align="left" valign="top"><para>Private desktop symbols (structures,
  137. functions, defines)</para></entry>
  138. <entry align="left" valign="top"><para><filename>_dt</filename>, <filename>_Dt</filename>, <filename>_DT</filename></para></entry>
  139. <entry align="left" valign="top"><para><command>_DtHelpFunction, _DtHELP_DEFINE</command></para></entry></row></tbody></tgroup></table>
  140. <para><!--Original XRef content: 'Table&numsp;3&hyphen;2'--><xref role="CodeOrFigureOrTable"
  141. linkend="RDMAP.devap.mkr.5"> lists the exceptions to the preceding naming
  142. conventions.</para>
  143. <table id="rdmap.devap.tbl.2" frame="topbot">
  144. <title id="rdmap.devap.mkr.5">Exceptions to Desktop Naming Conventions</title>
  145. <tgroup cols="3" colsep="0" rowsep="0">
  146. <?PubTbl tgroup dispwid="6.74in">
  147. <colspec colwidth="207*">
  148. <colspec colwidth="189*">
  149. <colspec colwidth="160*">
  150. <thead>
  151. <row><entry align="left" valign="bottom"><para><literal>Name</literal></para></entry>
  152. <entry align="left" valign="bottom"><para><literal>Prefix</literal></para></entry>
  153. <entry align="left" valign="bottom"><para><literal>Example</literal></para></entry>
  154. </row></thead>
  155. <tbody>
  156. <row>
  157. <entry align="left" valign="top"><para>Common Desktop Environment Motif<indexterm>
  158. <primary>Motif</primary></indexterm></para></entry>
  159. <entry align="left" valign="top"><para><command>Xm</command></para></entry>
  160. <entry align="left" valign="top"><para><command>XmCreateLabel</command></para></entry>
  161. </row>
  162. <row>
  163. <entry align="left" valign="top"><para><command>dtksh</command> Convenience
  164. Functions</para></entry>
  165. <entry align="left" valign="top"><para><command>Dtksh</command></para></entry>
  166. <entry align="left" valign="top"><para><command>DtkshAddButtons</command></para></entry>
  167. </row>
  168. <row>
  169. <entry align="left" valign="top"><para>ToolTalk Messaging Service<indexterm>
  170. <primary>ToolTalk Messaging Service</primary></indexterm></para></entry>
  171. <entry align="left" valign="top"><para>tt (for functions), Tt (for typedefs),
  172. TT (for constants)</para></entry>
  173. <entry align="left" valign="top"><para><filename>tt_open</filename>, Tt_message,
  174. TT_NOTICE</para></entry></row>
  175. <row>
  176. <entry align="left" valign="top"><para><indexterm><primary>X11R6.2</primary>
  177. </indexterm>X11R6.2</para></entry>
  178. <entry align="left" valign="top"><para><command>X</command>, <command>Xt</command></para></entry>
  179. <entry align="left" valign="top"><para><command>XOpenDisplay, XtCreateWidget</command></para></entry></row></tbody></tgroup></table>
  180. <caution>
  181. <para>Do <emphasis>not</emphasis> use the prefixes <command>dt</command>, <command>Dt</command>, <command>DT</command>, <filename>_dt</filename>, <filename>_Dt</filename>, <filename>_DT</filename>, <command>Xm</command>, <command>tt</command>, <command>Tt</command>, <command>TT</command>, <command>X</command>,
  182. or <command>Xt</command> to define new symbols in your application code.
  183. If you do, you might define one that has already been defined&mdash;or might
  184. be defined in the future&mdash;in the Common Desktop Environment, ToolTalk,
  185. X11, or Motif code.<indexterm><primary>naming conventions</primary><secondary>caution notice</secondary></indexterm><indexterm><primary>desktop</primary>
  186. <secondary>naming conventions</secondary></indexterm><indexterm><primary>naming conventions</primary><secondary>desktop</secondary></indexterm><indexterm>
  187. <primary>conventions, desktop naming</primary></indexterm><indexterm><primary>application development</primary><secondary>desktop naming conventions &lt;$endrange></secondary></indexterm></para>
  188. </caution>
  189. </sect1>
  190. <sect1 id="RDMAP.devap.div.4">
  191. <title id="RDMAP.devap.mkr.6">Public and Private Interfaces<indexterm><primary>public interfaces</primary></indexterm><indexterm><primary>private interfaces</primary></indexterm><indexterm><primary>interfaces</primary><secondary>private</secondary></indexterm><indexterm><primary>interfaces</primary><secondary>public</secondary></indexterm><indexterm><primary>application development</primary><secondary>public and private interfaces</secondary></indexterm></title>
  192. <para>If a Common Desktop Environment interface is documented in the man pages
  193. or the Common Desktop Environment documentation set, you can assume that
  194. the interface is public unless otherwise stated. An interface is not necessarily
  195. public just because it has a header file associated with it. Interfaces that
  196. are not documented are private to the Common Desktop Environment and are
  197. subject to change without notice.</para>
  198. </sect1>
  199. <sect1 id="RDMAP.devap.div.5">
  200. <title id="RDMAP.devap.mkr.7">Guidelines for Common Desktop Environment Databases<indexterm>
  201. <primary>guidelines</primary><secondary>database syntax</secondary></indexterm><indexterm>
  202. <primary>database</primary><secondary>syntax</secondary></indexterm><indexterm>
  203. <primary>syntax, for databases</primary></indexterm><indexterm><primary>application development</primary><secondary>databases, guidelines for</secondary>
  204. </indexterm></title>
  205. <para>You can find the syntax for the desktop databases, such as those used
  206. for actions and data types, in man pages located in the <filename>/usr/dt/man/man4</filename> directory.</para>
  207. <para>For more information on databases, see the <emphasis>Programmer's Guide</emphasis>.</para>
  208. </sect1>
  209. <sect1 id="RDMAP.devap.div.6">
  210. <title id="RDMAP.devap.mkr.8">Application Initialization and libDtSvc<indexterm>
  211. <primary>application development</primary><secondary>initialization and libDtSvc</secondary></indexterm><indexterm><primary>desktop</primary><secondary>libDtSvc and application initialization</secondary></indexterm></title>
  212. <para>If your application uses any of the <command>libDtSvc</command> APIs
  213. (for actions, data typing, drag and drop, Session Manager, or Workspace Manager),
  214. it must first initialize the <command>libDtSvc</command> library by calling
  215. either <filename>DtInitialize()</filename><indexterm><primary>DtInitialize()</primary></indexterm> or <filename>DtAppInitialize()</filename><indexterm>
  216. <primary>DtAppInitialize()</primary></indexterm>. Refer to the <filename>DtInitialize</filename>(3) or <filename>DtAppInitialize</filename>(3) man
  217. page for more information.</para>
  218. </sect1>
  219. <sect1 id="RDMAP.devap.div.7">
  220. <title id="RDMAP.devap.mkr.9">Application Builder<indexterm><primary>application
  221. development</primary><secondary>Application Builder &lt;$startrange></secondary></indexterm></title>
  222. <para>Application Builder (App Builder) is a tool that enables you to easily
  223. create the graphical user interface (GUI) for Common Desktop Environment
  224. applications, without having to write code to call the desktop application
  225. program interfaces (APIs). It abstracts the Motif toolkit into simple object
  226. palettes and object property sheets. You can use App Builder to construct
  227. a wide range of applications, from simple GUI-based programs to complex,
  228. integrated systems. It supports User Interface Language (UIL) file import
  229. and export to enable you to migrate your application among other Motif-based
  230. tools and products.<indexterm><primary>Application Builder</primary><secondary>App Builder</secondary></indexterm><indexterm><primary>App Builder (Application
  231. Builder)</primary></indexterm></para>
  232. <para>App Builder is ideally suited for use if you:<indexterm><primary>Application
  233. Builder</primary><secondary>when to use</secondary></indexterm></para>
  234. <itemizedlist remap="Bullet1"><listitem><para>Are not an expert Motif programmer
  235. </para>
  236. </listitem><listitem><para>Are not familiar with the Common Desktop Environment
  237. Motif widgets</para>
  238. </listitem><listitem><para>Are not familiar with the desktop services (for
  239. example,<indexterm><primary>drag and drop</primary></indexterm> drag and
  240. drop,<indexterm><primary>ToolTalk Messaging Service</primary></indexterm> ToolTalk
  241. messaging,<indexterm><primary>Session Manager</primary></indexterm> sessioning,<indexterm><primary>Help system</primary></indexterm>
  242. help, and<indexterm>
  243. <primary>internationalization</primary></indexterm> internationalization)</para>
  244. </listitem><listitem><para>Want to build your application user interface quickly
  245. and be able to change it easily</para>
  246. </listitem><listitem><para>Are working collaboratively with other people to
  247. build a single application</para>
  248. </listitem></itemizedlist>
  249. <para>In fact, even if you do not fit into any of the preceding categories,
  250. you will likely find App Builder to be appropriate and helpful for your application
  251. development.</para>
  252. <para>Using App Builder, you can:</para>
  253. <itemizedlist remap="Bullet1"><listitem><para>Lay out the user interface for
  254. an application, constructing it piece-by-piece from a collection of objects
  255. from the Common Desktop Environment<indexterm><primary>Motif</primary></indexterm> Motif
  256. toolkit</para>
  257. </listitem><listitem><para>Define connections between objects to provide application
  258. GUI behavior, then use the test mode that enables connections to be tested
  259. </para>
  260. </listitem><listitem><para>Add some of the desktop services functionality
  261. to your application</para>
  262. </listitem><listitem><para>Edit applications that were previously created
  263. using App Builder</para>
  264. </listitem><listitem><para>Merge automatically generated code with hand-generated
  265. code</para>
  266. </listitem><listitem><para>Generate C-language source code and associated
  267. project files (for example, message catalogs) for the application</para>
  268. </listitem></itemizedlist>
  269. <para>You can<indexterm><primary>compiling</primary><secondary>an application</secondary></indexterm> compile and invoke your application from within App
  270. Builder. You can execute the build, run, and debug cycles all from a common
  271. environment without having to exit and restart App Builder.</para>
  272. <sect2 id="RDMAP.devap.div.8">
  273. <title>Demo Programs<indexterm><primary>Application Builder</primary><secondary>demo programs</secondary></indexterm><indexterm><primary>demo programs</primary>
  274. </indexterm></title>
  275. <para>You can find the App Builder example programs in <filename>/usr/dt/examples/dtbuilder</filename>. Read the <command>README</command> file for detailed information
  276. on these programs.</para>
  277. <sect3 id="RDMAP.devap.div.9">
  278. <title>Related Documentation</title>
  279. <para>For more information on Application Builder, see the appropriate man
  280. pages, the App Builder help volume, and the <emphasis>Application Builder
  281. User's Guide</emphasis>.<indexterm><primary>application
  282. development</primary><secondary>Application Builder &lt;$endrange></secondary></indexterm><?Pub Caret></para>
  283. </sect3>
  284. </sect2>
  285. </sect1>
  286. </chapter>
  287. <!--fickle 1.14 mif-to-docbook 1.7 01/02/96 04:30:53-->
  288. <?Pub *0000020547>