home *** CD-ROM | disk | FTP | other *** search
/ Fish 'n' More 2 / fishmore-publicdomainlibraryvol.ii1991xetec.iso / dirs / prettywindows_399.lzh / PrettyWindows / pwindows2.c < prev    next >
C/C++ Source or Header  |  1990-11-02  |  12KB  |  447 lines

  1. #include <exec/types.h>
  2. #include <exec/exec.h>
  3. #include <intuition/intuition.h>
  4. #include <graphics/gfxbase.h>
  5. #include <graphics/gfx.h>
  6. #include <graphics/gfxmacros.h>
  7.  
  8. /********************************************
  9.  *  PrettyWindows v1.0   by Thom Robertson  *
  10.  ********************************************/
  11.  
  12. UWORD chip rb_data[4 * 24 * 2] = {
  13. 0x0000,0x0800,0x0020,0x0000,
  14. 0x0000,0x0800,0x0020,0x0000,
  15. 0x0000,0x0800,0x0020,0x0000,
  16. 0x0000,0x0800,0x0020,0x0000,
  17. 0x0000,0x0800,0x0020,0x0000,
  18. 0x0000,0x0800,0x0020,0x0000,
  19. 0x0000,0x0800,0x0020,0x0000,
  20. 0x0000,0x0800,0x0020,0x0000,
  21. 0x0000,0x003f,0xfc20,0x0000,
  22. 0x0001,0xffe0,0x03e0,0x0000,
  23. 0x0002,0x001f,0xffff,0x0000,
  24. 0x0004,0x0fff,0xf803,0xc000,
  25. 0x0004,0x7000,0x1e3e,0x0000,
  26. 0xfffc,0x8001,0xf3e0,0x0000,
  27. 0x0003,0x1fff,0xffff,0x0000,
  28. 0x0001,0x608e,0x0003,0xc000,
  29. 0x0003,0xffd0,0x003e,0x0000,
  30. 0x0004,0x003f,0xffc0,0x0000,
  31. 0x0008,0x1fff,0xf000,0x0000,
  32. 0x0008,0xe000,0x3c00,0x0000,
  33. 0x0009,0x0003,0xe000,0x0000,
  34. 0xfffe,0x3ffc,0x0000,0x0000,
  35. 0x0002,0xc000,0x0000,0x0000,
  36. 0x0001,0x0000,0x0000,0x0000,
  37. 0x0000,0x0801,0x0000,0x0000,
  38. 0x0000,0x0801,0x0000,0x0000,
  39. 0x0000,0x0801,0x0000,0x0000,
  40. 0x0000,0x0801,0x0000,0x0000,
  41. 0x0000,0x0801,0x0000,0x0000,
  42. 0x0000,0x0801,0x0000,0x0000,
  43. 0x0000,0x0801,0x0000,0x0000,
  44. 0x0000,0x0801,0x0000,0x0000,
  45. 0x0000,0x0000,0x0000,0x0000,
  46. 0x0000,0x001f,0xfc00,0x0000,
  47. 0x0001,0xffe0,0x0000,0x0000,
  48. 0x0003,0xf000,0x07fc,0x0000,
  49. 0x0003,0x8fff,0xe1c0,0x0000,
  50. 0xfffb,0x7ffe,0x0c00,0x0000,
  51. 0x0000,0xe000,0x0000,0x0000,
  52. 0x0000,0x8071,0xfffc,0x0000,
  53. 0x0000,0x002f,0xffc0,0x0000,
  54. 0xfffb,0xffc0,0x0000,0x0000,
  55. 0x0007,0xe000,0x0000,0x0000,
  56. 0x0007,0x1fff,0xc000,0x0000,
  57. 0x0006,0xfffc,0x0000,0x0000,
  58. 0x0001,0xc000,0x0000,0x0000,
  59. 0x0001,0x0000,0x0000,0x0000,
  60. 0x0000,0x0000,0x0000,0x0000};
  61.  
  62. /* IMAGE STRUCTURE */
  63.  
  64. struct Image rb = {
  65.    0, 0, 50, 24, 2, &rb_data[0], 3, 0, NULL};
  66.  
  67. /* IMAGE DATA */
  68.  
  69. UWORD chip lb_data[4 * 24 * 2] = {
  70. 0x0100,0x0004,0x0000,0x0000,
  71. 0x0100,0x0004,0x0000,0x0000,
  72. 0x0100,0x0004,0x0000,0x0000,
  73. 0x0100,0x0004,0x0000,0x0000,
  74. 0x0100,0x0004,0x0000,0x0000,
  75. 0x0100,0x0004,0x0000,0x0000,
  76. 0x0100,0x0004,0x0000,0x0000,
  77. 0x0100,0x0004,0x0000,0x0000,
  78. 0x010f,0xff00,0x0000,0x0000,
  79. 0x01f0,0x01ff,0xe000,0x0000,
  80. 0x3fff,0xfe00,0x1000,0x0000,
  81. 0xf007,0xfffc,0x0800,0x0000,
  82. 0x1f1e,0x0003,0x8800,0x0000,
  83. 0x01f3,0xe000,0x4fff,0xc000,
  84. 0x3fff,0xfffe,0x3000,0x0000,
  85. 0xf000,0x1c41,0xa000,0x0000,
  86. 0x1f00,0x02ff,0xf000,0x0000,
  87. 0x00ff,0xff00,0x0800,0x0000,
  88. 0x0003,0xfffe,0x0400,0x0000,
  89. 0x000f,0x0001,0xc400,0x0000,
  90. 0x0001,0xf000,0x2400,0x0000,
  91. 0x0000,0x0fff,0x1fff,0xc000,
  92. 0x0000,0x0000,0xd000,0x0000,
  93. 0x0000,0x0000,0x2000,0x0000,
  94. 0x0000,0x2004,0x0000,0x0000,
  95. 0x0000,0x2004,0x0000,0x0000,
  96. 0x0000,0x2004,0x0000,0x0000,
  97. 0x0000,0x2004,0x0000,0x0000,
  98. 0x0000,0x2004,0x0000,0x0000,
  99. 0x0000,0x2004,0x0000,0x0000,
  100. 0x0000,0x2004,0x0000,0x0000,
  101. 0x0000,0x2004,0x0000,0x0000,
  102. 0x0000,0x0000,0x0000,0x0000,
  103. 0x000f,0xfe00,0x0000,0x0000,
  104. 0x0000,0x01ff,0xe000,0x0000,
  105. 0x0ff8,0x0003,0xf000,0x0000,
  106. 0x00e1,0xfffc,0x7000,0x0000,
  107. 0x000c,0x1fff,0xb7ff,0xc000,
  108. 0x0000,0x0001,0xc000,0x0000,
  109. 0x0fff,0xe380,0x4000,0x0000,
  110. 0x00ff,0xfd00,0x0000,0x0000,
  111. 0x0000,0x00ff,0xf7ff,0xc000,
  112. 0x0000,0x0001,0xf800,0x0000,
  113. 0x0000,0xfffe,0x3800,0x0000,
  114. 0x0000,0x0fff,0xd800,0x0000,
  115. 0x0000,0x0000,0xe000,0x0000,
  116. 0x0000,0x0000,0x2000,0x0000,
  117. 0x0000,0x0000,0x0000,0x0000};
  118.  
  119. /* IMAGE STRUCTURE */
  120.  
  121. struct Image lb = {
  122.    0, 0, 50, 24, 2, &lb_data[0], 3, 0, NULL};
  123.  
  124. /* IMAGE DATA */
  125.  
  126. UWORD chip rt_data[4 * 22 * 2] = {
  127. 0xffff,0xfc3f,0xfc00,0x0000,
  128. 0x0001,0xffe0,0x03e0,0x0000,
  129. 0x0002,0x001f,0xffff,0x0000,
  130. 0x0004,0x0fff,0xf803,0xc000,
  131. 0x0004,0x7000,0x1e3e,0x0000,
  132. 0x0004,0x8001,0xf3e0,0x0000,
  133. 0x0003,0x1fff,0xffff,0x0000,
  134. 0x0001,0x608e,0x0003,0xc000,
  135. 0xffff,0xffd0,0x003e,0x0000,
  136. 0x0004,0x003f,0xffc0,0x0000,
  137. 0x0008,0x1fff,0xf020,0x0000,
  138. 0x0008,0xe000,0x3c20,0x0000,
  139. 0x0009,0x0003,0xe020,0x0000,
  140. 0x0006,0x3ffc,0x0020,0x0000,
  141. 0x0002,0xc800,0x0020,0x0000,
  142. 0x0001,0x0800,0x0020,0x0000,
  143. 0x0000,0x0800,0x0020,0x0000,
  144. 0x0000,0x0800,0x0020,0x0000,
  145. 0x0000,0x0800,0x0020,0x0000,
  146. 0x0000,0x0800,0x0020,0x0000,
  147. 0x0000,0x0800,0x0020,0x0000,
  148. 0x0000,0x0800,0x0020,0x0000,
  149. 0x0000,0x0000,0x0000,0x0000,
  150. 0x0000,0x001f,0xfc00,0x0000,
  151. 0x0001,0xffe0,0x0000,0x0000,
  152. 0x0003,0xf000,0x07fc,0x0000,
  153. 0xfffb,0x8fff,0xe1c0,0x0000,
  154. 0x0003,0x7ffe,0x0c00,0x0000,
  155. 0x0000,0xe000,0x0000,0x0000,
  156. 0x0000,0x8071,0xfffc,0x0000,
  157. 0xfffc,0x002f,0xffc0,0x0000,
  158. 0x0003,0xffc0,0x0000,0x0000,
  159. 0x0007,0xe000,0x0000,0x0000,
  160. 0x0007,0x1fff,0xc000,0x0000,
  161. 0x0006,0xfffc,0x0000,0x0000,
  162. 0x0001,0xc001,0x0000,0x0000,
  163. 0x0001,0x0801,0x0000,0x0000,
  164. 0x0000,0x0801,0x0000,0x0000,
  165. 0x0000,0x0801,0x0000,0x0000,
  166. 0x0000,0x0801,0x0000,0x0000,
  167. 0x0000,0x0801,0x0000,0x0000,
  168. 0x0000,0x0801,0x0000,0x0000,
  169. 0x0000,0x0801,0x0000,0x0000,
  170. 0x0000,0x0801,0x0000,0x0000};
  171.  
  172. /* IMAGE STRUCTURE */
  173.  
  174. struct Image rt = {
  175.    0, 0, 50, 22, 2, &rt_data[0], 3, 0, NULL};
  176.  
  177. /* IMAGE DATA */
  178.  
  179. UWORD chip lt_data[4 * 22 * 2] = {
  180. 0x000f,0xff0f,0xffff,0xc000,
  181. 0x01f0,0x01ff,0xe000,0x0000,
  182. 0x3fff,0xfe00,0x1000,0x0000,
  183. 0xf007,0xfffc,0x0800,0x0000,
  184. 0x1f1e,0x0003,0x8800,0x0000,
  185. 0x01f3,0xe000,0x4800,0x0000,
  186. 0x3fff,0xfffe,0x3000,0x0000,
  187. 0xf000,0x1c41,0xa000,0x0000,
  188. 0x1f00,0x02ff,0xffff,0xc000,
  189. 0x00ff,0xff00,0x0800,0x0000,
  190. 0x0103,0xfffe,0x0400,0x0000,
  191. 0x010f,0x0001,0xc400,0x0000,
  192. 0x0101,0xf000,0x2400,0x0000,
  193. 0x0100,0x0fff,0x1800,0x0000,
  194. 0x0100,0x0004,0xd000,0x0000,
  195. 0x0100,0x0004,0x2000,0x0000,
  196. 0x0100,0x0004,0x0000,0x0000,
  197. 0x0100,0x0004,0x0000,0x0000,
  198. 0x0100,0x0004,0x0000,0x0000,
  199. 0x0100,0x0004,0x0000,0x0000,
  200. 0x0100,0x0004,0x0000,0x0000,
  201. 0x0100,0x0004,0x0000,0x0000,
  202. 0x0000,0x0000,0x0000,0x0000,
  203. 0x000f,0xfe00,0x0000,0x0000,
  204. 0x0000,0x01ff,0xe000,0x0000,
  205. 0x0ff8,0x0003,0xf000,0x0000,
  206. 0x00e1,0xfffc,0x77ff,0xc000,
  207. 0x000c,0x1fff,0xb000,0x0000,
  208. 0x0000,0x0001,0xc000,0x0000,
  209. 0x0fff,0xe380,0x4000,0x0000,
  210. 0x00ff,0xfd00,0x0fff,0xc000,
  211. 0x0000,0x00ff,0xf000,0x0000,
  212. 0x0000,0x0001,0xf800,0x0000,
  213. 0x0000,0xfffe,0x3800,0x0000,
  214. 0x0000,0x0fff,0xd800,0x0000,
  215. 0x0000,0x2000,0xe000,0x0000,
  216. 0x0000,0x2004,0x2000,0x0000,
  217. 0x0000,0x2004,0x0000,0x0000,
  218. 0x0000,0x2004,0x0000,0x0000,
  219. 0x0000,0x2004,0x0000,0x0000,
  220. 0x0000,0x2004,0x0000,0x0000,
  221. 0x0000,0x2004,0x0000,0x0000,
  222. 0x0000,0x2004,0x0000,0x0000,
  223. 0x0000,0x2004,0x0000,0x0000};
  224.  
  225. /* IMAGE STRUCTURE */
  226.  
  227. struct Image lt = {
  228.    0, 0, 50, 22, 2, <_data[0], 3, 0, NULL};
  229.  
  230.  
  231. prettywindow2(win,color)
  232. struct Window *win;
  233. int color;
  234. {
  235.  
  236. /* Since we're using Images in this window, it's much tougher to change
  237. the background color without leaving big black squares around the
  238. images.  So I just won't respond to the color variable.
  239. */
  240.  
  241. /* IMAGE DATA */
  242.  
  243.  
  244. /* Here we define our border structures. */
  245.  
  246. /* top lines. */
  247.  
  248. static SHORT vectors1b[4];
  249.  
  250. static struct Border line1b = {
  251.     0,0,    /* XY origin relative to container TopLeft */
  252.     3,0,JAM2,    /* front pen, back pen and drawmode */
  253.     2,    /* number of XY vectors */
  254.     vectors1b,    /* pointer to XY vectors */
  255.     NULL    /* next border in list */
  256. };
  257.  
  258. static SHORT vectors1a[4];
  259.  
  260. static struct Border line1a = {
  261.     0,0,    /* XY origin relative to container TopLeft */
  262.     2,0,JAM2,    /* front pen, back pen and drawmode */
  263.     2,    /* number of XY vectors */
  264.     vectors1a,    /* pointer to XY vectors */
  265.     &line1b    /* next border in list */
  266. };
  267.  
  268. static SHORT vectors1[4];
  269.  
  270. static struct Border line1 = {
  271.     0,0,    /* XY origin relative to container TopLeft */
  272.     1,0,JAM2,    /* front pen, back pen and drawmode */
  273.     2,    /* number of XY vectors */
  274.     vectors1,    /* pointer to XY vectors */
  275.     &line1a    /* next border in list */
  276. };
  277.  
  278. /* bottom lines. */
  279.  
  280. static SHORT vectors2b[4];
  281.  
  282. static struct Border line2b = {
  283.     0,0,    /* XY origin relative to container TopLeft */
  284.     3,0,JAM2,    /* front pen, back pen and drawmode */
  285.     2,    /* number of XY vectors */
  286.     vectors2b,    /* pointer to XY vectors */
  287.     NULL    /* next border in list */
  288. };
  289.  
  290. static SHORT vectors2a[4];
  291.  
  292. static struct Border line2a = {
  293.     0,0,    /* XY origin relative to container TopLeft */
  294.     2,0,JAM2,    /* front pen, back pen and drawmode */
  295.     2,    /* number of XY vectors */
  296.     vectors2a,    /* pointer to XY vectors */
  297.     &line2b    /* next border in list */
  298. };
  299.  
  300. static SHORT vectors2[4];
  301.  
  302. static struct Border line2 = {
  303.     0,0,    /* XY origin relative to container TopLeft */
  304.     1,0,JAM2,    /* front pen, back pen and drawmode */
  305.     2,    /* number of XY vectors */
  306.     vectors2,    /* pointer to XY vectors */
  307.     &line2a    /* next border in list */
  308. };
  309.  
  310. /* left lines. */
  311.  
  312. static SHORT vectors3b[4];
  313.  
  314. static struct Border line3b = {
  315.     0,0,    /* XY origin relative to container TopLeft */
  316.     3,0,JAM2,    /* front pen, back pen and drawmode */
  317.     2,    /* number of XY vectors */
  318.     vectors3b,    /* pointer to XY vectors */
  319.     NULL    /* next border in list */
  320. };
  321.  
  322. static SHORT vectors3a[4];
  323.  
  324. static struct Border line3a = {
  325.     0,0,    /* XY origin relative to container TopLeft */
  326.     2,0,JAM2,    /* front pen, back pen and drawmode */
  327.     2,    /* number of XY vectors */
  328.     vectors3a,    /* pointer to XY vectors */
  329.     &line3b    /* next border in list */
  330. };
  331.  
  332. static SHORT vectors3[4];
  333.  
  334. static struct Border line3 = {
  335.     0,0,    /* XY origin relative to container TopLeft */
  336.     1,0,JAM2,    /* front pen, back pen and drawmode */
  337.     2,    /* number of XY vectors */
  338.     vectors3,    /* pointer to XY vectors */
  339.     &line3a    /* next border in list */
  340. };
  341.  
  342. /* right lines. */
  343.  
  344. static SHORT vectors4b[4];
  345.  
  346. static struct Border line4b = {
  347.     0,0,    /* XY origin relative to container TopLeft */
  348.     3,0,JAM2,    /* front pen, back pen and drawmode */
  349.     2,    /* number of XY vectors */
  350.     vectors4b,    /* pointer to XY vectors */
  351.     NULL    /* next border in list */
  352. };
  353.  
  354. static SHORT vectors4a[4];
  355.  
  356. static struct Border line4a = {
  357.     0,0,    /* XY origin relative to container TopLeft */
  358.     2,0,JAM2,    /* front pen, back pen and drawmode */
  359.     2,    /* number of XY vectors */
  360.     vectors4a,    /* pointer to XY vectors */
  361.     &line4b    /* next border in list */
  362. };
  363.  
  364. static SHORT vectors4[4];
  365.  
  366. static struct Border line4 = {
  367.     0,0,    /* XY origin relative to container TopLeft */
  368.     1,0,JAM2,    /* front pen, back pen and drawmode */
  369.     2,    /* number of XY vectors */
  370.     vectors4,    /* pointer to XY vectors */
  371.     &line4a    /* next border in list */
  372. };
  373.  
  374.  
  375.  
  376. /* adjust lines for the window size. */
  377.  
  378. vectors1[0] = 52;
  379. vectors1[2] = win->Width - 53;
  380. vectors1[1] = 1;
  381. vectors1[3] = 1;
  382. vectors1a[0] = 52;
  383. vectors1a[2] = win->Width - 53;
  384. vectors1a[1] = 1 +4;
  385. vectors1a[3] = 1 +4;
  386. vectors1b[0] = 52;
  387. vectors1b[2] = win->Width - 53;
  388. vectors1b[1] = 1 +8;
  389. vectors1b[3] = 1 +8;
  390.  
  391. vectors2[0] = 52;
  392. vectors2[2] = win->Width - 53;
  393. vectors2[1] = win->Height - 3 -1;
  394. vectors2[3] = win->Height - 3 -1;
  395. vectors2a[0] = 52;
  396. vectors2a[2] = win->Width - 53;
  397. vectors2a[1] = win->Height - 3 -1-4;
  398. vectors2a[3] = win->Height - 3 -1-4;
  399. vectors2b[0] = 52;
  400. vectors2b[2] = win->Width - 53;
  401. vectors2b[1] = win->Height - 3 -1-8;
  402. vectors2b[3] = win->Height - 3 -1-8;
  403.  
  404. vectors3[0] = 9;
  405. vectors3[2] = 9;
  406. vectors3[1] = 23;
  407. vectors3[3] = win->Height - 25;
  408. vectors3a[0] = 9+11;
  409. vectors3a[2] = 9+11;
  410. vectors3a[1] = 23;
  411. vectors3a[3] = win->Height - 25;
  412. vectors3b[0] = 9+22;
  413. vectors3b[2] = 9+22;
  414. vectors3b[1] = 23;
  415. vectors3b[3] = win->Height - 25;
  416.  
  417. vectors4[0] = win->Width - 10;
  418. vectors4[2] = win->Width - 10;
  419. vectors4[1] = 23;
  420. vectors4[3] = win->Height - 25;
  421. vectors4a[0] = win->Width - 10-11;
  422. vectors4a[2] = win->Width - 10-11;
  423. vectors4a[1] = 23;
  424. vectors4a[3] = win->Height - 25;
  425. vectors4b[0] = win->Width - 10-22;
  426. vectors4b[2] = win->Width - 10-22;
  427. vectors4b[1] = 23;
  428. vectors4b[3] = win->Height - 25;
  429.  
  430.  
  431. SetRast(win->RPort,0);
  432.  
  433. DrawImage(win->RPort,<,2,1);
  434. DrawImage(win->RPort,&rt,win->Width - 50 -2,1);
  435. DrawImage(win->RPort,&rb,win->Width - 50 -2,win->Height - 24-1);
  436. DrawImage(win->RPort,&lb,2,win->Height - 24-1);
  437.  
  438. DrawBorder(win->RPort,&line1,0,0);
  439. DrawBorder(win->RPort,&line2,0,0);
  440. DrawBorder(win->RPort,&line3,0,0);
  441. DrawBorder(win->RPort,&line4,0,0);
  442.  
  443.  
  444. }  /* end of routine */
  445.  
  446.  
  447.