//====START_GENERATED_PROLOG======================================
//
//
//   COMPONENT_NAME: odimaging
//
//   CLASSES: none
//
//   ORIGINS: 27
//
//
//   (C) COPYRIGHT International Business Machines Corp. 1995,1996
//   All Rights Reserved
//   Licensed Materials - Property of IBM
//   US Government Users Restricted Rights - Use, duplication or
//   disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
//   	
//   IBM DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
//   ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
//   PURPOSE. IN NO EVENT SHALL IBM BE LIABLE FOR ANY SPECIAL, INDIRECT OR
//   CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF
//   USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
//   OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE
//   OR PERFORMANCE OF THIS SOFTWARE.
//
//====END_GENERATED_PROLOG========================================
//
// @(#) 1.5 nt/src/imaging/WinPCanv.cpp, odimaging, od96nt, odnt9712d 7/15/96 17:51:58 [ 3/21/97 17:13:50 ]
/********************************************************************/
/*  Licensed Materials - Property of IBM                            */
/*                                                                  */
/*                                                                  */
/* Copyright (C) International Business Machines Corp., 1994.       */
/* Copyright (C) Apple Computer, Inc., 1994                         */
/*                                                                  */
/*  US Government Users Restricted Rights -                         */
/*  Use, duplication, or disclosure restricted                      */
/*  by GSA ADP Schedule Contract with IBM Corp.                     */
/*                                                                  */
/*  IBM Change History (most recent first):                         */
/*         05/10/96 jab ODWin32Canvas is now a platform-specific    */
/*                      parent class and any derived classes should */
/*                      override the appropriate methods.           */
/*         03/20/96 jab Created.                                    */
/*                                                                  */
/********************************************************************/

#ifndef SOM_Module_winpcanv_Source
#define SOM_Module_winpcanv_Source
#endif
#define ODWin32Canvas_Class_Source
#define VARIABLE_MACROS

#ifndef SOM_ODPlatformCanvas_xih
#include "platcanv.xih"
#endif

#ifndef SOM_ODWin32Canvas_xih
#include "winpcanv.xih"
#endif

#ifndef SOM_ODWin32StandardCanvas_xih
#include "winscanv.xih"
#endif

#ifndef SOM_ODWin32WindowCanvas_xih
#include "winwcanv.xih"
#endif

#ifndef _EXCEPT_
#include <Except.h>
#endif

#ifndef _ERRORDEF_
#include "ErrorDef.xh"
#endif

#ifndef _ODUTILS_
#include <ODUtils.h>
#endif 

#ifndef _ODTYPES_
#include <ODTypes.h>
#endif 




SOM_Scope ODPlatformCanvas*  SOMLINK ODWin32CanvasCreateConcreteCanvas( ODWin32Canvas* somSelf,
                                                               Environment *ev,
                                                               ODGraphicsSystem aSystemType,
                                                               ODBoolean isDynamic,
                                                               ODBoolean isOffScreen )
{
    ODWin32CanvasMethodDebug("ODWin32Canvas","ODWin32CanvasCreateConcreteCanvas");

    ODWin32Canvas *c = kODNULL;  ODVolatile( c );

    SOM_TRY

    if ( (aSystemType == kODWin32) || (aSystemType == kODWin95) || (aSystemType == kODWinNT) )  {

       // if an on-screen, dynamic platform canvas is requested, create a 
       // "Window" platform canvas.  Else, assume the platform canvas to be 
       // created will be the "standard" platform canvas.  The "standard"
       // platform canvas represents all other combinations of isDynamic and isOffScreen.

       if ( (isDynamic == kODTrue) && (isOffScreen == kODFalse) ) 
          c = new ODWin32WindowCanvas;
       else
          c = new ODWin32StandardCanvas;
        
       THROW_IF_NULL( c );
    
       return c;
    }
    else {
       THROW( kODErrInvalidGraphicsSystem );
    }

    SOM_CATCH_ALL{
       if( c )
          ODDeleteObject( c );
       return kODNULL;
    }
    SOM_ENDTRY
}


SOM_Scope ODGraphicsSystem  SOMLINK ODWin32CanvasGetSystemType( ODWin32Canvas *somSelf, 
                                                                Environment *ev ) 
{
    ODWin32CanvasMethodDebug("ODWin32Canvas","ODWin32CanvasGetSystemType");

    return kODWin32;
}



SOM_Scope ODPlatformCanvasType  SOMLINK ODWin32CanvasGetPlatformCanvasType( ODWin32Canvas *somSelf, 
                                                          Environment *ev ) 
{
    ODWin32CanvasMethodDebug("ODWin32Canvas","ODWin32CanvasGetPlatformCanvasType");

    return kODNoPlatformCanvas;
}



SOM_Scope ODBoolean  SOMLINK ODWin32CanvasHasWindow( ODWin32Canvas *somSelf, 
                                                     Environment *ev ) 
{
    ODWin32CanvasMethodDebug("ODWin32Canvas","ODWin32CanvasHasWindow");

    return kODFalse;
}



SOM_Scope ODBoolean  SOMLINK ODWin32CanvasIsInitialized( ODWin32Canvas *somSelf, 
                                                         Environment *ev ) 
{
    ODWin32CanvasMethodDebug("ODWin32Canvas","ODWin32CanvasIsInitialized");

    return kODFalse;
}



SOM_Scope void  SOMLINK ODWin32CanvasInitPlatformCanvas( ODWin32Canvas* somSelf,
                                                         Environment *ev,
                                                         HDC hdc )
{
    ODWin32CanvasMethodDebug("ODWin32Canvas","ODWin32CanvasInitPlatformCanvas");

    ODSetSOMException( ev, kODErrInvalidObjectType );
}



SOM_Scope void  SOMLINK ODWin32CanvasInitPlatformWindowCanvas(ODWin32Canvas* somSelf,
                                                              Environment *ev,
                                                              HWND hwnd)
{
    ODWin32CanvasMethodDebug("ODWin32Canvas","ODWin32CanvasInitPlatformWindowCanvas");

    ODSetSOMException( ev, kODErrInvalidObjectType );
}



SOM_Scope HDC  SOMLINK ODWin32CanvasGetDC( ODWin32Canvas* somSelf,
                                           Environment *ev )
{
    ODWin32CanvasMethodDebug("ODWin32Canvas","ODWin32CanvasGetDC");

    ODSetSOMException( ev, kODErrInvalidObjectType );
    return kODNULL;

}




SOM_Scope void  SOMLINK ODWin32CanvasReleaseDC( ODWin32Canvas* somSelf,
                                                Environment *ev )
{
    ODWin32CanvasMethodDebug("ODWin32Canvas","ODWin32CanvasReleaseDC");

    ODSetSOMException( ev, kODErrInvalidObjectType );
}



SOM_Scope HWND SOMLINK ODWin32CanvasGetWindow( ODWin32Canvas *somSelf, 
                                               Environment *ev ) 
{
    ODWin32CanvasMethodDebug("ODWin32Canvas","ODWin32CanvasGetWindow");

    ODSetSOMException( ev, kODErrInvalidObjectType );
    return kODNULL;
}


SOM_Scope ODBoolean SOMLINK ODWin32CanvasGetMetafileExtent( ODWin32Canvas *somSelf,
                                                            Environment *ev, 
                                                            SIZE *metafileExtent )
{
    ODWin32CanvasMethodDebug("ODWin32Canvas","ODWin32CanvasGetMetafileExtent");

    ODSetSOMException( ev, kODErrInvalidObjectType );
    metafileExtent->cx = metafileExtent->cy = 0;
    return kODFalse;

}



SOM_Scope void  SOMLINK ODWin32CanvasSetMetafileExtent( ODWin32Canvas* somSelf,
                                                        Environment *ev,
                                                        SIZE *metafileExtent)
{
    ODWin32CanvasMethodDebug("ODWin32Canvas","ODWin32CanvasSetMetafileExtent");

    ODSetSOMException( ev, kODErrInvalidObjectType );
}



