Exemplo n.º 1
0
static VOID LowerFrame(struct RastPort *rport, UWORD MinX, UWORD MinY, UWORD MaxX,
                       UWORD MaxY, UWORD color)
{
  SetAPen(rport, color);
  RectFill(rport, MinX, MaxY, MaxX, MaxY);
  RectFill(rport, MaxX, MinY, MaxX, MaxY);
}
Exemplo n.º 2
0
/*** Display cursor of project p ***/
void inv_curs(Project p, BYTE state)
{
	if(p->ccp.select)
	{
		/* Just draw a simple vert bart for selection */
		WORD y = p->ycurs - BASEL;
		RectFill(RP,p->xcurs, y, p->xcurs+1, y+YSIZE-1);
	}	else {
		UBYTE thechar, oldmask = RP->Mask;
		/* Fully highlight character */
		RP->Mask = gui.selmask;
		if(state) SetABPenDrMd(RP,pen.fgfill,pen.bgfill,JAM2);

		if(state != 0 && p->cursmode) {
			/* Draw the replacement cursor */
			SetAPen(RP, pen.bgfill);
			RectFill(RP,p->xcurs, p->ycurs, p->xcurs+XSIZE-1, p->ycurs-BASEL+YSIZE-1);
		} else {
			/* Normal cursor */
			thechar = (p->nbc < p->edited->size ? p->edited->stream[p->nbc] : ' ');
			if(thechar == '\t') thechar = ' ';
			Move(RP,p->xcurs,p->ycurs); Text(RP,&thechar,1);
		}
		SetABPenDrMd(RP,pen.fg,pen.bg,JAM2);
		RP->Mask = oldmask;
	}
}
Exemplo n.º 3
0
VOID TableClass::Render (struct RenderMessage &rmsg)
{
  if(Flags & FLG_Layouted)
  {
    struct RastPort *rp = rmsg.RPort;
    BOOL oldborder = rmsg.TableBorder, target;

    LONG old_backgroundcol = rmsg.Colours[Col_Background];
    class SuperClass *oldbackground = rmsg.BackgroundObj;
    if(BackgroundRGB != -1 || Picture)
    {
      SetCol(rmsg.Colours[Col_Background], BackgroundCol);
      rmsg.BackgroundObj = this;
    }

    if((target = (rmsg.TargetObj == (class SuperClass *)this)))
      rmsg.TargetObj = NULL;

    if(!rmsg.TargetObj)
    {
      if(rmsg.BackgroundObj == (class BackFillClass *)this)
        DrawBackground(rmsg, Left+BorderSize-rmsg.OffsetX, Top+BorderSize-rmsg.OffsetY, Left+BorderSize+Width-1+((Columns+1)*Spacing)-rmsg.OffsetX, Bottom-BorderSize-rmsg.OffsetY, 0, 0);

      if(BorderSize)
      {
        ULONG width = Width+((Columns+1)*Spacing)+2*BorderSize;
        LONG  x1 = Left-rmsg.OffsetX, x2 = Left+width-rmsg.OffsetX-1,
            y1 = Top-rmsg.OffsetY, y2 = Bottom-rmsg.OffsetY;

        SetAPen(rp, rmsg.Colours[Col_Halfshadow]);
        RectFill(rp, x1+BorderSize, y2-BorderSize+1, x2, y2);
        RectFill(rp, x2-BorderSize+1, y1+BorderSize, x2, y2);
        SetAPen(rp, rmsg.Colours[Col_Halfshine]);
        RectFill(rp, x1, y1, x2-BorderSize, y1+BorderSize-1);
        RectFill(rp, x1, y1+BorderSize, x1+BorderSize-1, y2-BorderSize);

        DrawCorner(rp, x1, y2-BorderSize+1, BorderSize, rmsg.Colours[Col_Halfshine], rmsg.Colours[Col_Halfshadow]);
        DrawCorner(rp, x2-BorderSize+1, y1, BorderSize, rmsg.Colours[Col_Halfshine], rmsg.Colours[Col_Halfshadow]);
      }
    }

    rmsg.TableBorder = BorderSize;

    struct ChildsList *first = FirstChild;
    while(first)
    {
      ((class TRClass *)first->Obj)->TRRender(rmsg);
      first = first->Next;
    }

    rmsg.TableBorder = oldborder;
    rmsg.BackgroundObj = (class BackFillClass *)oldbackground;
    rmsg.Colours[Col_Background] = old_backgroundcol;

    if(target)
      rmsg.TargetObj = this;
  }
}
Exemplo n.º 4
0
void cardRender( Card theCard, struct RastPort *Rast, long xPos, long yPos )
{
    SetDrMd( Rast, JAM2 );
    if( theCard )
    {
        if( cardFaceUp( theCard ))
        {
            SetAPen( Rast, 2 );
            RectFill( Rast, xPos, yPos, xPos+CARD_WIDTH-1,
                     yPos+CARD_HEIGHT-1 );
            SetBPen( Rast, 2 );
            switch( cardSuit( theCard ))
            {
            case HEARTS:
            case DIAMONDS:
                SetAPen( Rast, 6 );
                break;
            default:
                SetAPen( Rast, 1 );
                break;
            }
            SuitImages[cardSuit( theCard )].PlaneOnOff = 0x2;
            DrawImage( Rast, &SuitImages[cardSuit( theCard )],
                      xPos + Rast->TxWidth + 3, yPos + 3 );
            DrawImage( Rast, &SuitImages[cardSuit( theCard )],
                      xPos + CARD_WIDTH - Rast->TxWidth - 10,
                      yPos + CARD_HEIGHT - Rast->TxHeight - 2 );
            gfxMove( Rast, xPos + 2, yPos + Rast->TxBaseline + 3 );
            Text( Rast, RankToStr[cardRank( theCard )], 1 );
            gfxMove( Rast, xPos + CARD_WIDTH - Rast->TxWidth - 3,
                 yPos + CARD_HEIGHT - Rast->TxHeight + Rast->TxBaseline - 2 );
            Text( Rast, RankToStr[cardRank( theCard )], 1 );
        }
        else
        {
            SetAPen( Rast, 7 );
            RectFill( Rast, xPos, yPos, xPos+CARD_WIDTH-1,
                     yPos+CARD_HEIGHT-1 );
        }
    }
    else
    {
        SetAPen( Rast, 0 );
        RectFill( Rast, xPos, yPos, xPos+CARD_WIDTH-1, yPos+CARD_HEIGHT-1 );
    }
    SetAPen( Rast, 1 );
    gfxMove( Rast, xPos, yPos );
    Draw( Rast, xPos+CARD_WIDTH-1, yPos );
    Draw( Rast, xPos+CARD_WIDTH-1, yPos+CARD_HEIGHT-1 );
    Draw( Rast, xPos, yPos+CARD_HEIGHT-1 );
    Draw( Rast, xPos, yPos );
    SetAPen( Rast, 5 );
    WritePixel( Rast, xPos, yPos );
    WritePixel( Rast, xPos+CARD_WIDTH-1, yPos );
    WritePixel( Rast, xPos, yPos+CARD_HEIGHT-1 );
    WritePixel( Rast, xPos+CARD_WIDTH-1, yPos+CARD_HEIGHT-1 );
}
Exemplo n.º 5
0
static VOID DrawGhosted(struct TB_Element *tool, struct Toolbar_Data *data, Object *obj, BOOL selected)
{
  switch(data->GhostEffect)
  {
    case GHOST_LIGHT:
    case GHOST_HEAVY:
    {
      DrawButton(tool, data, obj, selected, !data->ToolImages);

      if(data->ToolImages)
      {
        struct RastPort *rport = &data->RP;
        USHORT ditherData[2];

        if(data->GhostEffect == GHOST_LIGHT)
        {
          ditherData[0] = 0x8888;
          ditherData[1] = 0x2222;
        }
        else
        {
          ditherData[0] = 0x5555;
          ditherData[1] = 0xAAAA;
        }

        SetAPen(rport, _pens(obj)[MPEN_SHADOW]);
        SetAfPt(rport, ditherData, 1);
        RectFill(rport, tool->DstX, tool->DstY, tool->DstX+data->ButtonWidth-1, tool->DstY + data->ButtonHeight-1);
        SetAfPt(rport, NULL, 0);
      }
    }
    break;
    case GHOST_SUPERLIGHT:
    {
      DrawButton(tool, data, obj, selected, THREE_D);

      if(data->ToolImages)
      {
        struct RastPort *rport = &data->RP;
        USHORT ditherData[] = {0x5555, 0xAAAA};
        SetAPen(rport, _pens(obj)[MPEN_HALFSHINE]);
        SetAfPt(rport, ditherData, 1);
        RectFill(rport, tool->DstX+2, tool->DstY+2, tool->DstX+data->ButtonWidth-3, tool->DstY+1+data->InnerSpace+data->IconHeight);
        SetAfPt(rport, NULL, 0);
      }
    }
    break;
    case GHOST_BITMAP:
//    case GHOST_DIMMED:
    {
      DrawButton(tool, data, obj, selected, THREE_D);
    }
    break;
  }
}
Exemplo n.º 6
0
static VOID DrawText(struct RastPort *rport, WORD x, WORD y, STRPTR text, char hotkey, UWORD textcolor, BOOL parse)
{
  ULONG length = strlen(text);
  y += rport->TxBaseline;

  SetAPen(rport, textcolor);
  Move(rport, x, y);

  if(hotkey)
  {
    if(parse)
    {
      char *textpnt = text;
      UWORD delta = 0;
      while(*textpnt != '\0')
      {
        if(*textpnt == '_')
        {
          Text(rport, text, delta);
          x += TextLength(rport, text, delta);
          text = textpnt+1;
          RectFill(rport, x, y+2, x+TextLength(rport, text, 1)-2, y+2);
          Move(rport, x, y);
          break;
        }
        delta++;
        textpnt++;
      }
      Text(rport, text, strlen(text));
    }
    else
    {
      ULONG i=0;
      Text(rport, text, length);

      for(i=0; i != length; i++)
      {
        if(hotkey == ToLower(text[i]))
        {
          ULONG width = TextLength(rport, text, i);
          RectFill(rport, x+width, y+2, x+width+TextLength(rport, &text[i], 1)-2, y+2);
          break;
        }

      }
    }
  }
  else
  {
    Text(rport, text, length);
  }
}
void ClearRX(int s)
{
 switch(s)
 {
   case 1: RectFill(44,75,52,81,3);break;
   case 2: RectFill(81,75,89,81,3);break;
   case 3: RectFill(118,75,126,81,3);break;
   case 4: RectFill(155,75,163,81,3);break;
   case 5: RectFill(192,75,200,81,3);break;
   default:break;
  }
 return;
}
Exemplo n.º 8
0
VOID TableClass::DrawCorner(struct RastPort *rport, LONG x, LONG y, UWORD width, UBYTE col1, UBYTE col2)
{
  LONG y2 = y+width-1;
  while(width--)
  {
    SetAPen(rport, col1);
    RectFill(rport, x, y, x+width, y);
    y++;
    if(y2 >= y)
    {
      SetAPen(rport, col2);
      RectFill(rport, x+width, y, x+width, y2);
    }
  }
}
/** draws the bubble on the screen,
 * starts with upper left coor
 * 
 * \param x x-coord of the upper left corner of the bubble
 * \param y y-coord of the upper left corner of the bubble
 */
void Bd(int x,int y)
{
 int x1,y1,x2,y2;
 x1=x-2; y1=y; x2=x-1; y2=y-1;
 RectFill(x1,y1,x1+8,y1+4,21);
 RectFill(x2,y2,x2+6,y2+6,21);
 grSetColor(1);
 grMoveTo(x,y+4);
 /** \note references Bub_Count to determine the number of the character to draw in the bubble */
 DispChr(65+Bub_Count);
 StepBub[Bub_Count].x_cor=x1;
 StepBub[Bub_Count].y_cor=y1;
 ++Bub_Count;
 return;
}
Exemplo n.º 10
0
void Clear(void)
{
 RectFill(44,31,145,40,3);RectFill(49,112,60,119,3);
 RectFill(123,62,145,77,3);RectFill(125,79,145,85,3);RectFill(128,86,145,93,3);
 RectFill(123,95,145,101,3);RectFill(127,113,141,120,3);
 RectFill(130,54,155,61,3);     
 return;
}
Exemplo n.º 11
0
VOID test_bltmask(struct Window *w)
{
/*    ULONG mask[] = {
	0xAAAAAAAA,
	0xAAAAAAAA,
	0xFFFFFFFF,
	0xFFFFFFFF,
	0xAAAAAAAA,
	0xAAAAAAAA
    };
*/    
    /* Fill a area to blit from */
    
    SetAPen(w->RPort, 1);
    
    RectFill(w->RPort, SRC_X, SRC_Y, SRC_X + MASK_WIDTH - 1, SRC_Y + MASK_HEIGHT);
    
    /* Blit from source area */
/*    BltMaskBitMapRastPort(w->RPort
    	, SRC_X, SRC_Y
	, DEST_X, DEST_Y
	, MASK_WIDTH, MASK_HEIGHT
	, 0x00C0
	, (PLANEPTR) mask
   );
*/
				
    return;
}
Exemplo n.º 12
0
IPTR Colorfield__MUIM_Draw(struct IClass *cl, Object *obj, struct MUIP_Draw *msg)
{
    struct Colorfield_DATA *data = INST_DATA(cl,obj);

    DoSuperMethodA(cl,obj,(Msg)msg);
    
    if (!(msg->flags & (MADF_DRAWOBJECT | MADF_DRAWUPDATE)))
        return FALSE;

    if (data->flags & FLAG_NO_PEN)
    {
    	static UWORD pat[] = {0x1111,0x2222,0x4444,0x8888};
	
    	SetAfPt(_rp(obj), pat, 2);
	SetABPenDrMd(_rp(obj), _pens(obj)[MPEN_SHADOW], _pens(obj)[MPEN_BACKGROUND],JAM2);

    }
    else
    {
	SetABPenDrMd(_rp(obj), data->pen, 0,JAM1);
    }
    
    RectFill(_rp(obj), _mleft(obj), _mtop(obj), _mright(obj), _mbottom(obj));
    
    SetAfPt(_rp(obj), NULL, 0);
    
    return 0;
}
Exemplo n.º 13
0
ULONG ERASE_Frame(piClass *cl,piObject *o,Msg msg)
{
	UWORD x,y,w,h;
	piObject *wo;
	struct Node_Window *nw;

	piGetAttr(o,OBJ_Window,(ULONG *)&wo);
	if(wo)
	{
		piGetAttr(wo,OBJ_Node,(ULONG *)&nw);
		if(nw) if(nw->nw_Window)
		{
			x=piCX(o);
			y=piCY(o);
			w=piCW(o);
			h=piCH(o);

			SetAPen(nw->nw_Window->RPort,DrawInfo->dri_Pens[BACKGROUNDPEN]);
			SetDrMd(nw->nw_Window->RPort,JAM1);
			RectFill(nw->nw_Window->RPort,x,y,x+w,y+h);
			piShowGrid(o);
		}
	}
	return TRUE;
}
Exemplo n.º 14
0
ULONG ERASE_Gadget(piClass *cl,piObject *o,Msg msg)
{
	UWORD x,y,w,h;
	piObject *wo;
	struct Node_Window *nw;
	struct Node_Gadget *ng;

	piGetAttr(o,OBJ_Node,(ULONG *)&ng);
	piGetAttr(o,OBJ_Window,(ULONG *)&wo);
	if(wo)
	{
		piGetAttr(wo,OBJ_Node,(ULONG *)&nw);
		if(nw) if(nw->nw_Window)
		{
//			if(!ng->ng_RelX)
 x=piCX(o);// else x=nw->nw_Width-ng->ng_X;
//			if(!ng->ng_RelY)
 y=piCY(o);// else y=nw->nw_Height-ng->ng_Y;
//			if(!ng->ng_RelWidth)
 w=piCW(o);// else w=nw->nw_Width-nw->nw_Window->BorderRight+ng->ng_Width-x;
//			if(!ng->ng_RelHeight)
 h=piCH(o);// else h=nw->nw_Height-nw->nw_Window->BorderBottom+ng->ng_Height-y;

			SetAPen(nw->nw_Window->RPort,DrawInfo->dri_Pens[BACKGROUNDPEN]);
			SetDrMd(nw->nw_Window->RPort,JAM1);
			RectFill(nw->nw_Window->RPort,x,y,x+w,y+h);
			piShowGrid(o);
		}
	}
	return TRUE;
}
Exemplo n.º 15
0
IPTR FillRectClass__IM_DRAW(Class *cl, Object *obj, struct impDraw *msg)
{
    struct FillRectData *data = INST_DATA(cl, obj);
    struct RastPort      rp;
    WORD            	 x1, y1, x2, y2;

    if (!((struct impDraw *)msg)->imp_RPort) return 0;

    memcpy(&rp,((struct impDraw *)msg)->imp_RPort,sizeof (struct RastPort));
    
    SetABPenDrMd(&rp, IM_FGPEN((struct Image *)obj),
                 IM_BGPEN((struct Image *)obj),
                 data->mode);

    SetAfPt(&rp, (APTR)((struct Image *)obj)->ImageData, data->apatsize);

    x1 = ((struct Image *)obj)->LeftEdge + ((struct impDraw *)msg)->imp_Offset.X;
    y1 = ((struct Image *)obj)->TopEdge  + ((struct impDraw *)msg)->imp_Offset.Y;

    if (msg->MethodID == IM_DRAW)
    {
        x2 = x1 + ((struct Image *)obj)->Width  - 1;
        y2 = y1 + ((struct Image *)obj)->Height - 1;
    }
    else
    {
        x2 = x1 + msg->imp_Dimensions.Width  - 1;
        y2 = y1 + msg->imp_Dimensions.Height - 1;
    }

    RectFill(&rp, x1, y1, x2, y2);

    return 0;
}
Exemplo n.º 16
0
VOID DrawSeparator (struct RastPort *rp, WORD X, WORD Y, WORD Width, WORD Height, struct InstData *data)
{
  ENTER();

  if(Width > 3*Height)
  {
    SetAPen(rp, data->separatorshadow);
    RectFill(rp, X, Y, X+Width-2, Y);
    RectFill(rp, X, Y, X, Y+Height);

    SetAPen(rp, data->separatorshine);
    RectFill(rp, X+1, Y+Height, X+Width-1, Y+Height);
    RectFill(rp, X+Width-1, Y, X+Width-1, Y+Height);
  }

  LEAVE();
}
Exemplo n.º 17
0
static void vsid_clear_window(void)
{
    ULONG vsid_pen;

    vsid_pen = GetAPen(vsid_window->RPort);
    SetAPen(vsid_window->RPort, GetBPen(vsid_window->RPort));
    RectFill(vsid_window->RPort, 25, 30, 350, 150);
    SetAPen(vsid_window->RPort, vsid_pen);
}
Exemplo n.º 18
0
void rect (long xMin, long yMin, long xMax, long yMax, unsigned long pen)
{
  unsigned long saved_pen;

  saved_pen = RastPort->FgPen;
  SetAPen (RastPort, pen);
  RectFill (RastPort, xMin, yMin, xMax, yMax);
  SetAPen (RastPort, saved_pen);
}
Exemplo n.º 19
0
void stackRender( Stack *theStack, struct RastPort *theRastPort, long Full )
{
    long Left, Delta, i;

    switch( stackArrangement( theStack ))
    {
    case SA_VERTICAL:
        cardRender( stackGetCard( theStack, 0 ), theRastPort,
                   theStack->st_Left, theStack->st_Top );
        break;
    case SA_SKEWED:
        Left = theStack->st_Left;
        Delta = ( Left > Scr->Width/2 )? CARD_WIDTH/3 : -CARD_WIDTH/3;
        i = max( stackEntries( theStack ), 1 );
        do
        {
            if( Full ||( i == 1 ))
                cardRender( stackGetCard( theStack, i-1 ), theRastPort, Left,
                           theStack->st_Top );
            if( --i )
                Left += Delta;
        }
        while( i );
        SetAPen( theRastPort, 5 );
        /* Clear out the last 1/3 card incase an old card was there */
        if( Delta < 0 )
           RectFill( theRastPort, Left+Delta, theStack->st_Top, Left-1,
                     theStack->st_Top+CARD_HEIGHT-1 );
        else
            RectFill( theRastPort, Left+CARD_WIDTH, theStack->st_Top,
                     Left+CARD_WIDTH+Delta-1, theStack->st_Top+CARD_HEIGHT-1 );
        break;
    }

    if( !theStack->st_NumCards &&( theStack->st_Suit < 4 ))
    {
        struct Image *theImage = SuitImages+theStack->st_Suit;

        theImage->PlaneOnOff = 0x0;
        DrawImage( theRastPort, theImage,
                  theStack->st_Left + CARD_WIDTH/2 - theImage->Width/2,
                  theStack->st_Top + CARD_HEIGHT/2 - theImage->Height/2 );
    }
}
Exemplo n.º 20
0
/*>ClearWindow(struct Window *wind)
   --------------------------------
   Clears the specified RastPort with a rectfill
   06.04.92 Original
*/
ClearWindow(struct Window *wind)
{
   SetAPen(wind->RPort,0);
   RectFill(wind->RPort,
            wind->BorderLeft,
            wind->BorderTop,
            wind->Width  - wind->BorderRight,
            wind->Height - wind->BorderBottom);
   return(0);
}
Exemplo n.º 21
0
// Highlight button
void buttons_highlight_button(Buttons *buttons,short state,short do_corners)
{
	short ret=0;

	// Redraw imagery
	if (do_corners!=-1 && (state==1 || !(buttons->flags&BUTTONF_NO_ALTIMAGE)))
	{
		if (!(ret=buttons_draw_button(
			buttons,
			buttons->button_sel_button,
			buttons->button_sel_col,
			buttons->button_sel_row,
			buttons->button_sel_which,
			state,0)) && state && 0) buttons->flags|=BUTTONF_NO_ALTIMAGE;
	}
	else buttons->flags&=~BUTTONF_NO_ALTIMAGE;

	// Redraw border
	if (!(buttons_draw_border(
		buttons,
		buttons->button_sel_button,
		buttons->button_sel_col,
		buttons->button_sel_row,
		state,do_corners,0)) && !ret && state)
	{
		short x,y;

		// We must be borderless with no alternate imagery
		// Calculate column/row to highlight
		x=buttons->button_sel_col-buttons->button_left;
		y=buttons->button_sel_row-buttons->button_top;

		// See if button is visible
		if (x>=0 && x<buttons->button_cols &&
			y>=0 && y<buttons->button_rows)
		{
			// Get position
			x=buttons->internal.Left+x*buttons->button_width;
			y=buttons->internal.Top+y*buttons->button_height;

			// Set Complement mode
			SetDrMd(buttons->window->RPort,COMPLEMENT);

			// Highlight button
			RectFill(
				buttons->window->RPort,
				x,y,
				x+buttons->button_width-1,y+buttons->button_height-1);

			// Set back to JAM1
			SetDrMd(buttons->window->RPort,JAM1);
		}
	}
}
Exemplo n.º 22
0
IPTR MenuBarLabelClass__IM_DRAW(Class *cl, struct Image *im, struct impDraw *msg)
{
    struct MenuBarLabelData *data = INST_DATA(cl, im);

    if (data->dri)
    {
        struct RastPort *rp = msg->imp_RPort;
        WORD x1, y1, x2, y2;

        if (!rp) return (IPTR)0;

        SetDrMd(rp, JAM1);

        x1 = im->LeftEdge + msg->imp_Offset.X;
        y1 = im->TopEdge  + msg->imp_Offset.Y;
        x2 = x1 + im->Width  - 1;
        y2 = y1 + im->Height - 1;


        if (MENUS_AMIGALOOK)
        {
            SetAPen(rp, data->dri->dri_Pens[BARDETAILPEN]);
            RectFill(rp, x1, y1, x2, y2);
        }
        else
        {
            /* Will only work if imageheight = 2 */
            SetAPen(rp, data->dri->dri_Pens[SHADOWPEN]);
            RectFill(rp, x1, y1, x2 - 1, y1);
            WritePixel(rp, x1, y2);

            SetAPen(rp, data->dri->dri_Pens[SHINEPEN]);
            RectFill(rp, x1 + 1, y2, x2, y2);
            WritePixel(rp, x2, y1);
        }

    } /* if (data->dri) */

    return (IPTR)0;
}
Exemplo n.º 23
0
// Draw list items
void listview_draw_items(
	Class *cl,
	struct Gadget *gadget,
	struct RastPort *rp,
	struct DrawInfo *drawinfo,
	ListViewData *data,
	short old_sel)
{
	struct Node *node;
	unsigned short line;

	// Is list detached?
	if (data->flags&LVF_DETACHED)
		return;

	// Clear list?
	if (!data->labels || !data->labels->lh_Head->ln_Succ)
	{
		SetAPen(rp,drawinfo->dri_Pens[BACKGROUNDPEN]);
		RectFill(rp,
			data->list_dims.Left+((data->flags&LVF_THIN_BORDER)?1:2),
			data->list_dims.Top+1,
			data->list_dims.Left+data->list_dims.Width-((data->flags&LVF_THIN_BORDER)?2:3),
			data->list_dims.Top+data->list_dims.Height-2);
		return;
	}

	// Draw items
	for (node=data->top_item,line=0;
		line<data->lines;
		node=(node)?node->ln_Succ:0,line++)
	{
		// Only drawing current and last?
		if (old_sel>-1)
		{
			// Ok to draw this?
			if (line==old_sel-data->top ||
				line==data->sel-data->top)
			{
				// Draw this line
				listview_draw_item(cl,gadget,rp,drawinfo,data,node,line,0);

				// Are they the same?
				if (old_sel==data->sel)
					break;
			}
		}

		// Drawing all
		else listview_draw_item(cl,gadget,rp,drawinfo,data,node,line,0);
	}
}
Exemplo n.º 24
0
void DrawRect(struct RastPort *rp,UWORD x,UWORD y,BOOL fill)
{
	if(fill)
		RectFill(rp,x,y,x+5,y+5);
	else
	{
		Move(rp,x,y);
		Draw(rp,x+5,y);
		Draw(rp,x+5,y+5);
		Draw(rp,x,y+5);
		Draw(rp,x,y);
	}
}
Exemplo n.º 25
0
BoxScreen()
{
 short bx1,by1,bx2,by2,p=pathsize+BORDERSIZE;
 bx1=minx-p;bx2=maxx+p;
 by1=miny-p;by2=maxy+p;
                               /* These routines removed for SupBitMap */
 bx1=(bx1<0)?0:bx1;            /* bx2=(bx2>maxx)?maxx:bx2; */
 by1=(by1<FIRSTY)?FIRSTY:by1;  /* by2=(by2>maxy)?maxy:by2; */

 SetAPen(rastport,FILLCOLOR);
 SetOPen(rastport,OUTLINECOLOR);
 RectFill(rastport,bx1,by1,bx2,by2);
 return 0;
}
Exemplo n.º 26
0
void
nsSplashScreenAmigaOS::Update(PRInt32 progress)
{
	if (!mIsOpen)
		return;

	mProgress = progress;

	// Current image has progress bar 183,149 - 410,153
	uint32 pbWidth = (410 - 183) * progress / 100;

	mIGraphics->SetAPen(mWindow->RPort, 3);
	mIGraphics->SetDrMd(mWindow->RPort, JAM1);
	mIGraphics->RectFill(mWindow->RPort, 183, 149, pbWidth + 183, 153);
}
Exemplo n.º 27
0
ULONG TAPEDECK_RENDER_Gadget(piClass *cl,piObject *o,Msg msg)
{
	UWORD x,y,w,h;
	struct Node_Gadget *ng;
	struct Node_Window *nw;
	struct Gadget *g,*ga;
	BOOL fill=FALSE;

	piGetAttr(o,OBJ_Node,(ULONG *)&ng);
	piGetAttr(ng->ng_Window,OBJ_Node,(ULONG *)&nw);

	x=piCX(o);
	y=piCY(o);
	w=piCW(o);
	h=piCH(o);

	SetAPen(nw->nw_Window->RPort,DrawInfo->dri_Pens[BACKGROUNDPEN]);
	SetDrMd(nw->nw_Window->RPort,JAM1);
	RectFill(nw->nw_Window->RPort,x,y,x+w,y+h);

	g=CreateContext(&g);
	if(ga=(struct Gadget *)piDoMethod(o,OM_CREATE,g))
	{
		AddGList(nw->nw_Window,ga,-1,-1,NULL);
		RefreshGList(g,nw->nw_Window,NULL,-1);
		RemoveGList(nw->nw_Window,ga,-1);
	}
	piDoMethod(o,OM_DELETE);
	g->NextGadget=NULL;
	FreeGadgets(g);

	if(ng->ng_Selected && GUI.gui_Mode==MODE_GADGET)
	{
		SetAPen(nw->nw_Window->RPort,1);
		SetDrMd(nw->nw_Window->RPort,COMPLEMENT);
		if(CurrentGadget==o) fill=TRUE;
		DrawRect(nw->nw_Window->RPort,x,y,fill);
		DrawRect(nw->nw_Window->RPort,x+w-5,y,fill);
		DrawRect(nw->nw_Window->RPort,x+w-5,y+h-5,fill);
		DrawRect(nw->nw_Window->RPort,x,y+h-5,fill);
		DrawRect(nw->nw_Window->RPort,x+(w/2)-2,y,fill);
		DrawRect(nw->nw_Window->RPort,x+(w/2)-2,y+h-5,fill);
		DrawRect(nw->nw_Window->RPort,x,y+(h/2)-2,fill);
		DrawRect(nw->nw_Window->RPort,x+w-5,y+(h/2)-2,fill);
	}
	return TRUE;
}
Exemplo n.º 28
0
int GetMinus(char plr)
{
 char i;int u;

 i=PrestMin(plr);
  RectFill(206,36,235,44,7);
 if (i<3) u=1; //ok
   else if (i<9) u=10; //caution
	else u=19; //danger
  gxVirtualDisplay(&vh,203,u,203,24,238,31,0);
 grSetColor(11);
 if (i>0) PrintAt(210,42,"-");
  else grMoveTo(210,42);
 DispNum(0,0,i);
 grSetColor(1);
 return 0;
}
Exemplo n.º 29
0
IPTR mDraw(Class *cl, Object *obj, struct MUIP_Draw *msg) {
    mybug(0, ("mDraw gets called\n"));

    struct InstData *data = INST_DATA(cl, obj);

    WORD    	      y;
    IPTR    	      retval;

    static ULONG sec=0, mic=0, lastTick=0, currTick=0;
    
    retval = DoSuperMethodA(cl, obj, (Msg)msg);
    
    if (!(msg->flags & (MADF_DRAWOBJECT | MADF_DRAWUPDATE))) return 0;

    if(data->ps3eye_ep1pipe) {        
        for(y= 0; y < _mheight(obj); y++) {
            WORD col;
            col = ((y + data->pos) / 8) % 2;
            SetAPen(_rp(obj), _pens(obj)[col ? MPEN_SHADOW : MPEN_SHINE]);
            RectFill(_rp(obj), _mleft(obj), _mtop(obj) + y, _mright(obj), _mtop(obj) + y);
        }
        data->pos++;
    } else {
        /* Add static distortion or old crt-monitor effect */
        if(data->resolutionvga) {
            DoEffect(kitty640_pure, kitty, 640, 480);
            WritePixelArray(kitty, 0, 0, 640*4, _rp(obj), _mleft(obj), _mtop(obj), _mwidth(obj), _mheight(obj), RECTFMT_RGB032);
//          WritePixelArray(kitty640_pure, 0, 0, 640*4, _rp(obj), _mleft(obj), _mtop(obj), _mwidth(obj), _mheight(obj), RECTFMT_RGB032); //+(rand() % (10))
        } else {

            DoEffect(kitty320_pure, kitty, 320, 240);
            WritePixelArray(kitty, 0, 0, 320*4, _rp(obj), _mleft(obj), _mtop(obj), _mwidth(obj), _mheight(obj), RECTFMT_RGB032);
        }
    }


    //lastTick = currTick;
    //CurrentTime(&sec, &mic);
    //currTick = ((sec * 1000) + (mic / 1000));
    //mybug(-1, ("Delta %d mS\n", currTick-lastTick));

    return retval;
}
Exemplo n.º 30
0
void CopyWNotice()
{
    int x, y;
    x = ( screenBox.w - PMapX( 48 ) - CW_WIDTH ) / 2;
    y = ( screenBox.h - CW_HEIGHT ) / 2;

    SetOPen( &screenRP, 1 );
    SetAPen( &screenRP, 3 );
    RectFill( &screenRP, x, y, x + CW_WIDTH - 1, y + CW_HEIGHT - 1 );

    BNDRYOFF( &screenRP );
    SetAPen( &screenRP, 0 );
    //FIXME: SetDrMd( &screenRP, JAM1 );

    CopyWText( x + 6, y + 30 );

    SetAPen( &screenRP, 1 );
    CopyWText( x + 5, y + 29 );
}