[fpc-pascal] How does TFPImageCanvas draw TextOut?

2009-02-28 Thread David Emerson
I've started with the fontdraw example at the bottom of 
http://wiki.freepascal.org/Developing_with_Graphics

Somewhere in the middle, there's a call to ImgCanvas.TextOut, which 
seems to work just fine -- the png file has the text, and if I create a 
cracker class I can call TFPImageCanvasCracker.GetColor and find where 
the text has been drawn, without the writer, memory stream, or file 
stream. I don't understand how it works, though.


In the fontdraw program,
  var ImgCanvas: TFPImageCanvas;

In unit fpimgcanv,
  type TFPImageCanvas = class (TFPPixelCanvas)
but it doesn't have a TextOut method.

In unit fppixlcanv,
  type TFPPixelCanvas = class (TFPCustomCanvas)
and it doesn't have a TextOut method, either.

and in unit fpcanvas,
  type TFPCustomCanvas = class(TPersistent)
public procedure TextOut (x,y:integer;text:string);

Okay, so I see that in the fontdraw example program, ImgCanvas inherits 
TextOut from TFPCustomCanvas; and it's not overridden in TFPPixelCanvas 
or TFPImageCanvas.

TFPCustomCanvas.TextOut simply calls DoTextOut, however 
TFPCustomCanvas.DoTextOut is virtual; abstract;

In TFPPixelCanvas, I see protected procedure DoTextOut 
(x,y:integer;text:string); override;

However, the procedure only makes a call to "NotImplemented;"

And TFPImageCanvas does not override DoTextOut, either.

So what on earth is going on here? I don't see any place where a 
procedure is being called that actually draws the text.

I do see that in ftfont, a DrawText procedure exists -- and it seems 
pretty clear that that's the procedure that's actually drawing the 
text. But how is it being called?

Puzzled,
~David.

___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal


[fpc-pascal] Socket (Depecrated) on FreePascal

2009-02-28 Thread Diego Antonio Lucena Pumar
Hi List:

My name is Diego and write from Spain. I need help. My problem resist on the 
primitive deprecated Accept. The interface is the following:

function Accept(

  Sock: LongInt;

  var Addr;

  var Addrlen: LongInt

):LongInt;

For my program I need use this interface, and not the modern versions.

Really, I can't compile the program. The error is provacated by the parameter 
(var Addr;). In the documentation y can read about this type of argument and 
indicated that is trated of Variable parameters. I read more and opine that 
this argument need a reference to a structure INADDR. But a call the function 
this:

Saux := Accept(S1, @Addr, sizeof(Addr));

Where:

S1: is socket descriptor.
Addr; is a variable type TInetSockAddr.

What is my error?. Sorry for my english. Thanks.
___
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal