PageRenderTime 45ms CodeModel.GetById 17ms RepoModel.GetById 0ms app.codeStats 0ms

/doc/FAQ.html

#
HTML | 344 lines | 291 code | 53 blank | 0 comment | 0 complexity | 24035d760f75c93802f1395e88804c48 MD5 | raw file
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
  2. <html lang="en">
  3. <HEAD>
  4. <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
  5. <TITLE>FAQ XPM</TITLE>
  6. </HEAD>
  7. <body>
  8. <h1 align="center">The XPM<br>
  9. Frequently Asked Questions</h1>
  10. <p>
  11. This article contains the answers to some Frequently Asked Questions about the
  12. XPM format and/or library. If you don't find the answer to your problem here,
  13. then you can mail either to lehors@sophia.inria.fr or to the mailing list
  14. xpm-talk@sophia.inria.fr.
  15. <h2>Contents</h2>
  16. <ol>
  17. <li><a href="#Q1">How do I convert my images to or from XPM ?</a>
  18. <li><a href="#Q2">Why are my XPM files said to be invalid ?</a>
  19. <li><a href="#Q3">Why does my program core dumps using XPM ?</a>
  20. <li><a href="#Q4">Why does my program core dumps using XPM with a widget ?</a>
  21. <li><a href="#Q5">How can I get a non rectangular icon using XPM ?</a>
  22. <li><a href="#Q6">What exactly triggers the creation of a mask when using XPM ?</a>
  23. <li><a href="#Q7">How should I use the mask ?</a>
  24. <li><a href="#Q8">Is there a string to pixmap converter somewhere ?</a>
  25. <li><a href="#Q9">How can I edit XPM icons ?</a>
  26. <li><a href="#Q10">Is there a collection of icons somewhere ?</a>
  27. <li><a href="#Q11">The documentation fails to print out. Why ?</a>
  28. <li><a href="#copy">Copyright</a>
  29. </ol>
  30. <h2><a name="Q1">1. How do I convert my images to or from XPM ?</a></h2>
  31. <p>
  32. Netpbm is surely the best image conversion package that I know of. It defines
  33. formats for color, gray and monochrome images and provides a set of filters.
  34. Thus a GIF image can be converted to XPM with something like:
  35. <p>
  36. $ giftoppm youricon.gif | ppmtoxpm > youricon.xpm
  37. <p>
  38. The latest release can be found at least from wuarchive.wustl.edu
  39. (128.252.135.4), directory /graphics/graphics/packages/NetPBM
  40. <h2><a name="Q2">2. Why are my XPM files said to be invalid ?</a></h2>
  41. <p>
  42. There are three official versions of the XPM format. The XPM library since
  43. version 3.3 can read all them but writes out only XPM 3. Also the small
  44. program called sxpm which is part of the XPM library package can be used to
  45. automatically translate XPM 1 and 2 files to XPM 3 with a command such as:
  46. <p>
  47. $ sxpm -nod yourxpm1or2file -o yourxpm3file
  48. <p>
  49. Also, the XPM format defines "None" to be the color name meaning
  50. "transparent", but IXI used to hack the XPM library in its early days to
  51. handle transparency as "#Transparent". This makes IXI format not compatible
  52. with the official XPM format, and so not readable neither by the official XPM
  53. library nor any of the programs built on top of it.
  54. <p>
  55. The only solutions are either to stick on IXI programs which can deal with
  56. their format or convert your files to the standard XPM format. This can be
  57. done simply by changing "#Transparent" to "None".
  58. <h2><a name="Q3">3. Why does my program core dumps using XPM ?</a></h2>
  59. <p>
  60. Be sure the XpmAttributes structure you pass by reference has a valid
  61. valuemask. You can give NULL instead if you don't want to use an
  62. XpmAttributes but if you do, you MUST initialize its valuemask component to
  63. some valid value, at least 0, otherwise unpredictable errors can occur.
  64. <p>
  65. So instead of doing something like:
  66. <pre>
  67. XpmAttributes attrib;
  68. XpmReadFileToPixmap(dpy, d, filename, &amp;pixmap, &amp;mask, &amp;attrib);
  69. </pre>
  70. <p>
  71. you should do:
  72. <pre>
  73. XpmAttributes attrib;
  74. attrib.valuemask = 0;
  75. XpmReadFileToPixmap(dpy, d, filename, &amp;pixmap, &amp;mask, &amp;attrib);
  76. </pre>
  77. <h2><a name="Q4">4. Why does my program core dumps using XPM with a widget ?</a></h2>
  78. <ul>
  79. <li>First the XPM library is Xlib level, so don't pass your widget as a
  80. Drawable parameter. A Drawable is either a Window or a Pixmap. The widget's
  81. window can do the job but:
  82. <li>Then a widget only gets a Window when realized, so passing XtWindow(widget)
  83. with a not yet realized widget is wrong. Either realize you widget first or
  84. use another window. Since the Drawable parameter is only used to specify
  85. the screen to which the pixmap must be created on, most of the time the
  86. default root window is just fine.
  87. </ul>
  88. <h2><a name="Q5">5. How can I get a non rectangular icon using XPM ?</a></h2>
  89. <p>
  90. The X Window System does not support transparent color. However there are
  91. several ways you can use to get the same visual effect using XPM:
  92. <ul>
  93. <li>First you can use the None color to get a shape mask and use it as
  94. explained below (question 7).
  95. <li>Second you can define a symbolic color name such as "mask" in the XPM
  96. format file, then use the color overriding mechanism to set this symbolic
  97. color to the color of the underlying object. Note that in this case the XPM
  98. library won't create a shape mask, and that if the color of the underlying
  99. object is changed then you'll have to create a new pixmap.
  100. </ul>
  101. <h2><a name="Q6">6. What exactly triggers the creation of a mask when using XPM ?</a></h2>
  102. <p>
  103. Basically a mask is created if "None" is used as one of the color of the
  104. pixmap. Be aware that this is not only true if it is used in the XPM of the
  105. pixmap since the colors can be overridden at load time. So a mask is created
  106. if the "None" color is used at load time, coming either from the XPM
  107. definition or the color overriding.
  108. <h2><a name="Q7">7. How should I use the mask ?</a></h2>
  109. <p>
  110. There are basically two ways of using the mask:
  111. <ul>
  112. <li>Use the mask as a shapemask with the X11 Nonrectangular Saphe Window
  113. Extension. Typically this is what should be done when the icon is used in a
  114. desktop.
  115. <li>Use the mask as a clipmask in the GC you pass to XCopyArea when drawing the
  116. pixmap. So the "transparent" pixels being not actually drawn will get the
  117. underlying pixels colors.
  118. </ul>
  119. <h2><a name="Q8">8. Is there a string to pixmap converter for Motif ?</a></h2>
  120. <p>
  121. Yes, Motif 2.0 or later does support XPM pixmaps as well as XBM bitmaps.
  122. <h2><a name="Q9">9. How can I edit XPM icons ?</a></h2>
  123. <p>
  124. As listed below several editors either commercial or not are supporting the
  125. XPM format. However, pixmap is the one I would recommend since it is freely
  126. available and, being fully dedicated to XPM, it allows to edit all the
  127. special things, such as the symbolic color names, which makes XPM different
  128. from all the other image formats. Pixmap can always be found by ftp from
  129. ftp.x.org (contrib) and avahi.inria.fr (pub/pixmap).
  130. <p>
  131. Last Update: 3 August 1994
  132. <table border=1>
  133. <caption>XPM Icon Editors</caption>
  134. <tr><th>Program<th>Infos<th>Source/Author<th>Platforms<th>SA<th>XPM<th>cost
  135. <tr><td>pixmap<td><ul>
  136. <li><a href="ftp://ftp.x.org/contrib/application/pixmap/pixmap2.6.tar.gz">ftp://ftp.x.org/contrib/application/pixmap/pixmap2.6.tar.gz</a>
  137. <li>requires 3.4 or higher revision of Xpm lib.
  138. <li>supports all XPM format features
  139. <li>current version doesn't work on 24-plane displays
  140. </ul>
  141. <td>Lionel Mallet<td>source<td>yes<td>3<td>NC
  142. <tr><td>pixt<td><ul>
  143. <li><a href="ftp://ftp.x.org/contrib/pixt.tar.Z">ftp://ftp.x.org/contrib/pixt.tar.Z</a>
  144. <li>doesn't work on 24-plane displays
  145. <li>last updated November 1991
  146. </ul>
  147. <td>J. Michael Flanery<td>source<td>yes<td>1<td>NC
  148. <tr><td>pixed<td><ul>
  149. <li>part of X.desktop
  150. <li>current version doesn't work on 24-plane displays
  151. </ul>
  152. <td>IXI<td>Many UNIX<td>no<td>3<td>N/A
  153. <tr><td>olpixmap<td><ul>
  154. <li>packaged with the OLIT (OpenLook) toolkit
  155. </ul>
  156. <td>USL<td>Sun, SVR4.2, UnixWare<td>no<td>1<td>N/A
  157. <tr><td>xfedor<td><ul>
  158. <li>only uses XLIB
  159. <li>doesn't work on 24-plane displays
  160. </ul>
  161. <td>Daniel Dardailler<td>source<td>yes<td>3<td>NC
  162. <tr><td>SCOpaint<td><ul>
  163. <li>included with the ODT package
  164. </ul>
  165. <td>SCO/Wing Eng<td>ODT<td>yes<td>2.8<td>N/A
  166. <tr><td>pme.icn<td><ul>
  167. <li>written in the Icon language
  168. </ul>
  169. <td>Icon Project<td>source<td>yes<td>3<td>NC
  170. <tr><td>PixEditT<td><ul>
  171. <li>there is currently no support for editing the colormap
  172. </ul>
  173. <td>Free Widget Foundation<td>source<td>yes<td>3<td>NC
  174. <tr><td>xscribble<td><ul>
  175. <li>requires the FWF, 8-bit pseudocolor
  176. <li><a href="ftp://ftp.cis.ufl.edu/pub/thoth">ftp://ftp.cis.ufl.edu/pub/thoth</a>
  177. <li>Alpha version (last updated April 1993)
  178. </ul>
  179. <td>Robert Forsman<td>source<td>yes<td>?<td>NC
  180. <tr><td>vueicon<td><ul>
  181. <li>included with Vue3.0
  182. </ul>
  183. <td>Hewlett-Packard<td>HP<td>yes<td>3<td>N/A
  184. <tr><td>iconedit V3<td>&nbsp;<td>SunSoft<td>Sparc/Sun3<td>yes<td>2<td>N/A
  185. <tr><td>Pixmap Editor<td><ul>
  186. <li>this is a Widget, not a complete program
  187. </ul>
  188. <td>ICS<td>?<td>yes<td>?<td>?
  189. <tr><td>ezX<td>&nbsp;<td>Sunrise Softwarey<td>?<td>?<td>?<td>N/A
  190. <tr><td>XPaint<td><ul>
  191. <li>full featured, works on all displays
  192. <li>current release is 2.1.1 (last update January 1994)
  193. </ul>
  194. <td>David Koblas<td>source<td>yes<td>3<td>NC
  195. <tr><td>Phoenix<td><ul>
  196. <li>full featured, 24-bit painting program, requires Motif.
  197. <li><a href="ftp://nic.funet.fi/pub/graphics/packages/phoenix">ftp://nic.funet.fi/pub/graphics/packages/phoenix</a>
  198. <li>Beta version (last updated September 1993)
  199. </ul>
  200. <td>ohtcolor@niksula.hut.fi<td>source<td>yes<td>3<td>NC
  201. <tr><td>pixed<td><ul>
  202. <li>pixed is part of the TeleUSE UIMS
  203. <li>More info is available from service@ignite.alsys.com
  204. </ul>
  205. <td>Alsys<td>Many UNIX<td>yes<td>3<td>N/A
  206. <tr><td>display<td><ul>
  207. <li><a href="ftp://ftp.x.org/contrib/application/ImageMagick/ImageMagick-3.2.tar.gz">ftp://ftp.x.org/contrib/application/ImageMagick/ImageMagick-3.2.tar.gz</a>
  208. <li>lots of image conversion and manipulation features
  209. </ul>
  210. <td>John Cristy<td>source<td>yes<td>3<td>NC
  211. </table>
  212. <p>
  213. SA - Stand Alone program<br>
  214. NC - No Charge (i.e. free); most programs are copyrighted.<br>
  215. XPM - XPM format supported<br>
  216. source - built from source code; likely works on all standard X platforms<br>
  217. N/A - icon editor is normally distributed with other software
  218. <p>
  219. Send updates, additions, corrections, etc. to <a
  220. href="mailto:dan@bristol.com">dan@bristol.com</a>
  221. <h2><a name="Q10">10. Is there a collection of icons somewhere ?</a></h2>
  222. <p>
  223. At least there is one freely available: Anthony's X Icon Library. You can
  224. found it on several ftp servers, such as <a href="ftp://server.berkeley.edu/pub/AIcons">server.berkeley.edu/pub/AIcons</a>. It
  225. contains only small icons (less than about 100x100 pixels in size) which are
  226. stored in groups in a logical way. Color icons are stored in XPM format and
  227. Black & White icons in XBM.
  228. <h2><a name="Q11">11. The documentation fails to print out. Why ?</a></h2>
  229. <p>
  230. The PostScript documentation file is formatted for US letter paper. Frame
  231. Maker tries very hard to ensure that you have the right paper and punts if
  232. you don't. However, you can easily work around this problem by applying the
  233. following patch. If for some reason applying the patch fails, you can still
  234. do it by hand. Just locate the corresponding block in the PS file and remove
  235. the lines with a leading '-' character.
  236. By the way, this applies to any doc generated by Frame Maker. The
  237. corresponding block might be slightly different depending on which version of
  238. Frame Maker was used, but it is still easy to locate.
  239. <pre>
  240. *** xpm.PS Wed Sep 11 15:47:43 1996
  241. --- xpm-A4.PS Thu Nov 21 09:27:28 1996
  242. ***************
  243. *** 647,668 ****
  244. 0 ne /edown exch def
  245. /yscale exch def
  246. /xscale exch def
  247. - FMLevel1 {
  248. - manualfeed {setmanualfeed} if
  249. - /FMdicttop countdictstack 1 add def
  250. - /FMoptop count def
  251. - setpapername
  252. - manualfeed {true} {papersize} ifelse
  253. - {manualpapersize} {false} ifelse
  254. - {desperatepapersize} {false} ifelse
  255. - { (Can't select requested paper size for Frame print job!) FMFAILURE } if
  256. - count -1 FMoptop {pop pop} for
  257. - countdictstack -1 FMdicttop {pop end} for
  258. - }
  259. - {{1 dict dup /PageSize [paperwidth paperheight]put setpagedevice}stopped
  260. - { (Can't select requested paper size for Frame print job!) FMFAILURE } if
  261. - {1 dict dup /ManualFeed manualfeed put setpagedevice } stopped pop }
  262. - ifelse
  263. FMPColor {
  264. currentcolorscreen
  265. --- 647,652 ----
  266. </pre>
  267. <hr>
  268. <h2><a name="copy">Copyright (C) 1989-95 GROUPE BULL</a></h2>
  269. <p>
  270. Permission is hereby granted, free of charge, to any person obtaining a copy
  271. of this software and associated documentation files (the "Software"), to
  272. deal in the Software without restriction, including without limitation the
  273. rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  274. sell copies of the Software, and to permit persons to whom the Software is
  275. furnished to do so, subject to the following conditions:
  276. <p>
  277. The above copyright notice and this permission notice shall be included in
  278. all copies or substantial portions of the Software.
  279. <p>
  280. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  281. IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  282. FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
  283. GROUPE BULL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
  284. AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  285. CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  286. <p>
  287. Except as contained in this notice, the name of GROUPE BULL shall not be
  288. used in advertising or otherwise to promote the sale, use or other dealings
  289. in this Software without prior written authorization from GROUPE BULL.
  290. </body>
  291. </html>