📄 z72.html
字号:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html> <head> <title> Installing Support Files </title> <meta name="GENERATOR" content= "Modular DocBook HTML Stylesheet Version 1.45"> <link rel="HOME" title="GTK+ / Gnome Application Development" href="ggad.html"> <link rel="UP" title="Creating Your Source Tree" href= "cha-source.html"> <link rel="PREVIOUS" title="Relevant GNU Documentation" href= "z71.html"> <link rel="NEXT" title="Gnome Application Basics" href= "cha-startup.html"> </head> <body bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink= "#840084" alink="#0000FF"> <div class="NAVHEADER"> <table width="100%" border="0" bgcolor="#ffffff" cellpadding= "1" cellspacing="0"> <tr> <th colspan="4" align="center"> <font color="#000000" size="2">GTK+ / Gnome Application Development</font> </th> </tr> <tr> <td width="25%" bgcolor="#ffffff" align="left"> <a href="z71.html"><font color="#0000ff" size="2"><b> <<< Previous</b></font></a> </td> <td width="25%" colspan="2" bgcolor="#ffffff" align= "center"> <font color="#0000ff" size="2"><b><a href="ggad.html"> <font color="#0000ff" size="2"><b> Home</b></font></a></b></font> </td> <td width="25%" bgcolor="#ffffff" align="right"> <a href="cha-startup.html"><font color="#0000ff" size= "2"><b>Next >>></b></font></a> </td> </tr> </table> </div> <div class="SECT1"> <h1 class="SECT1"> <a name="Z72">Installing Support Files</a> </h1> <p> Complete Gnome applications consist of more than just code. They have online help, are listed on the Gnome panel's menu, have translations, and have a desktop icon. They might come with pixmaps as well: a logo for the "about" dialog, a graphic for a "wizard," or a small icons to help the user rapidly distinguish menu items or list elements. This section tells you how to ship some of these files. </p> <div class="SECT2"> <h2 class="SECT2"> <a name="Z73">Installing Datafiles: Documentation and Pixmaps</a> </h2> <p> Documentation and pixmaps are installed in much the same way; <tt class="APPLICATION">automake</tt> allows you to install datafiles to arbitrary locations, and you can use variables defined by <tt class="FILENAME">configure</tt> to decide where they should go. </p> <div class="SECT3"> <h3 class="SECT3"> <a name="Z74">Pixmaps</a> </h3> <p> To install datafiles from your <tt class="FILENAME"> Makefile.am</tt> you simply come up with a name for the install target---<tt class="APPLICATION">pixmap</tt> seems good---then create a variable for the directory and a corresponding variable for the files to install there. For example: </p> <table border="0" bgcolor="#E0E0E0" width="100%"> <tr> <td><pre class="PROGRAMLISTING"> EXTRA_DIST = gnome-hello-logo.pngpixmapdir = $(datadir)/pixmapspixmap_DATA = gnome-hello-logo.png </pre> </td> </tr> </table> <p> The "<tt class="APPLICATION">pixmap</tt>" string connects the <tt class="APPLICATION">pixmapdir</tt> variable with the <tt class="APPLICATION"> pixmap_DATA</tt> variable. <tt class="APPLICATION"> automake</tt> interprets the <tt class="APPLICATION"> _DATA</tt> suffix and generates appropriate rules in <tt class="FILENAME">Makefile.in</tt>. This <tt class= "FILENAME">Makefile.am</tt> segment installs <tt class= "APPLICATION">gnome-hello-logo.png</tt> into <tt class= "APPLICATION">$(datadir)/pixmaps</tt>; <tt class= "APPLICATION">$(datadir)</tt> is a variable filled in by <tt class="FILENAME">configure</tt>. Typically <tt class="APPLICATION">$(datadir)</tt> is <tt class= "APPLICATION">/usr/local/share</tt> (more precisely, <tt class="APPLICATION">$(prefix)/share</tt>), which is the standard location for architecture-independent data files (that is, files which can be shared between several systems with different binary file formats). </p> <p> <a href="z72.html#SEC-EXTRADIST">the section called <i> <tt class="APPLICATION">EXTRA_DIST</tt></i></a> describes the <tt class="APPLICATION">EXTRA_DIST</tt> variable. </p> <p> The standard location for Gnome pixmaps is <tt class= "APPLICATION">$(datadir)/pixmaps</tt>, so we used that in the example. The Gnome Project encourages the use of PNG format for all pixmaps; this format is supported by <tt class="APPLICATION">gdk_imlib</tt>, the Gnome image-loading library. It is also small, fast, and unencumbered by patents. </p> </div> <div class="SECT3"> <h3 class="SECT3"> <a name="SEC-INSTALLDOCS">Documentation</a> </h3> <p> Installing documentation uses the same principles, with a little more complication. Gnome documentation is typically written in DocBook. DocBook is an SGML DTD ("Document Type Definition") just as HTML is. However, DocBook's tags are designed for technical documentation. Documentation written in DocBook can be converted to several other formats, including PostScript and HTML. Standardly, you want to install the HTML format so users can read it with their web browser or the Gnome help browser. </p> <p> The Gnome libraries and help browser understand a file called <tt class="FILENAME">topic.dat</tt>, which is simply a list of help topics with corresponding URLs. It serves as an index of help topics for your application. Here's an example, with only two entries: </p> <table border="0" bgcolor="#E0E0E0" width="100%"> <tr> <td><pre class="PROGRAMLISTING"> gnome-hello.html GnomeHello manual advanced.html Advanced Topics </pre> </td> </tr> </table> <p> URLs are relative to the directory where you install your help files. </p> <p> You should consider in advance that your documentation will be translated into other languages. It is nice to make a subdirectory in your source tree for each locale; for example, the default <tt class= "APPLICATION">C</tt> locale or the <tt class= "APPLICATION">es</tt> (Spanish) locale. That way translations don't cause clutter. Gnome expects help to be installed in a directory named after the locale, so this arrangement is convenient from that point of view as well. Your documentation directory might look like this one from the <tt class="APPLICATION"> GnomeHello</tt> example application: </p> <table border="0" bgcolor="#E0E0E0" width="100%"> <tr> <td><pre class="PROGRAMLISTING"> doc/ Makefile.am C/ Makefile.am gnome-hello.sgml topic.dat es/ Makefile.am gnome-hello.sgml topic.dat </pre> </td> </tr> </table> <p> Here is <tt class="FILENAME">doc/C/Makefile.am</tt>: </p> <table border="0" bgcolor="#E0E0E0" width="100%"> <tr> <td><pre class="PROGRAMLISTING"> gnome_hello_helpdir = $(datadir)/gnome/help/gnome-hello/Cgnome_hello_help_DATA = \ gnome-hello.html \ topic.dat
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -