/* @(#) 1.7 nt/src/samples/mandel/iodmandl.idl, odmandelpart, od96nt, odnt9712d 11/1/96 21:01:12 [3/21/97 17:35:44] */
//#====START_GENERATED_PROLOG======================================
//#
//#
//#   COMPONENT_NAME: odother
//#
//#   CLASSES: none
//#
//#   ORIGINS: 82,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========================================
//#
#ifdef __PRIVATE__
//#
//#     File:           iodmandl.idl
//#
//#     Contains:       IDL description of Mendelbrot Viewer
//#
#endif


#ifndef _MANDEL_H_
#define _MANDEL_H_
#ifndef _SIMPLPRT_

#include "iodsimpl.idl"
#endif

interface M_Mandelbrot;

typedef somToken HBITMAP;
typedef somToken ZoomType;

interface Mandelbrot : SimplePart
{
        ODBoolean HandleMouseDown(in ODEventData event, in ODFacet facet);
        ODBoolean HandleMouseUp(in ODEventData event, in ODFacet facet);
        void CheckSize(in ODFacet facet, in long* w, in long* h);
	void SetupBitmap(in ODFacet facet, in ODPlatformWindow window,
			 in long w, in long h);
	void NewSet(in ODPlatformWindow window);
	void Redraw(in ODPlatformWindow window);

#ifdef __SOMIDL__
        implementation
        {
                functionprefix = Mandelbrot;
                metaclass     = M_Mandelbrot;
                majorversion = 1;
                minorversion = 0;
                dllname = "iodmandl.dll";

        releaseorder:
               HandleMouseDown,
               HandleMouseUp,
               CheckSize,
               SetupBitmap,
               NewSet,
               Redraw;

        override:
               somInit,
               somUninit,
               InstallMenus,
               AdjustMenus,
               HandleEvent,
               HandleMenuEvent,
               Draw
               ;

        passthru C_xh =
                ""
                "struct ZoomType {"
                "ZoomType *zp;"
                "double lx, ux;"
                "double ly, uy;"
                "};"
                "";
        passthru C_xih = ""
         ;

        // instance variables
         ODSession       fSession;
         ODPart          fPartWrapper;
         ODFacet         fFacet;
         ODShape         fShape; 
         ODULong         fWidth;
         ODULong         fHeight;
         ODULong         fWindowWidth;
         ZoomType*       fZoom;
         ZoomType*       fNewZoom;
         ZoomType*       fCurrentZoom;
         ODBoolean       fZoomInProgress;
         ODBoolean       fResetZoom;
         long            fIterationLimit;
         char*           fImageData;
         long            fx0;
         long            fx1;
         long            fy0;
         long            fy1;
         long            fwinx0;
         long            fwinx1;
         long            fwiny0;
         long            fwiny1;
         long            fZoomWidth;
         long            fZoomHeight;
         ODBoolean       fInitialized;
         HBITMAP         fBitmap;
         HBITMAP         fBitmapRow;
         HDC             fMemBitmapDC;
         HDC             fMemRowDC;
        };
#endif
};

interface M_Mandelbrot : M_SimplePart
{

#ifdef __SOMIDL__
  implementation
  {
    functionprefix = M_Mandelbrot;
    override:
      clsGetODPartHandlerName,
      clsGetODPartHandlerDisplayName,
      clsGetODPartKinds,
      clsGetOLE2ClassId,
      clsGetWindowsIconFileName;
  };
#endif
};
#endif  // _MANDEL_H_
