home *** CD-ROM | disk | FTP | other *** search
/ The Fred Fish Collection 1.5 / ffcollection-1-5-1992-11.iso / ff_progs / libs / plotlib.lha / Plot_1.lzh / Demo / HpPlot.h < prev    next >
Encoding:
C/C++ Source or Header  |  1990-02-18  |  11.5 KB  |  604 lines

  1. #ifndef HPPLOT_H
  2. #define HPPLOT_H
  3.  
  4. /****************************************************************
  5.  *                                                                                                                            *
  6.  * Filename : HpPlot.h                                                                                    *
  7.  *                                                                                                                            *
  8.  ****************************************************************
  9.  *                                                                                                                            *
  10.  *    Comment : Allgemeine Definitionen für Plotten                                *
  11.  *                        Diese Includedatei sollte bei HpPlot.c                        *
  12.  *                        eingelesen werden.                                                                *
  13.  *                                                                                                                            *
  14.  *                        Es beinhaltet Definitionen für :                                    *
  15.  *                         ->Gadget                                                                                    *
  16.  *                         ->Graphik                                                                                *
  17.  *                         ->Verschiedene                                                                        *
  18.  *                                                                                                                            *
  19.  *            Rev : V1.0                                                                                            *
  20.  *                                                                                                                            *
  21.  *    History : V1.0 erstellen dieses Files                            01.06.89    *
  22.  *                                                                                                                            *
  23.  *            Doc :                                                                                                        *
  24.  *                                                                                                                            *
  25.  *         Bugs : keine bekannt                                                                            *
  26.  *                                                                                                                            *
  27.  *        Autor : Oesch Silvano                                                                            *
  28.  *                                                                                                                            *
  29.  *        Datum : 01.09.89                                                                                    *
  30.  *                                                                                                                            *
  31.  ****************************************************************/
  32.  
  33.  
  34. /****************************************************************
  35.  *                                                                                                                            *
  36.  * externe Definitionen                                                                                    *
  37.  *                                                                                                                            *
  38.  ****************************************************************/
  39.  
  40. extern struct TextAttr TOPAZ80;            /* Textdarstellung                    */
  41.  
  42. /****************************************************************
  43.  *                                                                                                                            *
  44.  * allgemeine Definitionen                                                                            *
  45.  *                                                                                                                            *
  46.  ****************************************************************/
  47.  
  48. #define HpX    110                                            /* Windowkoordinaten X            */
  49. #define HpY    25                                            /* Windowkoordinaten Y            */
  50. #define HpXh 300                                        /* Windowlänge                            */
  51. #define HpYh 125                                        /* Windowbreite                            */
  52.  
  53. #define HRX    0                                                /* Requestkoordinaten X            */
  54. #define HRY    0                                                /* Requestkoordinaten Y            */
  55. #define HRXh 280                                        /* Requestlänge                            */
  56. #define HRYh 50                                            /* Requestbreite                        */
  57.  
  58. #define hpxmax 10.5
  59. #define hpymax 7.5
  60. #define hpstep 1024
  61. #define zoll 2.541
  62. #define factor (int)(hpstep/zoll)
  63.  
  64. /****************************************************************
  65.  *                                                                                                                            *
  66.  *        Grenzen der Gadgetcounters und Startwerte                                    *
  67.  *                                                                                                                            *
  68.  ****************************************************************/
  69.  
  70. #define MINXRAND 0                                    /* X Rand 0-20                            */
  71. #define XRAND 0                                            /* Startwert                                */
  72. static char XRANDS[] = " 0";
  73.  
  74. #define MINYRAND 0                                    /* Y Rand 0-30                            */
  75. #define YRAND 0                                            /* Startwert                                */
  76. static char YRANDS[] = " 0";
  77.  
  78. #define MINBREITE 1                                    /* Mindestbreite                        */
  79. #define BREITE 10                                        /* Startwert                                */
  80. static char BREITES[] = "10";
  81. #define MAXBREITE (int)(hpxmax*zoll)
  82.                                                                         /* hpxmax*zoll                            */
  83.  
  84. #define MINHOEHE 1                                    /* Mindesthoehe                            */
  85. #define HOEHE 10                                        /* Startwert                                */
  86. static char HOEHES[] = "10";
  87. #define MAXHOEHE (int)(hpymax*zoll)
  88.                                                                         /* hpymax*zoll                            */
  89.  
  90.  
  91. /****************************************************************
  92.  *                                                                                                                            *
  93.  *        Gadget Abbruchdefinition                                                                    *
  94.  *                                                                                                                            *
  95.  ****************************************************************/
  96.  
  97. #define GHp2X 192                                        /* für Hardcopywindow                */
  98. #define GHp2Y 90
  99. #define GHpRX 190                                        /* für Abbruchwindow                */
  100. #define GHpRY 28
  101.  
  102. /****************************************************************
  103.  *                                                                                                                            *
  104.  *        Gadget ID's                                                                                                *
  105.  *                                                                                                                            *
  106.  ****************************************************************/
  107.  
  108. #define GSI 2                                                /* Filename                                    */
  109. #define GXU 3                                                /* oberer Rand Up                        */
  110. #define GXD 4                                                /* oberer Rand Down                    */
  111. #define GYU 5                                                /* linker Rand Up                        */
  112. #define GYD 6                                                /* linker Rand Down                    */
  113. #define GBU 7                                                /* Breite Up                                */
  114. #define GBD 8                                                /* Breite Down                            */
  115. #define GHU 9                                                /* Höhe Up                                    */
  116. #define GHD 10                                            /* Höhe Down                                */
  117. #define GP    11                                            /* Print                                        */
  118. #define GC    12                                            /* Cancel                                        */
  119. #define GR    13                                            /* Drehung                                    */
  120.  
  121. extern USHORT chip Up[18];
  122.  
  123. extern USHORT chip Down[18];
  124.  
  125. /****************************************************************
  126.  *                                                                                                                            *
  127.  * Stringbuffer für Filename                                                                        *
  128.  *                                                                                                                            *
  129.  ****************************************************************/
  130.  
  131. static UBYTE GHpSIB1[60] =
  132.     "PAR:";
  133.  
  134. /****************************************************************
  135.  *                                                                                                                            *
  136.  * Stringinfostrukturen                                                                                    *
  137.  *                                                                                                                            *
  138.  ****************************************************************/
  139.  
  140. static struct StringInfo GHpSI1 =
  141. {                                                                        /* Filenamen Gadget                    */
  142.     GHpSIB1,
  143.     NULL,
  144.     0,
  145.     60,
  146.     0,
  147.     0,0,0,0,0,
  148.     0,
  149.     0,
  150.     NULL
  151. };
  152.  
  153. /****************************************************************
  154.  *                                                                                                                            *
  155.  *        BorderVectoren                                                                                        *
  156.  *                                                                                                                            *
  157.  ****************************************************************/
  158.  
  159. static SHORT BVHp0[] = 
  160. {                                                                        /* Filename BorderVectoren    */
  161.     0,0,
  162.     51,0,
  163.     51,10,
  164.     0,10,
  165.     0,0
  166. };
  167.  
  168. static SHORT BVHp1[] =
  169. {
  170.     0,0,
  171.     20,0,
  172.     20,10,
  173.     0,10,
  174.     0,0
  175. };
  176.  
  177. static SHORT BVHp2[] =
  178. {
  179.     0,0,
  180.     80,0,
  181.     80,15,
  182.     0,15,
  183.     0,0
  184. };
  185.  
  186.  
  187. /****************************************************************
  188.  *                                                                                                                            *
  189.  *        Border                                                                                                        *
  190.  *                                                                                                                            *
  191.  ****************************************************************/
  192.  
  193. static struct Border BHp0 =
  194. {                                                                        /* Filename                                    */
  195.     -3,-2,
  196.     3,0,JAM1,
  197.     5,
  198.     BVHp0,
  199.     NULL
  200. };
  201.  
  202. static struct Border BHp1 =
  203. {                                                                        /* Reverse                                    */
  204.     -1,-1,
  205.     3,0,JAM1,
  206.     5,
  207.     BVHp1,
  208.     NULL
  209. };
  210.  
  211. static struct Border BHp2 =
  212. {                                                                        /* Print    + Cancel                    */
  213.     -1,-1,
  214.     3,0,JAM1,
  215.     5,
  216.     BVHp2,
  217.     NULL
  218. };
  219.  
  220. static struct Border BHp3 =
  221. {                                                                        /* X                                                */
  222.     88,41,
  223.     3,0,JAM1,
  224.     5,
  225.     BVHp1,
  226.     NULL
  227. };
  228.  
  229. static struct Border BHp5 =
  230. {                                                                        /* Y                                                */
  231.     150,41,
  232.     3,0,JAM1,
  233.     5,
  234.     BVHp1,
  235.     &BHp3
  236. };
  237.  
  238. static struct Border BHp6 =
  239. {                                                                        /* Breite                                        */
  240.     88,89,
  241.     3,0,JAM1,
  242.     5,
  243.     BVHp1,
  244.     &BHp5
  245. };
  246.  
  247. static struct Border BHp7 =
  248. {                                                                        /* Hoehe                                        */
  249.     150,89,
  250.     3,0,JAM1,
  251.     5,
  252.     BVHp1,
  253.     &BHp6
  254. };
  255.  
  256. /****************************************************************
  257.  *                                                                                                                            *
  258.  *        Textdefinitionen                                                                                    *
  259.  *                                                                                                                            *
  260.  ****************************************************************/
  261.  
  262. static struct IntuiText ITHp10 =
  263. {                                                                        /* Request Text                            */
  264.     3,0,JAM2,
  265.     9,15,
  266.     &TOPAZ80,
  267.     "Bitte warten, Hardcopy in Arbeit",
  268.     NULL
  269. };
  270.  
  271. static struct IntuiText ITHp9 =
  272. {                                                                        /* Gadget - Text                        */
  273.     3,0,JAM2,
  274.     20,3,
  275.     &TOPAZ80,
  276.     "Plot",
  277.     NULL
  278. };
  279.  
  280. static struct IntuiText ITHp8 =
  281. {                                                                        /* Gadget - Text                        */
  282.     3,0,JAM2,
  283.     14,3,
  284.     &TOPAZ80,
  285.     "Abbruch",
  286.     NULL
  287. };
  288.  
  289. static struct IntuiText ITHp7 =
  290. {                                                                        /* Hoehe                                        */
  291.     3,0,JAM2,
  292.     153,91,
  293.     &TOPAZ80,
  294.     HOEHES,
  295.     NULL
  296. };
  297.  
  298. static struct IntuiText ITHp6 =
  299. {                                                                        /* Breite                                        */
  300.     3,0,JAM2,
  301.     91,91,
  302.     &TOPAZ80,
  303.     BREITES,
  304.     &ITHp7
  305. };
  306.  
  307. static struct IntuiText ITHp5 =
  308. {                                                                        /* Y                                                */
  309.     3,0,JAM2,
  310.     153,43,
  311.     &TOPAZ80,
  312.     YRANDS,
  313.     &ITHp6
  314. };
  315.  
  316. static struct IntuiText ITHp4 =
  317. {                                                                        /* X                                                */
  318.     3,0,JAM2,
  319.     91,43,
  320.     &TOPAZ80,
  321.     XRANDS,
  322.     &ITHp5
  323. };
  324.  
  325. static struct IntuiText ITHp2 =
  326. {                                                                        /* 2. Titel                                    */
  327.     3,0,JAM2,
  328.     10,70,
  329.     &TOPAZ80,
  330.     "Drehung Breite  Höhe",
  331.     &ITHp4
  332. };
  333.  
  334. static struct IntuiText ITHp1 =
  335. {                                                                        /* 1. Titel                                    */
  336.     3,0,JAM2,
  337.     14,19,
  338.     &TOPAZ80,
  339.     "File     X       Y",
  340.     &ITHp2
  341. };
  342.  
  343.  
  344. /****************************************************************
  345.  *                                                                                                                            *
  346.  *        Image                                                                                                            *
  347.  *                                                                                                                            *
  348.  ****************************************************************/
  349.  
  350. static struct Image IUpHp =
  351. {
  352.     0,0,16,9,
  353.     2,
  354.     Up,
  355.     0x0003,0x0000,
  356.     NULL
  357. };
  358.  
  359. static struct Image IDownHp =
  360. {
  361.     0,0,
  362.     16,9,
  363.     2,
  364.     Down,
  365.     0x0003,0x0000,
  366.     NULL
  367. };
  368.  
  369. /****************************************************************
  370.  *                                                                                                                            *
  371.  *        Gadget                                                                                                        *
  372.  *                                                                                                                            *
  373.  ****************************************************************/
  374.  
  375.  
  376. static struct Gadget GHp13 =
  377. {                                                                        /* Hoehe Down                                */
  378.     NULL,
  379.     153,100,
  380.     16,9,
  381.     GADGIMAGE,
  382.     RELVERIFY+GADGIMMEDIATE,
  383.     BOOLGADGET,
  384.     (APTR)&IDownHp,
  385.     NULL,
  386.     NULL,
  387.     NULL,
  388.     NULL,
  389.     GHD,
  390.     NULL
  391. };
  392.  
  393. static struct Gadget GHp12 =
  394. {                                                                        /* Hoehe Up                                    */
  395.     &GHp13,
  396.     153,80,
  397.     16,9,
  398.     GADGIMAGE,
  399.     RELVERIFY+GADGIMMEDIATE,
  400.     BOOLGADGET,
  401.     (APTR)&IUpHp,
  402.     NULL,
  403.     NULL,
  404.     NULL,
  405.     NULL,
  406.     GHU,
  407.     NULL
  408. };
  409.  
  410. static struct Gadget GHp11 =
  411. {                                                                        /* Breite Down                            */
  412.     &GHp12,
  413.     91,100,
  414.     16,9,
  415.     GADGIMAGE,
  416.     RELVERIFY+GADGIMMEDIATE,
  417.     BOOLGADGET,
  418.     (APTR)&IDownHp,
  419.     NULL,
  420.     NULL,
  421.     NULL,
  422.     NULL,
  423.     GBD,
  424.     NULL
  425. };
  426.  
  427. static struct Gadget GHp10 =
  428. {                                                                        /* Breite Up                                */
  429.     &GHp11,
  430.     91,80,
  431.     16,9,
  432.     GADGIMAGE,
  433.     RELVERIFY+GADGIMMEDIATE,
  434.     BOOLGADGET,
  435.     (APTR)&IUpHp,
  436.     NULL,
  437.     NULL,
  438.     NULL,
  439.     NULL,
  440.     GBU,
  441.     NULL
  442. };
  443.  
  444. static struct Gadget GHp9 =
  445. {                                                                        /* Y Down                                        */
  446.     &GHp10,
  447.     153,52,
  448.     16,9,
  449.     GADGIMAGE,
  450.     RELVERIFY+GADGIMMEDIATE,
  451.     BOOLGADGET,
  452.     (APTR)&IDownHp,
  453.     NULL,
  454.     NULL,
  455.     NULL,
  456.     NULL,
  457.     GYD,
  458.     NULL
  459. };
  460.  
  461. static struct Gadget GHp8 =
  462. {                                                                        /* Y Up                                            */
  463.     &GHp9,
  464.     153,32,
  465.     16,9,
  466.     GADGIMAGE,
  467.     RELVERIFY+GADGIMMEDIATE,
  468.     BOOLGADGET,
  469.     (APTR)&IUpHp,
  470.     NULL,
  471.     NULL,
  472.     NULL,
  473.     NULL,
  474.     GYU,
  475.     NULL
  476. };
  477.  
  478. static struct Gadget GHp7 =
  479. {                                                                        /* X Down                                        */
  480.     &GHp8,
  481.     91,52,
  482.     16,9,
  483.     GADGIMAGE,
  484.     RELVERIFY+GADGIMMEDIATE,
  485.     BOOLGADGET,
  486.     (APTR)&IDownHp,
  487.     NULL,
  488.     NULL,
  489.     NULL,
  490.     NULL,
  491.     GXD,
  492.     NULL
  493. };
  494.  
  495. static struct Gadget GHp6 =
  496. {                                                                        /* X Up                                            */
  497.     &GHp7,
  498.     91,32,
  499.     16,9,
  500.     GADGIMAGE,
  501.     RELVERIFY+GADGIMMEDIATE,
  502.     BOOLGADGET,
  503.     (APTR)&IUpHp,
  504.     NULL,
  505.     NULL,
  506.     NULL,
  507.     NULL,
  508.     GXU,
  509.     NULL
  510. };
  511.  
  512. static struct Gadget GHp5 =
  513. {                                                                        /* File Name                                */
  514.     &GHp6,
  515.     17,43,
  516.     50,10,
  517.     NULL,
  518.     RELVERIFY+GADGIMMEDIATE,
  519.     STRGADGET,
  520.     (APTR)&BHp0,
  521.     NULL,
  522.     NULL,
  523.     NULL,
  524.     (APTR)&GHpSI1,
  525.     GSI,
  526.     NULL
  527. };
  528.  
  529. static struct Gadget GHp3 =
  530. {                                                                        /* Drehung Gadget                        */
  531.     &GHp5,
  532.     30,90,
  533.     19,9,
  534.     0,
  535.     RELVERIFY+TOGGLESELECT,
  536.     BOOLGADGET,
  537.     (APTR)&BHp1,
  538.     NULL,
  539.     NULL,
  540.     NULL,
  541.     NULL,
  542.     GR,
  543.     NULL
  544. };
  545.  
  546. static struct Gadget GHp2 =
  547. {                                                                        /* Cancel Gadget                        */
  548.     &GHp3,
  549.     GHp2X,GHp2Y,
  550.     81,14,
  551.     NULL,
  552.     RELVERIFY,
  553.     BOOLGADGET,
  554.     (APTR)&BHp2,
  555.     NULL,
  556.     &ITHp8,
  557.     NULL,
  558.     NULL,
  559.     GC,
  560.     NULL
  561. };
  562.  
  563. static struct Gadget GHp1 =
  564. {                                                                        /* Print Gadget                            */
  565.     &GHp2,
  566.     193,42,
  567.     81,14,
  568.     NULL,
  569.     RELVERIFY,
  570.     BOOLGADGET,
  571.     (APTR)&BHp2,
  572.     NULL,
  573.     &ITHp9,
  574.     NULL,
  575.     NULL,
  576.     GP,
  577.     NULL
  578. };
  579.  
  580. /****************************************************************
  581.  *                                                                                                                            *
  582.  *        Windowdefinitionen                                                                                *
  583.  *                                                                                                                            *
  584.  ****************************************************************/
  585.  
  586. static struct NewWindow HPW =
  587. {                                                                        /* Hardcopy Window                    */
  588.     HpX,HpY,
  589.     HpXh,HpYh,
  590.     0,1,
  591.     GADGETUP,
  592.     WINDOWDRAG+ACTIVATE+NOCAREREFRESH,
  593.     &GHp1,
  594.     NULL,
  595.     "Plot",
  596.     NULL,
  597.     NULL,
  598.     5,5,
  599.     -1,-1,
  600.     WBENCHSCREEN
  601. };
  602.  
  603. #endif HPPLOT_H
  604.