[haiku-commits] r39469 - in haiku/trunk: headers/os/app headers/private/app src/kits/app

  • From: clemens.zeidler@xxxxxxxxxxxxxx
  • To: haiku-commits@xxxxxxxxxxxxx
  • Date: Wed, 17 Nov 2010 23:19:09 +0100 (CET)

Author: czeidler
Date: 2010-11-17 23:19:09 +0100 (Wed, 17 Nov 2010)
New Revision: 39469
Changeset: http://dev.haiku-os.org/changeset/39469

Modified:
   haiku/trunk/headers/os/app/Application.h
   haiku/trunk/headers/private/app/ApplicationPrivate.h
   haiku/trunk/src/kits/app/Application.cpp
Log:
Revert r39462 because it was not really binary compatible.



Modified: haiku/trunk/headers/os/app/Application.h
===================================================================
--- haiku/trunk/headers/os/app/Application.h    2010-11-17 22:10:51 UTC (rev 
39468)
+++ haiku/trunk/headers/os/app/Application.h    2010-11-17 22:19:09 UTC (rev 
39469)
@@ -29,10 +29,6 @@
 }
 
 
-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 @@
 
        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 @@
                        BMessageRunner*         fPulseRunner;
                        status_t                        fInitError;
                        void*                           fServerReadOnlyMemory;
-                       uint32                          _reserved[11];
+                       uint32                          _reserved[12];
 
-                       uint32                          fHasBeenRestored;
                        bool                            fReadyToRunCalled;
 };
 

Modified: haiku/trunk/headers/private/app/ApplicationPrivate.h
===================================================================
--- haiku/trunk/headers/private/app/ApplicationPrivate.h        2010-11-17 
22:10:51 UTC (rev 39468)
+++ haiku/trunk/headers/private/app/ApplicationPrivate.h        2010-11-17 
22:19:09 UTC (rev 39469)
@@ -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()

Modified: haiku/trunk/src/kits/app/Application.cpp
===================================================================
--- haiku/trunk/src/kits/app/Application.cpp    2010-11-17 22:10:51 UTC (rev 
39468)
+++ haiku/trunk/src/kits/app/Application.cpp    2010-11-17 22:19:09 UTC (rev 
39469)
@@ -31,8 +31,6 @@
 #include <RegistrarDefs.h>
 #include <Resources.h>
 #include <Roster.h>
-#include <Screen.h>
-#include <String.h>
 #include <Window.h>
 
 #include <AppMisc.h>
@@ -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 @@
        fServerAllocator = NULL;
        fInitialWorkspace = 0;
        //fDraggedMessage = NULL;
-       fHasBeenRestored = 0;
        fReadyToRunCalled = false;
 
        // initially, there is no pulse
@@ -615,9 +572,7 @@
        // supposed to be implemented by subclasses
 }
 
-#include "ApplicationPrivate.h"
 
-
 void
 BApplication::MessageReceived(BMessage *message)
 {
@@ -642,19 +597,6 @@
                        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 @@
 }
 
 
-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() {}


Other related posts:

  • » [haiku-commits] r39469 - in haiku/trunk: headers/os/app headers/private/app src/kits/app - clemens . zeidler