with GNATCOM.Errors;

package body MSHTML.ISurfacePresenter_Interface is

   procedure Initialize (This : in out ISurfacePresenter_Type) is
   begin
      Set_IID (This, IID_ISurfacePresenter);
   end Initialize;

   function Pointer (This : ISurfacePresenter_Type)
     return Pointer_To_ISurfacePresenter
   is
   begin
      return To_Pointer_To_ISurfacePresenter (Address (This));
   end Pointer;

   procedure Attach (This    : in out ISurfacePresenter_Type;
                     Pointer : in     Pointer_To_ISurfacePresenter)
   is
   begin
      Attach (This, GNATCOM.IInterface.To_Pointer_To_IUnknown
              (Pointer.all'Address));
   end Attach;

   procedure Present
     (This    : ISurfacePresenter_Type;
      uBuffer : Interfaces.C.unsigned;
      pDirty  : Pointer_To_tagRECT)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.Present
         (Pointer (This),
          uBuffer,
          pDirty));

   end Present;

   function GetBuffer
     (This            : ISurfacePresenter_Type;
      backBufferIndex : Interfaces.C.unsigned;
      riid            : GNATCOM.Types.Pointer_To_GUID)
     return GNATCOM.Types.Pointer_To_Void
   is
       RetVal : aliased GNATCOM.Types.Pointer_To_Void;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.GetBuffer
         (Pointer (This),
          backBufferIndex,
          riid,
          RetVal'Unchecked_Access));

      return RetVal;
   end GetBuffer;

   function IsCurrent
     (This       : ISurfacePresenter_Type)
     return Interfaces.C.long
   is
       RetVal : aliased Interfaces.C.long;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.IsCurrent
         (Pointer (This),
          RetVal'Unchecked_Access));

      return RetVal;
   end IsCurrent;

end MSHTML.ISurfacePresenter_Interface;

