/*
- Copyright (C) 2010 Paul Davis
+ Copyright (C) 2010 Paul Davis
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
* Subclasses of WindowProxy handle windows that are created in different
* ways.
*/
-
+
class WindowProxyBase
{
public:
std::string name () const {
return _name;
}
-
+
void maybe_show ();
XMLNode* get_state () const;
void setup ();
/** Show this window */
virtual void show () = 0;
+ /** @return true if the configuration for this window should be
+ * global (ie across all sessions), otherwise false if it should
+ * be session-specific.
+ */
+ virtual bool rc_configured () const = 0;
+
virtual Gtk::Window* get_gtk_window () const = 0;
private:
XMLNode* state_node (bool, int, int, int, int) const;
-
+
std::string _name; ///< internal unique name for this window
bool _visible; ///< true if the window should be visible on startup
int _x_off; ///< x position
- int _y_off; ///< y position
+ int _y_off; ///< y position
int _width; ///< width
int _height; ///< height
};
: WindowProxyBase (name, node)
, _window (0)
{
-
+
}
Gtk::Window* get_gtk_window () const {
return _window;
}
- /** Set the window and set it up. To be used after initial window creation */
- void set (T* w) {
+ /** Set the window and maybe set it up. To be used after initial window creation */
+ void set (T* w, bool s = true) {
_window = w;
- setup ();
+ if (s) {
+ setup ();
+ }
}
private:
: WindowProxy<T> (name, node)
, _action (action)
{
-
+
}
void show () {
}
}
+ bool rc_configured () const {
+ return true;
+ }
+
private:
std::string _action;
};