home *** CD-ROM | disk | FTP | other *** search
-
- // objects.window.h.basewindow
-
- // Dreamscape - C++ class library for RISC OS
- // Copyright (c) 1996 Mark Seaborn <mseaborn@argonet.co.uk>
- //
- // This library is free software; you can redistribute it and/or
- // modify it under the terms of the GNU Library General Public
- // License as published by the Free Software Foundation; either
- // version 2 of the License, or (at your option) any later version.
- // See the Dreamscape documentation for more information.
-
- #ifndef dreamscape_basewindow_H
- #define dreamscape_basewindow_H
-
- #include "tboxobj.h"
-
- class Window;
- typedef struct wimp_w_ *wimp_w;
-
- class WindowCoordSystem;
- typedef int WinUnit;
- typedef Coords<WinUnit, WindowCoordSystem> WinCoords;
- typedef BBox<WinUnit, WindowCoordSystem> WinBBox;
- typedef TransformMatrix<WinUnit, float, WindowCoordSystem> WinTransform;
-
- class BaseWindow {
- public:
- class Position {
- public:
- Position();
- Position(const BaseWindow &window);
-
- Position &operator=(const Position &p)
- { visible = p.visible; scroll = p.scroll;
- next = p.next; return *this; }
- bool operator==(const Position &p) const
- { return visible == p.visible && scroll == p.scroll &&
- next == p.next; }
-
- enum StackPos { top = -1, bottom = -2 };
-
- ScrBBox visible;
- WinCoords scroll;
- StackPos next;
-
- Position &set_to_top() { next = top; return *this; }
- Position &set_to_bottom() { next = bottom; return *this; }
- };
- operator Position::StackPos() const
- { return (Position::StackPos) get_wimp_handle(); }
-
- void show();
- void show(const ScrCoords &topleft);
- void show(const Position &position);
- void show_transient();
- void show_transient(const ScrCoords &topleft);
- void show_transient(const Position &position);
- void hide();
- void iconise();
-
- bool is_showing() const;
- void get_position(Position &position) const;
- Position get_position() const
- { Position temp; get_position(temp); return temp; }
-
- ScrUnit get_left_border() const { return 0; }
- ScrUnit get_right_border() const;
- ScrUnit get_top_border() const;
- ScrUnit get_bottom_border() const;
-
- void set_scroll_position(const WinCoords &scroll);
- void get_scroll_position(WinCoords &scroll) const;
- WinCoords get_scroll_position() const
- { WinCoords temp; get_scroll_position(temp); return temp; }
-
- WinCoords scr_to_win(const ScrCoords &pos) const;
- ScrCoords win_to_scr(const WinCoords &pos) const;
- WinBBox scr_to_win(const ScrBBox &bbox) const;
- ScrBBox win_to_scr(const WinBBox &bbox) const;
-
- virtual Window &get_window();
- virtual const Window &get_window() const;
- virtual BaseWindow &get_next_window() = 0;
- virtual const BaseWindow &get_next_window() const = 0;
-
- virtual bool has_window() const;
- virtual bool has_next_window() const = 0;
-
- // Low level
- virtual wimp_w get_wimp_handle() const;
- virtual ToolboxObject &get_top_toolbox_object();
- virtual const ToolboxObject &get_top_toolbox_object() const;
- };
-
- #endif
-