home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The Fred Fish Collection 1.5
/
ffcollection-1-5-1992-11.iso
/
ff_disks
/
300-399
/
ff399.lzh
/
PrettyWindows
/
pwindows2.c
< prev
next >
Wrap
C/C++ Source or Header
|
1990-11-02
|
12KB
|
447 lines
#include <exec/types.h>
#include <exec/exec.h>
#include <intuition/intuition.h>
#include <graphics/gfxbase.h>
#include <graphics/gfx.h>
#include <graphics/gfxmacros.h>
/********************************************
* PrettyWindows v1.0 by Thom Robertson *
********************************************/
UWORD chip rb_data[4 * 24 * 2] = {
0x0000,0x0800,0x0020,0x0000,
0x0000,0x0800,0x0020,0x0000,
0x0000,0x0800,0x0020,0x0000,
0x0000,0x0800,0x0020,0x0000,
0x0000,0x0800,0x0020,0x0000,
0x0000,0x0800,0x0020,0x0000,
0x0000,0x0800,0x0020,0x0000,
0x0000,0x0800,0x0020,0x0000,
0x0000,0x003f,0xfc20,0x0000,
0x0001,0xffe0,0x03e0,0x0000,
0x0002,0x001f,0xffff,0x0000,
0x0004,0x0fff,0xf803,0xc000,
0x0004,0x7000,0x1e3e,0x0000,
0xfffc,0x8001,0xf3e0,0x0000,
0x0003,0x1fff,0xffff,0x0000,
0x0001,0x608e,0x0003,0xc000,
0x0003,0xffd0,0x003e,0x0000,
0x0004,0x003f,0xffc0,0x0000,
0x0008,0x1fff,0xf000,0x0000,
0x0008,0xe000,0x3c00,0x0000,
0x0009,0x0003,0xe000,0x0000,
0xfffe,0x3ffc,0x0000,0x0000,
0x0002,0xc000,0x0000,0x0000,
0x0001,0x0000,0x0000,0x0000,
0x0000,0x0801,0x0000,0x0000,
0x0000,0x0801,0x0000,0x0000,
0x0000,0x0801,0x0000,0x0000,
0x0000,0x0801,0x0000,0x0000,
0x0000,0x0801,0x0000,0x0000,
0x0000,0x0801,0x0000,0x0000,
0x0000,0x0801,0x0000,0x0000,
0x0000,0x0801,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,
0x0000,0x001f,0xfc00,0x0000,
0x0001,0xffe0,0x0000,0x0000,
0x0003,0xf000,0x07fc,0x0000,
0x0003,0x8fff,0xe1c0,0x0000,
0xfffb,0x7ffe,0x0c00,0x0000,
0x0000,0xe000,0x0000,0x0000,
0x0000,0x8071,0xfffc,0x0000,
0x0000,0x002f,0xffc0,0x0000,
0xfffb,0xffc0,0x0000,0x0000,
0x0007,0xe000,0x0000,0x0000,
0x0007,0x1fff,0xc000,0x0000,
0x0006,0xfffc,0x0000,0x0000,
0x0001,0xc000,0x0000,0x0000,
0x0001,0x0000,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000};
/* IMAGE STRUCTURE */
struct Image rb = {
0, 0, 50, 24, 2, &rb_data[0], 3, 0, NULL};
/* IMAGE DATA */
UWORD chip lb_data[4 * 24 * 2] = {
0x0100,0x0004,0x0000,0x0000,
0x0100,0x0004,0x0000,0x0000,
0x0100,0x0004,0x0000,0x0000,
0x0100,0x0004,0x0000,0x0000,
0x0100,0x0004,0x0000,0x0000,
0x0100,0x0004,0x0000,0x0000,
0x0100,0x0004,0x0000,0x0000,
0x0100,0x0004,0x0000,0x0000,
0x010f,0xff00,0x0000,0x0000,
0x01f0,0x01ff,0xe000,0x0000,
0x3fff,0xfe00,0x1000,0x0000,
0xf007,0xfffc,0x0800,0x0000,
0x1f1e,0x0003,0x8800,0x0000,
0x01f3,0xe000,0x4fff,0xc000,
0x3fff,0xfffe,0x3000,0x0000,
0xf000,0x1c41,0xa000,0x0000,
0x1f00,0x02ff,0xf000,0x0000,
0x00ff,0xff00,0x0800,0x0000,
0x0003,0xfffe,0x0400,0x0000,
0x000f,0x0001,0xc400,0x0000,
0x0001,0xf000,0x2400,0x0000,
0x0000,0x0fff,0x1fff,0xc000,
0x0000,0x0000,0xd000,0x0000,
0x0000,0x0000,0x2000,0x0000,
0x0000,0x2004,0x0000,0x0000,
0x0000,0x2004,0x0000,0x0000,
0x0000,0x2004,0x0000,0x0000,
0x0000,0x2004,0x0000,0x0000,
0x0000,0x2004,0x0000,0x0000,
0x0000,0x2004,0x0000,0x0000,
0x0000,0x2004,0x0000,0x0000,
0x0000,0x2004,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,
0x000f,0xfe00,0x0000,0x0000,
0x0000,0x01ff,0xe000,0x0000,
0x0ff8,0x0003,0xf000,0x0000,
0x00e1,0xfffc,0x7000,0x0000,
0x000c,0x1fff,0xb7ff,0xc000,
0x0000,0x0001,0xc000,0x0000,
0x0fff,0xe380,0x4000,0x0000,
0x00ff,0xfd00,0x0000,0x0000,
0x0000,0x00ff,0xf7ff,0xc000,
0x0000,0x0001,0xf800,0x0000,
0x0000,0xfffe,0x3800,0x0000,
0x0000,0x0fff,0xd800,0x0000,
0x0000,0x0000,0xe000,0x0000,
0x0000,0x0000,0x2000,0x0000,
0x0000,0x0000,0x0000,0x0000};
/* IMAGE STRUCTURE */
struct Image lb = {
0, 0, 50, 24, 2, &lb_data[0], 3, 0, NULL};
/* IMAGE DATA */
UWORD chip rt_data[4 * 22 * 2] = {
0xffff,0xfc3f,0xfc00,0x0000,
0x0001,0xffe0,0x03e0,0x0000,
0x0002,0x001f,0xffff,0x0000,
0x0004,0x0fff,0xf803,0xc000,
0x0004,0x7000,0x1e3e,0x0000,
0x0004,0x8001,0xf3e0,0x0000,
0x0003,0x1fff,0xffff,0x0000,
0x0001,0x608e,0x0003,0xc000,
0xffff,0xffd0,0x003e,0x0000,
0x0004,0x003f,0xffc0,0x0000,
0x0008,0x1fff,0xf020,0x0000,
0x0008,0xe000,0x3c20,0x0000,
0x0009,0x0003,0xe020,0x0000,
0x0006,0x3ffc,0x0020,0x0000,
0x0002,0xc800,0x0020,0x0000,
0x0001,0x0800,0x0020,0x0000,
0x0000,0x0800,0x0020,0x0000,
0x0000,0x0800,0x0020,0x0000,
0x0000,0x0800,0x0020,0x0000,
0x0000,0x0800,0x0020,0x0000,
0x0000,0x0800,0x0020,0x0000,
0x0000,0x0800,0x0020,0x0000,
0x0000,0x0000,0x0000,0x0000,
0x0000,0x001f,0xfc00,0x0000,
0x0001,0xffe0,0x0000,0x0000,
0x0003,0xf000,0x07fc,0x0000,
0xfffb,0x8fff,0xe1c0,0x0000,
0x0003,0x7ffe,0x0c00,0x0000,
0x0000,0xe000,0x0000,0x0000,
0x0000,0x8071,0xfffc,0x0000,
0xfffc,0x002f,0xffc0,0x0000,
0x0003,0xffc0,0x0000,0x0000,
0x0007,0xe000,0x0000,0x0000,
0x0007,0x1fff,0xc000,0x0000,
0x0006,0xfffc,0x0000,0x0000,
0x0001,0xc001,0x0000,0x0000,
0x0001,0x0801,0x0000,0x0000,
0x0000,0x0801,0x0000,0x0000,
0x0000,0x0801,0x0000,0x0000,
0x0000,0x0801,0x0000,0x0000,
0x0000,0x0801,0x0000,0x0000,
0x0000,0x0801,0x0000,0x0000,
0x0000,0x0801,0x0000,0x0000,
0x0000,0x0801,0x0000,0x0000};
/* IMAGE STRUCTURE */
struct Image rt = {
0, 0, 50, 22, 2, &rt_data[0], 3, 0, NULL};
/* IMAGE DATA */
UWORD chip lt_data[4 * 22 * 2] = {
0x000f,0xff0f,0xffff,0xc000,
0x01f0,0x01ff,0xe000,0x0000,
0x3fff,0xfe00,0x1000,0x0000,
0xf007,0xfffc,0x0800,0x0000,
0x1f1e,0x0003,0x8800,0x0000,
0x01f3,0xe000,0x4800,0x0000,
0x3fff,0xfffe,0x3000,0x0000,
0xf000,0x1c41,0xa000,0x0000,
0x1f00,0x02ff,0xffff,0xc000,
0x00ff,0xff00,0x0800,0x0000,
0x0103,0xfffe,0x0400,0x0000,
0x010f,0x0001,0xc400,0x0000,
0x0101,0xf000,0x2400,0x0000,
0x0100,0x0fff,0x1800,0x0000,
0x0100,0x0004,0xd000,0x0000,
0x0100,0x0004,0x2000,0x0000,
0x0100,0x0004,0x0000,0x0000,
0x0100,0x0004,0x0000,0x0000,
0x0100,0x0004,0x0000,0x0000,
0x0100,0x0004,0x0000,0x0000,
0x0100,0x0004,0x0000,0x0000,
0x0100,0x0004,0x0000,0x0000,
0x0000,0x0000,0x0000,0x0000,
0x000f,0xfe00,0x0000,0x0000,
0x0000,0x01ff,0xe000,0x0000,
0x0ff8,0x0003,0xf000,0x0000,
0x00e1,0xfffc,0x77ff,0xc000,
0x000c,0x1fff,0xb000,0x0000,
0x0000,0x0001,0xc000,0x0000,
0x0fff,0xe380,0x4000,0x0000,
0x00ff,0xfd00,0x0fff,0xc000,
0x0000,0x00ff,0xf000,0x0000,
0x0000,0x0001,0xf800,0x0000,
0x0000,0xfffe,0x3800,0x0000,
0x0000,0x0fff,0xd800,0x0000,
0x0000,0x2000,0xe000,0x0000,
0x0000,0x2004,0x2000,0x0000,
0x0000,0x2004,0x0000,0x0000,
0x0000,0x2004,0x0000,0x0000,
0x0000,0x2004,0x0000,0x0000,
0x0000,0x2004,0x0000,0x0000,
0x0000,0x2004,0x0000,0x0000,
0x0000,0x2004,0x0000,0x0000,
0x0000,0x2004,0x0000,0x0000};
/* IMAGE STRUCTURE */
struct Image lt = {
0, 0, 50, 22, 2, <_data[0], 3, 0, NULL};
prettywindow2(win,color)
struct Window *win;
int color;
{
/* Since we're using Images in this window, it's much tougher to change
the background color without leaving big black squares around the
images. So I just won't respond to the color variable.
*/
/* IMAGE DATA */
/* Here we define our border structures. */
/* top lines. */
static SHORT vectors1b[4];
static struct Border line1b = {
0,0, /* XY origin relative to container TopLeft */
3,0,JAM2, /* front pen, back pen and drawmode */
2, /* number of XY vectors */
vectors1b, /* pointer to XY vectors */
NULL /* next border in list */
};
static SHORT vectors1a[4];
static struct Border line1a = {
0,0, /* XY origin relative to container TopLeft */
2,0,JAM2, /* front pen, back pen and drawmode */
2, /* number of XY vectors */
vectors1a, /* pointer to XY vectors */
&line1b /* next border in list */
};
static SHORT vectors1[4];
static struct Border line1 = {
0,0, /* XY origin relative to container TopLeft */
1,0,JAM2, /* front pen, back pen and drawmode */
2, /* number of XY vectors */
vectors1, /* pointer to XY vectors */
&line1a /* next border in list */
};
/* bottom lines. */
static SHORT vectors2b[4];
static struct Border line2b = {
0,0, /* XY origin relative to container TopLeft */
3,0,JAM2, /* front pen, back pen and drawmode */
2, /* number of XY vectors */
vectors2b, /* pointer to XY vectors */
NULL /* next border in list */
};
static SHORT vectors2a[4];
static struct Border line2a = {
0,0, /* XY origin relative to container TopLeft */
2,0,JAM2, /* front pen, back pen and drawmode */
2, /* number of XY vectors */
vectors2a, /* pointer to XY vectors */
&line2b /* next border in list */
};
static SHORT vectors2[4];
static struct Border line2 = {
0,0, /* XY origin relative to container TopLeft */
1,0,JAM2, /* front pen, back pen and drawmode */
2, /* number of XY vectors */
vectors2, /* pointer to XY vectors */
&line2a /* next border in list */
};
/* left lines. */
static SHORT vectors3b[4];
static struct Border line3b = {
0,0, /* XY origin relative to container TopLeft */
3,0,JAM2, /* front pen, back pen and drawmode */
2, /* number of XY vectors */
vectors3b, /* pointer to XY vectors */
NULL /* next border in list */
};
static SHORT vectors3a[4];
static struct Border line3a = {
0,0, /* XY origin relative to container TopLeft */
2,0,JAM2, /* front pen, back pen and drawmode */
2, /* number of XY vectors */
vectors3a, /* pointer to XY vectors */
&line3b /* next border in list */
};
static SHORT vectors3[4];
static struct Border line3 = {
0,0, /* XY origin relative to container TopLeft */
1,0,JAM2, /* front pen, back pen and drawmode */
2, /* number of XY vectors */
vectors3, /* pointer to XY vectors */
&line3a /* next border in list */
};
/* right lines. */
static SHORT vectors4b[4];
static struct Border line4b = {
0,0, /* XY origin relative to container TopLeft */
3,0,JAM2, /* front pen, back pen and drawmode */
2, /* number of XY vectors */
vectors4b, /* pointer to XY vectors */
NULL /* next border in list */
};
static SHORT vectors4a[4];
static struct Border line4a = {
0,0, /* XY origin relative to container TopLeft */
2,0,JAM2, /* front pen, back pen and drawmode */
2, /* number of XY vectors */
vectors4a, /* pointer to XY vectors */
&line4b /* next border in list */
};
static SHORT vectors4[4];
static struct Border line4 = {
0,0, /* XY origin relative to container TopLeft */
1,0,JAM2, /* front pen, back pen and drawmode */
2, /* number of XY vectors */
vectors4, /* pointer to XY vectors */
&line4a /* next border in list */
};
/* adjust lines for the window size. */
vectors1[0] = 52;
vectors1[2] = win->Width - 53;
vectors1[1] = 1;
vectors1[3] = 1;
vectors1a[0] = 52;
vectors1a[2] = win->Width - 53;
vectors1a[1] = 1 +4;
vectors1a[3] = 1 +4;
vectors1b[0] = 52;
vectors1b[2] = win->Width - 53;
vectors1b[1] = 1 +8;
vectors1b[3] = 1 +8;
vectors2[0] = 52;
vectors2[2] = win->Width - 53;
vectors2[1] = win->Height - 3 -1;
vectors2[3] = win->Height - 3 -1;
vectors2a[0] = 52;
vectors2a[2] = win->Width - 53;
vectors2a[1] = win->Height - 3 -1-4;
vectors2a[3] = win->Height - 3 -1-4;
vectors2b[0] = 52;
vectors2b[2] = win->Width - 53;
vectors2b[1] = win->Height - 3 -1-8;
vectors2b[3] = win->Height - 3 -1-8;
vectors3[0] = 9;
vectors3[2] = 9;
vectors3[1] = 23;
vectors3[3] = win->Height - 25;
vectors3a[0] = 9+11;
vectors3a[2] = 9+11;
vectors3a[1] = 23;
vectors3a[3] = win->Height - 25;
vectors3b[0] = 9+22;
vectors3b[2] = 9+22;
vectors3b[1] = 23;
vectors3b[3] = win->Height - 25;
vectors4[0] = win->Width - 10;
vectors4[2] = win->Width - 10;
vectors4[1] = 23;
vectors4[3] = win->Height - 25;
vectors4a[0] = win->Width - 10-11;
vectors4a[2] = win->Width - 10-11;
vectors4a[1] = 23;
vectors4a[3] = win->Height - 25;
vectors4b[0] = win->Width - 10-22;
vectors4b[2] = win->Width - 10-22;
vectors4b[1] = 23;
vectors4b[3] = win->Height - 25;
SetRast(win->RPort,0);
DrawImage(win->RPort,<,2,1);
DrawImage(win->RPort,&rt,win->Width - 50 -2,1);
DrawImage(win->RPort,&rb,win->Width - 50 -2,win->Height - 24-1);
DrawImage(win->RPort,&lb,2,win->Height - 24-1);
DrawBorder(win->RPort,&line1,0,0);
DrawBorder(win->RPort,&line2,0,0);
DrawBorder(win->RPort,&line3,0,0);
DrawBorder(win->RPort,&line4,0,0);
} /* end of routine */