home *** CD-ROM | disk | FTP | other *** search
/ Meeting Pearls 3 / Meeting_Pearls_III.iso / Pearls / texmf / source / driver / show / amiga / am_requ.h < prev    next >
Encoding:
C/C++ Source or Header  |  1995-05-26  |  11.3 KB  |  512 lines

  1. /* *** am_requ.h *** */
  2.  
  3.  
  4.  
  5. #define CREQ_LOOK_X        13
  6. #define CREQ_LOOK_Y        10
  7.  
  8. #define CREQ_HEADER_Y        13
  9.  
  10. #define CREQ_X_KOO        170
  11. #define CREQ_Y_KOO        40
  12. #define CREQ_WIDTH        300
  13. #define CREQ_HEIGHT        115
  14. #define CREQ_DISTANCE_Y        30    /* Distance left-right-border */
  15.  
  16. #define CREQ_OC_WIDTH        60
  17. #define CREQ_OC_HEIGHT        20
  18. #define CREQ_OC_HEIGHT_NL    20    /* Hoehe im Non-Interlace */
  19. #define CREQ_OK_X        (CREQ_DISTANCE_Y)
  20. #define CREQ_OK_Y        (CREQ_HEIGHT - (3*CREQ_OC_HEIGHT)/2)
  21. #define CREQ_CANCEL_X        (CREQ_WIDTH - CREQ_DISTANCE_Y - CREQ_OC_WIDTH)
  22. #define CREQ_CANCEL_Y        (CREQ_OK_Y)
  23.  
  24. #define CREQ_RGB_LENGTH        (CREQ_WIDTH-2*CREQ_DISTANCE_Y-10)
  25. #define CREQ_RGB_HEIGHT        10
  26. #define CREQ_RGB_DIST        7
  27. #define CREQ_R_Y        30
  28. #define CREQ_G_Y        (CREQ_R_Y+CREQ_RGB_HEIGHT+CREQ_RGB_DIST)
  29. #define CREQ_B_Y        (CREQ_G_Y+CREQ_RGB_HEIGHT+CREQ_RGB_DIST)
  30.  
  31. #define CREQ_COL_WIDTH        40
  32. #define CREQ_COL_HEIGHT        12
  33. #define CREQ_COL_DIS_01        15
  34. #define CREQ_DIST_FR_TOP    11
  35. #define CREQ_COL_1_X        (CREQ_WIDTH-CREQ_DISTANCE_Y-CREQ_COL_WIDTH)
  36. #define CREQ_COL_0_X        (CREQ_COL_1_X-CREQ_COL_DIS_01-CREQ_COL_WIDTH)
  37. #define CREQ_COL_1_Y        (CREQ_DIST_FR_TOP)
  38. #define CREQ_COL_0_Y        (CREQ_DIST_FR_TOP)
  39.  
  40.  
  41. #if !defined(REQ_LIBRARY)
  42.  
  43.  
  44. static struct IntuiText col_cancel_text =
  45.  {
  46.     1, 0, JAM2, 6, 6,
  47.     (struct TextAttr*)&txtAttr, (UBYTE*)"cancel",
  48.     (struct IntuiText*)NULL
  49.  };
  50.  
  51. static struct IntuiText col_ok_text =
  52.  {
  53.     1, 0, JAM2, 23, 6,
  54.     (struct TextAttr*)&txtAttr, (UBYTE*)"ok",
  55.     (struct IntuiText*)NULL
  56.  };
  57.  
  58.  
  59. static struct IntuiText color_text =
  60.  {
  61.     1, 0, JAM2, CREQ_DISTANCE_Y, CREQ_HEADER_Y, (struct TextAttr*)&txtAttr, 
  62.     (UBYTE*)"Color-Requester:", (struct IntuiText*)NULL
  63.  };
  64.  
  65. static SHORT cborder_oc_pairs[10] = 
  66.   {  0,0, CREQ_OC_WIDTH-1,0, CREQ_OC_WIDTH-1,
  67.      CREQ_OC_HEIGHT-1, 0,CREQ_OC_HEIGHT-1, 0,0 };
  68.  
  69. static struct Border cborder_oc =
  70.  {
  71.     (SHORT)0, (SHORT)0,
  72.     (SHORT)1, (SHORT)0, JAM1, (SHORT)5,
  73.     cborder_oc_pairs, NULL
  74.  };
  75.  
  76. static struct IntuiText col_rgb_text_r =
  77.  {
  78.     1, 0, JAM2, CREQ_RGB_LENGTH+2, CREQ_RGB_HEIGHT-8,
  79.     (struct TextAttr*)&txtAttr, (UBYTE*)"R", (struct IntuiText*)NULL
  80.  };
  81.  
  82. static struct IntuiText col_rgb_text_g =
  83.  {
  84.     1, 0, JAM2, CREQ_RGB_LENGTH+2, CREQ_RGB_HEIGHT-8,
  85.     (struct TextAttr*)&txtAttr, (UBYTE*)"G", (struct IntuiText*)NULL
  86.  };
  87.  
  88. static struct IntuiText col_rgb_text_b =
  89.  {
  90.     1, 0, JAM2, CREQ_RGB_LENGTH+2, CREQ_RGB_HEIGHT-8,
  91.     (struct TextAttr*)&txtAttr, (UBYTE*)"B", (struct IntuiText*)NULL
  92.  };
  93.  
  94. static SHORT cborder_rgb_pairs[10] = 
  95.   {  0,0, CREQ_RGB_LENGTH-1,0, CREQ_RGB_LENGTH-1,
  96.      CREQ_RGB_HEIGHT-1, 0,CREQ_RGB_HEIGHT-1, 0,0 };
  97.  
  98. static struct Border cborder_rgb_r =
  99.  {
  100.     (SHORT)0, (SHORT)0,
  101.     (SHORT)1, (SHORT)0, JAM1, (SHORT)5,
  102.     cborder_rgb_pairs, NULL
  103.  };
  104.  
  105. static struct Border cborder_rgb_g =
  106.  {
  107.     (SHORT)0, (SHORT)0,
  108.     (SHORT)1, (SHORT)0, JAM1, (SHORT)5,
  109.     cborder_rgb_pairs, NULL
  110.  };
  111.  
  112. static struct Border cborder_rgb_b =
  113.  {
  114.     (SHORT)0, (SHORT)0,
  115.     (SHORT)1, (SHORT)0, JAM1, (SHORT)5,
  116.     cborder_rgb_pairs, NULL
  117.  };
  118.  
  119. /* die naechsten 3 PropInfo's *nicht* static wg. gatget.c/follow_pot_gad */
  120. /* werden in am_requ.i extern definiert */
  121. struct PropInfo cprop_r_info =
  122.  {
  123.     AUTOKNOB | FREEHORIZ,
  124.     0,0,
  125.     4095,0,
  126.     0,0,0,0,0,0
  127.  };
  128.  
  129. struct PropInfo cprop_g_info =
  130.  {
  131.     AUTOKNOB | FREEHORIZ,
  132.     1000,0,
  133.     4095,0,
  134.     0,0,0,0,0,0
  135.  };
  136.  
  137. struct PropInfo cprop_b_info =
  138.  {
  139.     AUTOKNOB | FREEHORIZ,
  140.     10000,0,
  141.     4095,0,
  142.     0,0,0,0,0,0
  143.  };
  144.  
  145.  
  146. static struct Gadget color_red_gadg =
  147.   {
  148.     NULL,
  149.     CREQ_OK_X, CREQ_R_Y, CREQ_RGB_LENGTH, CREQ_RGB_HEIGHT,
  150.     GADGHNONE,
  151.     GADGIMMEDIATE | RELVERIFY,
  152.     PROPGADGET | REQGADGET,
  153.     (APTR)&cborder_rgb_r,
  154.     NULL,
  155.     &col_rgb_text_r,
  156.     0L,
  157.     (APTR)&cprop_r_info,
  158.     COL_RED_NR,
  159.     NULL
  160.   };
  161.  
  162. static struct Gadget color_green_gadg =
  163.   {
  164.     &color_red_gadg,
  165.     CREQ_OK_X, CREQ_G_Y, CREQ_RGB_LENGTH, CREQ_RGB_HEIGHT,
  166.     GADGHCOMP,
  167.     GADGIMMEDIATE | RELVERIFY,
  168.     PROPGADGET | REQGADGET,
  169.     (APTR)&cborder_rgb_g,
  170.     NULL,
  171.     &col_rgb_text_g,
  172.     0L,
  173.     (APTR)&cprop_g_info,
  174.     COL_GREEN_NR,
  175.     NULL
  176.   };
  177.  
  178. static struct Gadget color_blue_gadg =
  179.   {
  180.     &color_green_gadg,
  181.     CREQ_OK_X, CREQ_B_Y, CREQ_RGB_LENGTH, CREQ_RGB_HEIGHT,
  182.     GADGHBOX,
  183.     GADGIMMEDIATE | RELVERIFY,
  184.     PROPGADGET | REQGADGET,
  185.     (APTR)&cborder_rgb_b,
  186.     NULL,
  187.     &col_rgb_text_b,
  188.     0L,
  189.     (APTR)&cprop_b_info,
  190.     COL_BLUE_NR,
  191.     NULL
  192.   };
  193.  
  194.  
  195. static struct Gadget color_cancel_gadg =
  196.   {
  197.     &color_blue_gadg,
  198.     CREQ_CANCEL_X, CREQ_CANCEL_Y, CREQ_OC_WIDTH, CREQ_OC_HEIGHT,
  199.     GADGHCOMP,
  200.     RELVERIFY | ENDGADGET,
  201.     BOOLGADGET | REQGADGET,
  202.     (APTR)&cborder_oc,
  203.     NULL,
  204.     &col_cancel_text,
  205.     0L,
  206.     NULL,
  207.     COL_CANCEL_GAD_NR,
  208.     NULL
  209.   };
  210.  
  211.  
  212. static struct Gadget color_ok_gadg =
  213.   {
  214.     &color_cancel_gadg,
  215.     CREQ_OK_X, CREQ_OK_Y, CREQ_OC_WIDTH, CREQ_OC_HEIGHT,
  216.     GADGHCOMP,
  217.     RELVERIFY | ENDGADGET,
  218.     BOOLGADGET | REQGADGET,
  219.     (APTR)&cborder_oc,
  220.     NULL,
  221.     &col_ok_text,
  222.     0L,
  223.     NULL,
  224.     COL_OK_GAD_NR,
  225.     NULL
  226.   };
  227.  
  228.  
  229. static SHORT cborder_01_pairs[10] = 
  230.   {  0,0, CREQ_COL_WIDTH-1,0, CREQ_COL_WIDTH-1,
  231.      CREQ_COL_HEIGHT-1, 0,CREQ_COL_HEIGHT-1, 0,1 };
  232.  
  233. static struct Border cborder_01 =
  234.  {
  235.     (SHORT)0, (SHORT)0,
  236.     (SHORT)1, (SHORT)0, JAM1, (SHORT)5,
  237.     cborder_01_pairs, NULL
  238.  };
  239.  
  240. static struct Gadget color_0_gadg =
  241.   {
  242.     &color_ok_gadg,
  243.     CREQ_COL_0_X, CREQ_COL_0_Y, CREQ_COL_WIDTH, CREQ_COL_HEIGHT,
  244.     GADGHBOX,
  245.     RELVERIFY,
  246.     BOOLGADGET | REQGADGET,
  247.     (APTR)&cborder_01,
  248.     NULL,
  249.     NULL,
  250.     0L,
  251.     NULL,
  252.     COL_0_GAD_NR,
  253.     NULL
  254.   };
  255.  
  256.  
  257. static struct Gadget color_1_gadg =
  258.   {
  259.     &color_0_gadg,
  260.     CREQ_COL_1_X, CREQ_COL_1_Y, CREQ_COL_WIDTH, CREQ_COL_HEIGHT,
  261.     GADGHBOX,
  262.     RELVERIFY,
  263.     BOOLGADGET | REQGADGET,
  264.     (APTR)&cborder_01,
  265.     NULL,
  266.     NULL,
  267.     0L,
  268.     NULL,
  269.     COL_1_GAD_NR,
  270.     NULL
  271.   };
  272.  
  273.  
  274.  
  275. static SHORT color_border_pairs[18] = 
  276.   {  CREQ_LOOK_X, 0,
  277.      CREQ_WIDTH-CREQ_LOOK_X-1, 0, 
  278.      CREQ_WIDTH-1, CREQ_LOOK_Y,
  279.      CREQ_WIDTH-1, CREQ_HEIGHT-CREQ_LOOK_Y-1,
  280.      CREQ_WIDTH-CREQ_LOOK_X-1, CREQ_HEIGHT-1,
  281.      CREQ_LOOK_X,CREQ_HEIGHT-1, 
  282.      0, CREQ_HEIGHT-CREQ_LOOK_Y-1, 
  283.      0, CREQ_LOOK_Y,
  284.      CREQ_LOOK_X,0
  285.   };
  286.  
  287. static struct Border color_border =
  288.  {
  289.     (SHORT)0, (SHORT)0,
  290.     (SHORT)1, (SHORT)0, JAM1, (SHORT)9,
  291.     color_border_pairs, NULL
  292.  };
  293.  
  294.  
  295. static struct Requester color_request = 
  296.   { 
  297.     NULL,
  298.     0, 0,    /* wird beim Aufruf belegt */
  299.     CREQ_WIDTH, CREQ_HEIGHT,
  300.     0, 0,
  301.     &color_1_gadg,
  302.     &color_border,
  303.     &color_text,
  304.     0,
  305.     0,
  306.     NULL,
  307.     {0},
  308.     NULL,
  309.     NULL,
  310.     {0}
  311.   };
  312.  
  313. #endif /* REQ_LIBRARY */
  314.  
  315.  
  316.  
  317. /****************************************************************************/
  318.  
  319.  
  320. struct MyTextStruct {
  321.   short xKoo, yKoo;    /* 10, 10 ist Zeile 1, Spalte 1 */
  322.   struct IntuiText txt;
  323. };
  324.  
  325.  
  326. #define ABOUTREQNUM 14
  327.  
  328. static struct MyTextStruct AboutReqText[] = {
  329.    180,   6, { 1, 0, JAM1, 0, 0, &AbWintxtAttr, "Pas",                                NULL },
  330.    208,   6, { 1, 0, JAM1, 0, 0, &AbWintxtAttr, "T",                                NULL },
  331.    215,   9, { 1, 0, JAM1, 0, 0, &AbWintxtAttr, "E",                                NULL },
  332.    224,   6, { 1, 0, JAM1, 0, 0, &AbWintxtAttr, "X  ---  S h o w D V I",                    NULL },
  333.    298,  20, { 1, 0, JAM1, 0, 0, &AbWintxtAttr, "by",                                NULL },
  334.    250,  30, { 1, 0, JAM1, 0, 0, &AbWintxtAttr, "Georg Heßmann",                        NULL },
  335.    100,  44, { 1, 0, JAM1, 0, 0, &AbWintxtAttr, "Copyright © 1990-1995, All Rights Reserved.",            NULL },
  336.     30,  59, { 1, 0, JAM1, 0, 0, &AbWintxtAttr, "The programs ShowDVI, DVIprint and Flib are freely",        NULL },
  337.     30,  69, { 1, 0, JAM1, 0, 0, &AbWintxtAttr, "distributable copyrighted software (see the README file).",    NULL },
  338.     30,  82, { 1, 0, JAM1, 0, 0, &AbWintxtAttr, "See also the GNU general public license (COPYING file).",    NULL },
  339.     30,  95, { 1, 0, JAM1, 0, 0, &AbWintxtAttr, "If you have any hints, bugs, or questions about",        NULL },
  340.     30, 105, { 1, 0, JAM1, 0, 0, &AbWintxtAttr, "the programs, ask in comp.sys.amiga.applications,",        NULL },
  341.     30, 115, { 1, 0, JAM1, 0, 0, &AbWintxtAttr, "de.comp.sys.amiga.misc or contact me.",            NULL },
  342.    190, 130, { 1, 0, JAM1, 0, 0, &AbWintxtAttr, "email: hessmann@informatik.uni-hamburg.de",            NULL },
  343. };
  344.  
  345.  
  346.  
  347.  
  348. /********************************************************************/
  349.  
  350.  
  351.  
  352.  
  353. #define YOFFLACE        16
  354. #define YOFFNOLA        10
  355.  
  356. #define NORM_HLACE        130
  357. #define NORM_HUNLA        160
  358.  
  359. #define ABOUT_WIDTH        500
  360. #define ABOUT_HEIGHT        ((is_lace) ? (2 * NORM_HLACE) : (NORM_HUNLA))
  361.  
  362. #if 0    /* wird nicht mehr gebraucht */
  363. #define ABOUT_X_KOO        ((x_win_width-ABOUT_WIDTH)/2)
  364. #define ABOUT_Y_KOO        ((x_win_height-ABOUT_HEIGHT)/2)
  365. #endif
  366.  
  367. #define ABOUT_OK_WIDTH        (CREQ_OC_WIDTH)
  368. #define ABOUT_OK_HEIGHT        ((is_lace) ? (CREQ_OC_HEIGHT) : (CREQ_OC_HEIGHT_NL))
  369. #define ABOUT_OK_X        ((ABOUT_WIDTH-ABOUT_OK_WIDTH)/3)
  370. #define ABOUT_HELP_X        (2*((ABOUT_WIDTH-ABOUT_OK_WIDTH)/3))
  371. #define ABOUT_OK_Y        (ABOUT_HEIGHT - (3*ABOUT_OK_HEIGHT)/2 \
  372.                     + ((is_lace) ? 0 : 3))
  373.  
  374.  
  375. #define ABOUT_HELP_STRING    " help "
  376. #define ABOUT_ABOUT_STRING    " about"
  377. #define ABOUT_MORE_STRING    " more "
  378.  
  379.  
  380. static struct IntuiText about_ok_text = 
  381.   {  1, 0, JAM2, 23, 6,
  382.      (struct TextAttr*)&txtAttr, (UBYTE*)"ok",
  383.      (struct IntuiText*)NULL
  384.   };
  385.  
  386. static struct IntuiText about_help_text = 
  387.   {  1, 0, JAM2, 7, 6,
  388.      (struct TextAttr*)&txtAttr, (UBYTE*)NULL,
  389.      (struct IntuiText*)NULL
  390.   };
  391.  
  392. static SHORT about_border_no_pairs[10] = 
  393.   {  0,0, ABOUT_OK_WIDTH-1,0, ABOUT_OK_WIDTH-1,
  394.      3, 0,3, 0,0 };
  395.  
  396. static SHORT about_border_ok_pairs[10] =     /* 3-> zu Laufzeit eingesetzt */
  397.  { -2,-2, ABOUT_OK_WIDTH+1,-2, ABOUT_OK_WIDTH+1,3,
  398.    -2,3, -2,-2
  399.  };
  400.  
  401.  
  402. static struct Border about_border_no =
  403.  {
  404.     (SHORT)0, (SHORT)0,
  405.     (SHORT)1, (SHORT)0, JAM1, (SHORT)5,
  406.     about_border_no_pairs, NULL
  407.  };
  408.  
  409. static struct Border about_border_ok =
  410.  {
  411.     (SHORT)0, (SHORT)0,
  412.     (SHORT)1, (SHORT)0, JAM1, (SHORT)5,
  413.     about_border_ok_pairs, &about_border_no
  414.  };
  415.  
  416. static struct Gadget about_help_gadg =
  417.   {
  418.     NULL,
  419.     ABOUT_HELP_X, 0, ABOUT_OK_WIDTH, 0,
  420.     GADGHCOMP,
  421.     RELVERIFY,
  422.     BOOLGADGET | REQGADGET,
  423.     (APTR)&about_border_no,
  424.     NULL,
  425.     &about_help_text,
  426.     0L,
  427.     NULL,
  428.     ABOUT_HELP_GAD_NR,
  429.     NULL
  430.   };
  431.  
  432.  
  433. static struct Gadget about_ok_gadg =
  434.   {
  435.     &about_help_gadg,
  436.     ABOUT_OK_X, 0, ABOUT_OK_WIDTH, 0,
  437.     GADGHCOMP,
  438.     RELVERIFY | ENDGADGET,
  439.     BOOLGADGET | REQGADGET,
  440.     (APTR)&about_border_ok,
  441.     NULL,
  442.     &about_ok_text,
  443.     0L,
  444.     NULL,
  445.     ABOUT_OK_GAD_NR,
  446.     &about_help_gadg /*NULL*/
  447.   };
  448.  
  449. static SHORT about_border_pairs[10] = 
  450.  { 0,0, ABOUT_WIDTH-1,0, ABOUT_WIDTH-1,3,    /* 3-> zu Laufzeit eingesetzt */
  451.    0,3, 0,0
  452.  };
  453.  
  454. static struct Border about_border =
  455.  {
  456.     (SHORT)0, (SHORT)0,
  457.     (SHORT)1, (SHORT)0, JAM1, (SHORT)5,
  458.     about_border_pairs, NULL
  459.  };
  460.  
  461.  
  462. #if 0    /* dies wird nicht mehr gebraucht! */
  463. static struct IntuiText about_text =
  464.  {
  465.     1, 0, JAM2, ABOUT_WIDTH/2, 200, (struct TextAttr*)&txtAttr, 
  466.     (UBYTE*)"About-Requester:", (struct IntuiText*)NULL
  467.  };
  468.  
  469. static struct Requester about_request = 
  470.   { 
  471.     NULL,
  472.     0, 0,    /* wird beim Aufruf belegt */
  473.     ABOUT_WIDTH, 0,
  474.     0, 0,
  475.     &about_ok_gadg,
  476.     &about_border,
  477.     NULL /*&about_text*/,
  478.     0,
  479.     0,
  480.     NULL,
  481.     {0},
  482.     NULL,
  483.     NULL,
  484.     {0}
  485.   };
  486. #endif
  487.  
  488. static struct IntuiText end_body_text =
  489.  {
  490.     0, 1, JAM2, 14, 15,
  491.     (struct TextAttr*)&txtAttr, (UBYTE*)"... really exit the program?",
  492.     (struct IntuiText*)NULL
  493.  };
  494.  
  495.  
  496. static struct IntuiText end_positive_text =
  497.  {
  498.     0, 1, JAM2, 7, 4,
  499.     (struct TextAttr*)&txtAttr, (UBYTE*)"Yes",
  500.     (struct IntuiText*)NULL
  501.  };
  502.  
  503.  
  504. static struct IntuiText end_negative_text =
  505.  {
  506.     0, 1, JAM2, 7, 4,
  507.     (struct TextAttr*)&txtAttr, (UBYTE*)"Oh, No!",
  508.     (struct IntuiText*)NULL
  509.  };
  510.  
  511.  
  512.