Class Definition File | WinStat.idl |
Class C++ Binding | WinStat.xh |
Class Hierarchy |
SOMObject ODObject ODWindowState |
Description | An object of the ODWindowState class maintains a list of all the open window objects for all open drafts in an OpenDoc session, references to the base menu bar and the current menu bar, and references to the base popup and current popup. When a document is opened, the session object creates a single window-state object. All parts of that document share the window-state object; you can obtain a reference to it by calling the session object's GetWindowState method. The document shell and dispatcher use the window-state object to pass events to parts so the parts can activate themselves, handle user input, and adjust their menus as necessary. The document shell may manage more than one open document. Typically, however, there is only one open document in a session, but multiple drafts of the document may be open. A part may be displayed in any number of frames, in any window of a document. The dispatcher passes events to the correct part, without regards to which window encloses the active frame and how many other frames the part has. Your part accesses the window-state object to create new windows, to access a particular window, and to access the base menu-bar object. For more information related to window objects, see the class description for ODWindow. |
Methods | The methods defined by the ODWindowState class include: Creating Windows Manipulating Windows
Window Characteristics Manipulating Menu Bars
Creating Facets and Canvases |
Overridden Methods | There are no methods overridden by the ODWindowState class. |
This method returns a reference to the front-most, non-floating window.
Signature
ODWindow *AcquireActiveWindow () |
Parameters
None.
Returns
Remarks
This method increments the reference count of the returned window object. When you have finished using that window object, you should call its Release method.
This method is called by the document shell to retrieve a reference to the base menu bar.
Signature
ODMenuBar *AcquireBaseMenuBar () |
Parameters
None.
Returns
Remarks
The document shell calls this method. Your part typically calls this window-state object's CopyBaseMenuBar method instead of this method.
This method increments the reference count of the returned menu-bar object. When the caller has finished using that menu-bar object, it should call the menu bar's Release method.
Related Methods
This method is called by the document shell to retrieve a reference to the base popup menu.
Signature
ODMenuBar *AcquireBasePopupMenu () |
Parameters
None.
Returns
Remarks
The document shell calls this method. Your part typically calls this window-state object's CopyBasePopup method instead of this method.
This method increments the reference count of the returned popup menu object. When the caller has finished using that popup menu object, it should call the popup menu 's Release method.
Related Methods
This method is called by the document shell to retrieve a reference to the menu bar being displayed by the document shell.
Signature
ODMenuBar *AcquireCurrentMenuBar () |
Parameters
None.
Returns
Remarks
The document shell calls this method. Your part typically calls this window-state object's CopyBaseMenuBar method instead of this method.
This method increments the reference count of the returned menu-bar object. When the caller has finished using that menu-bar object, it should call the menu bar's Release method.
Related Methods
This method is called by the document shell to retrieve a reference to the popup menu being displayed by the document shell.
Signature
ODPopup *AcquireCurrentPopupMenu () |
Parameters
None.
Returns
Remarks
The document shell calls this method. Your part typically calls this window-state object's CopyBasePopup method instead of this method.
This method increments the reference count of the returned popup menu object. When the caller has finished using that object, it should call the popup menu 's Release method.
Related Methods
This method returns a reference to the front-most, floating window.
Signature
ODWindow *AcquireFrontFloatingWindow () |
Parameters
None.
Returns
Remarks
This method increments the reference count of the returned window object. When you have finished using that window object, you should call its Release method.
This method returns a reference to the front-most, non-floating root window.
Signature
ODWindow *AcquireFrontRootWindow () |
Parameters
None.
Returns
Remarks
This method increments the reference count of the returned window object. When you have finished using that window object, you should call its Release method.
This method returns a reference to the front-most window.
Signature
ODWindow *AcquireFrontWindow () |
Parameters
None.
Returns
Remarks
This method increments the reference count of the returned window object. When you have finished using that window object, you should call its Release method.
This method returns a reference to the window object corresponding to the specified platform-specific window.
Signature
ODWindow *AcquireODWindow (ODPlatformWindow aWindow) |
Parameters
Returns
Remarks
OpenDoc calls this method.
This method increments the reference count of the returned window object. When the caller has finished using that window object, it should call the window's Release method.
Related Methods
This method returns a reference to the window object with the specified ID.
Signature
ODWindow *AcquireWindow (ODID id) |
Parameters
Returns
Remarks
This method increments the reference count of the returned window object. When you have finished using that window object, you should call its Release method.
Related Methods
This method calls both the root part and the part with the menu focus to adjust the displayed menu.
Signature
void AdjustPartMenus () |
Parameters
None.
Returns
None.
Remarks
OpenDoc calls this method when a mouse-down event occurs in the menu bar. This method in turn calls the AdjustMenus method for both the root part and the part with the menu focus, so the parts can enable or disable menu items as necessary. If the root part has the menu focus, then OpenDoc only calls the AdjustMenus method once.
Related Methods
This method is called by the document shell or container application to close all windows belonging to the specified draft.
Signature
void CloseWindows (ODDraft *draft) |
Parameters
Returns
None.
Remarks
The document shell calls this method when closing a draft.
Related Methods
This method copies the base menu-bar object.
Signature
ODMenuBar *CopyBaseMenuBar () |
Parameters
None.
Returns
Remarks
Your part calls this method to create a menu-bar object to which it can add its own menus.
This method initializes the reference count of the returned menu-bar object. When you have finished using that menu-bar object, you should call its Release method.
Related Methods
This method copies the base pop-up menu object.
Signature
ODPopup *CopyBasePopup () |
Parameters
None.
Returns
Remarks
Your part editor calls this method to create a pop-up menu object to which it can add its own menus items. This method in turn calls its pop-up menu object's Copy method.
This method increments the reference count of the returned pop-up menu object. When you have finished using that pop-up menu object, you should call its Release method.
This method creates a canvas object that will not be attached to a facet.
Signature
ODCanvas *CreateCanvas (ODGraphicsSystem graphicsSystem, ODPlatformCanvas *platformCanvas, ODBoolean isDynamic, ODBoolean isOffscreen) |
Parameters
kODTrue | The canvas is to be dynamic. |
kODFalse | The canvas is to be static. |
kODTrue | The canvas is to be offscreen. |
kODFalse | The canvas is to be onscreen. |
Returns
Remarks
To create a canvas to attach to a particular facet, you should call that facet's CreateCanvas method.
Related Methods
This method creates a facet object.
Signature
ODFacet *CreateFacet (ODFrame *frame, ODShape *clipShape, ODTransform *externalTransform, ODCanvas *canvas, ODCanvas *biasCanvas) |
Parameters
Returns
Remarks
Your part calls this method to create a root facet (for example, for printing). The frame is defined for the lifetime of the facet object; once set, it cannot be changed.
To create a facet object for a visible embedded frame, your part should call its own display facet's CreateEmbeddedFacet method instead of this method.
Related Methods
This method is called by the document shell to create and initialize a menu-bar object.
Signature
ODMenuBar *CreateMenuBar (ODPlatformMenuBar menuBar) |
Parameters
Returns
Remarks
The document shell calls this method. Your part typically calls this window-state object's CopyBaseMenuBar method instead of this method.
This method initializes the reference count of the returned menu bar. When the caller has finished using that menu bar, it should call the menu bar's Release method.
Related Methods
This method is called by the document shell to create and initialize a menu-bar object. This method is similar to CreateMenuBar, but takes additional parameters to specify the IDs for the submenus in the menu being added. This is necessary because Windows NT does not support IDs for submenus.
Signature
ODMenuBar *CreateMenuBarEx (ODPlatformMenuBar menuBar, OSUShort subMenuIDCount, ODMenuIDInfo *subMenuIDInfo) |
Parameters
Returns
Remarks
The document shell calls this method. Your part typically calls this window-state object's CopyBaseMenuBar method instead of this method.
This method initializes the reference count of the returned menu bar. When the caller has finished using that menu bar, it should call the menu bar's Release method.
Related Methods
Signature
ODPlatformWindow CreatePlatformWindow (ODBoolean isFloating) |
Parameters
kODTrue | The window object is to be a floating window. |
kODFalse | The window object is not to be a floating window. |
Returns
Remarks
OpenDoc parts cannot directly create document windows. Therefore, this method allows OpenDoc parts to create document windows using platform APIs.
This method is called by the document shell to create and initialize a popup menu object.
Signature
ODPopup *CreatePopupMenu (ODPlatformMenuBar popupMenu) |
Parameters
Returns
Remarks
The document shell calls this method. Your part typically calls this window-state object's CopyBasePopup method instead of this method.
This method initializes the reference count of the returned popup menu. When the caller has finished using that popup menu, it should call the popup menu's Release method.
Related Methods
This method is called by the document shell to create and initialize a popup menu object. This method is similar to CreatePopupMenu but takes additional parameters to specify the IDs for the submenus in the menu being added. This is necessary because Windows NT does not support IDs for submenus.
Signature
ODPopup *CreatePopupMenuEx (ODPlatformMenuBar popupMenu, ODUShort subMenuIDCount, ODMenuIDInfo *subMenuIDInfo) |
Parameters
Returns
Remarks
The document shell calls this method. Your part typically calls this window-state object's CopyBasePopup method instead of this method.
This method initializes the reference count of the returned popup menu. When the caller has finished using that popup menu, it should call the popup menu's Release method.
Related Methods
This method creates a window iterator for the windows (of all drafts) in this window-state object.
Signature
ODWindowIterator *CreateWindowIterator () |
Parameters
None.
Returns
Remarks
Your part calls this method if it needs to apply an operation to all windows of a window-state object. For example, a root part might use a window iterator to tile all the opened windows.
While you are using the returned window iterator, you must not call any methods that create or delete windows.
You must delete the returned window iterator when it is no longer needed.
This method is called by the document shell to write to persistent storage the window properties of windows of the specified draft and save their frames as the root frames of the draft.
Signature
void Externalize (ODDraft *draft) |
Parameters
Returns
None.
Remarks
The document shell calls this method when saving a draft. This method saves window properties for those windows of the specified draft that should be saved. For these windows, the ShouldSave method returned kODTrue.
Related Methods
This method returns the application context of the window-state object.
Signature
XtAppContext GetAppContext () |
Parameters
None.
Returns
Remarks
This method returns the application context of the window-state object. Your part calls this method when it needs the application context.
This method returns the Xlib display of the window-state object.
Signature
Display *GetDisplay () |
Parameters
None.
Returns
Remarks
This method returns the Xlib display of the window-state object. Your part calls this method when it needs the display.
This method returns the number of root windows belonging to the specified draft.
Signature
ODUShort GetRootWindowCount (ODDraft *draft) |
Parameters
Returns
Remarks
The document shell calls this method when closing a window to determine when to close the draft; the draft is closed when its last root window is closed.
Related Methods
This method returns the Xlib screen of the window-state object.
Signature
Screen *GetScreen () |
Parameters
None.
Returns
Remarks
This method returns the Xlib screen of the window-state object. Your part calls this method when it needs the screen.
This method returns the total number of root windows of all open drafts.
Signature
ODUShort GetTotalRootWindowCount () |
Parameters
None.
Returns
Related Methods
This method returns the number of windows (of all open drafts) in this window-state object.
Signature
ODUShort GetWindowCount () |
Parameters
None.
Returns
This method is called by the document shell to read into memory all root frames of the specified draft, causing their parts to open the windows.
Signature
void Internalize (ODDraft *draft) |
Parameters
Returns
None.
Remarks
The document shell calls this method when opening a draft. After reading the root frames, this method reads into memory the part associated with each root frame, then passes that root frame as the parameter to its part's Open method. The Open method in turn creates the root (document) window for the root frame.
Exception Handling
kODErrOutOfMemory | There is not enough memory to read in the data. |
Related Methods
This method indicates whether this window-state object has a window with the specified platform-specific window.
Signature
ODBoolean IsODWindow (ODPlatformWindow aWindow) |
Parameters
Returns
kODTrue | This window-state object has a window with the specified platform-specific window. |
kODFalse | This window-state object does not have a window with the specified platform-specific window. |
Remarks
OpenDoc calls this method.
Related Methods
This method is called by the document shell or container application to open all windows belonging to the specified draft.
Signature
void OpenWindows (ODDraft *draft) |
Parameters
Returns
None.
Remarks
If the draft is already open, this method brings its window to the front.
Exception Handling
kODErrOutOfMemory | There is not enough memory to open all the windows. |
Related Methods
This method creates an OpenDoc window object and root frame for the specified platform-specific window.
Signature
ODWindow *RegisterWindow (ODPlatformWindow newWindow, ODType frameType, ODBoolean isRootWindow, ODBoolean isResizable, ODBoolean isFloating, ODBoolean shouldSave, ODBoolean shouldDispose, ODPart *rootPart, ODTypeToken viewType, ODTypeToken presentation, ODFrame *sourceFrame) |
Parameters
kODFrameObject | A regular frame. |
kODNonPersistentFrameObject | A nonpersistent frame object. |
kODTrue | The window object is to be a root window. |
kODFalse | The window object is to be a regular window. |
kODTrue | The window object is to be resizable. |
kODFalse | The window object is not to be resizable. |
kODTrue | The window object is to be a floating window. |
kODFalse | The window object is not to be a floating window. |
kODTrue | The window object is to be saved in its draft. |
kODFalse | The window object is not to be saved in its draft. |
kODTrue | The window object should be removed. |
kODFalse | The window object should not be removed. |
This parameter must be the tokenized form of one of the following view-type constants. You can call the session's Tokenize method to obtain a token corresponding to one of these constants.
kODViewAsFrame | Framed view type. |
kODViewAsLargeIcon | Large-icon (standard) view type. |
kODViewAsSmallIcon | Small-icon view type. |
kODViewAsThumbNail | Thumbnail view type. |
Returns
Remarks
This method is a part of the following method sequence.
This method initializes the reference count of the returned window. When you have finished using that window, you should call its Release method.
Exception Handling
kODErrCannotCreateWindow | There is not enough memory to create the new window object. |
Related Methods
This method creates a window object for the specified platform-specific window and root frame.
Signature
ODWindow *RegisterWindowForFrame (ODPlatformWindow newWindow, ODFrame *frame, ODBoolean isRootWindow, ODBoolean isResizable, ODBoolean isFloating, ODBoolean shouldSave, ODBoolean shouldDispose, ODFrame *sourceFrame) |
Parameters
kODTrue | The window object is to be a root window. |
kODFalse | The window object is to be a regular window. |
kODTrue | The window object is to be resizable. |
kODFalse | The window object is not to be resizable. |
kODTrue | The window object is to be a floating window. |
kODFalse | The window object is not to be a floating window. |
kODTrue | The window object is to be saved in its draft. |
kODFalse | The window object is not to be saved in its draft. |
kODTrue | The window object should be removed. |
kODFalse | The window object should not be removed. |
Returns
Remarks
This method is a part of the following method sequence.
This window initializes the reference count of the returned window object. When you have finished using that window object, you should call its Release method.
Exception Handling
kODErrCannotCreateWindow | There is not enough memory to create the new window object. |
Related Methods
This method is called by the document shell or container application to install the specified menu-bar object as the base menu for parts to copy.
Signature
void SetBaseMenuBar (ODMenuBar *theMenuBar) |
Parameters
Returns
None.
Remarks
The base menu bar contains the Document, Edit, and Help menus.
This method is called by the document shell or container application to install the pop-up menu object used by all parts.
Signature
void SetBasePopup (ODPopup *thePopup) |
Parameters
Returns
This method is called by the document shell or container application to synchronize window titles with the file name of the document of the specified draft.
Signature
void SetDefaultWindowTitles (ODDraft *draft) |
Parameters
Returns
None.