home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #19 / NN_1992_19.iso / spool / comp / windows / x / motif / 5906 < prev    next >
Encoding:
Internet Message Format  |  1992-08-30  |  13.1 KB

  1. Xref: sparky comp.windows.x.motif:5906 comp.windows.x:15875
  2. Path: sparky!uunet!ukma!usenet.ins.cwru.edu!agate!stanford.edu!unix!morgan
  3. From: morgan@unix.SRI.COM (Morgan Kaufmann Publishers)
  4. Newsgroups: comp.windows.x.motif,comp.windows.x
  5. Subject: Announcement of Motif Application Design Book and Source Code
  6. Keywords: Motif, book
  7. Message-ID: <38232@unix.SRI.COM>
  8. Date: 29 Aug 92 02:53:24 GMT
  9. Followup-To: poster
  10. Organization: SRI International, Menlo Park, CA
  11. Lines: 281
  12.  
  13.  
  14.  
  15. ANNOUNCING THE AVAILABILITY OF NEW BOOK AND SOURCE CODE
  16.  
  17.  
  18.  
  19. DESIGNING X CLIENTS WITH XT/MOTIF
  20.  
  21.  
  22. Jerry D. Smith
  23. Iris Computing Laboratories
  24.  
  25. July 1992, paperback, approx. 350 pages
  26. ISBN 1-55860-255-0
  27. Price: $34.95 (US & Canada)
  28.        $38.45 (Shipped to international addresses)
  29.  
  30.  
  31. This book focuses on practical design and implementation issues
  32. common to many X software development projects.  Its goal is to
  33. introduce the reader to a number of important design issues in the
  34. context of real-world software, such that each reader can consider
  35. these ideas within his or her own approach to program design. The
  36. book has two main themes: The first is that source code should be
  37. separated along user interface (UI) and non-UI lines to gain
  38. advantages in software readability, maintainability, and
  39. reusability.  The second theme is that programmers should look for
  40. higher order components in their software development projects. 
  41. The book presents the advantages of using abstraction to develop
  42. higher level modules, and it discusses tools and  techniques that
  43. enhance the X toolkit's existing programming abstractions.  
  44.  
  45. In keeping with the author's belief that it is important to supply
  46. the reader with real-world examples that illustrate the "big
  47. picture" as well  as having on-going utility, the book provides
  48. several reusable objects  including a dialog object that supports
  49. modal and nonmodal dialogs.   It also presents two useful
  50. applications "xfilter", an X interface to  UNIX filters, and
  51. "xrolodex", a Motif rolodex.  The source code for these can be
  52. downloaded from popular UNIX network sites.
  53.  
  54. DESIGNING X CLIENTS WITH XT/MOTIF should be of immediate interest
  55. to  X programmers using the X toolkit with the Motif widget set to
  56. construct real applications.  Given its emphasis on general design
  57. principles it  should also be of interest to X programmers in
  58. general, whether or not they are using Xlib or a toolkit.
  59.  
  60. CONTENTS
  61.  
  62.  
  63. Preface                                                     xii
  64.  
  65. 1    Introduction                                           1
  66. 1.1  The X Window System                                    1
  67. 1.2  Programming Abstractions                               2
  68. 1.3  Economy of Window System Primitives                    3
  69. 1.4  Mixing X and Operating System Primitives               4
  70. 1.5  X Motif and Unix                                       7
  71. 1.6  Event Handling from a Toolkit                          8
  72. 1.7  Application Design                                     10
  73. 1.8  Separation of UI and Non-UI Components                 10
  74. 1.9  Practical Xt Design Issues                             11
  75. 1.10 Objects versus Widgets                                 12
  76.  
  77. 2    Xt Application Design                                  15
  78. 2.1  PC-style User Interfaces Considered Harmful            15
  79. 2.2  Modal versus Nonmodal Dialog Boxes                     16
  80. 2.3  X's Procedural Event-driven Style                      17
  81. 2.4  A Manageable Set of Tools                              20
  82. 2.5  Dynamic Widget Creation                                21
  83. 2.6  Callback Functions                                     23
  84.  
  85. 3    "xfilter":  Overview of Simple Abstraction             25
  86. 3.1  "xfilter"                                              25
  87. 3.2  "xfilter's" User Interface                             26
  88. 3.3  Common UI Components                                   28
  89. 3.4  "xfilter's" Non-UI Operations                          30
  90. 3.5  "xfilter":  Source Module Breakdown                    31
  91.  
  92. 4    Procedural Abstraction                                 33
  93. 4.1  Common Usages for a Menu Function                      33
  94. 4.2  Application Interface                                  34
  95. 4.3  Menu Implementation                                    37
  96.  
  97. 5    File-level Abstraction                                 43
  98. 5.1  User Interface                                         43
  99. 5.2  Application Interface                                  44
  100. 5.3  Help System Implementation                             47
  101. 5.4  Dependencies Among Modules                             55
  102. 5.5  Alternative Implementations                            55
  103.  
  104. 6    "xfilter.c":  Linking UI and Non-UI Modules            57
  105. 6.1  Overview of the User Interface                         57
  106. 6.2  Separation of UI and Non-UI Components                 60
  107. 6.3  Common Data Structures                                 62
  108. 6.4  Implementing the User Interface                        64
  109. 6.5  User Interface Drudgery                                68
  110. 6.6  Widget Instance Naming Conventions                     76
  111. 6.7  Application-neutral Callback Functions                 78
  112. 6.8  Application-specific Callback Functions                81
  113. 6.9  Dispatching Data Manipulations to "xfilter.sel.c"      84
  114. 6.10 Providing Help Text for "help.c"                       85
  115.  
  116. 7    "xfilter.sel.c": Linking in Non-UI Functionality       87
  117. 7.1  Overview of "xfilter's" Data Manipulation Operations   87
  118. 7.2  Transferring Data via Window Properties                88
  119. 7.3  Application Interface:  Linking UI & Non-UI Modules    91
  120. 7.4  Retrieving Selections                                  95
  121. 7.5  Dispatching Filter-related Operations                  97
  122. 7.6  Managing the Clipboard Selection                       99
  123. 7.7  Applying the UNIX Filter                               102
  124. 7.8  Xlib's Convenience Functions for Cut-buffer 0          105
  125. 7.9  The "Motif" Clipboard                                  106
  126. 7.10 Possible Extensions                                    106
  127.  
  128. 8    Multiply Instantiable Abstractions                     109
  129. 8.1  Introduction and Motivation                            109
  130. 8.2  "CtrlPanel":  A Control Panel Object                   111
  131. 8.3  "CtrlPanel" Resources                                  117
  132. 8.4  Objects versus Widgets                                 118
  133. 8.5  Encapsulation Issues                                   120
  134. 8.6  Motif Style Guide Considerations                       121
  135. 8.7  "testctrl":  A Simple "CtrlPanel" Application          122
  136.  
  137. 9    "xrolodex":  Higher Level Abstractions                 125
  138. 9.1  "xrolodex"                                             125
  139. 9.2  "xrolodex's" User Interface                            126
  140. 9.3  Beyond the User Interface                              128
  141. 9.4  "xrolodex":  Source Module Breakdown                   130
  142.  
  143. 10   "ListShell":  A Scrollable List in a Shell             133
  144. 10.1 Encapsulation                                          133
  145. 10.2 Overview of "ListShell"                                134
  146. 10.3 Application Interface                                  135
  147. 10.4 Creating and Initializing a "ListShell" Object         137
  148. 10.5 Private Support Functions                              145
  149. 10.6 Public Support Functions                               146
  150. 10.7 Managing Secondary Windows                             149
  151. 10.8 "testlist":  A Simple "ListShell"  Application         150
  152.  
  153. 11   "Editor":  A Search and Replace Editor Object          155
  154. 11.1 Overview of "Editor"                                   155
  155. 11.2 Application Interface                                  159
  156. 11.3 Implementing the "Editor" Object                       162
  157. 11.4 "Editor's" Access Functions                            174
  158. 11.5 Callback Functions for Clipboard Operations            176
  159. 11.6 Callback Functions fur Search and Replace Operations   180
  160. 11.7 Event Handlers                                         182
  161. 11.8 "testedit":  A Simple "Editor" Application             183
  162.  
  163. 12   "Dialog":  A Modal or Nonmodal Dialog Object           185
  164. 12.1 Objects versus Convenience Functions in Dialog Design  185
  165. 12.2 Overview of "Dialog"                                   186
  166. 12.3 Application Interface                                  187
  167. 12.4 Implementation of the "Dialog" Object                  191
  168. 12.5 "Dialog" Activation                                    201
  169. 12.6 Modifying and Querying the State of a 
  170.           "Dialog" Instance                                 205
  171. 12.7 Private Support Functions                              207
  172. 12.8 Modal Dialogs and Window Manager "Close" Functionality 210
  173. 12.9 "testdialog":  Testing Three "Dialog" Configurations   211
  174. 12.10 Design Issues                                         218
  175.  
  176. 13   "StreamDB":  A Stream Database Object                  221
  177. 13.1 Overview of "StreamDB"                                 221
  178. 13.2 Programming Interface                                  222
  179. 13.3 "streamdbP.h":  The Instance Record                    224
  180. 13.4 "streamdb.c": Overview of "StreamDB's" Implementation  226
  181. 13.5 Overview of "StreamDB's" Access Functions              228
  182. 13.6 Miscellaneous "StreamDB" Functions                     233
  183.  
  184. 14   "xrolo.c": Coordinating UI and Database Operations     237
  185. 14.1 "xrolodex": Overview of User Interface Components      238
  186. 14.2 Dialog Box Design                                      241
  187. 14.3 Separation of UI and Non-UI Components                 242
  188. 14.4 Initialization-related Issues                          244
  189. 14.5 Application versus Fallback Resources                  246
  190. 14.6 Creating the User Interface                            250
  191. 14.7 Designing Callback Functions                           264
  192. 14.8 Independent Callback Functions                         265
  193. 14.9 Laissez-faire Callback Functions                       268
  194. 14.10 Terminating the Application Gracefully                274
  195. 14.11 Application Logic in Callback Functions               275
  196. 14.12 Miscellaneous Callback Functions                      277
  197. 14.13 Miscellaneous Support Functions                       280
  198. 14.14 Reusability                                           282
  199.  
  200. 15   "xrolo.db.c":  The Role of Indirection                 285
  201. 15.1 "xrolodex's" Database Design Policy                    285
  202. 15.2 "xrolo.db.h":  The Programming Interface               286
  203. 15.3 Encapsulating the Rolodex File                         287
  204. 15.4 Indirection:  Maintaining Distance Between Specific
  205.           and General Modules                               288
  206. 15.5 Functions Returning "EntryDB" Values                   293
  207. 15.6 UI-independent Insertion & Deletion of 
  208.           Database Entries                                  294
  209. 15.7 "xrolo.db.c's" UI-independent Index-related Services   297
  210. 15.8 "xrolo.index.c's" UI-dependent Index-related Services  299
  211. 15.9 Separation of UI and Non-UI Components                 301
  212.  
  213. Appendix A     Quick Reference for "motif.c"                303
  214.  
  215. Appendix B     Quick Reference for "help.c"                 305
  216.  
  217. Appendix C     Quick Reference for "ctrlpanel.c"            307
  218.  
  219. Appendix D     Quick Reference for "listshell.c"            309
  220.  
  221. Appendix E     Quick Reference for "editor.c"               313
  222.  
  223. Appendix F     Quick Reference for "dialog.c"               319
  224.  
  225. Appendix G     Quick Reference for "streamdb.c"             323
  226.  
  227. References                                                  329
  228.  
  229. Index                                                       331 
  230. _________________________________________________________________
  231.  
  232. Ordering Information:
  233.  
  234.      
  235. The book is available now at better technical bookstores or by
  236. ordering directly from the publisher at: 
  237.  
  238.      Morgan Kaufmann Publishers
  239.      Dept. XT
  240.      2929 Campus Drive, Suite 260
  241.      San Mateo, CA 
  242.      94403
  243.      USA
  244.      
  245.      Phone: (800)745-READ, (415) 578-9911
  246.      Fax: (415) 578-0672
  247.      
  248.      For shipping, please add: 
  249.  
  250.           $3.50 for the first book and $2.50 for each additional
  251.           for book rate shipping to the U.S. and Canada (2-3
  252.           weeks); 
  253.  
  254.           $6.50 for the first book and $3.50 for each additional
  255.           for surface shipping to all other areas.  (4-8 weeks)
  256.  
  257.      Call or fax for quotations on other shipping methods.
  258.  
  259.      Master Card, Visa, American Express and personal checks
  260.      drawn on US banks accepted.
  261.  
  262.      California residents please add sales tax appropriate to
  263.      your county.
  264.  
  265. Source Code: 
  266.  
  267.      The source code for the book is available for a small
  268.      distribution fee on floppy diskettes ($30) or QIC-24 cartridge
  269.      tape ($60) payable only be check or money order in US funds,
  270.      drawn on a US bank from:
  271.  
  272.           Motif Source Offer
  273.           Iris Computing Laboratories
  274.           2801 Rodeo Road, Suite B-622
  275.           Santa Fe, NM 87505 
  276.  
  277.      Please specify diskette format: 5.25" DOS diskettes, 3.5" DOS
  278.      diskettes, or SunOS 4.X/5.X tar (1) format.  (The DOS
  279.      diskettes include Unix format text files).
  280.  
  281.      Alternatively, the source code is available by uucp or ftp
  282.      access as a compressed tar file from UUNET Technologies in the
  283.      following subdirectory:
  284.  
  285.      uunet!~/published/books (or: ftp.uu.net:/published/books/)
  286.  
  287.      or by anonymous ftp from MIT's public archive for X software
  288.      in the following subdirectory:
  289.  
  290.      export.lcs.mit.edu:contrib/
  291.  
  292.      The filename for the archive is smith.motif.tar.Z
  293.  
  294.