/* Copyright 1996 Acorn Computers Ltd
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
/****************************************************************************
 * This source file was written by Acorn Computers Limited. It is part of   *
 * the RISCOS library for writing applications in C for RISC OS. It may be  *
 * used freely in the creation of programs for Archimedes. It should be     *
 * used with Acorn's C Compiler Release 3 or later.                         *
 *                                                                          *
 ***************************************************************************/

/* Title:   txtwin.h
 * Purpose: control of multiple windows on Text objects.
 *
 */

#ifndef __txtwin_h
#define __txtwin_h

#ifndef __txt_h
#include "txt.h"
#endif

/* A Text can support multiple windows. When the Text is updated, all
 * of the windows are updated in step. All of the windows have the same
 * title information.
 *
 */

/* ----------------------------- txtwin_new --------------------------------
 * Description:   Creates an extra window on a given text object.
 *
 * Parameters:    txt t -- the text to have window added to it.
 * Returns:       void.
 * Other Info:    The created window will be in the same style as for
 *                txt_new(), with the same title information. The window
 *                will be made visible.
 *
 */

void txtwin_new(txt t);


/* --------------------------------- txtwin_number -------------------------
 * Description:   Informs caller of the number of windows currently on a
 *                given text.
 *
 * Parameters:    txt t -- the text.
 * Returns:       The number of windows currently on "t".
 * Other Info:    none.
 *
 */

int txtwin_number(txt t);


/* -------------------------------- txtwin_dispose -------------------------
 * Description:   Removes a window, previously on "t".
 *
 * Parameters:    txt t -- the text.
 * Returns:       void.
 * Other Info:    This call will have no effect if there is only one window
 *                on "t".
 *
 */

void txtwin_dispose(txt t);


/* --------------------------- txtwin_setcurrentwindow ---------------------
 * Description:    Ensures that the last window to which the last event was
 *                 delivered, is the current window on a given text
 *
 * Parameters:     txt t -- the text.
 * Returns:        void.
 * Other Info:     Call this when constructing menus, since the same menu
 *                 structure is attached to each window on the same text
 *                 object.
 *
 */

void txtwin_setcurrentwindow(txt t);

#endif

/* end txtwin.h */