/* @(#)Z 1.35 com/src/binding/NoPart.cpp, odconfig, od96nt, odnt9712d 97/03/21 16:43:59 (96/10/29 09:15:17) */
//====START_GENERATED_PROLOG======================================
//
//
//   COMPONENT_NAME: odconfig
//
//   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========================================
//

/*
 *  This file was generated by the SOM Compiler and Emitter Framework.
 *  Generated using:
 *      SOM Emitter emitxtm.dll: Development
 */

#ifndef SOM_Module_nopart_Source
#define SOM_Module_nopart_Source
#endif
#define NoPart_Class_Source
#define VARIABLE_MACROS

#ifndef _ALTPOINT_
#include "AltPoint.h"
#endif

#include "Info.xh"

#include "NoPart.xih"

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

#ifndef SOM_Module_OpenDoc_StdProps_defined
#include <StdProps.xh>
#endif

#ifndef SOM_Module_OpenDoc_StdTypes_defined
#include <StdTypes.xh>
#endif

#ifndef SOM_Module_OpenDoc_Commands_defined
#include <CmdDefs.xh>
#endif

#ifndef SOM_ODFacet_xh
#include <Facet.xh>
#endif

#ifndef SOM_ODMenuBar_xh
#include <MenuBar.xh>
#endif

#ifndef SOM_ODSession_xh
#include <ODSessn.xh>
#endif

#ifndef SOM_ODShape_xh
#include <Shape.xh>
#endif

#ifndef SOM_ODStorageUnit_xh
#include <StorageU.xh>
#endif

#ifndef SOM_ODTransform_xh
#include <Trnsform.xh>
#endif

#ifndef SOM_ODWindowState_xh
#include <WinStat.xh>
#endif

#ifndef SOM_ODWindow_xh
#include <Window.xh>
#endif

#ifndef SOM_ODArbitrat_xh
#include <Arbitrat.xh>
#endif

#ifndef SOM_Module_OpenDoc_Foci_defined
#include <Foci.xh>
#endif

#ifndef SOM_ODFocusSet_xh
#include <FocusSet.xh>
#endif

#ifndef SOM_ODFrame_xh
#include <Frame.xh>
#endif

#ifndef _ODMATH_
#include <ODMath.h>
#endif

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

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

#ifndef SOM_ODCanvas_xh
#include <Canvas.xh>
#endif

#ifdef _PLATFORM_UNIX_
#include <Xm/XmAll.h>

#ifndef SOM_ODAIXWindowCanvas_xh
#include "AIXWCanv.xh"
#endif
#endif

#ifdef _PLATFORM_WIN32_
#ifndef SOM_ODWin32WindowCanvas_xh
#include "WinWCanv.xh"
#endif
#endif

#if defined (_PLATFORM_WIN32_) || defined (_PLATFORM_OS2_) || defined (_PLATFORM_UNIX_)
#ifndef _FOCUSLIB_
#include "FocusLib.h"
#endif
#endif

#ifndef _TEMPOBJ_
#include "TempObj.h"
#endif

#ifndef _WINUTILS_
#include <WinUtils.h>
#endif

#ifdef DEBUG
#include <testmodb.xh>
#include <ODDebug.h>
#endif // DEBUG

#define CMD(X) kODCommand##X
#define kODErrCannotInitializePart 3001

#define kPartHandlerName "NoPart"
#define kPartHandlerDllName "NoPart"
#define kODKindTestNoPart "NoPart"
const ODType   kNoPartKindDisplayName = "NoPart Part Kind";
const ODType   kNoPartCategory         =  "Time";

// Data structure stored with frame to hold frame-specific values - JRB
typedef struct
{
    ODBoolean NeedsActivating;
} FramePartInfo;

//--------------------------------------------------------------------------
// Initialize
//--------------------------------------------------------------------------
SOM_Scope void  SOMLINK NoPartInitialize(NoPart *somSelf,
                                              Environment *ev)
{
    NoPartData *somThis = NoPartGetData(somSelf);
    NoPartMethodDebug("NoPart","NoPartInitialize");

        // Cache references to Session object and other global values
        _fSession = somSelf->GetStorageUnit(ev)->GetSession(ev);
        _fPartSU  = somSelf->GetStorageUnit(ev);

        // Tokenize Foci
        _fSelectionFocus = _fSession->Tokenize(ev, kODSelectionFocus);
        _fMenuFocus      = _fSession->Tokenize(ev, kODMenuFocus);
        _fKeyFocus       = _fSession->Tokenize(ev, kODKeyFocus);
        _fModalFocus     = _fSession->Tokenize(ev, kODModalFocus);

        // Create a Focus Set for this Part Handler
        _fFocusSet = _fSession->GetArbitrator(ev)->CreateFocusSet(ev);
        _fFocusSet->Add(ev, _fKeyFocus);
        _fFocusSet->Add(ev, _fMenuFocus);
        _fFocusSet->Add(ev, _fSelectionFocus);

        // Tokenize ViewTypes and presentation strings
        _fFrameView = _fSession->Tokenize(ev, kODViewAsFrame);
        _fMainPresentation = _fSession->Tokenize(ev, kODPresDefault);

        // Acquire a personal copy of the menubar
        _fMenuBar  = _fSession->GetWindowState(ev)->CopyBaseMenuBar(ev);

}


//--------------------------------------------------------------------------
// CheckAndAddProperties
//--------------------------------------------------------------------------
SOM_Scope void  SOMLINK NoPartCheckAndAddProperties(NoPart *somSelf,
                                                    Environment *ev,
                                                   ODStorageUnit* storageUnit)
{
    NoPartData *somThis = NoPartGetData(somSelf);
    NoPartMethodDebug("NoPart","NoPartCheckAndAddProperties");

}



//--------------------------------------------------------------------------
// HandleMouseUp
//--------------------------------------------------------------------------
SOM_Scope ODBoolean  SOMLINK NoPartHandleMouseUp(NoPart *somSelf,
                                                  Environment *ev,
                                                 ODEventData* event,
                                                 ODFrame* frame,
                                                 ODFacet* facet)
{
    NoPartData *somThis = NoPartGetData(somSelf);
    NoPartMethodDebug("NoPart","NoPartHandleMouseUp");

    // Activate the frame
    somSelf->ActivateFrame(ev, frame);

    return kODFalse;
}


//--------------------------------------------------------------------------
// HandleMenuEvent
//--------------------------------------------------------------------------
SOM_Scope ODBoolean  SOMLINK NoPartHandleMenuEvent(NoPart *somSelf,
                                                   Environment *ev,
                                                  ODFrame* frame,
                                                  ODEventData* event)
{
    NoPartData *somThis = NoPartGetData(somSelf);
    NoPartMethodDebug("NoPart","NoPartHandleMenuEvent");

    ODBoolean   eventHandled     = kODFalse;

#ifndef _PLATFORM_UNIX_
#ifdef _PLATFORM_OS2_
   if (event->msg)
   {
       switch (SHORT1FROMMP(event->mp1))
#endif // _PLATFORM_OS2_

#ifdef _PLATFORM_WIN32_
   if (event->message)
   {
       switch (LOWORD(event->wParam))
#endif // _PLATFORM_WIN32_
       {
        case kODCommandPartInfo:
           {
           eventHandled     = kODTrue;
           ODBoolean hasWriteAccess = kODTrue;
           TempODWindow window = _fSession->GetWindowState(ev)->AcquireFrontRootWindow(ev);
           ODInfo* info = _fSession->GetInfo(ev);

           info->ShowPartFrameInfo(ev, window->GetRootFacet(ev), hasWriteAccess);

           // Have to release window because it is a decendant of RefCntObject and
           // the ref count needs to be decremented.
           ODReleaseObject(ev, window);
           break;
           }

        default:
           break;
       } // end switch
   }     // end if
#endif

    return eventHandled;
}

//--------------------------------------------------------------------------
// ActivatingWindow - JRB
//--------------------------------------------------------------------------
SOM_Scope void  SOMLINK NoPartActivatingWindow (NoPart *somSelf,
                                                Environment *ev,
                                                ODFrame* frame)
{
    NoPartData *somThis = NoPartGetData(somSelf);
    NoPartMethodDebug("NoPart","NoPartActivatingWindow");

    SOM_TRY

        // Get frame's part info
        FramePartInfo *pInfo = (FramePartInfo *) frame->GetPartInfo(ev);

        // If the frame needs activating
        if (pInfo->NeedsActivating)
        {
            // Activate the frame
            somSelf->ActivateFrame(ev, frame);

            // Signify the frame no longer needs activating
            pInfo->NeedsActivating = kODFalse;
        }

    SOM_CATCH_ALL
    SOM_ENDTRY
}


//--------------------------------------------------------------------------
// DeactivatingWindow - JRB
//--------------------------------------------------------------------------
SOM_Scope void  SOMLINK NoPartDeactivatingWindow (NoPart *somSelf,
                                                  Environment *ev,
                                                  ODFrame* frame)
{
    NoPartData *somThis = NoPartGetData(somSelf);
    NoPartMethodDebug("NoPart","NoPartDeactivatingWindow");


    SOM_TRY
        // Get frame's part info
        FramePartInfo *pInfo = (FramePartInfo *) frame->GetPartInfo(ev);

        // Get the frame which has the selection focus
        TempODFrame tempFrame = _fSession->GetArbitrator(ev)->
                                AcquireFocusOwner(ev, _fSelectionFocus);

        // If the frame with the selection focus is this frame
        if (frame == tempFrame)
        {
            // We will need to be activated when the window gets
            // activated again
            pInfo->NeedsActivating = kODTrue;
        }
        else
        {
            if (pInfo)
            {
                // We won't need to be activated when the window gets
                // activated again
                pInfo->NeedsActivating = kODFalse;
            }
        }

    SOM_CATCH_ALL
    SOM_ENDTRY
}


//--------------------------------------------------------------------------
// ActivateFrame
//--------------------------------------------------------------------------
SOM_Scope ODBoolean  SOMLINK NoPartActivateFrame (NoPart *somSelf,
                                                 Environment *ev,
                                                 ODFrame* frame)
{
    NoPartData *somThis = NoPartGetData(somSelf);
    NoPartMethodDebug("NoPart","NoPartActivateFrame");

    // Request the set of foci necessary to become active.
    if ( somSelf->GetStorageUnit(ev)
                            ->GetSession(ev)
                            ->GetArbitrator(ev)
                            ->RequestFocusSet(ev, _fFocusSet, frame) )
    {
            // Notify ourself that we acquired the selection, menu,
            // and keyboard foci.
            somSelf->FocusAcquired(ev, _fSelectionFocus, frame);
            somSelf->FocusAcquired(ev, _fMenuFocus, frame);
            somSelf->FocusAcquired(ev, _fKeyFocus, frame);

            // We sucessfully acquired the foci we need to be active.
            return kODTrue;
    }
    else
            // We were unable to acquire the foci we need to be active.
            return kODFalse;
}



SOM_Scope void  SOMLINK NoPartDeActivateFrame(NoPart *somSelf,
                                               Environment *ev,
                                              ODFrame* frame)
{
    NoPartData *somThis = NoPartGetData(somSelf);
    NoPartMethodDebug("NoPart","NoPartDeActivateFrame");
}



//--------------------------------------------------------------------------
// somInit
//--------------------------------------------------------------------------
SOM_Scope void  SOMLINK NoPartsomInit(NoPart *somSelf)
{
    NoPartData *somThis = NoPartGetData(somSelf);
    NoPartMethodDebug("NoPart","NoPartsomInit");

    NoPart_parent_ODPart_somInit(somSelf);

        _fSession       = kODNULL;
        _fFocusSet      = kODNULL;
        _fSelectionFocus = kODNULL;
        _fMenuFocus      = kODNULL;
        _fKeyFocus      = kODNULL;
        _fModalFocus    = kODNULL;
        _fFrameView     = kODNULL;
        _fLargeIconView = kODNULL;
        _fSmallIconView = kODNULL;
        _fThumbnailView = kODNULL;
        _fMainPresentation = kODNULL;
        _fPartSU        = kODNULL;
        _fWindowID      = kODNULL;
        _fPartWrapper   = kODNULL;

}


//--------------------------------------------------------------------------
// somUninit
//--------------------------------------------------------------------------
SOM_Scope void  SOMLINK NoPartsomUninit(NoPart *somSelf)
{
    NoPartData *somThis = NoPartGetData(somSelf);
    NoPartMethodDebug("NoPart","NoPartsomUninit");

        Environment* ev = somGetGlobalEnvironment();
        ODVolatile(ev);

                ODDeleteObject(_fFocusSet);
                ODReleaseObject(ev, _fMenuBar);

       NoPart_parent_ODPart_somUninit(somSelf);

}



SOM_Scope void  SOMLINK NoPartFulfillPromise(NoPart *somSelf,
                                              Environment *ev,
                                             ODStorageUnitView* promiseSUView)
{
    NoPartData *somThis = NoPartGetData(somSelf);
    NoPartMethodDebug("NoPart","NoPartFulfillPromise");

}

SOM_Scope void  SOMLINK NoPartDropCompleted(NoPart *somSelf,
                                             Environment *ev,
                                            ODPart* destPart,
                                            ODDropResult dropResult)
{
    NoPartData *somThis = NoPartGetData(somSelf);
    NoPartMethodDebug("NoPart","NoPartDropCompleted");

}

SOM_Scope ODDragResult  SOMLINK NoPartDragEnter(NoPart *somSelf,
                                                 Environment *ev,
                                                ODDragItemIterator* dragInfo,
                                                ODFacet* facet,
                                                ODPoint* where)
{
    NoPartData *somThis = NoPartGetData(somSelf);
    NoPartMethodDebug("NoPart","NoPartDragEnter");

    return kODNULL;
}

SOM_Scope ODDragResult  SOMLINK NoPartDragWithin(NoPart *somSelf,
                                                  Environment *ev,
                                                 ODDragItemIterator* dragInfo,
                                                 ODFacet* facet,
                                                 ODPoint* where)
{
    NoPartData *somThis = NoPartGetData(somSelf);
    NoPartMethodDebug("NoPart","NoPartDragWithin");

    return kODNULL;
}

SOM_Scope void  SOMLINK NoPartDragLeave(NoPart *somSelf,  Environment *ev,
                                        ODFacet* facet, ODPoint* where)
{
    NoPartData *somThis = NoPartGetData(somSelf);
    NoPartMethodDebug("NoPart","NoPartDragLeave");

}

SOM_Scope ODDropResult  SOMLINK NoPartDrop(NoPart *somSelf,  Environment *ev,
                                           ODDragItemIterator* dropInfo,
                                           ODFacet* facet, ODPoint* where)
{
    NoPartData *somThis = NoPartGetData(somSelf);
    NoPartMethodDebug("NoPart","NoPartDrop");

    return kODNULL;
}

SOM_Scope ODBoolean  SOMLINK NoPartRevealFrame(NoPart *somSelf,
                                                Environment *ev,
                                               ODFrame* embeddedFrame,
                                               ODShape* revealShape)
{
    NoPartData *somThis = NoPartGetData(somSelf);
    NoPartMethodDebug("NoPart","NoPartRevealFrame");

    return kODNULL;
}

SOM_Scope void  SOMLINK NoPartEmbeddedFrameSpec(NoPart *somSelf,
                                                 Environment *ev,
                                                ODFrame* embeddedFrame,
                                                ODObjectSpec* spec)
{
    NoPartData *somThis = NoPartGetData(somSelf);
    NoPartMethodDebug("NoPart","NoPartEmbeddedFrameSpec");

}

SOM_Scope ODEmbeddedFramesIterator*  SOMLINK NoPartCreateEmbeddedFramesIterator(NoPart *somSelf,
                                                                                 Environment *ev,
                                                                                ODFrame* frame)
{
    NoPartData *somThis = NoPartGetData(somSelf);
    NoPartMethodDebug("NoPart","NoPartCreateEmbeddedFramesIterator");
    return kODNULL;

}


//--------------------------------------------------------------------------
// DisplayFrameAdded
//--------------------------------------------------------------------------
SOM_Scope void  SOMLINK NoPartDisplayFrameAdded(NoPart *somSelf,
                                                Environment *ev,
                                               ODFrame* frame)
{
    NoPartData *somThis = NoPartGetData(somSelf);
    NoPartMethodDebug("NoPart","NoPartDisplayFrameAdded");

    SOM_TRY

        // NOTE:  The DisplayFrameConnected method calls this method

        // If we are being embedded into another part, the presentation field
        // will be NULL, so we need to set it something meaningful.
        // The view field may also be null, if so, we prefer to be displayed
        // in a frame view.

        if ( frame->GetPresentation(ev) == kODNullTypeToken )
                frame->SetPresentation(ev, _fMainPresentation);

        if ( frame->GetViewType(ev) == kODNullTypeToken )
                frame->SetViewType(ev, _fFrameView);

        // Set up frame's part info - JRB
        FramePartInfo *pInfo = new FramePartInfo;

        if (frame->IsRoot(ev))
        {
                pInfo->NeedsActivating = kODTrue;
        }
        else
        {
                pInfo->NeedsActivating = kODFalse;
        }

        frame->SetPartInfo(ev, (ODInfoType) pInfo);

    SOM_CATCH_ALL
    SOM_ENDTRY
}


SOM_Scope void  SOMLINK NoPartDisplayFrameRemoved(NoPart *somSelf,
                                                   Environment *ev,
                                                  ODFrame* frame)
{
    NoPartData *somThis = NoPartGetData(somSelf);
    NoPartMethodDebug("NoPart","NoPartDisplayFrameRemoved");

    SOM_TRY

        // Logic in NoPart is the same as in method DisplayFrameClosed - JRB
        somSelf->DisplayFrameClosed(ev, frame);

    SOM_CATCH_ALL
    SOM_ENDTRY
}

SOM_Scope void  SOMLINK NoPartDisplayFrameConnected(NoPart *somSelf,
                                                     Environment *ev,
                                                    ODFrame* frame)
{
    NoPartData *somThis = NoPartGetData(somSelf);
    NoPartMethodDebug("NoPart","NoPartDisplayFrameConnected");

    SOM_TRY

        // Logic in NoPart is the same as the DisplayFrameAdded method - JRB
        somSelf->DisplayFrameAdded (ev, frame);

    SOM_CATCH_ALL
    SOM_ENDTRY
}

SOM_Scope void  SOMLINK NoPartDisplayFrameClosed(NoPart *somSelf,
                                                  Environment *ev,
                                                 ODFrame* frame)
{
    NoPartData *somThis = NoPartGetData(somSelf);
    NoPartMethodDebug("NoPart","NoPartDisplayFrameClosed");

    SOM_TRY

        // NOTE:  The DisplayFrameRemoved method calls this method

        // Relinquish the entire focus set - JRB
        _fSession->GetArbitrator(ev)->RelinquishFocusSet(ev, _fFocusSet, frame);

        // Delete the frame's part info - JRB
        FramePartInfo *pInfo = (FramePartInfo *) frame->GetPartInfo(ev);
        delete pInfo;
        frame->SetPartInfo(ev, kODNULL);

    SOM_CATCH_ALL
    SOM_ENDTRY
}

SOM_Scope void  SOMLINK NoPartAttachSourceFrame(NoPart *somSelf,
                                                 Environment *ev,
                                                ODFrame* frame,
                                                ODFrame* sourceFrame)
{
    NoPartData *somThis = NoPartGetData(somSelf);
    NoPartMethodDebug("NoPart","NoPartAttachSourceFrame");

}

SOM_Scope void  SOMLINK NoPartFrameShapeChanged(NoPart *somSelf,
                                                 Environment *ev,
                                                ODFrame* frame)
{
    NoPartData *somThis = NoPartGetData(somSelf);
    NoPartMethodDebug("NoPart","NoPartFrameShapeChanged");

}


//--------------------------------------------------------------------------
// ViewTypeChanged
//--------------------------------------------------------------------------
SOM_Scope void  SOMLINK NoPartViewTypeChanged(NoPart *somSelf,
                                              Environment *ev,
                                             ODFrame* frame)
{
    NoPartData *somThis = NoPartGetData(somSelf);
    NoPartMethodDebug("NoPart","NoPartViewTypeChanged");

        ODTypeToken     view = frame->GetViewType(ev);

        if ( view == _fFrameView )
        {
                frame->ChangeUsedShape(ev, kODNULL, kODNULL);
        }

}



SOM_Scope void  SOMLINK NoPartPresentationChanged(NoPart *somSelf,
                                                   Environment *ev,
                                                  ODFrame* frame)
{
    NoPartData *somThis = NoPartGetData(somSelf);
    NoPartMethodDebug("NoPart","NoPartPresentationChanged");

}

SOM_Scope void  SOMLINK NoPartSequenceChanged(NoPart *somSelf,
                                               Environment *ev,
                                              ODFrame* frame)
{
    NoPartData *somThis = NoPartGetData(somSelf);
    NoPartMethodDebug("NoPart","NoPartSequenceChanged");

}

SOM_Scope void  SOMLINK NoPartWritePartInfo(NoPart *somSelf,
                                             Environment *ev,
                                            ODInfoType partInfo,
                                            ODStorageUnitView* storageUnitView)
{
    NoPartData *somThis = NoPartGetData(somSelf);
    NoPartMethodDebug("NoPart","NoPartWritePartInfo");

}

SOM_Scope ODInfoType  SOMLINK NoPartReadPartInfo(NoPart *somSelf,
                                                  Environment *ev,
                                                 ODFrame* frame,
                                                 ODStorageUnitView* storageUnitView)
{
    NoPartData *somThis = NoPartGetData(somSelf);
    NoPartMethodDebug("NoPart","NoPartReadPartInfo");

    return kODNULL;
}

//--------------------------------------------------------------------------
// Open
//--------------------------------------------------------------------------
SOM_Scope ODID  SOMLINK NoPartOpen(NoPart *somSelf,  Environment *ev,
                                   ODFrame* frame)
{
    NoPartData *somThis = NoPartGetData(somSelf);
    NoPartMethodDebug("NoPart","NoPartOpen");

    ODID windowID = 0;

    TempODWindow window = kODNULL;

    SOM_TRY

    ODWindowState* winState = _fSession->GetWindowState(ev);

    if (frame)
    {
        if (frame->IsRoot(ev))
        {
            WindowProperties props;
            BeginGetWindowProperties(ev, frame, &props);

#if defined(_PLATFORM_WIN32_) || defined(_PLATFORM_OS2_)
            ODULong flCreateFlags = props.createFlags;
#endif

            ODPlatformWindow platwin = winState->CreatePlatformWindow(ev, kODFalse);

#if defined(_PLATFORM_WIN32_)
            SetWindowPos(platwin,
                         HWND_TOP,
                         props.boundsRect.left,
                         props.boundsRect.top,
                         props.boundsRect.right,
                         props.boundsRect.bottom,
                         SWP_NOACTIVATE | SWP_NOREDRAW);
#elif defined(_PLATFORM_OS2_)
            WinSetWindowPos(platwin,
                            HWND_TOP,
                            props.boundsRect.xLeft,
                            props.boundsRect.yBottom,
                            props.boundsRect.xRight,
                            props.boundsRect.yTop,
                            SWP_SIZE | SWP_MOVE | SWP_NOREDRAW);
#elif defined(_PLATFORM_UNIX_)
            Widget TopLevelShellWidget = XtWindowToWidget(winState->GetDisplay(ev),
                                                          platwin);
            XtVaSetValues(TopLevelShellWidget,
                          XmNx, props.boundsRect.x,
                          XmNy, props.boundsRect.y,
                          XmNwidth, props.boundsRect.width,
                          XmNheight, props.boundsRect.height,
                          NULL);
#endif

            window = winState->RegisterWindowForFrame(ev,
                                                      platwin,
                                                      frame,
                                                      props.isRootWindow,
                                                      props.isResizable,
                                                      props.isFloating,
                                                      kODTrue,
                                                      kODTrue,
                                                      props.sourceFrame);

            EndGetWindowProperties(ev, &props);     // release source frame

            window->Open(ev);
            window->Show(ev);
        }
        else
        {
            window = winState->AcquireWindow(ev, _fWindowID);
            if (window)
            {
                window->Select(ev);
            }
            else
            {
                window = somSelf->MakeWindow(ev, frame);
                _fWindowID = window->GetID(ev);
                window->Open(ev);
                window->Show(ev);
                window->Select(ev);
            }

        }
        // end of frame->IsRoot
    }
    else
    {
        window = somSelf->MakeWindow(ev, frame);
        _fWindowID = window->GetID(ev);
        window->Open(ev);
        window->Show(ev);
        window->Select(ev);
    }
    // end of frame

    windowID = window->GetID(ev);

    SOM_CATCH_ALL
    SOM_ENDTRY

    return windowID;
}

//--------------------------------------------------------------------------
// MakeWindow
//--------------------------------------------------------------------------
SOM_Scope ODWindow* SOMLINK NoPartMakeWindow(NoPart *somSelf,
                                             Environment *ev,
                                             ODFrame *sourceFrame)
{
    NoPartData *somThis = NoPartGetData(somSelf);
    NoPartMethodDebug("NoPart","NoPartMakeWindow");

    ODPlatformWindow platwin = kODNULL;

    ODWindow* window         = kODNULL;


    SOM_TRY

    ODWindowState* winState = _fSession->GetWindowState(ev);

    platwin = winState->CreatePlatformWindow(ev, kODFalse);

    window = winState->RegisterWindow(ev,
                                      platwin,
                                      kODFrameObject,       // frameType
                                      sourceFrame==kODNULL, // isRootWindow
                                      kODTrue,              // isResizable
                                      kODFalse,             // isFloating
                                      kODTrue,              // shouldSave
                                      kODTrue,              // shouldDispose
                                      _fPartWrapper,        // rootPart
                                      _fFrameView,          // viewType
                                      _fMainPresentation,   // presentation
                                      sourceFrame           // sourceFrame
                                     );

    SOM_CATCH_ALL
    SOM_ENDTRY

    return window;
}

SOM_Scope ODFrame*  SOMLINK NoPartRequestEmbeddedFrame(NoPart *somSelf,
                                                        Environment *ev,
                                                       ODFrame* containingFrame,
                                                       ODFrame* baseFrame,
                                                       ODShape* frameShape,
                                                       ODPart* embedPart,
                                                       ODTypeToken viewType,
                                                       ODTypeToken presentation,
                                                       ODBoolean isOverlaid)
{
    NoPartData *somThis = NoPartGetData(somSelf);
    NoPartMethodDebug("NoPart","NoPartRequestEmbeddedFrame");

    return kODNULL;
}

SOM_Scope void  SOMLINK NoPartRemoveEmbeddedFrame(NoPart *somSelf,
                                                   Environment *ev,
                                                  ODFrame* embeddedFrame)
{
    NoPartData *somThis = NoPartGetData(somSelf);
    NoPartMethodDebug("NoPart","NoPartRemoveEmbeddedFrame");

}

SOM_Scope ODShape*  SOMLINK NoPartRequestFrameShape(NoPart *somSelf,
                                                     Environment *ev,
                                                    ODFrame* embeddedFrame,
                                                    ODShape* frameShape)
{
    NoPartData *somThis = NoPartGetData(somSelf);
    NoPartMethodDebug("NoPart","NoPartRequestFrameShape");

    return kODNULL;
}

SOM_Scope void  SOMLINK NoPartUsedShapeChanged(NoPart *somSelf,
                                                Environment *ev,
                                               ODFrame* embeddedFrame)
{
    NoPartData *somThis = NoPartGetData(somSelf);
    NoPartMethodDebug("NoPart","NoPartUsedShapeChanged");

}

SOM_Scope ODShape*  SOMLINK NoPartAdjustBorderShape(NoPart *somSelf,
                                                     Environment *ev,
                                                    ODFacet* embeddedFacet,
                                                    ODShape* shape)
{
    NoPartData *somThis = NoPartGetData(somSelf);
    NoPartMethodDebug("NoPart","NoPartAdjustBorderShape");

    return kODNULL;
}


//--------------------------------------------------------------------------
// FacetAdded
//--------------------------------------------------------------------------
SOM_Scope void  SOMLINK NoPartFacetAdded(NoPart *somSelf,  Environment *ev,
                                        ODFacet* facet)
{
    NoPartData *somThis = NoPartGetData(somSelf);
    NoPartMethodDebug("NoPart","NoPartFacetAdded");

        ODFrame* frame = facet->GetFrame(ev);

        // We call this to prepare our part for being displayed in one of
        // the four standard views: Large Icon, Small Icon, Frame, and
        // Thumbnail.
        somSelf->ViewTypeChanged(ev, frame);

        // If this is the root frame/facet of a given window, we should activate
        // ourselves. This prevents OpenDoc from getting into an ambiguous
        // state.
#if 0 // LC
        if ( frame->IsRoot(ev) )
                somSelf->ActivateFrame(ev, frame);
#endif

// This code is added for the purpose of testing.
#ifdef DEBUG
        ODTestModuleB* testMod = kODNULL;
        // load the DLL containing the class "ODTestModule"
        somId testModId =  somIdFromString("ODTestModule");
        SOMClass* testModClass = SOMClassMgrObject->
                                        somFindClass(testModId, 0, 0);
        // if such a DLL is found and loaded
        if(testModClass) {
                // create an ODTestModule object
                testMod = (ODTestModuleB*)testModClass->somNew();
                // if that succeeds, call its Init and Run methods
                if(testMod) {
                        testMod->Init(ev, _fPartSU, facet);
                        testMod->Run(ev, _fPartSU, facet);
                }
/* defect 23541 - quiet down ODTestModule operations
                else
                        WARNMSG_DEBUG(WARN_INDEX(0),
                        "Error! ODTestModule instantiation failed!");
*/
        }
/* defect 23541 - quiet down ODTestModule operations
        else
                WARNMSG_DEBUG(WARN_INDEX(0),
                "Error! ODTestModule class failed to load!");
*/

        // cleanup
        if (testModId) SOMFree (testModId);
        if (testMod) SOMFree (testMod);
        if (testModClass) SOMFree (testModClass);
#endif // DEBUG

}



SOM_Scope void  SOMLINK NoPartFacetRemoved(NoPart *somSelf,  Environment *ev,
                                           ODFacet* facet)
{
    NoPartData *somThis = NoPartGetData(somSelf);
    NoPartMethodDebug("NoPart","NoPartFacetRemoved");

}

SOM_Scope void  SOMLINK NoPartCanvasChanged(NoPart *somSelf,
                                             Environment *ev,
                                            ODFacet* facet)
{
    NoPartData *somThis = NoPartGetData(somSelf);
    NoPartMethodDebug("NoPart","NoPartCanvasChanged");

}

SOM_Scope void  SOMLINK NoPartGeometryChanged(NoPart *somSelf,
                                               Environment *ev,
                                              ODFacet* facet,
                                              ODBoolean clipShapeChanged,
                                              ODBoolean externalTransformChanged)
{
    NoPartData *somThis = NoPartGetData(somSelf);
    NoPartMethodDebug("NoPart","NoPartGeometryChanged");

}

//--------------------------------------------------------------------------
// Draw
//--------------------------------------------------------------------------
SOM_Scope void  SOMLINK NoPartDraw(NoPart *somSelf,  Environment *ev,
                                   ODFacet* facet, ODShape* invalidShape)
{
    NoPartData *somThis = NoPartGetData(somSelf);
    NoPartMethodDebug("NoPart","NoPartDraw");

    // Drawing added by JRB
    SOM_TRY

    ODFrame* displayFrame = facet->GetFrame(ev);

    // Get the frame bounding rectangle and convert to Window's rectangle
    ODRect rect;
    TempODShape shape = displayFrame->AcquireFrameShape(ev, facet->GetCanvas(ev));
    shape->GetBoundingBox(ev, &rect);
    Rect frameRect;

#ifdef _PLATFORM_WIN32_  // defect 22580 - bracket Win32 specific drawing code
    rect.AsWinRect(frameRect);

    HDC hdc;

    // Use the focuslib code to set up transforms and clipping
    CFocus Focus(facet, invalidShape, &hdc);

    unsigned long brushes[] = {0x00400080,
                               0x00000000,
                               0x00000000,
                               0x00808000};

    // For loop to create filled rectangles
    for (int index = 0; index < 4; index++)
    {
        // Create a solid brush
        HBRUSH hbr = CreateSolidBrush (brushes[index]);

        // Switch on the loop pass
        switch (index)
        {
          case 0:
            // Don't modify anything
            break;
          case 1:
            // Set the frame rectangle for the shadow
            frameRect.left += 20;
            frameRect.right -= 5;
            frameRect.bottom -= 5;
            frameRect.top += 20;
            break;
          case 2:
            // Set the frame rectangle for the inner rectangle's border
            frameRect.left -= 10;
            frameRect.right -= 10;
            frameRect.bottom -= 10;
            frameRect.top -= 10;
            break;
          case 3:
            // Set the frame rectangle for the inner rectangle
            frameRect.left++;
            frameRect.right--;
            frameRect.bottom--;
            frameRect.top++;
            break;
        }

        // Fill the rectangle with the brush
        FillRect (hdc, &frameRect, hbr);

        // Get rid of the brush
        DeleteObject (hbr);
    }

    // Set up a font for the text - ensure it doesn't get too small
    LOGFONT labelFont;
    memset(&labelFont, 0, sizeof(labelFont));
    labelFont.lfPitchAndFamily = FF_SCRIPT;
    labelFont.lfItalic = 1;
    labelFont.lfHeight = (frameRect.bottom - frameRect.top) / 12;
    if (labelFont.lfHeight < 16)
    {
        labelFont.lfHeight = 16;
    }
    labelFont.lfQuality = PROOF_QUALITY;
    lstrcpy((LPSTR)labelFont.lfFaceName, (LPSTR)"Cursive");

    // Create the font and select it
    HFONT hFont = CreateFontIndirect(&labelFont);
    HFONT hOldFont;
    hOldFont = SelectObject(hdc, hFont);

    // Write some text on the screen using a transparent background and
    // white text
    SetBkMode(hdc, TRANSPARENT);
    SetTextColor(hdc, 0x00FFFFFF);
    char *text = "No part editor available!";
    DrawText(hdc,
             text,
             strlen(text),
             &frameRect,
             DT_CENTER | DT_VCENTER | DT_SINGLELINE);

    // Remove the temporary font
    SelectObject(hdc, hOldFont);
    DeleteObject(hFont);
#endif // defect 22580

#ifdef _PLATFORM_OS2_
    rect.AsRECTL(frameRect);

    HPS hps;

    // Use the focuslib code to set up transforms and clipping
    CFocus Focus(facet, invalidShape, &hps);

    long brushes[] = {0x800040,
                      0x000000,
                      0x000000,
                      0x008080};

    // For loop to create filled rectangles
    for (int index = 0; index < 4; index++)
    {
        // Set color
        GpiSetColor(hps, brushes[index]);

        // Switch on the loop pass
        switch (index)
        {
          case 0:
            // Don't modify anything
            break;
          case 1:
            // Set the frame rectangle for the shadow
            frameRect.xLeft += 20;
            frameRect.xRight -= 5;
            frameRect.yBottom += 5;
            frameRect.yTop -= 20;
            break;
          case 2:
            // Set the frame rectangle for the inner rectangle's border
            frameRect.xLeft -= 10;
            frameRect.xRight -= 10;
            frameRect.yBottom += 10;
            frameRect.yTop += 10;
            break;
          case 3:
            // Set the frame rectangle for the inner rectangle
            frameRect.xLeft++;
            frameRect.xRight--;
            frameRect.yBottom++;
            frameRect.yTop--;
            break;
        }

        // Fill the rectangle with the current color
        POINTL startpt = {frameRect.xLeft, frameRect.yBottom};
        POINTL endpt = {frameRect.xRight, frameRect.yTop};
        GpiSetCurrentPosition(hps, &startpt);
        GpiCreateLogColorTable (hps,
                                LCOL_RESET,
                                LCOLF_RGB,
                                0L,
                                1L,
                                &brushes[index]);
        GpiSetColor(hps, brushes[index]);
        GpiBox(hps, DRO_FILL, &endpt, 0, 0);
    }
#endif

#ifdef _PLATFORM_UNIX_
    GC gc;

    // Use the focuslib code to set up clipping - On AIX, transforms
    // are not setup
    CFocus Focus(facet, invalidShape, &gc);

    // Get the AIX Window canvas
    ODAIXWindowCanvas *aixwincanvas = (ODAIXWindowCanvas *)
                                      (facet->GetCanvas(ev)->GetPlatformCanvas(ev, kODAIX));

    // Get the canvas widget
    Widget widget = aixwincanvas->GetWidget(ev);

    // Get the canvas window
    Window window = aixwincanvas->GetWindow(ev);

    // Get the canvas display
    Display *display = aixwincanvas->GetDisplay(ev);

    // Get the widget's dimensions
    Position x, y;
    Dimension width, height;
    XtVaGetValues(widget,
                  XmNwidth, &width,
                  XmNheight, &height,
                  NULL);

    x = 0;
    y = 0;

    // Ensure the fill style is solid
    XSetFillStyle(display, gc, FillSolid);

    // Get the screen
    Screen *screen = _fSession->GetWindowState(ev)->GetScreen(ev);

    // Get the default colormap for the screen
    Colormap map = XDefaultColormapOfScreen(screen);

    XColor def, def2;

    // For loop to create filled rectangles
    for (int index = 0;
         index < 4;
         index++)
    {
        Status stat;

        // Switch on the loop pass
        switch (index)
        {
          case 0:
            width--;
            height--;

            // Background is maroon
            stat = XAllocNamedColor(display, map, "maroon", &def, &def2);
            break;

          case 1:
            // Set the frame rectangle for the shadow
            x += 20;
            width -= 25;
            height -= 25;
            y += 20;

            // Just use the standard black pixel
            def.pixel = BlackPixelOfScreen(screen);

            break;

          case 2:
            // Set the frame rectangle for the inner rectangle's border
            x -= 10;
            y -= 10;
            break;

          case 3:
            // Set the frame rectangle for the inner rectangle
            x++;
            width -= 2;
            height -= 2;
            y++;

            // Color is dark turquoise
            stat = XAllocNamedColor(display, map, "dark turquoise" , &def, &def2);

            break;
        }

        // Set foreground color
        XSetForeground(display, gc, def.pixel);

        // Fill the rectangle
        XFillRectangle(display,
                       window,
                       gc,
                       x, y,
                       width, height);
    }
#endif

    SOM_CATCH_ALL
    SOM_ENDTRY
}

 SOM_Scope void  SOMLINK NoPartCanvasUpdated(NoPart *somSelf,
                                              Environment *ev,
                                             ODCanvas* canvas)
{
    NoPartData *somThis = NoPartGetData(somSelf);
    NoPartMethodDebug("NoPart","NoPartCanvasUpdated");

}

SOM_Scope void  SOMLINK NoPartHighlightChanged(NoPart *somSelf,
                                                Environment *ev,
                                               ODFacet* facet)
{
    NoPartData *somThis = NoPartGetData(somSelf);
    NoPartMethodDebug("NoPart","NoPartHighlightChanged");

}

SOM_Scope ODULong  SOMLINK NoPartGetPrintResolution(NoPart *somSelf,
                                                     Environment *ev,
                                                    ODFrame* frame)
{
    NoPartData *somThis = NoPartGetData(somSelf);
    NoPartMethodDebug("NoPart","NoPartGetPrintResolution");

    return kODNULL;
}

SOM_Scope ODLinkSource*  SOMLINK NoPartCreateLink(NoPart *somSelf,
                                                   Environment *ev,
                                                  ODByteArray* data)
{
    NoPartData *somThis = NoPartGetData(somSelf);
    NoPartMethodDebug("NoPart","NoPartCreateLink");

    return kODNULL;
}

SOM_Scope void  SOMLINK NoPartLinkUpdated(NoPart *somSelf,  Environment *ev,
                                          ODLink* updatedLink,
                                          ODUpdateID change)
{
    NoPartData *somThis = NoPartGetData(somSelf);
    NoPartMethodDebug("NoPart","NoPartLinkUpdated");

}

SOM_Scope void  SOMLINK NoPartRevealLink(NoPart *somSelf,  Environment *ev,
                                         ODLinkSource* linkSource)
{
    NoPartData *somThis = NoPartGetData(somSelf);
    NoPartMethodDebug("NoPart","NoPartRevealLink");

}

SOM_Scope void  SOMLINK NoPartLinkStatusChanged(NoPart *somSelf,
                                                 Environment *ev,
                                                ODFrame* frame)
{
    NoPartData *somThis = NoPartGetData(somSelf);
    NoPartMethodDebug("NoPart","NoPartLinkStatusChanged");

}


//--------------------------------------------------------------------------
// BeginRelinquishFocus
//--------------------------------------------------------------------------
SOM_Scope ODBoolean  SOMLINK NoPartBeginRelinquishFocus(NoPart *somSelf,
                                                        Environment *ev,
                                                       ODTypeToken focus,
                                                       ODFrame* ownerFrame,
                                                       ODFrame* proposedFrame)
{
    NoPartData *somThis = NoPartGetData(somSelf);
    NoPartMethodDebug("NoPart","NoPartBeginRelinquishFocus");

        if ( focus == _fModalFocus )
                if ( proposedFrame->AcquirePart(ev) != somSelf)
                        // Another part is trying to put up a Modal dialog
                        // while we are currently displaying ours.
                        // Deny the request.
                        return kODFalse;

        return kODTrue;

}

//--------------------------------------------------------------------------
// CommitRelinquishFocus
//--------------------------------------------------------------------------
SOM_Scope void  SOMLINK NoPartCommitRelinquishFocus(NoPart *somSelf,
                                                    Environment *ev,
                                                   ODTypeToken focus,
                                                   ODFrame* ownerFrame,
                                                   ODFrame* proposedFrame)
{
    NoPartData *somThis = NoPartGetData(somSelf);
    NoPartMethodDebug("NoPart","NoPartCommitRelinquishFocus");

        // We previously agreed to give up our FocusSet and
        // now we are being asked to really do so.
        somSelf->FocusLost(ev, focus, ownerFrame);
}

//--------------------------------------------------------------------------
// AbortRelinquishFocus
//--------------------------------------------------------------------------
SOM_Scope void  SOMLINK NoPartAbortRelinquishFocus(NoPart *somSelf,
                                                   Environment *ev,
                                                  ODTypeToken focus,
                                                  ODFrame* ownerFrame,
                                                  ODFrame* proposedFrame)
{
    NoPartData *somThis = NoPartGetData(somSelf);
    NoPartMethodDebug("NoPart","NoPartAbortRelinquishFocus");

        // Another part requested one of the foci we had, but was unable
        // to acquire all the foci it needed. So, we are being given our
        // complete set of foci back.
        somSelf->FocusAcquired(ev, focus, ownerFrame);
}

//--------------------------------------------------------------------------
// FocusAcquired
//--------------------------------------------------------------------------
SOM_Scope void  SOMLINK NoPartFocusAcquired(NoPart *somSelf,  Environment *ev,
                                           ODTypeToken focus,
                                           ODFrame* ownerFrame)
{
    NoPartData *somThis = NoPartGetData(somSelf);
    NoPartMethodDebug("NoPart","NoPartFocusAcquired");

    SOM_TRY

        if ( focus == _fMenuFocus )
        {
            // If the part has a menubar - JRB
            if (_fMenuBar)
            {
                // Display the menubar - JRB
                _fMenuBar->Display(ev);
            }
        }

         else if ( focus == _fSelectionFocus )
         {
                FramePartInfo *pInfo = (FramePartInfo *) ownerFrame->GetPartInfo(ev);
                pInfo->NeedsActivating = kODFalse;
         }

     SOM_CATCH_ALL
     SOM_ENDTRY
}


//--------------------------------------------------------------------------
// FocusLost
//--------------------------------------------------------------------------
SOM_Scope void  SOMLINK NoPartFocusLost(NoPart *somSelf,  Environment *ev,
                                       ODTypeToken focus, ODFrame* ownerFrame)
{
    NoPartData *somThis = NoPartGetData(somSelf);
    NoPartMethodDebug("NoPart","NoPartFocusLost");

}




SOM_Scope void  SOMLINK NoPartCloneInto(NoPart *somSelf,  Environment *ev,
                                        ODDraftKey key, ODStorageUnit* toSU,
                                        ODFrame* scope)
{
    NoPartData *somThis = NoPartGetData(somSelf);
    NoPartMethodDebug("NoPart","NoPartCloneInto");

}

SOM_Scope void  SOMLINK NoPartExternalizeKinds(NoPart *somSelf,
                                                Environment *ev,
                                               ODTypeList* kindset)
{
    NoPartData *somThis = NoPartGetData(somSelf);
    NoPartMethodDebug("NoPart","NoPartExternalizeKinds");

}

SOM_Scope void  SOMLINK NoPartExternalize(NoPart *somSelf,  Environment *ev)
{
    NoPartData *somThis = NoPartGetData(somSelf);
    NoPartMethodDebug("NoPart","NoPartExternalize");

}

SOM_Scope void  SOMLINK NoPartChangeKind(NoPart *somSelf,  Environment *ev,
                                         ODType kind)
{
    NoPartData *somThis = NoPartGetData(somSelf);
    NoPartMethodDebug("NoPart","NoPartChangeKind");

}

//--------------------------------------------------------------------------
// HandleEvent
//--------------------------------------------------------------------------
SOM_Scope ODBoolean  SOMLINK NoPartHandleEvent(NoPart *somSelf,
                                                Environment *ev,
                                               ODEventData* event,
                                               ODFrame* frame,
                                               ODFacet* facet,
                                               ODEventInfo* eventInfo)
{
    NoPartData *somThis = NoPartGetData(somSelf);
    NoPartMethodDebug("NoPart","NoPartHandleEvent");

    ODBoolean   eventHandled     = kODFalse;

#ifdef _PLATFORM_UNIX_
    switch (event->type)
#endif
#ifdef _PLATFORM_MACINTOSH_
    switch (event->what)
#endif
#ifdef _PLATFORM_WIN32_
   switch (event->message)
#endif
#ifdef _PLATFORM_OS2_
   switch (event->msg)
#endif
        {
        case kODEvtActivate:   // LC
                // If activating
#if defined(_PLATFORM_WIN32_)
                if (LOWORD(event->wParam) != WA_INACTIVE)
#endif // _PLATFORM_WIN32_
#if defined(_PLATFORM_OS2_)
                if (SHORT1FROMMP(event->mp1) != 0)
#endif
#if defined(_PLATFORM_UNIX_)
                if (eventInfo->originalType == FocusIn)
#endif
                {
                    // Handle the window activation - JRB
                    somSelf->ActivatingWindow(ev, frame);
                }
                else
                {
                    // Handle the window deactivation - JRB
                    somSelf->DeactivatingWindow(ev, frame);
                }
                break;
        case kODEvtMouseUp:
                eventHandled = somSelf->HandleMouseUp(ev,event,frame,facet);
                break;
        case kODEvtMenu:
                eventHandled = somSelf->HandleMenuEvent(ev, frame, event);
                break;
        default:
                break;
        } /* endswitch */

    return eventHandled;
}

SOM_Scope void  SOMLINK NoPartAdjustMenus(NoPart *somSelf,  Environment *ev,
                                          ODFrame* frame)
{
    NoPartData *somThis = NoPartGetData(somSelf);
    NoPartMethodDebug("NoPart","NoPartAdjustMenus");

}

SOM_Scope void  SOMLINK NoPartUndoAction(NoPart *somSelf,  Environment *ev,
                                         ODActionData* actionState)
{
    NoPartData *somThis = NoPartGetData(somSelf);
    NoPartMethodDebug("NoPart","NoPartUndoAction");

}

SOM_Scope void  SOMLINK NoPartRedoAction(NoPart *somSelf,  Environment *ev,
                                         ODActionData* actionState)
{
    NoPartData *somThis = NoPartGetData(somSelf);
    NoPartMethodDebug("NoPart","NoPartRedoAction");

}

SOM_Scope void  SOMLINK NoPartDisposeActionState(NoPart *somSelf,
                                                  Environment *ev,
                                                 ODActionData* actionState,
                                                 ODDoneState doneState)
{
    NoPartData *somThis = NoPartGetData(somSelf);
    NoPartMethodDebug("NoPart","NoPartDisposeActionState");

}

SOM_Scope void  SOMLINK NoPartWriteActionState(NoPart *somSelf,
                                                Environment *ev,
                                               ODActionData* actionState,
                                               ODStorageUnitView* storageUnitView)
{
    NoPartData *somThis = NoPartGetData(somSelf);
    NoPartMethodDebug("NoPart","NoPartWriteActionState");

}

SOM_Scope ODActionData  SOMLINK NoPartReadActionState(NoPart *somSelf,
                                                       Environment *ev,
                                                      ODStorageUnitView* storageUnitView)
{
    NoPartData *somThis = NoPartGetData(somSelf);
    NoPartMethodDebug("NoPart","NoPartReadActionState");

    ODActionData data;
    data._maximum = 0;
    data._length = 0;
    data._buffer = kODNULL;
    return ((ODActionData) data);
}

SOM_Scope void  SOMLINK NoPartInitPart(NoPart *somSelf,  Environment *ev,
                                       ODStorageUnit* storageUnit,
                                       ODPart* partWrapper)
{
    NoPartData *somThis = NoPartGetData(somSelf);
    NoPartMethodDebug("NoPart","NoPartInitPart");

   _fPartWrapper = partWrapper;

   TRY
       somSelf->InitPersistentObject(ev, storageUnit);
       somSelf->Initialize(ev);
       somSelf->CheckAndAddProperties(ev, storageUnit);

   CATCH_ALL
       ODSetSOMException(ev, kODErrCannotInitializePart);
   ENDTRY

}


SOM_Scope void  SOMLINK NoPartClonePartInfo(NoPart *somSelf,
                                             Environment *ev,
                                            ODDraftKey key, ODInfoType partInfo,

                                            ODStorageUnitView* storageUnitView,
                                            ODFrame* scope)
{
    NoPartData *somThis = NoPartGetData(somSelf);
    NoPartMethodDebug("NoPart","NoPartClonePartInfo");

}



SOM_Scope void  SOMLINK NoPartInitPartFromStorage(NoPart *somSelf,
                                                   Environment *ev,
                                                  ODStorageUnit* storageUnit,
                                                  ODPart* partWrapper)
{
    NoPartData *somThis = NoPartGetData(somSelf);
    NoPartMethodDebug("NoPart","NoPartInitPartFromStorage");


    _fPartWrapper = partWrapper;

    TRY
        somSelf->InitPersistentObjectFromStorage(ev, storageUnit);
        somSelf->Initialize(ev);
        somSelf->CheckAndAddProperties(ev, storageUnit);

        // Internalize State Info
        // Internalize Content

    CATCH_ALL
        ODSetSOMException(ev, kODErrCannotInitializePart);
    ENDTRY

}
