[haiku-webkit-commits] r341 - in webkit/trunk/WebKit/haiku: API WebPositive WebPositive/support

  • From: webkit@xxxxxxxxxxxxxxx
  • To: haiku-webkit-commits@xxxxxxxxxxxxx
  • Date: Tue, 23 Mar 2010 00:02:06 +0000

Author: stippi
Date: Tue Mar 23 00:02:05 2010
New Revision: 341
URL: http://mmlr.dyndns.org/changeset/341

Log:
Work in progress on better download management...
 * Allow to specify the downloads folder in the General settings page.
 * Added necessary wiring.
 * The listener notification was not synchronous anymore because of mixed
   up default function params in BWebPage.
 * Added temporary debug output to WebDownloadPrivate.cpp... the restarting
   downloads code path needs testing yet.

Modified:
   webkit/trunk/WebKit/haiku/API/WebDownload.cpp
   webkit/trunk/WebKit/haiku/API/WebDownload.h
   webkit/trunk/WebKit/haiku/API/WebDownloadPrivate.cpp
   webkit/trunk/WebKit/haiku/API/WebDownloadPrivate.h
   webkit/trunk/WebKit/haiku/API/WebPage.cpp
   webkit/trunk/WebKit/haiku/API/WebPage.h
   webkit/trunk/WebKit/haiku/WebPositive/BrowserApp.cpp
   webkit/trunk/WebKit/haiku/WebPositive/DownloadWindow.cpp
   webkit/trunk/WebKit/haiku/WebPositive/DownloadWindow.h
   webkit/trunk/WebKit/haiku/WebPositive/SettingsWindow.cpp
   webkit/trunk/WebKit/haiku/WebPositive/support/SettingsMessage.cpp
   webkit/trunk/WebKit/haiku/WebPositive/support/SettingsMessage.h

Modified: webkit/trunk/WebKit/haiku/API/WebDownload.cpp
==============================================================================
--- webkit/trunk/WebKit/haiku/API/WebDownload.cpp       Mon Mar 22 18:11:27 
2010        (r340)
+++ webkit/trunk/WebKit/haiku/API/WebDownload.cpp       Tue Mar 23 00:02:05 
2010        (r341)
@@ -58,9 +58,11 @@
        delete fData;
 }
 
-void BWebDownload::Start()
+void BWebDownload::Start(const BPath& path)
 {
-    fData->start();
+       // Does not matter which thread this is invoked in, as long as the
+       // rest of the code is blocking...
+    fData->start(path);
 }
 
 void BWebDownload::Cancel()

Modified: webkit/trunk/WebKit/haiku/API/WebDownload.h
==============================================================================
--- webkit/trunk/WebKit/haiku/API/WebDownload.h Mon Mar 22 18:11:27 2010        
(r340)
+++ webkit/trunk/WebKit/haiku/API/WebDownload.h Tue Mar 23 00:02:05 2010        
(r341)
@@ -41,6 +41,7 @@
 
 
 enum {
+       B_DOWNLOAD_STARTED = 'dwns',
     B_DOWNLOAD_PROGRESS = 'dwnp'
 };
 
@@ -55,7 +56,7 @@
 class BWebDownload : public BHandler {
 // TODO: Inherit from BReferenceable.
 public:
-                       void                            Start();
+                       void                            Start(const BPath& 
path);
                        void                            Cancel();
 
                        void                            
SetProgressListener(const BMessenger& listener);

Modified: webkit/trunk/WebKit/haiku/API/WebDownloadPrivate.cpp
==============================================================================
--- webkit/trunk/WebKit/haiku/API/WebDownloadPrivate.cpp        Mon Mar 22 
18:11:27 2010        (r340)
+++ webkit/trunk/WebKit/haiku/API/WebDownloadPrivate.cpp        Tue Mar 23 
00:02:05 2010        (r341)
@@ -48,12 +48,14 @@
     , m_resourceHandle(ResourceHandle::create(request, this, 0, false, false, 
false))
     , m_currentSize(0)
     , m_expectedSize(0)
-    , m_url()
+    , m_url(request.url().string())
     , m_path("/boot/home/Desktop/")
     , m_filename("Download")
+    , m_mimeType("application/octet-stream")
     , m_file()
     , m_lastProgressReportTime(0)
 {
+printf("%p->WebDownloadPrivate(const ResourceRequest& request)\n", this);
 }
 
 WebDownloadPrivate::WebDownloadPrivate(ResourceHandle* handle,
@@ -65,9 +67,11 @@
     , m_url()
     , m_path("/boot/home/Desktop/")
     , m_filename("Download")
+    , m_mimeType("application/octet-stream")
     , m_file()
     , m_lastProgressReportTime(0)
 {
+printf("%p->WebDownloadPrivate(ResourceHandle* handle)\n", this);
        m_resourceHandle->setClient(this);
        // Call the hook manually to figure out the details of the request
        didReceiveResponse(handle, response);
@@ -75,7 +79,7 @@
 
 void WebDownloadPrivate::didReceiveResponse(ResourceHandle*, const 
ResourceResponse& response)
 {
-       BString mimeType("application/octet-stream");
+printf("%p->WebDownloadPrivate::didReceiveResponse()\n", this);
     if (!response.isNull()) {
        if (!response.suggestedFilename().isEmpty())
             m_filename = response.suggestedFilename();
@@ -86,20 +90,18 @@
             m_filename = 
decodeURLEscapeSequences(url.lastPathComponent()).utf8().data();
         }
         if (response.mimeType().length())
-            mimeType = response.mimeType();
+            m_mimeType = response.mimeType();
         m_expectedSize = response.expectedContentLength();
     }
+
     m_url = response.url().string();
-    m_path.Append(m_filename.String());
-       if (m_file.SetTo(m_path.Path(), B_CREATE_FILE | B_ERASE_FILE | 
B_WRITE_ONLY) == B_OK) {
-               BNodeInfo info(&m_file);
-               info.SetType(mimeType.String());
-               m_file.WriteAttrString("META:url", &m_url);
-       }
 }
 
 void WebDownloadPrivate::didReceiveData(ResourceHandle*, const char* data, int 
length, int lengthReceived)
 {
+       if (m_file.InitCheck() != B_OK)
+               createFile();
+
     ssize_t bytesWritten = m_file.Write(data, length);
     if (bytesWritten != (ssize_t)length) {
         // FIXME: Report error
@@ -142,9 +144,11 @@
     m_webDownload = download;
 }
 
-void WebDownloadPrivate::start()
+void WebDownloadPrivate::start(const BPath& path)
 {
-       // FIXME, the download is already running, and we cannot begin it 
paused...
+printf("%p->Start(%s)\n", m_webDownload, path.Path());
+       if (path.InitCheck() == B_OK)
+               m_path = path;
 }
 
 void WebDownloadPrivate::cancel()
@@ -154,6 +158,7 @@
 
 void WebDownloadPrivate::setProgressListener(const BMessenger& listener)
 {
+printf("%p->setProgressListener()\n", this);
        m_progressListener = listener;
 }
 
@@ -172,5 +177,23 @@
        delete m_webDownload;
 }
 
+void WebDownloadPrivate::createFile()
+{
+printf("%p->createFile()\n", this);
+    m_path.Append(m_filename.String());
+       if (m_file.SetTo(m_path.Path(), B_CREATE_FILE | B_ERASE_FILE | 
B_WRITE_ONLY) == B_OK) {
+               BNodeInfo info(&m_file);
+               info.SetType(m_mimeType.String());
+               m_file.WriteAttrString("META:url", &m_url);
+       }
+
+    if (m_progressListener.IsValid()) {
+printf("  sending notification\n");
+        BMessage message(B_DOWNLOAD_STARTED);
+        message.AddString("path", m_path.Path());
+        m_progressListener.SendMessage(&message);
+    }
+}
+
 } // namespace BPrivate
 

Modified: webkit/trunk/WebKit/haiku/API/WebDownloadPrivate.h
==============================================================================
--- webkit/trunk/WebKit/haiku/API/WebDownloadPrivate.h  Mon Mar 22 18:11:27 
2010        (r340)
+++ webkit/trunk/WebKit/haiku/API/WebDownloadPrivate.h  Tue Mar 23 00:02:05 
2010        (r341)
@@ -67,7 +67,7 @@
     virtual void cannotShowURL(ResourceHandle*);
 
     void setDownload(BWebDownload*);
-    void start();
+    void start(const BPath& path);
     void cancel();
     void setProgressListener(const BMessenger&);
 
@@ -79,6 +79,7 @@
 
 private:
        void handleFinished(WebCore::ResourceHandle* handle, uint32 status);
+       void createFile();
 
 private:
     BWebDownload* m_webDownload;
@@ -90,6 +91,7 @@
     BString m_url;
     BPath m_path;
     BString m_filename;
+    BString m_mimeType;
     BFile m_file;
     bigtime_t m_lastProgressReportTime;
 

Modified: webkit/trunk/WebKit/haiku/API/WebPage.cpp
==============================================================================
--- webkit/trunk/WebKit/haiku/API/WebPage.cpp   Mon Mar 22 18:11:27 2010        
(r340)
+++ webkit/trunk/WebKit/haiku/API/WebPage.cpp   Tue Mar 23 00:02:05 2010        
(r341)
@@ -72,6 +72,7 @@
 
 #include <Bitmap.h>
 #include <Entry.h>
+#include <FindDirectory.h>
 #include <Font.h>
 #include <Message.h>
 #include <MessageQueue.h>
@@ -584,7 +585,6 @@
 /*static*/ void BWebPage::downloadCreated(BWebDownload* download,
        bool isAsynchronousRequest)
 {
-       download->Start();
        if (sDownloadListener.IsValid()) {
         BMessage message(B_DOWNLOAD_ADDED);
         message.AddPointer("download", download);
@@ -595,6 +595,10 @@
         } else {
                sDownloadListener.SendMessage(&message);
         }
+       } else {
+               BPath desktopPath;
+               find_directory(B_DESKTOP_DIRECTORY, &desktopPath);
+        download->Start(desktopPath);
        }
 }
 

Modified: webkit/trunk/WebKit/haiku/API/WebPage.h
==============================================================================
--- webkit/trunk/WebKit/haiku/API/WebPage.h     Mon Mar 22 18:11:27 2010        
(r340)
+++ webkit/trunk/WebKit/haiku/API/WebPage.h     Tue Mar 23 00:02:05 2010        
(r341)
@@ -169,11 +169,11 @@
        friend class BWebDownload;
 
        static void requestDownload(const WebCore::ResourceRequest& request,
-               bool isAsynchronousRequest = false);
+               bool isAsynchronousRequest = true);
        static void requestDownload(WebCore::ResourceHandle* handle,
                const WebCore::ResourceRequest& request,
                const WebCore::ResourceResponse& response,
-               bool isAsynchronousRequest = false);
+               bool isAsynchronousRequest = true);
        static void downloadCreated(BWebDownload* download,
                bool isAsynchronousRequest);
 

Modified: webkit/trunk/WebKit/haiku/WebPositive/BrowserApp.cpp
==============================================================================
--- webkit/trunk/WebKit/haiku/WebPositive/BrowserApp.cpp        Mon Mar 22 
18:11:27 2010        (r340)
+++ webkit/trunk/WebKit/haiku/WebPositive/BrowserApp.cpp        Tue Mar 23 
00:02:05 2010        (r341)
@@ -145,7 +145,8 @@
                BRect());
        bool showDownloads = fSettings->GetValue("show downloads", false);
 
-       fDownloadWindow = new DownloadWindow(downloadWindowFrame, 
showDownloads);
+       fDownloadWindow = new DownloadWindow(downloadWindowFrame, showDownloads,
+               fSettings);
        fSettingsWindow = new SettingsWindow(settingsWindowFrame, fSettings);
 
        BWebPage::SetDownloadListener(BMessenger(fDownloadWindow));

Modified: webkit/trunk/WebKit/haiku/WebPositive/DownloadWindow.cpp
==============================================================================
--- webkit/trunk/WebKit/haiku/WebPositive/DownloadWindow.cpp    Mon Mar 22 
18:11:27 2010        (r340)
+++ webkit/trunk/WebKit/haiku/WebPositive/DownloadWindow.cpp    Tue Mar 23 
00:02:05 2010        (r341)
@@ -48,6 +48,7 @@
 #include <StatusBar.h>
 
 #include "BrowserApp.h"
+#include "SettingsMessage.h"
 #include "WebDownload.h"
 #include "WebPage.h"
 
@@ -64,15 +65,13 @@
 
 class IconView : public BView {
 public:
-       IconView(const BEntry& entry)
+       IconView()
                :
                BView("Download icon", B_WILL_DRAW),
                fIconBitmap(BRect(0, 0, 31, 31), 0, B_RGBA32)
        {
-               BNode node(&entry);
-               BNodeInfo info(&node);
-               info.GetTrackerIcon(&fIconBitmap, B_LARGE_ICON);
                SetDrawingMode(B_OP_OVER);
+               memset(fIconBitmap.Bits(), 0, fIconBitmap.BitsLength());
        }
 
        IconView(BMessage* archive)
@@ -83,6 +82,14 @@
                SetDrawingMode(B_OP_OVER);
        }
 
+       void SetTo(const BEntry& entry)
+       {
+               BNode node(&entry);
+               BNodeInfo info(&node);
+               info.GetTrackerIcon(&fIconBitmap, B_LARGE_ICON);
+               Invalidate();
+       }
+
        status_t SaveSettings(BMessage* archive)
        {
                return fIconBitmap.Archive(archive);
@@ -162,27 +169,24 @@
 
        bool Init(BMessage* archive = NULL)
        {
-               BEntry entry(fPath.Path());
-               if (!entry.Exists() && !archive)
-                       return false;
-
                SetViewColor(245, 245, 245);
                SetFlags(Flags() | B_FULL_UPDATE_ON_RESIZE | B_WILL_DRAW);
 
                BGridLayout* layout = GridLayout();
-               fStatusBar = new BStatusBar("download progress", fPath.Leaf());
-               fStatusBar->SetMaxValue(100);
                if (archive) {
+                       fStatusBar = new BStatusBar("download progress", 
fPath.Leaf());
                        float value;
                        if (archive->FindFloat("value", &value) == B_OK)
                                fStatusBar->SetTo(value);
-               }
+               } else
+                       fStatusBar = new BStatusBar("download progress", 
"Download");
+               fStatusBar->SetMaxValue(100);
                fStatusBar->SetBarHeight(12);
 
-               if (entry.Exists())
-                       fIconView = new IconView(entry);
-               else
+               if (archive)
                        fIconView = new IconView(archive);
+               else
+                       fIconView = new IconView();
 
                if (!fDownload && fStatusBar->CurrentValue() < 100)
                        fTopButton = new SmallButton("Restart", new 
BMessage(RESTART_DOWNLOAD));
@@ -247,6 +251,17 @@
        virtual void MessageReceived(BMessage* message)
        {
                switch (message->what) {
+                       case B_DOWNLOAD_STARTED: {
+                               BString path;
+                               if (message->FindString("path", &path) != B_OK)
+                                       break;
+                               fPath.SetTo(path);
+                               BEntry entry(fPath.Path());
+                               fIconView->SetTo(entry);
+printf("B_DOWNLOAD_STARTED: %s\n", fPath.Leaf());
+                               fStatusBar->Reset(fPath.Leaf());
+                               break;
+                       };
                        case B_DOWNLOAD_PROGRESS: {
                                float progress;
                                if (message->FindFloat("progress", &progress) 
== B_OK)
@@ -391,11 +406,22 @@
 };
 
 
-DownloadWindow::DownloadWindow(BRect frame, bool visible)
+// #pragma mark -
+
+
+DownloadWindow::DownloadWindow(BRect frame, bool visible,
+               SettingsMessage* settings)
        : BWindow(frame, "Downloads",
                B_TITLED_WINDOW_LOOK, B_NORMAL_WINDOW_FEEL,
                B_AUTO_UPDATE_SIZE_LIMITS | B_ASYNCHRONOUS_CONTROLS | 
B_NOT_ZOOMABLE)
 {
+       settings->AddListener(BMessenger(this));
+       BPath downloadPath;
+       if (find_directory(B_DESKTOP_DIRECTORY, &downloadPath) != B_OK)
+               downloadPath.SetTo("/boot/home/Desktop");
+       fDownloadPath = settings->GetValue("download path", 
downloadPath.Path());
+       settings->SetValue("download path", fDownloadPath);
+
        SetLayout(new BGroupLayout(B_VERTICAL));
 
        DownloadsContainerView* downloadsGroupView = new 
DownloadsContainerView();
@@ -445,7 +471,8 @@
 DownloadWindow::MessageReceived(BMessage* message)
 {
        switch (message->what) {
-               case B_DOWNLOAD_ADDED: {
+               case B_DOWNLOAD_ADDED:
+               {
                        BWebDownload* download;
                        if (message->FindPointer("download", 
reinterpret_cast<void**>(
                                        &download)) == B_OK) {
@@ -453,7 +480,8 @@
                        }
                        break;
                }
-               case B_DOWNLOAD_REMOVED: {
+               case B_DOWNLOAD_REMOVED:
+               {
                        BWebDownload* download;
                        if (message->FindPointer("download", 
reinterpret_cast<void**>(
                                        &download)) == B_OK) {
@@ -467,6 +495,17 @@
                case SAVE_SETTINGS:
                        _SaveSettings();
                        break;
+
+               case SETTINGS_VALUE_CHANGED:
+               {
+                       BString string;
+                       if (message->FindString("name", &string) == B_OK 
+                               && string == "download path"
+                               && message->FindString("value", &string) == 
B_OK) {
+                               fDownloadPath = string;
+                       }
+                       break;
+               }
                default:
                        BWindow::MessageReceived(message);
                        break;
@@ -486,6 +525,8 @@
 void
 DownloadWindow::_DownloadStarted(BWebDownload* download)
 {
+       download->Start(BPath(fDownloadPath.String()));
+
        int32 finishedCount = 0;
        int32 index = 0;
        for (int32 i = fDownloadViewsLayout->CountItems() - 1;

Modified: webkit/trunk/WebKit/haiku/WebPositive/DownloadWindow.h
==============================================================================
--- webkit/trunk/WebKit/haiku/WebPositive/DownloadWindow.h      Mon Mar 22 
18:11:27 2010        (r340)
+++ webkit/trunk/WebKit/haiku/WebPositive/DownloadWindow.h      Tue Mar 23 
00:02:05 2010        (r341)
@@ -28,17 +28,20 @@
 #define DOWNLOAD_WINDOW_H
 
 
+#include <String.h>
 #include <Window.h>
 
 class BButton;
 class BFile;
 class BGroupLayout;
 class BWebDownload;
+class SettingsMessage;
 
 
 class DownloadWindow : public BWindow {
 public:
-                                                               
DownloadWindow(BRect frame, bool visible);
+                                                               
DownloadWindow(BRect frame, bool visible,
+                                                                       
SettingsMessage* settings);
        virtual                                         ~DownloadWindow();
 
        virtual void                            MessageReceived(BMessage* 
message);
@@ -55,6 +58,7 @@
 private:
                        BGroupLayout*           fDownloadViewsLayout;
                        BButton*                        fRemoveFinishedButton;
+                       BString                         fDownloadPath;
 };
 
 #endif // DOWNLOAD_WINDOW_H

Modified: webkit/trunk/WebKit/haiku/WebPositive/SettingsWindow.cpp
==============================================================================
--- webkit/trunk/WebKit/haiku/WebPositive/SettingsWindow.cpp    Mon Mar 22 
18:11:27 2010        (r340)
+++ webkit/trunk/WebKit/haiku/WebPositive/SettingsWindow.cpp    Tue Mar 23 
00:02:05 2010        (r341)
@@ -202,7 +202,7 @@
 {
        fDownloadFolderControl = new BTextControl("download folder",
                TR("Download folder:"), "", new 
BMessage(MSG_DOWNLOAD_FOLDER_CHANGED));
-fDownloadFolderControl->SetEnabled(false);
+       fDownloadFolderControl->SetText(fSettings->GetValue("download path", 
""));
 
        fNewPageBehaviorCloneCurrentItem = new BMenuItem(TR("Clone current 
page"),
                NULL);
@@ -312,7 +312,20 @@
 void
 SettingsWindow::_ApplySettings()
 {
-       // Store settings
+       // Store general settings
+       int32 maxHistoryAge = atoi(fDaysInGoMenuControl->Text());
+       if (maxHistoryAge <= 0)
+               maxHistoryAge = 1;
+       if (maxHistoryAge >= 35)
+               maxHistoryAge = 35;
+       BString text;
+       text << maxHistoryAge;
+       fDaysInGoMenuControl->SetText(text.String());
+       BrowsingHistory::DefaultInstance()->SetMaxHistoryItemAge(maxHistoryAge);
+
+       fSettings->SetValue("download path", fDownloadFolderControl->Text());
+
+       // Store fond settings
        fSettings->SetValue("standard font", fStandardFontView->Font());
        fSettings->SetValue("serif font", fSerifFontView->Font());
        fSettings->SetValue("sans serif font", fSansSerifFontView->Font());
@@ -335,16 +348,6 @@
        // This will find all currently instantiated page settings and apply
        // the default values, unless the page settings have local overrides.
        BWebSettings::Default()->Apply();
-
-       int32 maxHistoryAge = atoi(fDaysInGoMenuControl->Text());
-       if (maxHistoryAge <= 0)
-               maxHistoryAge = 1;
-       if (maxHistoryAge >= 35)
-               maxHistoryAge = 35;
-       BString text;
-       text << maxHistoryAge;
-       fDaysInGoMenuControl->SetText(text.String());
-       BrowsingHistory::DefaultInstance()->SetMaxHistoryItemAge(maxHistoryAge);
 }
 
 

Modified: webkit/trunk/WebKit/haiku/WebPositive/support/SettingsMessage.cpp
==============================================================================
--- webkit/trunk/WebKit/haiku/WebPositive/support/SettingsMessage.cpp   Mon Mar 
22 18:11:27 2010        (r340)
+++ webkit/trunk/WebKit/haiku/WebPositive/support/SettingsMessage.cpp   Tue Mar 
23 00:02:05 2010        (r341)
@@ -11,6 +11,7 @@
 
 #include <new>
 
+#include <Autolock.h>
 #include <Entry.h>
 #include <File.h>
 #include <Messenger.h>
@@ -52,6 +53,8 @@
 status_t
 SettingsMessage::Load()
 {
+       BAutolock _(this);
+
        BFile file(fPath.Path(), B_READ_ONLY);
        status_t status = file.InitCheck();
 
@@ -65,6 +68,8 @@
 status_t
 SettingsMessage::Save() const
 {
+       BAutolock _(const_cast<SettingsMessage*>(this));
+
        BFile file(fPath.Path(), B_WRITE_ONLY | B_CREATE_FILE | B_ERASE_FILE);
        status_t status = file.InitCheck();
 
@@ -78,6 +83,8 @@
 bool
 SettingsMessage::AddListener(const BMessenger& listener)
 {
+       BAutolock _(this);
+
        BMessenger* listenerCopy = new(std::nothrow) BMessenger(listener);
        if (listenerCopy && fListeners.AddItem(listenerCopy))
                return true;
@@ -89,6 +96,8 @@
 void
 SettingsMessage::RemoveListener(const BMessenger& listener)
 {
+       BAutolock _(this);
+
        for (int32 i = fListeners.CountItems() - 1; i >= 0; i--) {
                BMessenger* listenerItem = reinterpret_cast<BMessenger*>(
                        fListeners.ItemAtFast(i));
@@ -401,6 +410,16 @@
 }
 
 
+const char*
+SettingsMessage::GetValue(const char* name, const char* defaultValue) const
+{
+       const char* value;
+       if (FindString(name, &value) != B_OK)
+               return defaultValue;
+       return value;
+}
+
+
 BPoint
 SettingsMessage::GetValue(const char *name, BPoint defaultValue) const
 {
@@ -473,7 +492,7 @@
 void
 SettingsMessage::_NotifyValueChanged(const char* name) const
 {
-       BMessage message(MSG_SETTINGS_VALUE_CHANGED);
+       BMessage message(SETTINGS_VALUE_CHANGED);
        message.AddString("name", name);
 
        // Add the value of that name to the notification.

Modified: webkit/trunk/WebKit/haiku/WebPositive/support/SettingsMessage.h
==============================================================================
--- webkit/trunk/WebKit/haiku/WebPositive/support/SettingsMessage.h     Mon Mar 
22 18:11:27 2010        (r340)
+++ webkit/trunk/WebKit/haiku/WebPositive/support/SettingsMessage.h     Tue Mar 
23 00:02:05 2010        (r341)
@@ -11,6 +11,7 @@
 #include <FindDirectory.h>
 #include <Font.h>
 #include <List.h>
+#include <Locker.h>
 #include <Message.h>
 #include <Path.h>
 
@@ -19,11 +20,11 @@
 
 
 enum {
-       MSG_SETTINGS_VALUE_CHANGED = 'stvc'
+       SETTINGS_VALUE_CHANGED = '_svc'
 };
 
 
-class SettingsMessage : public BMessage {
+class SettingsMessage : public BMessage, public BLocker {
 public:
                                                                
SettingsMessage(directory_which directory,
                                                                        const 
char* filename);
@@ -49,9 +50,11 @@
                                                                        const 
char* value);
                        status_t                        SetValue(const char* 
name,
                                                                        const 
BString& value);
-                       status_t                        SetValue(const char 
*name, const BPoint& value);
+                       status_t                        SetValue(const char 
*name,
+                                                                       const 
BPoint& value);
                        status_t                        SetValue(const char* 
name, const BRect& value);
-                       status_t                        SetValue(const char* 
name, const entry_ref& value);
+                       status_t                        SetValue(const char* 
name,
+                                                                       const 
entry_ref& value);
                        status_t                        SetValue(const char* 
name,
                                                                        const 
BMessage& value);
                        status_t                        SetValue(const char* 
name,
@@ -75,6 +78,8 @@
                                                                        float 
defaultValue) const;
                        double                          GetValue(const char* 
name,
                                                                        double 
defaultValue) const;
+                       const char*                     GetValue(const char* 
name,
+                                                                       const 
char* defaultValue) const;
                        BString                         GetValue(const char* 
name,
                                                                        const 
BString& defaultValue) const;
                        BPoint                          GetValue(const char 
*name,

Other related posts:

  • » [haiku-webkit-commits] r341 - in webkit/trunk/WebKit/haiku: API WebPositive WebPositive/support - webkit