[lazarus] Some (major) changes

Marc Weustink weus at quicknet.nl
Sat Nov 13 08:18:08 EST 1999


HI,
I started to implement some WINAPI functions, becouse mwEdit dumps on some
unimplemented results. 
Since the implementation is platform dependent, this should go to the
interface object. The only way to communicate was through sendmesseges. For
a few functions I think this is OK, but for loads of API, whrapping
parameters in structs an pass them.... nah

This reminded me of a discussion a while ago about an (abstract) baseclass.
This could be a way to implenment all these functions. I started on this
and committed the basic idea. If peaple have other thoughts I can change it
back.

TInterfaceBase has an abstract declaration of 
  AppTerminate, 
  DoEvents, 
  HandleEvents, 
  Init, 
  IntSendMessage3, 
  SetCallback, 
  RemoveCallbacks

and WINAPI parts are defined in winapih.inc as virtual. Interfacebase.inc
implements all winapih.inc methods like:
  procedure TInterfaceBase.MyApiFunc;
  begin
  end;

It has NO code. This way not all functions have to be implemented in the
specific platform InterfaceObject. (Thats the reason why they arent abstract)

The platform specific code (in this case GTK) goes in gtkwinapih.inc and
gtkwinapi.inc

since these are still object.member functions, they are mapped through
normal calls' in LCLLinux (for now, I still have no idea where this should
go) 
by winapih.inc and winapi.inc. The latter one just contains calls like:
  procedure MyApiFunc;
  begin
    TInterfaceBase.MyApiFunc;
  end;

This way I can now create my own say gtk GetDC and can mwEdit happily draw
on it.

Marc






More information about the Lazarus mailing list