home *** CD-ROM | disk | FTP | other *** search
-
- // utils.h.windowcmds
-
- // 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_windowcmds_H
- #define dreamscape_windowcmds_H
-
- #include "basewindow.h"
- #include "command.h"
-
- class ShowWindowCommand: public Command {
- BaseWindow *window;
- unsigned show_transient: 1;
- unsigned show_position: 1;
-
- public:
- enum Position { default_position = 0, at_pointer = 1 };
- enum { transient = 2 };
- ShowWindowCommand(BaseWindow *window, int flags = 0);
-
- void execute();
-
- ShowWindowCommand &operator=(BaseWindow *w) { window = w; return *this; }
- operator BaseWindow*() const { return window; }
-
- void set_window(BaseWindow *w) { window = w; }
- BaseWindow *get_window() const { return window; }
-
- void set_transient(bool t) { show_transient = t; }
- bool get_transient() const { return show_transient; }
-
- void set_position(Position position) { show_position = position; }
- Position get_position() const { return (Position) show_position; }
- };
-
- class HideWindowCommand: public Command {
- BaseWindow *window;
-
- public:
- HideWindowCommand(BaseWindow *w): window(w) {}
-
- void execute();
-
- HideWindowCommand &operator=(BaseWindow *w) { window = w; return *this; }
- operator BaseWindow*() const { return window; }
-
- void set_window(BaseWindow *w) { window = w; }
- BaseWindow *get_window() const { return window; }
- };
-
- class IconiseWindowCommand: public Command {
- BaseWindow *window;
-
- public:
- IconiseWindowCommand(BaseWindow *w): window(w) {}
-
- void execute();
-
- IconiseWindowCommand &operator=(BaseWindow *w)
- { window = w; return *this; }
- operator BaseWindow*() const { return window; }
-
- void set_window(BaseWindow *w) { window = w; }
- BaseWindow *get_window() const { return window; }
- };
-
- class ShowWindowTCommand: public ShowWindowCommand {
- public:
- ShowWindowTCommand(BaseWindow *window, int flags = 0):
- ShowWindowCommand(window, flags | transient) {}
- };
-
- class ShowWindowPCommand: public ShowWindowCommand {
- public:
- ShowWindowPCommand(BaseWindow *window, int flags = 0):
- ShowWindowCommand(window, flags | at_pointer) {}
- };
-
- class ShowWindowTPCommand: public ShowWindowCommand {
- public:
- ShowWindowTPCommand(BaseWindow *window, int flags = 0):
- ShowWindowCommand(window, flags | transient | at_pointer) {}
- };
-
- typedef ShowWindowTCommand ShowWindowTransientCommand;
- typedef ShowWindowPCommand ShowWindowAtPointerCommand;
-
- #endif
-