Code cleanup.

svn path=/trunk/netsurf/; revision=5167
This commit is contained in:
Chris Young 2008-08-21 21:42:48 +00:00
parent 7362250125
commit f071afe243
5 changed files with 34 additions and 52 deletions

View File

@ -57,12 +57,21 @@ int uname(struct utsname *uts)
if(VersionBase = OpenLibrary("version.library",50))
{
sprintf(uts->release,"%ld.%ld",VersionBase->lib_Version,VersionBase->lib_Version);
if((VersionBase->lib_Version >= 50) && (VersionBase->lib_Version <=52))
{
strcpy(uts->version,"4.0");
}
else if((VersionBase->lib_Version >= 53))
{
strcpy(uts->version,"4.1");
}
CloseLibrary(VersionBase);
}
strcpy(uts->sysname,"AmigaOS");
strcpy(uts->nodename,"amiga");
strcpy(uts->version,"4.0");
strcpy(uts->machine,"ppc");
}

View File

@ -75,6 +75,7 @@ bool nsfont_position_in_string(const struct css_style *style,
{
struct TextExtent extent;
struct TextFont *tfont = ami_open_font(style);
*char_offset = TextFit(currp,string,length,
&extent,NULL,1,x,32767);
@ -228,5 +229,5 @@ void ami_close_font(struct TextFont *tfont)
RPTAG_Font,origrpfont,
TAG_DONE);
CloseFont(tfont);
if(tfont) CloseFont(tfont);
}

View File

@ -43,7 +43,6 @@ struct nsObject *AddObject(struct MinList *objlist,ULONG otype)
AddTail((struct List *)objlist,(struct Node *)dtzo);
dtzo->Type = otype;
// dtzo->SubType = ostype;
return(dtzo);
}
@ -63,45 +62,11 @@ void FreeObjList(struct MinList *objlist)
node = (struct nsObject *)objlist->mlh_Head;
// for(node = objlist->mlh_Head ; node->dtz_Node.mln_Succ ; node = node->dtz_Node.mln_Succ)
while(nnode=(struct nsObject *)(node->dtz_Node.mln_Succ))
{
printf("%lx next %lx node objtype %ld\n",node,nnode,node->Type);
DelObject(node);
node=nnode;
}
FreeVec(objlist);
}
/*
int main(int argc, char **argv)
{
struct MinList *ol;
struct DTZObject *dtzo;
struct DTZObject *tobj;
ol = NewObjList();
tobj = AddObject(ol);
tobj->Data = 6;
dtzo = AddObject(ol);
dtzo->Data = 7;
// tobj = (struct DTZObject *)ol->mlh_Head;
// tobj = ol->dtz_Node.mln_Succ;
// printf("%ld\n",tobj->Data);
FreeObjList(ol);
return(0);
}
*/

View File

@ -23,6 +23,8 @@
#define AMINS_CALLBACK 0
#define AMINS_WINDOW 1
#define AMINS_FRAME 2
#define AMINS_DLWINDOW 3
struct nsObject
{

View File

@ -51,17 +51,22 @@ const struct plotter_table amiplot = {
NULL, //ami_group_end,
ami_flush, // optional
ami_path,
0 // option_knockout
true // option_knockout
};
bool ami_clg(colour c)
{
DebugPrintF("clg %lx\n",c);
SetDrMd(currp,BGBACKFILL);
SetRPAttrs(currp,RPTAG_BPenColor,p96EncodeColor(RGBFB_A8B8G8R8,c),
TAG_DONE);
ClearScreen(currp);
/*
p96RectFill(currp,clipx0,clipy0,clipx1,clipy1,
p96EncodeColor(RGBFB_A8B8G8R8,c));
*/
return true;
}
@ -86,6 +91,10 @@ bool ami_rectangle(int x0, int y0, int width, int height,
Draw(currp,x0,y0+height);
Draw(currp,x0,y0);
currp->PenWidth = 1;
currp->PenHeight = 1;
currp->LinePtrn = PATT_LINE;
return true;
}
@ -106,6 +115,10 @@ bool ami_line(int x0, int y0, int x1, int y1, int width,
Move(currp,x0,y0);
Draw(currp,x1,y1);
currp->PenWidth = 1;
currp->PenHeight = 1;
currp->LinePtrn = PATT_LINE;
return true;
}
@ -115,9 +128,6 @@ bool ami_polygon(int *p, unsigned int n, colour fill)
ULONG cx,cy;
DebugPrintF("poly\n");
currp->PenWidth = 1;
currp->PenHeight = 1;
currp->LinePtrn = PATT_LINE;
SetRPAttrs(currp,RPTAG_APenColor,p96EncodeColor(RGBFB_A8B8G8R8,fill),
TAG_DONE);
@ -144,6 +154,9 @@ bool ami_fill(int x0, int y0, int x1, int y1, colour c)
bool ami_clip(int x0, int y0, int x1, int y1)
{
/* to do - need to actually clip to this region using layers.library */
DebugPrintF("clip\n");
clipx0=x0;
clipy0=y0;
clipx1=x1;
@ -177,10 +190,6 @@ bool ami_disc(int x, int y, int radius, colour c, bool filled)
DebugPrintF("disc\n");
currp->PenWidth = 1;
currp->PenHeight = 1;
currp->LinePtrn = PATT_LINE;
SetRPAttrs(currp,RPTAG_APenColor,p96EncodeColor(RGBFB_A8B8G8R8,c),
TAG_DONE);
@ -205,10 +214,6 @@ bool ami_arc(int x, int y, int radius, int angle1, int angle2,
CommonFuncsPPC.lha */
DebugPrintF("arc\n");
currp->PenWidth = 1;
currp->PenHeight = 1;
currp->LinePtrn = PATT_LINE;
return true;
}
@ -219,9 +224,9 @@ bool ami_bitmap(int x, int y, int width, int height,
DebugPrintF("bitmap plotter %ld %ld %ld %ld (%ld %ld)\n",x,y,width,height,bitmap->width,bitmap->height);
// ami_fill(x,y,x+width,y+height,bg);
/* needs to also scale */
if(x<0 || y<0) DebugPrintF("NEGATIVE X,Y COORDINATES\n");
// ami_fill(x,y,x+width,y+height,bg);
SetRPAttrs(currp,RPTAG_BPenColor,p96EncodeColor(RGBFB_A8B8G8R8,bg),
TAG_DONE);