From da1c93175df3970c57acefb5fcf9147365bf8827 Mon Sep 17 00:00:00 2001 From: Clemens Zeidler Date: Wed, 17 Nov 2010 22:19:09 +0000 Subject: [PATCH] Revert r39462 because it was not really binary compatible. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39469 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- headers/os/app/Application.h | 13 +-- headers/private/app/ApplicationPrivate.h | 4 - src/kits/app/Application.cpp | 108 ----------------------- 3 files changed, 1 insertion(+), 124 deletions(-) diff --git a/headers/os/app/Application.h b/headers/os/app/Application.h index 105073e6c0..a9263efd7d 100644 --- a/headers/os/app/Application.h +++ b/headers/os/app/Application.h @@ -29,10 +29,6 @@ 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); @@ -95,12 +91,6 @@ 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; @@ -155,9 +145,8 @@ private: BMessageRunner* fPulseRunner; status_t fInitError; void* fServerReadOnlyMemory; - uint32 _reserved[11]; + uint32 _reserved[12]; - uint32 fHasBeenRestored; bool fReadyToRunCalled; }; diff --git a/headers/private/app/ApplicationPrivate.h b/headers/private/app/ApplicationPrivate.h index bea2498ae8..bfd6a56d95 100644 --- a/headers/private/app/ApplicationPrivate.h +++ b/headers/private/app/ApplicationPrivate.h @@ -14,10 +14,6 @@ struct server_read_only_memory; -const uint32 kRestoreStateMsg = '_RSM'; -const uint32 kSaveStateMsg = '_SSM'; - - class BApplication::Private { public: static inline BPrivate::PortLink *ServerLink() diff --git a/src/kits/app/Application.cpp b/src/kits/app/Application.cpp index 350b82d902..dc40511c97 100644 --- a/src/kits/app/Application.cpp +++ b/src/kits/app/Application.cpp @@ -31,8 +31,6 @@ #include #include #include -#include -#include #include #include @@ -50,46 +48,6 @@ using namespace BPrivate; -void -restore_window_geometry(BWindow* window, const BMessage* windowGeometry) -{ - BRect frame; - status_t status = windowGeometry->FindRect("frame", &frame); - if (status == B_OK) { - // make sure window is on the screen - BScreen screen; - BRect screenFrame = screen.Frame(); - if (screenFrame.right < frame.left || screenFrame.bottom < frame.top) - frame.OffsetBy(-frame.top, -frame.left); - - window->MoveTo(frame.LeftTop()); - window->ResizeTo(frame.Width(), frame.Height()); - } - - uint32 workspaces; - status = windowGeometry->FindInt32("workspaces", (int32*)&workspaces); - if (status == B_OK) - window->SetWorkspaces(workspaces); - - BMessage decoratroSettings; - status = windowGeometry->FindMessage("decorator_settings", - &decoratroSettings); - if (status == B_OK) - window->SetDecoratorSettings(decoratroSettings); -} - - -void -save_window_geometry(const BWindow* window, BMessage* windowGeometry) -{ - windowGeometry->AddRect("frame", window->Frame()); - windowGeometry->AddInt32("workspaces", window->Workspaces()); - BMessage decoratroSettings; - if (window->GetDecoratorSettings(&decoratroSettings) == B_OK) - windowGeometry->AddMessage("decorator_settings", &decoratroSettings); -} - - BApplication *be_app = NULL; BMessenger be_app_messenger; @@ -316,7 +274,6 @@ BApplication::_InitData(const char *signature, bool initGUI, status_t *_error) fServerAllocator = NULL; fInitialWorkspace = 0; //fDraggedMessage = NULL; - fHasBeenRestored = 0; fReadyToRunCalled = false; // initially, there is no pulse @@ -615,8 +572,6 @@ BApplication::ReadyToRun() // supposed to be implemented by subclasses } -#include "ApplicationPrivate.h" - void BApplication::MessageReceived(BMessage *message) @@ -642,19 +597,6 @@ BApplication::MessageReceived(BMessage *message) be_roster->ActivateApp(Team()); break; - case kRestoreStateMsg: - if (RestoreState(message) == B_OK) - fHasBeenRestored = 1; - break; - - case kSaveStateMsg: - { - BMessage state; - if (SaveState(&state) == B_OK) - message->SendReply(&state); - break; - } - default: BLooper::MessageReceived(message); break; @@ -1086,56 +1028,6 @@ BApplication::Perform(perform_code d, void *arg) } -bool -BApplication::HasBeenRestored() -{ - return fHasBeenRestored != 0; -} - - -status_t -BApplication::RestoreState(const BMessage* state) -{ - int32 i = 0; - while (true) { - BMessage windowState; - if (state->FindMessage("window", i, &windowState) != B_OK) - break; - i++; - - BString title; - if (windowState.FindString("title", &title) != B_OK) - continue; - - for (int i = 0; i < CountWindows(); i++) { - BWindow* window = WindowAt(i); - if (title != window->Title()) - continue; - restore_window_geometry(window, &windowState); - } - } - - return B_OK; -} - - -status_t -BApplication::SaveState(BMessage* state) const -{ - // just store all window positions - for (int i = 0; i < CountWindows(); i++) { - BWindow* window = WindowAt(i); - - BMessage windowState; - save_window_geometry(window, &windowState); - windowState.AddString("title", window->Title()); - state->AddMessage("window", &windowState); - } - - return B_OK; -} - - void BApplication::_ReservedApplication1() {} void BApplication::_ReservedApplication2() {} void BApplication::_ReservedApplication3() {}