home *** CD-ROM | disk | FTP | other *** search
/ Usenet 1994 January / usenetsourcesnewsgroupsinfomagicjanuary1994.iso / sources / x / volume19 / xfig / part01 / w_util.h < prev    next >
Encoding:
C/C++ Source or Header  |  1993-05-27  |  1.7 KB  |  60 lines

  1. /*
  2.  * FIG : Facility for Interactive Generation of figures
  3.  * Copyright (c) 1985 by Supoj Sutanthavibul
  4.  *
  5.  * "Permission to use, copy, modify, distribute, and sell this software and its
  6.  * documentation for any purpose is hereby granted without fee, provided that
  7.  * the above copyright notice appear in all copies and that both the copyright
  8.  * notice and this permission notice appear in supporting documentation. 
  9.  * No representations are made about the suitability of this software for 
  10.  * any purpose.  It is provided "as is" without express or implied warranty."
  11.  */
  12.  
  13. /* constant values used for popup_query */
  14.  
  15. #define QUERY_YES    0
  16. #define QUERY_YESNO    1
  17. #define RESULT_NO    -1
  18. #define RESULT_YES    1
  19. #define RESULT_CANCEL    0
  20.  
  21. /*
  22.  * Author:    Doyle C. Davidson
  23.  *        Intergraph Corporation
  24.  *        One Madison Industrial Park
  25.  *        Huntsville, Al.     35894-0001
  26.  *
  27.  * Modification history:
  28.  *        11 May 91 - added SetValues and GetValues - Paul King
  29.  *
  30.  * My macros for using XtSetArg easily:
  31.  * Usage:
  32.  *
  33.  *    blah()
  34.  *    {
  35.  *    DeclareArgs(2);
  36.  *        ...
  37.  *        FirstArg(XmNx, 100);
  38.  *        NextArg(XmNy, 80);
  39.  *        button = XmCreatePushButton(parent, name, Args, ArgCount);
  40.  *    }
  41.  */
  42.  
  43. #include "assert.h"
  44.  
  45. #define ArgCount    _fooArgCount
  46. #define Args        _fooArgList
  47. #define ArgCountMax    _fooArgCountMax
  48.  
  49. #define DeclareArgs(n)    Arg Args[n]; int ArgCountMax = n; int ArgCount
  50.  
  51. #define DeclareStaticArgs(n)  static Arg Args[n]; static int ArgCountMax = n; static int ArgCount
  52.  
  53. #define FirstArg(name, val) \
  54.     { XtSetArg(Args[0], (name), (val)); ArgCount=1;}
  55. #define NextArg(name, val) \
  56.     { assert(ArgCount < ArgCountMax); \
  57.       XtSetArg(Args[ArgCount], (name), (val)); ArgCount++;}
  58. #define GetValues(n)    XtGetValues(n, Args, ArgCount)
  59. #define SetValues(n)    XtSetValues(n, Args, ArgCount)
  60.