DriveSetup:
- File system is now only displayed when the partition actually has a filesystem. - Now checks if the DiskSystem supports initializing. - Updated the *ParamsPanels, as well as, the Disk System add-ons to use the new storage api changes (see below). Storage Kit: - Simplified the parameters editor system. Now all parameter editor requests go through a single function, GetParameterEditor, and pass a B_PARAMETER_EDITOR_TYPE to request a particular parameter editor. - Moved DiskDeviceAddOnManager.h to the headers directory, as it is now required by InitParamsPanel. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@39115 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
#ifndef _DISK_SYSTEM_ADD_ON_H
|
||||
#define _DISK_SYSTEM_ADD_ON_H
|
||||
|
||||
#include <DiskDeviceDefs.h>
|
||||
#include <String.h>
|
||||
#include <SupportDefs.h>
|
||||
|
||||
@@ -31,9 +32,6 @@ public:
|
||||
|
||||
virtual bool CanInitialize(
|
||||
const BMutablePartition* partition);
|
||||
virtual status_t GetInitializationParameterEditor(
|
||||
const BMutablePartition* partition,
|
||||
BPartitionParameterEditor** editor);
|
||||
virtual status_t ValidateInitialize(
|
||||
const BMutablePartition* partition,
|
||||
BString* name, const char* parameters);
|
||||
@@ -41,6 +39,9 @@ public:
|
||||
const char* name, const char* parameters,
|
||||
BPartitionHandle** handle);
|
||||
|
||||
virtual status_t GetParameterEditor(
|
||||
B_PARAMETER_EDITOR_TYPE type,
|
||||
BPartitionParameterEditor** editor);
|
||||
virtual status_t GetTypeForContentType(const char* contentType,
|
||||
BString* type);
|
||||
virtual bool IsSubSystemFor(const BMutablePartition* child);
|
||||
@@ -108,9 +109,7 @@ public:
|
||||
|
||||
virtual status_t GetContentParameterEditor(
|
||||
BPartitionParameterEditor** editor);
|
||||
virtual status_t GetParameterEditor(
|
||||
const BMutablePartition* child,
|
||||
BPartitionParameterEditor** editor);
|
||||
|
||||
virtual status_t ValidateSetContentParameters(
|
||||
const char* parameters);
|
||||
virtual status_t ValidateSetParameters(
|
||||
@@ -120,8 +119,8 @@ public:
|
||||
virtual status_t SetParameters(BMutablePartition* child,
|
||||
const char* parameters);
|
||||
|
||||
virtual status_t GetChildCreationParameterEditor(
|
||||
const char* type,
|
||||
virtual status_t GetParameterEditor(
|
||||
B_PARAMETER_EDITOR_TYPE type,
|
||||
BPartitionParameterEditor** editor);
|
||||
virtual status_t ValidateCreateChild(off_t* offset,
|
||||
off_t* size, const char* type,
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
/*
|
||||
* Copyright 2007, Ingo Weinhold, bonefish@users.sf.net.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*/
|
||||
#ifndef _DISK_SYSTEM_ADD_ON_MANAGER_H
|
||||
#define _DISK_SYSTEM_ADD_ON_MANAGER_H
|
||||
|
||||
#include <FindDirectory.h>
|
||||
#include <List.h>
|
||||
#include <Locker.h>
|
||||
|
||||
|
||||
class BDiskSystemAddOn;
|
||||
|
||||
|
||||
namespace BPrivate {
|
||||
|
||||
|
||||
class DiskSystemAddOnManager {
|
||||
public:
|
||||
static DiskSystemAddOnManager* Default();
|
||||
|
||||
bool Lock();
|
||||
void Unlock();
|
||||
|
||||
// load/unload all disk system add-ons
|
||||
status_t LoadDiskSystems();
|
||||
void UnloadDiskSystems();
|
||||
|
||||
// manager must be locked
|
||||
int32 CountAddOns() const;
|
||||
BDiskSystemAddOn* AddOnAt(int32 index) const;
|
||||
|
||||
// manager will be locked
|
||||
BDiskSystemAddOn* GetAddOn(const char* name);
|
||||
void PutAddOn(BDiskSystemAddOn* addOn);
|
||||
|
||||
private:
|
||||
struct AddOnImage;
|
||||
struct AddOn;
|
||||
struct StringSet;
|
||||
|
||||
DiskSystemAddOnManager();
|
||||
|
||||
static void _InitSingleton();
|
||||
|
||||
AddOn* _AddOnAt(int32 index) const;
|
||||
void _PutAddOn(int32 index);
|
||||
|
||||
status_t _LoadAddOns(StringSet& alreadyLoaded,
|
||||
directory_which directory);
|
||||
|
||||
private:
|
||||
mutable BLocker fLock;
|
||||
BList fAddOns;
|
||||
BList fAddOnsToBeUnloaded;
|
||||
int32 fLoadCount;
|
||||
|
||||
static DiskSystemAddOnManager* sManager;
|
||||
};
|
||||
|
||||
|
||||
} // namespace BPrivate
|
||||
|
||||
using BPrivate::DiskSystemAddOnManager;
|
||||
|
||||
#endif // _DISK_SYSTEM_ADD_ON_MANAGER_H
|
||||
@@ -3,6 +3,7 @@
|
||||
* Copyright 2003, Tyler Akidau, haiku@akidau.net.
|
||||
* Distributed under the terms of the MIT License.
|
||||
*/
|
||||
|
||||
#ifndef _PARTITION_H
|
||||
#define _PARTITION_H
|
||||
|
||||
@@ -129,13 +130,12 @@ public:
|
||||
|
||||
bool CanEditParameters() const;
|
||||
status_t GetParameterEditor(
|
||||
B_PARAMETER_EDITOR_TYPE type,
|
||||
BPartitionParameterEditor** editor);
|
||||
status_t SetParameters(const char* parameters);
|
||||
|
||||
bool CanEditContentParameters(
|
||||
bool* whileMounted = NULL) const;
|
||||
status_t GetContentParameterEditor(
|
||||
BPartitionParameterEditor** editor);
|
||||
status_t SetContentParameters(const char* parameters);
|
||||
|
||||
status_t GetNextSupportedType(int32 *cookie,
|
||||
@@ -151,9 +151,6 @@ public:
|
||||
bool IsSubSystem(const char* diskSystem) const;
|
||||
|
||||
bool CanInitialize(const char* diskSystem) const;
|
||||
status_t GetInitializationParameterEditor(
|
||||
const char* system,
|
||||
BPartitionParameterEditor** editor) const;
|
||||
status_t ValidateInitialize(const char* diskSystem,
|
||||
BString* name, const char* parameters);
|
||||
status_t Initialize(const char* diskSystem,
|
||||
@@ -163,9 +160,6 @@ public:
|
||||
// Modification of child partitions
|
||||
|
||||
bool CanCreateChild() const;
|
||||
status_t GetChildCreationParameterEditor(
|
||||
const char* type,
|
||||
BPartitionParameterEditor** editor) const;
|
||||
status_t ValidateCreateChild(off_t* start, off_t* size,
|
||||
const char* type, BString* name,
|
||||
const char* parameters) const;
|
||||
|
||||
Reference in New Issue
Block a user