with GNATCOM.Errors;

package body MSHTML.IViewObjectPresentSite_Interface is

   procedure Initialize (This : in out IViewObjectPresentSite_Type) is
   begin
      Set_IID (This, IID_IViewObjectPresentSite);
   end Initialize;

   function Pointer (This : IViewObjectPresentSite_Type)
     return Pointer_To_IViewObjectPresentSite
   is
   begin
      return To_Pointer_To_IViewObjectPresentSite (Address (This));
   end Pointer;

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

   function CreateSurfacePresenter
     (This            : IViewObjectPresentSite_Type;
      pDevice         : GNATCOM.Types.Pointer_To_IUnknown;
      width           : Interfaces.C.unsigned;
      height          : Interfaces.C.unsigned;
      backBufferCount : Interfaces.C.unsigned;
      format          : DXGI_FORMAT;
      mode            : uVIEW_OBJECT_ALPHA_MODE)
     return Pointer_To_ISurfacePresenter
   is
       RetVal : aliased Pointer_To_ISurfacePresenter;
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.CreateSurfacePresenter
         (Pointer (This),
          pDevice,
          width,
          height,
          backBufferCount,
          format,
          mode,
          RetVal'Unchecked_Access));

      return RetVal;
   end CreateSurfacePresenter;

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

      return RetVal;
   end IsHardwareComposition;

   procedure SetCompositionMode
     (This : IViewObjectPresentSite_Type;
      mode : uVIEW_OBJECT_COMPOSITION_MODE)
   is
   begin
      GNATCOM.Errors.Error_Check
        (Pointer (This).Vtbl.SetCompositionMode
         (Pointer (This),
          mode));

   end SetCompositionMode;

end MSHTML.IViewObjectPresentSite_Interface;

