home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / x / volume8 / wcl / part06 < prev    next >
Encoding:
Internet Message Format  |  1990-07-06  |  45.9 KB

  1. Path: uunet!snorkelwacker!usc!cs.utexas.edu!sun-barr!newstop!sun!devvax.Jpl.Nasa.Gov
  2. From: david@devvax.Jpl.Nasa.Gov (David E. Smyth)
  3. Newsgroups: comp.sources.x
  4. Subject: v08i036: wcl - Widget Creation Library, Part06/06
  5. Message-ID: <138462@sun.Eng.Sun.COM>
  6. Date: 6 Jul 90 07:41:11 GMT
  7. Sender: news@sun.Eng.Sun.COM
  8. Lines: 1428
  9. Approved: argv@sun.com
  10.  
  11. Submitted-by: david@devvax.Jpl.Nasa.Gov (David E. Smyth)
  12. Posting-number: Volume 8, Issue 36
  13. Archive-name: wcl/part06
  14.  
  15. # to unbundle, "sh" this file -- DO NOT use csh
  16. #  SHAR archive format.  Archive created Tue Jul 3 16:49:52 PDT 1990
  17. echo x - WidgetCreate.h
  18. sed 's/^X//' > WidgetCreate.h <<'+FUNKY+STUFF+'
  19. X/*
  20. X** Copyright (c) 1990 David E. Smyth
  21. X**
  22. X** This file was derived from work performed by Martin Brunecky at
  23. X** Auto-trol Technology Corporation, Denver, Colorado, under the
  24. X** following copyright:
  25. X**
  26. X*******************************************************************************
  27. X* Copyright 1990 by Auto-trol Technology Corporation, Denver, Colorado.
  28. X*
  29. X*                        All Rights Reserved
  30. X*
  31. X* Permission to use, copy, modify, and distribute this software and its
  32. X* documentation for any purpose and without fee is hereby granted, provided
  33. X* that the above copyright notice appears on all copies and that both the
  34. X* copyright and this permission notice appear in supporting documentation
  35. X* and that the name of Auto-trol not be used in advertising or publicity
  36. X* pertaining to distribution of the software without specific, prior written
  37. X* permission.
  38. X* 
  39. X* Auto-trol disclaims all warranties with regard to this software, including
  40. X* all implied warranties of merchantability and fitness, in no event shall
  41. X* Auto-trol be liable for any special, indirect or consequential damages or
  42. X* any damages whatsoever resulting from loss of use, data or profits, whether 
  43. X* in an action of contract, negligence or other tortious action, arising out 
  44. X* of or in connection with the use or performance of this software.
  45. X*******************************************************************************
  46. X**
  47. X** Redistribution and use in source and binary forms are permitted
  48. X** provided that the above copyright notice and this paragraph are
  49. X** duplicated in all such forms and that any documentation, advertising
  50. X** materials, and other materials related to such distribution and use
  51. X** acknowledge that the software was developed by David E. Smyth.  The
  52. X** name of David E. Smyth may not be used to endorse or promote products
  53. X** derived from this software without specific prior written permission.
  54. X** THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
  55. X** WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
  56. X** MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  57. X**
  58. X*/
  59. X
  60. X/*
  61. X* SCCS_data: @(#)WidgetCreate.h 1.0 ( 19 June 1990 )
  62. X*
  63. X* Include_name:
  64. X*
  65. X*     WidgetCreate.h
  66. X*
  67. X* Subsystem_group:
  68. X*
  69. X*     Widget Creation Library
  70. X*
  71. X* Include_description:
  72. X*
  73. X*     Public defines for the Widget Creation Library supporting widget 
  74. X*     tree creation from the Xrm database.
  75. X*
  76. X* Include_history:
  77. X*
  78. X*   mm/dd/yy  initials  action
  79. X*   --------  --------  -------------------------------------------------------
  80. X*   06/30/90   R.Whitby added WcRegisterWcActions declaration
  81. X*   06/19/90   D.Smyth  Widget Creation Library version 1.0 Release
  82. X*   04/04/90   marbru   updated, added new callbacks
  83. X*   03/27/90   marbru   updated for new names
  84. X*   03/02/90   marbru   created
  85. X*
  86. X*******************************************************************************
  87. X*/
  88. X#ifndef _WidgetCreate_h
  89. X#define _WidgetCreate_h
  90. X
  91. X#include <X11/IntrinsicP.h>
  92. X#include <X11/CoreP.h>
  93. X#include <X11/ObjectP.h>
  94. X
  95. X#ifdef FUNCTION_PROTOTYPES
  96. X/****************************** ANSI FUNC DECLS ******************************/
  97. X
  98. X#define APP XtAppContext
  99. X#define EV extern void
  100. X#define EW extern Widget
  101. X
  102. X/* -- Widget class, constructor, and callback proc registration routines */
  103. X
  104. XEV WcRegisterClassPtr    ( APP, char* name, WidgetClass class);
  105. XEV WcRegisterClassName   ( APP, char* name, WidgetClass class);
  106. XEV WcRegisterConstructor ( APP, char* name, Widget(*constructor) () );
  107. XEV WcRegisterCallback    ( APP, char* CBname, XtCallbackProc, caddr_t call);
  108. XEV WcRegisterWcCallbacks ( APP );
  109. X
  110. X/* -- Widget action registration routine */
  111. X
  112. XEV WcRegisterWcActions   ( APP );
  113. X
  114. X/* -- Widget creation routines */
  115. X
  116. XEV WcWidgetCreation         ( Widget root );
  117. XEV WcCreateDeferredChildren ( Widget parent, char* names );
  118. XEV WcCreateNamedChildren    ( Widget parent, char* names );
  119. X
  120. X/* -- Widget name routines */
  121. X
  122. Xextern Widget WcChildNameToWidget ( Widget w, char* childName );
  123. Xextern Widget WcFullNameToWidget  ( Widget w, char* name );
  124. Xextern char*  WcWidgetToFullName  ( Widget w );
  125. X        /* Note: returned char buff must be free'd by caller */
  126. Xextern char*  WcNamesToWidgetList ( Widget w, char* names, 
  127. X                                        Widget widgetList[], Cardinal* count);
  128. X        /* returns names which could not be converted */
  129. X
  130. X#undef APP
  131. X#undef EV
  132. X#undef EW
  133. X
  134. X#else
  135. X/**************************** NON-ANSI FUNC DECLS ****************************/
  136. X
  137. X/* -- Widget constructor registration routine */
  138. X
  139. Xextern void WcRegisterObjectClass     ();
  140. Xextern void WcRegisterConstructor     ();
  141. Xextern void WcRegisterCallback        ();
  142. Xextern void WcRegisterWcCallbacks     ();
  143. X
  144. X/* -- Widget action registration routine */
  145. X
  146. Xextern void WcRegisterWcActions       ();
  147. X
  148. X/* -- Widget creation routines */
  149. X
  150. Xextern void WcWidgetCreation         ();
  151. Xextern void WcCreateDeferredChildren    ();
  152. Xextern void WcCreateNamedChildren    ();
  153. X
  154. X/* -- Widget name routine */
  155. X
  156. Xextern Widget WcChildNameToWidget    ();
  157. Xextern Widget WcFullNameToWidget    ();
  158. Xextern char*  WcWidgetToFullName    ();    /* ret'd buff must be free'd */
  159. Xextern char*  WcNamesToWidgetList    ();    /* rets: names not converted */
  160. X
  161. X#endif FUNCTION_PROTOTYPES
  162. X
  163. X#endif _WidgetCreate_h
  164. +FUNKY+STUFF+
  165. echo '-rw-r--r--  1 david        5183 Jul  2 12:22 WidgetCreate.h    (as sent)'
  166. chmod u=rw,g=r,o=r WidgetCreate.h
  167. ls -l WidgetCreate.h
  168. echo x - WidgetCreateP.h
  169. sed 's/^X//' > WidgetCreateP.h <<'+FUNKY+STUFF+'
  170. X/*
  171. X** Copyright (c) 1990 David E. Smyth
  172. X**
  173. X** This file was derived from work performed by Martin Brunecky at
  174. X** Auto-trol Technology Corporation, Denver, Colorado, under the
  175. X** following copyright:
  176. X**
  177. X*******************************************************************************
  178. X* Copyright 1990 by Auto-trol Technology Corporation, Denver, Colorado.
  179. X*
  180. X*                        All Rights Reserved
  181. X*
  182. X* Permission to use, copy, modify, and distribute this software and its
  183. X* documentation for any purpose and without fee is hereby granted, provided
  184. X* that the above copyright notice appears on all copies and that both the
  185. X* copyright and this permission notice appear in supporting documentation
  186. X* and that the name of Auto-trol not be used in advertising or publicity
  187. X* pertaining to distribution of the software without specific, prior written
  188. X* permission.
  189. X*
  190. X* Auto-trol disclaims all warranties with regard to this software, including
  191. X* all implied warranties of merchantability and fitness, in no event shall
  192. X* Auto-trol be liable for any special, indirect or consequential damages or
  193. X* any damages whatsoever resulting from loss of use, data or profits, whether
  194. X* in an action of contract, negligence or other tortious action, arising out
  195. X* of or in connection with the use or performance of this software.
  196. X*******************************************************************************
  197. X**
  198. X** Redistribution and use in source and binary forms are permitted
  199. X** provided that the above copyright notice and this paragraph are
  200. X** duplicated in all such forms and that any documentation, advertising
  201. X** materials, and other materials related to such distribution and use
  202. X** acknowledge that the software was developed by David E. Smyth.  The
  203. X** name of David E. Smyth may not be used to endorse or promote products
  204. X** derived from this software without specific prior written permission.
  205. X** THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR IMPLIED
  206. X** WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTIES OF
  207. X** MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  208. X**
  209. X*/
  210. X
  211. X/*
  212. X* SCCS_data: @(#)WidgetCreateP.h 1.0 ( 19 June 1990 )
  213. X*
  214. X* Include_name:
  215. X*
  216. X*     WidgetCreateP.h
  217. X*
  218. X* Subsystem_group:
  219. X*
  220. X*     Widget Creation Library
  221. X*
  222. X* Include_description:
  223. X*
  224. X*     Private defines for the Widget Creation Library supporting widget
  225. X*     tree creation from the Xrm database.
  226. X*
  227. X* Include_history:
  228. X*
  229. X*   mm/dd/yy  initials  action
  230. X*   --------  --------  -------------------------------------------------------
  231. X*   06/30/90   R.Whitby added Action declarations
  232. X*   05/24/90   D.Smyth  created from provate section of WsCreate.h
  233. X*   03/02/90   marbru   created
  234. X*
  235. X*******************************************************************************
  236. X*/
  237. X#ifndef _WidgetCreateP_h
  238. X#define _WidgetCreateP_h
  239. X
  240. X/*
  241. X*******************************************************************************
  242. X* Private_constant_declarations.
  243. X*******************************************************************************
  244. X*/
  245. X#undef  NUL
  246. X#define NUL '\0'
  247. X#define ALREADY_LOADED_RESOURCE_FILE '4'
  248. X#define MAX_XRMSTRING   4096        /* max length of the Xrm DB string  */
  249. X#define MAX_ERRMSG      1024        /* max length of error message      */
  250. X#define MAX_CHILDREN    1024        /* max number of widget's children  */
  251. X#define MAX_PATHNAME    1024        /* max length of the pathname       */
  252. X#define INCR_REGISTRY     32        /* incr of cl, con, cb registries   */
  253. X#define MAX_CALLBACKS     64            /* max callbacks per Xrm resource   */
  254. X#define MAX_WIDGETS      512        /* max depth of a widget tree       */
  255. X#define MAX_ROOT_WIDGETS  32        /* max # separate widget trees        */
  256. X
  257. X#define WcNwcChildren        "wcChildren"
  258. X#define WcNwcClass        "wcClass"
  259. X#define WcNwcClassName        "wcClassName"
  260. X#define WcNwcConstructor    "wcConstructor"
  261. X#define WcNwcManaged        "wcManaged"
  262. X#define WcNwcDeferred        "wcDeferred"
  263. X#define WcNwcTrace        "wcTrace"
  264. X#define WcNwcCallback        "wcCallback"
  265. X
  266. X#define WcCWcChildren        "WcChildren"
  267. X#define WcCWcClass        "WcClass"
  268. X#define WcCWcClassName        "WcClassName"
  269. X#define WcCWcConstructor    "WcConstructor"
  270. X#define WcCWcManaged        "WcManaged"
  271. X#define WcCWcDeferred        "WcDeferred"
  272. X#define WcCWcTrace        "WcTrace"
  273. X#define WcCWcCallback        "WcCallback"
  274. X
  275. X/* Motif 1.0 has a bug: widgets ask for Windows 
  276. X** instead of Widgets for their resources...
  277. X*/
  278. X#define WcRWidget        "Window"
  279. X#define WcRClassPtr        "ClassPtr"
  280. X#define WcRClassName        "ClassName"
  281. X#define WcRConstructor        "Constructor"
  282. X/*
  283. X*******************************************************************************
  284. X* Private_type_declarations.
  285. X*******************************************************************************
  286. X*/
  287. X
  288. Xtypedef Widget (*PtrFuncWidget)();    /* ptr to func returning Widget    */
  289. X
  290. X/* Registration structs: It is a good idea if the classes, class names,
  291. X** constructors, and callbacks are registered with the same upper & lower 
  292. X** case names as the names in the ref manuals and source files, as this 
  293. X** makes the user error messages clearer.
  294. X*/
  295. X
  296. Xtypedef struct                          /* Class cache record        */
  297. X{
  298. X    String       name;        /* class ptr name as registered    */
  299. X    XrmQuark       quark;               /* quarkified class ptr name    */
  300. X    WidgetClass    class;               /* widget class pointer        */
  301. X} ClCacheRec;
  302. X
  303. Xtypedef struct                          /* Class Name cache record    */
  304. X{
  305. X    String       name;        /* class name as registered    */
  306. X    XrmQuark       quark;               /* quarkified class name    */
  307. X    WidgetClass    class;               /* widget class pointer        */
  308. X} ClNameCacheRec;
  309. X
  310. Xtypedef struct                          /* Constructor cache record    */
  311. X{
  312. X    String       name;        /* constructor as registered    */
  313. X    XrmQuark       quark;               /* quarkified constructor name    */
  314. X    Widget         (*constructor)();    /* constructor function ptr    */
  315. X} ConCacheRec;
  316. X
  317. Xtypedef struct                /* Callback cache record    */
  318. X{
  319. X    String         name;        /* name as registered         */
  320. X    XrmQuark       quark;               /* quarkified callback name    */
  321. X    XtCallbackProc callback;            /* callback procedure pointer    */
  322. X    caddr_t        closure;             /* default client data        */
  323. X} CBCacheRec;
  324. X
  325. Xtypedef struct  _ResourceRec
  326. X{
  327. X    String          children;           /* list of children names to create */
  328. X    WidgetClass     class;              /* widget class pointer             */
  329. X    WidgetClass     classFromName;      /* widget class pointer             */
  330. X    ConCacheRec*    constructor;    /* ptr to Constructo cache record   */
  331. X    Boolean         managed;            /* created  managed (default TRUE)  */
  332. X    Boolean         deferred;           /* deferred creation, (def FALSE)   */
  333. X    Boolean         trace;              /* creation trace required          */
  334. X    XtCallbackList  callback;           /* creation callback list           */
  335. X} ResourceRec, *ResourceRecPtr;
  336. X
  337. X/*
  338. X*******************************************************************************
  339. X* Private_macro_definitions.
  340. X*******************************************************************************
  341. X*/
  342. X
  343. X/*
  344. X*******************************************************************************
  345. X* Private_data_definitions.
  346. X*******************************************************************************
  347. X    The following cache/registry of known widget classes and contructors,
  348. X    initially empty, are loaded by the application using "registration"
  349. X    routines.
  350. X    Assuming small numbers of constructors, the sequential search
  351. X    of such cache is (initially) considered acceptable.
  352. X*/
  353. X
  354. X/*  -- Named class pointer cache, intially empty */
  355. X
  356. Xextern int         classes_num;
  357. Xextern int         classes_max;
  358. Xextern ClCacheRec* classes_ptr;
  359. X
  360. X/*  -- Class name cache, intially empty */
  361. X
  362. Xextern int             cl_nm_num;
  363. Xextern int             cl_nm_max;
  364. Xextern ClNameCacheRec* cl_nm_ptr;
  365. X
  366. X/*  -- Named object constructor cache, intially empty */
  367. X
  368. Xextern int          constrs_num;
  369. Xextern int          constrs_max;
  370. Xextern ConCacheRec* constrs_ptr;
  371. X
  372. X/*  -- Callback function cache, initially empty */
  373. X
  374. Xextern int        callbacks_num;
  375. Xextern int        callbacks_max;
  376. Xextern CBCacheRec*  callbacks_ptr;
  377. X/*  -- Widget Creation resources */
  378. X
  379. Xextern XtResource wc_resources[];
  380. X
  381. X/*
  382. X*******************************************************************************
  383. X* Private_function_declarations.
  384. X*******************************************************************************
  385. X    The following functions are generally private functions to the
  386. X    WcCreate routines, but they may be defined in different files from
  387. X    where they are used.  Client programs probably should not invoke
  388. X    these functions directly.
  389. X*/
  390. X
  391. X#ifdef FUNCTION_PROTOTYPES
  392. X/****************************** ANSI FUNC DECLS ******************************/
  393. X
  394. X#define EV extern void
  395. X#define EC extern char*
  396. X
  397. X/*  -- Resource converters */
  398. X
  399. XEV WcAddConverters     ( XtAppContext );
  400. XEV CvtStringToClassPtr    ( XrmValue*, Cardinal*, XrmValue*, XrmValue* );
  401. XEV CvtStringToClassName   ( XrmValue*, Cardinal*, XrmValue*, XrmValue* );
  402. XEV CvtStringToConstructor ( XrmValue*, Cardinal*, XrmValue*, XrmValue* );
  403. XEV CvtStringToCallback    ( XrmValue*, Cardinal*, XrmValue*, XrmValue* );
  404. XEV CvtStringToWidget      ( XrmValue*, Cardinal*, XrmValue*, XrmValue* );
  405. X
  406. X/*  -- Find root widget of argument, remember if never seen before */
  407. X
  408. Xextern Widget WcRootWidget    ( Widget );
  409. X
  410. X/*  -- Useful for argument parsing */
  411. X
  412. X/* caller must free returned copy from WcLowerCaseCopy() */
  413. XEC WcLowerCaseCopy        ( char* in );
  414. XEC WcSkipWhitespace       ( char* cp );
  415. XEC WcSkipWhitespace_Comma ( char* cp );
  416. XEC WcCleanName            ( char* in, char* out );
  417. XEC WcStripWhitespaceFromBothEnds (char* name );
  418. XEV WcSetValueFromString   ( Widget w, char* res_name, char* res_val );
  419. X
  420. X/*  -- Convenience Callbacks - Clients generally invoke these only
  421. X       by binding them to widgets via the resource file.  They can
  422. X       be programmatically bound, but generally should not be.
  423. X*/
  424. X
  425. XEV WcCreateChildrenCB     (Widget w, char* parent_children, caddr_t unused   );
  426. XEV WcManageCB             (Widget w, char* widgetNames,     caddr_t unused   );
  427. XEV WcUnmanageCB           (Widget w, char* widgetNames,     caddr_t unused   );
  428. XEV WcManageChildrenCB     (Widget w, char* parent_children, caddr_t unused   );
  429. XEV WcUnmanageChildrenCB   (Widget w, char* parent_children, caddr_t unused   );
  430. XEV WcDestroyCB            (Widget w, char* widgetNames,     caddr_t unused   );
  431. XEV WcSetValueCB           (Widget w, char* name_res_resVal, caddr_t unused   );
  432. XEV WcSetSensitiveCB       (Widget w, char* widgetNames,     caddr_t unused   );
  433. XEV WcSetInsensitiveCB     (Widget w, char* widgetNames,     caddr_t unused   );
  434. XEV WcLoadResourceFileCB   (Widget w, char* resFileName,     caddr_t unused   );
  435. XEV WcTraceCB              (Widget w, char* annotation,      caddr_t unused   );
  436. XEV WcPopupCB              (Widget w, char* widgetName,        caddr_t unused   );
  437. XEV WcPopupGrabCB          (Widget w, char* widgetName,        caddr_t unused   );
  438. XEV WcPopdownCB            (Widget w, char* widgetName,      caddr_t unused   );
  439. XEV WcSystemCB             (Widget w, char* shellCmdString,  caddr_t unused   );
  440. XEV WcExitCB               (Widget w, char* exitValue,       caddr_t unused   );
  441. X
  442. X/*  -- Convenience Actions - Clients generally invoke these only
  443. X       by binding them to widgets via the resource file.  They can
  444. X       be programmatically bound, but generally should not be.
  445. X*/
  446. X
  447. X#define ACT_ARGS Widget w, XEvent *event, String *params, Cardinal *num_params
  448. X
  449. XEV WcCreateChildrenACT    ( ACT_ARGS );
  450. XEV WcManageACT            ( ACT_ARGS );
  451. XEV WcUnmanageACT          ( ACT_ARGS );
  452. XEV WcManageChildrenACT    ( ACT_ARGS );
  453. XEV WcUnmanageChildrenACT  ( ACT_ARGS );
  454. XEV WcDestroyACT           ( ACT_ARGS );
  455. XEV WcSetValueACT          ( ACT_ARGS );
  456. XEV WcSetSensitiveACT      ( ACT_ARGS );
  457. XEV WcSetInsensitiveACT    ( ACT_ARGS );
  458. XEV WcLoadResourceFileACT  ( ACT_ARGS );
  459. XEV WcTraceACT             ( ACT_ARGS );
  460. XEV WcPopupACT             ( ACT_ARGS );
  461. XEV WcPopupGrabACT         ( ACT_ARGS );
  462. XEV WcPopdownACT           ( ACT_ARGS );
  463. XEV WcSystemACT            ( ACT_ARGS );
  464. XEV WcExitACT              ( ACT_ARGS );
  465. X
  466. X#undef ACT_ARGS
  467. X#undef EV
  468. X#undef EC
  469. X
  470. X#else
  471. X/**************************** NON-ANSI FUNC DECLS ****************************/
  472. X
  473. X/*  -- Resource converters */
  474. X
  475. Xextern void WcAddConverters        ();
  476. Xextern void CvtStringToClassPtr    ();
  477. Xextern void CvtStringToClassName    ();
  478. Xextern void CvtStringToConstructor ();
  479. Xextern void CvtStringToCallback    ();
  480. Xextern void CvtStringToWidget      ();
  481. X
  482. X/*  -- Find root widget of argument, remember if never seen before */
  483. X
  484. Xextern Widget WcRootWidget ();
  485. X
  486. X/*  -- Useful for argument parsing */
  487. X
  488. X/* caller must free returned copy from WcLowerCaseCopy() */
  489. Xextern char* WcLowerCaseCopy        ();
  490. Xextern char* WcSkipWhitespace       ();
  491. Xextern char* WcSkipWhitespace_Comma ();
  492. Xextern char* WcCleanName            ();
  493. Xextern char* WcStripWhitespaceFromBothEnds();
  494. Xextern void  WcSetValueFromString   ();
  495. X
  496. X/*  -- Convenience Callbacks - Clients generally invoke these only
  497. X       by binding them to widgets via the resource file.  They can
  498. X       be programmatically bound, but generally should not be.
  499. X*/
  500. X
  501. Xextern void WcCreateChildrenCB     ();
  502. Xextern void WcManageCB             ();
  503. Xextern void WcUnmanageCB           ();
  504. Xextern void WcManageChildrenCB     ();
  505. Xextern void WcUnmanageChildrenCB   ();
  506. Xextern void WcDestroyCB            ();
  507. Xextern void WcSetValueCB           ();
  508. Xextern void WcSetSensitiveCB       ();
  509. Xextern void WcSetInsensitiveCB     ();
  510. Xextern void WcLoadResourceFileCB   ();
  511. Xextern void WcTraceCB              ();
  512. Xextern void WcPopupCB              ();
  513. Xextern void WcPopupGrabCB          ();
  514. Xextern void WcPopdownCB            ();
  515. Xextern void WcSystemCB             ();
  516. Xextern void WcExitCB               ();
  517. X
  518. X/*  -- Convenience Actions - Clients generally invoke these only
  519. X       by binding them to widgets via the resource file.  They can
  520. X       be programmatically bound, but generally should not be.
  521. X*/
  522. X
  523. Xextern void WcCreateChildrenACT    ();
  524. Xextern void WcManageACT            ();
  525. Xextern void WcUnmanageACT          ();
  526. Xextern void WcManageChildrenACT    ();
  527. Xextern void WcUnmanageChildrenACT  ();
  528. Xextern void WcDestroyACT           ();
  529. Xextern void WcSetValueACT          ();
  530. Xextern void WcSetSensitiveACT      ();
  531. Xextern void WcSetInsensitiveACT    ();
  532. Xextern void WcLoadResourceFileACT  ();
  533. Xextern void WcTraceACT             ();
  534. Xextern void WcPopupACT             ();
  535. Xextern void WcPopupGrabACT         ();
  536. Xextern void WcPopdownACT           ();
  537. Xextern void WcSystemACT            ();
  538. Xextern void WcExitACT              ();
  539. X
  540. X#endif FUNCTION_PROTOTYPES
  541. X
  542. X#ifdef DEBUG
  543. X#ifdef MOTIF
  544. X#include "WcMotifP.h"
  545. X#else
  546. X#include "WcAthenaP.h"
  547. X#endif
  548. X#endif
  549. X
  550. X#endif _WidgetCreateP_h
  551. +FUNKY+STUFF+
  552. echo '-rw-r--r--  1 david       14752 Jul  2 12:47 WidgetCreateP.h    (as sent)'
  553. chmod u=rw,g=r,o=r WidgetCreateP.h
  554. ls -l WidgetCreateP.h
  555. echo x - XCalP.c
  556. sed 's/^X//' > XCalP.c <<'+FUNKY+STUFF+'
  557. X/*
  558. X*******************************************************************************
  559. X*   XCalP.c 
  560. X*******************************************************************************
  561. X    This program demonstrates usage of the Xrm (X resource management) databse
  562. X    for a widget tree definition and management.
  563. X    There is very little code in this example, since the entire user interface
  564. X    definition is stored in the Xrm database, preferably in the application
  565. X    class resource file:  ~/XCalPClass
  566. X
  567. X    ATTC NOTE: This example does NOT use Ws, since it's intended for demo
  568. X           outside Auto-trol.
  569. X/*
  570. X*******************************************************************************
  571. X*   Include_files.
  572. X*******************************************************************************
  573. X*/
  574. X
  575. X#include <X11/Intrinsic.h>
  576. X#include <X11/Shell.h>
  577. X#include <X11/StringDefs.h>
  578. X#include <WidgetCreate.h>    /* Window System Creation routines */
  579. X
  580. X/* 
  581. X*******************************************************************************
  582. X*   MAIN function
  583. X*******************************************************************************
  584. X*/
  585. X
  586. Xmain ( argc, argv )
  587. Xint    argc;
  588. Xchar **argv;
  589. X{   
  590. X    Widget       appShell;          /* application shell widget       */
  591. X    Display    *display;
  592. X    XtAppContext app;
  593. X
  594. X/*  -- Intialize AWS creating the application shell */
  595. X    XtToolkitInitialize();
  596. X    app = XtCreateApplicationContext();
  597. X    display = XtOpenDisplay(app, NULL, "XCalPClass", "XCalPClass",
  598. X                NULL, 0, &argc, argv );
  599. X
  600. X    WcAddConverters(NULL);
  601. X
  602. X    appShell = XtAppCreateShell("XCalPClass", "XCalPClass",
  603. X                  applicationShellWidgetClass, display,
  604. X                  NULL, 0);
  605. X
  606. X/*  -- Register all Intrinsic classes and constructors */
  607. X    WcRegisterIntrinsic( app );
  608. X
  609. X/*  -- Register all Athena classes and constructors */
  610. X    AriRegisterAthena( app );
  611. X
  612. X/*  -- Create widget tree down from the toplevel shell, using Xrm database */
  613. X    WcWidgetCreation( appShell );
  614. X
  615. X/*  -- Realize the widget tree and enter the main application loop */
  616. X    XtRealizeWidget( appShell );
  617. X    XtAppMainLoop( app );
  618. X}
  619. +FUNKY+STUFF+
  620. echo '-rw-r--r--  1 david        2070 Jul  2 12:22 XCalP.c    (as sent)'
  621. chmod u=rw,g=r,o=r XCalP.c
  622. ls -l XCalP.c
  623. echo x - XCalPClass
  624. sed 's/^X//' > XCalPClass <<'+FUNKY+STUFF+'
  625. X!
  626. X!  XCalP - global resources
  627. X!
  628. X*fontList:             -*-Helvetica-Medium-R-Normal--14*
  629. X*wcTrace:        True
  630. X!  
  631. X!  shell
  632. X!
  633. XXCalPClass.wcChildren:    question,date,Jun1990
  634. X!
  635. X*date.wcClassName:    Command
  636. X*date.label:        28 June 90
  637. X*date.translations:     #override \
  638. X    <Btn1Down>:    WcPopupACT(*Jun1990) \n \
  639. X    <Btn2Down>:    WcCreateChildrenACT(XCalPClass.question, newdate) \
  640. X            WcManageACT(*newdate) \
  641. X            WcPopupACT(*question) \n \
  642. X    <Btn3Down>:    WcCreateChildrenACT(XCalPClass.question, exit) \
  643. X            WcManageACT(*exit) \
  644. X            WcPopupACT(*question)
  645. X!
  646. X!  Jun1990 - the popup shell
  647. X!
  648. X*Jun1990.wcManaged:    False
  649. X*Jun1990.wcConstructor:    XtCreateTopLevelShell
  650. X*Jun1990.wcChildren:    Month
  651. X!
  652. X!  Month - panel containing the strip
  653. X!
  654. X*Month.wcClassName:    Paned
  655. X*Month.wcChildren:    header,action,help,1Fri
  656. X!
  657. X!  header
  658. X!
  659. X*header.wcClassName:        Label
  660. X*header.label:            June 1990
  661. X*header.showGrip:        False
  662. X!
  663. X!  action
  664. X!
  665. X*action.wcClassName:        Form
  666. X*action.wcChildren:        back,quit,next
  667. X*action.showGrip:        False
  668. X*action.defaultDistance:    1
  669. X!
  670. X!
  671. X!  back
  672. X!
  673. X*action.back.wcClassName:    Command
  674. X*action.back.label:        <
  675. X!
  676. X!  quit
  677. X!
  678. X*action.quit.wcClassName:    Command
  679. X*action.quit.label:        Quit
  680. X*action.quit.fromHoriz:        *action.back
  681. X*action.quit.translations:     #override \
  682. X    <Btn1Up>:    WcPopdownACT(*Jun1990)
  683. X!
  684. X!  next
  685. X!
  686. X*action.next.wcClassName:    Command
  687. X*action.next.label:        >
  688. X*action.next.fromHoriz:        *action.quit
  689. X!
  690. X!  help
  691. X!
  692. X*help.wcClassName:        Command
  693. X*help.label:            Help
  694. X*help.showGrip:            False
  695. X!
  696. X!  1 Fri
  697. X!
  698. X*1Fri.wcClassName:        Form
  699. X*1Fri.wcChildren:        label,info
  700. X*1Fri.defaultDistance:        0
  701. X!
  702. X!  label
  703. X!
  704. X*1Fri.label.wcClassName:    Label
  705. X*1Fri.label.label:        " 1 Fri"
  706. X*1Fri.label.borderWidth:    0
  707. X!
  708. X!  info
  709. X!
  710. X*1Fri.info.wcClassName:        Command
  711. X*1Fri.info.label:        Arbitrary text
  712. X*1Fri.info.fromHoriz:        *1Fri.label
  713. X*1Fri.info.borderWidth:        0
  714. X!
  715. X! question - the popup shell
  716. X!
  717. X*question.wcManaged:        False
  718. X*question.wcConstructor:    XtCreateApplicationShell
  719. X*question.wcChildren:        exit,newdate,noedit
  720. X!
  721. X! exit
  722. X!
  723. X*exit.wcDeferred:        True
  724. X*exit.wcManaged:        False
  725. X*exit.wcClassName:        Dialog
  726. X*exit.wcChildren:        yes, no
  727. X*exit.label:            Really exit?
  728. X!
  729. X! yes
  730. X!
  731. X*exit.yes.wcClassName:        Command
  732. X*exit.yes.label:        yes
  733. X*exit.yes.translations:     #override \
  734. X    <Btn1Up>: WcExitACT(0)
  735. X!
  736. X! no
  737. X!
  738. X*exit.no.wcClassName:        Command
  739. X*exit.no.label:            no
  740. X*exit.no.fromHoriz:        *exit.yes
  741. X*exit.no.translations:        #override \
  742. X    <Btn1Up>:    WcUnmanageACT(*exit) \
  743. X            WcDestroyACT(*question.exit) \
  744. X            WcPopdownACT(*question)
  745. X!
  746. X! newdate
  747. X!
  748. X*newdate.wcDeferred:        True
  749. X*newdate.wcManaged:        False
  750. X*newdate.wcClassName:        Dialog
  751. X*newdate.wcChildren:        ok, cancel
  752. X*newdate.label:            Enter mmm yyy?
  753. X!*newdate.value:        
  754. X*newdate.value.translations:     #override \
  755. X    <Key>Return:    WcUnmanageACT(*newdate) \
  756. X            WcDestroyACT(*question.newdate) \
  757. X            WcPopdownACT(*question)
  758. X!
  759. X! ok
  760. X!
  761. X*newdate.ok.wcClassName:    Command
  762. X*newdate.ok.label:        ok
  763. X*newdate.ok.translations:     #override \
  764. X    <Btn1Up>:    WcUnmanageACT(*newdate) \
  765. X            WcDestroyACT(*question.newdate) \
  766. X            WcPopdownACT(*question)
  767. X!
  768. X! cancel
  769. X!
  770. X*newdate.cancel.wcClassName:    Command
  771. X*newdate.cancel.label:        cancel
  772. X*newdate.cancel.fromHoriz:    *newdate.ok
  773. X*newdate.cancel.translations:    #override \
  774. X    <Btn1Up>:    WcUnmanageACT(*newdate) \
  775. X            WcDestroyACT(*question.newdate) \
  776. X            WcPopdownACT(*question)
  777. X!
  778. X! noedit
  779. X!
  780. X*noedit.wcDeferred:        True
  781. X*noedit.wcManaged:        False
  782. X*noedit.wcClassName:        Dialog
  783. X*noedit.wcChildren:        ok
  784. X*noedit.label:            Already editing 1 Jun 1990
  785. X!
  786. X! ok
  787. X!
  788. X*noedit.ok.wcClassName:        Command
  789. X*noedit.ok.label:        ok
  790. X*noedit.ok.translations:     #override \
  791. X    <Btn1Up>:    WcUnmanageACT(*noedit) \
  792. X            WcDestroyACT(*question.noedit) \
  793. X            WcPopdownACT(*question)
  794. X!
  795. +FUNKY+STUFF+
  796. echo '-rw-r--r--  1 david        3567 Jul  2 12:22 XCalPClass    (as sent)'
  797. chmod u=rw,g=r,o=r XCalPClass
  798. ls -l XCalPClass
  799. echo x - Xtos.h
  800. sed 's/^X//' > Xtos.h <<'+FUNKY+STUFF+'
  801. X/*
  802. X* $XConsortium: Xtos.h,v 1.6 89/12/19 08:23:59 swick Exp $
  803. X*/
  804. X
  805. X/***********************************************************
  806. XCopyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts,
  807. Xand the Massachusetts Institute of Technology, Cambridge, Massachusetts.
  808. X
  809. X                        All Rights Reserved
  810. X
  811. XPermission to use, copy, modify, and distribute this software and its 
  812. Xdocumentation for any purpose and without fee is hereby granted, 
  813. Xprovided that the above copyright notice appear in all copies and that
  814. Xboth that copyright notice and this permission notice appear in 
  815. Xsupporting documentation, and that the names of Digital or MIT not be
  816. Xused in advertising or publicity pertaining to distribution of the
  817. Xsoftware without specific, written prior permission.  
  818. X
  819. XDIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  820. XALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
  821. XDIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
  822. XANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
  823. XWHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
  824. XARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  825. XSOFTWARE.
  826. X
  827. X******************************************************************/
  828. X
  829. X#ifndef _Xtos_h
  830. X#define _Xtos_h
  831. X
  832. X#ifdef INCLUDE_ALLOCA_H
  833. X#include <alloca.h>
  834. X#endif
  835. X
  836. X#ifdef CRAY
  837. X#define WORD64
  838. X#define MAXPATHLEN PATH_MAX
  839. X#endif
  840. X
  841. X#ifdef __HIGHC__
  842. X# ifdef MissingStdargH
  843. X#  if MissingStdargH
  844. X#   define MISSING_STDARG_H
  845. X#  endif
  846. X# else
  847. X#  define MISSING_STDARG_H
  848. X# endif
  849. X
  850. X# ifdef MISSING_STDARG_H
  851. X
  852. X#ifndef _STDARG_H
  853. X#define _STDARG_H
  854. X
  855. Xtypedef char *va_list;
  856. X
  857. X/* Amount of space required in an argument list for an arg of type TYPE.
  858. X   TYPE may alternatively be an expression whose type is used.  */
  859. X
  860. X#define __va_rounded_size(TYPE)  \
  861. X  (((sizeof (TYPE) + sizeof (int) - 1) / sizeof (int)) * sizeof (int))
  862. X
  863. X#define va_start(AP, LASTARG)                                           \
  864. X (AP = ((char *) &(LASTARG) + __va_rounded_size (LASTARG)))
  865. X
  866. X#define va_end(AP)
  867. X
  868. X#define va_arg(AP, TYPE)                                                \
  869. X (AP += __va_rounded_size (TYPE),                                       \
  870. X  *((TYPE *) (AP - __va_rounded_size (TYPE))))
  871. X
  872. X#endif /* _STDARG_H */
  873. X
  874. X# endif /* MissingStdargH */
  875. X#endif /* __HIGHC__ */
  876. X
  877. X
  878. X/* stolen from server/include/os.h */
  879. X#ifndef NO_ALLOCA
  880. X/*
  881. X * os-dependent definition of local allocation and deallocation
  882. X * If you want something other than XtMalloc/XtFree for ALLOCATE/DEALLOCATE
  883. X * LOCAL then you add that in here.
  884. X */
  885. X#if defined(__HIGHC__)
  886. X
  887. Xextern char *alloca();
  888. X
  889. X#if HCVERSION < 21003
  890. X#define ALLOCATE_LOCAL(size)    alloca((int)(size))
  891. Xpragma on(alloca);
  892. X#else /* HCVERSION >= 21003 */
  893. X#define    ALLOCATE_LOCAL(size)    _Alloca((int)(size))
  894. X#endif /* HCVERSION < 21003 */
  895. X
  896. X#define DEALLOCATE_LOCAL(ptr)  /* as nothing */
  897. X
  898. X#endif /* defined(__HIGHC__) */
  899. X
  900. X
  901. X#ifdef __GNUC__
  902. X#define alloca __builtin_alloca
  903. X#define ALLOCATE_LOCAL(size) alloca((int)(size))
  904. X#define DEALLOCATE_LOCAL(ptr)  /* as nothing */
  905. X#else /* ! __GNUC__ */
  906. X/*
  907. X * warning: mips alloca is unsuitable in the server, do not use.
  908. X */
  909. X#if defined(vax) || defined(sun)
  910. X/*
  911. X * Some System V boxes extract alloca.o from /lib/libPW.a; if you
  912. X * decide that you don't want to use alloca, you might want to fix it here.
  913. X */
  914. Xchar *alloca();
  915. X#define ALLOCATE_LOCAL(size) alloca((int)(size))
  916. X#define DEALLOCATE_LOCAL(ptr)  /* as nothing */
  917. X#endif /* vax or sun */
  918. X#endif /* __GNUC__ */
  919. X
  920. X#endif /* NO_ALLOCA */
  921. X
  922. X#ifndef ALLOCATE_LOCAL
  923. X#define ALLOCATE_LOCAL(size) XtMalloc((unsigned long)(size))
  924. X#define DEALLOCATE_LOCAL(ptr) XtFree((XtPointer)(ptr))
  925. X#endif /* ALLOCATE_LOCAL */
  926. X
  927. X#endif /* _Xtos_h */
  928. X/* DON'T ADD STUFF AFTER THIS #endif */
  929. +FUNKY+STUFF+
  930. echo '-r--r--r--  1 david        3757 Jun 28 09:13 Xtos.h    (as sent)'
  931. chmod u=r,g=r,o=r Xtos.h
  932. ls -l Xtos.h
  933. echo x - makefile
  934. sed 's/^X//' > makefile <<'+FUNKY+STUFF+'
  935. X#
  936. X# Makefile for Widget Creation Library, one sample application,
  937. X# and three resource interpreters:
  938. X#       libWc        Widget Creation Library built on X11R4 Xt.
  939. X#    libWcm        Widget Creation Library built on Motif 1.0 Xt.
  940. X#    App        Sample application, demo's all Athena widgets.
  941. X#    Ari         Athena Resource Interpreter for Athena interfaces. 
  942. X#    Mri         Motif Resource Interpreter for Motif interfaces.
  943. X#
  944. X# Each target is built in its own makefile, named makefile_<target>.  You
  945. X# are encouraged to make copies of these makefiles and hack them to build
  946. X# your applications which used the Widget Creation Library.
  947. X
  948. X# Motif and X libraries are expected to exist in standard directories 
  949. X# ( /usr/lib ) with the following names:
  950. X#    Motif Widget Library:    libXm.*
  951. X#    Motif Intrinsics:    libXtm.*
  952. X#    Athena Widget Library:    libXaw.*
  953. X#    X Misc Utilities:    libXmu.*
  954. X#    Xt Intrinsics:        libXt.*
  955. X#    X Extensions:        libXext.*
  956. X#    X11 Xlib Library:    libX11.*
  957. X#
  958. X# Note that different Widget Creation Libraries must be created
  959. X# due to Motif using a bizarre version of the Intrinsics.  When
  960. X# Motif 1.1 is released, (hopefully) then only one version of 
  961. X# the library will be needed.
  962. X#
  963. X# Motif include files are expected to be within subdirectories Xm 
  964. X# and Xm/X11 somewhere on the standard include file search path 
  965. X# (typically /usr/include/Xm and /usr/include/Xm/X11).
  966. X#
  967. X# MIT standard distribution include files are expected to be on the 
  968. X# appropriate subdirectories somewhere on the standard include file 
  969. X# search path (typically /usr/include/X11 and /usr/include/X11/Xaw).
  970. X#
  971. X# These makefiles works on Suns, although I can see no architecture
  972. X# dependancies.
  973. X
  974. X#
  975. X# This CC specification can override that in the individual makefiles.
  976. X# Note that the individual makefiles should put debugging options (such
  977. X# as -g) in their CC macros, not in CFLAGS and LDFLAGS macros so this
  978. X# optimization can take place.
  979. X#
  980. X  CC = gcc -DFUNCTION_PROTOTYPES -ansi -O -fstrength-reduce -finline-functions
  981. X# CC = cc -O4
  982. X
  983. Xall: 
  984. X    make -f makefile_libWc
  985. X    make -f makefile_App
  986. X    make -f makefile_XCalP
  987. X    make -f makefile_Ari
  988. X    make -f makefile_libWcm
  989. X    make -f makefile_Mri
  990. X
  991. Xagain:
  992. X    rm -f App Ari Mri
  993. X    make all
  994. X
  995. XApp:
  996. X    make -f makefile_libWc
  997. X    make -f makefile_App
  998. X
  999. XXCalP:
  1000. X    make -f makefile_libWc
  1001. X    make -f makefile_XCalP
  1002. X
  1003. XAri:
  1004. X    make -f makefile_libWc
  1005. X    make -f makefile_Ari
  1006. X
  1007. XMri:
  1008. X    make -f makefile_libWcm
  1009. X    make -f makefile_Mri
  1010. X
  1011. Xoptimal: 
  1012. X    make -f makefile_libWc  "CC=$(CC)"
  1013. X    make -f makefile_App    "CC=$(CC)"
  1014. X    make -f makefile_XCalP  "CC=$(CC)"
  1015. X    make -f makefile_Ari    "CC=$(CC)"
  1016. X    make -f makefile_libWcm "CC=$(CC)"
  1017. X    make -f makefile_Mri    "CC=$(CC)"
  1018. X
  1019. Xclean:
  1020. X    rm -f *.o core
  1021. X
  1022. Xclobber:
  1023. X    make clean
  1024. X    rm -f App XCalP Ari Mri libWc.a libWcm.a
  1025. X
  1026. X###########################################################################
  1027. X# For Imake
  1028. X###########################################################################
  1029. X
  1030. X              TOP = .
  1031. X      CURRENT_DIR = .
  1032. X
  1033. X          DESTDIR =
  1034. X        USRLIBDIR = $(DESTDIR)/usr/lib
  1035. X           LIBDIR = $(USRLIBDIR)/X11
  1036. X        CONFIGDIR = $(LIBDIR)/config
  1037. X
  1038. X               RM = rm -f
  1039. X               MV = mv
  1040. X            IMAKE = imake
  1041. X
  1042. X         IRULESRC = $(CONFIGDIR)
  1043. X    IMAKE_DEFINES = -DHAVE_MOTIF
  1044. X        IMAKE_CMD = $(IMAKE) -DUseInstalled -I$(IRULESRC) $(IMAKE_DEFINES)
  1045. X
  1046. XMakefile::
  1047. X    -@if [ -f Makefile ]; then \
  1048. X    echo "  $(RM) Makefile.bak; $(MV) Makefile Makefile.bak"; \
  1049. X    $(RM) Makefile.bak; $(MV) Makefile Makefile.bak; \
  1050. X    else exit 0; fi
  1051. X    $(IMAKE_CMD) -DTOPDIR=$(TOP) -DCURDIR=$(CURRENT_DIR)
  1052. +FUNKY+STUFF+
  1053. echo '-rw-r--r--  1 david        3464 Jul  3 15:52 makefile    (as sent)'
  1054. chmod u=rw,g=r,o=r makefile
  1055. ls -l makefile
  1056. echo x - makefile_App
  1057. sed 's/^X//' > makefile_App <<'+FUNKY+STUFF+'
  1058. X#
  1059. X# Makefile for App, a sample Athena based application built upon the
  1060. X# Widget Creation Library.
  1061. X#
  1062. X# This makefile works on Suns, although I can see no architecture
  1063. X# dependancies.
  1064. X#
  1065. X# Athena, Widget Creation, and X libraries are expected to exist in 
  1066. X# the current directory or in standard directories ( /usr/lib ) with 
  1067. X# the following names:
  1068. X#    Athena Widgets:        libXaw.*
  1069. X#    Widget Creation:    libWc.*
  1070. X#    X Misc Utilities:    libXmu.*
  1071. X#    Xt Intrinsics:        libXt.*
  1072. X#    X Extensions:        libXext.*
  1073. X#    X11 Xlib Library:    libX11.*
  1074. X#    Math Library:        libm.*
  1075. X#
  1076. X# The only reason libm is needed is for the Athena Clock widget.
  1077. X# If you don't use that widget, you don't need libm.
  1078. X#
  1079. X# This makefile expects that the MIT standard distribution include
  1080. X# files are on the appropriate subdirectories somewhere on the standard
  1081. X# include file search path (typically /usr/include/X11 and
  1082. X# /usr/include/X11/Xaw).
  1083. X
  1084. X#
  1085. X# CC can be overridden from driver makefile.  Note the -g flag
  1086. X# is on the CC macro, not the CFLAGS and LDFLAGS macros, so the
  1087. X# driver makefile can force optimization instead of debugging.
  1088. X#
  1089. X     CC = gcc -g -DFUNCTION_PROTOTYPES -ansi
  1090. X#    CC = cc  -g
  1091. X CFLAGS = -I. -I/usr/include/X11
  1092. XLDFLAGS = -L.
  1093. X
  1094. XTARGET = App
  1095. X  SRCS = App.c AriRegAthena.c
  1096. X  OBJS = App.o AriRegAthena.o
  1097. X  LIBS = -lXaw -lm -lWc -lXmu -lXt -lXext -lX11
  1098. X
  1099. X$(TARGET): $(OBJS)
  1100. X    $(CC) $(LDFLAGS) $(OBJS) $(LIBS) -o $(TARGET)
  1101. X
  1102. Xclean:
  1103. X    rm -f $(OBJS) core
  1104. X
  1105. Xclobber:
  1106. X    make clean
  1107. X    rm -f $(TARGET)
  1108. +FUNKY+STUFF+
  1109. echo '-rw-r--r--  1 david        1441 Jun 28 09:12 makefile_App    (as sent)'
  1110. chmod u=rw,g=r,o=r makefile_App
  1111. ls -l makefile_App
  1112. echo x - makefile_Ari
  1113. sed 's/^X//' > makefile_Ari <<'+FUNKY+STUFF+'
  1114. X#
  1115. X# Makefile for Ari, the Athena Resource Interpreter built upon the
  1116. X# Widget Creation Library.
  1117. X#
  1118. X# This makefile works on Suns, although I can see no architecture
  1119. X# dependancies.
  1120. X#
  1121. X# Athena, Widget Creation, and X libraries are expected to exist in 
  1122. X# the current directory or in standard directories ( /usr/lib ) with 
  1123. X# the following names:
  1124. X#    Athena Widgets:        libXaw.*
  1125. X#       Math library:        libm.*
  1126. X#    Widget Creation:    libWc.*
  1127. X#    X Misc Utilities:    libXmu.*
  1128. X#    Xt Intrinsics:        libXt.*
  1129. X#    X Extensions:        libXext.*
  1130. X#    X11 Xlib Library:    libX11.*
  1131. X#
  1132. X# The math library is needed only because the Athena Clock widget
  1133. X# uses sin and cos.
  1134. X#
  1135. X# This makefile expects that the MIT standard distribution include
  1136. X# files are on the appropriate subdirectories somewhere on the standard
  1137. X# include file search path (typically /usr/include/X11 and
  1138. X# /usr/include/X11/Xaw).
  1139. X
  1140. X#
  1141. X# CC can be overridden from driver makefile.  Note the -g flag
  1142. X# is on the CC macro, not the CFLAGS and LDFLAGS macros, so the
  1143. X# driver makefile can force optimization instead of debugging.
  1144. X#
  1145. X     CC = gcc -g -DFUNCTION_PROTOTYPES -ansi
  1146. X#    CC = cc  -g
  1147. X CFLAGS = -I. -I/usr/include/X11
  1148. XLDFLAGS = -L.
  1149. X
  1150. XTARGET = Ari
  1151. X  SRCS = Ari.c AriRegAthena.c Table.c
  1152. X  OBJS = Ari.o AriRegAthena.o Table.o
  1153. X  LIBS = -lXaw -lm -lWc -lXmu -lXt -lXext -lX11
  1154. X
  1155. X$(TARGET): $(OBJS)
  1156. X    $(CC) $(LDFLAGS) $(OBJS) $(LIBS) -o $(TARGET)
  1157. X
  1158. XTable.o: Table.c
  1159. X    $(CC) $(CFLAGS) -DX11R4 Table.c -c
  1160. X
  1161. Xclean:
  1162. X    rm -f $(OBJS) core
  1163. X
  1164. Xclobber:
  1165. X    make clean
  1166. X    rm -f $(TARGET)
  1167. +FUNKY+STUFF+
  1168. echo '-rw-r--r--  1 david        1483 Jun 28 09:12 makefile_Ari    (as sent)'
  1169. chmod u=rw,g=r,o=r makefile_Ari
  1170. ls -l makefile_Ari
  1171. echo x - makefile_Mri
  1172. sed 's/^X//' > makefile_Mri <<'+FUNKY+STUFF+'
  1173. X#
  1174. X# Makefile for Mri, the Motif Resource Interpreter built upon the
  1175. X# Widget Creation Library.
  1176. X#
  1177. X# This makefile works on Suns, although I can see no architecture
  1178. X# dependancies.
  1179. X#
  1180. X# Motif, Widget Creation, and X libraries are expected to exist in 
  1181. X# the current directory or in standard directories ( /usr/lib ) with 
  1182. X# the following names:
  1183. X#    Motif Widgets:        libXm.*
  1184. X#    Widget Creation:    libWcm.*
  1185. X#    Motif Intrinsics:    libXtm.*
  1186. X#    X11 Xlib Library:    libX11.*
  1187. X#
  1188. X# Note that different Widget Creation libraries must be used
  1189. X# due to Motif using a bizarre version of the Intrinsics.  When
  1190. X# Motif 1.1 is released, (hopefully) then only one version of 
  1191. X# the library will be needed.
  1192. X#
  1193. X# This makefile expects that the Motif include files are within
  1194. X# subdirectories Xm and Xm/X11 somewhere on the standard include
  1195. X# file search path (typically /usr/include/Xm and /usr/include/Xm/X11).
  1196. X
  1197. X#
  1198. X# CC can be overridden from driver makefile.  Note the -g flag
  1199. X# is on the CC macro, not the CFLAGS and LDFLAGS macros, so the
  1200. X# driver makefile can force optimization instead of debugging.
  1201. X#
  1202. X     CC = gcc -g -DDEBUG -DFUNCTION_PROTOTYPES -ansi
  1203. X#    CC = cc  -g -DDEBUG
  1204. X CFLAGS = -DMOTIF -I. -I/usr/include/Xm
  1205. XLDFLAGS = -L.
  1206. X
  1207. XTARGET = Mri
  1208. X  SRCS = Mri.c MriRegMotif.c Table.c
  1209. X  OBJS = Mri.o MriRegMotif.o Table_m.o
  1210. X  LIBS = -lXm -lWcm -lXtm -lX11
  1211. X
  1212. X$(TARGET): $(OBJS)
  1213. X    $(CC) $(LDFLAGS) $(OBJS) $(LIBS) -o $(TARGET)
  1214. X
  1215. XTable_m.o: Table.c
  1216. X    $(CC) $(CFLAGS) -DX11R4 Table.c -c -o Table_m.o
  1217. X
  1218. Xclean:
  1219. X    rm -f $(OBJS) core
  1220. X
  1221. Xclobber:
  1222. X    make clean
  1223. X    rm -f $(TARGET)
  1224. +FUNKY+STUFF+
  1225. echo '-rw-r--r--  1 david        1529 Jul  2 16:36 makefile_Mri    (as sent)'
  1226. chmod u=rw,g=r,o=r makefile_Mri
  1227. ls -l makefile_Mri
  1228. echo x - makefile_XCalP
  1229. sed 's/^X//' > makefile_XCalP <<'+FUNKY+STUFF+'
  1230. X#
  1231. X# Makefile for XCalP, a sample Athena based application built upon the
  1232. X# Widget Creation Library.
  1233. X#
  1234. X# This makefile works on Suns, although I can see no architecture
  1235. X# dependancies.
  1236. X#
  1237. X# Athena, Widget Creation, and X libraries are expected to exist in 
  1238. X# the current directory or in standard directories ( /usr/lib ) with 
  1239. X# the following names:
  1240. X#    Athena Widgets:        libXaw.*
  1241. X#    Widget Creation:    libWc.*
  1242. X#    X Misc Utilities:    libXmu.*
  1243. X#    Xt Intrinsics:        libXt.*
  1244. X#    X Extensions:        libXext.*
  1245. X#    X11 Xlib Library:    libX11.*
  1246. X#    Math Library:        libm.*
  1247. X#
  1248. X# The only reason libm is needed is for the Athena Clock widget.
  1249. X# If you don't use that widget, you don't need libm.
  1250. X#
  1251. X# This makefile expects that the MIT standard distribution include
  1252. X# files are on the appropriate subdirectories somewhere on the standard
  1253. X# include file search path (typically /usr/include/X11 and
  1254. X# /usr/include/X11/Xaw).
  1255. X
  1256. X#
  1257. X# CC can be overridden from driver makefile.  Note the -g flag
  1258. X# is on the CC macro, not the CFLAGS and LDFLAGS macros, so the
  1259. X# driver makefile can force optimization instead of debugging.
  1260. X#
  1261. X     CC = gcc -g -DFUNCTION_PROTOTYPES -ansi
  1262. X#    CC = cc  -g
  1263. X CFLAGS = -I. -I/usr/include/X11
  1264. XLDFLAGS = -L.
  1265. X
  1266. XTARGET = XCalP
  1267. X  SRCS = XCalP.c AriRegAthena.c WcRegIntrinsic.c
  1268. X  OBJS = XCalP.o AriRegAthena.o WcRegIntrinsic.o
  1269. X  LIBS = -lXaw -lm -lWc -lXmu -lXt -lXext -lX11
  1270. X
  1271. X$(TARGET): $(OBJS)
  1272. X    $(CC) $(LDFLAGS) $(OBJS) $(LIBS) -o $(TARGET)
  1273. X
  1274. Xclean:
  1275. X    rm -f $(OBJS) core
  1276. X
  1277. Xclobber:
  1278. X    make clean
  1279. X    rm -f $(TARGET)
  1280. +FUNKY+STUFF+
  1281. echo '-rw-r--r--  1 david        1483 Jul  2 12:22 makefile_XCalP    (as sent)'
  1282. chmod u=rw,g=r,o=r makefile_XCalP
  1283. ls -l makefile_XCalP
  1284. echo x - makefile_libWc
  1285. sed 's/^X//' > makefile_libWc <<'+FUNKY+STUFF+'
  1286. X#
  1287. X# Makefile for Widget Creation Library built on X11R4 Xt Intrinsics.
  1288. X#
  1289. X# This makefile works on Suns, although I can see no architecture
  1290. X# dependancies.
  1291. X#
  1292. X# This makefile expects that the MIT standard distribution include
  1293. X# files are on the appropriate subdirectories somewhere on the standard
  1294. X# include file search path (typically /usr/include/X11 and
  1295. X# /usr/include/X11/Xaw).
  1296. X
  1297. X#
  1298. X# CC can be overridden from driver makefile.  Note the -g flag
  1299. X# is on the CC macro, not the CFLAGS and LDFLAGS macros, so the
  1300. X# driver makefile can force optimization instead of debugging.
  1301. X#
  1302. X     CC = gcc -g -DFUNCTION_PROTOTYPES -ansi
  1303. X#    CC = cc  -g
  1304. X CFLAGS = -I. -I/usr/include/X11
  1305. X
  1306. XTARGET = libWc.a
  1307. X  SRCS = WcCreateFunc.c WcCallbacks.c WcConverters.c WcNameFuncs.c \
  1308. X     WcRegister.c WcActions.c
  1309. X  OBJS = WcCreateFunc.o WcCallbacks.o WcConverters.o WcNameFuncs.o \
  1310. X     WcRegister.o WcActions.o
  1311. X
  1312. X$(TARGET): $(OBJS) 
  1313. X    rm -f $(TARGET)
  1314. X    ar rc $(TARGET) $(OBJS)
  1315. X    ranlib $(TARGET)
  1316. X
  1317. Xclean:
  1318. X    rm -f $(OBJS) core
  1319. X
  1320. Xclobber:
  1321. X    make clean
  1322. X    rm -f $(TARGET)
  1323. +FUNKY+STUFF+
  1324. echo '-rw-r--r--  1 david        1028 Jul  2 12:36 makefile_libWc    (as sent)'
  1325. chmod u=rw,g=r,o=r makefile_libWc
  1326. ls -l makefile_libWc
  1327. echo x - makefile_libWcm
  1328. sed 's/^X//' > makefile_libWcm <<'+FUNKY+STUFF+'
  1329. X#
  1330. X# Makefile for Widget Creation Library built on Motif 1.0 Xt Intrinsics
  1331. X#
  1332. X# This makefile works on Suns, although I can see no architecture
  1333. X# dependancies.
  1334. X#
  1335. X# Note that different Widget Creation libraries and object files must 
  1336. X# be created due to Motif using a bizarre version of the Intrinsics.  
  1337. X# When Motif 1.1 is released, (hopefully) then only one version of 
  1338. X# the library will be needed.
  1339. X#
  1340. X# This makefile expects that the Motif include files are within
  1341. X# subdirectories Xm and Xm/X11 somewhere on the standard include
  1342. X# file search path (typically /usr/include/Xm and /usr/include/Xm/X11).
  1343. X
  1344. X#
  1345. X# CC can be overridden from driver makefile.  Note the -g flag
  1346. X# is on the CC macro, not the CFLAGS and LDFLAGS macros, so the
  1347. X# driver makefile can force optimization instead of debugging.
  1348. X#
  1349. X     CC = gcc -g -DEBUG -DFUNCTION_PROTOTYPES -ansi
  1350. X#    CC = cc  -g -DEBUG
  1351. X CFLAGS = -DMOTIF -I. -I/usr/include/Xm
  1352. X
  1353. XTARGET = libWcm.a
  1354. X  SRCS = WcCreateFunc.c WcCallbacks.c WcConverters.c WcNameFuncs.c \
  1355. X     WcRegister.c WcActions.c
  1356. X  OBJS = WcmCreateFunc.o WcmCallbacks.o WcmConverters.o WcmNameFuncs.o \
  1357. X     WcmRegister.o WcmActions.o
  1358. X
  1359. X$(TARGET): $(OBJS)
  1360. X    rm -f $(TARGET)
  1361. X    ar rc $(TARGET) $(OBJS)
  1362. X    ranlib $(TARGET)
  1363. X
  1364. XWcmCreateFunc.o: WcCreateFunc.c
  1365. X    $(CC) $(CFLAGS) WcCreateFunc.c -c -o WcmCreateFunc.o
  1366. XWcmCallbacks.o: WcCallbacks.c
  1367. X    $(CC) $(CFLAGS) WcCallbacks.c  -c -o WcmCallbacks.o
  1368. XWcmConverters.o: WcConverters.c
  1369. X    $(CC) $(CFLAGS) WcConverters.c -c -o WcmConverters.o
  1370. XWcmNameFuncs.o: WcNameFuncs.c
  1371. X    $(CC) $(CFLAGS) WcNameFuncs.c  -c -o WcmNameFuncs.o
  1372. XWcmRegister.o: WcRegister.c
  1373. X    $(CC) $(CFLAGS) WcRegister.c   -c -o WcmRegister.o
  1374. XWcmActions.o: WcActions.c
  1375. X    $(CC) $(CFLAGS) WcActions.c    -c -o WcmActions.o
  1376. X
  1377. Xclean:
  1378. X    rm -f $(OBJS) core
  1379. X
  1380. Xclobber:
  1381. X    make clean
  1382. X    rm -f $(TARGET)
  1383. +FUNKY+STUFF+
  1384. echo '-rw-r--r--  1 david        1774 Jul  2 12:35 makefile_libWcm    (as sent)'
  1385. chmod u=rw,g=r,o=r makefile_libWcm
  1386. ls -l makefile_libWcm
  1387. echo x - patchlevel.h
  1388. sed 's/^X//' > patchlevel.h <<'+FUNKY+STUFF+'
  1389. X#define PATCHLEVEL 1
  1390. +FUNKY+STUFF+
  1391. echo '-rw-r--r--  1 david          21 Jul  2 16:21 patchlevel.h    (as sent)'
  1392. chmod u=rw,g=r,o=r patchlevel.h
  1393. ls -l patchlevel.h
  1394. echo x - test
  1395. sed 's/^X//' > test <<'+FUNKY+STUFF+'
  1396. X# !/bin/csh
  1397. X#
  1398. X# Execute all of the programs in the Widget Creation Library
  1399. X# delivery.
  1400. X#
  1401. X
  1402. Xalias se setenv XENVIRONMENT
  1403. X
  1404. Xecho This script will execute the programs once at a time.
  1405. X
  1406. Xif (-e App) then
  1407. X    se App01.Everything
  1408. X    App
  1409. Xendif
  1410. X
  1411. Xif (-e Ari) then
  1412. X    foreach example (Ari0*)
  1413. X    se $example
  1414. X    Ari 
  1415. X    end
  1416. Xendif
  1417. X
  1418. Xif (-e Mri) then
  1419. X    foreach example (Mri0*)
  1420. X    se $example
  1421. X    Mri 
  1422. X    end
  1423. Xendif
  1424. X
  1425. Xif (-e XCalP) then
  1426. X    se XCalPClass
  1427. X    XCalP 
  1428. Xendif
  1429. +FUNKY+STUFF+
  1430. echo '-rwxr-xr-x  1 david         448 Jul  3 16:25 test*    (as sent)'
  1431. chmod u=rwx,g=rx,o=rx test
  1432. ls -l test
  1433. exit 0
  1434.  
  1435. dan
  1436. ----------------------------------------------------
  1437. O'Reilly && Associates   argv@sun.com / argv@ora.com
  1438. Opinions expressed reflect those of the author only.
  1439.