Debugger: Split into core library and application.
- Add subfolder src/kits/debugger which contains the debugger's core functionality and lower layers. Correspondingly add headers/private/debugger for shared headers to be used by clients such as the Debugger application and eventual remote_debug_server. Adjust various files to account for differences as a result of the split and moves. - Add libdebugger.so to minimal Jamfile.
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
/*
|
||||
* Copyright 2009, Ingo Weinhold, [email protected].
|
||||
* Copyright 2016, Rene Gollent, [email protected].
|
||||
* Distributed under the terms of the MIT License.
|
||||
*/
|
||||
#ifndef SETTINGS_MANAGER_H
|
||||
#define SETTINGS_MANAGER_H
|
||||
|
||||
|
||||
#include <SupportDefs.h>
|
||||
|
||||
|
||||
class TeamSettings;
|
||||
|
||||
|
||||
class SettingsManager {
|
||||
public:
|
||||
virtual ~SettingsManager();
|
||||
|
||||
virtual status_t LoadTeamSettings(const char* teamName,
|
||||
TeamSettings& settings) = 0;
|
||||
virtual status_t SaveTeamSettings(const TeamSettings& settings)
|
||||
= 0;
|
||||
};
|
||||
|
||||
|
||||
#endif // SETTINGS_MANAGER_H
|
||||
@@ -0,0 +1,75 @@
|
||||
/*
|
||||
* Copyright 2009, Ingo Weinhold, [email protected].
|
||||
* Copyright 2013-2015, Rene Gollent, [email protected].
|
||||
* Distributed under the terms of the MIT License.
|
||||
*/
|
||||
#ifndef TEAM_SETTINGS_H
|
||||
#define TEAM_SETTINGS_H
|
||||
|
||||
|
||||
#include <String.h>
|
||||
|
||||
#include <ObjectList.h>
|
||||
|
||||
|
||||
class BMessage;
|
||||
class BreakpointSetting;
|
||||
class Team;
|
||||
class TeamFileManagerSettings;
|
||||
class TeamSignalSettings;
|
||||
class TeamUiSettings;
|
||||
class TeamUiSettingsFactory;
|
||||
|
||||
|
||||
class TeamSettings {
|
||||
public:
|
||||
TeamSettings();
|
||||
TeamSettings(const TeamSettings& other);
|
||||
// throws std::bad_alloc
|
||||
~TeamSettings();
|
||||
|
||||
status_t SetTo(Team* team);
|
||||
status_t SetTo(const BMessage& archive,
|
||||
const TeamUiSettingsFactory& factory);
|
||||
status_t WriteTo(BMessage& archive) const;
|
||||
|
||||
const BString& TeamName() const { return fTeamName; }
|
||||
|
||||
int32 CountBreakpoints() const;
|
||||
const BreakpointSetting* BreakpointAt(int32 index) const;
|
||||
|
||||
int32 CountUiSettings() const;
|
||||
const TeamUiSettings* UiSettingAt(int32 index) const;
|
||||
const TeamUiSettings* UiSettingFor(const char* id) const;
|
||||
status_t AddUiSettings(TeamUiSettings* settings);
|
||||
|
||||
TeamSettings& operator=(const TeamSettings& other);
|
||||
// throws std::bad_alloc
|
||||
|
||||
TeamFileManagerSettings*
|
||||
FileManagerSettings() const;
|
||||
status_t SetFileManagerSettings(
|
||||
TeamFileManagerSettings* settings);
|
||||
|
||||
TeamSignalSettings* SignalSettings() const;
|
||||
status_t SetSignalSettings(
|
||||
TeamSignalSettings* settings);
|
||||
|
||||
private:
|
||||
typedef BObjectList<BreakpointSetting> BreakpointList;
|
||||
typedef BObjectList<TeamUiSettings> UiSettingsList;
|
||||
|
||||
private:
|
||||
void _Unset();
|
||||
|
||||
private:
|
||||
BreakpointList fBreakpoints;
|
||||
UiSettingsList fUiSettings;
|
||||
TeamFileManagerSettings*
|
||||
fFileManagerSettings;
|
||||
TeamSignalSettings* fSignalSettings;
|
||||
BString fTeamName;
|
||||
};
|
||||
|
||||
|
||||
#endif // TEAM_SETTINGS_H
|
||||
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
* Copyright 2011, Rene Gollent, [email protected].
|
||||
* Distributed under the terms of the MIT License.
|
||||
*/
|
||||
#ifndef TEAM_UI_SETTINGS_H
|
||||
#define TEAM_UI_SETTINGS_H
|
||||
|
||||
|
||||
#include <String.h>
|
||||
|
||||
|
||||
class BMessage;
|
||||
|
||||
|
||||
enum team_ui_settings_type {
|
||||
TEAM_UI_SETTINGS_TYPE_GUI,
|
||||
TEAM_UI_SETTINGS_TYPE_CLI
|
||||
};
|
||||
|
||||
|
||||
class TeamUiSettings {
|
||||
public:
|
||||
TeamUiSettings();
|
||||
virtual ~TeamUiSettings();
|
||||
|
||||
virtual team_ui_settings_type Type() const = 0;
|
||||
virtual const char* ID() const = 0;
|
||||
virtual status_t SetTo(const BMessage& archive) = 0;
|
||||
virtual status_t WriteTo(BMessage& archive) const = 0;
|
||||
|
||||
virtual TeamUiSettings* Clone() const = 0;
|
||||
// throws std::bad_alloc
|
||||
|
||||
};
|
||||
|
||||
|
||||
#endif // TEAM_UI_SETTINGS_H
|
||||
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
* Copyright 2011, Rene Gollent, [email protected].
|
||||
* Distributed under the terms of the MIT License.
|
||||
*/
|
||||
#ifndef TEAM_UI_SETTINGS_FACTORY_H
|
||||
#define TEAM_UI_SETTINGS_FACTORY_H
|
||||
|
||||
|
||||
#include <SupportDefs.h>
|
||||
|
||||
|
||||
class BMessage;
|
||||
class TeamUiSettings;
|
||||
|
||||
class TeamUiSettingsFactory {
|
||||
public:
|
||||
virtual ~TeamUiSettingsFactory();
|
||||
|
||||
virtual status_t Create(const BMessage& archive,
|
||||
TeamUiSettings*& settings) const = 0;
|
||||
};
|
||||
|
||||
#endif // TEAM_UI_SETTINGS_FACTORY_H
|
||||
@@ -0,0 +1,233 @@
|
||||
/*
|
||||
* Copyright 2009, Ingo Weinhold, [email protected].
|
||||
* Copyright 2011-2013, Rene Gollent, [email protected].
|
||||
* Distributed under the terms of the MIT License.
|
||||
*/
|
||||
#ifndef SETTING_H
|
||||
#define SETTING_H
|
||||
|
||||
|
||||
#include <String.h>
|
||||
|
||||
#include <ObjectList.h>
|
||||
#include <Referenceable.h>
|
||||
#include <Variant.h>
|
||||
|
||||
|
||||
enum setting_type {
|
||||
SETTING_TYPE_BOOL,
|
||||
SETTING_TYPE_FLOAT,
|
||||
SETTING_TYPE_OPTIONS,
|
||||
SETTING_TYPE_BOUNDED,
|
||||
SETTING_TYPE_RANGE,
|
||||
SETTING_TYPE_RECT
|
||||
};
|
||||
|
||||
|
||||
class Setting : public BReferenceable {
|
||||
public:
|
||||
virtual ~Setting();
|
||||
|
||||
virtual setting_type Type() const = 0;
|
||||
virtual const char* ID() const = 0;
|
||||
virtual const char* Name() const = 0;
|
||||
|
||||
virtual BVariant DefaultValue() const = 0;
|
||||
};
|
||||
|
||||
|
||||
class BoolSetting : public virtual Setting {
|
||||
public:
|
||||
virtual setting_type Type() const;
|
||||
|
||||
virtual BVariant DefaultValue() const;
|
||||
|
||||
virtual bool DefaultBoolValue() const = 0;
|
||||
};
|
||||
|
||||
|
||||
class FloatSetting : public virtual Setting {
|
||||
public:
|
||||
virtual setting_type Type() const;
|
||||
|
||||
virtual BVariant DefaultValue() const;
|
||||
|
||||
virtual float DefaultFloatValue() const = 0;
|
||||
};
|
||||
|
||||
|
||||
class SettingsOption : public BReferenceable {
|
||||
public:
|
||||
virtual ~SettingsOption();
|
||||
|
||||
virtual const char* ID() const = 0;
|
||||
virtual const char* Name() const = 0;
|
||||
};
|
||||
|
||||
|
||||
class OptionsSetting : public virtual Setting {
|
||||
public:
|
||||
virtual setting_type Type() const;
|
||||
|
||||
virtual BVariant DefaultValue() const;
|
||||
|
||||
virtual int32 CountOptions() const = 0;
|
||||
virtual SettingsOption* OptionAt(int32 index) const = 0;
|
||||
virtual SettingsOption* OptionByID(const char* id) const = 0;
|
||||
|
||||
virtual SettingsOption* DefaultOption() const = 0;
|
||||
};
|
||||
|
||||
|
||||
class BoundedSetting : public virtual Setting {
|
||||
public:
|
||||
virtual setting_type Type() const;
|
||||
|
||||
virtual BVariant LowerBound() const = 0;
|
||||
virtual BVariant UpperBound() const = 0;
|
||||
};
|
||||
|
||||
|
||||
class RangeSetting : public virtual BoundedSetting {
|
||||
virtual setting_type Type() const;
|
||||
|
||||
virtual BVariant LowerValue() const = 0;
|
||||
virtual BVariant UpperValue() const = 0;
|
||||
};
|
||||
|
||||
|
||||
class RectSetting : public virtual Setting {
|
||||
public:
|
||||
virtual setting_type Type() const;
|
||||
|
||||
virtual BVariant DefaultValue() const;
|
||||
|
||||
virtual BRect DefaultRectValue() const = 0;
|
||||
};
|
||||
|
||||
|
||||
class AbstractSetting : public virtual Setting {
|
||||
public:
|
||||
AbstractSetting(const BString& id,
|
||||
const BString& name);
|
||||
|
||||
virtual const char* ID() const;
|
||||
virtual const char* Name() const;
|
||||
|
||||
private:
|
||||
BString fID;
|
||||
BString fName;
|
||||
};
|
||||
|
||||
|
||||
class BoolSettingImpl : public AbstractSetting, public BoolSetting {
|
||||
public:
|
||||
BoolSettingImpl(const BString& id,
|
||||
const BString& name, bool defaultValue);
|
||||
|
||||
virtual bool DefaultBoolValue() const;
|
||||
|
||||
private:
|
||||
bool fDefaultValue;
|
||||
};
|
||||
|
||||
|
||||
class FloatSettingImpl : public AbstractSetting, public FloatSetting {
|
||||
public:
|
||||
FloatSettingImpl(const BString& id,
|
||||
const BString& name, float defaultValue);
|
||||
|
||||
virtual float DefaultFloatValue() const;
|
||||
|
||||
private:
|
||||
float fDefaultValue;
|
||||
};
|
||||
|
||||
|
||||
class OptionsSettingImpl : public AbstractSetting, public OptionsSetting {
|
||||
public:
|
||||
OptionsSettingImpl(const BString& id,
|
||||
const BString& name);
|
||||
virtual ~OptionsSettingImpl();
|
||||
|
||||
virtual SettingsOption* DefaultOption() const;
|
||||
|
||||
virtual int32 CountOptions() const;
|
||||
virtual SettingsOption* OptionAt(int32 index) const;
|
||||
virtual SettingsOption* OptionByID(const char* id) const;
|
||||
|
||||
bool AddOption(SettingsOption* option);
|
||||
bool AddOption(const BString& id,
|
||||
const BString& name);
|
||||
|
||||
void SetDefaultOption(SettingsOption* option);
|
||||
|
||||
private:
|
||||
class Option;
|
||||
|
||||
typedef BObjectList<SettingsOption> OptionList;
|
||||
|
||||
private:
|
||||
OptionList fOptions;
|
||||
SettingsOption* fDefaultOption;
|
||||
};
|
||||
|
||||
|
||||
class BoundedSettingImpl : public AbstractSetting, public BoundedSetting {
|
||||
public:
|
||||
BoundedSettingImpl(const BString& id,
|
||||
const BString& name,
|
||||
const BVariant& lowerBound,
|
||||
const BVariant& upperBound,
|
||||
const BVariant& defaultValue);
|
||||
|
||||
virtual BVariant DefaultValue() const;
|
||||
|
||||
virtual BVariant LowerBound() const;
|
||||
virtual BVariant UpperBound() const;
|
||||
|
||||
private:
|
||||
BVariant fLowerBound;
|
||||
BVariant fUpperBound;
|
||||
BVariant fDefaultValue;
|
||||
};
|
||||
|
||||
|
||||
class RangeSettingImpl : public AbstractSetting, public RangeSetting {
|
||||
public:
|
||||
RangeSettingImpl(const BString& id,
|
||||
const BString& name,
|
||||
const BVariant& lowerBound,
|
||||
const BVariant& upperBound,
|
||||
const BVariant& lowerValue,
|
||||
const BVariant& upperValue);
|
||||
|
||||
virtual BVariant DefaultValue() const;
|
||||
|
||||
virtual BVariant LowerBound() const;
|
||||
virtual BVariant UpperBound() const;
|
||||
virtual BVariant LowerValue() const;
|
||||
virtual BVariant UpperValue() const;
|
||||
|
||||
private:
|
||||
BVariant fLowerBound;
|
||||
BVariant fUpperBound;
|
||||
BVariant fLowerValue;
|
||||
BVariant fUpperValue;
|
||||
};
|
||||
|
||||
|
||||
class RectSettingImpl : public AbstractSetting, public RectSetting {
|
||||
public:
|
||||
RectSettingImpl(const BString& id,
|
||||
const BString& name,
|
||||
const BRect& defaultValue);
|
||||
|
||||
virtual BRect DefaultRectValue() const;
|
||||
|
||||
private:
|
||||
BRect fDefaultValue;
|
||||
};
|
||||
|
||||
|
||||
#endif // SETTING_H
|
||||
@@ -0,0 +1,74 @@
|
||||
/*
|
||||
* Copyright 2013, Rene Gollent, [email protected].
|
||||
* Copyright 2009, Ingo Weinhold, [email protected].
|
||||
* Distributed under the terms of the MIT License.
|
||||
*/
|
||||
#ifndef SETTINGS_H
|
||||
#define SETTINGS_H
|
||||
|
||||
|
||||
#include <Locker.h>
|
||||
#include <Message.h>
|
||||
|
||||
#include <ObjectList.h>
|
||||
#include <Referenceable.h>
|
||||
#include <Variant.h>
|
||||
|
||||
#include "Setting.h"
|
||||
|
||||
|
||||
class SettingsDescription;
|
||||
|
||||
|
||||
class Settings : public BReferenceable {
|
||||
public:
|
||||
class Listener;
|
||||
|
||||
public:
|
||||
Settings(SettingsDescription* description);
|
||||
virtual ~Settings();
|
||||
|
||||
status_t Init();
|
||||
|
||||
bool Lock() { return fLock.Lock(); }
|
||||
void Unlock() { fLock.Unlock(); }
|
||||
|
||||
SettingsDescription* Description() const { return fDescription; }
|
||||
const BMessage& Message() const { return fValues; }
|
||||
|
||||
BVariant Value(Setting* setting) const;
|
||||
BVariant Value(const char* settingID) const;
|
||||
bool SetValue(Setting* setting,
|
||||
const BVariant& value);
|
||||
|
||||
bool RestoreValues(const BMessage& message);
|
||||
|
||||
bool BoolValue(BoolSetting* setting) const
|
||||
{ return Value(setting).ToBool(); }
|
||||
SettingsOption* OptionValue(OptionsSetting* setting) const;
|
||||
BVariant RangeValue(RangeSetting* setting) const
|
||||
{ return Value(setting); }
|
||||
|
||||
bool AddListener(Listener* listener);
|
||||
void RemoveListener(Listener* listener);
|
||||
|
||||
private:
|
||||
typedef BObjectList<Listener> ListenerList;
|
||||
|
||||
private:
|
||||
mutable BLocker fLock;
|
||||
SettingsDescription* fDescription;
|
||||
BMessage fValues;
|
||||
ListenerList fListeners;
|
||||
};
|
||||
|
||||
|
||||
class Settings::Listener {
|
||||
public:
|
||||
virtual ~Listener();
|
||||
|
||||
virtual void SettingValueChanged(Setting* setting) = 0;
|
||||
};
|
||||
|
||||
|
||||
#endif // SETTINGS_H
|
||||
@@ -0,0 +1,35 @@
|
||||
/*
|
||||
* Copyright 2009, Ingo Weinhold, [email protected].
|
||||
* Distributed under the terms of the MIT License.
|
||||
*/
|
||||
#ifndef SETTINGS_DESCRIPTION_H
|
||||
#define SETTINGS_DESCRIPTION_H
|
||||
|
||||
|
||||
#include <ObjectList.h>
|
||||
#include <Referenceable.h>
|
||||
|
||||
|
||||
class Setting;
|
||||
|
||||
|
||||
class SettingsDescription : public BReferenceable {
|
||||
public:
|
||||
SettingsDescription();
|
||||
virtual ~SettingsDescription();
|
||||
|
||||
int32 CountSettings() const;
|
||||
Setting* SettingAt(int32 index) const;
|
||||
Setting* SettingByID(const char* id) const;
|
||||
|
||||
bool AddSetting(Setting* setting);
|
||||
|
||||
private:
|
||||
typedef BObjectList<Setting> SettingsList;
|
||||
|
||||
private:
|
||||
SettingsList fSettings;
|
||||
};
|
||||
|
||||
|
||||
#endif // SETTINGS_DESCRIPTION_H
|
||||
Reference in New Issue
Block a user