home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fonts 1 / freshfonts1.bin / programs / amiga / pastex / src / specialhost / specialwin.h < prev    next >
C/C++ Source or Header  |  1991-07-11  |  10KB  |  408 lines

  1. /* *** specialwin.h *** */
  2.  
  3.  
  4. #define FONTNAME        "topaz.font"
  5. #define FONTYSIZE        8
  6. #define FONTSTYLE        FS_NORMAL
  7. #define FONTFLAGS        FPF_ROMFONT
  8.  
  9. #define WIN_X_KOO        30
  10. #define WIN_Y_KOO        40
  11. #define WIN_WIDTH        460
  12. #define WIN_HEIGHT        130
  13. #define WIN_TITLE        "Special-Host-Program V" VERSION
  14. #define WIN_IDCMP_FLAGS        CLOSEWINDOW | MOUSEBUTTONS | GADGETUP | REFRESHWINDOW | RAWKEY | MENUPICK | NEWSIZE
  15. #define WIN_X_MIN_WIDTH        456
  16. #define WIN_X_MIN_HEIGHT    70
  17. #define WIN_X_MAX_WIDTH        640
  18. #define WIN_X_MAX_HEIGHT    250
  19.  
  20. #define ICON_HEIGHT        35
  21. #define ICON_WIDTH        64
  22. #define ICON_LEFT_EDGE        20
  23. #define ICON_TOP_EDGE        20
  24.  
  25.  
  26. #define NR_TEXT_LINES        50        /* Lines */
  27. #define LINE_LENGTH        80        /* Chars */
  28. #define START_PRINTING        55        /* Pixel */
  29. #define HEIGHT_CHAR        10        /* Pixel */
  30. #define WIDTH_CHAR         8        /* Pixel */
  31.  
  32.  
  33.  
  34.  
  35. /***  Gad-Numbers *************/
  36.  
  37. #define NR_MEM_GAD    1
  38. #define NR_FILE_GAD    2
  39. #define NR_MEM_B_GAD    3
  40. #define NR_FILE_B_GAD    4
  41. #define NR_BORDER_GAD    5
  42. #define NR_RECT_GAD    6
  43. #define NR_INT_GAD    7
  44. #define NR_TOICON_GAD    8
  45. #define NR_SHOW_GAD    9
  46. #define NR_INVERT_GAD    10
  47. #define NR_BLITTER_GAD    11
  48.  
  49.  
  50.  
  51. #define CONFIG_FILE_MAGIC    (('S'<<24) | ('C'<<16) | ('N'<<8) | 'F')
  52. #define CONFIG_FILE_VERSION    1
  53.  
  54. struct config_struct {
  55.     long    magic;
  56.     long    version;
  57.     short    use_blitter;
  58.     short    invert_bmap;
  59.     int        base_dpi;
  60.     int        draw_modus;
  61.     int        icon_x_pos;
  62.     int        icon_y_pos;
  63.     int        win_x_pos;
  64.     int        win_y_pos;
  65.     int        win_width;
  66.     int        win_height;
  67.     short    use_pubscr;
  68.     short    reserved1;
  69.     long    reserved2;
  70.     long    reserved3;
  71.     long    reserved4;
  72.     long    reserved5;
  73.     long    reserved6;
  74.     long    reserved7;
  75.     long    reserved8;
  76.     long    reserved9;
  77.   };
  78.  
  79.  
  80.  
  81. static SHORT brd_arr[10] = { 0,0, 52,0, 52,12, 0,12, 0,0 };
  82.  
  83. static struct Border brd =
  84.  { -2, -2, 1, 0, JAM1, 5, brd_arr, NULL };
  85.  
  86. static struct Border selbrd =
  87.  { -2, -2, 3, 0, JAM1, 5, brd_arr, NULL };
  88.  
  89.  
  90.  
  91. static SHORT brd2_arr[10] = { 0,0, 52+24,0, 52+24,12, 0,12, 0,0 };
  92.  
  93. static struct Border brd2 =
  94.  { -2, -2, 1, 0, JAM1, 5, brd2_arr, NULL };
  95.  
  96. static struct Border selbrd2 =
  97.  { -2, -2, 3, 0, JAM1, 5, brd2_arr, NULL };
  98.  
  99.  
  100.  
  101. static struct IntuiText Memory_Title =
  102.  {
  103.     1, 0, JAM2, 1, 1, &txtAttr, (UBYTE*)"Memory",
  104.     (struct IntuiText*)NULL
  105.  };
  106.  
  107. static struct Gadget Memory_Gad =
  108.  {
  109.     (struct Gadget*)NULL, 20, 15,
  110.     50, 10, GADGHIMAGE, RELVERIFY | TOGGLESELECT,
  111.     BOOLGADGET, (APTR)&brd, (APTR)&selbrd,
  112.     &Memory_Title, 0L, (APTR)NULL,
  113.     NR_MEM_GAD, (APTR)NULL
  114.  };
  115.  
  116. static struct IntuiText File_Title =
  117.  {
  118.     1, 0, JAM2, 1, 1, &txtAttr, (UBYTE*)"File",
  119.     (struct IntuiText*)NULL
  120.  };
  121.  
  122. static struct Gadget File_Gad =
  123.  {
  124.     &Memory_Gad, 20, 30,
  125.     50, 10, GADGHIMAGE, RELVERIFY | TOGGLESELECT,
  126.     BOOLGADGET, (APTR)&brd, (APTR)&selbrd,
  127.     &File_Title, 0L, (APTR)NULL,
  128.     NR_FILE_GAD, (APTR)NULL
  129.  };
  130.  
  131. static struct IntuiText Memory_B_Title =
  132.  {
  133.     1, 0, JAM2, 5, 1, &txtAttr, (UBYTE*)"Mem-B",
  134.     (struct IntuiText*)NULL
  135.  };
  136.  
  137. static struct Gadget Memory_B_Gad =
  138.  {
  139.     &File_Gad, 80, 15,
  140.     50, 10, GADGHIMAGE, RELVERIFY | TOGGLESELECT,
  141.     BOOLGADGET, (APTR)&brd, (APTR)&selbrd,
  142.     &Memory_B_Title, 0L, (APTR)NULL,
  143.     NR_MEM_B_GAD, (APTR)NULL
  144.  };
  145.  
  146. static struct IntuiText File_B_Title =
  147.  {
  148.     1, 0, JAM2, 1, 1, &txtAttr, (UBYTE*)"File-B",
  149.     (struct IntuiText*)NULL
  150.  };
  151.  
  152. static struct Gadget File_B_Gad =
  153.  {
  154.     &Memory_B_Gad, 80, 30,
  155.     50, 10, GADGHIMAGE, RELVERIFY | TOGGLESELECT,
  156.     BOOLGADGET, (APTR)&brd, (APTR)&selbrd,
  157.     &File_B_Title, 0L, (APTR)NULL,
  158.     NR_FILE_B_GAD, (APTR)NULL
  159.  };
  160.  
  161. static struct IntuiText Border_Title =
  162.  {
  163.     1, 0, JAM2, 1, 1, &txtAttr, (UBYTE*)"Border",
  164.     (struct IntuiText*)NULL
  165.  };
  166.  
  167. static struct Gadget Border_Gad =
  168.  {
  169.     &File_B_Gad, 140, 15,
  170.     50, 10, GADGHIMAGE, RELVERIFY | TOGGLESELECT,
  171.     BOOLGADGET, (APTR)&brd, (APTR)&selbrd,
  172.     &Border_Title, 0L, (APTR)NULL,
  173.     NR_BORDER_GAD, (APTR)NULL
  174.  };
  175.  
  176. static struct IntuiText Rect_Title =
  177.  {
  178.     1, 0, JAM2, 1, 1, &txtAttr, (UBYTE*)"Rect.",
  179.     (struct IntuiText*)NULL
  180.  };
  181.  
  182. static struct Gadget Rect_Gad =
  183.  {
  184.     &Border_Gad, 140, 30,
  185.     50, 10, GADGHIMAGE, RELVERIFY | TOGGLESELECT,
  186.     BOOLGADGET, (APTR)&brd, (APTR)&selbrd,
  187.     &Rect_Title, 0L, (APTR)NULL,
  188.     NR_RECT_GAD, (APTR)NULL
  189.  };
  190.  
  191.  
  192. static UBYTE    int_buffer[5],
  193.         int_buffer_undo[5];
  194.  
  195. static SHORT int_brd_arr[10] = { 0,0, 35,0, 35,11, 0,11, 0,0 };
  196.  
  197. static struct Border int_brd =
  198.  { -2, -2, 1, 0, JAM1, 5, int_brd_arr, NULL };
  199.  
  200. static struct IntuiText Bdpi_Title =
  201.  {
  202.     1, 0, JAM2, -15,-11, &txtAttr, (UBYTE*)"base dpi",
  203.     (struct IntuiText*)NULL
  204.  };
  205.  
  206. static struct StringInfo int_strInfo =
  207.  {
  208.     int_buffer, int_buffer_undo, 0, 4, 0, 0, 0, 0,
  209.     0, 0, (struct Layer*)NULL, 0L,
  210.     (struct KeyMap*)NULL
  211.  };
  212.  
  213. static struct Gadget Bdpi_Gad = 
  214.  {
  215.     &Rect_Gad, 230, 28,
  216.     32, 10, GADGHCOMP, RELVERIFY | LONGINT,
  217.     STRGADGET, (APTR)&int_brd, (APTR)NULL,
  218.     (struct IntuiText*)&Bdpi_Title, 0L,
  219.     (APTR)&int_strInfo,
  220.     NR_INT_GAD, (APTR)NULL
  221.  };
  222.  
  223.  
  224. static struct IntuiText toIcon_Title =
  225.  {
  226.     1, 0, JAM2, 8, 1, &txtAttr, (UBYTE*)"Icon",
  227.     (struct IntuiText*)NULL
  228.  };
  229.  
  230. static struct Gadget toIcon_Gad =
  231.  {
  232.     &Bdpi_Gad, 360+24, 15,
  233.     50, 10, GADGHCOMP, RELVERIFY,
  234.     BOOLGADGET, (APTR)&brd, (APTR)NULL,
  235.     &toIcon_Title, 0L, (APTR)NULL,
  236.     NR_TOICON_GAD, (APTR)NULL
  237.  };
  238.  
  239.  
  240. static struct IntuiText Show_Title =
  241.  {
  242.     1, 0, JAM2, 8, 1, &txtAttr, (UBYTE*)"Show",
  243.     (struct IntuiText*)NULL
  244.  };
  245.  
  246. static struct Gadget Show_Gad =
  247.  {
  248.     &toIcon_Gad, 360+24, 30,
  249.     50, 10, GADGHCOMP, RELVERIFY,
  250.     BOOLGADGET, (APTR)&brd, (APTR)NULL,
  251.     &Show_Title, 0L, (APTR)NULL,
  252.     NR_SHOW_GAD, (APTR)NULL
  253.  };
  254.  
  255.  
  256. static struct IntuiText Invert_Title =
  257.  {
  258.     1, 0, JAM2, 8, 1, &txtAttr, (UBYTE*)"Invert?",
  259.     (struct IntuiText*)NULL
  260.  };
  261.  
  262. static struct Gadget Invert_Gad =
  263.  {
  264.     &Show_Gad, 295, 15,
  265.     50+24, 10, GADGHIMAGE, RELVERIFY | TOGGLESELECT,
  266.     BOOLGADGET, (APTR)&brd2, (APTR)&selbrd2,
  267.     &Invert_Title, 0L, (APTR)NULL,
  268.     NR_INVERT_GAD, (APTR)NULL
  269.  };
  270.  
  271.  
  272. static struct IntuiText Blitter_Title =
  273.  {
  274.     1, 0, JAM2, 8, 1, &txtAttr, (UBYTE*)"Blitter?",
  275.     (struct IntuiText*)NULL
  276.  };
  277.  
  278. static struct Gadget Blitter_Gad =
  279.  {
  280.     &Invert_Gad, 295, 30,
  281.     50+24, 10, GADGHIMAGE, RELVERIFY | TOGGLESELECT,
  282.     BOOLGADGET, (APTR)&brd2, (APTR)&selbrd2,
  283.     &Blitter_Title, 0L, (APTR)NULL,
  284.     NR_BLITTER_GAD, (APTR)NULL
  285.  };
  286.  
  287.  
  288. /******************** MENU **********************/
  289.  
  290.  
  291. struct IntuiText MenItem_Text[] = {
  292.     { 0, 1, JAM1, 0, 1, &txtAttr, "About", NULL },        /* men 1 */
  293.     { 0, 1, JAM1, 0, 1, &txtAttr, "", NULL },
  294.     { 0, 1, JAM1, 0, 1, &txtAttr, "Read config", NULL },
  295.     { 0, 1, JAM1, 0, 1, &txtAttr, "Save config", NULL },
  296.     { 0, 1, JAM1, 0, 1, &txtAttr, "", NULL },
  297.     { 0, 1, JAM1, 0, 1, &txtAttr, "To ShowDVI", NULL },
  298.     { 0, 1, JAM1, 0, 1, &txtAttr, "Iconify", NULL },
  299.     { 0, 1, JAM1, CHECKWIDTH, 1, &txtAttr, "Use PubScr", NULL },
  300.     { 0, 1, JAM1, 0, 1, &txtAttr, "", NULL },
  301.     { 0, 1, JAM1, 0, 1, &txtAttr, "Quit", NULL },
  302.     { 0, 1, JAM1, CHECKWIDTH, 1, &txtAttr, "Transfer in memory", NULL },    /* men 2 */
  303.     { 0, 1, JAM1, CHECKWIDTH, 1, &txtAttr, "Transfer in file", NULL },
  304.     { 0, 1, JAM1, CHECKWIDTH, 1, &txtAttr, "Memory with border", NULL },
  305.     { 0, 1, JAM1, CHECKWIDTH, 1, &txtAttr, "File with border", NULL },
  306.     { 0, 1, JAM1, CHECKWIDTH, 1, &txtAttr, "Only a border", NULL },
  307.     { 0, 1, JAM1, CHECKWIDTH, 1, &txtAttr, "Only a rectangle", NULL },
  308.     { 0, 1, JAM1, CHECKWIDTH, 1, &txtAttr, "Invert", NULL },        /* men 3 */
  309.     { 0, 1, JAM1, CHECKWIDTH, 1, &txtAttr, "Use blitter", NULL }
  310.   };
  311.  
  312. #define STARTDRAW    10
  313. #define INVERTNR    16
  314. #define BLITTERNR    17
  315.  
  316. struct MenuItem MenItem[] = {
  317.     { &MenItem[1], 0, 0, 150, 10,            /* about */
  318.       ITEMENABLED|ITEMTEXT|HIGHCOMP,
  319.       0, (APTR)&MenItem_Text[0], NULL, ' ', NULL, 0
  320.     },
  321.     { &MenItem[2], 0, 10, 150, 10,            /* "" */
  322.       ITEMTEXT|HIGHNONE,
  323.       0, (APTR)&MenItem_Text[1], NULL, ' ', NULL, 0
  324.     },
  325.     { &MenItem[3], 0, 20, 150, 10,            /* read cnf */
  326.       ITEMENABLED|ITEMTEXT|HIGHCOMP|COMMSEQ,
  327.       0, (APTR)&MenItem_Text[2], NULL, 'O', NULL, 0
  328.     },
  329.     { &MenItem[4], 0, 30, 150, 10,            /* save cnf */
  330.       ITEMENABLED|ITEMTEXT|HIGHCOMP|COMMSEQ,
  331.       0, (APTR)&MenItem_Text[3], NULL, 'W', NULL, 0
  332.     },
  333.     { &MenItem[5], 0, 40, 150, 10,            /* "" */
  334.       ITEMTEXT|HIGHNONE,
  335.       0, (APTR)&MenItem_Text[4], NULL, ' ', NULL, 0
  336.     },
  337.     { &MenItem[6], 0, 50, 150, 10,            /* ShowDVI */
  338.       ITEMENABLED|ITEMTEXT|HIGHCOMP|COMMSEQ,
  339.       0, (APTR)&MenItem