Add protected RestoreState, SaveState functions to BApplication. HasBeenRestored can be used to check in ReadyToRun if the RestoreState function has been called. The default implementation just store the window geometry and the decorator settings. Subclass implementations can use the global restore_window_geometry, save_window_geometry function for convenience. Please review. Will commit a simple session manager tomorrow.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39462 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -29,6 +29,10 @@ namespace BPrivate {
|
||||
}
|
||||
|
||||
|
||||
void restore_window_geometry(BWindow* window, const BMessage* windowGeometry);
|
||||
void save_window_geometry(const BWindow* window, BMessage* windowGeometry);
|
||||
|
||||
|
||||
class BApplication : public BLooper {
|
||||
public:
|
||||
BApplication(const char* signature);
|
||||
@@ -91,6 +95,12 @@ public:
|
||||
|
||||
class Private;
|
||||
|
||||
protected:
|
||||
// Session Manager
|
||||
bool HasBeenRestored();
|
||||
virtual status_t RestoreState(const BMessage* state);
|
||||
virtual status_t SaveState(BMessage* state) const;
|
||||
|
||||
private:
|
||||
typedef BLooper _inherited;
|
||||
|
||||
@@ -145,8 +155,9 @@ private:
|
||||
BMessageRunner* fPulseRunner;
|
||||
status_t fInitError;
|
||||
void* fServerReadOnlyMemory;
|
||||
uint32 _reserved[12];
|
||||
uint32 _reserved[11];
|
||||
|
||||
uint32 fHasBeenRestored;
|
||||
bool fReadyToRunCalled;
|
||||
};
|
||||
|
||||
|
||||
@@ -14,6 +14,10 @@
|
||||
struct server_read_only_memory;
|
||||
|
||||
|
||||
const uint32 kRestoreStateMsg = '_RSM';
|
||||
const uint32 kSaveStateMsg = '_SSM';
|
||||
|
||||
|
||||
class BApplication::Private {
|
||||
public:
|
||||
static inline BPrivate::PortLink *ServerLink()
|
||||
|
||||
Reference in New Issue
Block a user