/* @(#) 1.20 com/src/ui/idl/WinStat.idl, odui, od96nt, odnt9712d 2/19/97 15:20:19 [3/21/97 16:49:42] */

/********************************************************************/
/*  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.                     */
/********************************************************************/

#ifndef _WINSTAT_
#define _WINSTAT_

#ifndef _ODOBJECT_
#include "ODObject.idl"
#endif

//=====================================================================================
// Classes defined in this interface
//=====================================================================================

interface  ODWindowState;

//=====================================================================================
// Classes used by this interface
//=====================================================================================

interface  ODCanvas;
interface  ODDraft;
interface  ODFacet;
interface  ODFrame;
interface  ODMenuBar;
interface  ODPart;
interface  ODShape;
interface  ODTransform;
interface  ODWindow;
interface  ODWindowIterator;
#if defined(_PLATFORM_OS2_) || defined(_PLATFORM_WIN32_) || defined(_PLATFORM_UNIX_)
interface  ODPopup;
#endif

#ifdef _PLATFORM_UNIX_
typedef somToken Display;
typedef somToken Screen;
typedef somToken XtAppContext;
typedef somToken Widget;
#endif


//=====================================================================================
// ODWindowState
//=====================================================================================

interface ODWindowState :  ODObject
{

        ODWindow RegisterWindow(in ODPlatformWindow newWindow,
                                                        in ODType frameType,
                                                        in ODBoolean isRootWindow,
                                                        in ODBoolean isResizable,
                                                        in ODBoolean isFloating,
                                                        in ODBoolean shouldSave,
                                                        in ODBoolean shouldDispose,
                                                        in ODPart rootPart,
                                                        in ODTypeToken viewType,
                                                        in ODTypeToken presentation,
                                                        in ODFrame sourceFrame);

        ODWindow RegisterWindowForFrame(in ODPlatformWindow newWindow,
                                                        in ODFrame frame,
                                                        in ODBoolean isRootWindow,
                                                        in ODBoolean isResizable,
                                                        in ODBoolean isFloating,
                                                        in ODBoolean shouldSave,
                                                        in ODBoolean shouldDispose,
                                                        in ODFrame sourceFrame);

        ODWindow AcquireWindow(in ODID id);

        void Internalize(in ODDraft draft);

        void Externalize(in ODDraft draft);

        void SetDefaultWindowTitles(in ODDraft draft);

        void OpenWindows(in ODDraft draft);

        void CloseWindows(in ODDraft draft);

        ODUShort GetWindowCount();

        ODUShort GetRootWindowCount(in ODDraft draft);

        ODUShort GetTotalRootWindowCount();

        ODBoolean IsODWindow(in ODPlatformWindow aWindow);

        ODWindow  AcquireODWindow(in ODPlatformWindow aWindow);

        ODWindowIterator  CreateWindowIterator();

        ODWindow  AcquireActiveWindow();

        void SetBaseMenuBar(in ODMenuBar theMenuBar);

        ODMenuBar  CopyBaseMenuBar();

        void AdjustPartMenus();

#ifdef _PLATFORM_WIN32_
        ODPopup   CreatePopupMenuEx(in ODPlatformMenuBar popupMenu,
                                    in ODUShort          subMenuIDcount,
                                    in ODMenuIDInfo*     subMenuIDinfo);

        ODMenuBar CreateMenuBarEx(in ODPlatformMenuBar  menuBar,
                                  in ODUShort           subMenuIDcount,
                                  in ODMenuIDInfo*      subMenuIDinfo);
#endif // PLATFORM_WIN32

#if defined(_PLATFORM_OS2_) || defined(_PLATFORM_WIN32_) || defined(_PLATFORM_UNIX_)
        ODPopup   CreatePopupMenu(in ODPlatformMenuBar popupMenu);
#endif // PLATFORM_OS2, PLATFORM_WIN32, PLATFORM_UNIX

        ODMenuBar CreateMenuBar(in ODPlatformMenuBar menuBar);

        ODCanvas CreateCanvas(in ODGraphicsSystem graphicsSystem,
                                                  in ODPlatformCanvas platformCanvas,
                                                  in ODBoolean isDynamic,
                                                  in ODBoolean isOffscreen);

        ODFacet CreateFacet(in ODFrame frame,
                                            in ODShape clipShape,
                                            in ODTransform externalTransform,
                                            in ODCanvas canvas,
                                            in ODCanvas biasCanvas);

#if defined(_PLATFORM_MACINTOSH_) || defined(_PLATFORM_OS2_) || defined(_PLATFORM_WIN32_) || defined(_PLATFORM_UNIX_)

        ODMenuBar  AcquireCurrentMenuBar();

        ODMenuBar  AcquireBaseMenuBar();

#ifdef _PLATFORM_MACINTOSH_
        void DeactivateFrontWindows();

    void ActivateFrontWindows();
#endif

    ODWindow AcquireFrontWindow();

    ODWindow AcquireFrontFloatingWindow();

    ODWindow AcquireFrontRootWindow();

#endif 

#if defined(_PLATFORM_OS2_) || defined(_PLATFORM_WIN32_) || defined(_PLATFORM_UNIX_)

    void SetBasePopup(in ODPopup thePopup);

    ODPopup  CopyBasePopup();

    ODPopup    AcquireCurrentPopupMenu();

    ODPopup    AcquireBasePopupMenu();

    ODPlatformWindow CreatePlatformWindow(in ODBoolean isFloating);
#endif

#ifdef _PLATFORM_UNIX_
    Display*     GetDisplay();

    Screen*      GetScreen();

    XtAppContext GetAppContext();
#endif


#ifdef __SOMIDL__
// #ifdef _PLATFORM_MACINTOSH_
        implementation
        {
                majorversion = 1; minorversion = 0;

                functionprefix = ODWindowState;

                override:
                        somUninit,
                        Purge;

           releaseorder:
                        RegisterWindow,
                        RegisterWindowForFrame,
                        AcquireWindow,
                        Internalize,
                        Externalize,
                        SetDefaultWindowTitles,
                        OpenWindows,
                        CloseWindows,
                        GetWindowCount,
                        GetRootWindowCount,
                        GetTotalRootWindowCount,
                        IsODWindow,
                        AcquireODWindow,
                        CreateWindowIterator,
                        AcquireActiveWindow,
                        SetBaseMenuBar,
                        CopyBaseMenuBar,
                        AdjustPartMenus,

                #ifdef _PLATFORM_WIN32_
                        CreatePopupMenuEx,
                        CreateMenuBarEx,
                #endif // PLATFORM_WIN32

                #if defined(_PLATFORM_OS2_) || defined(_PLATFORM_WIN32_) || defined(_PLATFORM_UNIX_)
                        CreatePopupMenu,
                #endif // PLATFORM_OS2, PLATFORM_WIN32, PLATFORM_UNIX

                        CreateMenuBar,
                        CreateCanvas,
                        CreateFacet,

                        AcquireCurrentMenuBar,
                        AcquireBaseMenuBar,
        #ifdef _PLATFORM_MACINTOSH_
                        DeactivateFrontWindows,
                        ActivateFrontWindows,
        #endif
                        AcquireFrontWindow,
                        AcquireFrontFloatingWindow,
                        AcquireFrontRootWindow,
        #if defined(_PLATFORM_OS2_) || defined(_PLATFORM_WIN32_) || defined(_PLATFORM_UNIX_)
                        SetBasePopup,
                        CopyBasePopup,
                        AcquireCurrentPopupMenu,
                        AcquireBasePopupMenu,
                        CreatePlatformWindow,
        #endif
#ifdef _PLATFORM_UNIX_
                        GetDisplay,
                        GetScreen,
                        GetAppContext,
#endif

          #ifdef _PLATFORM_MACINTOSH_
                        reserved1, reserved2, reserved3, reserved4, reserved5, reserved6,
                        reserved7, reserved8, reserved9, reserved10, reserved11, reserved12,
                        reserved13, reserved14, reserved15, reserved16, reserved17, reserved18,
                        reserved19,reserved20,reserved21,reserved22,reserved23;
          #endif
          #if defined(_PLATFORM_OS2_) || defined(_PLATFORM_WIN32_)
            reserved1, reserved2, reserved3, reserved4, reserved5, reserved6,
            reserved7, reserved8, reserved9, reserved10, reserved11, reserved12,
            reserved13, reserved14, reserved15, reserved16, reserved17, reserved18,
            reserved19, reserved20, reserved21, reserved22, reserved23;
          #endif
          #ifdef _PLATFORM_UNIX_
            reserved1, reserved2, reserved3, reserved4, reserved5, reserved6,
            reserved7, reserved8, reserved9, reserved10, reserved11, reserved12,
            reserved13, reserved14, reserved15, reserved16, reserved17, reserved18,
            reserved19, reserved20, reserved21, reserved22, reserved23, reserved24,
            reserved25, reserved26, reserved27;
          #endif


  };
// #endif 
#endif 
};

#endif // _WINSTAT_
